@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
@@ -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
  ],
@@ -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": "bulletListItem",
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": "bulletListItem",
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,24 @@
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",
73
107
  "type": "numberedListItem",
74
108
  "props": {
75
109
  "textColor": "default",
@@ -85,7 +119,7 @@
85
119
  ],
86
120
  "children": [
87
121
  {
88
- "id": "6",
122
+ "id": "8",
89
123
  "type": "numberedListItem",
90
124
  "props": {
91
125
  "textColor": "default",
@@ -102,7 +136,7 @@
102
136
  "children": []
103
137
  },
104
138
  {
105
- "id": "7",
139
+ "id": "9",
106
140
  "type": "numberedListItem",
107
141
  "props": {
108
142
  "textColor": "default",
@@ -121,7 +155,7 @@
121
155
  ]
122
156
  },
123
157
  {
124
- "id": "8",
158
+ "id": "10",
125
159
  "type": "numberedListItem",
126
160
  "props": {
127
161
  "textColor": "default",
@@ -136,5 +170,96 @@
136
170
  }
137
171
  ],
138
172
  "children": []
173
+ },
174
+ {
175
+ "id": "11",
176
+ "type": "checkListItem",
177
+ "props": {
178
+ "textColor": "default",
179
+ "backgroundColor": "default",
180
+ "textAlignment": "left",
181
+ "checked": false
182
+ },
183
+ "content": [
184
+ {
185
+ "type": "text",
186
+ "text": "Checked List Item",
187
+ "styles": {}
188
+ }
189
+ ],
190
+ "children": []
191
+ },
192
+ {
193
+ "id": "12",
194
+ "type": "checkListItem",
195
+ "props": {
196
+ "textColor": "default",
197
+ "backgroundColor": "default",
198
+ "textAlignment": "left",
199
+ "checked": false
200
+ },
201
+ "content": [
202
+ {
203
+ "type": "text",
204
+ "text": "Checked List Item",
205
+ "styles": {}
206
+ }
207
+ ],
208
+ "children": [
209
+ {
210
+ "id": "13",
211
+ "type": "checkListItem",
212
+ "props": {
213
+ "textColor": "default",
214
+ "backgroundColor": "default",
215
+ "textAlignment": "left",
216
+ "checked": false
217
+ },
218
+ "content": [
219
+ {
220
+ "type": "text",
221
+ "text": "Nested Checked List Item",
222
+ "styles": {}
223
+ }
224
+ ],
225
+ "children": []
226
+ },
227
+ {
228
+ "id": "14",
229
+ "type": "checkListItem",
230
+ "props": {
231
+ "textColor": "default",
232
+ "backgroundColor": "default",
233
+ "textAlignment": "left",
234
+ "checked": false
235
+ },
236
+ "content": [
237
+ {
238
+ "type": "text",
239
+ "text": "Nested Checked List Item",
240
+ "styles": {}
241
+ }
242
+ ],
243
+ "children": []
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "id": "15",
249
+ "type": "checkListItem",
250
+ "props": {
251
+ "textColor": "default",
252
+ "backgroundColor": "default",
253
+ "textAlignment": "left",
254
+ "checked": false
255
+ },
256
+ "content": [
257
+ {
258
+ "type": "text",
259
+ "text": "Checked List Item",
260
+ "styles": {}
261
+ }
262
+ ],
263
+ "children": []
139
264
  }
140
265
  ]
@@ -100,9 +100,26 @@
100
100
  "styles": {}
101
101
  }
102
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
+ ],
103
120
  "children": [
104
121
  {
105
- "id": "7",
122
+ "id": "8",
106
123
  "type": "numberedListItem",
107
124
  "props": {
108
125
  "textColor": "default",
@@ -119,7 +136,7 @@
119
136
  "children": []
120
137
  },
121
138
  {
122
- "id": "8",
139
+ "id": "9",
123
140
  "type": "numberedListItem",
124
141
  "props": {
125
142
  "textColor": "default",
@@ -138,7 +155,7 @@
138
155
  ]
139
156
  },
140
157
  {
141
- "id": "9",
158
+ "id": "10",
142
159
  "type": "numberedListItem",
143
160
  "props": {
144
161
  "textColor": "default",
@@ -153,5 +170,96 @@
153
170
  }
154
171
  ],
155
172
  "children": []
173
+ },
174
+ {
175
+ "id": "11",
176
+ "type": "checkListItem",
177
+ "props": {
178
+ "textColor": "default",
179
+ "backgroundColor": "default",
180
+ "textAlignment": "left",
181
+ "checked": false
182
+ },
183
+ "content": [
184
+ {
185
+ "type": "text",
186
+ "text": "Check List Item",
187
+ "styles": {}
188
+ }
189
+ ],
190
+ "children": []
191
+ },
192
+ {
193
+ "id": "12",
194
+ "type": "checkListItem",
195
+ "props": {
196
+ "textColor": "default",
197
+ "backgroundColor": "default",
198
+ "textAlignment": "left",
199
+ "checked": false
200
+ },
201
+ "content": [
202
+ {
203
+ "type": "text",
204
+ "text": "Check List Item",
205
+ "styles": {}
206
+ }
207
+ ],
208
+ "children": [
209
+ {
210
+ "id": "13",
211
+ "type": "checkListItem",
212
+ "props": {
213
+ "textColor": "default",
214
+ "backgroundColor": "default",
215
+ "textAlignment": "left",
216
+ "checked": false
217
+ },
218
+ "content": [
219
+ {
220
+ "type": "text",
221
+ "text": "Nested Check List Item",
222
+ "styles": {}
223
+ }
224
+ ],
225
+ "children": []
226
+ },
227
+ {
228
+ "id": "14",
229
+ "type": "checkListItem",
230
+ "props": {
231
+ "textColor": "default",
232
+ "backgroundColor": "default",
233
+ "textAlignment": "left",
234
+ "checked": false
235
+ },
236
+ "content": [
237
+ {
238
+ "type": "text",
239
+ "text": "Nested Check List Item",
240
+ "styles": {}
241
+ }
242
+ ],
243
+ "children": []
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "id": "15",
249
+ "type": "checkListItem",
250
+ "props": {
251
+ "textColor": "default",
252
+ "backgroundColor": "default",
253
+ "textAlignment": "left",
254
+ "checked": false
255
+ },
256
+ "content": [
257
+ {
258
+ "type": "text",
259
+ "text": "Nested Check List Item",
260
+ "styles": {}
261
+ }
262
+ ],
263
+ "children": []
156
264
  }
157
265
  ]