import { Editor } from "slate";
import { Slate } from "@makeswift/controls";
const EditorUtils = {
  getFirstAncestorList(editor, path) {
    try {
      const parentList = Editor.above(editor, {
        at: path,
        match: Slate.isList
      });
      return parentList ?? null;
    } catch (e) {
      return null;
    }
  },
  getFirstAncestorListItem(editor, path) {
    try {
      const parentListItem = Editor.above(editor, {
        at: path,
        match: Slate.isListItem
      });
      return parentListItem ?? null;
    } catch (e) {
      return null;
    }
  }
};
export {
  EditorUtils
};
//# sourceMappingURL=editor.js.map