@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.
Files changed (68) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/types.js +1 -0
  3. package/dist/cjs/ui/FloatingContextualButton/index.js +1 -7
  4. package/dist/cjs/ui/FloatingContextualButton/styles.js +5 -25
  5. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +238 -99
  6. package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -2
  7. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -1
  8. package/dist/cjs/ui/common-styles.js +7 -7
  9. package/dist/cjs/ui/consts.js +16 -63
  10. package/dist/cjs/ui/icons/MergeCellsIcon.js +34 -0
  11. package/dist/cjs/ui/icons/SplitCellIcon.js +41 -0
  12. package/dist/cjs/ui/icons/index.js +14 -0
  13. package/dist/cjs/ui/ui-styles.js +47 -48
  14. package/dist/es2019/types.js +1 -0
  15. package/dist/es2019/ui/FloatingContextualButton/index.js +1 -5
  16. package/dist/es2019/ui/FloatingContextualButton/styles.js +10 -31
  17. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +248 -71
  18. package/dist/es2019/ui/FloatingContextualMenu/styles.js +22 -3
  19. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -1
  20. package/dist/es2019/ui/common-styles.js +59 -59
  21. package/dist/es2019/ui/consts.js +18 -64
  22. package/dist/es2019/ui/icons/MergeCellsIcon.js +25 -0
  23. package/dist/es2019/ui/icons/SplitCellIcon.js +32 -0
  24. package/dist/es2019/ui/icons/index.js +2 -0
  25. package/dist/es2019/ui/ui-styles.js +98 -99
  26. package/dist/esm/types.js +1 -0
  27. package/dist/esm/ui/FloatingContextualButton/index.js +1 -7
  28. package/dist/esm/ui/FloatingContextualButton/styles.js +5 -26
  29. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +238 -98
  30. package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -2
  31. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
  32. package/dist/esm/ui/common-styles.js +7 -7
  33. package/dist/esm/ui/consts.js +18 -64
  34. package/dist/esm/ui/icons/MergeCellsIcon.js +27 -0
  35. package/dist/esm/ui/icons/SplitCellIcon.js +34 -0
  36. package/dist/esm/ui/icons/index.js +2 -0
  37. package/dist/esm/ui/ui-styles.js +47 -48
  38. package/dist/types/types.d.ts +1 -0
  39. package/dist/types/ui/FloatingContextualButton/styles.d.ts +2 -3
  40. package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
  41. package/dist/types/ui/common-styles.d.ts +1 -2
  42. package/dist/types/ui/consts.d.ts +15 -15
  43. package/dist/types/ui/icons/MergeCellsIcon.d.ts +2 -0
  44. package/dist/types/ui/icons/SplitCellIcon.d.ts +2 -0
  45. package/dist/types/ui/icons/index.d.ts +2 -0
  46. package/dist/types/ui/ui-styles.d.ts +17 -18
  47. package/dist/types-ts4.5/types.d.ts +1 -0
  48. package/dist/types-ts4.5/ui/FloatingContextualButton/styles.d.ts +2 -3
  49. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
  50. package/dist/types-ts4.5/ui/common-styles.d.ts +1 -2
  51. package/dist/types-ts4.5/ui/consts.d.ts +15 -15
  52. package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +2 -0
  53. package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +2 -0
  54. package/dist/types-ts4.5/ui/icons/index.d.ts +2 -0
  55. package/dist/types-ts4.5/ui/ui-styles.d.ts +17 -18
  56. package/package.json +12 -5
  57. package/src/types.ts +1 -0
  58. package/src/ui/FloatingContextualButton/index.tsx +3 -5
  59. package/src/ui/FloatingContextualButton/styles.ts +13 -35
  60. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +316 -68
  61. package/src/ui/FloatingContextualMenu/styles.ts +22 -3
  62. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -1
  63. package/src/ui/common-styles.ts +57 -69
  64. package/src/ui/consts.ts +52 -73
  65. package/src/ui/icons/MergeCellsIcon.tsx +32 -0
  66. package/src/ui/icons/SplitCellIcon.tsx +40 -0
  67. package/src/ui/icons/index.ts +2 -0
  68. package/src/ui/ui-styles.ts +94 -106
@@ -2,7 +2,6 @@ import { css } from '@emotion/react';
2
2
 
3
3
  import { tableBackgroundBorderColor } from '@atlaskit/adf-schema';
4
4
  import { N60A, N90 } from '@atlaskit/theme/colors';
5
- import { borderRadius } from '@atlaskit/theme/constants';
6
5
  import { token } from '@atlaskit/tokens';
7
6
 
8
7
  import { TableCssClassName as ClassName } from '../../types';
@@ -18,7 +17,7 @@ export const cellColourPreviewStyles = (selectedColor: string) => css`
18
17
  // TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
19
18
  export const tablePopupStyles = css`
20
19
  .${ClassName.CONTEXTUAL_SUBMENU} {
21
- border-radius: ${borderRadius()}px;
20
+ border-radius: ${token('border.radius', '3px')};
22
21
  background: ${token('elevation.surface.overlay', 'white')};
23
22
  box-shadow: ${token(
24
23
  'elevation.shadow.overlay',
@@ -42,7 +41,7 @@ export const tablePopupStyles = css`
42
41
  content: '';
43
42
  display: block;
44
43
  border: 1px solid ${tableBackgroundBorderColor};
45
- border-radius: ${borderRadius()}px;
44
+ border-radius: ${token('border.radius', '3px')};
46
45
  width: 20px;
47
46
  height: 20px;
48
47
  }
@@ -54,4 +53,24 @@ export const tablePopupStyles = css`
54
53
  color: ${token('color.icon', N90)};
55
54
  }
56
55
  }
56
+
57
+ .${ClassName.CONTEXTUAL_MENU_ICON_SMALL} {
58
+ display: flex;
59
+
60
+ &::before {
61
+ content: '';
62
+ display: block;
63
+ border: 1px solid ${tableBackgroundBorderColor};
64
+ border-radius: ${token('border.radius', '3px')};
65
+ width: 14px;
66
+ height: 14px;
67
+ }
68
+
69
+ &::after {
70
+ content: '›';
71
+ margin-left: ${token('space.050', '4px')};
72
+ line-height: 14px;
73
+ color: ${token('color.icon', N90)};
74
+ }
75
+ }
57
76
  `;
@@ -47,7 +47,7 @@ export default class NumberColumn extends Component<Props, any> {
47
47
  : undefined,
48
48
  borderLeft:
49
49
  isDragAndDropEnabled && tableActive
50
- ? `1px solid ${tableBorderColor()}`
50
+ ? `1px solid ${tableBorderColor}`
51
51
  : undefined,
52
52
  }}
53
53
  contentEditable={false}
@@ -23,7 +23,6 @@ import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
23
23
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
24
24
  import { B300, N0, N20A, N300, N40A, R500 } from '@atlaskit/theme/colors';
25
25
  import { fontSize } from '@atlaskit/theme/constants';
26
- import type { ThemeProps } from '@atlaskit/theme/types';
27
26
  import { token } from '@atlaskit/tokens';
28
27
 
29
28
  import { TableCssClassName as ClassName } from '../types';
@@ -195,19 +194,15 @@ const breakoutWidthStyling = () => {
195
194
  `;
196
195
  };
197
196
 
198
- const tableBorderStyles = (
199
- props: ThemeProps & { featureFlags?: FeatureFlags },
200
- ) => {
197
+ const tableBorderStyles = () => {
201
198
  if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
202
- return `border-color: ${tableBorderDeleteColor(props)}`;
199
+ return `border-color: ${tableBorderDeleteColor}`;
203
200
  } else {
204
- return `border: 1px solid ${tableBorderDeleteColor(props)}`;
201
+ return `border: 1px solid ${tableBorderDeleteColor}`;
205
202
  }
206
203
  };
207
204
 
208
- const tableStickyHeaderColumnControlsDecorationsStyle = (
209
- props: ThemeProps & { featureFlags?: FeatureFlags },
210
- ) => {
205
+ const tableStickyHeaderColumnControlsDecorationsStyle = () => {
211
206
  if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
212
207
  return css`
213
208
  .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
@@ -217,7 +212,7 @@ const tableStickyHeaderColumnControlsDecorationsStyle = (
217
212
 
218
213
  .${ClassName.TABLE_STICKY}
219
214
  .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
220
- border-left: 1px solid ${tableBorderColor(props)};
215
+ border-left: 1px solid ${tableBorderColor};
221
216
  }
222
217
 
223
218
  .${ClassName.TABLE_STICKY}
@@ -239,9 +234,7 @@ const tableStickyHeaderColumnControlsDecorationsStyle = (
239
234
  }
240
235
  };
241
236
 
242
- const tableStickyHeaderFirefoxFixStyle = (
243
- props: ThemeProps & { featureFlags?: FeatureFlags },
244
- ) => {
237
+ const tableStickyHeaderFirefoxFixStyle = () => {
245
238
  /*
246
239
  This is MAGIC!
247
240
  This fixes a bug which occurs in firefox when the first row becomes sticky.
@@ -290,9 +283,7 @@ const tableWrapperStyles = () => {
290
283
  };
291
284
 
292
285
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
293
- export const tableStyles = (
294
- props: ThemeProps & { featureFlags?: FeatureFlags },
295
- ) => css`
286
+ export const tableStyles = (props: { featureFlags?: FeatureFlags }) => css`
296
287
  .${ClassName.LAYOUT_BUTTON} button {
297
288
  background: ${token('color.background.neutral', N20A)};
298
289
  color: ${token('color.icon', N300)};
@@ -306,13 +297,13 @@ export const tableStyles = (
306
297
  }
307
298
 
308
299
  .ProseMirror {
309
- ${tableSharedStyle(props)};
300
+ ${tableSharedStyle()};
310
301
  ${columnControlsLineMarker()};
311
- ${hoveredDeleteButton(props)};
312
- ${hoveredCell(props)};
302
+ ${hoveredDeleteButton()};
303
+ ${hoveredCell()};
313
304
  ${hoveredWarningCell};
314
- ${getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props)};
315
- ${resizeHandle(props)};
305
+ ${getBooleanFF('platform.editor.table.drag-and-drop') && insertLine()};
306
+ ${resizeHandle()};
316
307
  ${rangeSelectionStyles};
317
308
 
318
309
  .${ClassName.LAST_ITEM_IN_CELL} {
@@ -326,15 +317,15 @@ export const tableStyles = (
326
317
  }
327
318
 
328
319
  td.${ClassName.TABLE_CELL} {
329
- background-color: ${tableCellBackgroundColor(props)};
320
+ background-color: ${tableCellBackgroundColor};
330
321
 
331
322
  // ED-15246: Trello card is visible through a border of a table border
332
323
  // This fixes a border issue caused by relative positioned table cells
333
324
  &::after {
334
325
  height: 100%;
335
326
  content: '';
336
- border-left: 1px solid ${tableBorderColor(props)};
337
- border-bottom: 1px solid ${tableBorderColor(props)};
327
+ border-left: 1px solid ${tableBorderColor};
328
+ border-bottom: 1px solid ${tableBorderColor};
338
329
  position: absolute;
339
330
  right: 0px;
340
331
  top: 0px;
@@ -347,19 +338,19 @@ export const tableStyles = (
347
338
  }
348
339
 
349
340
  .${ClassName.CONTROLS_FLOATING_BUTTON_COLUMN} {
350
- ${insertColumnButtonWrapper(props)}
341
+ ${insertColumnButtonWrapper()}
351
342
  }
352
343
 
353
344
  .${ClassName.CONTROLS_FLOATING_BUTTON_ROW} {
354
- ${insertRowButtonWrapper(props)}
345
+ ${insertRowButtonWrapper()}
355
346
  }
356
347
 
357
- ${dragInsertButtonWrapper(props)}
348
+ ${dragInsertButtonWrapper()}
358
349
 
359
- ${dragCornerControlButton(props)}
350
+ ${dragCornerControlButton()}
360
351
 
361
352
  /* Delete button */
362
- ${DeleteButton(props)}
353
+ ${DeleteButton()}
363
354
  /* Ends Delete button */
364
355
 
365
356
  /* sticky styles */
@@ -392,9 +383,9 @@ export const tableStyles = (
392
383
  width: ${tableToolbarSize}px;
393
384
  }
394
385
 
395
- ${tableStickyHeaderColumnControlsDecorationsStyle(props)}
386
+ ${tableStickyHeaderColumnControlsDecorationsStyle()}
396
387
 
397
- ${tableStickyHeaderFirefoxFixStyle(props)}
388
+ ${tableStickyHeaderFirefoxFixStyle()}
398
389
 
399
390
  .${ClassName.TABLE_STICKY}
400
391
  .${ClassName.ROW_CONTROLS}
@@ -453,7 +444,7 @@ export const tableStyles = (
453
444
 
454
445
  tr.sticky th {
455
446
  border-bottom: ${stickyHeaderBorderBottomWidth}px solid
456
- ${tableBorderColor(props)};
447
+ ${tableBorderColor};
457
448
  margin-right: -1px;
458
449
  }
459
450
 
@@ -522,7 +513,7 @@ export const tableStyles = (
522
513
  }
523
514
 
524
515
  ${sentinelStyles}
525
- ${OverflowShadow(props)}
516
+ ${OverflowShadow()}
526
517
  ${stickyScrollbarStyles(props.featureFlags)}
527
518
 
528
519
  .${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
@@ -577,8 +568,8 @@ export const tableStyles = (
577
568
  /* Breakout only works on top level unless wrapped in fragment mark */
578
569
  ${breakoutWidthStyling()}
579
570
 
580
- ${columnControlsDecoration(props)};
581
- ${rowControlsWrapperDotStyle(props)};
571
+ ${columnControlsDecoration()};
572
+ ${rowControlsWrapperDotStyle()};
582
573
 
583
574
  /* Corner controls */
584
575
  .${ClassName.CORNER_CONTROLS} {
@@ -590,7 +581,6 @@ export const tableStyles = (
590
581
  position: relative;
591
582
 
592
583
  ${InsertMarker(
593
- props,
594
584
  `
595
585
  left: -11px;
596
586
  top: 9px;
@@ -611,10 +601,10 @@ export const tableStyles = (
611
601
  top: 0;
612
602
  width: ${tableToolbarSize + 1}px;
613
603
  height: ${tableToolbarSize + 1}px;
614
- border: 1px solid ${tableBorderColor(props)};
604
+ border: 1px solid ${tableBorderColor};
615
605
  border-radius: 0;
616
606
  border-top-left-radius: ${tableBorderRadiusSize}px;
617
- background: ${tableHeaderCellBackgroundColor(props)};
607
+ background: ${tableHeaderCellBackgroundColor};
618
608
  box-sizing: border-box;
619
609
  padding: 0;
620
610
  :focus {
@@ -622,8 +612,8 @@ export const tableStyles = (
622
612
  }
623
613
  }
624
614
  .active .${ClassName.CONTROLS_CORNER_BUTTON} {
625
- border-color: ${tableBorderSelectedColor(props)};
626
- background: ${tableToolbarSelectedColor(props)};
615
+ border-color: ${tableBorderSelectedColor};
616
+ background: ${tableToolbarSelectedColor};
627
617
  }
628
618
 
629
619
  .${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
@@ -638,15 +628,15 @@ export const tableStyles = (
638
628
  }
639
629
 
640
630
  :not(.${ClassName.IS_RESIZING}) .${ClassName.CONTROLS_CORNER_BUTTON}:hover {
641
- border-color: ${tableBorderSelectedColor(props)};
642
- background: ${tableToolbarSelectedColor(props)};
631
+ border-color: ${tableBorderSelectedColor};
632
+ background: ${tableToolbarSelectedColor};
643
633
  cursor: pointer;
644
634
  }
645
635
 
646
636
  :not(.${ClassName.IS_RESIZING})
647
637
  .${ClassName.CONTROLS_CORNER_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
648
- border-color: ${tableBorderDeleteColor(props)};
649
- background: ${tableToolbarDeleteColor(props)};
638
+ border-color: ${tableBorderDeleteColor};
639
+ background: ${tableToolbarDeleteColor};
650
640
  }
651
641
 
652
642
  /* Row controls */
@@ -657,7 +647,6 @@ export const tableStyles = (
657
647
  position: relative;
658
648
 
659
649
  ${InsertMarker(
660
- props,
661
650
  `
662
651
  bottom: -1px;
663
652
  left: -11px;
@@ -682,9 +671,8 @@ export const tableStyles = (
682
671
  }
683
672
 
684
673
  ${HeaderButton(
685
- props,
686
674
  `
687
- border-bottom: 1px solid ${tableBorderColor(props)};
675
+ border-bottom: 1px solid ${tableBorderColor};
688
676
  border-right: 0px;
689
677
  border-radius: 0;
690
678
  height: 100%;
@@ -835,11 +823,11 @@ export const tableStyles = (
835
823
  }
836
824
  }
837
825
 
838
- ${floatingColumnControls(props)}
826
+ ${floatingColumnControls()}
839
827
 
840
828
  :not(.${ClassName.IS_RESIZING}) .${ClassName.ROW_CONTROLS} {
841
- ${HeaderButtonHover(props)}
842
- ${HeaderButtonDanger(props)}
829
+ ${HeaderButtonHover()}
830
+ ${HeaderButtonDanger()}
843
831
  }
844
832
 
845
833
  /* Numbered column */
@@ -857,23 +845,23 @@ export const tableStyles = (
857
845
  }
858
846
 
859
847
  .${ClassName.NUMBERED_COLUMN_BUTTON} {
860
- border: 1px solid ${tableBorderColor(props)};
848
+ border: 1px solid ${tableBorderColor};
861
849
  box-sizing: border-box;
862
850
  margin-top: -1px;
863
851
  padding-bottom: 2px;
864
852
  padding: 10px 2px;
865
853
  text-align: center;
866
854
  font-size: ${relativeFontSizeToBase16(fontSize())};
867
- background-color: ${tableHeaderCellBackgroundColor(props)};
868
- color: ${tableTextColor(props)};
869
- border-color: ${tableBorderColor(props)};
855
+ background-color: ${tableHeaderCellBackgroundColor};
856
+ color: ${tableTextColor};
857
+ border-color: ${tableBorderColor};
870
858
 
871
859
  :first-child:not(style),
872
860
  style:first-child + * {
873
861
  margin-top: 0;
874
862
  }
875
863
  :last-child {
876
- border-bottom: 1px solid ${tableBorderColor(props)};
864
+ border-bottom: 1px solid ${tableBorderColor};
877
865
  }
878
866
  }
879
867
 
@@ -908,9 +896,9 @@ export const tableStyles = (
908
896
  }
909
897
 
910
898
  .${ClassName.NUMBERED_COLUMN_BUTTON}.active {
911
- border-bottom: 1px solid ${tableBorderSelectedColor(props)};
912
- border-color: ${tableBorderSelectedColor(props)};
913
- background-color: ${tableToolbarSelectedColor(props)};
899
+ border-bottom: 1px solid ${tableBorderSelectedColor};
900
+ border-color: ${tableBorderSelectedColor};
901
+ background-color: ${tableToolbarSelectedColor};
914
902
  position: relative;
915
903
  z-index: ${akEditorUnitZIndex};
916
904
  color: ${token('color.text.selected', N0)};
@@ -922,16 +910,16 @@ export const tableStyles = (
922
910
  cursor: pointer;
923
911
  }
924
912
  .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}):hover {
925
- border-bottom: 1px solid ${tableBorderSelectedColor(props)};
926
- border-color: ${tableBorderSelectedColor(props)};
927
- background-color: ${tableToolbarSelectedColor(props)};
913
+ border-bottom: 1px solid ${tableBorderSelectedColor};
914
+ border-color: ${tableBorderSelectedColor};
915
+ background-color: ${tableToolbarSelectedColor};
928
916
  position: relative;
929
917
  z-index: ${akEditorUnitZIndex};
930
918
  color: ${token('color.text.selected', N0)};
931
919
  }
932
920
  .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
933
- background-color: ${tableToolbarDeleteColor(props)};
934
- border: 1px solid ${tableBorderDeleteColor(props)};
921
+ background-color: ${tableToolbarDeleteColor};
922
+ border: 1px solid ${tableBorderDeleteColor};
935
923
  border-left: 0;
936
924
  color: ${token('color.text.danger', R500)};
937
925
  position: relative;
@@ -992,15 +980,15 @@ export const tableStyles = (
992
980
  pointer-events: none;
993
981
  }
994
982
  .${ClassName.SELECTED_CELL} {
995
- border: 1px solid ${tableBorderSelectedColor(props)};
983
+ border: 1px solid ${tableBorderSelectedColor};
996
984
  }
997
985
  .${ClassName.SELECTED_CELL}::after {
998
- background: ${tableCellSelectedColor(props)};
986
+ background: ${tableCellSelectedColor};
999
987
  z-index: ${akEditorSmallZIndex};
1000
988
  }
1001
989
  th.${ClassName.HOVERED_CELL_IN_DANGER}::after,
1002
990
  td.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1003
- background: ${tableCellDeleteColor(props)};
991
+ background: ${tableCellDeleteColor};
1004
992
  z-index: ${akEditorUnitZIndex * 100};
1005
993
  }
1006
994
  // ED-15246: Trello card is visible through a border of a table border
@@ -1014,7 +1002,7 @@ export const tableStyles = (
1014
1002
  &::after {
1015
1003
  height: 100%;
1016
1004
  width: 100%;
1017
- border: 1px solid ${tableBorderSelectedColor(props)};
1005
+ border: 1px solid ${tableBorderSelectedColor};
1018
1006
  content: '';
1019
1007
  position: absolute;
1020
1008
  left: -1px;
@@ -1025,12 +1013,12 @@ export const tableStyles = (
1025
1013
  pointer-events: none;
1026
1014
  }
1027
1015
  &.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1028
- ${tableBorderStyles(props)};
1016
+ ${tableBorderStyles()};
1029
1017
  z-index: ${akEditorUnitZIndex * 100};
1030
1018
  }
1031
1019
 
1032
1020
  &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1033
- ${tableBorderStyles(props)};
1021
+ ${tableBorderStyles()};
1034
1022
  z-index: ${akEditorUnitZIndex * 100};
1035
1023
  }
1036
1024
  }
package/src/ui/consts.ts CHANGED
@@ -4,22 +4,17 @@ import {
4
4
  } from '@atlaskit/editor-common/styles';
5
5
  import {
6
6
  akEditorTableBorder,
7
- akEditorTableBorderDark,
8
7
  akEditorTableBorderSelected,
9
8
  akEditorTableCellBlanketDeleted,
10
9
  akEditorTableCellBlanketSelected,
11
10
  akEditorTableHeaderCellBackground,
12
- akEditorTableHeaderCellBackgroundDark,
13
11
  akEditorTableToolbar,
14
- akEditorTableToolbarDark,
15
12
  akEditorTableToolbarSize,
16
13
  akEditorUnitZIndex,
17
14
  akRichMediaResizeZIndex,
18
15
  } from '@atlaskit/editor-shared-styles';
19
16
  import {
20
17
  B200,
21
- DN30,
22
- DN400,
23
18
  N0,
24
19
  N20,
25
20
  N200,
@@ -29,8 +24,6 @@ import {
29
24
  R400,
30
25
  R75,
31
26
  } from '@atlaskit/theme/colors';
32
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
33
- import { themed } from '@atlaskit/theme/components';
34
27
  import { token } from '@atlaskit/tokens';
35
28
 
36
29
  import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
@@ -40,80 +33,66 @@ import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
40
33
  */
41
34
 
42
35
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4135
43
- export const tableCellBackgroundColor = themed({
44
- light: token('elevation.surface', N0),
45
- dark: token('elevation.surface', DN30),
46
- });
36
+ export const tableCellBackgroundColor = token('elevation.surface', N0);
47
37
 
48
- export const tableHeaderCellBackgroundColor = themed({
49
- light: token(
50
- 'color.background.accent.gray.subtlest',
51
- akEditorTableHeaderCellBackground,
52
- ),
53
- dark: token(
54
- 'color.background.accent.gray.subtlest',
55
- akEditorTableHeaderCellBackgroundDark,
56
- ),
57
- });
38
+ export const tableHeaderCellBackgroundColor = token(
39
+ 'color.background.accent.gray.subtlest',
40
+ akEditorTableHeaderCellBackground,
41
+ );
58
42
 
59
- export const tableToolbarColor = themed({
60
- light: token('color.background.neutral.subtle', akEditorTableToolbar),
61
- dark: token('color.background.neutral.subtle', akEditorTableToolbarDark),
62
- });
63
- export const tableTextColor = themed({
64
- light: token('color.text.subtlest', N200),
65
- dark: token('color.text.subtlest', DN400),
66
- });
67
- export const tableBorderColor = themed({
68
- light: token('color.background.accent.gray.subtler', akEditorTableBorder),
69
- dark: token('color.background.accent.gray.subtler', akEditorTableBorderDark),
70
- });
43
+ export const tableToolbarColor = token(
44
+ 'color.background.neutral.subtle',
45
+ akEditorTableToolbar,
46
+ );
47
+ export const tableTextColor = token('color.text.subtlest', N200);
48
+ export const tableBorderColor = token(
49
+ 'color.background.accent.gray.subtler',
50
+ akEditorTableBorder,
51
+ );
71
52
  export const tableFloatingControlsColor = token(
72
53
  'color.background.neutral',
73
54
  N20,
74
55
  );
56
+
75
57
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4461
76
- export const tableCellSelectedColor = themed({
77
- light: token('color.blanket.selected', akEditorTableCellBlanketSelected),
78
- dark: token('color.blanket.selected', akEditorTableCellBlanketSelected),
79
- });
80
- export const tableToolbarSelectedColor = themed({
81
- light: token('color.background.selected.pressed', B200),
82
- dark: token('color.background.selected.pressed', B200),
83
- });
84
- export const tableBorderSelectedColor = themed({
85
- light: token('color.border.focused', akEditorTableBorderSelected),
86
- dark: token('color.border.focused', akEditorTableBorderSelected),
87
- });
88
- export const tableCellSelectedDeleteIconColor = themed({
89
- light: token('color.icon.subtle', N300),
90
- dark: token('color.icon.subtle', N300),
91
- });
92
- export const tableCellSelectedDeleteIconBackground = themed({
93
- light: token('color.background.accent.gray.subtlest', N20A),
94
- dark: token('color.background.accent.gray.subtlest', N20A),
95
- });
96
- export const tableCellDeleteColor = themed({
97
- light: token('color.blanket.danger', akEditorTableCellBlanketDeleted),
98
- dark: token('color.blanket.danger', akEditorTableCellBlanketDeleted),
99
- });
58
+ export const tableCellSelectedColor = token(
59
+ 'color.blanket.selected',
60
+ akEditorTableCellBlanketSelected,
61
+ );
62
+ export const tableToolbarSelectedColor = token(
63
+ 'color.background.selected.pressed',
64
+ B200,
65
+ );
66
+ export const tableBorderSelectedColor = token(
67
+ 'color.border.focused',
68
+ akEditorTableBorderSelected,
69
+ );
70
+ export const tableCellSelectedDeleteIconColor = token(
71
+ 'color.icon.subtle',
72
+ N300,
73
+ );
74
+ export const tableCellSelectedDeleteIconBackground = token(
75
+ 'color.background.accent.gray.subtlest',
76
+ N20A,
77
+ );
78
+ export const tableCellDeleteColor = token(
79
+ 'color.blanket.danger',
80
+ akEditorTableCellBlanketDeleted,
81
+ );
100
82
 
101
- export const tableBorderDeleteColor = themed({
102
- light: token('color.border.danger', R400),
103
- dark: token('color.border.danger', R400),
104
- });
105
- export const tableToolbarDeleteColor = themed({
106
- light: token('color.background.danger.pressed', R75),
107
- dark: token('color.background.danger.pressed', R75),
108
- });
109
- export const tableCellHoverDeleteIconColor = themed({
110
- light: token('color.icon.inverse', 'white'),
111
- dark: token('color.icon.inverse', 'white'),
112
- });
113
- export const tableCellHoverDeleteIconBackground = themed({
114
- light: token('color.background.danger.bold', R300),
115
- dark: token('color.background.danger.bold', R300),
116
- });
83
+ export const tableBorderDeleteColor = token('color.border.danger', R400);
84
+ export const tableToolbarDeleteColor = token(
85
+ 'color.background.danger.pressed',
86
+ R75,
87
+ );
88
+ export const tableCellHoverDeleteIconColor = token(
89
+ 'color.icon.inverse',
90
+ 'white',
91
+ );
92
+ export const tableCellHoverDeleteIconBackground = token(
93
+ 'color.background.danger.bold',
94
+ R300,
95
+ );
117
96
  export const tableBorderRadiusSize = 3;
118
97
  export const tablePadding = 8;
119
98
  export const tableScrollbarOffset = 15;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+
3
+ export const MergeCellsIcon = () => (
4
+ <svg
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ >
11
+ <path
12
+ fillRule="evenodd"
13
+ clipRule="evenodd"
14
+ d="M10 19C10.5523 19 11 18.5523 11 18C11 17.4477 10.5523 17 10 17H6V7L10 7C10.5523 7 11 6.55228 11 6C11 5.44771 10.5523 5 10 5H6C4.89543 5 4 5.89543 4 7V17C4 18.1046 4.89543 19 6 19H10ZM14 5C13.4477 5 13 5.44772 13 6C13 6.55228 13.4477 7 14 7H18V17L14 17C13.4477 17 13 17.4477 13 18C13 18.5523 13.4477 19 14 19H18C19.1046 19 20 18.1046 20 17V7C20 5.89543 19.1046 5 18 5H14Z"
15
+ fill="currentColor"
16
+ />
17
+ <path
18
+ d="M15.75 10L13.75 12L15.75 14"
19
+ stroke="currentColor"
20
+ strokeWidth="1.5"
21
+ strokeLinecap="round"
22
+ strokeLinejoin="round"
23
+ />
24
+ <path
25
+ d="M8.25 14L10.25 12L8.25 10"
26
+ stroke="currentColor"
27
+ strokeWidth="1.5"
28
+ strokeLinecap="round"
29
+ strokeLinejoin="round"
30
+ />
31
+ </svg>
32
+ );
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+
3
+ export const SplitCellIcon = () => (
4
+ <svg
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ >
11
+ <path
12
+ d="M19 18L14 18L14 6L19 6"
13
+ stroke="currentColor"
14
+ strokeWidth="2"
15
+ strokeLinecap="round"
16
+ strokeLinejoin="round"
17
+ />
18
+ <path
19
+ d="M5 6L10 6L9.99999 18L5 18"
20
+ stroke="currentColor"
21
+ strokeWidth="2"
22
+ strokeLinecap="round"
23
+ strokeLinejoin="round"
24
+ />
25
+ <path
26
+ d="M7 10L5 12L7 14"
27
+ stroke="currentColor"
28
+ strokeWidth="1.5"
29
+ strokeLinecap="round"
30
+ strokeLinejoin="round"
31
+ />
32
+ <path
33
+ d="M17 14L19 12L17 10"
34
+ stroke="currentColor"
35
+ strokeWidth="1.5"
36
+ strokeLinecap="round"
37
+ strokeLinejoin="round"
38
+ />
39
+ </svg>
40
+ );
@@ -2,6 +2,8 @@ export { DragHandleIcon } from './DragHandleIcon';
2
2
  export { DragInMotionIcon } from './DragInMotionIcon';
3
3
  export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
4
4
  export { MinimisedHandleIcon } from './MinimisedHandle';
5
+ export { MergeCellsIcon } from './MergeCellsIcon';
6
+ export { SplitCellIcon } from './SplitCellIcon';
5
7
  export { AddRowAboveIcon } from './AddRowAboveIcon';
6
8
  export { AddRowBelowIcon } from './AddRowBelowIcon';
7
9
  export { AddColLeftIcon } from './AddColLeftIcon';