@blocknote/core 0.13.2 → 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 (163) hide show
  1. package/dist/blocknote.js +5730 -2891
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +7 -7
  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__/file/basic/external.html +1 -0
  9. package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -0
  10. package/src/api/exporters/html/__snapshots__/file/button/external.html +1 -0
  11. package/src/api/exporters/html/__snapshots__/file/button/internal.html +1 -0
  12. package/src/api/exporters/html/__snapshots__/file/nested/external.html +1 -0
  13. package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -0
  14. package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +1 -0
  15. package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -0
  16. package/src/api/exporters/html/__snapshots__/file/noName/external.html +1 -0
  17. package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -0
  18. package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -1
  19. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
  20. package/src/api/exporters/html/__snapshots__/image/button/external.html +1 -1
  21. package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -1
  22. package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -1
  23. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
  24. package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +1 -0
  25. package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -0
  26. package/src/api/exporters/html/__snapshots__/image/noName/external.html +1 -0
  27. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -0
  28. package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +1 -0
  29. package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -0
  30. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -0
  31. package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -0
  32. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -0
  33. package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -0
  34. package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +1 -0
  35. package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +1 -0
  36. package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +1 -0
  37. package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +1 -0
  38. package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +1 -0
  39. package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +1 -0
  40. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  41. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
  42. package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
  43. package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -1
  44. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  45. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
  46. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -0
  47. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -0
  48. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -0
  49. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -0
  50. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -0
  51. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -0
  52. package/src/api/exporters/html/externalHTMLExporter.ts +4 -3
  53. package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +1 -1
  54. package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +3 -0
  55. package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +1 -0
  56. package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +7 -0
  57. package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +1 -0
  58. package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +3 -0
  59. package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +1 -1
  60. package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +1 -1
  61. package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +2 -2
  62. package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +1 -0
  63. package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +3 -0
  64. package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +3 -0
  65. package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -0
  66. package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +10 -0
  67. package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +3 -0
  68. package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +1 -0
  69. package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +7 -0
  70. package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +3 -1
  71. package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +1 -0
  72. package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +6 -2
  73. package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -0
  74. package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +3 -0
  75. package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +3 -0
  76. package/src/api/exporters/markdown/markdownExporter.ts +2 -0
  77. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +42 -0
  78. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +262 -4
  79. package/src/api/parsers/html/__snapshots__/paste/list-test.json +74 -2
  80. package/src/api/parsers/html/__snapshots__/paste/parse-basic-block-types.json +3 -1
  81. package/src/api/parsers/html/__snapshots__/paste/parse-fake-image-caption.json +3 -1
  82. package/src/api/parsers/html/__snapshots__/paste/parse-mixed-nested-lists.json +135 -10
  83. package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +132 -7
  84. package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists.json +111 -3
  85. package/src/api/parsers/html/parseHTML.test.ts +166 -95
  86. package/src/api/testUtil/cases/customBlocks.ts +82 -33
  87. package/src/api/testUtil/cases/customInlineContent.ts +1 -1
  88. package/src/api/testUtil/cases/customStyles.ts +1 -1
  89. package/src/api/testUtil/cases/defaultSchema.ts +185 -4
  90. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +163 -0
  91. package/src/blocks/AudioBlockContent/audioBlockHelpers.ts +5 -0
  92. package/src/blocks/FileBlockContent/FileBlockContent.ts +120 -0
  93. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +377 -0
  94. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +134 -354
  95. package/src/blocks/ImageBlockContent/imageBlockHelpers.ts +6 -0
  96. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +3 -0
  97. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +266 -0
  98. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +2 -1
  99. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +1 -0
  100. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +181 -0
  101. package/src/blocks/VideoBlockContent/videoBlockHelpers.ts +6 -0
  102. package/src/blocks/defaultBlockTypeGuards.ts +53 -1
  103. package/src/blocks/defaultBlocks.ts +11 -2
  104. package/src/editor/Block.css +89 -27
  105. package/src/editor/BlockNoteEditor.ts +24 -10
  106. package/src/editor/BlockNoteSchema.ts +12 -3
  107. package/src/editor/transformPasted.ts +2 -1
  108. package/src/extensions/{ImagePanel/ImageToolbarPlugin.ts → FilePanel/FilePanelPlugin.ts} +22 -25
  109. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +14 -2
  110. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +72 -2
  111. package/src/extensions/TableHandles/TableHandlesPlugin.ts +27 -27
  112. package/src/extensions/TextAlignment/TextAlignmentExtension.ts +7 -1
  113. package/src/i18n/locales/en.ts +117 -11
  114. package/src/i18n/locales/fr.ts +118 -11
  115. package/src/i18n/locales/index.ts +8 -2
  116. package/src/i18n/locales/is.ts +295 -0
  117. package/src/i18n/locales/ja.ts +323 -0
  118. package/src/i18n/locales/ko.ts +307 -0
  119. package/src/i18n/locales/nl.ts +108 -8
  120. package/src/i18n/locales/pl.ts +287 -0
  121. package/src/i18n/locales/pt.ts +295 -0
  122. package/src/i18n/locales/vi.ts +295 -0
  123. package/src/i18n/locales/zh.ts +123 -8
  124. package/src/index.ts +9 -2
  125. package/src/pm-nodes/BlockContainer.ts +18 -6
  126. package/src/schema/blocks/createSpec.ts +1 -0
  127. package/src/schema/blocks/internal.ts +10 -0
  128. package/src/schema/blocks/types.ts +40 -5
  129. package/src/util/string.ts +12 -0
  130. package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +7 -0
  131. package/types/src/api/testUtil/cases/customBlocks.d.ts +272 -54
  132. package/types/src/api/testUtil/cases/customInlineContent.d.ts +222 -16
  133. package/types/src/api/testUtil/cases/customStyles.d.ts +222 -16
  134. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +101 -0
  135. package/types/src/blocks/AudioBlockContent/audioBlockHelpers.d.ts +3 -0
  136. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +93 -0
  137. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +30 -0
  138. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +50 -14
  139. package/types/src/blocks/ImageBlockContent/imageBlockHelpers.d.ts +4 -0
  140. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +55 -0
  141. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +129 -0
  142. package/types/src/blocks/VideoBlockContent/videoBlockHelpers.d.ts +4 -0
  143. package/types/src/blocks/defaultBlockTypeGuards.d.ts +6 -1
  144. package/types/src/blocks/defaultBlocks.d.ts +444 -32
  145. package/types/src/editor/BlockNoteEditor.d.ts +12 -5
  146. package/types/src/extensions/{ImagePanel/ImageToolbarPlugin.d.ts → FilePanel/FilePanelPlugin.d.ts} +9 -12
  147. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
  148. package/types/src/i18n/locales/en.d.ts +56 -7
  149. package/types/src/i18n/locales/fr.d.ts +2 -184
  150. package/types/src/i18n/locales/index.d.ts +7 -1
  151. package/types/src/i18n/locales/is.d.ts +2 -0
  152. package/types/src/i18n/locales/ja.d.ts +2 -0
  153. package/types/src/i18n/locales/ko.d.ts +2 -0
  154. package/types/src/i18n/locales/pl.d.ts +2 -0
  155. package/types/src/i18n/locales/pt.d.ts +2 -0
  156. package/types/src/i18n/locales/vi.d.ts +2 -0
  157. package/types/src/index.d.ts +8 -2
  158. package/types/src/pm-nodes/BlockContainer.d.ts +1 -1
  159. package/types/src/schema/blocks/internal.d.ts +1 -1
  160. package/types/src/schema/blocks/types.d.ts +25 -1
  161. package/types/src/util/string.d.ts +1 -0
  162. /package/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
  163. /package/types/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
@@ -0,0 +1,42 @@
1
+ import { Element as HASTElement, Parent as HASTParent } from "hast";
2
+ import { fromDom } from "hast-util-from-dom";
3
+
4
+ /**
5
+ * Rehype plugin which adds a space after each checkbox input element. This is
6
+ * because remark doesn't add any spaces between the checkbox input and the text
7
+ * itself, but these are needed for correct Markdown syntax.
8
+ */
9
+ export function addSpacesToCheckboxes() {
10
+ const helper = (tree: HASTParent) => {
11
+ if (tree.children && "length" in tree.children && tree.children.length) {
12
+ for (let i = tree.children.length - 1; i >= 0; i--) {
13
+ const child = tree.children[i];
14
+ const nextChild =
15
+ i + 1 < tree.children.length ? tree.children[i + 1] : undefined;
16
+
17
+ // Checks for paragraph element after checkbox input element.
18
+ if (
19
+ child.type === "element" &&
20
+ child.tagName === "input" &&
21
+ child.properties?.type === "checkbox" &&
22
+ nextChild?.type === "element" &&
23
+ nextChild.tagName === "p"
24
+ ) {
25
+ // Converts paragraph to span, otherwise remark will think it needs to
26
+ // be on a new line.
27
+ nextChild.tagName = "span";
28
+ // Adds a space after the checkbox input element.
29
+ nextChild.children.splice(
30
+ 0,
31
+ 0,
32
+ fromDom(document.createTextNode(" ")) as HASTElement
33
+ );
34
+ } else {
35
+ helper(child as HASTParent);
36
+ }
37
+ }
38
+ }
39
+ };
40
+
41
+ return helper;
42
+ }
@@ -217,6 +217,134 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
217
217
  }
218
218
  `;
219
219
 
220
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/basic to/from prosemirror 1`] = `
221
+ {
222
+ "attrs": {
223
+ "backgroundColor": "default",
224
+ "id": "1",
225
+ "textColor": "default",
226
+ },
227
+ "content": [
228
+ {
229
+ "attrs": {
230
+ "caption": "Caption",
231
+ "name": "example",
232
+ "url": "exampleURL",
233
+ },
234
+ "type": "file",
235
+ },
236
+ ],
237
+ "type": "blockContainer",
238
+ }
239
+ `;
240
+
241
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/button to/from prosemirror 1`] = `
242
+ {
243
+ "attrs": {
244
+ "backgroundColor": "default",
245
+ "id": "1",
246
+ "textColor": "default",
247
+ },
248
+ "content": [
249
+ {
250
+ "attrs": {
251
+ "caption": "",
252
+ "name": "",
253
+ "url": "",
254
+ },
255
+ "type": "file",
256
+ },
257
+ ],
258
+ "type": "blockContainer",
259
+ }
260
+ `;
261
+
262
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/nested to/from prosemirror 1`] = `
263
+ {
264
+ "attrs": {
265
+ "backgroundColor": "default",
266
+ "id": "1",
267
+ "textColor": "default",
268
+ },
269
+ "content": [
270
+ {
271
+ "attrs": {
272
+ "caption": "Caption",
273
+ "name": "example",
274
+ "url": "exampleURL",
275
+ },
276
+ "type": "file",
277
+ },
278
+ {
279
+ "content": [
280
+ {
281
+ "attrs": {
282
+ "backgroundColor": "default",
283
+ "id": "2",
284
+ "textColor": "default",
285
+ },
286
+ "content": [
287
+ {
288
+ "attrs": {
289
+ "caption": "Caption",
290
+ "name": "example",
291
+ "url": "exampleURL",
292
+ },
293
+ "type": "file",
294
+ },
295
+ ],
296
+ "type": "blockContainer",
297
+ },
298
+ ],
299
+ "type": "blockGroup",
300
+ },
301
+ ],
302
+ "type": "blockContainer",
303
+ }
304
+ `;
305
+
306
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/noCaption to/from prosemirror 1`] = `
307
+ {
308
+ "attrs": {
309
+ "backgroundColor": "default",
310
+ "id": "1",
311
+ "textColor": "default",
312
+ },
313
+ "content": [
314
+ {
315
+ "attrs": {
316
+ "caption": "",
317
+ "name": "example",
318
+ "url": "exampleURL",
319
+ },
320
+ "type": "file",
321
+ },
322
+ ],
323
+ "type": "blockContainer",
324
+ }
325
+ `;
326
+
327
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/noName to/from prosemirror 1`] = `
328
+ {
329
+ "attrs": {
330
+ "backgroundColor": "default",
331
+ "id": "1",
332
+ "textColor": "default",
333
+ },
334
+ "content": [
335
+ {
336
+ "attrs": {
337
+ "caption": "Caption",
338
+ "name": "",
339
+ "url": "exampleURL",
340
+ },
341
+ "type": "file",
342
+ },
343
+ ],
344
+ "type": "blockContainer",
345
+ }
346
+ `;
347
+
220
348
  exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/basic to/from prosemirror 1`] = `
221
349
  {
222
350
  "attrs": {
@@ -524,9 +652,11 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
524
652
  {
525
653
  "attrs": {
526
654
  "caption": "Caption",
655
+ "name": "example",
656
+ "previewWidth": 256,
657
+ "showPreview": true,
527
658
  "textAlignment": "left",
528
659
  "url": "exampleURL",
529
- "width": 256,
530
660
  },
531
661
  "type": "image",
532
662
  },
@@ -546,9 +676,11 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
546
676
  {
547
677
  "attrs": {
548
678
  "caption": "",
679
+ "name": "",
680
+ "previewWidth": 512,
681
+ "showPreview": true,
549
682
  "textAlignment": "left",
550
683
  "url": "",
551
- "width": 512,
552
684
  },
553
685
  "type": "image",
554
686
  },
@@ -568,9 +700,11 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
568
700
  {
569
701
  "attrs": {
570
702
  "caption": "Caption",
703
+ "name": "",
704
+ "previewWidth": 256,
705
+ "showPreview": true,
571
706
  "textAlignment": "left",
572
707
  "url": "exampleURL",
573
- "width": 256,
574
708
  },
575
709
  "type": "image",
576
710
  },
@@ -586,9 +720,11 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
586
720
  {
587
721
  "attrs": {
588
722
  "caption": "Caption",
723
+ "name": "",
724
+ "previewWidth": 256,
725
+ "showPreview": true,
589
726
  "textAlignment": "left",
590
727
  "url": "exampleURL",
591
- "width": 256,
592
728
  },
593
729
  "type": "image",
594
730
  },
@@ -603,6 +739,78 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
603
739
  }
604
740
  `;
605
741
 
742
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/noCaption to/from prosemirror 1`] = `
743
+ {
744
+ "attrs": {
745
+ "backgroundColor": "default",
746
+ "id": "1",
747
+ "textColor": "default",
748
+ },
749
+ "content": [
750
+ {
751
+ "attrs": {
752
+ "caption": "",
753
+ "name": "example",
754
+ "previewWidth": 256,
755
+ "showPreview": true,
756
+ "textAlignment": "left",
757
+ "url": "exampleURL",
758
+ },
759
+ "type": "image",
760
+ },
761
+ ],
762
+ "type": "blockContainer",
763
+ }
764
+ `;
765
+
766
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/noName to/from prosemirror 1`] = `
767
+ {
768
+ "attrs": {
769
+ "backgroundColor": "default",
770
+ "id": "1",
771
+ "textColor": "default",
772
+ },
773
+ "content": [
774
+ {
775
+ "attrs": {
776
+ "caption": "Caption",
777
+ "name": "",
778
+ "previewWidth": 256,
779
+ "showPreview": true,
780
+ "textAlignment": "left",
781
+ "url": "exampleURL",
782
+ },
783
+ "type": "image",
784
+ },
785
+ ],
786
+ "type": "blockContainer",
787
+ }
788
+ `;
789
+
790
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/noPreview to/from prosemirror 1`] = `
791
+ {
792
+ "attrs": {
793
+ "backgroundColor": "default",
794
+ "id": "1",
795
+ "textColor": "default",
796
+ },
797
+ "content": [
798
+ {
799
+ "attrs": {
800
+ "caption": "Caption",
801
+ "name": "example",
802
+ "previewWidth": 256,
803
+ "showPreview": false,
804
+ "textAlignment": "left",
805
+ "url": "exampleURL",
806
+ },
807
+ "type": "image",
808
+ },
809
+ ],
810
+ "type": "blockContainer",
811
+ }
812
+ `;
813
+
606
814
  exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/adjacent to/from prosemirror 1`] = `
607
815
  {
608
816
  "attrs": {
@@ -744,6 +952,56 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
744
952
  }
745
953
  `;
746
954
 
955
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert lists/basic to/from prosemirror 1`] = `
956
+ {
957
+ "attrs": {
958
+ "backgroundColor": "default",
959
+ "id": "1",
960
+ "textColor": "default",
961
+ },
962
+ "content": [
963
+ {
964
+ "attrs": {
965
+ "textAlignment": "left",
966
+ },
967
+ "content": [
968
+ {
969
+ "text": "Bullet List Item 1",
970
+ "type": "text",
971
+ },
972
+ ],
973
+ "type": "bulletListItem",
974
+ },
975
+ ],
976
+ "type": "blockContainer",
977
+ }
978
+ `;
979
+
980
+ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert lists/nested to/from prosemirror 1`] = `
981
+ {
982
+ "attrs": {
983
+ "backgroundColor": "default",
984
+ "id": "1",
985
+ "textColor": "default",
986
+ },
987
+ "content": [
988
+ {
989
+ "attrs": {
990
+ "textAlignment": "left",
991
+ },
992
+ "content": [
993
+ {
994
+ "text": "Bullet List Item 1",
995
+ "type": "text",
996
+ },
997
+ ],
998
+ "type": "bulletListItem",
999
+ },
1000
+ ],
1001
+ "type": "blockContainer",
1002
+ }
1003
+ `;
1004
+
747
1005
  exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/basic to/from prosemirror 1`] = `
748
1006
  {
749
1007
  "attrs": {
@@ -52,6 +52,42 @@
52
52
  },
53
53
  {
54
54
  "id": "4",
55
+ "type": "checkListItem",
56
+ "props": {
57
+ "textColor": "default",
58
+ "backgroundColor": "default",
59
+ "textAlignment": "left",
60
+ "checked": false
61
+ },
62
+ "content": [
63
+ {
64
+ "type": "text",
65
+ "text": "Fourth",
66
+ "styles": {}
67
+ }
68
+ ],
69
+ "children": []
70
+ },
71
+ {
72
+ "id": "5",
73
+ "type": "checkListItem",
74
+ "props": {
75
+ "textColor": "default",
76
+ "backgroundColor": "default",
77
+ "textAlignment": "left",
78
+ "checked": false
79
+ },
80
+ "content": [
81
+ {
82
+ "type": "text",
83
+ "text": "Fifth",
84
+ "styles": {}
85
+ }
86
+ ],
87
+ "children": []
88
+ },
89
+ {
90
+ "id": "6",
55
91
  "type": "bulletListItem",
56
92
  "props": {
57
93
  "textColor": "default",
@@ -67,7 +103,7 @@
67
103
  ],
68
104
  "children": [
69
105
  {
70
- "id": "5",
106
+ "id": "7",
71
107
  "type": "bulletListItem",
72
108
  "props": {
73
109
  "textColor": "default",
@@ -84,7 +120,7 @@
84
120
  "children": []
85
121
  },
86
122
  {
87
- "id": "6",
123
+ "id": "8",
88
124
  "type": "bulletListItem",
89
125
  "props": {
90
126
  "textColor": "default",
@@ -99,6 +135,42 @@
99
135
  }
100
136
  ],
101
137
  "children": []
138
+ },
139
+ {
140
+ "id": "9",
141
+ "type": "checkListItem",
142
+ "props": {
143
+ "textColor": "default",
144
+ "backgroundColor": "default",
145
+ "textAlignment": "left",
146
+ "checked": false
147
+ },
148
+ "content": [
149
+ {
150
+ "type": "text",
151
+ "text": "Child 3",
152
+ "styles": {}
153
+ }
154
+ ],
155
+ "children": []
156
+ },
157
+ {
158
+ "id": "10",
159
+ "type": "checkListItem",
160
+ "props": {
161
+ "textColor": "default",
162
+ "backgroundColor": "default",
163
+ "textAlignment": "left",
164
+ "checked": false
165
+ },
166
+ "content": [
167
+ {
168
+ "type": "text",
169
+ "text": "Child 4",
170
+ "styles": {}
171
+ }
172
+ ],
173
+ "children": []
102
174
  }
103
175
  ]
104
176
  }
@@ -76,9 +76,11 @@
76
76
  "props": {
77
77
  "backgroundColor": "default",
78
78
  "textAlignment": "left",
79
+ "name": "",
79
80
  "url": "exampleURL",
80
81
  "caption": "Image Caption",
81
- "width": 512
82
+ "showPreview": true,
83
+ "previewWidth": 512
82
84
  },
83
85
  "children": []
84
86
  },
@@ -5,9 +5,11 @@
5
5
  "props": {
6
6
  "backgroundColor": "default",
7
7
  "textAlignment": "left",
8
+ "name": "",
8
9
  "url": "exampleURL",
9
10
  "caption": "",
10
- "width": 512
11
+ "showPreview": true,
12
+ "previewWidth": 512
11
13
  },
12
14
  "children": []
13
15
  },
@@ -14,9 +14,26 @@
14
14
  "styles": {}
15
15
  }
16
16
  ],
17
+ "children": []
18
+ },
19
+ {
20
+ "id": "2",
21
+ "type": "bulletListItem",
22
+ "props": {
23
+ "textColor": "default",
24
+ "backgroundColor": "default",
25
+ "textAlignment": "left"
26
+ },
27
+ "content": [
28
+ {
29
+ "type": "text",
30
+ "text": "Bullet List Item",
31
+ "styles": {}
32
+ }
33
+ ],
17
34
  "children": [
18
35
  {
19
- "id": "2",
36
+ "id": "3",
20
37
  "type": "numberedListItem",
21
38
  "props": {
22
39
  "textColor": "default",
@@ -33,7 +50,7 @@
33
50
  "children": []
34
51
  },
35
52
  {
36
- "id": "3",
53
+ "id": "4",
37
54
  "type": "numberedListItem",
38
55
  "props": {
39
56
  "textColor": "default",
@@ -52,7 +69,7 @@
52
69
  ]
53
70
  },
54
71
  {
55
- "id": "4",
72
+ "id": "5",
56
73
  "type": "bulletListItem",
57
74
  "props": {
58
75
  "textColor": "default",
@@ -69,7 +86,78 @@
69
86
  "children": []
70
87
  },
71
88
  {
72
- "id": "5",
89
+ "id": "6",
90
+ "type": "numberedListItem",
91
+ "props": {
92
+ "textColor": "default",
93
+ "backgroundColor": "default",
94
+ "textAlignment": "left"
95
+ },
96
+ "content": [
97
+ {
98
+ "type": "text",
99
+ "text": "Numbered List Item",
100
+ "styles": {}
101
+ }
102
+ ],
103
+ "children": []
104
+ },
105
+ {
106
+ "id": "7",
107
+ "type": "numberedListItem",
108
+ "props": {
109
+ "textColor": "default",
110
+ "backgroundColor": "default",
111
+ "textAlignment": "left"
112
+ },
113
+ "content": [
114
+ {
115
+ "type": "text",
116
+ "text": "Numbered List Item",
117
+ "styles": {}
118
+ }
119
+ ],
120
+ "children": [
121
+ {
122
+ "id": "8",
123
+ "type": "checkListItem",
124
+ "props": {
125
+ "textColor": "default",
126
+ "backgroundColor": "default",
127
+ "textAlignment": "left",
128
+ "checked": true
129
+ },
130
+ "content": [
131
+ {
132
+ "type": "text",
133
+ "text": "Nested Check List Item",
134
+ "styles": {}
135
+ }
136
+ ],
137
+ "children": []
138
+ },
139
+ {
140
+ "id": "9",
141
+ "type": "checkListItem",
142
+ "props": {
143
+ "textColor": "default",
144
+ "backgroundColor": "default",
145
+ "textAlignment": "left",
146
+ "checked": false
147
+ },
148
+ "content": [
149
+ {
150
+ "type": "text",
151
+ "text": "Nested Check List Item",
152
+ "styles": {}
153
+ }
154
+ ],
155
+ "children": []
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "id": "10",
73
161
  "type": "numberedListItem",
74
162
  "props": {
75
163
  "textColor": "default",
@@ -83,9 +171,45 @@
83
171
  "styles": {}
84
172
  }
85
173
  ],
174
+ "children": []
175
+ },
176
+ {
177
+ "id": "11",
178
+ "type": "checkListItem",
179
+ "props": {
180
+ "textColor": "default",
181
+ "backgroundColor": "default",
182
+ "textAlignment": "left",
183
+ "checked": true
184
+ },
185
+ "content": [
186
+ {
187
+ "type": "text",
188
+ "text": "Check List Item",
189
+ "styles": {}
190
+ }
191
+ ],
192
+ "children": []
193
+ },
194
+ {
195
+ "id": "12",
196
+ "type": "checkListItem",
197
+ "props": {
198
+ "textColor": "default",
199
+ "backgroundColor": "default",
200
+ "textAlignment": "left",
201
+ "checked": false
202
+ },
203
+ "content": [
204
+ {
205
+ "type": "text",
206
+ "text": "Check List Item",
207
+ "styles": {}
208
+ }
209
+ ],
86
210
  "children": [
87
211
  {
88
- "id": "6",
212
+ "id": "13",
89
213
  "type": "bulletListItem",
90
214
  "props": {
91
215
  "textColor": "default",
@@ -102,7 +226,7 @@
102
226
  "children": []
103
227
  },
104
228
  {
105
- "id": "7",
229
+ "id": "14",
106
230
  "type": "bulletListItem",
107
231
  "props": {
108
232
  "textColor": "default",
@@ -121,17 +245,18 @@
121
245
  ]
122
246
  },
123
247
  {
124
- "id": "8",
125
- "type": "numberedListItem",
248
+ "id": "15",
249
+ "type": "checkListItem",
126
250
  "props": {
127
251
  "textColor": "default",
128
252
  "backgroundColor": "default",
129
- "textAlignment": "left"
253
+ "textAlignment": "left",
254
+ "checked": true
130
255
  },
131
256
  "content": [
132
257
  {
133
258
  "type": "text",
134
- "text": "Numbered List Item",
259
+ "text": "Nested Check List Item",
135
260
  "styles": {}
136
261
  }
137
262
  ],