@atlaskit/editor-plugin-table 7.16.10 → 7.16.12

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