@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
@@ -109,54 +109,61 @@ const shadowSentinelStyles = `
109
109
  `;
110
110
  const breakoutWidthStyling = () => {
111
111
  return css`
112
- > *:not([data-mark-type='fragment'])
113
- .${ClassName.NODEVIEW_WRAPPER}
114
- .${ClassName.TABLE_CONTAINER} {
115
- margin-left: unset !important;
116
- width: 100% !important;
117
- }
118
-
119
- > [data-mark-type='fragment']
120
- *
121
- .${ClassName.NODEVIEW_WRAPPER}
122
- .${ClassName.TABLE_CONTAINER} {
123
- margin-left: unset !important;
124
- width: 100% !important;
125
- }
126
- `;
112
+ > *:not([data-mark-type='fragment'])
113
+ .${ClassName.NODEVIEW_WRAPPER}
114
+ .${ClassName.TABLE_CONTAINER} {
115
+ margin-left: unset !important;
116
+ width: 100% !important;
117
+ }
118
+
119
+ > [data-mark-type='fragment'] * .${ClassName.NODEVIEW_WRAPPER} .${ClassName.TABLE_CONTAINER} {
120
+ margin-left: unset !important;
121
+ width: 100% !important;
122
+ }
123
+ `;
127
124
  };
128
125
  const viewModeSortStyles = () => {
129
126
  if (getBooleanFF('platform.editor.table.live-pages-sorting_4malx')) {
130
127
  return css`
131
- th {
132
- .${SORTING_ICON_CLASS_NAME} {
133
- + p {
134
- margin-top: 0 !important;
135
- }
136
- }
137
-
138
- &:has(.is-active) {
139
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
140
- opacity: 1;
141
- }
142
- }
143
-
144
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
145
- opacity: 0;
146
- &:focus {
147
- opacity: 1;
148
- }
149
- }
150
-
151
- &:hover {
152
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
153
- opacity: 1;
154
- }
155
- }
156
- }
157
- `;
128
+ th {
129
+ .${SORTING_ICON_CLASS_NAME} {
130
+ + p {
131
+ margin-top: 0 !important;
132
+ }
133
+ }
134
+
135
+ &:has(.is-active) {
136
+ .${SORTABLE_COLUMN_ICON_CLASSNAME} {
137
+ opacity: 1;
138
+ }
139
+ }
140
+
141
+ .${SORTABLE_COLUMN_ICON_CLASSNAME} {
142
+ opacity: 0;
143
+ &:focus {
144
+ opacity: 1;
145
+ }
146
+ }
147
+
148
+ &:hover {
149
+ .${SORTABLE_COLUMN_ICON_CLASSNAME} {
150
+ opacity: 1;
151
+ }
152
+ }
153
+ }
154
+ `;
158
155
  }
159
156
  };
157
+ const numberColumnFix = () => {
158
+ if (getBooleanFF('platform.editor.table.editor-num-col-style-changes')) {
159
+ return '';
160
+ }
161
+ return css`
162
+ > table[data-number-column='true'] {
163
+ width: calc(100% - 1px);
164
+ }
165
+ `;
166
+ };
160
167
  const tableBorderStyles = () => {
161
168
  return `border-color: ${tableBorderDeleteColor}`;
162
169
  };
@@ -164,39 +171,36 @@ const tableBorderStyles = () => {
164
171
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
165
172
  const tableStickyHeaderColumnControlsDecorationsStyle = () => {
166
173
  return css`
167
- .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
168
- z-index: 0;
169
- left: -1px;
170
- }
171
-
172
- .${ClassName.TABLE_STICKY}
173
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
174
- border-left: 1px solid ${tableBorderColor};
175
- }
176
-
177
- .${ClassName.TABLE_STICKY}
178
- tr:first-of-type
179
- th.${ClassName.TABLE_HEADER_CELL} {
180
- &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
181
- .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
182
- left: 0;
183
- }
184
- }
185
- }
186
- `;
174
+ .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
175
+ z-index: 0;
176
+ left: -1px;
177
+ }
178
+
179
+ .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
180
+ border-left: 1px solid ${tableBorderColor};
181
+ }
182
+
183
+ .${ClassName.TABLE_STICKY} tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
184
+ &.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
185
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
186
+ left: 0;
187
+ }
188
+ }
189
+ }
190
+ `;
187
191
  };
188
192
  const tableStickyHeaderFirefoxFixStyle = () => {
189
193
  /*
190
- This is MAGIC!
191
- This fixes a bug which occurs in firefox when the first row becomes sticky.
192
- see https://product-fabric.atlassian.net/browse/ED-19177
193
- */
194
+ This is MAGIC!
195
+ This fixes a bug which occurs in firefox when the first row becomes sticky.
196
+ see https://product-fabric.atlassian.net/browse/ED-19177
197
+ */
194
198
  if (browser.gecko) {
195
199
  return css`
196
- .${ClassName.TABLE_STICKY} > tbody::before {
197
- content: '';
198
- }
199
- `;
200
+ .${ClassName.TABLE_STICKY} > tbody::before {
201
+ content: '';
202
+ }
203
+ `;
200
204
  }
201
205
  };
202
206
 
@@ -204,58 +208,58 @@ const tableStickyHeaderFirefoxFixStyle = () => {
204
208
  export const baseTableStyles = props => {
205
209
  var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4;
206
210
  return css`
207
- ${tableSharedStyle()};
208
- ${columnControlsLineMarker()};
209
- ${hoveredDeleteButton()};
210
- ${hoveredCell()};
211
- ${hoveredWarningCell};
212
- ${((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableDragAndDrop) && insertLine()};
213
- ${resizeHandle((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.tableDragAndDrop)};
214
- ${rangeSelectionStyles};
215
- ${viewModeSortStyles()};
216
-
217
- .${ClassName.LAST_ITEM_IN_CELL} {
218
- margin-bottom: 0;
219
- }
220
-
221
- .${ClassName.TABLE_NODE_WRAPPER} {
222
- td.${ClassName.TABLE_CELL}, th.${ClassName.TABLE_HEADER_CELL} {
223
- position: relative;
224
- overflow: visible;
225
- }
226
-
227
- td.${ClassName.TABLE_CELL} {
228
- background-color: ${tableCellBackgroundColor};
229
-
230
- // ED-15246: Trello card is visible through a border of a table border
231
- // This fixes a border issue caused by relative positioned table cells
232
- &::after {
233
- height: 100%;
234
- content: '';
235
- border-left: 1px solid ${tableBorderColor};
236
- border-bottom: 1px solid ${tableBorderColor};
237
- position: absolute;
238
- right: 0px;
239
- top: 0px;
240
- bottom: 0;
241
- width: 100%;
242
- display: inline-block;
243
- pointer-events: none;
244
- }
245
- }
246
- }
247
-
248
- .${ClassName.CONTROLS_FLOATING_BUTTON_COLUMN} {
249
- ${insertColumnButtonWrapper()}
250
- }
251
-
252
- .${ClassName.CONTROLS_FLOATING_BUTTON_ROW} {
253
- ${insertRowButtonWrapper()}
254
- }
255
-
256
- ${dragInsertButtonWrapper()}
257
-
258
- ${dragCornerControlButton()}
211
+ ${tableSharedStyle()};
212
+ ${columnControlsLineMarker()};
213
+ ${hoveredDeleteButton()};
214
+ ${hoveredCell()};
215
+ ${hoveredWarningCell};
216
+ ${((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableDragAndDrop) && insertLine()};
217
+ ${resizeHandle((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.tableDragAndDrop)};
218
+ ${rangeSelectionStyles};
219
+ ${viewModeSortStyles()};
220
+
221
+ .${ClassName.LAST_ITEM_IN_CELL} {
222
+ margin-bottom: 0;
223
+ }
224
+
225
+ .${ClassName.TABLE_NODE_WRAPPER} {
226
+ td.${ClassName.TABLE_CELL}, th.${ClassName.TABLE_HEADER_CELL} {
227
+ position: relative;
228
+ overflow: visible;
229
+ }
230
+
231
+ td.${ClassName.TABLE_CELL} {
232
+ background-color: ${tableCellBackgroundColor};
233
+
234
+ // ED-15246: Trello card is visible through a border of a table border
235
+ // This fixes a border issue caused by relative positioned table cells
236
+ &::after {
237
+ height: 100%;
238
+ content: '';
239
+ border-left: 1px solid ${tableBorderColor};
240
+ border-bottom: 1px solid ${tableBorderColor};
241
+ position: absolute;
242
+ right: 0px;
243
+ top: 0px;
244
+ bottom: 0;
245
+ width: 100%;
246
+ display: inline-block;
247
+ pointer-events: none;
248
+ }
249
+ }
250
+ }
251
+
252
+ .${ClassName.CONTROLS_FLOATING_BUTTON_COLUMN} {
253
+ ${insertColumnButtonWrapper()}
254
+ }
255
+
256
+ .${ClassName.CONTROLS_FLOATING_BUTTON_ROW} {
257
+ ${insertRowButtonWrapper()}
258
+ }
259
+
260
+ ${dragInsertButtonWrapper()}
261
+
262
+ ${dragCornerControlButton()}
259
263
 
260
264
  /* Delete button */
261
265
  ${DeleteButton()}
@@ -263,312 +267,306 @@ export const baseTableStyles = props => {
263
267
 
264
268
  /* sticky styles */
265
269
  .${ClassName.TABLE_STICKY} .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
266
- margin-top: ${stickyRowOffsetTop + 2}px;
267
- width: ${akEditorTableNumberColumnWidth}px;
268
-
269
- position: fixed !important;
270
- z-index: ${akEditorStickyHeaderZIndex} !important;
271
- box-shadow: 0px -${stickyRowOffsetTop}px ${"var(--ds-surface, white)"};
272
- border-right: 0 none;
273
- /* top set by NumberColumn component */
274
- }
270
+ margin-top: ${stickyRowOffsetTop + 2}px;
271
+ width: ${akEditorTableNumberColumnWidth}px;
275
272
 
276
- .${ClassName.TABLE_STICKY} .${ClassName.CORNER_CONTROLS}.sticky {
277
- position: fixed !important;
278
- /* needs to be above row controls */
279
- z-index: ${akEditorSmallZIndex} !important;
280
- background: ${"var(--ds-surface, white)"};
273
+ position: fixed !important;
274
+ z-index: ${akEditorStickyHeaderZIndex} !important;
275
+ box-shadow: 0px -${stickyRowOffsetTop}px ${"var(--ds-surface, white)"};
276
+ border-right: 0 none;
277
+ /* top set by NumberColumn component */
278
+ }
281
279
 
282
- width: ${tableToolbarSize}px;
283
- height: ${tableToolbarSize}px;
284
- }
280
+ .${ClassName.TABLE_STICKY} .${ClassName.CORNER_CONTROLS}.sticky {
281
+ position: fixed !important;
282
+ /* needs to be above row controls */
283
+ z-index: ${akEditorSmallZIndex} !important;
284
+ background: ${"var(--ds-surface, white)"};
285
285
 
286
- .${ClassName.CORNER_CONTROLS}.sticky .${ClassName.CONTROLS_CORNER_BUTTON} {
287
- border-bottom: 0px none;
288
- border-right: 0px none;
286
+ width: ${tableToolbarSize}px;
287
+ height: ${tableToolbarSize}px;
288
+ }
289
289
 
290
- height: ${tableToolbarSize}px;
291
- width: ${tableToolbarSize}px;
292
- }
290
+ .${ClassName.CORNER_CONTROLS}.sticky .${ClassName.CONTROLS_CORNER_BUTTON} {
291
+ border-bottom: 0px none;
292
+ border-right: 0px none;
293
293
 
294
- ${tableStickyHeaderColumnControlsDecorationsStyle()}
294
+ height: ${tableToolbarSize}px;
295
+ width: ${tableToolbarSize}px;
296
+ }
295
297
 
296
- ${tableStickyHeaderFirefoxFixStyle()}
298
+ ${tableStickyHeaderColumnControlsDecorationsStyle()}
299
+
300
+ ${tableStickyHeaderFirefoxFixStyle()}
297
301
 
298
302
  .${ClassName.TABLE_STICKY}
299
303
  .${ClassName.ROW_CONTROLS}
300
304
  .${ClassName.ROW_CONTROLS_BUTTON_WRAP}.sticky {
301
- position: fixed !important;
302
- z-index: ${akEditorStickyHeaderZIndex} !important;
303
- display: flex;
304
- border-left: ${tableToolbarSize}px solid
305
- ${"var(--ds-surface, white)"};
306
- margin-left: -${tableToolbarSize}px;
307
- }
308
-
309
- .${ClassName.TABLE_STICKY} col:first-of-type {
310
- /* moving rows out of a table layout does weird things in Chrome */
311
- border-right: 1px solid ${"var(--ds-surface, green)"};
312
- }
313
-
314
- tr.sticky {
315
- padding-top: ${stickyRowOffsetTop}px;
316
- position: fixed;
317
- display: grid;
318
-
319
- /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */
320
- z-index: ${akEditorTableCellOnStickyHeaderZIndex - 5};
321
-
322
- overflow-y: visible;
323
- overflow-x: hidden;
324
-
325
- grid-auto-flow: column;
326
-
327
- /* background for where controls apply */
328
- background: ${"var(--ds-surface, white)"};
329
- box-sizing: content-box;
330
-
331
- margin-top: 2px;
332
-
333
- box-shadow: 0 6px 4px -4px ${`var(--ds-shadow-overflow-perimeter, ${N40A})`};
334
- margin-left: -1px;
335
-
336
- &.no-pointer-events {
337
- pointer-events: none;
338
- }
339
- }
340
-
341
- .${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
342
- left: unset;
343
- position: fixed;
344
- /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */
345
- z-index: ${akEditorTableCellOnStickyHeaderZIndex};
346
- }
347
-
348
- .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY}
349
- .${ClassName.TABLE_STICKY_SHADOW} {
350
- padding-bottom: ${tableToolbarSize}px;
351
- }
352
-
353
- tr.sticky th {
354
- border-bottom: ${stickyHeaderBorderBottomWidth}px solid ${tableBorderColor};
355
- margin-right: -1px;
356
- }
357
-
358
- .${ClassName.TABLE_STICKY} tr.sticky > th:last-child {
359
- border-right-width: 1px;
360
- }
361
-
362
- /* add left edge for first cell */
363
- .${ClassName.TABLE_STICKY} tr.sticky > th:first-of-type {
364
- margin-left: 0px;
365
- }
366
-
367
- /* add a little bit so the scroll lines up with the table */
368
- .${ClassName.TABLE_STICKY} tr.sticky::after {
369
- content: ' ';
370
- width: ${insertColumnButtonOffset + 1}px;
371
- }
372
-
373
- /* To fix jumpiness caused in Chrome Browsers for sticky headers */
374
- .${ClassName.TABLE_STICKY} .sticky + tr {
375
- min-height: 0px;
376
- }
377
-
378
- /* move resize line a little in sticky bar */
379
- .${ClassName.TABLE_CONTAINER}.${ClassName.TABLE_STICKY} {
380
- tr.sticky
381
- td.${ClassName.WITH_RESIZE_LINE},
382
- tr.sticky
383
- th.${ClassName.WITH_RESIZE_LINE} {
384
- .${ClassName.RESIZE_HANDLE_DECORATION}::after {
385
- right: ${(resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1}px;
386
- }
387
- }
388
-
389
- /* when selected put it back to normal -- :not selector would be nicer */
390
- tr.sticky
391
- td.${ClassName.WITH_RESIZE_LINE}.${ClassName.SELECTED_CELL},
392
- tr.sticky
393
- th.${ClassName.WITH_RESIZE_LINE}.${ClassName.SELECTED_CELL} {
394
- .${ClassName.RESIZE_HANDLE_DECORATION}::after {
395
- right: ${(resizeHandlerAreaWidth - resizeLineWidth) / 2}px;
396
- }
397
- }
398
- }
399
-
400
- tr.sticky .${ClassName.HOVERED_CELL}, tr.sticky .${ClassName.SELECTED_CELL} {
401
- z-index: 1;
402
- }
403
-
404
- .${ClassName.WITH_CONTROLS} tr.sticky {
405
- padding-top: ${tableControlsSpacing}px;
406
- }
407
-
408
- .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY}
409
- .${ClassName.NUMBERED_COLUMN}
410
- .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
411
- margin-top: ${tableControlsSpacing + 2}px;
412
- }
413
-
414
- .${ClassName.CORNER_CONTROLS}.sticky {
415
- border-top: ${tableControlsSpacing - tableToolbarSize + 2}px solid
416
- ${"var(--ds-surface, white)"};
417
- }
418
-
419
- ${sentinelStyles}
420
- ${OverflowShadow((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.tableDragAndDrop)}
305
+ position: fixed !important;
306
+ z-index: ${akEditorStickyHeaderZIndex} !important;
307
+ display: flex;
308
+ border-left: ${tableToolbarSize}px solid ${"var(--ds-surface, white)"};
309
+ margin-left: -${tableToolbarSize}px;
310
+ }
311
+
312
+ .${ClassName.TABLE_STICKY} col:first-of-type {
313
+ /* moving rows out of a table layout does weird things in Chrome */
314
+ border-right: 1px solid ${"var(--ds-surface, green)"};
315
+ }
316
+
317
+ tr.sticky {
318
+ padding-top: ${stickyRowOffsetTop}px;
319
+ position: fixed;
320
+ display: grid;
321
+
322
+ /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */
323
+ z-index: ${akEditorTableCellOnStickyHeaderZIndex - 5};
324
+
325
+ overflow-y: visible;
326
+ overflow-x: hidden;
327
+
328
+ grid-auto-flow: column;
329
+
330
+ /* background for where controls apply */
331
+ background: ${"var(--ds-surface, white)"};
332
+ box-sizing: content-box;
333
+
334
+ margin-top: 2px;
335
+
336
+ box-shadow: 0 6px 4px -4px ${`var(--ds-shadow-overflow-perimeter, ${N40A})`};
337
+ margin-left: -1px;
338
+
339
+ &.no-pointer-events {
340
+ pointer-events: none;
341
+ }
342
+ }
343
+
344
+ .${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
345
+ left: unset;
346
+ position: fixed;
347
+ /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */
348
+ z-index: ${akEditorTableCellOnStickyHeaderZIndex};
349
+ }
350
+
351
+ .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
352
+ padding-bottom: ${tableToolbarSize}px;
353
+ }
354
+
355
+ tr.sticky th {
356
+ border-bottom: ${stickyHeaderBorderBottomWidth}px solid ${tableBorderColor};
357
+ margin-right: -1px;
358
+ }
359
+
360
+ .${ClassName.TABLE_STICKY} tr.sticky > th:last-child {
361
+ border-right-width: 1px;
362
+ }
363
+
364
+ /* add left edge for first cell */
365
+ .${ClassName.TABLE_STICKY} tr.sticky > th:first-of-type {
366
+ margin-left: 0px;
367
+ }
368
+
369
+ /* add a little bit so the scroll lines up with the table */
370
+ .${ClassName.TABLE_STICKY} tr.sticky::after {
371
+ content: ' ';
372
+ width: ${insertColumnButtonOffset + 1}px;
373
+ }
374
+
375
+ /* To fix jumpiness caused in Chrome Browsers for sticky headers */
376
+ .${ClassName.TABLE_STICKY} .sticky + tr {
377
+ min-height: 0px;
378
+ }
379
+
380
+ /* move resize line a little in sticky bar */
381
+ .${ClassName.TABLE_CONTAINER}.${ClassName.TABLE_STICKY} {
382
+ tr.sticky td.${ClassName.WITH_RESIZE_LINE}, tr.sticky th.${ClassName.WITH_RESIZE_LINE} {
383
+ .${ClassName.RESIZE_HANDLE_DECORATION}::after {
384
+ right: ${(resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1}px;
385
+ }
386
+ }
387
+
388
+ /* when selected put it back to normal -- :not selector would be nicer */
389
+ tr.sticky
390
+ td.${ClassName.WITH_RESIZE_LINE}.${ClassName.SELECTED_CELL},
391
+ tr.sticky
392
+ th.${ClassName.WITH_RESIZE_LINE}.${ClassName.SELECTED_CELL} {
393
+ .${ClassName.RESIZE_HANDLE_DECORATION}::after {
394
+ right: ${(resizeHandlerAreaWidth - resizeLineWidth) / 2}px;
395
+ }
396
+ }
397
+ }
398
+
399
+ tr.sticky .${ClassName.HOVERED_CELL}, tr.sticky .${ClassName.SELECTED_CELL} {
400
+ z-index: 1;
401
+ }
402
+
403
+ .${ClassName.WITH_CONTROLS} tr.sticky {
404
+ padding-top: ${tableControlsSpacing}px;
405
+ }
406
+
407
+ .${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY}
408
+ .${ClassName.NUMBERED_COLUMN}
409
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
410
+ margin-top: ${tableControlsSpacing + 2}px;
411
+ }
412
+
413
+ .${ClassName.CORNER_CONTROLS}.sticky {
414
+ border-top: ${tableControlsSpacing - tableToolbarSize + 2}px solid
415
+ ${"var(--ds-surface, white)"};
416
+ }
417
+
418
+ ${sentinelStyles}
419
+ ${OverflowShadow((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.tableDragAndDrop)}
421
420
  ${stickyScrollbarStyles(props.featureFlags)}
422
421
 
423
422
  .${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
424
- height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts
425
- }
426
-
427
- .less-padding {
428
- padding: 0 ${tablePadding}px;
429
-
430
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER},
431
- .${ClassName.ROW_CONTROLS_WRAPPER} {
432
- padding: 0 ${tablePadding}px;
433
-
434
- // https://product-fabric.atlassian.net/browse/ED-16386
435
- // Fixes issue where the extra padding that is added here throws off the position
436
- // of the rows control dot
437
- &::after {
438
- right: 6px !important;
439
- }
440
- }
441
-
442
- .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
443
- padding: 0 ${tablePadding}px;
444
- }
445
-
446
- &.${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
447
- padding-left: ${akEditorTableNumberColumnWidth + tablePadding - 1}px;
448
- }
449
- .${ClassName.TABLE_LEFT_SHADOW}, .${ClassName.TABLE_RIGHT_SHADOW} {
450
- width: ${tableOverflowShadowWidth}px;
451
- }
452
-
453
- .${ClassName.TABLE_LEFT_SHADOW} {
454
- left: 6px;
455
- }
456
-
457
- .${ClassName.TABLE_RIGHT_SHADOW} {
458
- left: calc(100% - 6px);
459
- }
460
- }
461
-
462
- > .${ClassName.NODEVIEW_WRAPPER} {
463
- /**
423
+ height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts
424
+ }
425
+
426
+ .less-padding {
427
+ padding: 0 ${tablePadding}px;
428
+
429
+ .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}, .${ClassName.ROW_CONTROLS_WRAPPER} {
430
+ padding: 0 ${tablePadding}px;
431
+
432
+ // https://product-fabric.atlassian.net/browse/ED-16386
433
+ // Fixes issue where the extra padding that is added here throws off the position
434
+ // of the rows control dot
435
+ &::after {
436
+ right: 6px !important;
437
+ }
438
+ }
439
+
440
+ .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
441
+ padding: 0 ${tablePadding}px;
442
+ }
443
+
444
+ &.${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
445
+ padding-left: ${akEditorTableNumberColumnWidth + tablePadding - 1}px;
446
+ }
447
+ .${ClassName.TABLE_LEFT_SHADOW}, .${ClassName.TABLE_RIGHT_SHADOW} {
448
+ width: ${tableOverflowShadowWidth}px;
449
+ }
450
+
451
+ .${ClassName.TABLE_LEFT_SHADOW} {
452
+ left: 6px;
453
+ }
454
+
455
+ .${ClassName.TABLE_RIGHT_SHADOW} {
456
+ left: calc(100% - 6px);
457
+ }
458
+ }
459
+
460
+ > .${ClassName.NODEVIEW_WRAPPER} {
461
+ /**
464
462
  * Prevent margins collapsing, aids with placing the gap-cursor correctly
465
463
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing
466
464
  *
467
465
  * TODO: Enable this, many tests will fail!
468
466
  * border-top: 1px solid transparent;
469
467
  */
470
- }
468
+ }
471
469
 
472
- /* Breakout only works on top level unless wrapped in fragment mark */
473
- ${breakoutWidthStyling()}
470
+ /* Breakout only works on top level unless wrapped in fragment mark */
471
+ ${breakoutWidthStyling()}
474
472
 
475
- ${columnControlsDecoration()};
476
- ${rowControlsWrapperDotStyle()};
473
+ ${columnControlsDecoration()};
474
+ ${rowControlsWrapperDotStyle()};
477
475
 
478
- /* Corner controls */
479
- .${ClassName.CORNER_CONTROLS} {
480
- width: ${tableToolbarSize + 1}px;
481
- height: ${cornerControlHeight}px;
482
- display: none;
476
+ /* Corner controls */
477
+ .${ClassName.CORNER_CONTROLS} {
478
+ width: ${tableToolbarSize + 1}px;
479
+ height: ${cornerControlHeight}px;
480
+ display: none;
483
481
 
484
- .${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
485
- position: relative;
482
+ .${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
483
+ position: relative;
486
484
 
487
- ${InsertMarker(`
485
+ ${InsertMarker(`
488
486
  left: -11px;
489
487
  top: 9px;
490
488
  `)};
491
- }
492
- }
493
-
494
- .${ClassName.CORNER_CONTROLS}.sticky {
495
- .${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
496
- /* sticky row insert dot overlaps other row insert and messes things up */
497
- display: none !important;
498
- }
499
- }
500
-
501
- .${ClassName.CONTROLS_CORNER_BUTTON} {
502
- position: absolute;
503
- top: 0;
504
- width: ${tableToolbarSize + 1}px;
505
- height: ${tableToolbarSize + 1}px;
506
- border: 1px solid ${tableBorderColor};
507
- border-radius: 0;
508
- border-top-left-radius: ${tableBorderRadiusSize}px;
509
- background: ${tableHeaderCellBackgroundColor};
510
- box-sizing: border-box;
511
- padding: 0;
512
- :focus {
513
- outline: none;
514
- }
515
- }
516
- .active .${ClassName.CONTROLS_CORNER_BUTTON} {
517
- border-color: ${tableBorderSelectedColor};
518
- background: ${tableToolbarSelectedColor};
519
- }
520
-
521
- .${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
522
- .${ClassName.CORNER_CONTROLS}, .${ClassName.CONTROLS_CORNER_BUTTON} {
523
- width: ${akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1}px;
524
- }
525
- .${ClassName.ROW_CONTROLS} .${ClassName.CONTROLS_BUTTON} {
526
- border-right-width: 0;
527
- }
528
- }
529
-
530
- :not(.${ClassName.IS_RESIZING}) .${ClassName.CONTROLS_CORNER_BUTTON}:hover {
531
- border-color: ${tableBorderSelectedColor};
532
- background: ${tableToolbarSelectedColor};
533
- cursor: pointer;
534
- }
535
-
536
- :not(.${ClassName.IS_RESIZING})
537
- .${ClassName.CONTROLS_CORNER_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
538
- border-color: ${tableBorderDeleteColor};
539
- background: ${tableToolbarDeleteColor};
540
- }
541
-
542
- /* Row controls */
543
- .${ClassName.ROW_CONTROLS} {
544
- width: ${tableToolbarSize}px;
545
- box-sizing: border-box;
546
- display: none;
547
- position: relative;
548
-
549
- ${InsertMarker(`
489
+ }
490
+ }
491
+
492
+ .${ClassName.CORNER_CONTROLS}.sticky {
493
+ .${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
494
+ /* sticky row insert dot overlaps other row insert and messes things up */
495
+ display: none !important;
496
+ }
497
+ }
498
+
499
+ .${ClassName.CONTROLS_CORNER_BUTTON} {
500
+ position: absolute;
501
+ top: 0;
502
+ width: ${tableToolbarSize + 1}px;
503
+ height: ${tableToolbarSize + 1}px;
504
+ border: 1px solid ${tableBorderColor};
505
+ border-radius: 0;
506
+ border-top-left-radius: ${tableBorderRadiusSize}px;
507
+ background: ${tableHeaderCellBackgroundColor};
508
+ box-sizing: border-box;
509
+ padding: 0;
510
+ :focus {
511
+ outline: none;
512
+ }
513
+ }
514
+ .active .${ClassName.CONTROLS_CORNER_BUTTON} {
515
+ border-color: ${tableBorderSelectedColor};
516
+ background: ${tableToolbarSelectedColor};
517
+ }
518
+
519
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
520
+ .${ClassName.CORNER_CONTROLS}, .${ClassName.CONTROLS_CORNER_BUTTON} {
521
+ width: ${akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1}px;
522
+ }
523
+ .${ClassName.ROW_CONTROLS} .${ClassName.CONTROLS_BUTTON} {
524
+ border-right-width: 0;
525
+ }
526
+ }
527
+
528
+ :not(.${ClassName.IS_RESIZING}) .${ClassName.CONTROLS_CORNER_BUTTON}:hover {
529
+ border-color: ${tableBorderSelectedColor};
530
+ background: ${tableToolbarSelectedColor};
531
+ cursor: pointer;
532
+ }
533
+
534
+ :not(.${ClassName.IS_RESIZING})
535
+ .${ClassName.CONTROLS_CORNER_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
536
+ border-color: ${tableBorderDeleteColor};
537
+ background: ${tableToolbarDeleteColor};
538
+ }
539
+
540
+ /* Row controls */
541
+ .${ClassName.ROW_CONTROLS} {
542
+ width: ${tableToolbarSize}px;
543
+ box-sizing: border-box;
544
+ display: none;
545
+ position: relative;
546
+
547
+ ${InsertMarker(`
550
548
  bottom: -1px;
551
549
  left: -11px;
552
550
  `)};
553
551
 
554
- .${ClassName.ROW_CONTROLS_INNER} {
555
- display: flex;
556
- flex-direction: column;
557
- }
558
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}:last-child > button {
559
- border-bottom-left-radius: ${tableBorderRadiusSize}px;
560
- }
561
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP} {
562
- position: relative;
563
- margin-top: -1px;
564
- }
565
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}:hover,
566
- .${ClassName.ROW_CONTROLS_BUTTON_WRAP}.active,
567
- .${ClassName.CONTROLS_BUTTON}:hover {
568
- z-index: ${akEditorUnitZIndex};
569
- }
570
-
571
- ${HeaderButton(`
552
+ .${ClassName.ROW_CONTROLS_INNER} {
553
+ display: flex;
554
+ flex-direction: column;
555
+ }
556
+ .${ClassName.ROW_CONTROLS_BUTTON_WRAP}:last-child > button {
557
+ border-bottom-left-radius: ${tableBorderRadiusSize}px;
558
+ }
559
+ .${ClassName.ROW_CONTROLS_BUTTON_WRAP} {
560
+ position: relative;
561
+ margin-top: -1px;
562
+ }
563
+ .${ClassName.ROW_CONTROLS_BUTTON_WRAP}:hover,
564
+ .${ClassName.ROW_CONTROLS_BUTTON_WRAP}.active,
565
+ .${ClassName.CONTROLS_BUTTON}:hover {
566
+ z-index: ${akEditorUnitZIndex};
567
+ }
568
+
569
+ ${HeaderButton(`
572
570
  border-bottom: 1px solid ${tableBorderColor};
573
571
  border-right: 0px;
574
572
  border-radius: 0;
@@ -586,440 +584,436 @@ export const baseTableStyles = props => {
586
584
  top: 0;
587
585
  }
588
586
  `)}
589
- }
590
-
591
- .${ClassName.DRAG_ROW_CONTROLS} {
592
- display: grid;
593
- align-items: center;
594
- position: absolute;
595
- z-index: ${akEditorUnitZIndex};
596
-
597
- .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER} {
598
- position: absolute;
599
- align-self: end;
600
- height: 100%;
601
- width: 18px;
602
- }
603
-
604
- .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT} {
605
- position: absolute;
606
- bottom: -3px;
607
- left: 2px;
608
- background-color: ${"var(--ds-background-accent-gray-subtler, #C1C7D0)"};
609
- height: 4px;
610
- width: 4px;
611
- border-radius: 50%;
612
- pointer-events: none;
613
- }
614
- }
615
-
616
- .${ClassName.DRAG_COLUMN_CONTROLS} {
617
- .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
618
- height: 24px;
619
- position: absolute;
620
- top: ${"var(--ds-space-negative-150, -12px)"};
621
- z-index: ${resizeHandlerZIndex};
622
- }
623
-
624
- .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER} {
625
- position: absolute;
626
- height: 24px;
627
- width: 100%;
628
- }
629
-
630
- .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT} {
631
- background-color: ${"var(--ds-background-accent-gray-subtler, #C1C7D0)"};
632
- height: 4px;
633
- width: 4px;
634
- border-radius: 50%;
635
- position: absolute;
636
- right: -2px;
637
- }
638
- }
639
-
640
- .${ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE} {
641
- background: none;
642
- border: none;
643
- outline: none;
644
- position: absolute;
645
- margin: 0;
646
- padding: 0;
647
- display: flex;
648
- align-items: center;
649
- cursor: pointer;
650
-
651
- :focus {
652
- outline: none;
653
- }
654
- }
655
-
656
- .${ClassName.DRAG_HANDLE_BUTTON_CONTAINER} {
657
- cursor: grab;
658
- pointer-events: auto;
659
-
660
- line-height: 0;
661
- padding: 0;
662
- border-radius: 6px;
663
- width: max-content;
664
- border: 2px solid ${`var(--ds-surface, ${N0})`};
665
-
666
- display: flex;
667
- justify-content: center;
668
- align-items: center;
669
- background: transparent;
670
- outline: none;
671
-
672
- &.placeholder {
673
- background-color: transparent;
674
- border: 2px solid transparent;
675
- }
676
-
677
- &.${ClassName.DRAG_HANDLE_DISABLED} {
678
- cursor: pointer;
679
- & svg {
680
- & > rect.${ClassName.DRAG_HANDLE_MINIMISED} {
681
- fill: ${"var(--ds-background-accent-gray-subtler, #DCDFE4)"};
682
- }
683
- & > rect {
684
- fill: ${"var(--ds-background-accent-gray-subtlest, #F4F5F7)"};
685
- }
686
- & > g > rect {
687
- fill: ${"var(--ds-icon-disabled, #BFDBF847)"};
688
- }
689
- }
690
- }
691
-
692
- &:not(.${ClassName.DRAG_HANDLE_DISABLED}) {
693
- & svg {
694
- rect {
695
- fill: ${"var(--ds-background-accent-gray-subtler, #DCDFE4)"};
696
- }
697
- g {
698
- fill: ${"var(--ds-icon-subtle, #626f86)"};
699
- }
700
- }
701
-
702
- &:hover {
703
- svg {
704
- rect {
705
- fill: ${"var(--ds-background-accent-blue-subtle, #579DFF)"};
706
- }
707
- g {
708
- fill: ${"var(--ds-icon-inverse, #FFF)"};
709
- }
710
- }
711
- }
712
-
713
- &:active {
714
- cursor: grabbing;
715
- }
716
-
717
- &.selected {
718
- :focus {
719
- outline: 2px solid ${"var(--ds-border-focused, #2684FF)"};
720
- outline-offset: 1px;
721
- }
722
-
723
- &:active {
724
- outline: none;
725
- }
726
-
727
- svg {
728
- rect {
729
- fill: ${"var(--ds-background-accent-blue-subtle, #579dff)"};
730
- }
731
- g {
732
- fill: ${"var(--ds-icon-inverse, #fff)"};
733
- }
734
- }
735
- }
736
-
737
- &.danger {
738
- svg {
739
- rect {
740
- fill: ${"var(--ds-background-accent-red-subtler-pressed, #F87462)"};
741
- }
742
- g {
743
- fill: ${"var(--ds-border-inverse, #FFF)"};
744
- }
745
- }
746
- }
747
- }
748
- }
749
-
750
- ${floatingColumnControls()}
751
-
752
- :not(.${ClassName.IS_RESIZING}) .${ClassName.ROW_CONTROLS} {
753
- ${HeaderButtonHover()}
754
- ${HeaderButtonDanger()}
755
- }
756
-
757
- /* Numbered column */
758
- .${ClassName.NUMBERED_COLUMN} {
759
- position: relative;
760
- float: right;
761
- margin-left: ${akEditorTableToolbarSize}px;
762
- top: ${(_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.tableDragAndDrop ? 0 : akEditorTableToolbarSize}px;
763
- width: ${akEditorTableNumberColumnWidth + 1}px;
764
- box-sizing: border-box;
765
- }
766
-
767
- .${ClassName.NUMBERED_COLUMN_BUTTON} {
768
- border: 1px solid ${tableBorderColor};
769
- box-sizing: border-box;
770
- margin-top: -1px;
771
- padding-bottom: 2px;
772
- padding: 10px 2px;
773
- text-align: center;
774
- font-size: ${relativeFontSizeToBase16(fontSize())};
775
- background-color: ${tableHeaderCellBackgroundColor};
776
- color: ${tableTextColor};
777
- border-color: ${tableBorderColor};
778
-
779
- :first-child:not(style),
780
- style:first-child + * {
781
- margin-top: 0;
782
- }
783
- :last-child {
784
- border-bottom: 1px solid ${tableBorderColor};
785
- }
786
- }
787
-
788
- // add a background above the first numbered column cell when sticky header is engaged
789
- // which hides the table when scrolling
790
- .${ClassName.TABLE_STICKY} {
791
- .${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}:first-of-type::after {
792
- content: '';
793
- display: block;
794
- height: 33px;
795
- width: 100%;
796
- background-color: ${"var(--ds-surface, white)"};
797
- position: absolute;
798
-
799
- // the extra pixel is accounting for borders
800
- top: -34px;
801
- left: -1px;
802
- }
803
- }
804
-
805
- .${ClassName.WITH_CONTROLS} {
806
- .${ClassName.CORNER_CONTROLS}, .${ClassName.ROW_CONTROLS} {
807
- display: block;
808
- }
809
- .${ClassName.NUMBERED_COLUMN} {
810
- padding-left: 0px;
811
-
812
- .${ClassName.NUMBERED_COLUMN_BUTTON} {
813
- border-left: 0 none;
814
- }
815
-
816
- .${ClassName.NUMBERED_COLUMN_BUTTON}.active {
817
- border-bottom: 1px solid ${tableBorderSelectedColor};
818
- border-color: ${tableBorderSelectedColor};
819
- background-color: ${tableToolbarSelectedColor};
820
- position: relative;
821
- z-index: ${akEditorUnitZIndex};
822
- color: ${`var(--ds-text-selected, ${N0})`};
823
- }
824
- }
825
- }
826
- :not(.${ClassName.IS_RESIZING}) .${ClassName.WITH_CONTROLS} {
827
- .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}) {
828
- cursor: pointer;
829
- }
830
- .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}):hover {
831
- border-bottom: 1px solid ${tableBorderSelectedColor};
832
- border-color: ${tableBorderSelectedColor};
833
- background-color: ${tableToolbarSelectedColor};
834
- position: relative;
835
- z-index: ${akEditorUnitZIndex};
836
- color: ${`var(--ds-text-selected, ${N0})`};
837
- }
838
- .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
839
- background-color: ${tableToolbarDeleteColor};
840
- border: 1px solid ${tableBorderDeleteColor};
841
- border-left: 0;
842
- color: ${`var(--ds-text-danger, ${R500})`};
843
- position: relative;
844
- z-index: ${akEditorUnitZIndex};
845
- }
846
- }
847
-
848
- /* Table */
849
- .${ClassName.TABLE_NODE_WRAPPER} > table {
850
- table-layout: fixed;
851
- white-space: normal;
852
- border-top: none;
853
- // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212
854
- margin-right: -1px;
855
- // Allows better positioning for the shadow sentinels - ED-16668
856
- position: relative;
857
-
858
- > tbody > tr {
859
- white-space: pre-wrap;
860
- }
861
-
862
- .${ClassName.COLUMN_CONTROLS_DECORATIONS} + * {
863
- margin-top: 0;
864
- }
865
-
866
- /*
587
+ }
588
+
589
+ .${ClassName.DRAG_ROW_CONTROLS} {
590
+ display: grid;
591
+ align-items: center;
592
+ position: absolute;
593
+ z-index: ${akEditorUnitZIndex};
594
+
595
+ .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER} {
596
+ position: absolute;
597
+ align-self: end;
598
+ height: 100%;
599
+ width: 18px;
600
+ }
601
+
602
+ .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT} {
603
+ position: absolute;
604
+ bottom: -3px;
605
+ left: 2px;
606
+ background-color: ${"var(--ds-background-accent-gray-subtler, #C1C7D0)"};
607
+ height: 4px;
608
+ width: 4px;
609
+ border-radius: 50%;
610
+ pointer-events: none;
611
+ }
612
+ }
613
+
614
+ .${ClassName.DRAG_COLUMN_CONTROLS} {
615
+ .${ClassName.DRAG_COLUMN_CONTROLS_INNER} {
616
+ height: 24px;
617
+ position: absolute;
618
+ top: ${"var(--ds-space-negative-150, -12px)"};
619
+ z-index: ${resizeHandlerZIndex};
620
+ }
621
+
622
+ .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER} {
623
+ position: absolute;
624
+ height: 24px;
625
+ width: 100%;
626
+ }
627
+
628
+ .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT} {
629
+ background-color: ${"var(--ds-background-accent-gray-subtler, #C1C7D0)"};
630
+ height: 4px;
631
+ width: 4px;
632
+ border-radius: 50%;
633
+ position: absolute;
634
+ right: -2px;
635
+ }
636
+ }
637
+
638
+ .${ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE} {
639
+ background: none;
640
+ border: none;
641
+ outline: none;
642
+ position: absolute;
643
+ margin: 0;
644
+ padding: 0;
645
+ display: flex;
646
+ align-items: center;
647
+ cursor: pointer;
648
+
649
+ :focus {
650
+ outline: none;
651
+ }
652
+ }
653
+
654
+ .${ClassName.DRAG_HANDLE_BUTTON_CONTAINER} {
655
+ cursor: grab;
656
+ pointer-events: auto;
657
+
658
+ line-height: 0;
659
+ padding: 0;
660
+ border-radius: 6px;
661
+ width: max-content;
662
+ border: 2px solid ${`var(--ds-surface, ${N0})`};
663
+
664
+ display: flex;
665
+ justify-content: center;
666
+ align-items: center;
667
+ background: transparent;
668
+ outline: none;
669
+
670
+ &.placeholder {
671
+ background-color: transparent;
672
+ border: 2px solid transparent;
673
+ }
674
+
675
+ &.${ClassName.DRAG_HANDLE_DISABLED} {
676
+ cursor: pointer;
677
+ & svg {
678
+ & > rect.${ClassName.DRAG_HANDLE_MINIMISED} {
679
+ fill: ${"var(--ds-background-accent-gray-subtler, #DCDFE4)"};
680
+ }
681
+ & > rect {
682
+ fill: ${"var(--ds-background-accent-gray-subtlest, #F4F5F7)"};
683
+ }
684
+ & > g > rect {
685
+ fill: ${"var(--ds-icon-disabled, #BFDBF847)"};
686
+ }
687
+ }
688
+ }
689
+
690
+ &:not(.${ClassName.DRAG_HANDLE_DISABLED}) {
691
+ & svg {
692
+ rect {
693
+ fill: ${"var(--ds-background-accent-gray-subtler, #DCDFE4)"};
694
+ }
695
+ g {
696
+ fill: ${"var(--ds-icon-subtle, #626f86)"};
697
+ }
698
+ }
699
+
700
+ &:hover {
701
+ svg {
702
+ rect {
703
+ fill: ${"var(--ds-background-accent-blue-subtle, #579DFF)"};
704
+ }
705
+ g {
706
+ fill: ${"var(--ds-icon-inverse, #FFF)"};
707
+ }
708
+ }
709
+ }
710
+
711
+ &:active {
712
+ cursor: grabbing;
713
+ }
714
+
715
+ &.selected {
716
+ :focus {
717
+ outline: 2px solid ${"var(--ds-border-focused, #2684FF)"};
718
+ outline-offset: 1px;
719
+ }
720
+
721
+ &:active {
722
+ outline: none;
723
+ }
724
+
725
+ svg {
726
+ rect {
727
+ fill: ${"var(--ds-background-accent-blue-subtle, #579dff)"};
728
+ }
729
+ g {
730
+ fill: ${"var(--ds-icon-inverse, #fff)"};
731
+ }
732
+ }
733
+ }
734
+
735
+ &.danger {
736
+ svg {
737
+ rect {
738
+ fill: ${"var(--ds-background-accent-red-subtler-pressed, #F87462)"};
739
+ }
740
+ g {
741
+ fill: ${"var(--ds-border-inverse, #FFF)"};
742
+ }
743
+ }
744
+ }
745
+ }
746
+ }
747
+
748
+ ${floatingColumnControls()}
749
+
750
+ :not(.${ClassName.IS_RESIZING}) .${ClassName.ROW_CONTROLS} {
751
+ ${HeaderButtonHover()}
752
+ ${HeaderButtonDanger()}
753
+ }
754
+
755
+ /* Numbered column */
756
+ .${ClassName.NUMBERED_COLUMN} {
757
+ position: relative;
758
+ float: right;
759
+ margin-left: ${akEditorTableToolbarSize}px;
760
+ top: ${(_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.tableDragAndDrop ? 0 : akEditorTableToolbarSize}px;
761
+ width: ${akEditorTableNumberColumnWidth + 1}px;
762
+ box-sizing: border-box;
763
+ }
764
+
765
+ .${ClassName.NUMBERED_COLUMN_BUTTON} {
766
+ border: 1px solid ${tableBorderColor};
767
+ box-sizing: border-box;
768
+ margin-top: -1px;
769
+ padding-bottom: 2px;
770
+ padding: 10px 2px;
771
+ text-align: center;
772
+ font-size: ${relativeFontSizeToBase16(fontSize())};
773
+ background-color: ${tableHeaderCellBackgroundColor};
774
+ color: ${tableTextColor};
775
+ border-color: ${tableBorderColor};
776
+
777
+ :first-child:not(style),
778
+ style:first-child + * {
779
+ margin-top: 0;
780
+ }
781
+ :last-child {
782
+ border-bottom: 1px solid ${tableBorderColor};
783
+ }
784
+ }
785
+
786
+ // add a background above the first numbered column cell when sticky header is engaged
787
+ // which hides the table when scrolling
788
+ .${ClassName.TABLE_STICKY} {
789
+ .${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}:first-of-type::after {
790
+ content: '';
791
+ display: block;
792
+ height: 33px;
793
+ width: 100%;
794
+ background-color: ${"var(--ds-surface, white)"};
795
+ position: absolute;
796
+
797
+ // the extra pixel is accounting for borders
798
+ top: -34px;
799
+ left: -1px;
800
+ }
801
+ }
802
+
803
+ .${ClassName.WITH_CONTROLS} {
804
+ .${ClassName.CORNER_CONTROLS}, .${ClassName.ROW_CONTROLS} {
805
+ display: block;
806
+ }
807
+ .${ClassName.NUMBERED_COLUMN} {
808
+ padding-left: 0px;
809
+
810
+ .${ClassName.NUMBERED_COLUMN_BUTTON} {
811
+ border-left: 0 none;
812
+ }
813
+
814
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active {
815
+ border-bottom: 1px solid ${tableBorderSelectedColor};
816
+ border-color: ${tableBorderSelectedColor};
817
+ background-color: ${tableToolbarSelectedColor};
818
+ position: relative;
819
+ z-index: ${akEditorUnitZIndex};
820
+ color: ${`var(--ds-text-selected, ${N0})`};
821
+ }
822
+ }
823
+ }
824
+ :not(.${ClassName.IS_RESIZING}) .${ClassName.WITH_CONTROLS} {
825
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}) {
826
+ cursor: pointer;
827
+ }
828
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}):hover {
829
+ border-bottom: 1px solid ${tableBorderSelectedColor};
830
+ border-color: ${tableBorderSelectedColor};
831
+ background-color: ${tableToolbarSelectedColor};
832
+ position: relative;
833
+ z-index: ${akEditorUnitZIndex};
834
+ color: ${`var(--ds-text-selected, ${N0})`};
835
+ }
836
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
837
+ background-color: ${tableToolbarDeleteColor};
838
+ border: 1px solid ${tableBorderDeleteColor};
839
+ border-left: 0;
840
+ color: ${`var(--ds-text-danger, ${R500})`};
841
+ position: relative;
842
+ z-index: ${akEditorUnitZIndex};
843
+ }
844
+ }
845
+
846
+ /* Table */
847
+ .${ClassName.TABLE_NODE_WRAPPER} > table {
848
+ table-layout: fixed;
849
+ white-space: normal;
850
+ border-top: none;
851
+ // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212
852
+ margin-right: -1px;
853
+ // Allows better positioning for the shadow sentinels - ED-16668
854
+ position: relative;
855
+
856
+ > tbody > tr {
857
+ white-space: pre-wrap;
858
+ }
859
+
860
+ .${ClassName.COLUMN_CONTROLS_DECORATIONS} + * {
861
+ margin-top: 0;
862
+ }
863
+
864
+ /*
867
865
  * Headings have a top margin by default, but we don't want this on the
868
866
  * first heading within table header cells.
869
867
  *
870
868
  * This specifically sets margin-top for the first heading within a header
871
869
  * cell when center/right aligned.
872
870
  */
873
- th.${ClassName.TABLE_HEADER_CELL} > .fabric-editor-block-mark {
874
- > h1:first-of-type,
875
- > h2:first-of-type,
876
- > h3:first-of-type,
877
- > h4:first-of-type,
878
- > h5:first-of-type,
879
- > h6:first-of-type {
880
- margin-top: 0;
881
- }
882
- }
883
-
884
- .${ClassName.SELECTED_CELL}, .${ClassName.HOVERED_CELL_IN_DANGER} {
885
- position: relative;
886
- }
887
- /* Give selected cells a blue overlay */
888
- .${ClassName.SELECTED_CELL}::after,
889
- .${ClassName.HOVERED_CELL_IN_DANGER}::after {
890
- z-index: ${akEditorSmallZIndex};
891
- position: absolute;
892
- content: '';
893
- left: 0;
894
- right: 0;
895
- top: 0;
896
- bottom: 0;
897
- width: 100%;
898
- pointer-events: none;
899
- }
900
- .${ClassName.SELECTED_CELL} {
901
- border: 1px solid ${tableBorderSelectedColor};
902
- }
903
- .${ClassName.SELECTED_CELL}::after {
904
- background: ${tableCellSelectedColor};
905
- z-index: ${akEditorSmallZIndex};
906
- }
907
- th.${ClassName.HOVERED_CELL_IN_DANGER}::after,
908
- td.${ClassName.HOVERED_CELL_IN_DANGER}::after {
909
- background: ${tableCellDeleteColor};
910
- z-index: ${akEditorUnitZIndex * 100};
911
- }
912
- // ED-15246: Trello card is visible through a border of a table border
913
- /* ED-19064: To fix when enable header column in the table,
871
+ th.${ClassName.TABLE_HEADER_CELL} > .fabric-editor-block-mark {
872
+ > h1:first-of-type,
873
+ > h2:first-of-type,
874
+ > h3:first-of-type,
875
+ > h4:first-of-type,
876
+ > h5:first-of-type,
877
+ > h6:first-of-type {
878
+ margin-top: 0;
879
+ }
880
+ }
881
+
882
+ .${ClassName.SELECTED_CELL}, .${ClassName.HOVERED_CELL_IN_DANGER} {
883
+ position: relative;
884
+ }
885
+ /* Give selected cells a blue overlay */
886
+ .${ClassName.SELECTED_CELL}::after, .${ClassName.HOVERED_CELL_IN_DANGER}::after {
887
+ z-index: ${akEditorSmallZIndex};
888
+ position: absolute;
889
+ content: '';
890
+ left: 0;
891
+ right: 0;
892
+ top: 0;
893
+ bottom: 0;
894
+ width: 100%;
895
+ pointer-events: none;
896
+ }
897
+ .${ClassName.SELECTED_CELL} {
898
+ border: 1px solid ${tableBorderSelectedColor};
899
+ }
900
+ .${ClassName.SELECTED_CELL}::after {
901
+ background: ${tableCellSelectedColor};
902
+ z-index: ${akEditorSmallZIndex};
903
+ }
904
+ th.${ClassName.HOVERED_CELL_IN_DANGER}::after, td.${ClassName.HOVERED_CELL_IN_DANGER}::after {
905
+ background: ${tableCellDeleteColor};
906
+ z-index: ${akEditorUnitZIndex * 100};
907
+ }
908
+ // ED-15246: Trello card is visible through a border of a table border
909
+ /* ED-19064: To fix when enable header column in the table,
914
910
  and selection the header column, the right border is not tableBorderSelectedColor
915
911
  when deleting the header column, the right border is not tableToolbarDeleteColor */
916
- td.${ClassName.HOVERED_CELL},
917
- td.${ClassName.SELECTED_CELL},
918
- th.${ClassName.TABLE_HEADER_CELL}.${ClassName.SELECTED_CELL},
919
- th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL} {
920
- &::after {
921
- height: 100%;
922
- width: 100%;
923
- border: 1px solid ${tableBorderSelectedColor};
924
- content: '';
925
- position: absolute;
926
- left: -1px;
927
- top: -1px;
928
- bottom: 0;
929
- z-index: ${akEditorSmallZIndex};
930
- display: inline-block;
931
- pointer-events: none;
932
- }
933
- &.${ClassName.HOVERED_CELL_IN_DANGER}::after {
934
- ${tableBorderStyles()};
935
- z-index: ${akEditorUnitZIndex * 100};
936
- }
937
-
938
- &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
939
- ${tableBorderStyles()};
940
- z-index: ${akEditorUnitZIndex * 100};
941
- }
942
- }
943
- }
944
-
945
- // override for DnD controls
946
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} {
947
- position: absolute;
948
- margin-top: ${tableMarginTop}px;
949
- left: -${tableToolbarSize + 1}px;
950
- z-index: ${rowControlsZIndex + 4};
951
- }
952
-
953
- .${ClassName.ROW_CONTROLS_WRAPPER} {
954
- position: absolute;
955
- /* top of corner control is table margin top - corner control height + 1 pixel of table border. */
956
- top: ${tableMarginTop - cornerControlHeight + 1}px;
957
- left: -${tableToolbarSize}px;
958
- }
959
-
960
- .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_LEFT_SHADOW},
961
- .${ClassName.ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_LEFT_SHADOW} {
962
- z-index: ${akEditorUnitZIndex};
963
- }
964
-
965
- .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
966
- position: absolute;
967
- top: ${tableMarginTop}px;
968
- }
969
-
970
- .${ClassName.TABLE_STICKY} .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
971
- position: fixed;
972
- /* higher zIndex than sticky header which is akEditorTableCellOnStickyHeaderZIndex - 5 */
973
- z-index: ${akEditorTableCellOnStickyHeaderZIndex - 4};
974
- }
975
-
976
- .${ClassName.TABLE_NODE_WRAPPER} {
977
- padding-bottom: 0px;
978
- /* fixes gap cursor height */
979
- overflow: auto;
980
- overflow-y: hidden;
981
- position: relative;
982
-
983
- > table[data-number-column='true'] {
984
- width: calc(100% - 1px);
985
- }
986
- }
912
+ td.${ClassName.HOVERED_CELL},
913
+ td.${ClassName.SELECTED_CELL},
914
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.SELECTED_CELL},
915
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL} {
916
+ &::after {
917
+ height: 100%;
918
+ width: 100%;
919
+ border: 1px solid ${tableBorderSelectedColor};
920
+ content: '';
921
+ position: absolute;
922
+ left: -1px;
923
+ top: -1px;
924
+ bottom: 0;
925
+ z-index: ${akEditorSmallZIndex};
926
+ display: inline-block;
927
+ pointer-events: none;
928
+ }
929
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after {
930
+ ${tableBorderStyles()};
931
+ z-index: ${akEditorUnitZIndex * 100};
932
+ }
933
+
934
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
935
+ ${tableBorderStyles()};
936
+ z-index: ${akEditorUnitZIndex * 100};
937
+ }
938
+ }
939
+ }
940
+
941
+ // override for DnD controls
942
+ .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} {
943
+ position: absolute;
944
+ margin-top: ${tableMarginTop}px;
945
+ left: -${tableToolbarSize + 1}px;
946
+ z-index: ${rowControlsZIndex + 4};
947
+ }
948
+
949
+ .${ClassName.ROW_CONTROLS_WRAPPER} {
950
+ position: absolute;
951
+ /* top of corner control is table margin top - corner control height + 1 pixel of table border. */
952
+ top: ${tableMarginTop - cornerControlHeight + 1}px;
953
+ left: -${tableToolbarSize}px;
954
+ }
955
+
956
+ .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_LEFT_SHADOW},
957
+ .${ClassName.ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_LEFT_SHADOW} {
958
+ z-index: ${akEditorUnitZIndex};
959
+ }
960
+
961
+ .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
962
+ position: absolute;
963
+ top: ${tableMarginTop}px;
964
+ }
965
+
966
+ .${ClassName.TABLE_STICKY} .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
967
+ position: fixed;
968
+ /* higher zIndex than sticky header which is akEditorTableCellOnStickyHeaderZIndex - 5 */
969
+ z-index: ${akEditorTableCellOnStickyHeaderZIndex - 4};
970
+ }
971
+
972
+ .${ClassName.TABLE_NODE_WRAPPER} {
973
+ padding-bottom: 0px;
974
+ /* fixes gap cursor height */
975
+ overflow: auto;
976
+ overflow-y: hidden;
977
+ position: relative;
978
+
979
+ ${numberColumnFix()}
980
+ }
987
981
  `;
988
982
  };
989
983
 
990
984
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
991
985
  export const tableStyles = props => css`
992
- .ProseMirror {
993
- ${baseTableStyles(props)}
994
- }
995
-
996
- .ProseMirror.${ClassName.IS_RESIZING} {
997
- .${ClassName.TABLE_NODE_WRAPPER} {
998
- overflow-x: auto;
999
- ${scrollbarStyles};
1000
- }
1001
- }
1002
-
1003
- .ProseMirror.${ClassName.RESIZE_CURSOR} {
1004
- cursor: col-resize;
1005
- }
1006
-
1007
- ${shadowSentinelStyles}
986
+ .ProseMirror {
987
+ ${baseTableStyles(props)}
988
+ }
989
+
990
+ .ProseMirror.${ClassName.IS_RESIZING} {
991
+ .${ClassName.TABLE_NODE_WRAPPER} {
992
+ overflow-x: auto;
993
+ ${scrollbarStyles};
994
+ }
995
+ }
996
+
997
+ .ProseMirror.${ClassName.RESIZE_CURSOR} {
998
+ cursor: col-resize;
999
+ }
1000
+
1001
+ ${shadowSentinelStyles}
1008
1002
  `;
1009
1003
 
1010
1004
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
1011
1005
  export const tableFullPageEditorStyles = css`
1012
- .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
1013
- margin-left: 0;
1014
- // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212
1015
- margin-right: -1px;
1016
- width: 100%;
1017
- }
1006
+ .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
1007
+ margin-left: 0;
1008
+ // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212
1009
+ margin-right: -1px;
1010
+ width: 100%;
1011
+ }
1018
1012
  `;
1019
1013
  export const tableCommentEditorStyles = css`
1020
- .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
1021
- margin-left: 0;
1022
- margin-right: 0;
1023
- ${scrollbarStyles};
1024
- }
1014
+ .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
1015
+ margin-left: 0;
1016
+ margin-right: 0;
1017
+ ${scrollbarStyles};
1018
+ }
1025
1019
  `;