@atlaskit/editor-plugin-table 2.5.0 → 2.5.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 +6 -0
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +45 -7
- package/dist/cjs/plugins/table/ui/ui-styles.js +29 -15
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +27 -27
- package/dist/es2019/plugins/table/ui/consts.js +42 -8
- package/dist/es2019/plugins/table/ui/ui-styles.js +38 -38
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +42 -8
- package/dist/esm/plugins/table/ui/ui-styles.js +31 -17
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/ui/consts.d.ts +10 -6
- package/dist/types/plugins/table/ui/ui-styles.d.ts +8 -8
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +10 -6
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +8 -8
- package/package.json +2 -2
- package/src/__tests__/unit/pm-plugins/main.ts +11 -0
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +11 -0
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +11 -0
- package/src/plugins/table/ui/FloatingContextualButton/styles.ts +1 -1
- package/src/plugins/table/ui/common-styles.ts +27 -42
- package/src/plugins/table/ui/consts.ts +46 -19
- package/src/plugins/table/ui/ui-styles.ts +49 -64
- package/tmp/api-report-tmp.d.ts +108 -0
|
@@ -7,12 +7,16 @@ export declare const tableToolbarColor: import("@atlaskit/theme").ThemedValue<"v
|
|
|
7
7
|
export declare const tableTextColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
|
|
8
8
|
export declare const tableBorderColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtler)">;
|
|
9
9
|
export declare const tableFloatingControlsColor: "var(--ds-background-neutral)";
|
|
10
|
-
export declare const tableCellSelectedColor: "var(--ds-blanket-selected)"
|
|
11
|
-
export declare const tableToolbarSelectedColor: "var(--ds-background-selected-
|
|
12
|
-
export declare const tableBorderSelectedColor: "var(--ds-border-
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
10
|
+
export declare const tableCellSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-selected)">;
|
|
11
|
+
export declare const tableToolbarSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected-pressed)">;
|
|
12
|
+
export declare const tableBorderSelectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-focused)">;
|
|
13
|
+
export declare const tableCellSelectedDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
|
|
14
|
+
export declare const tableCellSelectedDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
|
|
15
|
+
export declare const tableCellDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-danger)">;
|
|
16
|
+
export declare const tableBorderDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-danger)">;
|
|
17
|
+
export declare const tableToolbarDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-pressed)">;
|
|
18
|
+
export declare const tableCellHoverDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)">;
|
|
19
|
+
export declare const tableCellHoverDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-bold)">;
|
|
16
20
|
export declare const tableBorderRadiusSize = 3;
|
|
17
21
|
export declare const tablePadding = 8;
|
|
18
22
|
export declare const tableScrollbarOffset = 15;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
2
|
export declare const InsertMarker: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
|
|
4
|
-
export declare const HeaderButtonHover: () => import("@emotion/react").SerializedStyles;
|
|
5
|
-
export declare const HeaderButtonDanger: () => import("@emotion/react").SerializedStyles;
|
|
6
|
-
export declare const insertColumnButtonWrapper: import("@emotion/react").SerializedStyles;
|
|
7
|
-
export declare const insertRowButtonWrapper: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
8
8
|
export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
|
|
9
|
-
export declare const DeleteButton: import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const DeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
10
10
|
export declare const OverflowShadow: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
11
11
|
export declare const columnControlsDecoration: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
12
|
-
export declare const hoveredDeleteButton: import("@emotion/react").SerializedStyles;
|
|
13
|
-
export declare const hoveredCell: import("@emotion/react").SerializedStyles;
|
|
12
|
+
export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
13
|
+
export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
14
14
|
export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
|
|
15
|
-
export declare const resizeHandle: import("@emotion/react").SerializedStyles;
|
|
15
|
+
export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^26.2.0",
|
|
31
|
-
"@atlaskit/editor-common": "^74.
|
|
31
|
+
"@atlaskit/editor-common": "^74.26.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
34
34
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.6",
|
|
@@ -34,6 +34,17 @@ import * as miscCommands from '../../../plugins/table/commands/misc';
|
|
|
34
34
|
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
35
35
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
36
36
|
|
|
37
|
+
jest.mock('prosemirror-utils', () => {
|
|
38
|
+
// Unblock prosemirror bump:
|
|
39
|
+
// Workaround to enable spy on prosemirror-utils cjs bundle
|
|
40
|
+
const originalModule = jest.requireActual('prosemirror-utils');
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
__esModule: true,
|
|
44
|
+
...originalModule,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
37
48
|
describe('tables: main plugin', () => {
|
|
38
49
|
const createEditor = createProsemirrorEditorFactory();
|
|
39
50
|
const editor = (doc: DocBuilder) =>
|
|
@@ -32,6 +32,17 @@ import FloatingContextualButton, {
|
|
|
32
32
|
Props as FloatingContextualButtonProps,
|
|
33
33
|
} from '../../../plugins/table/ui/FloatingContextualButton';
|
|
34
34
|
|
|
35
|
+
jest.mock('prosemirror-utils', () => {
|
|
36
|
+
// Unblock prosemirror bump:
|
|
37
|
+
// Workaround to enable spy on prosemirror-utils cjs bundle
|
|
38
|
+
const originalModule = jest.requireActual('prosemirror-utils');
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
__esModule: true,
|
|
42
|
+
...originalModule,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
35
46
|
const createEditor = createProsemirrorEditorFactory();
|
|
36
47
|
let createAnalyticsEvent = jest.fn(() => ({ fire() {} } as UIAnalyticsEvent));
|
|
37
48
|
const editor = (doc: DocBuilder) =>
|
|
@@ -39,6 +39,17 @@ import {
|
|
|
39
39
|
Props as FloatingInsertButtonProps,
|
|
40
40
|
} from '../../../plugins/table/ui/FloatingInsertButton';
|
|
41
41
|
|
|
42
|
+
jest.mock('prosemirror-utils', () => {
|
|
43
|
+
// Unblock prosemirror bump:
|
|
44
|
+
// Workaround to enable spy on prosemirror-utils cjs bundle
|
|
45
|
+
const originalModule = jest.requireActual('prosemirror-utils');
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
__esModule: true,
|
|
49
|
+
...originalModule,
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
|
|
42
53
|
const getEditorContainerWidth = () => ({ width: 500 });
|
|
43
54
|
const createEditor = createEditorFactory<TablePluginState>();
|
|
44
55
|
const createAnalyticsEvent = jest.fn(() => ({ fire() {} } as UIAnalyticsEvent));
|
|
@@ -24,7 +24,7 @@ export const tableFloatingCellButtonStyles = (props: ThemeProps) => css`
|
|
|
24
24
|
})(props)};
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
margin: 2px;
|
|
27
|
-
outline: 2px solid ${token('
|
|
27
|
+
outline: 2px solid ${token('elevation.surface', N0)};
|
|
28
28
|
border-radius: 1px;
|
|
29
29
|
padding: 0;
|
|
30
30
|
height: calc(100% - 4px);
|
|
@@ -185,10 +185,10 @@ export const tableStyles = (
|
|
|
185
185
|
.ProseMirror {
|
|
186
186
|
${tableSharedStyle(props)};
|
|
187
187
|
${columnControlsLineMarker()};
|
|
188
|
-
${hoveredDeleteButton};
|
|
189
|
-
${hoveredCell};
|
|
188
|
+
${hoveredDeleteButton(props)};
|
|
189
|
+
${hoveredCell(props)};
|
|
190
190
|
${hoveredWarningCell};
|
|
191
|
-
${resizeHandle};
|
|
191
|
+
${resizeHandle(props)};
|
|
192
192
|
${rangeSelectionStyles};
|
|
193
193
|
|
|
194
194
|
.${ClassName.LAST_ITEM_IN_CELL} {
|
|
@@ -223,15 +223,15 @@ export const tableStyles = (
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
.${ClassName.CONTROLS_FLOATING_BUTTON_COLUMN} {
|
|
226
|
-
${insertColumnButtonWrapper}
|
|
226
|
+
${insertColumnButtonWrapper(props)}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
.${ClassName.CONTROLS_FLOATING_BUTTON_ROW} {
|
|
230
|
-
${insertRowButtonWrapper}
|
|
230
|
+
${insertRowButtonWrapper(props)}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
/* Delete button */
|
|
234
|
-
${DeleteButton}
|
|
234
|
+
${DeleteButton(props)}
|
|
235
235
|
/* Ends Delete button */
|
|
236
236
|
|
|
237
237
|
/* sticky styles */
|
|
@@ -485,11 +485,8 @@ export const tableStyles = (
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
.active .${ClassName.CONTROLS_CORNER_BUTTON} {
|
|
488
|
-
border-color: ${tableBorderSelectedColor};
|
|
489
|
-
background: ${
|
|
490
|
-
'color.background.selected',
|
|
491
|
-
tableToolbarSelectedColor,
|
|
492
|
-
)};
|
|
488
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
489
|
+
background: ${tableToolbarSelectedColor(props)};
|
|
493
490
|
}
|
|
494
491
|
|
|
495
492
|
.${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
|
|
@@ -502,18 +499,15 @@ export const tableStyles = (
|
|
|
502
499
|
}
|
|
503
500
|
|
|
504
501
|
:not(.${ClassName.IS_RESIZING}) .${ClassName.CONTROLS_CORNER_BUTTON}:hover {
|
|
505
|
-
border-color: ${tableBorderSelectedColor};
|
|
506
|
-
background: ${
|
|
507
|
-
'color.background.selected',
|
|
508
|
-
tableToolbarSelectedColor,
|
|
509
|
-
)};
|
|
502
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
503
|
+
background: ${tableToolbarSelectedColor(props)};
|
|
510
504
|
cursor: pointer;
|
|
511
505
|
}
|
|
512
506
|
|
|
513
507
|
:not(.${ClassName.IS_RESIZING})
|
|
514
508
|
.${ClassName.CONTROLS_CORNER_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
|
|
515
|
-
border-color: ${tableBorderDeleteColor};
|
|
516
|
-
background: ${
|
|
509
|
+
border-color: ${tableBorderDeleteColor(props)};
|
|
510
|
+
background: ${tableToolbarDeleteColor(props)};
|
|
517
511
|
}
|
|
518
512
|
|
|
519
513
|
/* Row controls */
|
|
@@ -572,8 +566,8 @@ export const tableStyles = (
|
|
|
572
566
|
}
|
|
573
567
|
|
|
574
568
|
:not(.${ClassName.IS_RESIZING}) .${ClassName.ROW_CONTROLS} {
|
|
575
|
-
${HeaderButtonHover()}
|
|
576
|
-
${HeaderButtonDanger()}
|
|
569
|
+
${HeaderButtonHover(props)}
|
|
570
|
+
${HeaderButtonDanger(props)}
|
|
577
571
|
}
|
|
578
572
|
|
|
579
573
|
/* Numbered column */
|
|
@@ -618,12 +612,9 @@ export const tableStyles = (
|
|
|
618
612
|
}
|
|
619
613
|
|
|
620
614
|
.${ClassName.NUMBERED_COLUMN_BUTTON}.active {
|
|
621
|
-
border-bottom: 1px solid ${tableBorderSelectedColor};
|
|
622
|
-
border-color: ${tableBorderSelectedColor};
|
|
623
|
-
background-color: ${
|
|
624
|
-
'color.background.selected',
|
|
625
|
-
tableToolbarSelectedColor,
|
|
626
|
-
)};
|
|
615
|
+
border-bottom: 1px solid ${tableBorderSelectedColor(props)};
|
|
616
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
617
|
+
background-color: ${tableToolbarSelectedColor(props)};
|
|
627
618
|
position: relative;
|
|
628
619
|
z-index: ${akEditorUnitZIndex};
|
|
629
620
|
color: ${token('color.text.selected', N0)};
|
|
@@ -635,22 +626,16 @@ export const tableStyles = (
|
|
|
635
626
|
cursor: pointer;
|
|
636
627
|
}
|
|
637
628
|
.${ClassName.NUMBERED_COLUMN_BUTTON}:hover {
|
|
638
|
-
border-bottom: 1px solid ${tableBorderSelectedColor};
|
|
639
|
-
border-color: ${tableBorderSelectedColor};
|
|
640
|
-
background-color: ${
|
|
641
|
-
'color.background.selected',
|
|
642
|
-
tableToolbarSelectedColor,
|
|
643
|
-
)};
|
|
629
|
+
border-bottom: 1px solid ${tableBorderSelectedColor(props)};
|
|
630
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
631
|
+
background-color: ${tableToolbarSelectedColor(props)};
|
|
644
632
|
position: relative;
|
|
645
633
|
z-index: ${akEditorUnitZIndex};
|
|
646
634
|
color: ${token('color.text.selected', N0)};
|
|
647
635
|
}
|
|
648
636
|
.${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
|
|
649
|
-
background-color: ${
|
|
650
|
-
|
|
651
|
-
tableToolbarDeleteColor,
|
|
652
|
-
)};
|
|
653
|
-
border: 1px solid ${tableBorderDeleteColor};
|
|
637
|
+
background-color: ${tableToolbarDeleteColor(props)};
|
|
638
|
+
border: 1px solid ${tableBorderDeleteColor(props)};
|
|
654
639
|
border-left: 0;
|
|
655
640
|
color: ${token('color.text.danger', R500)};
|
|
656
641
|
position: relative;
|
|
@@ -711,15 +696,15 @@ export const tableStyles = (
|
|
|
711
696
|
pointer-events: none;
|
|
712
697
|
}
|
|
713
698
|
.${ClassName.SELECTED_CELL} {
|
|
714
|
-
border: 1px solid ${tableBorderSelectedColor};
|
|
699
|
+
border: 1px solid ${tableBorderSelectedColor(props)};
|
|
715
700
|
}
|
|
716
701
|
.${ClassName.SELECTED_CELL}::after {
|
|
717
|
-
background: ${tableCellSelectedColor};
|
|
702
|
+
background: ${tableCellSelectedColor(props)};
|
|
718
703
|
z-index: ${akEditorSmallZIndex};
|
|
719
704
|
}
|
|
720
705
|
th.${ClassName.HOVERED_CELL_IN_DANGER}::after,
|
|
721
706
|
td.${ClassName.HOVERED_CELL_IN_DANGER}::after {
|
|
722
|
-
background: ${tableCellDeleteColor};
|
|
707
|
+
background: ${tableCellDeleteColor(props)};
|
|
723
708
|
z-index: ${akEditorUnitZIndex * 100};
|
|
724
709
|
}
|
|
725
710
|
// ED-15246: Trello card is visible through a border of a table border
|
|
@@ -727,7 +712,7 @@ export const tableStyles = (
|
|
|
727
712
|
&::after {
|
|
728
713
|
height: 100%;
|
|
729
714
|
width: 100%;
|
|
730
|
-
border: 1px solid ${tableBorderSelectedColor};
|
|
715
|
+
border: 1px solid ${tableBorderSelectedColor(props)};
|
|
731
716
|
content: '';
|
|
732
717
|
position: absolute;
|
|
733
718
|
left: -1px;
|
|
@@ -738,7 +723,7 @@ export const tableStyles = (
|
|
|
738
723
|
pointer-events: none;
|
|
739
724
|
}
|
|
740
725
|
&.${ClassName.HOVERED_CELL_IN_DANGER}::after {
|
|
741
|
-
border: 1px solid ${tableBorderDeleteColor};
|
|
726
|
+
border: 1px solid ${tableBorderDeleteColor(props)};
|
|
742
727
|
z-index: ${akEditorUnitZIndex * 100};
|
|
743
728
|
}
|
|
744
729
|
}
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
akEditorTableBorder,
|
|
7
7
|
akEditorTableBorderDark,
|
|
8
|
+
akEditorTableBorderSelected,
|
|
9
|
+
akEditorTableCellBlanketDeleted,
|
|
10
|
+
akEditorTableCellBlanketSelected,
|
|
8
11
|
akEditorTableToolbar,
|
|
9
12
|
akEditorTableToolbarDark,
|
|
10
13
|
akEditorTableToolbarSize,
|
|
@@ -13,12 +16,14 @@ import {
|
|
|
13
16
|
} from '@atlaskit/editor-shared-styles';
|
|
14
17
|
import {
|
|
15
18
|
B200,
|
|
16
|
-
B300,
|
|
17
19
|
DN30,
|
|
18
20
|
DN400,
|
|
19
21
|
N0,
|
|
20
22
|
N20,
|
|
21
23
|
N200,
|
|
24
|
+
N20A,
|
|
25
|
+
N300,
|
|
26
|
+
R300,
|
|
22
27
|
R400,
|
|
23
28
|
R75,
|
|
24
29
|
} from '@atlaskit/theme/colors';
|
|
@@ -58,24 +63,46 @@ export const tableFloatingControlsColor = token(
|
|
|
58
63
|
N20,
|
|
59
64
|
);
|
|
60
65
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4461
|
|
61
|
-
export const tableCellSelectedColor =
|
|
62
|
-
'color.blanket.selected',
|
|
63
|
-
'
|
|
64
|
-
);
|
|
65
|
-
export const tableToolbarSelectedColor =
|
|
66
|
-
'color.background.selected.
|
|
67
|
-
B200,
|
|
68
|
-
);
|
|
69
|
-
export const tableBorderSelectedColor =
|
|
70
|
-
|
|
71
|
-
'color.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
66
|
+
export const tableCellSelectedColor = themed({
|
|
67
|
+
light: token('color.blanket.selected', akEditorTableCellBlanketSelected),
|
|
68
|
+
dark: token('color.blanket.selected', akEditorTableCellBlanketSelected),
|
|
69
|
+
});
|
|
70
|
+
export const tableToolbarSelectedColor = themed({
|
|
71
|
+
light: token('color.background.selected.pressed', B200),
|
|
72
|
+
dark: token('color.background.selected.pressed', B200),
|
|
73
|
+
});
|
|
74
|
+
export const tableBorderSelectedColor = themed({
|
|
75
|
+
light: token('color.border.focused', akEditorTableBorderSelected),
|
|
76
|
+
dark: token('color.border.focused', akEditorTableBorderSelected),
|
|
77
|
+
});
|
|
78
|
+
export const tableCellSelectedDeleteIconColor = themed({
|
|
79
|
+
light: token('color.icon.subtle', N300),
|
|
80
|
+
dark: token('color.icon.subtle', N300),
|
|
81
|
+
});
|
|
82
|
+
export const tableCellSelectedDeleteIconBackground = themed({
|
|
83
|
+
light: token('color.background.accent.gray.subtlest', N20A),
|
|
84
|
+
dark: token('color.background.accent.gray.subtlest', N20A),
|
|
85
|
+
});
|
|
86
|
+
export const tableCellDeleteColor = themed({
|
|
87
|
+
light: token('color.blanket.danger', akEditorTableCellBlanketDeleted),
|
|
88
|
+
dark: token('color.blanket.danger', akEditorTableCellBlanketDeleted),
|
|
89
|
+
});
|
|
90
|
+
export const tableBorderDeleteColor = themed({
|
|
91
|
+
light: token('color.border.danger', R400),
|
|
92
|
+
dark: token('color.border.danger', R400),
|
|
93
|
+
});
|
|
94
|
+
export const tableToolbarDeleteColor = themed({
|
|
95
|
+
light: token('color.background.danger.pressed', R75),
|
|
96
|
+
dark: token('color.background.danger.pressed', R75),
|
|
97
|
+
});
|
|
98
|
+
export const tableCellHoverDeleteIconColor = themed({
|
|
99
|
+
light: token('color.icon.inverse', 'white'),
|
|
100
|
+
dark: token('color.icon.inverse', 'white'),
|
|
101
|
+
});
|
|
102
|
+
export const tableCellHoverDeleteIconBackground = themed({
|
|
103
|
+
light: token('color.background.danger.bold', R300),
|
|
104
|
+
dark: token('color.background.danger.bold', R300),
|
|
105
|
+
});
|
|
79
106
|
export const tableBorderRadiusSize = 3;
|
|
80
107
|
export const tablePadding = 8;
|
|
81
108
|
export const tableScrollbarOffset = 15;
|
|
@@ -10,17 +10,7 @@ import {
|
|
|
10
10
|
akEditorTableNumberColumnWidth,
|
|
11
11
|
akEditorUnitZIndex,
|
|
12
12
|
} from '@atlaskit/editor-shared-styles';
|
|
13
|
-
import {
|
|
14
|
-
B300,
|
|
15
|
-
N0,
|
|
16
|
-
N20A,
|
|
17
|
-
N300,
|
|
18
|
-
N40A,
|
|
19
|
-
N60A,
|
|
20
|
-
R300,
|
|
21
|
-
Y200,
|
|
22
|
-
Y50,
|
|
23
|
-
} from '@atlaskit/theme/colors';
|
|
13
|
+
import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
|
|
24
14
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
25
15
|
import { ThemeProps } from '@atlaskit/theme/types';
|
|
26
16
|
import { token } from '@atlaskit/tokens';
|
|
@@ -39,6 +29,10 @@ import {
|
|
|
39
29
|
tableBorderDeleteColor,
|
|
40
30
|
tableBorderSelectedColor,
|
|
41
31
|
tableCellDeleteColor,
|
|
32
|
+
tableCellHoverDeleteIconBackground,
|
|
33
|
+
tableCellHoverDeleteIconColor,
|
|
34
|
+
tableCellSelectedDeleteIconBackground,
|
|
35
|
+
tableCellSelectedDeleteIconColor,
|
|
42
36
|
tableDeleteButtonSize,
|
|
43
37
|
tableHeaderCellBackgroundColor,
|
|
44
38
|
tableInsertColumnButtonSize,
|
|
@@ -47,9 +41,9 @@ import {
|
|
|
47
41
|
tableToolbarSize,
|
|
48
42
|
} from './consts';
|
|
49
43
|
|
|
50
|
-
const InsertLine = (cssString?: string) => css`
|
|
44
|
+
const InsertLine = (props: ThemeProps, cssString?: string) => css`
|
|
51
45
|
.${ClassName.CONTROLS_INSERT_LINE} {
|
|
52
|
-
background: ${tableBorderSelectedColor};
|
|
46
|
+
background: ${tableBorderSelectedColor(props)};
|
|
53
47
|
display: none;
|
|
54
48
|
position: absolute;
|
|
55
49
|
z-index: ${akEditorUnitZIndex};
|
|
@@ -122,33 +116,24 @@ export const HeaderButton = (props: ThemeProps, cssString?: string) => css`
|
|
|
122
116
|
|
|
123
117
|
.active .${ClassName.CONTROLS_BUTTON} {
|
|
124
118
|
color: ${token('color.icon.inverse', N0)};
|
|
125
|
-
background-color: ${
|
|
126
|
-
|
|
127
|
-
tableToolbarSelectedColor,
|
|
128
|
-
)};
|
|
129
|
-
border-color: ${tableBorderSelectedColor};
|
|
119
|
+
background-color: ${tableToolbarSelectedColor(props)};
|
|
120
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
130
121
|
}
|
|
131
122
|
`;
|
|
132
123
|
|
|
133
|
-
export const HeaderButtonHover = () => css`
|
|
124
|
+
export const HeaderButtonHover = (props: ThemeProps) => css`
|
|
134
125
|
.${ClassName.CONTROLS_BUTTON}:hover {
|
|
135
126
|
color: ${token('color.icon.inverse', N0)};
|
|
136
|
-
background-color: ${
|
|
137
|
-
|
|
138
|
-
tableToolbarSelectedColor,
|
|
139
|
-
)};
|
|
140
|
-
border-color: ${tableBorderSelectedColor};
|
|
127
|
+
background-color: ${tableToolbarSelectedColor(props)};
|
|
128
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
141
129
|
cursor: pointer;
|
|
142
130
|
}
|
|
143
131
|
`;
|
|
144
132
|
|
|
145
|
-
export const HeaderButtonDanger = () => css`
|
|
133
|
+
export const HeaderButtonDanger = (props: ThemeProps) => css`
|
|
146
134
|
.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.CONTROLS_BUTTON} {
|
|
147
|
-
background-color: ${
|
|
148
|
-
|
|
149
|
-
tableToolbarDeleteColor,
|
|
150
|
-
)};
|
|
151
|
-
border-color: ${tableBorderDeleteColor};
|
|
135
|
+
background-color: ${tableToolbarDeleteColor(props)};
|
|
136
|
+
border-color: ${tableBorderDeleteColor(props)};
|
|
152
137
|
position: relative;
|
|
153
138
|
z-index: ${akEditorUnitZIndex};
|
|
154
139
|
}
|
|
@@ -191,23 +176,29 @@ const InsertButtonHover = () => css`
|
|
|
191
176
|
}
|
|
192
177
|
`;
|
|
193
178
|
|
|
194
|
-
export const insertColumnButtonWrapper = css`
|
|
179
|
+
export const insertColumnButtonWrapper = (props: ThemeProps) => css`
|
|
195
180
|
${InsertButton()}
|
|
196
181
|
${InsertButtonHover()}
|
|
197
|
-
${InsertLine(
|
|
182
|
+
${InsertLine(
|
|
183
|
+
props,
|
|
184
|
+
`
|
|
198
185
|
width: 2px;
|
|
199
186
|
left: 9px;
|
|
200
|
-
|
|
187
|
+
`,
|
|
188
|
+
)}
|
|
201
189
|
`;
|
|
202
190
|
|
|
203
|
-
export const insertRowButtonWrapper = css`
|
|
191
|
+
export const insertRowButtonWrapper = (props: ThemeProps) => css`
|
|
204
192
|
${InsertButton()}
|
|
205
193
|
${InsertButtonHover()}
|
|
206
|
-
${InsertLine(
|
|
194
|
+
${InsertLine(
|
|
195
|
+
props,
|
|
196
|
+
`
|
|
207
197
|
height: 2px;
|
|
208
198
|
top: -11px;
|
|
209
199
|
left: ${tableInsertColumnButtonSize - 1}px;
|
|
210
|
-
|
|
200
|
+
`,
|
|
201
|
+
)}
|
|
211
202
|
`;
|
|
212
203
|
|
|
213
204
|
export const columnControlsLineMarker = () => css`
|
|
@@ -223,7 +214,7 @@ export const columnControlsLineMarker = () => css`
|
|
|
223
214
|
}
|
|
224
215
|
`;
|
|
225
216
|
|
|
226
|
-
export const DeleteButton = css`
|
|
217
|
+
export const DeleteButton = (props: ThemeProps) => css`
|
|
227
218
|
.${ClassName.CONTROLS_DELETE_BUTTON_WRAP},
|
|
228
219
|
.${ClassName.CONTROLS_DELETE_BUTTON} {
|
|
229
220
|
height: ${tableDeleteButtonSize}px;
|
|
@@ -232,15 +223,15 @@ export const DeleteButton = css`
|
|
|
232
223
|
.${ClassName.CONTROLS_DELETE_BUTTON_WRAP} {
|
|
233
224
|
.${ClassName.CONTROLS_DELETE_BUTTON} {
|
|
234
225
|
${Button(`
|
|
235
|
-
background: ${
|
|
236
|
-
color: ${
|
|
226
|
+
background: ${tableCellSelectedDeleteIconBackground(props)};
|
|
227
|
+
color: ${tableCellSelectedDeleteIconColor(props)};
|
|
237
228
|
`)}
|
|
238
229
|
}
|
|
239
230
|
}
|
|
240
231
|
|
|
241
232
|
.${ClassName.CONTROLS_DELETE_BUTTON}:hover {
|
|
242
|
-
background: ${
|
|
243
|
-
color: ${
|
|
233
|
+
background: ${tableCellHoverDeleteIconBackground(props)};
|
|
234
|
+
color: ${tableCellHoverDeleteIconColor(props)};
|
|
244
235
|
cursor: pointer;
|
|
245
236
|
}
|
|
246
237
|
`;
|
|
@@ -312,13 +303,10 @@ const columnHeaderButton = (props: ThemeProps, cssString?: string) => css`
|
|
|
312
303
|
${cssString}
|
|
313
304
|
`;
|
|
314
305
|
|
|
315
|
-
const columnHeaderButtonSelected = css`
|
|
306
|
+
const columnHeaderButtonSelected = (props: ThemeProps) => css`
|
|
316
307
|
color: ${token('color.text.inverse', N0)};
|
|
317
|
-
background-color: ${
|
|
318
|
-
|
|
319
|
-
tableToolbarSelectedColor,
|
|
320
|
-
)};
|
|
321
|
-
border-color: ${tableBorderSelectedColor};
|
|
308
|
+
background-color: ${tableToolbarSelectedColor(props)};
|
|
309
|
+
border-color: ${tableBorderSelectedColor(props)};
|
|
322
310
|
z-index: ${columnControlsSelectedZIndex};
|
|
323
311
|
`;
|
|
324
312
|
|
|
@@ -392,16 +380,13 @@ export const columnControlsDecoration = (props: ThemeProps) => css`
|
|
|
392
380
|
&.${ClassName.HOVERED_COLUMN},
|
|
393
381
|
&.${ClassName.HOVERED_TABLE} {
|
|
394
382
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
395
|
-
${columnHeaderButtonSelected};
|
|
383
|
+
${columnHeaderButtonSelected(props)};
|
|
396
384
|
}
|
|
397
385
|
|
|
398
386
|
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
399
387
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
400
|
-
background-color: ${
|
|
401
|
-
|
|
402
|
-
tableToolbarDeleteColor,
|
|
403
|
-
)};
|
|
404
|
-
border: 1px solid ${tableBorderDeleteColor};
|
|
388
|
+
background-color: ${tableToolbarDeleteColor(props)};
|
|
389
|
+
border: 1px solid ${tableBorderDeleteColor(props)};
|
|
405
390
|
border-bottom: none;
|
|
406
391
|
z-index: ${akEditorUnitZIndex * 100};
|
|
407
392
|
}
|
|
@@ -417,30 +402,30 @@ export const columnControlsDecoration = (props: ThemeProps) => css`
|
|
|
417
402
|
tr:first-of-type
|
|
418
403
|
th.${ClassName.TABLE_HEADER_CELL} {
|
|
419
404
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
420
|
-
${columnHeaderButtonSelected};
|
|
405
|
+
${columnHeaderButtonSelected(props)};
|
|
421
406
|
}
|
|
422
407
|
}
|
|
423
408
|
`;
|
|
424
409
|
|
|
425
|
-
export const hoveredDeleteButton = css`
|
|
410
|
+
export const hoveredDeleteButton = (props: ThemeProps) => css`
|
|
426
411
|
.${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
|
|
427
412
|
.${ClassName.SELECTED_CELL},
|
|
428
413
|
.${ClassName.COLUMN_SELECTED},
|
|
429
414
|
.${ClassName.HOVERED_CELL} {
|
|
430
|
-
border: 1px solid ${tableBorderDeleteColor};
|
|
415
|
+
border: 1px solid ${tableBorderDeleteColor(props)};
|
|
431
416
|
}
|
|
432
417
|
.${ClassName.SELECTED_CELL}::after {
|
|
433
|
-
background: ${tableCellDeleteColor};
|
|
418
|
+
background: ${tableCellDeleteColor(props)};
|
|
434
419
|
}
|
|
435
420
|
}
|
|
436
421
|
`;
|
|
437
422
|
|
|
438
|
-
export const hoveredCell = css`
|
|
423
|
+
export const hoveredCell = (props: ThemeProps) => css`
|
|
439
424
|
:not(.${ClassName.IS_RESIZING})
|
|
440
425
|
.${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
|
|
441
426
|
.${ClassName.HOVERED_CELL} {
|
|
442
427
|
position: relative;
|
|
443
|
-
border: 1px solid ${tableBorderSelectedColor};
|
|
428
|
+
border: 1px solid ${tableBorderSelectedColor(props)};
|
|
444
429
|
}
|
|
445
430
|
}
|
|
446
431
|
`;
|
|
@@ -458,7 +443,7 @@ export const hoveredWarningCell = css`
|
|
|
458
443
|
}
|
|
459
444
|
`;
|
|
460
445
|
|
|
461
|
-
export const resizeHandle = css`
|
|
446
|
+
export const resizeHandle = (props: ThemeProps) => css`
|
|
462
447
|
.${ClassName.TABLE_CONTAINER} {
|
|
463
448
|
.${ClassName.RESIZE_HANDLE_DECORATION} {
|
|
464
449
|
background-color: transparent;
|
|
@@ -478,7 +463,7 @@ export const resizeHandle = css`
|
|
|
478
463
|
top: -1px;
|
|
479
464
|
width: ${resizeLineWidth}px;
|
|
480
465
|
height: calc(100% + 2px);
|
|
481
|
-
background-color: ${tableBorderSelectedColor};
|
|
466
|
+
background-color: ${tableBorderSelectedColor(props)};
|
|
482
467
|
z-index: ${columnControlsZIndex * 2};
|
|
483
468
|
}
|
|
484
469
|
|
|
@@ -488,7 +473,7 @@ export const resizeHandle = css`
|
|
|
488
473
|
position: absolute;
|
|
489
474
|
width: ${resizeLineWidth}px;
|
|
490
475
|
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
491
|
-
background-color: ${tableBorderSelectedColor};
|
|
476
|
+
background-color: ${tableBorderSelectedColor(props)};
|
|
492
477
|
z-index: ${columnControlsZIndex * 2};
|
|
493
478
|
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
494
479
|
}
|
|
@@ -500,7 +485,7 @@ export const resizeHandle = css`
|
|
|
500
485
|
top: -1px;
|
|
501
486
|
width: ${resizeLineWidth}px;
|
|
502
487
|
height: calc(100% + 2px);
|
|
503
|
-
background-color: ${tableBorderSelectedColor};
|
|
488
|
+
background-color: ${tableBorderSelectedColor(props)};
|
|
504
489
|
z-index: ${columnControlsZIndex * 2};
|
|
505
490
|
}
|
|
506
491
|
|
|
@@ -510,7 +495,7 @@ export const resizeHandle = css`
|
|
|
510
495
|
position: absolute;
|
|
511
496
|
width: ${resizeLineWidth}px;
|
|
512
497
|
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
513
|
-
background-color: ${tableBorderSelectedColor};
|
|
498
|
+
background-color: ${tableBorderSelectedColor(props)};
|
|
514
499
|
z-index: ${columnControlsZIndex * 2};
|
|
515
500
|
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
516
501
|
}
|