@atlaskit/editor-plugin-table 24.4.14 → 24.4.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +60 -85
  3. package/dist/cjs/pm-plugins/handlers.js +13 -21
  4. package/dist/cjs/pm-plugins/table-anchor-names/plugin.js +3 -6
  5. package/dist/cjs/tablePlugin.js +2 -2
  6. package/dist/cjs/ui/FloatingContextualButton/index.js +1 -16
  7. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +31 -51
  8. package/dist/cjs/ui/FloatingDragMenu/index.js +1 -2
  9. package/dist/cjs/ui/FloatingTableMenu/index.js +1 -2
  10. package/dist/cjs/ui/TableFloatingControls/index.js +1 -10
  11. package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.js +1 -1
  12. package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.js +1 -1
  13. package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.compiled.css +0 -1
  14. package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +1 -1
  15. package/dist/cjs/ui/common-styles.js +4 -4
  16. package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +60 -85
  17. package/dist/es2019/pm-plugins/handlers.js +13 -22
  18. package/dist/es2019/pm-plugins/table-anchor-names/plugin.js +3 -6
  19. package/dist/es2019/tablePlugin.js +2 -2
  20. package/dist/es2019/ui/FloatingContextualButton/index.js +1 -16
  21. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +4 -23
  22. package/dist/es2019/ui/FloatingDragMenu/index.js +1 -2
  23. package/dist/es2019/ui/FloatingTableMenu/index.js +1 -2
  24. package/dist/es2019/ui/TableFloatingControls/index.js +2 -11
  25. package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.js +1 -1
  26. package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.js +1 -1
  27. package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.compiled.css +0 -1
  28. package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +1 -1
  29. package/dist/es2019/ui/common-styles.js +54 -72
  30. package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +60 -85
  31. package/dist/esm/pm-plugins/handlers.js +13 -21
  32. package/dist/esm/pm-plugins/table-anchor-names/plugin.js +3 -6
  33. package/dist/esm/tablePlugin.js +2 -2
  34. package/dist/esm/ui/FloatingContextualButton/index.js +1 -16
  35. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +31 -51
  36. package/dist/esm/ui/FloatingDragMenu/index.js +1 -2
  37. package/dist/esm/ui/FloatingTableMenu/index.js +1 -2
  38. package/dist/esm/ui/TableFloatingControls/index.js +2 -11
  39. package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.js +1 -1
  40. package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.js +1 -1
  41. package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.compiled.css +0 -1
  42. package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +1 -1
  43. package/dist/esm/ui/common-styles.js +4 -4
  44. package/package.json +10 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 24.4.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6afed619aa443`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6afed619aa443) -
8
+ Clean up experiment `platform_editor_table_close_cell_menu_on_move_exp`
9
+ - Updated dependencies
10
+
11
+ ## 24.4.15
12
+
13
+ ### Patch Changes
14
+
15
+ - [`0a6b16efd7f45`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0a6b16efd7f45) -
16
+ Clean up sticky header patch feature gates and experiments.
17
+ - Updated dependencies
18
+
3
19
  ## 24.4.14
4
20
 
5
21
  ### Patch Changes
@@ -149,7 +149,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
149
149
  }
150
150
  });
151
151
  }
152
- if (_this.isHeaderRow && _this.isStickyHeaderEnabled && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4')) {
152
+ if (_this.isHeaderRow && _this.isStickyHeaderEnabled) {
153
153
  var _api$table;
154
154
  _this.onEditorContentAreaHeightChange = api === null || api === void 0 || (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.onChange(function (_ref) {
155
155
  var nextSharedState = _ref.nextSharedState;
@@ -278,47 +278,45 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
278
278
  if (this.editorScrollableElement) {
279
279
  this.initObservers();
280
280
  this.topPosEditorElement = (0, _dom2.getTop)(this.editorScrollableElement);
281
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_5')) {
282
- this.scrollListener = function () {
283
- var _this3$overflowObserv;
284
- if (_this3.hasScrolledSinceLoad) {
285
- return;
286
- }
287
- _this3.hasScrolledSinceLoad = true;
288
- if (!_this3.overflowObserver) {
289
- return;
290
- }
291
-
292
- // Re-check intersection state now that scrolling has occurred
293
- var entries = (_this3$overflowObserv = _this3.overflowObserverEntries) !== null && _this3$overflowObserv !== void 0 ? _this3$overflowObserv : _this3.overflowObserver.takeRecords();
294
- _this3.overflowObserverEntries = undefined;
281
+ this.scrollListener = function () {
282
+ var _this3$overflowObserv;
283
+ if (_this3.hasScrolledSinceLoad) {
284
+ return;
285
+ }
286
+ _this3.hasScrolledSinceLoad = true;
287
+ if (!_this3.overflowObserver) {
288
+ return;
289
+ }
295
290
 
296
- /** NOTE: This logic is duplicated in the overflowObserver callback
297
- * to avoid conflicting with a follow up refactor where this will
298
- * be cleaned up.
299
- */
300
- entries.forEach(function (entry) {
301
- var tableWrapper = _this3.dom.closest(".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER));
302
- if (tableWrapper && tableWrapper instanceof HTMLElement && (!(0, _dom2.areAllRectsZero)(entry) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_10', 'isEnabled', true) || !(0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_10', 'isEnabled', true))) {
303
- if (entry.isIntersecting) {
304
- tableWrapper.classList.add(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
305
- _this3.dom.classList.add(_types.TableCssClassName.NATIVE_STICKY);
306
- _this3.isNativeSticky = true;
307
- } else {
308
- tableWrapper.classList.remove(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
309
- _this3.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY);
310
- _this3.isNativeSticky = false;
311
- }
312
- _this3.refreshLegacyStickyState();
291
+ // Re-check intersection state now that scrolling has occurred
292
+ var entries = (_this3$overflowObserv = _this3.overflowObserverEntries) !== null && _this3$overflowObserv !== void 0 ? _this3$overflowObserv : _this3.overflowObserver.takeRecords();
293
+ _this3.overflowObserverEntries = undefined;
294
+
295
+ /** NOTE: This logic is duplicated in the overflowObserver callback
296
+ * to avoid conflicting with a follow up refactor where this will
297
+ * be cleaned up.
298
+ */
299
+ entries.forEach(function (entry) {
300
+ var tableWrapper = _this3.dom.closest(".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER));
301
+ if (tableWrapper && tableWrapper instanceof HTMLElement && !(0, _dom2.areAllRectsZero)(entry)) {
302
+ if (entry.isIntersecting) {
303
+ tableWrapper.classList.add(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
304
+ _this3.dom.classList.add(_types.TableCssClassName.NATIVE_STICKY);
305
+ _this3.isNativeSticky = true;
306
+ } else {
307
+ tableWrapper.classList.remove(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
308
+ _this3.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY);
309
+ _this3.isNativeSticky = false;
313
310
  }
314
- });
315
- };
316
- // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
317
- this.editorScrollableElement.addEventListener('scroll', this.scrollListener, {
318
- passive: true,
319
- once: true
311
+ _this3.refreshLegacyStickyState();
312
+ }
320
313
  });
321
- }
314
+ };
315
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
316
+ this.editorScrollableElement.addEventListener('scroll', this.scrollListener, {
317
+ passive: true,
318
+ once: true
319
+ });
322
320
  }
323
321
  this.eventDispatcher.on('widthPlugin', this.updateStickyHeaderWidth.bind(this));
324
322
 
@@ -389,48 +387,36 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
389
387
  };
390
388
  this.overflowObserver = new IntersectionObserver(function (entries, observer) {
391
389
  entries.forEach(function (entry) {
390
+ var _this4$api;
392
391
  if (!(observer.root instanceof HTMLElement)) {
393
392
  return;
394
393
  }
395
394
  // Only apply classes if page has scrolled since load
396
- if (!_this4.hasScrolledSinceLoad && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_5')) {
395
+ if (!_this4.hasScrolledSinceLoad) {
397
396
  _this4.overflowObserverEntries = entries;
398
397
  return;
399
398
  }
400
399
  if (entry.isIntersecting) {
401
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4')) {
402
- observer.root.classList.add(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
403
- if (!_this4.disableNativeSticky) {
404
- _this4.dom.classList.add(_types.TableCssClassName.NATIVE_STICKY);
405
- }
406
- } else {
407
- observer.root.classList.add(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
400
+ observer.root.classList.add(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
401
+ if (!_this4.disableNativeSticky) {
408
402
  _this4.dom.classList.add(_types.TableCssClassName.NATIVE_STICKY);
409
403
  }
410
404
  _this4.isNativeSticky = true;
411
405
  } else {
412
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4')) {
413
- observer.root.classList.remove(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
414
- _this4.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY);
415
- } else {
416
- observer.root.classList.remove(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
417
- _this4.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY);
418
- }
406
+ observer.root.classList.remove(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
407
+ _this4.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY);
419
408
  _this4.isNativeSticky = false;
420
409
  }
421
410
  _this4.refreshLegacyStickyState();
422
- if ((0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_9', 'isEnabled', true)) {
423
- var _this4$api;
424
- (_this4$api = _this4.api) === null || _this4$api === void 0 || (_this4$api = _this4$api.analytics) === null || _this4$api === void 0 || (_this4$api = _this4$api.actions) === null || _this4$api === void 0 || _this4$api.fireAnalyticsEvent({
425
- action: _analytics.TABLE_ACTION.STICKY_HEADER_METHOD_TOGGLED,
426
- actionSubject: _analytics.ACTION_SUBJECT.TABLE,
427
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE_STICKY_HEADER,
428
- eventType: _analytics.EVENT_TYPE.UI,
429
- attributes: {
430
- nativeStickyHeaderEnabled: entry.isIntersecting
431
- }
432
- });
433
- }
411
+ (_this4$api = _this4.api) === null || _this4$api === void 0 || (_this4$api = _this4$api.analytics) === null || _this4$api === void 0 || (_this4$api = _this4$api.actions) === null || _this4$api === void 0 || _this4$api.fireAnalyticsEvent({
412
+ action: _analytics.TABLE_ACTION.STICKY_HEADER_METHOD_TOGGLED,
413
+ actionSubject: _analytics.ACTION_SUBJECT.TABLE,
414
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE_STICKY_HEADER,
415
+ eventType: _analytics.EVENT_TYPE.UI,
416
+ attributes: {
417
+ nativeStickyHeaderEnabled: entry.isIntersecting
418
+ }
419
+ });
434
420
  });
435
421
  }, options);
436
422
  }
@@ -456,7 +442,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
456
442
  entries.forEach(function (entry) {
457
443
  var _entry$rootBounds;
458
444
  var tableContainer = _this5.dom.closest(".".concat(_types.TableCssClassName.TABLE_CONTAINER));
459
- if (entry.intersectionRect.top === ((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.top) && (!_this5.disableNativeSticky || !(0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4'))) {
445
+ if (entry.intersectionRect.top === ((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.top) && !_this5.disableNativeSticky) {
460
446
  _this5.dom.classList.add(_types.TableCssClassName.NATIVE_STICKY_ACTIVE);
461
447
  if (tableContainer && tableContainer instanceof HTMLElement) {
462
448
  tableContainer.dataset.tableHeaderIsStuck = 'true';
@@ -464,11 +450,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
464
450
  } else {
465
451
  _this5.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY_ACTIVE);
466
452
  if (tableContainer && tableContainer instanceof HTMLElement) {
467
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_3')) {
468
- delete tableContainer.dataset.tableHeaderIsStuck;
469
- } else {
470
- tableContainer.dataset.tableHeaderIsStuck = 'false';
471
- }
453
+ delete tableContainer.dataset.tableHeaderIsStuck;
472
454
  }
473
455
  }
474
456
  });
@@ -496,17 +478,12 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
496
478
  this.dom.style.setProperty('anchor-name', (_this$dom$getAttribut = this.dom.getAttribute('data-node-anchor')) !== null && _this$dom$getAttribut !== void 0 ? _this$dom$getAttribut : '');
497
479
  }
498
480
  this.initOverflowObserver();
499
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4')) {
500
- this.initNodeVisibilityObserver();
501
- }
481
+ this.initNodeVisibilityObserver();
502
482
  var closestTable = this.dom.closest('table');
503
483
  if (closestTable) {
504
- var _this$overflowObserve;
484
+ var _this$overflowObserve, _this$nodeVisibilityO2;
505
485
  (_this$overflowObserve = this.overflowObserver) === null || _this$overflowObserve === void 0 || _this$overflowObserve.observe(closestTable);
506
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4')) {
507
- var _this$nodeVisibilityO2;
508
- (_this$nodeVisibilityO2 = this.nodeVisibilityObserver) === null || _this$nodeVisibilityO2 === void 0 || _this$nodeVisibilityO2.observe(closestTable);
509
- }
486
+ (_this$nodeVisibilityO2 = this.nodeVisibilityObserver) === null || _this$nodeVisibilityO2 === void 0 || _this$nodeVisibilityO2.observe(closestTable);
510
487
  }
511
488
  this.initStickyStateObserver();
512
489
  (_this$stickyStateObse = this.stickyStateObserver) === null || _this$stickyStateObse === void 0 || _this$stickyStateObse.observe(this.dom);
@@ -641,6 +618,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
641
618
  if (entry.target.className === ((_this8$editorScrollab = _this8.editorScrollableElement) === null || _this8$editorScrollab === void 0 ? void 0 : _this8$editorScrollab.className)) {
642
619
  _this8.updateStickyHeaderWidth();
643
620
  } else {
621
+ var _this8$editorContentA;
644
622
  var newHeight = entry.contentRect ? entry.contentRect.height :
645
623
  // Ignored via go/ees005
646
624
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -653,11 +631,8 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
653
631
  _this8.sentinels.bottom.style.bottom = "".concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + newHeight, "px");
654
632
  (0, _dom.updateStickyMargins)(table);
655
633
  }
656
- if ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4')) {
657
- var _this8$editorContentA;
658
- var viewportHeight = (_this8$editorContentA = _this8.editorContentAreaHeight) !== null && _this8$editorContentA !== void 0 ? _this8$editorContentA : _editorContentAreaHeight.INITIAL_STATIC_VIEWPORT_HEIGHT;
659
- _this8.toggleDisableNativeSticky(newHeight, viewportHeight);
660
- }
634
+ var viewportHeight = (_this8$editorContentA = _this8.editorContentAreaHeight) !== null && _this8$editorContentA !== void 0 ? _this8$editorContentA : _editorContentAreaHeight.INITIAL_STATIC_VIEWPORT_HEIGHT;
635
+ _this8.toggleDisableNativeSticky(newHeight, viewportHeight);
661
636
  }
662
637
  });
663
638
  });
@@ -78,29 +78,21 @@ var updateTargetCellPosition = function updateTargetCellPosition(_ref2) {
78
78
  tableHeader = _tr$doc$type$schema$n2.tableHeader;
79
79
  var cell = (0, _utils2.findParentNodeOfType)([tableCell, tableHeader])(tr.selection);
80
80
  var targetCellPosition = cell ? cell.pos : undefined;
81
- if ((0, _expValEquals.expValEquals)('platform_editor_table_close_cell_menu_on_move_exp', 'isEnabled', true)) {
82
- var targetCellPositionChanged = pluginState.targetCellPosition !== targetCellPosition;
83
- var closeContextualMenu = shouldCloseLegacyContextualMenu({
84
- pluginState: pluginState,
85
- targetCellPositionChanged: targetCellPositionChanged,
86
- tr: tr
87
- });
88
- if (!targetCellPositionChanged && !closeContextualMenu) {
89
- return pluginState;
90
- }
91
-
92
- // Close the legacy contextual menu when moving cells because the cell background
93
- // color submenu can otherwise remain open against the previous cell selection.
94
- return _objectSpread(_objectSpread(_objectSpread({}, pluginState), closeContextualMenu ? {
95
- isContextualMenuOpen: false
96
- } : {}), {}, {
97
- targetCellPosition: targetCellPosition
98
- });
99
- }
100
- if (pluginState.targetCellPosition === targetCellPosition) {
81
+ var targetCellPositionChanged = pluginState.targetCellPosition !== targetCellPosition;
82
+ var closeContextualMenu = shouldCloseLegacyContextualMenu({
83
+ pluginState: pluginState,
84
+ targetCellPositionChanged: targetCellPositionChanged,
85
+ tr: tr
86
+ });
87
+ if (!targetCellPositionChanged && !closeContextualMenu) {
101
88
  return pluginState;
102
89
  }
103
- return _objectSpread(_objectSpread({}, pluginState), {}, {
90
+
91
+ // Close the legacy contextual menu when moving cells because the cell background
92
+ // color submenu can otherwise remain open against the previous cell selection.
93
+ return _objectSpread(_objectSpread(_objectSpread({}, pluginState), closeContextualMenu ? {
94
+ isContextualMenuOpen: false
95
+ } : {}), {}, {
104
96
  targetCellPosition: targetCellPosition
105
97
  });
106
98
  };
@@ -13,8 +13,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
13
  var _styles = require("@atlaskit/editor-common/styles");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _view = require("@atlaskit/editor-prosemirror/view");
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
16
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid
19
17
  var ObjHash = /*#__PURE__*/function () {
20
18
  function ObjHash() {
@@ -45,9 +43,8 @@ var createTableAnchorDecorations = function createTableAnchorDecorations(state)
45
43
  var _parent$attrs;
46
44
  var isTableHeader = node.type.name === 'tableHeader';
47
45
  var isTableRow = node.type.name === 'tableRow';
48
- var isParentTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'tableRow';
49
46
  var isParentTableHeaderRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'tableRow' && headerRowId && (parent === null || parent === void 0 || (_parent$attrs = parent.attrs) === null || _parent$attrs === void 0 ? void 0 : _parent$attrs.localId) === headerRowId;
50
- var shouldAddDecorationToHeader = (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_9', 'isEnabled', true) ? isParentTableHeaderRow && isTableHeader : isTableHeader;
47
+ var shouldAddDecorationToHeader = isParentTableHeaderRow && isTableHeader;
51
48
  var isFirstRow = isTableRow && index === 0;
52
49
  if (isFirstRow) {
53
50
  headerRowId = node.attrs.localId;
@@ -55,7 +52,7 @@ var createTableAnchorDecorations = function createTableAnchorDecorations(state)
55
52
  // only apply to header cells and the first row of a table, for performance reasons
56
53
  if (isFirstRow || shouldAddDecorationToHeader) {
57
54
  var anchorName = getNodeAnchor(node);
58
- var shouldAddAnchorNameInDecoration = !(0, _styles.isCSSAttrAnchorSupported)() && (0, _styles.isCSSAnchorSupported)() && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_8');
55
+ var shouldAddAnchorNameInDecoration = !(0, _styles.isCSSAttrAnchorSupported)() && (0, _styles.isCSSAnchorSupported)();
59
56
  var attributes = {
60
57
  'data-node-anchor': anchorName,
61
58
  style: "anchor-name: ".concat(anchorName, ";")
@@ -66,7 +63,7 @@ var createTableAnchorDecorations = function createTableAnchorDecorations(state)
66
63
  }
67
64
 
68
65
  // only decend if there is a possible table row or table header node after the current node, for performance reasons
69
- return (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_9', 'isEnabled', true) ? !(isTableHeader || isParentTableHeaderRow) : !(isTableHeader || isParentTableRow);
66
+ return !(isTableHeader || isParentTableHeaderRow);
70
67
  });
71
68
  return _view.DecorationSet.create(state.doc, decs);
72
69
  };
@@ -160,7 +160,7 @@ var tablePlugin = function tablePlugin(_ref) {
160
160
  isDragMenuOpen: dragAndDropState === null || dragAndDropState === void 0 ? void 0 : dragAndDropState.isDragMenuOpen,
161
161
  isSizeSelectorOpen: sizeSelectorPluginState === null || sizeSelectorPluginState === void 0 ? void 0 : sizeSelectorPluginState.isSelectorOpen,
162
162
  sizeSelectorTargetRef: sizeSelectorPluginState === null || sizeSelectorPluginState === void 0 ? void 0 : sizeSelectorPluginState.targetRef,
163
- editorContentAreaHeight: (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4') ? editorContentAreaHeightPluginState === null || editorContentAreaHeightPluginState === void 0 ? void 0 : editorContentAreaHeightPluginState.height : undefined
163
+ editorContentAreaHeight: (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? editorContentAreaHeightPluginState === null || editorContentAreaHeightPluginState === void 0 ? void 0 : editorContentAreaHeightPluginState.height : undefined
164
164
  };
165
165
  return sharedStateInternal;
166
166
  },
@@ -498,7 +498,7 @@ var tablePlugin = function tablePlugin(_ref) {
498
498
  }, {
499
499
  name: 'editorContentAreaHeightPlugin',
500
500
  plugin: function plugin() {
501
- return (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_1') ? (0, _editorContentAreaHeight.createPlugin)() : undefined;
501
+ return (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? (0, _editorContentAreaHeight.createPlugin)() : undefined;
502
502
  }
503
503
  }];
504
504
  if (!(0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
@@ -19,7 +19,6 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
19
19
  var _utils = require("@atlaskit/editor-prosemirror/utils");
20
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
21
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
22
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
22
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
24
23
  var _commands = require("../../pm-plugins/commands");
25
24
  var _pluginFactory = require("../../pm-plugins/plugin-factory");
@@ -154,7 +153,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
154
153
  testId: (0, _expValEquals.expValEquals)('platform_editor_table_menu_updates', 'isEnabled', true) ? 'pm-table-contextual-menu-button' : undefined
155
154
  }));
156
155
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
157
- var parentStickyNative = targetCellRef.parentElement && ((0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_4') ? tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW) : targetCellRef.parentElement.classList.contains(_types.TableCssClassName.NATIVE_STICKY));
156
+ var parentStickyNative = targetCellRef.parentElement && (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW));
158
157
  if (parentStickyNative && targetCellRef.nodeName === 'TH' && (0, _stickyHeader.isNativeStickySupported)() && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
159
158
  var _targetCellRef$parent;
160
159
  /* We need to default to checking the anchor style because there may be a conflict with the block controls
@@ -169,20 +168,6 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
169
168
  if (colAnchorName === '') {
170
169
  colAnchorName = targetCellRef === null || targetCellRef === void 0 ? void 0 : targetCellRef.dataset.nodeAnchor;
171
170
  }
172
- if (!(0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_9', 'isEnabled', true)) {
173
- return (0, _react2.jsx)("div", {
174
- css: anchorStyles,
175
- style: {
176
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
177
- top: "calc(".concat(BUTTON_OFFSET, "px + anchor(").concat(rowAnchorName, " top))"),
178
- right: "calc(".concat(BUTTON_OFFSET, "px + anchor(").concat(colAnchorName, " right))"),
179
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
180
- positionAnchor: colAnchorName
181
- } // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
182
- ,
183
- "data-testid": "table-cell-options-anchor-wrapper"
184
- }, button);
185
- }
186
171
  if (rowAnchorName && colAnchorName) {
187
172
  return (0, _react2.jsx)("div", {
188
173
  css: anchorStyles,
@@ -543,32 +543,21 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
543
543
  }
544
544
  });
545
545
  (0, _defineProperty2.default)(_this, "toggleOpen", function () {
546
- var _this$props8 = _this.props,
547
- isOpen = _this$props8.isOpen,
548
- _this$props8$editorVi = _this$props8.editorView,
549
- state = _this$props8$editorVi.state,
550
- dispatch = _this$props8$editorVi.dispatch;
551
- if ((0, _expValEquals.expValEquals)('platform_editor_table_close_cell_menu_on_move_exp', 'isEnabled', true)) {
552
- if ((0, _pluginFactory.getPluginState)(state).isContextualMenuOpen) {
553
- (0, _commands.toggleContextualMenu)()(state, dispatch);
554
- }
555
- _this.closeSubmenu();
556
- return;
557
- }
558
- (0, _commands.toggleContextualMenu)()(state, dispatch);
559
- if (!isOpen) {
560
- _this.setState({
561
- isSubmenuOpen: false
562
- });
546
+ var _this$props$editorVie = _this.props.editorView,
547
+ state = _this$props$editorVie.state,
548
+ dispatch = _this$props$editorVie.dispatch;
549
+ if ((0, _pluginFactory.getPluginState)(state).isContextualMenuOpen) {
550
+ (0, _commands.toggleContextualMenu)()(state, dispatch);
563
551
  }
552
+ _this.closeSubmenu();
564
553
  });
565
554
  (0, _defineProperty2.default)(_this, "handleOpenChange", function (payload) {
566
- var _this$props9 = _this.props,
567
- _this$props9$editorVi = _this$props9.editorView,
568
- state = _this$props9$editorVi.state,
569
- dispatch = _this$props9$editorVi.dispatch,
570
- dom = _this$props9$editorVi.dom,
571
- isCellMenuOpenByKeyboard = _this$props9.isCellMenuOpenByKeyboard;
555
+ var _this$props8 = _this.props,
556
+ _this$props8$editorVi = _this$props8.editorView,
557
+ state = _this$props8$editorVi.state,
558
+ dispatch = _this$props8$editorVi.dispatch,
559
+ dom = _this$props8$editorVi.dom,
560
+ isCellMenuOpenByKeyboard = _this$props8.isCellMenuOpenByKeyboard;
572
561
  if (payload) {
573
562
  var event = payload.event;
574
563
  if (event && event instanceof KeyboardEvent) {
@@ -607,11 +596,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
607
596
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
608
597
  (0, _defineProperty2.default)(_this, "handleItemMouseEnter", function (_ref4) {
609
598
  var item = _ref4.item;
610
- var _this$props0 = _this.props,
611
- _this$props0$editorVi = _this$props0.editorView,
612
- state = _this$props0$editorVi.state,
613
- dispatch = _this$props0$editorVi.dispatch,
614
- selectionRect = _this$props0.selectionRect;
599
+ var _this$props9 = _this.props,
600
+ _this$props9$editorVi = _this$props9.editorView,
601
+ state = _this$props9$editorVi.state,
602
+ dispatch = _this$props9$editorVi.dispatch,
603
+ selectionRect = _this$props9.selectionRect;
615
604
  if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
616
605
  if (item.value.name === 'background') {
617
606
  if (!_this.state.isSubmenuOpen) {
@@ -635,9 +624,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
635
624
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
636
625
  (0, _defineProperty2.default)(_this, "handleItemMouseLeave", function (_ref5) {
637
626
  var item = _ref5.item;
638
- var _this$props$editorVie = _this.props.editorView,
639
- state = _this$props$editorVie.state,
640
- dispatch = _this$props$editorVie.dispatch;
627
+ var _this$props$editorVie2 = _this.props.editorView,
628
+ state = _this$props$editorVie2.state,
629
+ dispatch = _this$props$editorVie2.dispatch;
641
630
  if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
642
631
  if (item.value.name === 'background') {
643
632
  _this.closeSubmenu();
@@ -655,31 +644,22 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
655
644
  }
656
645
  });
657
646
  (0, _defineProperty2.default)(_this, "setColor", function (color) {
658
- var _this$props1 = _this.props,
659
- editorView = _this$props1.editorView,
660
- editorAnalyticsAPI = _this$props1.editorAnalyticsAPI,
661
- isCellMenuOpenByKeyboard = _this$props1.isCellMenuOpenByKeyboard;
647
+ var _this$props0 = _this.props,
648
+ editorView = _this$props0.editorView,
649
+ editorAnalyticsAPI = _this$props0.editorAnalyticsAPI,
650
+ isCellMenuOpenByKeyboard = _this$props0.isCellMenuOpenByKeyboard;
662
651
  var state = editorView.state,
663
652
  dispatch = editorView.dispatch,
664
653
  dom = editorView.dom;
665
654
  (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color)(state, dispatch);
666
655
  if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
667
656
  _this.toggleOpen();
668
- } else if ((0, _expValEquals.expValEquals)('platform_editor_table_close_cell_menu_on_move_exp', 'isEnabled', true)) {
657
+ } else {
669
658
  _this.toggleOpen();
670
659
  if (isCellMenuOpenByKeyboard) {
671
660
  (0, _commands.setFocusToCellMenu)(false)(editorView.state, dispatch);
672
661
  dom.focus();
673
662
  }
674
- } else {
675
- (0, _commands.toggleContextualMenu)()(state, dispatch);
676
- _this.setState({
677
- isSubmenuOpen: false
678
- });
679
- if (isCellMenuOpenByKeyboard) {
680
- (0, _commands.setFocusToCellMenu)(false)(state, dispatch);
681
- dom.focus();
682
- }
683
663
  }
684
664
  });
685
665
  return _this;
@@ -711,12 +691,12 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
711
691
  }, {
712
692
  key: "render",
713
693
  value: function render() {
714
- var _this$props10 = this.props,
715
- isOpen = _this$props10.isOpen,
716
- offset = _this$props10.offset,
717
- boundariesElement = _this$props10.boundariesElement,
718
- isCellMenuOpenByKeyboard = _this$props10.isCellMenuOpenByKeyboard,
719
- api = _this$props10.api;
694
+ var _this$props1 = this.props,
695
+ isOpen = _this$props1.isOpen,
696
+ offset = _this$props1.offset,
697
+ boundariesElement = _this$props1.boundariesElement,
698
+ isCellMenuOpenByKeyboard = _this$props1.isCellMenuOpenByKeyboard,
699
+ api = _this$props1.api;
720
700
  var items = this.createContextMenuItems();
721
701
  var isOpenAllowed = false;
722
702
  isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
@@ -9,7 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _ui = require("@atlaskit/editor-common/ui");
10
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
11
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _types = require("../../types");
14
13
  var _consts = require("../consts");
15
14
  var _DragMenu = _interopRequireDefault(require("./DragMenu"));
@@ -37,7 +36,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
37
36
  if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
38
37
  return null;
39
38
  }
40
- var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW)) && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_7');
39
+ var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW));
41
40
  var targetHandleRef = direction === 'row' ? document.querySelector('#drag-handle-button-row') : document.querySelector('#drag-handle-button-column');
42
41
  if (!targetHandleRef || !(editorView.state.selection instanceof _cellSelection.CellSelection)) {
43
42
  return null;
@@ -12,7 +12,6 @@ var _uiReact = require("@atlaskit/editor-common/ui-react");
12
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
13
13
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
14
14
  var _toolbarKeyboardNavigationProvider = require("@atlaskit/editor-toolbar/toolbar-keyboard-navigation-provider");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _commands = require("../../pm-plugins/commands");
17
16
  var _types = require("../../types");
18
17
  var _consts = require("../consts");
@@ -132,7 +131,7 @@ var FloatingTableMenu = function FloatingTableMenu(_ref) {
132
131
  if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
133
132
  return null;
134
133
  }
135
- var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW)) && (0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_7');
134
+ var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW));
136
135
  var targetHandleRef = dragMenuDirection === 'row' ? document.querySelector('#drag-handle-button-row') : document.querySelector('#drag-handle-button-column');
137
136
  if (!targetHandleRef || !(editorView.state.selection instanceof _cellSelection.CellSelection)) {
138
137
  return null;
@@ -10,7 +10,6 @@ var _react2 = require("@emotion/react");
10
10
  var _browser = require("@atlaskit/editor-common/browser");
11
11
  var _utils = require("@atlaskit/editor-tables/utils");
12
12
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
13
  var _commands = require("../../pm-plugins/commands");
15
14
  var _nodes = require("../../pm-plugins/utils/nodes");
16
15
  var _types = require("../../types");
@@ -24,13 +23,6 @@ var _DragControls = require("./RowControls/DragControls");
24
23
 
25
24
  /* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
26
25
 
27
- var styles = (0, _react2.css)({
28
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
29
- '&:has(~ .pm-table-wrapper-no-overflow)': {
30
- marginTop: 0
31
- }
32
- });
33
-
34
26
  // Row controls
35
27
  var TableFloatingControls = exports.TableFloatingControls = function TableFloatingControls(_ref) {
36
28
  var _findTable;
@@ -102,8 +94,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
102
94
  var shouldShowCornerControls = isNested && !(0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes');
103
95
  return (0, _react2.jsx)("div", {
104
96
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
105
- className: wrapperClassName,
106
- css: [(0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && !(0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_7') && styles]
97
+ className: wrapperClassName
107
98
  }, (0, _react2.jsx)("div", {
108
99
  role: "none",
109
100
  onMouseDown: function onMouseDown(e) {
@@ -1,4 +1,4 @@
1
- /* SortDecreasingItem.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* SortDecreasingItem.tsx generated by @compiled/babel-plugin v0.40.0 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* SortIncreasingItem.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* SortIncreasingItem.tsx generated by @compiled/babel-plugin v0.40.0 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,3 @@
1
-
2
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
2
  ._zulp1b66{gap:var(--ds-space-050,4px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
4
3
  ._1dqonqa1{border-style:solid}
@@ -1,4 +1,4 @@
1
- /* BackgroundColorItem.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* BackgroundColorItem.tsx generated by @compiled/babel-plugin v0.40.0 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");