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

Function Editor

tests/src/utils/components/Editor.tsx:25–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23});
24
25export default function Editor() {
26 const editor = useCreateBlockNote({ schema });
27
28 // Give tests a way to get prosemirror instance
29 (window as WindowWithProseMirror).ProseMirror = editor?._tiptapEditor;
30 // editor.insertBlocks([{
31 // type:""
32 // }])
33 // TODO: how to customize slashmenu
34 return (
35 <BlockNoteView editor={editor}>
36 <BlockNoteDefaultUI slashMenu={false} />
37 <SuggestionMenuController
38 getItems={async (query) =>
39 filterSuggestionItems(
40 [...getDefaultReactSlashMenuItems(editor), insertAlert(editor)],
41 query,
42 )
43 }
44 // suggestionMenuComponent={MantineSuggestionMenu}
45 triggerCharacter="/"
46 />
47 </BlockNoteView>
48 );
49}

Callers

nothing calls this directly

Calls 4

useCreateBlockNoteFunction · 0.90
filterSuggestionItemsFunction · 0.90
insertAlertFunction · 0.50

Tested by

no test coverage detected