import { Element, Editor, Transforms } from "slate";
import { prepareElementForInsertion } from "../utils/prepareElementForInsertion.js";
const overrideInsertNode = (editor) => {
  const { insertNode } = editor;
  editor.insertNode = (node) => {
    if (!Element.isElement(node)) {
      return insertNode(node);
    }
    Editor.withoutNormalizing(editor, () => {
      const preppedPath = prepareElementForInsertion(editor, node);
      Transforms.insertNodes(editor, node, {
        at: preppedPath
      });
    });
  };
};
export { overrideInsertNode };
//# sourceMappingURL=overrideInsertNode.js.map
