@atlaskit/editor-plugin-table 3.0.2 → 3.0.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +12 -1
  3. package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +1 -1
  4. package/dist/cjs/plugins/table/ui/consts.js +6 -4
  5. package/dist/cjs/plugins/table/ui/ui-styles.js +1 -1
  6. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +14 -3
  7. package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -1
  8. package/dist/es2019/plugins/table/ui/consts.js +5 -4
  9. package/dist/es2019/plugins/table/ui/ui-styles.js +2 -2
  10. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +14 -3
  11. package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -1
  12. package/dist/esm/plugins/table/ui/consts.js +5 -4
  13. package/dist/esm/plugins/table/ui/ui-styles.js +1 -1
  14. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +6 -5
  15. package/dist/types/plugins/table/pm-plugins/sticky-headers/util.d.ts +1 -1
  16. package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +1 -1
  17. package/dist/types/plugins/table/ui/consts.d.ts +2 -1
  18. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +6 -5
  19. package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +1 -1
  20. package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +1 -1
  21. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +2 -1
  22. package/package.json +6 -6
  23. package/src/__tests__/integration/arrow-down-into-table.ts +2 -0
  24. package/src/__tests__/integration/auto-size.ts +3 -0
  25. package/src/__tests__/integration/cell-selection.ts +3 -0
  26. package/src/__tests__/integration/delete-columns.ts +2 -0
  27. package/src/__tests__/integration/delete-last-column-in-full-width.ts +2 -0
  28. package/src/__tests__/integration/delete-last-column-with-empty-action.ts +2 -0
  29. package/src/__tests__/integration/delete-last-row-with-empty-action.ts +2 -0
  30. package/src/__tests__/integration/delete-rows.ts +3 -0
  31. package/src/__tests__/integration/delete-table-when-selected.ts +3 -0
  32. package/src/__tests__/integration/deleting-empty-paragraph-under-table.ts +2 -0
  33. package/src/__tests__/integration/even-columns.ts +3 -0
  34. package/src/__tests__/integration/horizontal-scroll-shadows.ts +2 -0
  35. package/src/__tests__/integration/horizontal-scroll.ts +4 -1
  36. package/src/__tests__/integration/insert-cell-header-with-strong-mark.ts +2 -0
  37. package/src/__tests__/integration/insert-row-inside-layout.ts +3 -0
  38. package/src/__tests__/integration/layout.ts +3 -0
  39. package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +2 -0
  40. package/src/__tests__/integration/resize-handler.ts +3 -0
  41. package/src/__tests__/integration/resize.ts +4 -1
  42. package/src/__tests__/integration/scale.ts +3 -0
  43. package/src/__tests__/integration/sticky-header.ts +3 -1
  44. package/src/__tests__/unit/analytics.ts +4 -0
  45. package/src/__tests__/unit/collab.ts +3 -0
  46. package/src/__tests__/unit/commands/go-to-next-cell.ts +3 -0
  47. package/src/__tests__/unit/commands/insert.ts +3 -0
  48. package/src/__tests__/unit/commands/misc.ts +3 -0
  49. package/src/__tests__/unit/commands/sort.ts +3 -0
  50. package/src/__tests__/unit/commands.ts +3 -0
  51. package/src/__tests__/unit/copy-paste.ts +5 -0
  52. package/src/__tests__/unit/event-handlers/index.ts +3 -0
  53. package/src/__tests__/unit/event-handlers.ts +3 -0
  54. package/src/__tests__/unit/fix-tables.ts +3 -0
  55. package/src/__tests__/unit/get-toolbar-config.ts +3 -0
  56. package/src/__tests__/unit/handlers.ts +3 -0
  57. package/src/__tests__/unit/hover-selection.ts +4 -0
  58. package/src/__tests__/unit/index-with-fake-timers.ts +2 -0
  59. package/src/__tests__/unit/index.ts +4 -0
  60. package/src/__tests__/unit/layout.ts +3 -0
  61. package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +1 -0
  62. package/src/__tests__/unit/nodeviews/TableComponent.tsx +2 -0
  63. package/src/__tests__/unit/nodeviews/TableContainer.tsx +2 -0
  64. package/src/__tests__/unit/nodeviews/cell.ts +3 -0
  65. package/src/__tests__/unit/nodeviews/table.ts +4 -0
  66. package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +2 -0
  67. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +3 -0
  68. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +3 -0
  69. package/src/__tests__/unit/pm-plugins/main.ts +3 -0
  70. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +3 -0
  71. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +5 -1
  72. package/src/__tests__/unit/pm-plugins/table-local-id.ts +4 -0
  73. package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +2 -0
  74. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +3 -0
  75. package/src/__tests__/unit/pm-plugins/table-width.ts +3 -0
  76. package/src/__tests__/unit/sort-column.ts +3 -0
  77. package/src/__tests__/unit/toolbar.ts +3 -0
  78. package/src/__tests__/unit/transforms/delete-columns.ts +3 -0
  79. package/src/__tests__/unit/transforms/delete-rows.ts +3 -0
  80. package/src/__tests__/unit/transforms/merging.ts +3 -0
  81. package/src/__tests__/unit/ui/ContextualMenu.tsx +3 -0
  82. package/src/__tests__/unit/ui/CornerControls.tsx +3 -0
  83. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +3 -0
  84. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +3 -0
  85. package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +3 -0
  86. package/src/__tests__/unit/ui/FloatingInsertButton.tsx +3 -0
  87. package/src/__tests__/unit/ui/RowControls.tsx +4 -0
  88. package/src/__tests__/unit/ui/TableFloatingControls.tsx +3 -0
  89. package/src/__tests__/unit/undo-redo.ts +4 -0
  90. package/src/__tests__/unit/utils/collapse.ts +3 -0
  91. package/src/__tests__/unit/utils/nodes.ts +3 -0
  92. package/src/__tests__/unit/utils/row-controls.ts +3 -0
  93. package/src/__tests__/unit/utils/table.ts +2 -0
  94. package/src/__tests__/unit/utils.ts +3 -0
  95. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +2 -2
  96. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +2 -2
  97. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +2 -2
  98. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +2 -2
  99. package/src/__tests__/visual-regression/cell-options-menu.ts +3 -1
  100. package/src/__tests__/visual-regression/index.ts +4 -1
  101. package/src/__tests__/visual-regression/sticky-header.ts +4 -1
  102. package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +26 -7
  103. package/src/plugins/table/pm-plugins/sticky-headers/util.ts +1 -1
  104. package/src/plugins/table/pm-plugins/table-local-id.ts +5 -4
  105. package/src/plugins/table/ui/consts.ts +13 -2
  106. package/src/plugins/table/ui/ui-styles.ts +2 -2
  107. package/src/__tests__/integration/__snapshots__/floating-toolbar.ts.snap +0 -613
  108. package/src/__tests__/integration/floating-toolbar.ts +0 -374
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 3.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9e36c4aec5c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9e36c4aec5c) - Fixed a bug in the local id plugin where it was deferred dispatching a transaction created from and old state causing the "Applying a mismatched transaction" runtime error to occur.
8
+
9
+ ## 3.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`65b155b2787`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65b155b2787) - [ux] ED-19172: Updated tableHeaderCellBackgroundColor to use non-transparent token."
14
+ - [`cd06919038d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cd06919038d) - [ux] Fix Firefox scrolling stuck in some certain height when scroll up from bottom
15
+ - [`0b1f816e4fa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0b1f816e4fa) - [ux] Added akEditorTableHeaderCellBackground to store fallback.
16
+ - Updated dependencies
17
+
3
18
  ## 3.0.2
4
19
 
5
20
  ### Patch Changes
@@ -248,6 +248,7 @@ var TableRowNodeView = /*#__PURE__*/function () {
248
248
  this.lastTimePainted = 0;
249
249
  this.isHeaderRow = supportedHeaderRow(node);
250
250
  this.isSticky = false;
251
+ this.lastStickyTimestamp = undefined;
251
252
  if (this.isHeaderRow) {
252
253
  this.dom.setAttribute('data-header-row', 'true');
253
254
  this.subscribe();
@@ -393,6 +394,7 @@ var TableRowNodeView = /*#__PURE__*/function () {
393
394
  if (!entry.isIntersecting && !sentinelIsBelowScrollArea) {
394
395
  var _entry$rootBounds3;
395
396
  _this4.tree && _this4.makeHeaderRowSticky(_this4.tree, (_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.top);
397
+ _this4.lastStickyTimestamp = Date.now();
396
398
  } else {
397
399
  table && _this4.makeRowHeaderNotSticky(table);
398
400
  }
@@ -401,12 +403,21 @@ var TableRowNodeView = /*#__PURE__*/function () {
401
403
  var _entry$rootBounds4;
402
404
  var sentinelIsAboveScrollArea = entry.boundingClientRect.top - _this4.dom.offsetHeight < (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.top) || 0);
403
405
  if (table && !entry.isIntersecting && sentinelIsAboveScrollArea) {
404
- _this4.makeRowHeaderNotSticky(table);
406
+ // Not a perfect solution, but need to this code specific for FireFox ED-19177
407
+ if (_utils.browser.gecko) {
408
+ if (_this4.lastStickyTimestamp && Date.now() - _this4.lastStickyTimestamp > _consts.STICKY_HEADER_TOGGLE_TOLERANCE_MS) {
409
+ _this4.makeRowHeaderNotSticky(table);
410
+ }
411
+ } else {
412
+ _this4.makeRowHeaderNotSticky(table);
413
+ }
405
414
  } else if (entry.isIntersecting && sentinelIsAboveScrollArea) {
406
415
  var _entry$rootBounds5;
407
416
  _this4.tree && _this4.makeHeaderRowSticky(_this4.tree, entry === null || entry === void 0 ? void 0 : (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
417
+ _this4.lastStickyTimestamp = Date.now();
408
418
  }
409
419
  }
420
+ return;
410
421
  });
411
422
  }, {
412
423
  root: this.editorScrollableElement
@@ -91,7 +91,7 @@ var createPlugin = function createPlugin(dispatch) {
91
91
  }
92
92
  var table = state.schema.nodes.table;
93
93
  (0, _rafSchd.default)(function () {
94
- var tr = state.tr;
94
+ var tr = editorView.state.tr;
95
95
  var tableIdWasAdded = false;
96
96
  editorView.state.doc.descendants(function (node, pos) {
97
97
  var isTable = node.type === table;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tablePadding = exports.tableOverflowShadowWidth = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableCellSelectedDeleteIconColor = exports.tableCellSelectedDeleteIconBackground = exports.tableCellSelectedColor = exports.tableCellHoverDeleteIconColor = exports.tableCellHoverDeleteIconBackground = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = void 0;
6
+ exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tablePadding = exports.tableOverflowShadowWidth = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableCellSelectedDeleteIconColor = exports.tableCellSelectedDeleteIconBackground = exports.tableCellSelectedColor = exports.tableCellHoverDeleteIconColor = exports.tableCellHoverDeleteIconBackground = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = void 0;
7
7
  var _styles = require("@atlaskit/editor-common/styles");
8
8
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
9
9
  var _colors = require("@atlaskit/theme/colors");
@@ -21,8 +21,8 @@ var tableCellBackgroundColor = (0, _components.themed)({
21
21
  });
22
22
  exports.tableCellBackgroundColor = tableCellBackgroundColor;
23
23
  var tableHeaderCellBackgroundColor = (0, _components.themed)({
24
- light: "var(--ds-background-neutral, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"),
25
- dark: "var(--ds-background-neutral, ".concat(_editorSharedStyles.akEditorTableToolbarDark, ")")
24
+ light: "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableHeaderCellBackground, ")"),
25
+ dark: "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableHeaderCellBackgroundDark, ")")
26
26
  });
27
27
  exports.tableHeaderCellBackgroundColor = tableHeaderCellBackgroundColor;
28
28
  var tableToolbarColor = (0, _components.themed)({
@@ -150,4 +150,6 @@ exports.TABLE_SNAP_GAP = TABLE_SNAP_GAP;
150
150
  var TABLE_HIGHLIGHT_GAP = 10;
151
151
  exports.TABLE_HIGHLIGHT_GAP = TABLE_HIGHLIGHT_GAP;
152
152
  var TABLE_HIGHLIGHT_TOLERANCE = 2;
153
- exports.TABLE_HIGHLIGHT_TOLERANCE = TABLE_HIGHLIGHT_TOLERANCE;
153
+ exports.TABLE_HIGHLIGHT_TOLERANCE = TABLE_HIGHLIGHT_TOLERANCE;
154
+ var STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
155
+ exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = STICKY_HEADER_TOGGLE_TOLERANCE_MS;
@@ -95,6 +95,6 @@ var getLastColumnResizerOverrides = function getLastColumnResizerOverrides() {
95
95
  return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? (0, _react.css)(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2.default)(["\n tr\n th:last-child\n .", ",\n tr\n td:last-child\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: 0;\n cursor: col-resize;\n z-index: ", ";\n }\n "])), _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _consts.resizeHandlerAreaWidth, _consts.resizeHandlerZIndex) : '';
96
96
  };
97
97
  var resizeHandle = function resizeHandle(props) {
98
- return (0, _react.css)(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: -2px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: -2px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _consts.resizeHandlerAreaWidth, _consts.resizeHandlerAreaWidth / 2, _consts.resizeHandlerZIndex, getLastColumnResizerOverrides(), _types.TableCssClassName.WITH_RESIZE_LINE, _consts.resizeLineWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _types.TableCssClassName.WITH_RESIZE_LINE, _consts.resizeLineWidth, _consts.tableToolbarSize + _styles.tableCellBorderWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _types.TableCssClassName.WITH_RESIZE_LINE_LAST_COLUMN, _consts.resizeLineWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _types.TableCssClassName.WITH_RESIZE_LINE_LAST_COLUMN, _consts.resizeLineWidth, _consts.tableToolbarSize + _styles.tableCellBorderWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _consts.tableToolbarSize + _styles.tableCellBorderWidth);
98
+ return (0, _react.css)(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _consts.resizeHandlerAreaWidth, _consts.resizeHandlerAreaWidth / 2, _consts.resizeHandlerZIndex, getLastColumnResizerOverrides(), _types.TableCssClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", _consts.resizeLineWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _types.TableCssClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", _consts.resizeLineWidth, _consts.tableToolbarSize + _styles.tableCellBorderWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _types.TableCssClassName.WITH_RESIZE_LINE_LAST_COLUMN, _consts.resizeLineWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _types.TableCssClassName.WITH_RESIZE_LINE_LAST_COLUMN, _consts.resizeLineWidth, _consts.tableToolbarSize + _styles.tableCellBorderWidth, (0, _consts.tableBorderSelectedColor)(props), _consts.columnControlsZIndex * 2, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, _consts.tableToolbarSize + _styles.tableCellBorderWidth, _consts.tableToolbarSize + _styles.tableCellBorderWidth);
99
99
  };
100
100
  exports.resizeHandle = resizeHandle;
@@ -2,9 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import debounce from 'lodash/debounce';
3
3
  import throttle from 'lodash/throttle';
4
4
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
5
- import { mapChildren } from '@atlaskit/editor-common/utils';
5
+ import { browser, mapChildren } from '@atlaskit/editor-common/utils';
6
6
  import { TableCssClassName as ClassName, TableCssClassName } from '../../../types';
7
- import { stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../../../ui/consts';
7
+ import { STICKY_HEADER_TOGGLE_TOLERANCE_MS, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../../../ui/consts';
8
8
  import { pluginKey as tablePluginKey } from '../../plugin-key';
9
9
  import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../../table-resizing/utils/dom';
10
10
  import { updateStickyState } from '../commands';
@@ -230,6 +230,7 @@ export class TableRowNodeView {
230
230
  this.lastTimePainted = 0;
231
231
  this.isHeaderRow = supportedHeaderRow(node);
232
232
  this.isSticky = false;
233
+ this.lastStickyTimestamp = undefined;
233
234
  if (this.isHeaderRow) {
234
235
  this.dom.setAttribute('data-header-row', 'true');
235
236
  this.subscribe();
@@ -361,6 +362,7 @@ export class TableRowNodeView {
361
362
  if (!entry.isIntersecting && !sentinelIsBelowScrollArea) {
362
363
  var _entry$rootBounds3;
363
364
  this.tree && this.makeHeaderRowSticky(this.tree, (_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.top);
365
+ this.lastStickyTimestamp = Date.now();
364
366
  } else {
365
367
  table && this.makeRowHeaderNotSticky(table);
366
368
  }
@@ -369,12 +371,21 @@ export class TableRowNodeView {
369
371
  var _entry$rootBounds4;
370
372
  const sentinelIsAboveScrollArea = entry.boundingClientRect.top - this.dom.offsetHeight < (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.top) || 0);
371
373
  if (table && !entry.isIntersecting && sentinelIsAboveScrollArea) {
372
- this.makeRowHeaderNotSticky(table);
374
+ // Not a perfect solution, but need to this code specific for FireFox ED-19177
375
+ if (browser.gecko) {
376
+ if (this.lastStickyTimestamp && Date.now() - this.lastStickyTimestamp > STICKY_HEADER_TOGGLE_TOLERANCE_MS) {
377
+ this.makeRowHeaderNotSticky(table);
378
+ }
379
+ } else {
380
+ this.makeRowHeaderNotSticky(table);
381
+ }
373
382
  } else if (entry.isIntersecting && sentinelIsAboveScrollArea) {
374
383
  var _entry$rootBounds5;
375
384
  this.tree && this.makeHeaderRowSticky(this.tree, entry === null || entry === void 0 ? void 0 : (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
385
+ this.lastStickyTimestamp = Date.now();
376
386
  }
377
387
  }
388
+ return;
378
389
  });
379
390
  }, {
380
391
  root: this.editorScrollableElement
@@ -83,7 +83,7 @@ const createPlugin = dispatch => new SafePlugin({
83
83
  table
84
84
  } = state.schema.nodes;
85
85
  rafSchedule(() => {
86
- const tr = state.tr;
86
+ const tr = editorView.state.tr;
87
87
  let tableIdWasAdded = false;
88
88
  editorView.state.doc.descendants((node, pos) => {
89
89
  const isTable = node.type === table;
@@ -1,5 +1,5 @@
1
1
  import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
2
- import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderSelected, akEditorTableCellBlanketDeleted, akEditorTableCellBlanketSelected, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
2
+ import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderSelected, akEditorTableCellBlanketDeleted, akEditorTableCellBlanketSelected, akEditorTableHeaderCellBackground, akEditorTableHeaderCellBackgroundDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
3
3
  import { B200, DN30, DN400, N0, N20, N200, N20A, N300, R300, R400, R75 } from '@atlaskit/theme/colors';
4
4
  import { themed } from '@atlaskit/theme/components';
5
5
  import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
@@ -15,8 +15,8 @@ export const tableCellBackgroundColor = themed({
15
15
  dark: `var(--ds-surface, ${DN30})`
16
16
  });
17
17
  export const tableHeaderCellBackgroundColor = themed({
18
- light: `var(--ds-background-neutral, ${akEditorTableToolbar})`,
19
- dark: `var(--ds-background-neutral, ${akEditorTableToolbarDark})`
18
+ light: `var(--ds-background-accent-gray-subtlest, ${akEditorTableHeaderCellBackground})`,
19
+ dark: `var(--ds-background-accent-gray-subtlest, ${akEditorTableHeaderCellBackgroundDark})`
20
20
  });
21
21
  export const tableToolbarColor = themed({
22
22
  light: `var(--ds-background-neutral-subtle, ${akEditorTableToolbar})`,
@@ -100,4 +100,5 @@ export const stickyHeaderBorderBottomWidth = 1;
100
100
  export const tableOverflowShadowWidth = 8;
101
101
  export const TABLE_SNAP_GAP = 9;
102
102
  export const TABLE_HIGHLIGHT_GAP = 10;
103
- export const TABLE_HIGHLIGHT_TOLERANCE = 2;
103
+ export const TABLE_HIGHLIGHT_TOLERANCE = 2;
104
+ export const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
@@ -429,7 +429,7 @@ export const resizeHandle = props => css`
429
429
  td.${ClassName.WITH_RESIZE_LINE}::before {
430
430
  content: ' ';
431
431
  position: absolute;
432
- left: -2px;
432
+ left: ${"var(--ds-space-negative-025, -2px)"};
433
433
  top: -1px;
434
434
  width: ${resizeLineWidth}px;
435
435
  height: calc(100% + 2px);
@@ -439,7 +439,7 @@ export const resizeHandle = props => css`
439
439
 
440
440
  th.${ClassName.WITH_RESIZE_LINE}::before {
441
441
  content: ' ';
442
- left: -2px;
442
+ left: ${"var(--ds-space-negative-025, -2px)"};
443
443
  position: absolute;
444
444
  width: ${resizeLineWidth}px;
445
445
  height: calc(100% + ${tableToolbarSize + tableCellBorderWidth}px);
@@ -4,9 +4,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import debounce from 'lodash/debounce';
5
5
  import throttle from 'lodash/throttle';
6
6
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
7
- import { mapChildren } from '@atlaskit/editor-common/utils';
7
+ import { browser, mapChildren } from '@atlaskit/editor-common/utils';
8
8
  import { TableCssClassName as ClassName, TableCssClassName } from '../../../types';
9
- import { stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../../../ui/consts';
9
+ import { STICKY_HEADER_TOGGLE_TOLERANCE_MS, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../../../ui/consts';
10
10
  import { pluginKey as tablePluginKey } from '../../plugin-key';
11
11
  import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../../table-resizing/utils/dom';
12
12
  import { updateStickyState } from '../commands';
@@ -241,6 +241,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
241
241
  this.lastTimePainted = 0;
242
242
  this.isHeaderRow = supportedHeaderRow(node);
243
243
  this.isSticky = false;
244
+ this.lastStickyTimestamp = undefined;
244
245
  if (this.isHeaderRow) {
245
246
  this.dom.setAttribute('data-header-row', 'true');
246
247
  this.subscribe();
@@ -386,6 +387,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
386
387
  if (!entry.isIntersecting && !sentinelIsBelowScrollArea) {
387
388
  var _entry$rootBounds3;
388
389
  _this4.tree && _this4.makeHeaderRowSticky(_this4.tree, (_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.top);
390
+ _this4.lastStickyTimestamp = Date.now();
389
391
  } else {
390
392
  table && _this4.makeRowHeaderNotSticky(table);
391
393
  }
@@ -394,12 +396,21 @@ export var TableRowNodeView = /*#__PURE__*/function () {
394
396
  var _entry$rootBounds4;
395
397
  var sentinelIsAboveScrollArea = entry.boundingClientRect.top - _this4.dom.offsetHeight < (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.top) || 0);
396
398
  if (table && !entry.isIntersecting && sentinelIsAboveScrollArea) {
397
- _this4.makeRowHeaderNotSticky(table);
399
+ // Not a perfect solution, but need to this code specific for FireFox ED-19177
400
+ if (browser.gecko) {
401
+ if (_this4.lastStickyTimestamp && Date.now() - _this4.lastStickyTimestamp > STICKY_HEADER_TOGGLE_TOLERANCE_MS) {
402
+ _this4.makeRowHeaderNotSticky(table);
403
+ }
404
+ } else {
405
+ _this4.makeRowHeaderNotSticky(table);
406
+ }
398
407
  } else if (entry.isIntersecting && sentinelIsAboveScrollArea) {
399
408
  var _entry$rootBounds5;
400
409
  _this4.tree && _this4.makeHeaderRowSticky(_this4.tree, entry === null || entry === void 0 ? void 0 : (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
410
+ _this4.lastStickyTimestamp = Date.now();
401
411
  }
402
412
  }
413
+ return;
403
414
  });
404
415
  }, {
405
416
  root: this.editorScrollableElement
@@ -85,7 +85,7 @@ var createPlugin = function createPlugin(dispatch) {
85
85
  }
86
86
  var table = state.schema.nodes.table;
87
87
  rafSchedule(function () {
88
- var tr = state.tr;
88
+ var tr = editorView.state.tr;
89
89
  var tableIdWasAdded = false;
90
90
  editorView.state.doc.descendants(function (node, pos) {
91
91
  var isTable = node.type === table;
@@ -1,5 +1,5 @@
1
1
  import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
2
- import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderSelected, akEditorTableCellBlanketDeleted, akEditorTableCellBlanketSelected, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
2
+ import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderSelected, akEditorTableCellBlanketDeleted, akEditorTableCellBlanketSelected, akEditorTableHeaderCellBackground, akEditorTableHeaderCellBackgroundDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
3
3
  import { B200, DN30, DN400, N0, N20, N200, N20A, N300, R300, R400, R75 } from '@atlaskit/theme/colors';
4
4
  import { themed } from '@atlaskit/theme/components';
5
5
  import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
@@ -15,8 +15,8 @@ export var tableCellBackgroundColor = themed({
15
15
  dark: "var(--ds-surface, ".concat(DN30, ")")
16
16
  });
17
17
  export var tableHeaderCellBackgroundColor = themed({
18
- light: "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"),
19
- dark: "var(--ds-background-neutral, ".concat(akEditorTableToolbarDark, ")")
18
+ light: "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableHeaderCellBackground, ")"),
19
+ dark: "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableHeaderCellBackgroundDark, ")")
20
20
  });
21
21
  export var tableToolbarColor = themed({
22
22
  light: "var(--ds-background-neutral-subtle, ".concat(akEditorTableToolbar, ")"),
@@ -100,4 +100,5 @@ export var stickyHeaderBorderBottomWidth = 1;
100
100
  export var tableOverflowShadowWidth = 8;
101
101
  export var TABLE_SNAP_GAP = 9;
102
102
  export var TABLE_HIGHLIGHT_GAP = 10;
103
- export var TABLE_HIGHLIGHT_TOLERANCE = 2;
103
+ export var TABLE_HIGHLIGHT_TOLERANCE = 2;
104
+ export var STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
@@ -75,5 +75,5 @@ var getLastColumnResizerOverrides = function getLastColumnResizerOverrides() {
75
75
  return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", ",\n tr\n td:last-child\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: 0;\n cursor: col-resize;\n z-index: ", ";\n }\n "])), ClassName.RESIZE_HANDLE_DECORATION, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerZIndex) : '';
76
76
  };
77
77
  export var resizeHandle = function resizeHandle(props) {
78
- return css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: -2px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: -2px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, getLastColumnResizerOverrides(), ClassName.WITH_RESIZE_LINE, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
78
+ return css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, getLastColumnResizerOverrides(), ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
79
79
  };
@@ -1,9 +1,9 @@
1
1
  /// <reference types="lodash" />
2
- import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
- import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
- import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
- import { TablePluginState } from '../../../types';
6
- import { TableDOMElements } from './dom';
2
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { TablePluginState } from '../../../types';
6
+ import type { TableDOMElements } from './dom';
7
7
  /**
8
8
  * Check if a given node is a header row with this definition:
9
9
  * - all children are tableHeader cells
@@ -26,6 +26,7 @@ export declare class TableRowNodeView implements NodeView {
26
26
  focused: boolean;
27
27
  topPosEditorElement: number;
28
28
  isSticky: boolean;
29
+ lastStickyTimestamp: number | undefined;
29
30
  lastTimePainted: number;
30
31
  private intersectionObserver?;
31
32
  private resizeObserver?;
@@ -1,2 +1,2 @@
1
- import { StickyPluginState } from './types';
1
+ import type { StickyPluginState } from './types';
2
2
  export declare const findStickyHeaderForTable: (state: StickyPluginState, tablePos: number | undefined) => import("./types").RowStickyState | undefined;
@@ -1,4 +1,4 @@
1
- import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
1
+ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  interface TableLocalIdPluginState {
4
4
  parsedForLocalIds: boolean;
@@ -2,7 +2,7 @@
2
2
  * Basic colors added to prevent content overflow in table cells.
3
3
  */
4
4
  export declare const tableCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-surface)">;
5
- export declare const tableHeaderCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral)">;
5
+ export declare const tableHeaderCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
6
6
  export declare const tableToolbarColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle)">;
7
7
  export declare const tableTextColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
8
8
  export declare const tableBorderColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtler)">;
@@ -46,3 +46,4 @@ export declare const tableOverflowShadowWidth = 8;
46
46
  export declare const TABLE_SNAP_GAP = 9;
47
47
  export declare const TABLE_HIGHLIGHT_GAP = 10;
48
48
  export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
49
+ export declare const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="lodash" />
2
- import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
- import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
- import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
- import { TablePluginState } from '../../../types';
6
- import { TableDOMElements } from './dom';
2
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { TablePluginState } from '../../../types';
6
+ import type { TableDOMElements } from './dom';
7
7
  /**
8
8
  * Check if a given node is a header row with this definition:
9
9
  * - all children are tableHeader cells
@@ -26,6 +26,7 @@ export declare class TableRowNodeView implements NodeView {
26
26
  focused: boolean;
27
27
  topPosEditorElement: number;
28
28
  isSticky: boolean;
29
+ lastStickyTimestamp: number | undefined;
29
30
  lastTimePainted: number;
30
31
  private intersectionObserver?;
31
32
  private resizeObserver?;
@@ -1,2 +1,2 @@
1
- import { StickyPluginState } from './types';
1
+ import type { StickyPluginState } from './types';
2
2
  export declare const findStickyHeaderForTable: (state: StickyPluginState, tablePos: number | undefined) => import("./types").RowStickyState | undefined;
@@ -1,4 +1,4 @@
1
- import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
1
+ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  interface TableLocalIdPluginState {
4
4
  parsedForLocalIds: boolean;
@@ -2,7 +2,7 @@
2
2
  * Basic colors added to prevent content overflow in table cells.
3
3
  */
4
4
  export declare const tableCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-surface)">;
5
- export declare const tableHeaderCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral)">;
5
+ export declare const tableHeaderCellBackgroundColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
6
6
  export declare const tableToolbarColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle)">;
7
7
  export declare const tableTextColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
8
8
  export declare const tableBorderColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtler)">;
@@ -46,3 +46,4 @@ export declare const tableOverflowShadowWidth = 8;
46
46
  export declare const TABLE_SNAP_GAP = 9;
47
47
  export declare const TABLE_HIGHLIGHT_GAP = 10;
48
48
  export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
49
+ export declare const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,17 +28,17 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^29.1.0",
31
- "@atlaskit/editor-common": "^75.0.0",
31
+ "@atlaskit/editor-common": "^75.2.0",
32
32
  "@atlaskit/editor-palette": "1.5.1",
33
33
  "@atlaskit/editor-plugin-analytics": "^0.2.0",
34
34
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
35
35
  "@atlaskit/editor-prosemirror": "1.1.0",
36
- "@atlaskit/editor-shared-styles": "^2.6.0",
36
+ "@atlaskit/editor-shared-styles": "^2.7.0",
37
37
  "@atlaskit/editor-tables": "^2.3.0",
38
38
  "@atlaskit/icon": "^21.12.0",
39
39
  "@atlaskit/platform-feature-flags": "^0.2.1",
40
40
  "@atlaskit/theme": "^12.6.0",
41
- "@atlaskit/tokens": "^1.22.0",
41
+ "@atlaskit/tokens": "^1.25.0",
42
42
  "@atlaskit/tooltip": "^17.8.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1",
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
60
60
  "@atlaskit/editor-plugin-grid": "^0.2.0",
61
61
  "@atlaskit/editor-plugin-guideline": "^0.5.0",
62
- "@atlaskit/editor-plugin-hyperlink": "^0.4.0",
62
+ "@atlaskit/editor-plugin-hyperlink": "^0.5.0",
63
63
  "@atlaskit/editor-plugin-width": "^0.2.0",
64
64
  "@atlaskit/visual-regression": "*",
65
65
  "@atlaskit/webdriver-runner": "*",
@@ -112,4 +112,4 @@
112
112
  "type": "boolean"
113
113
  }
114
114
  }
115
- }
115
+ }
@@ -1,8 +1,10 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
1
2
  import {
2
3
  expectToMatchSelection,
3
4
  fullpage,
4
5
  setProseMirrorTextSelection,
5
6
  } from '@atlaskit/editor-test-helpers/integration/helpers';
7
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
6
8
  import {
7
9
  goToEditorTestingWDExample,
8
10
  mountEditor,
@@ -1,9 +1,12 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
1
2
  import {
2
3
  editable,
3
4
  fullpage,
4
5
  getDocFromElement,
5
6
  } from '@atlaskit/editor-test-helpers/integration/helpers';
7
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
6
8
  import sleep from '@atlaskit/editor-test-helpers/sleep';
9
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
7
10
  import {
8
11
  goToEditorTestingWDExample,
9
12
  mountEditor,
@@ -1,11 +1,14 @@
1
1
  import isEqual from 'lodash/isEqual';
2
2
 
3
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
4
  import { fullpage } from '@atlaskit/editor-test-helpers/integration/helpers';
5
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
4
6
  import {
5
7
  multiCellTableSelectionBottomRightToFirstCell,
6
8
  multiCellTableSelectionBottomRightToMiddleTopCell,
7
9
  multiCellTableSelectionTopLeftToBottomRight,
8
10
  } from '@atlaskit/editor-test-helpers/page-objects/table';
11
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
9
12
  import {
10
13
  goToEditorTestingWDExample,
11
14
  mountEditor,
@@ -1,10 +1,12 @@
1
1
  import { createIntl } from 'react-intl-next';
2
2
 
3
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
4
  import {
4
5
  editable,
5
6
  fullpage,
6
7
  getDocFromElement,
7
8
  } from '@atlaskit/editor-test-helpers/integration/helpers';
9
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
8
10
  import {
9
11
  goToEditorTestingWDExample,
10
12
  mountEditor,
@@ -1,9 +1,11 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
1
2
  import {
2
3
  editable,
3
4
  fullpage,
4
5
  getDocFromElement,
5
6
  quickInsert,
6
7
  } from '@atlaskit/editor-test-helpers/integration/helpers';
8
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
7
9
  import {
8
10
  goToEditorTestingWDExample,
9
11
  mountEditor,
@@ -1,9 +1,11 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
1
2
  import {
2
3
  editable,
3
4
  fullpage,
4
5
  getDocFromElement,
5
6
  quickInsert,
6
7
  } from '@atlaskit/editor-test-helpers/integration/helpers';
8
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
7
9
  import {
8
10
  goToEditorTestingWDExample,
9
11
  mountEditor,
@@ -1,9 +1,11 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
1
2
  import {
2
3
  editable,
3
4
  fullpage,
4
5
  getDocFromElement,
5
6
  quickInsert,
6
7
  } from '@atlaskit/editor-test-helpers/integration/helpers';
8
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
7
9
  import {
8
10
  goToEditorTestingWDExample,
9
11
  mountEditor,
@@ -1,11 +1,14 @@
1
1
  import { createIntl } from 'react-intl-next';
2
2
 
3
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
4
  import {
4
5
  editable,
5
6
  fullpage,
6
7
  getDocFromElement,
7
8
  } from '@atlaskit/editor-test-helpers/integration/helpers';
9
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
8
10
  import { deleteRow } from '@atlaskit/editor-test-helpers/page-objects/table';
11
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
9
12
  import {
10
13
  goToEditorTestingWDExample,
11
14
  mountEditor,
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
1
2
  import {
2
3
  clipboardInput,
3
4
  copyAsHTMLButton,
@@ -6,11 +7,13 @@ import {
6
7
  fullpage,
7
8
  getDocFromElement,
8
9
  } from '@atlaskit/editor-test-helpers/integration/helpers';
10
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
9
11
  import {
10
12
  clickFirstCell,
11
13
  tableSelectors,
12
14
  waitForNoTable,
13
15
  } from '@atlaskit/editor-test-helpers/page-objects/table';
16
+ // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
14
17
  import {
15
18
  goToEditorTestingWDExample,
16
19
  mountEditor,