@blocknote/core 0.13.3 → 0.13.4

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 (84) hide show
  1. package/dist/blocknote.js +1038 -696
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +6 -6
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +2 -2
  8. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
  9. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
  10. package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -1
  11. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -1
  12. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -0
  13. package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -0
  14. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -0
  15. package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -0
  16. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  17. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
  18. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  19. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
  20. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
  21. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -1
  22. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
  23. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -1
  24. package/src/api/exporters/html/externalHTMLExporter.ts +4 -3
  25. package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +1 -1
  26. package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -0
  27. package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +10 -0
  28. package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +1 -1
  29. package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +2 -2
  30. package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -1
  31. package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +1 -1
  32. package/src/api/exporters/markdown/markdownExporter.ts +2 -0
  33. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +42 -0
  34. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +50 -0
  35. package/src/api/parsers/html/__snapshots__/paste/list-test.json +74 -2
  36. package/src/api/parsers/html/__snapshots__/paste/parse-mixed-nested-lists.json +135 -10
  37. package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +132 -7
  38. package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists.json +111 -3
  39. package/src/api/parsers/html/parseHTML.test.ts +166 -95
  40. package/src/api/testUtil/cases/customBlocks.ts +3 -0
  41. package/src/api/testUtil/cases/defaultSchema.ts +71 -0
  42. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +3 -2
  43. package/src/blocks/FileBlockContent/FileBlockContent.ts +1 -2
  44. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +3 -2
  45. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +3 -0
  46. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +266 -0
  47. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +2 -1
  48. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +1 -0
  49. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +0 -1
  50. package/src/blocks/defaultBlockTypeGuards.ts +1 -1
  51. package/src/blocks/defaultBlocks.ts +6 -3
  52. package/src/editor/Block.css +22 -0
  53. package/src/editor/BlockNoteEditor.ts +10 -0
  54. package/src/editor/transformPasted.ts +2 -1
  55. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +13 -0
  56. package/src/extensions/TableHandles/TableHandlesPlugin.ts +27 -27
  57. package/src/extensions/TextAlignment/TextAlignmentExtension.ts +7 -1
  58. package/src/i18n/locales/en.ts +15 -0
  59. package/src/i18n/locales/fr.ts +14 -0
  60. package/src/i18n/locales/is.ts +7 -0
  61. package/src/i18n/locales/ja.ts +24 -1
  62. package/src/i18n/locales/ko.ts +15 -0
  63. package/src/i18n/locales/nl.ts +7 -0
  64. package/src/i18n/locales/pl.ts +7 -0
  65. package/src/i18n/locales/pt.ts +14 -0
  66. package/src/i18n/locales/vi.ts +16 -2
  67. package/src/i18n/locales/zh.ts +16 -0
  68. package/src/pm-nodes/BlockContainer.ts +16 -4
  69. package/src/schema/blocks/types.ts +0 -1
  70. package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +7 -0
  71. package/types/src/api/testUtil/cases/customBlocks.d.ts +74 -42
  72. package/types/src/api/testUtil/cases/customInlineContent.d.ts +74 -42
  73. package/types/src/api/testUtil/cases/customStyles.d.ts +74 -42
  74. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +0 -3
  75. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +0 -3
  76. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +0 -3
  77. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +55 -0
  78. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +0 -3
  79. package/types/src/blocks/defaultBlocks.d.ts +141 -77
  80. package/types/src/editor/BlockNoteEditor.d.ts +7 -0
  81. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
  82. package/types/src/i18n/locales/en.d.ts +7 -0
  83. package/types/src/pm-nodes/BlockContainer.d.ts +1 -1
  84. package/types/src/schema/blocks/types.d.ts +0 -1
@@ -146,6 +146,80 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
146
146
  };
147
147
  }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
148
148
  };
149
+ checkListItem: {
150
+ config: {
151
+ type: "checkListItem";
152
+ content: "inline";
153
+ propSchema: {
154
+ checked: {
155
+ default: false;
156
+ };
157
+ backgroundColor: {
158
+ default: "default";
159
+ };
160
+ textColor: {
161
+ default: "default";
162
+ };
163
+ textAlignment: {
164
+ default: "left";
165
+ values: readonly ["left", "center", "right", "justify"];
166
+ };
167
+ };
168
+ };
169
+ implementation: import("../../..").TiptapBlockImplementation<{
170
+ type: "checkListItem";
171
+ content: "inline";
172
+ propSchema: {
173
+ checked: {
174
+ default: false;
175
+ };
176
+ backgroundColor: {
177
+ default: "default";
178
+ };
179
+ textColor: {
180
+ default: "default";
181
+ };
182
+ textAlignment: {
183
+ default: "left";
184
+ values: readonly ["left", "center", "right", "justify"];
185
+ };
186
+ };
187
+ }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
188
+ };
189
+ table: {
190
+ config: {
191
+ type: "table";
192
+ content: "table";
193
+ propSchema: {
194
+ backgroundColor: {
195
+ default: "default";
196
+ };
197
+ textColor: {
198
+ default: "default";
199
+ };
200
+ textAlignment: {
201
+ default: "left";
202
+ values: readonly ["left", "center", "right", "justify"];
203
+ };
204
+ };
205
+ };
206
+ implementation: import("../../..").TiptapBlockImplementation<{
207
+ type: "table";
208
+ content: "table";
209
+ propSchema: {
210
+ backgroundColor: {
211
+ default: "default";
212
+ };
213
+ textColor: {
214
+ default: "default";
215
+ };
216
+ textAlignment: {
217
+ default: "left";
218
+ values: readonly ["left", "center", "right", "justify"];
219
+ };
220
+ };
221
+ }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
222
+ };
149
223
  file: {
150
224
  config: {
151
225
  type: "file";
@@ -165,7 +239,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
165
239
  };
166
240
  content: "none";
167
241
  isFileBlock: true;
168
- isFileBlockPlaceholder: (block: any) => boolean;
169
242
  };
170
243
  implementation: import("../../..").TiptapBlockImplementation<{
171
244
  type: "file";
@@ -185,7 +258,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
185
258
  };
186
259
  content: "none";
187
260
  isFileBlock: true;
188
- isFileBlockPlaceholder: (block: any) => boolean;
189
261
  }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
190
262
  };
191
263
  image: {
@@ -217,7 +289,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
217
289
  };
218
290
  content: "none";
219
291
  isFileBlock: true;
220
- isFileBlockPlaceholder: (block: any) => boolean;
221
292
  fileBlockAcceptMimeTypes: string[];
222
293
  };
223
294
  implementation: import("../../..").TiptapBlockImplementation<{
@@ -248,7 +319,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
248
319
  };
249
320
  content: "none";
250
321
  isFileBlock: true;
251
- isFileBlockPlaceholder: (block: any) => boolean;
252
322
  fileBlockAcceptMimeTypes: string[];
253
323
  }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
254
324
  };
@@ -281,7 +351,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
281
351
  };
282
352
  content: "none";
283
353
  isFileBlock: true;
284
- isFileBlockPlaceholder: (block: any) => boolean;
285
354
  fileBlockAcceptMimeTypes: string[];
286
355
  };
287
356
  implementation: import("../../..").TiptapBlockImplementation<{
@@ -312,7 +381,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
312
381
  };
313
382
  content: "none";
314
383
  isFileBlock: true;
315
- isFileBlockPlaceholder: (block: any) => boolean;
316
384
  fileBlockAcceptMimeTypes: string[];
317
385
  }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
318
386
  };
@@ -338,7 +406,6 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
338
406
  };
339
407
  content: "none";
340
408
  isFileBlock: true;
341
- isFileBlockPlaceholder: (block: any) => boolean;
342
409
  fileBlockAcceptMimeTypes: string[];
343
410
  };
344
411
  implementation: import("../../..").TiptapBlockImplementation<{
@@ -362,44 +429,9 @@ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
362
429
  };
363
430
  content: "none";
364
431
  isFileBlock: true;
365
- isFileBlockPlaceholder: (block: any) => boolean;
366
432
  fileBlockAcceptMimeTypes: string[];
367
433
  }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
368
434
  };
369
- table: {
370
- config: {
371
- type: "table";
372
- content: "table";
373
- propSchema: {
374
- backgroundColor: {
375
- default: "default";
376
- };
377
- textColor: {
378
- default: "default";
379
- };
380
- textAlignment: {
381
- default: "left";
382
- values: readonly ["left", "center", "right", "justify"];
383
- };
384
- };
385
- };
386
- implementation: import("../../..").TiptapBlockImplementation<{
387
- type: "table";
388
- content: "table";
389
- propSchema: {
390
- backgroundColor: {
391
- default: "default";
392
- };
393
- textColor: {
394
- default: "default";
395
- };
396
- textAlignment: {
397
- default: "left";
398
- values: readonly ["left", "center", "right", "justify"];
399
- };
400
- };
401
- }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
402
- };
403
435
  }>, import("../../..").InlineContentSchemaFromSpecs<{
404
436
  text: {
405
437
  config: "text";
@@ -38,7 +38,6 @@ export declare const audioBlockConfig: {
38
38
  };
39
39
  content: "none";
40
40
  isFileBlock: true;
41
- isFileBlockPlaceholder: (block: any) => boolean;
42
41
  fileBlockAcceptMimeTypes: string[];
43
42
  };
44
43
  export declare const audioRender: (block: BlockFromConfig<typeof audioBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
@@ -74,7 +73,6 @@ export declare const AudioBlock: {
74
73
  };
75
74
  content: "none";
76
75
  isFileBlock: true;
77
- isFileBlockPlaceholder: (block: any) => boolean;
78
76
  fileBlockAcceptMimeTypes: string[];
79
77
  };
80
78
  implementation: import("../../schema").TiptapBlockImplementation<{
@@ -98,7 +96,6 @@ export declare const AudioBlock: {
98
96
  };
99
97
  content: "none";
100
98
  isFileBlock: true;
101
- isFileBlockPlaceholder: (block: any) => boolean;
102
99
  fileBlockAcceptMimeTypes: string[];
103
100
  }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
104
101
  };
@@ -32,7 +32,6 @@ export declare const fileBlockConfig: {
32
32
  };
33
33
  content: "none";
34
34
  isFileBlock: true;
35
- isFileBlockPlaceholder: (block: any) => boolean;
36
35
  };
37
36
  export declare const fileRender: (block: BlockFromConfig<typeof fileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
38
37
  dom: HTMLDivElement;
@@ -71,7 +70,6 @@ export declare const FileBlock: {
71
70
  };
72
71
  content: "none";
73
72
  isFileBlock: true;
74
- isFileBlockPlaceholder: (block: any) => boolean;
75
73
  };
76
74
  implementation: import("../../schema").TiptapBlockImplementation<{
77
75
  type: "file";
@@ -91,6 +89,5 @@ export declare const FileBlock: {
91
89
  };
92
90
  content: "none";
93
91
  isFileBlock: true;
94
- isFileBlockPlaceholder: (block: any) => boolean;
95
92
  }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
96
93
  };
@@ -52,7 +52,6 @@ export declare const imageBlockConfig: {
52
52
  };
53
53
  content: "none";
54
54
  isFileBlock: true;
55
- isFileBlockPlaceholder: (block: any) => boolean;
56
55
  fileBlockAcceptMimeTypes: string[];
57
56
  };
58
57
  export declare const imageRender: (block: BlockFromConfig<typeof imageBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
@@ -95,7 +94,6 @@ export declare const ImageBlock: {
95
94
  };
96
95
  content: "none";
97
96
  isFileBlock: true;
98
- isFileBlockPlaceholder: (block: any) => boolean;
99
97
  fileBlockAcceptMimeTypes: string[];
100
98
  };
101
99
  implementation: import("../../schema").TiptapBlockImplementation<{
@@ -126,7 +124,6 @@ export declare const ImageBlock: {
126
124
  };
127
125
  content: "none";
128
126
  isFileBlock: true;
129
- isFileBlockPlaceholder: (block: any) => boolean;
130
127
  fileBlockAcceptMimeTypes: string[];
131
128
  }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
132
129
  };
@@ -0,0 +1,55 @@
1
+ export declare const checkListItemPropSchema: {
2
+ checked: {
3
+ default: false;
4
+ };
5
+ backgroundColor: {
6
+ default: "default";
7
+ };
8
+ textColor: {
9
+ default: "default";
10
+ };
11
+ textAlignment: {
12
+ default: "left";
13
+ values: readonly ["left", "center", "right", "justify"];
14
+ };
15
+ };
16
+ export declare const CheckListItem: {
17
+ config: {
18
+ type: "checkListItem";
19
+ content: "inline";
20
+ propSchema: {
21
+ checked: {
22
+ default: false;
23
+ };
24
+ backgroundColor: {
25
+ default: "default";
26
+ };
27
+ textColor: {
28
+ default: "default";
29
+ };
30
+ textAlignment: {
31
+ default: "left";
32
+ values: readonly ["left", "center", "right", "justify"];
33
+ };
34
+ };
35
+ };
36
+ implementation: import("../../../schema").TiptapBlockImplementation<{
37
+ type: "checkListItem";
38
+ content: "inline";
39
+ propSchema: {
40
+ checked: {
41
+ default: false;
42
+ };
43
+ backgroundColor: {
44
+ default: "default";
45
+ };
46
+ textColor: {
47
+ default: "default";
48
+ };
49
+ textAlignment: {
50
+ default: "left";
51
+ values: readonly ["left", "center", "right", "justify"];
52
+ };
53
+ };
54
+ }, any, import("../../../schema").InlineContentSchema, import("../../../schema").StyleSchema>;
55
+ };
@@ -52,7 +52,6 @@ export declare const videoBlockConfig: {
52
52
  };
53
53
  content: "none";
54
54
  isFileBlock: true;
55
- isFileBlockPlaceholder: (block: any) => boolean;
56
55
  fileBlockAcceptMimeTypes: string[];
57
56
  };
58
57
  export declare const videoRender: (block: BlockFromConfig<typeof videoBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
@@ -95,7 +94,6 @@ export declare const VideoBlock: {
95
94
  };
96
95
  content: "none";
97
96
  isFileBlock: true;
98
- isFileBlockPlaceholder: (block: any) => boolean;
99
97
  fileBlockAcceptMimeTypes: string[];
100
98
  };
101
99
  implementation: import("../../schema").TiptapBlockImplementation<{
@@ -126,7 +124,6 @@ export declare const VideoBlock: {
126
124
  };
127
125
  content: "none";
128
126
  isFileBlock: true;
129
- isFileBlockPlaceholder: (block: any) => boolean;
130
127
  fileBlockAcceptMimeTypes: string[];
131
128
  }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
132
129
  };