@blocknote/xl-multi-column 0.50.0 → 0.51.1

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.
@@ -105,17 +105,6 @@ exports[`Test removeBlocks > Remove all blocks in column 1`] = `
105
105
  },
106
106
  "type": "paragraph",
107
107
  },
108
- {
109
- "children": [],
110
- "content": [],
111
- "id": "trailing-paragraph",
112
- "props": {
113
- "backgroundColor": "default",
114
- "textAlignment": "left",
115
- "textColor": "default",
116
- },
117
- "type": "paragraph",
118
- },
119
108
  ]
120
109
  `;
121
110
 
@@ -207,17 +196,6 @@ exports[`Test removeBlocks > Remove all blocks in column and block after 1`] = `
207
196
  },
208
197
  "type": "paragraph",
209
198
  },
210
- {
211
- "children": [],
212
- "content": [],
213
- "id": "trailing-paragraph",
214
- "props": {
215
- "backgroundColor": "default",
216
- "textAlignment": "left",
217
- "textColor": "default",
218
- },
219
- "type": "paragraph",
220
- },
221
199
  ]
222
200
  `;
223
201
 
@@ -292,17 +270,6 @@ exports[`Test removeBlocks > Remove all blocks in columns 1`] = `
292
270
  },
293
271
  "type": "paragraph",
294
272
  },
295
- {
296
- "children": [],
297
- "content": [],
298
- "id": "trailing-paragraph",
299
- "props": {
300
- "backgroundColor": "default",
301
- "textAlignment": "left",
302
- "textColor": "default",
303
- },
304
- "type": "paragraph",
305
- },
306
273
  ]
307
274
  `;
308
275
 
@@ -360,17 +327,6 @@ exports[`Test removeBlocks > Remove all blocks in columns and block after 1`] =
360
327
  },
361
328
  "type": "paragraph",
362
329
  },
363
- {
364
- "children": [],
365
- "content": [],
366
- "id": "trailing-paragraph",
367
- "props": {
368
- "backgroundColor": "default",
369
- "textAlignment": "left",
370
- "textColor": "default",
371
- },
372
- "type": "paragraph",
373
- },
374
330
  ]
375
331
  `;
376
332
 
@@ -479,17 +435,6 @@ exports[`Test removeBlocks > Remove all blocks in second column 1`] = `
479
435
  },
480
436
  "type": "paragraph",
481
437
  },
482
- {
483
- "children": [],
484
- "content": [],
485
- "id": "trailing-paragraph",
486
- "props": {
487
- "backgroundColor": "default",
488
- "textAlignment": "left",
489
- "textColor": "default",
490
- },
491
- "type": "paragraph",
492
- },
493
438
  ]
494
439
  `;
495
440
 
@@ -564,17 +509,6 @@ exports[`Test removeBlocks > Remove all columns in columnList 1`] = `
564
509
  },
565
510
  "type": "paragraph",
566
511
  },
567
- {
568
- "children": [],
569
- "content": [],
570
- "id": "trailing-paragraph",
571
- "props": {
572
- "backgroundColor": "default",
573
- "textAlignment": "left",
574
- "textColor": "default",
575
- },
576
- "type": "paragraph",
577
- },
578
512
  ]
579
513
  `;
580
514
 
@@ -632,17 +566,6 @@ exports[`Test removeBlocks > Remove all columns in columnList and block after 1`
632
566
  },
633
567
  "type": "paragraph",
634
568
  },
635
- {
636
- "children": [],
637
- "content": [],
638
- "id": "trailing-paragraph",
639
- "props": {
640
- "backgroundColor": "default",
641
- "textAlignment": "left",
642
- "textColor": "default",
643
- },
644
- "type": "paragraph",
645
- },
646
569
  ]
647
570
  `;
648
571
 
@@ -734,17 +657,6 @@ exports[`Test removeBlocks > Remove column and and block in column after 1`] = `
734
657
  },
735
658
  "type": "paragraph",
736
659
  },
737
- {
738
- "children": [],
739
- "content": [],
740
- "id": "trailing-paragraph",
741
- "props": {
742
- "backgroundColor": "default",
743
- "textAlignment": "left",
744
- "textColor": "default",
745
- },
746
- "type": "paragraph",
747
- },
748
660
  ]
749
661
  `;
750
662
 
@@ -853,17 +765,6 @@ exports[`Test removeBlocks > Remove column in columnList 1`] = `
853
765
  },
854
766
  "type": "paragraph",
855
767
  },
856
- {
857
- "children": [],
858
- "content": [],
859
- "id": "trailing-paragraph",
860
- "props": {
861
- "backgroundColor": "default",
862
- "textAlignment": "left",
863
- "textColor": "default",
864
- },
865
- "type": "paragraph",
866
- },
867
768
  ]
868
769
  `;
869
770
 
@@ -955,16 +856,5 @@ exports[`Test removeBlocks > Remove column in columnList and block after 1`] = `
955
856
  },
956
857
  "type": "paragraph",
957
858
  },
958
- {
959
- "children": [],
960
- "content": [],
961
- "id": "trailing-paragraph",
962
- "props": {
963
- "backgroundColor": "default",
964
- "textAlignment": "left",
965
- "textColor": "default",
966
- },
967
- "type": "paragraph",
968
- },
969
859
  ]
970
860
  `;
@@ -150,17 +150,6 @@ exports[`Test replaceBlocks > Replace all blocks in column with single block 1`]
150
150
  },
151
151
  "type": "paragraph",
152
152
  },
153
- {
154
- "children": [],
155
- "content": [],
156
- "id": "trailing-paragraph",
157
- "props": {
158
- "backgroundColor": "default",
159
- "textAlignment": "left",
160
- "textColor": "default",
161
- },
162
- "type": "paragraph",
163
- },
164
153
  ]
165
154
  `;
166
155
 
@@ -252,17 +241,6 @@ exports[`Test replaceBlocks > Replace all blocks in columns with single block 1`
252
241
  },
253
242
  "type": "paragraph",
254
243
  },
255
- {
256
- "children": [],
257
- "content": [],
258
- "id": "trailing-paragraph",
259
- "props": {
260
- "backgroundColor": "default",
261
- "textAlignment": "left",
262
- "textColor": "default",
263
- },
264
- "type": "paragraph",
265
- },
266
244
  ]
267
245
  `;
268
246
 
@@ -478,16 +456,5 @@ exports[`Test replaceBlocks > Replace paragraph with column list above column li
478
456
  },
479
457
  "type": "paragraph",
480
458
  },
481
- {
482
- "children": [],
483
- "content": [],
484
- "id": "trailing-paragraph",
485
- "props": {
486
- "backgroundColor": "default",
487
- "textAlignment": "left",
488
- "textColor": "default",
489
- },
490
- "type": "paragraph",
491
- },
492
459
  ]
493
460
  `;
@@ -133,17 +133,6 @@ exports[`Test updateBlock > Update column list new children 1`] = `
133
133
  },
134
134
  "type": "paragraph",
135
135
  },
136
- {
137
- "children": [],
138
- "content": [],
139
- "id": "trailing-paragraph",
140
- "props": {
141
- "backgroundColor": "default",
142
- "textAlignment": "left",
143
- "textColor": "default",
144
- },
145
- "type": "paragraph",
146
- },
147
136
  ]
148
137
  `;
149
138
 
@@ -297,17 +286,6 @@ exports[`Test updateBlock > Update column new children 1`] = `
297
286
  },
298
287
  "type": "paragraph",
299
288
  },
300
- {
301
- "children": [],
302
- "content": [],
303
- "id": "trailing-paragraph",
304
- "props": {
305
- "backgroundColor": "default",
306
- "textAlignment": "left",
307
- "textColor": "default",
308
- },
309
- "type": "paragraph",
310
- },
311
289
  ]
312
290
  `;
313
291
 
@@ -743,17 +721,6 @@ exports[`Test updateBlock > Update nested paragraph to column list 1`] = `
743
721
  },
744
722
  "type": "paragraph",
745
723
  },
746
- {
747
- "children": [],
748
- "content": [],
749
- "id": "trailing-paragraph",
750
- "props": {
751
- "backgroundColor": "default",
752
- "textAlignment": "left",
753
- "textColor": "default",
754
- },
755
- "type": "paragraph",
756
- },
757
724
  ]
758
725
  `;
759
726
 
@@ -1153,16 +1120,5 @@ exports[`Test updateBlock > Update paragraph to column list 1`] = `
1153
1120
  },
1154
1121
  "type": "paragraph",
1155
1122
  },
1156
- {
1157
- "children": [],
1158
- "content": [],
1159
- "id": "trailing-paragraph",
1160
- "props": {
1161
- "backgroundColor": "default",
1162
- "textAlignment": "left",
1163
- "textColor": "default",
1164
- },
1165
- "type": "paragraph",
1166
- },
1167
1123
  ]
1168
1124
  `;
@@ -28,6 +28,54 @@ describe("Test moveBlocksUp", () => {
28
28
 
29
29
  expect(getEditor().document).toMatchSnapshot();
30
30
  });
31
+
32
+ it("Selection spans column list", () => {
33
+ getEditor().setSelection("paragraph-1", "paragraph-2");
34
+
35
+ getEditor().moveBlocksUp();
36
+
37
+ expect(getEditor().document).toMatchSnapshot();
38
+ });
39
+
40
+ it("Selection across columns", () => {
41
+ getEditor().setSelection("column-paragraph-1", "column-paragraph-2");
42
+
43
+ getEditor().moveBlocksUp();
44
+
45
+ expect(getEditor().document).toMatchSnapshot();
46
+ });
47
+
48
+ it("Selection starts outside, ends in column", () => {
49
+ getEditor().setSelection("paragraph-1", "column-paragraph-1");
50
+
51
+ getEditor().moveBlocksUp();
52
+
53
+ expect(getEditor().document).toMatchSnapshot();
54
+ });
55
+
56
+ it("Selection starts outside, ends in second column", () => {
57
+ getEditor().setSelection("paragraph-1", "column-paragraph-2");
58
+
59
+ getEditor().moveBlocksUp();
60
+
61
+ expect(getEditor().document).toMatchSnapshot();
62
+ });
63
+
64
+ it("Selection starts in column, ends outside", () => {
65
+ getEditor().setSelection("column-paragraph-2", "paragraph-2");
66
+
67
+ getEditor().moveBlocksUp();
68
+
69
+ expect(getEditor().document).toMatchSnapshot();
70
+ });
71
+
72
+ it("Selection starts in first column, ends outside", () => {
73
+ getEditor().setSelection("column-paragraph-1", "paragraph-2");
74
+
75
+ getEditor().moveBlocksUp();
76
+
77
+ expect(getEditor().document).toMatchSnapshot();
78
+ });
31
79
  });
32
80
 
33
81
  describe("Test moveBlocksDown", () => {
@@ -54,4 +102,52 @@ describe("Test moveBlocksDown", () => {
54
102
 
55
103
  expect(getEditor().document).toMatchSnapshot();
56
104
  });
105
+
106
+ it("Selection spans column list", () => {
107
+ getEditor().setSelection("paragraph-1", "paragraph-2");
108
+
109
+ getEditor().moveBlocksDown();
110
+
111
+ expect(getEditor().document).toMatchSnapshot();
112
+ });
113
+
114
+ it("Selection across columns", () => {
115
+ getEditor().setSelection("column-paragraph-1", "column-paragraph-2");
116
+
117
+ getEditor().moveBlocksDown();
118
+
119
+ expect(getEditor().document).toMatchSnapshot();
120
+ });
121
+
122
+ it("Selection starts outside, ends in column", () => {
123
+ getEditor().setSelection("paragraph-1", "column-paragraph-1");
124
+
125
+ getEditor().moveBlocksDown();
126
+
127
+ expect(getEditor().document).toMatchSnapshot();
128
+ });
129
+
130
+ it("Selection starts outside, ends in second column", () => {
131
+ getEditor().setSelection("paragraph-1", "column-paragraph-2");
132
+
133
+ getEditor().moveBlocksDown();
134
+
135
+ expect(getEditor().document).toMatchSnapshot();
136
+ });
137
+
138
+ it("Selection starts in column, ends outside", () => {
139
+ getEditor().setSelection("column-paragraph-2", "paragraph-2");
140
+
141
+ getEditor().moveBlocksDown();
142
+
143
+ expect(getEditor().document).toMatchSnapshot();
144
+ });
145
+
146
+ it("Selection starts in first column, ends outside", () => {
147
+ getEditor().setSelection("column-paragraph-1", "paragraph-2");
148
+
149
+ getEditor().moveBlocksDown();
150
+
151
+ expect(getEditor().document).toMatchSnapshot();
152
+ });
57
153
  });
@@ -106,8 +106,4 @@ const testDocument: PartialBlock<
106
106
  type: "paragraph",
107
107
  content: "Paragraph 2",
108
108
  },
109
- {
110
- id: "trailing-paragraph",
111
- type: "paragraph",
112
- },
113
109
  ];