@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.
Files changed (139) hide show
  1. package/dist/blocknote.cjs +9 -9
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +2754 -2230
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/{en-D4taoCs4.cjs → en-BXVKCwYt.cjs} +2 -2
  6. package/dist/en-BXVKCwYt.cjs.map +1 -0
  7. package/dist/{en-B7ycW7c8.js → en-qGo6sk9V.js} +2 -3
  8. package/dist/en-qGo6sk9V.js.map +1 -0
  9. package/dist/locales.cjs +1 -1
  10. package/dist/locales.cjs.map +1 -1
  11. package/dist/locales.js +20 -39
  12. package/dist/locales.js.map +1 -1
  13. package/dist/style.css +1 -1
  14. package/dist/webpack-stats.json +1 -1
  15. package/package.json +4 -5
  16. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -3
  17. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +1 -1
  18. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2816 -0
  19. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +158 -0
  20. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +87 -17
  21. package/src/api/blockManipulation/selections/selection.ts +48 -1
  22. package/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.ts → textCursorPosition.ts} +7 -7
  23. package/src/api/getBlockInfoFromPos.ts +1 -1
  24. package/src/api/nodeConversions/blockToNode.ts +5 -2
  25. package/src/api/nodeConversions/nodeToBlock.ts +203 -8
  26. package/src/api/pmUtil.ts +3 -3
  27. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +6 -6
  28. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +1 -1
  29. package/src/blocks/TableBlockContent/TableBlockContent.ts +32 -2
  30. package/src/editor/Block.css +27 -1
  31. package/src/editor/BlockNoteEditor.test.ts +7 -0
  32. package/src/editor/BlockNoteEditor.ts +88 -37
  33. package/src/editor/BlockNoteExtension.ts +26 -0
  34. package/src/editor/BlockNoteExtensions.ts +28 -12
  35. package/src/editor/BlockNoteTipTapEditor.ts +23 -2
  36. package/src/extensions/Collaboration/CursorPlugin.ts +13 -7
  37. package/src/extensions/Collaboration/ForkYDocPlugin.test.ts +166 -0
  38. package/src/extensions/Collaboration/ForkYDocPlugin.ts +174 -0
  39. package/src/extensions/Collaboration/SyncPlugin.ts +7 -4
  40. package/src/extensions/Collaboration/UndoPlugin.ts +7 -4
  41. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +30 -0
  42. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +30 -0
  43. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -0
  44. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -0
  45. package/src/extensions/Comments/CommentsPlugin.ts +75 -70
  46. package/src/extensions/FilePanel/FilePanelPlugin.ts +50 -49
  47. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +56 -26
  48. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +22 -21
  49. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
  50. package/src/extensions/Placeholder/PlaceholderPlugin.ts +111 -108
  51. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +179 -170
  52. package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +22 -19
  53. package/src/extensions/SideMenu/SideMenuPlugin.ts +19 -18
  54. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +168 -168
  55. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -4
  56. package/src/extensions/Suggestions/SuggestionMarks.ts +175 -0
  57. package/src/extensions/TableHandles/TableHandlesPlugin.ts +153 -150
  58. package/src/i18n/locales/ar.ts +0 -1
  59. package/src/i18n/locales/de.ts +0 -1
  60. package/src/i18n/locales/en.ts +0 -1
  61. package/src/i18n/locales/es.ts +0 -1
  62. package/src/i18n/locales/fr.ts +0 -1
  63. package/src/i18n/locales/hr.ts +0 -1
  64. package/src/i18n/locales/is.ts +0 -1
  65. package/src/i18n/locales/it.ts +0 -1
  66. package/src/i18n/locales/ja.ts +0 -1
  67. package/src/i18n/locales/ko.ts +0 -1
  68. package/src/i18n/locales/nl.ts +0 -1
  69. package/src/i18n/locales/no.ts +0 -1
  70. package/src/i18n/locales/pl.ts +0 -1
  71. package/src/i18n/locales/pt.ts +0 -1
  72. package/src/i18n/locales/ru.ts +0 -1
  73. package/src/i18n/locales/sk.ts +0 -1
  74. package/src/i18n/locales/uk.ts +0 -1
  75. package/src/i18n/locales/vi.ts +0 -1
  76. package/src/i18n/locales/zh-tw.ts +0 -1
  77. package/src/i18n/locales/zh.ts +0 -1
  78. package/src/index.ts +18 -8
  79. package/src/pm-nodes/BlockContainer.ts +1 -1
  80. package/src/pm-nodes/BlockGroup.ts +1 -1
  81. package/src/pm-nodes/Doc.ts +1 -0
  82. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +1 -1
  83. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +4 -0
  84. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
  85. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +3 -1
  86. package/types/src/api/blockManipulation/selections/selection.d.ts +10 -0
  87. package/types/src/api/blockManipulation/selections/textCursorPosition.d.ts +5 -0
  88. package/types/src/api/blockManipulation/transactions.test.d.ts +0 -0
  89. package/types/src/api/clipboard/clipboardExternal.test.d.ts +1 -0
  90. package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
  91. package/types/src/api/clipboard/testUtil.d.ts +541 -0
  92. package/types/src/api/exporters/html/htmlConversion.test.d.ts +1 -0
  93. package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +1 -0
  94. package/types/src/api/nodeConversions/nodeConversions.test.d.ts +1 -0
  95. package/types/src/api/nodeConversions/nodeToBlock.d.ts +39 -2
  96. package/types/src/api/parsers/html/parseHTML.test.d.ts +1 -0
  97. package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +1 -0
  98. package/types/src/api/pmUtil.d.ts +3 -3
  99. package/types/src/api/testUtil/cases/customBlocks.d.ts +670 -0
  100. package/types/src/api/testUtil/cases/customInlineContent.d.ts +558 -0
  101. package/types/src/api/testUtil/cases/customStyles.d.ts +552 -0
  102. package/types/src/api/testUtil/cases/defaultSchema.d.ts +4 -0
  103. package/types/src/api/testUtil/index.d.ts +14 -0
  104. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +9 -0
  105. package/types/src/api/testUtil/paste.d.ts +2 -0
  106. package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +6 -0
  107. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +9 -1
  108. package/types/src/editor/BlockNoteEditor.d.ts +55 -9
  109. package/types/src/editor/BlockNoteExtension.d.ts +9 -0
  110. package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
  111. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
  112. package/types/src/extensions/Collaboration/CursorPlugin.d.ts +3 -3
  113. package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +41 -0
  114. package/types/src/extensions/Collaboration/ForkYDocPlugin.test.d.ts +1 -0
  115. package/types/src/extensions/Collaboration/SyncPlugin.d.ts +3 -3
  116. package/types/src/extensions/Collaboration/UndoPlugin.d.ts +3 -3
  117. package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +17 -0
  118. package/types/src/extensions/Comments/CommentsPlugin.d.ts +2 -4
  119. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +3 -4
  120. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -5
  121. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +3 -4
  122. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -3
  123. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +2 -3
  124. package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +2 -3
  125. package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +2 -3
  126. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +3 -4
  127. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +2 -4
  128. package/types/src/extensions/Suggestions/SuggestionMarks.d.ts +4 -0
  129. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +5 -6
  130. package/types/src/i18n/locales/en.d.ts +0 -1
  131. package/types/src/i18n/locales/sk.d.ts +0 -1
  132. package/types/src/index.d.ts +15 -8
  133. package/dist/en-B7ycW7c8.js.map +0 -1
  134. package/dist/en-D4taoCs4.cjs.map +0 -1
  135. package/dist/tsconfig.tsbuildinfo +0 -1
  136. package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +0 -844
  137. package/src/api/blockManipulation/selections/selection.test.ts +0 -72
  138. package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +0 -316
  139. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +0 -74
@@ -1,844 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`Test getSelection & setSelection > Basic 1`] = `
4
- {
5
- "blocks": [
6
- {
7
- "children": [],
8
- "content": [
9
- {
10
- "styles": {},
11
- "text": "Paragraph 0",
12
- "type": "text",
13
- },
14
- ],
15
- "id": "paragraph-0",
16
- "props": {
17
- "backgroundColor": "default",
18
- "textAlignment": "left",
19
- "textColor": "default",
20
- },
21
- "type": "paragraph",
22
- },
23
- {
24
- "children": [],
25
- "content": [
26
- {
27
- "styles": {},
28
- "text": "Paragraph 1",
29
- "type": "text",
30
- },
31
- ],
32
- "id": "paragraph-1",
33
- "props": {
34
- "backgroundColor": "default",
35
- "textAlignment": "left",
36
- "textColor": "default",
37
- },
38
- "type": "paragraph",
39
- },
40
- ],
41
- }
42
- `;
43
-
44
- exports[`Test getSelection & setSelection > Contains block with children 1`] = `
45
- {
46
- "blocks": [
47
- {
48
- "children": [],
49
- "content": [
50
- {
51
- "styles": {},
52
- "text": "Paragraph 1",
53
- "type": "text",
54
- },
55
- ],
56
- "id": "paragraph-1",
57
- "props": {
58
- "backgroundColor": "default",
59
- "textAlignment": "left",
60
- "textColor": "default",
61
- },
62
- "type": "paragraph",
63
- },
64
- {
65
- "children": [
66
- {
67
- "children": [
68
- {
69
- "children": [],
70
- "content": [
71
- {
72
- "styles": {},
73
- "text": "Double Nested Paragraph 0",
74
- "type": "text",
75
- },
76
- ],
77
- "id": "double-nested-paragraph-0",
78
- "props": {
79
- "backgroundColor": "default",
80
- "textAlignment": "left",
81
- "textColor": "default",
82
- },
83
- "type": "paragraph",
84
- },
85
- ],
86
- "content": [
87
- {
88
- "styles": {},
89
- "text": "Nested Paragraph 0",
90
- "type": "text",
91
- },
92
- ],
93
- "id": "nested-paragraph-0",
94
- "props": {
95
- "backgroundColor": "default",
96
- "textAlignment": "left",
97
- "textColor": "default",
98
- },
99
- "type": "paragraph",
100
- },
101
- ],
102
- "content": [
103
- {
104
- "styles": {},
105
- "text": "Paragraph with children",
106
- "type": "text",
107
- },
108
- ],
109
- "id": "paragraph-with-children",
110
- "props": {
111
- "backgroundColor": "default",
112
- "textAlignment": "left",
113
- "textColor": "default",
114
- },
115
- "type": "paragraph",
116
- },
117
- {
118
- "children": [],
119
- "content": [
120
- {
121
- "styles": {},
122
- "text": "Paragraph 2",
123
- "type": "text",
124
- },
125
- ],
126
- "id": "paragraph-2",
127
- "props": {
128
- "backgroundColor": "default",
129
- "textAlignment": "left",
130
- "textColor": "default",
131
- },
132
- "type": "paragraph",
133
- },
134
- ],
135
- }
136
- `;
137
-
138
- exports[`Test getSelection & setSelection > Ends in block with children 1`] = `
139
- {
140
- "blocks": [
141
- {
142
- "children": [],
143
- "content": [
144
- {
145
- "styles": {},
146
- "text": "Paragraph 1",
147
- "type": "text",
148
- },
149
- ],
150
- "id": "paragraph-1",
151
- "props": {
152
- "backgroundColor": "default",
153
- "textAlignment": "left",
154
- "textColor": "default",
155
- },
156
- "type": "paragraph",
157
- },
158
- {
159
- "children": [
160
- {
161
- "children": [
162
- {
163
- "children": [],
164
- "content": [
165
- {
166
- "styles": {},
167
- "text": "Double Nested Paragraph 0",
168
- "type": "text",
169
- },
170
- ],
171
- "id": "double-nested-paragraph-0",
172
- "props": {
173
- "backgroundColor": "default",
174
- "textAlignment": "left",
175
- "textColor": "default",
176
- },
177
- "type": "paragraph",
178
- },
179
- ],
180
- "content": [
181
- {
182
- "styles": {},
183
- "text": "Nested Paragraph 0",
184
- "type": "text",
185
- },
186
- ],
187
- "id": "nested-paragraph-0",
188
- "props": {
189
- "backgroundColor": "default",
190
- "textAlignment": "left",
191
- "textColor": "default",
192
- },
193
- "type": "paragraph",
194
- },
195
- ],
196
- "content": [
197
- {
198
- "styles": {},
199
- "text": "Paragraph with children",
200
- "type": "text",
201
- },
202
- ],
203
- "id": "paragraph-with-children",
204
- "props": {
205
- "backgroundColor": "default",
206
- "textAlignment": "left",
207
- "textColor": "default",
208
- },
209
- "type": "paragraph",
210
- },
211
- ],
212
- }
213
- `;
214
-
215
- exports[`Test getSelection & setSelection > Ends in nested block 1`] = `
216
- {
217
- "blocks": [
218
- {
219
- "children": [],
220
- "content": [
221
- {
222
- "styles": {},
223
- "text": "Paragraph 1",
224
- "type": "text",
225
- },
226
- ],
227
- "id": "paragraph-1",
228
- "props": {
229
- "backgroundColor": "default",
230
- "textAlignment": "left",
231
- "textColor": "default",
232
- },
233
- "type": "paragraph",
234
- },
235
- {
236
- "children": [
237
- {
238
- "children": [
239
- {
240
- "children": [],
241
- "content": [
242
- {
243
- "styles": {},
244
- "text": "Double Nested Paragraph 0",
245
- "type": "text",
246
- },
247
- ],
248
- "id": "double-nested-paragraph-0",
249
- "props": {
250
- "backgroundColor": "default",
251
- "textAlignment": "left",
252
- "textColor": "default",
253
- },
254
- "type": "paragraph",
255
- },
256
- ],
257
- "content": [
258
- {
259
- "styles": {},
260
- "text": "Nested Paragraph 0",
261
- "type": "text",
262
- },
263
- ],
264
- "id": "nested-paragraph-0",
265
- "props": {
266
- "backgroundColor": "default",
267
- "textAlignment": "left",
268
- "textColor": "default",
269
- },
270
- "type": "paragraph",
271
- },
272
- ],
273
- "content": [
274
- {
275
- "styles": {},
276
- "text": "Paragraph with children",
277
- "type": "text",
278
- },
279
- ],
280
- "id": "paragraph-with-children",
281
- "props": {
282
- "backgroundColor": "default",
283
- "textAlignment": "left",
284
- "textColor": "default",
285
- },
286
- "type": "paragraph",
287
- },
288
- ],
289
- }
290
- `;
291
-
292
- exports[`Test getSelection & setSelection > Ends in table 1`] = `
293
- {
294
- "blocks": [
295
- {
296
- "children": [],
297
- "content": [
298
- {
299
- "styles": {},
300
- "text": "Paragraph 6",
301
- "type": "text",
302
- },
303
- ],
304
- "id": "paragraph-6",
305
- "props": {
306
- "backgroundColor": "default",
307
- "textAlignment": "left",
308
- "textColor": "default",
309
- },
310
- "type": "paragraph",
311
- },
312
- {
313
- "children": [],
314
- "content": {
315
- "columnWidths": [
316
- undefined,
317
- undefined,
318
- undefined,
319
- ],
320
- "headerCols": undefined,
321
- "headerRows": undefined,
322
- "rows": [
323
- {
324
- "cells": [
325
- {
326
- "content": [
327
- {
328
- "styles": {},
329
- "text": "Cell 1",
330
- "type": "text",
331
- },
332
- ],
333
- "props": {
334
- "backgroundColor": "default",
335
- "colspan": 1,
336
- "rowspan": 1,
337
- "textAlignment": "left",
338
- "textColor": "default",
339
- },
340
- "type": "tableCell",
341
- },
342
- {
343
- "content": [
344
- {
345
- "styles": {},
346
- "text": "Cell 2",
347
- "type": "text",
348
- },
349
- ],
350
- "props": {
351
- "backgroundColor": "default",
352
- "colspan": 1,
353
- "rowspan": 1,
354
- "textAlignment": "left",
355
- "textColor": "default",
356
- },
357
- "type": "tableCell",
358
- },
359
- {
360
- "content": [
361
- {
362
- "styles": {},
363
- "text": "Cell 3",
364
- "type": "text",
365
- },
366
- ],
367
- "props": {
368
- "backgroundColor": "default",
369
- "colspan": 1,
370
- "rowspan": 1,
371
- "textAlignment": "left",
372
- "textColor": "default",
373
- },
374
- "type": "tableCell",
375
- },
376
- ],
377
- },
378
- {
379
- "cells": [
380
- {
381
- "content": [
382
- {
383
- "styles": {},
384
- "text": "Cell 4",
385
- "type": "text",
386
- },
387
- ],
388
- "props": {
389
- "backgroundColor": "default",
390
- "colspan": 1,
391
- "rowspan": 1,
392
- "textAlignment": "left",
393
- "textColor": "default",
394
- },
395
- "type": "tableCell",
396
- },
397
- {
398
- "content": [
399
- {
400
- "styles": {},
401
- "text": "Cell 5",
402
- "type": "text",
403
- },
404
- ],
405
- "props": {
406
- "backgroundColor": "default",
407
- "colspan": 1,
408
- "rowspan": 1,
409
- "textAlignment": "left",
410
- "textColor": "default",
411
- },
412
- "type": "tableCell",
413
- },
414
- {
415
- "content": [
416
- {
417
- "styles": {},
418
- "text": "Cell 6",
419
- "type": "text",
420
- },
421
- ],
422
- "props": {
423
- "backgroundColor": "default",
424
- "colspan": 1,
425
- "rowspan": 1,
426
- "textAlignment": "left",
427
- "textColor": "default",
428
- },
429
- "type": "tableCell",
430
- },
431
- ],
432
- },
433
- {
434
- "cells": [
435
- {
436
- "content": [
437
- {
438
- "styles": {},
439
- "text": "Cell 7",
440
- "type": "text",
441
- },
442
- ],
443
- "props": {
444
- "backgroundColor": "default",
445
- "colspan": 1,
446
- "rowspan": 1,
447
- "textAlignment": "left",
448
- "textColor": "default",
449
- },
450
- "type": "tableCell",
451
- },
452
- {
453
- "content": [
454
- {
455
- "styles": {},
456
- "text": "Cell 8",
457
- "type": "text",
458
- },
459
- ],
460
- "props": {
461
- "backgroundColor": "default",
462
- "colspan": 1,
463
- "rowspan": 1,
464
- "textAlignment": "left",
465
- "textColor": "default",
466
- },
467
- "type": "tableCell",
468
- },
469
- {
470
- "content": [
471
- {
472
- "styles": {},
473
- "text": "Cell 9",
474
- "type": "text",
475
- },
476
- ],
477
- "props": {
478
- "backgroundColor": "default",
479
- "colspan": 1,
480
- "rowspan": 1,
481
- "textAlignment": "left",
482
- "textColor": "default",
483
- },
484
- "type": "tableCell",
485
- },
486
- ],
487
- },
488
- ],
489
- "type": "tableContent",
490
- },
491
- "id": "table-0",
492
- "props": {
493
- "textColor": "default",
494
- },
495
- "type": "table",
496
- },
497
- ],
498
- }
499
- `;
500
-
501
- exports[`Test getSelection & setSelection > Starts in block with children 1`] = `
502
- {
503
- "blocks": [
504
- {
505
- "children": [
506
- {
507
- "children": [
508
- {
509
- "children": [],
510
- "content": [
511
- {
512
- "styles": {},
513
- "text": "Double Nested Paragraph 0",
514
- "type": "text",
515
- },
516
- ],
517
- "id": "double-nested-paragraph-0",
518
- "props": {
519
- "backgroundColor": "default",
520
- "textAlignment": "left",
521
- "textColor": "default",
522
- },
523
- "type": "paragraph",
524
- },
525
- ],
526
- "content": [
527
- {
528
- "styles": {},
529
- "text": "Nested Paragraph 0",
530
- "type": "text",
531
- },
532
- ],
533
- "id": "nested-paragraph-0",
534
- "props": {
535
- "backgroundColor": "default",
536
- "textAlignment": "left",
537
- "textColor": "default",
538
- },
539
- "type": "paragraph",
540
- },
541
- ],
542
- "content": [
543
- {
544
- "styles": {},
545
- "text": "Paragraph with children",
546
- "type": "text",
547
- },
548
- ],
549
- "id": "paragraph-with-children",
550
- "props": {
551
- "backgroundColor": "default",
552
- "textAlignment": "left",
553
- "textColor": "default",
554
- },
555
- "type": "paragraph",
556
- },
557
- {
558
- "children": [],
559
- "content": [
560
- {
561
- "styles": {},
562
- "text": "Paragraph 2",
563
- "type": "text",
564
- },
565
- ],
566
- "id": "paragraph-2",
567
- "props": {
568
- "backgroundColor": "default",
569
- "textAlignment": "left",
570
- "textColor": "default",
571
- },
572
- "type": "paragraph",
573
- },
574
- ],
575
- }
576
- `;
577
-
578
- exports[`Test getSelection & setSelection > Starts in nested block 1`] = `
579
- {
580
- "blocks": [
581
- {
582
- "children": [
583
- {
584
- "children": [],
585
- "content": [
586
- {
587
- "styles": {},
588
- "text": "Double Nested Paragraph 0",
589
- "type": "text",
590
- },
591
- ],
592
- "id": "double-nested-paragraph-0",
593
- "props": {
594
- "backgroundColor": "default",
595
- "textAlignment": "left",
596
- "textColor": "default",
597
- },
598
- "type": "paragraph",
599
- },
600
- ],
601
- "content": [
602
- {
603
- "styles": {},
604
- "text": "Nested Paragraph 0",
605
- "type": "text",
606
- },
607
- ],
608
- "id": "nested-paragraph-0",
609
- "props": {
610
- "backgroundColor": "default",
611
- "textAlignment": "left",
612
- "textColor": "default",
613
- },
614
- "type": "paragraph",
615
- },
616
- {
617
- "children": [],
618
- "content": [
619
- {
620
- "styles": {},
621
- "text": "Paragraph 2",
622
- "type": "text",
623
- },
624
- ],
625
- "id": "paragraph-2",
626
- "props": {
627
- "backgroundColor": "default",
628
- "textAlignment": "left",
629
- "textColor": "default",
630
- },
631
- "type": "paragraph",
632
- },
633
- ],
634
- }
635
- `;
636
-
637
- exports[`Test getSelection & setSelection > Starts in table 1`] = `
638
- {
639
- "blocks": [
640
- {
641
- "children": [],
642
- "content": {
643
- "columnWidths": [
644
- undefined,
645
- undefined,
646
- undefined,
647
- ],
648
- "headerCols": undefined,
649
- "headerRows": undefined,
650
- "rows": [
651
- {
652
- "cells": [
653
- {
654
- "content": [
655
- {
656
- "styles": {},
657
- "text": "Cell 1",
658
- "type": "text",
659
- },
660
- ],
661
- "props": {
662
- "backgroundColor": "default",
663
- "colspan": 1,
664
- "rowspan": 1,
665
- "textAlignment": "left",
666
- "textColor": "default",
667
- },
668
- "type": "tableCell",
669
- },
670
- {
671
- "content": [
672
- {
673
- "styles": {},
674
- "text": "Cell 2",
675
- "type": "text",
676
- },
677
- ],
678
- "props": {
679
- "backgroundColor": "default",
680
- "colspan": 1,
681
- "rowspan": 1,
682
- "textAlignment": "left",
683
- "textColor": "default",
684
- },
685
- "type": "tableCell",
686
- },
687
- {
688
- "content": [
689
- {
690
- "styles": {},
691
- "text": "Cell 3",
692
- "type": "text",
693
- },
694
- ],
695
- "props": {
696
- "backgroundColor": "default",
697
- "colspan": 1,
698
- "rowspan": 1,
699
- "textAlignment": "left",
700
- "textColor": "default",
701
- },
702
- "type": "tableCell",
703
- },
704
- ],
705
- },
706
- {
707
- "cells": [
708
- {
709
- "content": [
710
- {
711
- "styles": {},
712
- "text": "Cell 4",
713
- "type": "text",
714
- },
715
- ],
716
- "props": {
717
- "backgroundColor": "default",
718
- "colspan": 1,
719
- "rowspan": 1,
720
- "textAlignment": "left",
721
- "textColor": "default",
722
- },
723
- "type": "tableCell",
724
- },
725
- {
726
- "content": [
727
- {
728
- "styles": {},
729
- "text": "Cell 5",
730
- "type": "text",
731
- },
732
- ],
733
- "props": {
734
- "backgroundColor": "default",
735
- "colspan": 1,
736
- "rowspan": 1,
737
- "textAlignment": "left",
738
- "textColor": "default",
739
- },
740
- "type": "tableCell",
741
- },
742
- {
743
- "content": [
744
- {
745
- "styles": {},
746
- "text": "Cell 6",
747
- "type": "text",
748
- },
749
- ],
750
- "props": {
751
- "backgroundColor": "default",
752
- "colspan": 1,
753
- "rowspan": 1,
754
- "textAlignment": "left",
755
- "textColor": "default",
756
- },
757
- "type": "tableCell",
758
- },
759
- ],
760
- },
761
- {
762
- "cells": [
763
- {
764
- "content": [
765
- {
766
- "styles": {},
767
- "text": "Cell 7",
768
- "type": "text",
769
- },
770
- ],
771
- "props": {
772
- "backgroundColor": "default",
773
- "colspan": 1,
774
- "rowspan": 1,
775
- "textAlignment": "left",
776
- "textColor": "default",
777
- },
778
- "type": "tableCell",
779
- },
780
- {
781
- "content": [
782
- {
783
- "styles": {},
784
- "text": "Cell 8",
785
- "type": "text",
786
- },
787
- ],
788
- "props": {
789
- "backgroundColor": "default",
790
- "colspan": 1,
791
- "rowspan": 1,
792
- "textAlignment": "left",
793
- "textColor": "default",
794
- },
795
- "type": "tableCell",
796
- },
797
- {
798
- "content": [
799
- {
800
- "styles": {},
801
- "text": "Cell 9",
802
- "type": "text",
803
- },
804
- ],
805
- "props": {
806
- "backgroundColor": "default",
807
- "colspan": 1,
808
- "rowspan": 1,
809
- "textAlignment": "left",
810
- "textColor": "default",
811
- },
812
- "type": "tableCell",
813
- },
814
- ],
815
- },
816
- ],
817
- "type": "tableContent",
818
- },
819
- "id": "table-0",
820
- "props": {
821
- "textColor": "default",
822
- },
823
- "type": "table",
824
- },
825
- {
826
- "children": [],
827
- "content": [
828
- {
829
- "styles": {},
830
- "text": "Paragraph 7",
831
- "type": "text",
832
- },
833
- ],
834
- "id": "paragraph-7",
835
- "props": {
836
- "backgroundColor": "default",
837
- "textAlignment": "left",
838
- "textColor": "default",
839
- },
840
- "type": "paragraph",
841
- },
842
- ],
843
- }
844
- `;