|
4 | 4 | inlineContentToNodes,
|
5 | 5 | nodeToCustomInlineContent,
|
6 | 6 | } from "../../api/nodeConversions/nodeConversions";
|
| 7 | +import type { BlockNoteEditor } from "../../editor/BlockNoteEditor"; |
7 | 8 | import { propsToAttributes } from "../blocks/internal";
|
8 | 9 | import { Props } from "../propTypes";
|
9 | 10 | import { StyleSchema } from "../styles/types";
|
@@ -34,13 +35,13 @@ export type CustomInlineContentImplementation<
|
34 | 35 | inlineContent: InlineContentFromConfig<T, S>,
|
35 | 36 | updateInlineContent: (
|
36 | 37 | update: PartialCustomInlineContentFromConfig<T, S>
|
37 |
| - ) => void |
| 38 | + ) => void, |
38 | 39 | /**
|
39 | 40 | * The BlockNote editor instance
|
40 | 41 | * This is typed generically. If you want an editor with your custom schema, you need to
|
41 | 42 | * cast it manually, e.g.: `const e = editor as BlockNoteEditor<typeof mySchema>;`
|
42 | 43 | */
|
43 |
| - // editor: BlockNoteEditor<B, I, S> |
| 44 | + editor: BlockNoteEditor<any, any, S> |
44 | 45 | // (note) if we want to fix the manual cast, we need to prevent circular references and separate block definition and render implementations
|
45 | 46 | // or allow manually passing <BSchema>, but that's not possible without passing the other generics because Typescript doesn't support partial inferred generics
|
46 | 47 | ) => {
|
@@ -109,7 +110,8 @@ export function createInlineContentSpec<
|
109 | 110 | ) as any as InlineContentFromConfig<T, S>, // TODO: fix cast
|
110 | 111 | () => {
|
111 | 112 | // No-op
|
112 |
| - } |
| 113 | + }, |
| 114 | + editor |
113 | 115 | );
|
114 | 116 |
|
115 | 117 | return addInlineContentAttributes(
|
@@ -148,7 +150,8 @@ export function createInlineContentSpec<
|
148 | 150 | content
|
149 | 151 | )
|
150 | 152 | );
|
151 |
| - } |
| 153 | + }, |
| 154 | + editor |
152 | 155 | );
|
153 | 156 |
|
154 | 157 | return addInlineContentAttributes(
|
|
0 commit comments