@blocknote/core 0.11.2 → 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.
- package/README.md +13 -17
- package/dist/blocknote.js +1600 -1403
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +7 -3
- package/src/api/blockManipulation/blockManipulation.test.ts +19 -15
- package/src/api/blockManipulation/blockManipulation.ts +107 -17
- package/src/api/exporters/html/externalHTMLExporter.ts +3 -7
- package/src/api/exporters/html/htmlConversion.test.ts +6 -3
- package/src/api/exporters/html/internalHTMLSerializer.ts +3 -7
- package/src/api/exporters/html/util/sharedHTMLConversion.ts +3 -3
- package/src/api/exporters/markdown/markdownExporter.test.ts +7 -3
- package/src/api/exporters/markdown/markdownExporter.ts +2 -6
- package/src/api/nodeConversions/nodeConversions.test.ts +14 -7
- package/src/api/nodeConversions/nodeConversions.ts +1 -2
- package/src/api/parsers/html/parseHTML.test.ts +5 -1
- package/src/api/parsers/html/parseHTML.ts +2 -6
- package/src/api/parsers/html/util/nestedLists.ts +11 -1
- package/src/api/parsers/markdown/parseMarkdown.test.ts +3 -0
- package/src/api/parsers/markdown/parseMarkdown.ts +2 -6
- package/src/api/testUtil/cases/customBlocks.ts +18 -16
- package/src/api/testUtil/cases/customInlineContent.ts +12 -13
- package/src/api/testUtil/cases/customStyles.ts +12 -10
- package/src/api/testUtil/index.ts +4 -2
- package/src/api/testUtil/partialBlockTestUtil.ts +2 -6
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +1 -2
- package/src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +8 -1
- package/src/blocks/defaultBlockHelpers.ts +3 -3
- package/src/blocks/defaultBlockTypeGuards.ts +84 -0
- package/src/blocks/defaultBlocks.ts +29 -3
- package/src/editor/Block.css +2 -31
- package/src/editor/BlockNoteEditor.ts +218 -262
- package/src/editor/BlockNoteExtensions.ts +5 -2
- package/src/editor/BlockNoteSchema.ts +98 -0
- package/src/editor/BlockNoteTipTapEditor.ts +162 -0
- package/src/editor/cursorPositionTypes.ts +2 -6
- package/src/editor/editor.css +0 -1
- package/src/editor/selectionTypes.ts +2 -6
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +22 -29
- package/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.ts +26 -27
- package/src/extensions/ImageToolbar/ImageToolbarPlugin.ts +45 -51
- package/src/extensions/Placeholder/PlaceholderExtension.ts +81 -88
- package/src/extensions/SideMenu/SideMenuPlugin.ts +55 -56
- package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +8 -0
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +353 -0
- package/src/extensions/{SlashMenu/defaultSlashMenuItems.ts → SuggestionMenu/getDefaultSlashMenuItems.ts} +119 -89
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +62 -45
- package/src/extensions-shared/UiElementPosition.ts +4 -0
- package/src/index.ts +6 -6
- package/src/pm-nodes/BlockContainer.ts +5 -5
- package/src/schema/blocks/types.ts +15 -15
- package/src/schema/inlineContent/createSpec.ts +2 -2
- package/src/schema/inlineContent/types.ts +1 -1
- package/src/util/browser.ts +6 -4
- package/src/util/typescript.ts +7 -4
- package/types/src/api/blockManipulation/blockManipulation.d.ts +6 -1
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +2 -1
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +2 -1
- package/types/src/api/exporters/markdown/markdownExporter.d.ts +2 -1
- package/types/src/api/nodeConversions/nodeConversions.d.ts +2 -1
- package/types/src/api/parsers/html/parseHTML.d.ts +2 -1
- package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -1
- package/types/src/api/testUtil/cases/customBlocks.d.ts +72 -13
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +281 -6
- package/types/src/api/testUtil/cases/customStyles.d.ts +247 -13
- package/types/src/api/testUtil/index.d.ts +4 -2
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
- package/types/src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +6 -1
- package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
- package/types/src/blocks/defaultBlockTypeGuards.d.ts +24 -0
- package/types/src/blocks/defaultBlocks.d.ts +21 -15
- package/types/src/editor/BlockNoteEditor.d.ts +48 -53
- package/types/src/editor/BlockNoteExtensions.d.ts +1 -0
- package/types/src/editor/BlockNoteSchema.d.ts +34 -0
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +28 -0
- package/types/src/editor/cursorPositionTypes.d.ts +2 -1
- package/types/src/editor/selectionTypes.d.ts +2 -1
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -6
- package/types/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.d.ts +2 -2
- package/types/src/extensions/ImageToolbar/ImageToolbarPlugin.d.ts +15 -14
- package/types/src/extensions/Placeholder/PlaceholderExtension.d.ts +2 -15
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +8 -7
- package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +8 -0
- package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +31 -0
- package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +10 -0
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +7 -7
- package/types/src/extensions-shared/UiElementPosition.d.ts +4 -0
- package/types/src/index.d.ts +6 -6
- package/types/src/pm-nodes/BlockContainer.d.ts +3 -2
- package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
- package/types/src/schema/blocks/types.d.ts +15 -15
- package/types/src/schema/inlineContent/types.d.ts +1 -1
- package/types/src/util/browser.d.ts +1 -0
- package/types/src/util/typescript.d.ts +1 -0
- package/src/extensions/SlashMenu/BaseSlashMenuItem.ts +0 -12
- package/src/extensions/SlashMenu/SlashMenuPlugin.ts +0 -53
- package/src/extensions-shared/BaseUiElementTypes.ts +0 -8
- package/src/extensions-shared/README.md +0 -3
- package/src/extensions-shared/suggestion/SuggestionItem.ts +0 -3
- package/src/extensions-shared/suggestion/SuggestionPlugin.ts +0 -448
- package/types/src/extensions/SlashMenu/BaseSlashMenuItem.d.ts +0 -7
- package/types/src/extensions/SlashMenu/SlashMenuPlugin.d.ts +0 -13
- package/types/src/extensions/SlashMenu/defaultSlashMenuItems.d.ts +0 -3
- package/types/src/extensions-shared/BaseUiElementTypes.d.ts +0 -7
- package/types/src/extensions-shared/suggestion/SuggestionItem.d.ts +0 -3
- package/types/src/extensions-shared/suggestion/SuggestionPlugin.d.ts +0 -36
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-100.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-200.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-300.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-500.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-600.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-700.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-800.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-900.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
- /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
- /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, DefaultInlineContentSchema, DefaultStyleSchema,
|
|
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 {
|
|
11
|
-
import { SlashMenuProsemirrorPlugin } from "../extensions/SlashMenu/SlashMenuPlugin";
|
|
9
|
+
import { SuggestionMenuProseMirrorPlugin } from "../extensions/SuggestionMenu/SuggestionPlugin";
|
|
12
10
|
import { TableHandlesProsemirrorPlugin } from "../extensions/TableHandles/TableHandlesPlugin";
|
|
13
|
-
import {
|
|
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<
|
|
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<
|
|
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:
|
|
73
|
+
readonly _tiptapEditor: BlockNoteTipTapEditor & {
|
|
106
74
|
contentComponent: any;
|
|
107
75
|
};
|
|
108
76
|
blockCache: WeakMap<Node, Block<any, any, any>>;
|
|
109
|
-
readonly
|
|
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
|
|
121
|
-
readonly
|
|
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<
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
|
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
|
-
|
|
13
|
-
|
|
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,
|
|
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 =
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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<
|
|
11
|
+
export declare class ImageToolbarView<I extends InlineContentSchema, S extends StyleSchema> {
|
|
12
12
|
private readonly pluginKey;
|
|
13
13
|
private readonly pmView;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
state?: ImageToolbarState<I, S>;
|
|
15
|
+
emitUpdate: () => void;
|
|
16
16
|
prevWasEditable: boolean | null;
|
|
17
|
-
constructor(pluginKey: PluginKey, pmView: EditorView,
|
|
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
|
|
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<
|
|
30
|
-
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
6
|
-
import {
|
|
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> =
|
|
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
|
|
22
|
-
private
|
|
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,
|
|
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
|
-
|
|
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,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
|
-
|
|
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<
|
|
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<
|
|
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<
|
|
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: () =>
|
|
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: () =>
|
|
73
|
+
unfreezeHandles: () => void;
|
|
74
74
|
}
|
package/types/src/index.d.ts
CHANGED
|
@@ -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/
|
|
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/
|
|
18
|
-
export * from "./extensions/
|
|
19
|
-
export
|
|
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,
|
|
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>;
|