@atlaskit/editor-plugin-table 24.3.14 → 24.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/nodeviews/TableSSRReactContextsProvider.js +23 -0
  3. package/dist/cjs/nodeviews/table-node-views.js +1 -1
  4. package/dist/cjs/nodeviews/table.js +14 -21
  5. package/dist/cjs/pm-plugins/commands/insert.js +10 -1
  6. package/dist/cjs/pm-plugins/main.js +3 -1
  7. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +2 -1
  8. package/dist/cjs/tablePlugin.js +10 -1
  9. package/dist/cjs/ui/TableMenu/cell/getCellMenuComponents.js +153 -1
  10. package/dist/cjs/ui/TableMenu/cell/keys.js +19 -5
  11. package/dist/cjs/ui/TableMenu/column/getColumnMenuComponents.js +166 -1
  12. package/dist/cjs/ui/TableMenu/column/items/AddColumnRightItem.js +2 -2
  13. package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +3 -3
  14. package/dist/cjs/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -2
  15. package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +136 -1
  16. package/dist/cjs/ui/TableMenu/row/items/AddRowBelowItem.js +2 -2
  17. package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +3 -3
  18. package/dist/cjs/ui/TableMenu/shared/getSharedItems.js +141 -1
  19. package/dist/cjs/ui/TableMenu/shared/selection.js +19 -0
  20. package/dist/es2019/nodeviews/TableSSRReactContextsProvider.js +17 -0
  21. package/dist/es2019/nodeviews/table-node-views.js +1 -1
  22. package/dist/es2019/nodeviews/table.js +15 -22
  23. package/dist/es2019/pm-plugins/commands/insert.js +10 -1
  24. package/dist/es2019/pm-plugins/main.js +4 -2
  25. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -1
  26. package/dist/es2019/tablePlugin.js +10 -1
  27. package/dist/es2019/ui/TableMenu/cell/getCellMenuComponents.js +134 -2
  28. package/dist/es2019/ui/TableMenu/cell/keys.js +25 -2
  29. package/dist/es2019/ui/TableMenu/column/getColumnMenuComponents.js +144 -1
  30. package/dist/es2019/ui/TableMenu/column/items/AddColumnRightItem.js +2 -2
  31. package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +3 -3
  32. package/dist/es2019/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -2
  33. package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +118 -1
  34. package/dist/es2019/ui/TableMenu/row/items/AddRowBelowItem.js +2 -2
  35. package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +3 -3
  36. package/dist/es2019/ui/TableMenu/shared/getSharedItems.js +130 -4
  37. package/dist/es2019/ui/TableMenu/shared/selection.js +14 -0
  38. package/dist/esm/nodeviews/TableSSRReactContextsProvider.js +16 -0
  39. package/dist/esm/nodeviews/table-node-views.js +1 -1
  40. package/dist/esm/nodeviews/table.js +15 -22
  41. package/dist/esm/pm-plugins/commands/insert.js +10 -1
  42. package/dist/esm/pm-plugins/main.js +4 -2
  43. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +2 -1
  44. package/dist/esm/tablePlugin.js +10 -1
  45. package/dist/esm/ui/TableMenu/cell/getCellMenuComponents.js +154 -2
  46. package/dist/esm/ui/TableMenu/cell/keys.js +16 -2
  47. package/dist/esm/ui/TableMenu/column/getColumnMenuComponents.js +166 -1
  48. package/dist/esm/ui/TableMenu/column/items/AddColumnRightItem.js +2 -2
  49. package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +3 -3
  50. package/dist/esm/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -2
  51. package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +136 -1
  52. package/dist/esm/ui/TableMenu/row/items/AddRowBelowItem.js +2 -2
  53. package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +3 -3
  54. package/dist/esm/ui/TableMenu/shared/getSharedItems.js +144 -4
  55. package/dist/esm/ui/TableMenu/shared/selection.js +14 -0
  56. package/dist/types/nodeviews/TableSSRReactContextsProvider.d.ts +8 -0
  57. package/dist/types/nodeviews/table-node-views.d.ts +2 -0
  58. package/dist/types/nodeviews/table.d.ts +3 -1
  59. package/dist/types/nodeviews/types.d.ts +2 -0
  60. package/dist/types/tablePluginType.d.ts +3 -2
  61. package/dist/types/ui/TableMenu/cell/keys.d.ts +2 -0
  62. package/dist/types/ui/TableMenu/column/getColumnMenuComponents.d.ts +1 -1
  63. package/dist/types/ui/TableMenu/shared/selection.d.ts +8 -0
  64. package/package.json +9 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 24.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`af0307ac8c91b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af0307ac8c91b) -
8
+ Fix nested tables rendering as non-nested during SSR streaming (guarded by isSSRStreaming; no
9
+ change to CSR)
10
+
11
+ ### Patch Changes
12
+
13
+ - [`5fa08ff6d295a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5fa08ff6d295a) -
14
+ Re-add missing cell menu items behind the `platform_editor_table_cell_menu_update`.
15
+ - [`075b6ae004392`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/075b6ae004392) -
16
+ [ux] fix toolbar table insertion for markdown syntax mode
17
+ - [`e162cd8ab6b15`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e162cd8ab6b15) -
18
+ Fix malformed nested-table column width in SSR output: the min-width branch emitted `width: 48px)`
19
+ (stray parenthesis) instead of a valid `width: 48px`.
20
+ - Updated dependencies
21
+
3
22
  ## 24.3.14
4
23
 
5
24
  ### Patch Changes
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.TableSSRReactContextsProvider = TableSSRReactContextsProvider;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactIntl = require("react-intl");
10
+ var _coreUtils = require("@atlaskit/editor-common/core-utils");
11
+ function TableSSRReactContextsProvider(_ref) {
12
+ var children = _ref.children,
13
+ intl = _ref.intl;
14
+ if (!(0, _coreUtils.isSSR)() || !(0, _coreUtils.isSSRStreaming)()) {
15
+ return children;
16
+ }
17
+ if (!intl) {
18
+ return children;
19
+ }
20
+ return /*#__PURE__*/_react.default.createElement(_reactIntl.RawIntlProvider, {
21
+ value: intl
22
+ }, children);
23
+ }
@@ -15,7 +15,7 @@ var _TableRowNativeStickyWithFallback = _interopRequireDefault(require("./TableR
15
15
 
16
16
  var tableView = exports.tableView = function tableView(options) {
17
17
  return function (node, view, getPos) {
18
- return (0, _table.createTableView)(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
18
+ return (0, _table.createTableView)(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption, options.intl);
19
19
  };
20
20
  };
21
21
  var tableCellView = exports.tableCellView = function tableCellView(options) {
@@ -31,6 +31,7 @@ var _nodes = require("../pm-plugins/utils/nodes");
31
31
  var _isContentModeSupported = require("../pm-plugins/utils/tableMode/is-content-mode-supported");
32
32
  var _roundedTableEdges = require("./rounded-table-edges");
33
33
  var _TableComponentWithSharedState = require("./TableComponentWithSharedState");
34
+ var _TableSSRReactContextsProvider = require("./TableSSRReactContextsProvider");
34
35
  var _toDOM = require("./toDOM");
35
36
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
36
37
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -81,6 +82,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
81
82
  _this.eventDispatcher = props.eventDispatcher;
82
83
  _this.options = props.options;
83
84
  _this.getEditorFeatureFlags = props.getEditorFeatureFlags;
85
+ _this.intl = props.intl;
84
86
  if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true)) {
85
87
  _this.roundedTableEdges = new _roundedTableEdges.RoundedTableEdges(function () {
86
88
  return _this.table;
@@ -168,7 +170,11 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
168
170
  }
169
171
 
170
172
  // Remove the ProseMirror table DOM structure to avoid duplication, as it's replaced with the React table node.
171
- if (this.dom && this.renderedDOM) {
173
+ // In SSR streaming the portal renders via `container.innerHTML = html` (portal/common.tsx), which detaches
174
+ // `renderedDOM` from `dom` before this runs; require it to still be a child so `removeChild` doesn't throw
175
+ // `NotFoundError` (which would make EditorSSRRenderer fall back to the position-blind schema toDOM and lose
176
+ // nested detection). CSR keeps the original condition unchanged.
177
+ if (this.dom && this.renderedDOM && (!(0, _coreUtils.isSSRStreaming)() || this.renderedDOM.parentNode === this.dom)) {
172
178
  this.dom.removeChild(this.renderedDOM);
173
179
  }
174
180
  // Move the table from the ProseMirror table structure into the React rendered table node.
@@ -272,7 +278,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
272
278
  }, {
273
279
  key: "render",
274
280
  value: function render(props, forwardRef) {
275
- return /*#__PURE__*/_react.default.createElement(_TableComponentWithSharedState.TableComponentWithSharedState, {
281
+ return /*#__PURE__*/_react.default.createElement(_TableSSRReactContextsProvider.TableSSRReactContextsProvider, {
282
+ intl: this.intl
283
+ }, /*#__PURE__*/_react.default.createElement(_TableComponentWithSharedState.TableComponentWithSharedState, {
276
284
  forwardRef: forwardRef,
277
285
  getNode: this.getNode,
278
286
  view: props.view,
@@ -287,7 +295,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
287
295
  getEditorFeatureFlags: props.getEditorFeatureFlags,
288
296
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
289
297
  allowFixedColumnWidthOption: props.allowFixedColumnWidthOption
290
- });
298
+ }));
291
299
  }
292
300
  }, {
293
301
  key: "viewShouldUpdate",
@@ -358,7 +366,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
358
366
  }
359
367
  }]);
360
368
  }(_reactNodeView.default);
361
- var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
369
+ var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption, intl) {
362
370
  var _pluginInjectionApi$t;
363
371
  var _getPluginState2 = (0, _pluginFactory.getPluginState)(view.state),
364
372
  pluginConfig = _getPluginState2.pluginConfig,
@@ -373,22 +381,6 @@ var createTableView = exports.createTableView = function createTableView(node, v
373
381
  allowTableAlignment = _getPluginConfig.allowTableAlignment;
374
382
  var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? allowFixedColumnWidthOption : getEditorFeatureFlags === null || getEditorFeatureFlags === void 0 ? void 0 : getEditorFeatureFlags().tableWithFixedColumnWidthsOption) || false;
375
383
  var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (isTableFixedColumnWidthsOptionEnabled || isCommentEditor);
376
-
377
- // In SSR use native ProseMirror spec-based render for table nodes
378
- if ((0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)()) {
379
- var isNested = (0, _nodes.isTableNested)(view.state, typeof getPos === 'function' ? getPos() : undefined);
380
- var tableDOMStructure = (0, _toDOM.tableNodeSpecWithFixedToDOM)({
381
- allowColumnResizing: allowColumnResizing !== null && allowColumnResizing !== void 0 ? allowColumnResizing : false,
382
- tableResizingEnabled: allowTableResizing !== null && allowTableResizing !== void 0 ? allowTableResizing : false,
383
- getEditorContainerWidth: getEditorContainerWidth,
384
- isTableScalingEnabled: isTableScalingEnabled,
385
- shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
386
- isCommentEditor: isCommentEditor,
387
- isChromelessEditor: isChromelessEditor,
388
- isNested: isNested
389
- }).toDOM(node);
390
- return _model.DOMSerializer.renderSpec(document, tableDOMStructure);
391
- }
392
384
  return new TableView({
393
385
  node: node,
394
386
  view: view,
@@ -412,6 +404,7 @@ var createTableView = exports.createTableView = function createTableView(node, v
412
404
  getEditorFeatureFlags: getEditorFeatureFlags,
413
405
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
414
406
  pluginInjectionApi: pluginInjectionApi,
415
- allowFixedColumnWidthOption: allowFixedColumnWidthOption
407
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
408
+ intl: intl
416
409
  }).init();
417
410
  };
@@ -15,7 +15,9 @@ var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _utils = require("@atlaskit/editor-prosemirror/utils");
16
16
  var _tableMap = require("@atlaskit/editor-tables/table-map");
17
17
  var _utils2 = require("@atlaskit/editor-tables/utils");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
19
21
  var _commands = require("../analytics/commands");
20
22
  var _tableAnalytics = require("../table-analytics");
21
23
  var _columnWidth = require("../transforms/column-width");
@@ -272,8 +274,15 @@ var insertTableWithNestingSupport = exports.insertTableWithNestingSupport = func
272
274
  _ref2$createTableProp = _ref2.createTableProps,
273
275
  createTableProps = _ref2$createTableProp === void 0 ? {} : _ref2$createTableProp;
274
276
  return function (_ref3) {
275
- var _api$contentInsertion, _tr$selection$$from$n2;
277
+ var _api$markdownMode, _api$contentInsertion, _tr$selection$$from$n2;
276
278
  var tr = _ref3.tr;
279
+ // Delegate to the markdown plugin to insert a markdown table string at the CM cursor position.
280
+ var markdownState = api === null || api === void 0 || (_api$markdownMode = api.markdownMode) === null || _api$markdownMode === void 0 ? void 0 : _api$markdownMode.sharedState.currentState();
281
+ if (markdownState !== null && markdownState !== void 0 && markdownState.isMarkdownMode && (markdownState === null || markdownState === void 0 ? void 0 : markdownState.view) === 'syntax' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-markdown-mode', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_markdown_compatible_toolbar')) {
282
+ var _api$markdownMode2;
283
+ api === null || api === void 0 || (_api$markdownMode2 = api.markdownMode) === null || _api$markdownMode2 === void 0 || _api$markdownMode2.actions.insertSourceTable(createTableProps.rowsCount, createTableProps.colsCount);
284
+ return tr;
285
+ }
277
286
  var schema = tr.doc.type.schema;
278
287
 
279
288
  // If the cursor is inside a table
@@ -69,6 +69,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
69
69
  }
70
70
  return editorView.state;
71
71
  };
72
+ var intl = (0, _coreUtils.isSSRStreaming)() ? getIntl() : undefined;
72
73
  var getNodeView = function getNodeView() {
73
74
  return {
74
75
  table: (0, _tableNodeViews.tableView)({
@@ -80,7 +81,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
80
81
  pluginInjectionApi: pluginInjectionApi,
81
82
  isCommentEditor: isCommentEditor,
82
83
  isChromelessEditor: isChromelessEditor,
83
- allowFixedColumnWidthOption: allowFixedColumnWidthOption
84
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
85
+ intl: intl
84
86
  }),
85
87
  tableRow: (0, _tableNodeViews.tableRowView)({
86
88
  eventDispatcher: eventDispatcher,
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.isMinCellWidthTable = exports.insertColgroupFromNode = exports.hasTableColumnBeenResized = exports.hasTableBeenResized = exports.getResizerMinWidth = exports.getColgroupChildrenLength = exports.getColWidthFix = exports.generateColgroupFromNode = exports.generateColgroup = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _coreUtils = require("@atlaskit/editor-common/core-utils");
9
10
  var _styles = require("@atlaskit/editor-common/styles");
10
11
  var _utils = require("@atlaskit/editor-common/utils");
11
12
  var _model = require("@atlaskit/editor-prosemirror/model");
@@ -32,7 +33,7 @@ var generateColStyle = function generateColStyle(fixedColWidth, tableWidth, isCo
32
33
  if (hasTableBeenResized) {
33
34
  return "width: max(".concat(fixedColWidth, "px, ").concat(_styles.tableCellMinWidth, "px)");
34
35
  }
35
- return "width: ".concat(_styles.tableCellMinWidth, "px)");
36
+ return (0, _coreUtils.isSSRStreaming)() ? "width: ".concat(_styles.tableCellMinWidth, "px") : "width: ".concat(_styles.tableCellMinWidth, "px)");
36
37
  }
37
38
  if (isFullPageEditor || !isFullPageEditor && isTableHasWidth) {
38
39
  var scaledPercent = isNumberColumnEnabled ? "calc(calc(var(--ak-editor-table-width) - ".concat(_editorSharedStyles.akEditorTableNumberColumnWidth, "px - 1px)/").concat(tableWidth, ")") : "calc(calc(var(--ak-editor-table-width) - 1px)/".concat(tableWidth, ")");
@@ -22,6 +22,7 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
22
22
  var _pmPlugins = require("@atlaskit/editor-tables/pm-plugins");
23
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
24
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
25
26
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
26
27
  var _toDOM = require("./nodeviews/toDOM");
27
28
  var _plugin = require("./pm-plugins/active-cell-highlight/plugin");
@@ -563,7 +564,7 @@ var tablePlugin = function tablePlugin(_ref) {
563
564
  return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
564
565
  },
565
566
  action: function action(insert, state) {
566
- var _api$table, _options$tableOptions6, _tr$selection$$from$n;
567
+ var _api$markdownMode, _api$table, _options$tableOptions6, _tr$selection$$from$n;
567
568
  if (isTableSelectorEnabled) {
568
569
  var _tr = insert('');
569
570
  _tr.setMeta(_tableSizeSelector.pluginKey, {
@@ -572,6 +573,14 @@ var tablePlugin = function tablePlugin(_ref) {
572
573
  return _tr;
573
574
  }
574
575
 
576
+ // Delegate to the markdown plugin to insert a markdown table string at the CM cursor position.
577
+ var markdownState = api === null || api === void 0 || (_api$markdownMode = api.markdownMode) === null || _api$markdownMode === void 0 ? void 0 : _api$markdownMode.sharedState.currentState();
578
+ if (markdownState !== null && markdownState !== void 0 && markdownState.isMarkdownMode && (markdownState === null || markdownState === void 0 ? void 0 : markdownState.view) === 'syntax' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-markdown-mode', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_markdown_compatible_toolbar')) {
579
+ var _api$markdownMode2;
580
+ api === null || api === void 0 || (_api$markdownMode2 = api.markdownMode) === null || _api$markdownMode2 === void 0 || _api$markdownMode2.actions.insertSourceTable();
581
+ return state.tr;
582
+ }
583
+
575
584
  // see comment on tablesPlugin.getSharedState on usage
576
585
  var tableState = api === null || api === void 0 || (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
577
586
  var tableNodeProps = {
@@ -11,6 +11,7 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
11
11
  var _alignPositionBottom = _interopRequireDefault(require("@atlaskit/icon-lab/core/align-position-bottom"));
12
12
  var _alignPositionCenterVertical = _interopRequireDefault(require("@atlaskit/icon-lab/core/align-position-center-vertical"));
13
13
  var _alignPositionTop = _interopRequireDefault(require("@atlaskit/icon-lab/core/align-position-top"));
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _MergeCellsItem = require("./items/MergeCellsItem");
15
16
  var _SplitCellItem = require("./items/SplitCellItem");
16
17
  var _VerticalAlignDropdownItem = require("./items/VerticalAlignDropdownItem");
@@ -18,7 +19,158 @@ var _VerticalAlignNestedMenu = require("./items/VerticalAlignNestedMenu");
18
19
  var _keys = require("./keys");
19
20
  var getCellMenuComponents = exports.getCellMenuComponents = function getCellMenuComponents(_ref) {
20
21
  var api = _ref.api;
21
- return [
22
+ return (0, _platformFeatureFlags.fg)('platform_editor_table_cell_menu_update') ? [
23
+ // --- Cell menu update ON ---
24
+ // Merge/Split cells move into the Add section (alongside the shared add/distribute
25
+ // items); the danger section gains the shared Delete column/row items.
26
+
27
+ // --- Menu surface ---
28
+ {
29
+ type: _keys.CELL_MENU.type,
30
+ key: _keys.CELL_MENU.key
31
+ },
32
+ // --- Main action section (Background color, Vertical align) ---
33
+ {
34
+ type: _keys.CELL_ACTION_SECTION.type,
35
+ key: _keys.CELL_ACTION_SECTION.key,
36
+ parents: [{
37
+ type: _keys.CELL_MENU.type,
38
+ key: _keys.CELL_MENU.key,
39
+ rank: _keys.CELL_MENU_RANK[_keys.CELL_ACTION_SECTION.key]
40
+ }],
41
+ component: function component(props) {
42
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, null, props.children);
43
+ }
44
+ }, {
45
+ type: _keys.VERTICAL_ALIGN_MENU.type,
46
+ key: _keys.VERTICAL_ALIGN_MENU.key,
47
+ parents: [{
48
+ type: _keys.CELL_ACTION_SECTION.type,
49
+ key: _keys.CELL_ACTION_SECTION.key,
50
+ rank: _keys.CELL_ACTION_SECTION_RANK[_keys.VERTICAL_ALIGN_MENU.key]
51
+ }],
52
+ component: function component(props) {
53
+ return /*#__PURE__*/_react.default.createElement(_VerticalAlignNestedMenu.VerticalAlignNestedMenu, null, props.children);
54
+ }
55
+ }, {
56
+ type: _keys.VERTICAL_ALIGN_MENU_SECTION.type,
57
+ key: _keys.VERTICAL_ALIGN_MENU_SECTION.key,
58
+ parents: [{
59
+ type: _keys.VERTICAL_ALIGN_MENU.type,
60
+ key: _keys.VERTICAL_ALIGN_MENU.key,
61
+ rank: _keys.VERTICAL_ALIGN_MENU_RANK[_keys.VERTICAL_ALIGN_MENU_SECTION.key]
62
+ }],
63
+ component: function component(props) {
64
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, null, props.children);
65
+ }
66
+ }, {
67
+ type: _keys.VERTICAL_ALIGN_TOP_ITEM.type,
68
+ key: _keys.VERTICAL_ALIGN_TOP_ITEM.key,
69
+ parents: [{
70
+ type: _keys.VERTICAL_ALIGN_MENU_SECTION.type,
71
+ key: _keys.VERTICAL_ALIGN_MENU_SECTION.key,
72
+ rank: _keys.VERTICAL_ALIGN_MENU_SECTION_RANK[_keys.VERTICAL_ALIGN_TOP_ITEM.key]
73
+ }],
74
+ component: function component() {
75
+ return /*#__PURE__*/_react.default.createElement(_VerticalAlignDropdownItem.VerticalAlignDropdownItem, {
76
+ api: api,
77
+ icon: _alignPositionTop.default,
78
+ label: _messages.tableMessages.cellAlignmentTop,
79
+ value: "top"
80
+ });
81
+ }
82
+ }, {
83
+ type: _keys.VERTICAL_ALIGN_MIDDLE_ITEM.type,
84
+ key: _keys.VERTICAL_ALIGN_MIDDLE_ITEM.key,
85
+ parents: [{
86
+ type: _keys.VERTICAL_ALIGN_MENU_SECTION.type,
87
+ key: _keys.VERTICAL_ALIGN_MENU_SECTION.key,
88
+ rank: _keys.VERTICAL_ALIGN_MENU_SECTION_RANK[_keys.VERTICAL_ALIGN_MIDDLE_ITEM.key]
89
+ }],
90
+ component: function component() {
91
+ return /*#__PURE__*/_react.default.createElement(_VerticalAlignDropdownItem.VerticalAlignDropdownItem, {
92
+ api: api,
93
+ icon: _alignPositionCenterVertical.default,
94
+ label: _messages.tableMessages.cellAlignmentMiddle,
95
+ value: "middle"
96
+ });
97
+ }
98
+ }, {
99
+ type: _keys.VERTICAL_ALIGN_BOTTOM_ITEM.type,
100
+ key: _keys.VERTICAL_ALIGN_BOTTOM_ITEM.key,
101
+ parents: [{
102
+ type: _keys.VERTICAL_ALIGN_MENU_SECTION.type,
103
+ key: _keys.VERTICAL_ALIGN_MENU_SECTION.key,
104
+ rank: _keys.VERTICAL_ALIGN_MENU_SECTION_RANK[_keys.VERTICAL_ALIGN_BOTTOM_ITEM.key]
105
+ }],
106
+ component: function component() {
107
+ return /*#__PURE__*/_react.default.createElement(_VerticalAlignDropdownItem.VerticalAlignDropdownItem, {
108
+ api: api,
109
+ icon: _alignPositionBottom.default,
110
+ label: _messages.tableMessages.cellAlignmentBottom,
111
+ value: "bottom"
112
+ });
113
+ }
114
+ },
115
+ // --- Add / Move section (shared Add column right / Add row below / Distribute
116
+ // columns are registered in `../shared/getSharedItems`; Merge/Split cells below) ---
117
+ {
118
+ type: _keys.CELL_ADD_SECTION.type,
119
+ key: _keys.CELL_ADD_SECTION.key,
120
+ parents: [{
121
+ type: _keys.CELL_MENU.type,
122
+ key: _keys.CELL_MENU.key,
123
+ rank: _keys.CELL_MENU_RANK[_keys.CELL_ADD_SECTION.key]
124
+ }],
125
+ component: function component(props) {
126
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
127
+ hasSeparator: true
128
+ }, props.children);
129
+ }
130
+ }, {
131
+ type: _keys.MERGE_CELLS_ITEM.type,
132
+ key: _keys.MERGE_CELLS_ITEM.key,
133
+ parents: [{
134
+ type: _keys.CELL_ADD_SECTION.type,
135
+ key: _keys.CELL_ADD_SECTION.key,
136
+ rank: _keys.CELL_ADD_SECTION_RANK[_keys.MERGE_CELLS_ITEM.key]
137
+ }],
138
+ component: function component() {
139
+ return /*#__PURE__*/_react.default.createElement(_MergeCellsItem.MergeCellsItem, {
140
+ api: api
141
+ });
142
+ }
143
+ }, {
144
+ type: _keys.SPLIT_CELL_ITEM.type,
145
+ key: _keys.SPLIT_CELL_ITEM.key,
146
+ parents: [{
147
+ type: _keys.CELL_ADD_SECTION.type,
148
+ key: _keys.CELL_ADD_SECTION.key,
149
+ rank: _keys.CELL_ADD_SECTION_RANK[_keys.SPLIT_CELL_ITEM.key]
150
+ }],
151
+ component: function component() {
152
+ return /*#__PURE__*/_react.default.createElement(_SplitCellItem.SplitCellItem, {
153
+ api: api
154
+ });
155
+ }
156
+ },
157
+ // --- Danger section (Clear cell + shared Delete column / Delete row) ---
158
+ {
159
+ type: _keys.CELL_DANGER_SECTION.type,
160
+ key: _keys.CELL_DANGER_SECTION.key,
161
+ parents: [{
162
+ type: _keys.CELL_MENU.type,
163
+ key: _keys.CELL_MENU.key,
164
+ rank: _keys.CELL_MENU_RANK[_keys.CELL_DANGER_SECTION.key]
165
+ }],
166
+ component: function component(props) {
167
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
168
+ hasSeparator: true
169
+ }, props.children);
170
+ }
171
+ }] : [
172
+ // --- Cell menu update OFF: legacy cell menu (Merge/Split live in the action section) ---
173
+
22
174
  // --- Menu surface ---
23
175
  {
24
176
  type: _keys.CELL_MENU.type,
@@ -4,9 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.VERTICAL_ALIGN_TOP_ITEM = exports.VERTICAL_ALIGN_MIDDLE_ITEM = exports.VERTICAL_ALIGN_MENU_SECTION_RANK = exports.VERTICAL_ALIGN_MENU_SECTION = exports.VERTICAL_ALIGN_MENU_RANK = exports.VERTICAL_ALIGN_MENU = exports.VERTICAL_ALIGN_BOTTOM_ITEM = exports.SPLIT_CELL_ITEM = exports.MERGE_CELLS_ITEM = exports.CELL_MENU_RANK = exports.CELL_MENU = exports.CELL_DANGER_SECTION_RANK = exports.CELL_DANGER_SECTION = exports.CELL_ACTION_SECTION_RANK = exports.CELL_ACTION_SECTION = void 0;
7
+ exports.VERTICAL_ALIGN_TOP_ITEM = exports.VERTICAL_ALIGN_MIDDLE_ITEM = exports.VERTICAL_ALIGN_MENU_SECTION_RANK = exports.VERTICAL_ALIGN_MENU_SECTION = exports.VERTICAL_ALIGN_MENU_RANK = exports.VERTICAL_ALIGN_MENU = exports.VERTICAL_ALIGN_BOTTOM_ITEM = exports.SPLIT_CELL_ITEM = exports.MERGE_CELLS_ITEM = exports.CELL_MENU_RANK = exports.CELL_MENU = exports.CELL_DANGER_SECTION_RANK = exports.CELL_DANGER_SECTION = exports.CELL_ADD_SECTION_RANK = exports.CELL_ADD_SECTION = exports.CELL_ACTION_SECTION_RANK = exports.CELL_ACTION_SECTION = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _keys = require("../shared/keys");
9
+ var _keys = require("../column/keys");
10
+ var _keys2 = require("../row/keys");
11
+ var _keys3 = require("../shared/keys");
10
12
  // --- Menu surface ---
11
13
 
12
14
  var CELL_MENU = exports.CELL_MENU = {
@@ -20,11 +22,15 @@ var CELL_ACTION_SECTION = exports.CELL_ACTION_SECTION = {
20
22
  type: 'menu-section',
21
23
  key: 'cell-action-section'
22
24
  };
25
+ var CELL_ADD_SECTION = exports.CELL_ADD_SECTION = {
26
+ type: 'menu-section',
27
+ key: 'cell-add-section'
28
+ };
23
29
  var CELL_DANGER_SECTION = exports.CELL_DANGER_SECTION = {
24
30
  type: 'menu-section',
25
31
  key: 'cell-danger-section'
26
32
  };
27
- var CELL_MENU_RANK = exports.CELL_MENU_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, CELL_ACTION_SECTION.key, 100), CELL_DANGER_SECTION.key, 200);
33
+ var CELL_MENU_RANK = exports.CELL_MENU_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, CELL_ACTION_SECTION.key, 100), CELL_ADD_SECTION.key, 200), CELL_DANGER_SECTION.key, 300);
28
34
  var MERGE_CELLS_ITEM = exports.MERGE_CELLS_ITEM = {
29
35
  type: 'menu-item',
30
36
  key: 'merge-cells'
@@ -55,8 +61,16 @@ var VERTICAL_ALIGN_BOTTOM_ITEM = exports.VERTICAL_ALIGN_BOTTOM_ITEM = {
55
61
  };
56
62
 
57
63
  // --- Item ranks within their sections ---
64
+ //
65
+ // The add/delete items rendered in the cell menu are shared with the row/column
66
+ // menus (registered once in `../shared/getSharedItems` with multiple parents), so
67
+ // we reuse their existing keys here rather than declaring cell-specific ones.
58
68
 
59
- var CELL_ACTION_SECTION_RANK = exports.CELL_ACTION_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.BACKGROUND_COLOR_ITEM.key, 100), VERTICAL_ALIGN_MENU.key, 200), MERGE_CELLS_ITEM.key, 300), SPLIT_CELL_ITEM.key, 400);
69
+ var CELL_ACTION_SECTION_RANK = exports.CELL_ACTION_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys3.BACKGROUND_COLOR_ITEM.key, 100), VERTICAL_ALIGN_MENU.key, 200), MERGE_CELLS_ITEM.key, 300), SPLIT_CELL_ITEM.key, 400);
60
70
  var VERTICAL_ALIGN_MENU_RANK = exports.VERTICAL_ALIGN_MENU_RANK = (0, _defineProperty2.default)({}, VERTICAL_ALIGN_MENU_SECTION.key, 100);
61
71
  var VERTICAL_ALIGN_MENU_SECTION_RANK = exports.VERTICAL_ALIGN_MENU_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, VERTICAL_ALIGN_TOP_ITEM.key, 100), VERTICAL_ALIGN_MIDDLE_ITEM.key, 200), VERTICAL_ALIGN_BOTTOM_ITEM.key, 300);
62
- var CELL_DANGER_SECTION_RANK = exports.CELL_DANGER_SECTION_RANK = (0, _defineProperty2.default)({}, _keys.CLEAR_CELLS_ITEM.key, 100);
72
+
73
+ // Merge/Split cells are relocated from the action section into the add section when the
74
+ // cell menu update gate is on; they sit at the top of the section.
75
+ var CELL_ADD_SECTION_RANK = exports.CELL_ADD_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, MERGE_CELLS_ITEM.key, 100), SPLIT_CELL_ITEM.key, 200), _keys.ADD_COLUMN_RIGHT_ITEM.key, 300), _keys2.ADD_ROW_BELOW_ITEM.key, 400), _keys.DISTRIBUTE_COLUMNS_ITEM.key, 500);
76
+ var CELL_DANGER_SECTION_RANK = exports.CELL_DANGER_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys3.CLEAR_CELLS_ITEM.key, 100), _keys.DELETE_COLUMN_ITEM.key, 200), _keys2.DELETE_ROW_ITEM.key, 300);
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getColumnMenuComponents = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _editorToolbar = require("@atlaskit/editor-toolbar");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var _AddColumnLeftItem = require("./items/AddColumnLeftItem");
11
12
  var _AddColumnRightItem = require("./items/AddColumnRightItem");
12
13
  var _ColumnBackgroundSection = require("./items/ColumnBackgroundSection");
@@ -21,7 +22,171 @@ var _SortIncreasingItem = require("./items/SortIncreasingItem");
21
22
  var _keys = require("./keys");
22
23
  var getColumnMenuComponents = exports.getColumnMenuComponents = function getColumnMenuComponents(_ref) {
23
24
  var api = _ref.api;
24
- return [
25
+ return (0, _platformFeatureFlags.fg)('platform_editor_table_cell_menu_update') ? [
26
+ // --- Cell menu update ON ---
27
+ // AddColumnRightItem/DistributeColumnsItem/DeleteColumnItem are registered in
28
+ // `../shared/getSharedItems` (shared with the cell menu), so they are omitted here.
29
+
30
+ // --- Menu surface ---
31
+ {
32
+ type: _keys.COLUMN_MENU.type,
33
+ key: _keys.COLUMN_MENU.key
34
+ },
35
+ // --- Toggle section (Header column) ---
36
+ {
37
+ type: _keys.COLUMN_TOGGLE_SECTION.type,
38
+ key: _keys.COLUMN_TOGGLE_SECTION.key,
39
+ parents: [{
40
+ type: _keys.COLUMN_MENU.type,
41
+ key: _keys.COLUMN_MENU.key,
42
+ rank: _keys.COLUMN_SECTION_RANK[_keys.COLUMN_TOGGLE_SECTION.key]
43
+ }],
44
+ component: function component(props) {
45
+ return /*#__PURE__*/_react.default.createElement(_ColumnToggleSection.ColumnToggleSection, {
46
+ api: api
47
+ }, props.children);
48
+ }
49
+ }, {
50
+ type: _keys.HEADER_COLUMN_TOGGLE_ITEM.type,
51
+ key: _keys.HEADER_COLUMN_TOGGLE_ITEM.key,
52
+ parents: [{
53
+ type: _keys.COLUMN_TOGGLE_SECTION.type,
54
+ key: _keys.COLUMN_TOGGLE_SECTION.key,
55
+ rank: _keys.COLUMN_TOGGLE_SECTION_RANK[_keys.HEADER_COLUMN_TOGGLE_ITEM.key]
56
+ }],
57
+ component: function component() {
58
+ return /*#__PURE__*/_react.default.createElement(_HeaderColumnToggleItem.HeaderColumnToggleItem, {
59
+ api: api
60
+ });
61
+ }
62
+ },
63
+ // --- Background color section ---
64
+ {
65
+ type: _keys.COLUMN_BACKGROUND_SECTION.type,
66
+ key: _keys.COLUMN_BACKGROUND_SECTION.key,
67
+ parents: [{
68
+ type: _keys.COLUMN_MENU.type,
69
+ key: _keys.COLUMN_MENU.key,
70
+ rank: _keys.COLUMN_SECTION_RANK[_keys.COLUMN_BACKGROUND_SECTION.key]
71
+ }],
72
+ component: function component(props) {
73
+ return /*#__PURE__*/_react.default.createElement(_ColumnBackgroundSection.ColumnBackgroundSection, {
74
+ api: api
75
+ }, props.children);
76
+ }
77
+ },
78
+ // --- Sort section ---
79
+ {
80
+ type: _keys.COLUMN_SORT_SECTION.type,
81
+ key: _keys.COLUMN_SORT_SECTION.key,
82
+ parents: [{
83
+ type: _keys.COLUMN_MENU.type,
84
+ key: _keys.COLUMN_MENU.key,
85
+ rank: _keys.COLUMN_SECTION_RANK[_keys.COLUMN_SORT_SECTION.key]
86
+ }],
87
+ component: function component(props) {
88
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
89
+ hasSeparator: true
90
+ }, props.children);
91
+ }
92
+ }, {
93
+ type: _keys.SORT_INCREASING_ITEM.type,
94
+ key: _keys.SORT_INCREASING_ITEM.key,
95
+ parents: [{
96
+ type: _keys.COLUMN_SORT_SECTION.type,
97
+ key: _keys.COLUMN_SORT_SECTION.key,
98
+ rank: _keys.COLUMN_SORT_SECTION_RANK[_keys.SORT_INCREASING_ITEM.key]
99
+ }],
100
+ component: function component() {
101
+ return /*#__PURE__*/_react.default.createElement(_SortIncreasingItem.SortIncreasingItem, {
102
+ api: api
103
+ });
104
+ }
105
+ }, {
106
+ type: _keys.SORT_DECREASING_ITEM.type,
107
+ key: _keys.SORT_DECREASING_ITEM.key,
108
+ parents: [{
109
+ type: _keys.COLUMN_SORT_SECTION.type,
110
+ key: _keys.COLUMN_SORT_SECTION.key,
111
+ rank: _keys.COLUMN_SORT_SECTION_RANK[_keys.SORT_DECREASING_ITEM.key]
112
+ }],
113
+ component: function component() {
114
+ return /*#__PURE__*/_react.default.createElement(_SortDecreasingItem.SortDecreasingItem, {
115
+ api: api
116
+ });
117
+ }
118
+ },
119
+ // --- Add / Move section ---
120
+ {
121
+ type: _keys.COLUMN_ADD_SECTION.type,
122
+ key: _keys.COLUMN_ADD_SECTION.key,
123
+ parents: [{
124
+ type: _keys.COLUMN_MENU.type,
125
+ key: _keys.COLUMN_MENU.key,
126
+ rank: _keys.COLUMN_SECTION_RANK[_keys.COLUMN_ADD_SECTION.key]
127
+ }],
128
+ component: function component(props) {
129
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
130
+ hasSeparator: true
131
+ }, props.children);
132
+ }
133
+ }, {
134
+ type: _keys.ADD_COLUMN_LEFT_ITEM.type,
135
+ key: _keys.ADD_COLUMN_LEFT_ITEM.key,
136
+ parents: [{
137
+ type: _keys.COLUMN_ADD_SECTION.type,
138
+ key: _keys.COLUMN_ADD_SECTION.key,
139
+ rank: _keys.COLUMN_ADD_SECTION_RANK[_keys.ADD_COLUMN_LEFT_ITEM.key]
140
+ }],
141
+ component: function component() {
142
+ return /*#__PURE__*/_react.default.createElement(_AddColumnLeftItem.AddColumnLeftItem, {
143
+ api: api
144
+ });
145
+ }
146
+ }, {
147
+ type: _keys.MOVE_COLUMN_LEFT_ITEM.type,
148
+ key: _keys.MOVE_COLUMN_LEFT_ITEM.key,
149
+ parents: [{
150
+ type: _keys.COLUMN_ADD_SECTION.type,
151
+ key: _keys.COLUMN_ADD_SECTION.key,
152
+ rank: _keys.COLUMN_ADD_SECTION_RANK[_keys.MOVE_COLUMN_LEFT_ITEM.key]
153
+ }],
154
+ component: function component() {
155
+ return /*#__PURE__*/_react.default.createElement(_MoveColumnLeftItem.MoveColumnLeftItem, {
156
+ api: api
157
+ });
158
+ }
159
+ }, {
160
+ type: _keys.MOVE_COLUMN_RIGHT_ITEM.type,
161
+ key: _keys.MOVE_COLUMN_RIGHT_ITEM.key,
162
+ parents: [{
163
+ type: _keys.COLUMN_ADD_SECTION.type,
164
+ key: _keys.COLUMN_ADD_SECTION.key,
165
+ rank: _keys.COLUMN_ADD_SECTION_RANK[_keys.MOVE_COLUMN_RIGHT_ITEM.key]
166
+ }],
167
+ component: function component() {
168
+ return /*#__PURE__*/_react.default.createElement(_MoveColumnRightItem.MoveColumnRightItem, {
169
+ api: api
170
+ });
171
+ }
172
+ },
173
+ // --- Danger section (Clear cells, Delete column) ---
174
+ {
175
+ type: _keys.COLUMN_DANGER_SECTION.type,
176
+ key: _keys.COLUMN_DANGER_SECTION.key,
177
+ parents: [{
178
+ type: _keys.COLUMN_MENU.type,
179
+ key: _keys.COLUMN_MENU.key,
180
+ rank: _keys.COLUMN_SECTION_RANK[_keys.COLUMN_DANGER_SECTION.key]
181
+ }],
182
+ component: function component(props) {
183
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
184
+ hasSeparator: true
185
+ }, props.children);
186
+ }
187
+ }] : [
188
+ // --- Cell menu update OFF: legacy column menu (registers its own add/delete items) ---
189
+
25
190
  // --- Menu surface ---
26
191
  {
27
192
  type: _keys.COLUMN_MENU.type,