quill-table-up 2.4.0 → 2.4.2

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 (33) hide show
  1. package/README.md +8 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.d.ts +7 -2
  4. package/dist/index.js +30 -23
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.umd.js +34 -27
  7. package/dist/index.umd.js.map +1 -1
  8. package/package.json +5 -4
  9. package/src/__tests__/e2e/table-blots.test.ts +69 -0
  10. package/src/__tests__/e2e/table-hack.test.ts +5 -5
  11. package/src/__tests__/e2e/table-keyboard-handler.test.ts +157 -3
  12. package/src/__tests__/e2e/table-selection.test.ts +0 -109
  13. package/src/__tests__/unit/table-cell-merge.test.ts +79 -6
  14. package/src/__tests__/unit/table-clipboard.test.ts +138 -182
  15. package/src/__tests__/unit/table-hack.test.ts +73 -73
  16. package/src/__tests__/unit/table-insert.test.ts +35 -32
  17. package/src/__tests__/unit/table-redo-undo.test.ts +98 -20
  18. package/src/__tests__/unit/table-remove.test.ts +8 -8
  19. package/src/__tests__/unit/utils.test.ts +4 -4
  20. package/src/__tests__/unit/utils.ts +1 -1
  21. package/src/formats/overrides/block.ts +13 -0
  22. package/src/formats/table-cell-format.ts +33 -7
  23. package/src/formats/table-cell-inner-format.ts +23 -1
  24. package/src/modules/table-menu/constants.ts +12 -1
  25. package/src/modules/table-resize/table-resize-common.ts +2 -4
  26. package/src/modules/table-scrollbar.ts +4 -5
  27. package/src/modules/table-selection.ts +6 -4
  28. package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  29. package/src/style/index.less +6 -3
  30. package/src/style/table-selection.less +0 -1
  31. package/src/svg/convert-cell.svg +7 -0
  32. package/src/utils/is.ts +1 -0
  33. package/src/utils/types.ts +1 -0
@@ -149,7 +149,7 @@ describe('hack html convert', () => {
149
149
  </table>
150
150
  </div>
151
151
  `,
152
- { ignoreAttrs: ['class', 'data-table-id'] },
152
+ { ignoreAttrs: ['data-tag', 'class', 'data-table-id'] },
153
153
  );
154
154
  });
155
155
  });
@@ -227,18 +227,18 @@ describe('hack format cell', () => {
227
227
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
228
228
  { insert: '1234' },
229
229
  { attributes: { underline: true, bold: true }, insert: '56789' },
230
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
230
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
231
231
  { attributes: { underline: true, bold: true }, insert: '12345' },
232
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
232
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
233
233
  { attributes: { underline: true, bold: true }, insert: '12345' },
234
234
  { insert: '6789' },
235
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
235
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
236
236
  { insert: '2' },
237
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
237
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
238
238
  { insert: '3' },
239
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
239
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
240
240
  { insert: '4' },
241
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
241
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
242
242
  { insert: '\n' },
243
243
  ]),
244
244
  );
@@ -262,22 +262,22 @@ describe('hack format cell', () => {
262
262
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
263
263
  { insert: '1234' },
264
264
  { attributes: { underline: true, bold: true }, insert: '56789' },
265
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
265
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
266
266
  { attributes: { underline: true, bold: true }, insert: '12345' },
267
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
267
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
268
268
  { attributes: { underline: true, bold: true }, insert: '12345' },
269
269
  { insert: '6789' },
270
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
270
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
271
271
  { insert: '2345' },
272
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
272
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
273
273
  { insert: '2345' },
274
- { attributes: { 'list': 'ordered', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
274
+ { attributes: { 'list': 'ordered', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
275
275
  { insert: '2345' },
276
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
276
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
277
277
  { insert: '3' },
278
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
278
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
279
279
  { insert: '4' },
280
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
280
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
281
281
  { insert: '\n' },
282
282
  ]),
283
283
  );
@@ -303,17 +303,17 @@ describe('hack format cell', () => {
303
303
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
304
304
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
305
305
  { insert: '123456789' },
306
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
306
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
307
307
  { insert: '12345' },
308
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
308
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
309
309
  { insert: '123456789' },
310
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
310
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
311
311
  { insert: '2' },
312
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
312
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
313
313
  { insert: '3' },
314
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
314
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
315
315
  { insert: '4' },
316
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
316
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
317
317
  { insert: '\n' },
318
318
  ]),
319
319
  );
@@ -350,17 +350,17 @@ describe('hack format cell', () => {
350
350
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
351
351
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
352
352
  { insert: '123456789', attributes: { bold: true } },
353
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
353
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
354
354
  { insert: '12345', attributes: { bold: true } },
355
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
355
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
356
356
  { insert: '123456789', attributes: { bold: true } },
357
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
357
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
358
358
  { insert: '2' },
359
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
359
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
360
360
  { insert: '3', attributes: { bold: true } },
361
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
361
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
362
362
  { insert: '4' },
363
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
363
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
364
364
  { insert: '\n' },
365
365
  ]),
366
366
  );
@@ -395,13 +395,13 @@ describe('hack format cell', () => {
395
395
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
396
396
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
397
397
  { insert: '1' },
398
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
398
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
399
399
  { insert: '2' },
400
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
400
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
401
401
  { insert: '3' },
402
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
402
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
403
403
  { attributes: { bold: true }, insert: '4' },
404
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
404
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
405
405
  { insert: '\n' },
406
406
  ]),
407
407
  );
@@ -456,13 +456,13 @@ describe('hack toolbar clean handler', () => {
456
456
  { insert: '1', attributes: { bold: true } },
457
457
  { insert: '234' },
458
458
  { insert: '5', attributes: { bold: true } },
459
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
459
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
460
460
  { insert: '22345', attributes: { bold: true } },
461
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
461
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
462
462
  { insert: '3' },
463
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
463
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
464
464
  { insert: '4' },
465
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
465
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
466
466
  { insert: '\n' },
467
467
  ]),
468
468
  );
@@ -497,15 +497,15 @@ describe('hack toolbar clean handler', () => {
497
497
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
498
498
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
499
499
  { insert: '12345', attributes: { bold: true } },
500
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
500
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
501
501
  { insert: '12345', attributes: { bold: true } },
502
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
502
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
503
503
  { insert: '22345', attributes: { bold: true } },
504
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
504
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
505
505
  { insert: '3' },
506
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
506
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
507
507
  { insert: '4' },
508
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
508
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
509
509
  { insert: '\n' },
510
510
  ]),
511
511
  );
@@ -543,15 +543,15 @@ describe('hack toolbar clean handler', () => {
543
543
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
544
544
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
545
545
  { insert: '12345' },
546
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
546
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
547
547
  { insert: '12345' },
548
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
548
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
549
549
  { insert: '22345' },
550
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
550
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
551
551
  { insert: '3' },
552
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
552
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
553
553
  { insert: '4' },
554
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
554
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
555
555
  { insert: '\n' },
556
556
  ]),
557
557
  );
@@ -590,13 +590,13 @@ describe('hack toolbar clean handler', () => {
590
590
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
591
591
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
592
592
  { insert: '1' },
593
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
593
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
594
594
  { insert: '2' },
595
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
595
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
596
596
  { insert: '3' },
597
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
597
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
598
598
  { insert: '4' },
599
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
599
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
600
600
  { insert: '\n' },
601
601
  ]),
602
602
  );
@@ -632,16 +632,16 @@ describe('hack toolbar clean handler', () => {
632
632
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
633
633
  { insert: '1', attributes: { bold: true } },
634
634
  { insert: '23' },
635
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
635
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
636
636
  { insert: '12' },
637
637
  { insert: '3', attributes: { bold: true } },
638
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
638
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
639
639
  { insert: '2' },
640
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
640
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
641
641
  { insert: '3', attributes: { bold: true } },
642
- { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
642
+ { attributes: { 'list': 'bullet', 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
643
643
  { insert: '4' },
644
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
644
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
645
645
  { insert: '\n' },
646
646
  ]),
647
647
  );
@@ -671,10 +671,10 @@ describe('hack toolbar clean handler', () => {
671
671
  { insert: '\n' },
672
672
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
673
673
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
674
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
675
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
676
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
677
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
674
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
675
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
676
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
677
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
678
678
  { insert: '\n' },
679
679
  ]),
680
680
  );
@@ -693,10 +693,10 @@ describe('hack toolbar clean handler', () => {
693
693
  { insert: '\n' },
694
694
  { insert: { 'table-up-col': { tableId: '1', colId: '1', full: false, width: 100 } } },
695
695
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
696
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
697
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
698
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1 } }, insert: '\n' },
699
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
696
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
697
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
698
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
699
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
700
700
  { insert: '\n' },
701
701
  ]),
702
702
  );
@@ -802,7 +802,7 @@ describe('hack toolbar clean handler', () => {
802
802
  </div>
803
803
  <p><br></p>
804
804
  `,
805
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
805
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
806
806
  );
807
807
  });
808
808
 
@@ -886,7 +886,7 @@ describe('hack toolbar clean handler', () => {
886
886
  </div>
887
887
  <p><br></p>
888
888
  `,
889
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
889
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
890
890
  );
891
891
  });
892
892
 
@@ -932,23 +932,23 @@ describe('hack toolbar clean handler', () => {
932
932
  { insert: { 'table-up-col': { tableId: '1', colId: '2', full: false, width: 100 } } },
933
933
  { insert: { 'table-up-col': { tableId: '1', colId: '3', full: false, width: 100 } } },
934
934
  { insert: '1' },
935
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
935
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
936
936
  { insert: '2' },
937
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
937
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
938
938
  { insert: '3' },
939
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '3', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
939
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '3', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
940
940
  { insert: '4' },
941
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
941
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
942
942
  { insert: '5' },
943
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1 } }, insert: '\n' },
943
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, tag: 'td' } }, insert: '\n' },
944
944
  { insert: '6' },
945
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '3', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
945
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '3', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
946
946
  { insert: '7' },
947
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
947
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
948
948
  { insert: '8' },
949
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '2', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
949
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '2', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
950
950
  { insert: '9' },
951
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '3', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);' } }, insert: '\n' },
951
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '3', rowspan: 1, colspan: 1, style: 'background-color: rgb(201, 16, 16);', tag: 'td' } }, insert: '\n' },
952
952
  { insert: '\n' },
953
953
  ]),
954
954
  );
@@ -46,7 +46,7 @@ describe('insert embed blot', () => {
46
46
  </div>
47
47
  <p><br></p>
48
48
  `,
49
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
49
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
50
50
  );
51
51
  });
52
52
  });
@@ -85,7 +85,7 @@ describe('insert block blot', () => {
85
85
  </div>
86
86
  <p><br></p>
87
87
  `,
88
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
88
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
89
89
  );
90
90
  });
91
91
 
@@ -120,7 +120,7 @@ describe('insert block blot', () => {
120
120
  </div>
121
121
  <p><br></p>
122
122
  `,
123
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
123
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
124
124
  );
125
125
  });
126
126
 
@@ -155,7 +155,7 @@ describe('insert block blot', () => {
155
155
  </div>
156
156
  <p><br></p>
157
157
  `,
158
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
158
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
159
159
  );
160
160
  });
161
161
 
@@ -195,7 +195,7 @@ describe('insert block blot', () => {
195
195
  </div>
196
196
  <p><br></p>
197
197
  `,
198
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
198
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
199
199
  );
200
200
  });
201
201
  });
@@ -232,7 +232,7 @@ describe('insert block embed blot', () => {
232
232
  </div>
233
233
  <p><br></p>
234
234
  `,
235
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
235
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
236
236
  );
237
237
  });
238
238
 
@@ -270,7 +270,7 @@ describe('insert block embed blot', () => {
270
270
  </div>
271
271
  <p><br></p>
272
272
  `,
273
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
273
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
274
274
  );
275
275
  });
276
276
  });
@@ -327,24 +327,27 @@ describe('set contents', () => {
327
327
  tableModule.setCellAttrs([tds[4], tds[5]], 'height', '50px', true);
328
328
  await vi.runAllTimersAsync();
329
329
  const delta = quill.getContents();
330
- expect(delta.ops).toEqual([
331
- { insert: '\n' },
332
- { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 50 } } },
333
- { insert: { 'table-up-col': { tableId: '1', colId: '2', full: true, width: 50 } } },
334
- { insert: '1' },
335
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: red; border-bottom-color: red;' } }, insert: '\n' },
336
- { insert: '2' },
337
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, style: 'background-color: red; border-bottom-color: red;' } }, insert: '\n' },
338
- { insert: '3' },
339
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, style: 'border-color: red; border-right-color: red;' } }, insert: '\n' },
340
- { insert: '4' },
341
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, style: 'border-color: red;' } }, insert: '\n' },
342
- { insert: '5' },
343
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '1', rowspan: 1, colspan: 1, style: 'height: 50px;' } }, insert: '\n' },
344
- { insert: '6' },
345
- { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '2', rowspan: 1, colspan: 1, style: 'height: 50px;' } }, insert: '\n' },
346
- { insert: '\n' },
347
- ]);
330
+ expectDelta(
331
+ new Delta([
332
+ { insert: '\n' },
333
+ { insert: { 'table-up-col': { tableId: '1', colId: '1', full: true, width: 50 } } },
334
+ { insert: { 'table-up-col': { tableId: '1', colId: '2', full: true, width: 50 } } },
335
+ { insert: '1' },
336
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '1', rowspan: 1, colspan: 1, style: 'background-color: red; border-bottom-color: red;' } }, insert: '\n' },
337
+ { insert: '2' },
338
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '1', colId: '2', rowspan: 1, colspan: 1, style: 'background-color: red; border-bottom-color: red;' } }, insert: '\n' },
339
+ { insert: '3' },
340
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '1', rowspan: 1, colspan: 1, style: 'border-color: red; border-right-color: red;' } }, insert: '\n' },
341
+ { insert: '4' },
342
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '2', colId: '2', rowspan: 1, colspan: 1, style: 'border-color: red;' } }, insert: '\n' },
343
+ { insert: '5' },
344
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '1', rowspan: 1, colspan: 1, style: 'height: 50px;' } }, insert: '\n' },
345
+ { insert: '6' },
346
+ { attributes: { 'table-up-cell-inner': { tableId: '1', rowId: '3', colId: '2', rowspan: 1, colspan: 1, style: 'height: 50px;' } }, insert: '\n' },
347
+ { insert: '\n' },
348
+ ]),
349
+ quill.getContents(),
350
+ );
348
351
  quill.setContents([{ insert: '\n' }]);
349
352
  quill.setContents(delta);
350
353
  await vi.runAllTimersAsync();
@@ -383,7 +386,7 @@ describe('set contents', () => {
383
386
  </div>
384
387
  <p><br></p>
385
388
  `,
386
- { ignoreAttrs: ['class', 'style', 'rowspan', 'colspan', 'data-full', 'data-style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
389
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'rowspan', 'colspan', 'data-full', 'data-style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
387
390
  );
388
391
  });
389
392
  });
@@ -428,7 +431,7 @@ describe('insert row into table', () => {
428
431
  </div>
429
432
  <p><br></p>
430
433
  `,
431
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
434
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
432
435
  );
433
436
  });
434
437
 
@@ -491,7 +494,7 @@ describe('insert row into table', () => {
491
494
  </div>
492
495
  <p><br></p>
493
496
  `,
494
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
497
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
495
498
  );
496
499
  });
497
500
 
@@ -525,7 +528,7 @@ describe('insert row into table', () => {
525
528
  </div>
526
529
  <p><br></p>
527
530
  `,
528
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
531
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
529
532
  );
530
533
  });
531
534
 
@@ -576,7 +579,7 @@ describe('insert row into table', () => {
576
579
  </div>
577
580
  <p><br></p>
578
581
  `,
579
- { ignoreAttrs: ['class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
582
+ { ignoreAttrs: ['data-tag', 'class', 'style', 'data-table-id', 'data-row-id', 'data-col-id', 'data-rowspan', 'data-colspan', 'contenteditable'] },
580
583
  );
581
584
  });
582
585
  });
@@ -611,7 +614,7 @@ describe('set cell attribute', () => {
611
614
  </div>
612
615
  <p><br></p>
613
616
  `,
614
- { ignoreAttrs: ['class', 'data-table-id', 'contenteditable'] },
617
+ { ignoreAttrs: ['data-tag', 'class', 'data-table-id', 'contenteditable'] },
615
618
  );
616
619
  });
617
620
 
@@ -657,7 +660,7 @@ describe('set cell attribute', () => {
657
660
  </div>
658
661
  <p><br></p>
659
662
  `,
660
- { ignoreAttrs: ['class', 'data-table-id', 'contenteditable'] },
663
+ { ignoreAttrs: ['data-tag', 'class', 'data-table-id', 'contenteditable'] },
661
664
  );
662
665
  expectDelta(
663
666
  new Delta([