@atlaskit/editor-plugin-table 7.6.2 → 7.6.4

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