@atlaskit/editor-plugin-table 10.5.0 → 10.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#130002](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130002)
8
+ [`e273880dffa90`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e273880dffa90) -
9
+ Clean up feature flag platform_editor_nested_table_in_nested_parent_fix
10
+
3
11
  ## 10.5.0
4
12
 
5
13
  ### Minor Changes
@@ -170,7 +170,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
170
170
  var prevAttrs = prevNode.attrs;
171
171
  var isNested = (0, _nodes.isTableNested)(_this.props.view.state, _this.props.getPos());
172
172
  var parentWidth = _this.getParentNodeWidth();
173
- if (isNested && (0, _nodes.isTableNestedInMoreThanOneNode)(_this.props.view.state, _this.props.getPos()) && (0, _platformFeatureFlags.fg)('platform_editor_nested_table_in_nested_parent_fix')) {
173
+ if (isNested && (0, _nodes.isTableNestedInMoreThanOneNode)(_this.props.view.state, _this.props.getPos())) {
174
174
  var resizeObsWrapperWidth = _this.wrapperWidth || 0;
175
175
  var wrapperWidthDiffBetweenRerenders = Math.abs(resizeObsWrapperWidth - (_this.state.parentWidth || 0));
176
176
  var isOusideOfThreshold = wrapperWidthDiffBetweenRerenders <= NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD || wrapperWidthDiffBetweenRerenders > NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD;
@@ -428,14 +428,15 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
428
428
  if (isTableScalingEnabled && tableWithFixedColumnWidthsOption && getNode().attrs.displayMode !== 'fixed') {
429
429
  this.handleColgroupUpdates(true);
430
430
  }
431
- if (this.wrapper && (0, _platformFeatureFlags.fg)('platform_editor_nested_table_in_nested_parent_fix')) {
431
+ if (this.wrapper) {
432
432
  this.wrapperReisizeObserver = new ResizeObserver(function (entries) {
433
433
  var _iterator2 = _createForOfIteratorHelper(entries),
434
434
  _step2;
435
435
  try {
436
436
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
437
+ var _entry$contentRect3;
437
438
  var entry = _step2.value;
438
- _this2.wrapperWidth = entry.contentRect.width;
439
+ _this2.wrapperWidth = (_entry$contentRect3 = entry.contentRect) === null || _entry$contentRect3 === void 0 ? void 0 : _entry$contentRect3.width;
439
440
  }
440
441
  } catch (err) {
441
442
  _iterator2.e(err);
@@ -90,7 +90,8 @@ var transformSliceToRemoveNestedTables = exports.transformSliceToRemoveNestedTab
90
90
  var _slice$content$firstC, _slice$content$lastCh;
91
91
  var isPasteInTable = (0, _utils2.hasParentNodeOfType)([table, tableCell, tableHeader])(selection);
92
92
  var isPasteInNestedTable = (0, _nesting.getParentOfTypeCount)(schema.nodes.table)(selection.$from) > 1;
93
- var isCellPaste = isPasteInTable && slice.content.childCount === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === table && slice.openStart !== 0 && slice.openEnd !== 0;
93
+ var isPasteFullTableInsideEmptyCellEnabled = (0, _platformFeatureFlags.fg)('platform_editor_paste_full_table_inside_empty_cell');
94
+ var isCellPaste = isPasteInTable && slice.content.childCount === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === table && (!isPasteFullTableInsideEmptyCellEnabled || slice.openStart !== 0 && slice.openEnd !== 0);
94
95
 
95
96
  // if nesting is allowed we bump up the default nesting allowance to 2 to support
96
97
  // two levels of nesting in nodes that support table nesting already such as layoutSection and expands
@@ -158,7 +158,7 @@ class TableComponent extends React.Component {
158
158
  const prevAttrs = prevNode.attrs;
159
159
  const isNested = isTableNested(this.props.view.state, this.props.getPos());
160
160
  let parentWidth = this.getParentNodeWidth();
161
- if (isNested && isTableNestedInMoreThanOneNode(this.props.view.state, this.props.getPos()) && fg('platform_editor_nested_table_in_nested_parent_fix')) {
161
+ if (isNested && isTableNestedInMoreThanOneNode(this.props.view.state, this.props.getPos())) {
162
162
  const resizeObsWrapperWidth = this.wrapperWidth || 0;
163
163
  const wrapperWidthDiffBetweenRerenders = Math.abs(resizeObsWrapperWidth - (this.state.parentWidth || 0));
164
164
  const isOusideOfThreshold = wrapperWidthDiffBetweenRerenders <= NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD || wrapperWidthDiffBetweenRerenders > NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD;
@@ -411,10 +411,11 @@ class TableComponent extends React.Component {
411
411
  if (isTableScalingEnabled && tableWithFixedColumnWidthsOption && getNode().attrs.displayMode !== 'fixed') {
412
412
  this.handleColgroupUpdates(true);
413
413
  }
414
- if (this.wrapper && fg('platform_editor_nested_table_in_nested_parent_fix')) {
414
+ if (this.wrapper) {
415
415
  this.wrapperReisizeObserver = new ResizeObserver(entries => {
416
416
  for (const entry of entries) {
417
- this.wrapperWidth = entry.contentRect.width;
417
+ var _entry$contentRect3;
418
+ this.wrapperWidth = (_entry$contentRect3 = entry.contentRect) === null || _entry$contentRect3 === void 0 ? void 0 : _entry$contentRect3.width;
418
419
  }
419
420
  });
420
421
  this.wrapperReisizeObserver.observe(this.wrapper);
@@ -80,7 +80,8 @@ export const transformSliceToRemoveNestedTables = (slice, schema, selection) =>
80
80
  var _slice$content$firstC, _slice$content$lastCh;
81
81
  const isPasteInTable = hasParentNodeOfType([table, tableCell, tableHeader])(selection);
82
82
  const isPasteInNestedTable = getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1;
83
- const isCellPaste = isPasteInTable && slice.content.childCount === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === table && slice.openStart !== 0 && slice.openEnd !== 0;
83
+ const isPasteFullTableInsideEmptyCellEnabled = fg('platform_editor_paste_full_table_inside_empty_cell');
84
+ const isCellPaste = isPasteInTable && slice.content.childCount === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === table && (!isPasteFullTableInsideEmptyCellEnabled || slice.openStart !== 0 && slice.openEnd !== 0);
84
85
 
85
86
  // if nesting is allowed we bump up the default nesting allowance to 2 to support
86
87
  // two levels of nesting in nodes that support table nesting already such as layoutSection and expands
@@ -164,7 +164,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
164
164
  var prevAttrs = prevNode.attrs;
165
165
  var isNested = isTableNested(_this.props.view.state, _this.props.getPos());
166
166
  var parentWidth = _this.getParentNodeWidth();
167
- if (isNested && isTableNestedInMoreThanOneNode(_this.props.view.state, _this.props.getPos()) && fg('platform_editor_nested_table_in_nested_parent_fix')) {
167
+ if (isNested && isTableNestedInMoreThanOneNode(_this.props.view.state, _this.props.getPos())) {
168
168
  var resizeObsWrapperWidth = _this.wrapperWidth || 0;
169
169
  var wrapperWidthDiffBetweenRerenders = Math.abs(resizeObsWrapperWidth - (_this.state.parentWidth || 0));
170
170
  var isOusideOfThreshold = wrapperWidthDiffBetweenRerenders <= NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD || wrapperWidthDiffBetweenRerenders > NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD;
@@ -422,14 +422,15 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
422
422
  if (isTableScalingEnabled && tableWithFixedColumnWidthsOption && getNode().attrs.displayMode !== 'fixed') {
423
423
  this.handleColgroupUpdates(true);
424
424
  }
425
- if (this.wrapper && fg('platform_editor_nested_table_in_nested_parent_fix')) {
425
+ if (this.wrapper) {
426
426
  this.wrapperReisizeObserver = new ResizeObserver(function (entries) {
427
427
  var _iterator2 = _createForOfIteratorHelper(entries),
428
428
  _step2;
429
429
  try {
430
430
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
431
+ var _entry$contentRect3;
431
432
  var entry = _step2.value;
432
- _this2.wrapperWidth = entry.contentRect.width;
433
+ _this2.wrapperWidth = (_entry$contentRect3 = entry.contentRect) === null || _entry$contentRect3 === void 0 ? void 0 : _entry$contentRect3.width;
433
434
  }
434
435
  } catch (err) {
435
436
  _iterator2.e(err);
@@ -83,7 +83,8 @@ export var transformSliceToRemoveNestedTables = function transformSliceToRemoveN
83
83
  var _slice$content$firstC, _slice$content$lastCh;
84
84
  var isPasteInTable = hasParentNodeOfType([table, tableCell, tableHeader])(selection);
85
85
  var isPasteInNestedTable = getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1;
86
- var isCellPaste = isPasteInTable && slice.content.childCount === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === table && slice.openStart !== 0 && slice.openEnd !== 0;
86
+ var isPasteFullTableInsideEmptyCellEnabled = fg('platform_editor_paste_full_table_inside_empty_cell');
87
+ var isCellPaste = isPasteInTable && slice.content.childCount === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === table && (!isPasteFullTableInsideEmptyCellEnabled || slice.openStart !== 0 && slice.openEnd !== 0);
87
88
 
88
89
  // if nesting is allowed we bump up the default nesting allowance to 2 to support
89
90
  // two levels of nesting in nodes that support table nesting already such as layoutSection and expands
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.5.0",
3
+ "version": "10.5.1",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/adf-schema": "^47.6.0",
33
33
  "@atlaskit/button": "^21.1.0",
34
34
  "@atlaskit/custom-steps": "^0.11.0",
35
- "@atlaskit/editor-common": "^102.11.0",
35
+ "@atlaskit/editor-common": "^102.12.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
@@ -116,9 +116,6 @@
116
116
  "platform_editor_batch_steps_table": {
117
117
  "type": "boolean"
118
118
  },
119
- "platform_editor_nested_table_in_nested_parent_fix": {
120
- "type": "boolean"
121
- },
122
119
  "platform-visual-refresh-icons": {
123
120
  "type": "boolean"
124
121
  },
@@ -194,6 +191,9 @@
194
191
  },
195
192
  "platform_editor_scroll_table_flickering_fix": {
196
193
  "type": "boolean"
194
+ },
195
+ "platform_editor_paste_full_table_inside_empty_cell": {
196
+ "type": "boolean"
197
197
  }
198
198
  }
199
199
  }
@@ -286,10 +286,10 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
286
286
  this.handleColgroupUpdates(true);
287
287
  }
288
288
 
289
- if (this.wrapper && fg('platform_editor_nested_table_in_nested_parent_fix')) {
289
+ if (this.wrapper) {
290
290
  this.wrapperReisizeObserver = new ResizeObserver((entries) => {
291
291
  for (const entry of entries) {
292
- this.wrapperWidth = entry.contentRect.width;
292
+ this.wrapperWidth = entry.contentRect?.width;
293
293
  }
294
294
  });
295
295
 
@@ -1193,8 +1193,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
1193
1193
 
1194
1194
  if (
1195
1195
  isNested &&
1196
- isTableNestedInMoreThanOneNode(this.props.view.state, this.props.getPos()) &&
1197
- fg('platform_editor_nested_table_in_nested_parent_fix')
1196
+ isTableNestedInMoreThanOneNode(this.props.view.state, this.props.getPos())
1198
1197
  ) {
1199
1198
  const resizeObsWrapperWidth = this.wrapperWidth || 0;
1200
1199
 
@@ -183,13 +183,25 @@ export const getDragMenuConfig = (
183
183
  {
184
184
  label: 'above',
185
185
  offset: 0,
186
- icon: () => <TableRowAddAboveIcon LEGACY_fallbackIcon={AddRowAboveIcon} spacing={'spacious'} label={''}/>,
186
+ icon: () => (
187
+ <TableRowAddAboveIcon
188
+ LEGACY_fallbackIcon={AddRowAboveIcon}
189
+ spacing={'spacious'}
190
+ label={''}
191
+ />
192
+ ),
187
193
  keymap: addRowBefore,
188
194
  },
189
195
  {
190
196
  label: 'below',
191
197
  offset: 1,
192
- icon: () => <TableRowAddBelowIcon LEGACY_fallbackIcon={AddRowBelowIcon} spacing={'spacious'} label={''}/>,
198
+ icon: () => (
199
+ <TableRowAddBelowIcon
200
+ LEGACY_fallbackIcon={AddRowBelowIcon}
201
+ spacing={'spacious'}
202
+ label={''}
203
+ />
204
+ ),
193
205
  keymap: addRowAfter,
194
206
  },
195
207
  ]
@@ -197,13 +209,25 @@ export const getDragMenuConfig = (
197
209
  {
198
210
  label: 'left',
199
211
  offset: 0,
200
- icon: () => <TableColumnAddLeftIcon LEGACY_fallbackIcon={AddColLeftIcon} spacing={'spacious'} label={''}/>,
212
+ icon: () => (
213
+ <TableColumnAddLeftIcon
214
+ LEGACY_fallbackIcon={AddColLeftIcon}
215
+ spacing={'spacious'}
216
+ label={''}
217
+ />
218
+ ),
201
219
  keymap: addColumnBefore,
202
220
  },
203
221
  {
204
222
  label: 'right',
205
223
  offset: 1,
206
- icon: () => <TableColumnAddRightIcon LEGACY_fallbackIcon={AddColRightIcon} spacing={'spacious'} label={''}/>,
224
+ icon: () => (
225
+ <TableColumnAddRightIcon
226
+ LEGACY_fallbackIcon={AddColRightIcon}
227
+ spacing={'spacious'}
228
+ label={''}
229
+ />
230
+ ),
207
231
  keymap: addColumnAfter,
208
232
  },
209
233
  ];
@@ -212,7 +236,13 @@ export const getDragMenuConfig = (
212
236
  ? [
213
237
  {
214
238
  label: 'up',
215
- icon: () => <TableRowMoveUpIcon LEGACY_fallbackIcon={ArrowUpIcon} spacing={'spacious'} label={''}/>,
239
+ icon: () => (
240
+ <TableRowMoveUpIcon
241
+ LEGACY_fallbackIcon={ArrowUpIcon}
242
+ spacing={'spacious'}
243
+ label={''}
244
+ />
245
+ ),
216
246
  keymap: moveRowUp,
217
247
  canMove: canMove('table-row', -1, tableMap?.height ?? 0, selection, selectionRect),
218
248
  getOriginIndexes: getSelectedRowIndexes,
@@ -220,7 +250,13 @@ export const getDragMenuConfig = (
220
250
  },
221
251
  {
222
252
  label: 'down',
223
- icon: () => <TableRowMoveDownIcon LEGACY_fallbackIcon={ArrowDownIcon} spacing={'spacious'} label={''}/>,
253
+ icon: () => (
254
+ <TableRowMoveDownIcon
255
+ LEGACY_fallbackIcon={ArrowDownIcon}
256
+ spacing={'spacious'}
257
+ label={''}
258
+ />
259
+ ),
224
260
  keymap: moveRowDown,
225
261
  canMove: canMove('table-row', 1, tableMap?.height ?? 0, selection, selectionRect),
226
262
  getOriginIndexes: getSelectedRowIndexes,
@@ -230,7 +266,13 @@ export const getDragMenuConfig = (
230
266
  : [
231
267
  {
232
268
  label: 'left',
233
- icon: () => <TableColumnMoveLeftIcon LEGACY_fallbackIcon={ArrowLeftIcon} spacing={'spacious'} label={''}/>,
269
+ icon: () => (
270
+ <TableColumnMoveLeftIcon
271
+ LEGACY_fallbackIcon={ArrowLeftIcon}
272
+ spacing={'spacious'}
273
+ label={''}
274
+ />
275
+ ),
234
276
  keymap: moveColumnLeft,
235
277
  canMove: canMove('table-column', -1, tableMap?.width ?? 0, selection, selectionRect),
236
278
  getOriginIndexes: getSelectedColumnIndexes,
@@ -238,7 +280,13 @@ export const getDragMenuConfig = (
238
280
  },
239
281
  {
240
282
  label: 'right',
241
- icon: () => <TableColumnMoveRightIcon LEGACY_fallbackIcon={ArrowRightIcon} spacing={'spacious'} label={''}/>,
283
+ icon: () => (
284
+ <TableColumnMoveRightIcon
285
+ LEGACY_fallbackIcon={ArrowRightIcon}
286
+ spacing={'spacious'}
287
+ label={''}
288
+ />
289
+ ),
242
290
  keymap: moveColumnRight,
243
291
  canMove: canMove('table-column', 1, tableMap?.width ?? 0, selection, selectionRect),
244
292
  getOriginIndexes: getSelectedColumnIndexes,
@@ -251,12 +299,24 @@ export const getDragMenuConfig = (
251
299
  {
252
300
  label: 'increasing',
253
301
  order: SortOrder.ASC,
254
- icon: () => <SortAscendingIcon LEGACY_fallbackIcon={HipchatChevronDoubleUpIcon} spacing={'spacious'} label={''}/>,
302
+ icon: () => (
303
+ <SortAscendingIcon
304
+ LEGACY_fallbackIcon={HipchatChevronDoubleUpIcon}
305
+ spacing={'spacious'}
306
+ label={''}
307
+ />
308
+ ),
255
309
  },
256
310
  {
257
311
  label: 'decreasing',
258
312
  order: SortOrder.DESC,
259
- icon: () => <SortDescendingIcon LEGACY_fallbackIcon={HipchatChevronDoubleDownIcon} spacing={'spacious'} label={''}/>,
313
+ icon: () => (
314
+ <SortDescendingIcon
315
+ LEGACY_fallbackIcon={HipchatChevronDoubleDownIcon}
316
+ spacing={'spacious'}
317
+ label={''}
318
+ />
319
+ ),
260
320
  },
261
321
  ]
262
322
  : [];
@@ -329,7 +389,13 @@ export const getDragMenuConfig = (
329
389
  }
330
390
  return false;
331
391
  },
332
- icon: () => <TableColumnsDistributeIcon LEGACY_fallbackIcon={EditorLayoutThreeEqualIcon} spacing={'spacious'} label={''}/>,
392
+ icon: () => (
393
+ <TableColumnsDistributeIcon
394
+ LEGACY_fallbackIcon={EditorLayoutThreeEqualIcon}
395
+ spacing={'spacious'}
396
+ label={''}
397
+ />
398
+ ),
333
399
  }
334
400
  : undefined,
335
401
  {
@@ -342,7 +408,9 @@ export const getDragMenuConfig = (
342
408
  )(state, dispatch);
343
409
  return true;
344
410
  },
345
- icon: () => <TableCellClearIcon LEGACY_fallbackIcon={CrossCircleIcon} spacing={'spacious'} label={''}/>,
411
+ icon: () => (
412
+ <TableCellClearIcon LEGACY_fallbackIcon={CrossCircleIcon} spacing={'spacious'} label={''} />
413
+ ),
346
414
  keymap: tooltip(backspace),
347
415
  },
348
416
  {
@@ -371,36 +439,49 @@ export const getDragMenuConfig = (
371
439
  }
372
440
  return true;
373
441
  },
374
- icon: direction === 'row' ? () => <TableRowDeleteIcon LEGACY_fallbackIcon={RemoveIcon} spacing={'spacious'} label={''}/> : () => <TableColumnDeleteIcon LEGACY_fallbackIcon={RemoveIcon} spacing={'spacious'} label={''}/>,
442
+ icon:
443
+ direction === 'row'
444
+ ? () => (
445
+ <TableRowDeleteIcon
446
+ LEGACY_fallbackIcon={RemoveIcon}
447
+ spacing={'spacious'}
448
+ label={''}
449
+ />
450
+ )
451
+ : () => (
452
+ <TableColumnDeleteIcon
453
+ LEGACY_fallbackIcon={RemoveIcon}
454
+ spacing={'spacious'}
455
+ label={''}
456
+ />
457
+ ),
375
458
  keymap: direction === 'row' ? tooltip(deleteRow) : tooltip(deleteColumn),
376
459
  },
377
- ...moveOptions.map(
378
- ({ label, canMove, icon, keymap, getOriginIndexes, getTargetIndex }) => ({
379
- id: `move_${direction}_${label}`,
380
- title: `Move ${direction} ${label}`,
381
- disabled: !canMove,
382
- icon: icon,
383
- onClick: (state: EditorState, dispatch?: CommandDispatch) => {
384
- if (canMove) {
385
- requestAnimationFrame(() => {
386
- moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(
387
- INPUT_METHOD.TABLE_CONTEXT_MENU,
388
- `table-${direction}`,
389
- // Ignored via go/ees005
390
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
391
- getOriginIndexes(selectionRect!),
392
- // Ignored via go/ees005
393
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
394
- getTargetIndex(selectionRect!),
395
- )(editorView.state, editorView.dispatch);
396
- });
397
- return true;
398
- }
399
- return false;
400
- },
401
- keymap: keymap && tooltip(keymap),
402
- }),
403
- ),
460
+ ...moveOptions.map(({ label, canMove, icon, keymap, getOriginIndexes, getTargetIndex }) => ({
461
+ id: `move_${direction}_${label}`,
462
+ title: `Move ${direction} ${label}`,
463
+ disabled: !canMove,
464
+ icon: icon,
465
+ onClick: (state: EditorState, dispatch?: CommandDispatch) => {
466
+ if (canMove) {
467
+ requestAnimationFrame(() => {
468
+ moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(
469
+ INPUT_METHOD.TABLE_CONTEXT_MENU,
470
+ `table-${direction}`,
471
+ // Ignored via go/ees005
472
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
473
+ getOriginIndexes(selectionRect!),
474
+ // Ignored via go/ees005
475
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
476
+ getTargetIndex(selectionRect!),
477
+ )(editorView.state, editorView.dispatch);
478
+ });
479
+ return true;
480
+ }
481
+ return false;
482
+ },
483
+ keymap: keymap && tooltip(keymap),
484
+ })),
404
485
  ];
405
486
 
406
487
  const allConfigs = [...restConfigs];
@@ -106,12 +106,14 @@ export const transformSliceToRemoveNestedTables = (
106
106
  if (isNestingAllowed) {
107
107
  const isPasteInTable = hasParentNodeOfType([table, tableCell, tableHeader])(selection);
108
108
  const isPasteInNestedTable = getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1;
109
+ const isPasteFullTableInsideEmptyCellEnabled = fg(
110
+ 'platform_editor_paste_full_table_inside_empty_cell',
111
+ );
109
112
  const isCellPaste =
110
113
  isPasteInTable &&
111
114
  slice.content.childCount === 1 &&
112
115
  slice.content.firstChild?.type === table &&
113
- slice.openStart !== 0 &&
114
- slice.openEnd !== 0;
116
+ (!isPasteFullTableInsideEmptyCellEnabled || (slice.openStart !== 0 && slice.openEnd !== 0));
115
117
 
116
118
  // if nesting is allowed we bump up the default nesting allowance to 2 to support
117
119
  // two levels of nesting in nodes that support table nesting already such as layoutSection and expands
@@ -840,7 +840,13 @@ const getColumnSettingItems = (
840
840
  id: 'editor.table.distributeColumns',
841
841
  type: 'button',
842
842
  title: formatMessage(messages.distributeColumns),
843
- icon: () => <TableColumnsDistributeIcon LEGACY_fallbackIcon={DistributeColumnIcon} spacing={'spacious'} label={''}/>,
843
+ icon: () => (
844
+ <TableColumnsDistributeIcon
845
+ LEGACY_fallbackIcon={DistributeColumnIcon}
846
+ spacing={'spacious'}
847
+ label={''}
848
+ />
849
+ ),
844
850
  onClick: (state, dispatch, view) =>
845
851
  getDistributeConfig(
846
852
  getEditorContainerWidth,