@blocknote/core 0.30.1 → 0.31.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/dist/blocknote.cjs +9 -9
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +2754 -2230
- package/dist/blocknote.js.map +1 -1
- package/dist/{en-D4taoCs4.cjs → en-BXVKCwYt.cjs} +2 -2
- package/dist/en-BXVKCwYt.cjs.map +1 -0
- package/dist/{en-B7ycW7c8.js → en-qGo6sk9V.js} +2 -3
- package/dist/en-qGo6sk9V.js.map +1 -0
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +20 -39
- package/dist/locales.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -5
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -3
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +1 -1
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2816 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +158 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +87 -17
- package/src/api/blockManipulation/selections/selection.ts +48 -1
- package/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.ts → textCursorPosition.ts} +7 -7
- package/src/api/getBlockInfoFromPos.ts +1 -1
- package/src/api/nodeConversions/blockToNode.ts +5 -2
- package/src/api/nodeConversions/nodeToBlock.ts +203 -8
- package/src/api/pmUtil.ts +3 -3
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +6 -6
- package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +1 -1
- package/src/blocks/TableBlockContent/TableBlockContent.ts +32 -2
- package/src/editor/Block.css +27 -1
- package/src/editor/BlockNoteEditor.test.ts +7 -0
- package/src/editor/BlockNoteEditor.ts +88 -37
- package/src/editor/BlockNoteExtension.ts +26 -0
- package/src/editor/BlockNoteExtensions.ts +28 -12
- package/src/editor/BlockNoteTipTapEditor.ts +23 -2
- package/src/extensions/Collaboration/CursorPlugin.ts +13 -7
- package/src/extensions/Collaboration/ForkYDocPlugin.test.ts +166 -0
- package/src/extensions/Collaboration/ForkYDocPlugin.ts +174 -0
- package/src/extensions/Collaboration/SyncPlugin.ts +7 -4
- package/src/extensions/Collaboration/UndoPlugin.ts +7 -4
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +30 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +30 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -0
- package/src/extensions/Comments/CommentsPlugin.ts +75 -70
- package/src/extensions/FilePanel/FilePanelPlugin.ts +50 -49
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +56 -26
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +22 -21
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +111 -108
- package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +179 -170
- package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +22 -19
- package/src/extensions/SideMenu/SideMenuPlugin.ts +19 -18
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +168 -168
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -4
- package/src/extensions/Suggestions/SuggestionMarks.ts +175 -0
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +153 -150
- package/src/i18n/locales/ar.ts +0 -1
- package/src/i18n/locales/de.ts +0 -1
- package/src/i18n/locales/en.ts +0 -1
- package/src/i18n/locales/es.ts +0 -1
- package/src/i18n/locales/fr.ts +0 -1
- package/src/i18n/locales/hr.ts +0 -1
- package/src/i18n/locales/is.ts +0 -1
- package/src/i18n/locales/it.ts +0 -1
- package/src/i18n/locales/ja.ts +0 -1
- package/src/i18n/locales/ko.ts +0 -1
- package/src/i18n/locales/nl.ts +0 -1
- package/src/i18n/locales/no.ts +0 -1
- package/src/i18n/locales/pl.ts +0 -1
- package/src/i18n/locales/pt.ts +0 -1
- package/src/i18n/locales/ru.ts +0 -1
- package/src/i18n/locales/sk.ts +0 -1
- package/src/i18n/locales/uk.ts +0 -1
- package/src/i18n/locales/vi.ts +0 -1
- package/src/i18n/locales/zh-tw.ts +0 -1
- package/src/i18n/locales/zh.ts +0 -1
- package/src/index.ts +18 -8
- package/src/pm-nodes/BlockContainer.ts +1 -1
- package/src/pm-nodes/BlockGroup.ts +1 -1
- package/src/pm-nodes/Doc.ts +1 -0
- package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +1 -1
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +4 -0
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +3 -1
- package/types/src/api/blockManipulation/selections/selection.d.ts +10 -0
- package/types/src/api/blockManipulation/selections/textCursorPosition.d.ts +5 -0
- package/types/src/api/blockManipulation/transactions.test.d.ts +0 -0
- package/types/src/api/clipboard/clipboardExternal.test.d.ts +1 -0
- package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
- package/types/src/api/clipboard/testUtil.d.ts +541 -0
- package/types/src/api/exporters/html/htmlConversion.test.d.ts +1 -0
- package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +1 -0
- package/types/src/api/nodeConversions/nodeConversions.test.d.ts +1 -0
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +39 -2
- package/types/src/api/parsers/html/parseHTML.test.d.ts +1 -0
- package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +1 -0
- package/types/src/api/pmUtil.d.ts +3 -3
- package/types/src/api/testUtil/cases/customBlocks.d.ts +670 -0
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +558 -0
- package/types/src/api/testUtil/cases/customStyles.d.ts +552 -0
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +4 -0
- package/types/src/api/testUtil/index.d.ts +14 -0
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +9 -0
- package/types/src/api/testUtil/paste.d.ts +2 -0
- package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +6 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +9 -1
- package/types/src/editor/BlockNoteEditor.d.ts +55 -9
- package/types/src/editor/BlockNoteExtension.d.ts +9 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
- package/types/src/extensions/Collaboration/CursorPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +41 -0
- package/types/src/extensions/Collaboration/ForkYDocPlugin.test.d.ts +1 -0
- package/types/src/extensions/Collaboration/SyncPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/UndoPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +17 -0
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +2 -4
- package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +3 -4
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -5
- package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +3 -4
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -3
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +2 -3
- package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +2 -3
- package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +2 -3
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +3 -4
- package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +2 -4
- package/types/src/extensions/Suggestions/SuggestionMarks.d.ts +4 -0
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +5 -6
- package/types/src/i18n/locales/en.d.ts +0 -1
- package/types/src/i18n/locales/sk.d.ts +0 -1
- package/types/src/index.d.ts +15 -8
- package/dist/en-B7ycW7c8.js.map +0 -1
- package/dist/en-D4taoCs4.cjs.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +0 -844
- package/src/api/blockManipulation/selections/selection.test.ts +0 -72
- package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +0 -316
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +0 -74
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import { BlockNoteSchema } from "../../editor/BlockNoteSchema.js";
|
|
2
|
+
export declare const schema: BlockNoteSchema<import("../../index.js").BlockSchemaFromSpecs<{
|
|
3
|
+
customParagraph: any;
|
|
4
|
+
paragraph: {
|
|
5
|
+
config: {
|
|
6
|
+
type: "paragraph";
|
|
7
|
+
content: "inline";
|
|
8
|
+
propSchema: {
|
|
9
|
+
backgroundColor: {
|
|
10
|
+
default: "default";
|
|
11
|
+
};
|
|
12
|
+
textColor: {
|
|
13
|
+
default: "default";
|
|
14
|
+
};
|
|
15
|
+
textAlignment: {
|
|
16
|
+
default: "left";
|
|
17
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
22
|
+
type: "paragraph";
|
|
23
|
+
content: "inline";
|
|
24
|
+
propSchema: {
|
|
25
|
+
backgroundColor: {
|
|
26
|
+
default: "default";
|
|
27
|
+
};
|
|
28
|
+
textColor: {
|
|
29
|
+
default: "default";
|
|
30
|
+
};
|
|
31
|
+
textAlignment: {
|
|
32
|
+
default: "left";
|
|
33
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
37
|
+
};
|
|
38
|
+
heading: {
|
|
39
|
+
config: {
|
|
40
|
+
type: "heading";
|
|
41
|
+
content: "inline";
|
|
42
|
+
propSchema: {
|
|
43
|
+
level: {
|
|
44
|
+
default: number;
|
|
45
|
+
values: readonly [1, 2, 3];
|
|
46
|
+
};
|
|
47
|
+
backgroundColor: {
|
|
48
|
+
default: "default";
|
|
49
|
+
};
|
|
50
|
+
textColor: {
|
|
51
|
+
default: "default";
|
|
52
|
+
};
|
|
53
|
+
textAlignment: {
|
|
54
|
+
default: "left";
|
|
55
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
60
|
+
type: "heading";
|
|
61
|
+
content: "inline";
|
|
62
|
+
propSchema: {
|
|
63
|
+
level: {
|
|
64
|
+
default: number;
|
|
65
|
+
values: readonly [1, 2, 3];
|
|
66
|
+
};
|
|
67
|
+
backgroundColor: {
|
|
68
|
+
default: "default";
|
|
69
|
+
};
|
|
70
|
+
textColor: {
|
|
71
|
+
default: "default";
|
|
72
|
+
};
|
|
73
|
+
textAlignment: {
|
|
74
|
+
default: "left";
|
|
75
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
79
|
+
};
|
|
80
|
+
quote: {
|
|
81
|
+
config: {
|
|
82
|
+
type: "quote";
|
|
83
|
+
content: "inline";
|
|
84
|
+
propSchema: {
|
|
85
|
+
backgroundColor: {
|
|
86
|
+
default: "default";
|
|
87
|
+
};
|
|
88
|
+
textColor: {
|
|
89
|
+
default: "default";
|
|
90
|
+
};
|
|
91
|
+
textAlignment: {
|
|
92
|
+
default: "left";
|
|
93
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
98
|
+
type: "quote";
|
|
99
|
+
content: "inline";
|
|
100
|
+
propSchema: {
|
|
101
|
+
backgroundColor: {
|
|
102
|
+
default: "default";
|
|
103
|
+
};
|
|
104
|
+
textColor: {
|
|
105
|
+
default: "default";
|
|
106
|
+
};
|
|
107
|
+
textAlignment: {
|
|
108
|
+
default: "left";
|
|
109
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
113
|
+
};
|
|
114
|
+
codeBlock: {
|
|
115
|
+
config: {
|
|
116
|
+
type: "codeBlock";
|
|
117
|
+
content: "inline";
|
|
118
|
+
propSchema: {
|
|
119
|
+
language: {
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
125
|
+
type: "codeBlock";
|
|
126
|
+
content: "inline";
|
|
127
|
+
propSchema: {
|
|
128
|
+
language: {
|
|
129
|
+
default: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
133
|
+
};
|
|
134
|
+
bulletListItem: {
|
|
135
|
+
config: {
|
|
136
|
+
type: "bulletListItem";
|
|
137
|
+
content: "inline";
|
|
138
|
+
propSchema: {
|
|
139
|
+
backgroundColor: {
|
|
140
|
+
default: "default";
|
|
141
|
+
};
|
|
142
|
+
textColor: {
|
|
143
|
+
default: "default";
|
|
144
|
+
};
|
|
145
|
+
textAlignment: {
|
|
146
|
+
default: "left";
|
|
147
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
152
|
+
type: "bulletListItem";
|
|
153
|
+
content: "inline";
|
|
154
|
+
propSchema: {
|
|
155
|
+
backgroundColor: {
|
|
156
|
+
default: "default";
|
|
157
|
+
};
|
|
158
|
+
textColor: {
|
|
159
|
+
default: "default";
|
|
160
|
+
};
|
|
161
|
+
textAlignment: {
|
|
162
|
+
default: "left";
|
|
163
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
167
|
+
};
|
|
168
|
+
numberedListItem: {
|
|
169
|
+
config: {
|
|
170
|
+
type: "numberedListItem";
|
|
171
|
+
content: "inline";
|
|
172
|
+
propSchema: {
|
|
173
|
+
start: {
|
|
174
|
+
default: undefined;
|
|
175
|
+
type: "number";
|
|
176
|
+
};
|
|
177
|
+
backgroundColor: {
|
|
178
|
+
default: "default";
|
|
179
|
+
};
|
|
180
|
+
textColor: {
|
|
181
|
+
default: "default";
|
|
182
|
+
};
|
|
183
|
+
textAlignment: {
|
|
184
|
+
default: "left";
|
|
185
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
190
|
+
type: "numberedListItem";
|
|
191
|
+
content: "inline";
|
|
192
|
+
propSchema: {
|
|
193
|
+
start: {
|
|
194
|
+
default: undefined;
|
|
195
|
+
type: "number";
|
|
196
|
+
};
|
|
197
|
+
backgroundColor: {
|
|
198
|
+
default: "default";
|
|
199
|
+
};
|
|
200
|
+
textColor: {
|
|
201
|
+
default: "default";
|
|
202
|
+
};
|
|
203
|
+
textAlignment: {
|
|
204
|
+
default: "left";
|
|
205
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
209
|
+
};
|
|
210
|
+
checkListItem: {
|
|
211
|
+
config: {
|
|
212
|
+
type: "checkListItem";
|
|
213
|
+
content: "inline";
|
|
214
|
+
propSchema: {
|
|
215
|
+
checked: {
|
|
216
|
+
default: false;
|
|
217
|
+
};
|
|
218
|
+
backgroundColor: {
|
|
219
|
+
default: "default";
|
|
220
|
+
};
|
|
221
|
+
textColor: {
|
|
222
|
+
default: "default";
|
|
223
|
+
};
|
|
224
|
+
textAlignment: {
|
|
225
|
+
default: "left";
|
|
226
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
231
|
+
type: "checkListItem";
|
|
232
|
+
content: "inline";
|
|
233
|
+
propSchema: {
|
|
234
|
+
checked: {
|
|
235
|
+
default: false;
|
|
236
|
+
};
|
|
237
|
+
backgroundColor: {
|
|
238
|
+
default: "default";
|
|
239
|
+
};
|
|
240
|
+
textColor: {
|
|
241
|
+
default: "default";
|
|
242
|
+
};
|
|
243
|
+
textAlignment: {
|
|
244
|
+
default: "left";
|
|
245
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
249
|
+
};
|
|
250
|
+
table: {
|
|
251
|
+
config: {
|
|
252
|
+
type: "table";
|
|
253
|
+
content: "table";
|
|
254
|
+
propSchema: {
|
|
255
|
+
textColor: {
|
|
256
|
+
default: "default";
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
261
|
+
type: "table";
|
|
262
|
+
content: "table";
|
|
263
|
+
propSchema: {
|
|
264
|
+
textColor: {
|
|
265
|
+
default: "default";
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
269
|
+
};
|
|
270
|
+
file: {
|
|
271
|
+
config: {
|
|
272
|
+
type: "file";
|
|
273
|
+
propSchema: {
|
|
274
|
+
backgroundColor: {
|
|
275
|
+
default: "default";
|
|
276
|
+
};
|
|
277
|
+
name: {
|
|
278
|
+
default: "";
|
|
279
|
+
};
|
|
280
|
+
url: {
|
|
281
|
+
default: "";
|
|
282
|
+
};
|
|
283
|
+
caption: {
|
|
284
|
+
default: "";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
content: "none";
|
|
288
|
+
isFileBlock: true;
|
|
289
|
+
};
|
|
290
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
291
|
+
type: "file";
|
|
292
|
+
propSchema: {
|
|
293
|
+
backgroundColor: {
|
|
294
|
+
default: "default";
|
|
295
|
+
};
|
|
296
|
+
name: {
|
|
297
|
+
default: "";
|
|
298
|
+
};
|
|
299
|
+
url: {
|
|
300
|
+
default: "";
|
|
301
|
+
};
|
|
302
|
+
caption: {
|
|
303
|
+
default: "";
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
content: "none";
|
|
307
|
+
isFileBlock: true;
|
|
308
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
309
|
+
};
|
|
310
|
+
image: {
|
|
311
|
+
config: {
|
|
312
|
+
type: "image";
|
|
313
|
+
propSchema: {
|
|
314
|
+
textAlignment: {
|
|
315
|
+
default: "left";
|
|
316
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
317
|
+
};
|
|
318
|
+
backgroundColor: {
|
|
319
|
+
default: "default";
|
|
320
|
+
};
|
|
321
|
+
name: {
|
|
322
|
+
default: "";
|
|
323
|
+
};
|
|
324
|
+
url: {
|
|
325
|
+
default: "";
|
|
326
|
+
};
|
|
327
|
+
caption: {
|
|
328
|
+
default: "";
|
|
329
|
+
};
|
|
330
|
+
showPreview: {
|
|
331
|
+
default: true;
|
|
332
|
+
};
|
|
333
|
+
previewWidth: {
|
|
334
|
+
default: number;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
content: "none";
|
|
338
|
+
isFileBlock: true;
|
|
339
|
+
fileBlockAccept: string[];
|
|
340
|
+
};
|
|
341
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
342
|
+
type: "image";
|
|
343
|
+
propSchema: {
|
|
344
|
+
textAlignment: {
|
|
345
|
+
default: "left";
|
|
346
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
347
|
+
};
|
|
348
|
+
backgroundColor: {
|
|
349
|
+
default: "default";
|
|
350
|
+
};
|
|
351
|
+
name: {
|
|
352
|
+
default: "";
|
|
353
|
+
};
|
|
354
|
+
url: {
|
|
355
|
+
default: "";
|
|
356
|
+
};
|
|
357
|
+
caption: {
|
|
358
|
+
default: "";
|
|
359
|
+
};
|
|
360
|
+
showPreview: {
|
|
361
|
+
default: true;
|
|
362
|
+
};
|
|
363
|
+
previewWidth: {
|
|
364
|
+
default: number;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
content: "none";
|
|
368
|
+
isFileBlock: true;
|
|
369
|
+
fileBlockAccept: string[];
|
|
370
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
371
|
+
};
|
|
372
|
+
video: {
|
|
373
|
+
config: {
|
|
374
|
+
type: "video";
|
|
375
|
+
propSchema: {
|
|
376
|
+
textAlignment: {
|
|
377
|
+
default: "left";
|
|
378
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
379
|
+
};
|
|
380
|
+
backgroundColor: {
|
|
381
|
+
default: "default";
|
|
382
|
+
};
|
|
383
|
+
name: {
|
|
384
|
+
default: "";
|
|
385
|
+
};
|
|
386
|
+
url: {
|
|
387
|
+
default: "";
|
|
388
|
+
};
|
|
389
|
+
caption: {
|
|
390
|
+
default: "";
|
|
391
|
+
};
|
|
392
|
+
showPreview: {
|
|
393
|
+
default: true;
|
|
394
|
+
};
|
|
395
|
+
previewWidth: {
|
|
396
|
+
default: number;
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
content: "none";
|
|
400
|
+
isFileBlock: true;
|
|
401
|
+
fileBlockAccept: string[];
|
|
402
|
+
};
|
|
403
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
404
|
+
type: "video";
|
|
405
|
+
propSchema: {
|
|
406
|
+
textAlignment: {
|
|
407
|
+
default: "left";
|
|
408
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
409
|
+
};
|
|
410
|
+
backgroundColor: {
|
|
411
|
+
default: "default";
|
|
412
|
+
};
|
|
413
|
+
name: {
|
|
414
|
+
default: "";
|
|
415
|
+
};
|
|
416
|
+
url: {
|
|
417
|
+
default: "";
|
|
418
|
+
};
|
|
419
|
+
caption: {
|
|
420
|
+
default: "";
|
|
421
|
+
};
|
|
422
|
+
showPreview: {
|
|
423
|
+
default: true;
|
|
424
|
+
};
|
|
425
|
+
previewWidth: {
|
|
426
|
+
default: number;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
content: "none";
|
|
430
|
+
isFileBlock: true;
|
|
431
|
+
fileBlockAccept: string[];
|
|
432
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
433
|
+
};
|
|
434
|
+
audio: {
|
|
435
|
+
config: {
|
|
436
|
+
type: "audio";
|
|
437
|
+
propSchema: {
|
|
438
|
+
backgroundColor: {
|
|
439
|
+
default: "default";
|
|
440
|
+
};
|
|
441
|
+
name: {
|
|
442
|
+
default: "";
|
|
443
|
+
};
|
|
444
|
+
url: {
|
|
445
|
+
default: "";
|
|
446
|
+
};
|
|
447
|
+
caption: {
|
|
448
|
+
default: "";
|
|
449
|
+
};
|
|
450
|
+
showPreview: {
|
|
451
|
+
default: true;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
content: "none";
|
|
455
|
+
isFileBlock: true;
|
|
456
|
+
fileBlockAccept: string[];
|
|
457
|
+
};
|
|
458
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
459
|
+
type: "audio";
|
|
460
|
+
propSchema: {
|
|
461
|
+
backgroundColor: {
|
|
462
|
+
default: "default";
|
|
463
|
+
};
|
|
464
|
+
name: {
|
|
465
|
+
default: "";
|
|
466
|
+
};
|
|
467
|
+
url: {
|
|
468
|
+
default: "";
|
|
469
|
+
};
|
|
470
|
+
caption: {
|
|
471
|
+
default: "";
|
|
472
|
+
};
|
|
473
|
+
showPreview: {
|
|
474
|
+
default: true;
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
content: "none";
|
|
478
|
+
isFileBlock: true;
|
|
479
|
+
fileBlockAccept: string[];
|
|
480
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
481
|
+
};
|
|
482
|
+
}>, import("../../index.js").InlineContentSchemaFromSpecs<{
|
|
483
|
+
text: {
|
|
484
|
+
config: "text";
|
|
485
|
+
implementation: any;
|
|
486
|
+
};
|
|
487
|
+
link: {
|
|
488
|
+
config: "link";
|
|
489
|
+
implementation: any;
|
|
490
|
+
};
|
|
491
|
+
}>, import("../../index.js").StyleSchemaFromSpecs<{
|
|
492
|
+
bold: {
|
|
493
|
+
config: {
|
|
494
|
+
type: string;
|
|
495
|
+
propSchema: "boolean";
|
|
496
|
+
};
|
|
497
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
498
|
+
};
|
|
499
|
+
italic: {
|
|
500
|
+
config: {
|
|
501
|
+
type: string;
|
|
502
|
+
propSchema: "boolean";
|
|
503
|
+
};
|
|
504
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
505
|
+
};
|
|
506
|
+
underline: {
|
|
507
|
+
config: {
|
|
508
|
+
type: string;
|
|
509
|
+
propSchema: "boolean";
|
|
510
|
+
};
|
|
511
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
512
|
+
};
|
|
513
|
+
strike: {
|
|
514
|
+
config: {
|
|
515
|
+
type: string;
|
|
516
|
+
propSchema: "boolean";
|
|
517
|
+
};
|
|
518
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
519
|
+
};
|
|
520
|
+
code: {
|
|
521
|
+
config: {
|
|
522
|
+
type: string;
|
|
523
|
+
propSchema: "boolean";
|
|
524
|
+
};
|
|
525
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
526
|
+
};
|
|
527
|
+
textColor: {
|
|
528
|
+
config: {
|
|
529
|
+
type: string;
|
|
530
|
+
propSchema: "string";
|
|
531
|
+
};
|
|
532
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
533
|
+
};
|
|
534
|
+
backgroundColor: {
|
|
535
|
+
config: {
|
|
536
|
+
type: string;
|
|
537
|
+
propSchema: "string";
|
|
538
|
+
};
|
|
539
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
540
|
+
};
|
|
541
|
+
}>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Node, Schema } from "@tiptap/pm/model";
|
|
2
|
-
import type { BlockSchema, InlineContent, InlineContentSchema, StyleSchema, TableContent } from "../../schema/index.js";
|
|
1
|
+
import { Node, Schema, Slice } from "@tiptap/pm/model";
|
|
3
2
|
import type { Block } from "../../blocks/defaultBlocks.js";
|
|
3
|
+
import type { BlockSchema, InlineContent, InlineContentSchema, StyleSchema, TableContent } from "../../schema/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Converts an internal (prosemirror) table node contentto a BlockNote Tablecontent
|
|
6
6
|
*/
|
|
@@ -16,3 +16,40 @@ export declare function nodeToCustomInlineContent<I extends InlineContentSchema,
|
|
|
16
16
|
* TODO: test changes
|
|
17
17
|
*/
|
|
18
18
|
export declare function nodeToBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(node: Node, schema: Schema, blockSchema?: BSchema, inlineContentSchema?: I, styleSchema?: S, blockCache?: import("../../index.js").BlockCache<any, any, any>): Block<BSchema, I, S>;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a Prosemirror document to a BlockNote document (array of blocks)
|
|
21
|
+
*/
|
|
22
|
+
export declare function docToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(doc: Node, schema: Schema, blockSchema?: BSchema, inlineContentSchema?: I, styleSchema?: S, blockCache?: import("../../index.js").BlockCache<any, any, any>): Block<BSchema, I, S>[];
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* Parse a Prosemirror Slice into a BlockNote selection. The prosemirror schema looks like this:
|
|
26
|
+
*
|
|
27
|
+
* <blockGroup>
|
|
28
|
+
* <blockContainer> (main content of block)
|
|
29
|
+
* <p, heading, etc.>
|
|
30
|
+
* <blockGroup> (only if blocks has children)
|
|
31
|
+
* <blockContainer> (child block)
|
|
32
|
+
* <p, heading, etc.>
|
|
33
|
+
* </blockContainer>
|
|
34
|
+
* <blockContainer> (child block 2)
|
|
35
|
+
* <p, heading, etc.>
|
|
36
|
+
* </blockContainer>
|
|
37
|
+
* </blockContainer>
|
|
38
|
+
* </blockGroup>
|
|
39
|
+
* </blockGroup>
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export declare function prosemirrorSliceToSlicedBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(slice: Slice, schema: Schema, blockSchema?: BSchema, inlineContentSchema?: I, styleSchema?: S, blockCache?: WeakMap<Node, Block<BSchema, I, S>>): {
|
|
43
|
+
/**
|
|
44
|
+
* The blocks that are included in the selection.
|
|
45
|
+
*/
|
|
46
|
+
blocks: Block<BSchema, I, S>[];
|
|
47
|
+
/**
|
|
48
|
+
* If a block was "cut" at the start of the selection, this will be the id of the block that was cut.
|
|
49
|
+
*/
|
|
50
|
+
blockCutAtStart: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* If a block was "cut" at the end of the selection, this will be the id of the block that was cut.
|
|
53
|
+
*/
|
|
54
|
+
blockCutAtEnd: string | undefined;
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Node, Schema } from "prosemirror-model";
|
|
2
|
-
import
|
|
2
|
+
import { Transform } from "prosemirror-transform";
|
|
3
|
+
import { BlockNoteSchema } from "../editor/BlockNoteSchema.js";
|
|
3
4
|
import type { BlockSchema } from "../schema/blocks/types.js";
|
|
4
5
|
import type { InlineContentSchema } from "../schema/inlineContent/types.js";
|
|
5
6
|
import type { StyleSchema } from "../schema/styles/types.js";
|
|
6
|
-
|
|
7
|
-
export declare function getPmSchema(trOrNode: Transaction | Node): Schema<any, any>;
|
|
7
|
+
export declare function getPmSchema(trOrNode: Transform | Node): Schema<any, any>;
|
|
8
8
|
export declare function getBlockNoteSchema<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: Schema): BlockNoteSchema<BSchema, I, S>;
|
|
9
9
|
export declare function getBlockSchema<BSchema extends BlockSchema>(schema: Schema): BSchema;
|
|
10
10
|
export declare function getInlineContentSchema<I extends InlineContentSchema>(schema: Schema): I;
|