MCPcopy Index your code
hub / github.com/TypeCellOS/BlockNote / insertAlert

Function insertAlert

tests/src/utils/customblocks/Alert.tsx:130–155  ·  view source on GitHub ↗
(editor: BlockNoteEditor<any, any, any>)

Source from the content-addressed store, hash-verified

128);
129
130export const insertAlert = (editor: BlockNoteEditor<any, any, any>) => ({
131 title: "Insert Alert",
132 onItemClick: () => {
133 const block: PartialBlock<
134 BlockSchemaWithBlock<"alert", (typeof Alert)["config"]>,
135 any,
136 any
137 > = {
138 type: "alert",
139 };
140
141 editor.insertBlocks([block], editor.getTextCursorPosition().block, "after");
142 },
143 subtext: "Insert an alert block to emphasize text",
144 icon: <RiAlertFill />,
145 aliases: [
146 "alert",
147 "notification",
148 "emphasize",
149 "warning",
150 "error",
151 "info",
152 "success",
153 ],
154 group: "Other",
155});

Callers 1

EditorFunction · 0.50

Calls 2

insertBlocksMethod · 0.45
getTextCursorPositionMethod · 0.45

Tested by

no test coverage detected