import { Node, Editor } from "slate";
import { isElementWithReference } from "../elements/ElementWithReference.js";
const isPathInReferenceElement = (editor, path) => {
  for (const [node] of Node.levels(editor, path, { reverse: true })) {
    if (isElementWithReference(node)) {
      return true;
    }
    if (Editor.isBlock(editor, node)) {
      break;
    }
  }
  return false;
};
const isInReferenceElement = (editor) => {
  if (!editor.selection) {
    return false;
  }
  return isPathInReferenceElement(editor, editor.selection.focus.path);
};
export { isInReferenceElement };
//# sourceMappingURL=isInReferenceElement.js.map
