"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Slate = require("slate");
const ElementWithReference = require("../elements/ElementWithReference.cjs");
const isPathInReferenceElement = (editor, path) => {
  for (const [node] of Slate.Node.levels(editor, path, { reverse: true })) {
    if (ElementWithReference.isElementWithReference(node)) {
      return true;
    }
    if (Slate.Editor.isBlock(editor, node)) {
      break;
    }
  }
  return false;
};
const isInReferenceElement = (editor) => {
  if (!editor.selection) {
    return false;
  }
  return isPathInReferenceElement(editor, editor.selection.focus.path);
};
exports.isInReferenceElement = isInReferenceElement;
//# sourceMappingURL=isInReferenceElement.cjs.map
