import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
import { mapChildren } from '../utils/slice';
export var transformSliceNestedExpandToExpand = function transformSliceNestedExpandToExpand(slice, schema) {
  var _schema$nodes = schema.nodes,
    expand = _schema$nodes.expand,
    nestedExpand = _schema$nodes.nestedExpand;
  var children = [];
  mapChildren(slice.content, function (node) {
    if (node.type === nestedExpand) {
      children.push(expand.createChecked(node.attrs, node.content, node.marks));
    } else {
      children.push(node);
    }
  });
  return new Slice(Fragment.fromArray(children), slice.openStart, slice.openEnd);
};