"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Slate = require("slate");
const ListItemElement = require("../ListItemElement.cjs");
const index = require("../../../../ContemberEditor/index.cjs");
const normalizeListElement = ({ editor, path, preventDefault }) => {
  for (const [child, childPath] of Slate.Node.children(editor, path)) {
    if (Slate.Element.isElement(child)) {
      if (child.type !== ListItemElement.listItemElementType) {
        index.ContemberEditor.ejectElement(editor, childPath);
        Slate.Transforms.setNodes(editor, { type: ListItemElement.listItemElementType }, { at: childPath });
      }
    } else {
      Slate.Transforms.removeNodes(editor, {
        at: path
      });
      return preventDefault();
    }
  }
};
exports.normalizeListElement = normalizeListElement;
//# sourceMappingURL=normalizeListElement.cjs.map
