@atlaskit/editor-plugin-table 7.17.2 → 7.17.4

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 (46) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/plugin.js +3 -2
  3. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +3 -3
  4. package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
  5. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +4 -4
  6. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +9 -9
  7. package/dist/cjs/ui/FloatingDragMenu/index.js +3 -3
  8. package/dist/cjs/ui/FloatingDragMenu/styles.js +2 -2
  9. package/dist/cjs/utils/drag-menu.js +2 -2
  10. package/dist/es2019/plugin.js +3 -2
  11. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +3 -3
  12. package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
  13. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  14. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +9 -9
  15. package/dist/es2019/ui/FloatingDragMenu/index.js +2 -2
  16. package/dist/es2019/ui/FloatingDragMenu/styles.js +2 -2
  17. package/dist/es2019/utils/drag-menu.js +2 -2
  18. package/dist/esm/plugin.js +3 -2
  19. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +3 -3
  20. package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
  21. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +4 -4
  22. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +9 -9
  23. package/dist/esm/ui/FloatingDragMenu/index.js +3 -3
  24. package/dist/esm/ui/FloatingDragMenu/styles.js +2 -2
  25. package/dist/esm/utils/drag-menu.js +2 -2
  26. package/dist/types/plugin.d.ts +1 -0
  27. package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  28. package/dist/types/pm-plugins/table-resizing/plugin.d.ts +1 -1
  29. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  30. package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
  31. package/dist/types/utils/drag-menu.d.ts +1 -1
  32. package/dist/types-ts4.5/plugin.d.ts +1 -0
  33. package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  34. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +1 -1
  35. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  36. package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
  37. package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
  38. package/package.json +19 -11
  39. package/src/plugin.tsx +9 -2
  40. package/src/pm-plugins/table-resizing/event-handlers.ts +3 -8
  41. package/src/pm-plugins/table-resizing/plugin.ts +2 -0
  42. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +3 -5
  43. package/src/ui/FloatingDragMenu/DragMenu.tsx +10 -10
  44. package/src/ui/FloatingDragMenu/index.tsx +2 -2
  45. package/src/ui/FloatingDragMenu/styles.ts +2 -4
  46. package/src/utils/drag-menu.ts +2 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.17.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#111851](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111851)
8
+ [`4aefbe38ee8e2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4aefbe38ee8e2) -
9
+ ED-23129: Updated experiment ID and corresponding editor FF
10
+
11
+ ## 7.17.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#111381](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111381)
16
+ [`5ec7ab3d39035`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ec7ab3d39035) -
17
+ Replace the LD flag controlling new column resizing experience with statsig experiment
18
+
3
19
  ## 7.17.2
4
20
 
5
21
  ### Patch Changes
@@ -177,12 +177,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
177
177
  fullWidthEnabled = _ref5.fullWidthEnabled,
178
178
  tableOptions = _ref5.tableOptions,
179
179
  getEditorFeatureFlags = _ref5.getEditorFeatureFlags,
180
- isTableScalingEnabled = _ref5.isTableScalingEnabled;
180
+ isTableScalingEnabled = _ref5.isTableScalingEnabled,
181
+ isNewColumnResizingEnabled = _ref5.isNewColumnResizingEnabled;
181
182
  var _pluginConfig = (0, _createPluginConfig.pluginConfig)(tableOptions),
182
183
  allowColumnResizing = _pluginConfig.allowColumnResizing;
183
184
  return allowColumnResizing ? (0, _tableResizing.createPlugin)(dispatch, {
184
185
  lastColumnResizable: !fullWidthEnabled
185
- }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled || false) : undefined;
186
+ }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled) : undefined;
186
187
  }
187
188
  }, {
188
189
  name: 'tableEditing',
@@ -18,7 +18,7 @@ var _tableAnalytics = require("../table-analytics");
18
18
  var _commands = require("./commands");
19
19
  var _pluginFactory2 = require("./plugin-factory");
20
20
  var _utils3 = require("./utils");
21
- var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, editorAnalyticsAPI) {
21
+ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, editorAnalyticsAPI, isNewColumnResizingEnabled) {
22
22
  var state = view.state,
23
23
  dispatch = view.dispatch;
24
24
  var editorDisabled = !view.editable;
@@ -147,7 +147,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
147
147
  _shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
148
148
  }
149
149
  var resizedDelta = clientX - startX;
150
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements') && !(0, _utils2.isTableNested)(state, tablePos)) {
150
+ if (isNewColumnResizingEnabled && !(0, _utils2.isTableNested)(state, tablePos)) {
151
151
  var newResizeState = (0, _utils3.resizeColumnAndTable)(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale);
152
152
  tr = (0, _transforms.updateColumnWidths)(newResizeState, table, start)(tr);
153
153
  tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
@@ -224,7 +224,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
224
224
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
225
225
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
226
226
  }
227
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements') && !(0, _utils2.isTableNested)(state, tablePos)) {
227
+ if (isNewColumnResizingEnabled && !(0, _utils2.isTableNested)(state, tablePos)) {
228
228
  (0, _utils3.resizeColumnAndTable)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
229
229
  } else {
230
230
  (0, _utils3.resizeColumn)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
@@ -16,7 +16,7 @@ var _eventHandlers = require("./event-handlers");
16
16
  var _pluginFactory2 = require("./plugin-factory");
17
17
  var _pluginKey = require("./plugin-key");
18
18
  var _utils = require("./utils");
19
- function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled) {
19
+ function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled) {
20
20
  var _ref$lastColumnResiza = _ref.lastColumnResizable,
21
21
  lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
22
22
  return new _safePlugin.SafePlugin({
@@ -56,7 +56,7 @@ function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureF
56
56
  }
57
57
  }
58
58
  if (resizeHandlePos !== null && (!dragging || isColumnKeyboardResizeStarted)) {
59
- if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, editorAnalyticsAPI)) {
59
+ if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, editorAnalyticsAPI, isNewColumnResizingEnabled)) {
60
60
  var _state = view.state,
61
61
  _dispatch = view.dispatch;
62
62
  return (0, _commands.setResizeHandlePos)(resizeHandlePos)(_state, _dispatch);
@@ -355,12 +355,12 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
355
355
  var items = [];
356
356
  var getEditorFeatureFlags = _this.props.getEditorFeatureFlags;
357
357
  var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
358
- _ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
359
- tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
358
+ _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
359
+ tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
360
360
  var sortColumnItems = _this.createSortColumnItems();
361
361
  var backgroundColorItem = _this.createBackgroundColorItem();
362
362
  var distributeColumnsItem = _this.createDistributeColumnsItem();
363
- tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
363
+ tableSortColumnReorder && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
364
364
  backgroundColorItem && items.push(backgroundColorItem);
365
365
  items.push(_this.createInsertColumnItem());
366
366
  items.push(_this.createInsertRowItem());
@@ -368,7 +368,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
368
368
  items.push(_this.createDeleteRowItem());
369
369
  items.push.apply(items, (0, _toConsumableArray2.default)(_this.createMergeSplitCellItems()));
370
370
  distributeColumnsItem && items.push(distributeColumnsItem);
371
- !tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
371
+ !tableSortColumnReorder && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
372
372
  items.push(_this.createClearCellsItem());
373
373
  return [{
374
374
  items: items
@@ -100,16 +100,16 @@ var MapDragMenuOptionIdToMessage = {
100
100
  plural: null
101
101
  }
102
102
  };
103
- var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnDiscoverability) {
103
+ var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnReorder) {
104
104
  var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down']];
105
105
  var sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
106
- tableSortColumnDiscoverability ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
106
+ tableSortColumnReorder ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
107
107
  return groupedDragMenuConfig;
108
108
  };
109
109
  var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage) {
110
- var tableSortColumnDiscoverability = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
110
+ var tableSortColumnReorder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
111
111
  var selectionRect = arguments.length > 3 ? arguments[3] : undefined;
112
- var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnDiscoverability);
112
+ var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
113
113
  var menuItemsArr = (0, _toConsumableArray2.default)(Array(groupedDragMenuConfig.length)).map(function () {
114
114
  return [];
115
115
  });
@@ -206,7 +206,7 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
206
206
  tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
207
207
  shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
208
208
  isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
209
- tableSortColumnDiscoverability = _ref.tableSortColumnDiscoverability;
209
+ tableSortColumnReorder = _ref.tableSortColumnReorder;
210
210
  var state = editorView.state,
211
211
  dispatch = editorView.dispatch;
212
212
  var selection = state.selection;
@@ -230,8 +230,8 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
230
230
  hasMergedCellsInTable = (0, _utils3.getMergedCellsPositions)(state.tr).length > 0;
231
231
  }
232
232
  var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
233
- var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnDiscoverability);
234
- var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnDiscoverability, selectionRect),
233
+ var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnReorder);
234
+ var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnReorder, selectionRect),
235
235
  menuItems = _convertToDropdownIte.menuItems,
236
236
  menuCallback = _convertToDropdownIte.menuCallback;
237
237
  var handleSubMenuRef = function handleSubMenuRef(ref) {
@@ -282,7 +282,7 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
282
282
  className: _styles.DropdownMenuSharedCssClassName.SUBMENU
283
283
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
284
284
  ,
285
- css: (0, _styles2.dragMenuBackgroundColorStyles)(tableSortColumnDiscoverability)
285
+ css: (0, _styles2.dragMenuBackgroundColorStyles)(tableSortColumnReorder)
286
286
  }, (0, _react2.jsx)("div", {
287
287
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
288
288
  css: (0, _styles2.cellColourPreviewStyles)(background)
@@ -480,7 +480,7 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
480
480
  return null;
481
481
  }
482
482
  if (allowBackgroundColor) {
483
- tableSortColumnDiscoverability ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
483
+ tableSortColumnReorder ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
484
484
  }
485
485
 
486
486
  // If first row, add toggle for Header row, default is true
@@ -42,8 +42,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
42
42
  tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
43
43
  _ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
44
44
  tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC,
45
- _ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
46
- tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
45
+ _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
46
+ tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
47
47
  var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
48
48
  return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
49
49
  alignX: direction === 'row' ? 'right' : undefined,
@@ -82,7 +82,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
82
82
  tableDuplicateCellColouring: tableDuplicateCellColouring,
83
83
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
84
84
  isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
85
- tableSortColumnDiscoverability: tableSortColumnDiscoverability
85
+ tableSortColumnReorder: tableSortColumnReorder
86
86
  }));
87
87
  };
88
88
  FloatingDragMenu.displayName = 'FloatingDragMenu';
@@ -29,8 +29,8 @@ var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)(
29
29
 
30
30
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
31
31
  var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
32
- var tableSortColumnDiscoverability = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
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), ")"), tableSortColumnDiscoverability ? _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, ")"));
32
+ var tableSortColumnReorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
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
36
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
@@ -81,7 +81,7 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
81
81
  var tableDuplicateCellColouring = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
82
82
  var isTableFixedColumnWidthsOptionEnabled = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
83
83
  var shouldUseIncreasedScalingPercent = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
84
- var tableSortColumnDiscoverability = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
84
+ var tableSortColumnReorder = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
85
85
  var selection = editorView.state.selection;
86
86
  var addOptions = direction === 'row' ? [{
87
87
  label: 'above',
@@ -251,6 +251,6 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
251
251
  };
252
252
  })));
253
253
  var allConfigs = (0, _toConsumableArray2.default)(restConfigs);
254
- tableSortColumnDiscoverability ? allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs)) : allConfigs.push.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
254
+ tableSortColumnReorder ? allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs)) : allConfigs.push.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
255
255
  return allConfigs.filter(Boolean);
256
256
  };
@@ -169,14 +169,15 @@ const tablesPlugin = ({
169
169
  fullWidthEnabled,
170
170
  tableOptions,
171
171
  getEditorFeatureFlags,
172
- isTableScalingEnabled
172
+ isTableScalingEnabled,
173
+ isNewColumnResizingEnabled
173
174
  } = options || {};
174
175
  const {
175
176
  allowColumnResizing
176
177
  } = pluginConfig(tableOptions);
177
178
  return allowColumnResizing ? createFlexiResizingPlugin(dispatch, {
178
179
  lastColumnResizable: !fullWidthEnabled
179
- }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled || false) : undefined;
180
+ }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled) : undefined;
180
181
  }
181
182
  }, {
182
183
  name: 'tableEditing',
@@ -12,7 +12,7 @@ import { META_KEYS } from '../table-analytics';
12
12
  import { evenColumns, setDragging, stopResizing } from './commands';
13
13
  import { getPluginState } from './plugin-factory';
14
14
  import { currentColWidth, getResizeState, getTableMaxWidth, pointsAtCell, resizeColumn, resizeColumnAndTable, updateControls } from './utils';
15
- export const handleMouseDown = (view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, editorAnalyticsAPI) => {
15
+ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, editorAnalyticsAPI, isNewColumnResizingEnabled) => {
16
16
  const {
17
17
  state,
18
18
  dispatch
@@ -154,7 +154,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
154
154
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
155
155
  }
156
156
  const resizedDelta = clientX - startX;
157
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
157
+ if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
158
158
  const newResizeState = resizeColumnAndTable(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, shouldScale);
159
159
  tr = updateColumnWidths(newResizeState, table, start)(tr);
160
160
  tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
@@ -237,7 +237,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
237
237
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
238
238
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
239
239
  }
240
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
240
+ if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
241
241
  resizeColumnAndTable(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
242
242
  } else {
243
243
  resizeColumn(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
@@ -10,7 +10,7 @@ import { pluginKey } from './plugin-key';
10
10
  import { getResizeCellPos } from './utils';
11
11
  export function createPlugin(dispatch, {
12
12
  lastColumnResizable = true
13
- }, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled) {
13
+ }, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled) {
14
14
  return new SafePlugin({
15
15
  key: pluginKey,
16
16
  state: createPluginState(dispatch, {
@@ -54,7 +54,7 @@ export function createPlugin(dispatch, {
54
54
  }
55
55
  }
56
56
  if (resizeHandlePos !== null && (!dragging || isColumnKeyboardResizeStarted)) {
57
- if (handleMouseDown(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, editorAnalyticsAPI)) {
57
+ if (handleMouseDown(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, editorAnalyticsAPI, isNewColumnResizingEnabled)) {
58
58
  const {
59
59
  state,
60
60
  dispatch
@@ -386,12 +386,12 @@ export class ContextualMenu extends Component {
386
386
  getEditorFeatureFlags
387
387
  } = this.props;
388
388
  const {
389
- tableSortColumnDiscoverability = false
389
+ tableSortColumnReorder = false
390
390
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
391
391
  const sortColumnItems = this.createSortColumnItems();
392
392
  const backgroundColorItem = this.createBackgroundColorItem();
393
393
  const distributeColumnsItem = this.createDistributeColumnsItem();
394
- tableSortColumnDiscoverability && sortColumnItems && items.push(...sortColumnItems);
394
+ tableSortColumnReorder && sortColumnItems && items.push(...sortColumnItems);
395
395
  backgroundColorItem && items.push(backgroundColorItem);
396
396
  items.push(this.createInsertColumnItem());
397
397
  items.push(this.createInsertRowItem());
@@ -399,7 +399,7 @@ export class ContextualMenu extends Component {
399
399
  items.push(this.createDeleteRowItem());
400
400
  items.push(...this.createMergeSplitCellItems());
401
401
  distributeColumnsItem && items.push(distributeColumnsItem);
402
- !tableSortColumnDiscoverability && sortColumnItems && items.push(...sortColumnItems);
402
+ !tableSortColumnReorder && sortColumnItems && items.push(...sortColumnItems);
403
403
  items.push(this.createClearCellsItem());
404
404
  return [{
405
405
  items
@@ -87,14 +87,14 @@ const MapDragMenuOptionIdToMessage = {
87
87
  plural: null
88
88
  }
89
89
  };
90
- const getGroupedDragMenuConfig = tableSortColumnDiscoverability => {
90
+ const getGroupedDragMenuConfig = tableSortColumnReorder => {
91
91
  let groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down']];
92
92
  const sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
93
- tableSortColumnDiscoverability ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
93
+ tableSortColumnReorder ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
94
94
  return groupedDragMenuConfig;
95
95
  };
96
- const convertToDropdownItems = (dragMenuConfig, formatMessage, tableSortColumnDiscoverability = false, selectionRect) => {
97
- const groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnDiscoverability);
96
+ const convertToDropdownItems = (dragMenuConfig, formatMessage, tableSortColumnReorder = false, selectionRect) => {
97
+ const groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
98
98
  let menuItemsArr = [...Array(groupedDragMenuConfig.length)].map(() => []);
99
99
  let menuCallback = {};
100
100
  dragMenuConfig.forEach(item => {
@@ -189,7 +189,7 @@ export const DragMenu = /*#__PURE__*/React.memo(({
189
189
  tableDuplicateCellColouring,
190
190
  shouldUseIncreasedScalingPercent,
191
191
  isTableFixedColumnWidthsOptionEnabled,
192
- tableSortColumnDiscoverability
192
+ tableSortColumnReorder
193
193
  }) => {
194
194
  var _pluginConfig$allowBa;
195
195
  const {
@@ -217,11 +217,11 @@ export const DragMenu = /*#__PURE__*/React.memo(({
217
217
  hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
218
218
  }
219
219
  const allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
220
- const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnDiscoverability);
220
+ const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnReorder);
221
221
  const {
222
222
  menuItems,
223
223
  menuCallback
224
- } = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnDiscoverability, selectionRect);
224
+ } = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnReorder, selectionRect);
225
225
  const handleSubMenuRef = ref => {
226
226
  const parent = closestElement(editorView.dom, '.fabric-editor-popup-scroll-parent');
227
227
  if (!(parent && ref)) {
@@ -275,7 +275,7 @@ export const DragMenu = /*#__PURE__*/React.memo(({
275
275
  className: DropdownMenuSharedCssClassName.SUBMENU
276
276
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
277
277
  ,
278
- css: dragMenuBackgroundColorStyles(tableSortColumnDiscoverability)
278
+ css: dragMenuBackgroundColorStyles(tableSortColumnReorder)
279
279
  }, jsx("div", {
280
280
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
281
281
  css: cellColourPreviewStyles(background)
@@ -478,7 +478,7 @@ export const DragMenu = /*#__PURE__*/React.memo(({
478
478
  return null;
479
479
  }
480
480
  if (allowBackgroundColor) {
481
- tableSortColumnDiscoverability ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
481
+ tableSortColumnReorder ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
482
482
  }
483
483
 
484
484
  // If first row, add toggle for Header row, default is true
@@ -34,7 +34,7 @@ const FloatingDragMenu = ({
34
34
  const {
35
35
  tableDuplicateCellColouring = false,
36
36
  tableWithFixedColumnWidthsOption = false,
37
- tableSortColumnDiscoverability = false
37
+ tableSortColumnReorder = false
38
38
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
39
39
  const shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
40
40
  return /*#__PURE__*/React.createElement(Popup, {
@@ -74,7 +74,7 @@ const FloatingDragMenu = ({
74
74
  tableDuplicateCellColouring: tableDuplicateCellColouring,
75
75
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
76
76
  isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
77
- tableSortColumnDiscoverability: tableSortColumnDiscoverability
77
+ tableSortColumnReorder: tableSortColumnReorder
78
78
  }));
79
79
  };
80
80
  FloatingDragMenu.displayName = 'FloatingDragMenu';
@@ -17,14 +17,14 @@ export const elementBeforeIconStyles = css({
17
17
  });
18
18
 
19
19
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
20
- export const dragMenuBackgroundColorStyles = (tableSortColumnDiscoverability = false) => css`
20
+ export const dragMenuBackgroundColorStyles = (tableSortColumnReorder = false) => css`
21
21
  .${ClassName.DRAG_SUBMENU} {
22
22
  border-radius: ${"var(--ds-border-radius, 3px)"};
23
23
  background: ${"var(--ds-surface-overlay, white)"};
24
24
  box-shadow: ${`var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`};
25
25
  display: block;
26
26
  position: absolute;
27
- top: ${tableSortColumnDiscoverability ? TABLE_DRAG_MENU_PADDING_TOP + TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0}px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker
27
+ top: ${tableSortColumnReorder ? TABLE_DRAG_MENU_PADDING_TOP + TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0}px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker
28
28
  left: ${dragMenuDropdownWidth}px;
29
29
  padding: ${"var(--ds-space-100, 8px)"};
30
30
 
@@ -65,7 +65,7 @@ const defaultSelectionRect = {
65
65
  right: 0,
66
66
  bottom: 0
67
67
  };
68
- export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired, isTableScalingEnabled = false, tableDuplicateCellColouring = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, tableSortColumnDiscoverability = false) => {
68
+ export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired, isTableScalingEnabled = false, tableDuplicateCellColouring = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, tableSortColumnReorder = false) => {
69
69
  var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
70
70
  const {
71
71
  selection
@@ -227,6 +227,6 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, h
227
227
  keymap: keymap && tooltip(keymap)
228
228
  }))];
229
229
  let allConfigs = [...restConfigs];
230
- tableSortColumnDiscoverability ? allConfigs.unshift(...sortConfigs) : allConfigs.push(...sortConfigs);
230
+ tableSortColumnReorder ? allConfigs.unshift(...sortConfigs) : allConfigs.push(...sortConfigs);
231
231
  return allConfigs.filter(Boolean);
232
232
  };
@@ -170,12 +170,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
170
170
  fullWidthEnabled = _ref5.fullWidthEnabled,
171
171
  tableOptions = _ref5.tableOptions,
172
172
  getEditorFeatureFlags = _ref5.getEditorFeatureFlags,
173
- isTableScalingEnabled = _ref5.isTableScalingEnabled;
173
+ isTableScalingEnabled = _ref5.isTableScalingEnabled,
174
+ isNewColumnResizingEnabled = _ref5.isNewColumnResizingEnabled;
174
175
  var _pluginConfig = pluginConfig(tableOptions),
175
176
  allowColumnResizing = _pluginConfig.allowColumnResizing;
176
177
  return allowColumnResizing ? createFlexiResizingPlugin(dispatch, {
177
178
  lastColumnResizable: !fullWidthEnabled
178
- }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled || false) : undefined;
179
+ }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled) : undefined;
179
180
  }
180
181
  }, {
181
182
  name: 'tableEditing',
@@ -12,7 +12,7 @@ import { META_KEYS } from '../table-analytics';
12
12
  import { evenColumns, setDragging, stopResizing } from './commands';
13
13
  import { getPluginState } from './plugin-factory';
14
14
  import { currentColWidth, getResizeState, getTableMaxWidth, pointsAtCell, resizeColumn, resizeColumnAndTable, updateControls } from './utils';
15
- export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, editorAnalyticsAPI) {
15
+ export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, editorAnalyticsAPI, isNewColumnResizingEnabled) {
16
16
  var state = view.state,
17
17
  dispatch = view.dispatch;
18
18
  var editorDisabled = !view.editable;
@@ -141,7 +141,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
141
141
  _shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
142
142
  }
143
143
  var resizedDelta = clientX - startX;
144
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
144
+ if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
145
145
  var newResizeState = resizeColumnAndTable(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale);
146
146
  tr = updateColumnWidths(newResizeState, table, start)(tr);
147
147
  tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
@@ -218,7 +218,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
218
218
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
219
219
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
220
220
  }
221
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
221
+ if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
222
222
  resizeColumnAndTable(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
223
223
  } else {
224
224
  resizeColumn(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
@@ -9,7 +9,7 @@ import { handleMouseDown } from './event-handlers';
9
9
  import { createPluginState, getPluginState } from './plugin-factory';
10
10
  import { pluginKey } from './plugin-key';
11
11
  import { getResizeCellPos } from './utils';
12
- export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled) {
12
+ export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled) {
13
13
  var _ref$lastColumnResiza = _ref.lastColumnResizable,
14
14
  lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
15
15
  return new SafePlugin({
@@ -49,7 +49,7 @@ export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorF
49
49
  }
50
50
  }
51
51
  if (resizeHandlePos !== null && (!dragging || isColumnKeyboardResizeStarted)) {
52
- if (handleMouseDown(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, editorAnalyticsAPI)) {
52
+ if (handleMouseDown(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, editorAnalyticsAPI, isNewColumnResizingEnabled)) {
53
53
  var _state = view.state,
54
54
  _dispatch = view.dispatch;
55
55
  return setResizeHandlePos(resizeHandlePos)(_state, _dispatch);
@@ -350,12 +350,12 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
350
350
  var items = [];
351
351
  var getEditorFeatureFlags = _this.props.getEditorFeatureFlags;
352
352
  var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
353
- _ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
354
- tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
353
+ _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
354
+ tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
355
355
  var sortColumnItems = _this.createSortColumnItems();
356
356
  var backgroundColorItem = _this.createBackgroundColorItem();
357
357
  var distributeColumnsItem = _this.createDistributeColumnsItem();
358
- tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
358
+ tableSortColumnReorder && sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
359
359
  backgroundColorItem && items.push(backgroundColorItem);
360
360
  items.push(_this.createInsertColumnItem());
361
361
  items.push(_this.createInsertRowItem());
@@ -363,7 +363,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
363
363
  items.push(_this.createDeleteRowItem());
364
364
  items.push.apply(items, _toConsumableArray(_this.createMergeSplitCellItems()));
365
365
  distributeColumnsItem && items.push(distributeColumnsItem);
366
- !tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
366
+ !tableSortColumnReorder && sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
367
367
  items.push(_this.createClearCellsItem());
368
368
  return [{
369
369
  items: items
@@ -89,16 +89,16 @@ var MapDragMenuOptionIdToMessage = {
89
89
  plural: null
90
90
  }
91
91
  };
92
- var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnDiscoverability) {
92
+ var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnReorder) {
93
93
  var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down']];
94
94
  var sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
95
- tableSortColumnDiscoverability ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
95
+ tableSortColumnReorder ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
96
96
  return groupedDragMenuConfig;
97
97
  };
98
98
  var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage) {
99
- var tableSortColumnDiscoverability = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
99
+ var tableSortColumnReorder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
100
100
  var selectionRect = arguments.length > 3 ? arguments[3] : undefined;
101
- var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnDiscoverability);
101
+ var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
102
102
  var menuItemsArr = _toConsumableArray(Array(groupedDragMenuConfig.length)).map(function () {
103
103
  return [];
104
104
  });
@@ -195,7 +195,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
195
195
  tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
196
196
  shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
197
197
  isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
198
- tableSortColumnDiscoverability = _ref.tableSortColumnDiscoverability;
198
+ tableSortColumnReorder = _ref.tableSortColumnReorder;
199
199
  var state = editorView.state,
200
200
  dispatch = editorView.dispatch;
201
201
  var selection = state.selection;
@@ -219,8 +219,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
219
219
  hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
220
220
  }
221
221
  var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
222
- var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnDiscoverability);
223
- var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnDiscoverability, selectionRect),
222
+ var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnReorder);
223
+ var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnReorder, selectionRect),
224
224
  menuItems = _convertToDropdownIte.menuItems,
225
225
  menuCallback = _convertToDropdownIte.menuCallback;
226
226
  var handleSubMenuRef = function handleSubMenuRef(ref) {
@@ -271,7 +271,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
271
271
  className: DropdownMenuSharedCssClassName.SUBMENU
272
272
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
273
273
  ,
274
- css: dragMenuBackgroundColorStyles(tableSortColumnDiscoverability)
274
+ css: dragMenuBackgroundColorStyles(tableSortColumnReorder)
275
275
  }, jsx("div", {
276
276
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
277
277
  css: cellColourPreviewStyles(background)
@@ -469,7 +469,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
469
469
  return null;
470
470
  }
471
471
  if (allowBackgroundColor) {
472
- tableSortColumnDiscoverability ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
472
+ tableSortColumnReorder ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
473
473
  }
474
474
 
475
475
  // If first row, add toggle for Header row, default is true
@@ -35,8 +35,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
35
35
  tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
36
36
  _ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
37
37
  tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC,
38
- _ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
39
- tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
38
+ _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
39
+ tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
40
40
  var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
41
41
  return /*#__PURE__*/React.createElement(Popup, {
42
42
  alignX: direction === 'row' ? 'right' : undefined,
@@ -75,7 +75,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
75
75
  tableDuplicateCellColouring: tableDuplicateCellColouring,
76
76
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
77
77
  isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
78
- tableSortColumnDiscoverability: tableSortColumnDiscoverability
78
+ tableSortColumnReorder: tableSortColumnReorder
79
79
  }));
80
80
  };
81
81
  FloatingDragMenu.displayName = 'FloatingDragMenu';
@@ -22,8 +22,8 @@ export var elementBeforeIconStyles = css({
22
22
 
23
23
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
24
24
  export var dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
25
- var tableSortColumnDiscoverability = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
26
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), ClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), tableSortColumnDiscoverability ? TABLE_DRAG_MENU_PADDING_TOP + TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, dragMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.DRAG_SUBMENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
25
+ var tableSortColumnReorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
26
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), ClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), tableSortColumnReorder ? TABLE_DRAG_MENU_PADDING_TOP + TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, dragMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.DRAG_SUBMENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
27
27
  };
28
28
 
29
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
@@ -74,7 +74,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
74
74
  var tableDuplicateCellColouring = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
75
75
  var isTableFixedColumnWidthsOptionEnabled = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
76
76
  var shouldUseIncreasedScalingPercent = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
77
- var tableSortColumnDiscoverability = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
77
+ var tableSortColumnReorder = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
78
78
  var selection = editorView.state.selection;
79
79
  var addOptions = direction === 'row' ? [{
80
80
  label: 'above',
@@ -244,6 +244,6 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
244
244
  };
245
245
  })));
246
246
  var allConfigs = _toConsumableArray(restConfigs);
247
- tableSortColumnDiscoverability ? allConfigs.unshift.apply(allConfigs, _toConsumableArray(sortConfigs)) : allConfigs.push.apply(allConfigs, _toConsumableArray(sortConfigs));
247
+ tableSortColumnReorder ? allConfigs.unshift.apply(allConfigs, _toConsumableArray(sortConfigs)) : allConfigs.push.apply(allConfigs, _toConsumableArray(sortConfigs));
248
248
  return allConfigs.filter(Boolean);
249
249
  };
@@ -20,6 +20,7 @@ export interface TablePluginOptions {
20
20
  getEditorFeatureFlags?: GetEditorFeatureFlags;
21
21
  isTableScalingEnabled?: boolean;
22
22
  isTableAlignmentEnabled?: boolean;
23
+ isNewColumnResizingEnabled?: boolean;
23
24
  }
24
25
  type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
25
26
  type MediaPlugin = NextEditorPlugin<'media', {
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => boolean;
4
+ export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean) => boolean;
@@ -3,4 +3,4 @@ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { ColumnResizingPluginState } from '../../types';
6
- export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean): SafePlugin<ColumnResizingPluginState>;
6
+ export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean): SafePlugin<ColumnResizingPluginState>;
@@ -28,9 +28,9 @@ type DragMenuProps = {
28
28
  tableDuplicateCellColouring?: boolean;
29
29
  shouldUseIncreasedScalingPercent?: boolean;
30
30
  isTableFixedColumnWidthsOptionEnabled?: boolean;
31
- tableSortColumnDiscoverability?: boolean;
31
+ tableSortColumnReorder?: boolean;
32
32
  };
33
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnDiscoverability, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
33
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
34
34
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
35
35
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
36
36
  };
@@ -1,4 +1,4 @@
1
1
  export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
2
  export declare const elementBeforeIconStyles: import("@emotion/react").SerializedStyles;
3
- export declare const dragMenuBackgroundColorStyles: (tableSortColumnDiscoverability?: boolean) => import("@emotion/react").SerializedStyles;
3
+ export declare const dragMenuBackgroundColorStyles: (tableSortColumnReorder?: boolean) => import("@emotion/react").SerializedStyles;
4
4
  export declare const toggleStyles: import("@emotion/react").SerializedStyles;
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
13
13
  icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
14
  keymap?: string;
15
15
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnDiscoverability?: boolean) => DragMenuConfig[];
16
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean) => DragMenuConfig[];
@@ -20,6 +20,7 @@ export interface TablePluginOptions {
20
20
  getEditorFeatureFlags?: GetEditorFeatureFlags;
21
21
  isTableScalingEnabled?: boolean;
22
22
  isTableAlignmentEnabled?: boolean;
23
+ isNewColumnResizingEnabled?: boolean;
23
24
  }
24
25
  type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
25
26
  type MediaPlugin = NextEditorPlugin<'media', {
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => boolean;
4
+ export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean) => boolean;
@@ -3,4 +3,4 @@ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { ColumnResizingPluginState } from '../../types';
6
- export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean): SafePlugin<ColumnResizingPluginState>;
6
+ export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean): SafePlugin<ColumnResizingPluginState>;
@@ -28,9 +28,9 @@ type DragMenuProps = {
28
28
  tableDuplicateCellColouring?: boolean;
29
29
  shouldUseIncreasedScalingPercent?: boolean;
30
30
  isTableFixedColumnWidthsOptionEnabled?: boolean;
31
- tableSortColumnDiscoverability?: boolean;
31
+ tableSortColumnReorder?: boolean;
32
32
  };
33
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnDiscoverability, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
33
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
34
34
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
35
35
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
36
36
  };
@@ -1,4 +1,4 @@
1
1
  export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
2
  export declare const elementBeforeIconStyles: import("@emotion/react").SerializedStyles;
3
- export declare const dragMenuBackgroundColorStyles: (tableSortColumnDiscoverability?: boolean) => import("@emotion/react").SerializedStyles;
3
+ export declare const dragMenuBackgroundColorStyles: (tableSortColumnReorder?: boolean) => import("@emotion/react").SerializedStyles;
4
4
  export declare const toggleStyles: import("@emotion/react").SerializedStyles;
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
13
13
  icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
14
  keymap?: string;
15
15
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnDiscoverability?: boolean) => DragMenuConfig[];
16
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean) => DragMenuConfig[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.17.2",
3
+ "version": "7.17.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -13,7 +13,10 @@
13
13
  "types": "dist/types/index.d.ts",
14
14
  "typesVersions": {
15
15
  ">=4.5 <4.9": {
16
- "*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
16
+ "*": [
17
+ "dist/types-ts4.5/*",
18
+ "dist/types-ts4.5/index.d.ts"
19
+ ]
17
20
  }
18
21
  },
19
22
  "sideEffects": false,
@@ -28,7 +31,7 @@
28
31
  "@atlaskit/adf-schema": "^36.10.7",
29
32
  "@atlaskit/button": "^17.17.0",
30
33
  "@atlaskit/custom-steps": "^0.2.0",
31
- "@atlaskit/editor-common": "^82.6.0",
34
+ "@atlaskit/editor-common": "^82.8.0",
32
35
  "@atlaskit/editor-palette": "1.6.0",
33
36
  "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
34
37
  "@atlaskit/editor-plugin-analytics": "^1.2.0",
@@ -46,7 +49,7 @@
46
49
  "@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
47
50
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.3.0",
48
51
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
49
- "@atlaskit/primitives": "^7.2.0",
52
+ "@atlaskit/primitives": "^7.3.0",
50
53
  "@atlaskit/theme": "^12.9.0",
51
54
  "@atlaskit/toggle": "^13.1.0",
52
55
  "@atlaskit/tokens": "^1.50.0",
@@ -76,13 +79,21 @@
76
79
  },
77
80
  "techstack": {
78
81
  "@atlassian/frontend": {
79
- "import-structure": ["atlassian-conventions"],
80
- "circular-dependencies": ["file-and-folder-level"]
82
+ "import-structure": [
83
+ "atlassian-conventions"
84
+ ],
85
+ "circular-dependencies": [
86
+ "file-and-folder-level"
87
+ ]
81
88
  },
82
89
  "@repo/internal": {
83
- "design-tokens": ["color"],
90
+ "design-tokens": [
91
+ "color"
92
+ ],
84
93
  "deprecation": "no-deprecated-imports",
85
- "styling": ["emotion"]
94
+ "styling": [
95
+ "emotion"
96
+ ]
86
97
  }
87
98
  },
88
99
  "stricter": {
@@ -118,9 +129,6 @@
118
129
  "platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
119
130
  "type": "boolean"
120
131
  },
121
- "platform.editor.table.colum-resizing-improvements": {
122
- "type": "boolean"
123
- },
124
132
  "platform.editor.table.use-increased-scaling-percent": {
125
133
  "type": "boolean"
126
134
  },
package/src/plugin.tsx CHANGED
@@ -94,6 +94,7 @@ export interface TablePluginOptions {
94
94
  getEditorFeatureFlags?: GetEditorFeatureFlags;
95
95
  isTableScalingEnabled?: boolean;
96
96
  isTableAlignmentEnabled?: boolean;
97
+ isNewColumnResizingEnabled?: boolean;
97
98
  }
98
99
 
99
100
  type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
@@ -296,8 +297,13 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
296
297
  {
297
298
  name: 'tablePMColResizing',
298
299
  plugin: ({ dispatch }) => {
299
- const { fullWidthEnabled, tableOptions, getEditorFeatureFlags, isTableScalingEnabled } =
300
- options || ({} as TablePluginOptions);
300
+ const {
301
+ fullWidthEnabled,
302
+ tableOptions,
303
+ getEditorFeatureFlags,
304
+ isTableScalingEnabled,
305
+ isNewColumnResizingEnabled,
306
+ } = options || ({} as TablePluginOptions);
301
307
  const { allowColumnResizing } = pluginConfig(tableOptions);
302
308
  return allowColumnResizing
303
309
  ? createFlexiResizingPlugin(
@@ -309,6 +315,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
309
315
  getEditorFeatureFlags || defaultGetEditorFeatureFlags,
310
316
  editorAnalyticsAPI,
311
317
  isTableScalingEnabled || false,
318
+ isNewColumnResizingEnabled,
312
319
  )
313
320
  : undefined;
314
321
  },
@@ -41,6 +41,7 @@ export const handleMouseDown = (
41
41
  getEditorFeatureFlags: GetEditorFeatureFlags,
42
42
  isTableScalingEnabled: boolean,
43
43
  editorAnalyticsAPI?: EditorAnalyticsAPI,
44
+ isNewColumnResizingEnabled?: boolean,
44
45
  ): boolean => {
45
46
  const { state, dispatch } = view;
46
47
  const editorDisabled = !view.editable;
@@ -192,10 +193,7 @@ export const handleMouseDown = (
192
193
 
193
194
  const resizedDelta = clientX - startX;
194
195
 
195
- if (
196
- getBooleanFF('platform.editor.table.colum-resizing-improvements') &&
197
- !isTableNested(state, tablePos)
198
- ) {
196
+ if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
199
197
  const newResizeState = resizeColumnAndTable(
200
198
  resizeState,
201
199
  colIndex,
@@ -300,10 +298,7 @@ export const handleMouseDown = (
300
298
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
301
299
  }
302
300
 
303
- if (
304
- getBooleanFF('platform.editor.table.colum-resizing-improvements') &&
305
- !isTableNested(state, tablePos)
306
- ) {
301
+ if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
307
302
  resizeColumnAndTable(
308
303
  resizeState,
309
304
  colIndex,
@@ -23,6 +23,7 @@ export function createPlugin(
23
23
  getEditorFeatureFlags: GetEditorFeatureFlags,
24
24
  editorAnalyticsAPI?: EditorAnalyticsAPI,
25
25
  isTableScalingEnabled?: boolean,
26
+ isNewColumnResizingEnabled?: boolean,
26
27
  ) {
27
28
  return new SafePlugin({
28
29
  key: pluginKey,
@@ -75,6 +76,7 @@ export function createPlugin(
75
76
  getEditorFeatureFlags,
76
77
  isTableScalingEnabled || false,
77
78
  editorAnalyticsAPI,
79
+ isNewColumnResizingEnabled,
78
80
  )
79
81
  ) {
80
82
  const { state, dispatch } = view;
@@ -460,14 +460,12 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
460
460
  private createOriginalContextMenuItems = () => {
461
461
  let items: MenuItem[] = [];
462
462
  const { getEditorFeatureFlags } = this.props;
463
- const { tableSortColumnDiscoverability = false } = getEditorFeatureFlags
464
- ? getEditorFeatureFlags()
465
- : {};
463
+ const { tableSortColumnReorder = false } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
466
464
  const sortColumnItems = this.createSortColumnItems();
467
465
  const backgroundColorItem = this.createBackgroundColorItem();
468
466
  const distributeColumnsItem = this.createDistributeColumnsItem();
469
467
 
470
- tableSortColumnDiscoverability && sortColumnItems && items.push(...sortColumnItems);
468
+ tableSortColumnReorder && sortColumnItems && items.push(...sortColumnItems);
471
469
 
472
470
  backgroundColorItem && items.push(backgroundColorItem);
473
471
 
@@ -483,7 +481,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
483
481
 
484
482
  distributeColumnsItem && items.push(distributeColumnsItem);
485
483
 
486
- !tableSortColumnDiscoverability && sortColumnItems && items.push(...sortColumnItems);
484
+ !tableSortColumnReorder && sortColumnItems && items.push(...sortColumnItems);
487
485
 
488
486
  items.push(this.createClearCellsItem());
489
487
 
@@ -95,7 +95,7 @@ type DragMenuProps = {
95
95
  tableDuplicateCellColouring?: boolean;
96
96
  shouldUseIncreasedScalingPercent?: boolean;
97
97
  isTableFixedColumnWidthsOptionEnabled?: boolean;
98
- tableSortColumnDiscoverability?: boolean;
98
+ tableSortColumnReorder?: boolean;
99
99
  };
100
100
 
101
101
  type PluralOptionType = 'noOfCols' | 'noOfRows' | 'noOfCells' | null;
@@ -163,7 +163,7 @@ const MapDragMenuOptionIdToMessage: Record<DragMenuOptionIdType, MessageType> =
163
163
  },
164
164
  };
165
165
 
166
- const getGroupedDragMenuConfig = (tableSortColumnDiscoverability: boolean) => {
166
+ const getGroupedDragMenuConfig = (tableSortColumnReorder: boolean) => {
167
167
  let groupedDragMenuConfig: DragMenuOptionIdType[][] = [
168
168
  [
169
169
  'add_row_above',
@@ -178,7 +178,7 @@ const getGroupedDragMenuConfig = (tableSortColumnDiscoverability: boolean) => {
178
178
  ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down'],
179
179
  ];
180
180
  const sortColumnItems: DragMenuOptionIdType[] = ['sort_column_asc', 'sort_column_desc'];
181
- tableSortColumnDiscoverability
181
+ tableSortColumnReorder
182
182
  ? groupedDragMenuConfig.unshift(sortColumnItems)
183
183
  : groupedDragMenuConfig.push(sortColumnItems);
184
184
 
@@ -188,10 +188,10 @@ const getGroupedDragMenuConfig = (tableSortColumnDiscoverability: boolean) => {
188
188
  const convertToDropdownItems = (
189
189
  dragMenuConfig: DragMenuConfig[],
190
190
  formatMessage: IntlShape['formatMessage'],
191
- tableSortColumnDiscoverability: boolean = false,
191
+ tableSortColumnReorder: boolean = false,
192
192
  selectionRect?: Rect,
193
193
  ) => {
194
- const groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnDiscoverability);
194
+ const groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
195
195
  let menuItemsArr: MenuItem[][] = [...Array(groupedDragMenuConfig.length)].map(() => []);
196
196
  let menuCallback: { [key: string]: Command } = {};
197
197
  dragMenuConfig.forEach((item) => {
@@ -277,7 +277,7 @@ export const DragMenu = React.memo(
277
277
  tableDuplicateCellColouring,
278
278
  shouldUseIncreasedScalingPercent,
279
279
  isTableFixedColumnWidthsOptionEnabled,
280
- tableSortColumnDiscoverability,
280
+ tableSortColumnReorder,
281
281
  }: DragMenuProps & WrappedComponentProps) => {
282
282
  const { state, dispatch } = editorView;
283
283
  const { selection } = state;
@@ -320,13 +320,13 @@ export const DragMenu = React.memo(
320
320
  tableDuplicateCellColouring,
321
321
  isTableFixedColumnWidthsOptionEnabled,
322
322
  shouldUseIncreasedScalingPercent,
323
- tableSortColumnDiscoverability,
323
+ tableSortColumnReorder,
324
324
  );
325
325
 
326
326
  const { menuItems, menuCallback } = convertToDropdownItems(
327
327
  dragMenuConfig,
328
328
  formatMessage,
329
- tableSortColumnDiscoverability,
329
+ tableSortColumnReorder,
330
330
  selectionRect,
331
331
  );
332
332
 
@@ -386,7 +386,7 @@ export const DragMenu = React.memo(
386
386
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
387
387
  className={DropdownMenuSharedCssClassName.SUBMENU}
388
388
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
389
- css={dragMenuBackgroundColorStyles(tableSortColumnDiscoverability)}
389
+ css={dragMenuBackgroundColorStyles(tableSortColumnReorder)}
390
390
  >
391
391
  <div
392
392
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
@@ -613,7 +613,7 @@ export const DragMenu = React.memo(
613
613
  }
614
614
 
615
615
  if (allowBackgroundColor) {
616
- tableSortColumnDiscoverability
616
+ tableSortColumnReorder
617
617
  ? menuItems[1].items.unshift(createBackgroundColorMenuItem())
618
618
  : menuItems[0].items.unshift(createBackgroundColorMenuItem());
619
619
  }
@@ -73,7 +73,7 @@ const FloatingDragMenu = ({
73
73
  const {
74
74
  tableDuplicateCellColouring = false,
75
75
  tableWithFixedColumnWidthsOption = false,
76
- tableSortColumnDiscoverability = false,
76
+ tableSortColumnReorder = false,
77
77
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
78
78
 
79
79
  const shouldUseIncreasedScalingPercent =
@@ -119,7 +119,7 @@ const FloatingDragMenu = ({
119
119
  tableDuplicateCellColouring={tableDuplicateCellColouring}
120
120
  shouldUseIncreasedScalingPercent={shouldUseIncreasedScalingPercent}
121
121
  isTableFixedColumnWidthsOptionEnabled={tableWithFixedColumnWidthsOption}
122
- tableSortColumnDiscoverability={tableSortColumnDiscoverability}
122
+ tableSortColumnReorder={tableSortColumnReorder}
123
123
  />
124
124
  </Popup>
125
125
  );
@@ -27,16 +27,14 @@ export const elementBeforeIconStyles = css({
27
27
  });
28
28
 
29
29
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
30
- export const dragMenuBackgroundColorStyles = (
31
- tableSortColumnDiscoverability: boolean = false,
32
- ) => css`
30
+ export const dragMenuBackgroundColorStyles = (tableSortColumnReorder: boolean = false) => css`
33
31
  .${ClassName.DRAG_SUBMENU} {
34
32
  border-radius: ${token('border.radius', '3px')};
35
33
  background: ${token('elevation.surface.overlay', 'white')};
36
34
  box-shadow: ${token('elevation.shadow.overlay', `0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`)};
37
35
  display: block;
38
36
  position: absolute;
39
- top: ${tableSortColumnDiscoverability
37
+ top: ${tableSortColumnReorder
40
38
  ? TABLE_DRAG_MENU_PADDING_TOP +
41
39
  TABLE_DRAG_MENU_SORT_GROUP_HEIGHT +
42
40
  TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT
@@ -162,7 +162,7 @@ export const getDragMenuConfig = (
162
162
  tableDuplicateCellColouring = false,
163
163
  isTableFixedColumnWidthsOptionEnabled = false,
164
164
  shouldUseIncreasedScalingPercent = false,
165
- tableSortColumnDiscoverability = false,
165
+ tableSortColumnReorder = false,
166
166
  ): DragMenuConfig[] => {
167
167
  const { selection } = editorView.state;
168
168
  const addOptions =
@@ -394,9 +394,7 @@ export const getDragMenuConfig = (
394
394
  ];
395
395
 
396
396
  let allConfigs = [...restConfigs];
397
- tableSortColumnDiscoverability
398
- ? allConfigs.unshift(...sortConfigs)
399
- : allConfigs.push(...sortConfigs);
397
+ tableSortColumnReorder ? allConfigs.unshift(...sortConfigs) : allConfigs.push(...sortConfigs);
400
398
 
401
399
  return allConfigs.filter(Boolean) as DragMenuConfig[];
402
400
  };