Files
outline/shared/editor/queries/isInHeading.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

19 lines
461 B
TypeScript

import type { EditorState } from "prosemirror-state";
import { isNodeActive } from "./isNodeActive";
/**
* Returns true if the selection is inside a heading node.
*
* @param state The editor state.
* @returns True if the selection is inside a heading node.
*/
export function isInHeading(state: EditorState): boolean {
const { nodes } = state.schema;
if (nodes.heading && isNodeActive(nodes.heading)(state)) {
return true;
}
return false;
}