@atlaskit/editor-plugin-table 12.2.5 → 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 (207) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +24 -2
  3. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +23 -1
  4. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +24 -2
  5. package/package.json +4 -4
  6. package/afm-cc/tsconfig.json +0 -123
  7. package/afm-dev-agents/tsconfig.json +0 -123
  8. package/afm-jira/tsconfig.json +0 -123
  9. package/afm-passionfruit/tsconfig.json +0 -123
  10. package/afm-post-office/tsconfig.json +0 -123
  11. package/afm-rovo-extension/tsconfig.json +0 -123
  12. package/afm-townsquare/tsconfig.json +0 -123
  13. package/afm-volt/tsconfig.json +0 -114
  14. package/build/tsconfig.json +0 -23
  15. package/docs/0-intro.tsx +0 -57
  16. package/src/index.ts +0 -21
  17. package/src/nodeviews/ExternalDropTargets.tsx +0 -91
  18. package/src/nodeviews/OverflowShadowsObserver.ts +0 -156
  19. package/src/nodeviews/TableCell.ts +0 -134
  20. package/src/nodeviews/TableComponent.tsx +0 -1590
  21. package/src/nodeviews/TableComponentWithSharedState.tsx +0 -278
  22. package/src/nodeviews/TableContainer.tsx +0 -926
  23. package/src/nodeviews/TableNodeViewBase.ts +0 -29
  24. package/src/nodeviews/TableResizer.tsx +0 -884
  25. package/src/nodeviews/TableRow.ts +0 -830
  26. package/src/nodeviews/TableStickyScrollbar.ts +0 -211
  27. package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +0 -15
  28. package/src/nodeviews/__mocks__/OverridableMock.ts +0 -26
  29. package/src/nodeviews/table-container-styles.ts +0 -9
  30. package/src/nodeviews/table-node-views.ts +0 -76
  31. package/src/nodeviews/table.tsx +0 -530
  32. package/src/nodeviews/toDOM.ts +0 -244
  33. package/src/nodeviews/types.ts +0 -36
  34. package/src/nodeviews/update-overflow-shadows.ts +0 -11
  35. package/src/pm-plugins/analytics/actions.ts +0 -21
  36. package/src/pm-plugins/analytics/commands.ts +0 -47
  37. package/src/pm-plugins/analytics/plugin-factory.ts +0 -9
  38. package/src/pm-plugins/analytics/plugin-key.ts +0 -5
  39. package/src/pm-plugins/analytics/plugin.ts +0 -80
  40. package/src/pm-plugins/analytics/reducer.ts +0 -27
  41. package/src/pm-plugins/analytics/types.ts +0 -20
  42. package/src/pm-plugins/analytics/utils/moved-event.ts +0 -51
  43. package/src/pm-plugins/commands/clear.ts +0 -43
  44. package/src/pm-plugins/commands/collapse.ts +0 -17
  45. package/src/pm-plugins/commands/column-resize.ts +0 -478
  46. package/src/pm-plugins/commands/commands-with-analytics.ts +0 -715
  47. package/src/pm-plugins/commands/delete.ts +0 -42
  48. package/src/pm-plugins/commands/display-mode.ts +0 -18
  49. package/src/pm-plugins/commands/go-to-next-cell.ts +0 -198
  50. package/src/pm-plugins/commands/hover.ts +0 -242
  51. package/src/pm-plugins/commands/index.ts +0 -51
  52. package/src/pm-plugins/commands/insert.ts +0 -438
  53. package/src/pm-plugins/commands/misc.ts +0 -811
  54. package/src/pm-plugins/commands/referentiality.ts +0 -15
  55. package/src/pm-plugins/commands/selection.ts +0 -537
  56. package/src/pm-plugins/commands/sort.ts +0 -102
  57. package/src/pm-plugins/commands/split-cell.ts +0 -28
  58. package/src/pm-plugins/commands/toggle.ts +0 -109
  59. package/src/pm-plugins/create-plugin-config.ts +0 -17
  60. package/src/pm-plugins/decorations/plugin.ts +0 -107
  61. package/src/pm-plugins/decorations/utils/column-controls.ts +0 -91
  62. package/src/pm-plugins/decorations/utils/column-resizing.ts +0 -71
  63. package/src/pm-plugins/decorations/utils/compose-decorations.ts +0 -9
  64. package/src/pm-plugins/decorations/utils/types.ts +0 -16
  65. package/src/pm-plugins/default-table-selection.ts +0 -14
  66. package/src/pm-plugins/drag-and-drop/actions.ts +0 -48
  67. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +0 -222
  68. package/src/pm-plugins/drag-and-drop/commands.ts +0 -194
  69. package/src/pm-plugins/drag-and-drop/consts.ts +0 -7
  70. package/src/pm-plugins/drag-and-drop/plugin-factory.ts +0 -33
  71. package/src/pm-plugins/drag-and-drop/plugin-key.ts +0 -5
  72. package/src/pm-plugins/drag-and-drop/plugin.ts +0 -398
  73. package/src/pm-plugins/drag-and-drop/reducer.ts +0 -38
  74. package/src/pm-plugins/drag-and-drop/types.ts +0 -18
  75. package/src/pm-plugins/drag-and-drop/utils/autoscrollers.ts +0 -49
  76. package/src/pm-plugins/drag-and-drop/utils/getDragBehaviour.ts +0 -9
  77. package/src/pm-plugins/drag-and-drop/utils/monitor.ts +0 -73
  78. package/src/pm-plugins/handlers.ts +0 -161
  79. package/src/pm-plugins/keymap.ts +0 -436
  80. package/src/pm-plugins/main.ts +0 -433
  81. package/src/pm-plugins/plugin-factory.ts +0 -42
  82. package/src/pm-plugins/plugin-key.ts +0 -8
  83. package/src/pm-plugins/reducer.ts +0 -145
  84. package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -102
  85. package/src/pm-plugins/sticky-headers/commands.ts +0 -8
  86. package/src/pm-plugins/sticky-headers/plugin-key.ts +0 -5
  87. package/src/pm-plugins/sticky-headers/plugin-state.ts +0 -52
  88. package/src/pm-plugins/sticky-headers/plugin.ts +0 -12
  89. package/src/pm-plugins/sticky-headers/types.ts +0 -20
  90. package/src/pm-plugins/sticky-headers/util.ts +0 -18
  91. package/src/pm-plugins/table-analytics.ts +0 -100
  92. package/src/pm-plugins/table-local-id.ts +0 -213
  93. package/src/pm-plugins/table-resizing/commands.ts +0 -116
  94. package/src/pm-plugins/table-resizing/event-handlers.ts +0 -352
  95. package/src/pm-plugins/table-resizing/plugin-factory.ts +0 -29
  96. package/src/pm-plugins/table-resizing/plugin-key.ts +0 -5
  97. package/src/pm-plugins/table-resizing/plugin.ts +0 -94
  98. package/src/pm-plugins/table-resizing/reducer.ts +0 -37
  99. package/src/pm-plugins/table-resizing/utils/colgroup.ts +0 -306
  100. package/src/pm-plugins/table-resizing/utils/column-state.ts +0 -120
  101. package/src/pm-plugins/table-resizing/utils/consts.ts +0 -11
  102. package/src/pm-plugins/table-resizing/utils/content-width.ts +0 -118
  103. package/src/pm-plugins/table-resizing/utils/dom.ts +0 -132
  104. package/src/pm-plugins/table-resizing/utils/misc.ts +0 -282
  105. package/src/pm-plugins/table-resizing/utils/resize-column.ts +0 -34
  106. package/src/pm-plugins/table-resizing/utils/resize-logic.ts +0 -289
  107. package/src/pm-plugins/table-resizing/utils/resize-state.ts +0 -417
  108. package/src/pm-plugins/table-resizing/utils/scale-table.ts +0 -290
  109. package/src/pm-plugins/table-resizing/utils/types.ts +0 -25
  110. package/src/pm-plugins/table-resizing/utils/unit-to-number.ts +0 -1
  111. package/src/pm-plugins/table-selection-keymap.ts +0 -64
  112. package/src/pm-plugins/table-size-selector.ts +0 -39
  113. package/src/pm-plugins/table-width-in-comment-fix.ts +0 -113
  114. package/src/pm-plugins/table-width.ts +0 -153
  115. package/src/pm-plugins/transforms/column-width.ts +0 -249
  116. package/src/pm-plugins/transforms/delete-columns.ts +0 -281
  117. package/src/pm-plugins/transforms/delete-rows.ts +0 -154
  118. package/src/pm-plugins/transforms/fix-tables.ts +0 -249
  119. package/src/pm-plugins/transforms/merge.ts +0 -301
  120. package/src/pm-plugins/transforms/replace-table.ts +0 -38
  121. package/src/pm-plugins/transforms/split.ts +0 -90
  122. package/src/pm-plugins/utils/alignment.ts +0 -33
  123. package/src/pm-plugins/utils/analytics.ts +0 -238
  124. package/src/pm-plugins/utils/collapse.ts +0 -93
  125. package/src/pm-plugins/utils/column-controls.ts +0 -250
  126. package/src/pm-plugins/utils/create.ts +0 -64
  127. package/src/pm-plugins/utils/decoration.ts +0 -672
  128. package/src/pm-plugins/utils/dom.ts +0 -251
  129. package/src/pm-plugins/utils/drag-menu.tsx +0 -491
  130. package/src/pm-plugins/utils/get-allow-add-column-custom-step.ts +0 -10
  131. package/src/pm-plugins/utils/guidelines.ts +0 -30
  132. package/src/pm-plugins/utils/merged-cells.ts +0 -239
  133. package/src/pm-plugins/utils/nodes.ts +0 -162
  134. package/src/pm-plugins/utils/paste.ts +0 -386
  135. package/src/pm-plugins/utils/row-controls.ts +0 -211
  136. package/src/pm-plugins/utils/selection.ts +0 -17
  137. package/src/pm-plugins/utils/snapping.ts +0 -136
  138. package/src/pm-plugins/utils/table.ts +0 -60
  139. package/src/pm-plugins/utils/update-plugin-state-decorations.ts +0 -13
  140. package/src/pm-plugins/view-mode-sort/consts.ts +0 -3
  141. package/src/pm-plugins/view-mode-sort/index.ts +0 -291
  142. package/src/pm-plugins/view-mode-sort/plugin-key.ts +0 -7
  143. package/src/pm-plugins/view-mode-sort/types.ts +0 -23
  144. package/src/pm-plugins/view-mode-sort/utils.ts +0 -136
  145. package/src/tablePlugin.tsx +0 -971
  146. package/src/tablePluginType.ts +0 -102
  147. package/src/types/index.ts +0 -592
  148. package/src/ui/ColumnResizeWidget/index.tsx +0 -61
  149. package/src/ui/ContentComponent.tsx +0 -311
  150. package/src/ui/DragHandle/HandleIconComponent.tsx +0 -21
  151. package/src/ui/DragHandle/index.tsx +0 -391
  152. package/src/ui/DragPreview/index.tsx +0 -51
  153. package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +0 -59
  154. package/src/ui/FloatingContextualButton/FixedButton.tsx +0 -203
  155. package/src/ui/FloatingContextualButton/index.tsx +0 -168
  156. package/src/ui/FloatingContextualButton/styles.ts +0 -69
  157. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +0 -931
  158. package/src/ui/FloatingContextualMenu/index.tsx +0 -141
  159. package/src/ui/FloatingContextualMenu/styles.ts +0 -77
  160. package/src/ui/FloatingDeleteButton/DeleteButton.tsx +0 -54
  161. package/src/ui/FloatingDeleteButton/getPopUpOptions.ts +0 -65
  162. package/src/ui/FloatingDeleteButton/index.tsx +0 -383
  163. package/src/ui/FloatingDeleteButton/types.ts +0 -3
  164. package/src/ui/FloatingDragMenu/DragMenu.tsx +0 -668
  165. package/src/ui/FloatingDragMenu/DropdownMenu.tsx +0 -221
  166. package/src/ui/FloatingDragMenu/index.tsx +0 -136
  167. package/src/ui/FloatingDragMenu/styles.ts +0 -83
  168. package/src/ui/FloatingInsertButton/InsertButton.tsx +0 -263
  169. package/src/ui/FloatingInsertButton/getPopupOptions.ts +0 -131
  170. package/src/ui/FloatingInsertButton/index.tsx +0 -314
  171. package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +0 -31
  172. package/src/ui/SizeSelector/index.tsx +0 -74
  173. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +0 -397
  174. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +0 -105
  175. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +0 -63
  176. package/src/ui/TableFloatingColumnControls/index.tsx +0 -151
  177. package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +0 -106
  178. package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +0 -143
  179. package/src/ui/TableFloatingControls/CornerControls/types.ts +0 -12
  180. package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +0 -88
  181. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +0 -150
  182. package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +0 -131
  183. package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +0 -429
  184. package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +0 -96
  185. package/src/ui/TableFloatingControls/index.tsx +0 -275
  186. package/src/ui/TableFullWidthLabel/index.tsx +0 -38
  187. package/src/ui/common-styles.ts +0 -1218
  188. package/src/ui/consts.ts +0 -109
  189. package/src/ui/event-handlers.ts +0 -662
  190. package/src/ui/global-styles.tsx +0 -55
  191. package/src/ui/hooks/useInternalTablePluginStateSelector.ts +0 -38
  192. package/src/ui/icons/AddColLeftIcon.tsx +0 -37
  193. package/src/ui/icons/AddColRightIcon.tsx +0 -37
  194. package/src/ui/icons/AddRowAboveIcon.tsx +0 -22
  195. package/src/ui/icons/AddRowBelowIcon.tsx +0 -39
  196. package/src/ui/icons/DragHandleDisabledIcon.tsx +0 -25
  197. package/src/ui/icons/DragHandleIcon.tsx +0 -16
  198. package/src/ui/icons/DragInMotionIcon.tsx +0 -54
  199. package/src/ui/icons/MergeCellsIcon.tsx +0 -26
  200. package/src/ui/icons/MinimisedHandle.tsx +0 -15
  201. package/src/ui/icons/SortingIconWrapper.tsx +0 -43
  202. package/src/ui/icons/SplitCellIcon.tsx +0 -34
  203. package/src/ui/toolbar.tsx +0 -1153
  204. package/src/ui/ui-styles.ts +0 -960
  205. package/tsconfig.app.json +0 -135
  206. package/tsconfig.dev.json +0 -54
  207. package/tsconfig.json +0 -18
@@ -1,1218 +0,0 @@
1
- /* eslint-disable @atlaskit/editor/no-re-export */
2
- // Entry file in package.json
3
-
4
- /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css } from '@emotion/react';
8
-
9
- import { browser } from '@atlaskit/editor-common/browser';
10
- import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
11
- import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
12
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
13
- import {
14
- akEditorSelectedNodeClassName,
15
- akEditorSmallZIndex,
16
- akEditorStickyHeaderZIndex,
17
- akEditorTableCellOnStickyHeaderZIndex,
18
- akEditorTableNumberColumnWidth,
19
- akEditorTableToolbarSize,
20
- akEditorUnitZIndex,
21
- getSelectionStyles,
22
- MAX_BROWSER_SCROLLBAR_HEIGHT,
23
- relativeFontSizeToBase16,
24
- SelectionStyle,
25
- } from '@atlaskit/editor-shared-styles';
26
- import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
27
- import { fg } from '@atlaskit/platform-feature-flags';
28
- import { N0, N40A, R500 } from '@atlaskit/theme/colors';
29
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
30
- import { token } from '@atlaskit/tokens';
31
-
32
- import { SORTING_ICON_CLASS_NAME } from '../pm-plugins/view-mode-sort/consts';
33
- import { TableCssClassName as ClassName } from '../types';
34
-
35
- import {
36
- columnControlsDecorationHeight,
37
- resizeHandlerAreaWidth,
38
- resizeHandlerZIndex,
39
- resizeLineWidth,
40
- rowControlsZIndex,
41
- stickyHeaderBorderBottomWidth,
42
- stickyRowOffsetTop,
43
- tableBorderColor,
44
- tableBorderDeleteColor,
45
- tableBorderRadiusSize,
46
- tableBorderSelectedColor,
47
- tableCellBackgroundColor,
48
- tableCellDeleteColor,
49
- tableCellSelectedColor,
50
- tableControlsSpacing,
51
- tableHeaderCellBackgroundColor,
52
- tableInsertColumnButtonSize,
53
- tableOverflowShadowWidth,
54
- tablePadding,
55
- tableScrollbarOffset,
56
- tableTextColor,
57
- tableToolbarDeleteColor,
58
- tableToolbarSelectedColor,
59
- tableToolbarSize,
60
- } from './consts';
61
- import {
62
- columnControlsDecoration,
63
- columnControlsLineMarker,
64
- DeleteButton,
65
- dragCornerControlButton,
66
- dragInsertButtonWrapper,
67
- floatingColumnControls,
68
- HeaderButton,
69
- HeaderButtonDanger,
70
- HeaderButtonHover,
71
- hoveredCell,
72
- hoveredDeleteButton,
73
- hoveredWarningCell,
74
- insertColumnButtonWrapper,
75
- insertLine,
76
- InsertMarker,
77
- insertRowButtonWrapper,
78
- OverflowShadow,
79
- resizeHandle,
80
- rowControlsWrapperDotStyle,
81
- } from './ui-styles';
82
-
83
- const cornerControlHeight = tableToolbarSize + 1;
84
-
85
- /*
86
- compensating for half of the insert column button
87
- that is aligned to the right edge initially on hover of the top right column control when table overflown,
88
- its center should be aligned with the edge
89
- */
90
- export const insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
91
- export const tableRowHeight = 44;
92
-
93
- const rangeSelectionStyles = `
94
- .${ClassName.NODEVIEW_WRAPPER}.${akEditorSelectedNodeClassName} table tbody tr {
95
- th,td {
96
- ${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border])}
97
-
98
- // The non-break space /00a0 in :after selector caused a table scroll issue when pressing Cmd+A to select table
99
- // This line is to override the content of :after selector from the shared getSelectionStyles
100
- &::after {
101
- content: '';
102
- }
103
- }
104
- }
105
- `;
106
-
107
- const sentinelStyles = `.${ClassName.TABLE_CONTAINER} {
108
- > .${ClassName.TABLE_STICKY_SENTINEL_TOP}, > .${ClassName.TABLE_STICKY_SENTINEL_BOTTOM} {
109
- position: absolute;
110
- width: 100%;
111
- height: 1px;
112
- margin-top: -1px;
113
- // need this to avoid sentinel being focused via keyboard
114
- // this still allows it to be detected by intersection observer
115
- visibility: hidden;
116
- }
117
- > .${ClassName.TABLE_STICKY_SENTINEL_TOP} {
118
- top: ${columnControlsDecorationHeight}px;
119
- }
120
- > .${ClassName.TABLE_STICKY_SENTINEL_BOTTOM} {
121
- bottom: ${tableScrollbarOffset + stickyRowOffsetTop + tablePadding * 2 + 23}px;
122
- }
123
- &.${ClassName.WITH_CONTROLS} {
124
- > .${ClassName.TABLE_STICKY_SENTINEL_TOP} {
125
- top: 0px;
126
- }
127
- > .${ClassName.TABLE_STICKY_SENTINEL_BOTTOM} {
128
- margin-bottom: ${columnControlsDecorationHeight}px;
129
- }
130
- }
131
- }`;
132
-
133
- const stickyScrollbarSentinelStyles = `.${ClassName.TABLE_CONTAINER} {
134
- > .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM},
135
- > .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
136
- position: absolute;
137
- width: 100%;
138
- height: 1px;
139
- margin-top: -1px;
140
- // need this to avoid sentinel being focused via keyboard
141
- // this still allows it to be detected by intersection observer
142
- visibility: hidden;
143
- }
144
- > .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
145
- top: ${columnControlsDecorationHeight + tableRowHeight * 3}px;
146
- }
147
- > .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM} {
148
- bottom: ${MAX_BROWSER_SCROLLBAR_HEIGHT}px;
149
- }
150
- }`;
151
-
152
- const stickyScrollbarContainerStyles = `.${ClassName.TABLE_CONTAINER} {
153
- > .${ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER} {
154
- width: 100%;
155
- display: none;
156
- overflow-x: auto;
157
- position: sticky;
158
- bottom: 0;
159
- z-index: 1;
160
- }
161
- }`;
162
-
163
- const stickyScrollbarStyles = `${stickyScrollbarContainerStyles} ${stickyScrollbarSentinelStyles}`;
164
-
165
- const shadowSentinelStyles = `
166
- .${ClassName.TABLE_SHADOW_SENTINEL_LEFT},
167
- .${ClassName.TABLE_SHADOW_SENTINEL_RIGHT} {
168
- position: absolute;
169
- top: 0;
170
- height: 100%;
171
- width: 1px;
172
- visibility: hidden;
173
- }
174
- .${ClassName.TABLE_SHADOW_SENTINEL_LEFT} {
175
- left: 0;
176
- }
177
- .${ClassName.TABLE_SHADOW_SENTINEL_RIGHT} {
178
- right: 0;
179
- }
180
- `;
181
-
182
- const breakoutWidthStyling = () => {
183
- return css`
184
- > *:not([data-mark-type='fragment'])
185
- .${ClassName.NODEVIEW_WRAPPER}
186
- .${ClassName.TABLE_CONTAINER} {
187
- margin-left: unset !important;
188
- width: 100% !important;
189
- }
190
-
191
- > [data-mark-type='fragment'] * .${ClassName.NODEVIEW_WRAPPER} .${ClassName.TABLE_CONTAINER} {
192
- margin-left: unset !important;
193
- width: 100% !important;
194
- }
195
- `;
196
- };
197
-
198
- const viewModeSortStyles = () => {
199
- return css`
200
- /* new styles */
201
- th {
202
- .${SORTING_ICON_CLASS_NAME} {
203
- + p {
204
- margin-top: 0 !important;
205
- }
206
- }
207
-
208
- > .${SORTING_ICON_CLASS_NAME} {
209
- &:has(.is-active) {
210
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
211
- opacity: 1;
212
- }
213
- }
214
- }
215
-
216
- > .${SORTING_ICON_CLASS_NAME} {
217
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
218
- opacity: 0;
219
- &:focus {
220
- opacity: 1;
221
- }
222
- }
223
- }
224
-
225
- &:hover:not(:has(.${ClassName.TABLE_CONTAINER}:hover)) {
226
- > .${SORTING_ICON_CLASS_NAME} {
227
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
228
- opacity: 1;
229
- }
230
- }
231
- }
232
- }
233
- `;
234
- };
235
-
236
- const tableBorderStyles = () => {
237
- return `border-color: ${tableBorderDeleteColor}`;
238
- };
239
-
240
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
241
- const tableStickyHeaderColumnControlsDecorationsStyle = () => {
242
- return css`
243
- .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
244
- z-index: 0;
245
- left: -1px;
246
- }
247
-
248
- .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
249
- border-left: 1px solid ${tableBorderColor};
250
- }
251
-
252
- .${ClassName.TABLE_STICKY} tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
253
- &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
254
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
255
- left: 0;
256
- }
257
- }
258
- }
259
- `;
260
- };
261
-
262
- const tableStickyHeaderFirefoxFixStyle = () => {
263
- /*
264
- This is MAGIC!
265
- This fixes a bug which occurs in firefox when the first row becomes sticky.
266
- see https://product-fabric.atlassian.net/browse/ED-19177
267
- */
268
- if (browser.gecko) {
269
- return css`
270
- .${ClassName.TABLE_STICKY} > tbody::before {
271
- content: '';
272
- }
273
- `;
274
- }
275
- };
276
-
277
- // re-exporting these styles to use in Gemini test when table node view is rendered outside of PM
278
- export const baseTableStyles = (props: {
279
- featureFlags?: FeatureFlags;
280
- isDragAndDropEnabled?: boolean;
281
- }) => css`
282
- ${tableSharedStyle()};
283
- ${columnControlsLineMarker()};
284
- ${hoveredDeleteButton()};
285
- ${hoveredCell()};
286
- ${hoveredWarningCell};
287
- ${insertLine()};
288
- ${resizeHandle()};
289
- ${rangeSelectionStyles};
290
- ${viewModeSortStyles()};
291
-
292
- .${ClassName.LAST_ITEM_IN_CELL} {
293
- margin-bottom: 0;
294
- }
295
-
296
- .${ClassName.TABLE_NODE_WRAPPER} {
297
- td.${ClassName.TABLE_CELL}, th.${ClassName.TABLE_HEADER_CELL} {
298
- position: relative;
299
- overflow: visible;
300
- }
301
-
302
- td.${ClassName.TABLE_CELL} {
303
- background-color: ${tableCellBackgroundColor};
304
-
305
- &::after {
306
- height: 100%;
307
- content: '';
308
- border-left: 1px solid ${tableBorderColor};
309
- border-bottom: 1px solid ${tableBorderColor};
310
- position: absolute;
311
- right: 0px;
312
- top: 0px;
313
- bottom: 0;
314
- width: 100%;
315
- display: inline-block;
316
- pointer-events: none;
317
- }
318
- }
319
- }
320
-
321
- .${ClassName.CONTROLS_FLOATING_BUTTON_COLUMN} {
322
- ${insertColumnButtonWrapper()}
323
- }
324
-
325
- .${ClassName.CONTROLS_FLOATING_BUTTON_ROW} {
326
- ${insertRowButtonWrapper()}
327
- }
328
-
329
- ${dragInsertButtonWrapper()}
330
-
331
- ${dragCornerControlButton()}
332
-
333
- /* Delete button */
334
- ${DeleteButton()}
335
- /* Ends Delete button */
336
-
337
- /* sticky styles */
338
- ${fg('platform_editor_nested_tables_sticky_header_bug')
339
- ? `
340
- ${
341
- fg('platform_editor_number_column_sticky_header_broken')
342
- ? `.${ClassName.TABLE_STICKY} > .${props.isDragAndDropEnabled ? ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER} .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {`
343
- : `.${ClassName.TABLE_STICKY} > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {`
344
- }
345
- margin-top: ${
346
- fg('platform_editor_number_column_sticky_header_bug')
347
- ? stickyRowOffsetTop
348
- : stickyRowOffsetTop + 2
349
- }px;
350
- width: ${akEditorTableNumberColumnWidth}px;
351
-
352
- position: fixed !important;
353
- z-index: ${akEditorStickyHeaderZIndex} !important;
354
- box-shadow: 0px -${stickyRowOffsetTop}px ${token('elevation.surface', 'white')};
355
- border-right: 0 none;
356
- /* top set by NumberColumn component */
357
- }
358
- `
359
- : `
360
- .${ClassName.TABLE_STICKY} .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
361
- margin-top: ${
362
- fg('platform_editor_number_column_sticky_header_bug')
363
- ? stickyRowOffsetTop
364
- : stickyRowOffsetTop + 2
365
- }px;
366
- width: ${akEditorTableNumberColumnWidth}px;
367
-
368
- position: fixed !important;
369
- z-index: ${akEditorStickyHeaderZIndex} !important;
370
- box-shadow: 0px -${stickyRowOffsetTop}px ${token('elevation.surface', 'white')};
371
- border-right: 0 none;
372
- /* top set by NumberColumn component */
373
- }
374
- `}
375
-
376
- .${ClassName.TABLE_STICKY} .${ClassName.CORNER_CONTROLS}.sticky {
377
- position: fixed !important;
378
- /* needs to be above row controls */
379
- z-index: ${akEditorSmallZIndex} !important;
380
- background: ${token('elevation.surface', 'white')};
381
-
382
- width: ${tableToolbarSize}px;
383
- height: ${tableToolbarSize}px;
384
- }
385
-
386
- .${ClassName.CORNER_CONTROLS}.sticky .${ClassName.CONTROLS_CORNER_BUTTON} {
387
- border-bottom: 0px none;
388
- border-right: 0px none;
389
-
390
- height: ${tableToolbarSize}px;
391
- width: ${tableToolbarSize}px;
392
- }
393
-
394
- ${tableStickyHeaderColumnControlsDecorationsStyle()}
395
-
396
- ${tableStickyHeaderFirefoxFixStyle()}
397
-
398
- .${ClassName.TABLE_STICKY}
399
- .${ClassName.ROW_CONTROLS}
400
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}.sticky {
401
- position: fixed !important;
402
- z-index: ${akEditorStickyHeaderZIndex} !important;
403
- display: flex;
404
- border-left: ${tableToolbarSize}px solid ${token('elevation.surface', 'white')};
405
- margin-left: -${tableToolbarSize}px;
406
- }
407
-
408
- .${ClassName.TABLE_STICKY} col:first-of-type {
409
- /* moving rows out of a table layout does weird things in Chrome */
410
- border-right: 1px solid ${token('elevation.surface', 'green')};
411
- }
412
-
413
- tr.sticky {
414
- padding-top: ${stickyRowOffsetTop}px;
415
- position: fixed;
416
- display: grid;
417
-
418
- /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */
419
- z-index: ${akEditorTableCellOnStickyHeaderZIndex - 5};
420
-
421
- overflow-y: visible;
422
- overflow-x: hidden;
423
-
424
- grid-auto-flow: column;
425
-
426
- /* background for where controls apply */
427
- background: ${token('elevation.surface', 'white')};
428
- box-sizing: content-box;
429
- box-shadow: 0 6px 4px -4px ${token('elevation.shadow.overflow.perimeter', N40A)};
430
- margin-left: -1px;
431
-
432
- &.no-pointer-events {
433
- pointer-events: none;
434
- }
435
- }
436
-
437
- .${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
438
- left: unset;
439
- position: fixed;
440
- /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */
441
- z-index: ${akEditorTableCellOnStickyHeaderZIndex};
442
- }
443
-
444
- .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
445
- padding-bottom: ${tableToolbarSize}px;
446
- }
447
-
448
- .tableView-content-wrap:has(.tableView-content-wrap):has(
449
- .${ClassName.NESTED_TABLE_WITH_CONTROLS}
450
- ) {
451
- padding-left: unset;
452
- }
453
-
454
- .tableView-content-wrap:has(.${ClassName.NESTED_TABLE_WITH_CONTROLS}) {
455
- padding-left: 15px;
456
- }
457
-
458
- tr.sticky th {
459
- border-bottom: ${stickyHeaderBorderBottomWidth}px solid ${tableBorderColor};
460
- margin-right: -1px;
461
- }
462
-
463
- .${ClassName.TABLE_STICKY} tr.sticky > th:last-child {
464
- border-right-width: 1px;
465
- }
466
-
467
- /* add left edge for first cell */
468
- .${ClassName.TABLE_STICKY} tr.sticky > th:first-of-type {
469
- margin-left: 0px;
470
- }
471
-
472
- /* add a little bit so the scroll lines up with the table */
473
- .${ClassName.TABLE_STICKY} tr.sticky::after {
474
- content: ' ';
475
- width: ${insertColumnButtonOffset + 1}px;
476
- }
477
-
478
- /* To fix jumpiness caused in Chrome Browsers for sticky headers */
479
- .${ClassName.TABLE_STICKY} .sticky + tr {
480
- min-height: 0px;
481
- }
482
-
483
- /* move resize line a little in sticky bar */
484
- .${ClassName.TABLE_CONTAINER}.${ClassName.TABLE_STICKY} {
485
- tr.sticky td.${ClassName.WITH_RESIZE_LINE}, tr.sticky th.${ClassName.WITH_RESIZE_LINE} {
486
- .${ClassName.RESIZE_HANDLE_DECORATION}::after {
487
- right: ${(resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1}px;
488
- }
489
- }
490
-
491
- /* when selected put it back to normal -- :not selector would be nicer */
492
- tr.sticky
493
- td.${ClassName.WITH_RESIZE_LINE}.${ClassName.SELECTED_CELL},
494
- tr.sticky
495
- th.${ClassName.WITH_RESIZE_LINE}.${ClassName.SELECTED_CELL} {
496
- .${ClassName.RESIZE_HANDLE_DECORATION}::after {
497
- right: ${(resizeHandlerAreaWidth - resizeLineWidth) / 2}px;
498
- }
499
- }
500
- }
501
-
502
- tr.sticky .${ClassName.HOVERED_CELL}, tr.sticky .${ClassName.SELECTED_CELL} {
503
- z-index: 1;
504
- }
505
-
506
- .${ClassName.WITH_CONTROLS} tr.sticky {
507
- padding-top: ${tableControlsSpacing}px;
508
- }
509
-
510
- ${fg('platform_editor_nested_tables_sticky_header_bug')
511
- ? `
512
- .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY} > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
513
- .${ClassName.NUMBERED_COLUMN}
514
- .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
515
- margin-top: ${
516
- fg('platform_editor_number_column_sticky_header_bug')
517
- ? tableControlsSpacing
518
- : tableControlsSpacing + 2
519
- }px;
520
- }
521
- `
522
- : `
523
- .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY}
524
- .${ClassName.NUMBERED_COLUMN}
525
- .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
526
- margin-top: ${
527
- fg('platform_editor_number_column_sticky_header_bug')
528
- ? tableControlsSpacing
529
- : tableControlsSpacing + 2
530
- }px;
531
- }
532
- `}
533
-
534
- .${ClassName.CORNER_CONTROLS}.sticky {
535
- border-top: ${fg('platform_editor_number_column_sticky_header_bug')
536
- ? tableControlsSpacing - tableToolbarSize
537
- : tableControlsSpacing - tableToolbarSize + 2}px
538
- solid ${token('elevation.surface', 'white')};
539
- }
540
-
541
- ${sentinelStyles}
542
- ${OverflowShadow(props.featureFlags?.tableDragAndDrop)}
543
- ${stickyScrollbarStyles}
544
-
545
- .${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
546
- height: 0; /* stop overflow flash & set correct height in update-overflow-shadows.ts */
547
- }
548
-
549
- .less-padding {
550
- padding: 0 ${tablePadding}px;
551
-
552
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}, .${ClassName.ROW_CONTROLS_WRAPPER} {
553
- padding: 0 ${tablePadding}px;
554
-
555
- /* https://product-fabric.atlassian.net/browse/ED-16386
556
- Fixes issue where the extra padding that is added here throws off the position
557
- of the rows control dot */
558
- &::after {
559
- right: 6px !important;
560
- }
561
- }
562
-
563
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_CHROMELESS} {
564
- left: -4px;
565
- }
566
-
567
- .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
568
- padding: 0 ${tablePadding}px;
569
- }
570
-
571
- .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER}.${ClassName.TABLE_CHROMELESS} {
572
- left: -8px;
573
- }
574
-
575
- &.${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
576
- padding-left: ${akEditorTableNumberColumnWidth + tablePadding - 1}px;
577
- }
578
- .${ClassName.TABLE_LEFT_SHADOW}, .${ClassName.TABLE_RIGHT_SHADOW} {
579
- width: ${tableOverflowShadowWidth}px;
580
- }
581
-
582
- .${ClassName.TABLE_LEFT_SHADOW} {
583
- left: 6px;
584
- }
585
- .${ClassName.TABLE_LEFT_SHADOW}.${ClassName.TABLE_CHROMELESS} {
586
- left: 8px;
587
- }
588
-
589
- .${ClassName.TABLE_RIGHT_SHADOW} {
590
- left: calc(100% - 6px);
591
- }
592
- .${ClassName.TABLE_RIGHT_SHADOW}.${ClassName.TABLE_CHROMELESS} {
593
- left: calc(100% - 16px);
594
- }
595
- }
596
-
597
- > .${ClassName.NODEVIEW_WRAPPER} {
598
- /**
599
- * Prevent margins collapsing, aids with placing the gap-cursor correctly
600
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing
601
- *
602
- * TODO: Enable this, many tests will fail!
603
- * border-top: 1px solid transparent;
604
- */
605
- }
606
-
607
- /* Breakout only works on top level unless wrapped in fragment mark */
608
- ${breakoutWidthStyling()}
609
-
610
- ${columnControlsDecoration()};
611
- ${rowControlsWrapperDotStyle()};
612
-
613
- /* Corner controls */
614
- .${ClassName.CORNER_CONTROLS} {
615
- width: ${tableToolbarSize + 1}px;
616
- height: ${cornerControlHeight}px;
617
- display: none;
618
-
619
- .${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
620
- position: relative;
621
-
622
- ${InsertMarker(
623
- `
624
- left: -11px;
625
- top: 9px;
626
- `,
627
- )};
628
- }
629
- }
630
-
631
- .${ClassName.CORNER_CONTROLS}.sticky {
632
- .${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
633
- /* sticky row insert dot overlaps other row insert and messes things up */
634
- display: none !important;
635
- }
636
- }
637
-
638
- .${ClassName.CONTROLS_CORNER_BUTTON} {
639
- position: absolute;
640
- top: 0;
641
- width: ${tableToolbarSize + 1}px;
642
- height: ${tableToolbarSize + 1}px;
643
- border: 1px solid ${tableBorderColor};
644
- border-radius: 0;
645
- border-top-left-radius: ${tableBorderRadiusSize}px;
646
- background: ${tableHeaderCellBackgroundColor};
647
- box-sizing: border-box;
648
- padding: 0;
649
- :focus {
650
- outline: none;
651
- }
652
- }
653
- .active .${ClassName.CONTROLS_CORNER_BUTTON} {
654
- border-color: ${tableBorderSelectedColor};
655
- background: ${tableToolbarSelectedColor};
656
- }
657
-
658
- .${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
659
- .${ClassName.CORNER_CONTROLS}, .${ClassName.CONTROLS_CORNER_BUTTON} {
660
- width: ${akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1}px;
661
- }
662
- .${ClassName.ROW_CONTROLS} .${ClassName.CONTROLS_BUTTON} {
663
- border-right-width: 0;
664
- }
665
- }
666
-
667
- :not(.${ClassName.IS_RESIZING}) .${ClassName.CONTROLS_CORNER_BUTTON}:hover {
668
- border-color: ${tableBorderSelectedColor};
669
- background: ${tableToolbarSelectedColor};
670
- cursor: pointer;
671
- }
672
-
673
- :not(.${ClassName.IS_RESIZING})
674
- .${ClassName.CONTROLS_CORNER_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
675
- border-color: ${tableBorderDeleteColor};
676
- background: ${tableToolbarDeleteColor};
677
- }
678
-
679
- /* Row controls */
680
- .${ClassName.ROW_CONTROLS} {
681
- width: ${tableToolbarSize}px;
682
- box-sizing: border-box;
683
- display: none;
684
- position: relative;
685
-
686
- ${InsertMarker(
687
- `
688
- bottom: -1px;
689
- left: -11px;
690
- `,
691
- )};
692
-
693
- .${ClassName.ROW_CONTROLS_INNER} {
694
- display: flex;
695
- flex-direction: column;
696
- }
697
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}:last-child > button {
698
- border-bottom-left-radius: ${tableBorderRadiusSize}px;
699
- }
700
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP} {
701
- position: relative;
702
- margin-top: -1px;
703
- }
704
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}:hover,
705
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}.active,
706
- .${ClassName.CONTROLS_BUTTON}:hover {
707
- z-index: ${akEditorUnitZIndex};
708
- }
709
-
710
- ${HeaderButton(
711
- `
712
- border-bottom: 1px solid ${tableBorderColor};
713
- border-right: 0px;
714
- border-radius: 0;
715
- height: 100%;
716
- width: ${tableToolbarSize}px;
717
-
718
- .${ClassName.CONTROLS_BUTTON_OVERLAY} {
719
- position: absolute;
720
- width: 30px;
721
- height: 50%;
722
- right: 0;
723
- bottom: 0;
724
- }
725
- .${ClassName.CONTROLS_BUTTON_OVERLAY}:first-of-type {
726
- top: 0;
727
- }
728
- `,
729
- )}
730
- }
731
-
732
- .${ClassName.DRAG_ROW_CONTROLS} {
733
- display: grid;
734
- align-items: center;
735
- position: absolute;
736
- z-index: ${fg('platform_editor_table_column_selected_state_fix')
737
- ? rowControlsZIndex + 4
738
- : akEditorUnitZIndex};
739
-
740
- .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER} {
741
- position: absolute;
742
- align-self: end;
743
- height: 100%;
744
- width: 18px;
745
- }
746
-
747
- .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT} {
748
- position: absolute;
749
- bottom: -3px;
750
- left: 2px;
751
- background-color: ${token('color.background.accent.gray.subtler', '#C1C7D0')};
752
- height: 4px;
753
- width: 4px;
754
- border-radius: 50%;
755
- pointer-events: none;
756
- }
757
- }
758
-
759
- .${ClassName.DRAG_COLUMN_CONTROLS} {
760
- .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
761
- height: 24px;
762
- position: absolute;
763
- top: ${token('space.negative.150', '-12px')};
764
- z-index: ${resizeHandlerZIndex};
765
- }
766
-
767
- .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER} {
768
- position: absolute;
769
- height: 24px;
770
- width: 100%;
771
- }
772
-
773
- .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT} {
774
- background-color: ${token('color.background.accent.gray.subtler', '#C1C7D0')};
775
- height: 4px;
776
- width: 4px;
777
- border-radius: 50%;
778
- position: absolute;
779
- right: -2px;
780
- }
781
- }
782
-
783
- .${ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE} {
784
- background: none;
785
- border: none;
786
- outline: none;
787
- position: absolute;
788
- margin: 0;
789
- padding: 0;
790
- display: flex;
791
- align-items: center;
792
- cursor: pointer;
793
-
794
- :focus {
795
- outline: none;
796
- }
797
- }
798
-
799
- .${ClassName.DRAG_HANDLE_BUTTON_CONTAINER} {
800
- cursor: grab;
801
- pointer-events: auto;
802
-
803
- line-height: 0;
804
- padding: 0;
805
- border-radius: 6px;
806
- width: max-content;
807
- border: 2px solid ${token('elevation.surface', N0)};
808
-
809
- display: flex;
810
- justify-content: center;
811
- align-items: center;
812
- background: transparent;
813
- outline: none;
814
-
815
- &.placeholder {
816
- background-color: transparent;
817
- border: 2px solid transparent;
818
- }
819
-
820
- &.${ClassName.DRAG_HANDLE_DISABLED} {
821
- cursor: pointer;
822
- & svg {
823
- & > rect.${ClassName.DRAG_HANDLE_MINIMISED} {
824
- fill: ${token('color.background.accent.gray.subtler', '#DCDFE4')};
825
- }
826
- & > rect {
827
- fill: ${token('color.background.accent.gray.subtlest', '#F4F5F7')};
828
- }
829
- & > g > rect {
830
- fill: ${token('color.icon.disabled', '#BFDBF847')};
831
- }
832
- }
833
- }
834
-
835
- &:not(.${ClassName.DRAG_HANDLE_DISABLED}) {
836
- & svg {
837
- rect {
838
- fill: ${token('color.background.accent.gray.subtler', '#DCDFE4')};
839
- }
840
- g {
841
- fill: ${token('color.icon.subtle', '#626f86')};
842
- }
843
- }
844
-
845
- &:hover {
846
- svg {
847
- rect {
848
- fill: ${token('color.background.accent.blue.subtle', '#579DFF')};
849
- }
850
- g {
851
- fill: ${token('color.icon.inverse', '#FFF')};
852
- }
853
- }
854
- }
855
-
856
- &:active {
857
- cursor: grabbing;
858
- }
859
-
860
- &.selected {
861
- :focus {
862
- outline: 2px solid ${token('color.border.focused', '#2684FF')};
863
- outline-offset: 1px;
864
- }
865
-
866
- &:active {
867
- outline: none;
868
- }
869
-
870
- svg {
871
- rect {
872
- fill: ${token('color.background.accent.blue.subtle', '#579dff')};
873
- }
874
- g {
875
- fill: ${token('color.icon.inverse', '#fff')};
876
- }
877
- }
878
- }
879
-
880
- &.danger {
881
- svg {
882
- rect {
883
- fill: ${token('color.background.accent.red.subtler.pressed', '#F87462')};
884
- }
885
- g {
886
- fill: ${token('color.border.inverse', '#FFF')};
887
- }
888
- }
889
- }
890
- }
891
- }
892
-
893
- ${floatingColumnControls()}
894
-
895
- :not(.${ClassName.IS_RESIZING}) .${ClassName.ROW_CONTROLS} {
896
- ${HeaderButtonHover()}
897
- ${HeaderButtonDanger()}
898
- }
899
-
900
- /* Numbered column */
901
- .${ClassName.NUMBERED_COLUMN} {
902
- position: relative;
903
- float: right;
904
- margin-left: ${akEditorTableToolbarSize}px;
905
- top: ${(fg('platform_editor_number_column_sticky_header_broken')
906
- ? props.isDragAndDropEnabled
907
- : props.featureFlags?.tableDragAndDrop) ||
908
- editorExperiment('support_table_in_comment_jira', true)
909
- ? 0
910
- : akEditorTableToolbarSize}px;
911
- width: ${akEditorTableNumberColumnWidth + 1}px;
912
- box-sizing: border-box;
913
- }
914
-
915
- .${ClassName.NUMBERED_COLUMN_BUTTON} {
916
- border: 1px solid ${tableBorderColor};
917
- box-sizing: border-box;
918
- margin-top: -1px;
919
- padding-bottom: 2px;
920
- padding: 10px 2px;
921
- text-align: center;
922
- font-size: ${relativeFontSizeToBase16(14)};
923
- background-color: ${tableHeaderCellBackgroundColor};
924
- color: ${tableTextColor};
925
- border-color: ${tableBorderColor};
926
-
927
- :first-child:not(style),
928
- style:first-child + * {
929
- margin-top: 0;
930
- }
931
- :last-child {
932
- border-bottom: 1px solid ${tableBorderColor};
933
- }
934
- }
935
-
936
- /* add a background above the first numbered column cell when sticky header is engaged
937
- which hides the table when scrolling */
938
- ${fg('platform_editor_nested_tables_sticky_header_bug')
939
- ? `
940
- ${
941
- fg('platform_editor_number_column_sticky_header_broken')
942
- ? `.${ClassName.TABLE_STICKY} > .${props.isDragAndDropEnabled ? ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER} {
943
- .${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}:first-of-type::after {`
944
- : `.${ClassName.TABLE_STICKY} > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} {
945
- .${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}:first-of-type::after {`
946
- }
947
- content: '';
948
- display: block;
949
- height: 33px;
950
- width: 100%;
951
- background-color: ${token('elevation.surface', 'white')};
952
- position: absolute;
953
-
954
- /* the extra pixel is accounting for borders */
955
- top: -34px;
956
- left: -1px;
957
- }
958
- }
959
- `
960
- : `
961
- .${ClassName.TABLE_STICKY} {
962
- .${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}:first-of-type::after {
963
- content: '';
964
- display: block;
965
- height: 33px;
966
- width: 100%;
967
- background-color: ${token('elevation.surface', 'white')};
968
- position: absolute;
969
-
970
- /* the extra pixel is accounting for borders */
971
- top: -34px;
972
- left: -1px;
973
- }
974
- }
975
- `}
976
-
977
- .${ClassName.WITH_CONTROLS} {
978
- .${ClassName.CORNER_CONTROLS}, .${ClassName.ROW_CONTROLS} {
979
- display: block;
980
- }
981
- .${ClassName.NUMBERED_COLUMN} {
982
- padding-left: 0px;
983
-
984
- .${ClassName.NUMBERED_COLUMN_BUTTON} {
985
- border-left: 0 none;
986
- }
987
-
988
- .${ClassName.NUMBERED_COLUMN_BUTTON}.active {
989
- border-bottom: 1px solid ${tableBorderSelectedColor};
990
- border-color: ${tableBorderSelectedColor};
991
- background-color: ${tableToolbarSelectedColor};
992
- position: relative;
993
- z-index: ${akEditorUnitZIndex};
994
- color: ${token('color.text.selected', N0)};
995
- }
996
- }
997
-
998
- /* nested tables should be ignored when we apply border-left: 0 to the parent table */
999
- .${ClassName.TABLE_CONTAINER} {
1000
- .${ClassName.NUMBERED_COLUMN_BUTTON} {
1001
- border-left: 1px solid ${tableBorderColor};
1002
- }
1003
- }
1004
- }
1005
- :not(.${ClassName.IS_RESIZING}) .${ClassName.WITH_CONTROLS} {
1006
- .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}) {
1007
- cursor: pointer;
1008
- }
1009
- .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}):hover {
1010
- border-bottom: 1px solid ${tableBorderSelectedColor};
1011
- border-color: ${tableBorderSelectedColor};
1012
- background-color: ${tableToolbarSelectedColor};
1013
- position: relative;
1014
- z-index: ${akEditorUnitZIndex};
1015
- color: ${token('color.text.selected', N0)};
1016
- }
1017
- .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
1018
- background-color: ${tableToolbarDeleteColor};
1019
- border: 1px solid ${tableBorderDeleteColor};
1020
- border-left: 0;
1021
- color: ${token('color.text.danger', R500)};
1022
- position: relative;
1023
- z-index: ${akEditorUnitZIndex};
1024
- }
1025
- }
1026
-
1027
- /* Table */
1028
- .${ClassName.TABLE_NODE_WRAPPER} > table {
1029
- table-layout: fixed;
1030
- white-space: normal;
1031
- border-top: none;
1032
- /* 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212 */
1033
- margin-right: -1px;
1034
- /* Allows better positioning for the shadow sentinels - ED-16668 */
1035
- position: relative;
1036
-
1037
- > tbody > tr {
1038
- white-space: pre-wrap;
1039
- }
1040
-
1041
- .${ClassName.COLUMN_CONTROLS_DECORATIONS} + * {
1042
- margin-top: 0;
1043
- }
1044
-
1045
- /*
1046
- * Headings have a top margin by default, but we don't want this on the
1047
- * first heading within table header cells.
1048
- *
1049
- * This specifically sets margin-top for the first heading within a header
1050
- * cell when center/right aligned.
1051
- */
1052
- th.${ClassName.TABLE_HEADER_CELL} > .fabric-editor-block-mark {
1053
- > h1:first-of-type,
1054
- > h2:first-of-type,
1055
- > h3:first-of-type,
1056
- > h4:first-of-type,
1057
- > h5:first-of-type,
1058
- > h6:first-of-type {
1059
- margin-top: 0;
1060
- }
1061
- }
1062
-
1063
- .${ClassName.SELECTED_CELL}, .${ClassName.HOVERED_CELL_IN_DANGER} {
1064
- position: relative;
1065
- }
1066
- /* Give selected cells a blue overlay */
1067
- .${ClassName.SELECTED_CELL}::after, .${ClassName.HOVERED_CELL_IN_DANGER}::after {
1068
- z-index: ${akEditorSmallZIndex};
1069
- position: absolute;
1070
- content: '';
1071
- left: 0;
1072
- right: 0;
1073
- top: 0;
1074
- bottom: 0;
1075
- width: 100%;
1076
- pointer-events: none;
1077
- }
1078
- .${ClassName.SELECTED_CELL} {
1079
- border: 1px solid ${tableBorderSelectedColor};
1080
- }
1081
- .${ClassName.SELECTED_CELL}::after {
1082
- background: ${tableCellSelectedColor};
1083
- z-index: ${akEditorSmallZIndex};
1084
- }
1085
- th.${ClassName.HOVERED_CELL_IN_DANGER}::after, td.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1086
- background: ${tableCellDeleteColor};
1087
- z-index: ${akEditorUnitZIndex * 100};
1088
- }
1089
- td.${ClassName.HOVERED_CELL},
1090
- td.${ClassName.SELECTED_CELL},
1091
- th.${ClassName.TABLE_HEADER_CELL}.${ClassName.SELECTED_CELL},
1092
- th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL} {
1093
- &::after {
1094
- height: 100%;
1095
- width: 100%;
1096
- border: 1px solid ${tableBorderSelectedColor};
1097
- content: '';
1098
- position: absolute;
1099
- left: -1px;
1100
- top: -1px;
1101
- bottom: 0;
1102
- z-index: ${akEditorSmallZIndex};
1103
- display: inline-block;
1104
- pointer-events: none;
1105
- }
1106
- &.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1107
- ${tableBorderStyles()};
1108
- z-index: ${akEditorUnitZIndex * 100};
1109
- }
1110
-
1111
- &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1112
- ${tableBorderStyles()};
1113
- z-index: ${akEditorUnitZIndex * 100};
1114
- }
1115
- }
1116
- }
1117
-
1118
- /* override for DnD controls */
1119
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} {
1120
- position: absolute;
1121
- margin-top: ${tableMarginTop}px;
1122
- left: -${tableToolbarSize + 1}px;
1123
- ${fg('platform_editor_table_column_selected_state_fix')
1124
- ? ''
1125
- : `z-index: ${rowControlsZIndex + 4}`}
1126
- }
1127
-
1128
- .${ClassName.ROW_CONTROLS_WRAPPER} {
1129
- position: absolute;
1130
- /* this is to fix the misalignment of the numbered column in live page view mode */
1131
- ${props.isDragAndDropEnabled && fg('platform_editor_numbered_column_misalignment')
1132
- ? `
1133
- margin-top: ${tableMarginTop}px;
1134
- top: 0;
1135
- left: -${tableToolbarSize + 1}px;
1136
- `
1137
- : `
1138
- /* top of corner control is table margin top - corner control height + 1 pixel of table border. */
1139
- top: ${tableMarginTop - cornerControlHeight + 1}px;
1140
- margin-top: 0;
1141
- left: -${tableToolbarSize}px;
1142
- `}
1143
- }
1144
-
1145
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_LEFT_SHADOW},
1146
- .${ClassName.ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_LEFT_SHADOW} {
1147
- z-index: ${akEditorUnitZIndex};
1148
- }
1149
-
1150
- .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
1151
- position: absolute;
1152
- top: ${tableMarginTop}px;
1153
- }
1154
-
1155
- .${ClassName.TABLE_STICKY} .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
1156
- position: fixed;
1157
- /* higher zIndex than sticky header which is akEditorTableCellOnStickyHeaderZIndex - 5 */
1158
- z-index: ${akEditorTableCellOnStickyHeaderZIndex - 4};
1159
- }
1160
-
1161
- /* nested tables */
1162
- .${ClassName.TABLE_CONTAINER} {
1163
- .${ClassName.TABLE_STICKY} .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
1164
- position: absolute;
1165
- z-index: ${akEditorUnitZIndex};
1166
- }
1167
- }
1168
-
1169
- .${ClassName.TABLE_NODE_WRAPPER} {
1170
- padding-bottom: 0px;
1171
- /* fixes gap cursor height */
1172
- overflow: auto;
1173
- overflow-y: hidden;
1174
- position: relative;
1175
- }
1176
- `;
1177
-
1178
- // TODO: DSP-4139 - Remove this when we have a better solution for the table toolbar
1179
- export const tableStyles = (props: {
1180
- featureFlags?: FeatureFlags;
1181
- isDragAndDropEnabled?: boolean;
1182
- }) => css`
1183
- .ProseMirror {
1184
- ${baseTableStyles(props)}
1185
- }
1186
-
1187
- .ProseMirror.${ClassName.IS_RESIZING} {
1188
- .${ClassName.TABLE_NODE_WRAPPER} {
1189
- overflow-x: auto;
1190
- ${scrollbarStyles};
1191
- }
1192
- }
1193
-
1194
- .ProseMirror.${ClassName.RESIZE_CURSOR} {
1195
- cursor: col-resize;
1196
- }
1197
-
1198
- ${shadowSentinelStyles}
1199
- `;
1200
-
1201
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
1202
- export const tableFullPageEditorStyles = css`
1203
- .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
1204
- margin-left: 0;
1205
- /* 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212 */
1206
- margin-right: -1px;
1207
- width: 100%;
1208
- }
1209
- `;
1210
-
1211
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
1212
- export const tableCommentEditorStyles = css`
1213
- .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
1214
- margin-left: 0;
1215
- margin-right: 0;
1216
- ${scrollbarStyles};
1217
- }
1218
- `;