@blocknote/core 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +13 -17
  2. package/dist/blocknote.js +1611 -1408
  3. package/dist/blocknote.js.map +1 -1
  4. package/dist/blocknote.umd.cjs +6 -6
  5. package/dist/blocknote.umd.cjs.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/webpack-stats.json +1 -1
  8. package/package.json +8 -4
  9. package/src/api/blockManipulation/blockManipulation.test.ts +19 -15
  10. package/src/api/blockManipulation/blockManipulation.ts +107 -17
  11. package/src/api/exporters/html/externalHTMLExporter.ts +3 -7
  12. package/src/api/exporters/html/htmlConversion.test.ts +6 -3
  13. package/src/api/exporters/html/internalHTMLSerializer.ts +3 -7
  14. package/src/api/exporters/html/util/sharedHTMLConversion.ts +3 -3
  15. package/src/api/exporters/markdown/markdownExporter.test.ts +7 -3
  16. package/src/api/exporters/markdown/markdownExporter.ts +2 -6
  17. package/src/api/nodeConversions/nodeConversions.test.ts +14 -7
  18. package/src/api/nodeConversions/nodeConversions.ts +1 -2
  19. package/src/api/parsers/html/parseHTML.test.ts +5 -1
  20. package/src/api/parsers/html/parseHTML.ts +2 -6
  21. package/src/api/parsers/html/util/nestedLists.ts +11 -1
  22. package/src/api/parsers/markdown/parseMarkdown.test.ts +3 -0
  23. package/src/api/parsers/markdown/parseMarkdown.ts +2 -6
  24. package/src/api/testUtil/cases/customBlocks.ts +18 -16
  25. package/src/api/testUtil/cases/customInlineContent.ts +12 -13
  26. package/src/api/testUtil/cases/customStyles.ts +12 -10
  27. package/src/api/testUtil/index.ts +4 -2
  28. package/src/api/testUtil/partialBlockTestUtil.ts +2 -6
  29. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +1 -2
  30. package/src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +8 -1
  31. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +13 -0
  32. package/src/blocks/defaultBlockHelpers.ts +3 -3
  33. package/src/blocks/defaultBlockTypeGuards.ts +84 -0
  34. package/src/blocks/defaultBlocks.ts +29 -3
  35. package/src/editor/Block.css +2 -31
  36. package/src/editor/BlockNoteEditor.ts +219 -263
  37. package/src/editor/BlockNoteExtensions.ts +5 -2
  38. package/src/editor/BlockNoteSchema.ts +98 -0
  39. package/src/editor/BlockNoteTipTapEditor.ts +162 -0
  40. package/src/editor/cursorPositionTypes.ts +2 -6
  41. package/src/editor/editor.css +0 -1
  42. package/src/editor/selectionTypes.ts +2 -6
  43. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +22 -29
  44. package/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.ts +26 -27
  45. package/src/extensions/ImageToolbar/ImageToolbarPlugin.ts +45 -51
  46. package/src/extensions/Placeholder/PlaceholderExtension.ts +81 -88
  47. package/src/extensions/SideMenu/SideMenuPlugin.ts +55 -56
  48. package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +8 -0
  49. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +353 -0
  50. package/src/extensions/{SlashMenu/defaultSlashMenuItems.ts → SuggestionMenu/getDefaultSlashMenuItems.ts} +119 -89
  51. package/src/extensions/TableHandles/TableHandlesPlugin.ts +62 -45
  52. package/src/extensions-shared/UiElementPosition.ts +4 -0
  53. package/src/index.ts +6 -6
  54. package/src/pm-nodes/BlockContainer.ts +5 -9
  55. package/src/schema/blocks/types.ts +15 -15
  56. package/src/schema/inlineContent/createSpec.ts +2 -2
  57. package/src/schema/inlineContent/types.ts +1 -1
  58. package/src/util/browser.ts +6 -4
  59. package/src/util/typescript.ts +7 -4
  60. package/types/src/api/blockManipulation/blockManipulation.d.ts +6 -1
  61. package/types/src/api/exporters/html/externalHTMLExporter.d.ts +2 -1
  62. package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +2 -1
  63. package/types/src/api/exporters/markdown/markdownExporter.d.ts +2 -1
  64. package/types/src/api/nodeConversions/nodeConversions.d.ts +2 -1
  65. package/types/src/api/parsers/html/parseHTML.d.ts +2 -1
  66. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -1
  67. package/types/src/api/testUtil/cases/customBlocks.d.ts +72 -13
  68. package/types/src/api/testUtil/cases/customInlineContent.d.ts +281 -6
  69. package/types/src/api/testUtil/cases/customStyles.d.ts +247 -13
  70. package/types/src/api/testUtil/index.d.ts +4 -2
  71. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
  72. package/types/src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +6 -1
  73. package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
  74. package/types/src/blocks/defaultBlockTypeGuards.d.ts +24 -0
  75. package/types/src/blocks/defaultBlocks.d.ts +21 -15
  76. package/types/src/editor/BlockNoteEditor.d.ts +48 -53
  77. package/types/src/editor/BlockNoteExtensions.d.ts +1 -0
  78. package/types/src/editor/BlockNoteSchema.d.ts +34 -0
  79. package/types/src/editor/BlockNoteTipTapEditor.d.ts +28 -0
  80. package/types/src/editor/cursorPositionTypes.d.ts +2 -1
  81. package/types/src/editor/selectionTypes.d.ts +2 -1
  82. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -6
  83. package/types/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.d.ts +2 -2
  84. package/types/src/extensions/ImageToolbar/ImageToolbarPlugin.d.ts +15 -14
  85. package/types/src/extensions/Placeholder/PlaceholderExtension.d.ts +2 -15
  86. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +8 -7
  87. package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +8 -0
  88. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +31 -0
  89. package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +10 -0
  90. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +7 -7
  91. package/types/src/extensions-shared/UiElementPosition.d.ts +4 -0
  92. package/types/src/index.d.ts +6 -6
  93. package/types/src/pm-nodes/BlockContainer.d.ts +3 -2
  94. package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
  95. package/types/src/schema/blocks/types.d.ts +15 -15
  96. package/types/src/schema/inlineContent/types.d.ts +1 -1
  97. package/types/src/util/browser.d.ts +1 -0
  98. package/types/src/util/typescript.d.ts +1 -0
  99. package/src/extensions/SlashMenu/BaseSlashMenuItem.ts +0 -12
  100. package/src/extensions/SlashMenu/SlashMenuPlugin.ts +0 -53
  101. package/src/extensions-shared/BaseUiElementTypes.ts +0 -8
  102. package/src/extensions-shared/README.md +0 -3
  103. package/src/extensions-shared/suggestion/SuggestionItem.ts +0 -3
  104. package/src/extensions-shared/suggestion/SuggestionPlugin.ts +0 -448
  105. package/types/src/extensions/SlashMenu/BaseSlashMenuItem.d.ts +0 -7
  106. package/types/src/extensions/SlashMenu/SlashMenuPlugin.d.ts +0 -13
  107. package/types/src/extensions/SlashMenu/defaultSlashMenuItems.d.ts +0 -3
  108. package/types/src/extensions-shared/BaseUiElementTypes.d.ts +0 -7
  109. package/types/src/extensions-shared/suggestion/SuggestionItem.d.ts +0 -3
  110. package/types/src/extensions-shared/suggestion/SuggestionPlugin.d.ts +0 -36
  111. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-100.woff +0 -0
  112. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
  113. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-200.woff +0 -0
  114. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
  115. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-300.woff +0 -0
  116. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
  117. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-500.woff +0 -0
  118. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
  119. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-600.woff +0 -0
  120. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
  121. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-700.woff +0 -0
  122. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
  123. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-800.woff +0 -0
  124. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
  125. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-900.woff +0 -0
  126. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
  127. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
  128. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
  129. /package/src/{assets/fonts-inter.css → fonts/inter.css} +0 -0
@@ -1,73 +1,41 @@
1
1
  import { EditorOptions } from "@tiptap/core";
2
2
  import { Node } from "prosemirror-model";
3
- import { Editor as TiptapEditor } from "@tiptap/core/dist/packages/core/src/Editor";
4
3
  import * as Y from "yjs";
5
- import { DefaultBlockSchema, defaultBlockSpecs, DefaultInlineContentSchema, defaultInlineContentSpecs, DefaultStyleSchema, defaultStyleSpecs } from "../blocks/defaultBlocks";
4
+ import { Block, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from "../blocks/defaultBlocks";
6
5
  import { FormattingToolbarProsemirrorPlugin } from "../extensions/FormattingToolbar/FormattingToolbarPlugin";
7
6
  import { HyperlinkToolbarProsemirrorPlugin } from "../extensions/HyperlinkToolbar/HyperlinkToolbarPlugin";
8
7
  import { ImageToolbarProsemirrorPlugin } from "../extensions/ImageToolbar/ImageToolbarPlugin";
9
8
  import { SideMenuProsemirrorPlugin } from "../extensions/SideMenu/SideMenuPlugin";
10
- import { BaseSlashMenuItem } from "../extensions/SlashMenu/BaseSlashMenuItem";
11
- import { SlashMenuProsemirrorPlugin } from "../extensions/SlashMenu/SlashMenuPlugin";
9
+ import { SuggestionMenuProseMirrorPlugin } from "../extensions/SuggestionMenu/SuggestionPlugin";
12
10
  import { TableHandlesProsemirrorPlugin } from "../extensions/TableHandles/TableHandlesPlugin";
13
- import { Block, BlockIdentifier, BlockNoteDOMAttributes, BlockSchema, BlockSchemaFromSpecs, BlockSchemaWithBlock, BlockSpecs, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, PartialBlock, Styles, StyleSchema, StyleSchemaFromSpecs, StyleSpecs } from "../schema";
11
+ import { BlockIdentifier, BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, PartialInlineContent, StyleSchema, StyleSpecs, Styles } from "../schema";
12
+ import { NoInfer } from "../util/typescript";
14
13
  import { TextCursorPosition } from "./cursorPositionTypes";
15
14
  import { Selection } from "./selectionTypes";
16
15
  import "./Block.css";
16
+ import { BlockNoteSchema } from "./BlockNoteSchema";
17
+ import { BlockNoteTipTapEditor } from "./BlockNoteTipTapEditor";
17
18
  import "./editor.css";
18
- export type BlockNoteEditorOptions<BSpecs extends BlockSpecs, ISpecs extends InlineContentSpecs, SSpecs extends StyleSpecs> = {
19
+ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> = {
19
20
  enableBlockNoteExtensions: boolean;
20
- /**
21
- *
22
- * (couldn't fix any type, see https://github.com/TypeCellOS/BlockNote/pull/191#discussion_r1210708771)
23
- *
24
- * @default defaultSlashMenuItems from `./extensions/SlashMenu`
25
- */
26
- slashMenuItems: BaseSlashMenuItem<any, any, any>[];
27
- /**
28
- * The HTML element that should be used as the parent element for the editor.
29
- *
30
- * @default: undefined, the editor is not attached to the DOM
31
- */
32
- parentElement: HTMLElement;
21
+ placeholders: Record<string | "default", string>;
33
22
  /**
34
23
  * An object containing attributes that should be added to HTML elements of the editor.
35
24
  *
36
25
  * @example { editor: { class: "my-editor-class" } }
37
26
  */
38
27
  domAttributes: Partial<BlockNoteDOMAttributes>;
39
- /**
40
- * A callback function that runs when the editor is ready to be used.
41
- */
42
- onEditorReady: (editor: BlockNoteEditor<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>) => void;
43
- /**
44
- * A callback function that runs whenever the editor's contents change.
45
- */
46
- onEditorContentChange: (editor: BlockNoteEditor<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>) => void;
47
- /**
48
- * A callback function that runs whenever the text cursor position changes.
49
- */
50
- onTextCursorPositionChange: (editor: BlockNoteEditor<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>) => void;
51
- /**
52
- * Locks the editor from being editable by the user if set to `false`.
53
- */
54
- editable: boolean;
55
28
  /**
56
29
  * The content that should be in the editor when it's created, represented as an array of partial block objects.
57
30
  */
58
- initialContent: PartialBlock<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>[];
31
+ initialContent: PartialBlock<NoInfer<BSchema>, NoInfer<ISchema>, NoInfer<SSchema>>[];
59
32
  /**
60
33
  * Use default BlockNote font and reset the styles of <p> <li> <h1> elements etc., that are used in BlockNote.
61
34
  *
62
35
  * @default true
63
36
  */
64
37
  defaultStyles: boolean;
65
- /**
66
- * A list of block types that should be available in the editor.
67
- */
68
- blockSpecs: BSpecs;
69
- styleSpecs: SSpecs;
70
- inlineContentSpecs: ISpecs;
38
+ schema: BlockNoteSchema<BSchema, ISchema, SSchema>;
71
39
  /**
72
40
  * A custom function to handle file uploads.
73
41
  * @param file The file that should be uploaded.
@@ -102,35 +70,42 @@ export type BlockNoteEditorOptions<BSpecs extends BlockSpecs, ISpecs extends Inl
102
70
  };
103
71
  export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema> {
104
72
  private readonly options;
105
- readonly _tiptapEditor: TiptapEditor & {
73
+ readonly _tiptapEditor: BlockNoteTipTapEditor & {
106
74
  contentComponent: any;
107
75
  };
108
76
  blockCache: WeakMap<Node, Block<any, any, any>>;
109
- readonly blockSchema: BSchema;
110
- readonly inlineContentSchema: ISchema;
111
- readonly styleSchema: SSchema;
77
+ readonly schema: BlockNoteSchema<BSchema, ISchema, SSchema>;
112
78
  readonly blockImplementations: BlockSpecs;
113
79
  readonly inlineContentImplementations: InlineContentSpecs;
114
80
  readonly styleImplementations: StyleSpecs;
115
- ready: boolean;
116
- readonly sideMenu: SideMenuProsemirrorPlugin<BSchema, ISchema, SSchema>;
117
81
  readonly formattingToolbar: FormattingToolbarProsemirrorPlugin;
118
- readonly slashMenu: SlashMenuProsemirrorPlugin<BSchema, ISchema, SSchema, any>;
119
82
  readonly hyperlinkToolbar: HyperlinkToolbarProsemirrorPlugin<BSchema, ISchema, SSchema>;
120
- readonly imageToolbar: ImageToolbarProsemirrorPlugin<BSchema, ISchema, SSchema>;
121
- readonly tableHandles: TableHandlesProsemirrorPlugin<BSchema extends BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]> ? BSchema : any, ISchema, SSchema> | undefined;
83
+ readonly sideMenu: SideMenuProsemirrorPlugin<BSchema, ISchema, SSchema>;
84
+ readonly suggestionMenus: SuggestionMenuProseMirrorPlugin<BSchema, ISchema, SSchema>;
85
+ readonly imageToolbar?: ImageToolbarProsemirrorPlugin<ISchema, SSchema>;
86
+ readonly tableHandles?: TableHandlesProsemirrorPlugin<ISchema, SSchema>;
122
87
  readonly uploadFile: ((file: File) => Promise<string>) | undefined;
123
- static create<BSpecs extends BlockSpecs = typeof defaultBlockSpecs, ISpecs extends InlineContentSpecs = typeof defaultInlineContentSpecs, SSpecs extends StyleSpecs = typeof defaultStyleSpecs>(options?: Partial<BlockNoteEditorOptions<BSpecs, ISpecs, SSpecs>>): BlockNoteEditor<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>;
88
+ static create<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema>(options?: Partial<BlockNoteEditorOptions<BSchema, ISchema, SSchema>>): BlockNoteEditor<BSchema, ISchema, SSchema>;
124
89
  private constructor();
90
+ /**
91
+ * Mount the editor to a parent DOM element. Call mount(undefined) to clean up
92
+ *
93
+ * @warning Not needed for React, use BlockNoteView to take care of this
94
+ */
95
+ mount(parentElement?: HTMLElement | null): void;
125
96
  get prosemirrorView(): import("prosemirror-view").EditorView;
126
97
  get domElement(): HTMLDivElement;
127
98
  isFocused(): boolean;
128
99
  focus(): void;
100
+ /**
101
+ * @deprecated, use `editor.document` instead
102
+ */
103
+ get topLevelBlocks(): Block<BSchema, ISchema, SSchema>[];
129
104
  /**
130
105
  * Gets a snapshot of all top-level (non-nested) blocks in the editor.
131
106
  * @returns A snapshot of all top-level (non-nested) blocks in the editor.
132
107
  */
133
- get topLevelBlocks(): Block<BSchema, ISchema, SSchema>[];
108
+ get document(): Block<BSchema, ISchema, SSchema>[];
134
109
  /**
135
110
  * Gets a snapshot of an existing block from the editor.
136
111
  * @param blockIdentifier The identifier of an existing block that should be retrieved.
@@ -212,6 +187,12 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
212
187
  insertedBlocks: Block<BSchema, ISchema, SSchema>[];
213
188
  removedBlocks: Block<BSchema, ISchema, SSchema>[];
214
189
  };
190
+ /**
191
+ * Insert a piece of content at the current cursor position.
192
+ *
193
+ * @param content can be a string, or array of partial inline content elements
194
+ */
195
+ insertInlineContent(content: PartialInlineContent<ISchema, SSchema>): void;
215
196
  /**
216
197
  * Gets the active text styles at the text cursor position or at the end of the current selection if it's active.
217
198
  */
@@ -298,4 +279,18 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
298
279
  name: string;
299
280
  color: string;
300
281
  }): void;
282
+ /**
283
+ * A callback function that runs whenever the editor's contents change.
284
+ *
285
+ * @param callback The callback to execute.
286
+ * @returns A function to remove the callback.
287
+ */
288
+ onChange(callback: (editor: BlockNoteEditor<BSchema, ISchema, SSchema>) => void): () => void;
289
+ /**
290
+ * A callback function that runs whenever the text cursor position or selection changes.
291
+ *
292
+ * @param callback The callback to execute.
293
+ * @returns A function to remove the callback.
294
+ */
295
+ onSelectionChange(callback: (editor: BlockNoteEditor<BSchema, ISchema, SSchema>) => void): () => void;
301
296
  }
@@ -7,6 +7,7 @@ import { BlockNoteDOMAttributes, BlockSpecs, InlineContentSchema, InlineContentS
7
7
  */
8
8
  export declare const getBlockNoteExtensions: <BSchema extends Record<string, import("../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(opts: {
9
9
  editor: BlockNoteEditor<BSchema, I, S>;
10
+ placeholders?: Record<string, string> | undefined;
10
11
  domAttributes: Partial<BlockNoteDOMAttributes>;
11
12
  blockSchema: BSchema;
12
13
  blockSpecs: BlockSpecs;
@@ -0,0 +1,34 @@
1
+ import { defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "../blocks/defaultBlocks";
2
+ import { BlockSchema, BlockSchemaFromSpecs, BlockSpecs, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, StyleSchema, StyleSchemaFromSpecs, StyleSpecs } from "../schema";
3
+ import type { BlockNoDefaults, PartialBlockNoDefaults } from "../schema/blocks/types";
4
+ import type { BlockNoteEditor } from "./BlockNoteEditor";
5
+ export declare class BlockNoteSchema<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> {
6
+ readonly blockSpecs: BlockSpecs;
7
+ readonly inlineContentSpecs: InlineContentSpecs;
8
+ readonly styleSpecs: StyleSpecs;
9
+ readonly blockSchema: BSchema;
10
+ readonly inlineContentSchema: ISchema;
11
+ readonly styleSchema: SSchema;
12
+ readonly BlockNoteEditor: BlockNoteEditor<BSchema, ISchema, SSchema>;
13
+ readonly Block: BlockNoDefaults<BSchema, ISchema, SSchema>;
14
+ readonly PartialBlock: PartialBlockNoDefaults<BSchema, ISchema, SSchema>;
15
+ static create<BSpecs extends BlockSpecs = typeof defaultBlockSpecs, ISpecs extends InlineContentSpecs = typeof defaultInlineContentSpecs, SSpecs extends StyleSpecs = typeof defaultStyleSpecs>(options?: {
16
+ /**
17
+ * A list of custom block types that should be available in the editor.
18
+ */
19
+ blockSpecs?: BSpecs;
20
+ /**
21
+ * A list of custom InlineContent types that should be available in the editor.
22
+ */
23
+ inlineContentSpecs?: ISpecs;
24
+ /**
25
+ * A list of custom Styles that should be available in the editor.
26
+ */
27
+ styleSpecs?: SSpecs;
28
+ }): BlockNoteSchema<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>;
29
+ constructor(opts?: {
30
+ blockSpecs?: BlockSpecs;
31
+ inlineContentSpecs?: InlineContentSpecs;
32
+ styleSpecs?: StyleSpecs;
33
+ });
34
+ }
@@ -0,0 +1,28 @@
1
+ import { EditorOptions } from "@tiptap/core";
2
+ import { Editor as TiptapEditor } from "@tiptap/core";
3
+ import { EditorState } from "prosemirror-state";
4
+ import { PartialBlock } from "../blocks/defaultBlocks";
5
+ import { StyleSchema } from "../schema";
6
+ export type BlockNoteTipTapEditorOptions = Partial<Omit<EditorOptions, "content">> & {
7
+ content: PartialBlock<any, any, any>[];
8
+ };
9
+ /**
10
+ * Custom Editor class that extends TiptapEditor and separates
11
+ * the creation of the view from the constructor.
12
+ */
13
+ export declare class BlockNoteTipTapEditor extends TiptapEditor {
14
+ private _state;
15
+ constructor(options: BlockNoteTipTapEditorOptions, styleSchema: StyleSchema);
16
+ get state(): EditorState;
17
+ createView(): void;
18
+ /**
19
+ * Replace the default `createView` method with a custom one - which we call on mount
20
+ */
21
+ private createViewAlternative;
22
+ /**
23
+ * Mounts / unmounts the editor to a dom element
24
+ *
25
+ * @param element DOM element to mount to, ur null / undefined to destroy
26
+ */
27
+ mount: (element?: HTMLElement | null) => void;
28
+ }
@@ -1,4 +1,5 @@
1
- import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
1
+ import { Block } from "../blocks/defaultBlocks";
2
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
2
3
  export type TextCursorPosition<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
3
4
  block: Block<BSchema, I, S>;
4
5
  prevBlock: Block<BSchema, I, S> | undefined;
@@ -1,4 +1,5 @@
1
- import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
1
+ import { Block } from "../blocks/defaultBlocks";
2
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
2
3
  export type Selection<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
3
4
  blocks: Block<BSchema, I, S>[];
4
5
  };
@@ -1,16 +1,15 @@
1
1
  import { EditorState, Plugin, PluginKey } from "prosemirror-state";
2
2
  import { EditorView } from "prosemirror-view";
3
3
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
4
- import { BaseUiElementCallbacks, BaseUiElementState } from "../../extensions-shared/BaseUiElementTypes";
4
+ import { UiElementPosition } from "../../extensions-shared/UiElementPosition";
5
5
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
6
6
  import { EventEmitter } from "../../util/EventEmitter";
7
- export type FormattingToolbarCallbacks = BaseUiElementCallbacks;
8
- export type FormattingToolbarState = BaseUiElementState;
7
+ export type FormattingToolbarState = UiElementPosition;
9
8
  export declare class FormattingToolbarView {
10
9
  private readonly editor;
11
10
  private readonly pmView;
12
- private formattingToolbarState?;
13
- updateFormattingToolbar: () => void;
11
+ state?: FormattingToolbarState;
12
+ emitUpdate: () => void;
14
13
  preventHide: boolean;
15
14
  preventShow: boolean;
16
15
  prevWasEditable: boolean | null;
@@ -20,7 +19,7 @@ export declare class FormattingToolbarView {
20
19
  from: number;
21
20
  to: number;
22
21
  }) => boolean;
23
- constructor(editor: BlockNoteEditor<BlockSchema, InlineContentSchema, StyleSchema>, pmView: EditorView, updateFormattingToolbar: (formattingToolbarState: FormattingToolbarState) => void);
22
+ constructor(editor: BlockNoteEditor<BlockSchema, InlineContentSchema, StyleSchema>, pmView: EditorView, emitUpdate: (state: FormattingToolbarState) => void);
24
23
  viewMousedownHandler: () => void;
25
24
  viewMouseupHandler: () => void;
26
25
  dragHandler: () => void;
@@ -1,9 +1,9 @@
1
1
  import { Plugin, PluginKey } from "prosemirror-state";
2
2
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
3
- import { BaseUiElementState } from "../../extensions-shared/BaseUiElementTypes";
4
3
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
4
+ import { UiElementPosition } from "../../extensions-shared/UiElementPosition";
5
5
  import { EventEmitter } from "../../util/EventEmitter";
6
- export type HyperlinkToolbarState = BaseUiElementState & {
6
+ export type HyperlinkToolbarState = UiElementPosition & {
7
7
  url: string;
8
8
  text: string;
9
9
  };
@@ -1,20 +1,20 @@
1
1
  import { EditorState, Plugin, PluginKey } from "prosemirror-state";
2
2
  import { EditorView } from "prosemirror-view";
3
- import { EventEmitter } from "../../util/EventEmitter";
4
3
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
5
- import { BlockSchema, InlineContentSchema, SpecificBlock, StyleSchema } from "../../schema";
6
- import { BaseUiElementCallbacks, BaseUiElementState } from "../../extensions-shared/BaseUiElementTypes";
7
- export type ImageToolbarCallbacks = BaseUiElementCallbacks;
8
- export type ImageToolbarState<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema = StyleSchema> = BaseUiElementState & {
9
- block: SpecificBlock<B, "image", I, S>;
4
+ import type { BlockFromConfig, InlineContentSchema, StyleSchema } from "../../schema";
5
+ import { UiElementPosition } from "../../extensions-shared/UiElementPosition";
6
+ import { EventEmitter } from "../../util/EventEmitter";
7
+ import { DefaultBlockSchema } from "../../blocks/defaultBlocks";
8
+ export type ImageToolbarState<I extends InlineContentSchema, S extends StyleSchema> = UiElementPosition & {
9
+ block: BlockFromConfig<DefaultBlockSchema["image"], I, S>;
10
10
  };
11
- export declare class ImageToolbarView<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> {
11
+ export declare class ImageToolbarView<I extends InlineContentSchema, S extends StyleSchema> {
12
12
  private readonly pluginKey;
13
13
  private readonly pmView;
14
- private imageToolbarState?;
15
- updateImageToolbar: () => void;
14
+ state?: ImageToolbarState<I, S>;
15
+ emitUpdate: () => void;
16
16
  prevWasEditable: boolean | null;
17
- constructor(pluginKey: PluginKey, pmView: EditorView, updateImageToolbar: (imageToolbarState: ImageToolbarState<BSchema, I, S>) => void);
17
+ constructor(pluginKey: PluginKey, pmView: EditorView, emitUpdate: (state: ImageToolbarState<I, S>) => void);
18
18
  mouseDownHandler: () => void;
19
19
  dragstartHandler: () => void;
20
20
  blurHandler: (event: FocusEvent) => void;
@@ -22,10 +22,11 @@ export declare class ImageToolbarView<BSchema extends BlockSchema, I extends Inl
22
22
  update(view: EditorView, prevState: EditorState): void;
23
23
  destroy(): void;
24
24
  }
25
- export declare const imageToolbarPluginKey: PluginKey<any>;
26
- export declare class ImageToolbarProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
25
+ export declare class ImageToolbarProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
27
26
  private view;
28
27
  readonly plugin: Plugin;
29
- constructor(_editor: BlockNoteEditor<BSchema, I, S>);
30
- onUpdate(callback: (state: ImageToolbarState<BSchema, I, S>) => void): () => void;
28
+ constructor(_editor: BlockNoteEditor<{
29
+ image: DefaultBlockSchema["image"];
30
+ }, I, S>);
31
+ onUpdate(callback: (state: ImageToolbarState<I, S>) => void): () => void;
31
32
  }
@@ -1,5 +1,4 @@
1
- import { Editor, Extension } from "@tiptap/core";
2
- import { Node as ProsemirrorNode } from "prosemirror-model";
1
+ import { Extension } from "@tiptap/core";
3
2
  /**
4
3
  * This is a modified version of the tiptap
5
4
  * placeholder plugin, that also sets hasAnchorClass
@@ -8,18 +7,6 @@ import { Node as ProsemirrorNode } from "prosemirror-model";
8
7
  *
9
8
  */
10
9
  export interface PlaceholderOptions {
11
- emptyEditorClass: string;
12
- emptyNodeClass: string;
13
- isFilterClass: string;
14
- hasAnchorClass: string;
15
- placeholder: ((PlaceholderProps: {
16
- editor: Editor;
17
- node: ProsemirrorNode;
18
- pos: number;
19
- hasAnchor: boolean;
20
- }) => string) | string;
21
- showOnlyWhenEditable: boolean;
22
- showOnlyCurrent: boolean;
23
- includeChildren: boolean;
10
+ placeholders: Record<string | "default", string>;
24
11
  }
25
12
  export declare const Placeholder: Extension<PlaceholderOptions, any>;
@@ -1,11 +1,12 @@
1
1
  import { PluginView } from "@tiptap/pm/state";
2
2
  import { Plugin, PluginKey } from "prosemirror-state";
3
3
  import { EditorView } from "prosemirror-view";
4
+ import { Block } from "../../blocks/defaultBlocks";
4
5
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
5
- import { BaseUiElementState } from "../../extensions-shared/BaseUiElementTypes";
6
- import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
6
+ import { UiElementPosition } from "../../extensions-shared/UiElementPosition";
7
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
7
8
  import { EventEmitter } from "../../util/EventEmitter";
8
- export type SideMenuState<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = BaseUiElementState & {
9
+ export type SideMenuState<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = UiElementPosition & {
9
10
  block: Block<BSchema, I, S>;
10
11
  };
11
12
  export declare function getDraggableBlockFromCoords(coords: {
@@ -18,14 +19,14 @@ export declare function getDraggableBlockFromCoords(coords: {
18
19
  export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> implements PluginView {
19
20
  private readonly editor;
20
21
  private readonly pmView;
21
- private readonly updateSideMenu;
22
- private sideMenuState?;
22
+ private state?;
23
+ private readonly emitUpdate;
23
24
  private horizontalPosAnchoredAtRoot;
24
25
  private horizontalPosAnchor;
25
26
  private hoveredBlock;
26
27
  isDragging: boolean;
27
28
  menuFrozen: boolean;
28
- constructor(editor: BlockNoteEditor<BSchema, I, S>, pmView: EditorView, updateSideMenu: (sideMenuState: SideMenuState<BSchema, I, S>) => void);
29
+ constructor(editor: BlockNoteEditor<BSchema, I, S>, pmView: EditorView, emitUpdate: (state: SideMenuState<BSchema, I, S>) => void);
29
30
  /**
30
31
  * Sets isDragging when dragging text.
31
32
  */
@@ -52,7 +53,7 @@ export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineC
52
53
  export declare const sideMenuPluginKey: PluginKey<any>;
53
54
  export declare class SideMenuProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
54
55
  private readonly editor;
55
- private sideMenuView;
56
+ view: SideMenuView<BSchema, I, S> | undefined;
56
57
  readonly plugin: Plugin;
57
58
  constructor(editor: BlockNoteEditor<BSchema, I, S>);
58
59
  onUpdate(callback: (state: SideMenuState<BSchema, I, S>) => void): () => void;
@@ -0,0 +1,8 @@
1
+ export type DefaultSuggestionItem = {
2
+ title: string;
3
+ onItemClick: () => void;
4
+ subtext?: string;
5
+ badge?: string;
6
+ aliases?: string[];
7
+ group?: string;
8
+ };
@@ -0,0 +1,31 @@
1
+ import { Plugin, PluginKey } from "prosemirror-state";
2
+ import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
3
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
4
+ import { UiElementPosition } from "../../extensions-shared/UiElementPosition";
5
+ import { EventEmitter } from "../../util/EventEmitter";
6
+ export type SuggestionMenuState = UiElementPosition & {
7
+ query: string;
8
+ };
9
+ export declare const suggestionMenuPluginKey: PluginKey<any>;
10
+ /**
11
+ * A ProseMirror plugin for suggestions, designed to make '/'-commands possible as well as mentions.
12
+ *
13
+ * This is basically a simplified version of TipTap's [Suggestions](https://github.com/ueberdosis/tiptap/tree/db92a9b313c5993b723c85cd30256f1d4a0b65e1/packages/suggestion) plugin.
14
+ *
15
+ * This version is adapted from the aforementioned version in the following ways:
16
+ * - This version supports generic items instead of only strings (to allow for more advanced filtering for example)
17
+ * - This version hides some unnecessary complexity from the user of the plugin.
18
+ * - This version handles key events differently
19
+ */
20
+ export declare class SuggestionMenuProseMirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
21
+ private view;
22
+ readonly plugin: Plugin;
23
+ private triggerCharacters;
24
+ constructor(editor: BlockNoteEditor<BSchema, I, S>);
25
+ onUpdate(triggerCharacter: string, callback: (state: SuggestionMenuState) => void): () => void;
26
+ addTriggerCharacter: (triggerCharacter: string) => void;
27
+ removeTriggerCharacter: (triggerCharacter: string) => void;
28
+ closeMenu: () => void;
29
+ clearQuery: () => void;
30
+ }
31
+ export declare function createSuggestionMenu<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, triggerCharacter: string): void;
@@ -0,0 +1,10 @@
1
+ import { Block, PartialBlock } from "../../blocks/defaultBlocks";
2
+ import { BlockNoteEditor } from "../../editor/BlockNoteEditor";
3
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
4
+ import { DefaultSuggestionItem } from "./DefaultSuggestionItem";
5
+ export declare function insertOrUpdateBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, block: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
6
+ export declare function getDefaultSlashMenuItems<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>): DefaultSuggestionItem[];
7
+ export declare function filterSuggestionItems<T extends {
8
+ title: string;
9
+ aliases?: readonly string[];
10
+ }>(items: T[], query: string): T[];
@@ -1,9 +1,9 @@
1
1
  import { Plugin, PluginKey, PluginView } from "prosemirror-state";
2
2
  import { EditorView } from "prosemirror-view";
3
- import { EventEmitter } from "../../util/EventEmitter";
4
3
  import { DefaultBlockSchema } from "../../blocks/defaultBlocks";
5
4
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
6
5
  import { BlockFromConfigNoChildren, BlockSchemaWithBlock, InlineContentSchema, StyleSchema } from "../../schema";
6
+ import { EventEmitter } from "../../util/EventEmitter";
7
7
  export type TableHandlesState<I extends InlineContentSchema, S extends StyleSchema> = {
8
8
  show: boolean;
9
9
  referencePosCell: DOMRect;
@@ -21,12 +21,12 @@ export declare class TableHandlesView<BSchema extends BlockSchemaWithBlock<"tabl
21
21
  private readonly editor;
22
22
  private readonly pmView;
23
23
  state?: TableHandlesState<I, S>;
24
- updateState: () => void;
24
+ emitUpdate: () => void;
25
25
  tableId: string | undefined;
26
26
  tablePos: number | undefined;
27
27
  menuFrozen: boolean;
28
28
  prevWasEditable: boolean | null;
29
- constructor(editor: BlockNoteEditor<BSchema, I, S>, pmView: EditorView, updateState: (state: TableHandlesState<I, S>) => void);
29
+ constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, I, S>, pmView: EditorView, emitUpdate: (state: TableHandlesState<I, S>) => void);
30
30
  mouseMoveHandler: (event: MouseEvent) => false | undefined;
31
31
  dragOverHandler: (event: DragEvent) => void;
32
32
  dropHandler: (event: DragEvent) => void;
@@ -34,11 +34,11 @@ export declare class TableHandlesView<BSchema extends BlockSchemaWithBlock<"tabl
34
34
  destroy(): void;
35
35
  }
36
36
  export declare const tableHandlesPluginKey: PluginKey<any>;
37
- export declare class TableHandlesProsemirrorPlugin<BSchema extends BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
37
+ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
38
38
  private readonly editor;
39
39
  private view;
40
40
  readonly plugin: Plugin;
41
- constructor(editor: BlockNoteEditor<BSchema, I, S>);
41
+ constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, I, S>);
42
42
  onUpdate(callback: (state: TableHandlesState<I, S>) => void): () => void;
43
43
  /**
44
44
  * Callback that should be set on the `dragStart` event for whichever element
@@ -65,10 +65,10 @@ export declare class TableHandlesProsemirrorPlugin<BSchema extends BlockSchemaWi
65
65
  * Freezes the drag handles. When frozen, they will stay attached to the same
66
66
  * cell regardless of which cell is hovered by the mouse cursor.
67
67
  */
68
- freezeHandles: () => boolean;
68
+ freezeHandles: () => void;
69
69
  /**
70
70
  * Unfreezes the drag handles. When frozen, they will stay attached to the
71
71
  * same cell regardless of which cell is hovered by the mouse cursor.
72
72
  */
73
- unfreezeHandles: () => boolean;
73
+ unfreezeHandles: () => void;
74
74
  }
@@ -0,0 +1,4 @@
1
+ export type UiElementPosition = {
2
+ show: boolean;
3
+ referencePos: DOMRect;
4
+ };
@@ -2,21 +2,21 @@ export * from "./api/exporters/html/externalHTMLExporter";
2
2
  export * from "./api/exporters/html/internalHTMLSerializer";
3
3
  export * from "./api/testUtil";
4
4
  export * from "./blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY";
5
+ export * from "./blocks/defaultBlockTypeGuards";
5
6
  export * from "./blocks/defaultBlocks";
6
7
  export * from "./blocks/defaultProps";
7
8
  export * from "./editor/BlockNoteEditor";
8
9
  export * from "./editor/BlockNoteExtensions";
10
+ export * from "./editor/BlockNoteSchema";
9
11
  export * from "./editor/selectionTypes";
10
- export * from "./extensions-shared/BaseUiElementTypes";
11
- export type { SuggestionItem } from "./extensions-shared/suggestion/SuggestionItem";
12
- export * from "./extensions-shared/suggestion/SuggestionPlugin";
12
+ export * from "./extensions-shared/UiElementPosition";
13
13
  export * from "./extensions/FormattingToolbar/FormattingToolbarPlugin";
14
14
  export * from "./extensions/HyperlinkToolbar/HyperlinkToolbarPlugin";
15
15
  export * from "./extensions/ImageToolbar/ImageToolbarPlugin";
16
16
  export * from "./extensions/SideMenu/SideMenuPlugin";
17
- export * from "./extensions/SlashMenu/BaseSlashMenuItem";
18
- export * from "./extensions/SlashMenu/SlashMenuPlugin";
19
- export { getDefaultSlashMenuItems } from "./extensions/SlashMenu/defaultSlashMenuItems";
17
+ export * from "./extensions/SuggestionMenu/DefaultSuggestionItem";
18
+ export * from "./extensions/SuggestionMenu/SuggestionPlugin";
19
+ export * from "./extensions/SuggestionMenu/getDefaultSlashMenuItems";
20
20
  export * from "./extensions/TableHandles/TableHandlesPlugin";
21
21
  export * from "./schema";
22
22
  export * from "./util/browser";
@@ -1,6 +1,7 @@
1
1
  import { Node } from "@tiptap/core";
2
+ import { PartialBlock } from "../blocks/defaultBlocks";
2
3
  import type { BlockNoteEditor } from "../editor/BlockNoteEditor";
3
- import { BlockSchema, InlineContentSchema, PartialBlock, StyleSchema } from "../schema";
4
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
4
5
  declare module "@tiptap/core" {
5
6
  interface Commands<ReturnType> {
6
7
  block: {
@@ -18,8 +19,8 @@ declare module "@tiptap/core" {
18
19
  */
19
20
  export declare const BlockContainer: Node<{
20
21
  domAttributes?: Partial<{
21
- blockContainer: Record<string, string>;
22
22
  blockGroup: Record<string, string>;
23
+ block: Record<string, string>;
23
24
  editor: Record<string, string>;
24
25
  blockContent: Record<string, string>;
25
26
  inlineContent: Record<string, string>;
@@ -1,8 +1,8 @@
1
1
  import { Node } from "@tiptap/core";
2
2
  export declare const BlockGroup: Node<{
3
3
  domAttributes?: Partial<{
4
- blockContainer: Record<string, string>;
5
4
  blockGroup: Record<string, string>;
5
+ block: Record<string, string>;
6
6
  editor: Record<string, string>;
7
7
  blockContent: Record<string, string>;
8
8
  inlineContent: Record<string, string>;