@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,343 +0,0 @@
1
- export const documentWithMergedCells = {
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: [151],
19
- background: '#ffffff',
20
- },
21
- content: [
22
- {
23
- type: 'paragraph',
24
- content: [
25
- {
26
- type: 'text',
27
- text: '1',
28
- },
29
- ],
30
- },
31
- ],
32
- },
33
- {
34
- type: 'tableHeader',
35
- attrs: {
36
- colwidth: [98],
37
- background: '#deebff',
38
- },
39
- content: [
40
- {
41
- type: 'paragraph',
42
- content: [
43
- {
44
- type: 'text',
45
- text: '2',
46
- },
47
- ],
48
- },
49
- ],
50
- },
51
- {
52
- type: 'tableHeader',
53
- attrs: {
54
- colwidth: [275],
55
- background: '#e6fcff',
56
- },
57
- content: [
58
- {
59
- type: 'paragraph',
60
- content: [
61
- {
62
- type: 'text',
63
- text: '3',
64
- },
65
- ],
66
- },
67
- ],
68
- },
69
- {
70
- type: 'tableHeader',
71
- attrs: {
72
- colwidth: [83],
73
- background: '#eae6ff',
74
- },
75
- content: [
76
- {
77
- type: 'paragraph',
78
- content: [
79
- {
80
- type: 'text',
81
- text: '4',
82
- },
83
- ],
84
- },
85
- ],
86
- },
87
- {
88
- type: 'tableHeader',
89
- attrs: {
90
- colwidth: [152],
91
- background: '#ffffff',
92
- },
93
- content: [
94
- {
95
- type: 'paragraph',
96
- content: [
97
- {
98
- type: 'text',
99
- text: '5',
100
- },
101
- ],
102
- },
103
- ],
104
- },
105
- ],
106
- },
107
- {
108
- type: 'tableRow',
109
- content: [
110
- {
111
- type: 'tableCell',
112
- attrs: {
113
- colwidth: [151],
114
- background: '#e6fcff',
115
- },
116
- content: [
117
- {
118
- type: 'paragraph',
119
- content: [
120
- {
121
- type: 'text',
122
- text: '2',
123
- },
124
- ],
125
- },
126
- ],
127
- },
128
- {
129
- type: 'tableCell',
130
- attrs: {
131
- colspan: 3,
132
- rowspan: 3,
133
- colwidth: [98, 275, 83],
134
- background: '#fffae6',
135
- },
136
- content: [
137
- {
138
- type: 'paragraph',
139
- content: [],
140
- },
141
- ],
142
- },
143
- {
144
- type: 'tableCell',
145
- attrs: {
146
- colwidth: [152],
147
- background: '#e6fcff',
148
- },
149
- content: [
150
- {
151
- type: 'paragraph',
152
- content: [
153
- {
154
- type: 'text',
155
- text: '2',
156
- },
157
- ],
158
- },
159
- ],
160
- },
161
- ],
162
- },
163
- {
164
- type: 'tableRow',
165
- content: [
166
- {
167
- type: 'tableCell',
168
- attrs: {
169
- colwidth: [151],
170
- background: '#ffebe6',
171
- },
172
- content: [
173
- {
174
- type: 'paragraph',
175
- content: [
176
- {
177
- type: 'text',
178
- text: '3',
179
- },
180
- ],
181
- },
182
- ],
183
- },
184
- {
185
- type: 'tableCell',
186
- attrs: {
187
- colwidth: [152],
188
- background: '#ffebe6',
189
- },
190
- content: [
191
- {
192
- type: 'paragraph',
193
- content: [
194
- {
195
- type: 'text',
196
- text: '3',
197
- },
198
- ],
199
- },
200
- ],
201
- },
202
- ],
203
- },
204
- {
205
- type: 'tableRow',
206
- content: [
207
- {
208
- type: 'tableCell',
209
- attrs: {
210
- colwidth: [151],
211
- background: '#e3fcef',
212
- },
213
- content: [
214
- {
215
- type: 'paragraph',
216
- content: [
217
- {
218
- type: 'text',
219
- text: '4',
220
- },
221
- ],
222
- },
223
- ],
224
- },
225
- {
226
- type: 'tableCell',
227
- attrs: {
228
- colwidth: [152],
229
- background: '#e3fcef',
230
- },
231
- content: [
232
- {
233
- type: 'paragraph',
234
- content: [
235
- {
236
- type: 'text',
237
- text: '4',
238
- },
239
- ],
240
- },
241
- ],
242
- },
243
- ],
244
- },
245
- {
246
- type: 'tableRow',
247
- content: [
248
- {
249
- type: 'tableCell',
250
- attrs: {
251
- colwidth: [151],
252
- background: '#ffffff',
253
- },
254
- content: [
255
- {
256
- type: 'paragraph',
257
- content: [
258
- {
259
- type: 'text',
260
- text: '5',
261
- },
262
- ],
263
- },
264
- ],
265
- },
266
- {
267
- type: 'tableCell',
268
- attrs: {
269
- colwidth: [98],
270
- background: '#deebff',
271
- },
272
- content: [
273
- {
274
- type: 'paragraph',
275
- content: [
276
- {
277
- type: 'text',
278
- text: '2',
279
- },
280
- ],
281
- },
282
- ],
283
- },
284
- {
285
- type: 'tableCell',
286
- attrs: {
287
- colwidth: [275],
288
- background: '#e6fcff',
289
- },
290
- content: [
291
- {
292
- type: 'paragraph',
293
- content: [
294
- {
295
- type: 'text',
296
- text: '3',
297
- },
298
- ],
299
- },
300
- ],
301
- },
302
- {
303
- type: 'tableCell',
304
- attrs: {
305
- colwidth: [83],
306
- background: '#eae6ff',
307
- },
308
- content: [
309
- {
310
- type: 'paragraph',
311
- content: [
312
- {
313
- type: 'text',
314
- text: '4',
315
- },
316
- ],
317
- },
318
- ],
319
- },
320
- {
321
- type: 'tableCell',
322
- attrs: {
323
- colwidth: [152],
324
- background: '#ffffff',
325
- },
326
- content: [
327
- {
328
- type: 'paragraph',
329
- content: [
330
- {
331
- type: 'text',
332
- text: '5',
333
- },
334
- ],
335
- },
336
- ],
337
- },
338
- ],
339
- },
340
- ],
341
- },
342
- ],
343
- };
@@ -1,129 +0,0 @@
1
- export default {
2
- version: 1,
3
- type: 'doc',
4
- content: [
5
- {
6
- type: 'expand',
7
- attrs: {
8
- title: '',
9
- },
10
- content: [
11
- {
12
- type: 'table',
13
- attrs: {
14
- isNumberColumnEnabled: false,
15
- layout: 'default',
16
- localId: '30bc8b3b-d6b5-42c8-830b-71358eb3ab39',
17
- },
18
- content: [
19
- {
20
- type: 'tableRow',
21
- content: [
22
- {
23
- type: 'tableHeader',
24
- attrs: {},
25
- content: [
26
- {
27
- type: 'paragraph',
28
- content: [],
29
- },
30
- ],
31
- },
32
- {
33
- type: 'tableHeader',
34
- attrs: {},
35
- content: [
36
- {
37
- type: 'paragraph',
38
- content: [],
39
- },
40
- ],
41
- },
42
- {
43
- type: 'tableHeader',
44
- attrs: {},
45
- content: [
46
- {
47
- type: 'paragraph',
48
- content: [],
49
- },
50
- ],
51
- },
52
- ],
53
- },
54
- {
55
- type: 'tableRow',
56
- content: [
57
- {
58
- type: 'tableCell',
59
- attrs: {},
60
- content: [
61
- {
62
- type: 'paragraph',
63
- content: [],
64
- },
65
- ],
66
- },
67
- {
68
- type: 'tableCell',
69
- attrs: {},
70
- content: [
71
- {
72
- type: 'paragraph',
73
- content: [],
74
- },
75
- ],
76
- },
77
- {
78
- type: 'tableCell',
79
- attrs: {},
80
- content: [
81
- {
82
- type: 'paragraph',
83
- content: [],
84
- },
85
- ],
86
- },
87
- ],
88
- },
89
- {
90
- type: 'tableRow',
91
- content: [
92
- {
93
- type: 'tableCell',
94
- attrs: {},
95
- content: [
96
- {
97
- type: 'paragraph',
98
- content: [],
99
- },
100
- ],
101
- },
102
- {
103
- type: 'tableCell',
104
- attrs: {},
105
- content: [
106
- {
107
- type: 'paragraph',
108
- content: [],
109
- },
110
- ],
111
- },
112
- {
113
- type: 'tableCell',
114
- attrs: {},
115
- content: [
116
- {
117
- type: 'paragraph',
118
- content: [],
119
- },
120
- ],
121
- },
122
- ],
123
- },
124
- ],
125
- },
126
- ],
127
- },
128
- ],
129
- };
@@ -1,163 +0,0 @@
1
- export const nestedInExtension = {
2
- version: 1,
3
- type: 'doc',
4
- content: [
5
- {
6
- type: 'bodiedExtension',
7
- attrs: {
8
- extensionType: 'com.atlassian.confluence.macro.core',
9
- extensionKey: 'bodied-eh',
10
- parameters: {
11
- macroParams: {},
12
- macroMetadata: {
13
- placeholder: [
14
- {
15
- data: {
16
- url: '',
17
- },
18
- type: 'icon',
19
- },
20
- ],
21
- },
22
- },
23
- localId: 'testId',
24
- layout: 'default',
25
- },
26
- content: [
27
- {
28
- type: 'table',
29
- attrs: {
30
- isNumberColumnEnabled: false,
31
- layout: 'default',
32
- localId: 'abc-123',
33
- },
34
- content: [
35
- {
36
- type: 'tableRow',
37
- content: [
38
- {
39
- type: 'tableHeader',
40
- attrs: {
41
- colwidth: [242],
42
- },
43
- content: [
44
- {
45
- type: 'paragraph',
46
- content: [],
47
- },
48
- ],
49
- },
50
- {
51
- type: 'tableHeader',
52
- attrs: {
53
- colwidth: [308],
54
- },
55
- content: [
56
- {
57
- type: 'paragraph',
58
- content: [],
59
- },
60
- ],
61
- },
62
- {
63
- type: 'tableHeader',
64
- attrs: {
65
- colwidth: [176],
66
- },
67
- content: [
68
- {
69
- type: 'paragraph',
70
- content: [],
71
- },
72
- ],
73
- },
74
- ],
75
- },
76
- {
77
- type: 'tableRow',
78
- content: [
79
- {
80
- type: 'tableCell',
81
- attrs: {
82
- colwidth: [242],
83
- },
84
- content: [
85
- {
86
- type: 'paragraph',
87
- content: [],
88
- },
89
- ],
90
- },
91
- {
92
- type: 'tableCell',
93
- attrs: {
94
- colwidth: [308],
95
- },
96
- content: [
97
- {
98
- type: 'paragraph',
99
- content: [],
100
- },
101
- ],
102
- },
103
- {
104
- type: 'tableCell',
105
- attrs: {
106
- colwidth: [176],
107
- },
108
- content: [
109
- {
110
- type: 'paragraph',
111
- content: [],
112
- },
113
- ],
114
- },
115
- ],
116
- },
117
- {
118
- type: 'tableRow',
119
- content: [
120
- {
121
- type: 'tableCell',
122
- attrs: {
123
- colwidth: [242],
124
- },
125
- content: [
126
- {
127
- type: 'paragraph',
128
- content: [],
129
- },
130
- ],
131
- },
132
- {
133
- type: 'tableCell',
134
- attrs: {
135
- colwidth: [308],
136
- },
137
- content: [
138
- {
139
- type: 'paragraph',
140
- content: [],
141
- },
142
- ],
143
- },
144
- {
145
- type: 'tableCell',
146
- attrs: {
147
- colwidth: [176],
148
- },
149
- content: [
150
- {
151
- type: 'paragraph',
152
- content: [],
153
- },
154
- ],
155
- },
156
- ],
157
- },
158
- ],
159
- },
160
- ],
161
- },
162
- ],
163
- };