quill-table-up 2.3.1 → 2.4.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.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/dist/index.d.ts +35 -12
  3. package/dist/index.js +26 -25
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.js +35 -31
  6. package/dist/index.umd.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/__tests__/e2e/table-blots.test.ts +22 -0
  9. package/src/__tests__/e2e/table-keyboard-handler.test.ts +218 -0
  10. package/src/__tests__/e2e/table-selection.test.ts +137 -131
  11. package/src/__tests__/unit/table-cell-merge.test.ts +261 -1
  12. package/src/__tests__/unit/table-clipboard.test.ts +62 -44
  13. package/src/__tests__/unit/table-insert.test.ts +39 -2
  14. package/src/__tests__/unit/table-redo-undo.test.ts +69 -0
  15. package/src/__tests__/unit/table-remove.test.ts +4 -2
  16. package/src/__tests__/unit/utils.ts +22 -4
  17. package/src/__tests__/unit/vitest.d.ts +4 -1
  18. package/src/formats/index.ts +6 -0
  19. package/src/formats/overrides/block-embed.ts +54 -0
  20. package/src/formats/overrides/block.ts +23 -4
  21. package/src/formats/overrides/index.ts +1 -0
  22. package/src/formats/table-cell-format.ts +39 -6
  23. package/src/formats/table-cell-inner-format.ts +70 -21
  24. package/src/formats/table-main-format.ts +92 -1
  25. package/src/formats/table-row-format.ts +13 -2
  26. package/src/modules/table-clipboard.ts +30 -35
  27. package/src/modules/table-resize/table-resize-box.ts +2 -2
  28. package/src/modules/table-resize/table-resize-common.ts +3 -5
  29. package/src/modules/table-resize/table-resize-line.ts +1 -1
  30. package/src/modules/table-resize/table-resize-scale.ts +1 -1
  31. package/src/modules/table-scrollbar.ts +9 -10
  32. package/src/modules/table-selection.ts +52 -31
  33. package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  34. package/src/table-up.ts +57 -23
  35. package/src/utils/blot-helper.ts +7 -4
  36. package/src/utils/index.ts +1 -1
  37. package/src/utils/{scroll-event-handle.ts → scroll-event-helper.ts} +7 -0
  38. package/src/utils/types.ts +2 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quill-table-up",
3
3
  "type": "module",
4
- "version": "2.3.1",
4
+ "version": "2.4.1",
5
5
  "packageManager": "pnpm@10.12.1",
6
6
  "description": "A table module for quill2.x",
7
7
  "author": "zzxming",
@@ -58,7 +58,7 @@
58
58
  "@typescript-eslint/parser": "^8.34.0",
59
59
  "@vitest/coverage-v8": "^3.2.3",
60
60
  "@vitest/ui": "^3.2.3",
61
- "@zzxming/eslint-config": "0.4.5",
61
+ "@zzxming/eslint-config": "^0.5.0",
62
62
  "autoprefixer": "^10.4.21",
63
63
  "eslint": "^9.29.0",
64
64
  "gulp": "^5.0.1",
@@ -88,3 +88,25 @@ extendTest('test table tools should hide after table removed', async ({ page, ed
88
88
  await expect(page.locator('#container2 .table-up-toolbox .table-up-resize-box')).not.toBeAttached();
89
89
  await expect(page.locator('#container2 .table-up-toolbox .table-up-scale')).not.toBeAttached();
90
90
  });
91
+
92
+ extendTest('remove list in cell should work correctly', async ({ page, editorPage }) => {
93
+ editorPage.index = 0;
94
+ await editorPage.setContents([
95
+ { insert: '\n' },
96
+ { insert: { 'table-up-col': { tableId: 'dg216cyh1hh', colId: 'rbeybfr14n', full: false, width: 373 } } },
97
+ { insert: { 'table-up-col': { tableId: 'dg216cyh1hh', colId: '4yqh0essvp3', full: false, width: 373 } } },
98
+ { insert: '123' },
99
+ { attributes: { 'list': 'ordered', 'table-up-cell-inner': { tableId: 'dg216cyh1hh', rowId: '2lreudvqubb', colId: 'rbeybfr14n', rowspan: 1, colspan: 1 } }, insert: '\n' },
100
+ { insert: '123' },
101
+ { attributes: { 'list': 'ordered', 'table-up-cell-inner': { tableId: 'dg216cyh1hh', rowId: '2lreudvqubb', colId: 'rbeybfr14n', rowspan: 1, colspan: 1 } }, insert: '\n\n' },
102
+ { attributes: { 'table-up-cell-inner': { tableId: 'dg216cyh1hh', rowId: '2lreudvqubb', colId: '4yqh0essvp3', rowspan: 1, colspan: 1 } }, insert: '\n' },
103
+ { insert: '\n' },
104
+ ]);
105
+ await page.waitForTimeout(1000);
106
+ await editorPage.setSelection(11, 0);
107
+
108
+ await page.keyboard.press('Backspace');
109
+ await page.keyboard.press('Backspace');
110
+
111
+ expect(await page.locator('#editor1 .ql-editor .ql-table li').count()).toBe(2);
112
+ });
@@ -0,0 +1,218 @@
1
+ import { expect, test } from '@playwright/test';
2
+ import { createTableBySelect, extendTest } from './utils';
3
+
4
+ test.beforeEach(async ({ page }) => {
5
+ await page.goto('http://127.0.0.1:5500/docs/test.html');
6
+ page.locator('.ql-container.ql-snow');
7
+ });
8
+
9
+ extendTest.describe('table cell keyboard handler enter', () => {
10
+ extendTest('cursor at the start of BlockEmbed', async ({ page, editorPage }) => {
11
+ editorPage.index = 0;
12
+ await editorPage.setContents([
13
+ { insert: '\n' },
14
+ { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 100 } } },
15
+ { insert: { video: 'https://quilljs.com/' } },
16
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
17
+ { insert: '\n' },
18
+ ]);
19
+ await page.waitForTimeout(1000);
20
+
21
+ await editorPage.setSelection(2, 0);
22
+ await page.keyboard.press('Enter');
23
+ await expect(page.locator('#editor1 .ql-table-wrapper .ql-table-cell-inner iframe').nth(0)).toBeVisible();
24
+ await expect(page.locator('#editor1 .ql-table-wrapper .ql-table-cell-inner p').nth(0)).toBeVisible();
25
+ const delta = await editorPage.getContents();
26
+ const contents = [
27
+ { insert: '\n' },
28
+ { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 100 } } },
29
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
30
+ { insert: { video: 'https://quilljs.com/' } },
31
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
32
+ { insert: '\n' },
33
+ ];
34
+ for (const [i, op] of delta.ops.entries()) {
35
+ expect(op).toStrictEqual(contents[i]);
36
+ }
37
+ });
38
+
39
+ extendTest('cursor at the end of BlockEmbed', async ({ page, editorPage }) => {
40
+ editorPage.index = 0;
41
+ await editorPage.setContents([
42
+ { insert: '\n' },
43
+ { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 100 } } },
44
+ { insert: { video: 'https://quilljs.com/' } },
45
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
46
+ { insert: '\n' },
47
+ ]);
48
+ await page.waitForTimeout(1000);
49
+
50
+ await editorPage.setSelection(3, 0);
51
+ await page.keyboard.press('Enter');
52
+ await expect(page.locator('#editor1 .ql-table-wrapper .ql-table-cell-inner p').nth(0)).toBeVisible();
53
+ await expect(page.locator('#editor1 .ql-table-wrapper .ql-table-cell-inner iframe').nth(0)).toBeVisible();
54
+ const delta = await editorPage.getContents();
55
+ const contents = [
56
+ { insert: '\n' },
57
+ { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 100 } } },
58
+ { insert: { video: 'https://quilljs.com/' } },
59
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n\n' },
60
+ { insert: '\n' },
61
+ ];
62
+ for (const [i, op] of delta.ops.entries()) {
63
+ expect(op).toStrictEqual(contents[i]);
64
+ }
65
+ });
66
+
67
+ extendTest('selection multiple line', async ({ page, editorPage }) => {
68
+ editorPage.index = 0;
69
+ await editorPage.setContents([
70
+ { insert: '\n' },
71
+ { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 100 } } },
72
+ { insert: { video: 'https://quilljs.com/' } },
73
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
74
+ { insert: '123' },
75
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
76
+ { insert: '123' },
77
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
78
+ ]);
79
+ await page.waitForTimeout(1000);
80
+
81
+ await editorPage.setSelection(3, 7);
82
+ await page.keyboard.press('Enter');
83
+ await expect(page.locator('#editor1 .ql-table-wrapper .ql-table-cell-inner p')).toHaveCount(1);
84
+ });
85
+ });
86
+
87
+ extendTest.describe('table cell keyboard handler ArrowUp and ArrowDown', () => {
88
+ extendTest('test TableSelection should update when selection change', async ({ page, editorPage }) => {
89
+ editorPage.index = 0;
90
+ await createTableBySelect(page, 'container1', 3, 3);
91
+
92
+ await page.locator('#editor1 .ql-table .ql-table-cell').nth(0).click();
93
+ const selectionLine = page.locator('#container1 .table-up-selection .table-up-selection__line');
94
+ await expect(selectionLine).toBeVisible();
95
+
96
+ await page.keyboard.press('ArrowRight');
97
+ await expect(selectionLine).toBeVisible();
98
+ const newSelectionWrapper = (await selectionLine.boundingBox())!;
99
+ expect(newSelectionWrapper).not.toBeNull();
100
+ const cell1Bound = (await page.locator('#editor1 .ql-editor td').nth(1).boundingBox())!;
101
+ expect(cell1Bound).not.toBeNull();
102
+ expect(cell1Bound).toEqual(newSelectionWrapper);
103
+ });
104
+
105
+ extendTest('test TableSelection and TableMenuSelect should hide when selection out table', async ({ page }) => {
106
+ await createTableBySelect(page, 'container1', 3, 3);
107
+ const firstCell1 = page.locator('#editor1').getByRole('cell').nth(0);
108
+ await firstCell1.click();
109
+ expect(page.locator('#container1 .table-up-selection')).toBeVisible();
110
+
111
+ await page.keyboard.down('ArrowUp');
112
+ expect(page.locator('#container1 .table-up-selection')).not.toBeVisible();
113
+
114
+ await firstCell1.click();
115
+ await firstCell1.click({ button: 'right' });
116
+ await expect(page.locator('#container1 .table-up-selection')).toBeVisible();
117
+ await expect(page.locator('.table-up-menu.is-contextmenu')).toBeVisible();
118
+
119
+ await page.keyboard.down('ArrowUp');
120
+ await expect(page.locator('#container1 .table-up-selection')).not.toBeVisible();
121
+ await expect(page.locator('.table-up-menu.is-contextmenu')).not.toBeVisible();
122
+
123
+ await createTableBySelect(page, 'container2', 3, 3);
124
+ const firstCell2 = page.locator('#editor2').getByRole('cell').nth(0);
125
+ await firstCell2.click();
126
+ await expect(page.locator('#container2 .table-up-selection')).toBeVisible();
127
+
128
+ await page.keyboard.down('ArrowUp');
129
+ await expect(page.locator('#container2 .table-up-selection')).not.toBeVisible();
130
+
131
+ await firstCell2.click();
132
+ await expect(page.locator('#container2 .table-up-selection')).toBeVisible();
133
+ await expect(page.locator('#container2 .table-up-menu')).toBeVisible();
134
+
135
+ await page.keyboard.down('ArrowUp');
136
+ await expect(page.locator('#container2 .table-up-selection')).not.toBeVisible();
137
+ await expect(page.locator('#container2 .table-up-menu')).not.toBeVisible();
138
+ });
139
+
140
+ extendTest('test table keyboard ArrowUp and ArrowDown should work', async ({ page, editorPage }) => {
141
+ editorPage.index = 0;
142
+ editorPage.setContents([
143
+ { insert: '123456\n' },
144
+ { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: 'mnpytyt1cno', full: false, width: 291 } } },
145
+ { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: '6ihx044tflt', full: false, width: 291 } } },
146
+ { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: 'raiomwr9yuc', full: false, width: 291 } } },
147
+ { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: 'qiuz7k09q6r', full: false, width: 291 } } },
148
+ { insert: '123' },
149
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'mnpytyt1cno', rowspan: 2, colspan: 2 } }, insert: '\n' },
150
+ { insert: '123456' },
151
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'mnpytyt1cno', rowspan: 2, colspan: 2 } }, insert: '\n' },
152
+ { insert: '123' },
153
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'mnpytyt1cno', rowspan: 2, colspan: 2 } }, insert: '\n' },
154
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'raiomwr9yuc', rowspan: 1, colspan: 1 } }, insert: '\n' },
155
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'qiuz7k09q6r', rowspan: 1, colspan: 1 } }, insert: '\n' },
156
+ { insert: '123' },
157
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'vhg5x933cs', colId: 'raiomwr9yuc', rowspan: 1, colspan: 2 } }, insert: '\n' },
158
+ { insert: '123456' },
159
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'vhg5x933cs', colId: 'raiomwr9yuc', rowspan: 1, colspan: 2 } }, insert: '\n' },
160
+ { insert: '123' },
161
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'vhg5x933cs', colId: 'raiomwr9yuc', rowspan: 1, colspan: 2 } }, insert: '\n' },
162
+ { insert: '12345' },
163
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: 'mnpytyt1cno', rowspan: 1, colspan: 1 } }, insert: '\n' },
164
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: '6ihx044tflt', rowspan: 1, colspan: 1 } }, insert: '\n' },
165
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: 'raiomwr9yuc', rowspan: 1, colspan: 1 } }, insert: '\n' },
166
+ { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: 'qiuz7k09q6r', rowspan: 1, colspan: 1 } }, insert: '\n' },
167
+ { insert: '123456\n' },
168
+ ]);
169
+
170
+ await editorPage.setSelection(50, 0);
171
+ await page.keyboard.press('ArrowUp');
172
+ expect((await editorPage.getSelection())!.index).toBe(39);
173
+
174
+ await editorPage.setSelection(48, 0);
175
+ await page.keyboard.press('ArrowUp');
176
+ expect((await editorPage.getSelection())!.index).toBe(25);
177
+
178
+ await editorPage.setSelection(14, 0);
179
+ await page.keyboard.press('ArrowUp');
180
+ expect((await editorPage.getSelection())!.index).toBe(6);
181
+
182
+ await editorPage.setSelection(25, 0);
183
+ await page.keyboard.press('ArrowDown');
184
+ expect((await editorPage.getSelection())!.index).toBe(46);
185
+
186
+ await editorPage.setSelection(26, 0);
187
+ await page.keyboard.press('ArrowDown');
188
+ expect((await editorPage.getSelection())!.index).toBe(28);
189
+
190
+ await editorPage.setSelection(48, 0);
191
+ await page.keyboard.press('ArrowDown');
192
+ expect((await editorPage.getSelection())!.index).toBe(52);
193
+
194
+ await editorPage.setSelection(50, 0);
195
+ await page.keyboard.press('ArrowDown');
196
+ expect((await editorPage.getSelection())!.index).toBe(52);
197
+ });
198
+
199
+ extendTest('test TableSelection should update when selection change and menu display', async ({ page, editorPage }) => {
200
+ editorPage.index = 0;
201
+ await createTableBySelect(page, 'container1', 3, 3);
202
+
203
+ await page.locator('#editor1 .ql-table .ql-table-cell').nth(0).click();
204
+ const selectionLine = page.locator('#container1 .table-up-selection .table-up-selection__line');
205
+ await expect(selectionLine).toBeVisible();
206
+
207
+ await page.locator('#editor1 .ql-table .ql-table-cell').nth(0).click({ button: 'right' });
208
+ await expect(page.locator('.table-up-menu.is-contextmenu')).toBeVisible();
209
+
210
+ await page.locator('.table-up-menu.is-contextmenu .table-up-menu__item').filter({ hasText: 'Set background color' }).first().click();
211
+ await page.waitForTimeout(1000);
212
+ await expect(selectionLine).not.toBeVisible();
213
+
214
+ await page.keyboard.press('ArrowDown');
215
+ await expect(selectionLine).not.toBeVisible();
216
+ await expect(page.locator('.table-up-menu.is-contextmenu')).toBeVisible();
217
+ });
218
+ });
@@ -347,137 +347,6 @@ extendTest('table resize should update TableSelection', async ({ page, editorPag
347
347
  expect(newThirdCellSelectionBound).toEqual(newCellBound);
348
348
  });
349
349
 
350
- extendTest('test TableSelection should update when selection change', async ({ page, editorPage }) => {
351
- editorPage.index = 0;
352
- await createTableBySelect(page, 'container1', 3, 3);
353
-
354
- await page.locator('#editor1 .ql-table .ql-table-cell').nth(0).click();
355
- const selectionLine = page.locator('#container1 .table-up-selection .table-up-selection__line');
356
- await expect(selectionLine).toBeVisible();
357
-
358
- await page.keyboard.press('ArrowRight');
359
- await expect(selectionLine).toBeVisible();
360
- const newSelectionWrapper = (await selectionLine.boundingBox())!;
361
- expect(newSelectionWrapper).not.toBeNull();
362
- const cell1Bound = (await page.locator('#editor1 .ql-editor td').nth(1).boundingBox())!;
363
- expect(cell1Bound).not.toBeNull();
364
- expect(cell1Bound).toEqual(newSelectionWrapper);
365
- });
366
-
367
- extendTest('test TableSelection and TableMenuSelect should hide when selection out table', async ({ page }) => {
368
- await createTableBySelect(page, 'container1', 3, 3);
369
- const firstCell1 = page.locator('#editor1').getByRole('cell').nth(0);
370
- await firstCell1.click();
371
- expect(page.locator('#container1 .table-up-selection')).toBeVisible();
372
-
373
- await page.keyboard.down('ArrowUp');
374
- expect(page.locator('#container1 .table-up-selection')).not.toBeVisible();
375
-
376
- await firstCell1.click();
377
- await firstCell1.click({ button: 'right' });
378
- await expect(page.locator('#container1 .table-up-selection')).toBeVisible();
379
- await expect(page.locator('.table-up-menu.is-contextmenu')).toBeVisible();
380
-
381
- await page.keyboard.down('ArrowUp');
382
- await expect(page.locator('#container1 .table-up-selection')).not.toBeVisible();
383
- await expect(page.locator('.table-up-menu.is-contextmenu')).not.toBeVisible();
384
-
385
- await createTableBySelect(page, 'container2', 3, 3);
386
- const firstCell2 = page.locator('#editor2').getByRole('cell').nth(0);
387
- await firstCell2.click();
388
- await expect(page.locator('#container2 .table-up-selection')).toBeVisible();
389
-
390
- await page.keyboard.down('ArrowUp');
391
- await expect(page.locator('#container2 .table-up-selection')).not.toBeVisible();
392
-
393
- await firstCell2.click();
394
- await expect(page.locator('#container2 .table-up-selection')).toBeVisible();
395
- await expect(page.locator('#container2 .table-up-menu')).toBeVisible();
396
-
397
- await page.keyboard.down('ArrowUp');
398
- await expect(page.locator('#container2 .table-up-selection')).not.toBeVisible();
399
- await expect(page.locator('#container2 .table-up-menu')).not.toBeVisible();
400
- });
401
-
402
- extendTest('test table keyboard ArrowUp and ArrowDown should work', async ({ page, editorPage }) => {
403
- editorPage.index = 0;
404
- editorPage.setContents([
405
- { insert: '123456\n' },
406
- { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: 'mnpytyt1cno', full: false, width: 291 } } },
407
- { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: '6ihx044tflt', full: false, width: 291 } } },
408
- { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: 'raiomwr9yuc', full: false, width: 291 } } },
409
- { insert: { 'table-up-col': { tableId: 'njo6syk0zqb', colId: 'qiuz7k09q6r', full: false, width: 291 } } },
410
- { insert: '123' },
411
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'mnpytyt1cno', rowspan: 2, colspan: 2 } }, insert: '\n' },
412
- { insert: '123456' },
413
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'mnpytyt1cno', rowspan: 2, colspan: 2 } }, insert: '\n' },
414
- { insert: '123' },
415
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'mnpytyt1cno', rowspan: 2, colspan: 2 } }, insert: '\n' },
416
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'raiomwr9yuc', rowspan: 1, colspan: 1 } }, insert: '\n' },
417
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'rvwpsb2pky', colId: 'qiuz7k09q6r', rowspan: 1, colspan: 1 } }, insert: '\n' },
418
- { insert: '123' },
419
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'vhg5x933cs', colId: 'raiomwr9yuc', rowspan: 1, colspan: 2 } }, insert: '\n' },
420
- { insert: '123456' },
421
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'vhg5x933cs', colId: 'raiomwr9yuc', rowspan: 1, colspan: 2 } }, insert: '\n' },
422
- { insert: '123' },
423
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'vhg5x933cs', colId: 'raiomwr9yuc', rowspan: 1, colspan: 2 } }, insert: '\n' },
424
- { insert: '12345' },
425
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: 'mnpytyt1cno', rowspan: 1, colspan: 1 } }, insert: '\n' },
426
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: '6ihx044tflt', rowspan: 1, colspan: 1 } }, insert: '\n' },
427
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: 'raiomwr9yuc', rowspan: 1, colspan: 1 } }, insert: '\n' },
428
- { attributes: { 'table-up-cell-inner': { tableId: 'njo6syk0zqb', rowId: 'nsb7mrygbk9', colId: 'qiuz7k09q6r', rowspan: 1, colspan: 1 } }, insert: '\n' },
429
- { insert: '123456\n' },
430
- ]);
431
-
432
- await editorPage.setSelection(50, 0);
433
- await page.keyboard.press('ArrowUp');
434
- expect((await editorPage.getSelection())!.index).toBe(39);
435
-
436
- await editorPage.setSelection(48, 0);
437
- await page.keyboard.press('ArrowUp');
438
- expect((await editorPage.getSelection())!.index).toBe(25);
439
-
440
- await editorPage.setSelection(14, 0);
441
- await page.keyboard.press('ArrowUp');
442
- expect((await editorPage.getSelection())!.index).toBe(6);
443
-
444
- await editorPage.setSelection(25, 0);
445
- await page.keyboard.press('ArrowDown');
446
- expect((await editorPage.getSelection())!.index).toBe(46);
447
-
448
- await editorPage.setSelection(26, 0);
449
- await page.keyboard.press('ArrowDown');
450
- expect((await editorPage.getSelection())!.index).toBe(28);
451
-
452
- await editorPage.setSelection(48, 0);
453
- await page.keyboard.press('ArrowDown');
454
- expect((await editorPage.getSelection())!.index).toBe(52);
455
-
456
- await editorPage.setSelection(50, 0);
457
- await page.keyboard.press('ArrowDown');
458
- expect((await editorPage.getSelection())!.index).toBe(52);
459
- });
460
-
461
- extendTest('test TableSelection should update when selection change and menu display', async ({ page, editorPage }) => {
462
- editorPage.index = 0;
463
- await createTableBySelect(page, 'container1', 3, 3);
464
-
465
- await page.locator('#editor1 .ql-table .ql-table-cell').nth(0).click();
466
- const selectionLine = page.locator('#container1 .table-up-selection .table-up-selection__line');
467
- await expect(selectionLine).toBeVisible();
468
-
469
- await page.locator('#editor1 .ql-table .ql-table-cell').nth(0).click({ button: 'right' });
470
- await expect(page.locator('.table-up-menu.is-contextmenu')).toBeVisible();
471
-
472
- await page.locator('.table-up-menu.is-contextmenu .table-up-menu__item').filter({ hasText: 'Set background color' }).first().click();
473
- await page.waitForTimeout(1000);
474
- await expect(selectionLine).not.toBeVisible();
475
-
476
- await page.keyboard.press('ArrowDown');
477
- await expect(selectionLine).not.toBeVisible();
478
- await expect(page.locator('.table-up-menu.is-contextmenu')).toBeVisible();
479
- });
480
-
481
350
  extendTest('should handle delete table cell text when selected tds', async ({ page, editorPage, browserName }) => {
482
351
  editorPage.index = 0;
483
352
  await editorPage.setContents([
@@ -664,3 +533,140 @@ extendTest('TableSelection should not update when input composition', async ({ p
664
533
  const composingBounding = (await selectionLine.boundingBox())!;
665
534
  expect(composingBounding).toEqual(bounding);
666
535
  });
536
+
537
+ extendTest.describe('TableSelection should work correct when wrapper scroll', () => {
538
+ extendTest('TableSelection in quill root scroll', async ({ page, editorPage }) => {
539
+ editorPage.index = 0;
540
+ await editorPage.setContents([
541
+ { insert: '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' },
542
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: 'odojvz7psp8', full: false, width: 400 } } },
543
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: 'thtn1vm1a0l', full: false, width: 400 } } },
544
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: '6ci2o6ophk8', full: false, width: 400 } } },
545
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: 'k7jzkt8ede8', full: false, width: 400 } } },
546
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: '6nj5cy7mrat', full: false, width: 400 } } },
547
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
548
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
549
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
550
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
551
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
552
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
553
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
554
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
555
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
556
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
557
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
558
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
559
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
560
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
561
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
562
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
563
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
564
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
565
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
566
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
567
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
568
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
569
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
570
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
571
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
572
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
573
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
574
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
575
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
576
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
577
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
578
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
579
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
580
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
581
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
582
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
583
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
584
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
585
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
586
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
587
+ { insert: '\n\n\n\n\n\n\n\n\n\n\n\n\n' },
588
+ ]);
589
+ await page.waitForTimeout(1000);
590
+
591
+ await page.locator('#editor1 .ql-editor td').nth(0).click();
592
+ await page.mouse.down();
593
+ await page.mouse.wheel(0, 200);
594
+ await page.mouse.wheel(500, 0);
595
+ await page.waitForTimeout(1000);
596
+ const bounding = (await page.locator('#editor1 .ql-editor td').nth(12).boundingBox())!;
597
+ expect(bounding).not.toBeNull();
598
+ await page.mouse.move(bounding.x + bounding.width / 2, bounding.y + bounding.height / 2);
599
+
600
+ const selectedTds = await page.evaluate(() => {
601
+ return (window.quills[0].getModule('table-up') as any).tableSelection!.selectedTds;
602
+ });
603
+ expect(selectedTds.length).toBe(9);
604
+ });
605
+
606
+ extendTest('TableSelection in body scroll', async ({ page, editorPage }) => {
607
+ editorPage.index = 4;
608
+ await editorPage.setContents([
609
+ { insert: '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' },
610
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: 'odojvz7psp8', full: false, width: 400 } } },
611
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: 'thtn1vm1a0l', full: false, width: 400 } } },
612
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: '6ci2o6ophk8', full: false, width: 400 } } },
613
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: 'k7jzkt8ede8', full: false, width: 400 } } },
614
+ { insert: { 'table-up-col': { tableId: 'q9rcu2l5en', colId: '6nj5cy7mrat', full: false, width: 400 } } },
615
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
616
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
617
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
618
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
619
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: '1zdvvq78kqa', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
620
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
621
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
622
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
623
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
624
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'kkyehoxutvs', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
625
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
626
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
627
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
628
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
629
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'ife4q2in0se', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
630
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
631
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
632
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
633
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
634
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'waafccgk7yk', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
635
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
636
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
637
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
638
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
639
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'lb7s1smtyh', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
640
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
641
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
642
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
643
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
644
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'jgvhoknv7tf', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
645
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
646
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
647
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
648
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
649
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'bxqnf58tmfd', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
650
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: 'odojvz7psp8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
651
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: 'thtn1vm1a0l', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
652
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: '6ci2o6ophk8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
653
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: 'k7jzkt8ede8', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
654
+ { attributes: { 'table-up-cell-inner': { tableId: 'q9rcu2l5en', rowId: 'dctaip1l39v', colId: '6nj5cy7mrat', rowspan: 1, colspan: 1, style: 'height: 100px;' } }, insert: '\n' },
655
+ { insert: '\n\n\n\n\n\n\n\n\n\n\n\n\n' },
656
+ ]);
657
+ await page.waitForTimeout(1000);
658
+
659
+ await page.locator('#editor5 .ql-editor td').nth(0).click();
660
+ await page.mouse.down();
661
+ await page.mouse.wheel(500, 200);
662
+ await page.waitForTimeout(1000);
663
+ const bounding = (await page.locator('#editor5 .ql-editor td').nth(12).boundingBox())!;
664
+ expect(bounding).not.toBeNull();
665
+ await page.mouse.move(bounding.x + bounding.width / 2, bounding.y + bounding.height / 2);
666
+
667
+ const selectedTds = await page.evaluate(() => {
668
+ return (window.quills[4].getModule('table-up') as any).tableSelection!.selectedTds;
669
+ });
670
+ expect(selectedTds.length).toBe(9);
671
+ });
672
+ });