import { findParentNodeClosestToPos } from "./../../../tiptap/helpers/index.js";
const NAME = "isChildOfNode";
const isChildOfNodeFn = ({ editorQuery }) => (nodeTypeName) => {
  const selection = editorQuery.editor.view.state.selection;
  const { $from } = selection;
  const parentNode = findParentNodeClosestToPos($from, (node) => node.type.name === nodeTypeName);
  return !!parentNode;
};
const isChildOfNode = { NAME, query: isChildOfNodeFn };
export {
  isChildOfNode
};
//# sourceMappingURL=is-child-of-node.js.map
