mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* feat: change notice type * Apply suggestions from code review Co-authored-by: Tom Moor <tom.moor@gmail.com> * refactor: change enum naming * fix: notice creation * fix: menu name * refactor: put notice type in the menu label --------- Co-authored-by: Tom Moor <tom.moor@gmail.com>
14 lines
435 B
TypeScript
14 lines
435 B
TypeScript
import { 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);
|
|
}
|