import { TextSelection } from "./../../tiptap/pm/state.js";
const replaceNodes = (nodes) => ({ tr, chain }) => {
  const from = tr.selection.from;
  const to = tr.selection.to;
  return nodes.reduce((chain2, node) => chain2.replaceNode(node), chain().focus()).command(({ tr: tr2 }) => {
    tr2.setSelection(TextSelection.create(tr2.doc, from, to));
    return true;
  }).run();
};
export {
  replaceNodes
};
//# sourceMappingURL=replace-nodes.js.map
