@atlaskit/editor-plugin-table 5.4.5 → 5.4.7

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 (115) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/table/commands/insert.js +12 -2
  3. package/dist/cjs/plugins/table/commands/misc.js +49 -1
  4. package/dist/cjs/plugins/table/index.js +46 -35
  5. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +12 -16
  6. package/dist/cjs/plugins/table/nodeviews/TableResizer.js +1 -1
  7. package/dist/cjs/plugins/table/nodeviews/table.js +3 -1
  8. package/dist/cjs/plugins/table/pm-plugins/analytics/actions.js +14 -0
  9. package/dist/cjs/plugins/table/pm-plugins/analytics/commands.js +45 -0
  10. package/dist/cjs/plugins/table/pm-plugins/analytics/plugin-factory.js +13 -0
  11. package/dist/cjs/plugins/table/pm-plugins/analytics/plugin-key.js +8 -0
  12. package/dist/cjs/plugins/table/pm-plugins/analytics/plugin.js +74 -0
  13. package/dist/cjs/plugins/table/pm-plugins/analytics/reducer.js +26 -0
  14. package/dist/cjs/plugins/table/pm-plugins/analytics/types.js +13 -0
  15. package/dist/cjs/plugins/table/pm-plugins/analytics/utils/moved-event.js +38 -0
  16. package/dist/cjs/plugins/table/pm-plugins/main.js +1 -1
  17. package/dist/cjs/plugins/table/pm-plugins/table-analytics.js +1 -1
  18. package/dist/es2019/plugins/table/commands/insert.js +12 -3
  19. package/dist/es2019/plugins/table/commands/misc.js +49 -0
  20. package/dist/es2019/plugins/table/index.js +14 -4
  21. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +13 -17
  22. package/dist/es2019/plugins/table/nodeviews/TableResizer.js +1 -1
  23. package/dist/es2019/plugins/table/nodeviews/table.js +3 -1
  24. package/dist/es2019/plugins/table/pm-plugins/analytics/actions.js +8 -0
  25. package/dist/es2019/plugins/table/pm-plugins/analytics/commands.js +33 -0
  26. package/dist/es2019/plugins/table/pm-plugins/analytics/plugin-factory.js +8 -0
  27. package/dist/es2019/plugins/table/pm-plugins/analytics/plugin-key.js +2 -0
  28. package/dist/es2019/plugins/table/pm-plugins/analytics/plugin.js +72 -0
  29. package/dist/es2019/plugins/table/pm-plugins/analytics/reducer.js +21 -0
  30. package/dist/es2019/plugins/table/pm-plugins/analytics/types.js +7 -0
  31. package/dist/es2019/plugins/table/pm-plugins/analytics/utils/moved-event.js +30 -0
  32. package/dist/es2019/plugins/table/pm-plugins/main.js +1 -1
  33. package/dist/es2019/plugins/table/pm-plugins/table-analytics.js +1 -1
  34. package/dist/esm/plugins/table/commands/insert.js +12 -3
  35. package/dist/esm/plugins/table/commands/misc.js +48 -0
  36. package/dist/esm/plugins/table/index.js +43 -32
  37. package/dist/esm/plugins/table/nodeviews/TableComponent.js +13 -17
  38. package/dist/esm/plugins/table/nodeviews/TableResizer.js +1 -1
  39. package/dist/esm/plugins/table/nodeviews/table.js +3 -1
  40. package/dist/esm/plugins/table/pm-plugins/analytics/actions.js +8 -0
  41. package/dist/esm/plugins/table/pm-plugins/analytics/commands.js +39 -0
  42. package/dist/esm/plugins/table/pm-plugins/analytics/plugin-factory.js +8 -0
  43. package/dist/esm/plugins/table/pm-plugins/analytics/plugin-key.js +2 -0
  44. package/dist/esm/plugins/table/pm-plugins/analytics/plugin.js +68 -0
  45. package/dist/esm/plugins/table/pm-plugins/analytics/reducer.js +19 -0
  46. package/dist/esm/plugins/table/pm-plugins/analytics/types.js +7 -0
  47. package/dist/esm/plugins/table/pm-plugins/analytics/utils/moved-event.js +31 -0
  48. package/dist/esm/plugins/table/pm-plugins/main.js +1 -1
  49. package/dist/esm/plugins/table/pm-plugins/table-analytics.js +1 -1
  50. package/dist/types/plugins/table/commands/misc.d.ts +5 -1
  51. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +2 -0
  52. package/dist/types/plugins/table/nodeviews/table.d.ts +2 -1
  53. package/dist/types/plugins/table/nodeviews/types.d.ts +2 -0
  54. package/dist/types/plugins/table/pm-plugins/analytics/actions.d.ts +17 -0
  55. package/dist/types/plugins/table/pm-plugins/analytics/commands.d.ts +5 -0
  56. package/dist/types/plugins/table/pm-plugins/analytics/plugin-factory.d.ts +1 -0
  57. package/dist/types/plugins/table/pm-plugins/analytics/plugin-key.d.ts +3 -0
  58. package/dist/types/plugins/table/pm-plugins/analytics/plugin.d.ts +4 -0
  59. package/dist/types/plugins/table/pm-plugins/analytics/reducer.d.ts +3 -0
  60. package/dist/types/plugins/table/pm-plugins/analytics/types.d.ts +11 -0
  61. package/dist/types/plugins/table/pm-plugins/analytics/utils/moved-event.d.ts +6 -0
  62. package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +5 -1
  63. package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +2 -0
  64. package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +2 -1
  65. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -0
  66. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/actions.d.ts +17 -0
  67. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/commands.d.ts +5 -0
  68. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/plugin-factory.d.ts +1 -0
  69. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/plugin-key.d.ts +3 -0
  70. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/plugin.d.ts +4 -0
  71. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/reducer.d.ts +3 -0
  72. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/types.d.ts +11 -0
  73. package/dist/types-ts4.5/plugins/table/pm-plugins/analytics/utils/moved-event.d.ts +6 -0
  74. package/package.json +7 -4
  75. package/src/__tests__/unit/index-with-fake-timers.ts +1 -0
  76. package/src/__tests__/unit/nodeviews/table.ts +1 -0
  77. package/src/__tests__/unit/pm-plugins/analytics.ts +327 -0
  78. package/src/plugins/table/commands/insert.ts +23 -2
  79. package/src/plugins/table/commands/misc.ts +84 -1
  80. package/src/plugins/table/index.tsx +13 -6
  81. package/src/plugins/table/nodeviews/TableComponent.tsx +15 -22
  82. package/src/plugins/table/nodeviews/TableResizer.tsx +1 -2
  83. package/src/plugins/table/nodeviews/table.tsx +4 -0
  84. package/src/plugins/table/nodeviews/types.ts +2 -0
  85. package/src/plugins/table/pm-plugins/analytics/actions.ts +23 -0
  86. package/src/plugins/table/pm-plugins/analytics/commands.ts +53 -0
  87. package/src/plugins/table/pm-plugins/analytics/plugin-factory.ts +7 -0
  88. package/src/plugins/table/pm-plugins/analytics/plugin-key.ts +7 -0
  89. package/src/plugins/table/pm-plugins/analytics/plugin.ts +98 -0
  90. package/src/plugins/table/pm-plugins/analytics/reducer.ts +27 -0
  91. package/src/plugins/table/pm-plugins/analytics/types.ts +20 -0
  92. package/src/plugins/table/pm-plugins/analytics/utils/moved-event.ts +51 -0
  93. package/src/plugins/table/pm-plugins/main.ts +1 -0
  94. package/src/plugins/table/pm-plugins/table-analytics.ts +1 -1
  95. package/tsconfig.dev.json +3 -3
  96. package/src/__tests__/integration/__fixtures__/auto-size-documents.ts +0 -434
  97. package/src/__tests__/integration/__fixtures__/basic-table-with-merged-cell.ts +0 -112
  98. package/src/__tests__/integration/__fixtures__/basic-table.ts +0 -120
  99. package/src/__tests__/integration/__fixtures__/empty-layout.ts +0 -35
  100. package/src/__tests__/integration/__fixtures__/empty-paragraph-underneath-table.ts +0 -396
  101. package/src/__tests__/integration/__fixtures__/even-columns.ts +0 -493
  102. package/src/__tests__/integration/__fixtures__/layout-documents.ts +0 -606
  103. package/src/__tests__/integration/__fixtures__/merged-rows-and-cols-document.ts +0 -343
  104. package/src/__tests__/integration/__fixtures__/nested-in-expand.ts +0 -129
  105. package/src/__tests__/integration/__fixtures__/nested-in-extension.ts +0 -163
  106. package/src/__tests__/integration/__fixtures__/paragraph-and-table-adf.ts +0 -132
  107. package/src/__tests__/integration/__fixtures__/resize-documents.ts +0 -1605
  108. package/src/__tests__/integration/__fixtures__/scale.ts +0 -825
  109. package/src/__tests__/integration/__fixtures__/table-inside-layout.ts +0 -145
  110. package/src/__tests__/integration/__fixtures__/table-with-min-width-columns-document.ts +0 -175
  111. package/src/__tests__/integration/__fixtures__/table-with-multiline-date.adf.json +0 -168
  112. package/src/__tests__/integration/__fixtures__/table-with-text-and-empty-row.ts +0 -216
  113. package/src/__tests__/integration/__snapshots__/copy-button.ts.snap +0 -423
  114. package/src/__tests__/integration/copy-button.ts +0 -179
  115. package/src/__tests__/integration/table-controls-selection.ts +0 -71
@@ -1,606 +0,0 @@
1
- const defaultTableInOverflow = {
2
- version: 1,
3
- type: 'doc',
4
- content: [
5
- {
6
- type: 'table',
7
- attrs: {
8
- isNumberColumnEnabled: false,
9
- layout: 'default',
10
- },
11
- content: [
12
- {
13
- type: 'tableRow',
14
- content: [
15
- {
16
- type: 'tableHeader',
17
- attrs: {
18
- colwidth: [226],
19
- },
20
- content: [
21
- {
22
- type: 'paragraph',
23
- content: [],
24
- },
25
- ],
26
- },
27
- {
28
- type: 'tableHeader',
29
- attrs: {
30
- colwidth: [463],
31
- },
32
- content: [
33
- {
34
- type: 'paragraph',
35
- content: [],
36
- },
37
- ],
38
- },
39
- {
40
- type: 'tableHeader',
41
- attrs: {
42
- colwidth: [48],
43
- },
44
- content: [
45
- {
46
- type: 'paragraph',
47
- content: [],
48
- },
49
- ],
50
- },
51
- ],
52
- },
53
- {
54
- type: 'tableRow',
55
- content: [
56
- {
57
- type: 'tableCell',
58
- attrs: {
59
- colwidth: [226],
60
- },
61
- content: [
62
- {
63
- type: 'paragraph',
64
- content: [],
65
- },
66
- ],
67
- },
68
- {
69
- type: 'tableCell',
70
- attrs: {
71
- colwidth: [463],
72
- },
73
- content: [
74
- {
75
- type: 'paragraph',
76
- content: [],
77
- },
78
- ],
79
- },
80
- {
81
- type: 'tableCell',
82
- attrs: {
83
- colwidth: [48],
84
- },
85
- content: [
86
- {
87
- type: 'paragraph',
88
- content: [],
89
- },
90
- ],
91
- },
92
- ],
93
- },
94
- {
95
- type: 'tableRow',
96
- content: [
97
- {
98
- type: 'tableCell',
99
- attrs: {
100
- colwidth: [226],
101
- },
102
- content: [
103
- {
104
- type: 'paragraph',
105
- content: [],
106
- },
107
- ],
108
- },
109
- {
110
- type: 'tableCell',
111
- attrs: {
112
- colwidth: [463],
113
- },
114
- content: [
115
- {
116
- type: 'paragraph',
117
- content: [],
118
- },
119
- ],
120
- },
121
- {
122
- type: 'tableCell',
123
- attrs: {
124
- colwidth: [48],
125
- },
126
- content: [
127
- {
128
- type: 'paragraph',
129
- content: [],
130
- },
131
- ],
132
- },
133
- ],
134
- },
135
- ],
136
- },
137
- ],
138
- };
139
-
140
- const defaultTableResizedTable = {
141
- version: 1,
142
- type: 'doc',
143
- content: [
144
- {
145
- type: 'table',
146
- attrs: {
147
- isNumberColumnEnabled: false,
148
- layout: 'default',
149
- },
150
- content: [
151
- {
152
- type: 'tableRow',
153
- content: [
154
- {
155
- type: 'tableHeader',
156
- attrs: {
157
- colwidth: [340],
158
- },
159
- content: [
160
- {
161
- type: 'paragraph',
162
- content: [],
163
- },
164
- ],
165
- },
166
- {
167
- type: 'tableHeader',
168
- attrs: {
169
- colwidth: [339],
170
- },
171
- content: [
172
- {
173
- type: 'paragraph',
174
- content: [],
175
- },
176
- ],
177
- },
178
- ],
179
- },
180
- {
181
- type: 'tableRow',
182
- content: [
183
- {
184
- type: 'tableCell',
185
- attrs: {
186
- rowspan: 2,
187
- colwidth: [340],
188
- },
189
- content: [
190
- {
191
- type: 'paragraph',
192
- content: [],
193
- },
194
- ],
195
- },
196
- {
197
- type: 'tableCell',
198
- attrs: {
199
- colwidth: [339],
200
- },
201
- content: [
202
- {
203
- type: 'paragraph',
204
- content: [],
205
- },
206
- ],
207
- },
208
- ],
209
- },
210
- {
211
- type: 'tableRow',
212
- content: [
213
- {
214
- type: 'tableCell',
215
- attrs: {
216
- colwidth: [339],
217
- },
218
- content: [
219
- {
220
- type: 'paragraph',
221
- content: [],
222
- },
223
- ],
224
- },
225
- ],
226
- },
227
- {
228
- type: 'tableRow',
229
- content: [
230
- {
231
- type: 'tableCell',
232
- attrs: {
233
- colwidth: [340],
234
- },
235
- content: [
236
- {
237
- type: 'paragraph',
238
- content: [],
239
- },
240
- ],
241
- },
242
- {
243
- type: 'tableCell',
244
- attrs: {
245
- colwidth: [339],
246
- },
247
- content: [
248
- {
249
- type: 'paragraph',
250
- content: [],
251
- },
252
- ],
253
- },
254
- ],
255
- },
256
- ],
257
- },
258
- {
259
- type: 'paragraph',
260
- content: [],
261
- },
262
- ],
263
- };
264
-
265
- const nestedTables = {
266
- version: 1,
267
- type: 'doc',
268
- content: [
269
- {
270
- type: 'paragraph',
271
- content: [
272
- {
273
- type: 'text',
274
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean mi nisl, venenatis eget auctor vitae, venenatis quis lorem. Suspendisse maximus tortor vel dui tincidunt cursus. Vestibulum magna nibh, auctor non auctor id, finibus vitae orci. Nulla viverra ipsum et nunc fringilla ultricies. Pellentesque vitae felis molestie justo finibus accumsan. Suspendisse potenti. Nulla facilisi. Integer dignissim quis velit quis elementum. Sed sit amet varius ante. Duis vestibulum porta augue eu laoreet. Morbi id risus et augue sollicitudin aliquam. In et ligula dolor. Nam ac aliquet diam.',
275
- },
276
- ],
277
- },
278
- {
279
- type: 'layoutSection',
280
- content: [
281
- {
282
- type: 'layoutColumn',
283
- attrs: {
284
- width: 50,
285
- },
286
- content: [
287
- {
288
- type: 'table',
289
- attrs: {
290
- isNumberColumnEnabled: false,
291
- layout: 'default',
292
- },
293
- content: [
294
- {
295
- type: 'tableRow',
296
- content: [
297
- {
298
- type: 'tableHeader',
299
- attrs: {
300
- colwidth: [143],
301
- },
302
- content: [
303
- {
304
- type: 'paragraph',
305
- content: [],
306
- },
307
- ],
308
- },
309
- {
310
- type: 'tableHeader',
311
- attrs: {
312
- colwidth: [71],
313
- },
314
- content: [
315
- {
316
- type: 'paragraph',
317
- content: [],
318
- },
319
- ],
320
- },
321
- {
322
- type: 'tableHeader',
323
- attrs: {
324
- colwidth: [259.5],
325
- },
326
- content: [
327
- {
328
- type: 'paragraph',
329
- content: [],
330
- },
331
- ],
332
- },
333
- ],
334
- },
335
- {
336
- type: 'tableRow',
337
- content: [
338
- {
339
- type: 'tableCell',
340
- attrs: {
341
- colwidth: [143],
342
- },
343
- content: [
344
- {
345
- type: 'paragraph',
346
- content: [],
347
- },
348
- ],
349
- },
350
- {
351
- type: 'tableCell',
352
- attrs: {
353
- colwidth: [71],
354
- },
355
- content: [
356
- {
357
- type: 'paragraph',
358
- content: [],
359
- },
360
- ],
361
- },
362
- {
363
- type: 'tableCell',
364
- attrs: {
365
- colwidth: [259.5],
366
- },
367
- content: [
368
- {
369
- type: 'paragraph',
370
- content: [],
371
- },
372
- ],
373
- },
374
- ],
375
- },
376
- {
377
- type: 'tableRow',
378
- content: [
379
- {
380
- type: 'tableCell',
381
- attrs: {
382
- colwidth: [143],
383
- },
384
- content: [
385
- {
386
- type: 'paragraph',
387
- content: [],
388
- },
389
- ],
390
- },
391
- {
392
- type: 'tableCell',
393
- attrs: {
394
- colwidth: [71],
395
- },
396
- content: [
397
- {
398
- type: 'paragraph',
399
- content: [],
400
- },
401
- ],
402
- },
403
- {
404
- type: 'tableCell',
405
- attrs: {
406
- colwidth: [259.5],
407
- },
408
- content: [
409
- {
410
- type: 'paragraph',
411
- content: [],
412
- },
413
- ],
414
- },
415
- ],
416
- },
417
- ],
418
- },
419
- ],
420
- },
421
- {
422
- type: 'layoutColumn',
423
- attrs: {
424
- width: 50,
425
- },
426
- content: [
427
- {
428
- type: 'paragraph',
429
- content: [],
430
- },
431
- ],
432
- },
433
- ],
434
- marks: [
435
- {
436
- type: 'breakout',
437
- attrs: {
438
- mode: 'wide',
439
- },
440
- },
441
- ],
442
- },
443
- {
444
- type: 'bodiedExtension',
445
- attrs: {
446
- extensionType: 'com.atlassian.confluence.macro.core',
447
- extensionKey: 'bodied-eh',
448
- parameters: {
449
- macroParams: {},
450
- macroMetadata: {
451
- placeholder: [
452
- {
453
- data: {
454
- url: '',
455
- },
456
- type: 'icon',
457
- },
458
- ],
459
- },
460
- },
461
- localId: 'testId',
462
- layout: 'wide',
463
- },
464
- content: [
465
- {
466
- type: 'paragraph',
467
- content: [],
468
- },
469
- {
470
- type: 'table',
471
- attrs: {
472
- isNumberColumnEnabled: false,
473
- layout: 'default',
474
- },
475
- content: [
476
- {
477
- type: 'tableRow',
478
- content: [
479
- {
480
- type: 'tableHeader',
481
- attrs: {
482
- colwidth: [349],
483
- },
484
- content: [
485
- {
486
- type: 'paragraph',
487
- content: [],
488
- },
489
- ],
490
- },
491
- {
492
- type: 'tableHeader',
493
- attrs: {
494
- colwidth: [302],
495
- },
496
- content: [
497
- {
498
- type: 'paragraph',
499
- content: [],
500
- },
501
- ],
502
- },
503
- {
504
- type: 'tableHeader',
505
- attrs: {
506
- colwidth: [328],
507
- },
508
- content: [
509
- {
510
- type: 'paragraph',
511
- content: [],
512
- },
513
- ],
514
- },
515
- ],
516
- },
517
- {
518
- type: 'tableRow',
519
- content: [
520
- {
521
- type: 'tableCell',
522
- attrs: {
523
- colwidth: [349],
524
- },
525
- content: [
526
- {
527
- type: 'paragraph',
528
- content: [],
529
- },
530
- ],
531
- },
532
- {
533
- type: 'tableCell',
534
- attrs: {
535
- colwidth: [302],
536
- },
537
- content: [
538
- {
539
- type: 'paragraph',
540
- content: [],
541
- },
542
- ],
543
- },
544
- {
545
- type: 'tableCell',
546
- attrs: {
547
- colwidth: [328],
548
- },
549
- content: [
550
- {
551
- type: 'paragraph',
552
- content: [],
553
- },
554
- ],
555
- },
556
- ],
557
- },
558
- {
559
- type: 'tableRow',
560
- content: [
561
- {
562
- type: 'tableCell',
563
- attrs: {
564
- colwidth: [349],
565
- },
566
- content: [
567
- {
568
- type: 'paragraph',
569
- content: [],
570
- },
571
- ],
572
- },
573
- {
574
- type: 'tableCell',
575
- attrs: {
576
- colwidth: [302],
577
- },
578
- content: [
579
- {
580
- type: 'paragraph',
581
- content: [],
582
- },
583
- ],
584
- },
585
- {
586
- type: 'tableCell',
587
- attrs: {
588
- colwidth: [328],
589
- },
590
- content: [
591
- {
592
- type: 'paragraph',
593
- content: [],
594
- },
595
- ],
596
- },
597
- ],
598
- },
599
- ],
600
- },
601
- ],
602
- },
603
- ],
604
- };
605
-
606
- export { defaultTableInOverflow, defaultTableResizedTable, nestedTables };