"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Slate = require("slate");
const prepareElementForInsertion = require("../utils/prepareElementForInsertion.cjs");
const overrideInsertNode = (editor) => {
  const { insertNode } = editor;
  editor.insertNode = (node) => {
    if (!Slate.Element.isElement(node)) {
      return insertNode(node);
    }
    Slate.Editor.withoutNormalizing(editor, () => {
      const preppedPath = prepareElementForInsertion.prepareElementForInsertion(editor, node);
      Slate.Transforms.insertNodes(editor, node, {
        at: preppedPath
      });
    });
  };
};
exports.overrideInsertNode = overrideInsertNode;
//# sourceMappingURL=overrideInsertNode.cjs.map
