@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/dist/esm/plugin.js
CHANGED
|
@@ -431,13 +431,14 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
431
431
|
},
|
|
432
432
|
pluginsOptions: {
|
|
433
433
|
quickInsert: function quickInsert(_ref19) {
|
|
434
|
+
var _options$getEditorFea3;
|
|
434
435
|
var formatMessage = _ref19.formatMessage;
|
|
435
436
|
return [{
|
|
436
437
|
id: 'table',
|
|
437
438
|
title: formatMessage(messages.table),
|
|
438
439
|
description: formatMessage(messages.tableDescription),
|
|
439
440
|
keywords: ['cell', 'table'],
|
|
440
|
-
priority: 600,
|
|
441
|
+
priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
|
|
441
442
|
keyshortcut: tooltip(toggleTable),
|
|
442
443
|
icon: function icon() {
|
|
443
444
|
return /*#__PURE__*/React.createElement(IconTable, null);
|
|
@@ -6,7 +6,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
6
6
|
import { stopKeyboardColumnResizing } from '../../commands/column-resize';
|
|
7
7
|
import { updateResizeHandleDecorations } from '../../commands/misc';
|
|
8
8
|
import { updateColumnWidths } from '../../transforms';
|
|
9
|
-
import { getSelectedColumnIndexes } from '../../utils';
|
|
9
|
+
import { getSelectedColumnIndexes, isTableNested } from '../../utils';
|
|
10
10
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
11
11
|
import { META_KEYS } from '../table-analytics';
|
|
12
12
|
import { evenColumns, setDragging, stopResizing } from './commands';
|
|
@@ -141,7 +141,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
141
141
|
_shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
142
142
|
}
|
|
143
143
|
var resizedDelta = clientX - startX;
|
|
144
|
-
if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
|
|
144
|
+
if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
|
|
145
145
|
var newResizeState = resizeColumnAndTable(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale);
|
|
146
146
|
tr = updateColumnWidths(newResizeState, table, start)(tr);
|
|
147
147
|
tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
|
|
@@ -218,7 +218,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
218
218
|
if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
|
|
219
219
|
shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
220
220
|
}
|
|
221
|
-
if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
|
|
221
|
+
if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
|
|
222
222
|
resizeColumnAndTable(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
|
|
223
223
|
} else {
|
|
224
224
|
resizeColumn(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
// Resize a given column by an amount from the current state
|
|
5
5
|
|
|
6
6
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
7
|
+
import { ALIGN_START } from '../../../utils/alignment';
|
|
7
8
|
import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
|
|
8
9
|
import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
|
|
9
10
|
import { updateColgroup } from './resize-state';
|
|
@@ -31,7 +32,7 @@ export var resizeColumnAndTable = function resizeColumnAndTable(resizeState, col
|
|
|
31
32
|
var tableWidth = tableRef.clientWidth;
|
|
32
33
|
var tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
|
|
33
34
|
var isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
|
|
34
|
-
var resizeAmount = amount * 2;
|
|
35
|
+
var resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
|
|
35
36
|
|
|
36
37
|
// todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
|
|
37
38
|
// let scalePercent = 1;
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -146,6 +146,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
|
|
|
146
146
|
},
|
|
147
147
|
selected: false,
|
|
148
148
|
disabled: false,
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
149
150
|
elemAfter: jsx("div", {
|
|
150
151
|
css: shortcutStyle
|
|
151
152
|
}, tooltip(addColumnAfter))
|
|
@@ -165,6 +166,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
|
|
|
165
166
|
},
|
|
166
167
|
selected: false,
|
|
167
168
|
disabled: false,
|
|
169
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
168
170
|
elemAfter: jsx("div", {
|
|
169
171
|
css: shortcutStyle
|
|
170
172
|
}, tooltip(addRowAfter))
|
|
@@ -297,6 +299,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
|
|
|
297
299
|
},
|
|
298
300
|
selected: false,
|
|
299
301
|
disabled: false,
|
|
302
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
300
303
|
elemAfter: jsx("div", {
|
|
301
304
|
css: shortcutStyle
|
|
302
305
|
}, tooltip(backspace))
|
|
@@ -152,10 +152,12 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
152
152
|
className: ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE,
|
|
153
153
|
"data-testid": "table-drag-handle-clickable-zone-button",
|
|
154
154
|
style: {
|
|
155
|
-
height: isRow ?
|
|
155
|
+
height: isRow ? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
156
|
+
"calc(100% - ".concat(dragTableInsertColumnButtonSize, "px)") : "var(--ds-space-200, 16px)",
|
|
156
157
|
// 16px here because it's the size of drag handle button's large side
|
|
157
158
|
width: isRow ? "var(--ds-space-200, 16px)" // 16px here because it's the size of drag handle button's large side
|
|
158
|
-
:
|
|
159
|
+
: // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
160
|
+
"calc(100% - ".concat(dragTableInsertColumnButtonSize, "px)"),
|
|
159
161
|
left: isRow ? "var(--ds-space-050, 4px)" : undefined,
|
|
160
162
|
bottom: isColumn ? "var(--ds-space-0, 0px)" : undefined,
|
|
161
163
|
alignSelf: isColumn ? 'none' : 'center',
|
|
@@ -110,7 +110,7 @@ export var FixedButton = function FixedButton(_ref2) {
|
|
|
110
110
|
position: 'fixed',
|
|
111
111
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
112
112
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
113
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
113
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
114
114
|
zIndex: akEditorTableCellOnStickyHeaderZIndex,
|
|
115
115
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
116
116
|
left: calcLeftPos({
|
|
@@ -45,7 +45,11 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
45
45
|
}
|
|
46
46
|
var labelCellOptions = formatMessage(messages.cellOptions);
|
|
47
47
|
var button = jsx("div", {
|
|
48
|
-
css: [
|
|
48
|
+
css: [
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
50
|
+
tableFloatingCellButtonStyles(),
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
52
|
+
isContextualMenuOpen && tableFloatingCellButtonSelectedStyles()]
|
|
49
53
|
}, jsx(ToolbarButton
|
|
50
54
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
51
55
|
, {
|
|
@@ -3,14 +3,17 @@ import { N0, N20, N30A, N700 } from '@atlaskit/theme/colors';
|
|
|
3
3
|
import { contextualMenuTriggerSize } from '../consts';
|
|
4
4
|
export var tableFloatingCellButtonStyles = function tableFloatingCellButtonStyles() {
|
|
5
5
|
return css({
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
6
7
|
'> div': {
|
|
7
8
|
// Sits behind button to provide surface-color background
|
|
8
9
|
background: "var(--ds-surface, ".concat(N20, ")"),
|
|
9
10
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
10
11
|
display: 'flex',
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
11
13
|
height: "".concat(contextualMenuTriggerSize + 2, "px"),
|
|
12
14
|
flexDirection: 'column'
|
|
13
15
|
},
|
|
16
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
14
17
|
'&& button': {
|
|
15
18
|
background: "var(--ds-background-neutral, none)",
|
|
16
19
|
flexDirection: 'column',
|
|
@@ -21,15 +24,19 @@ export var tableFloatingCellButtonStyles = function tableFloatingCellButtonStyle
|
|
|
21
24
|
height: 'calc(100% - 4px)',
|
|
22
25
|
display: 'flex'
|
|
23
26
|
},
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
24
28
|
'&& button:hover': {
|
|
25
29
|
background: "var(--ds-background-neutral-hovered, ".concat(N30A, ")")
|
|
26
30
|
},
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
27
32
|
'&& button:active': {
|
|
28
33
|
background: "var(--ds-background-neutral-pressed, rgba(179, 212, 255, 0.6))"
|
|
29
34
|
},
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
30
36
|
'&& button > span': {
|
|
31
37
|
margin: "0px ".concat("var(--ds-space-negative-050, -4px)")
|
|
32
38
|
},
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
33
40
|
'&& span': {
|
|
34
41
|
pointerEvents: 'none'
|
|
35
42
|
}
|
|
@@ -37,12 +44,15 @@ export var tableFloatingCellButtonStyles = function tableFloatingCellButtonStyle
|
|
|
37
44
|
};
|
|
38
45
|
export var tableFloatingCellButtonSelectedStyles = function tableFloatingCellButtonSelectedStyles() {
|
|
39
46
|
return css({
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
40
48
|
'&& button': {
|
|
41
49
|
background: "var(--ds-background-selected, ".concat(N700, ")")
|
|
42
50
|
},
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
43
52
|
'&& button:hover': {
|
|
44
53
|
background: "var(--ds-background-selected-hovered, ".concat(N700, ")")
|
|
45
54
|
},
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
46
56
|
'&& button:active': {
|
|
47
57
|
background: "var(--ds-background-selected-pressed, ".concat(N700, ")")
|
|
48
58
|
}
|
|
@@ -84,7 +84,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
84
84
|
value: {
|
|
85
85
|
name: 'background'
|
|
86
86
|
},
|
|
87
|
-
elemBefore: isDragAndDropEnabled ?
|
|
87
|
+
elemBefore: isDragAndDropEnabled ?
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
89
|
+
jsx("span", {
|
|
88
90
|
css: elementBeforeIconStyles
|
|
89
91
|
}, jsx(EditorBackgroundColorIcon, {
|
|
90
92
|
label: formatMessage(messages.backgroundColor),
|
|
@@ -95,6 +97,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
95
97
|
jsx("div", {
|
|
96
98
|
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
97
99
|
}, jsx("div", {
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
98
101
|
css: cellColourPreviewStyles(background)
|
|
99
102
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
100
103
|
,
|
|
@@ -131,7 +134,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
131
134
|
name: 'merge'
|
|
132
135
|
},
|
|
133
136
|
isDisabled: !canMergeCells(state.tr),
|
|
134
|
-
elemBefore: isDragAndDropEnabled ?
|
|
137
|
+
elemBefore: isDragAndDropEnabled ?
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
139
|
+
jsx("span", {
|
|
135
140
|
css: elementBeforeIconStyles
|
|
136
141
|
}, jsx(MergeCellsIcon, null)) : undefined
|
|
137
142
|
}, {
|
|
@@ -140,7 +145,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
140
145
|
name: 'split'
|
|
141
146
|
},
|
|
142
147
|
isDisabled: !splitCell(state),
|
|
143
|
-
elemBefore: isDragAndDropEnabled ?
|
|
148
|
+
elemBefore: isDragAndDropEnabled ?
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
150
|
+
jsx("span", {
|
|
144
151
|
css: elementBeforeIconStyles
|
|
145
152
|
}, jsx(SplitCellIcon, null)) : undefined
|
|
146
153
|
}];
|
|
@@ -158,10 +165,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
158
165
|
value: {
|
|
159
166
|
name: 'insert_column'
|
|
160
167
|
},
|
|
168
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
161
169
|
elemAfter: jsx("div", {
|
|
162
170
|
css: shortcutStyle
|
|
163
171
|
}, tooltip(addColumnAfter)),
|
|
164
|
-
elemBefore: isDragAndDropEnabled ?
|
|
172
|
+
elemBefore: isDragAndDropEnabled ?
|
|
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
|
|
174
|
+
jsx("span", {
|
|
165
175
|
css: elementBeforeIconStyles
|
|
166
176
|
}, jsx(AddColRightIcon, null)) : undefined
|
|
167
177
|
};
|
|
@@ -177,10 +187,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
177
187
|
value: {
|
|
178
188
|
name: 'insert_row'
|
|
179
189
|
},
|
|
190
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
180
191
|
elemAfter: jsx("div", {
|
|
181
192
|
css: shortcutStyle
|
|
182
193
|
}, tooltip(addRowAfter)),
|
|
183
|
-
elemBefore: isDragAndDropEnabled ?
|
|
194
|
+
elemBefore: isDragAndDropEnabled ?
|
|
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
|
|
196
|
+
jsx("span", {
|
|
184
197
|
css: elementBeforeIconStyles
|
|
185
198
|
}, jsx(AddRowBelowIcon, null)) : undefined
|
|
186
199
|
};
|
|
@@ -205,10 +218,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
205
218
|
value: {
|
|
206
219
|
name: 'clear'
|
|
207
220
|
},
|
|
221
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
208
222
|
elemAfter: jsx("div", {
|
|
209
223
|
css: shortcutStyle
|
|
210
224
|
}, tooltip(backspace)),
|
|
211
|
-
elemBefore: isDragAndDropEnabled ?
|
|
225
|
+
elemBefore: isDragAndDropEnabled ?
|
|
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
|
|
227
|
+
jsx("span", {
|
|
212
228
|
css: elementBeforeIconStyles
|
|
213
229
|
}, jsx(CrossCircleIcon, {
|
|
214
230
|
label: formatMessage(messages.clearCells, {
|
|
@@ -234,7 +250,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
234
250
|
value: {
|
|
235
251
|
name: 'delete_column'
|
|
236
252
|
},
|
|
237
|
-
elemBefore: isDragAndDropEnabled ?
|
|
253
|
+
elemBefore: isDragAndDropEnabled ?
|
|
254
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
255
|
+
jsx("span", {
|
|
238
256
|
css: elementBeforeIconStyles
|
|
239
257
|
}, jsx(RemoveIcon, {
|
|
240
258
|
label: formatMessage(messages.removeColumns, {
|
|
@@ -260,7 +278,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
260
278
|
value: {
|
|
261
279
|
name: 'delete_row'
|
|
262
280
|
},
|
|
263
|
-
elemBefore: isDragAndDropEnabled ?
|
|
281
|
+
elemBefore: isDragAndDropEnabled ?
|
|
282
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
283
|
+
jsx("span", {
|
|
264
284
|
css: elementBeforeIconStyles
|
|
265
285
|
}, jsx(RemoveIcon, {
|
|
266
286
|
label: formatMessage(messages.removeRows, {
|
|
@@ -328,17 +348,22 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
328
348
|
});
|
|
329
349
|
_defineProperty(_assertThisInitialized(_this), "createOriginalContextMenuItems", function () {
|
|
330
350
|
var items = [];
|
|
351
|
+
var getEditorFeatureFlags = _this.props.getEditorFeatureFlags;
|
|
352
|
+
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
353
|
+
_ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
|
|
354
|
+
tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
|
|
355
|
+
var sortColumnItems = _this.createSortColumnItems();
|
|
331
356
|
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
357
|
+
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
358
|
+
tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
|
|
332
359
|
backgroundColorItem && items.push(backgroundColorItem);
|
|
333
360
|
items.push(_this.createInsertColumnItem());
|
|
334
361
|
items.push(_this.createInsertRowItem());
|
|
335
362
|
items.push(_this.createDeleteColumnItem());
|
|
336
363
|
items.push(_this.createDeleteRowItem());
|
|
337
364
|
items.push.apply(items, _toConsumableArray(_this.createMergeSplitCellItems()));
|
|
338
|
-
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
339
365
|
distributeColumnsItem && items.push(distributeColumnsItem);
|
|
340
|
-
|
|
341
|
-
sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
|
|
366
|
+
!tableSortColumnDiscoverability && sortColumnItems && items.push.apply(items, _toConsumableArray(sortColumnItems));
|
|
342
367
|
items.push(_this.createClearCellsItem());
|
|
343
368
|
return [{
|
|
344
369
|
items: items
|
|
@@ -369,8 +394,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
369
394
|
items[1].items.push(deleteRowItem);
|
|
370
395
|
return items;
|
|
371
396
|
});
|
|
372
|
-
_defineProperty(_assertThisInitialized(_this), "onMenuItemActivated", function (
|
|
373
|
-
var item =
|
|
397
|
+
_defineProperty(_assertThisInitialized(_this), "onMenuItemActivated", function (_ref3) {
|
|
398
|
+
var item = _ref3.item;
|
|
374
399
|
var _this$props10 = _this.props,
|
|
375
400
|
editorView = _this$props10.editorView,
|
|
376
401
|
selectionRect = _this$props10.selectionRect,
|
|
@@ -384,11 +409,11 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
384
409
|
targetCellPosition = _getPluginState11.targetCellPosition,
|
|
385
410
|
_getPluginState11$isT = _getPluginState11.isTableScalingEnabled,
|
|
386
411
|
isTableScalingEnabled = _getPluginState11$isT === void 0 ? false : _getPluginState11$isT;
|
|
387
|
-
var
|
|
388
|
-
|
|
389
|
-
tableDuplicateCellColouring =
|
|
390
|
-
|
|
391
|
-
tableWithFixedColumnWidthsOption =
|
|
412
|
+
var _ref4 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
413
|
+
_ref4$tableDuplicateC = _ref4.tableDuplicateCellColouring,
|
|
414
|
+
tableDuplicateCellColouring = _ref4$tableDuplicateC === void 0 ? false : _ref4$tableDuplicateC,
|
|
415
|
+
_ref4$tableWithFixedC = _ref4.tableWithFixedColumnWidthsOption,
|
|
416
|
+
tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
|
|
392
417
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
393
418
|
switch (item.value.name) {
|
|
394
419
|
case 'sort_column_desc':
|
|
@@ -463,8 +488,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
463
488
|
isSubmenuOpen: false
|
|
464
489
|
});
|
|
465
490
|
});
|
|
466
|
-
_defineProperty(_assertThisInitialized(_this), "handleItemMouseEnter", function (
|
|
467
|
-
var item =
|
|
491
|
+
_defineProperty(_assertThisInitialized(_this), "handleItemMouseEnter", function (_ref5) {
|
|
492
|
+
var item = _ref5.item;
|
|
468
493
|
var _this$props12 = _this.props,
|
|
469
494
|
_this$props12$editorV = _this$props12.editorView,
|
|
470
495
|
state = _this$props12$editorV.state,
|
|
@@ -487,8 +512,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
487
512
|
hoverMergedCells()(state, dispatch);
|
|
488
513
|
}
|
|
489
514
|
});
|
|
490
|
-
_defineProperty(_assertThisInitialized(_this), "handleItemMouseLeave", function (
|
|
491
|
-
var item =
|
|
515
|
+
_defineProperty(_assertThisInitialized(_this), "handleItemMouseLeave", function (_ref6) {
|
|
516
|
+
var item = _ref6.item;
|
|
492
517
|
var _this$props$editorVie2 = _this.props.editorView,
|
|
493
518
|
state = _this$props$editorVie2.state,
|
|
494
519
|
dispatch = _this$props$editorVie2.dispatch;
|
|
@@ -8,10 +8,13 @@ import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../
|
|
|
8
8
|
export var cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
|
|
9
9
|
return css({
|
|
10
10
|
'&::before': {
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
11
12
|
background: selectedColor
|
|
12
13
|
}
|
|
13
14
|
});
|
|
14
15
|
};
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
15
18
|
export var elementBeforeIconStyles = css({
|
|
16
19
|
marginRight: "var(--ds-space-negative-075, -6px)",
|
|
17
20
|
display: 'flex'
|
|
@@ -202,10 +202,12 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
202
202
|
position: 'fixed',
|
|
203
203
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
204
204
|
top: pos.top,
|
|
205
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
205
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
206
206
|
zIndex: stickyRowZIndex,
|
|
207
207
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
208
|
-
left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (
|
|
208
|
+
left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
210
|
+
this.props.isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0)
|
|
209
211
|
}
|
|
210
212
|
}, button), mountTo);
|
|
211
213
|
}
|
|
@@ -89,8 +89,16 @@ var MapDragMenuOptionIdToMessage = {
|
|
|
89
89
|
plural: null
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
var
|
|
93
|
-
var
|
|
92
|
+
var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnDiscoverability) {
|
|
93
|
+
var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down']];
|
|
94
|
+
var sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
|
|
95
|
+
tableSortColumnDiscoverability ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
|
|
96
|
+
return groupedDragMenuConfig;
|
|
97
|
+
};
|
|
98
|
+
var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage) {
|
|
99
|
+
var tableSortColumnDiscoverability = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
100
|
+
var selectionRect = arguments.length > 3 ? arguments[3] : undefined;
|
|
101
|
+
var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnDiscoverability);
|
|
94
102
|
var menuItemsArr = _toConsumableArray(Array(groupedDragMenuConfig.length)).map(function () {
|
|
95
103
|
return [];
|
|
96
104
|
});
|
|
@@ -138,11 +146,14 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, for
|
|
|
138
146
|
name: item.id
|
|
139
147
|
},
|
|
140
148
|
isDisabled: item.disabled,
|
|
141
|
-
elemBefore: item.icon ?
|
|
149
|
+
elemBefore: item.icon ?
|
|
150
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
151
|
+
jsx("span", {
|
|
142
152
|
css: elementBeforeIconStyles
|
|
143
153
|
}, jsx(item.icon, {
|
|
144
154
|
label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options)
|
|
145
155
|
})) : undefined,
|
|
156
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
146
157
|
elemAfter: item.keymap ? jsx("div", {
|
|
147
158
|
css: shortcutStyle
|
|
148
159
|
}, item.keymap) : undefined
|
|
@@ -183,7 +194,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
183
194
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
184
195
|
tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
|
|
185
196
|
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
|
|
186
|
-
isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled
|
|
197
|
+
isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
|
|
198
|
+
tableSortColumnDiscoverability = _ref.tableSortColumnDiscoverability;
|
|
187
199
|
var state = editorView.state,
|
|
188
200
|
dispatch = editorView.dispatch;
|
|
189
201
|
var selection = state.selection;
|
|
@@ -207,8 +219,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
207
219
|
hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
|
|
208
220
|
}
|
|
209
221
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
210
|
-
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
|
|
211
|
-
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
222
|
+
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnDiscoverability);
|
|
223
|
+
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnDiscoverability, selectionRect),
|
|
212
224
|
menuItems = _convertToDropdownIte.menuItems,
|
|
213
225
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
214
226
|
var handleSubMenuRef = function handleSubMenuRef(ref) {
|
|
@@ -246,7 +258,9 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
246
258
|
value: {
|
|
247
259
|
name: 'background'
|
|
248
260
|
},
|
|
249
|
-
elemBefore:
|
|
261
|
+
elemBefore:
|
|
262
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
263
|
+
jsx("span", {
|
|
250
264
|
css: elementBeforeIconStyles
|
|
251
265
|
}, jsx(EditorBackgroundColorIcon, {
|
|
252
266
|
label: formatMessage(messages.backgroundColor),
|
|
@@ -254,9 +268,12 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
254
268
|
})),
|
|
255
269
|
elemAfter: jsx("div", {
|
|
256
270
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
257
|
-
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
258
|
-
css
|
|
271
|
+
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
272
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
273
|
+
,
|
|
274
|
+
css: dragMenuBackgroundColorStyles(tableSortColumnDiscoverability)
|
|
259
275
|
}, jsx("div", {
|
|
276
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
260
277
|
css: cellColourPreviewStyles(background)
|
|
261
278
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
262
279
|
,
|
|
@@ -311,7 +328,9 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
311
328
|
value: {
|
|
312
329
|
name: 'header_column'
|
|
313
330
|
},
|
|
314
|
-
elemAfter:
|
|
331
|
+
elemAfter:
|
|
332
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
333
|
+
jsx("div", {
|
|
315
334
|
css: toggleStyles
|
|
316
335
|
}, jsx(Toggle, {
|
|
317
336
|
id: "toggle-header-column",
|
|
@@ -324,7 +343,9 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
324
343
|
value: {
|
|
325
344
|
name: 'header_row'
|
|
326
345
|
},
|
|
327
|
-
elemAfter:
|
|
346
|
+
elemAfter:
|
|
347
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
348
|
+
jsx("div", {
|
|
328
349
|
css: toggleStyles
|
|
329
350
|
}, jsx(Toggle, {
|
|
330
351
|
id: "toggle-header-row",
|
|
@@ -340,7 +361,9 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
340
361
|
value: {
|
|
341
362
|
name: 'row_numbers'
|
|
342
363
|
},
|
|
343
|
-
elemAfter:
|
|
364
|
+
elemAfter:
|
|
365
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
366
|
+
jsx("div", {
|
|
344
367
|
css: toggleStyles
|
|
345
368
|
}, jsx(Toggle, {
|
|
346
369
|
id: "toggle-row-numbers",
|
|
@@ -446,7 +469,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
446
469
|
return null;
|
|
447
470
|
}
|
|
448
471
|
if (allowBackgroundColor) {
|
|
449
|
-
menuItems[0].items.unshift(createBackgroundColorMenuItem());
|
|
472
|
+
tableSortColumnDiscoverability ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
|
|
450
473
|
}
|
|
451
474
|
|
|
452
475
|
// If first row, add toggle for Header row, default is true
|
|
@@ -34,7 +34,9 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
34
34
|
_ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
|
|
35
35
|
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
|
|
36
36
|
_ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
|
|
37
|
-
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC
|
|
37
|
+
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC,
|
|
38
|
+
_ref2$tableSortColumn = _ref2.tableSortColumnDiscoverability,
|
|
39
|
+
tableSortColumnDiscoverability = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
|
|
38
40
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
39
41
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
40
42
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
@@ -72,7 +74,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
72
74
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
73
75
|
tableDuplicateCellColouring: tableDuplicateCellColouring,
|
|
74
76
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
75
|
-
isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption
|
|
77
|
+
isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
|
|
78
|
+
tableSortColumnDiscoverability: tableSortColumnDiscoverability
|
|
76
79
|
}));
|
|
77
80
|
};
|
|
78
81
|
FloatingDragMenu.displayName = 'FloatingDragMenu';
|
|
@@ -4,32 +4,43 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { tableBackgroundBorderColor } from '@atlaskit/adf-schema';
|
|
5
5
|
import { N60A, N90 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { TableCssClassName as ClassName } from '../../types';
|
|
7
|
-
import { dragMenuDropdownWidth } from '../consts';
|
|
7
|
+
import { dragMenuDropdownWidth, TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT, TABLE_DRAG_MENU_PADDING_TOP, TABLE_DRAG_MENU_SORT_GROUP_HEIGHT } from '../consts';
|
|
8
8
|
export var cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
|
|
9
9
|
return css({
|
|
10
10
|
'&::before': {
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
11
12
|
background: selectedColor
|
|
12
13
|
}
|
|
13
14
|
});
|
|
14
15
|
};
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
15
18
|
export var elementBeforeIconStyles = css({
|
|
16
19
|
marginRight: "var(--ds-space-negative-075, -6px)",
|
|
17
20
|
display: 'flex'
|
|
18
21
|
});
|
|
19
22
|
|
|
20
23
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
21
|
-
export var dragMenuBackgroundColorStyles =
|
|
24
|
+
export var dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
|
|
25
|
+
var tableSortColumnDiscoverability = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
26
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), ClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), tableSortColumnDiscoverability ? TABLE_DRAG_MENU_PADDING_TOP + TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, dragMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.DRAG_SUBMENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
22
30
|
export var toggleStyles = css({
|
|
23
31
|
display: 'flex',
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
24
33
|
"input[type='checkbox']": {
|
|
25
34
|
width: '30px',
|
|
26
35
|
height: '14px',
|
|
27
36
|
pointerEvents: 'initial',
|
|
28
37
|
cursor: 'pointer'
|
|
29
38
|
},
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
30
40
|
'> label': {
|
|
31
41
|
margin: '0px',
|
|
32
42
|
pointerEvents: 'none',
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
33
44
|
'> span': {
|
|
34
45
|
pointerEvents: 'none'
|
|
35
46
|
}
|
|
@@ -105,7 +105,9 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
105
105
|
style: {
|
|
106
106
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
107
107
|
marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
|
|
108
|
-
borderLeft:
|
|
108
|
+
borderLeft:
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
110
|
+
isDragAndDropEnabled && tableActive ? "1px solid ".concat(tableBorderColor) : undefined
|
|
109
111
|
},
|
|
110
112
|
contentEditable: false
|
|
111
113
|
}, rowHeights.map(function (rowHeight, index) {
|
|
@@ -80,7 +80,7 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
80
80
|
marginTop: "".concat(marginTop, "px"),
|
|
81
81
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
82
82
|
top: thisRowSticky ? "".concat(_this2.props.stickyTop + 3, "px") : undefined,
|
|
83
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
83
|
+
// 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
|
|
84
84
|
paddingTop: thisRowSticky ? "".concat(tableControlsSpacing, "px") : undefined
|
|
85
85
|
}
|
|
86
86
|
}, /*#__PURE__*/React.createElement("button", {
|