@atlaskit/editor-plugin-table 7.19.11 → 7.19.12

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 (64) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/commands/column-resize.js +1 -1
  3. package/dist/cjs/commands/selection.js +25 -4
  4. package/dist/cjs/plugin.js +59 -56
  5. package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +23 -9
  6. package/dist/cjs/pm-plugins/keymap.js +6 -6
  7. package/dist/cjs/pm-plugins/main.js +1 -1
  8. package/dist/cjs/pm-plugins/table-selection-keymap.js +6 -3
  9. package/dist/cjs/toolbar.js +8 -5
  10. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
  11. package/dist/cjs/ui/FloatingDragMenu/index.js +5 -3
  12. package/dist/cjs/ui/TableFloatingControls/index.js +8 -2
  13. package/dist/cjs/utils/drag-menu.js +5 -1
  14. package/dist/es2019/commands/column-resize.js +2 -2
  15. package/dist/es2019/commands/selection.js +25 -4
  16. package/dist/es2019/plugin.js +11 -7
  17. package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +18 -3
  18. package/dist/es2019/pm-plugins/keymap.js +7 -7
  19. package/dist/es2019/pm-plugins/main.js +2 -2
  20. package/dist/es2019/pm-plugins/table-selection-keymap.js +6 -3
  21. package/dist/es2019/toolbar.js +8 -5
  22. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
  23. package/dist/es2019/ui/FloatingDragMenu/index.js +6 -4
  24. package/dist/es2019/ui/TableFloatingControls/index.js +9 -3
  25. package/dist/es2019/utils/drag-menu.js +6 -2
  26. package/dist/esm/commands/column-resize.js +2 -2
  27. package/dist/esm/commands/selection.js +25 -4
  28. package/dist/esm/plugin.js +60 -57
  29. package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +23 -9
  30. package/dist/esm/pm-plugins/keymap.js +7 -7
  31. package/dist/esm/pm-plugins/main.js +2 -2
  32. package/dist/esm/pm-plugins/table-selection-keymap.js +6 -3
  33. package/dist/esm/toolbar.js +8 -5
  34. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
  35. package/dist/esm/ui/FloatingDragMenu/index.js +6 -4
  36. package/dist/esm/ui/TableFloatingControls/index.js +9 -3
  37. package/dist/esm/utils/drag-menu.js +5 -1
  38. package/dist/types/commands/selection.d.ts +4 -2
  39. package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +4 -2
  40. package/dist/types/pm-plugins/table-selection-keymap.d.ts +3 -3
  41. package/dist/types/toolbar.d.ts +2 -2
  42. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +3 -1
  43. package/dist/types/ui/FloatingDragMenu/index.d.ts +3 -1
  44. package/dist/types/utils/drag-menu.d.ts +2 -1
  45. package/dist/types-ts4.5/commands/selection.d.ts +4 -2
  46. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +4 -2
  47. package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +3 -3
  48. package/dist/types-ts4.5/toolbar.d.ts +2 -2
  49. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +3 -1
  50. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +3 -1
  51. package/dist/types-ts4.5/utils/drag-menu.d.ts +2 -1
  52. package/package.json +7 -4
  53. package/src/commands/column-resize.ts +2 -2
  54. package/src/commands/selection.ts +49 -4
  55. package/src/plugin.tsx +8 -7
  56. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +43 -3
  57. package/src/pm-plugins/keymap.ts +23 -7
  58. package/src/pm-plugins/main.ts +2 -2
  59. package/src/pm-plugins/table-selection-keymap.ts +18 -6
  60. package/src/toolbar.tsx +7 -1
  61. package/src/ui/FloatingDragMenu/DragMenu.tsx +7 -0
  62. package/src/ui/FloatingDragMenu/index.tsx +9 -2
  63. package/src/ui/TableFloatingControls/index.tsx +12 -4
  64. package/src/utils/drag-menu.ts +8 -1
@@ -13,7 +13,7 @@ import { browser } from '@atlaskit/editor-common/utils';
13
13
  import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
14
14
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
15
15
  import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
16
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { insertTableWithSize } from './commands/insert';
18
18
  import { pluginConfig } from './create-plugin-config';
19
19
  import { createPlugin as createTableAnalyticsPlugin } from './pm-plugins/analytics/plugin';
@@ -52,7 +52,7 @@ var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
52
52
  * from `@atlaskit/editor-core`.
53
53
  */
54
54
  var tablesPlugin = function tablesPlugin(_ref) {
55
- var _api$analytics, _options$getEditorFea, _options$getEditorFea2, _api$analytics2;
55
+ var _api$analytics, _api$accessibilityUti, _options$getEditorFea, _options$getEditorFea2, _api$analytics2;
56
56
  var options = _ref.config,
57
57
  api = _ref.api;
58
58
  var editorViewRef = {
@@ -65,8 +65,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
65
65
  };
66
66
  };
67
67
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
68
+ var ariaNotifyPlugin = api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 ? void 0 : _api$accessibilityUti.actions.ariaNotify;
68
69
  var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
69
- var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && isTableFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
70
+ var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && isTableFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
70
71
  var isCellBackgroundDuplicated = (options === null || options === void 0 || (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableDuplicateCellColouring) || false;
71
72
  return {
72
73
  name: 'table',
@@ -202,18 +203,19 @@ var tablesPlugin = function tablesPlugin(_ref) {
202
203
  }
203
204
  }, {
204
205
  name: 'tableSelectionKeymap',
205
- plugin: function plugin() {
206
- return tableSelectionKeymapPlugin(api === null || api === void 0 ? void 0 : api.selection);
206
+ plugin: function plugin(_ref8) {
207
+ var getIntl = _ref8.getIntl;
208
+ return tableSelectionKeymapPlugin(api, getIntl);
207
209
  }
208
210
  }, {
209
211
  name: 'tableEditing',
210
212
  plugin: function plugin() {
211
- var _ref8 = options || {},
212
- dragAndDropEnabled = _ref8.dragAndDropEnabled;
213
+ var _ref9 = options || {},
214
+ dragAndDropEnabled = _ref9.dragAndDropEnabled;
213
215
  return tableEditing({
214
- reportFixedTable: function reportFixedTable(_ref9) {
215
- var tr = _ref9.tr,
216
- reason = _ref9.reason;
216
+ reportFixedTable: function reportFixedTable(_ref10) {
217
+ var tr = _ref10.tr,
218
+ reason = _ref10.reason;
217
219
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
218
220
  action: TABLE_ACTION.FIXED,
219
221
  actionSubject: ACTION_SUBJECT.TABLE,
@@ -229,53 +231,53 @@ var tablesPlugin = function tablesPlugin(_ref) {
229
231
  }
230
232
  }, {
231
233
  name: 'tableStickyHeaders',
232
- plugin: function plugin(_ref10) {
233
- var dispatch = _ref10.dispatch,
234
- eventDispatcher = _ref10.eventDispatcher;
234
+ plugin: function plugin(_ref11) {
235
+ var dispatch = _ref11.dispatch,
236
+ eventDispatcher = _ref11.eventDispatcher;
235
237
  return options && options.tableOptions.stickyHeaders ? createStickyHeadersPlugin(dispatch, function () {
236
238
  return [];
237
239
  }) : undefined;
238
240
  }
239
241
  }, {
240
242
  name: 'tableDragAndDrop',
241
- plugin: function plugin(_ref11) {
242
- var dispatch = _ref11.dispatch;
243
+ plugin: function plugin(_ref12) {
244
+ var dispatch = _ref12.dispatch;
243
245
  return options !== null && options !== void 0 && options.dragAndDropEnabled ? createDragAndDropPlugin(dispatch, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : undefined;
244
246
  }
245
247
  }, {
246
248
  name: 'tableViewModeSort',
247
249
  plugin: function plugin() {
248
- return getBooleanFF('platform.editor.table.live-pages-sorting_4malx') && api !== null && api !== void 0 && api.editorViewMode ? createViewModeSortPlugin(api.editorViewMode) : undefined;
250
+ return api !== null && api !== void 0 && api.editorViewMode && fg('platform.editor.table.live-pages-sorting_4malx') ? createViewModeSortPlugin(api.editorViewMode) : undefined;
249
251
  }
250
252
  }, {
251
253
  name: 'tableLocalId',
252
- plugin: function plugin(_ref12) {
253
- var dispatch = _ref12.dispatch;
254
+ plugin: function plugin(_ref13) {
255
+ var dispatch = _ref13.dispatch;
254
256
  return createTableLocalIdPlugin(dispatch);
255
257
  }
256
258
  }, {
257
259
  name: 'tableWidth',
258
- plugin: function plugin(_ref13) {
260
+ plugin: function plugin(_ref14) {
259
261
  var _options$fullWidthEna, _options$isTableScali, _options$isTableAlign;
260
- var dispatchAnalyticsEvent = _ref13.dispatchAnalyticsEvent,
261
- dispatch = _ref13.dispatch;
262
+ var dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent,
263
+ dispatch = _ref14.dispatch;
262
264
  return options !== null && options !== void 0 && options.tableResizingEnabled ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false, (_options$isTableScali = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) !== null && _options$isTableScali !== void 0 ? _options$isTableScali : false, (_options$isTableAlign = options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled) !== null && _options$isTableAlign !== void 0 ? _options$isTableAlign : false) : undefined;
263
265
  }
264
266
  },
265
267
  // TODO: should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
266
268
  {
267
269
  name: 'tableOverflowAnalyticsPlugin',
268
- plugin: function plugin(_ref14) {
270
+ plugin: function plugin(_ref15) {
269
271
  var _options$tableResizin;
270
- var dispatch = _ref14.dispatch,
271
- dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent;
272
+ var dispatch = _ref15.dispatch,
273
+ dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent;
272
274
  return createTableOverflowAnalyticsPlugin(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false);
273
275
  }
274
276
  }, {
275
277
  name: 'tableAnalyticsPlugin',
276
- plugin: function plugin(_ref15) {
277
- var dispatch = _ref15.dispatch,
278
- dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent;
278
+ plugin: function plugin(_ref16) {
279
+ var dispatch = _ref16.dispatch,
280
+ dispatchAnalyticsEvent = _ref16.dispatchAnalyticsEvent;
279
281
  return createTableAnalyticsPlugin(dispatch, dispatchAnalyticsEvent);
280
282
  }
281
283
  }, {
@@ -306,12 +308,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
306
308
  }
307
309
  return plugins;
308
310
  },
309
- contentComponent: function contentComponent(_ref16) {
310
- var editorView = _ref16.editorView,
311
- popupsMountPoint = _ref16.popupsMountPoint,
312
- popupsBoundariesElement = _ref16.popupsBoundariesElement,
313
- popupsScrollableElement = _ref16.popupsScrollableElement,
314
- dispatchAnalyticsEvent = _ref16.dispatchAnalyticsEvent;
311
+ contentComponent: function contentComponent(_ref17) {
312
+ var editorView = _ref17.editorView,
313
+ popupsMountPoint = _ref17.popupsMountPoint,
314
+ popupsBoundariesElement = _ref17.popupsBoundariesElement,
315
+ popupsScrollableElement = _ref17.popupsScrollableElement,
316
+ dispatchAnalyticsEvent = _ref17.dispatchAnalyticsEvent;
315
317
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
316
318
  component: ACTION_SUBJECT.TABLES_PLUGIN,
317
319
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
@@ -325,35 +327,35 @@ var tablesPlugin = function tablesPlugin(_ref) {
325
327
  stickyHeadersState: stickyHeadersPluginKey,
326
328
  dragAndDropState: dragAndDropPluginKey
327
329
  },
328
- render: function render(_ref17) {
329
- var resizingPluginState = _ref17.tableResizingPluginState,
330
- stickyHeadersState = _ref17.stickyHeadersState,
331
- tablePluginState = _ref17.tablePluginState,
332
- tableWidthPluginState = _ref17.tableWidthPluginState,
333
- dragAndDropState = _ref17.dragAndDropState;
330
+ render: function render(_ref18) {
331
+ var resizingPluginState = _ref18.tableResizingPluginState,
332
+ stickyHeadersState = _ref18.stickyHeadersState,
333
+ tablePluginState = _ref18.tablePluginState,
334
+ tableWidthPluginState = _ref18.tableWidthPluginState,
335
+ dragAndDropState = _ref18.dragAndDropState;
334
336
  var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
335
337
  var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
336
338
  var resizingTableLocalId = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableLocalId;
337
339
  var resizingTableRef = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableRef;
338
340
  var isResizing = isColumnResizing || isTableResizing;
339
341
  var widthToWidest = tablePluginState === null || tablePluginState === void 0 ? void 0 : tablePluginState.widthToWidest;
340
- var _ref18 = tablePluginState,
341
- tableNode = _ref18.tableNode,
342
- tablePos = _ref18.tablePos,
343
- targetCellPosition = _ref18.targetCellPosition,
344
- isContextualMenuOpen = _ref18.isContextualMenuOpen,
345
- tableRef = _ref18.tableRef,
346
- pluginConfig = _ref18.pluginConfig,
347
- insertColumnButtonIndex = _ref18.insertColumnButtonIndex,
348
- insertRowButtonIndex = _ref18.insertRowButtonIndex,
349
- isHeaderColumnEnabled = _ref18.isHeaderColumnEnabled,
350
- isHeaderRowEnabled = _ref18.isHeaderRowEnabled,
351
- isDragAndDropEnabled = _ref18.isDragAndDropEnabled,
352
- tableWrapperTarget = _ref18.tableWrapperTarget,
353
- isCellMenuOpenByKeyboard = _ref18.isCellMenuOpenByKeyboard;
342
+ var _ref19 = tablePluginState,
343
+ tableNode = _ref19.tableNode,
344
+ tablePos = _ref19.tablePos,
345
+ targetCellPosition = _ref19.targetCellPosition,
346
+ isContextualMenuOpen = _ref19.isContextualMenuOpen,
347
+ tableRef = _ref19.tableRef,
348
+ pluginConfig = _ref19.pluginConfig,
349
+ insertColumnButtonIndex = _ref19.insertColumnButtonIndex,
350
+ insertRowButtonIndex = _ref19.insertRowButtonIndex,
351
+ isHeaderColumnEnabled = _ref19.isHeaderColumnEnabled,
352
+ isHeaderRowEnabled = _ref19.isHeaderRowEnabled,
353
+ isDragAndDropEnabled = _ref19.isDragAndDropEnabled,
354
+ tableWrapperTarget = _ref19.tableWrapperTarget,
355
+ isCellMenuOpenByKeyboard = _ref19.isCellMenuOpenByKeyboard;
354
356
  var allowControls = pluginConfig.allowControls;
355
357
  var stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
356
- return /*#__PURE__*/React.createElement(React.Fragment, null, targetCellPosition && (tableRef || getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/React.createElement(FloatingContextualButton, {
358
+ return /*#__PURE__*/React.createElement(React.Fragment, null, targetCellPosition && (tableRef || isCellMenuOpenByKeyboard && fg('platform.editor.a11y-table-context-menu_y4c9c')) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/React.createElement(FloatingContextualButton, {
357
359
  isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
358
360
  editorView: editorView,
359
361
  tableNode: tableNode,
@@ -409,7 +411,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
409
411
  stickyHeaders: stickyHeader,
410
412
  pluginConfig: pluginConfig,
411
413
  isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
412
- getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags
414
+ getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
415
+ ariaNotifyPlugin: ariaNotifyPlugin
413
416
  }), allowControls && !isDragAndDropEnabled && !isResizing && /*#__PURE__*/React.createElement(FloatingDeleteButton, {
414
417
  editorView: editorView,
415
418
  selection: editorView.state.selection,
@@ -434,8 +437,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
434
437
  }));
435
438
  },
436
439
  pluginsOptions: {
437
- quickInsert: function quickInsert(_ref19) {
438
- var formatMessage = _ref19.formatMessage;
440
+ quickInsert: function quickInsert(_ref20) {
441
+ var formatMessage = _ref20.formatMessage;
439
442
  return [{
440
443
  id: 'table',
441
444
  title: formatMessage(messages.table),
@@ -1,5 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_STATUS } from '@atlaskit/editor-common/analytics';
3
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
3
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
4
5
  import { findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
5
6
  import { getSelectedColumnIndexes, getSelectedRowIndexes, getSelectedTableInfo } from '../../utils';
@@ -36,7 +37,7 @@ export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(
36
37
  });
37
38
  };
38
39
  };
39
- export var moveSourceWithAnalytics = function moveSourceWithAnalytics(editorAnalyticsAPI) {
40
+ export var moveSourceWithAnalytics = function moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl) {
40
41
  return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr) {
41
42
  return withEditorAnalyticsAPI(function (_ref2) {
42
43
  var selection = _ref2.selection;
@@ -66,12 +67,25 @@ export var moveSourceWithAnalytics = function moveSourceWithAnalytics(editorAnal
66
67
  })(editorAnalyticsAPI)(function (state, dispatch) {
67
68
  if (dispatch) {
68
69
  moveSource(sourceType, sourceIndexes, targetIndex, tr)(state, dispatch);
70
+ // Only considering single row/column movement for screen reader as only single row/column selection is supported via keyboard atm.
71
+ if ((inputMethod === INPUT_METHOD.TABLE_CONTEXT_MENU || INPUT_METHOD.SHORTCUT) && sourceIndexes.length === 1 && ariaNotify && getIntl) {
72
+ var direction = sourceIndexes[0] > targetIndex ? -1 : 1; // -1 for left/up , 1 for right/down
73
+ var _getSelectedTableInfo3 = getSelectedTableInfo(state.selection),
74
+ totalRowCount = _getSelectedTableInfo3.totalRowCount,
75
+ totalColumnCount = _getSelectedTableInfo3.totalColumnCount;
76
+ ariaNotify(getIntl().formatMessage(sourceType === 'table-row' ? direction > 0 ? messages.rowMovedDown : messages.rowMovedUp : direction > 0 ? messages.columnMovedRight : messages.columnMovedLeft, {
77
+ index: targetIndex + 1,
78
+ total: sourceType === 'table-row' ? totalRowCount : totalColumnCount
79
+ }), {
80
+ priority: 'important'
81
+ });
82
+ }
69
83
  }
70
84
  return true;
71
85
  });
72
86
  };
73
87
  };
74
- export var moveSourceWithAnalyticsViaShortcut = function moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI) {
88
+ export var moveSourceWithAnalyticsViaShortcut = function moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotify, getIntl) {
75
89
  return function (sourceType, direction) {
76
90
  return function (state, dispatch) {
77
91
  var selection = state.selection;
@@ -85,14 +99,14 @@ export var moveSourceWithAnalyticsViaShortcut = function moveSourceWithAnalytics
85
99
  if (selectedIndexes.length === 0) {
86
100
  return false;
87
101
  }
88
- var _getSelectedTableInfo3 = getSelectedTableInfo(selection),
89
- totalRowCount = _getSelectedTableInfo3.totalRowCount,
90
- totalColumnCount = _getSelectedTableInfo3.totalColumnCount;
102
+ var _getSelectedTableInfo4 = getSelectedTableInfo(selection),
103
+ totalRowCount = _getSelectedTableInfo4.totalRowCount,
104
+ totalColumnCount = _getSelectedTableInfo4.totalColumnCount;
91
105
  if (!canMove(sourceType, direction, isRow ? totalRowCount : totalColumnCount, selection, selectionRect)) {
92
106
  return false;
93
107
  }
94
108
  var targetIndex = getTargetIndex(selectedIndexes, direction);
95
- return moveSourceWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT, sourceType, selectedIndexes, targetIndex)(state, dispatch);
109
+ return moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl)(INPUT_METHOD.SHORTCUT, sourceType, selectedIndexes, targetIndex)(state, dispatch);
96
110
  };
97
111
  };
98
112
  };
@@ -101,9 +115,9 @@ export var cloneSourceWithAnalytics = function cloneSourceWithAnalytics(editorAn
101
115
  return withEditorAnalyticsAPI(function (_ref3) {
102
116
  var selection = _ref3.selection;
103
117
  var direction = sourceIndexes[0] > targetIndex ? -1 : 1;
104
- var _getSelectedTableInfo4 = getSelectedTableInfo(selection),
105
- totalRowCount = _getSelectedTableInfo4.totalRowCount,
106
- totalColumnCount = _getSelectedTableInfo4.totalColumnCount;
118
+ var _getSelectedTableInfo5 = getSelectedTableInfo(selection),
119
+ totalRowCount = _getSelectedTableInfo5.totalRowCount,
120
+ totalColumnCount = _getSelectedTableInfo5.totalColumnCount;
107
121
  return {
108
122
  action: sourceType === 'table-row' ? TABLE_ACTION.CLONED_ROW : TABLE_ACTION.CLONED_COLUMN,
109
123
  actionSubject: ACTION_SUBJECT.TABLE,
@@ -2,7 +2,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { addColumnAfter, addColumnAfterVO, addColumnBefore, addColumnBeforeVO, addRowAfter, addRowAfterVO, addRowBefore, addRowBeforeVO, backspace, bindKeymapWithCommand, decreaseMediaSize, deleteColumn, deleteRow, escape, focusToContextMenuTrigger, increaseMediaSize, moveColumnLeft, moveColumnRight, moveLeft, moveRight, moveRowDown, moveRowUp, nextCell, previousCell, startColumnResizing, toggleTable } from '@atlaskit/editor-common/keymaps';
3
3
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
4
4
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
5
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { goToNextCell, moveCursorBackward, setFocusToCellMenu } from '../commands';
7
7
  import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
8
8
  import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
@@ -31,7 +31,7 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
31
31
  bindKeymapWithCommand(addRowAfter.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
32
32
  bindKeymapWithCommand(addColumnBefore.common, addColumnBeforeCommand(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
33
33
  bindKeymapWithCommand(addColumnAfter.common, addColumnAfterCommand(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
34
- if (getBooleanFF('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg')) {
34
+ if (fg('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg')) {
35
35
  bindKeymapWithCommand(addRowBeforeVO.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
36
36
  bindKeymapWithCommand(addRowAfterVO.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
37
37
  bindKeymapWithCommand(addColumnBeforeVO.common, addColumnBeforeCommand(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
@@ -46,10 +46,10 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
46
46
  * See ticket ED-22154 https://product-fabric.atlassian.net/browse/ED-22154
47
47
  */
48
48
 
49
- bindKeymapWithCommand(moveRowDown.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-row', 1), list);
50
- bindKeymapWithCommand(moveRowUp.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-row', -1), list);
51
- bindKeymapWithCommand(moveColumnLeft.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-column', -1), list);
52
- bindKeymapWithCommand(moveColumnRight.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-column', 1), list);
49
+ bindKeymapWithCommand(moveRowDown.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-row', 1), list);
50
+ bindKeymapWithCommand(moveRowUp.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-row', -1), list);
51
+ bindKeymapWithCommand(moveColumnLeft.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-column', -1), list);
52
+ bindKeymapWithCommand(moveColumnRight.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-column', 1), list);
53
53
 
54
54
  // Delete row/column shortcuts
55
55
  bindKeymapWithCommand(deleteColumn.common, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
@@ -75,7 +75,7 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
75
75
  ariaNotify: ariaNotifyPlugin,
76
76
  getIntl: getIntl
77
77
  }), list);
78
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
78
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
79
79
  bindKeymapWithCommand(focusToContextMenuTrigger.common, setFocusToCellMenu(), list);
80
80
  }
81
81
  return keymap(list);
@@ -9,7 +9,7 @@ import { browser, closestElement } from '@atlaskit/editor-common/utils';
9
9
  import { findParentDomRefOfType, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { TableMap } from '@atlaskit/editor-tables';
11
11
  import { findTable } from '@atlaskit/editor-tables/utils';
12
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { addBoldInEmptyHeaderCells, clearHoverSelection, setTableRef } from '../commands';
14
14
  import { stopKeyboardColumnResizing } from '../commands/column-resize';
15
15
  import { removeResizeHandleDecorations, transformSliceRemoveCellBackgroundColor, transformSliceToAddTableHeaders, transformSliceToRemoveColumnsWidths } from '../commands/misc';
@@ -199,7 +199,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
199
199
  }
200
200
 
201
201
  // If a partial paste of nested expand, paste only nested-expand's content */
202
- if (getBooleanFF('platform.editor.transform-slice-for-nested-expand')) {
202
+ if (fg('platform.editor.transform-slice-for-nested-expand')) {
203
203
  slice = transformSliceToRemoveOpenNestedExpand(slice, schema);
204
204
  }
205
205
  return slice;
@@ -1,12 +1,15 @@
1
1
  import { bindKeymapArrayWithCommand, bindKeymapWithCommand, moveLeft, moveRight, selectColumn, selectRow, selectTable, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
3
  import { arrowLeftFromTable, arrowRightFromTable, modASelectTable, selectColumns, selectRows, shiftArrowUpFromTable } from '../commands/selection';
4
- export function tableSelectionKeymapPlugin(editorSelectionAPI) {
4
+ export function tableSelectionKeymapPlugin(pluginInjectionApi, getIntl) {
5
+ var _pluginInjectionApi$a;
5
6
  var list = {};
7
+ var editorSelectionAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.selection;
8
+ var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
6
9
  bindKeymapWithCommand(moveRight.common, arrowRightFromTable(editorSelectionAPI)(), list);
7
10
  bindKeymapWithCommand(moveLeft.common, arrowLeftFromTable(editorSelectionAPI)(), list);
8
- bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
9
- bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
11
+ bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI, ariaNotifyPlugin, getIntl)(true), list);
12
+ bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI, ariaNotifyPlugin, getIntl)(true), list);
10
13
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
11
14
  bindKeymapWithCommand(selectTable.common, modASelectTable(editorSelectionAPI)(), list);
12
15
  return keymap(list);
@@ -364,7 +364,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
364
364
  return element;
365
365
  };
366
366
  var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
367
- var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) : [];
367
+ var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.fullWidthEnabled) : [];
368
368
  var isCellBackgroundDuplicated = getEditorFeatureFlags().tableDuplicateCellColouring || false;
369
369
  var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
370
370
  var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : [];
@@ -580,7 +580,7 @@ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch)
580
580
  }
581
581
  return false;
582
582
  };
583
- export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) {
583
+ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) {
584
584
  var formatMessage = _ref6.formatMessage;
585
585
  var tableObject = findTable(editorState.selection);
586
586
  if (!tableObject) {
@@ -613,7 +613,7 @@ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editor
613
613
  title: formatMessage(layoutToMessages[value]),
614
614
  selected: normaliseAlignment(currentLayout) === value,
615
615
  onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED)
616
- }, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) && {
616
+ }, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) && {
617
617
  disabled: value !== 'center'
618
618
  });
619
619
  });
@@ -643,7 +643,7 @@ export var getSelectedAlignmentIcon = function getSelectedAlignmentIcon(alignmen
643
643
  return icon.value === normaliseAlignment(selectedAlignment);
644
644
  });
645
645
  };
646
- export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) {
646
+ export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) {
647
647
  var _getEditorContainerWi = getEditorContainerWidth(),
648
648
  lineLength = _getEditorContainerWi.lineLength;
649
649
  var tableContainerWidth = getTableContainerWidth(selectedNode);
@@ -655,7 +655,10 @@ export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode
655
655
  var scalePercent = getStaticTableScalingPercent(selectedNode, tableWrapperWidth, shouldUseIncreasedScalingPercent);
656
656
  tableContainerWidth = tableContainerWidth * scalePercent;
657
657
  }
658
- if (selectedNode && lineLength && tableContainerWidth > lineLength) {
658
+
659
+ // If fixed-width editor, we disable 'left-alignment' when table width is 760px.
660
+ // tableContainerWidth +1 here because tableContainerWidth is 759 in fixed-width editor
661
+ if (selectedNode && !isFullWidthEditor && lineLength && tableContainerWidth + 1 >= lineLength) {
659
662
  return true;
660
663
  }
661
664
  return false;
@@ -196,7 +196,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
196
196
  tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
197
197
  shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
198
198
  isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
199
- tableSortColumnReorder = _ref.tableSortColumnReorder;
199
+ tableSortColumnReorder = _ref.tableSortColumnReorder,
200
+ ariaNotifyPlugin = _ref.ariaNotifyPlugin;
200
201
  var state = editorView.state,
201
202
  dispatch = editorView.dispatch;
202
203
  var selection = state.selection;
@@ -210,7 +211,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
210
211
  var selectionRect = isSelectionType(selection, 'cell') ? getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
211
212
  var hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
212
213
  var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
213
- var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnReorder);
214
+ var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnReorder, ariaNotifyPlugin);
214
215
  var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnReorder, selectionRect),
215
216
  menuItems = _convertToDropdownIte.menuItems,
216
217
  menuCallback = _convertToDropdownIte.menuCallback;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Popup } from '@atlaskit/editor-common/ui';
3
3
  import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { dragMenuDropdownWidth, tablePopupMenuFitHeight } from '../consts';
7
7
  import DragMenu from './DragMenu';
8
8
  var FloatingDragMenu = function FloatingDragMenu(_ref) {
@@ -20,7 +20,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
20
20
  stickyHeaders = _ref.stickyHeaders,
21
21
  pluginConfig = _ref.pluginConfig,
22
22
  isTableScalingEnabled = _ref.isTableScalingEnabled,
23
- getEditorFeatureFlags = _ref.getEditorFeatureFlags;
23
+ getEditorFeatureFlags = _ref.getEditorFeatureFlags,
24
+ ariaNotifyPlugin = _ref.ariaNotifyPlugin;
24
25
  if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
25
26
  return null;
26
27
  }
@@ -37,7 +38,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
37
38
  tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC,
38
39
  _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
39
40
  tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
40
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
41
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && fg('platform.editor.table.use-increased-scaling-percent');
41
42
  return /*#__PURE__*/React.createElement(Popup, {
42
43
  alignX: direction === 'row' ? 'right' : undefined,
43
44
  alignY: direction === 'row' ? 'start' : undefined,
@@ -75,7 +76,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
75
76
  tableDuplicateCellColouring: tableDuplicateCellColouring,
76
77
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
77
78
  isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
78
- tableSortColumnReorder: tableSortColumnReorder
79
+ tableSortColumnReorder: tableSortColumnReorder,
80
+ ariaNotifyPlugin: ariaNotifyPlugin
79
81
  }));
80
82
  };
81
83
  FloatingDragMenu.displayName = 'FloatingDragMenu';
@@ -1,14 +1,17 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
3
3
  import { browser } from '@atlaskit/editor-common/utils';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
+ import { findTable } from '@atlaskit/editor-tables/utils';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
6
7
  import { TableCssClassName as ClassName } from '../../types';
8
+ import { isTableNested } from '../../utils/nodes';
7
9
  import { CornerControls, DragCornerControls, DragCornerControlsWithSelection } from './CornerControls';
8
10
  import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
9
11
  import NumberColumn from './NumberColumn';
10
12
  import { DragControls, RowControls } from './RowControls';
11
13
  export var TableFloatingControls = function TableFloatingControls(_ref) {
14
+ var _findTable;
12
15
  var editorView = _ref.editorView,
13
16
  tableRef = _ref.tableRef,
14
17
  tableNode = _ref.tableNode,
@@ -69,6 +72,9 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
69
72
  }
70
73
  var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
71
74
  var wrapperClassName = isDragAndDropEnabled ? ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
75
+ var tablePos = (_findTable = findTable(editorView.state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos;
76
+ var isNested = tablePos !== undefined && isTableNested(editorView.state, tablePos);
77
+ var shouldShowCornerControls = fg('platform_editor_element_drag_and_drop_ed_24041') ? !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop) || isNested : !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop);
72
78
  return (
73
79
  /*#__PURE__*/
74
80
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -91,7 +97,7 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
91
97
  updateCellHoverLocation: updateCellHoverLocation,
92
98
  stickyTop: stickyTop,
93
99
  isDragAndDropEnabled: isDragAndDropEnabled
94
- }) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop) && (getBooleanFF('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(DragCornerControlsWithSelection, {
100
+ }) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, shouldShowCornerControls && (fg('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(DragCornerControlsWithSelection, {
95
101
  editorView: editorView,
96
102
  tableRef: tableRef,
97
103
  isInDanger: isInDanger,
@@ -116,7 +122,7 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
116
122
  selectRow: _selectRow,
117
123
  selectRows: _selectRows,
118
124
  updateCellHoverLocation: updateCellHoverLocation
119
- })) : getBooleanFF('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(FloatingControlsWithSelection, {
125
+ })) : fg('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/React.createElement(FloatingControlsWithSelection, {
120
126
  editorView: editorView,
121
127
  tableRef: tableRef,
122
128
  isInDanger: isInDanger,
@@ -13,6 +13,7 @@ import HipchatChevronDoubleDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-d
13
13
  import HipchatChevronDoubleUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-double-up';
14
14
  import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, sortColumnWithAnalytics } from '../commands-with-analytics';
15
15
  import { moveSourceWithAnalytics } from '../pm-plugins/drag-and-drop/commands-with-analytics';
16
+ import { getPluginState as getTablePluginState } from '../pm-plugins/plugin-factory';
16
17
  import { getNewResizeStateFromSelectedColumns } from '../pm-plugins/table-resizing/utils/resize-state';
17
18
  import { getClosestSelectionRect } from '../toolbar';
18
19
  import { AddColLeftIcon, AddColRightIcon, AddRowAboveIcon, AddRowBelowIcon } from '../ui/icons';
@@ -67,7 +68,10 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
67
68
  var isTableFixedColumnWidthsOptionEnabled = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
68
69
  var shouldUseIncreasedScalingPercent = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
69
70
  var tableSortColumnReorder = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
71
+ var ariaNotifyPlugin = arguments.length > 15 ? arguments[15] : undefined;
70
72
  var selection = editorView.state.selection;
73
+ var _getTablePluginState = getTablePluginState(editorView.state),
74
+ getIntl = _getTablePluginState.getIntl;
71
75
  var addOptions = direction === 'row' ? [{
72
76
  label: 'above',
73
77
  offset: 0,
@@ -226,7 +230,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
226
230
  onClick: function onClick(state, dispatch) {
227
231
  if (canMove) {
228
232
  requestAnimationFrame(function () {
229
- moveSourceWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, "table-".concat(direction), getOriginIndexes(selectionRect), getTargetIndex(selectionRect))(editorView.state, editorView.dispatch);
233
+ moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(INPUT_METHOD.TABLE_CONTEXT_MENU, "table-".concat(direction), getOriginIndexes(selectionRect), getTargetIndex(selectionRect))(editorView.state, editorView.dispatch);
230
234
  });
231
235
  return true;
232
236
  }
@@ -1,4 +1,6 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
1
2
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
2
4
  import type tablePlugin from '../plugin';
3
5
  export declare enum TableSelectionDirection {
4
6
  TopToBottom = "TopToBottom",
@@ -6,7 +8,7 @@ export declare enum TableSelectionDirection {
6
8
  }
7
9
  export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
10
  export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
10
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
11
+ export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
12
+ export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
11
13
  export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
12
14
  export declare const modASelectTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
@@ -1,9 +1,11 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
1
2
  import { INPUT_METHOD, TABLE_STATUS } from '@atlaskit/editor-common/analytics';
2
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
4
  import type { Command } from '@atlaskit/editor-common/types';
5
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
6
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
5
7
  import type { DraggableData, DraggableType } from '../../types';
6
8
  export declare const clearDropTargetWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP, sourceType: DraggableType, sourceIndexes: number[] | undefined, status: TABLE_STATUS.CANCELLED | TABLE_STATUS.INVALID, tr?: Transaction) => Command;
7
- export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
8
- export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (sourceType: DraggableType, direction: DraggableData['direction']) => Command;
9
+ export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
10
+ export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData['direction']) => Command;
9
11
  export declare const cloneSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: 'start' | 'end', tr?: Transaction) => Command;
@@ -1,5 +1,5 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
1
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type tablePlugin from '../plugin';
4
- export declare function tableSelectionKeymapPlugin(editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined): SafePlugin;
3
+ import { type PluginInjectionAPI } from '../types';
4
+ export declare function tableSelectionKeymapPlugin(pluginInjectionApi?: PluginInjectionAPI, getIntl?: () => IntlShape): SafePlugin;
5
5
  export default tableSelectionKeymapPlugin;