@atlaskit/editor-plugin-table 5.7.3 → 5.7.5

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 (45) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/commands/insert.js +1 -1
  3. package/dist/cjs/nodeviews/TableComponent.js +4 -2
  4. package/dist/cjs/nodeviews/TableContainer.js +10 -5
  5. package/dist/cjs/nodeviews/TableResizer.js +7 -3
  6. package/dist/cjs/transforms/column-width.js +3 -105
  7. package/dist/cjs/transforms/delete-columns.js +2 -5
  8. package/dist/cjs/ui/common-styles.js +1 -1
  9. package/dist/cjs/utils/analytics.js +2 -1
  10. package/dist/es2019/commands/insert.js +1 -1
  11. package/dist/es2019/nodeviews/TableComponent.js +4 -2
  12. package/dist/es2019/nodeviews/TableContainer.js +10 -5
  13. package/dist/es2019/nodeviews/TableResizer.js +7 -3
  14. package/dist/es2019/transforms/column-width.js +4 -102
  15. package/dist/es2019/transforms/delete-columns.js +2 -5
  16. package/dist/es2019/ui/common-styles.js +1 -0
  17. package/dist/es2019/utils/analytics.js +2 -1
  18. package/dist/esm/commands/insert.js +1 -1
  19. package/dist/esm/nodeviews/TableComponent.js +4 -2
  20. package/dist/esm/nodeviews/TableContainer.js +10 -5
  21. package/dist/esm/nodeviews/TableResizer.js +7 -3
  22. package/dist/esm/transforms/column-width.js +4 -106
  23. package/dist/esm/transforms/delete-columns.js +2 -5
  24. package/dist/esm/ui/common-styles.js +1 -1
  25. package/dist/esm/utils/analytics.js +2 -1
  26. package/dist/types/nodeviews/TableContainer.d.ts +4 -2
  27. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  28. package/dist/types/transforms/column-width.d.ts +1 -14
  29. package/dist/types/utils/analytics.d.ts +1 -0
  30. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
  31. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  32. package/dist/types-ts4.5/transforms/column-width.d.ts +1 -14
  33. package/dist/types-ts4.5/utils/analytics.d.ts +1 -0
  34. package/package.json +2 -5
  35. package/src/__tests__/unit/commands/insert.ts +7 -0
  36. package/src/__tests__/unit/nodeviews/TableContainer.tsx +7 -0
  37. package/src/__tests__/unit/transforms/delete-columns.ts +147 -368
  38. package/src/commands/insert.ts +1 -3
  39. package/src/nodeviews/TableComponent.tsx +2 -1
  40. package/src/nodeviews/TableContainer.tsx +9 -0
  41. package/src/nodeviews/TableResizer.tsx +6 -0
  42. package/src/transforms/column-width.ts +4 -137
  43. package/src/transforms/delete-columns.ts +3 -9
  44. package/src/ui/common-styles.ts +1 -0
  45. package/src/utils/analytics.ts +2 -0
@@ -27,7 +27,6 @@ import {
27
27
  tdEmpty,
28
28
  tr,
29
29
  } from '@atlaskit/editor-test-helpers/doc-builder';
30
- import { ffTest } from '@atlassian/feature-flags-test-utils';
31
30
 
32
31
  import tablePlugin from '../../../plugin';
33
32
  import { pluginKey } from '../../../pm-plugins/plugin-key';
@@ -87,406 +86,186 @@ describe('table plugin -> transforms -> delete columns', () => {
87
86
 
88
87
  describe('when selection rect is given', () => {
89
88
  describe('when the first column is deleted', () => {
90
- describe('should delete the column and move cursor to the first column', () => {
91
- ffTest(
92
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
93
- () => {
94
- const {
95
- editorView,
96
- refs: { nextCursorPos },
97
- } = editor(
98
- doc(
99
- p('text'),
100
- table()(
101
- tr(
102
- td({})(p('{nextCursorPos}')),
103
- td({})(p('c2')),
104
- td({})(p('c3')),
105
- ),
106
- ),
107
- ),
108
- );
109
- const { state, dispatch } = editorView;
110
- dispatch(deleteColumns(colsToRect([0], 1), true)(state.tr));
111
- expect(editorView.state.doc).toEqualDocument(
112
- doc(
113
- p('text'),
114
- table({ localId: TABLE_LOCAL_ID })(
115
- tr(td({})(p('c2')), td()(p('c3'))),
116
- ),
117
- ),
118
- );
119
- expect(editorView.state.selection.from).toEqual(nextCursorPos);
120
- },
121
- () => {
122
- const {
123
- editorView,
124
- refs: { nextCursorPos },
125
- } = editor(
126
- doc(
127
- p('text'),
128
- table()(
129
- tr(
130
- td({})(p('{nextCursorPos}')),
131
- td({})(p('c2')),
132
- td({})(p('c3')),
133
- ),
134
- ),
135
- ),
136
- );
137
- const { state, dispatch } = editorView;
138
- dispatch(deleteColumns(colsToRect([0], 1), true)(state.tr));
139
- expect(editorView.state.doc).toEqualDocument(
140
- doc(
141
- p('text'),
142
- table({ localId: TABLE_LOCAL_ID })(
143
- tr(td({})(p('c2')), td()(p('c3'))),
144
- ),
89
+ it('should delete the column and move cursor to the first column', () => {
90
+ const {
91
+ editorView,
92
+ refs: { nextCursorPos },
93
+ } = editor(
94
+ doc(
95
+ p('text'),
96
+ table()(
97
+ tr(
98
+ td({})(p('{nextCursorPos}')),
99
+ td({})(p('c2')),
100
+ td({})(p('c3')),
145
101
  ),
146
- );
147
- expect(editorView.state.selection.from).toEqual(nextCursorPos);
148
- },
102
+ ),
103
+ ),
104
+ );
105
+ const { state, dispatch } = editorView;
106
+ dispatch(deleteColumns(colsToRect([0], 1), true)(state.tr));
107
+ expect(editorView.state.doc).toEqualDocument(
108
+ doc(
109
+ p('text'),
110
+ table({ localId: TABLE_LOCAL_ID })(
111
+ tr(td({})(p('c2')), td()(p('c3'))),
112
+ ),
113
+ ),
149
114
  );
115
+ expect(editorView.state.selection.from).toEqual(nextCursorPos);
150
116
  });
151
117
  });
152
118
 
153
119
  describe('when middle column is deleted', () => {
154
- describe('should delete the column and move cursor to the previous column', () => {
155
- ffTest(
156
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
157
- () => {
158
- const {
159
- editorView,
160
- refs: { nextCursorPos },
161
- } = editor(
162
- doc(
163
- p('text'),
164
- table()(
165
- tr(
166
- td({})(p('{nextCursorPos}')),
167
- td({})(p('c2')),
168
- td({})(p('c3')),
169
- ),
170
- ),
171
- ),
172
- );
173
- const { state, dispatch } = editorView;
174
- dispatch(deleteColumns(colsToRect([1], 1), true)(state.tr));
175
- expect(editorView.state.doc).toEqualDocument(
176
- doc(
177
- p('text'),
178
- table({ localId: TABLE_LOCAL_ID })(tr(tdEmpty, td()(p('c3')))),
179
- ),
180
- );
181
- expect(editorView.state.selection.from).toEqual(nextCursorPos);
182
- },
183
- () => {
184
- const {
185
- editorView,
186
- refs: { nextCursorPos },
187
- } = editor(
188
- doc(
189
- p('text'),
190
- table()(
191
- tr(
192
- td({})(p('{nextCursorPos}')),
193
- td({})(p('c2')),
194
- td({})(p('c3')),
195
- ),
196
- ),
197
- ),
198
- );
199
- const { state, dispatch } = editorView;
200
- dispatch(deleteColumns(colsToRect([1], 1), true)(state.tr));
201
- expect(editorView.state.doc).toEqualDocument(
202
- doc(
203
- p('text'),
204
- table({ localId: TABLE_LOCAL_ID })(tr(tdEmpty, td()(p('c3')))),
120
+ it('should delete the column and move cursor to the previous column', () => {
121
+ const {
122
+ editorView,
123
+ refs: { nextCursorPos },
124
+ } = editor(
125
+ doc(
126
+ p('text'),
127
+ table()(
128
+ tr(
129
+ td({})(p('{nextCursorPos}')),
130
+ td({})(p('c2')),
131
+ td({})(p('c3')),
205
132
  ),
206
- );
207
- expect(editorView.state.selection.from).toEqual(nextCursorPos);
208
- },
133
+ ),
134
+ ),
135
+ );
136
+ const { state, dispatch } = editorView;
137
+ dispatch(deleteColumns(colsToRect([1], 1), true)(state.tr));
138
+ expect(editorView.state.doc).toEqualDocument(
139
+ doc(
140
+ p('text'),
141
+ table({ localId: TABLE_LOCAL_ID })(tr(tdEmpty, td()(p('c3')))),
142
+ ),
209
143
  );
144
+ expect(editorView.state.selection.from).toEqual(nextCursorPos);
210
145
  });
211
146
  });
212
147
 
213
148
  describe('when multiple rows are selected', () => {
214
- describe('should delete these columns', () => {
215
- ffTest(
216
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
217
- () => {
218
- const { editorView } = editor(
219
- doc(
220
- p('text'),
221
- table()(tr(tdCursor, td({})(p('c1')), td({})(p('c2')))),
222
- ),
223
- );
224
- const { state, dispatch } = editorView;
225
- dispatch(deleteColumns(colsToRect([0, 1], 1), true)(state.tr));
226
- expect(editorView.state.doc).toEqualDocument(
227
- doc(
228
- p('text'),
229
- table({ localId: TABLE_LOCAL_ID })(tr(td()(p('c2')))),
230
- ),
231
- );
232
- },
233
- () => {
234
- const { editorView } = editor(
235
- doc(
236
- p('text'),
237
- table()(tr(tdCursor, td({})(p('c1')), td({})(p('c2')))),
238
- ),
239
- );
240
- const { state, dispatch } = editorView;
241
- dispatch(deleteColumns(colsToRect([0, 1], 1), true)(state.tr));
242
- expect(editorView.state.doc).toEqualDocument(
243
- doc(
244
- p('text'),
245
- table({ localId: TABLE_LOCAL_ID })(tr(td()(p('c2')))),
246
- ),
247
- );
248
- },
149
+ it('should delete these columns', () => {
150
+ const { editorView } = editor(
151
+ doc(
152
+ p('text'),
153
+ table()(tr(tdCursor, td({})(p('c1')), td({})(p('c2')))),
154
+ ),
155
+ );
156
+ const { state, dispatch } = editorView;
157
+ dispatch(deleteColumns(colsToRect([0, 1], 1), true)(state.tr));
158
+ expect(editorView.state.doc).toEqualDocument(
159
+ doc(p('text'), table({ localId: TABLE_LOCAL_ID })(tr(td()(p('c2'))))),
249
160
  );
250
161
  });
251
162
  });
252
163
  });
253
164
 
254
165
  describe('when one column is selected', () => {
255
- describe('should delete the column', () => {
256
- ffTest(
257
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
258
- () => {
259
- const { editorView } = editor(
260
- doc(
261
- p('text'),
262
- table()(
263
- tr(td({})(p('a1')), td({})(p('{<cell}a2')), td({})(p('a3'))),
264
- tr(td({})(p('b1')), td({})(p('{cell>}b2')), td({})(p('b3'))),
265
- ),
266
- ),
267
- );
268
- const { state, dispatch } = editorView;
269
- dispatch(
270
- deleteColumns(getSelectionRect(state.selection)!, true)(state.tr),
271
- );
272
- expect(editorView.state.doc).toEqualDocument(
273
- doc(
274
- p('text'),
275
- table({ localId: TABLE_LOCAL_ID })(
276
- tr(td({})(p('a1')), td({})(p('a3'))),
277
- tr(td({})(p('b1')), td({})(p('b3'))),
278
- ),
279
- ),
280
- );
281
- },
282
- () => {
283
- const { editorView } = editor(
284
- doc(
285
- p('text'),
286
- table()(
287
- tr(td({})(p('a1')), td({})(p('{<cell}a2')), td({})(p('a3'))),
288
- tr(td({})(p('b1')), td({})(p('{cell>}b2')), td({})(p('b3'))),
289
- ),
290
- ),
291
- );
292
- const { state, dispatch } = editorView;
293
- dispatch(
294
- deleteColumns(getSelectionRect(state.selection)!, true)(state.tr),
295
- );
296
- expect(editorView.state.doc).toEqualDocument(
297
- doc(
298
- p('text'),
299
- table({ localId: TABLE_LOCAL_ID })(
300
- tr(td({})(p('a1')), td({})(p('a3'))),
301
- tr(td({})(p('b1')), td({})(p('b3'))),
302
- ),
303
- ),
304
- );
305
- },
166
+ it('should delete the column', () => {
167
+ const { editorView } = editor(
168
+ doc(
169
+ p('text'),
170
+ table()(
171
+ tr(td({})(p('a1')), td({})(p('{<cell}a2')), td({})(p('a3'))),
172
+ tr(td({})(p('b1')), td({})(p('{cell>}b2')), td({})(p('b3'))),
173
+ ),
174
+ ),
175
+ );
176
+ const { state, dispatch } = editorView;
177
+ dispatch(
178
+ deleteColumns(getSelectionRect(state.selection)!, true)(state.tr),
179
+ );
180
+ expect(editorView.state.doc).toEqualDocument(
181
+ doc(
182
+ p('text'),
183
+ table({ localId: TABLE_LOCAL_ID })(
184
+ tr(td({})(p('a1')), td({})(p('a3'))),
185
+ tr(td({})(p('b1')), td({})(p('b3'))),
186
+ ),
187
+ ),
306
188
  );
307
189
  });
308
190
 
309
- describe('should update each cells colWidth', () => {
310
- ffTest(
311
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
312
- () => {
313
- const { editorView } = editor(
314
- doc(
315
- table({ localId: TABLE_LOCAL_ID, layout: 'default', width: 760 })(
316
- tr(
317
- td({ colwidth: [401] })(p('{<>}')),
318
- td({ colwidth: [105] })(p('')),
319
- td({ colwidth: [253] })(p('')),
320
- ),
321
- ),
322
- ),
323
- );
324
- const { dispatch, state } = editorView;
325
- dispatch(
326
- deleteColumns(colsToRect([1], 1), true, editorView)(state.tr),
327
- );
328
-
329
- expect(editorView.state.doc).toEqualDocument(
330
- doc(
331
- table({ localId: TABLE_LOCAL_ID, width: 760 })(
332
- tr(
333
- td({ colwidth: [460] })(p('')),
334
- td({ colwidth: [289] })(p('')),
335
- ),
336
- ),
337
- ),
338
- );
339
- },
340
- () => {
341
- const { editorView } = editor(
342
- doc(
343
- table({ localId: TABLE_LOCAL_ID, width: 691 })(
344
- tr(
345
- td({ colwidth: [230] })(p('')),
346
- td({ colwidth: [230] })(p('')),
347
- td({ colwidth: [230] })(p('')),
348
- ),
349
- ),
191
+ it('should update each cells colWidth', () => {
192
+ const { editorView } = editor(
193
+ doc(
194
+ table({ localId: TABLE_LOCAL_ID, layout: 'default', width: 760 })(
195
+ tr(
196
+ td({ colwidth: [401] })(p('{<>}')),
197
+ td({ colwidth: [105] })(p('')),
198
+ td({ colwidth: [253] })(p('')),
350
199
  ),
351
- );
352
- const { dispatch, state } = editorView;
353
-
354
- dispatch(
355
- deleteColumns(colsToRect([1], 1), true, editorView)(state.tr),
356
- );
200
+ ),
201
+ ),
202
+ );
203
+ const { dispatch, state } = editorView;
204
+ dispatch(deleteColumns(colsToRect([1], 1), true, editorView)(state.tr));
357
205
 
358
- expect(editorView.state.doc).toEqualDocument(
359
- doc(
360
- table({ localId: TABLE_LOCAL_ID, width: 691 })(
361
- tr(
362
- td({ colwidth: [230] })(p('')),
363
- td({ colwidth: [230] })(p('')),
364
- ),
365
- ),
366
- ),
367
- );
368
- },
206
+ expect(editorView.state.doc).toEqualDocument(
207
+ doc(
208
+ table({ localId: TABLE_LOCAL_ID, width: 760 })(
209
+ tr(td({ colwidth: [460] })(p('')), td({ colwidth: [290] })(p(''))),
210
+ ),
211
+ ),
369
212
  );
370
213
  });
371
214
  });
372
215
 
373
216
  describe('when multiple columns are selected', () => {
374
- describe('should delete these column', () => {
375
- ffTest(
376
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
377
- () => {
378
- const { editorView } = editor(
379
- doc(
380
- p('text'),
381
- table()(
382
- tr(td({})(p('{<cell}a1')), td({})(p('a2')), td({})(p('a3'))),
383
- tr(td({})(p('b1')), td({})(p('{cell>}b2')), td({})(p('b3'))),
384
- ),
385
- ),
386
- );
387
- const { state, dispatch } = editorView;
388
- dispatch(
389
- deleteColumns(getSelectionRect(state.selection)!, true)(state.tr),
390
- );
391
- expect(editorView.state.doc).toEqualDocument(
392
- doc(
393
- p('text'),
394
- table({ localId: TABLE_LOCAL_ID })(
395
- tr(td({})(p('a3'))),
396
- tr(td({})(p('b3'))),
397
- ),
398
- ),
399
- );
400
- },
401
- () => {
402
- const { editorView } = editor(
403
- doc(
404
- p('text'),
405
- table()(
406
- tr(td({})(p('{<cell}a1')), td({})(p('a2')), td({})(p('a3'))),
407
- tr(td({})(p('b1')), td({})(p('{cell>}b2')), td({})(p('b3'))),
408
- ),
409
- ),
410
- );
411
- const { state, dispatch } = editorView;
412
- dispatch(
413
- deleteColumns(getSelectionRect(state.selection)!, true)(state.tr),
414
- );
415
- expect(editorView.state.doc).toEqualDocument(
416
- doc(
417
- p('text'),
418
- table({ localId: TABLE_LOCAL_ID })(
419
- tr(td({})(p('a3'))),
420
- tr(td({})(p('b3'))),
421
- ),
422
- ),
423
- );
424
- },
217
+ it('should delete these column', () => {
218
+ const { editorView } = editor(
219
+ doc(
220
+ p('text'),
221
+ table()(
222
+ tr(td({})(p('{<cell}a1')), td({})(p('a2')), td({})(p('a3'))),
223
+ tr(td({})(p('b1')), td({})(p('{cell>}b2')), td({})(p('b3'))),
224
+ ),
225
+ ),
226
+ );
227
+ const { state, dispatch } = editorView;
228
+ dispatch(
229
+ deleteColumns(getSelectionRect(state.selection)!, true)(state.tr),
230
+ );
231
+ expect(editorView.state.doc).toEqualDocument(
232
+ doc(
233
+ p('text'),
234
+ table({ localId: TABLE_LOCAL_ID })(
235
+ tr(td({})(p('a3'))),
236
+ tr(td({})(p('b3'))),
237
+ ),
238
+ ),
425
239
  );
426
240
  });
427
241
 
428
- describe('should update each cells colWidth', () => {
429
- ffTest(
430
- 'platform.editor.table-update-colwidths-after-column-is-deleted',
431
- () => {
432
- const { editorView } = editor(
433
- doc(
434
- table({ localId: TABLE_LOCAL_ID, layout: 'default', width: 760 })(
435
- tr(
436
- td({ colwidth: [401] })(p('{<cell}')),
437
- td({ colwidth: [105] })(p('{cell>}')),
438
- td({ colwidth: [253] })(p('')),
439
- ),
440
- ),
441
- ),
442
- );
443
- const { dispatch, state } = editorView;
444
- dispatch(
445
- deleteColumns(
446
- getSelectionRect(state.selection)!,
447
- true,
448
- editorView,
449
- )(state.tr),
450
- );
451
-
452
- expect(editorView.state.doc).toEqualDocument(
453
- doc(
454
- table({ localId: TABLE_LOCAL_ID, width: 760 })(
455
- tr(td({ colwidth: [749] })(p(''))),
456
- ),
457
- ),
458
- );
459
- },
460
- () => {
461
- const { editorView } = editor(
462
- doc(
463
- table({ localId: TABLE_LOCAL_ID, width: 691 })(
464
- tr(
465
- td({ colwidth: [401] })(p('{<cell}')),
466
- td({ colwidth: [105] })(p('{cell>}')),
467
- td({ colwidth: [253] })(p('')),
468
- ),
469
- ),
242
+ it('should update each cells colWidth', () => {
243
+ const { editorView } = editor(
244
+ doc(
245
+ table({ localId: TABLE_LOCAL_ID, layout: 'default', width: 760 })(
246
+ tr(
247
+ td({ colwidth: [401] })(p('{<cell}')),
248
+ td({ colwidth: [105] })(p('{cell>}')),
249
+ td({ colwidth: [253] })(p('')),
470
250
  ),
471
- );
472
- const { dispatch, state } = editorView;
473
-
474
- dispatch(
475
- deleteColumns(
476
- getSelectionRect(state.selection)!,
477
- true,
478
- editorView,
479
- )(state.tr),
480
- );
251
+ ),
252
+ ),
253
+ );
254
+ const { dispatch, state } = editorView;
255
+ dispatch(
256
+ deleteColumns(
257
+ getSelectionRect(state.selection)!,
258
+ true,
259
+ editorView,
260
+ )(state.tr),
261
+ );
481
262
 
482
- expect(editorView.state.doc).toEqualDocument(
483
- doc(
484
- table({ localId: TABLE_LOCAL_ID, width: 691 })(
485
- tr(td({ colwidth: [253] })(p(''))),
486
- ),
487
- ),
488
- );
489
- },
263
+ expect(editorView.state.doc).toEqualDocument(
264
+ doc(
265
+ table({ localId: TABLE_LOCAL_ID, width: 760 })(
266
+ tr(td({ colwidth: [750] })(p(''))),
267
+ ),
268
+ ),
490
269
  );
491
270
  });
492
271
  });
@@ -56,9 +56,7 @@ export function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth) {
56
56
  const table = findTable(updatedTr.selection);
57
57
  if (table) {
58
58
  // [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
59
- updatedTr = rescaleColumns(getEditorContainerWidth)(table, view)(
60
- updatedTr,
61
- );
59
+ updatedTr = rescaleColumns()(table, view)(updatedTr);
62
60
  }
63
61
 
64
62
  if (
@@ -569,7 +569,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
569
569
  shadowPadding +
570
570
  2;
571
571
 
572
- const { stickyScrollbar } = getEditorFeatureFlags();
572
+ const { stickyScrollbar, tableResizePerformance } = getEditorFeatureFlags();
573
573
 
574
574
  return (
575
575
  <TableContainer
@@ -589,6 +589,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
589
589
  pluginInjectionApi={pluginInjectionApi}
590
590
  isTableResizingEnabled={options?.isTableResizingEnabled}
591
591
  isResizing={isResizing}
592
+ tableResizePerformance={tableResizePerformance}
592
593
  >
593
594
  <div
594
595
  className={ClassName.TABLE_STICKY_SENTINEL_TOP}
@@ -75,6 +75,7 @@ type ResizableTableContainerProps = {
75
75
  tableRef: HTMLTableElement;
76
76
  isResizing?: boolean;
77
77
  pluginInjectionApi?: PluginInjectionAPI;
78
+ tableResizePerformance?: boolean;
78
79
  };
79
80
 
80
81
  export const ResizableTableContainer = React.memo(
@@ -88,6 +89,7 @@ export const ResizableTableContainer = React.memo(
88
89
  tableRef,
89
90
  isResizing,
90
91
  pluginInjectionApi,
92
+ tableResizePerformance,
91
93
  }: PropsWithChildren<ResizableTableContainerProps>) => {
92
94
  const containerRef = useRef<HTMLDivElement | null>(null);
93
95
  const tableWidthRef = useRef<number>(akEditorDefaultLayoutWidth);
@@ -207,6 +209,7 @@ export const ResizableTableContainer = React.memo(
207
209
  displayGuideline,
208
210
  attachAnalyticsEvent,
209
211
  displayGapCursor,
212
+ tableResizePerformance,
210
213
  };
211
214
 
212
215
  if (getBooleanFF('platform.editor.resizing-table-height-improvement')) {
@@ -223,6 +226,9 @@ export const ResizableTableContainer = React.memo(
223
226
  display: 'flex',
224
227
  justifyContent: 'center',
225
228
  }}
229
+ contentEditable={
230
+ tableResizePerformance && isResizing ? 'false' : undefined
231
+ }
226
232
  >
227
233
  <div
228
234
  style={{
@@ -254,6 +260,7 @@ type TableContainerProps = {
254
260
  isNested: boolean;
255
261
  isResizing?: boolean;
256
262
  pluginInjectionApi?: PluginInjectionAPI;
263
+ tableResizePerformance?: boolean;
257
264
  };
258
265
 
259
266
  export const TableContainer = ({
@@ -269,6 +276,7 @@ export const TableContainer = ({
269
276
  isNested,
270
277
  isResizing,
271
278
  pluginInjectionApi,
279
+ tableResizePerformance,
272
280
  }: PropsWithChildren<TableContainerProps>) => {
273
281
  if (isTableResizingEnabled && !isNested) {
274
282
  return (
@@ -281,6 +289,7 @@ export const TableContainer = ({
281
289
  tableRef={tableRef}
282
290
  isResizing={isResizing}
283
291
  pluginInjectionApi={pluginInjectionApi}
292
+ tableResizePerformance={tableResizePerformance}
284
293
  >
285
294
  {children}
286
295
  </ResizableTableContainer>
@@ -68,6 +68,7 @@ interface TableResizerProps {
68
68
  payload: TableEventPayload,
69
69
  ) => ((tr: Transaction) => boolean) | undefined;
70
70
  displayGapCursor: (toggle: boolean) => boolean;
71
+ tableResizePerformance?: boolean;
71
72
  }
72
73
 
73
74
  export interface TableResizerImprovementProps extends TableResizerProps {
@@ -162,6 +163,7 @@ export const TableResizer = ({
162
163
  displayGuideline,
163
164
  attachAnalyticsEvent,
164
165
  displayGapCursor,
166
+ tableResizePerformance,
165
167
  }: PropsWithChildren<TableResizerImprovementProps>) => {
166
168
  const currentGap = useRef(0);
167
169
  // track resizing state - use ref over state to avoid re-render
@@ -354,6 +356,9 @@ export const TableResizer = ({
354
356
  docSize: state.doc.nodeSize,
355
357
  frameRateSamples,
356
358
  originalNode: node,
359
+ experiments: {
360
+ tableResizePerformance,
361
+ },
357
362
  });
358
363
  resizeFrameRatePayloads.forEach((payload) => {
359
364
  attachAnalyticsEvent(payload)?.(tr);
@@ -416,6 +421,7 @@ export const TableResizer = ({
416
421
  attachAnalyticsEvent,
417
422
  endMeasure,
418
423
  onResizeStop,
424
+ tableResizePerformance,
419
425
  ],
420
426
  );
421
427