@atlaskit/editor-plugin-table 5.6.6 → 5.7.0
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 +13 -0
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +1 -7
- package/dist/cjs/ui/FloatingContextualButton/styles.js +5 -25
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +238 -99
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/cjs/ui/common-styles.js +7 -7
- package/dist/cjs/ui/consts.js +16 -63
- package/dist/cjs/ui/icons/MergeCellsIcon.js +34 -0
- package/dist/cjs/ui/icons/SplitCellIcon.js +41 -0
- package/dist/cjs/ui/icons/index.js +14 -0
- package/dist/cjs/ui/ui-styles.js +47 -48
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/FloatingContextualButton/index.js +1 -5
- package/dist/es2019/ui/FloatingContextualButton/styles.js +10 -31
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +248 -71
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +22 -3
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/es2019/ui/common-styles.js +59 -59
- package/dist/es2019/ui/consts.js +18 -64
- package/dist/es2019/ui/icons/MergeCellsIcon.js +25 -0
- package/dist/es2019/ui/icons/SplitCellIcon.js +32 -0
- package/dist/es2019/ui/icons/index.js +2 -0
- package/dist/es2019/ui/ui-styles.js +98 -99
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +1 -7
- package/dist/esm/ui/FloatingContextualButton/styles.js +5 -26
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +238 -98
- package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/ui/common-styles.js +7 -7
- package/dist/esm/ui/consts.js +18 -64
- package/dist/esm/ui/icons/MergeCellsIcon.js +27 -0
- package/dist/esm/ui/icons/SplitCellIcon.js +34 -0
- package/dist/esm/ui/icons/index.js +2 -0
- package/dist/esm/ui/ui-styles.js +47 -48
- package/dist/types/types.d.ts +1 -0
- package/dist/types/ui/FloatingContextualButton/styles.d.ts +2 -3
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
- package/dist/types/ui/common-styles.d.ts +1 -2
- package/dist/types/ui/consts.d.ts +15 -15
- package/dist/types/ui/icons/MergeCellsIcon.d.ts +2 -0
- package/dist/types/ui/icons/SplitCellIcon.d.ts +2 -0
- package/dist/types/ui/icons/index.d.ts +2 -0
- package/dist/types/ui/ui-styles.d.ts +17 -18
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingContextualButton/styles.d.ts +2 -3
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
- package/dist/types-ts4.5/ui/common-styles.d.ts +1 -2
- package/dist/types-ts4.5/ui/consts.d.ts +15 -15
- package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +2 -0
- package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +2 -0
- package/dist/types-ts4.5/ui/icons/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/ui-styles.d.ts +17 -18
- package/package.json +12 -5
- package/src/types.ts +1 -0
- package/src/ui/FloatingContextualButton/index.tsx +3 -5
- package/src/ui/FloatingContextualButton/styles.ts +13 -35
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +316 -68
- package/src/ui/FloatingContextualMenu/styles.ts +22 -3
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -1
- package/src/ui/common-styles.ts +57 -69
- package/src/ui/consts.ts +52 -73
- package/src/ui/icons/MergeCellsIcon.tsx +32 -0
- package/src/ui/icons/SplitCellIcon.tsx +40 -0
- package/src/ui/icons/index.ts +2 -0
- package/src/ui/ui-styles.ts +94 -106
|
@@ -3,34 +3,33 @@ import { tableCellBorderWidth, tableMarginTop, tableMarginTopWithControl } from
|
|
|
3
3
|
import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
|
|
6
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
6
|
import { TableCssClassName as ClassName } from '../types';
|
|
8
7
|
import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
9
|
-
const InsertLine =
|
|
8
|
+
const InsertLine = cssString => css`
|
|
10
9
|
.${ClassName.CONTROLS_INSERT_LINE} {
|
|
11
|
-
background: ${tableBorderSelectedColor
|
|
10
|
+
background: ${tableBorderSelectedColor};
|
|
12
11
|
display: none;
|
|
13
12
|
position: absolute;
|
|
14
13
|
z-index: ${akEditorUnitZIndex};
|
|
15
14
|
${cssString}
|
|
16
15
|
}
|
|
17
16
|
`;
|
|
18
|
-
const Marker =
|
|
19
|
-
background-color: ${tableBorderColor
|
|
17
|
+
const Marker = () => css`
|
|
18
|
+
background-color: ${tableBorderColor};
|
|
20
19
|
position: absolute;
|
|
21
20
|
height: ${lineMarkerSize}px;
|
|
22
21
|
width: ${lineMarkerSize}px;
|
|
23
22
|
border-radius: 50%;
|
|
24
23
|
pointer-events: none;
|
|
25
24
|
`;
|
|
26
|
-
export const InsertMarker =
|
|
25
|
+
export const InsertMarker = cssString => css`
|
|
27
26
|
.${ClassName.CONTROLS_INSERT_MARKER} {
|
|
28
|
-
${Marker(
|
|
27
|
+
${Marker()};
|
|
29
28
|
${cssString}
|
|
30
29
|
}
|
|
31
30
|
`;
|
|
32
31
|
const Button = cssString => css`
|
|
33
|
-
border-radius: ${
|
|
32
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
34
33
|
border-width: 0px;
|
|
35
34
|
display: inline-flex;
|
|
36
35
|
max-width: 100%;
|
|
@@ -50,10 +49,10 @@ const Button = cssString => css`
|
|
|
50
49
|
}
|
|
51
50
|
${cssString}
|
|
52
51
|
`;
|
|
53
|
-
export const HeaderButton =
|
|
52
|
+
export const HeaderButton = cssString => css`
|
|
54
53
|
.${ClassName.CONTROLS_BUTTON} {
|
|
55
|
-
background: ${tableHeaderCellBackgroundColor
|
|
56
|
-
border: 1px solid ${tableBorderColor
|
|
54
|
+
background: ${tableHeaderCellBackgroundColor};
|
|
55
|
+
border: 1px solid ${tableBorderColor};
|
|
57
56
|
display: block;
|
|
58
57
|
box-sizing: border-box;
|
|
59
58
|
padding: 0;
|
|
@@ -77,22 +76,22 @@ export const HeaderButton = (props, cssString) => css`
|
|
|
77
76
|
|
|
78
77
|
.active .${ClassName.CONTROLS_BUTTON} {
|
|
79
78
|
color: ${`var(--ds-icon-inverse, ${N0})`};
|
|
80
|
-
background-color: ${tableToolbarSelectedColor
|
|
81
|
-
border-color: ${tableBorderSelectedColor
|
|
79
|
+
background-color: ${tableToolbarSelectedColor};
|
|
80
|
+
border-color: ${tableBorderSelectedColor};
|
|
82
81
|
}
|
|
83
82
|
`;
|
|
84
|
-
export const HeaderButtonHover =
|
|
83
|
+
export const HeaderButtonHover = () => css`
|
|
85
84
|
.${ClassName.CONTROLS_BUTTON}:hover {
|
|
86
85
|
color: ${`var(--ds-icon-inverse, ${N0})`};
|
|
87
|
-
background-color: ${tableToolbarSelectedColor
|
|
88
|
-
border-color: ${tableBorderSelectedColor
|
|
86
|
+
background-color: ${tableToolbarSelectedColor};
|
|
87
|
+
border-color: ${tableBorderSelectedColor};
|
|
89
88
|
cursor: pointer;
|
|
90
89
|
}
|
|
91
90
|
`;
|
|
92
|
-
export const HeaderButtonDanger =
|
|
91
|
+
export const HeaderButtonDanger = () => css`
|
|
93
92
|
.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.CONTROLS_BUTTON} {
|
|
94
|
-
background-color: ${tableToolbarDeleteColor
|
|
95
|
-
border-color: ${tableBorderDeleteColor
|
|
93
|
+
background-color: ${tableToolbarDeleteColor};
|
|
94
|
+
border-color: ${tableBorderDeleteColor};
|
|
96
95
|
position: relative;
|
|
97
96
|
z-index: ${akEditorUnitZIndex};
|
|
98
97
|
}
|
|
@@ -129,7 +128,7 @@ const InsertButtonHover = () => css`
|
|
|
129
128
|
cursor: pointer;
|
|
130
129
|
}
|
|
131
130
|
`;
|
|
132
|
-
export const dragInsertButtonWrapper =
|
|
131
|
+
export const dragInsertButtonWrapper = () => css`
|
|
133
132
|
.${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER} {
|
|
134
133
|
position: absolute;
|
|
135
134
|
z-index: ${akEditorUnitZIndex + 10};
|
|
@@ -166,7 +165,7 @@ export const dragInsertButtonWrapper = props => css`
|
|
|
166
165
|
|
|
167
166
|
// Explicit pixel values required here to ensure corner button aligns correctly
|
|
168
167
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
169
|
-
export const dragCornerControlButton =
|
|
168
|
+
export const dragCornerControlButton = () => css`
|
|
170
169
|
.${ClassName.DRAG_CORNER_BUTTON} {
|
|
171
170
|
width: 15px;
|
|
172
171
|
height: 15px;
|
|
@@ -215,18 +214,18 @@ export const dragCornerControlButton = props => css`
|
|
|
215
214
|
position: relative;
|
|
216
215
|
}
|
|
217
216
|
`;
|
|
218
|
-
export const insertColumnButtonWrapper =
|
|
217
|
+
export const insertColumnButtonWrapper = () => css`
|
|
219
218
|
${InsertButton()}
|
|
220
219
|
${InsertButtonHover()}
|
|
221
|
-
${InsertLine(
|
|
220
|
+
${InsertLine(`
|
|
222
221
|
width: 2px;
|
|
223
222
|
left: 9px;
|
|
224
223
|
`)}
|
|
225
224
|
`;
|
|
226
|
-
export const insertRowButtonWrapper =
|
|
225
|
+
export const insertRowButtonWrapper = () => css`
|
|
227
226
|
${InsertButton()}
|
|
228
227
|
${InsertButtonHover()}
|
|
229
|
-
${InsertLine(
|
|
228
|
+
${InsertLine(`
|
|
230
229
|
height: 2px;
|
|
231
230
|
top: -11px;
|
|
232
231
|
left: ${tableInsertColumnButtonSize - 1}px;
|
|
@@ -244,7 +243,7 @@ export const columnControlsLineMarker = () => css`
|
|
|
244
243
|
position: relative;
|
|
245
244
|
}
|
|
246
245
|
`;
|
|
247
|
-
export const DeleteButton =
|
|
246
|
+
export const DeleteButton = () => css`
|
|
248
247
|
.${ClassName.CONTROLS_DELETE_BUTTON_WRAP},
|
|
249
248
|
.${ClassName.CONTROLS_DELETE_BUTTON} {
|
|
250
249
|
height: ${tableDeleteButtonSize}px;
|
|
@@ -253,19 +252,19 @@ export const DeleteButton = props => css`
|
|
|
253
252
|
.${ClassName.CONTROLS_DELETE_BUTTON_WRAP} {
|
|
254
253
|
.${ClassName.CONTROLS_DELETE_BUTTON} {
|
|
255
254
|
${Button(`
|
|
256
|
-
background: ${tableCellSelectedDeleteIconBackground
|
|
257
|
-
color: ${tableCellSelectedDeleteIconColor
|
|
255
|
+
background: ${tableCellSelectedDeleteIconBackground};
|
|
256
|
+
color: ${tableCellSelectedDeleteIconColor};
|
|
258
257
|
`)}
|
|
259
258
|
}
|
|
260
259
|
}
|
|
261
260
|
|
|
262
261
|
.${ClassName.CONTROLS_DELETE_BUTTON}:hover {
|
|
263
|
-
background: ${tableCellHoverDeleteIconBackground
|
|
264
|
-
color: ${tableCellHoverDeleteIconColor
|
|
262
|
+
background: ${tableCellHoverDeleteIconBackground};
|
|
263
|
+
color: ${tableCellHoverDeleteIconColor};
|
|
265
264
|
cursor: pointer;
|
|
266
265
|
}
|
|
267
266
|
`;
|
|
268
|
-
export const OverflowShadow =
|
|
267
|
+
export const OverflowShadow = () => css`
|
|
269
268
|
.${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
|
|
270
269
|
display: block;
|
|
271
270
|
height: calc(100% - ${tableMarginTop}px);
|
|
@@ -309,7 +308,7 @@ export const OverflowShadow = props => css`
|
|
|
309
308
|
.${ClassName.WITH_CONTROLS} {
|
|
310
309
|
${overflowShadowWidhoutDnD()}
|
|
311
310
|
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
312
|
-
border-left: 1px solid ${tableBorderColor
|
|
311
|
+
border-left: 1px solid ${tableBorderColor};
|
|
313
312
|
}
|
|
314
313
|
}
|
|
315
314
|
`;
|
|
@@ -323,10 +322,10 @@ const overflowShadowWidhoutDnD = () => {
|
|
|
323
322
|
`;
|
|
324
323
|
}
|
|
325
324
|
};
|
|
326
|
-
const columnHeaderButton =
|
|
325
|
+
const columnHeaderButton = cssString => {
|
|
327
326
|
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
328
327
|
return css`
|
|
329
|
-
background: ${tableHeaderCellBackgroundColor
|
|
328
|
+
background: ${tableHeaderCellBackgroundColor};
|
|
330
329
|
display: block;
|
|
331
330
|
box-sizing: border-box;
|
|
332
331
|
padding: 0;
|
|
@@ -339,8 +338,8 @@ const columnHeaderButton = (props, cssString) => {
|
|
|
339
338
|
`;
|
|
340
339
|
} else {
|
|
341
340
|
return css`
|
|
342
|
-
background: ${tableHeaderCellBackgroundColor
|
|
343
|
-
border: 1px solid ${tableBorderColor
|
|
341
|
+
background: ${tableHeaderCellBackgroundColor};
|
|
342
|
+
border: 1px solid ${tableBorderColor};
|
|
344
343
|
display: block;
|
|
345
344
|
box-sizing: border-box;
|
|
346
345
|
padding: 0;
|
|
@@ -353,13 +352,13 @@ const columnHeaderButton = (props, cssString) => {
|
|
|
353
352
|
`;
|
|
354
353
|
}
|
|
355
354
|
};
|
|
356
|
-
const columnHeaderButtonSelected =
|
|
355
|
+
const columnHeaderButtonSelected = () => css`
|
|
357
356
|
color: ${`var(--ds-text-inverse, ${N0})`};
|
|
358
|
-
background-color: ${tableToolbarSelectedColor
|
|
359
|
-
border-color: ${tableBorderSelectedColor
|
|
357
|
+
background-color: ${tableToolbarSelectedColor};
|
|
358
|
+
border-color: ${tableBorderSelectedColor};
|
|
360
359
|
z-index: ${columnControlsSelectedZIndex};
|
|
361
360
|
`;
|
|
362
|
-
const getFloatingDotOverrides =
|
|
361
|
+
const getFloatingDotOverrides = () => {
|
|
363
362
|
return getBooleanFF('platform.editor.custom-table-width') ? css`
|
|
364
363
|
tr
|
|
365
364
|
th:last-child
|
|
@@ -368,7 +367,7 @@ const getFloatingDotOverrides = props => {
|
|
|
368
367
|
td:last-child
|
|
369
368
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::before {
|
|
370
369
|
content: '';
|
|
371
|
-
background-color: ${tableBorderColor
|
|
370
|
+
background-color: ${tableBorderColor};
|
|
372
371
|
position: absolute;
|
|
373
372
|
height: ${lineMarkerSize}px;
|
|
374
373
|
width: ${lineMarkerSize}px;
|
|
@@ -379,7 +378,7 @@ const getFloatingDotOverrides = props => {
|
|
|
379
378
|
}
|
|
380
379
|
` : '';
|
|
381
380
|
};
|
|
382
|
-
export const floatingColumnControls =
|
|
381
|
+
export const floatingColumnControls = () => {
|
|
383
382
|
return css`
|
|
384
383
|
.${ClassName.DRAG_COLUMN_DROP_TARGET_CONTROLS} {
|
|
385
384
|
box-sizing: border-box;
|
|
@@ -402,7 +401,7 @@ export const floatingColumnControls = props => {
|
|
|
402
401
|
}
|
|
403
402
|
`;
|
|
404
403
|
};
|
|
405
|
-
export const rowControlsWrapperDotStyle =
|
|
404
|
+
export const rowControlsWrapperDotStyle = () => {
|
|
406
405
|
return css`
|
|
407
406
|
// override for DnD controls
|
|
408
407
|
div.${ClassName.WITH_CONTROLS}>.${ClassName.DRAG_ROW_CONTROLS_WRAPPER}::after {
|
|
@@ -411,7 +410,7 @@ export const rowControlsWrapperDotStyle = props => {
|
|
|
411
410
|
|
|
412
411
|
div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
|
|
413
412
|
content: ' ';
|
|
414
|
-
background-color: ${tableBorderColor
|
|
413
|
+
background-color: ${tableBorderColor};
|
|
415
414
|
position: absolute;
|
|
416
415
|
height: ${lineMarkerSize}px;
|
|
417
416
|
width: ${lineMarkerSize}px;
|
|
@@ -422,7 +421,7 @@ export const rowControlsWrapperDotStyle = props => {
|
|
|
422
421
|
}
|
|
423
422
|
`;
|
|
424
423
|
};
|
|
425
|
-
export const columnControlsDecoration =
|
|
424
|
+
export const columnControlsDecoration = () => {
|
|
426
425
|
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
427
426
|
return css`
|
|
428
427
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
@@ -436,7 +435,7 @@ export const columnControlsDecoration = props => {
|
|
|
436
435
|
// floating dot for adding column button
|
|
437
436
|
&::before {
|
|
438
437
|
content: ' ';
|
|
439
|
-
background-color: ${tableBorderColor
|
|
438
|
+
background-color: ${tableBorderColor};
|
|
440
439
|
position: absolute;
|
|
441
440
|
height: ${lineMarkerSize}px;
|
|
442
441
|
width: ${lineMarkerSize}px;
|
|
@@ -449,10 +448,10 @@ export const columnControlsDecoration = props => {
|
|
|
449
448
|
&::after {
|
|
450
449
|
content: ' ';
|
|
451
450
|
|
|
452
|
-
${columnHeaderButton(
|
|
453
|
-
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor
|
|
454
|
-
border-top: ${tableCellBorderWidth}px solid ${tableBorderColor
|
|
455
|
-
border-bottom: ${tableCellBorderWidth}px solid ${tableBorderColor
|
|
451
|
+
${columnHeaderButton(`
|
|
452
|
+
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
453
|
+
border-top: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
454
|
+
border-bottom: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
456
455
|
box-sizing: content-box;
|
|
457
456
|
height: ${tableToolbarSize - 1}px;
|
|
458
457
|
width: 100%;
|
|
@@ -465,7 +464,7 @@ export const columnControlsDecoration = props => {
|
|
|
465
464
|
}
|
|
466
465
|
|
|
467
466
|
// floating dot for adding column button - overriding style on last column to avoid scroll
|
|
468
|
-
${getFloatingDotOverrides(
|
|
467
|
+
${getFloatingDotOverrides()}
|
|
469
468
|
|
|
470
469
|
.${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
471
470
|
display: block;
|
|
@@ -474,13 +473,13 @@ export const columnControlsDecoration = props => {
|
|
|
474
473
|
table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
|
|
475
474
|
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_TABLE} {
|
|
476
475
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
477
|
-
${columnHeaderButtonSelected(
|
|
476
|
+
${columnHeaderButtonSelected()};
|
|
478
477
|
}
|
|
479
478
|
|
|
480
479
|
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
481
480
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
482
|
-
background-color: ${tableToolbarDeleteColor
|
|
483
|
-
border-color: ${tableBorderDeleteColor
|
|
481
|
+
background-color: ${tableToolbarDeleteColor};
|
|
482
|
+
border-color: ${tableBorderDeleteColor};
|
|
484
483
|
z-index: ${akEditorUnitZIndex * 100};
|
|
485
484
|
}
|
|
486
485
|
}
|
|
@@ -489,9 +488,9 @@ export const columnControlsDecoration = props => {
|
|
|
489
488
|
table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
|
|
490
489
|
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
|
|
491
490
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
492
|
-
${columnHeaderButtonSelected(
|
|
491
|
+
${columnHeaderButtonSelected()};
|
|
493
492
|
border-left: ${tableCellBorderWidth}px solid
|
|
494
|
-
${tableBorderSelectedColor
|
|
493
|
+
${tableBorderSelectedColor};
|
|
495
494
|
left: -${tableCellBorderWidth}px;
|
|
496
495
|
}
|
|
497
496
|
}
|
|
@@ -500,15 +499,15 @@ export const columnControlsDecoration = props => {
|
|
|
500
499
|
table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
|
|
501
500
|
&.${ClassName.HOVERED_COLUMN} {
|
|
502
501
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
503
|
-
${columnHeaderButtonSelected(
|
|
502
|
+
${columnHeaderButtonSelected()};
|
|
504
503
|
}
|
|
505
504
|
|
|
506
505
|
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
507
506
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
508
|
-
background-color: ${tableToolbarDeleteColor
|
|
509
|
-
border-color: ${tableBorderDeleteColor
|
|
507
|
+
background-color: ${tableToolbarDeleteColor};
|
|
508
|
+
border-color: ${tableBorderDeleteColor};
|
|
510
509
|
border-left: ${tableCellBorderWidth}px solid
|
|
511
|
-
${tableBorderDeleteColor
|
|
510
|
+
${tableBorderDeleteColor};
|
|
512
511
|
left: -${tableCellBorderWidth}px;
|
|
513
512
|
z-index: ${akEditorUnitZIndex * 100};
|
|
514
513
|
}
|
|
@@ -524,7 +523,7 @@ export const columnControlsDecoration = props => {
|
|
|
524
523
|
tr:first-of-type
|
|
525
524
|
th.${ClassName.TABLE_HEADER_CELL} {
|
|
526
525
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
527
|
-
${columnHeaderButtonSelected(
|
|
526
|
+
${columnHeaderButtonSelected()};
|
|
528
527
|
}
|
|
529
528
|
}
|
|
530
529
|
`;
|
|
@@ -541,7 +540,7 @@ export const columnControlsDecoration = props => {
|
|
|
541
540
|
// floating dot for adding column button
|
|
542
541
|
&::before {
|
|
543
542
|
content: ' ';
|
|
544
|
-
background-color: ${tableBorderColor
|
|
543
|
+
background-color: ${tableBorderColor};
|
|
545
544
|
position: absolute;
|
|
546
545
|
height: ${lineMarkerSize}px;
|
|
547
546
|
width: ${lineMarkerSize}px;
|
|
@@ -554,8 +553,8 @@ export const columnControlsDecoration = props => {
|
|
|
554
553
|
&::after {
|
|
555
554
|
content: ' ';
|
|
556
555
|
|
|
557
|
-
${columnHeaderButton(
|
|
558
|
-
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor
|
|
556
|
+
${columnHeaderButton(`
|
|
557
|
+
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
559
558
|
border-bottom: none;
|
|
560
559
|
height: ${tableToolbarSize}px;
|
|
561
560
|
width: 100%;
|
|
@@ -568,7 +567,7 @@ export const columnControlsDecoration = props => {
|
|
|
568
567
|
}
|
|
569
568
|
|
|
570
569
|
// floating dot for adding column button - overriding style on last column to avoid scroll
|
|
571
|
-
${getFloatingDotOverrides(
|
|
570
|
+
${getFloatingDotOverrides()}
|
|
572
571
|
|
|
573
572
|
.${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
574
573
|
display: block;
|
|
@@ -584,13 +583,13 @@ export const columnControlsDecoration = props => {
|
|
|
584
583
|
&.${ClassName.HOVERED_COLUMN},
|
|
585
584
|
&.${ClassName.HOVERED_TABLE} {
|
|
586
585
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
587
|
-
${columnHeaderButtonSelected(
|
|
586
|
+
${columnHeaderButtonSelected()};
|
|
588
587
|
}
|
|
589
588
|
|
|
590
589
|
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
591
590
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
592
|
-
background-color: ${tableToolbarDeleteColor
|
|
593
|
-
border: 1px solid ${tableBorderDeleteColor
|
|
591
|
+
background-color: ${tableToolbarDeleteColor};
|
|
592
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
594
593
|
border-bottom: none;
|
|
595
594
|
z-index: ${akEditorUnitZIndex * 100};
|
|
596
595
|
}
|
|
@@ -606,48 +605,48 @@ export const columnControlsDecoration = props => {
|
|
|
606
605
|
tr:first-of-type
|
|
607
606
|
th.${ClassName.TABLE_HEADER_CELL} {
|
|
608
607
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
609
|
-
${columnHeaderButtonSelected(
|
|
608
|
+
${columnHeaderButtonSelected()};
|
|
610
609
|
}
|
|
611
610
|
}
|
|
612
611
|
`;
|
|
613
612
|
}
|
|
614
613
|
};
|
|
615
|
-
export const hoveredDeleteButton =
|
|
614
|
+
export const hoveredDeleteButton = () => css`
|
|
616
615
|
.${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
|
|
617
616
|
.${ClassName.SELECTED_CELL},
|
|
618
617
|
.${ClassName.COLUMN_SELECTED},
|
|
619
618
|
.${ClassName.HOVERED_CELL} {
|
|
620
|
-
border: 1px solid ${tableBorderDeleteColor
|
|
619
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
621
620
|
}
|
|
622
621
|
.${ClassName.SELECTED_CELL}::after {
|
|
623
|
-
background: ${tableCellDeleteColor
|
|
622
|
+
background: ${tableCellDeleteColor};
|
|
624
623
|
}
|
|
625
624
|
|
|
626
625
|
.${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
627
626
|
td.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
|
|
628
|
-
background: ${tableCellDeleteColor
|
|
629
|
-
border: 1px solid ${tableBorderDeleteColor
|
|
627
|
+
background: ${tableCellDeleteColor};
|
|
628
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
630
629
|
}
|
|
631
630
|
th.${ClassName.HOVERED_NO_HIGHLIGHT} {
|
|
632
631
|
background-color: unset;
|
|
633
632
|
}
|
|
634
633
|
th.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
|
|
635
|
-
background: ${tableCellDeleteColor
|
|
636
|
-
border: 1px solid ${tableBorderDeleteColor
|
|
634
|
+
background: ${tableCellDeleteColor};
|
|
635
|
+
border: 1px solid ${tableBorderDeleteColor};
|
|
637
636
|
}
|
|
638
637
|
}
|
|
639
638
|
}
|
|
640
639
|
`;
|
|
641
|
-
export const hoveredCell =
|
|
640
|
+
export const hoveredCell = () => css`
|
|
642
641
|
:not(.${ClassName.IS_RESIZING})
|
|
643
642
|
.${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
|
|
644
643
|
.${ClassName.HOVERED_CELL} {
|
|
645
644
|
position: relative;
|
|
646
|
-
border: 1px solid ${tableBorderSelectedColor
|
|
645
|
+
border: 1px solid ${tableBorderSelectedColor};
|
|
647
646
|
}
|
|
648
647
|
.${ClassName.HOVERED_CELL}.${ClassName.HOVERED_NO_HIGHLIGHT} {
|
|
649
648
|
position: relative;
|
|
650
|
-
border: 1px solid ${tableBorderColor
|
|
649
|
+
border: 1px solid ${tableBorderColor};
|
|
651
650
|
}
|
|
652
651
|
}
|
|
653
652
|
`;
|
|
@@ -681,7 +680,7 @@ const getLastColumnResizerOverrides = () => {
|
|
|
681
680
|
}
|
|
682
681
|
` : '';
|
|
683
682
|
};
|
|
684
|
-
const resizeHandleOverrides =
|
|
683
|
+
const resizeHandleOverrides = () => {
|
|
685
684
|
if (getBooleanFF('platform.editor.table.drag-and-drop')) {
|
|
686
685
|
return css`
|
|
687
686
|
th.${ClassName.WITH_RESIZE_LINE}::before,
|
|
@@ -692,7 +691,7 @@ const resizeHandleOverrides = props => {
|
|
|
692
691
|
top: -1px;
|
|
693
692
|
width: ${resizeLineWidth}px;
|
|
694
693
|
height: calc(100% + 2px);
|
|
695
|
-
background-color: ${tableBorderSelectedColor
|
|
694
|
+
background-color: ${tableBorderSelectedColor};
|
|
696
695
|
z-index: ${columnControlsZIndex * 2};
|
|
697
696
|
}
|
|
698
697
|
|
|
@@ -704,7 +703,7 @@ const resizeHandleOverrides = props => {
|
|
|
704
703
|
top: -1px;
|
|
705
704
|
width: ${resizeLineWidth}px;
|
|
706
705
|
height: calc(100% + 2px);
|
|
707
|
-
background-color: ${tableBorderSelectedColor
|
|
706
|
+
background-color: ${tableBorderSelectedColor};
|
|
708
707
|
z-index: ${columnControlsZIndex * 2};
|
|
709
708
|
}
|
|
710
709
|
`;
|
|
@@ -717,7 +716,7 @@ const resizeHandleOverrides = props => {
|
|
|
717
716
|
top: -1px;
|
|
718
717
|
width: ${resizeLineWidth}px;
|
|
719
718
|
height: calc(100% + 2px);
|
|
720
|
-
background-color: ${tableBorderSelectedColor
|
|
719
|
+
background-color: ${tableBorderSelectedColor};
|
|
721
720
|
z-index: ${columnControlsZIndex * 2};
|
|
722
721
|
}
|
|
723
722
|
|
|
@@ -727,7 +726,7 @@ const resizeHandleOverrides = props => {
|
|
|
727
726
|
position: absolute;
|
|
728
727
|
width: ${resizeLineWidth}px;
|
|
729
728
|
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
730
|
-
background-color: ${tableBorderSelectedColor
|
|
729
|
+
background-color: ${tableBorderSelectedColor};
|
|
731
730
|
z-index: ${columnControlsZIndex * 2};
|
|
732
731
|
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
733
732
|
}
|
|
@@ -739,7 +738,7 @@ const resizeHandleOverrides = props => {
|
|
|
739
738
|
top: -1px;
|
|
740
739
|
width: ${resizeLineWidth}px;
|
|
741
740
|
height: calc(100% + 2px);
|
|
742
|
-
background-color: ${tableBorderSelectedColor
|
|
741
|
+
background-color: ${tableBorderSelectedColor};
|
|
743
742
|
z-index: ${columnControlsZIndex * 2};
|
|
744
743
|
}
|
|
745
744
|
|
|
@@ -749,13 +748,13 @@ const resizeHandleOverrides = props => {
|
|
|
749
748
|
position: absolute;
|
|
750
749
|
width: ${resizeLineWidth}px;
|
|
751
750
|
height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
|
|
752
|
-
background-color: ${tableBorderSelectedColor
|
|
751
|
+
background-color: ${tableBorderSelectedColor};
|
|
753
752
|
z-index: ${columnControlsZIndex * 2};
|
|
754
753
|
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
755
754
|
}
|
|
756
755
|
`;
|
|
757
756
|
};
|
|
758
|
-
export const resizeHandle =
|
|
757
|
+
export const resizeHandle = () => css`
|
|
759
758
|
.${ClassName.TABLE_CONTAINER} {
|
|
760
759
|
.${ClassName.RESIZE_HANDLE_DECORATION} {
|
|
761
760
|
background-color: transparent;
|
|
@@ -770,7 +769,7 @@ export const resizeHandle = props => css`
|
|
|
770
769
|
|
|
771
770
|
${getLastColumnResizerOverrides()}
|
|
772
771
|
|
|
773
|
-
${resizeHandleOverrides(
|
|
772
|
+
${resizeHandleOverrides()}
|
|
774
773
|
|
|
775
774
|
table
|
|
776
775
|
tr:first-of-type
|
|
@@ -787,7 +786,7 @@ export const resizeHandle = props => css`
|
|
|
787
786
|
`;
|
|
788
787
|
|
|
789
788
|
// Drag and Drop: drop target insert line
|
|
790
|
-
export const insertLine =
|
|
789
|
+
export const insertLine = () => css`
|
|
791
790
|
.${ClassName.TABLE_CONTAINER} {
|
|
792
791
|
td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
|
|
793
792
|
content: ' ';
|
|
@@ -796,7 +795,7 @@ export const insertLine = props => css`
|
|
|
796
795
|
top: -1px;
|
|
797
796
|
width: ${insertLineWidth}px;
|
|
798
797
|
height: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
799
|
-
background-color: ${tableBorderSelectedColor
|
|
798
|
+
background-color: ${tableBorderSelectedColor};
|
|
800
799
|
z-index: ${columnControlsZIndex * 2};
|
|
801
800
|
}
|
|
802
801
|
|
|
@@ -806,7 +805,7 @@ export const insertLine = props => css`
|
|
|
806
805
|
position: absolute;
|
|
807
806
|
width: ${insertLineWidth}px;
|
|
808
807
|
height: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
809
|
-
background-color: ${tableBorderSelectedColor
|
|
808
|
+
background-color: ${tableBorderSelectedColor};
|
|
810
809
|
z-index: ${columnControlsZIndex * 2};
|
|
811
810
|
top: -${tableCellBorderWidth}px;
|
|
812
811
|
}
|
|
@@ -818,7 +817,7 @@ export const insertLine = props => css`
|
|
|
818
817
|
top: -1px;
|
|
819
818
|
width: ${insertLineWidth}px;
|
|
820
819
|
height: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
821
|
-
background-color: ${tableBorderSelectedColor
|
|
820
|
+
background-color: ${tableBorderSelectedColor};
|
|
822
821
|
z-index: ${columnControlsZIndex * 2};
|
|
823
822
|
}
|
|
824
823
|
|
|
@@ -828,7 +827,7 @@ export const insertLine = props => css`
|
|
|
828
827
|
position: absolute;
|
|
829
828
|
width: ${insertLineWidth}px;
|
|
830
829
|
height: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
831
|
-
background-color: ${tableBorderSelectedColor
|
|
830
|
+
background-color: ${tableBorderSelectedColor};
|
|
832
831
|
z-index: ${columnControlsZIndex * 2};
|
|
833
832
|
top: -${tableCellBorderWidth}px;
|
|
834
833
|
}
|
|
@@ -840,7 +839,7 @@ export const insertLine = props => css`
|
|
|
840
839
|
top: -1px;
|
|
841
840
|
width: ${insertLineWidth}px;
|
|
842
841
|
height: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
843
|
-
background-color: ${tableBorderSelectedColor
|
|
842
|
+
background-color: ${tableBorderSelectedColor};
|
|
844
843
|
z-index: ${columnControlsZIndex * 2};
|
|
845
844
|
}
|
|
846
845
|
|
|
@@ -850,7 +849,7 @@ export const insertLine = props => css`
|
|
|
850
849
|
position: absolute;
|
|
851
850
|
width: ${insertLineWidth}px;
|
|
852
851
|
height: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
853
|
-
background-color: ${tableBorderSelectedColor
|
|
852
|
+
background-color: ${tableBorderSelectedColor};
|
|
854
853
|
z-index: ${columnControlsZIndex * 2};
|
|
855
854
|
top: -${tableCellBorderWidth}px;
|
|
856
855
|
}
|
|
@@ -862,7 +861,7 @@ export const insertLine = props => css`
|
|
|
862
861
|
top: -1px;
|
|
863
862
|
height: ${insertLineWidth}px;
|
|
864
863
|
width: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
865
|
-
background-color: ${tableBorderSelectedColor
|
|
864
|
+
background-color: ${tableBorderSelectedColor};
|
|
866
865
|
z-index: ${columnControlsZIndex * 2};
|
|
867
866
|
}
|
|
868
867
|
|
|
@@ -872,7 +871,7 @@ export const insertLine = props => css`
|
|
|
872
871
|
position: absolute;
|
|
873
872
|
height: ${insertLineWidth}px;
|
|
874
873
|
width: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
875
|
-
background-color: ${tableBorderSelectedColor
|
|
874
|
+
background-color: ${tableBorderSelectedColor};
|
|
876
875
|
z-index: ${columnControlsZIndex * 2};
|
|
877
876
|
top: -1px;
|
|
878
877
|
}
|
|
@@ -884,7 +883,7 @@ export const insertLine = props => css`
|
|
|
884
883
|
bottom: 0;
|
|
885
884
|
height: ${insertLineWidth}px;
|
|
886
885
|
width: calc(100% + 2px);
|
|
887
|
-
background-color: ${tableBorderSelectedColor
|
|
886
|
+
background-color: ${tableBorderSelectedColor};
|
|
888
887
|
z-index: ${columnControlsZIndex * 2};
|
|
889
888
|
}
|
|
890
889
|
|
|
@@ -895,7 +894,7 @@ export const insertLine = props => css`
|
|
|
895
894
|
position: absolute;
|
|
896
895
|
height: ${insertLineWidth}px;
|
|
897
896
|
width: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
898
|
-
background-color: ${tableBorderSelectedColor
|
|
897
|
+
background-color: ${tableBorderSelectedColor};
|
|
899
898
|
z-index: ${columnControlsZIndex * 2};
|
|
900
899
|
}
|
|
901
900
|
}
|
package/dist/esm/types.js
CHANGED
|
@@ -124,6 +124,7 @@ export var TableCssClassName = _objectSpread(_objectSpread({}, TableSharedCssCla
|
|
|
124
124
|
CONTEXTUAL_MENU_BUTTON: "".concat(tablePrefixSelector, "-contextual-menu-button"),
|
|
125
125
|
CONTEXTUAL_MENU_BUTTON_FIXED: "".concat(tablePrefixSelector, "-contextual-menu-button-fixed"),
|
|
126
126
|
CONTEXTUAL_MENU_ICON: "".concat(tablePrefixSelector, "-contextual-submenu-icon"),
|
|
127
|
+
CONTEXTUAL_MENU_ICON_SMALL: "".concat(tablePrefixSelector, "-contextual-submenu-icon-small"),
|
|
127
128
|
// come from prosemirror-table
|
|
128
129
|
SELECTED_CELL: 'selectedCell',
|
|
129
130
|
// defined in ReactNodeView based on PM node name
|
|
@@ -45,13 +45,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
45
45
|
}
|
|
46
46
|
var labelCellOptions = formatMessage(messages.cellOptions);
|
|
47
47
|
var button = jsx("div", {
|
|
48
|
-
css:
|
|
49
|
-
return [tableFloatingCellButtonStyles({
|
|
50
|
-
theme: theme
|
|
51
|
-
}), isContextualMenuOpen && tableFloatingCellButtonSelectedStyles({
|
|
52
|
-
theme: theme
|
|
53
|
-
})];
|
|
54
|
-
}
|
|
48
|
+
css: [tableFloatingCellButtonStyles(), isContextualMenuOpen && tableFloatingCellButtonSelectedStyles()]
|
|
55
49
|
}, jsx(ToolbarButton, {
|
|
56
50
|
className: ClassName.CONTEXTUAL_MENU_BUTTON,
|
|
57
51
|
selected: isContextualMenuOpen,
|