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