@atlaskit/editor-plugin-table 22.4.2 → 22.4.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.
@@ -2,7 +2,6 @@ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
2
2
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
4
4
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  import { updateColumnWidths } from '../../transforms/column-width';
7
6
  import { getTableWidth } from '../../utils/nodes';
8
7
  import { getLayoutSize } from '../utils/misc';
@@ -165,7 +164,7 @@ export const scaleTable = (tableRef, options, domAtPos, api, isTableScalingEnabl
165
164
  // table's outer width to exceed the colgroup width by 1px. Subtract 1px from the
166
165
  // parentWidth here so that the scaled colgroup fits within the sync-block
167
166
  // container without overflowing.
168
- const isNestedInBodiedSyncBlock = !!((_tableRef$closest = tableRef.closest) !== null && _tableRef$closest !== void 0 && _tableRef$closest.call(tableRef, `.${BodiedSyncBlockSharedCssClassName.content}`)) && fg('platform_synced_block_patch_9');
167
+ const isNestedInBodiedSyncBlock = !!((_tableRef$closest = tableRef.closest) !== null && _tableRef$closest !== void 0 && _tableRef$closest.call(tableRef, `.${BodiedSyncBlockSharedCssClassName.content}`));
169
168
  const BORDER_COLLAPSE_WIDTH_PX = 1;
170
169
  const adjustedParentWidth = isNestedInBodiedSyncBlock ? parentWidth - BORDER_COLLAPSE_WIDTH_PX : parentWidth;
171
170
  resizeState = scaleWithParent(tableRef, adjustedParentWidth, node, start, domAtPos, isTableScalingEnabledOnCurrentTable, shouldUseIncreasedScalingPercent);
@@ -60,9 +60,9 @@ export default class NumberColumn extends Component {
60
60
  style: {
61
61
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
62
62
  marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
63
- borderLeft:
63
+ borderLeft: isDragAndDropEnabled && tableActive && !expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ?
64
64
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
65
- isDragAndDropEnabled && tableActive ? `1px solid ${tableBorderColor}` : undefined,
65
+ `1px solid ${tableBorderColor}` : undefined,
66
66
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
67
67
  visibility: 'hidden' // Ensure the column is not visible during SSR
68
68
  },
@@ -75,9 +75,9 @@ export default class NumberColumn extends Component {
75
75
  style: {
76
76
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
77
77
  marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
78
- borderLeft:
78
+ borderLeft: isDragAndDropEnabled && tableActive && !expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ?
79
79
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
80
- isDragAndDropEnabled && tableActive ? `1px solid ${tableBorderColor}` : undefined,
80
+ `1px solid ${tableBorderColor}` : undefined,
81
81
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
82
82
  visibility: 'visible'
83
83
  },
@@ -218,22 +218,443 @@ const tableStickyHeaderFirefoxFixStyle = () => {
218
218
  `;
219
219
  }
220
220
  };
221
- const activeCellHighlightStyles = () => {
222
- return css`
223
- .${ClassName.TABLE_NODE_WRAPPER} {
224
- td.${ClassName.TABLE_CELL}.${ClassName.ACTIVE_CURSOR_CELL}::after,
225
- th.${ClassName.TABLE_HEADER_CELL}.${ClassName.ACTIVE_CURSOR_CELL}::after {
226
- border: 1px solid ${"var(--ds-border-selected, #1868DB)"};
227
- box-shadow: ${"var(--ds-shadow-raised, 0px 1px 1px #1E1F2140, 0px 0px 1px #1E1F214f)"};
221
+ const roundedTableCellCornerStyles = () => css`
222
+ .${ClassName.TABLE_NODE_WRAPPER} > table {
223
+ /* Round table corner cells (including merged cells that span to the edge)
224
+ and their interaction overlays. The data-reaches-* attributes are set by the
225
+ TableCell node view based on each cell's position + rowspan/colspan. */
226
+ > tbody > tr > td[data-reaches-top][data-reaches-left],
227
+ > tbody > tr > th[data-reaches-top][data-reaches-left] {
228
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
229
+
230
+ &::after,
231
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
232
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
233
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
234
+ }
235
+ }
236
+
237
+ > tbody > tr > td[data-reaches-top][data-reaches-right],
238
+ > tbody > tr > th[data-reaches-top][data-reaches-right] {
239
+ border-top-right-radius: ${"var(--ds-radius-medium, 6px)"};
240
+
241
+ &::after,
242
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
243
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
244
+ border-top-right-radius: ${"var(--ds-radius-medium, 6px)"};
245
+ }
246
+ }
247
+
248
+ > tbody > tr > td[data-reaches-bottom][data-reaches-left],
249
+ > tbody > tr > th[data-reaches-bottom][data-reaches-left] {
250
+ border-bottom-left-radius: ${"var(--ds-radius-medium, 6px)"};
251
+
252
+ &::after,
253
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
254
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
255
+ border-bottom-left-radius: ${"var(--ds-radius-medium, 6px)"};
256
+ }
257
+ }
258
+
259
+ > tbody > tr > td[data-reaches-bottom][data-reaches-right],
260
+ > tbody > tr > th[data-reaches-bottom][data-reaches-right] {
261
+ border-bottom-right-radius: ${"var(--ds-radius-medium, 6px)"};
262
+
263
+ &::after,
264
+ &.${ClassName.HOVERED_CELL_IN_DANGER}::after,
265
+ &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
266
+ border-bottom-right-radius: ${"var(--ds-radius-medium, 6px)"};
267
+ }
268
+ }
269
+ }
270
+ `;
271
+ const roundedTableInteractionOverlayStyles = () => css`
272
+ .${ClassName.TABLE_NODE_WRAPPER} > table {
273
+ /* Active-cell highlight base properties (replaces activeCellHighlightStyles).
274
+ width/height: auto overrides the base cell ::after which uses width: 100%; height: 100%,
275
+ so that left/right/top/bottom determine the size instead. */
276
+ td.${ClassName.TABLE_CELL}.${ClassName.ACTIVE_CURSOR_CELL}::after,
277
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.ACTIVE_CURSOR_CELL}::after {
278
+ border: 1px solid ${"var(--ds-border-selected, #1868DB)"};
279
+ box-shadow: ${"var(--ds-shadow-raised, 0px 1px 1px #1E1F2140, 0px 0px 1px #1E1F214f)"};
280
+ content: '';
281
+ position: absolute;
282
+ top: -1px;
283
+ left: -1px;
284
+ right: -1px;
285
+ bottom: -1px;
286
+ width: auto;
287
+ height: auto;
288
+ z-index: ${akEditorSmallZIndex};
289
+ pointer-events: none;
290
+ }
291
+
292
+ /* Normalize selected/hover/danger overlays to the same box model as active-cell.
293
+ width/height: auto overrides the base cell ::after which uses width: 100%; height: 100%. */
294
+ td.${ClassName.HOVERED_CELL}::after,
295
+ td.${ClassName.SELECTED_CELL}::after,
296
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.SELECTED_CELL}::after,
297
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL}::after,
298
+ th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL_IN_DANGER}::after,
299
+ td.${ClassName.TABLE_CELL}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
300
+ left: -1px;
301
+ right: -1px;
302
+ top: -1px;
303
+ bottom: -1px;
304
+ width: auto;
305
+ height: auto;
306
+ }
307
+
308
+ /* Active-cell overlays: clamp outer sides using data-reaches-* attributes.
309
+ Internal sides keep -1px overlap; true outer edges are clamped to 0. */
310
+ > tbody
311
+ > tr
312
+ > td[data-reaches-top].${ClassName.ACTIVE_CURSOR_CELL}::after,
313
+ > tbody
314
+ > tr
315
+ > th[data-reaches-top].${ClassName.ACTIVE_CURSOR_CELL}::after {
316
+ top: 0;
317
+ }
318
+
319
+ > tbody
320
+ > tr
321
+ > td[data-reaches-left].${ClassName.ACTIVE_CURSOR_CELL}::after,
322
+ > tbody
323
+ > tr
324
+ > th[data-reaches-left].${ClassName.ACTIVE_CURSOR_CELL}::after {
325
+ left: 0;
326
+ }
327
+
328
+ > tbody
329
+ > tr
330
+ > td[data-reaches-right].${ClassName.ACTIVE_CURSOR_CELL}::after,
331
+ > tbody
332
+ > tr
333
+ > th[data-reaches-right].${ClassName.ACTIVE_CURSOR_CELL}::after {
334
+ right: 0;
335
+ }
336
+
337
+ > tbody
338
+ > tr
339
+ > td[data-reaches-bottom].${ClassName.ACTIVE_CURSOR_CELL}::after,
340
+ > tbody
341
+ > tr
342
+ > th[data-reaches-bottom].${ClassName.ACTIVE_CURSOR_CELL}::after {
343
+ bottom: 0;
344
+ }
345
+
346
+ /* Selected/hover/active overlays: clamp outer left side and draw overlay border. */
347
+ > tbody
348
+ > tr
349
+ > td[data-reaches-left].${ClassName.SELECTED_CELL},
350
+ > tbody
351
+ > tr
352
+ > th[data-reaches-left].${ClassName.SELECTED_CELL},
353
+ > tbody
354
+ > tr
355
+ > td[data-reaches-left].${ClassName.HOVERED_CELL},
356
+ > tbody
357
+ > tr
358
+ > th[data-reaches-left].${ClassName.HOVERED_CELL},
359
+ > tbody
360
+ > tr
361
+ > td[data-reaches-left].${ClassName.ACTIVE_CURSOR_CELL},
362
+ > tbody
363
+ > tr
364
+ > th[data-reaches-left].${ClassName.ACTIVE_CURSOR_CELL} {
365
+ border-left-color: transparent;
366
+
367
+ &::after {
368
+ left: 0;
369
+ border-left-color: ${tableBorderSelectedColor};
370
+ }
371
+ }
372
+
373
+ /* Danger/delete overlays: clamp outer left side. */
374
+ > tbody
375
+ > tr
376
+ > td[data-reaches-left].${ClassName.HOVERED_CELL_IN_DANGER},
377
+ > tbody
378
+ > tr
379
+ > th[data-reaches-left].${ClassName.HOVERED_CELL_IN_DANGER} {
380
+ border-left-color: transparent;
381
+
382
+ &::after {
383
+ left: 0;
384
+ border-left-color: ${tableBorderDeleteColor};
385
+ }
386
+ }
387
+
388
+ /* Selected/hover/active overlays: clamp outer right side. */
389
+ > tbody
390
+ > tr
391
+ > td[data-reaches-right].${ClassName.SELECTED_CELL},
392
+ > tbody
393
+ > tr
394
+ > th[data-reaches-right].${ClassName.SELECTED_CELL},
395
+ > tbody
396
+ > tr
397
+ > td[data-reaches-right].${ClassName.HOVERED_CELL},
398
+ > tbody
399
+ > tr
400
+ > th[data-reaches-right].${ClassName.HOVERED_CELL},
401
+ > tbody
402
+ > tr
403
+ > td[data-reaches-right].${ClassName.ACTIVE_CURSOR_CELL},
404
+ > tbody
405
+ > tr
406
+ > th[data-reaches-right].${ClassName.ACTIVE_CURSOR_CELL} {
407
+ border-right-color: transparent;
408
+
409
+ &::after {
410
+ right: 0;
411
+ border-right-color: ${tableBorderSelectedColor};
412
+ }
413
+ }
414
+
415
+ /* Danger/delete overlays: clamp outer right side. */
416
+ > tbody
417
+ > tr
418
+ > td[data-reaches-right].${ClassName.HOVERED_CELL_IN_DANGER},
419
+ > tbody
420
+ > tr
421
+ > th[data-reaches-right].${ClassName.HOVERED_CELL_IN_DANGER} {
422
+ border-right-color: transparent;
423
+
424
+ &::after {
425
+ right: 0;
426
+ border-right-color: ${tableBorderDeleteColor};
427
+ }
428
+ }
429
+
430
+ /* Selected/hover/active overlays: clamp outer bottom side. */
431
+ > tbody
432
+ > tr
433
+ > td[data-reaches-bottom].${ClassName.SELECTED_CELL},
434
+ > tbody
435
+ > tr
436
+ > th[data-reaches-bottom].${ClassName.SELECTED_CELL},
437
+ > tbody
438
+ > tr
439
+ > td[data-reaches-bottom].${ClassName.HOVERED_CELL},
440
+ > tbody
441
+ > tr
442
+ > th[data-reaches-bottom].${ClassName.HOVERED_CELL},
443
+ > tbody
444
+ > tr
445
+ > td[data-reaches-bottom].${ClassName.ACTIVE_CURSOR_CELL},
446
+ > tbody
447
+ > tr
448
+ > th[data-reaches-bottom].${ClassName.ACTIVE_CURSOR_CELL} {
449
+ border-bottom-color: transparent;
450
+
451
+ &::after {
452
+ border-bottom-color: ${tableBorderSelectedColor};
453
+ }
454
+ }
455
+
456
+ /* Danger/delete overlays: clamp outer bottom side. */
457
+ > tbody
458
+ > tr
459
+ > td[data-reaches-bottom].${ClassName.HOVERED_CELL_IN_DANGER},
460
+ > tbody
461
+ > tr
462
+ > th[data-reaches-bottom].${ClassName.HOVERED_CELL_IN_DANGER} {
463
+ border-bottom-color: transparent;
464
+
465
+ &::after {
466
+ border-bottom-color: ${tableBorderDeleteColor};
467
+ }
468
+ }
469
+ }
470
+ `;
471
+ const roundedTableNumberedColumnStyles = () => css`
472
+ /* Numbered columns are separate, so they need their own rounded edge owner. */
473
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
474
+ /* Override the inline/container left border and replace it with one rounded pseudo-border. */
475
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
476
+ .${ClassName.NUMBERED_COLUMN},
477
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
478
+ .${ClassName.NUMBERED_COLUMN} {
479
+ position: relative;
480
+ border-left: 0;
481
+
482
+ &::before {
228
483
  content: '';
229
484
  position: absolute;
230
- inset: -1px;
231
- z-index: ${akEditorSmallZIndex};
485
+ top: 0;
486
+ left: 0;
487
+ bottom: 0;
488
+ width: 100%;
489
+ border-left: 1px solid ${tableBorderColor};
490
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
491
+ border-bottom-left-radius: ${"var(--ds-radius-medium, 6px)"};
232
492
  pointer-events: none;
493
+ z-index: ${akEditorUnitZIndex};
233
494
  }
234
495
  }
235
- `;
236
- };
496
+
497
+ /* Prevent individual number buttons from drawing a straight left border. */
498
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
499
+ .${ClassName.NUMBERED_COLUMN_BUTTON},
500
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
501
+ .${ClassName.NUMBERED_COLUMN_BUTTON} {
502
+ border-left-color: transparent;
503
+ }
504
+
505
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
506
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER},
507
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
508
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER},
509
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
510
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE},
511
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
512
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE},
513
+ > .${ClassName.ROW_CONTROLS_WRAPPER}
514
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active,
515
+ > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
516
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active {
517
+ border-left-color: transparent;
518
+ }
519
+
520
+ /* When numbered column is present, the visual left edge belongs to the number column widget.
521
+ Zero out any left-side border-radius on the cell and its overlays/pseudo-borders —
522
+ but leave right-side radii untouched so right-edge cells still round correctly. */
523
+ .${ClassName.TABLE_NODE_WRAPPER} > table > tbody > tr > th[data-reaches-top][data-reaches-left],
524
+ .${ClassName.TABLE_NODE_WRAPPER}
525
+ > table
526
+ > tbody
527
+ > tr
528
+ > td[data-reaches-top][data-reaches-left] {
529
+ border-top-left-radius: 0;
530
+
531
+ &::after,
532
+ &::before {
533
+ border-top-left-radius: 0;
534
+ }
535
+ }
536
+
537
+ .${ClassName.TABLE_NODE_WRAPPER}
538
+ > table
539
+ > tbody
540
+ > tr
541
+ > th[data-reaches-bottom][data-reaches-left],
542
+ .${ClassName.TABLE_NODE_WRAPPER}
543
+ > table
544
+ > tbody
545
+ > tr
546
+ > td[data-reaches-bottom][data-reaches-left] {
547
+ border-bottom-left-radius: 0;
548
+
549
+ &::after,
550
+ &::before {
551
+ border-bottom-left-radius: 0;
552
+ }
553
+ }
554
+
555
+ /* Preserve rounded numbered-column corners across normal, active, and danger states. */
556
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
557
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
558
+ }
559
+
560
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:last-of-type {
561
+ border-bottom-left-radius: ${"var(--ds-radius-medium, 6px)"};
562
+ }
563
+
564
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:first-of-type,
565
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE}:first-of-type,
566
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active:first-of-type {
567
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
568
+ }
569
+
570
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:last-of-type,
571
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_ACTIVE}:last-of-type,
572
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.active:last-of-type {
573
+ border-bottom-left-radius: ${"var(--ds-radius-medium, 6px)"};
574
+ }
575
+
576
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:first-of-type::after {
577
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
578
+ }
579
+
580
+ .${ClassName.NUMBERED_COLUMN_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER}:last-of-type::after {
581
+ border-bottom-left-radius: ${"var(--ds-radius-medium, 6px)"};
582
+ }
583
+
584
+ /* Sticky numbered-column mask also needs the same top-left radius. */
585
+ .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW}
586
+ tr
587
+ th[data-reaches-top][data-reaches-left]::before {
588
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
589
+ }
590
+ }
591
+ `;
592
+ const roundedTableStickyHeaderStyles = () => css`
593
+ /* Sticky header rows have independent border/shadow/mask painting, so patch the sticky-only painters too. */
594
+ .${ClassName.TABLE_NODE_WRAPPER}
595
+ > table
596
+ > tbody
597
+ > tr.${ClassName.NATIVE_STICKY},
598
+ .${ClassName.TABLE_NODE_WRAPPER}
599
+ > table.${ClassName.TABLE_STICKY}
600
+ > tbody
601
+ > tr.sticky {
602
+ > th[data-reaches-left],
603
+ > td[data-reaches-left] {
604
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
605
+
606
+ &::after,
607
+ &::before {
608
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
609
+ }
610
+ }
611
+
612
+ > td[data-reaches-right],
613
+ > th[data-reaches-right] {
614
+ border-top-right-radius: ${"var(--ds-radius-medium, 6px)"};
615
+
616
+ &::after,
617
+ &::before {
618
+ border-top-right-radius: ${"var(--ds-radius-medium, 6px)"};
619
+ }
620
+ }
621
+ }
622
+
623
+ .${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
624
+ border-left-color: transparent;
625
+ }
626
+
627
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} tr th[data-reaches-top][data-reaches-left]::before,
628
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} tr.${ClassName.NATIVE_STICKY} th[data-reaches-left]::before,
629
+ .${ClassName.TABLE_CONTAINER}[data-number-column='true'] .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} .${ClassName.NATIVE_STICKY_ACTIVE} th[data-reaches-left]::before {
630
+ border-top-left-radius: ${"var(--ds-radius-medium, 6px)"};
631
+ clip-path: inset(0 0 0 0 round ${"var(--ds-radius-medium, 6px)"} 0 0 0);
632
+ box-shadow: none !important;
633
+ }
634
+
635
+ .${ClassName.TABLE_NODE_WRAPPER}
636
+ > table
637
+ > tbody
638
+ > tr.${ClassName.NATIVE_STICKY},
639
+ .${ClassName.TABLE_NODE_WRAPPER}
640
+ > table.${ClassName.TABLE_STICKY}
641
+ > tbody
642
+ > tr.sticky {
643
+ box-shadow: none !important;
644
+ }
645
+
646
+ .${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS}:has(tr.sticky)
647
+ .${ClassName.NUMBERED_COLUMN}
648
+ .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
649
+ box-shadow: none !important;
650
+ }
651
+ `;
652
+ const roundedTableOverrides = () => css`
653
+ ${roundedTableCellCornerStyles()}
654
+ ${roundedTableInteractionOverlayStyles()}
655
+ ${roundedTableNumberedColumnStyles()}
656
+ ${roundedTableStickyHeaderStyles()}
657
+ `;
237
658
  const baseTableStylesWithoutSharedStyle = props => css`
238
659
  ${columnControlsLineMarker()};
239
660
  ${hoveredDeleteButton()};
@@ -1080,7 +1501,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
1080
1501
  pointer-events: none;
1081
1502
  }
1082
1503
  .${ClassName.SELECTED_CELL} {
1083
- border: 1px solid ${tableBorderSelectedColor};
1504
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? '' /* Cell borders handled by ::after overlay in rounded mode. */ : `border: 1px solid ${tableBorderSelectedColor};`}
1084
1505
  }
1085
1506
  .${ClassName.SELECTED_CELL}::after {
1086
1507
  background: ${tableCellSelectedColor};
@@ -1089,8 +1510,8 @@ const baseTableStylesWithoutSharedStyle = props => css`
1089
1510
  /* Override border colors for danger state */
1090
1511
  th.${ClassName.TABLE_HEADER_CELL}.${ClassName.HOVERED_CELL_IN_DANGER},
1091
1512
  td.${ClassName.TABLE_CELL}.${ClassName.HOVERED_CELL_IN_DANGER} {
1092
- border-left-color: ${tableBorderDeleteColor};
1093
- border-top-color: ${tableBorderDeleteColor};
1513
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? '' /* Cell border colors are handled by the ::after overlay in rounded mode. */ : `border-left-color: ${tableBorderDeleteColor};
1514
+ border-top-color: ${tableBorderDeleteColor};`}
1094
1515
  &::after {
1095
1516
  height: 100%;
1096
1517
  width: 100%;
@@ -1137,8 +1558,7 @@ const baseTableStylesWithoutSharedStyle = props => css`
1137
1558
  }
1138
1559
  }
1139
1560
 
1140
- /* Active cursor cell highlight */
1141
- ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? activeCellHighlightStyles() : ''}
1561
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableOverrides() : ''}
1142
1562
 
1143
1563
  /* override for DnD controls */
1144
1564
  .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} {
@@ -3,6 +3,7 @@
3
3
  import { css } from '@emotion/react';
4
4
  import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
5
5
  import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
7
  import { TableCssClassName as ClassName } from '../types';
7
8
  import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
8
9
  const InsertLine = cssString => css`
@@ -531,7 +532,7 @@ export const columnControlsDecoration = () => {
531
532
  export const hoveredDeleteButton = () => css`
532
533
  .${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
533
534
  .${ClassName.SELECTED_CELL}, .${ClassName.COLUMN_SELECTED}, .${ClassName.HOVERED_CELL} {
534
- border: 1px solid ${tableBorderDeleteColor};
535
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? '' /* Cell borders handled by ::after overlay in rounded mode. */ : `border: 1px solid ${tableBorderDeleteColor};`}
535
536
  }
536
537
  .${ClassName.SELECTED_CELL}::after {
537
538
  background: ${tableCellDeleteColor};
@@ -557,11 +558,11 @@ export const hoveredCell = () => css`
557
558
  .${ClassName.TABLE_CONTAINER}:not(.${ClassName.HOVERED_DELETE_BUTTON}) {
558
559
  .${ClassName.HOVERED_CELL} {
559
560
  position: relative;
560
- border: 1px solid ${tableBorderSelectedColor};
561
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? '' /* Cell borders handled by ::after overlay in rounded mode. */ : `border: 1px solid ${tableBorderSelectedColor};`}
561
562
  }
562
563
  .${ClassName.HOVERED_CELL}.${ClassName.HOVERED_NO_HIGHLIGHT} {
563
564
  position: relative;
564
- border: 1px solid ${tableBorderColor};
565
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? '' /* Cell borders handled by ::after overlay in rounded mode. */ : `border: 1px solid ${tableBorderColor};`}
565
566
  }
566
567
  }
567
568
  `;
@@ -9,6 +9,8 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  import { getCellAttrs, getCellDomAttrs } from '@atlaskit/adf-schema';
11
11
  import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
12
+ import { TableMap } from '@atlaskit/editor-tables';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
14
  import TableNodeView from './TableNodeViewBase';
13
15
  var DEFAULT_COL_SPAN = 1;
14
16
  var DEFAULT_ROW_SPAN = 1;
@@ -42,6 +44,22 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
42
44
  var _this;
43
45
  _classCallCheck(this, TableCell);
44
46
  _this = _callSuper(this, TableCell, [node, view, getPos, eventDispatcher]);
47
+ /** Cached edge state to avoid redundant DOM writes. */
48
+ _defineProperty(_this, "prevReachesTop", false);
49
+ _defineProperty(_this, "prevReachesBottom", false);
50
+ _defineProperty(_this, "prevReachesLeft", false);
51
+ _defineProperty(_this, "prevReachesRight", false);
52
+ _defineProperty(_this, "destroy", function () {
53
+ if (_this.delayHandle && typeof window !== 'undefined') {
54
+ var _window, _window$cancelIdleCal, _window2, _window2$cancelAnimat;
55
+ // eslint-disable-next-line compat/compat
56
+ (_window = window) === null || _window === void 0 || (_window$cancelIdleCal = _window.cancelIdleCallback) === null || _window$cancelIdleCal === void 0 || _window$cancelIdleCal.call(_window, _this.delayHandle);
57
+ (_window2 = window) === null || _window2 === void 0 || (_window2$cancelAnimat = _window2.cancelAnimationFrame) === null || _window2$cancelAnimat === void 0 || _window2$cancelAnimat.call(_window2, _this.delayHandle);
58
+ }
59
+ });
60
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
61
+ _this.updateTableEdgeAttrs(node);
62
+ }
45
63
 
46
64
  // CONFCLOUD-78239: Previously we had a bug which tried to invert the heading colour of a table
47
65
  // Obviously design tokens can't be inverted and so it would result in `VAR(--DS-BACKGROUND-ACCENT-GRAY-SUBTLEST, #F4F5F7)`
@@ -53,14 +71,6 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
53
71
  // This is a workaround to fix those cases on the fly. Note it is super specific on purpose
54
72
  // so that it just fixes the heading token (other tokens should be unaffected)
55
73
  // At some point in the future
56
- _defineProperty(_this, "destroy", function () {
57
- if (_this.delayHandle && typeof window !== 'undefined') {
58
- var _window, _window$cancelIdleCal, _window2, _window2$cancelAnimat;
59
- // eslint-disable-next-line compat/compat
60
- (_window = window) === null || _window === void 0 || (_window$cancelIdleCal = _window.cancelIdleCallback) === null || _window$cancelIdleCal === void 0 || _window$cancelIdleCal.call(_window, _this.delayHandle);
61
- (_window2 = window) === null || _window2 === void 0 || (_window2$cancelAnimat = _window2.cancelAnimationFrame) === null || _window2$cancelAnimat === void 0 || _window2$cancelAnimat.call(_window2, _this.delayHandle);
62
- }
63
- });
64
74
  if (cssVariablePattern.test(node.attrs.background)) {
65
75
  _this.delayHandle = delayUntilIdle(function () {
66
76
  var pos = getPos();
@@ -91,6 +101,70 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
91
101
  }
92
102
  return didUpdate;
93
103
  }
104
+
105
+ /**
106
+ * Detects whether this cell visually reaches the bottom or right edge of the table
107
+ * (accounting for rowspan/colspan) and sets data attributes so CSS can apply
108
+ * rounded corners and transparent borders to merged cells that span to the table edges.
109
+ */
110
+ }, {
111
+ key: "updateTableEdgeAttrs",
112
+ value: function updateTableEdgeAttrs(node) {
113
+ var pos = this.getPos();
114
+ if (pos === undefined) {
115
+ return;
116
+ }
117
+ try {
118
+ var resolvedPos = this.view.state.doc.resolve(pos);
119
+
120
+ // Cell → row → table: depth-1 is the table, depth is the row
121
+ var tableDepth = resolvedPos.depth - 1;
122
+ var rowDepth = resolvedPos.depth;
123
+ if (tableDepth < 0 || rowDepth < 0) {
124
+ return;
125
+ }
126
+ var tableNode = resolvedPos.node(tableDepth);
127
+ if (tableNode.type.name !== 'table') {
128
+ return;
129
+ }
130
+ var tableMap = TableMap.get(tableNode);
131
+ var cellStartInTable = pos - resolvedPos.start(tableDepth);
132
+ var cellRect = tableMap.findCell(cellStartInTable);
133
+ var reachesTop = cellRect.top === 0;
134
+ var reachesBottom = cellRect.bottom >= tableMap.height;
135
+ var reachesLeft = cellRect.left === 0;
136
+ var reachesRight = cellRect.right >= tableMap.width;
137
+
138
+ // Only touch DOM attributes that actually changed
139
+ if (reachesTop !== this.prevReachesTop) {
140
+ this.prevReachesTop = reachesTop;
141
+ this.setDataAttr('data-reaches-top', reachesTop);
142
+ }
143
+ if (reachesBottom !== this.prevReachesBottom) {
144
+ this.prevReachesBottom = reachesBottom;
145
+ this.setDataAttr('data-reaches-bottom', reachesBottom);
146
+ }
147
+ if (reachesLeft !== this.prevReachesLeft) {
148
+ this.prevReachesLeft = reachesLeft;
149
+ this.setDataAttr('data-reaches-left', reachesLeft);
150
+ }
151
+ if (reachesRight !== this.prevReachesRight) {
152
+ this.prevReachesRight = reachesRight;
153
+ this.setDataAttr('data-reaches-right', reachesRight);
154
+ }
155
+ } catch (_unused) {
156
+ // Position may be stale during document mutations; silently ignore.
157
+ }
158
+ }
159
+ }, {
160
+ key: "setDataAttr",
161
+ value: function setDataAttr(attr, value) {
162
+ if (value) {
163
+ this.dom.setAttribute(attr, 'true');
164
+ } else {
165
+ this.dom.removeAttribute(attr);
166
+ }
167
+ }
94
168
  }, {
95
169
  key: "updateNodeView",
96
170
  value: function updateNodeView(node) {
@@ -130,6 +204,9 @@ var TableCell = /*#__PURE__*/function (_TableNodeView) {
130
204
  removedAttrs.forEach(function (key) {
131
205
  return _this2.dom.removeAttribute(key);
132
206
  });
207
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
208
+ this.updateTableEdgeAttrs(node);
209
+ }
133
210
  return true;
134
211
  }
135
212