@atlaskit/editor-plugin-table 7.17.0 → 7.17.2
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 +28 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/cjs/nodeviews/TableResizer.js +2 -0
- package/dist/cjs/plugin.js +2 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/cjs/toolbar.js +3 -0
- package/dist/cjs/ui/DragHandle/index.js +4 -2
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +5 -1
- package/dist/cjs/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +47 -22
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/cjs/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +36 -13
- package/dist/cjs/ui/FloatingDragMenu/index.js +5 -2
- package/dist/cjs/ui/FloatingDragMenu/styles.js +12 -1
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +4 -2
- package/dist/cjs/ui/common-styles.js +3 -1
- package/dist/cjs/ui/consts.js +4 -1
- package/dist/cjs/ui/ui-styles.js +35 -3
- package/dist/cjs/utils/drag-menu.js +32 -27
- package/dist/es2019/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/es2019/nodeviews/TableResizer.js +2 -0
- package/dist/es2019/plugin.js +34 -31
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +3 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/es2019/toolbar.js +3 -0
- package/dist/es2019/ui/DragHandle/index.js +6 -2
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +5 -1
- package/dist/es2019/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +38 -11
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/es2019/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +34 -13
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/styles.js +11 -3
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +6 -2
- package/dist/es2019/ui/common-styles.js +3 -1
- package/dist/es2019/ui/consts.js +3 -0
- package/dist/es2019/ui/ui-styles.js +36 -3
- package/dist/es2019/utils/drag-menu.js +23 -19
- package/dist/esm/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/esm/nodeviews/TableResizer.js +2 -0
- package/dist/esm/plugin.js +2 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +3 -3
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/esm/toolbar.js +3 -0
- package/dist/esm/ui/DragHandle/index.js +4 -2
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +5 -1
- package/dist/esm/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +47 -22
- package/dist/esm/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/esm/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +36 -13
- package/dist/esm/ui/FloatingDragMenu/index.js +5 -2
- package/dist/esm/ui/FloatingDragMenu/styles.js +13 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +4 -2
- package/dist/esm/ui/common-styles.js +3 -1
- package/dist/esm/ui/consts.js +3 -0
- package/dist/esm/ui/ui-styles.js +35 -3
- package/dist/esm/utils/drag-menu.js +32 -27
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +8 -0
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +16 -0
- package/dist/types/ui/TableFloatingControls/index.d.ts +8 -0
- package/dist/types/ui/consts.d.ts +3 -0
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +16 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/consts.d.ts +3 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +136 -147
- package/src/nodeviews/ExternalDropTargets.tsx +2 -1
- package/src/nodeviews/TableResizer.tsx +3 -0
- package/src/plugin.tsx +3 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +9 -3
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +2 -1
- package/src/toolbar.tsx +3 -0
- package/src/ui/DragHandle/index.tsx +4 -2
- package/src/ui/FloatingContextualButton/FixedButton.tsx +1 -1
- package/src/ui/FloatingContextualButton/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/styles.ts +10 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +22 -3
- package/src/ui/FloatingContextualMenu/index.tsx +1 -0
- package/src/ui/FloatingContextualMenu/styles.ts +2 -0
- package/src/ui/FloatingDeleteButton/index.tsx +2 -1
- package/src/ui/FloatingDragMenu/DragMenu.tsx +39 -16
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +1 -1
- package/src/ui/FloatingDragMenu/index.tsx +6 -2
- package/src/ui/FloatingDragMenu/styles.ts +20 -3
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +4 -2
- package/src/ui/common-styles.ts +2 -1
- package/src/ui/consts.ts +4 -0
- package/src/ui/ui-styles.ts +25 -0
- package/src/utils/drag-menu.ts +28 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.17.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#110390](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110390)
|
|
8
|
+
[`bead123202369`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bead123202369) -
|
|
9
|
+
[ux] [ED-23642] Reordering the typeahead so that date, status, code block & info panel are above
|
|
10
|
+
the fold (in the top 5 results)
|
|
11
|
+
- [#111045](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111045)
|
|
12
|
+
[`2f693993423ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f693993423ec) -
|
|
13
|
+
improve input latency of drag and drop experience and hide drag handle during resizing
|
|
14
|
+
- [#111428](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111428)
|
|
15
|
+
[`5679a3e527073`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5679a3e527073) -
|
|
16
|
+
ED-23129: Disabled internal column resizing for nested tables
|
|
17
|
+
- [#111254](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111254)
|
|
18
|
+
[`c76f505dccf41`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c76f505dccf41) -
|
|
19
|
+
[ux] Fixed resizeAmount for left-aligned tables when internal column resizing is enabled.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 7.17.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#109812](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109812)
|
|
27
|
+
[`b066a2c5e63b2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b066a2c5e63b2) -
|
|
28
|
+
ED-23599: Move sort column to top of drag menu when FF is on
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
3
31
|
## 7.17.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
|
@@ -54,10 +54,11 @@ var ExternalDropTargets = exports.ExternalDropTargets = function ExternalDropTar
|
|
|
54
54
|
overflow: 'hidden',
|
|
55
55
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
56
56
|
position: 'absolute',
|
|
57
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
57
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
58
58
|
top: "-".concat(_consts.dropTargetExtendedWidth - _styles.tableMarginTop, "px"),
|
|
59
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
60
60
|
pointerEvents: 'auto',
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
61
62
|
zIndex: "".concat(_consts.dropTargetsZIndex)
|
|
62
63
|
},
|
|
63
64
|
"data-testid": "table-floating-column-extended-drop-targets"
|
|
@@ -216,6 +216,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
216
216
|
tableLocalId: node.attrs.localId,
|
|
217
217
|
tableRef: tableRef
|
|
218
218
|
});
|
|
219
|
+
tr.setMeta('is-resizer-resizing', true);
|
|
219
220
|
tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
|
|
220
221
|
name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
|
|
221
222
|
});
|
|
@@ -281,6 +282,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
281
282
|
tableLocalId: '',
|
|
282
283
|
tableRef: null
|
|
283
284
|
});
|
|
285
|
+
tr.setMeta('is-resizer-resizing', false);
|
|
284
286
|
var frameRateSamples = endMeasure();
|
|
285
287
|
if (frameRateSamples.length > 0) {
|
|
286
288
|
var resizeFrameRatePayloads = (0, _analytics2.generateResizeFrameRatePayloads)({
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -438,13 +438,14 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
438
438
|
},
|
|
439
439
|
pluginsOptions: {
|
|
440
440
|
quickInsert: function quickInsert(_ref19) {
|
|
441
|
+
var _options$getEditorFea3;
|
|
441
442
|
var formatMessage = _ref19.formatMessage;
|
|
442
443
|
return [{
|
|
443
444
|
id: 'table',
|
|
444
445
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
445
446
|
description: formatMessage(_messages.toolbarInsertBlockMessages.tableDescription),
|
|
446
447
|
keywords: ['cell', 'table'],
|
|
447
|
-
priority: 600,
|
|
448
|
+
priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
|
|
448
449
|
keyshortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
|
|
449
450
|
icon: function icon() {
|
|
450
451
|
return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
|
|
@@ -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')) {
|
|
150
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements') && !(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')) {
|
|
227
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements') && !(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);
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.resizeColumnAndTable = exports.resizeColumn = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _types = require("../../../types");
|
|
10
|
+
var _alignment = require("../../../utils/alignment");
|
|
10
11
|
var _misc = require("./misc");
|
|
11
12
|
var _resizeLogic = require("./resize-logic");
|
|
12
13
|
var _resizeState = require("./resize-state");
|
|
@@ -36,7 +37,7 @@ var resizeColumnAndTable = exports.resizeColumnAndTable = function resizeColumnA
|
|
|
36
37
|
var tableWidth = tableRef.clientWidth;
|
|
37
38
|
var tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
|
|
38
39
|
var isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
|
|
39
|
-
var resizeAmount = amount * 2;
|
|
40
|
+
var resizeAmount = tableNode.attrs.layout === _alignment.ALIGN_START && !isOverflowed ? amount : amount * 2;
|
|
40
41
|
|
|
41
42
|
// todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
|
|
42
43
|
// let scalePercent = 1;
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -155,6 +155,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
|
|
|
155
155
|
},
|
|
156
156
|
selected: false,
|
|
157
157
|
disabled: false,
|
|
158
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
158
159
|
elemAfter: (0, _react.jsx)("div", {
|
|
159
160
|
css: _shortcut.shortcutStyle
|
|
160
161
|
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter))
|
|
@@ -174,6 +175,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
|
|
|
174
175
|
},
|
|
175
176
|
selected: false,
|
|
176
177
|
disabled: false,
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
177
179
|
elemAfter: (0, _react.jsx)("div", {
|
|
178
180
|
css: _shortcut.shortcutStyle
|
|
179
181
|
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter))
|
|
@@ -306,6 +308,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
|
|
|
306
308
|
},
|
|
307
309
|
selected: false,
|
|
308
310
|
disabled: false,
|
|
311
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
309
312
|
elemAfter: (0, _react.jsx)("div", {
|
|
310
313
|
css: _shortcut.shortcutStyle
|
|
311
314
|
}, (0, _keymaps.tooltip)(_keymaps.backspace))
|
|
@@ -162,10 +162,12 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
162
162
|
className: _types.TableCssClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE,
|
|
163
163
|
"data-testid": "table-drag-handle-clickable-zone-button",
|
|
164
164
|
style: {
|
|
165
|
-
height: isRow ?
|
|
165
|
+
height: isRow ? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
166
|
+
"calc(100% - ".concat(_consts.dragTableInsertColumnButtonSize, "px)") : "var(--ds-space-200, 16px)",
|
|
166
167
|
// 16px here because it's the size of drag handle button's large side
|
|
167
168
|
width: isRow ? "var(--ds-space-200, 16px)" // 16px here because it's the size of drag handle button's large side
|
|
168
|
-
:
|
|
169
|
+
: // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
170
|
+
"calc(100% - ".concat(_consts.dragTableInsertColumnButtonSize, "px)"),
|
|
169
171
|
left: isRow ? "var(--ds-space-050, 4px)" : undefined,
|
|
170
172
|
bottom: isColumn ? "var(--ds-space-0, 0px)" : undefined,
|
|
171
173
|
alignSelf: isColumn ? 'none' : 'center',
|
|
@@ -120,7 +120,7 @@ var FixedButton = exports.FixedButton = function FixedButton(_ref2) {
|
|
|
120
120
|
position: 'fixed',
|
|
121
121
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
122
122
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
123
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
124
124
|
zIndex: _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex,
|
|
125
125
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
126
126
|
left: calcLeftPos({
|
|
@@ -53,7 +53,11 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
53
53
|
}
|
|
54
54
|
var labelCellOptions = formatMessage(_messages.tableMessages.cellOptions);
|
|
55
55
|
var button = (0, _react2.jsx)("div", {
|
|
56
|
-
css: [
|
|
56
|
+
css: [
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
58
|
+
(0, _styles.tableFloatingCellButtonStyles)(),
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
60
|
+
isContextualMenuOpen && (0, _styles.tableFloatingCellButtonSelectedStyles)()]
|
|
57
61
|
}, (0, _react2.jsx)(_uiMenu.ToolbarButton
|
|
58
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
59
63
|
, {
|
|
@@ -9,14 +9,17 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
9
9
|
var _consts = require("../consts");
|
|
10
10
|
var tableFloatingCellButtonStyles = exports.tableFloatingCellButtonStyles = function tableFloatingCellButtonStyles() {
|
|
11
11
|
return (0, _react.css)({
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
12
13
|
'> div': {
|
|
13
14
|
// Sits behind button to provide surface-color background
|
|
14
15
|
background: "var(--ds-surface, ".concat(_colors.N20, ")"),
|
|
15
16
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
16
17
|
display: 'flex',
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
17
19
|
height: "".concat(_consts.contextualMenuTriggerSize + 2, "px"),
|
|
18
20
|
flexDirection: 'column'
|
|
19
21
|
},
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
20
23
|
'&& button': {
|
|
21
24
|
background: "var(--ds-background-neutral, none)",
|
|
22
25
|
flexDirection: 'column',
|
|
@@ -27,15 +30,19 @@ var tableFloatingCellButtonStyles = exports.tableFloatingCellButtonStyles = func
|
|
|
27
30
|
height: 'calc(100% - 4px)',
|
|
28
31
|
display: 'flex'
|
|
29
32
|
},
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
30
34
|
'&& button:hover': {
|
|
31
35
|
background: "var(--ds-background-neutral-hovered, ".concat(_colors.N30A, ")")
|
|
32
36
|
},
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
33
38
|
'&& button:active': {
|
|
34
39
|
background: "var(--ds-background-neutral-pressed, rgba(179, 212, 255, 0.6))"
|
|
35
40
|
},
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
36
42
|
'&& button > span': {
|
|
37
43
|
margin: "0px ".concat("var(--ds-space-negative-050, -4px)")
|
|
38
44
|
},
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
39
46
|
'&& span': {
|
|
40
47
|
pointerEvents: 'none'
|
|
41
48
|
}
|
|
@@ -43,12 +50,15 @@ var tableFloatingCellButtonStyles = exports.tableFloatingCellButtonStyles = func
|
|
|
43
50
|
};
|
|
44
51
|
var tableFloatingCellButtonSelectedStyles = exports.tableFloatingCellButtonSelectedStyles = function tableFloatingCellButtonSelectedStyles() {
|
|
45
52
|
return (0, _react.css)({
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
46
54
|
'&& button': {
|
|
47
55
|
background: "var(--ds-background-selected, ".concat(_colors.N700, ")")
|
|
48
56
|
},
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
49
58
|
'&& button:hover': {
|
|
50
59
|
background: "var(--ds-background-selected-hovered, ".concat(_colors.N700, ")")
|
|
51
60
|
},
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
52
62
|
'&& button:active': {
|
|
53
63
|
background: "var(--ds-background-selected-pressed, ".concat(_colors.N700, ")")
|
|
54
64
|
}
|
|
@@ -89,7 +89,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
89
89
|
value: {
|
|
90
90
|
name: 'background'
|
|
91
91
|
},
|
|
92
|
-
elemBefore: isDragAndDropEnabled ?
|
|
92
|
+
elemBefore: isDragAndDropEnabled ?
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
94
|
+
(0, _react2.jsx)("span", {
|
|
93
95
|
css: _styles2.elementBeforeIconStyles
|
|
94
96
|
}, (0, _react2.jsx)(_backgroundColor.default, {
|
|
95
97
|
label: formatMessage(_messages.tableMessages.backgroundColor),
|
|
@@ -100,6 +102,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
100
102
|
(0, _react2.jsx)("div", {
|
|
101
103
|
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
102
104
|
}, (0, _react2.jsx)("div", {
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
103
106
|
css: (0, _styles2.cellColourPreviewStyles)(background)
|
|
104
107
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
105
108
|
,
|
|
@@ -136,7 +139,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
136
139
|
name: 'merge'
|
|
137
140
|
},
|
|
138
141
|
isDisabled: !(0, _transforms.canMergeCells)(state.tr),
|
|
139
|
-
elemBefore: isDragAndDropEnabled ?
|
|
142
|
+
elemBefore: isDragAndDropEnabled ?
|
|
143
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
144
|
+
(0, _react2.jsx)("span", {
|
|
140
145
|
css: _styles2.elementBeforeIconStyles
|
|
141
146
|
}, (0, _react2.jsx)(_icons.MergeCellsIcon, null)) : undefined
|
|
142
147
|
}, {
|
|
@@ -145,7 +150,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
145
150
|
name: 'split'
|
|
146
151
|
},
|
|
147
152
|
isDisabled: !(0, _utils2.splitCell)(state),
|
|
148
|
-
elemBefore: isDragAndDropEnabled ?
|
|
153
|
+
elemBefore: isDragAndDropEnabled ?
|
|
154
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
155
|
+
(0, _react2.jsx)("span", {
|
|
149
156
|
css: _styles2.elementBeforeIconStyles
|
|
150
157
|
}, (0, _react2.jsx)(_icons.SplitCellIcon, null)) : undefined
|
|
151
158
|
}];
|
|
@@ -163,10 +170,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
163
170
|
value: {
|
|
164
171
|
name: 'insert_column'
|
|
165
172
|
},
|
|
173
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
166
174
|
elemAfter: (0, _react2.jsx)("div", {
|
|
167
175
|
css: _shortcut.shortcutStyle
|
|
168
176
|
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter)),
|
|
169
|
-
elemBefore: isDragAndDropEnabled ?
|
|
177
|
+
elemBefore: isDragAndDropEnabled ?
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
179
|
+
(0, _react2.jsx)("span", {
|
|
170
180
|
css: _styles2.elementBeforeIconStyles
|
|
171
181
|
}, (0, _react2.jsx)(_icons.AddColRightIcon, null)) : undefined
|
|
172
182
|
};
|
|
@@ -182,10 +192,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
182
192
|
value: {
|
|
183
193
|
name: 'insert_row'
|
|
184
194
|
},
|
|
195
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
185
196
|
elemAfter: (0, _react2.jsx)("div", {
|
|
186
197
|
css: _shortcut.shortcutStyle
|
|
187
198
|
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter)),
|
|
188
|
-
elemBefore: isDragAndDropEnabled ?
|
|
199
|
+
elemBefore: isDragAndDropEnabled ?
|
|
200
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
201
|
+
(0, _react2.jsx)("span", {
|
|
189
202
|
css: _styles2.elementBeforeIconStyles
|
|
190
203
|
}, (0, _react2.jsx)(_icons.AddRowBelowIcon, null)) : undefined
|
|
191
204
|
};
|
|
@@ -210,10 +223,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
210
223
|
value: {
|
|
211
224
|
name: 'clear'
|
|
212
225
|
},
|
|
226
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
213
227
|
elemAfter: (0, _react2.jsx)("div", {
|
|
214
228
|
css: _shortcut.shortcutStyle
|
|
215
229
|
}, (0, _keymaps.tooltip)(_keymaps.backspace)),
|
|
216
|
-
elemBefore: isDragAndDropEnabled ?
|
|
230
|
+
elemBefore: isDragAndDropEnabled ?
|
|
231
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
232
|
+
(0, _react2.jsx)("span", {
|
|
217
233
|
css: _styles2.elementBeforeIconStyles
|
|
218
234
|
}, (0, _react2.jsx)(_crossCircle.default, {
|
|
219
235
|
label: formatMessage(_messages.tableMessages.clearCells, {
|
|
@@ -239,7 +255,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
239
255
|
value: {
|
|
240
256
|
name: 'delete_column'
|
|
241
257
|
},
|
|
242
|
-
elemBefore: isDragAndDropEnabled ?
|
|
258
|
+
elemBefore: isDragAndDropEnabled ?
|
|
259
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
260
|
+
(0, _react2.jsx)("span", {
|
|
243
261
|
css: _styles2.elementBeforeIconStyles
|
|
244
262
|
}, (0, _react2.jsx)(_remove.default, {
|
|
245
263
|
label: formatMessage(_messages.tableMessages.removeColumns, {
|
|
@@ -265,7 +283,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
265
283
|
value: {
|
|
266
284
|
name: 'delete_row'
|
|
267
285
|
},
|
|
268
|
-
elemBefore: isDragAndDropEnabled ?
|
|
286
|
+
elemBefore: isDragAndDropEnabled ?
|
|
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
|
+
(0, _react2.jsx)("span", {
|
|
269
289
|
css: _styles2.elementBeforeIconStyles
|
|
270
290
|
}, (0, _react2.jsx)(_remove.default, {
|
|
271
291
|
label: formatMessage(_messages.tableMessages.removeRows, {
|
|
@@ -333,17 +353,22 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
333
353
|
});
|
|
334
354
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createOriginalContextMenuItems", function () {
|
|
335
355
|
var items = [];
|
|
356
|
+
var getEditorFeatureFlags = _this.props.getEditorFeatureFlags;
|
|
357
|
+
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
358
|
+
_ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
|
|
359
|
+
tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
|
|
360
|
+
var sortColumnItems = _this.createSortColumnItems();
|
|
336
361
|
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
362
|
+
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
363
|
+
tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
337
364
|
backgroundColorItem && items.push(backgroundColorItem);
|
|
338
365
|
items.push(_this.createInsertColumnItem());
|
|
339
366
|
items.push(_this.createInsertRowItem());
|
|
340
367
|
items.push(_this.createDeleteColumnItem());
|
|
341
368
|
items.push(_this.createDeleteRowItem());
|
|
342
369
|
items.push.apply(items, (0, _toConsumableArray2.default)(_this.createMergeSplitCellItems()));
|
|
343
|
-
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
344
370
|
distributeColumnsItem && items.push(distributeColumnsItem);
|
|
345
|
-
|
|
346
|
-
sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
371
|
+
!tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
347
372
|
items.push(_this.createClearCellsItem());
|
|
348
373
|
return [{
|
|
349
374
|
items: items
|
|
@@ -374,8 +399,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
374
399
|
items[1].items.push(deleteRowItem);
|
|
375
400
|
return items;
|
|
376
401
|
});
|
|
377
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (
|
|
378
|
-
var item =
|
|
402
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (_ref3) {
|
|
403
|
+
var item = _ref3.item;
|
|
379
404
|
var _this$props10 = _this.props,
|
|
380
405
|
editorView = _this$props10.editorView,
|
|
381
406
|
selectionRect = _this$props10.selectionRect,
|
|
@@ -389,11 +414,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
389
414
|
targetCellPosition = _getPluginState11.targetCellPosition,
|
|
390
415
|
_getPluginState11$isT = _getPluginState11.isTableScalingEnabled,
|
|
391
416
|
isTableScalingEnabled = _getPluginState11$isT === void 0 ? false : _getPluginState11$isT;
|
|
392
|
-
var
|
|
393
|
-
|
|
394
|
-
tableDuplicateCellColouring =
|
|
395
|
-
|
|
396
|
-
tableWithFixedColumnWidthsOption =
|
|
417
|
+
var _ref4 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
418
|
+
_ref4$tableDuplicateC = _ref4.tableDuplicateCellColouring,
|
|
419
|
+
tableDuplicateCellColouring = _ref4$tableDuplicateC === void 0 ? false : _ref4$tableDuplicateC,
|
|
420
|
+
_ref4$tableWithFixedC = _ref4.tableWithFixedColumnWidthsOption,
|
|
421
|
+
tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
|
|
397
422
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
398
423
|
switch (item.value.name) {
|
|
399
424
|
case 'sort_column_desc':
|
|
@@ -468,8 +493,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
468
493
|
isSubmenuOpen: false
|
|
469
494
|
});
|
|
470
495
|
});
|
|
471
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (
|
|
472
|
-
var item =
|
|
496
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref5) {
|
|
497
|
+
var item = _ref5.item;
|
|
473
498
|
var _this$props12 = _this.props,
|
|
474
499
|
_this$props12$editorV = _this$props12.editorView,
|
|
475
500
|
state = _this$props12$editorV.state,
|
|
@@ -492,8 +517,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
492
517
|
(0, _commands.hoverMergedCells)()(state, dispatch);
|
|
493
518
|
}
|
|
494
519
|
});
|
|
495
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (
|
|
496
|
-
var item =
|
|
520
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (_ref6) {
|
|
521
|
+
var item = _ref6.item;
|
|
497
522
|
var _this$props$editorVie2 = _this.props.editorView,
|
|
498
523
|
state = _this$props$editorVie2.state,
|
|
499
524
|
dispatch = _this$props$editorVie2.dispatch;
|
|
@@ -15,10 +15,13 @@ var _templateObject;
|
|
|
15
15
|
var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
|
|
16
16
|
return (0, _react.css)({
|
|
17
17
|
'&::before': {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
18
19
|
background: selectedColor
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
};
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
22
25
|
var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)({
|
|
23
26
|
marginRight: "var(--ds-space-negative-075, -6px)",
|
|
24
27
|
display: 'flex'
|
|
@@ -213,10 +213,12 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
213
213
|
position: 'fixed',
|
|
214
214
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
215
215
|
top: pos.top,
|
|
216
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
217
217
|
zIndex: _consts.stickyRowZIndex,
|
|
218
218
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
219
|
-
left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (
|
|
219
|
+
left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (
|
|
220
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
221
|
+
this.props.isNumberColumnEnabled ? _editorSharedStyles.akEditorTableNumberColumnWidth : 0)
|
|
220
222
|
}
|
|
221
223
|
}, button), mountTo);
|
|
222
224
|
}
|
|
@@ -100,8 +100,16 @@ var MapDragMenuOptionIdToMessage = {
|
|
|
100
100
|
plural: null
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
var
|
|
104
|
-
var
|
|
103
|
+
var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnDiscoverability) {
|
|
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
|
+
var sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
|
|
106
|
+
tableSortColumnDiscoverability ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
|
|
107
|
+
return groupedDragMenuConfig;
|
|
108
|
+
};
|
|
109
|
+
var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage) {
|
|
110
|
+
var tableSortColumnDiscoverability = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
111
|
+
var selectionRect = arguments.length > 3 ? arguments[3] : undefined;
|
|
112
|
+
var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnDiscoverability);
|
|
105
113
|
var menuItemsArr = (0, _toConsumableArray2.default)(Array(groupedDragMenuConfig.length)).map(function () {
|
|
106
114
|
return [];
|
|
107
115
|
});
|
|
@@ -149,11 +157,14 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, for
|
|
|
149
157
|
name: item.id
|
|
150
158
|
},
|
|
151
159
|
isDisabled: item.disabled,
|
|
152
|
-
elemBefore: item.icon ?
|
|
160
|
+
elemBefore: item.icon ?
|
|
161
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
162
|
+
(0, _react2.jsx)("span", {
|
|
153
163
|
css: _styles2.elementBeforeIconStyles
|
|
154
164
|
}, (0, _react2.jsx)(item.icon, {
|
|
155
165
|
label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options)
|
|
156
166
|
})) : undefined,
|
|
167
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
157
168
|
elemAfter: item.keymap ? (0, _react2.jsx)("div", {
|
|
158
169
|
css: _shortcut.shortcutStyle
|
|
159
170
|
}, item.keymap) : undefined
|
|
@@ -194,7 +205,8 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
194
205
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
195
206
|
tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
|
|
196
207
|
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
|
|
197
|
-
isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled
|
|
208
|
+
isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
|
|
209
|
+
tableSortColumnDiscoverability = _ref.tableSortColumnDiscoverability;
|
|
198
210
|
var state = editorView.state,
|
|
199
211
|
dispatch = editorView.dispatch;
|
|
200
212
|
var selection = state.selection;
|
|
@@ -218,8 +230,8 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
218
230
|
hasMergedCellsInTable = (0, _utils3.getMergedCellsPositions)(state.tr).length > 0;
|
|
219
231
|
}
|
|
220
232
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
221
|
-
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);
|
|
222
|
-
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, 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, tableSortColumnDiscoverability);
|
|
234
|
+
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnDiscoverability, selectionRect),
|
|
223
235
|
menuItems = _convertToDropdownIte.menuItems,
|
|
224
236
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
225
237
|
var handleSubMenuRef = function handleSubMenuRef(ref) {
|
|
@@ -257,7 +269,9 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
257
269
|
value: {
|
|
258
270
|
name: 'background'
|
|
259
271
|
},
|
|
260
|
-
elemBefore:
|
|
272
|
+
elemBefore:
|
|
273
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
274
|
+
(0, _react2.jsx)("span", {
|
|
261
275
|
css: _styles2.elementBeforeIconStyles
|
|
262
276
|
}, (0, _react2.jsx)(_backgroundColor.default, {
|
|
263
277
|
label: formatMessage(_messages.tableMessages.backgroundColor),
|
|
@@ -265,9 +279,12 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
265
279
|
})),
|
|
266
280
|
elemAfter: (0, _react2.jsx)("div", {
|
|
267
281
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
268
|
-
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
269
|
-
css
|
|
282
|
+
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
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
|
+
,
|
|
285
|
+
css: (0, _styles2.dragMenuBackgroundColorStyles)(tableSortColumnDiscoverability)
|
|
270
286
|
}, (0, _react2.jsx)("div", {
|
|
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
|
|
271
288
|
css: (0, _styles2.cellColourPreviewStyles)(background)
|
|
272
289
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
273
290
|
,
|
|
@@ -322,7 +339,9 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
322
339
|
value: {
|
|
323
340
|
name: 'header_column'
|
|
324
341
|
},
|
|
325
|
-
elemAfter:
|
|
342
|
+
elemAfter:
|
|
343
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
344
|
+
(0, _react2.jsx)("div", {
|
|
326
345
|
css: _styles2.toggleStyles
|
|
327
346
|
}, (0, _react2.jsx)(_toggle.default, {
|
|
328
347
|
id: "toggle-header-column",
|
|
@@ -335,7 +354,9 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
335
354
|
value: {
|
|
336
355
|
name: 'header_row'
|
|
337
356
|
},
|
|
338
|
-
elemAfter:
|
|
357
|
+
elemAfter:
|
|
358
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
359
|
+
(0, _react2.jsx)("div", {
|
|
339
360
|
css: _styles2.toggleStyles
|
|
340
361
|
}, (0, _react2.jsx)(_toggle.default, {
|
|
341
362
|
id: "toggle-header-row",
|
|
@@ -351,7 +372,9 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
351
372
|
value: {
|
|
352
373
|
name: 'row_numbers'
|
|
353
374
|
},
|
|
354
|
-
elemAfter:
|
|
375
|
+
elemAfter:
|
|
376
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
377
|
+
(0, _react2.jsx)("div", {
|
|
355
378
|
css: _styles2.toggleStyles
|
|
356
379
|
}, (0, _react2.jsx)(_toggle.default, {
|
|
357
380
|
id: "toggle-row-numbers",
|
|
@@ -457,7 +480,7 @@ var DragMenu = exports.DragMenu = /*#__PURE__*/_react.default.memo(function (_re
|
|
|
457
480
|
return null;
|
|
458
481
|
}
|
|
459
482
|
if (allowBackgroundColor) {
|
|
460
|
-
menuItems[0].items.unshift(createBackgroundColorMenuItem());
|
|
483
|
+
tableSortColumnDiscoverability ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
|
|
461
484
|
}
|
|
462
485
|
|
|
463
486
|
// If first row, add toggle for Header row, default is true
|
|
@@ -41,7 +41,9 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
41
41
|
_ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
|
|
42
42
|
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
|
|
43
43
|
_ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
|
|
44
|
-
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC
|
|
44
|
+
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC,
|
|
45
|
+
_ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
|
|
46
|
+
tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
|
|
45
47
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
46
48
|
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
47
49
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
@@ -79,7 +81,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
79
81
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
80
82
|
tableDuplicateCellColouring: tableDuplicateCellColouring,
|
|
81
83
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
82
|
-
isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption
|
|
84
|
+
isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
|
|
85
|
+
tableSortColumnDiscoverability: tableSortColumnDiscoverability
|
|
83
86
|
}));
|
|
84
87
|
};
|
|
85
88
|
FloatingDragMenu.displayName = 'FloatingDragMenu';
|