import { Node, Element, Transforms } from "slate";
import { listItemElementType } from "../ListItemElement.js";
import { ContemberEditor } from "../../../../ContemberEditor/index.js";
const normalizeListElement = ({ editor, path, preventDefault }) => {
  for (const [child, childPath] of Node.children(editor, path)) {
    if (Element.isElement(child)) {
      if (child.type !== listItemElementType) {
        ContemberEditor.ejectElement(editor, childPath);
        Transforms.setNodes(editor, { type: listItemElementType }, { at: childPath });
      }
    } else {
      Transforms.removeNodes(editor, {
        at: path
      });
      return preventDefault();
    }
  }
};
export { normalizeListElement };
//# sourceMappingURL=normalizeListElement.js.map
