@atlaskit/editor-plugin-table 7.19.5 → 7.19.6

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 (30) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/commands/misc.js +14 -12
  3. package/dist/cjs/commands-with-analytics.js +2 -2
  4. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +1 -1
  5. package/dist/cjs/toolbar.js +1 -1
  6. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +15 -18
  7. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +4 -6
  8. package/dist/es2019/commands/misc.js +4 -1
  9. package/dist/es2019/commands-with-analytics.js +2 -2
  10. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +2 -2
  11. package/dist/es2019/toolbar.js +1 -1
  12. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +14 -18
  13. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -6
  14. package/dist/esm/commands/misc.js +14 -12
  15. package/dist/esm/commands-with-analytics.js +2 -2
  16. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +2 -2
  17. package/dist/esm/toolbar.js +1 -1
  18. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +16 -19
  19. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +5 -7
  20. package/dist/types/commands/misc.d.ts +1 -1
  21. package/dist/types/commands-with-analytics.d.ts +1 -1
  22. package/dist/types-ts4.5/commands/misc.d.ts +1 -1
  23. package/dist/types-ts4.5/commands-with-analytics.d.ts +1 -1
  24. package/package.json +3 -3
  25. package/src/commands/misc.ts +2 -1
  26. package/src/commands-with-analytics.ts +1 -4
  27. package/src/pm-plugins/drag-and-drop/plugin.ts +2 -2
  28. package/src/toolbar.tsx +1 -2
  29. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +17 -24
  30. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.19.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#113441](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113441)
8
+ [`8b819018560ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b819018560ea) -
9
+ [ux] Fixed a bug where when cell background color is updated via floating toolbar, the calor is
10
+ set on a wrong cell.
11
+ - [#114548](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114548)
12
+ [`8b2d47bffb50e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b2d47bffb50e) -
13
+ bump adf-schema version
14
+ - Updated dependencies
15
+
3
16
  ## 7.19.5
4
17
 
5
18
  ### Patch Changes
@@ -309,10 +309,12 @@ var moveCursorBackward = exports.moveCursorBackward = function moveCursorBackwar
309
309
  }
310
310
  return true;
311
311
  };
312
- var setMultipleCellAttrs = exports.setMultipleCellAttrs = function setMultipleCellAttrs(attrs, targetCellPosition, editorView) {
312
+ var setMultipleCellAttrs = exports.setMultipleCellAttrs = function setMultipleCellAttrs(attrs, editorView) {
313
313
  return function (state, dispatch) {
314
314
  var cursorPos;
315
315
  var tr = state.tr;
316
+ var _getPluginState2 = (0, _pluginFactory.getPluginState)(state),
317
+ targetCellPosition = _getPluginState2.targetCellPosition;
316
318
  if ((0, _utils2.isSelectionType)(tr.selection, 'cell')) {
317
319
  var selection = tr.selection;
318
320
  selection.forEachCell(function (_cell, pos) {
@@ -470,9 +472,9 @@ var hideInsertColumnOrRowButton = exports.hideInsertColumnOrRowButton = function
470
472
  var addResizeHandleDecorations = exports.addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, isKeyboardResize) {
471
473
  return (0, _pluginFactory.createCommand)(function (state) {
472
474
  var tableNode = (0, _utils2.findTable)(state.selection);
473
- var _getPluginState2 = (0, _pluginFactory.getPluginState)(state),
474
- allowColumnResizing = _getPluginState2.pluginConfig.allowColumnResizing,
475
- getIntl = _getPluginState2.getIntl;
475
+ var _getPluginState3 = (0, _pluginFactory.getPluginState)(state),
476
+ allowColumnResizing = _getPluginState3.pluginConfig.allowColumnResizing,
477
+ getIntl = _getPluginState3.getIntl;
476
478
  if (!tableNode || !allowColumnResizing) {
477
479
  return false;
478
480
  }
@@ -496,12 +498,12 @@ var addResizeHandleDecorations = exports.addResizeHandleDecorations = function a
496
498
  var updateResizeHandleDecorations = exports.updateResizeHandleDecorations = function updateResizeHandleDecorations(rowIndex, columnIndex, includeTooltip) {
497
499
  return (0, _pluginFactory.createCommand)(function (state) {
498
500
  var tableNode = (0, _utils2.findTable)(state.selection);
499
- var _getPluginState3 = (0, _pluginFactory.getPluginState)(state),
500
- resizeHandleRowIndex = _getPluginState3.resizeHandleRowIndex,
501
- resizeHandleColumnIndex = _getPluginState3.resizeHandleColumnIndex,
502
- resizeHandleIncludeTooltip = _getPluginState3.resizeHandleIncludeTooltip,
503
- allowColumnResizing = _getPluginState3.pluginConfig.allowColumnResizing,
504
- getIntl = _getPluginState3.getIntl;
501
+ var _getPluginState4 = (0, _pluginFactory.getPluginState)(state),
502
+ resizeHandleRowIndex = _getPluginState4.resizeHandleRowIndex,
503
+ resizeHandleColumnIndex = _getPluginState4.resizeHandleColumnIndex,
504
+ resizeHandleIncludeTooltip = _getPluginState4.resizeHandleIncludeTooltip,
505
+ allowColumnResizing = _getPluginState4.pluginConfig.allowColumnResizing,
506
+ getIntl = _getPluginState4.getIntl;
505
507
  if (!tableNode || !allowColumnResizing) {
506
508
  return false;
507
509
  }
@@ -575,8 +577,8 @@ var addBoldInEmptyHeaderCells = exports.addBoldInEmptyHeaderCells = function add
575
577
  };
576
578
  var updateWidthToWidest = exports.updateWidthToWidest = function updateWidthToWidest(widthToWidest) {
577
579
  return (0, _pluginFactory.createCommand)(function (state) {
578
- var _getPluginState4 = (0, _pluginFactory.getPluginState)(state),
579
- prevWidthToWidest = _getPluginState4.widthToWidest;
580
+ var _getPluginState5 = (0, _pluginFactory.getPluginState)(state),
581
+ prevWidthToWidest = _getPluginState5.widthToWidest;
580
582
  if ((0, _isEqual.default)(widthToWidest, prevWidthToWidest)) {
581
583
  return false;
582
584
  }
@@ -125,7 +125,7 @@ var splitCellWithAnalytics = exports.splitCellWithAnalytics = function splitCell
125
125
  };
126
126
  };
127
127
  var setColorWithAnalytics = exports.setColorWithAnalytics = function setColorWithAnalytics(editorAnalyticsAPI) {
128
- return function (inputMethod, cellColor, targetCellPosition, editorView) {
128
+ return function (inputMethod, cellColor, editorView) {
129
129
  return (0, _analytics2.withEditorAnalyticsAPI)(function (_ref4) {
130
130
  var selection = _ref4.selection;
131
131
  var _getSelectedCellInfo4 = (0, _utils2.getSelectedCellInfo)(selection),
@@ -151,7 +151,7 @@ var setColorWithAnalytics = exports.setColorWithAnalytics = function setColorWit
151
151
  };
152
152
  })(editorAnalyticsAPI)((0, _misc.setMultipleCellAttrs)({
153
153
  background: cellColor
154
- }, targetCellPosition, editorView));
154
+ }, editorView));
155
155
  };
156
156
  };
157
157
  var addRowAroundSelection = exports.addRowAroundSelection = function addRowAroundSelection(editorAnalyticsAPI) {
@@ -165,7 +165,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
165
165
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
166
166
  isTableScalingEnabledOnCurrentTable = tableNode.attrs.displayMode !== 'fixed';
167
167
  }
168
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
168
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.fg)('platform.editor.table.use-increased-scaling-percent');
169
169
  (0, _utils3.insertColgroupFromNode)(tableRef, tableNode, isTableScalingEnabledOnCurrentTable, undefined, shouldUseIncreasedScalingPercent);
170
170
  }
171
171
  }
@@ -555,7 +555,7 @@ var getColorPicker = function getColorPicker(state, menu, _ref5, editorAnalytics
555
555
  options: _uiColor.cellBackgroundColorPalette,
556
556
  returnEscToButton: true,
557
557
  onChange: function onChange(option) {
558
- return (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, option.value, targetCellPosition, getEditorView());
558
+ return (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, option.value, getEditorView());
559
559
  }
560
560
  }, separator(menu.hidden)];
561
561
  };
@@ -94,7 +94,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
94
94
  var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
95
95
  var selectedRowIndex;
96
96
  var selectedColumnIndex;
97
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
97
+ if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
98
98
  var selectedRowAndColumnFromPalette = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette, background, _consts.colorPalletteColumns);
99
99
  selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
100
100
  selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
@@ -122,7 +122,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
122
122
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
123
123
  ,
124
124
  className: isDragAndDropEnabled ? _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL : _types.TableCssClassName.CONTEXTUAL_MENU_ICON
125
- }), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && (0, _react2.jsx)("div", {
125
+ }), (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && (0, _react2.jsx)("div", {
126
126
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
127
127
  className: _types.TableCssClassName.CONTEXTUAL_SUBMENU,
128
128
  ref: _this.handleSubMenuRef
@@ -167,7 +167,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
167
167
  hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
168
168
  }
169
169
  }))),
170
- 'aria-expanded': (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
170
+ 'aria-expanded': (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
171
171
  };
172
172
  }
173
173
  });
@@ -469,7 +469,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
469
469
  tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
470
470
  // context menu opened by keyboard and any item except 'background' activated
471
471
  // or color has been chosen from color palette
472
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen)) {
472
+ if (isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen) && (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
473
473
  var tr = state.tr;
474
474
  tr.setMeta(_pluginKey.pluginKey, {
475
475
  type: 'SET_CELL_MENU_OPEN',
@@ -480,7 +480,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
480
480
  dispatch(tr);
481
481
  editorView.dom.focus(); // otherwise cursor disappears from cell
482
482
  }
483
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
483
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && (0, _platformFeatureFlags.fg)('platform.editor.table.use-increased-scaling-percent');
484
484
  switch (item.value.name) {
485
485
  case 'sort_column_desc':
486
486
  (0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, selectionRect.left, _customSteps.TableSortOrder.DESC)(state, dispatch);
@@ -536,7 +536,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
536
536
  // 1st time when user chooses the background color item.
537
537
  // 2nd when color has been chosen from color palette.
538
538
  // here we are handling the 1st call relying on the isSubmenuOpen state value
539
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !_this.state.isSubmenuOpen) {
539
+ if (isCellMenuOpenByKeyboard && !_this.state.isSubmenuOpen && (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
540
540
  _this.setState({
541
541
  isSubmenuOpen: true
542
542
  });
@@ -565,7 +565,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
565
565
  dispatch = _this$props12$editorV.dispatch,
566
566
  dom = _this$props12$editorV.dom,
567
567
  isCellMenuOpenByKeyboard = _this$props12.isCellMenuOpenByKeyboard;
568
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
568
+ if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
569
569
  if (payload) {
570
570
  var event = payload.event;
571
571
  if (event && event instanceof KeyboardEvent) {
@@ -647,12 +647,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
647
647
  var _this$props14 = _this.props,
648
648
  editorView = _this$props14.editorView,
649
649
  editorAnalyticsAPI = _this$props14.editorAnalyticsAPI;
650
- // TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
651
- var _getPluginState13 = (0, _pluginFactory.getPluginState)(editorView.state),
652
- targetCellPosition = _getPluginState13.targetCellPosition;
653
650
  var state = editorView.state,
654
651
  dispatch = editorView.dispatch;
655
- (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
652
+ (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
656
653
  _this.toggleOpen();
657
654
  });
658
655
  return _this;
@@ -660,7 +657,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
660
657
  (0, _createClass2.default)(ContextualMenu, [{
661
658
  key: "componentDidMount",
662
659
  value: function componentDidMount() {
663
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
660
+ if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
664
661
  // ArrowKeyNavigationProvider in DropdownMenu expects that menu handle will stay focused
665
662
  // until user pressed ArrowDown.
666
663
  // Behavior above fails the A11Y requirement about first item in menu should be focused immediately.
@@ -683,11 +680,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
683
680
  boundariesElement = _this$props15.boundariesElement,
684
681
  editorView = _this$props15.editorView,
685
682
  isCellMenuOpenByKeyboard = _this$props15.isCellMenuOpenByKeyboard;
686
- var _getPluginState14 = (0, _pluginFactory.getPluginState)(editorView.state),
687
- isDragAndDropEnabled = _getPluginState14.isDragAndDropEnabled;
683
+ var _getPluginState13 = (0, _pluginFactory.getPluginState)(editorView.state),
684
+ isDragAndDropEnabled = _getPluginState13.isDragAndDropEnabled;
688
685
  var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
689
686
  var isOpenAllowed = false;
690
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
687
+ if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
691
688
  isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
692
689
  } else {
693
690
  isOpenAllowed = isOpen;
@@ -703,7 +700,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
703
700
  ,
704
701
  arrowKeyNavigationProviderOptions: {
705
702
  type: _uiMenu.ArrowKeyNavigationType.MENU,
706
- disableArrowKeyNavigation: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen ? false : true
703
+ disableArrowKeyNavigation: isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen && (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? false : true
707
704
  },
708
705
  items: items,
709
706
  isOpen: isOpenAllowed,
@@ -713,7 +710,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
713
710
  onMouseLeave: this.handleItemMouseLeave,
714
711
  fitHeight: 188,
715
712
  fitWidth: isDragAndDropEnabled ? _consts.contextualMenuDropdownWidthDnD : _consts.contextualMenuDropdownWidth,
716
- shouldFocusFirstItem: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? function () {
713
+ shouldFocusFirstItem: (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? function () {
717
714
  return Boolean(isCellMenuOpenByKeyboard);
718
715
  } : undefined,
719
716
  boundariesElement: boundariesElement,
@@ -721,7 +718,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
721
718
  section: isDragAndDropEnabled ? {
722
719
  hasSeparator: true
723
720
  } : undefined,
724
- isAllowEnterDefaultBehavior: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
721
+ isAllowEnterDefaultBehavior: (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
725
722
  }));
726
723
  }
727
724
  }]);
@@ -222,7 +222,7 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
222
222
  var selectionRect = (0, _utils2.isSelectionType)(selection, 'cell') ? (0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
223
223
  var shouldMoveDisabled;
224
224
  var hasMergedCellsInTable;
225
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
225
+ if ((0, _platformFeatureFlags.fg)('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
226
226
  var _tableMap$hasMergedCe;
227
227
  shouldMoveDisabled = false;
228
228
  hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
@@ -248,18 +248,16 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
248
248
  }
249
249
  };
250
250
  var setColor = function setColor(color) {
251
- var _getTablePluginState = (0, _pluginFactory2.getPluginState)(editorView.state),
252
- targetCellPosition = _getTablePluginState.targetCellPosition;
253
251
  var state = editorView.state,
254
252
  dispatch = editorView.dispatch;
255
- (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
253
+ (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
256
254
  closeMenu();
257
255
  setIsSubmenuOpen(false);
258
256
  };
259
257
  var createBackgroundColorMenuItem = function createBackgroundColorMenuItem() {
260
258
  var _node$attrs;
261
- var _getTablePluginState2 = (0, _pluginFactory2.getPluginState)(editorView.state),
262
- targetCellPosition = _getTablePluginState2.targetCellPosition;
259
+ var _getTablePluginState = (0, _pluginFactory2.getPluginState)(editorView.state),
260
+ targetCellPosition = _getTablePluginState.targetCellPosition;
263
261
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
264
262
  var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
265
263
  var _getSelectedRowAndCol = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette, background, _consts.colorPalletteColumns),
@@ -316,11 +316,14 @@ export const moveCursorBackward = (state, dispatch) => {
316
316
  }
317
317
  return true;
318
318
  };
319
- export const setMultipleCellAttrs = (attrs, targetCellPosition, editorView) => (state, dispatch) => {
319
+ export const setMultipleCellAttrs = (attrs, editorView) => (state, dispatch) => {
320
320
  let cursorPos;
321
321
  let {
322
322
  tr
323
323
  } = state;
324
+ const {
325
+ targetCellPosition
326
+ } = getPluginState(state);
324
327
  if (isSelectionType(tr.selection, 'cell')) {
325
328
  const selection = tr.selection;
326
329
  selection.forEachCell((_cell, pos) => {
@@ -109,7 +109,7 @@ export const splitCellWithAnalytics = editorAnalyticsAPI => inputMethod => withE
109
109
  }
110
110
  return;
111
111
  })(editorAnalyticsAPI)(splitCell);
112
- export const setColorWithAnalytics = editorAnalyticsAPI => (inputMethod, cellColor, targetCellPosition, editorView) => withEditorAnalyticsAPI(({
112
+ export const setColorWithAnalytics = editorAnalyticsAPI => (inputMethod, cellColor, editorView) => withEditorAnalyticsAPI(({
113
113
  selection
114
114
  }) => {
115
115
  const {
@@ -136,7 +136,7 @@ export const setColorWithAnalytics = editorAnalyticsAPI => (inputMethod, cellCol
136
136
  };
137
137
  })(editorAnalyticsAPI)(setMultipleCellAttrs({
138
138
  background: cellColor
139
- }, targetCellPosition, editorView));
139
+ }, editorView));
140
140
  export const addRowAroundSelection = editorAnalyticsAPI => side => (state, dispatch) => {
141
141
  const {
142
142
  selection
@@ -3,7 +3,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  import { getCellsInRow, getSelectedCellInfo } from '@atlaskit/editor-tables/utils';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
8
8
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
9
9
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
@@ -173,7 +173,7 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
173
173
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
174
174
  isTableScalingEnabledOnCurrentTable = tableNode.attrs.displayMode !== 'fixed';
175
175
  }
176
- const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
176
+ const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
177
177
  insertColgroupFromNode(tableRef, tableNode, isTableScalingEnabledOnCurrentTable, undefined, shouldUseIncreasedScalingPercent);
178
178
  }
179
179
  }
@@ -515,7 +515,7 @@ const getColorPicker = (state, menu, {
515
515
  defaultValue: defaultPalette,
516
516
  options: cellBackgroundColorPalette,
517
517
  returnEscToButton: true,
518
- onChange: option => setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, option.value, targetCellPosition, getEditorView())
518
+ onChange: option => setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, option.value, getEditorView())
519
519
  }, separator(menu.hidden)];
520
520
  };
521
521
  const clickWithCheckboxHandler = (isChecked, node, editorAnalyticsAPI) => (state, dispatch) => {
@@ -19,7 +19,7 @@ import { splitCell } from '@atlaskit/editor-tables/utils';
19
19
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
20
20
  import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
21
21
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
22
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
22
+ import { fg } from '@atlaskit/platform-feature-flags';
23
23
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../commands';
24
24
  import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../commands-with-analytics';
25
25
  import { getPluginState } from '../../pm-plugins/plugin-factory';
@@ -77,7 +77,7 @@ export class ContextualMenu extends Component {
77
77
  const background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
78
78
  let selectedRowIndex;
79
79
  let selectedColumnIndex;
80
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
80
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
81
81
  const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette, background, colorPalletteColumns);
82
82
  selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
83
83
  selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
@@ -105,7 +105,7 @@ export class ContextualMenu extends Component {
105
105
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
106
106
  ,
107
107
  className: isDragAndDropEnabled ? ClassName.CONTEXTUAL_MENU_ICON_SMALL : ClassName.CONTEXTUAL_MENU_ICON
108
- }), getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && jsx("div", {
108
+ }), fg('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && jsx("div", {
109
109
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
110
110
  className: ClassName.CONTEXTUAL_SUBMENU,
111
111
  ref: this.handleSubMenuRef
@@ -150,7 +150,7 @@ export class ContextualMenu extends Component {
150
150
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
151
151
  }
152
152
  }))),
153
- 'aria-expanded': getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
153
+ 'aria-expanded': fg('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
154
154
  };
155
155
  }
156
156
  });
@@ -500,7 +500,7 @@ export class ContextualMenu extends Component {
500
500
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
501
501
  // context menu opened by keyboard and any item except 'background' activated
502
502
  // or color has been chosen from color palette
503
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && this.state.isSubmenuOpen)) {
503
+ if (isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && this.state.isSubmenuOpen) && fg('platform.editor.a11y-table-context-menu_y4c9c')) {
504
504
  const {
505
505
  tr
506
506
  } = state;
@@ -513,7 +513,7 @@ export class ContextualMenu extends Component {
513
513
  dispatch(tr);
514
514
  editorView.dom.focus(); // otherwise cursor disappears from cell
515
515
  }
516
- const shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
516
+ const shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && fg('platform.editor.table.use-increased-scaling-percent');
517
517
  switch (item.value.name) {
518
518
  case 'sort_column_desc':
519
519
  sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect.left, SortOrder.DESC)(state, dispatch);
@@ -572,7 +572,7 @@ export class ContextualMenu extends Component {
572
572
  // 1st time when user chooses the background color item.
573
573
  // 2nd when color has been chosen from color palette.
574
574
  // here we are handling the 1st call relying on the isSubmenuOpen state value
575
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen) {
575
+ if (isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen && fg('platform.editor.a11y-table-context-menu_y4c9c')) {
576
576
  this.setState({
577
577
  isSubmenuOpen: true
578
578
  });
@@ -605,7 +605,7 @@ export class ContextualMenu extends Component {
605
605
  },
606
606
  isCellMenuOpenByKeyboard
607
607
  } = this.props;
608
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
608
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
609
609
  if (payload) {
610
610
  const {
611
611
  event
@@ -695,20 +695,16 @@ export class ContextualMenu extends Component {
695
695
  editorView,
696
696
  editorAnalyticsAPI
697
697
  } = this.props;
698
- // TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
699
- const {
700
- targetCellPosition
701
- } = getPluginState(editorView.state);
702
698
  const {
703
699
  state,
704
700
  dispatch
705
701
  } = editorView;
706
- setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
702
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
707
703
  this.toggleOpen();
708
704
  });
709
705
  }
710
706
  componentDidMount() {
711
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
707
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
712
708
  // ArrowKeyNavigationProvider in DropdownMenu expects that menu handle will stay focused
713
709
  // until user pressed ArrowDown.
714
710
  // Behavior above fails the A11Y requirement about first item in menu should be focused immediately.
@@ -738,7 +734,7 @@ export class ContextualMenu extends Component {
738
734
  } = getPluginState(editorView.state);
739
735
  const items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
740
736
  let isOpenAllowed = false;
741
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
737
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
742
738
  isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
743
739
  } else {
744
740
  isOpenAllowed = isOpen;
@@ -754,7 +750,7 @@ export class ContextualMenu extends Component {
754
750
  ,
755
751
  arrowKeyNavigationProviderOptions: {
756
752
  type: ArrowKeyNavigationType.MENU,
757
- disableArrowKeyNavigation: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen ? false : true
753
+ disableArrowKeyNavigation: isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen && fg('platform.editor.a11y-table-context-menu_y4c9c') ? false : true
758
754
  },
759
755
  items: items,
760
756
  isOpen: isOpenAllowed,
@@ -764,7 +760,7 @@ export class ContextualMenu extends Component {
764
760
  onMouseLeave: this.handleItemMouseLeave,
765
761
  fitHeight: 188,
766
762
  fitWidth: isDragAndDropEnabled ? contextualMenuDropdownWidthDnD : contextualMenuDropdownWidth,
767
- shouldFocusFirstItem: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? () => {
763
+ shouldFocusFirstItem: fg('platform.editor.a11y-table-context-menu_y4c9c') ? () => {
768
764
  return Boolean(isCellMenuOpenByKeyboard);
769
765
  } : undefined,
770
766
  boundariesElement: boundariesElement,
@@ -772,7 +768,7 @@ export class ContextualMenu extends Component {
772
768
  section: isDragAndDropEnabled ? {
773
769
  hasSeparator: true
774
770
  } : undefined,
775
- isAllowEnterDefaultBehavior: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
771
+ isAllowEnterDefaultBehavior: fg('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
776
772
  }));
777
773
  }
778
774
  }
@@ -18,7 +18,7 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
18
18
  import { TableMap } from '@atlaskit/editor-tables/table-map';
19
19
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
20
20
  import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
21
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
21
+ import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Toggle from '@atlaskit/toggle';
23
23
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
24
24
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../commands-with-analytics';
@@ -209,7 +209,7 @@ export const DragMenu = /*#__PURE__*/React.memo(({
209
209
  const selectionRect = isSelectionType(selection, 'cell') ? getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
210
210
  let shouldMoveDisabled;
211
211
  let hasMergedCellsInTable;
212
- if (getBooleanFF('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
212
+ if (fg('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
213
213
  var _tableMap$hasMergedCe;
214
214
  shouldMoveDisabled = false;
215
215
  hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
@@ -236,14 +236,11 @@ export const DragMenu = /*#__PURE__*/React.memo(({
236
236
  }
237
237
  };
238
238
  const setColor = color => {
239
- const {
240
- targetCellPosition
241
- } = getTablePluginState(editorView.state);
242
239
  const {
243
240
  state,
244
241
  dispatch
245
242
  } = editorView;
246
- setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
243
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
247
244
  closeMenu();
248
245
  setIsSubmenuOpen(false);
249
246
  };
@@ -302,10 +302,12 @@ export var moveCursorBackward = function moveCursorBackward(state, dispatch) {
302
302
  }
303
303
  return true;
304
304
  };
305
- export var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, targetCellPosition, editorView) {
305
+ export var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, editorView) {
306
306
  return function (state, dispatch) {
307
307
  var cursorPos;
308
308
  var tr = state.tr;
309
+ var _getPluginState2 = getPluginState(state),
310
+ targetCellPosition = _getPluginState2.targetCellPosition;
309
311
  if (isSelectionType(tr.selection, 'cell')) {
310
312
  var selection = tr.selection;
311
313
  selection.forEachCell(function (_cell, pos) {
@@ -463,9 +465,9 @@ export var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton()
463
465
  export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, isKeyboardResize) {
464
466
  return createCommand(function (state) {
465
467
  var tableNode = findTable(state.selection);
466
- var _getPluginState2 = getPluginState(state),
467
- allowColumnResizing = _getPluginState2.pluginConfig.allowColumnResizing,
468
- getIntl = _getPluginState2.getIntl;
468
+ var _getPluginState3 = getPluginState(state),
469
+ allowColumnResizing = _getPluginState3.pluginConfig.allowColumnResizing,
470
+ getIntl = _getPluginState3.getIntl;
469
471
  if (!tableNode || !allowColumnResizing) {
470
472
  return false;
471
473
  }
@@ -489,12 +491,12 @@ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowI
489
491
  export var updateResizeHandleDecorations = function updateResizeHandleDecorations(rowIndex, columnIndex, includeTooltip) {
490
492
  return createCommand(function (state) {
491
493
  var tableNode = findTable(state.selection);
492
- var _getPluginState3 = getPluginState(state),
493
- resizeHandleRowIndex = _getPluginState3.resizeHandleRowIndex,
494
- resizeHandleColumnIndex = _getPluginState3.resizeHandleColumnIndex,
495
- resizeHandleIncludeTooltip = _getPluginState3.resizeHandleIncludeTooltip,
496
- allowColumnResizing = _getPluginState3.pluginConfig.allowColumnResizing,
497
- getIntl = _getPluginState3.getIntl;
494
+ var _getPluginState4 = getPluginState(state),
495
+ resizeHandleRowIndex = _getPluginState4.resizeHandleRowIndex,
496
+ resizeHandleColumnIndex = _getPluginState4.resizeHandleColumnIndex,
497
+ resizeHandleIncludeTooltip = _getPluginState4.resizeHandleIncludeTooltip,
498
+ allowColumnResizing = _getPluginState4.pluginConfig.allowColumnResizing,
499
+ getIntl = _getPluginState4.getIntl;
498
500
  if (!tableNode || !allowColumnResizing) {
499
501
  return false;
500
502
  }
@@ -568,8 +570,8 @@ export var addBoldInEmptyHeaderCells = function addBoldInEmptyHeaderCells(tableC
568
570
  };
569
571
  export var updateWidthToWidest = function updateWidthToWidest(widthToWidest) {
570
572
  return createCommand(function (state) {
571
- var _getPluginState4 = getPluginState(state),
572
- prevWidthToWidest = _getPluginState4.widthToWidest;
573
+ var _getPluginState5 = getPluginState(state),
574
+ prevWidthToWidest = _getPluginState5.widthToWidest;
573
575
  if (isEqual(widthToWidest, prevWidthToWidest)) {
574
576
  return false;
575
577
  }
@@ -118,7 +118,7 @@ export var splitCellWithAnalytics = function splitCellWithAnalytics(editorAnalyt
118
118
  };
119
119
  };
120
120
  export var setColorWithAnalytics = function setColorWithAnalytics(editorAnalyticsAPI) {
121
- return function (inputMethod, cellColor, targetCellPosition, editorView) {
121
+ return function (inputMethod, cellColor, editorView) {
122
122
  return withEditorAnalyticsAPI(function (_ref4) {
123
123
  var selection = _ref4.selection;
124
124
  var _getSelectedCellInfo4 = getSelectedCellInfo(selection),
@@ -144,7 +144,7 @@ export var setColorWithAnalytics = function setColorWithAnalytics(editorAnalytic
144
144
  };
145
145
  })(editorAnalyticsAPI)(setMultipleCellAttrs({
146
146
  background: cellColor
147
- }, targetCellPosition, editorView));
147
+ }, editorView));
148
148
  };
149
149
  };
150
150
  export var addRowAroundSelection = function addRowAroundSelection(editorAnalyticsAPI) {
@@ -3,7 +3,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  import { getCellsInRow, getSelectedCellInfo } from '@atlaskit/editor-tables/utils';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
8
8
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
9
9
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
@@ -159,7 +159,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
159
159
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
160
160
  isTableScalingEnabledOnCurrentTable = tableNode.attrs.displayMode !== 'fixed';
161
161
  }
162
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
162
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
163
163
  insertColgroupFromNode(tableRef, tableNode, isTableScalingEnabledOnCurrentTable, undefined, shouldUseIncreasedScalingPercent);
164
164
  }
165
165
  }
@@ -547,7 +547,7 @@ var getColorPicker = function getColorPicker(state, menu, _ref5, editorAnalytics
547
547
  options: cellBackgroundColorPalette,
548
548
  returnEscToButton: true,
549
549
  onChange: function onChange(option) {
550
- return setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, option.value, targetCellPosition, getEditorView());
550
+ return setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, option.value, getEditorView());
551
551
  }
552
552
  }, separator(menu.hidden)];
553
553
  };
@@ -30,7 +30,7 @@ import { splitCell } from '@atlaskit/editor-tables/utils';
30
30
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
31
31
  import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
32
32
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
33
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
33
+ import { fg } from '@atlaskit/platform-feature-flags';
34
34
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../commands';
35
35
  import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../commands-with-analytics';
36
36
  import { getPluginState } from '../../pm-plugins/plugin-factory';
@@ -87,7 +87,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
87
87
  var background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
88
88
  var selectedRowIndex;
89
89
  var selectedColumnIndex;
90
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
90
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
91
91
  var selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette, background, colorPalletteColumns);
92
92
  selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
93
93
  selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
@@ -115,7 +115,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
115
115
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
116
116
  ,
117
117
  className: isDragAndDropEnabled ? ClassName.CONTEXTUAL_MENU_ICON_SMALL : ClassName.CONTEXTUAL_MENU_ICON
118
- }), getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && jsx("div", {
118
+ }), fg('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && jsx("div", {
119
119
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
120
120
  className: ClassName.CONTEXTUAL_SUBMENU,
121
121
  ref: _this.handleSubMenuRef
@@ -160,7 +160,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
160
160
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
161
161
  }
162
162
  }))),
163
- 'aria-expanded': getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
163
+ 'aria-expanded': fg('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
164
164
  };
165
165
  }
166
166
  });
@@ -462,7 +462,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
462
462
  tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
463
463
  // context menu opened by keyboard and any item except 'background' activated
464
464
  // or color has been chosen from color palette
465
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen)) {
465
+ if (isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen) && fg('platform.editor.a11y-table-context-menu_y4c9c')) {
466
466
  var tr = state.tr;
467
467
  tr.setMeta(tablePluginKey, {
468
468
  type: 'SET_CELL_MENU_OPEN',
@@ -473,7 +473,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
473
473
  dispatch(tr);
474
474
  editorView.dom.focus(); // otherwise cursor disappears from cell
475
475
  }
476
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
476
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && fg('platform.editor.table.use-increased-scaling-percent');
477
477
  switch (item.value.name) {
478
478
  case 'sort_column_desc':
479
479
  sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect.left, SortOrder.DESC)(state, dispatch);
@@ -529,7 +529,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
529
529
  // 1st time when user chooses the background color item.
530
530
  // 2nd when color has been chosen from color palette.
531
531
  // here we are handling the 1st call relying on the isSubmenuOpen state value
532
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !_this.state.isSubmenuOpen) {
532
+ if (isCellMenuOpenByKeyboard && !_this.state.isSubmenuOpen && fg('platform.editor.a11y-table-context-menu_y4c9c')) {
533
533
  _this.setState({
534
534
  isSubmenuOpen: true
535
535
  });
@@ -558,7 +558,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
558
558
  dispatch = _this$props12$editorV.dispatch,
559
559
  dom = _this$props12$editorV.dom,
560
560
  isCellMenuOpenByKeyboard = _this$props12.isCellMenuOpenByKeyboard;
561
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
561
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
562
562
  if (payload) {
563
563
  var event = payload.event;
564
564
  if (event && event instanceof KeyboardEvent) {
@@ -640,12 +640,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
640
640
  var _this$props14 = _this.props,
641
641
  editorView = _this$props14.editorView,
642
642
  editorAnalyticsAPI = _this$props14.editorAnalyticsAPI;
643
- // TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
644
- var _getPluginState13 = getPluginState(editorView.state),
645
- targetCellPosition = _getPluginState13.targetCellPosition;
646
643
  var state = editorView.state,
647
644
  dispatch = editorView.dispatch;
648
- setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
645
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
649
646
  _this.toggleOpen();
650
647
  });
651
648
  return _this;
@@ -653,7 +650,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
653
650
  _createClass(ContextualMenu, [{
654
651
  key: "componentDidMount",
655
652
  value: function componentDidMount() {
656
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
653
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
657
654
  // ArrowKeyNavigationProvider in DropdownMenu expects that menu handle will stay focused
658
655
  // until user pressed ArrowDown.
659
656
  // Behavior above fails the A11Y requirement about first item in menu should be focused immediately.
@@ -676,11 +673,11 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
676
673
  boundariesElement = _this$props15.boundariesElement,
677
674
  editorView = _this$props15.editorView,
678
675
  isCellMenuOpenByKeyboard = _this$props15.isCellMenuOpenByKeyboard;
679
- var _getPluginState14 = getPluginState(editorView.state),
680
- isDragAndDropEnabled = _getPluginState14.isDragAndDropEnabled;
676
+ var _getPluginState13 = getPluginState(editorView.state),
677
+ isDragAndDropEnabled = _getPluginState13.isDragAndDropEnabled;
681
678
  var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
682
679
  var isOpenAllowed = false;
683
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
680
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
684
681
  isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
685
682
  } else {
686
683
  isOpenAllowed = isOpen;
@@ -696,7 +693,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
696
693
  ,
697
694
  arrowKeyNavigationProviderOptions: {
698
695
  type: ArrowKeyNavigationType.MENU,
699
- disableArrowKeyNavigation: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen ? false : true
696
+ disableArrowKeyNavigation: isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen && fg('platform.editor.a11y-table-context-menu_y4c9c') ? false : true
700
697
  },
701
698
  items: items,
702
699
  isOpen: isOpenAllowed,
@@ -706,7 +703,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
706
703
  onMouseLeave: this.handleItemMouseLeave,
707
704
  fitHeight: 188,
708
705
  fitWidth: isDragAndDropEnabled ? contextualMenuDropdownWidthDnD : contextualMenuDropdownWidth,
709
- shouldFocusFirstItem: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? function () {
706
+ shouldFocusFirstItem: fg('platform.editor.a11y-table-context-menu_y4c9c') ? function () {
710
707
  return Boolean(isCellMenuOpenByKeyboard);
711
708
  } : undefined,
712
709
  boundariesElement: boundariesElement,
@@ -714,7 +711,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
714
711
  section: isDragAndDropEnabled ? {
715
712
  hasSeparator: true
716
713
  } : undefined,
717
- isAllowEnterDefaultBehavior: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
714
+ isAllowEnterDefaultBehavior: fg('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
718
715
  }));
719
716
  }
720
717
  }]);
@@ -20,7 +20,7 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
20
20
  import { TableMap } from '@atlaskit/editor-tables/table-map';
21
21
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
22
22
  import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
23
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
23
+ import { fg } from '@atlaskit/platform-feature-flags';
24
24
  import Toggle from '@atlaskit/toggle';
25
25
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
26
26
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../commands-with-analytics';
@@ -211,7 +211,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
211
211
  var selectionRect = isSelectionType(selection, 'cell') ? getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
212
212
  var shouldMoveDisabled;
213
213
  var hasMergedCellsInTable;
214
- if (getBooleanFF('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
214
+ if (fg('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
215
215
  var _tableMap$hasMergedCe;
216
216
  shouldMoveDisabled = false;
217
217
  hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
@@ -237,18 +237,16 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
237
237
  }
238
238
  };
239
239
  var setColor = function setColor(color) {
240
- var _getTablePluginState = getTablePluginState(editorView.state),
241
- targetCellPosition = _getTablePluginState.targetCellPosition;
242
240
  var state = editorView.state,
243
241
  dispatch = editorView.dispatch;
244
- setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
242
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
245
243
  closeMenu();
246
244
  setIsSubmenuOpen(false);
247
245
  };
248
246
  var createBackgroundColorMenuItem = function createBackgroundColorMenuItem() {
249
247
  var _node$attrs;
250
- var _getTablePluginState2 = getTablePluginState(editorView.state),
251
- targetCellPosition = _getTablePluginState2.targetCellPosition;
248
+ var _getTablePluginState = getTablePluginState(editorView.state),
249
+ targetCellPosition = _getTablePluginState.targetCellPosition;
252
250
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
253
251
  var background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
254
252
  var _getSelectedRowAndCol = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette, background, colorPalletteColumns),
@@ -20,7 +20,7 @@ export declare const deleteTable: Command;
20
20
  export declare const deleteTableIfSelected: Command;
21
21
  export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
22
22
  export declare const moveCursorBackward: Command;
23
- export declare const setMultipleCellAttrs: (attrs: Object, targetCellPosition?: number, editorView?: EditorView | null) => Command;
23
+ export declare const setMultipleCellAttrs: (attrs: Object, editorView?: EditorView | null) => Command;
24
24
  export declare const selectColumn: (column: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
25
25
  export declare const selectColumns: (columnIndexes: number[]) => Command;
26
26
  export declare const selectRow: (row: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
@@ -13,7 +13,7 @@ import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, RowInsertPos
13
13
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
14
14
  export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
15
15
  export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
16
- export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, targetCellPosition?: number, editorView?: EditorView | null) => Command;
16
+ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
17
17
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
18
18
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
19
19
  export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
@@ -20,7 +20,7 @@ export declare const deleteTable: Command;
20
20
  export declare const deleteTableIfSelected: Command;
21
21
  export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
22
22
  export declare const moveCursorBackward: Command;
23
- export declare const setMultipleCellAttrs: (attrs: Object, targetCellPosition?: number, editorView?: EditorView | null) => Command;
23
+ export declare const setMultipleCellAttrs: (attrs: Object, editorView?: EditorView | null) => Command;
24
24
  export declare const selectColumn: (column: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
25
25
  export declare const selectColumns: (columnIndexes: number[]) => Command;
26
26
  export declare const selectRow: (row: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
@@ -13,7 +13,7 @@ import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, RowInsertPos
13
13
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
14
14
  export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
15
15
  export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
16
- export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, targetCellPosition?: number, editorView?: EditorView | null) => Command;
16
+ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
17
17
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
18
18
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
19
19
  export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.19.5",
3
+ "version": "7.19.6",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,10 +28,10 @@
28
28
  "runReact18": false
29
29
  },
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^38.0.0",
31
+ "@atlaskit/adf-schema": "^39.0.3",
32
32
  "@atlaskit/button": "^18.0.0",
33
33
  "@atlaskit/custom-steps": "^0.4.0",
34
- "@atlaskit/editor-common": "^83.4.0",
34
+ "@atlaskit/editor-common": "^83.5.0",
35
35
  "@atlaskit/editor-palette": "1.6.0",
36
36
  "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
@@ -387,10 +387,11 @@ export const moveCursorBackward: Command = (state, dispatch) => {
387
387
  };
388
388
 
389
389
  export const setMultipleCellAttrs =
390
- (attrs: Object, targetCellPosition?: number, editorView?: EditorView | null): Command =>
390
+ (attrs: Object, editorView?: EditorView | null): Command =>
391
391
  (state, dispatch) => {
392
392
  let cursorPos: number | undefined;
393
393
  let { tr } = state;
394
+ const { targetCellPosition } = getPluginState(state);
394
395
 
395
396
  if (isSelectionType(tr.selection, 'cell')) {
396
397
  const selection = tr.selection as any as CellSelection;
@@ -161,7 +161,6 @@ export const setColorWithAnalytics =
161
161
  | INPUT_METHOD.FLOATING_TB
162
162
  | INPUT_METHOD.TABLE_CONTEXT_MENU,
163
163
  cellColor: string,
164
- targetCellPosition?: number,
165
164
  editorView?: EditorView | null,
166
165
  ) =>
167
166
  withEditorAnalyticsAPI(({ selection }) => {
@@ -185,9 +184,7 @@ export const setColorWithAnalytics =
185
184
  },
186
185
  eventType: EVENT_TYPE.TRACK,
187
186
  };
188
- })(editorAnalyticsAPI)(
189
- setMultipleCellAttrs({ background: cellColor }, targetCellPosition, editorView),
190
- );
187
+ })(editorAnalyticsAPI)(setMultipleCellAttrs({ background: cellColor }, editorView));
191
188
 
192
189
  export const addRowAroundSelection =
193
190
  (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) =>
@@ -6,7 +6,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
8
8
  import { getCellsInRow, getSelectedCellInfo } from '@atlaskit/editor-tables/utils';
9
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
11
11
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
12
12
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
@@ -225,7 +225,7 @@ const destroyFn = (
225
225
 
226
226
  const shouldUseIncreasedScalingPercent =
227
227
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
228
- getBooleanFF('platform.editor.table.use-increased-scaling-percent');
228
+ fg('platform.editor.table.use-increased-scaling-percent');
229
229
 
230
230
  insertColgroupFromNode(
231
231
  tableRef,
package/src/toolbar.tsx CHANGED
@@ -630,6 +630,7 @@ export const getToolbarConfig =
630
630
  scrollable: true,
631
631
  };
632
632
  }
633
+
633
634
  return;
634
635
  };
635
636
 
@@ -715,7 +716,6 @@ const getColumnSettingItems = (
715
716
  ): Array<FloatingToolbarItem<Command>> => {
716
717
  const pluginState = getPluginState(editorState);
717
718
  const selectionOrTableRect = getClosestSelectionOrTableRect(editorState);
718
-
719
719
  if (!selectionOrTableRect || !editorView) {
720
720
  return [];
721
721
  }
@@ -794,7 +794,6 @@ const getColorPicker = (
794
794
  setColorWithAnalytics(editorAnalyticsAPI)(
795
795
  INPUT_METHOD.FLOATING_TB,
796
796
  option.value,
797
- targetCellPosition,
798
797
  getEditorView(),
799
798
  ),
800
799
  },
@@ -42,7 +42,7 @@ import { splitCell } from '@atlaskit/editor-tables/utils';
42
42
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
43
43
  import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
44
44
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
45
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
45
+ import { fg } from '@atlaskit/platform-feature-flags';
46
46
 
47
47
  import {
48
48
  clearHoverSelection,
@@ -117,7 +117,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
117
117
  private dropdownMenuRef = React.createRef<HTMLDivElement>();
118
118
 
119
119
  componentDidMount() {
120
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
120
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
121
121
  // ArrowKeyNavigationProvider in DropdownMenu expects that menu handle will stay focused
122
122
  // until user pressed ArrowDown.
123
123
  // Behavior above fails the A11Y requirement about first item in menu should be focused immediately.
@@ -141,7 +141,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
141
141
  : this.createOriginalContextMenuItems();
142
142
  let isOpenAllowed = false;
143
143
 
144
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
144
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
145
145
  isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
146
146
  } else {
147
147
  isOpenAllowed = isOpen;
@@ -160,9 +160,9 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
160
160
  arrowKeyNavigationProviderOptions={{
161
161
  type: ArrowKeyNavigationType.MENU,
162
162
  disableArrowKeyNavigation:
163
- getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') &&
164
163
  isCellMenuOpenByKeyboard &&
165
- !this.state.isSubmenuOpen
164
+ !this.state.isSubmenuOpen &&
165
+ fg('platform.editor.a11y-table-context-menu_y4c9c')
166
166
  ? false
167
167
  : true,
168
168
  }}
@@ -177,7 +177,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
177
177
  isDragAndDropEnabled ? contextualMenuDropdownWidthDnD : contextualMenuDropdownWidth
178
178
  }
179
179
  shouldFocusFirstItem={
180
- getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')
180
+ fg('platform.editor.a11y-table-context-menu_y4c9c')
181
181
  ? () => {
182
182
  return Boolean(isCellMenuOpenByKeyboard);
183
183
  }
@@ -187,9 +187,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
187
187
  offset={offset}
188
188
  section={isDragAndDropEnabled ? { hasSeparator: true } : undefined}
189
189
  isAllowEnterDefaultBehavior={
190
- getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')
191
- ? this.state.isSubmenuOpen
192
- : false
190
+ fg('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
193
191
  }
194
192
  />
195
193
  </div>
@@ -229,7 +227,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
229
227
  let selectedRowIndex;
230
228
  let selectedColumnIndex;
231
229
 
232
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
230
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
233
231
  const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(
234
232
  cellBackgroundColorPalette,
235
233
  background!,
@@ -265,7 +263,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
265
263
  : ClassName.CONTEXTUAL_MENU_ICON
266
264
  }
267
265
  />
268
- {getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')
266
+ {fg('platform.editor.a11y-table-context-menu_y4c9c')
269
267
  ? isSubmenuOpen && (
270
268
  <div
271
269
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -320,7 +318,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
320
318
  )}
321
319
  </div>
322
320
  ),
323
- 'aria-expanded': getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')
321
+ 'aria-expanded': fg('platform.editor.a11y-table-context-menu_y4c9c')
324
322
  ? isSubmenuOpen
325
323
  : undefined,
326
324
  } as MenuItem;
@@ -649,10 +647,10 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
649
647
  // context menu opened by keyboard and any item except 'background' activated
650
648
  // or color has been chosen from color palette
651
649
  if (
652
- getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') &&
653
650
  isCellMenuOpenByKeyboard &&
654
651
  (item.value.name !== 'background' ||
655
- (item.value.name === 'background' && this.state.isSubmenuOpen))
652
+ (item.value.name === 'background' && this.state.isSubmenuOpen)) &&
653
+ fg('platform.editor.a11y-table-context-menu_y4c9c')
656
654
  ) {
657
655
  const { tr } = state;
658
656
  tr.setMeta(tablePluginKey, {
@@ -668,7 +666,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
668
666
  const shouldUseIncreasedScalingPercent =
669
667
  isTableScalingEnabled &&
670
668
  tableWithFixedColumnWidthsOption &&
671
- getBooleanFF('platform.editor.table.use-increased-scaling-percent');
669
+ fg('platform.editor.table.use-increased-scaling-percent');
672
670
 
673
671
  switch (item.value.name) {
674
672
  case 'sort_column_desc':
@@ -767,9 +765,9 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
767
765
  // 2nd when color has been chosen from color palette.
768
766
  // here we are handling the 1st call relying on the isSubmenuOpen state value
769
767
  if (
770
- getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') &&
771
768
  isCellMenuOpenByKeyboard &&
772
- !this.state.isSubmenuOpen
769
+ !this.state.isSubmenuOpen &&
770
+ fg('platform.editor.a11y-table-context-menu_y4c9c')
773
771
  ) {
774
772
  this.setState({ isSubmenuOpen: true });
775
773
  }
@@ -800,7 +798,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
800
798
  isCellMenuOpenByKeyboard,
801
799
  } = this.props;
802
800
 
803
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
801
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
804
802
  if (payload) {
805
803
  const { event } = payload;
806
804
  if (event && event instanceof KeyboardEvent) {
@@ -881,13 +879,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
881
879
 
882
880
  private setColor = (color: string) => {
883
881
  const { editorView, editorAnalyticsAPI } = this.props;
884
- // TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
885
- const { targetCellPosition } = getPluginState(editorView.state);
886
882
  const { state, dispatch } = editorView;
887
- setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(
888
- state,
889
- dispatch,
890
- );
883
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
891
884
  this.toggleOpen();
892
885
  };
893
886
  }
@@ -39,7 +39,7 @@ import {
39
39
  isSelectionType,
40
40
  } from '@atlaskit/editor-tables/utils';
41
41
  import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
42
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
42
+ import { fg } from '@atlaskit/platform-feature-flags';
43
43
  import Toggle from '@atlaskit/toggle';
44
44
 
45
45
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
@@ -292,7 +292,7 @@ export const DragMenu = React.memo(
292
292
 
293
293
  let shouldMoveDisabled;
294
294
  let hasMergedCellsInTable;
295
- if (getBooleanFF('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
295
+ if (fg('platform.editor.table.drag-move-options-logic-update_fp7xw')) {
296
296
  shouldMoveDisabled = false;
297
297
  hasMergedCellsInTable = tableMap?.hasMergedCells() ?? false;
298
298
  } else {
@@ -347,13 +347,8 @@ export const DragMenu = React.memo(
347
347
  };
348
348
 
349
349
  const setColor = (color: string) => {
350
- const { targetCellPosition } = getTablePluginState(editorView.state);
351
350
  const { state, dispatch } = editorView;
352
- setColorWithAnalytics(editorAnalyticsAPI)(
353
- INPUT_METHOD.CONTEXT_MENU,
354
- color,
355
- targetCellPosition,
356
- )(state, dispatch);
351
+ setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
357
352
  closeMenu();
358
353
  setIsSubmenuOpen(false);
359
354
  };