@atlaskit/editor-plugin-table 24.3.14 → 24.4.1
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.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/nodeviews/TableResizer.js +4 -10
- package/dist/cjs/nodeviews/TableSSRReactContextsProvider.js +23 -0
- package/dist/cjs/nodeviews/table-node-views.js +1 -1
- package/dist/cjs/nodeviews/table.js +14 -21
- package/dist/cjs/pm-plugins/commands/insert.js +10 -1
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +12 -25
- package/dist/cjs/pm-plugins/main.js +3 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +10 -22
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +2 -1
- package/dist/cjs/tablePlugin.js +10 -1
- package/dist/cjs/ui/TableMenu/cell/getCellMenuComponents.js +153 -1
- package/dist/cjs/ui/TableMenu/cell/keys.js +19 -5
- package/dist/cjs/ui/TableMenu/column/getColumnMenuComponents.js +166 -1
- package/dist/cjs/ui/TableMenu/column/items/AddColumnRightItem.js +2 -2
- package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +3 -3
- package/dist/cjs/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -2
- package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +136 -1
- package/dist/cjs/ui/TableMenu/row/items/AddRowBelowItem.js +2 -2
- package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +3 -3
- package/dist/cjs/ui/TableMenu/shared/getSharedItems.js +141 -1
- package/dist/cjs/ui/TableMenu/shared/selection.js +19 -0
- package/dist/es2019/nodeviews/TableResizer.js +4 -10
- package/dist/es2019/nodeviews/TableSSRReactContextsProvider.js +17 -0
- package/dist/es2019/nodeviews/table-node-views.js +1 -1
- package/dist/es2019/nodeviews/table.js +15 -22
- package/dist/es2019/pm-plugins/commands/insert.js +10 -1
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +12 -25
- package/dist/es2019/pm-plugins/main.js +4 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +10 -22
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -1
- package/dist/es2019/tablePlugin.js +10 -1
- package/dist/es2019/ui/TableMenu/cell/getCellMenuComponents.js +134 -2
- package/dist/es2019/ui/TableMenu/cell/keys.js +25 -2
- package/dist/es2019/ui/TableMenu/column/getColumnMenuComponents.js +144 -1
- package/dist/es2019/ui/TableMenu/column/items/AddColumnRightItem.js +2 -2
- package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +3 -3
- package/dist/es2019/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -2
- package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +118 -1
- package/dist/es2019/ui/TableMenu/row/items/AddRowBelowItem.js +2 -2
- package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +3 -3
- package/dist/es2019/ui/TableMenu/shared/getSharedItems.js +130 -4
- package/dist/es2019/ui/TableMenu/shared/selection.js +14 -0
- package/dist/esm/nodeviews/TableResizer.js +4 -10
- package/dist/esm/nodeviews/TableSSRReactContextsProvider.js +16 -0
- package/dist/esm/nodeviews/table-node-views.js +1 -1
- package/dist/esm/nodeviews/table.js +15 -22
- package/dist/esm/pm-plugins/commands/insert.js +10 -1
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +12 -25
- package/dist/esm/pm-plugins/main.js +4 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +10 -22
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +2 -1
- package/dist/esm/tablePlugin.js +10 -1
- package/dist/esm/ui/TableMenu/cell/getCellMenuComponents.js +154 -2
- package/dist/esm/ui/TableMenu/cell/keys.js +16 -2
- package/dist/esm/ui/TableMenu/column/getColumnMenuComponents.js +166 -1
- package/dist/esm/ui/TableMenu/column/items/AddColumnRightItem.js +2 -2
- package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +3 -3
- package/dist/esm/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -2
- package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +136 -1
- package/dist/esm/ui/TableMenu/row/items/AddRowBelowItem.js +2 -2
- package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +3 -3
- package/dist/esm/ui/TableMenu/shared/getSharedItems.js +144 -4
- package/dist/esm/ui/TableMenu/shared/selection.js +14 -0
- package/dist/types/nodeviews/TableSSRReactContextsProvider.d.ts +8 -0
- package/dist/types/nodeviews/table-node-views.d.ts +2 -0
- package/dist/types/nodeviews/table.d.ts +3 -1
- package/dist/types/nodeviews/types.d.ts +2 -0
- package/dist/types/tablePluginType.d.ts +3 -2
- package/dist/types/ui/TableMenu/cell/keys.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/getColumnMenuComponents.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/selection.d.ts +8 -0
- package/package.json +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 24.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0e797fd81675f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e797fd81675f) -
|
|
8
|
+
Cleaning up interactivity monitoring experiment
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 24.4.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`af0307ac8c91b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af0307ac8c91b) -
|
|
16
|
+
Fix nested tables rendering as non-nested during SSR streaming (guarded by isSSRStreaming; no
|
|
17
|
+
change to CSR)
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`5fa08ff6d295a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5fa08ff6d295a) -
|
|
22
|
+
Re-add missing cell menu items behind the `platform_editor_table_cell_menu_update`.
|
|
23
|
+
- [`075b6ae004392`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/075b6ae004392) -
|
|
24
|
+
[ux] fix toolbar table insertion for markdown syntax mode
|
|
25
|
+
- [`e162cd8ab6b15`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e162cd8ab6b15) -
|
|
26
|
+
Fix malformed nested-table column width in SSR output: the min-width branch emitted `width: 48px)`
|
|
27
|
+
(stray parenthesis) instead of a valid `width: 48px`.
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 24.3.14
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -257,11 +257,8 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
257
257
|
};
|
|
258
258
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
259
259
|
var handleResizeStart = (0, _react.useCallback)(function () {
|
|
260
|
-
var _pluginInjectionApi$u;
|
|
261
|
-
|
|
262
|
-
var _insm$session;
|
|
263
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
264
|
-
}
|
|
260
|
+
var _insm$session, _pluginInjectionApi$u;
|
|
261
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
265
262
|
startMeasure();
|
|
266
263
|
isResizing.current = true;
|
|
267
264
|
var dispatch = editorView.dispatch,
|
|
@@ -333,7 +330,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
333
330
|
return (0, _rafSchd.default)(handleResize);
|
|
334
331
|
}, [handleResize]);
|
|
335
332
|
var handleResizeStop = (0, _react.useCallback)(function (originalState, delta) {
|
|
336
|
-
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3;
|
|
333
|
+
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3, _insm$session2;
|
|
337
334
|
isResizing.current = false;
|
|
338
335
|
var newWidth = originalState.width + delta.width;
|
|
339
336
|
var originalNewWidth = newWidth;
|
|
@@ -414,10 +411,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
414
411
|
if (onResizeStop) {
|
|
415
412
|
onResizeStop();
|
|
416
413
|
}
|
|
417
|
-
|
|
418
|
-
var _insm$session2;
|
|
419
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
420
|
-
}
|
|
414
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
421
415
|
return newWidth;
|
|
422
416
|
}, [editorView, getPos, node, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage, isFullPageAppearance]);
|
|
423
417
|
var handleTableSizeChangeOnKeypress = (0, _react.useCallback)(function (step) {
|
|
@@ -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
|
-
|
|
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(
|
|
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
|
|
@@ -39,20 +39,16 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
39
39
|
return type === 'table-row';
|
|
40
40
|
},
|
|
41
41
|
onDragStart: function onDragStart() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
45
|
-
}
|
|
42
|
+
var _insm$session;
|
|
43
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
46
44
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
47
45
|
// Ignored via go/ees005
|
|
48
46
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
49
47
|
editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
|
|
50
48
|
},
|
|
51
49
|
onDrop: function onDrop() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
55
|
-
}
|
|
50
|
+
var _insm$session2;
|
|
51
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
56
52
|
// 'null' will remove the inline style
|
|
57
53
|
// Ignored via go/ees005
|
|
58
54
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -88,10 +84,8 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
88
84
|
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
89
85
|
},
|
|
90
86
|
onDragStart: function onDragStart() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
94
|
-
}
|
|
87
|
+
var _insm$session3;
|
|
88
|
+
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
95
89
|
if ((0, _expValEquals.expValEquals)('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
96
90
|
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
97
91
|
var _api$userIntent;
|
|
@@ -160,13 +154,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
160
154
|
}
|
|
161
155
|
// If no data can be found then it's most like we do not want to perform any drop action
|
|
162
156
|
if (!data) {
|
|
163
|
-
var _event$source, _event$source2;
|
|
157
|
+
var _insm$session4, _event$source, _event$source2;
|
|
164
158
|
// If we're able to determine the source type of the dropped element then we should report to analytics that
|
|
165
159
|
// the drop event was cancelled. Otherwise we will cancel silently.
|
|
166
|
-
|
|
167
|
-
var _insm$session4;
|
|
168
|
-
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
169
|
-
}
|
|
160
|
+
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
170
161
|
if ((event === null || event === void 0 || (_event$source = event.source) === null || _event$source === void 0 || (_event$source = _event$source.data) === null || _event$source === void 0 ? void 0 : _event$source.type) === 'table-row' || (event === null || event === void 0 || (_event$source2 = event.source) === null || _event$source2 === void 0 || (_event$source2 = _event$source2.data) === null || _event$source2 === void 0 ? void 0 : _event$source2.type) === 'table-column') {
|
|
171
162
|
var _event$source$data;
|
|
172
163
|
return (0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data = event.source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.indexes, _analytics.TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
|
|
@@ -190,16 +181,15 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
190
181
|
|
|
191
182
|
// If the drop target index contains merged cells then we should not allow the drop to occur.
|
|
192
183
|
if ((0, _mergedCells.hasMergedCellsInBetween)([targetAdjustedIndex - 1, targetAdjustedIndex], sourceType === 'table-row' ? _consts.DropTargetType.ROW : _consts.DropTargetType.COLUMN)(editorView.state.selection)) {
|
|
184
|
+
var _insm$session5;
|
|
193
185
|
(0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
|
|
194
186
|
// This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
|
|
195
187
|
_analytics.TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
|
|
196
|
-
|
|
197
|
-
var _insm$session5;
|
|
198
|
-
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
199
|
-
}
|
|
188
|
+
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
200
189
|
return;
|
|
201
190
|
}
|
|
202
191
|
requestAnimationFrame(function () {
|
|
192
|
+
var _insm$session6;
|
|
203
193
|
if (behaviour === 'clone') {
|
|
204
194
|
(0, _commandsWithAnalytics.cloneSourceWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes, targetIndex, targetDirection, tr)(editorView.state, editorView.dispatch);
|
|
205
195
|
} else {
|
|
@@ -226,10 +216,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
226
216
|
}
|
|
227
217
|
}
|
|
228
218
|
editorView.focus();
|
|
229
|
-
|
|
230
|
-
var _insm$session6;
|
|
231
|
-
(_insm$session6 = _insm.insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
232
|
-
}
|
|
219
|
+
(_insm$session6 = _insm.insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
233
220
|
});
|
|
234
221
|
}
|
|
235
222
|
})]));
|
|
@@ -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,
|
|
@@ -9,7 +9,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
9
9
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
11
|
var _insm = require("@atlaskit/insm");
|
|
12
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
12
|
var _columnResize = require("../commands/column-resize");
|
|
14
13
|
var _misc = require("../commands/misc");
|
|
15
14
|
var _pluginFactory = require("../plugin-factory");
|
|
@@ -25,7 +24,7 @@ var _misc2 = require("./utils/misc");
|
|
|
25
24
|
var _resizeColumn = require("./utils/resize-column");
|
|
26
25
|
var _resizeState = require("./utils/resize-state");
|
|
27
26
|
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isCommentEditor) {
|
|
28
|
-
var _originalTable$attrs;
|
|
27
|
+
var _insm$session, _originalTable$attrs;
|
|
29
28
|
var state = view.state,
|
|
30
29
|
dispatch = view.dispatch;
|
|
31
30
|
var editorDisabled = !view.editable;
|
|
@@ -38,10 +37,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
38
37
|
var _getTablePluginState = (0, _pluginFactory.getPluginState)(state),
|
|
39
38
|
isKeyboardResize = _getTablePluginState.isKeyboardResize;
|
|
40
39
|
event.preventDefault();
|
|
41
|
-
|
|
42
|
-
var _insm$session;
|
|
43
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
44
|
-
}
|
|
40
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
45
41
|
var tr = view.state.tr;
|
|
46
42
|
tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
|
|
47
43
|
name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED_COLUMN
|
|
@@ -132,17 +128,13 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
132
128
|
var _getTablePluginState2 = (0, _pluginFactory.getPluginState)(state),
|
|
133
129
|
isTableHovered = _getTablePluginState2.isTableHovered;
|
|
134
130
|
if (resizeHandlePos === null) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
138
|
-
}
|
|
131
|
+
var _insm$session2;
|
|
132
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
139
133
|
return (0, _commands.stopResizing)()(state, dispatch);
|
|
140
134
|
}
|
|
141
135
|
if (!(0, _misc2.pointsAtCell)(state.doc.resolve(resizeHandlePos))) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
145
|
-
}
|
|
136
|
+
var _insm$session3;
|
|
137
|
+
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
146
138
|
return;
|
|
147
139
|
}
|
|
148
140
|
// resizeHandlePos could be remapped via a collab change.
|
|
@@ -155,10 +147,8 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
155
147
|
|
|
156
148
|
// If we let go in the same place we started, don't need to do anything.
|
|
157
149
|
if (dragging && clientX === dragging.startX) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
161
|
-
}
|
|
150
|
+
var _insm$session4;
|
|
151
|
+
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
162
152
|
if (isKeyboardResize || !isTableHovered) {
|
|
163
153
|
/** if column resize had started via keyboard but continued by mouse
|
|
164
154
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -170,6 +160,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
170
160
|
}
|
|
171
161
|
var tr = state.tr;
|
|
172
162
|
if (dragging) {
|
|
163
|
+
var _insm$session5;
|
|
173
164
|
var startX = dragging.startX;
|
|
174
165
|
|
|
175
166
|
// If the dimensions of the table have changed through a remote modification by another
|
|
@@ -225,10 +216,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
225
216
|
}
|
|
226
217
|
})(tr);
|
|
227
218
|
}
|
|
228
|
-
|
|
229
|
-
var _insm$session5;
|
|
230
|
-
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
231
|
-
}
|
|
219
|
+
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
232
220
|
if (isKeyboardResize || !isTableHovered) {
|
|
233
221
|
/** if column resize had started via keyboard but continued by mouse
|
|
234
222
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -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, ")");
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -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,
|