@atlaskit/editor-plugin-table 15.3.15 → 15.3.16

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.
@@ -1,7 +1,9 @@
1
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
1
2
  // TODO: ED-23976 - Clean up
2
3
  import { createTableView } from './table';
3
4
  import TableCell from './TableCell';
4
5
  import TableRow from './TableRow';
6
+ import TableRowNativeStickyWithFallback from './TableRowNativeStickyWithFallback';
5
7
  export const tableView = options => {
6
8
  return (node, view, getPos) => {
7
9
  return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor);
@@ -21,6 +23,10 @@ export const tableHeaderView = options => {
21
23
  };
22
24
  export const tableRowView = options => {
23
25
  return (node, view, getPos) => {
24
- return new TableRow(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
26
+ if (expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
27
+ return new TableRowNativeStickyWithFallback(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
28
+ } else {
29
+ return new TableRow(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
30
+ }
25
31
  };
26
32
  };
@@ -161,7 +161,8 @@ export const TableCssClassName = {
161
161
  WITH_ROW_INSERT_LINE: `${tablePrefixSelector}-row-insert-line`,
162
162
  WITH_ROW_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-row-insert-line__inactive`,
163
163
  WITH_LAST_ROW_INSERT_LINE: `${tablePrefixSelector}-last-row-insert-line`,
164
- WITH_LAST_ROW_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-last-row-insert-line__inactive`
164
+ WITH_LAST_ROW_INSERT_LINE_INACTIVE: `${tablePrefixSelector}-last-row-insert-line__inactive`,
165
+ NATIVE_STICKY: `${tablePrefixSelector}-row-native-sticky`
165
166
  };
166
167
  export let ShadowEvent = /*#__PURE__*/function (ShadowEvent) {
167
168
  ShadowEvent["SHOW_BEFORE_SHADOW"] = "showBeforeShadow";
@@ -461,6 +461,12 @@ export const baseTableStyles = props => {
461
461
  z-index: 1;
462
462
  }
463
463
 
464
+ tr.${ClassName.NATIVE_STICKY} {
465
+ position: sticky;
466
+ top: 0;
467
+ z-index: ${akEditorTableCellOnStickyHeaderZIndex};
468
+ }
469
+
464
470
  .${ClassName.WITH_CONTROLS} tr.sticky {
465
471
  padding-top: ${tableControlsSpacing}px;
466
472
  }
@@ -1108,6 +1114,10 @@ export const baseTableStyles = props => {
1108
1114
  overflow-y: hidden;
1109
1115
  position: relative;
1110
1116
  }
1117
+
1118
+ .${ClassName.TABLE_NODE_WRAPPER}.${ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW} {
1119
+ overflow: visible;
1120
+ }
1111
1121
  `;
1112
1122
  };
1113
1123