@atlaskit/editor-plugin-table 38.0.0 → 38.0.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.
@@ -6,15 +6,16 @@ import { ACTION, ACTION_SUBJECT, CONTENT_COMPONENT, EVENT_TYPE, INPUT_METHOD } f
6
6
  import { Popup } from '@atlaskit/editor-common/ui';
7
7
  import { closestElement } from '@atlaskit/editor-common/utils';
8
8
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
- import { akEditorTableCellOnStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
10
9
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
11
10
  import { TableMap } from '@atlaskit/editor-tables/table-map';
12
11
  import { findTable } from '@atlaskit/editor-tables/utils';
12
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
13
13
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
14
  import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
15
15
  import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
16
16
  import { isFullRowOrColumnSelected } from '../../pm-plugins/utils/selection';
17
17
  import { TableCssClassName as ClassName } from '../../types';
18
+ import { getTableZIndexes } from '../sticky-header-z-index';
18
19
  import getPopupOptions from './getPopupOptions';
19
20
  import { DragAndDropInsertButton } from './InsertButton';
20
21
  // Ignored via go/ees005
@@ -128,11 +129,14 @@ export class FloatingInsertButton extends React.Component {
128
129
  if (type === 'column' && expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
129
130
  verticalOffsetCorrection = Math.max(0, targetCellRef.getBoundingClientRect().top - tableRef.getBoundingClientRect().top);
130
131
  }
131
- // Fixed the 'add column button' not visible issue when sticky header is enabled
132
- // By setting the Popup z-index higher than the sticky header z-index ( common-styles.ts tr.sticky)
133
- // Only when inserting a column, otherwise set to undefined
134
- // Need to set z-index in the Popup, set z-index in the <DragAndDropInsertButton /> will not work
135
- const zIndex = expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') || type === 'column' ? akEditorTableCellOnStickyHeaderZIndex : undefined;
132
+ // Column inserts sit above the header; row inserts scroll behind it.
133
+ // Set the layer on the Popup because its children share its stacking context.
134
+ let zIndex;
135
+ if (type === 'row' && isExperimentEnabled('platform_editor_sticky_headers_zindex')) {
136
+ zIndex = getTableZIndexes().belowHeader;
137
+ } else if (expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') || type === 'column') {
138
+ zIndex = getTableZIndexes().headerButton;
139
+ }
136
140
  return /*#__PURE__*/React.createElement(Popup, _extends({
137
141
  target: targetCellRef,
138
142
  mountTo: tableContainerWrapper || mountPoint,
@@ -8,7 +8,7 @@ import { css } from '@emotion/react';
8
8
  import { getBrowserInfo } from '@atlaskit/editor-common/browser';
9
9
  import { ANCHOR_VARIABLE_NAME, DRAG_HANDLE_WIDTH, tableMarginTop, tableSharedStyle, TableSharedCssClassName } from '@atlaskit/editor-common/styles';
10
10
  import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
11
- import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, SelectionStyle, relativeSizeToBaseFontSize, akEditorSelectedBorderColor } from '@atlaskit/editor-shared-styles';
11
+ import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, SelectionStyle, relativeSizeToBaseFontSize, akEditorSelectedBorderColor } from '@atlaskit/editor-shared-styles';
12
12
  import { akEditorTableContainerBg } from '@atlaskit/editor-shared-styles/consts';
13
13
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
14
14
  import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
@@ -17,8 +17,9 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
17
17
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
18
  import { SORTING_ICON_CLASS_NAME } from '../pm-plugins/view-mode-sort/consts';
19
19
  import { TableCssClassName as ClassName } from '../types';
20
- import { aboveNativeStickyHeaderZIndex, belowNativeStickyHeaderZIndex, columnControlsDecorationHeight, dragRowControlsWidth, nativeStickyHeaderZIndex, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, rowControlsZIndex, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, stickyRowZIndex, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableColumnControlsHeight, tableControlsSpacing, tableHeaderCellBackgroundColor, tableHeaderCellSelectedColor, tableInsertColumnButtonSize, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
20
+ import { columnControlsDecorationHeight, dragRowControlsWidth, resizeHandlerAreaWidth, resizeLineWidth, rowControlsZIndex, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableColumnControlsHeight, tableControlsSpacing, tableHeaderCellBackgroundColor, tableHeaderCellSelectedColor, tableInsertColumnButtonSize, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
21
21
  import { roundedTableOverrides } from './rounded-table-styles';
22
+ import { getTableZIndexes } from './sticky-header-z-index';
22
23
  import { columnControlsDecoration, columnControlsLineMarker, DeleteButton, dragCornerControlButton, dragInsertButtonWrapper, floatingColumnControls, HeaderButton, HeaderButtonDanger, HeaderButtonHover, hoveredCell, hoveredDeleteButton, hoveredWarningCell, insertColumnButtonWrapper, insertLine, InsertMarker, insertRowButtonWrapper, resizeHandle, rowControlsWrapperDotStyle } from './ui-styles';
23
24
  const cornerControlHeight = tableToolbarSize + 1;
24
25
 
@@ -249,6 +250,10 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
249
250
  ${rangeSelectionStylesForFakeBorders};
250
251
  ${viewModeSortStyles()};
251
252
 
253
+ ${isExperimentEnabled('platform_editor_sticky_headers_zindex') ? `.${ClassName.TABLE_CONTAINER} {
254
+ --ak-editor-table-resize-handle-z-index: ${getTableZIndexes().resizeHandle};
255
+ }` : ''}
256
+
252
257
  ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `
253
258
  .ak-editor-panel:not([data-panel-type="custom"]) .${ClassName.TABLE_CONTAINER} {
254
259
  ${akEditorTableContainerBg}: ${"var(--ds-background-accent-blue-subtlest, #E9F2FE)"};
@@ -383,7 +388,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
383
388
  display: grid;
384
389
 
385
390
  /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */
386
- z-index: ${akEditorTableCellOnStickyHeaderZIndex - 5};
391
+ z-index: ${getTableZIndexes().header};
387
392
 
388
393
  overflow-y: visible;
389
394
  overflow-x: hidden;
@@ -493,13 +498,13 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
493
498
  tr.${ClassName.NATIVE_STICKY} {
494
499
  position: sticky;
495
500
  top: ${tableMarginTop}px;
496
- z-index: ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? akEditorSmallZIndex : `calc(${akEditorTableCellOnStickyHeaderZIndex} - 5)`};
501
+ z-index: ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? akEditorSmallZIndex : `calc(${getTableZIndexes().header})`};
497
502
  box-shadow:
498
503
  inset -1px 1px ${tableBorderColor},
499
504
  inset 1px -1px ${tableBorderColor};
500
505
 
501
506
  &.${ClassName.NATIVE_STICKY_ACTIVE} {
502
- ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? `z-index: ${nativeStickyHeaderZIndex};` : ''}
507
+ ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? `z-index: ${getTableZIndexes().header};` : ''}
503
508
  box-shadow:
504
509
  inset -1px 1px ${tableBorderColor},
505
510
  inset 1px -1px ${tableBorderColor},
@@ -532,7 +537,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
532
537
  margin-bottom: -${tableMarginTop}px;
533
538
  position: sticky;
534
539
  border-top: ${tableMarginTop}px solid transparent;
535
- z-index: ${stickyRowZIndex};
540
+ z-index: ${getTableZIndexes().mask};
536
541
  }
537
542
 
538
543
  .${ClassName.TABLE_NODE_WRAPPER}:has(tr.${ClassName.NATIVE_STICKY_ACTIVE})::before {
@@ -561,7 +566,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
561
566
  > div
562
567
  > .${ClassName.DRAG_ROW_CONTROLS} {
563
568
  top: ${tableColumnControlsHeight}px;
564
- z-index: ${aboveNativeStickyHeaderZIndex};
569
+ z-index: ${getTableZIndexes().aboveHeader};
565
570
  }
566
571
 
567
572
  .${ClassName.TABLE_CONTAINER}:has(> .${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW})
@@ -573,7 +578,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
573
578
  > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
574
579
  > div
575
580
  > .${ClassName.DRAG_ROW_CONTROLS} {
576
- z-index: ${belowNativeStickyHeaderZIndex};
581
+ z-index: ${getTableZIndexes().belowHeader};
577
582
  }
578
583
 
579
584
  /** Corrects position of numbered column when sticky header top mask is present */
@@ -824,7 +829,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
824
829
  height: ${tableColumnControlsHeight}px;
825
830
  position: absolute;
826
831
  top: ${"var(--ds-space-negative-150, -12px)"};
827
- z-index: ${resizeHandlerZIndex};
832
+ z-index: ${getTableZIndexes().resizeHandle};
828
833
  }
829
834
 
830
835
  .${ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER} {
@@ -1145,7 +1150,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
1145
1150
  left: -1px;
1146
1151
  top: -1px;
1147
1152
  bottom: 0;
1148
- z-index: ${akEditorUnitZIndex * 100};
1153
+ z-index: ${getTableZIndexes().dangerOverlay};
1149
1154
  display: inline-block;
1150
1155
  pointer-events: none;
1151
1156
  background: ${tableCellDeleteColor};
@@ -1170,13 +1175,13 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
1170
1175
  }
1171
1176
  &.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1172
1177
  ${tableBorderStyles()};
1173
- z-index: ${akEditorUnitZIndex * 100};
1178
+ z-index: ${getTableZIndexes().dangerOverlay};
1174
1179
  background: ${tableCellDeleteColor};
1175
1180
  }
1176
1181
 
1177
1182
  &.${ClassName.HOVERED_NO_HIGHLIGHT}.${ClassName.HOVERED_CELL_IN_DANGER}::after {
1178
1183
  ${tableBorderStyles()};
1179
- z-index: ${akEditorUnitZIndex * 100};
1184
+ z-index: ${getTableZIndexes().dangerOverlay};
1180
1185
  background: ${tableCellDeleteColor};
1181
1186
  }
1182
1187
  }
@@ -1220,7 +1225,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
1220
1225
  position: fixed;
1221
1226
  position-area: top center;
1222
1227
  position-visibility: anchors-visible;
1223
- z-index: ${nativeStickyHeaderZIndex + 1};
1228
+ z-index: ${getTableZIndexes().aboveHeader};
1224
1229
  ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? isExperimentEnabled('platform_editor_table_q4_patch_8') ? `
1225
1230
  /* Transparent bottom 1px so the sticky header row's top border stays visible. */
1226
1231
  padding-bottom: 1px;
@@ -1241,7 +1246,7 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
1241
1246
  width: ${akEditorTableNumberColumnWidth + dragRowControlsWidth}px;
1242
1247
  height: ${expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_q4_patch_8') ? tableMarginTop - 1 : tableMarginTop}px;
1243
1248
  background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
1244
- z-index: ${nativeStickyHeaderZIndex - 1};
1249
+ z-index: ${getTableZIndexes().belowHeader};
1245
1250
  }
1246
1251
 
1247
1252
  /** Mask for numbered column content to the left of the header row */
@@ -1318,8 +1323,8 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
1318
1323
 
1319
1324
  .${ClassName.TABLE_STICKY} .${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER} {
1320
1325
  position: fixed;
1321
- /* higher zIndex than sticky header which is akEditorTableCellOnStickyHeaderZIndex - 5 */
1322
- z-index: ${akEditorTableCellOnStickyHeaderZIndex - 4};
1326
+ /* Keep column controls above the sticky header in both experiment cohorts. */
1327
+ z-index: ${getTableZIndexes().aboveHeader};
1323
1328
  }
1324
1329
 
1325
1330
  ${expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? `.${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS}:has(tr.sticky) .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
@@ -7,7 +7,8 @@ import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorTableNumber
7
7
  import { akEditorTableContainerBg } from '@atlaskit/editor-shared-styles/consts';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
9
  import { TableCssClassName as ClassName } from '../types';
10
- import { nativeStickyHeaderZIndex, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellSelectedColor } from './consts';
10
+ import { tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellSelectedColor } from './consts';
11
+ import { getTableZIndexes } from './sticky-header-z-index';
11
12
  const roundedTableCellCornerStyles = () => css`
12
13
  .${ClassName.TABLE_NODE_WRAPPER} > table {
13
14
  /* Round table corner cells (including merged cells that span to the edge)
@@ -464,7 +465,7 @@ const roundedTableStickyHeaderCornerMaskStyles = () => css`
464
465
  margin-bottom: -12px;
465
466
  background: ${expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? `var(${akEditorTableContainerBg}, ${"var(--ds-surface, #FFFFFF)"})` : "var(--ds-surface, #FFFFFF)"};
466
467
  pointer-events: none;
467
- z-index: ${nativeStickyHeaderZIndex};
468
+ z-index: ${getTableZIndexes().header};
468
469
  }
469
470
 
470
471
  .${ClassName.TABLE_CONTAINER}[data-number-column='true']
@@ -0,0 +1,29 @@
1
+ import { akEditorTableCellOnStickyHeaderZIndex, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
2
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
+ import { aboveNativeStickyHeaderZIndex, belowNativeStickyHeaderZIndex, nativeStickyHeaderZIndex, resizeHandlerZIndex, stickyRowZIndex } from './consts';
4
+ // Keep table content below its sticky masks and header, and the entire table chrome
5
+ // below block controls (100) and Object Sidebar controls (300).
6
+ export const getTableZIndexes = () => {
7
+ if (isExperimentEnabled('platform_editor_sticky_headers_zindex')) {
8
+ const headerZIndex = 90;
9
+ const tableLayerGap = 10;
10
+ return {
11
+ header: headerZIndex,
12
+ aboveHeader: headerZIndex + akEditorUnitZIndex,
13
+ belowHeader: headerZIndex - akEditorUnitZIndex,
14
+ headerButton: headerZIndex + akEditorUnitZIndex * 2,
15
+ mask: headerZIndex - akEditorUnitZIndex * 2,
16
+ resizeHandle: headerZIndex - tableLayerGap,
17
+ dangerOverlay: headerZIndex - tableLayerGap * 2
18
+ };
19
+ }
20
+ return {
21
+ header: nativeStickyHeaderZIndex,
22
+ aboveHeader: aboveNativeStickyHeaderZIndex,
23
+ belowHeader: belowNativeStickyHeaderZIndex,
24
+ headerButton: akEditorTableCellOnStickyHeaderZIndex,
25
+ mask: stickyRowZIndex,
26
+ resizeHandle: resizeHandlerZIndex,
27
+ dangerOverlay: 100
28
+ };
29
+ };
@@ -5,7 +5,8 @@ import { tableCellBorderWidth } from '@atlaskit/editor-common/styles';
5
5
  import { akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
7
  import { TableCssClassName as ClassName } from '../types';
8
- import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
8
+ import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
9
+ import { getTableZIndexes } from './sticky-header-z-index';
9
10
  const InsertLine = cssString => css`
10
11
  .${ClassName.CONTROLS_INSERT_LINE} {
11
12
  background: ${tableBorderSelectedColor};
@@ -421,7 +422,7 @@ export const columnControlsDecoration = () => {
421
422
  &.${ClassName.HOVERED_CELL_IN_DANGER} .${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
422
423
  background-color: ${tableToolbarDeleteColor};
423
424
  border-color: ${tableBorderDeleteColor};
424
- z-index: ${akEditorUnitZIndex * 100};
425
+ z-index: ${getTableZIndexes().dangerOverlay};
425
426
  }
426
427
  }
427
428
  }
@@ -456,7 +457,7 @@ export const columnControlsDecoration = () => {
456
457
  border-color: ${tableBorderDeleteColor};
457
458
  border-left: ${tableCellBorderWidth}px solid ${tableBorderDeleteColor};
458
459
  left: -${tableCellBorderWidth}px;
459
- z-index: ${akEditorUnitZIndex * 100};
460
+ z-index: ${getTableZIndexes().dangerOverlay};
460
461
  }
461
462
  }
462
463
  }
@@ -607,7 +608,7 @@ export const resizeHandle = () => css`
607
608
  top: 0;
608
609
  right: -${resizeHandlerAreaWidth / 2}px;
609
610
  cursor: col-resize;
610
- z-index: ${resizeHandlerZIndex};
611
+ z-index: ${getTableZIndexes().resizeHandle};
611
612
  }
612
613
 
613
614
  tr
@@ -623,7 +624,7 @@ export const resizeHandle = () => css`
623
624
  top: 0;
624
625
  right: 0;
625
626
  cursor: col-resize;
626
- z-index: ${resizeHandlerZIndex};
627
+ z-index: ${getTableZIndexes().resizeHandle};
627
628
  }
628
629
 
629
630
  ${resizeLineStyles()}
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useMemo, useRef } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
3
  import rafSchedule from 'raf-schd';
4
- import { akEditorTableCellOnStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
5
4
  import { TableCssClassName as ClassName } from '../../types';
6
5
  import { insertColumnButtonOffset } from '../common-styles';
6
+ import { getTableZIndexes } from '../sticky-header-z-index';
7
7
  var BUTTON_WIDTH = 20;
8
8
  export var calcLeftPos = function calcLeftPos(_ref) {
9
9
  var buttonWidth = _ref.buttonWidth,
@@ -129,7 +129,7 @@ export var FixedButton = function FixedButton(_ref2) {
129
129
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
130
130
  top: fixedButtonTop + stickyHeader.padding + offset * 2,
131
131
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
132
- zIndex: akEditorTableCellOnStickyHeaderZIndex,
132
+ zIndex: getTableZIndexes().headerButton,
133
133
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
134
134
  left: left,
135
135
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -24,7 +24,7 @@ import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-f
24
24
  import { getColumnDeleteButtonParams, getColumnsWidths } from '../../pm-plugins/utils/column-controls';
25
25
  import { getRowDeleteButtonParams, getRowHeights } from '../../pm-plugins/utils/row-controls';
26
26
  import { TableCssClassName as ClassName } from '../../types';
27
- import { stickyRowZIndex } from '../consts';
27
+ import { getTableZIndexes } from '../sticky-header-z-index';
28
28
  import DeleteButton from './DeleteButton';
29
29
  import getPopupOptions from './getPopUpOptions';
30
30
  function getSelectionType(selection) {
@@ -219,7 +219,7 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
219
219
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
220
220
  top: pos.top,
221
221
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
222
- zIndex: stickyRowZIndex,
222
+ zIndex: getTableZIndexes().mask,
223
223
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
224
224
  left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (
225
225
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -13,15 +13,16 @@ import { ACTION, ACTION_SUBJECT, CONTENT_COMPONENT, EVENT_TYPE, INPUT_METHOD } f
13
13
  import { Popup } from '@atlaskit/editor-common/ui';
14
14
  import { closestElement } from '@atlaskit/editor-common/utils';
15
15
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
16
- import { akEditorTableCellOnStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
17
16
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
18
17
  import { TableMap } from '@atlaskit/editor-tables/table-map';
19
18
  import { findTable } from '@atlaskit/editor-tables/utils';
19
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
20
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
21
  import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
22
22
  import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
23
23
  import { isFullRowOrColumnSelected } from '../../pm-plugins/utils/selection';
24
24
  import { TableCssClassName as ClassName } from '../../types';
25
+ import { getTableZIndexes } from '../sticky-header-z-index';
25
26
  import getPopupOptions from './getPopupOptions';
26
27
  import { DragAndDropInsertButton } from './InsertButton';
27
28
  // Ignored via go/ees005
@@ -136,11 +137,14 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
136
137
  if (type === 'column' && expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
137
138
  verticalOffsetCorrection = Math.max(0, targetCellRef.getBoundingClientRect().top - tableRef.getBoundingClientRect().top);
138
139
  }
139
- // Fixed the 'add column button' not visible issue when sticky header is enabled
140
- // By setting the Popup z-index higher than the sticky header z-index ( common-styles.ts tr.sticky)
141
- // Only when inserting a column, otherwise set to undefined
142
- // Need to set z-index in the Popup, set z-index in the <DragAndDropInsertButton /> will not work
143
- var zIndex = expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') || type === 'column' ? akEditorTableCellOnStickyHeaderZIndex : undefined;
140
+ // Column inserts sit above the header; row inserts scroll behind it.
141
+ // Set the layer on the Popup because its children share its stacking context.
142
+ var zIndex;
143
+ if (type === 'row' && isExperimentEnabled('platform_editor_sticky_headers_zindex')) {
144
+ zIndex = getTableZIndexes().belowHeader;
145
+ } else if (expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') || type === 'column') {
146
+ zIndex = getTableZIndexes().headerButton;
147
+ }
144
148
  return /*#__PURE__*/React.createElement(Popup, _extends({
145
149
  target: targetCellRef,
146
150
  mountTo: tableContainerWrapper || mountPoint,