@atlaskit/editor-plugin-table 12.2.6 → 12.2.7

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