@atlaskit/editor-plugin-table 7.17.0 → 7.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.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/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/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/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/consts.d.ts +3 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +2 -2
- package/src/nodeviews/ExternalDropTargets.tsx +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
|
@@ -70,8 +70,11 @@ const FloatingDragMenu = ({
|
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
const {
|
|
74
|
-
|
|
73
|
+
const {
|
|
74
|
+
tableDuplicateCellColouring = false,
|
|
75
|
+
tableWithFixedColumnWidthsOption = false,
|
|
76
|
+
tableSortColumnDiscoverability = false,
|
|
77
|
+
} = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
|
|
75
78
|
|
|
76
79
|
const shouldUseIncreasedScalingPercent =
|
|
77
80
|
isTableScalingEnabled &&
|
|
@@ -116,6 +119,7 @@ const FloatingDragMenu = ({
|
|
|
116
119
|
tableDuplicateCellColouring={tableDuplicateCellColouring}
|
|
117
120
|
shouldUseIncreasedScalingPercent={shouldUseIncreasedScalingPercent}
|
|
118
121
|
isTableFixedColumnWidthsOptionEnabled={tableWithFixedColumnWidthsOption}
|
|
122
|
+
tableSortColumnDiscoverability={tableSortColumnDiscoverability}
|
|
119
123
|
/>
|
|
120
124
|
</Popup>
|
|
121
125
|
);
|
|
@@ -5,29 +5,42 @@ import { N60A, N90 } from '@atlaskit/theme/colors';
|
|
|
5
5
|
import { token } from '@atlaskit/tokens';
|
|
6
6
|
|
|
7
7
|
import { TableCssClassName as ClassName } from '../../types';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
dragMenuDropdownWidth,
|
|
10
|
+
TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT,
|
|
11
|
+
TABLE_DRAG_MENU_PADDING_TOP,
|
|
12
|
+
TABLE_DRAG_MENU_SORT_GROUP_HEIGHT,
|
|
13
|
+
} from '../consts';
|
|
9
14
|
|
|
10
15
|
export const cellColourPreviewStyles = (selectedColor: string) =>
|
|
11
16
|
css({
|
|
12
17
|
'&::before': {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
13
19
|
background: selectedColor,
|
|
14
20
|
},
|
|
15
21
|
});
|
|
16
22
|
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
17
24
|
export const elementBeforeIconStyles = css({
|
|
18
25
|
marginRight: token('space.negative.075', '-6px'),
|
|
19
26
|
display: 'flex',
|
|
20
27
|
});
|
|
21
28
|
|
|
22
29
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
23
|
-
export const dragMenuBackgroundColorStyles =
|
|
30
|
+
export const dragMenuBackgroundColorStyles = (
|
|
31
|
+
tableSortColumnDiscoverability: boolean = false,
|
|
32
|
+
) => css`
|
|
24
33
|
.${ClassName.DRAG_SUBMENU} {
|
|
25
34
|
border-radius: ${token('border.radius', '3px')};
|
|
26
35
|
background: ${token('elevation.surface.overlay', 'white')};
|
|
27
36
|
box-shadow: ${token('elevation.shadow.overlay', `0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`)};
|
|
28
37
|
display: block;
|
|
29
38
|
position: absolute;
|
|
30
|
-
top:
|
|
39
|
+
top: ${tableSortColumnDiscoverability
|
|
40
|
+
? TABLE_DRAG_MENU_PADDING_TOP +
|
|
41
|
+
TABLE_DRAG_MENU_SORT_GROUP_HEIGHT +
|
|
42
|
+
TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT
|
|
43
|
+
: 0}px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker
|
|
31
44
|
left: ${dragMenuDropdownWidth}px;
|
|
32
45
|
padding: ${token('space.100', '8px')};
|
|
33
46
|
|
|
@@ -57,17 +70,21 @@ export const dragMenuBackgroundColorStyles = css`
|
|
|
57
70
|
}
|
|
58
71
|
`;
|
|
59
72
|
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
60
74
|
export const toggleStyles = css({
|
|
61
75
|
display: 'flex',
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
62
77
|
"input[type='checkbox']": {
|
|
63
78
|
width: '30px',
|
|
64
79
|
height: '14px',
|
|
65
80
|
pointerEvents: 'initial',
|
|
66
81
|
cursor: 'pointer',
|
|
67
82
|
},
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
68
84
|
'> label': {
|
|
69
85
|
margin: '0px',
|
|
70
86
|
pointerEvents: 'none',
|
|
87
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
71
88
|
'> span': {
|
|
72
89
|
pointerEvents: 'none',
|
|
73
90
|
},
|
|
@@ -40,6 +40,7 @@ export default class NumberColumn extends Component<Props, any> {
|
|
|
40
40
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
41
41
|
marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
|
|
42
42
|
borderLeft:
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
43
44
|
isDragAndDropEnabled && tableActive ? `1px solid ${tableBorderColor}` : undefined,
|
|
44
45
|
}}
|
|
45
46
|
contentEditable={false}
|
|
@@ -79,7 +79,7 @@ class RowControlsComponent extends Component<Props & WrappedComponentProps> {
|
|
|
79
79
|
marginTop: `${marginTop}px`,
|
|
80
80
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
81
81
|
top: thisRowSticky ? `${this.props.stickyTop! + 3}px` : undefined,
|
|
82
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
82
|
+
// 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
|
|
83
83
|
paddingTop: thisRowSticky ? `${tableControlsSpacing}px` : undefined,
|
|
84
84
|
}}
|
|
85
85
|
>
|
|
@@ -283,11 +283,13 @@ const DragControlsComponent = ({
|
|
|
283
283
|
style={{
|
|
284
284
|
gridTemplateRows: heights,
|
|
285
285
|
gridTemplateColumns: isDragging
|
|
286
|
-
?
|
|
286
|
+
? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
287
|
+
`${dropTargetExtendedWidth}px 14px ${tableWidth}px`
|
|
287
288
|
: '0px 14px 0px',
|
|
288
289
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
289
290
|
left: isDragging
|
|
290
|
-
?
|
|
291
|
+
? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
292
|
+
`-${dropTargetExtendedWidth + 2}px`
|
|
291
293
|
: token('space.negative.025', '-2px'),
|
|
292
294
|
}}
|
|
293
295
|
onMouseMove={handleMouseMove}
|
package/src/ui/common-styles.ts
CHANGED
|
@@ -1081,7 +1081,7 @@ export const tableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
1081
1081
|
${shadowSentinelStyles}
|
|
1082
1082
|
`;
|
|
1083
1083
|
|
|
1084
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
1084
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
1085
1085
|
export const tableFullPageEditorStyles = css`
|
|
1086
1086
|
.ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
1087
1087
|
margin-left: 0;
|
|
@@ -1091,6 +1091,7 @@ export const tableFullPageEditorStyles = css`
|
|
|
1091
1091
|
}
|
|
1092
1092
|
`;
|
|
1093
1093
|
|
|
1094
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
1094
1095
|
export const tableCommentEditorStyles = css`
|
|
1095
1096
|
.ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
1096
1097
|
margin-left: 0;
|
package/src/ui/consts.ts
CHANGED
|
@@ -94,6 +94,10 @@ export const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
|
|
|
94
94
|
// BUT it cannot be snapped to during resize due to padding being applied to the resizer wrapper. This accommodates that difference.
|
|
95
95
|
export const TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = -68;
|
|
96
96
|
|
|
97
|
+
export const TABLE_DRAG_MENU_SORT_GROUP_HEIGHT = 92;
|
|
98
|
+
export const TABLE_DRAG_MENU_PADDING_TOP = 4;
|
|
99
|
+
export const TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT = 6;
|
|
100
|
+
|
|
97
101
|
export const dragMenuDropdownWidth = 250;
|
|
98
102
|
export const dragTableInsertColumnButtonSize = 16;
|
|
99
103
|
export const dropTargetExtendedWidth = 150;
|
package/src/ui/ui-styles.ts
CHANGED
|
@@ -56,9 +56,12 @@ const InsertLine = (cssString?: string) => css`
|
|
|
56
56
|
|
|
57
57
|
const Marker = () =>
|
|
58
58
|
css({
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
59
60
|
backgroundColor: tableBorderColor,
|
|
60
61
|
position: 'absolute',
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
61
63
|
height: `${lineMarkerSize}px`,
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
62
65
|
width: `${lineMarkerSize}px`,
|
|
63
66
|
borderRadius: '50%',
|
|
64
67
|
pointerEvents: 'none',
|
|
@@ -268,8 +271,11 @@ export const dragCornerControlButton = () => css`
|
|
|
268
271
|
|
|
269
272
|
export const insertColumnButtonWrapper = () =>
|
|
270
273
|
css(
|
|
274
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
271
275
|
InsertButton(),
|
|
276
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
272
277
|
InsertButtonHover(),
|
|
278
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
273
279
|
InsertLine(
|
|
274
280
|
`
|
|
275
281
|
width: 2px;
|
|
@@ -280,12 +286,16 @@ export const insertColumnButtonWrapper = () =>
|
|
|
280
286
|
|
|
281
287
|
export const insertRowButtonWrapper = () =>
|
|
282
288
|
css(
|
|
289
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
283
290
|
InsertButton(),
|
|
291
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
284
292
|
InsertButtonHover(),
|
|
293
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
285
294
|
InsertLine(
|
|
286
295
|
`
|
|
287
296
|
height: 2px;
|
|
288
297
|
top: -11px;
|
|
298
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
289
299
|
left: ${tableInsertColumnButtonSize - 1}px;
|
|
290
300
|
`,
|
|
291
301
|
),
|
|
@@ -380,14 +390,17 @@ const overflowShadowWidhoutDnD = (isDragAndDropEnabled: boolean | undefined) =>
|
|
|
380
390
|
const columnHeaderButton = (cssString?: string) => {
|
|
381
391
|
return css(
|
|
382
392
|
{
|
|
393
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
383
394
|
background: tableHeaderCellBackgroundColor,
|
|
384
395
|
display: 'block',
|
|
385
396
|
boxSizing: 'border-box',
|
|
386
397
|
padding: 0,
|
|
398
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
387
399
|
':focus': {
|
|
388
400
|
outline: 'none',
|
|
389
401
|
},
|
|
390
402
|
},
|
|
403
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
391
404
|
cssString,
|
|
392
405
|
);
|
|
393
406
|
};
|
|
@@ -395,8 +408,11 @@ const columnHeaderButton = (cssString?: string) => {
|
|
|
395
408
|
const columnHeaderButtonSelected = () =>
|
|
396
409
|
css({
|
|
397
410
|
color: token('color.text.inverse', N0),
|
|
411
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
398
412
|
backgroundColor: tableToolbarSelectedColor,
|
|
413
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
399
414
|
borderColor: tableBorderSelectedColor,
|
|
415
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
400
416
|
zIndex: columnControlsSelectedZIndex,
|
|
401
417
|
});
|
|
402
418
|
|
|
@@ -623,6 +639,7 @@ export const hoveredCell = () => css`
|
|
|
623
639
|
}
|
|
624
640
|
`;
|
|
625
641
|
|
|
642
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
626
643
|
export const hoveredWarningCell = css`
|
|
627
644
|
:not(.${ClassName.IS_RESIZING})
|
|
628
645
|
.${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
|
|
@@ -761,8 +778,11 @@ export const resizeHandle = (isDragAndDropEnabled: boolean | undefined) => css`
|
|
|
761
778
|
const tableCellColumnInsertLineStyles = css({
|
|
762
779
|
content: "' '",
|
|
763
780
|
position: 'absolute',
|
|
781
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
764
782
|
height: `calc(100% + ${tableCellBorderWidth * 2}px)`,
|
|
783
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
765
784
|
width: `${insertLineWidth}px`,
|
|
785
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
766
786
|
zIndex: columnControlsZIndex * 2,
|
|
767
787
|
});
|
|
768
788
|
|
|
@@ -770,16 +790,21 @@ const tableCellRowInsertLineStyles = css({
|
|
|
770
790
|
content: "' '",
|
|
771
791
|
position: 'absolute',
|
|
772
792
|
left: token('space.negative.025', '-2px'),
|
|
793
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
773
794
|
height: `${insertLineWidth}px`,
|
|
795
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
774
796
|
width: `calc(100% + ${tableCellBorderWidth * 2}px)`,
|
|
797
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
775
798
|
zIndex: columnControlsZIndex * 2,
|
|
776
799
|
});
|
|
777
800
|
|
|
778
801
|
const insertLineActiveColor = css({
|
|
802
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
779
803
|
backgroundColor: tableBorderSelectedColor,
|
|
780
804
|
});
|
|
781
805
|
|
|
782
806
|
const insertLineInactiveColor = css({
|
|
807
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
783
808
|
backgroundColor: token('color.background.accent.gray.subtler', akEditorTableBorder),
|
|
784
809
|
});
|
|
785
810
|
|
package/src/utils/drag-menu.ts
CHANGED
|
@@ -162,7 +162,9 @@ export const getDragMenuConfig = (
|
|
|
162
162
|
tableDuplicateCellColouring = false,
|
|
163
163
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
164
164
|
shouldUseIncreasedScalingPercent = false,
|
|
165
|
+
tableSortColumnDiscoverability = false,
|
|
165
166
|
): DragMenuConfig[] => {
|
|
167
|
+
const { selection } = editorView.state;
|
|
166
168
|
const addOptions =
|
|
167
169
|
direction === 'row'
|
|
168
170
|
? [
|
|
@@ -193,8 +195,6 @@ export const getDragMenuConfig = (
|
|
|
193
195
|
keymap: addColumnAfter,
|
|
194
196
|
},
|
|
195
197
|
];
|
|
196
|
-
|
|
197
|
-
const { selection } = editorView.state;
|
|
198
198
|
const moveOptions =
|
|
199
199
|
direction === 'row'
|
|
200
200
|
? [
|
|
@@ -254,7 +254,25 @@ export const getDragMenuConfig = (
|
|
|
254
254
|
},
|
|
255
255
|
]
|
|
256
256
|
: [];
|
|
257
|
-
|
|
257
|
+
|
|
258
|
+
const sortConfigs = [
|
|
259
|
+
...sortOptions.map(({ label, order, icon }) => ({
|
|
260
|
+
id: `sort_column_${order}`,
|
|
261
|
+
title: `Sort ${label}`,
|
|
262
|
+
disabled: hasMergedCellsInTable,
|
|
263
|
+
icon,
|
|
264
|
+
onClick: (state: EditorState, dispatch?: CommandDispatch) => {
|
|
265
|
+
sortColumnWithAnalytics(editorAnalyticsAPI)(
|
|
266
|
+
INPUT_METHOD.TABLE_CONTEXT_MENU,
|
|
267
|
+
index ?? 0,
|
|
268
|
+
order,
|
|
269
|
+
)(state, dispatch);
|
|
270
|
+
return true;
|
|
271
|
+
},
|
|
272
|
+
})),
|
|
273
|
+
];
|
|
274
|
+
|
|
275
|
+
const restConfigs = [
|
|
258
276
|
...addOptions.map(({ label, offset, icon, keymap }) => ({
|
|
259
277
|
id: `add_${direction}_${label}`,
|
|
260
278
|
title: `Add ${direction} ${label}`,
|
|
@@ -373,20 +391,12 @@ export const getDragMenuConfig = (
|
|
|
373
391
|
},
|
|
374
392
|
keymap: keymap && tooltip(keymap),
|
|
375
393
|
})),
|
|
394
|
+
];
|
|
376
395
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
sortColumnWithAnalytics(editorAnalyticsAPI)(
|
|
384
|
-
INPUT_METHOD.TABLE_CONTEXT_MENU,
|
|
385
|
-
index ?? 0,
|
|
386
|
-
order,
|
|
387
|
-
)(state, dispatch);
|
|
388
|
-
return true;
|
|
389
|
-
},
|
|
390
|
-
})),
|
|
391
|
-
].filter(Boolean) as DragMenuConfig[];
|
|
396
|
+
let allConfigs = [...restConfigs];
|
|
397
|
+
tableSortColumnDiscoverability
|
|
398
|
+
? allConfigs.unshift(...sortConfigs)
|
|
399
|
+
: allConfigs.push(...sortConfigs);
|
|
400
|
+
|
|
401
|
+
return allConfigs.filter(Boolean) as DragMenuConfig[];
|
|
392
402
|
};
|