mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
14 lines
440 B
TypeScript
14 lines
440 B
TypeScript
import type { EditorState } from "prosemirror-state";
|
|
import { isNodeActive } from "./isNodeActive";
|
|
|
|
/**
|
|
* Returns true if the selection is inside a notice block.
|
|
*
|
|
* @param state The editor state.
|
|
* @returns True if the selection is inside a notice block.
|
|
*/
|
|
export function isInNotice(state: EditorState): boolean {
|
|
const { nodes } = state.schema;
|
|
return nodes.container_notice && isNodeActive(nodes.container_notice)(state);
|
|
}
|