import { TIPTAP_CARD_TYPE } from "./../../../ricos-content/index.js";
const NAME = "isNodeSelected";
const isNodeSelectedFn = ({ editorQuery }) => (nodeId) => {
  if (editorQuery.query.isMultipleSelection()) {
    return false;
  }
  const selectedTreeNode = editorQuery.selection().doc?.children?.[0];
  const targetNode = selectedTreeNode?.type() === TIPTAP_CARD_TYPE ? selectedTreeNode.children?.[0] : selectedTreeNode;
  return targetNode?.toNode?.()?.id === nodeId;
};
const isNodeSelected = { NAME, query: isNodeSelectedFn };
export {
  isNodeSelected
};
//# sourceMappingURL=is-node-selected.js.map
