@atlaskit/editor-plugin-table 23.3.12 → 23.4.1

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 (44) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/nodeviews/TableCell.js +2 -5
  3. package/dist/cjs/nodeviews/TableComponent.js +18 -1
  4. package/dist/cjs/nodeviews/TableRow.js +4 -0
  5. package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +3 -0
  6. package/dist/cjs/nodeviews/toDOM.js +13 -1
  7. package/dist/cjs/pm-plugins/commands/selection.js +1 -2
  8. package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +31 -1
  9. package/dist/cjs/tablePlugin.js +1 -1
  10. package/dist/cjs/types/index.js +1 -0
  11. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +10 -2
  12. package/dist/cjs/ui/common-styles.js +8 -22
  13. package/dist/cjs/ui/rounded-table-styles.js +43 -0
  14. package/dist/es2019/nodeviews/TableCell.js +2 -5
  15. package/dist/es2019/nodeviews/TableComponent.js +19 -2
  16. package/dist/es2019/nodeviews/TableRow.js +5 -1
  17. package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +4 -1
  18. package/dist/es2019/nodeviews/toDOM.js +13 -1
  19. package/dist/es2019/pm-plugins/commands/selection.js +1 -2
  20. package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +30 -0
  21. package/dist/es2019/tablePlugin.js +1 -1
  22. package/dist/es2019/types/index.js +1 -0
  23. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +10 -2
  24. package/dist/es2019/ui/common-styles.js +21 -458
  25. package/dist/es2019/ui/rounded-table-styles.js +581 -0
  26. package/dist/esm/nodeviews/TableCell.js +2 -5
  27. package/dist/esm/nodeviews/TableComponent.js +19 -2
  28. package/dist/esm/nodeviews/TableRow.js +5 -1
  29. package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +4 -1
  30. package/dist/esm/nodeviews/toDOM.js +13 -1
  31. package/dist/esm/pm-plugins/commands/selection.js +1 -2
  32. package/dist/esm/pm-plugins/table-resizing/utils/dom.js +30 -0
  33. package/dist/esm/tablePlugin.js +1 -1
  34. package/dist/esm/types/index.js +1 -0
  35. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +10 -2
  36. package/dist/esm/ui/common-styles.js +8 -22
  37. package/dist/esm/ui/rounded-table-styles.js +37 -0
  38. package/dist/types/pm-plugins/table-resizing/utils/dom.d.ts +1 -0
  39. package/dist/types/types/index.d.ts +1 -0
  40. package/dist/types/ui/rounded-table-styles.d.ts +2 -0
  41. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/dom.d.ts +1 -0
  42. package/dist/types-ts4.5/types/index.d.ts +1 -0
  43. package/dist/types-ts4.5/ui/rounded-table-styles.d.ts +2 -0
  44. package/package.json +6 -9
@@ -0,0 +1,581 @@
1
+ /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression */
2
+
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
+ import { css } from '@emotion/react';
5
+ import { tableMarginTop } from '@atlaskit/editor-common/styles';
6
+ import { akEditorSmallZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
7
+ import { TableCssClassName as ClassName } from '../types';
8
+ import { nativeStickyHeaderZIndex, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor } from './consts';
9
+ const roundedTableCellCornerStyles = () => css`
10
+ .${ClassName.TABLE_NODE_WRAPPER} > table {
11
+ /* Round table corner cells (including merged cells that span to the edge)
12
+ and their interaction overlays. The data-reaches-* attributes are set by the
13
+ TableCell node view based on each cell's position + rowspan/colspan. */
14
+ > tbody > tr > td[data-reaches-top][data-reaches-left],
15
+ > tbody > tr > th[data-reaches-top][data-reaches-left] {
16
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
17
+
18
+ &::after,
19
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
20
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
21
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
22
+ }
23
+ }
24
+
25
+ > tbody > tr > td[data-reaches-top][data-reaches-right],
26
+ > tbody > tr > th[data-reaches-top][data-reaches-right] {
27
+ border-top-right-radius: ${"var(--ds-radius-xlarge, 12px)"};
28
+
29
+ &::after,
30
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
31
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
32
+ border-top-right-radius: ${"var(--ds-radius-xlarge, 12px)"};
33
+ }
34
+ }
35
+
36
+ > tbody > tr > td[data-reaches-bottom][data-reaches-left],
37
+ > tbody > tr > th[data-reaches-bottom][data-reaches-left] {
38
+ border-bottom-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
39
+
40
+ &::after,
41
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
42
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
43
+ border-bottom-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
44
+ }
45
+ }
46
+
47
+ > tbody > tr > td[data-reaches-bottom][data-reaches-right],
48
+ > tbody > tr > th[data-reaches-bottom][data-reaches-right] {
49
+ border-bottom-right-radius: ${"var(--ds-radius-xlarge, 12px)"};
50
+
51
+ &::after,
52
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
53
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
54
+ border-bottom-right-radius: ${"var(--ds-radius-xlarge, 12px)"};
55
+ }
56
+ }
57
+ }
58
+ `;
59
+ const roundedTableInteractionOverlayStyles = () => css`
60
+ .${ClassName.TABLE_NODE_WRAPPER} > table {
61
+ /* Active-cell highlight base properties (replaces activeCellHighlightStyles).
62
+ width/height: auto overrides the base cell ::after which uses width: 100%; height: 100%,
63
+ so that left/right/top/bottom determine the size instead. */
64
+ td.${ClassName.TABLE_CELL}.${ClassName.ACTIVE_CURSOR_CELL}::after,
65
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.ACTIVE_CURSOR_CELL}::after {
66
+ border: 1px solid ${"var(--ds-border-selected, #1868DB)"};
67
+ box-shadow: ${"var(--ds-shadow-raised, 0px 1px 1px #1E1F2140, 0px 0px 1px #1E1F214f)"};
68
+ content: '';
69
+ position: absolute;
70
+ top: -1px;
71
+ left: -1px;
72
+ right: -1px;
73
+ bottom: -1px;
74
+ width: auto;
75
+ height: auto;
76
+ z-index: ${akEditorSmallZIndex};
77
+ pointer-events: none;
78
+ }
79
+
80
+ /* Normalize selected/hover/danger overlays to the same box model as active-cell.
81
+ width/height: auto overrides the base cell ::after which uses width: 100%; height: 100%. */
82
+ td.${ClassName.HOVERED_CELL}::after,
83
+ td.${ClassName.SELECTED_CELL}::after,
84
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.SELECTED_CELL}::after,
85
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL}::after,
86
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL_IN_DANGER}::after,
87
+ td.${ClassName.TABLE_CELL}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
88
+ left: -1px;
89
+ right: -1px;
90
+ top: -1px;
91
+ bottom: -1px;
92
+ width: auto;
93
+ height: auto;
94
+ }
95
+
96
+ /* Preserve interaction border colours on table edges without changing the shared -1px overlay inset. */
97
+ > tbody
98
+ > tr
99
+ > td:is(
100
+ .${ClassName.SELECTED_CELL},
101
+ .${ClassName.HOVERED_CELL},
102
+ .${ClassName.ACTIVE_CURSOR_CELL}
103
+ ),
104
+ > tbody
105
+ > tr
106
+ > th:is(
107
+ .${ClassName.SELECTED_CELL},
108
+ .${ClassName.HOVERED_CELL},
109
+ .${ClassName.ACTIVE_CURSOR_CELL}
110
+ ) {
111
+ &[data-reaches-top] {
112
+ border-top-color: transparent;
113
+
114
+ &::after {
115
+ top: -1px;
116
+ bottom: -1px;
117
+ border-top-color: ${tableBorderSelectedColor};
118
+ }
119
+ }
120
+
121
+ &[data-reaches-left] {
122
+ border-left-color: transparent;
123
+
124
+ &::after {
125
+ border-left-color: ${tableBorderSelectedColor};
126
+ }
127
+ }
128
+
129
+ &[data-reaches-right] {
130
+ border-right-color: transparent;
131
+
132
+ &::after {
133
+ border-right-color: ${tableBorderSelectedColor};
134
+ }
135
+ }
136
+
137
+ &[data-reaches-bottom] {
138
+ border-bottom-color: transparent;
139
+
140
+ &::after {
141
+ border-bottom-color: ${tableBorderSelectedColor};
142
+ }
143
+ }
144
+ }
145
+
146
+ > tbody
147
+ > tr
148
+ > td.${ClassName.HOVERED_CELL_IN_DANGER},
149
+ > tbody
150
+ > tr
151
+ > th.${ClassName.HOVERED_CELL_IN_DANGER} {
152
+ &[data-reaches-top] {
153
+ border-top-color: transparent;
154
+
155
+ &::after {
156
+ top: -1px;
157
+ bottom: -1px;
158
+ border-top-color: ${tableBorderDeleteColor};
159
+ }
160
+ }
161
+
162
+ &[data-reaches-left] {
163
+ border-left-color: transparent;
164
+
165
+ &::after {
166
+ border-left-color: ${tableBorderDeleteColor};
167
+ }
168
+ }
169
+
170
+ &[data-reaches-right] {
171
+ border-right-color: transparent;
172
+
173
+ &::after {
174
+ border-right-color: ${tableBorderDeleteColor};
175
+ }
176
+ }
177
+
178
+ &[data-reaches-bottom] {
179
+ border-bottom-color: transparent;
180
+
181
+ &::after {
182
+ border-bottom-color: ${tableBorderDeleteColor};
183
+ }
184
+ }
185
+ }
186
+ }
187
+ `;
188
+ const roundedTableNumberedColumnStyles = () => css`
189
+ /* Numbered columns are separate, so they need their own rounded edge owner. */
190
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
191
+ /* Override the inline/container left border and replace it with one rounded pseudo-border. */
192
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
193
+ .${ClassName.NUMBERED_COLUMN},
194
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
195
+ .${ClassName.NUMBERED_COLUMN} {
196
+ position: relative;
197
+ border-left: 0;
198
+
199
+ &::before {
200
+ content: '';
201
+ position: absolute;
202
+ top: 0;
203
+ left: 0;
204
+ bottom: 0;
205
+ width: 100%;
206
+ border-left: 1px solid ${tableBorderColor};
207
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
208
+ border-bottom-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
209
+ pointer-events: none;
210
+ z-index: ${akEditorUnitZIndex};
211
+ }
212
+ }
213
+
214
+ /* Prevent individual number buttons from drawing a straight left border. */
215
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
216
+ .${ClassName.NUMBERED_COLUMN_BUTTON},
217
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
218
+ .${ClassName.NUMBERED_COLUMN_BUTTON} {
219
+ border-left-color: transparent;
220
+ }
221
+
222
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
223
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER},
224
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
225
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER},
226
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
227
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE},
228
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
229
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE},
230
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
231
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active,
232
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
233
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active {
234
+ border-left-color: transparent;
235
+ }
236
+
237
+ /* When numbered column is present, the visual left edge belongs to the number column widget.
238
+ Zero out any left-side border-radius on the cell and its overlays/pseudo-borders —
239
+ but leave right-side radii untouched so right-edge cells still round correctly.
240
+ ::before is intentionally excluded here because on the sticky header it carries the
241
+ numbered-column mask which needs to round its own top-left corner (see overrides
242
+ below and in roundedTableStickyHeaderStyles). */
243
+ > .${ClassName.TABLE_NODE_WRAPPER} > table > tbody > tr > th[data-reaches-top][data-reaches-left],
244
+ > .${ClassName.TABLE_NODE_WRAPPER}
245
+ > table
246
+ > tbody
247
+ > tr
248
+ > td[data-reaches-top][data-reaches-left] {
249
+ border-top-left-radius: 0;
250
+
251
+ &::after {
252
+ border-top-left-radius: 0;
253
+ }
254
+ }
255
+
256
+ > .${ClassName.TABLE_NODE_WRAPPER}
257
+ > table
258
+ > tbody
259
+ > tr
260
+ > th[data-reaches-bottom][data-reaches-left],
261
+ > .${ClassName.TABLE_NODE_WRAPPER}
262
+ > table
263
+ > tbody
264
+ > tr
265
+ > td[data-reaches-bottom][data-reaches-left] {
266
+ border-bottom-left-radius: 0;
267
+
268
+ &::after,
269
+ &::before {
270
+ border-bottom-left-radius: 0;
271
+ }
272
+ }
273
+
274
+ /* Preserve rounded numbered-column corners across normal, active, and danger states. */
275
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type,
276
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:first-of-type,
277
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE}:first-of-type,
278
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active:first-of-type {
279
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
280
+ }
281
+
282
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:last-of-type,
283
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:last-of-type,
284
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE}:last-of-type,
285
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active:last-of-type {
286
+ border-bottom-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
287
+ }
288
+
289
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:first-of-type::after {
290
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
291
+ }
292
+
293
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:last-of-type::after {
294
+ border-bottom-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
295
+ }
296
+
297
+ /* Sticky numbered-column mask also needs the same top-left radius. */
298
+ > .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW}
299
+ tr
300
+ th[data-reaches-top][data-reaches-left]::before {
301
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
302
+ }
303
+ }
304
+ `;
305
+ const roundedTableStickyHeaderCellCornerStyles = () => css`
306
+ /* Sticky header rows have independent border/shadow/mask painting, so patch the sticky-only painters too. */
307
+ .${ClassName.TABLE_NODE_WRAPPER} > table > tbody > tr.${ClassName.NATIVE_STICKY},
308
+ .${ClassName.TABLE_NODE_WRAPPER} > table.${ClassName.TABLE_STICKY} > tbody > tr.sticky {
309
+ > th[data-reaches-left],
310
+ > td[data-reaches-left] {
311
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
312
+
313
+ &::after,
314
+ &::before {
315
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
316
+ }
317
+ }
318
+
319
+ > td[data-reaches-right],
320
+ > th[data-reaches-right] {
321
+ border-top-right-radius: ${"var(--ds-radius-xlarge, 12px)"};
322
+
323
+ &::after,
324
+ &::before {
325
+ border-top-right-radius: ${"var(--ds-radius-xlarge, 12px)"};
326
+ }
327
+ }
328
+ }
329
+
330
+ .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
331
+ border-left-color: transparent;
332
+ }
333
+ `;
334
+ const roundedTableStickyHeaderNumberColumnStyles = () => css`
335
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} tr th[data-reaches-top][data-reaches-left]::before,
336
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} tr.${ClassName.NATIVE_STICKY} th[data-reaches-left]::before,
337
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} .${ClassName.NATIVE_STICKY_ACTIVE} th[data-reaches-left]::before {
338
+ border-top-left-radius: ${"var(--ds-radius-xlarge, 12px)"};
339
+ border-bottom: none;
340
+ }
341
+ `;
342
+ const roundedTableStickyHeaderCornerMaskStyles = () => css`
343
+ /* Same z-index as the sticky row; DOM order keeps the row above this mask and the table border below it. */
344
+ .${ClassName.TABLE_CORNER_MASK} {
345
+ display: none;
346
+ position: sticky;
347
+ top: calc(${tableMarginTop}px - 1px);
348
+ width: 12px;
349
+ height: 12px;
350
+ margin-bottom: -12px;
351
+ background: ${"var(--ds-surface, #FFFFFF)"};
352
+ pointer-events: none;
353
+ z-index: ${nativeStickyHeaderZIndex};
354
+ }
355
+
356
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true']
357
+ .${ClassName.TABLE_CORNER_MASK}[data-corner='left'] {
358
+ margin-left: -${akEditorTableNumberColumnWidth}px;
359
+ }
360
+
361
+ .${ClassName.TABLE_CORNER_MASK}[data-corner='right'] {
362
+ left: calc(100% - 11px);
363
+ }
364
+
365
+ /*
366
+ Scope the :has() selectors to a DIRECT child table so a nested table that
367
+ has its own sticky row does not pull the OUTER wrapper's masks into the
368
+ sticky / fallback layout. The masks belong to the wrapper of the table
369
+ that owns the sticky row, never to an ancestor wrapper.
370
+ */
371
+ .${ClassName.TABLE_NODE_WRAPPER}:has(> table > tbody > tr.${ClassName.NATIVE_STICKY})
372
+ > .${ClassName.TABLE_CORNER_MASK},
373
+ .${ClassName.TABLE_NODE_WRAPPER}:has(> table.${ClassName.TABLE_STICKY} > tbody > tr.sticky)
374
+ > .${ClassName.TABLE_CORNER_MASK} {
375
+ display: block;
376
+ }
377
+
378
+ /*
379
+ When the table overflows horizontally, sticky headers fall back from native
380
+ position: sticky to a fixed-position header row. Match that positioning so
381
+ the corner masks continue to cover the rounded corners in the fallback path.
382
+
383
+ The direct-child combinator inside :has() is critical: without it a nested
384
+ table entering the legacy fallback would incorrectly trigger this rule on
385
+ the OUTER wrapper, detaching the outer table's masks from its corners.
386
+ */
387
+ .${ClassName.TABLE_NODE_WRAPPER}:has(> table.${ClassName.TABLE_STICKY} > tbody > tr.sticky)
388
+ > .${ClassName.TABLE_CORNER_MASK} {
389
+ position: fixed;
390
+ top: 30px;
391
+ z-index: 1;
392
+ }
393
+ `;
394
+ const roundedTableStickyHeaderOverlayStyles = () => css`
395
+ /*
396
+ Paint the pinned sticky row's rounded top edge via each cell's ::after.
397
+ top: -1px places it in the reserved transparent border slot, aligned with
398
+ the row's inset-shadow bottom border. Longhand border-top-* lets
399
+ interaction-state rules override only the colour.
400
+ */
401
+ .${ClassName.TABLE_NODE_WRAPPER}
402
+ > table
403
+ > tbody
404
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
405
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-top]::after,
406
+ .${ClassName.TABLE_NODE_WRAPPER}
407
+ > table
408
+ > tbody
409
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
410
+ > td.${ClassName.TABLE_CELL}[data-reaches-top]::after {
411
+ content: '';
412
+ position: absolute;
413
+ left: -1px;
414
+ right: -1px;
415
+ top: -1px;
416
+ bottom: -1px;
417
+ width: auto;
418
+ height: auto;
419
+ pointer-events: none;
420
+ border-top-width: 1px;
421
+ border-top-style: solid;
422
+ border-top-color: ${tableBorderColor};
423
+ }
424
+
425
+ /* Selection / hover / active-cursor colour for the painted top edge. */
426
+ .${ClassName.TABLE_NODE_WRAPPER}
427
+ > table
428
+ > tbody
429
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
430
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-top]:is(
431
+ .${ClassName.SELECTED_CELL},
432
+ .${ClassName.HOVERED_CELL},
433
+ .${ClassName.ACTIVE_CURSOR_CELL}
434
+ )::after,
435
+ .${ClassName.TABLE_NODE_WRAPPER}
436
+ > table
437
+ > tbody
438
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
439
+ > td.${ClassName.TABLE_CELL}[data-reaches-top]:is(
440
+ .${ClassName.SELECTED_CELL},
441
+ .${ClassName.HOVERED_CELL},
442
+ .${ClassName.ACTIVE_CURSOR_CELL}
443
+ )::after {
444
+ border-top-color: ${tableBorderSelectedColor};
445
+ }
446
+
447
+ /* Danger colour for the painted top edge. */
448
+ .${ClassName.TABLE_NODE_WRAPPER}
449
+ > table
450
+ > tbody
451
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
452
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-top].${ClassName.HOVERED_CELL_IN_DANGER}::after,
453
+ .${ClassName.TABLE_NODE_WRAPPER}
454
+ > table
455
+ > tbody
456
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
457
+ > td.${ClassName.TABLE_CELL}[data-reaches-top].${ClassName.HOVERED_CELL_IN_DANGER}::after {
458
+ border-top-color: ${tableBorderDeleteColor};
459
+ }
460
+
461
+ :where(.${ClassName.TABLE_NODE_WRAPPER} > table > tbody > tr.${ClassName.NATIVE_STICKY})
462
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-left]::after {
463
+ border-left-color: transparent;
464
+ }
465
+ `;
466
+ const roundedTableStickyHeaderShadowStyles = () => css`
467
+ /* Native sticky row */
468
+ .${ClassName.TABLE_NODE_WRAPPER}
469
+ > table
470
+ > tbody
471
+ > tr.${ClassName.NATIVE_STICKY},
472
+ /* Legacy sticky row */
473
+ .${ClassName.TABLE_NODE_WRAPPER}
474
+ > table.${ClassName.TABLE_STICKY}
475
+ > tbody
476
+ > tr.sticky {
477
+ box-shadow: inset 0 -1px ${tableBorderColor} !important;
478
+ }
479
+
480
+ /*
481
+ Box-shadow below active sticky header.
482
+ */
483
+ .${ClassName.TABLE_NODE_WRAPPER}
484
+ > table
485
+ > tbody
486
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE} {
487
+ box-shadow:
488
+ inset 0 -1px ${tableBorderColor},
489
+ 0 6px 4px -4px ${"var(--ds-shadow-overflow-perimeter, #1E1F211f)"} !important;
490
+ }
491
+
492
+ /*
493
+ Sticky headers leave the table's rounded outer overlay behind, so make the
494
+ reserved 1px top-border slot visible on the pinned row.
495
+ */
496
+ .${ClassName.TABLE_NODE_WRAPPER}
497
+ > table
498
+ > tbody
499
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
500
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-top],
501
+ .${ClassName.TABLE_NODE_WRAPPER}
502
+ > table
503
+ > tbody
504
+ > tr.${ClassName.NATIVE_STICKY}.${ClassName.NATIVE_STICKY_ACTIVE}
505
+ > td.${ClassName.TABLE_CELL}[data-reaches-top],
506
+ .${ClassName.TABLE_NODE_WRAPPER}
507
+ > table.${ClassName.TABLE_STICKY}
508
+ > tbody
509
+ > tr.sticky
510
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-top],
511
+ .${ClassName.TABLE_NODE_WRAPPER}
512
+ > table.${ClassName.TABLE_STICKY}
513
+ > tbody
514
+ > tr.sticky
515
+ > td.${ClassName.TABLE_CELL}[data-reaches-top] {
516
+ border-top-color: ${tableBorderColor};
517
+ }
518
+
519
+ /*
520
+ Restore legacy sticky corner side borders after the row is pinned outside the
521
+ table's outer overlay. (Pinned row top edge is painted by the cell ::after
522
+ overlay in roundedTableStickyHeaderOverlayStyles.)
523
+ */
524
+ .${ClassName.TABLE_NODE_WRAPPER}
525
+ > table.${ClassName.TABLE_STICKY}
526
+ > tbody
527
+ > tr.sticky
528
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-left],
529
+ .${ClassName.TABLE_NODE_WRAPPER}
530
+ > table.${ClassName.TABLE_STICKY}
531
+ > tbody
532
+ > tr.sticky
533
+ > td.${ClassName.TABLE_CELL}[data-reaches-left] {
534
+ border-left-color: ${tableBorderColor};
535
+ }
536
+
537
+ .${ClassName.TABLE_NODE_WRAPPER}
538
+ > table.${ClassName.TABLE_STICKY}
539
+ > tbody
540
+ > tr.sticky
541
+ > th.${ClassName.TABLE_HEADER_CELL}[data-reaches-right],
542
+ .${ClassName.TABLE_NODE_WRAPPER}
543
+ > table.${ClassName.TABLE_STICKY}
544
+ > tbody
545
+ > tr.sticky
546
+ > td.${ClassName.TABLE_CELL}[data-reaches-right] {
547
+ border-right: 1px solid ${tableBorderColor};
548
+ }
549
+
550
+ /*
551
+ Paint the legacy sticky bottom edge on cells so it aligns under display: grid.
552
+ */
553
+ .${ClassName.TABLE_NODE_WRAPPER}
554
+ > table.${ClassName.TABLE_STICKY}
555
+ > tbody
556
+ > tr.sticky
557
+ > th.${ClassName.TABLE_HEADER_CELL},
558
+ .${ClassName.TABLE_NODE_WRAPPER}
559
+ > table.${ClassName.TABLE_STICKY}
560
+ > tbody
561
+ > tr.sticky
562
+ > td.${ClassName.TABLE_CELL} {
563
+ border-bottom: 1px solid ${tableBorderColor};
564
+ }
565
+
566
+ .${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS}:has(tr.sticky)
567
+ .${ClassName.NUMBERED_COLUMN}
568
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
569
+ box-shadow: none !important;
570
+ }
571
+ `;
572
+ export const roundedTableOverrides = () => css`
573
+ ${roundedTableCellCornerStyles()}
574
+ ${roundedTableInteractionOverlayStyles()}
575
+ ${roundedTableNumberedColumnStyles()}
576
+ ${roundedTableStickyHeaderCellCornerStyles()}
577
+ ${roundedTableStickyHeaderNumberColumnStyles()}
578
+ ${roundedTableStickyHeaderCornerMaskStyles()}
579
+ ${roundedTableStickyHeaderOverlayStyles()}
580
+ ${roundedTableStickyHeaderShadowStyles()}
581
+ `;
@@ -65,7 +65,7 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
65
65
  }
66
66
  });
67
67
  if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
68
- _this.updateTableEdgeAttrs(node);
68
+ _this.updateTableEdgeAttrs();
69
69
  }
70
70
 
71
71
  // CONFCLOUD-78239: Previously we had a bug which tried to invert the heading colour of a table
@@ -116,7 +116,7 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
116
116
  */
117
117
  }, {
118
118
  key: "updateTableEdgeAttrs",
119
- value: function updateTableEdgeAttrs(node) {
119
+ value: function updateTableEdgeAttrs() {
120
120
  var pos = this.getPos();
121
121
  if (pos === undefined) {
122
122
  return;
@@ -211,9 +211,6 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
211
211
  removedAttrs.forEach(function (key) {
212
212
  return _this2.dom.removeAttribute(key);
213
213
  });
214
- if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
215
- this.updateTableEdgeAttrs(node);
216
- }
217
214
  return true;
218
215
  }
219
216
 
@@ -35,7 +35,7 @@ import { pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-header
35
35
  import { findStickyHeaderForTable } from '../pm-plugins/sticky-headers/util';
36
36
  import { hasTableBeenResized, insertColgroupFromNode } from '../pm-plugins/table-resizing/utils/colgroup';
37
37
  import { COLUMN_MIN_WIDTH, TABLE_EDITOR_MARGIN, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
38
- import { updateControls } from '../pm-plugins/table-resizing/utils/dom';
38
+ import { syncStickyRowToTable, updateControls } from '../pm-plugins/table-resizing/utils/dom';
39
39
  import { getLayoutSize, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '../pm-plugins/table-resizing/utils/misc';
40
40
  import { getResizeState, updateColgroup } from '../pm-plugins/table-resizing/utils/resize-state';
41
41
  import { scaleTable } from '../pm-plugins/table-resizing/utils/scale-table';
@@ -134,6 +134,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
134
134
  header.scrollLeft = _this.wrapper.scrollLeft;
135
135
  header.style.marginRight = '2px';
136
136
  }
137
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
138
+ syncStickyRowToTable(_this.table);
139
+ }
137
140
  }
138
141
 
139
142
  // force update to for table controls to re-align
@@ -972,7 +975,21 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
972
975
  , {
973
976
  className: classnames(ClassName.TABLE_NODE_WRAPPER),
974
977
  ref: this.setWrapperRef
975
- }, allowControls && colControls), !this.isNestedInTable ? /*#__PURE__*/React.createElement("div", {
978
+ }, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
979
+ contentEditable: false,
980
+ "aria-hidden": "true"
981
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
982
+ ,
983
+ className: ClassName.TABLE_CORNER_MASK,
984
+ "data-corner": "left"
985
+ }), /*#__PURE__*/React.createElement("div", {
986
+ contentEditable: false,
987
+ "aria-hidden": "true"
988
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
989
+ ,
990
+ className: ClassName.TABLE_CORNER_MASK,
991
+ "data-corner": "right"
992
+ })), allowControls && colControls), !this.isNestedInTable ? /*#__PURE__*/React.createElement("div", {
976
993
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
977
994
  className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
978
995
  "data-vc-nvs": "true",
@@ -13,10 +13,11 @@ import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
13
13
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
14
14
  import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
17
  import { getPluginState } from '../pm-plugins/plugin-factory';
17
18
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
18
19
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
19
- import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../pm-plugins/table-resizing/utils/dom';
20
+ import { clearStickyCornerMaskPositions, syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../pm-plugins/table-resizing/utils/dom';
20
21
  import { getTop, getTree } from '../pm-plugins/utils/dom';
21
22
  import { supportedHeaderRow } from '../pm-plugins/utils/nodes';
22
23
  import { TableCssClassName as ClassName, TableCssClassName } from '../types';
@@ -697,6 +698,9 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
697
698
  return;
698
699
  }
699
700
  this.dom.style.removeProperty('width');
701
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
702
+ clearStickyCornerMaskPositions(table);
703
+ }
700
704
  this.dom.classList.remove('sticky');
701
705
  table.classList.remove(ClassName.TABLE_STICKY);
702
706
  this.isSticky = false;
@@ -20,7 +20,7 @@ import { INITIAL_STATIC_VIEWPORT_HEIGHT } from '../pm-plugins/editor-content-are
20
20
  import { getPluginState } from '../pm-plugins/plugin-factory';
21
21
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
22
22
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
23
- import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../pm-plugins/table-resizing/utils/dom';
23
+ import { clearStickyCornerMaskPositions, syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../pm-plugins/table-resizing/utils/dom';
24
24
  import { areAllRectsZero, getTop, getTree } from '../pm-plugins/utils/dom';
25
25
  import { supportedHeaderRow } from '../pm-plugins/utils/nodes';
26
26
  import { TableCssClassName as ClassName, TableCssClassName } from '../types';
@@ -945,6 +945,9 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
945
945
  return;
946
946
  }
947
947
  this.dom.style.removeProperty('width');
948
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
949
+ clearStickyCornerMaskPositions(table);
950
+ }
948
951
  this.dom.classList.remove('sticky');
949
952
  table.classList.remove(ClassName.TABLE_STICKY);
950
953
  this.isLegacySticky = false;