Skip to content

ValidationContext

type ValidationContext = {
blockSelection?: Set<string>;
state: EditorState;
supportsDecoration: (blockType) => boolean;
};

Defined in: validation.ts:22

PropertyTypeDescriptionDefined in
blockSelection?Set<string>Block-level selection (set of selected block ids), if any. Present when the user has selected whole blocks via the drag handle / shift- click etc. — separate from the text caret in state.selection. Rules that care about “which block am I operating on?” (notably blockTypeIs) prefer this over state.selection.head.path when non-empty: the toolbar appears for the block selection, so its “active” highlight should reflect those blocks, not whatever block the text caret happened to be parked in before the user clicked the drag handle.validation.ts:37
stateEditorState-validation.ts:23
supportsDecoration(blockType) => boolean-validation.ts:24