@atlaskit/editor-plugin-table 7.19.5 → 7.19.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/commands/misc.js +14 -12
  3. package/dist/cjs/commands-with-analytics.js +2 -2
  4. package/dist/cjs/plugin.js +1 -2
  5. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +1 -1
  6. package/dist/cjs/toolbar.js +1 -1
  7. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +15 -18
  8. package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -1
  9. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +4 -6
  10. package/dist/cjs/ui/FloatingDragMenu/styles.js +2 -2
  11. package/dist/cjs/ui/common-styles.js +2 -2
  12. package/dist/cjs/ui/ui-styles.js +1 -1
  13. package/dist/es2019/commands/misc.js +4 -1
  14. package/dist/es2019/commands-with-analytics.js +2 -2
  15. package/dist/es2019/plugin.js +31 -34
  16. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +2 -2
  17. package/dist/es2019/toolbar.js +1 -1
  18. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +14 -18
  19. package/dist/es2019/ui/FloatingContextualMenu/styles.js +1 -1
  20. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -6
  21. package/dist/es2019/ui/FloatingDragMenu/styles.js +2 -2
  22. package/dist/es2019/ui/common-styles.js +2 -2
  23. package/dist/es2019/ui/ui-styles.js +1 -1
  24. package/dist/esm/commands/misc.js +14 -12
  25. package/dist/esm/commands-with-analytics.js +2 -2
  26. package/dist/esm/plugin.js +1 -2
  27. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +2 -2
  28. package/dist/esm/toolbar.js +1 -1
  29. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +16 -19
  30. package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -1
  31. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +5 -7
  32. package/dist/esm/ui/FloatingDragMenu/styles.js +2 -2
  33. package/dist/esm/ui/common-styles.js +2 -2
  34. package/dist/esm/ui/ui-styles.js +1 -1
  35. package/dist/types/commands/misc.d.ts +1 -1
  36. package/dist/types/commands-with-analytics.d.ts +1 -1
  37. package/dist/types-ts4.5/commands/misc.d.ts +1 -1
  38. package/dist/types-ts4.5/commands-with-analytics.d.ts +1 -1
  39. package/package.json +6 -6
  40. package/src/commands/misc.ts +2 -1
  41. package/src/commands-with-analytics.ts +1 -4
  42. package/src/plugin.tsx +1 -3
  43. package/src/pm-plugins/drag-and-drop/plugin.ts +2 -2
  44. package/src/toolbar.tsx +1 -2
  45. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +17 -24
  46. package/src/ui/FloatingContextualMenu/styles.ts +1 -1
  47. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -8
  48. package/src/ui/FloatingDragMenu/styles.ts +2 -2
  49. package/src/ui/common-styles.ts +2 -2
  50. package/src/ui/ui-styles.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.19.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d9b562bd66f8e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d9b562bd66f8e) -
8
+ [ux] [ED-23947] restoring the original order of the typeahead menu so that actions, media,
9
+ mentions and emojis are above the fold (in the top 5 results). this change is a major because it
10
+ removes the `getEditorFeatureFlags prop` for plugins. if any consumers who have adopted these
11
+ changes to the public API, they should remove them on their side too.
12
+ - Updated dependencies
13
+
14
+ ## 7.19.6
15
+
16
+ ### Patch Changes
17
+
18
+ - [#113441](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113441)
19
+ [`8b819018560ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b819018560ea) -
20
+ [ux] Fixed a bug where when cell background color is updated via floating toolbar, the calor is
21
+ set on a wrong cell.
22
+ - [#114548](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114548)
23
+ [`8b2d47bffb50e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b2d47bffb50e) -
24
+ bump adf-schema version
25
+ - Updated dependencies
26
+
3
27
  ## 7.19.5
4
28
 
5
29
  ### 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) {
@@ -442,14 +442,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
442
442
  },
443
443
  pluginsOptions: {
444
444
  quickInsert: function quickInsert(_ref19) {
445
- var _options$getEditorFea3;
446
445
  var formatMessage = _ref19.formatMessage;
447
446
  return [{
448
447
  id: 'table',
449
448
  title: formatMessage(_messages.toolbarInsertBlockMessages.table),
450
449
  description: formatMessage(_messages.toolbarInsertBlockMessages.tableDescription),
451
450
  keywords: ['cell', 'table'],
452
- priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
451
+ priority: 600,
453
452
  keyshortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
454
453
  icon: function icon() {
455
454
  return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
@@ -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
  }]);
@@ -21,7 +21,7 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
21
21
  });
22
22
  };
23
23
 
24
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
25
25
  var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)({
26
26
  marginRight: "var(--ds-space-negative-075, -6px)",
27
27
  display: 'flex'
@@ -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),
@@ -21,7 +21,7 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
21
21
  });
22
22
  };
23
23
 
24
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
25
25
  var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)({
26
26
  marginRight: "var(--ds-space-negative-075, -6px)",
27
27
  display: 'flex'
@@ -33,7 +33,7 @@ var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = func
33
33
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), tableSortColumnReorder ? _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
34
34
  };
35
35
 
36
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
37
37
  var toggleStyles = exports.toggleStyles = (0, _react.css)({
38
38
  display: 'flex',
39
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
@@ -83,8 +83,8 @@ var tableStyles = exports.tableStyles = function tableStyles(props) {
83
83
  return (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t}\n\n\t.ProseMirror.", " {\n\t\t.", " {\n\t\t\toverflow-x: auto;\n\t\t\t", ";\n\t\t}\n\t}\n\n\t.ProseMirror.", " {\n\t\tcursor: col-resize;\n\t}\n\n\t", "\n"])), baseTableStyles(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, shadowSentinelStyles);
84
84
  };
85
85
 
86
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
86
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
87
87
  var tableFullPageEditorStyles = exports.tableFullPageEditorStyles = (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror .", " > table {\n\t\tmargin-left: 0;\n\t\t// 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n\t\tmargin-right: -1px;\n\t\twidth: 100%;\n\t}\n"])), _types.TableCssClassName.TABLE_NODE_WRAPPER);
88
88
 
89
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
89
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
90
90
  var tableCommentEditorStyles = exports.tableCommentEditorStyles = (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror .", " > table {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t\t", ";\n\t}\n"])), _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles);
@@ -141,7 +141,7 @@ var hoveredCell = exports.hoveredCell = function hoveredCell() {
141
141
  return (0, _react.css)(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2.default)(["\n\t:not(.", ")\n\t\t.", ":not(.", ") {\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tborder: 1px solid ", ";\n\t\t}\n\t\t.", ".", " {\n\t\t\tposition: relative;\n\t\t\tborder: 1px solid ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.HOVERED_DELETE_BUTTON, _types.TableCssClassName.HOVERED_CELL, _consts.tableBorderSelectedColor, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.HOVERED_NO_HIGHLIGHT, _consts.tableBorderColor);
142
142
  };
143
143
 
144
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
144
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
145
145
  var hoveredWarningCell = exports.hoveredWarningCell = (0, _react.css)(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2.default)(["\n\t:not(.", ")\n\t\t.", ":not(.", ") {\n\t\ttd.", " {\n\t\t\tbackground-color: ", " !important; // We need to override the background-color added to the cell\n\t\t\tborder: 1px solid ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.HOVERED_DELETE_BUTTON, _types.TableCssClassName.HOVERED_CELL_WARNING, "var(--ds-background-warning, ".concat(_colors.Y50, ")"), "var(--ds-border-warning, ".concat(_colors.Y200, ")"));
146
146
 
147
147
  // Explicit pixel values required here to ensure correct positioning and sizes of column resize handle
@@ -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
@@ -437,40 +437,37 @@ const tablesPlugin = ({
437
437
  pluginsOptions: {
438
438
  quickInsert: ({
439
439
  formatMessage
440
- }) => {
441
- var _options$getEditorFea3;
442
- return [{
443
- id: 'table',
444
- title: formatMessage(messages.table),
445
- description: formatMessage(messages.tableDescription),
446
- keywords: ['cell', 'table'],
447
- priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
448
- keyshortcut: tooltip(toggleTable),
449
- icon: () => /*#__PURE__*/React.createElement(IconTable, null),
450
- action(insert, state) {
451
- var _api$table;
452
- // see comment on tablesPlugin.getSharedState on usage
453
- const tableState = api === null || api === void 0 ? void 0 : (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
454
- const tableNode = createTableWithWidth({
455
- isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
456
- isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
457
- isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled
458
- })(state.schema);
459
- const tr = insert(tableNode);
460
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
461
- action: ACTION.INSERTED,
462
- actionSubject: ACTION_SUBJECT.DOCUMENT,
463
- actionSubjectId: ACTION_SUBJECT_ID.TABLE,
464
- attributes: {
465
- inputMethod: INPUT_METHOD.QUICK_INSERT,
466
- localId: tableNode.attrs.localId
467
- },
468
- eventType: EVENT_TYPE.TRACK
469
- })(tr);
470
- return tr;
471
- }
472
- }];
473
- },
440
+ }) => [{
441
+ id: 'table',
442
+ title: formatMessage(messages.table),
443
+ description: formatMessage(messages.tableDescription),
444
+ keywords: ['cell', 'table'],
445
+ priority: 600,
446
+ keyshortcut: tooltip(toggleTable),
447
+ icon: () => /*#__PURE__*/React.createElement(IconTable, null),
448
+ action(insert, state) {
449
+ var _api$table;
450
+ // see comment on tablesPlugin.getSharedState on usage
451
+ const tableState = api === null || api === void 0 ? void 0 : (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
452
+ const tableNode = createTableWithWidth({
453
+ isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
454
+ isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
455
+ isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled
456
+ })(state.schema);
457
+ const tr = insert(tableNode);
458
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
459
+ action: ACTION.INSERTED,
460
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
461
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
462
+ attributes: {
463
+ inputMethod: INPUT_METHOD.QUICK_INSERT,
464
+ localId: tableNode.attrs.localId
465
+ },
466
+ eventType: EVENT_TYPE.TRACK
467
+ })(tr);
468
+ return tr;
469
+ }
470
+ }],
474
471
  floatingToolbar: getToolbarConfig(defaultGetEditorContainerWidth, editorAnalyticsAPI, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags, () => editorViewRef.current, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions))
475
472
  }
476
473
  };
@@ -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) => {