@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.
- package/dist/blocknote.js +5730 -2891
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +7 -7
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/exporters/html/__snapshots__/file/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/button/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -0
- package/src/api/exporters/html/externalHTMLExporter.ts +4 -3
- package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +1 -1
- package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +2 -2
- package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -0
- package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +10 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +3 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +6 -2
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +3 -0
- package/src/api/exporters/markdown/markdownExporter.ts +2 -0
- package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +42 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +262 -4
- package/src/api/parsers/html/__snapshots__/paste/list-test.json +74 -2
- package/src/api/parsers/html/__snapshots__/paste/parse-basic-block-types.json +3 -1
- package/src/api/parsers/html/__snapshots__/paste/parse-fake-image-caption.json +3 -1
- package/src/api/parsers/html/__snapshots__/paste/parse-mixed-nested-lists.json +135 -10
- package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +132 -7
- package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists.json +111 -3
- package/src/api/parsers/html/parseHTML.test.ts +166 -95
- package/src/api/testUtil/cases/customBlocks.ts +82 -33
- package/src/api/testUtil/cases/customInlineContent.ts +1 -1
- package/src/api/testUtil/cases/customStyles.ts +1 -1
- package/src/api/testUtil/cases/defaultSchema.ts +185 -4
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +163 -0
- package/src/blocks/AudioBlockContent/audioBlockHelpers.ts +5 -0
- package/src/blocks/FileBlockContent/FileBlockContent.ts +120 -0
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +377 -0
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +134 -354
- package/src/blocks/ImageBlockContent/imageBlockHelpers.ts +6 -0
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +3 -0
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +266 -0
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +2 -1
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +1 -0
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +181 -0
- package/src/blocks/VideoBlockContent/videoBlockHelpers.ts +6 -0
- package/src/blocks/defaultBlockTypeGuards.ts +53 -1
- package/src/blocks/defaultBlocks.ts +11 -2
- package/src/editor/Block.css +89 -27
- package/src/editor/BlockNoteEditor.ts +24 -10
- package/src/editor/BlockNoteSchema.ts +12 -3
- package/src/editor/transformPasted.ts +2 -1
- package/src/extensions/{ImagePanel/ImageToolbarPlugin.ts → FilePanel/FilePanelPlugin.ts} +22 -25
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +14 -2
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +72 -2
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +27 -27
- package/src/extensions/TextAlignment/TextAlignmentExtension.ts +7 -1
- package/src/i18n/locales/en.ts +117 -11
- package/src/i18n/locales/fr.ts +118 -11
- package/src/i18n/locales/index.ts +8 -2
- package/src/i18n/locales/is.ts +295 -0
- package/src/i18n/locales/ja.ts +323 -0
- package/src/i18n/locales/ko.ts +307 -0
- package/src/i18n/locales/nl.ts +108 -8
- package/src/i18n/locales/pl.ts +287 -0
- package/src/i18n/locales/pt.ts +295 -0
- package/src/i18n/locales/vi.ts +295 -0
- package/src/i18n/locales/zh.ts +123 -8
- package/src/index.ts +9 -2
- package/src/pm-nodes/BlockContainer.ts +18 -6
- package/src/schema/blocks/createSpec.ts +1 -0
- package/src/schema/blocks/internal.ts +10 -0
- package/src/schema/blocks/types.ts +40 -5
- package/src/util/string.ts +12 -0
- package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +7 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +272 -54
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +222 -16
- package/types/src/api/testUtil/cases/customStyles.d.ts +222 -16
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +101 -0
- package/types/src/blocks/AudioBlockContent/audioBlockHelpers.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +93 -0
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +30 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +50 -14
- package/types/src/blocks/ImageBlockContent/imageBlockHelpers.d.ts +4 -0
- package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +55 -0
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +129 -0
- package/types/src/blocks/VideoBlockContent/videoBlockHelpers.d.ts +4 -0
- package/types/src/blocks/defaultBlockTypeGuards.d.ts +6 -1
- package/types/src/blocks/defaultBlocks.d.ts +444 -32
- package/types/src/editor/BlockNoteEditor.d.ts +12 -5
- package/types/src/extensions/{ImagePanel/ImageToolbarPlugin.d.ts → FilePanel/FilePanelPlugin.d.ts} +9 -12
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
- package/types/src/i18n/locales/en.d.ts +56 -7
- package/types/src/i18n/locales/fr.d.ts +2 -184
- package/types/src/i18n/locales/index.d.ts +7 -1
- package/types/src/i18n/locales/is.d.ts +2 -0
- package/types/src/i18n/locales/ja.d.ts +2 -0
- package/types/src/i18n/locales/ko.d.ts +2 -0
- package/types/src/i18n/locales/pl.d.ts +2 -0
- package/types/src/i18n/locales/pt.d.ts +2 -0
- package/types/src/i18n/locales/vi.d.ts +2 -0
- package/types/src/index.d.ts +8 -2
- package/types/src/pm-nodes/BlockContainer.d.ts +1 -1
- package/types/src/schema/blocks/internal.d.ts +1 -1
- package/types/src/schema/blocks/types.d.ts +25 -1
- package/types/src/util/string.d.ts +1 -0
- /package/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
- /package/types/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
|
@@ -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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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
|
]
|
|
@@ -76,88 +76,147 @@ describe("Parse HTML", () => {
|
|
|
76
76
|
|
|
77
77
|
it("list test", async () => {
|
|
78
78
|
const html = `<ul>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
<li>First</li>
|
|
80
|
+
<li>Second</li>
|
|
81
|
+
<li>Third</li>
|
|
82
|
+
<li>
|
|
83
|
+
<input type="checkbox">
|
|
84
|
+
Fourth
|
|
85
|
+
</li>
|
|
86
|
+
<li>
|
|
87
|
+
<input type="checkbox">
|
|
88
|
+
Fifth
|
|
89
|
+
</li>
|
|
90
|
+
<li>Five Parent
|
|
91
|
+
<ul>
|
|
92
|
+
<li>Child 1</li>
|
|
93
|
+
<li>Child 2</li>
|
|
94
|
+
<li>
|
|
95
|
+
<input type="checkbox">
|
|
96
|
+
Child 3
|
|
97
|
+
</li>
|
|
98
|
+
<li>
|
|
99
|
+
<input type="checkbox">
|
|
100
|
+
Child 4
|
|
101
|
+
</li>
|
|
102
|
+
</ul>
|
|
103
|
+
</li>
|
|
104
|
+
</ul>`;
|
|
89
105
|
await parseHTMLAndCompareSnapshots(html, "list-test");
|
|
90
106
|
});
|
|
91
107
|
|
|
92
108
|
it("Parse nested lists", async () => {
|
|
93
109
|
const html = `<ul>
|
|
94
110
|
<li>Bullet List Item</li>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</li>
|
|
103
|
-
</ul>
|
|
104
|
-
<li>
|
|
105
|
-
Bullet List Item
|
|
106
|
-
</li>
|
|
111
|
+
<li>Bullet List Item
|
|
112
|
+
<ul>
|
|
113
|
+
<li>Nested Bullet List Item</li>
|
|
114
|
+
<li>Nested Bullet List Item</li>
|
|
115
|
+
</ul>
|
|
116
|
+
</li>
|
|
117
|
+
<li>Bullet List Item</li>
|
|
107
118
|
</ul>
|
|
108
119
|
<ol>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
<li>Numbered List Item</li>
|
|
121
|
+
<li>Numbered List Item
|
|
122
|
+
<ol>
|
|
123
|
+
<li>Nested Numbered List Item</li>
|
|
124
|
+
<li>Nested Numbered List Item</li>
|
|
125
|
+
</ol>
|
|
126
|
+
</li>
|
|
127
|
+
<li>Numbered List Item</li>
|
|
128
|
+
</ol>
|
|
129
|
+
<ul>
|
|
130
|
+
<li>
|
|
131
|
+
<input type="checkbox">
|
|
132
|
+
Check List Item
|
|
133
|
+
</li>
|
|
134
|
+
<li>
|
|
135
|
+
<input type="checkbox">
|
|
136
|
+
Check List Item
|
|
137
|
+
<ul>
|
|
138
|
+
<li>
|
|
139
|
+
<input type="checkbox">
|
|
140
|
+
Nested Check List Item
|
|
141
|
+
</li>
|
|
142
|
+
<li>
|
|
143
|
+
<input type="checkbox">
|
|
144
|
+
Nested Check List Item
|
|
145
|
+
</li>
|
|
146
|
+
</ul>
|
|
147
|
+
</li>
|
|
148
|
+
<li>
|
|
149
|
+
<input type="checkbox">
|
|
150
|
+
Nested Check List Item
|
|
151
|
+
</li>
|
|
152
|
+
</ul>`;
|
|
124
153
|
|
|
125
154
|
await parseHTMLAndCompareSnapshots(html, "parse-nested-lists");
|
|
126
155
|
});
|
|
127
156
|
|
|
128
157
|
it("Parse nested lists with paragraphs", async () => {
|
|
129
158
|
const html = `<ul>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
159
|
+
<li>
|
|
160
|
+
<p>Bullet List Item</p>
|
|
161
|
+
</li>
|
|
162
|
+
<li>
|
|
163
|
+
<p>Bullet List Item</p>
|
|
164
|
+
<ul>
|
|
165
|
+
<li>
|
|
166
|
+
<p>Nested Bullet List Item</p>
|
|
167
|
+
</li>
|
|
168
|
+
<li>
|
|
169
|
+
<p>Nested Bullet List Item</p>
|
|
170
|
+
</li>
|
|
171
|
+
</ul>
|
|
172
|
+
</li>
|
|
173
|
+
<li>
|
|
174
|
+
<p>Bullet List Item</p>
|
|
175
|
+
</li>
|
|
144
176
|
</ul>
|
|
145
177
|
<ol>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
178
|
+
<li>
|
|
179
|
+
<p>Numbered List Item</p>
|
|
180
|
+
</li>
|
|
181
|
+
<li>
|
|
182
|
+
<p>Numbered List Item</p>
|
|
183
|
+
<ol>
|
|
184
|
+
<li>
|
|
185
|
+
<p>Nested Numbered List Item</p>
|
|
186
|
+
</li>
|
|
187
|
+
<li>
|
|
188
|
+
<p>Nested Numbered List Item</p>
|
|
189
|
+
</li>
|
|
190
|
+
</ol>
|
|
191
|
+
</li>
|
|
192
|
+
<li>
|
|
193
|
+
<p>Numbered List Item</p>
|
|
194
|
+
</li>
|
|
195
|
+
</ol>
|
|
196
|
+
<ul>
|
|
197
|
+
<li>
|
|
198
|
+
<input type="checkbox">
|
|
199
|
+
<p>Checked List Item</p>
|
|
200
|
+
</li>
|
|
201
|
+
<li>
|
|
202
|
+
<input type="checkbox">
|
|
203
|
+
<p>Checked List Item</p>
|
|
204
|
+
<ul>
|
|
205
|
+
<li>
|
|
206
|
+
<input type="checkbox">
|
|
207
|
+
<p>Nested Checked List Item</p>
|
|
208
|
+
</li>
|
|
209
|
+
<li>
|
|
210
|
+
<label><input type="checkbox"></label>
|
|
211
|
+
<p>Nested Checked List Item</p>
|
|
212
|
+
</li>
|
|
213
|
+
</ul>
|
|
214
|
+
</li>
|
|
215
|
+
<li>
|
|
216
|
+
<input type="checkbox">
|
|
217
|
+
<p>Checked List Item</p>
|
|
218
|
+
</li>
|
|
219
|
+
</ul>`;
|
|
161
220
|
|
|
162
221
|
await parseHTMLAndCompareSnapshots(
|
|
163
222
|
html,
|
|
@@ -167,37 +226,49 @@ describe("Parse HTML", () => {
|
|
|
167
226
|
|
|
168
227
|
it("Parse mixed nested lists", async () => {
|
|
169
228
|
const html = `<ul>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
</li>
|
|
179
|
-
</ol>
|
|
180
|
-
</li>
|
|
181
|
-
<li>
|
|
182
|
-
Bullet List Item
|
|
183
|
-
</li>
|
|
229
|
+
<li>Bullet List Item</li>
|
|
230
|
+
<li>Bullet List Item
|
|
231
|
+
<ol>
|
|
232
|
+
<li>Nested Numbered List Item</li>
|
|
233
|
+
<li>Nested Numbered List Item</li>
|
|
234
|
+
</ol>
|
|
235
|
+
</li>
|
|
236
|
+
<li>Bullet List Item</li>
|
|
184
237
|
</ul>
|
|
185
238
|
<ol>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
</ol
|
|
239
|
+
<li>Numbered List Item</li>
|
|
240
|
+
<li>Numbered List Item
|
|
241
|
+
<ul>
|
|
242
|
+
<li>
|
|
243
|
+
<input type="checkbox" checked>
|
|
244
|
+
Nested Check List Item
|
|
245
|
+
</li>
|
|
246
|
+
<li>
|
|
247
|
+
<input type="checkbox">
|
|
248
|
+
Nested Check List Item
|
|
249
|
+
</li>
|
|
250
|
+
</ul>
|
|
251
|
+
</li>
|
|
252
|
+
<li>Numbered List Item</li>
|
|
253
|
+
</ol>
|
|
254
|
+
<ul>
|
|
255
|
+
<li>
|
|
256
|
+
<input type="checkbox" checked>
|
|
257
|
+
Check List Item
|
|
258
|
+
</li>
|
|
259
|
+
<li>
|
|
260
|
+
<input type="checkbox">
|
|
261
|
+
Check List Item
|
|
262
|
+
<ul>
|
|
263
|
+
<li>Nested Bullet List Item</li>
|
|
264
|
+
<li>Nested Bullet List Item</li>
|
|
265
|
+
</ul>
|
|
266
|
+
</li>
|
|
267
|
+
<li>
|
|
268
|
+
<input type="checkbox" checked>
|
|
269
|
+
Nested Check List Item
|
|
270
|
+
</li>
|
|
271
|
+
</ul>`;
|
|
201
272
|
|
|
202
273
|
await parseHTMLAndCompareSnapshots(html, "parse-mixed-nested-lists");
|
|
203
274
|
});
|