@atlaskit/editor-plugin-table 9.4.0 → 9.5.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 9.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#112673](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112673)
8
+ [`df389f09ee177`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/df389f09ee177) -
9
+ ED-25870 disable table sticky header inside layout for Safari
10
+
11
+ ## 9.4.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#112186](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112186)
16
+ [`9462d8ca2405a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9462d8ca2405a) -
17
+ Bump adf-schema to 47.2.1
18
+ - Updated dependencies
19
+
3
20
  ## 9.4.0
4
21
 
5
22
  ### Minor Changes
@@ -14,6 +14,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
14
14
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
15
15
  var _throttle = _interopRequireDefault(require("lodash/throttle"));
16
16
  var _ui = require("@atlaskit/editor-common/ui");
17
+ var _utils = require("@atlaskit/editor-prosemirror/utils");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
19
  var _pluginFactory = require("../pm-plugins/plugin-factory");
18
20
  var _pluginKey = require("../pm-plugins/plugin-key");
19
21
  var _commands = require("../pm-plugins/sticky-headers/commands");
@@ -343,7 +345,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
343
345
  return;
344
346
  }
345
347
  var table = tree.table;
346
- var shouldStick = this.isHeaderSticky();
348
+ var shouldStick = this.shouldSticky();
347
349
  if (this.isSticky !== shouldStick) {
348
350
  if (shouldStick) {
349
351
  var _this$sentinelData$to;
@@ -355,6 +357,30 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
355
357
  }
356
358
  }
357
359
  }
360
+ }, {
361
+ key: "shouldSticky",
362
+ value: function shouldSticky() {
363
+ if (
364
+ // is Safari
365
+ navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome') && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_4')) {
366
+ var pos = this.getPos();
367
+ if (typeof pos === 'number') {
368
+ var $tableRowPos = this.view.state.doc.resolve(pos);
369
+
370
+ // layout -> layout column -> table -> table row
371
+ if ($tableRowPos.depth >= 3) {
372
+ var _findParentNodeCloses;
373
+ var isInsideLayout = (_findParentNodeCloses = (0, _utils.findParentNodeClosestToPos)($tableRowPos, function (node) {
374
+ return node.type.name === 'layoutColumn';
375
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
376
+ if (isInsideLayout) {
377
+ return false;
378
+ }
379
+ }
380
+ }
381
+ }
382
+ return this.isHeaderSticky();
383
+ }
358
384
  }, {
359
385
  key: "isHeaderSticky",
360
386
  value: function isHeaderSticky() {
@@ -7,14 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.updateDecorations = exports.findControlsHoverDecoration = exports.findColumnControlSelectedDecoration = exports.createRowInsertLine = exports.createResizeHandleDecoration = exports.createControlsHoverDecoration = exports.createColumnSelectedDecoration = exports.createColumnLineResize = exports.createColumnInsertLine = exports.createColumnControlsDecoration = exports.createCellHoverDecoration = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _react = require("react");
10
- var _reactDom = _interopRequireDefault(require("react-dom"));
11
10
  var _reactIntlNext = require("react-intl-next");
12
11
  var _v = _interopRequireDefault(require("uuid/v4"));
13
12
  var _utils = require("@atlaskit/editor-common/utils");
14
13
  var _view = require("@atlaskit/editor-prosemirror/view");
15
14
  var _tableMap = require("@atlaskit/editor-tables/table-map");
16
15
  var _utils2 = require("@atlaskit/editor-tables/utils");
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
16
  var _types = require("../../types");
19
17
  var _ColumnResizeWidget = require("../../ui/ColumnResizeWidget");
20
18
  // @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
@@ -274,34 +272,20 @@ var createResizeHandleDecoration = exports.createResizeHandleDecoration = functi
274
272
  var position = cellPos + cellNode.nodeSize - 1;
275
273
  return _view.Decoration.widget(position, function () {
276
274
  var element = document.createElement('div');
277
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
278
- nodeViewPortalProviderAPI.render(function () {
279
- return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
280
- value: getIntl()
281
- }, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
282
- startIndex: cellColumnPositioning.left,
283
- endIndex: cellColumnPositioning.right,
284
- includeTooltip: includeTooltip
285
- }));
286
- }, element, decorationRenderKey);
287
- } else {
288
- _reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
275
+ nodeViewPortalProviderAPI.render(function () {
276
+ return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
289
277
  value: getIntl()
290
278
  }, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
291
279
  startIndex: cellColumnPositioning.left,
292
280
  endIndex: cellColumnPositioning.right,
293
281
  includeTooltip: includeTooltip
294
- })), element);
295
- }
282
+ }));
283
+ }, element, decorationRenderKey);
296
284
  return element;
297
285
  }, {
298
286
  key: "".concat(_types.TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
299
287
  destroy: function destroy(node) {
300
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
301
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
302
- } else {
303
- _reactDom.default.unmountComponentAtNode(node);
304
- }
288
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
305
289
  }
306
290
  });
307
291
  };
@@ -9,14 +9,12 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _react = require("react");
12
- var _reactDom = _interopRequireDefault(require("react-dom"));
13
12
  var _reactIntlNext = require("react-intl-next");
14
13
  var _v = _interopRequireDefault(require("uuid/v4"));
15
14
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
16
15
  var _types = require("@atlaskit/editor-common/types");
17
16
  var _view = require("@atlaskit/editor-prosemirror/view");
18
17
  var _tableMap = require("@atlaskit/editor-tables/table-map");
19
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
18
  var _SortingIconWrapper = require("../../ui/icons/SortingIconWrapper");
21
19
  var _pluginFactory = require("../plugin-factory");
22
20
  var _consts = require("./consts");
@@ -122,20 +120,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
122
120
  }
123
121
  var _getPluginState = (0, _pluginFactory.getPluginState)(oldState),
124
122
  getIntl = _getPluginState.getIntl;
125
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
126
- nodeViewPortalProviderAPI.render(function () {
127
- return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
128
- value: getIntl()
129
- }, /*#__PURE__*/(0, _react.createElement)(_SortingIconWrapper.SortingIconWrapper, {
130
- isSortingAllowed: !hasMergedCells,
131
- sortOrdered: sortOrdered,
132
- onClick: function onClick() {},
133
- onKeyDown: function onKeyDown() {},
134
- api: api
135
- }));
136
- }, element, decorationRenderKey);
137
- } else {
138
- _reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
123
+ nodeViewPortalProviderAPI.render(function () {
124
+ return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
139
125
  value: getIntl()
140
126
  }, /*#__PURE__*/(0, _react.createElement)(_SortingIconWrapper.SortingIconWrapper, {
141
127
  isSortingAllowed: !hasMergedCells,
@@ -143,16 +129,12 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
143
129
  onClick: function onClick() {},
144
130
  onKeyDown: function onKeyDown() {},
145
131
  api: api
146
- })), element);
147
- }
132
+ }));
133
+ }, element, decorationRenderKey);
148
134
  return element;
149
135
  }, {
150
136
  destroy: function destroy(node) {
151
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
152
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
153
- } else {
154
- _reactDom.default.unmountComponentAtNode(node);
155
- }
137
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
156
138
  }
157
139
  }));
158
140
  });
@@ -2,6 +2,8 @@ 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 { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
5
7
  import { getPluginState } from '../pm-plugins/plugin-factory';
6
8
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
7
9
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -311,7 +313,7 @@ export default class TableRow extends TableNodeView {
311
313
  const {
312
314
  table
313
315
  } = tree;
314
- const shouldStick = this.isHeaderSticky();
316
+ const shouldStick = this.shouldSticky();
315
317
  if (this.isSticky !== shouldStick) {
316
318
  if (shouldStick) {
317
319
  var _this$sentinelData$to;
@@ -323,6 +325,28 @@ export default class TableRow extends TableNodeView {
323
325
  }
324
326
  }
325
327
  }
328
+ shouldSticky() {
329
+ if (
330
+ // is Safari
331
+ navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome') && fg('platform_editor_advanced_layouts_post_fix_patch_4')) {
332
+ const pos = this.getPos();
333
+ if (typeof pos === 'number') {
334
+ const $tableRowPos = this.view.state.doc.resolve(pos);
335
+
336
+ // layout -> layout column -> table -> table row
337
+ if ($tableRowPos.depth >= 3) {
338
+ var _findParentNodeCloses;
339
+ const isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, node => {
340
+ return node.type.name === 'layoutColumn';
341
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
342
+ if (isInsideLayout) {
343
+ return false;
344
+ }
345
+ }
346
+ }
347
+ }
348
+ return this.isHeaderSticky();
349
+ }
326
350
  isHeaderSticky() {
327
351
  var _sentinelTop$rootBoun;
328
352
  /*
@@ -1,5 +1,4 @@
1
1
  import { createElement } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
  import { RawIntlProvider } from 'react-intl-next';
4
3
  import uuid from 'uuid/v4';
5
4
  import { nonNullable } from '@atlaskit/editor-common/utils';
@@ -9,7 +8,6 @@ import { nonNullable } from '@atlaskit/editor-common/utils';
9
8
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
10
9
  import { TableMap } from '@atlaskit/editor-tables/table-map';
11
10
  import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
11
  import { TableCssClassName as ClassName, TableDecorations } from '../../types';
14
12
  import { ColumnResizeWidget } from '../../ui/ColumnResizeWidget';
15
13
  const filterDecorationByKey = (key, decorationSet) => decorationSet.find(undefined, undefined, spec => spec.key.indexOf(key) > -1);
@@ -244,32 +242,18 @@ export const createResizeHandleDecoration = (tr, rowIndexTarget, columnEndIndexT
244
242
  const position = cellPos + cellNode.nodeSize - 1;
245
243
  return Decoration.widget(position, () => {
246
244
  const element = document.createElement('div');
247
- if (fg('platform_editor_react18_plugin_portalprovider')) {
248
- nodeViewPortalProviderAPI.render(() => /*#__PURE__*/createElement(RawIntlProvider, {
249
- value: getIntl()
250
- }, /*#__PURE__*/createElement(ColumnResizeWidget, {
251
- startIndex: cellColumnPositioning.left,
252
- endIndex: cellColumnPositioning.right,
253
- includeTooltip
254
- })), element, decorationRenderKey);
255
- } else {
256
- ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
257
- value: getIntl()
258
- }, /*#__PURE__*/createElement(ColumnResizeWidget, {
259
- startIndex: cellColumnPositioning.left,
260
- endIndex: cellColumnPositioning.right,
261
- includeTooltip
262
- })), element);
263
- }
245
+ nodeViewPortalProviderAPI.render(() => /*#__PURE__*/createElement(RawIntlProvider, {
246
+ value: getIntl()
247
+ }, /*#__PURE__*/createElement(ColumnResizeWidget, {
248
+ startIndex: cellColumnPositioning.left,
249
+ endIndex: cellColumnPositioning.right,
250
+ includeTooltip
251
+ })), element, decorationRenderKey);
264
252
  return element;
265
253
  }, {
266
254
  key: `${TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET}_${rowIndex}_${columnIndex}_${includeTooltip ? 'with' : 'no'}-tooltip`,
267
255
  destroy: node => {
268
- if (fg('platform_editor_react18_plugin_portalprovider')) {
269
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
270
- } else {
271
- ReactDOM.unmountComponentAtNode(node);
272
- }
256
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
273
257
  }
274
258
  });
275
259
  };
@@ -5,14 +5,12 @@
5
5
  */
6
6
 
7
7
  import { createElement } from 'react';
8
- import ReactDOM from 'react-dom';
9
8
  import { RawIntlProvider } from 'react-intl-next';
10
9
  import uuid from 'uuid/v4';
11
10
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
12
11
  import { SortOrder } from '@atlaskit/editor-common/types';
13
12
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
14
13
  import { TableMap } from '@atlaskit/editor-tables/table-map';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
14
  import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
17
15
  import { getPluginState } from '../plugin-factory';
18
16
  import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
@@ -99,35 +97,19 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
99
97
  const {
100
98
  getIntl
101
99
  } = getPluginState(oldState);
102
- if (fg('platform_editor_react18_plugin_portalprovider')) {
103
- nodeViewPortalProviderAPI.render(() => /*#__PURE__*/createElement(RawIntlProvider, {
104
- value: getIntl()
105
- }, /*#__PURE__*/createElement(SortingIconWrapper, {
106
- isSortingAllowed: !hasMergedCells,
107
- sortOrdered,
108
- onClick: () => {},
109
- onKeyDown: () => {},
110
- api
111
- })), element, decorationRenderKey);
112
- } else {
113
- ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
114
- value: getIntl()
115
- }, /*#__PURE__*/createElement(SortingIconWrapper, {
116
- isSortingAllowed: !hasMergedCells,
117
- sortOrdered,
118
- onClick: () => {},
119
- onKeyDown: () => {},
120
- api
121
- })), element);
122
- }
100
+ nodeViewPortalProviderAPI.render(() => /*#__PURE__*/createElement(RawIntlProvider, {
101
+ value: getIntl()
102
+ }, /*#__PURE__*/createElement(SortingIconWrapper, {
103
+ isSortingAllowed: !hasMergedCells,
104
+ sortOrdered,
105
+ onClick: () => {},
106
+ onKeyDown: () => {},
107
+ api
108
+ })), element, decorationRenderKey);
123
109
  return element;
124
110
  }, {
125
111
  destroy: node => {
126
- if (fg('platform_editor_react18_plugin_portalprovider')) {
127
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
128
- } else {
129
- ReactDOM.unmountComponentAtNode(node);
130
- }
112
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
131
113
  }
132
114
  }));
133
115
  });
@@ -9,6 +9,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
9
9
  import debounce from 'lodash/debounce';
10
10
  import throttle from 'lodash/throttle';
11
11
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
12
+ import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
12
14
  import { getPluginState } from '../pm-plugins/plugin-factory';
13
15
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
14
16
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -336,7 +338,7 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
336
338
  return;
337
339
  }
338
340
  var table = tree.table;
339
- var shouldStick = this.isHeaderSticky();
341
+ var shouldStick = this.shouldSticky();
340
342
  if (this.isSticky !== shouldStick) {
341
343
  if (shouldStick) {
342
344
  var _this$sentinelData$to;
@@ -348,6 +350,30 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
348
350
  }
349
351
  }
350
352
  }
353
+ }, {
354
+ key: "shouldSticky",
355
+ value: function shouldSticky() {
356
+ if (
357
+ // is Safari
358
+ navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome') && fg('platform_editor_advanced_layouts_post_fix_patch_4')) {
359
+ var pos = this.getPos();
360
+ if (typeof pos === 'number') {
361
+ var $tableRowPos = this.view.state.doc.resolve(pos);
362
+
363
+ // layout -> layout column -> table -> table row
364
+ if ($tableRowPos.depth >= 3) {
365
+ var _findParentNodeCloses;
366
+ var isInsideLayout = (_findParentNodeCloses = findParentNodeClosestToPos($tableRowPos, function (node) {
367
+ return node.type.name === 'layoutColumn';
368
+ })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
369
+ if (isInsideLayout) {
370
+ return false;
371
+ }
372
+ }
373
+ }
374
+ }
375
+ return this.isHeaderSticky();
376
+ }
351
377
  }, {
352
378
  key: "isHeaderSticky",
353
379
  value: function isHeaderSticky() {
@@ -1,6 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { createElement } from 'react';
3
- import ReactDOM from 'react-dom';
4
3
  import { RawIntlProvider } from 'react-intl-next';
5
4
  import uuid from 'uuid/v4';
6
5
  import { nonNullable } from '@atlaskit/editor-common/utils';
@@ -10,7 +9,6 @@ import { nonNullable } from '@atlaskit/editor-common/utils';
10
9
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
11
10
  import { TableMap } from '@atlaskit/editor-tables/table-map';
12
11
  import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
13
- import { fg } from '@atlaskit/platform-feature-flags';
14
12
  import { TableCssClassName as ClassName, TableDecorations } from '../../types';
15
13
  import { ColumnResizeWidget } from '../../ui/ColumnResizeWidget';
16
14
  var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
@@ -268,34 +266,20 @@ export var createResizeHandleDecoration = function createResizeHandleDecoration(
268
266
  var position = cellPos + cellNode.nodeSize - 1;
269
267
  return Decoration.widget(position, function () {
270
268
  var element = document.createElement('div');
271
- if (fg('platform_editor_react18_plugin_portalprovider')) {
272
- nodeViewPortalProviderAPI.render(function () {
273
- return /*#__PURE__*/createElement(RawIntlProvider, {
274
- value: getIntl()
275
- }, /*#__PURE__*/createElement(ColumnResizeWidget, {
276
- startIndex: cellColumnPositioning.left,
277
- endIndex: cellColumnPositioning.right,
278
- includeTooltip: includeTooltip
279
- }));
280
- }, element, decorationRenderKey);
281
- } else {
282
- ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
269
+ nodeViewPortalProviderAPI.render(function () {
270
+ return /*#__PURE__*/createElement(RawIntlProvider, {
283
271
  value: getIntl()
284
272
  }, /*#__PURE__*/createElement(ColumnResizeWidget, {
285
273
  startIndex: cellColumnPositioning.left,
286
274
  endIndex: cellColumnPositioning.right,
287
275
  includeTooltip: includeTooltip
288
- })), element);
289
- }
276
+ }));
277
+ }, element, decorationRenderKey);
290
278
  return element;
291
279
  }, {
292
280
  key: "".concat(TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
293
281
  destroy: function destroy(node) {
294
- if (fg('platform_editor_react18_plugin_portalprovider')) {
295
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
296
- } else {
297
- ReactDOM.unmountComponentAtNode(node);
298
- }
282
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
299
283
  }
300
284
  });
301
285
  };
@@ -13,14 +13,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  */
14
14
 
15
15
  import { createElement } from 'react';
16
- import ReactDOM from 'react-dom';
17
16
  import { RawIntlProvider } from 'react-intl-next';
18
17
  import uuid from 'uuid/v4';
19
18
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
20
19
  import { SortOrder } from '@atlaskit/editor-common/types';
21
20
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
22
21
  import { TableMap } from '@atlaskit/editor-tables/table-map';
23
- import { fg } from '@atlaskit/platform-feature-flags';
24
22
  import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
25
23
  import { getPluginState } from '../plugin-factory';
26
24
  import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
@@ -117,20 +115,8 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
117
115
  }
118
116
  var _getPluginState = getPluginState(oldState),
119
117
  getIntl = _getPluginState.getIntl;
120
- if (fg('platform_editor_react18_plugin_portalprovider')) {
121
- nodeViewPortalProviderAPI.render(function () {
122
- return /*#__PURE__*/createElement(RawIntlProvider, {
123
- value: getIntl()
124
- }, /*#__PURE__*/createElement(SortingIconWrapper, {
125
- isSortingAllowed: !hasMergedCells,
126
- sortOrdered: sortOrdered,
127
- onClick: function onClick() {},
128
- onKeyDown: function onKeyDown() {},
129
- api: api
130
- }));
131
- }, element, decorationRenderKey);
132
- } else {
133
- ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
118
+ nodeViewPortalProviderAPI.render(function () {
119
+ return /*#__PURE__*/createElement(RawIntlProvider, {
134
120
  value: getIntl()
135
121
  }, /*#__PURE__*/createElement(SortingIconWrapper, {
136
122
  isSortingAllowed: !hasMergedCells,
@@ -138,16 +124,12 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
138
124
  onClick: function onClick() {},
139
125
  onKeyDown: function onKeyDown() {},
140
126
  api: api
141
- })), element);
142
- }
127
+ }));
128
+ }, element, decorationRenderKey);
143
129
  return element;
144
130
  }, {
145
131
  destroy: function destroy(node) {
146
- if (fg('platform_editor_react18_plugin_portalprovider')) {
147
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
148
- } else {
149
- ReactDOM.unmountComponentAtNode(node);
150
- }
132
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
151
133
  }
152
134
  }));
153
135
  });
@@ -42,6 +42,7 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
42
42
  private createResizeObserver;
43
43
  private createIntersectionObserver;
44
44
  private refreshStickyState;
45
+ private shouldSticky;
45
46
  private isHeaderSticky;
46
47
  private onTablePluginState;
47
48
  private updateStickyHeaderWidth;
@@ -401,28 +401,25 @@ export declare const TableCssClassName: {
401
401
  WITH_ROW_INSERT_LINE_INACTIVE: string;
402
402
  WITH_LAST_ROW_INSERT_LINE: string;
403
403
  WITH_LAST_ROW_INSERT_LINE_INACTIVE: string;
404
- TABLE_CONTAINER: string;
405
- TABLE_NODE_WRAPPER: string;
406
- TABLE_LEFT_SHADOW: string;
407
- TABLE_RIGHT_SHADOW: string;
408
- TABLE_STICKY_SHADOW: string;
409
- TABLE_STICKY_WRAPPER: string;
410
- TABLE_STICKY_SCROLLBAR_CONTAINER: string;
411
- TABLE_STICKY_SENTINEL_TOP: string;
412
- TABLE_STICKY_SENTINEL_BOTTOM: string;
413
- TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
414
- TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
415
- TABLE_SHADOW_SENTINEL_LEFT: string;
416
- TABLE_SHADOW_SENTINEL_RIGHT: string;
417
- TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
418
- TABLE_CELL_WRAPPER: string;
419
- /**
420
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6877 Internal documentation for deprecation (no external access)}
421
- **/
422
- TABLE_HEADER_CELL_WRAPPER: string;
423
- TABLE_ROW_CONTROLS_WRAPPER: string;
424
- TABLE_COLUMN_CONTROLS_DECORATIONS: string;
425
- TABLE_RESIZER_CONTAINER: string;
404
+ TABLE_CONTAINER: "pm-table-container";
405
+ TABLE_NODE_WRAPPER: "pm-table-wrapper";
406
+ TABLE_LEFT_SHADOW: "pm-table-with-left-shadow";
407
+ TABLE_RIGHT_SHADOW: "pm-table-with-right-shadow";
408
+ TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
409
+ TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
410
+ TABLE_STICKY_SCROLLBAR_CONTAINER: "pm-table-sticky-scrollbar-container";
411
+ TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
412
+ TABLE_STICKY_SENTINEL_BOTTOM: "pm-table-sticky-sentinel-bottom";
413
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "pm-table-sticky-scrollbar-sentinel-top";
414
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "pm-table-sticky-scrollbar-sentinel-bottom";
415
+ TABLE_SHADOW_SENTINEL_LEFT: "pm-table-shadow-sentinel-left";
416
+ TABLE_SHADOW_SENTINEL_RIGHT: "pm-table-shadow-sentinel-right";
417
+ TABLE_CELL_NODEVIEW_CONTENT_DOM: "pm-table-cell-nodeview-content-dom";
418
+ TABLE_CELL_WRAPPER: "pm-table-cell-content-wrap";
419
+ TABLE_HEADER_CELL_WRAPPER: "pm-table-header-content-wrap";
420
+ TABLE_ROW_CONTROLS_WRAPPER: "pm-table-row-controls-wrapper";
421
+ TABLE_COLUMN_CONTROLS_DECORATIONS: "pm-table-column-controls-decoration";
422
+ TABLE_RESIZER_CONTAINER: "pm-table-resizer-container";
426
423
  };
427
424
  export interface ToolbarMenuConfig {
428
425
  allowHeaderRow?: boolean;
@@ -42,6 +42,7 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
42
42
  private createResizeObserver;
43
43
  private createIntersectionObserver;
44
44
  private refreshStickyState;
45
+ private shouldSticky;
45
46
  private isHeaderSticky;
46
47
  private onTablePluginState;
47
48
  private updateStickyHeaderWidth;
@@ -401,28 +401,25 @@ export declare const TableCssClassName: {
401
401
  WITH_ROW_INSERT_LINE_INACTIVE: string;
402
402
  WITH_LAST_ROW_INSERT_LINE: string;
403
403
  WITH_LAST_ROW_INSERT_LINE_INACTIVE: string;
404
- TABLE_CONTAINER: string;
405
- TABLE_NODE_WRAPPER: string;
406
- TABLE_LEFT_SHADOW: string;
407
- TABLE_RIGHT_SHADOW: string;
408
- TABLE_STICKY_SHADOW: string;
409
- TABLE_STICKY_WRAPPER: string;
410
- TABLE_STICKY_SCROLLBAR_CONTAINER: string;
411
- TABLE_STICKY_SENTINEL_TOP: string;
412
- TABLE_STICKY_SENTINEL_BOTTOM: string;
413
- TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
414
- TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
415
- TABLE_SHADOW_SENTINEL_LEFT: string;
416
- TABLE_SHADOW_SENTINEL_RIGHT: string;
417
- TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
418
- TABLE_CELL_WRAPPER: string;
419
- /**
420
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6877 Internal documentation for deprecation (no external access)}
421
- **/
422
- TABLE_HEADER_CELL_WRAPPER: string;
423
- TABLE_ROW_CONTROLS_WRAPPER: string;
424
- TABLE_COLUMN_CONTROLS_DECORATIONS: string;
425
- TABLE_RESIZER_CONTAINER: string;
404
+ TABLE_CONTAINER: "pm-table-container";
405
+ TABLE_NODE_WRAPPER: "pm-table-wrapper";
406
+ TABLE_LEFT_SHADOW: "pm-table-with-left-shadow";
407
+ TABLE_RIGHT_SHADOW: "pm-table-with-right-shadow";
408
+ TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
409
+ TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
410
+ TABLE_STICKY_SCROLLBAR_CONTAINER: "pm-table-sticky-scrollbar-container";
411
+ TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
412
+ TABLE_STICKY_SENTINEL_BOTTOM: "pm-table-sticky-sentinel-bottom";
413
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "pm-table-sticky-scrollbar-sentinel-top";
414
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "pm-table-sticky-scrollbar-sentinel-bottom";
415
+ TABLE_SHADOW_SENTINEL_LEFT: "pm-table-shadow-sentinel-left";
416
+ TABLE_SHADOW_SENTINEL_RIGHT: "pm-table-shadow-sentinel-right";
417
+ TABLE_CELL_NODEVIEW_CONTENT_DOM: "pm-table-cell-nodeview-content-dom";
418
+ TABLE_CELL_WRAPPER: "pm-table-cell-content-wrap";
419
+ TABLE_HEADER_CELL_WRAPPER: "pm-table-header-content-wrap";
420
+ TABLE_ROW_CONTROLS_WRAPPER: "pm-table-row-controls-wrapper";
421
+ TABLE_COLUMN_CONTROLS_DECORATIONS: "pm-table-column-controls-decoration";
422
+ TABLE_RESIZER_CONTAINER: "pm-table-resizer-container";
426
423
  };
427
424
  export interface ToolbarMenuConfig {
428
425
  allowHeaderRow?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,23 +27,23 @@
27
27
  "runReact18": true
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/adf-schema": "^46.1.0",
30
+ "@atlaskit/adf-schema": "^47.2.1",
31
31
  "@atlaskit/button": "^20.5.0",
32
32
  "@atlaskit/custom-steps": "^0.10.0",
33
- "@atlaskit/editor-common": "^99.10.0",
33
+ "@atlaskit/editor-common": "^99.14.0",
34
34
  "@atlaskit/editor-palette": "1.7.0",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^1.4.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.12.0",
37
- "@atlaskit/editor-plugin-batch-attribute-updates": "1.3.0",
37
+ "@atlaskit/editor-plugin-batch-attribute-updates": "1.3.1",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^1.13.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^2.2.0",
40
40
  "@atlaskit/editor-plugin-guideline": "^1.4.0",
41
- "@atlaskit/editor-plugin-selection": "^1.7.0",
41
+ "@atlaskit/editor-plugin-selection": "^1.8.0",
42
42
  "@atlaskit/editor-plugin-width": "^2.1.0",
43
43
  "@atlaskit/editor-prosemirror": "7.0.0",
44
44
  "@atlaskit/editor-shared-styles": "^3.2.0",
45
45
  "@atlaskit/editor-tables": "^2.9.0",
46
- "@atlaskit/icon": "^23.7.0",
46
+ "@atlaskit/icon": "^23.9.0",
47
47
  "@atlaskit/menu": "^2.14.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.0.0",
49
49
  "@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
@@ -51,7 +51,7 @@
51
51
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
52
52
  "@atlaskit/primitives": "^13.5.0",
53
53
  "@atlaskit/theme": "^15.0.0",
54
- "@atlaskit/tmp-editor-statsig": "^2.43.0",
54
+ "@atlaskit/tmp-editor-statsig": "^2.46.0",
55
55
  "@atlaskit/toggle": "^14.1.0",
56
56
  "@atlaskit/tokens": "^3.3.0",
57
57
  "@atlaskit/tooltip": "^19.1.0",
@@ -116,9 +116,6 @@
116
116
  "platform-visual-refresh-icons": {
117
117
  "type": "boolean"
118
118
  },
119
- "platform_editor_react18_plugin_portalprovider": {
120
- "type": "boolean"
121
- },
122
119
  "platform_editor_use_nested_table_pm_nodes": {
123
120
  "type": "boolean",
124
121
  "referenceOnly": true
@@ -149,6 +146,9 @@
149
146
  },
150
147
  "platform_editor_table_layout_shift_fix": {
151
148
  "type": "boolean"
149
+ },
150
+ "platform_editor_advanced_layouts_post_fix_patch_4": {
151
+ "type": "boolean"
152
152
  }
153
153
  }
154
154
  }
@@ -4,7 +4,9 @@ import throttle from 'lodash/throttle';
4
4
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
5
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
6
6
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
+ import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
7
8
  import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
8
10
 
9
11
  import { getPluginState } from '../pm-plugins/plugin-factory';
10
12
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
@@ -384,7 +386,7 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
384
386
  return;
385
387
  }
386
388
  const { table } = tree;
387
- const shouldStick = this.isHeaderSticky();
389
+ const shouldStick = this.shouldSticky();
388
390
  if (this.isSticky !== shouldStick) {
389
391
  if (shouldStick) {
390
392
  // The rootRect is kept in sync across sentinels so it doesn't matter which one we use.
@@ -396,6 +398,33 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
396
398
  }
397
399
  }
398
400
 
401
+ private shouldSticky() {
402
+ if (
403
+ // is Safari
404
+ navigator.userAgent.includes('AppleWebKit') &&
405
+ !navigator.userAgent.includes('Chrome') &&
406
+ fg('platform_editor_advanced_layouts_post_fix_patch_4')
407
+ ) {
408
+ const pos = this.getPos();
409
+ if (typeof pos === 'number') {
410
+ const $tableRowPos = this.view.state.doc.resolve(pos);
411
+
412
+ // layout -> layout column -> table -> table row
413
+ if ($tableRowPos.depth >= 3) {
414
+ const isInsideLayout = findParentNodeClosestToPos($tableRowPos, (node) => {
415
+ return node.type.name === 'layoutColumn';
416
+ })?.node;
417
+
418
+ if (isInsideLayout) {
419
+ return false;
420
+ }
421
+ }
422
+ }
423
+ }
424
+
425
+ return this.isHeaderSticky();
426
+ }
427
+
399
428
  private isHeaderSticky() {
400
429
  /*
401
430
  # Overview
@@ -1,6 +1,5 @@
1
1
  import { createElement } from 'react';
2
2
 
3
- import ReactDOM from 'react-dom';
4
3
  import { RawIntlProvider } from 'react-intl-next';
5
4
  import type { IntlShape } from 'react-intl-next';
6
5
  import uuid from 'uuid/v4';
@@ -20,7 +19,6 @@ import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
20
19
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
21
20
  import { TableMap } from '@atlaskit/editor-tables/table-map';
22
21
  import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
23
- import { fg } from '@atlaskit/platform-feature-flags';
24
22
 
25
23
  import type { Cell, CellColumnPositioning } from '../../types';
26
24
  import { TableCssClassName as ClassName, TableDecorations } from '../../types';
@@ -341,23 +339,8 @@ export const createResizeHandleDecoration = (
341
339
  position,
342
340
  () => {
343
341
  const element = document.createElement('div');
344
- if (fg('platform_editor_react18_plugin_portalprovider')) {
345
- nodeViewPortalProviderAPI.render(
346
- () =>
347
- createElement(
348
- RawIntlProvider,
349
- { value: getIntl() },
350
- createElement(ColumnResizeWidget, {
351
- startIndex: cellColumnPositioning.left,
352
- endIndex: cellColumnPositioning.right,
353
- includeTooltip,
354
- }),
355
- ),
356
- element,
357
- decorationRenderKey,
358
- );
359
- } else {
360
- ReactDOM.render(
342
+ nodeViewPortalProviderAPI.render(
343
+ () =>
361
344
  createElement(
362
345
  RawIntlProvider,
363
346
  { value: getIntl() },
@@ -367,9 +350,9 @@ export const createResizeHandleDecoration = (
367
350
  includeTooltip,
368
351
  }),
369
352
  ),
370
- element,
371
- );
372
- }
353
+ element,
354
+ decorationRenderKey,
355
+ );
373
356
  return element;
374
357
  },
375
358
  {
@@ -377,11 +360,7 @@ export const createResizeHandleDecoration = (
377
360
  TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET
378
361
  }_${rowIndex}_${columnIndex}_${includeTooltip ? 'with' : 'no'}-tooltip`,
379
362
  destroy: (node) => {
380
- if (fg('platform_editor_react18_plugin_portalprovider')) {
381
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
382
- } else {
383
- ReactDOM.unmountComponentAtNode(node as HTMLDivElement);
384
- }
363
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
385
364
  },
386
365
  },
387
366
  );
@@ -6,7 +6,6 @@
6
6
 
7
7
  import { createElement } from 'react';
8
8
 
9
- import ReactDOM from 'react-dom';
10
9
  import { RawIntlProvider } from 'react-intl-next';
11
10
  import uuid from 'uuid/v4';
12
11
 
@@ -16,7 +15,6 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
16
15
  import { SortOrder } from '@atlaskit/editor-common/types';
17
16
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
18
17
  import { TableMap } from '@atlaskit/editor-tables/table-map';
19
- import { fg } from '@atlaskit/platform-feature-flags';
20
18
 
21
19
  import type tablePlugin from '../../tablePlugin';
22
20
  import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
@@ -111,25 +109,8 @@ export const createPlugin = (
111
109
 
112
110
  const { getIntl } = getPluginState(oldState);
113
111
 
114
- if (fg('platform_editor_react18_plugin_portalprovider')) {
115
- nodeViewPortalProviderAPI.render(
116
- () =>
117
- createElement(
118
- RawIntlProvider,
119
- { value: getIntl() },
120
- createElement(SortingIconWrapper, {
121
- isSortingAllowed: !hasMergedCells,
122
- sortOrdered,
123
- onClick: () => {},
124
- onKeyDown: () => {},
125
- api,
126
- }),
127
- ),
128
- element,
129
- decorationRenderKey,
130
- );
131
- } else {
132
- ReactDOM.render(
112
+ nodeViewPortalProviderAPI.render(
113
+ () =>
133
114
  createElement(
134
115
  RawIntlProvider,
135
116
  { value: getIntl() },
@@ -141,19 +122,15 @@ export const createPlugin = (
141
122
  api,
142
123
  }),
143
124
  ),
144
- element,
145
- );
146
- }
125
+ element,
126
+ decorationRenderKey,
127
+ );
147
128
 
148
129
  return element;
149
130
  },
150
131
  {
151
132
  destroy: (node) => {
152
- if (fg('platform_editor_react18_plugin_portalprovider')) {
153
- nodeViewPortalProviderAPI.remove(decorationRenderKey);
154
- } else {
155
- ReactDOM.unmountComponentAtNode(node as HTMLDivElement);
156
- }
133
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
157
134
  },
158
135
  },
159
136
  ),