@atlaskit/editor-plugin-table 7.16.11 → 7.16.13

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 (254) hide show
  1. package/.eslintrc.js +3 -3
  2. package/CHANGELOG.md +16 -0
  3. package/dist/cjs/commands/misc.js +3 -3
  4. package/dist/cjs/nodeviews/TableCell.js +10 -10
  5. package/dist/cjs/nodeviews/TableContainer.js +83 -27
  6. package/dist/cjs/nodeviews/TableResizer.js +40 -19
  7. package/dist/cjs/nodeviews/TableRow.js +23 -23
  8. package/dist/cjs/pm-plugins/table-resizing/plugin.js +3 -3
  9. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +4 -4
  10. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +3 -3
  11. package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -1
  12. package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -1
  13. package/dist/cjs/ui/common-styles.js +13 -13
  14. package/dist/cjs/ui/ui-styles.js +25 -25
  15. package/dist/cjs/utils/guidelines.js +7 -4
  16. package/dist/cjs/utils/merged-cells.js +3 -3
  17. package/dist/cjs/utils/snapping.js +7 -8
  18. package/dist/es2019/commands/misc.js +3 -3
  19. package/dist/es2019/nodeviews/TableContainer.js +70 -9
  20. package/dist/es2019/nodeviews/TableResizer.js +42 -21
  21. package/dist/es2019/nodeviews/TableRow.js +21 -21
  22. package/dist/es2019/pm-plugins/table-resizing/plugin.js +3 -3
  23. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +4 -4
  24. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +3 -3
  25. package/dist/es2019/ui/FloatingContextualMenu/styles.js +47 -47
  26. package/dist/es2019/ui/FloatingDragMenu/styles.js +30 -30
  27. package/dist/es2019/ui/common-styles.js +802 -816
  28. package/dist/es2019/ui/ui-styles.js +665 -678
  29. package/dist/es2019/utils/guidelines.js +5 -2
  30. package/dist/es2019/utils/merged-cells.js +3 -3
  31. package/dist/es2019/utils/snapping.js +5 -6
  32. package/dist/esm/commands/misc.js +3 -3
  33. package/dist/esm/nodeviews/TableCell.js +10 -10
  34. package/dist/esm/nodeviews/TableContainer.js +85 -29
  35. package/dist/esm/nodeviews/TableResizer.js +42 -21
  36. package/dist/esm/nodeviews/TableRow.js +23 -23
  37. package/dist/esm/pm-plugins/table-resizing/plugin.js +3 -3
  38. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +4 -4
  39. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +3 -3
  40. package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -1
  41. package/dist/esm/ui/FloatingDragMenu/styles.js +1 -1
  42. package/dist/esm/ui/common-styles.js +13 -13
  43. package/dist/esm/ui/ui-styles.js +25 -25
  44. package/dist/esm/utils/guidelines.js +6 -3
  45. package/dist/esm/utils/merged-cells.js +3 -3
  46. package/dist/esm/utils/snapping.js +6 -7
  47. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  48. package/dist/types/pm-plugins/decorations/utils/index.d.ts +1 -1
  49. package/dist/types/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
  50. package/dist/types/pm-plugins/drag-and-drop/utils/getDragBehaviour.d.ts +1 -1
  51. package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  52. package/dist/types/ui/ColumnResizeWidget/index.d.ts +1 -1
  53. package/dist/types/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +1 -1
  54. package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
  55. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +1 -1
  56. package/dist/types/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
  57. package/dist/types/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
  58. package/dist/types/utils/guidelines.d.ts +2 -1
  59. package/dist/types/utils/snapping.d.ts +3 -2
  60. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  61. package/dist/types-ts4.5/pm-plugins/decorations/utils/index.d.ts +1 -1
  62. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
  63. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/getDragBehaviour.d.ts +1 -1
  64. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  65. package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +1 -1
  66. package/dist/types-ts4.5/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +1 -1
  67. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
  68. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +1 -1
  69. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
  70. package/dist/types-ts4.5/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
  71. package/dist/types-ts4.5/utils/guidelines.d.ts +2 -1
  72. package/dist/types-ts4.5/utils/snapping.d.ts +3 -2
  73. package/docs/0-intro.tsx +9 -7
  74. package/package.json +3 -3
  75. package/report.api.md +67 -66
  76. package/src/commands/clear.ts +36 -44
  77. package/src/commands/collapse.ts +8 -8
  78. package/src/commands/column-resize.ts +412 -452
  79. package/src/commands/delete.ts +14 -14
  80. package/src/commands/display-mode.ts +10 -11
  81. package/src/commands/go-to-next-cell.ts +48 -54
  82. package/src/commands/hover.ts +210 -227
  83. package/src/commands/index.ts +35 -35
  84. package/src/commands/insert.ts +208 -235
  85. package/src/commands/misc.ts +655 -748
  86. package/src/commands/referentiality.ts +9 -9
  87. package/src/commands/selection.ts +433 -563
  88. package/src/commands/sort.ts +68 -86
  89. package/src/commands/split-cell.ts +14 -14
  90. package/src/commands/toggle.ts +69 -67
  91. package/src/commands-with-analytics.ts +570 -639
  92. package/src/create-plugin-config.ts +13 -13
  93. package/src/event-handlers.ts +513 -612
  94. package/src/handlers.ts +120 -133
  95. package/src/nodeviews/ExternalDropTargets.tsx +68 -73
  96. package/src/nodeviews/OverflowShadowsObserver.ts +148 -157
  97. package/src/nodeviews/TableCell.ts +47 -54
  98. package/src/nodeviews/TableComponent.tsx +1018 -1112
  99. package/src/nodeviews/TableComponentWithSharedState.tsx +91 -94
  100. package/src/nodeviews/TableContainer.tsx +384 -340
  101. package/src/nodeviews/TableNodeViewBase.ts +19 -24
  102. package/src/nodeviews/TableResizer.tsx +642 -653
  103. package/src/nodeviews/TableRow.ts +580 -629
  104. package/src/nodeviews/TableStickyScrollbar.ts +173 -190
  105. package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +8 -8
  106. package/src/nodeviews/__mocks__/OverridableMock.ts +14 -15
  107. package/src/nodeviews/table.tsx +345 -375
  108. package/src/nodeviews/types.ts +21 -24
  109. package/src/nodeviews/update-overflow-shadows.ts +8 -14
  110. package/src/plugin.tsx +578 -603
  111. package/src/pm-plugins/analytics/actions.ts +10 -12
  112. package/src/pm-plugins/analytics/commands.ts +31 -37
  113. package/src/pm-plugins/analytics/plugin-factory.ts +4 -2
  114. package/src/pm-plugins/analytics/plugin-key.ts +1 -3
  115. package/src/pm-plugins/analytics/plugin.ts +60 -70
  116. package/src/pm-plugins/analytics/reducer.ts +19 -19
  117. package/src/pm-plugins/analytics/types.ts +10 -10
  118. package/src/pm-plugins/analytics/utils/moved-event.ts +38 -38
  119. package/src/pm-plugins/decorations/plugin.ts +58 -77
  120. package/src/pm-plugins/decorations/utils/column-controls.ts +59 -71
  121. package/src/pm-plugins/decorations/utils/column-resizing.ts +50 -57
  122. package/src/pm-plugins/decorations/utils/compose-decorations.ts +6 -6
  123. package/src/pm-plugins/decorations/utils/index.ts +3 -6
  124. package/src/pm-plugins/decorations/utils/types.ts +7 -12
  125. package/src/pm-plugins/default-table-selection.ts +3 -3
  126. package/src/pm-plugins/drag-and-drop/actions.ts +25 -25
  127. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +158 -190
  128. package/src/pm-plugins/drag-and-drop/commands.ts +154 -170
  129. package/src/pm-plugins/drag-and-drop/consts.ts +4 -5
  130. package/src/pm-plugins/drag-and-drop/plugin-factory.ts +23 -20
  131. package/src/pm-plugins/drag-and-drop/plugin-key.ts +1 -3
  132. package/src/pm-plugins/drag-and-drop/plugin.ts +329 -383
  133. package/src/pm-plugins/drag-and-drop/reducer.ts +30 -30
  134. package/src/pm-plugins/drag-and-drop/types.ts +8 -8
  135. package/src/pm-plugins/drag-and-drop/utils/autoscrollers.ts +38 -41
  136. package/src/pm-plugins/drag-and-drop/utils/getDragBehaviour.ts +3 -6
  137. package/src/pm-plugins/drag-and-drop/utils/monitor.ts +57 -70
  138. package/src/pm-plugins/keymap.ts +208 -220
  139. package/src/pm-plugins/main.ts +348 -400
  140. package/src/pm-plugins/plugin-factory.ts +32 -34
  141. package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +83 -97
  142. package/src/pm-plugins/sticky-headers/commands.ts +2 -6
  143. package/src/pm-plugins/sticky-headers/plugin-key.ts +1 -3
  144. package/src/pm-plugins/sticky-headers/plugin-state.ts +41 -44
  145. package/src/pm-plugins/sticky-headers/plugin.ts +4 -4
  146. package/src/pm-plugins/sticky-headers/types.ts +8 -8
  147. package/src/pm-plugins/sticky-headers/util.ts +10 -10
  148. package/src/pm-plugins/table-analytics.ts +70 -72
  149. package/src/pm-plugins/table-local-id.ts +180 -184
  150. package/src/pm-plugins/table-resizing/commands.ts +72 -85
  151. package/src/pm-plugins/table-resizing/event-handlers.ts +298 -317
  152. package/src/pm-plugins/table-resizing/plugin-factory.ts +10 -10
  153. package/src/pm-plugins/table-resizing/plugin-key.ts +1 -3
  154. package/src/pm-plugins/table-resizing/plugin.ts +61 -68
  155. package/src/pm-plugins/table-resizing/reducer.ts +30 -33
  156. package/src/pm-plugins/table-resizing/utils/colgroup.ts +84 -84
  157. package/src/pm-plugins/table-resizing/utils/column-state.ts +78 -81
  158. package/src/pm-plugins/table-resizing/utils/content-width.ts +94 -114
  159. package/src/pm-plugins/table-resizing/utils/dom.ts +93 -110
  160. package/src/pm-plugins/table-resizing/utils/index.ts +29 -34
  161. package/src/pm-plugins/table-resizing/utils/misc.ts +94 -119
  162. package/src/pm-plugins/table-resizing/utils/resize-column.ts +93 -106
  163. package/src/pm-plugins/table-resizing/utils/resize-logic.ts +240 -257
  164. package/src/pm-plugins/table-resizing/utils/resize-state.ts +343 -372
  165. package/src/pm-plugins/table-resizing/utils/scale-table.ts +202 -207
  166. package/src/pm-plugins/table-resizing/utils/types.ts +17 -17
  167. package/src/pm-plugins/table-resizing/utils/unit-to-number.ts +1 -2
  168. package/src/pm-plugins/table-selection-keymap.ts +25 -51
  169. package/src/pm-plugins/table-width.ts +191 -204
  170. package/src/pm-plugins/view-mode-sort/index.ts +223 -227
  171. package/src/pm-plugins/view-mode-sort/plugin-key.ts +3 -2
  172. package/src/pm-plugins/view-mode-sort/types.ts +12 -12
  173. package/src/pm-plugins/view-mode-sort/utils.ts +108 -117
  174. package/src/reducer.ts +139 -155
  175. package/src/toolbar.tsx +815 -905
  176. package/src/transforms/column-width.ts +186 -213
  177. package/src/transforms/delete-columns.ts +208 -222
  178. package/src/transforms/delete-rows.ts +117 -121
  179. package/src/transforms/fix-tables.ts +190 -215
  180. package/src/transforms/merge.ts +263 -269
  181. package/src/transforms/replace-table.ts +27 -43
  182. package/src/transforms/split.ts +65 -75
  183. package/src/types.ts +421 -427
  184. package/src/ui/ColumnResizeWidget/index.tsx +40 -47
  185. package/src/ui/DragHandle/HandleIconComponent.tsx +9 -13
  186. package/src/ui/DragHandle/index.tsx +221 -250
  187. package/src/ui/DragPreview/index.tsx +35 -35
  188. package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +33 -41
  189. package/src/ui/FloatingContextualButton/FixedButton.tsx +154 -157
  190. package/src/ui/FloatingContextualButton/index.tsx +109 -115
  191. package/src/ui/FloatingContextualButton/styles.ts +43 -46
  192. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +634 -694
  193. package/src/ui/FloatingContextualMenu/index.tsx +83 -101
  194. package/src/ui/FloatingContextualMenu/styles.ts +57 -65
  195. package/src/ui/FloatingDeleteButton/DeleteButton.tsx +37 -37
  196. package/src/ui/FloatingDeleteButton/getPopUpOptions.ts +47 -57
  197. package/src/ui/FloatingDeleteButton/index.tsx +319 -350
  198. package/src/ui/FloatingDragMenu/DragMenu.tsx +555 -596
  199. package/src/ui/FloatingDragMenu/DropdownMenu.tsx +152 -162
  200. package/src/ui/FloatingDragMenu/index.tsx +88 -102
  201. package/src/ui/FloatingDragMenu/styles.ts +51 -54
  202. package/src/ui/FloatingInsertButton/InsertButton.tsx +204 -217
  203. package/src/ui/FloatingInsertButton/getPopupOptions.ts +100 -115
  204. package/src/ui/FloatingInsertButton/index.tsx +248 -292
  205. package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +24 -29
  206. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +308 -329
  207. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +85 -94
  208. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +46 -46
  209. package/src/ui/TableFloatingColumnControls/index.tsx +116 -136
  210. package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +79 -91
  211. package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +95 -102
  212. package/src/ui/TableFloatingControls/CornerControls/index.tsx +1 -4
  213. package/src/ui/TableFloatingControls/CornerControls/types.ts +8 -8
  214. package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +50 -50
  215. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +111 -124
  216. package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +86 -105
  217. package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +305 -341
  218. package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +72 -75
  219. package/src/ui/TableFloatingControls/index.tsx +191 -193
  220. package/src/ui/TableFullWidthLabel/index.tsx +20 -20
  221. package/src/ui/common-styles.ts +880 -912
  222. package/src/ui/consts.ts +29 -74
  223. package/src/ui/icons/AddColLeftIcon.tsx +33 -39
  224. package/src/ui/icons/AddColRightIcon.tsx +33 -39
  225. package/src/ui/icons/AddRowAboveIcon.tsx +16 -22
  226. package/src/ui/icons/AddRowBelowIcon.tsx +33 -39
  227. package/src/ui/icons/DisplayModeIcon.tsx +31 -31
  228. package/src/ui/icons/DragHandleDisabledIcon.tsx +19 -21
  229. package/src/ui/icons/DragHandleIcon.tsx +12 -12
  230. package/src/ui/icons/DragInMotionIcon.tsx +45 -52
  231. package/src/ui/icons/MergeCellsIcon.tsx +22 -28
  232. package/src/ui/icons/MinimisedHandle.tsx +9 -9
  233. package/src/ui/icons/SplitCellIcon.tsx +30 -36
  234. package/src/ui/ui-styles.ts +769 -798
  235. package/src/utils/alignment.ts +1 -1
  236. package/src/utils/analytics.ts +192 -208
  237. package/src/utils/collapse.ts +55 -64
  238. package/src/utils/column-controls.ts +237 -254
  239. package/src/utils/create.ts +30 -30
  240. package/src/utils/decoration.ts +482 -502
  241. package/src/utils/dom.ts +127 -134
  242. package/src/utils/drag-menu.ts +322 -373
  243. package/src/utils/get-allow-add-column-custom-step.ts +4 -5
  244. package/src/utils/guidelines.ts +16 -21
  245. package/src/utils/index.ts +68 -68
  246. package/src/utils/merged-cells.ts +245 -254
  247. package/src/utils/nodes.ts +91 -106
  248. package/src/utils/paste.ts +119 -135
  249. package/src/utils/row-controls.ts +199 -213
  250. package/src/utils/selection.ts +77 -87
  251. package/src/utils/snapping.ts +87 -100
  252. package/src/utils/table.ts +44 -44
  253. package/src/utils/transforms.ts +5 -5
  254. package/src/utils/update-plugin-state-decorations.ts +5 -9
@@ -2,15 +2,15 @@
2
2
  import { css } from '@emotion/react';
3
3
 
4
4
  import {
5
- tableCellBorderWidth,
6
- tableMarginTop,
7
- tableMarginTopWithControl,
5
+ tableCellBorderWidth,
6
+ tableMarginTop,
7
+ tableMarginTopWithControl,
8
8
  } from '@atlaskit/editor-common/styles';
9
9
  import {
10
- akEditorShadowZIndex,
11
- akEditorTableBorder,
12
- akEditorTableNumberColumnWidth,
13
- akEditorUnitZIndex,
10
+ akEditorShadowZIndex,
11
+ akEditorTableBorder,
12
+ akEditorTableNumberColumnWidth,
13
+ akEditorUnitZIndex,
14
14
  } from '@atlaskit/editor-shared-styles';
15
15
  import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
16
16
  import { token } from '@atlaskit/tokens';
@@ -18,502 +18,482 @@ import { token } from '@atlaskit/tokens';
18
18
  import { TableCssClassName as ClassName } from '../types';
19
19
 
20
20
  import {
21
- columnControlsDecorationHeight,
22
- columnControlsSelectedZIndex,
23
- columnControlsZIndex,
24
- dragTableInsertColumnButtonSize,
25
- insertLineWidth,
26
- lineMarkerSize,
27
- resizeHandlerAreaWidth,
28
- resizeHandlerZIndex,
29
- resizeLineWidth,
30
- tableBorderColor,
31
- tableBorderDeleteColor,
32
- tableBorderSelectedColor,
33
- tableCellDeleteColor,
34
- tableCellHoverDeleteIconBackground,
35
- tableCellHoverDeleteIconColor,
36
- tableCellSelectedDeleteIconBackground,
37
- tableCellSelectedDeleteIconColor,
38
- tableDeleteButtonSize,
39
- tableHeaderCellBackgroundColor,
40
- tableInsertColumnButtonSize,
41
- tableOverflowShadowWidthWide,
42
- tableToolbarDeleteColor,
43
- tableToolbarSelectedColor,
44
- tableToolbarSize,
21
+ columnControlsDecorationHeight,
22
+ columnControlsSelectedZIndex,
23
+ columnControlsZIndex,
24
+ dragTableInsertColumnButtonSize,
25
+ insertLineWidth,
26
+ lineMarkerSize,
27
+ resizeHandlerAreaWidth,
28
+ resizeHandlerZIndex,
29
+ resizeLineWidth,
30
+ tableBorderColor,
31
+ tableBorderDeleteColor,
32
+ tableBorderSelectedColor,
33
+ tableCellDeleteColor,
34
+ tableCellHoverDeleteIconBackground,
35
+ tableCellHoverDeleteIconColor,
36
+ tableCellSelectedDeleteIconBackground,
37
+ tableCellSelectedDeleteIconColor,
38
+ tableDeleteButtonSize,
39
+ tableHeaderCellBackgroundColor,
40
+ tableInsertColumnButtonSize,
41
+ tableOverflowShadowWidthWide,
42
+ tableToolbarDeleteColor,
43
+ tableToolbarSelectedColor,
44
+ tableToolbarSize,
45
45
  } from './consts';
46
46
 
47
47
  const InsertLine = (cssString?: string) => css`
48
- .${ClassName.CONTROLS_INSERT_LINE} {
49
- background: ${tableBorderSelectedColor};
50
- display: none;
51
- position: absolute;
52
- z-index: ${akEditorUnitZIndex};
53
- ${cssString}
54
- }
48
+ .${ClassName.CONTROLS_INSERT_LINE} {
49
+ background: ${tableBorderSelectedColor};
50
+ display: none;
51
+ position: absolute;
52
+ z-index: ${akEditorUnitZIndex};
53
+ ${cssString}
54
+ }
55
55
  `;
56
56
 
57
57
  const Marker = () =>
58
- css({
59
- backgroundColor: tableBorderColor,
60
- position: 'absolute',
61
- height: `${lineMarkerSize}px`,
62
- width: `${lineMarkerSize}px`,
63
- borderRadius: '50%',
64
- pointerEvents: 'none',
65
- });
58
+ css({
59
+ backgroundColor: tableBorderColor,
60
+ position: 'absolute',
61
+ height: `${lineMarkerSize}px`,
62
+ width: `${lineMarkerSize}px`,
63
+ borderRadius: '50%',
64
+ pointerEvents: 'none',
65
+ });
66
66
 
67
67
  export const InsertMarker = (cssString?: string) => css`
68
- .${ClassName.CONTROLS_INSERT_MARKER} {
69
- ${Marker()};
70
- ${cssString}
71
- }
68
+ .${ClassName.CONTROLS_INSERT_MARKER} {
69
+ ${Marker()};
70
+ ${cssString}
71
+ }
72
72
  `;
73
73
 
74
74
  const Button = (cssString?: string) => css`
75
- border-radius: ${token('border.radius', '3px')};
76
- border-width: 0px;
77
- display: inline-flex;
78
- max-width: 100%;
79
- text-align: center;
80
- margin: 0px;
81
- padding: 0px;
82
- text-decoration: none;
83
- transition: background 0.1s ease-out 0s,
84
- box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;
85
- outline: none !important;
86
- cursor: none;
87
-
88
- > .${ClassName.CONTROLS_BUTTON_ICON} {
89
- display: inline-flex;
90
- max-height: 100%;
91
- max-width: 100%;
92
- }
93
- ${cssString}
75
+ border-radius: ${token('border.radius', '3px')};
76
+ border-width: 0px;
77
+ display: inline-flex;
78
+ max-width: 100%;
79
+ text-align: center;
80
+ margin: 0px;
81
+ padding: 0px;
82
+ text-decoration: none;
83
+ transition:
84
+ background 0.1s ease-out 0s,
85
+ box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;
86
+ outline: none !important;
87
+ cursor: none;
88
+
89
+ > .${ClassName.CONTROLS_BUTTON_ICON} {
90
+ display: inline-flex;
91
+ max-height: 100%;
92
+ max-width: 100%;
93
+ }
94
+ ${cssString}
94
95
  `;
95
96
 
96
97
  // Explicit pixel values required here to ensure classic row controls align correctly
97
98
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
98
99
  export const HeaderButton = (cssString?: string) => css`
99
- .${ClassName.CONTROLS_BUTTON} {
100
- background: ${tableHeaderCellBackgroundColor};
101
- border: 1px solid ${tableBorderColor};
102
- display: block;
103
- box-sizing: border-box;
104
- padding: 0;
105
-
106
- :focus {
107
- outline: none;
108
- }
109
- ${cssString}
110
- }
111
-
112
- .${ClassName.ROW_CONTROLS_BUTTON}::after {
113
- content: ' ';
114
- background-color: transparent;
115
- left: -15px;
116
- top: 0;
117
- position: absolute;
118
- width: 15px;
119
- height: 100%;
120
- z-index: 1;
121
- }
122
-
123
- .active .${ClassName.CONTROLS_BUTTON} {
124
- color: ${token('color.icon.inverse', N0)};
125
- background-color: ${tableToolbarSelectedColor};
126
- border-color: ${tableBorderSelectedColor};
127
- }
100
+ .${ClassName.CONTROLS_BUTTON} {
101
+ background: ${tableHeaderCellBackgroundColor};
102
+ border: 1px solid ${tableBorderColor};
103
+ display: block;
104
+ box-sizing: border-box;
105
+ padding: 0;
106
+
107
+ :focus {
108
+ outline: none;
109
+ }
110
+ ${cssString}
111
+ }
112
+
113
+ .${ClassName.ROW_CONTROLS_BUTTON}::after {
114
+ content: ' ';
115
+ background-color: transparent;
116
+ left: -15px;
117
+ top: 0;
118
+ position: absolute;
119
+ width: 15px;
120
+ height: 100%;
121
+ z-index: 1;
122
+ }
123
+
124
+ .active .${ClassName.CONTROLS_BUTTON} {
125
+ color: ${token('color.icon.inverse', N0)};
126
+ background-color: ${tableToolbarSelectedColor};
127
+ border-color: ${tableBorderSelectedColor};
128
+ }
128
129
  `;
129
130
 
130
131
  export const HeaderButtonHover = () => css`
131
- .${ClassName.CONTROLS_BUTTON}:hover {
132
- color: ${token('color.icon.inverse', N0)};
133
- background-color: ${tableToolbarSelectedColor};
134
- border-color: ${tableBorderSelectedColor};
135
- cursor: pointer;
136
- }
132
+ .${ClassName.CONTROLS_BUTTON}:hover {
133
+ color: ${token('color.icon.inverse', N0)};
134
+ background-color: ${tableToolbarSelectedColor};
135
+ border-color: ${tableBorderSelectedColor};
136
+ cursor: pointer;
137
+ }
137
138
  `;
138
139
 
139
140
  export const HeaderButtonDanger = () => css`
140
- .${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.CONTROLS_BUTTON} {
141
- background-color: ${tableToolbarDeleteColor};
142
- border-color: ${tableBorderDeleteColor};
143
- position: relative;
144
- z-index: ${akEditorUnitZIndex};
145
- }
141
+ .${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.CONTROLS_BUTTON} {
142
+ background-color: ${tableToolbarDeleteColor};
143
+ border-color: ${tableBorderDeleteColor};
144
+ position: relative;
145
+ z-index: ${akEditorUnitZIndex};
146
+ }
146
147
  `;
147
148
 
148
149
  const InsertButton = () => css`
149
- .${ClassName.CONTROLS_INSERT_BUTTON_INNER} {
150
- position: absolute;
151
- z-index: ${akEditorUnitZIndex + 10};
152
- bottom: 0;
153
- }
154
- .${ClassName.CONTROLS_INSERT_BUTTON_INNER},
155
- .${ClassName.CONTROLS_INSERT_BUTTON} {
156
- height: ${tableInsertColumnButtonSize}px;
157
- width: ${tableInsertColumnButtonSize}px;
158
- }
159
- .${ClassName.CONTROLS_INSERT_BUTTON} {
160
- ${Button(`
150
+ .${ClassName.CONTROLS_INSERT_BUTTON_INNER} {
151
+ position: absolute;
152
+ z-index: ${akEditorUnitZIndex + 10};
153
+ bottom: 0;
154
+ }
155
+ .${ClassName.CONTROLS_INSERT_BUTTON_INNER}, .${ClassName.CONTROLS_INSERT_BUTTON} {
156
+ height: ${tableInsertColumnButtonSize}px;
157
+ width: ${tableInsertColumnButtonSize}px;
158
+ }
159
+ .${ClassName.CONTROLS_INSERT_BUTTON} {
160
+ ${Button(`
161
161
  background: ${token('elevation.surface.overlay', 'white')};
162
- box-shadow: ${token(
163
- 'elevation.shadow.overlay',
164
- `0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`,
165
- )};
162
+ box-shadow: ${token('elevation.shadow.overlay', `0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`)};
166
163
  color: ${token('color.icon', N300)};
167
164
  `)}
168
- }
169
- .${ClassName.CONTROLS_INSERT_LINE} {
170
- display: none;
171
- }
172
- &:hover .${ClassName.CONTROLS_INSERT_LINE} {
173
- display: flex;
174
- }
165
+ }
166
+ .${ClassName.CONTROLS_INSERT_LINE} {
167
+ display: none;
168
+ }
169
+ &:hover .${ClassName.CONTROLS_INSERT_LINE} {
170
+ display: flex;
171
+ }
175
172
  `;
176
173
 
177
174
  const InsertButtonHover = () => css`
178
- .${ClassName.CONTROLS_INSERT_BUTTON}:hover {
179
- background: ${token('color.background.brand.bold', B300)};
180
- color: ${token('color.icon.inverse', 'white')};
181
- cursor: pointer;
182
- }
175
+ .${ClassName.CONTROLS_INSERT_BUTTON}:hover {
176
+ background: ${token('color.background.brand.bold', B300)};
177
+ color: ${token('color.icon.inverse', 'white')};
178
+ cursor: pointer;
179
+ }
183
180
  `;
184
181
 
185
182
  export const dragInsertButtonWrapper = () => css`
186
- .${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER} {
187
- position: absolute;
188
- z-index: ${akEditorUnitZIndex + 10};
189
- }
190
-
191
- .${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN} {
192
- bottom: -3px;
193
- left: 2px;
194
- }
195
-
196
- .${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW} {
197
- left: -3px;
198
- bottom: -2px;
199
- }
200
-
201
- .${ClassName.DRAG_CONTROLS_INSERT_BUTTON} {
202
- ${Button(`
183
+ .${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER} {
184
+ position: absolute;
185
+ z-index: ${akEditorUnitZIndex + 10};
186
+ }
187
+
188
+ .${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_COLUMN} {
189
+ bottom: -3px;
190
+ left: 2px;
191
+ }
192
+
193
+ .${ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER_ROW} {
194
+ left: -3px;
195
+ bottom: -2px;
196
+ }
197
+
198
+ .${ClassName.DRAG_CONTROLS_INSERT_BUTTON} {
199
+ ${Button(`
203
200
  background: ${token('elevation.surface.overlay', 'white')};
204
201
  color: ${token('color.icon', N300)};
205
- border: 1px solid ${token(
206
- 'color.background.accent.gray.subtler',
207
- '#C1C7D0',
208
- )};
202
+ border: 1px solid ${token('color.background.accent.gray.subtler', '#C1C7D0')};
209
203
  border-radius: 50%;
210
204
  height: ${dragTableInsertColumnButtonSize}px;
211
205
  width: ${dragTableInsertColumnButtonSize}px;
212
206
  `)}
213
- }
214
-
215
- .${ClassName.DRAG_CONTROLS_INSERT_BUTTON}:hover {
216
- background: ${token('color.background.brand.bold', B300)};
217
- border: 1px solid ${token('color.background.brand.bold', B300)};
218
- color: ${token('color.icon.inverse', 'white')};
219
- cursor: pointer;
220
- }
207
+ }
208
+
209
+ .${ClassName.DRAG_CONTROLS_INSERT_BUTTON}:hover {
210
+ background: ${token('color.background.brand.bold', B300)};
211
+ border: 1px solid ${token('color.background.brand.bold', B300)};
212
+ color: ${token('color.icon.inverse', 'white')};
213
+ cursor: pointer;
214
+ }
221
215
  `;
222
216
 
223
217
  // Explicit pixel values required here to ensure corner button aligns correctly
224
218
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
225
219
  export const dragCornerControlButton = () => css`
226
- .${ClassName.DRAG_CORNER_BUTTON} {
227
- width: 15px;
228
- height: 15px;
229
- display: flex;
230
- justify-content: center;
231
- align-items: center;
232
- position: absolute;
233
- top: -17px;
234
- left: -5px;
235
- background-color: transparent;
236
- border: none;
237
- padding: 0;
238
- outline: none;
239
- z-index: ${akEditorUnitZIndex * 99};
240
-
241
- &.active .${ClassName.DRAG_CORNER_BUTTON_INNER} {
242
- background-color: ${token('color.border.selected', '#0C66E4')};
243
- width: 10px;
244
- height: 10px;
245
- border-width: 2px;
246
- border-radius: 4px;
247
-
248
- top: 3px;
249
- left: 2px;
250
- }
251
-
252
- &:hover {
253
- cursor: pointer;
254
-
255
- .${ClassName.DRAG_CORNER_BUTTON_INNER} {
256
- width: 10px;
257
- height: 10px;
258
- border-radius: 4px;
259
- top: 3px;
260
- left: 2px;
261
- }
262
- }
263
- }
264
-
265
- .${ClassName.DRAG_CORNER_BUTTON_INNER} {
266
- border: 1px solid ${token('color.border.inverse', '#FFF')};
267
- background-color: ${token(
268
- 'color.background.accent.gray.subtler',
269
- '#DCDFE4',
270
- )};
271
- border-radius: 2px;
272
- width: 5px;
273
- height: 5px;
274
- position: relative;
275
- }
220
+ .${ClassName.DRAG_CORNER_BUTTON} {
221
+ width: 15px;
222
+ height: 15px;
223
+ display: flex;
224
+ justify-content: center;
225
+ align-items: center;
226
+ position: absolute;
227
+ top: -17px;
228
+ left: -5px;
229
+ background-color: transparent;
230
+ border: none;
231
+ padding: 0;
232
+ outline: none;
233
+ z-index: ${akEditorUnitZIndex * 99};
234
+
235
+ &.active .${ClassName.DRAG_CORNER_BUTTON_INNER} {
236
+ background-color: ${token('color.border.selected', '#0C66E4')};
237
+ width: 10px;
238
+ height: 10px;
239
+ border-width: 2px;
240
+ border-radius: 4px;
241
+
242
+ top: 3px;
243
+ left: 2px;
244
+ }
245
+
246
+ &:hover {
247
+ cursor: pointer;
248
+
249
+ .${ClassName.DRAG_CORNER_BUTTON_INNER} {
250
+ width: 10px;
251
+ height: 10px;
252
+ border-radius: 4px;
253
+ top: 3px;
254
+ left: 2px;
255
+ }
256
+ }
257
+ }
258
+
259
+ .${ClassName.DRAG_CORNER_BUTTON_INNER} {
260
+ border: 1px solid ${token('color.border.inverse', '#FFF')};
261
+ background-color: ${token('color.background.accent.gray.subtler', '#DCDFE4')};
262
+ border-radius: 2px;
263
+ width: 5px;
264
+ height: 5px;
265
+ position: relative;
266
+ }
276
267
  `;
277
268
 
278
269
  export const insertColumnButtonWrapper = () =>
279
- css(
280
- InsertButton(),
281
- InsertButtonHover(),
282
- InsertLine(
283
- `
270
+ css(
271
+ InsertButton(),
272
+ InsertButtonHover(),
273
+ InsertLine(
274
+ `
284
275
  width: 2px;
285
276
  left: 9px;
286
277
  `,
287
- ),
288
- );
278
+ ),
279
+ );
289
280
 
290
281
  export const insertRowButtonWrapper = () =>
291
- css(
292
- InsertButton(),
293
- InsertButtonHover(),
294
- InsertLine(
295
- `
282
+ css(
283
+ InsertButton(),
284
+ InsertButtonHover(),
285
+ InsertLine(
286
+ `
296
287
  height: 2px;
297
288
  top: -11px;
298
289
  left: ${tableInsertColumnButtonSize - 1}px;
299
290
  `,
300
- ),
301
- );
291
+ ),
292
+ );
302
293
 
303
294
  export const columnControlsLineMarker = () => css`
304
- .${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS}
305
- table
306
- tr:first-of-type
307
- td,
308
- .${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS}
309
- table
310
- tr:first-of-type
311
- th {
312
- position: relative;
313
- }
295
+ .${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS} table tr:first-of-type td,
296
+ .${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS} table tr:first-of-type th {
297
+ position: relative;
298
+ }
314
299
  `;
315
300
 
316
301
  export const DeleteButton = () => css`
317
- .${ClassName.CONTROLS_DELETE_BUTTON_WRAP},
318
- .${ClassName.CONTROLS_DELETE_BUTTON} {
319
- height: ${tableDeleteButtonSize}px;
320
- width: ${tableDeleteButtonSize}px;
321
- }
322
- .${ClassName.CONTROLS_DELETE_BUTTON_WRAP} {
323
- .${ClassName.CONTROLS_DELETE_BUTTON} {
324
- ${Button(`
302
+ .${ClassName.CONTROLS_DELETE_BUTTON_WRAP}, .${ClassName.CONTROLS_DELETE_BUTTON} {
303
+ height: ${tableDeleteButtonSize}px;
304
+ width: ${tableDeleteButtonSize}px;
305
+ }
306
+ .${ClassName.CONTROLS_DELETE_BUTTON_WRAP} {
307
+ .${ClassName.CONTROLS_DELETE_BUTTON} {
308
+ ${Button(`
325
309
  background: ${tableCellSelectedDeleteIconBackground};
326
310
  color: ${tableCellSelectedDeleteIconColor};
327
311
  `)}
328
- }
329
- }
330
-
331
- .${ClassName.CONTROLS_DELETE_BUTTON}:hover {
332
- background: ${tableCellHoverDeleteIconBackground};
333
- color: ${tableCellHoverDeleteIconColor};
334
- cursor: pointer;
335
- }
312
+ }
313
+ }
314
+
315
+ .${ClassName.CONTROLS_DELETE_BUTTON}:hover {
316
+ background: ${tableCellHoverDeleteIconBackground};
317
+ color: ${tableCellHoverDeleteIconColor};
318
+ cursor: pointer;
319
+ }
336
320
  `;
337
321
 
338
- export const OverflowShadow = (
339
- isDragAndDropEnabled: boolean | undefined,
340
- ) => css`
341
- .${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
342
- display: block;
343
- height: calc(100% - ${tableMarginTop}px);
344
- position: absolute;
345
- pointer-events: none;
346
- top: ${tableMarginTop}px;
347
- z-index: ${akEditorShadowZIndex};
348
- width: ${tableOverflowShadowWidthWide}px;
349
- }
350
- .${ClassName.TABLE_LEFT_SHADOW} {
351
- background: linear-gradient(
352
- to left,
353
- transparent 0,
354
- ${token('elevation.shadow.overflow.spread', N40A)} 140%
355
- ),
356
- linear-gradient(
357
- to right,
358
- ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
359
- transparent 1px
360
- );
361
- left: 0px;
362
- }
363
- .${ClassName.TABLE_CONTAINER}[data-number-column='true'] > :not(.${ClassName.TABLE_STICKY_SHADOW}).${ClassName.TABLE_LEFT_SHADOW} {
364
- left: ${akEditorTableNumberColumnWidth - 1}px;
365
- }
366
- .${ClassName.TABLE_RIGHT_SHADOW} {
367
- background: linear-gradient(
368
- to right,
369
- transparent 0,
370
- ${token('elevation.shadow.overflow.spread', N40A)} 140%
371
- ),
372
- linear-gradient(
373
- to left,
374
- ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
375
- transparent 1px
376
- );
377
- left: calc(100% - ${tableOverflowShadowWidthWide}px);
378
- }
379
- .${ClassName.WITH_CONTROLS} {
380
- ${overflowShadowWidhoutDnD(isDragAndDropEnabled)}
381
- .${ClassName.TABLE_LEFT_SHADOW} {
382
- border-left: 1px solid ${tableBorderColor};
383
- }
384
- }
322
+ export const OverflowShadow = (isDragAndDropEnabled: boolean | undefined) => css`
323
+ .${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
324
+ display: block;
325
+ height: calc(100% - ${tableMarginTop}px);
326
+ position: absolute;
327
+ pointer-events: none;
328
+ top: ${tableMarginTop}px;
329
+ z-index: ${akEditorShadowZIndex};
330
+ width: ${tableOverflowShadowWidthWide}px;
331
+ }
332
+ .${ClassName.TABLE_LEFT_SHADOW} {
333
+ background: linear-gradient(
334
+ to left,
335
+ transparent 0,
336
+ ${token('elevation.shadow.overflow.spread', N40A)} 140%
337
+ ),
338
+ linear-gradient(
339
+ to right,
340
+ ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
341
+ transparent 1px
342
+ );
343
+ left: 0px;
344
+ }
345
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] > :not(.${ClassName.TABLE_STICKY_SHADOW}).${ClassName.TABLE_LEFT_SHADOW} {
346
+ left: ${akEditorTableNumberColumnWidth - 1}px;
347
+ }
348
+ .${ClassName.TABLE_RIGHT_SHADOW} {
349
+ background: linear-gradient(
350
+ to right,
351
+ transparent 0,
352
+ ${token('elevation.shadow.overflow.spread', N40A)} 140%
353
+ ),
354
+ linear-gradient(
355
+ to left,
356
+ ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
357
+ transparent 1px
358
+ );
359
+ left: calc(100% - ${tableOverflowShadowWidthWide}px);
360
+ }
361
+ .${ClassName.WITH_CONTROLS} {
362
+ ${overflowShadowWidhoutDnD(isDragAndDropEnabled)}
363
+ .${ClassName.TABLE_LEFT_SHADOW} {
364
+ border-left: 1px solid ${tableBorderColor};
365
+ }
366
+ }
385
367
  `;
386
368
 
387
- const overflowShadowWidhoutDnD = (
388
- isDragAndDropEnabled: boolean | undefined,
389
- ) => {
390
- if (!isDragAndDropEnabled) {
391
- return css`
392
- .${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
393
- height: calc(100% - ${tableMarginTopWithControl}px);
394
- top: ${tableMarginTopWithControl}px;
395
- }
396
- `;
397
- }
369
+ const overflowShadowWidhoutDnD = (isDragAndDropEnabled: boolean | undefined) => {
370
+ if (!isDragAndDropEnabled) {
371
+ return css`
372
+ .${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
373
+ height: calc(100% - ${tableMarginTopWithControl}px);
374
+ top: ${tableMarginTopWithControl}px;
375
+ }
376
+ `;
377
+ }
398
378
  };
399
379
 
400
380
  const columnHeaderButton = (cssString?: string) => {
401
- return css(
402
- {
403
- background: tableHeaderCellBackgroundColor,
404
- display: 'block',
405
- boxSizing: 'border-box',
406
- padding: 0,
407
- ':focus': {
408
- outline: 'none',
409
- },
410
- },
411
- cssString,
412
- );
381
+ return css(
382
+ {
383
+ background: tableHeaderCellBackgroundColor,
384
+ display: 'block',
385
+ boxSizing: 'border-box',
386
+ padding: 0,
387
+ ':focus': {
388
+ outline: 'none',
389
+ },
390
+ },
391
+ cssString,
392
+ );
413
393
  };
414
394
 
415
395
  const columnHeaderButtonSelected = () =>
416
- css({
417
- color: token('color.text.inverse', N0),
418
- backgroundColor: tableToolbarSelectedColor,
419
- borderColor: tableBorderSelectedColor,
420
- zIndex: columnControlsSelectedZIndex,
421
- });
396
+ css({
397
+ color: token('color.text.inverse', N0),
398
+ backgroundColor: tableToolbarSelectedColor,
399
+ borderColor: tableBorderSelectedColor,
400
+ zIndex: columnControlsSelectedZIndex,
401
+ });
422
402
 
423
403
  const getFloatingDotOverrides = () => {
424
- return css`
425
- tr
426
- th:last-child
427
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::before,
428
- tr
429
- td:last-child
430
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::before {
431
- content: '';
432
- background-color: ${tableBorderColor};
433
- position: absolute;
434
- height: ${lineMarkerSize}px;
435
- width: ${lineMarkerSize}px;
436
- border-radius: 50%;
437
- pointer-events: none;
438
- top: ${token('space.025', '2px')};
439
- right: 0px;
440
- }
441
- `;
404
+ return css`
405
+ tr
406
+ th:last-child
407
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::before,
408
+ tr
409
+ td:last-child
410
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::before {
411
+ content: '';
412
+ background-color: ${tableBorderColor};
413
+ position: absolute;
414
+ height: ${lineMarkerSize}px;
415
+ width: ${lineMarkerSize}px;
416
+ border-radius: 50%;
417
+ pointer-events: none;
418
+ top: ${token('space.025', '2px')};
419
+ right: 0px;
420
+ }
421
+ `;
442
422
  };
443
423
 
444
424
  export const floatingColumnControls = () => {
445
- return css`
446
- .${ClassName.DRAG_COLUMN_DROP_TARGET_CONTROLS} {
447
- box-sizing: border-box;
448
- position: absolute;
449
- top: 0;
450
-
451
- .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
452
- display: flex;
453
- flex-direction: row;
454
- }
455
- }
456
-
457
- .${ClassName.DRAG_COLUMN_CONTROLS} {
458
- box-sizing: border-box;
459
-
460
- .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
461
- display: grid;
462
- justify-items: center;
463
- }
464
- }
465
- `;
425
+ return css`
426
+ .${ClassName.DRAG_COLUMN_DROP_TARGET_CONTROLS} {
427
+ box-sizing: border-box;
428
+ position: absolute;
429
+ top: 0;
430
+
431
+ .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
432
+ display: flex;
433
+ flex-direction: row;
434
+ }
435
+ }
436
+
437
+ .${ClassName.DRAG_COLUMN_CONTROLS} {
438
+ box-sizing: border-box;
439
+
440
+ .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
441
+ display: grid;
442
+ justify-items: center;
443
+ }
444
+ }
445
+ `;
466
446
  };
467
447
 
468
448
  export const rowControlsWrapperDotStyle = () => {
469
- return css`
470
- // override for DnD controls
471
- div.${ClassName.WITH_CONTROLS}>.${ClassName.DRAG_ROW_CONTROLS_WRAPPER}::after {
472
- display: none;
473
- }
474
-
475
- div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
476
- content: ' ';
477
- background-color: ${tableBorderColor};
478
- position: absolute;
479
- height: ${lineMarkerSize}px;
480
- width: ${lineMarkerSize}px;
481
- border-radius: 50%;
482
- pointer-events: none;
483
- top: -${tableToolbarSize + tableCellBorderWidth}px;
484
- right: -1px;
485
- }
486
- `;
449
+ return css`
450
+ // override for DnD controls
451
+ div.${ClassName.WITH_CONTROLS}>.${ClassName.DRAG_ROW_CONTROLS_WRAPPER}::after {
452
+ display: none;
453
+ }
454
+
455
+ div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
456
+ content: ' ';
457
+ background-color: ${tableBorderColor};
458
+ position: absolute;
459
+ height: ${lineMarkerSize}px;
460
+ width: ${lineMarkerSize}px;
461
+ border-radius: 50%;
462
+ pointer-events: none;
463
+ top: -${tableToolbarSize + tableCellBorderWidth}px;
464
+ right: -1px;
465
+ }
466
+ `;
487
467
  };
488
468
 
489
469
  export const columnControlsDecoration = () => {
490
- return css`
491
- .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
492
- display: none;
493
- cursor: pointer;
494
- position: absolute;
495
- width: 100%;
496
- left: 0;
497
- top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
498
- height: ${columnControlsDecorationHeight}px;
499
- // floating dot for adding column button
500
- &::before {
501
- content: ' ';
502
- background-color: ${tableBorderColor};
503
- position: absolute;
504
- height: ${lineMarkerSize}px;
505
- width: ${lineMarkerSize}px;
506
- border-radius: 50%;
507
- pointer-events: none;
508
- top: 2px;
509
- right: ${token('space.negative.025', '-2px')};
510
- }
511
-
512
- &::after {
513
- content: ' ';
514
-
515
- ${columnHeaderButton(
516
- `
470
+ return css`
471
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
472
+ display: none;
473
+ cursor: pointer;
474
+ position: absolute;
475
+ width: 100%;
476
+ left: 0;
477
+ top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
478
+ height: ${columnControlsDecorationHeight}px;
479
+ // floating dot for adding column button
480
+ &::before {
481
+ content: ' ';
482
+ background-color: ${tableBorderColor};
483
+ position: absolute;
484
+ height: ${lineMarkerSize}px;
485
+ width: ${lineMarkerSize}px;
486
+ border-radius: 50%;
487
+ pointer-events: none;
488
+ top: 2px;
489
+ right: ${token('space.negative.025', '-2px')};
490
+ }
491
+
492
+ &::after {
493
+ content: ' ';
494
+
495
+ ${columnHeaderButton(
496
+ `
517
497
  border-right: ${tableCellBorderWidth}px solid ${tableBorderColor};
518
498
  border-top: ${tableCellBorderWidth}px solid ${tableBorderColor};
519
499
  border-bottom: ${tableCellBorderWidth}px solid ${tableBorderColor};
@@ -525,251 +505,245 @@ export const columnControlsDecoration = () => {
525
505
  left: 0px;
526
506
  z-index: ${columnControlsZIndex};
527
507
  `,
528
- )}
529
- }
530
- }
531
-
532
- // floating dot for adding column button - overriding style on last column to avoid scroll
533
- ${getFloatingDotOverrides()}
534
-
535
- .${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
536
- display: block;
537
- }
538
-
539
- table
540
- tr:first-of-type
541
- td.${ClassName.TABLE_CELL},table
542
- tr:first-of-type
543
- th.${ClassName.TABLE_HEADER_CELL} {
544
- &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_TABLE} {
545
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
546
- ${columnHeaderButtonSelected()};
547
- }
548
-
549
- &.${ClassName.HOVERED_CELL_IN_DANGER}
550
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
551
- background-color: ${tableToolbarDeleteColor};
552
- border-color: ${tableBorderDeleteColor};
553
- z-index: ${akEditorUnitZIndex * 100};
554
- }
555
- }
556
- }
557
-
558
- table
559
- tr:first-of-type
560
- td.${ClassName.TABLE_CELL},table
561
- tr:first-of-type
562
- th.${ClassName.TABLE_HEADER_CELL} {
563
- &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
564
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
565
- ${columnHeaderButtonSelected()};
566
- border-left: ${tableCellBorderWidth}px solid
567
- ${tableBorderSelectedColor};
568
- left: -${tableCellBorderWidth}px;
569
- }
570
- }
571
- }
572
-
573
- table
574
- tr:first-of-type
575
- td.${ClassName.TABLE_CELL},
576
- table
577
- tr:first-of-type
578
- th.${ClassName.TABLE_HEADER_CELL} {
579
- &.${ClassName.HOVERED_COLUMN} {
580
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
581
- ${columnHeaderButtonSelected()};
582
- }
583
-
584
- &.${ClassName.HOVERED_CELL_IN_DANGER}
585
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
586
- background-color: ${tableToolbarDeleteColor};
587
- border-color: ${tableBorderDeleteColor};
588
- border-left: ${tableCellBorderWidth}px solid ${tableBorderDeleteColor};
589
- left: -${tableCellBorderWidth}px;
590
- z-index: ${akEditorUnitZIndex * 100};
591
- }
592
- }
593
- }
594
-
595
- .${ClassName.TABLE_SELECTED}
596
- table
597
- tr:first-of-type
598
- td.${ClassName.TABLE_CELL},
599
- .${ClassName.TABLE_SELECTED}
600
- table
601
- tr:first-of-type
602
- th.${ClassName.TABLE_HEADER_CELL} {
603
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
604
- ${columnHeaderButtonSelected()};
605
- }
606
- }
607
- `;
508
+ )}
509
+ }
510
+ }
511
+
512
+ // floating dot for adding column button - overriding style on last column to avoid scroll
513
+ ${getFloatingDotOverrides()}
514
+
515
+ .${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
516
+ display: block;
517
+ }
518
+
519
+ table
520
+ tr:first-of-type
521
+ td.${ClassName.TABLE_CELL},table
522
+ tr:first-of-type
523
+ th.${ClassName.TABLE_HEADER_CELL} {
524
+ &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_TABLE} {
525
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
526
+ ${columnHeaderButtonSelected()};
527
+ }
528
+
529
+ &.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
530
+ background-color: ${tableToolbarDeleteColor};
531
+ border-color: ${tableBorderDeleteColor};
532
+ z-index: ${akEditorUnitZIndex * 100};
533
+ }
534
+ }
535
+ }
536
+
537
+ table
538
+ tr:first-of-type
539
+ td.${ClassName.TABLE_CELL},table
540
+ tr:first-of-type
541
+ th.${ClassName.TABLE_HEADER_CELL} {
542
+ &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
543
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
544
+ ${columnHeaderButtonSelected()};
545
+ border-left: ${tableCellBorderWidth}px solid ${tableBorderSelectedColor};
546
+ left: -${tableCellBorderWidth}px;
547
+ }
548
+ }
549
+ }
550
+
551
+ table
552
+ tr:first-of-type
553
+ td.${ClassName.TABLE_CELL},
554
+ table
555
+ tr:first-of-type
556
+ th.${ClassName.TABLE_HEADER_CELL} {
557
+ &.${ClassName.HOVERED_COLUMN} {
558
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
559
+ ${columnHeaderButtonSelected()};
560
+ }
561
+
562
+ &.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
563
+ background-color: ${tableToolbarDeleteColor};
564
+ border-color: ${tableBorderDeleteColor};
565
+ border-left: ${tableCellBorderWidth}px solid ${tableBorderDeleteColor};
566
+ left: -${tableCellBorderWidth}px;
567
+ z-index: ${akEditorUnitZIndex * 100};
568
+ }
569
+ }
570
+ }
571
+
572
+ .${ClassName.TABLE_SELECTED}
573
+ table
574
+ tr:first-of-type
575
+ td.${ClassName.TABLE_CELL},
576
+ .${ClassName.TABLE_SELECTED}
577
+ table
578
+ tr:first-of-type
579
+ th.${ClassName.TABLE_HEADER_CELL} {
580
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
581
+ ${columnHeaderButtonSelected()};
582
+ }
583
+ }
584
+ `;
608
585
  };
609
586
 
610
587
  export const hoveredDeleteButton = () => css`
611
- .${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
612
- .${ClassName.SELECTED_CELL},
613
- .${ClassName.COLUMN_SELECTED},
614
- .${ClassName.HOVERED_CELL} {
615
- border: 1px solid ${tableBorderDeleteColor};
616
- }
617
- .${ClassName.SELECTED_CELL}::after {
618
- background: ${tableCellDeleteColor};
619
- }
620
-
621
- .${ClassName.TABLE_NODE_WRAPPER} > table {
622
- td.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
623
- background: ${tableCellDeleteColor};
624
- border: 1px solid ${tableBorderDeleteColor};
625
- }
626
- th.${ClassName.HOVERED_NO_HIGHLIGHT} {
627
- background-color: unset;
628
- }
629
- th.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
630
- background: ${tableCellDeleteColor};
631
- border: 1px solid ${tableBorderDeleteColor};
632
- }
633
- }
634
- }
588
+ .${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
589
+ .${ClassName.SELECTED_CELL}, .${ClassName.COLUMN_SELECTED}, .${ClassName.HOVERED_CELL} {
590
+ border: 1px solid ${tableBorderDeleteColor};
591
+ }
592
+ .${ClassName.SELECTED_CELL}::after {
593
+ background: ${tableCellDeleteColor};
594
+ }
595
+
596
+ .${ClassName.TABLE_NODE_WRAPPER} > table {
597
+ td.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
598
+ background: ${tableCellDeleteColor};
599
+ border: 1px solid ${tableBorderDeleteColor};
600
+ }
601
+ th.${ClassName.HOVERED_NO_HIGHLIGHT} {
602
+ background-color: unset;
603
+ }
604
+ th.${ClassName.HOVERED_NO_HIGHLIGHT}::after {
605
+ background: ${tableCellDeleteColor};
606
+ border: 1px solid ${tableBorderDeleteColor};
607
+ }
608
+ }
609
+ }
635
610
  `;
636
611
 
637
612
  export const hoveredCell = () => css`
638
- :not(.${ClassName.IS_RESIZING})
639
- .${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
640
- .${ClassName.HOVERED_CELL} {
641
- position: relative;
642
- border: 1px solid ${tableBorderSelectedColor};
643
- }
644
- .${ClassName.HOVERED_CELL}.${ClassName.HOVERED_NO_HIGHLIGHT} {
645
- position: relative;
646
- border: 1px solid ${tableBorderColor};
647
- }
648
- }
613
+ :not(.${ClassName.IS_RESIZING})
614
+ .${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
615
+ .${ClassName.HOVERED_CELL} {
616
+ position: relative;
617
+ border: 1px solid ${tableBorderSelectedColor};
618
+ }
619
+ .${ClassName.HOVERED_CELL}.${ClassName.HOVERED_NO_HIGHLIGHT} {
620
+ position: relative;
621
+ border: 1px solid ${tableBorderColor};
622
+ }
623
+ }
649
624
  `;
650
625
 
651
626
  export const hoveredWarningCell = css`
652
- :not(.${ClassName.IS_RESIZING})
653
- .${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
654
- td.${ClassName.HOVERED_CELL_WARNING} {
655
- background-color: ${token(
656
- 'color.background.warning',
657
- Y50,
658
- )} !important; // We need to override the background-color added to the cell
659
- border: 1px solid ${token('color.border.warning', Y200)};
660
- }
661
- }
627
+ :not(.${ClassName.IS_RESIZING})
628
+ .${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
629
+ td.${ClassName.HOVERED_CELL_WARNING} {
630
+ background-color: ${token(
631
+ 'color.background.warning',
632
+ Y50,
633
+ )} !important; // We need to override the background-color added to the cell
634
+ border: 1px solid ${token('color.border.warning', Y200)};
635
+ }
636
+ }
662
637
  `;
663
638
 
664
639
  // Explicit pixel values required here to ensure correct positioning and sizes of column resize handle
665
640
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
666
641
  const resizeHandleOverrides = (isDragAndDropEnabled: boolean | undefined) => {
667
- if (isDragAndDropEnabled) {
668
- return css`
669
- th.${ClassName.WITH_RESIZE_LINE}::before,
670
- td.${ClassName.WITH_RESIZE_LINE}::before {
671
- content: ' ';
672
- position: absolute;
673
- left: ${token('space.negative.025', '-2px')};
674
- top: -1px;
675
- width: ${resizeLineWidth}px;
676
- height: calc(100% + 2px);
677
- background-color: ${tableBorderSelectedColor};
678
- z-index: ${columnControlsZIndex * 2};
679
- }
680
-
681
- th.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before,
682
- td.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
683
- content: ' ';
684
- position: absolute;
685
- right: -1px;
686
- top: -1px;
687
- width: ${resizeLineWidth}px;
688
- height: calc(100% + 2px);
689
- background-color: ${tableBorderSelectedColor};
690
- z-index: ${columnControlsZIndex * 2};
691
- }
692
- `;
693
- }
694
- return css`
695
- td.${ClassName.WITH_RESIZE_LINE}::before {
696
- content: ' ';
697
- position: absolute;
698
- left: ${token('space.negative.025', '-2px')};
699
- top: -1px;
700
- width: ${resizeLineWidth}px;
701
- height: calc(100% + 2px);
702
- background-color: ${tableBorderSelectedColor};
703
- z-index: ${columnControlsZIndex * 2};
704
- }
705
-
706
- th.${ClassName.WITH_RESIZE_LINE}::before {
707
- content: ' ';
708
- left: ${token('space.negative.025', '-2px')};
709
- position: absolute;
710
- width: ${resizeLineWidth}px;
711
- height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
712
- background-color: ${tableBorderSelectedColor};
713
- z-index: ${columnControlsZIndex * 2};
714
- top: -${tableToolbarSize + tableCellBorderWidth}px;
715
- }
716
-
717
- td.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
718
- content: ' ';
719
- position: absolute;
720
- right: -1px;
721
- top: -1px;
722
- width: ${resizeLineWidth}px;
723
- height: calc(100% + 2px);
724
- background-color: ${tableBorderSelectedColor};
725
- z-index: ${columnControlsZIndex * 2};
726
- }
727
-
728
- th.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
729
- content: ' ';
730
- right: -1px;
731
- position: absolute;
732
- width: ${resizeLineWidth}px;
733
- height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
734
- background-color: ${tableBorderSelectedColor};
735
- z-index: ${columnControlsZIndex * 2};
736
- top: -${tableToolbarSize + tableCellBorderWidth}px;
737
- }
738
- `;
642
+ if (isDragAndDropEnabled) {
643
+ return css`
644
+ th.${ClassName.WITH_RESIZE_LINE}::before, td.${ClassName.WITH_RESIZE_LINE}::before {
645
+ content: ' ';
646
+ position: absolute;
647
+ left: ${token('space.negative.025', '-2px')};
648
+ top: -1px;
649
+ width: ${resizeLineWidth}px;
650
+ height: calc(100% + 2px);
651
+ background-color: ${tableBorderSelectedColor};
652
+ z-index: ${columnControlsZIndex * 2};
653
+ }
654
+
655
+ th.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before,
656
+ td.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
657
+ content: ' ';
658
+ position: absolute;
659
+ right: -1px;
660
+ top: -1px;
661
+ width: ${resizeLineWidth}px;
662
+ height: calc(100% + 2px);
663
+ background-color: ${tableBorderSelectedColor};
664
+ z-index: ${columnControlsZIndex * 2};
665
+ }
666
+ `;
667
+ }
668
+ return css`
669
+ td.${ClassName.WITH_RESIZE_LINE}::before {
670
+ content: ' ';
671
+ position: absolute;
672
+ left: ${token('space.negative.025', '-2px')};
673
+ top: -1px;
674
+ width: ${resizeLineWidth}px;
675
+ height: calc(100% + 2px);
676
+ background-color: ${tableBorderSelectedColor};
677
+ z-index: ${columnControlsZIndex * 2};
678
+ }
679
+
680
+ th.${ClassName.WITH_RESIZE_LINE}::before {
681
+ content: ' ';
682
+ left: ${token('space.negative.025', '-2px')};
683
+ position: absolute;
684
+ width: ${resizeLineWidth}px;
685
+ height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
686
+ background-color: ${tableBorderSelectedColor};
687
+ z-index: ${columnControlsZIndex * 2};
688
+ top: -${tableToolbarSize + tableCellBorderWidth}px;
689
+ }
690
+
691
+ td.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
692
+ content: ' ';
693
+ position: absolute;
694
+ right: -1px;
695
+ top: -1px;
696
+ width: ${resizeLineWidth}px;
697
+ height: calc(100% + 2px);
698
+ background-color: ${tableBorderSelectedColor};
699
+ z-index: ${columnControlsZIndex * 2};
700
+ }
701
+
702
+ th.${ClassName.WITH_RESIZE_LINE_LAST_COLUMN}::before {
703
+ content: ' ';
704
+ right: -1px;
705
+ position: absolute;
706
+ width: ${resizeLineWidth}px;
707
+ height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
708
+ background-color: ${tableBorderSelectedColor};
709
+ z-index: ${columnControlsZIndex * 2};
710
+ top: -${tableToolbarSize + tableCellBorderWidth}px;
711
+ }
712
+ `;
739
713
  };
740
714
 
741
715
  export const resizeHandle = (isDragAndDropEnabled: boolean | undefined) => css`
742
- .${ClassName.TABLE_CONTAINER} {
743
- .${ClassName.RESIZE_HANDLE_DECORATION} {
744
- background-color: transparent;
745
- position: absolute;
746
- width: ${resizeHandlerAreaWidth}px;
747
- height: 100%;
748
- top: 0;
749
- right: -${resizeHandlerAreaWidth / 2}px;
750
- cursor: col-resize;
751
- z-index: ${resizeHandlerZIndex};
752
- }
753
-
754
- tr
755
- th:last-child
756
- .${ClassName.RESIZE_HANDLE_DECORATION},
757
- tr
758
- td:last-child
759
- .${ClassName.RESIZE_HANDLE_DECORATION} {
760
- background-color: transparent;
761
- position: absolute;
762
- width: ${resizeHandlerAreaWidth / 2}px;
763
- height: 100%;
764
- top: 0;
765
- right: 0;
766
- cursor: col-resize;
767
- z-index: ${resizeHandlerZIndex};
768
- }
769
-
770
- ${resizeHandleOverrides(isDragAndDropEnabled)}
771
-
772
- table
716
+ .${ClassName.TABLE_CONTAINER} {
717
+ .${ClassName.RESIZE_HANDLE_DECORATION} {
718
+ background-color: transparent;
719
+ position: absolute;
720
+ width: ${resizeHandlerAreaWidth}px;
721
+ height: 100%;
722
+ top: 0;
723
+ right: -${resizeHandlerAreaWidth / 2}px;
724
+ cursor: col-resize;
725
+ z-index: ${resizeHandlerZIndex};
726
+ }
727
+
728
+ tr
729
+ th:last-child
730
+ .${ClassName.RESIZE_HANDLE_DECORATION},
731
+ tr
732
+ td:last-child
733
+ .${ClassName.RESIZE_HANDLE_DECORATION} {
734
+ background-color: transparent;
735
+ position: absolute;
736
+ width: ${resizeHandlerAreaWidth / 2}px;
737
+ height: 100%;
738
+ top: 0;
739
+ right: 0;
740
+ cursor: col-resize;
741
+ z-index: ${resizeHandlerZIndex};
742
+ }
743
+
744
+ ${resizeHandleOverrides(isDragAndDropEnabled)}
745
+
746
+ table
773
747
  tr:first-of-type
774
748
  th.${ClassName.WITH_RESIZE_LINE}
775
749
  .${ClassName.RESIZE_HANDLE_DECORATION}::after,
@@ -777,176 +751,173 @@ export const resizeHandle = (isDragAndDropEnabled: boolean | undefined) => css`
777
751
  tr:first-of-type
778
752
  td.${ClassName.WITH_RESIZE_LINE}
779
753
  .${ClassName.RESIZE_HANDLE_DECORATION}::after {
780
- top: -${tableToolbarSize + tableCellBorderWidth}px;
781
- height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
782
- }
783
- }
754
+ top: -${tableToolbarSize + tableCellBorderWidth}px;
755
+ height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
756
+ }
757
+ }
784
758
  `;
785
759
 
786
760
  // Drag and Drop: drop target insert line
787
761
  const tableCellColumnInsertLineStyles = css({
788
- content: "' '",
789
- position: 'absolute',
790
- height: `calc(100% + ${tableCellBorderWidth * 2}px)`,
791
- width: `${insertLineWidth}px`,
792
- zIndex: columnControlsZIndex * 2,
762
+ content: "' '",
763
+ position: 'absolute',
764
+ height: `calc(100% + ${tableCellBorderWidth * 2}px)`,
765
+ width: `${insertLineWidth}px`,
766
+ zIndex: columnControlsZIndex * 2,
793
767
  });
794
768
 
795
769
  const tableCellRowInsertLineStyles = css({
796
- content: "' '",
797
- position: 'absolute',
798
- left: token('space.negative.025', '-2px'),
799
- height: `${insertLineWidth}px`,
800
- width: `calc(100% + ${tableCellBorderWidth * 2}px)`,
801
- zIndex: columnControlsZIndex * 2,
770
+ content: "' '",
771
+ position: 'absolute',
772
+ left: token('space.negative.025', '-2px'),
773
+ height: `${insertLineWidth}px`,
774
+ width: `calc(100% + ${tableCellBorderWidth * 2}px)`,
775
+ zIndex: columnControlsZIndex * 2,
802
776
  });
803
777
 
804
778
  const insertLineActiveColor = css({
805
- backgroundColor: tableBorderSelectedColor,
779
+ backgroundColor: tableBorderSelectedColor,
806
780
  });
807
781
 
808
782
  const insertLineInactiveColor = css({
809
- backgroundColor: token(
810
- 'color.background.accent.gray.subtler',
811
- akEditorTableBorder,
812
- ),
783
+ backgroundColor: token('color.background.accent.gray.subtler', akEditorTableBorder),
813
784
  });
814
785
 
815
786
  // Explicit pixel values required here to ensure correct positioning of line that is show on row
816
787
  // or column drag
817
788
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
818
789
  export const insertLine = () => css`
819
- .${ClassName.TABLE_CONTAINER} {
820
- td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
821
- ${tableCellColumnInsertLineStyles}
822
- left: -1px;
823
- top: -1px;
824
- ${insertLineActiveColor}
825
- }
826
-
827
- td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE}::before {
828
- ${tableCellColumnInsertLineStyles}
829
- left: -1px;
830
- top: -1px;
831
- ${insertLineInactiveColor}
832
- }
833
-
834
- th.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
835
- ${tableCellColumnInsertLineStyles}
836
- left: -1px;
837
- top: -${tableCellBorderWidth}px;
838
- ${insertLineActiveColor}
839
- }
840
-
841
- th.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE}::before {
842
- ${tableCellColumnInsertLineStyles}
843
- left: -1px;
844
- top: -${tableCellBorderWidth}px;
845
- ${insertLineInactiveColor}
846
- }
847
-
848
- td.${ClassName.WITH_COLUMN_INSERT_LINE}::before {
849
- ${tableCellColumnInsertLineStyles}
850
- left: ${token('space.negative.025', '-2px')};
851
- top: -1px;
852
- ${insertLineActiveColor}
853
- }
854
-
855
- td.${ClassName.WITH_COLUMN_INSERT_LINE_INACTIVE}::before {
856
- ${tableCellColumnInsertLineStyles}
857
- left: ${token('space.negative.025', '-2px')};
858
- top: -1px;
859
- ${insertLineInactiveColor}
860
- }
861
-
862
- th.${ClassName.WITH_COLUMN_INSERT_LINE}::before {
863
- ${tableCellColumnInsertLineStyles}
864
- left: ${token('space.negative.025', '-2px')};
865
- top: -${tableCellBorderWidth}px;
866
- ${insertLineActiveColor}
867
- }
868
-
869
- th.${ClassName.WITH_COLUMN_INSERT_LINE_INACTIVE}::before {
870
- ${tableCellColumnInsertLineStyles}
871
- left: ${token('space.negative.025', '-2px')};
872
- top: -${tableCellBorderWidth}px;
873
- ${insertLineInactiveColor}
874
- }
875
-
876
- td.${ClassName.WITH_LAST_COLUMN_INSERT_LINE}::before {
877
- ${tableCellColumnInsertLineStyles}
878
- right: -1px;
879
- top: -1px;
880
- ${insertLineActiveColor}
881
- }
882
-
883
- td.${ClassName.WITH_LAST_COLUMN_INSERT_LINE_INACTIVE}::before {
884
- ${tableCellColumnInsertLineStyles}
885
- right: -1px;
886
- top: -1px;
887
- ${insertLineInactiveColor}
888
- }
889
-
890
- th.${ClassName.WITH_LAST_COLUMN_INSERT_LINE}::before {
891
- ${tableCellColumnInsertLineStyles}
892
- right: -1px;
893
- top: -${tableCellBorderWidth}px;
894
- ${insertLineActiveColor}
895
- }
896
-
897
- th.${ClassName.WITH_LAST_COLUMN_INSERT_LINE_INACTIVE}::before {
898
- ${tableCellColumnInsertLineStyles}
899
- right: -1px;
900
- top: -${tableCellBorderWidth}px;
901
- ${insertLineInactiveColor}
902
- }
903
-
904
- td.${ClassName.WITH_ROW_INSERT_LINE}::before {
905
- ${tableCellRowInsertLineStyles}
906
- top: -1px;
907
- ${insertLineActiveColor}
908
- }
909
-
910
- td.${ClassName.WITH_ROW_INSERT_LINE_INACTIVE}::before {
911
- ${tableCellRowInsertLineStyles}
912
- top: -1px;
913
- ${insertLineInactiveColor}
914
- }
915
-
916
- th.${ClassName.WITH_ROW_INSERT_LINE}::before {
917
- ${tableCellRowInsertLineStyles}
918
- top: -1px;
919
- ${insertLineActiveColor}
920
- }
921
-
922
- th.${ClassName.WITH_ROW_INSERT_LINE_INACTIVE}::before {
923
- ${tableCellRowInsertLineStyles}
924
- top: -1px;
925
- ${insertLineInactiveColor}
926
- }
927
-
928
- td.${ClassName.WITH_LAST_ROW_INSERT_LINE}::before {
929
- ${tableCellRowInsertLineStyles}
930
- bottom: 0;
931
- ${insertLineActiveColor}
932
- }
933
-
934
- td.${ClassName.WITH_LAST_ROW_INSERT_LINE_INACTIVE}::before {
935
- ${tableCellRowInsertLineStyles}
936
- bottom: 0;
937
- ${insertLineInactiveColor}
938
- }
939
-
940
- th.${ClassName.WITH_LAST_ROW_INSERT_LINE}::before {
941
- ${tableCellRowInsertLineStyles}
942
- bottom: 0;
943
- ${insertLineActiveColor}
944
- }
945
-
946
- th.${ClassName.WITH_LAST_ROW_INSERT_LINE_INACTIVE}::before {
947
- ${tableCellRowInsertLineStyles}
948
- bottom: 0;
949
- ${insertLineInactiveColor}
950
- }
951
- }
790
+ .${ClassName.TABLE_CONTAINER} {
791
+ td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
792
+ ${tableCellColumnInsertLineStyles}
793
+ left: -1px;
794
+ top: -1px;
795
+ ${insertLineActiveColor}
796
+ }
797
+
798
+ td.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE}::before {
799
+ ${tableCellColumnInsertLineStyles}
800
+ left: -1px;
801
+ top: -1px;
802
+ ${insertLineInactiveColor}
803
+ }
804
+
805
+ th.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE}::before {
806
+ ${tableCellColumnInsertLineStyles}
807
+ left: -1px;
808
+ top: -${tableCellBorderWidth}px;
809
+ ${insertLineActiveColor}
810
+ }
811
+
812
+ th.${ClassName.WITH_FIRST_COLUMN_INSERT_LINE_INACTIVE}::before {
813
+ ${tableCellColumnInsertLineStyles}
814
+ left: -1px;
815
+ top: -${tableCellBorderWidth}px;
816
+ ${insertLineInactiveColor}
817
+ }
818
+
819
+ td.${ClassName.WITH_COLUMN_INSERT_LINE}::before {
820
+ ${tableCellColumnInsertLineStyles}
821
+ left: ${token('space.negative.025', '-2px')};
822
+ top: -1px;
823
+ ${insertLineActiveColor}
824
+ }
825
+
826
+ td.${ClassName.WITH_COLUMN_INSERT_LINE_INACTIVE}::before {
827
+ ${tableCellColumnInsertLineStyles}
828
+ left: ${token('space.negative.025', '-2px')};
829
+ top: -1px;
830
+ ${insertLineInactiveColor}
831
+ }
832
+
833
+ th.${ClassName.WITH_COLUMN_INSERT_LINE}::before {
834
+ ${tableCellColumnInsertLineStyles}
835
+ left: ${token('space.negative.025', '-2px')};
836
+ top: -${tableCellBorderWidth}px;
837
+ ${insertLineActiveColor}
838
+ }
839
+
840
+ th.${ClassName.WITH_COLUMN_INSERT_LINE_INACTIVE}::before {
841
+ ${tableCellColumnInsertLineStyles}
842
+ left: ${token('space.negative.025', '-2px')};
843
+ top: -${tableCellBorderWidth}px;
844
+ ${insertLineInactiveColor}
845
+ }
846
+
847
+ td.${ClassName.WITH_LAST_COLUMN_INSERT_LINE}::before {
848
+ ${tableCellColumnInsertLineStyles}
849
+ right: -1px;
850
+ top: -1px;
851
+ ${insertLineActiveColor}
852
+ }
853
+
854
+ td.${ClassName.WITH_LAST_COLUMN_INSERT_LINE_INACTIVE}::before {
855
+ ${tableCellColumnInsertLineStyles}
856
+ right: -1px;
857
+ top: -1px;
858
+ ${insertLineInactiveColor}
859
+ }
860
+
861
+ th.${ClassName.WITH_LAST_COLUMN_INSERT_LINE}::before {
862
+ ${tableCellColumnInsertLineStyles}
863
+ right: -1px;
864
+ top: -${tableCellBorderWidth}px;
865
+ ${insertLineActiveColor}
866
+ }
867
+
868
+ th.${ClassName.WITH_LAST_COLUMN_INSERT_LINE_INACTIVE}::before {
869
+ ${tableCellColumnInsertLineStyles}
870
+ right: -1px;
871
+ top: -${tableCellBorderWidth}px;
872
+ ${insertLineInactiveColor}
873
+ }
874
+
875
+ td.${ClassName.WITH_ROW_INSERT_LINE}::before {
876
+ ${tableCellRowInsertLineStyles}
877
+ top: -1px;
878
+ ${insertLineActiveColor}
879
+ }
880
+
881
+ td.${ClassName.WITH_ROW_INSERT_LINE_INACTIVE}::before {
882
+ ${tableCellRowInsertLineStyles}
883
+ top: -1px;
884
+ ${insertLineInactiveColor}
885
+ }
886
+
887
+ th.${ClassName.WITH_ROW_INSERT_LINE}::before {
888
+ ${tableCellRowInsertLineStyles}
889
+ top: -1px;
890
+ ${insertLineActiveColor}
891
+ }
892
+
893
+ th.${ClassName.WITH_ROW_INSERT_LINE_INACTIVE}::before {
894
+ ${tableCellRowInsertLineStyles}
895
+ top: -1px;
896
+ ${insertLineInactiveColor}
897
+ }
898
+
899
+ td.${ClassName.WITH_LAST_ROW_INSERT_LINE}::before {
900
+ ${tableCellRowInsertLineStyles}
901
+ bottom: 0;
902
+ ${insertLineActiveColor}
903
+ }
904
+
905
+ td.${ClassName.WITH_LAST_ROW_INSERT_LINE_INACTIVE}::before {
906
+ ${tableCellRowInsertLineStyles}
907
+ bottom: 0;
908
+ ${insertLineInactiveColor}
909
+ }
910
+
911
+ th.${ClassName.WITH_LAST_ROW_INSERT_LINE}::before {
912
+ ${tableCellRowInsertLineStyles}
913
+ bottom: 0;
914
+ ${insertLineActiveColor}
915
+ }
916
+
917
+ th.${ClassName.WITH_LAST_ROW_INSERT_LINE_INACTIVE}::before {
918
+ ${tableCellRowInsertLineStyles}
919
+ bottom: 0;
920
+ ${insertLineInactiveColor}
921
+ }
922
+ }
952
923
  `;