@atlaskit/editor-plugin-table 7.31.0 → 7.31.2

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 (92) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/commands/column-resize.js +10 -8
  3. package/dist/cjs/commands/misc.js +4 -4
  4. package/dist/cjs/event-handlers.js +69 -65
  5. package/dist/cjs/plugin.js +52 -48
  6. package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +2 -2
  7. package/dist/cjs/pm-plugins/keymap.js +18 -15
  8. package/dist/cjs/pm-plugins/main.js +2 -2
  9. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +2 -2
  10. package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
  11. package/dist/cjs/pm-plugins/view-mode-sort/index.js +35 -10
  12. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +12 -17
  13. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +8 -11
  14. package/dist/cjs/ui/FloatingDragMenu/index.js +1 -4
  15. package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -2
  16. package/dist/cjs/utils/decoration.js +28 -8
  17. package/dist/cjs/utils/drag-menu.js +3 -4
  18. package/dist/es2019/commands/column-resize.js +10 -8
  19. package/dist/es2019/commands/misc.js +4 -4
  20. package/dist/es2019/event-handlers.js +4 -4
  21. package/dist/es2019/plugin.js +12 -7
  22. package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +2 -2
  23. package/dist/es2019/pm-plugins/keymap.js +7 -4
  24. package/dist/es2019/pm-plugins/main.js +2 -2
  25. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +2 -2
  26. package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
  27. package/dist/es2019/pm-plugins/view-mode-sort/index.js +33 -10
  28. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +1 -8
  29. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +8 -9
  30. package/dist/es2019/ui/FloatingDragMenu/index.js +1 -3
  31. package/dist/es2019/ui/FloatingDragMenu/styles.js +2 -2
  32. package/dist/es2019/utils/decoration.js +26 -9
  33. package/dist/es2019/utils/drag-menu.js +2 -2
  34. package/dist/esm/commands/column-resize.js +10 -8
  35. package/dist/esm/commands/misc.js +4 -4
  36. package/dist/esm/event-handlers.js +69 -65
  37. package/dist/esm/plugin.js +52 -48
  38. package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +2 -2
  39. package/dist/esm/pm-plugins/keymap.js +18 -15
  40. package/dist/esm/pm-plugins/main.js +2 -2
  41. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +2 -2
  42. package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
  43. package/dist/esm/pm-plugins/view-mode-sort/index.js +35 -10
  44. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +12 -17
  45. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +8 -11
  46. package/dist/esm/ui/FloatingDragMenu/index.js +1 -4
  47. package/dist/esm/ui/FloatingDragMenu/styles.js +1 -2
  48. package/dist/esm/utils/decoration.js +28 -8
  49. package/dist/esm/utils/drag-menu.js +3 -4
  50. package/dist/types/commands/column-resize.d.ts +5 -2
  51. package/dist/types/commands/misc.d.ts +3 -2
  52. package/dist/types/event-handlers.d.ts +2 -1
  53. package/dist/types/pm-plugins/decorations/utils/column-resizing.d.ts +2 -1
  54. package/dist/types/pm-plugins/keymap.d.ts +2 -1
  55. package/dist/types/pm-plugins/main.d.ts +1 -1
  56. package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
  57. package/dist/types/pm-plugins/table-resizing/plugin.d.ts +2 -1
  58. package/dist/types/pm-plugins/view-mode-sort/index.d.ts +2 -1
  59. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +0 -1
  60. package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
  61. package/dist/types/utils/decoration.d.ts +2 -1
  62. package/dist/types/utils/drag-menu.d.ts +1 -1
  63. package/dist/types-ts4.5/commands/column-resize.d.ts +5 -2
  64. package/dist/types-ts4.5/commands/misc.d.ts +3 -2
  65. package/dist/types-ts4.5/event-handlers.d.ts +2 -1
  66. package/dist/types-ts4.5/pm-plugins/decorations/utils/column-resizing.d.ts +2 -1
  67. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -1
  68. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
  69. package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
  70. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +2 -1
  71. package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +2 -1
  72. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +0 -1
  73. package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
  74. package/dist/types-ts4.5/utils/decoration.d.ts +2 -1
  75. package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
  76. package/package.json +9 -5
  77. package/src/commands/column-resize.ts +18 -1
  78. package/src/commands/misc.ts +5 -0
  79. package/src/event-handlers.ts +22 -20
  80. package/src/plugin.tsx +10 -4
  81. package/src/pm-plugins/decorations/utils/column-resizing.ts +3 -0
  82. package/src/pm-plugins/keymap.ts +5 -0
  83. package/src/pm-plugins/main.ts +2 -1
  84. package/src/pm-plugins/table-resizing/event-handlers.ts +8 -1
  85. package/src/pm-plugins/table-resizing/plugin.ts +3 -0
  86. package/src/pm-plugins/view-mode-sort/index.ts +73 -34
  87. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +1 -5
  88. package/src/ui/FloatingDragMenu/DragMenu.tsx +5 -14
  89. package/src/ui/FloatingDragMenu/index.tsx +2 -6
  90. package/src/ui/FloatingDragMenu/styles.ts +4 -6
  91. package/src/utils/decoration.ts +39 -13
  92. package/src/utils/drag-menu.ts +1 -2
@@ -11,10 +11,12 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _react = require("react");
12
12
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
+ var _v = _interopRequireDefault(require("uuid/v4"));
14
15
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
15
16
  var _types = require("@atlaskit/editor-common/types");
16
17
  var _view = require("@atlaskit/editor-prosemirror/view");
17
18
  var _tableMap = require("@atlaskit/editor-tables/table-map");
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
20
  var _SortingIconWrapper = require("../../ui/icons/SortingIconWrapper");
19
21
  var _pluginFactory = require("../plugin-factory");
20
22
  var _consts = require("./consts");
@@ -29,7 +31,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
29
31
  * Instead of making changes to the ProseMirror document, the plugin sorts the table rows in the DOM. This allows the sorting to be
30
32
  * visible to the user without affecting the document's content.
31
33
  */
32
- var createPlugin = exports.createPlugin = function createPlugin(api) {
34
+ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPortalProviderAPI) {
33
35
  return new _safePlugin.SafePlugin({
34
36
  state: {
35
37
  init: function init() {
@@ -102,6 +104,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
102
104
  var map = _tableMap.TableMap.get(tableNode);
103
105
  var hasMergedCells = new Set(map.map).size !== map.map.length;
104
106
  map.mapByRow[0].forEach(function (cell, index) {
107
+ var decorationRenderKey = (0, _v.default)();
105
108
  decs.push(_view.Decoration.widget(cell + pos + 2, function () {
106
109
  var _sort$tableId;
107
110
  var element = document.createElement('div');
@@ -119,16 +122,38 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
119
122
  }
120
123
  var _getPluginState = (0, _pluginFactory.getPluginState)(oldState),
121
124
  getIntl = _getPluginState.getIntl;
122
- _reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
123
- value: getIntl()
124
- }, /*#__PURE__*/(0, _react.createElement)(_SortingIconWrapper.SortingIconWrapper, {
125
- isSortingAllowed: !hasMergedCells,
126
- sortOrdered: sortOrdered,
127
- onClick: function onClick() {},
128
- onKeyDown: function onKeyDown() {},
129
- api: api
130
- })), element);
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, {
139
+ value: getIntl()
140
+ }, /*#__PURE__*/(0, _react.createElement)(_SortingIconWrapper.SortingIconWrapper, {
141
+ isSortingAllowed: !hasMergedCells,
142
+ sortOrdered: sortOrdered,
143
+ onClick: function onClick() {},
144
+ onKeyDown: function onKeyDown() {},
145
+ api: api
146
+ })), element);
147
+ }
131
148
  return element;
149
+ }, {
150
+ 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
+ }
156
+ }
132
157
  }));
133
158
  });
134
159
  });
@@ -423,14 +423,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
423
423
  });
424
424
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createOriginalContextMenuItems", function () {
425
425
  var items = [];
426
- var getEditorFeatureFlags = _this.props.getEditorFeatureFlags;
427
- var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
428
- _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
429
- tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
430
426
  var sortColumnItems = _this.createSortColumnItems();
431
427
  var backgroundColorItem = _this.createBackgroundColorItem();
432
428
  var distributeColumnsItem = _this.createDistributeColumnsItem();
433
- tableSortColumnReorder && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
429
+ sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
434
430
  backgroundColorItem && items.push(backgroundColorItem);
435
431
  items.push(_this.createInsertColumnItem());
436
432
  items.push(_this.createInsertRowItem());
@@ -438,7 +434,6 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
438
434
  items.push(_this.createDeleteRowItem());
439
435
  items.push.apply(items, (0, _toConsumableArray2.default)(_this.createMergeSplitCellItems()));
440
436
  distributeColumnsItem && items.push(distributeColumnsItem);
441
- !tableSortColumnReorder && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
442
437
  items.push(_this.createClearCellsItem());
443
438
  return [{
444
439
  items: items
@@ -469,8 +464,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
469
464
  items[1].items.push(deleteRowItem);
470
465
  return items;
471
466
  });
472
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (_ref3) {
473
- var item = _ref3.item;
467
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (_ref2) {
468
+ var item = _ref2.item;
474
469
  var _this$props10 = _this.props,
475
470
  editorView = _this$props10.editorView,
476
471
  selectionRect = _this$props10.selectionRect,
@@ -486,11 +481,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
486
481
  targetCellPosition = _getPluginState11.targetCellPosition,
487
482
  _getPluginState11$isT = _getPluginState11.isTableScalingEnabled,
488
483
  isTableScalingEnabled = _getPluginState11$isT === void 0 ? false : _getPluginState11$isT;
489
- var _ref4 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
490
- _ref4$tableDuplicateC = _ref4.tableDuplicateCellColouring,
491
- tableDuplicateCellColouring = _ref4$tableDuplicateC === void 0 ? false : _ref4$tableDuplicateC,
492
- _ref4$tableWithFixedC = _ref4.tableWithFixedColumnWidthsOption,
493
- tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
484
+ var _ref3 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
485
+ _ref3$tableDuplicateC = _ref3.tableDuplicateCellColouring,
486
+ tableDuplicateCellColouring = _ref3$tableDuplicateC === void 0 ? false : _ref3$tableDuplicateC,
487
+ _ref3$tableWithFixedC = _ref3.tableWithFixedColumnWidthsOption,
488
+ tableWithFixedColumnWidthsOption = _ref3$tableWithFixedC === void 0 ? false : _ref3$tableWithFixedC;
494
489
  // context menu opened by keyboard and any item except 'background' activated
495
490
  // or color has been chosen from color palette
496
491
  if (isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen)) {
@@ -619,8 +614,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
619
614
  }
620
615
  }
621
616
  });
622
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref5) {
623
- var item = _ref5.item;
617
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref4) {
618
+ var item = _ref4.item;
624
619
  var _this$props13 = _this.props,
625
620
  _this$props13$editorV = _this$props13.editorView,
626
621
  state = _this$props13$editorV.state,
@@ -643,8 +638,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
643
638
  (0, _commands.hoverMergedCells)()(state, dispatch);
644
639
  }
645
640
  });
646
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (_ref6) {
647
- var item = _ref6.item;
641
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (_ref5) {
642
+ var item = _ref5.item;
648
643
  var _this$props$editorVie = _this.props.editorView,
649
644
  state = _this$props$editorVie.state,
650
645
  dispatch = _this$props$editorVie.dispatch;
@@ -105,20 +105,18 @@ var MapDragMenuOptionIdToMessage = {
105
105
  plural: null
106
106
  }
107
107
  };
108
- var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(tableSortColumnReorder) {
108
+ var getGroupedDragMenuConfig = function getGroupedDragMenuConfig() {
109
109
  var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down']];
110
110
  var sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
111
- tableSortColumnReorder ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
111
+ groupedDragMenuConfig.unshift(sortColumnItems);
112
112
  return groupedDragMenuConfig;
113
113
  };
114
114
  var elementBeforeIconStyles = (0, _primitives.xcss)({
115
115
  marginRight: 'space.negative.075',
116
116
  display: 'flex'
117
117
  });
118
- var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage) {
119
- var tableSortColumnReorder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
120
- var selectionRect = arguments.length > 3 ? arguments[3] : undefined;
121
- var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
118
+ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect) {
119
+ var groupedDragMenuConfig = getGroupedDragMenuConfig();
122
120
  var menuItemsArr = (0, _toConsumableArray2.default)(Array(groupedDragMenuConfig.length)).map(function () {
123
121
  return [];
124
122
  });
@@ -216,7 +214,6 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
216
214
  tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
217
215
  shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
218
216
  isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
219
- tableSortColumnReorder = _ref.tableSortColumnReorder,
220
217
  ariaNotifyPlugin = _ref.ariaNotifyPlugin,
221
218
  isCommentEditor = _ref.isCommentEditor;
222
219
  var state = editorView.state,
@@ -232,8 +229,8 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
232
229
  var selectionRect = (0, _utils2.isSelectionType)(selection, 'cell') ? (0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
233
230
  var hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
234
231
  var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
235
- var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, tableSortColumnReorder, ariaNotifyPlugin, isCommentEditor);
236
- var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, tableSortColumnReorder, selectionRect),
232
+ var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
233
+ var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
237
234
  menuItems = _convertToDropdownIte.menuItems,
238
235
  menuCallback = _convertToDropdownIte.menuCallback;
239
236
  var handleSubMenuRef = function handleSubMenuRef(ref) {
@@ -282,7 +279,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
282
279
  className: _styles.DropdownMenuSharedCssClassName.SUBMENU
283
280
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
284
281
  ,
285
- css: (0, _styles2.dragMenuBackgroundColorStyles)(tableSortColumnReorder)
282
+ css: (0, _styles2.dragMenuBackgroundColorStyles)()
286
283
  }, (0, _react2.jsx)("div", {
287
284
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
288
285
  css: (0, _styles2.cellColourPreviewStyles)(background)
@@ -480,7 +477,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
480
477
  return null;
481
478
  }
482
479
  if (allowBackgroundColor) {
483
- tableSortColumnReorder ? menuItems[1].items.unshift(createBackgroundColorMenuItem()) : menuItems[0].items.unshift(createBackgroundColorMenuItem());
480
+ menuItems[1].items.unshift(createBackgroundColorMenuItem());
484
481
  }
485
482
 
486
483
  // If first row, add toggle for Header row, default is true
@@ -43,9 +43,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
43
43
  _ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
44
44
  tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
45
45
  _ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
46
- tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC,
47
- _ref2$tableSortColumn = _ref2.tableSortColumnReorder,
48
- tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
46
+ tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC;
49
47
  var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (tableWithFixedColumnWidthsOption || isCommentEditor);
50
48
  return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
51
49
  alignX: direction === 'row' ? 'right' : undefined,
@@ -84,7 +82,6 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
84
82
  tableDuplicateCellColouring: tableDuplicateCellColouring,
85
83
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
86
84
  isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
87
- tableSortColumnReorder: tableSortColumnReorder,
88
85
  ariaNotifyPlugin: ariaNotifyPlugin,
89
86
  api: api,
90
87
  isCommentEditor: isCommentEditor || false
@@ -23,8 +23,7 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
23
23
 
24
24
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
25
25
  var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
26
- var tableSortColumnReorder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
27
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), tableSortColumnReorder ? _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
26
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
28
27
  };
29
28
 
30
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -9,10 +9,12 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
9
9
  var _react = require("react");
10
10
  var _reactDom = _interopRequireDefault(require("react-dom"));
11
11
  var _reactIntlNext = require("react-intl-next");
12
+ var _v = _interopRequireDefault(require("uuid/v4"));
12
13
  var _utils = require("@atlaskit/editor-common/utils");
13
14
  var _view = require("@atlaskit/editor-prosemirror/view");
14
15
  var _tableMap = require("@atlaskit/editor-tables/table-map");
15
16
  var _utils2 = require("@atlaskit/editor-tables/utils");
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
18
  var _types = require("../types");
17
19
  var _ColumnResizeWidget = require("../ui/ColumnResizeWidget");
18
20
  // @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
@@ -251,6 +253,7 @@ var makeArray = function makeArray(n) {
251
253
  var createResizeHandleDecoration = exports.createResizeHandleDecoration = function createResizeHandleDecoration(tr, rowIndexTarget, columnEndIndexTarget) {
252
254
  var includeTooltip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
253
255
  var getIntl = arguments.length > 4 ? arguments[4] : undefined;
256
+ var nodeViewPortalProviderAPI = arguments.length > 5 ? arguments[5] : undefined;
254
257
  var emptyResult = [[], []];
255
258
  var table = (0, _utils2.findTable)(tr.selection);
256
259
  if (!table || !table.node) {
@@ -261,21 +264,38 @@ var createResizeHandleDecoration = exports.createResizeHandleDecoration = functi
261
264
  return emptyResult;
262
265
  }
263
266
  var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode) {
267
+ var decorationRenderKey = (0, _v.default)();
264
268
  var position = cellPos + cellNode.nodeSize - 1;
265
269
  return _view.Decoration.widget(position, function () {
266
270
  var element = document.createElement('div');
267
- _reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
268
- value: getIntl()
269
- }, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
270
- startIndex: cellColumnPositioning.left,
271
- endIndex: cellColumnPositioning.right,
272
- includeTooltip: includeTooltip
273
- })), element);
271
+ if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
272
+ nodeViewPortalProviderAPI.render(function () {
273
+ return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
274
+ value: getIntl()
275
+ }, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
276
+ startIndex: cellColumnPositioning.left,
277
+ endIndex: cellColumnPositioning.right,
278
+ includeTooltip: includeTooltip
279
+ }));
280
+ }, element, decorationRenderKey);
281
+ } else {
282
+ _reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
283
+ value: getIntl()
284
+ }, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
285
+ startIndex: cellColumnPositioning.left,
286
+ endIndex: cellColumnPositioning.right,
287
+ includeTooltip: includeTooltip
288
+ })), element);
289
+ }
274
290
  return element;
275
291
  }, {
276
292
  key: "".concat(_types.TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
277
293
  destroy: function destroy(node) {
278
- _reactDom.default.unmountComponentAtNode(node);
294
+ if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
295
+ nodeViewPortalProviderAPI.remove(decorationRenderKey);
296
+ } else {
297
+ _reactDom.default.unmountComponentAtNode(node);
298
+ }
279
299
  }
280
300
  });
281
301
  };
@@ -88,9 +88,8 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
88
88
  var tableDuplicateCellColouring = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
89
89
  var isTableFixedColumnWidthsOptionEnabled = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
90
90
  var shouldUseIncreasedScalingPercent = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
91
- var tableSortColumnReorder = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
92
- var ariaNotifyPlugin = arguments.length > 16 ? arguments[16] : undefined;
93
- var isCommentEditor = arguments.length > 17 && arguments[17] !== undefined ? arguments[17] : false;
91
+ var ariaNotifyPlugin = arguments.length > 15 ? arguments[15] : undefined;
92
+ var isCommentEditor = arguments.length > 16 && arguments[16] !== undefined ? arguments[16] : false;
94
93
  var selection = editorView.state.selection;
95
94
  var _getTablePluginState = (0, _pluginFactory.getPluginState)(editorView.state),
96
95
  getIntl = _getTablePluginState.getIntl;
@@ -281,6 +280,6 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
281
280
  };
282
281
  })));
283
282
  var allConfigs = (0, _toConsumableArray2.default)(restConfigs);
284
- tableSortColumnReorder ? allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs)) : allConfigs.push.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
283
+ allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
285
284
  return allConfigs.filter(Boolean);
286
285
  };
@@ -15,7 +15,7 @@ import { createColumnLineResize, getSelectedColumnIndexes, updateDecorations } f
15
15
  const getTablePluginCommand = (actionPayload, originalTr) => {
16
16
  return createCommand(() => actionPayload, tr => (originalTr || tr).setMeta('addToHistory', false));
17
17
  };
18
- const updateResizeHandleAndStatePosition = (rowIndex, columnIndex, nextResizeHandlePos) => (state, dispatch) => {
18
+ const updateResizeHandleAndStatePosition = (rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI) => (state, dispatch) => {
19
19
  let customTr = state.tr;
20
20
  const {
21
21
  pluginConfig: {
@@ -29,7 +29,7 @@ const updateResizeHandleAndStatePosition = (rowIndex, columnIndex, nextResizeHan
29
29
  if (!allowColumnResizing) {
30
30
  return false;
31
31
  }
32
- const decorationsWithWidget = buildColumnResizingDecorations(rowIndex, columnIndex, true, getIntl)({
32
+ const decorationsWithWidget = buildColumnResizingDecorations(rowIndex, columnIndex, true, getIntl, nodeViewPortalProviderAPI)({
33
33
  tr: customTr,
34
34
  decorationSet: getDecorations(state)
35
35
  });
@@ -60,7 +60,8 @@ const updateResizeHandleAndStatePosition = (rowIndex, columnIndex, nextResizeHan
60
60
  };
61
61
  export const initiateKeyboardColumnResizing = ({
62
62
  ariaNotify,
63
- getIntl
63
+ getIntl,
64
+ nodeViewPortalProviderAPI
64
65
  }) => (state, dispatch, view) => {
65
66
  const {
66
67
  selection
@@ -73,14 +74,15 @@ export const initiateKeyboardColumnResizing = ({
73
74
  });
74
75
  }
75
76
  if (selectionRect && cell && view) {
76
- return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos)(state, dispatch);
77
+ return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos, nodeViewPortalProviderAPI)(state, dispatch);
77
78
  }
78
79
  return false;
79
80
  };
80
81
  export const activateNextResizeArea = ({
81
82
  direction,
82
83
  ariaNotify,
83
- getIntl
84
+ getIntl,
85
+ nodeViewPortalProviderAPI
84
86
  }) => (state, dispatch, view) => {
85
87
  const {
86
88
  resizeHandlePos
@@ -129,17 +131,17 @@ export const activateNextResizeArea = ({
129
131
  // we are somewhere in between the side columns of the table
130
132
  const offset = $nextCell.pos - $nextCell.start(-1);
131
133
  const rectForNextCell = tableMap.findCell(offset);
132
- return updateResizeHandleAndStatePosition(rectForNextCell.top, rectForNextCell.right, $nextCell.pos)(state, dispatch, view);
134
+ return updateResizeHandleAndStatePosition(rectForNextCell.top, rectForNextCell.right, $nextCell.pos, nodeViewPortalProviderAPI)(state, dispatch, view);
133
135
  } else {
134
136
  // current position is in the one of the side columns of the table(left or right)
135
137
  if (currentCellRect.left === 0) {
136
138
  const lastCellInCurrentRow = tableMap.positionAt(currentCellRect.top, tableMap.width - 1, tableNode) + closestTable.start;
137
139
  const $lastCell = state.doc.resolve(lastCellInCurrentRow);
138
- return updateResizeHandleAndStatePosition(currentCellRect.top, tableMap.width, $lastCell.pos)(state, dispatch, view);
140
+ return updateResizeHandleAndStatePosition(currentCellRect.top, tableMap.width, $lastCell.pos, nodeViewPortalProviderAPI)(state, dispatch, view);
139
141
  } else if (tableMap.width === currentCellRect.right) {
140
142
  const firsCellInCurrentRow = tableMap.positionAt(currentCellRect.top, 0, tableNode) + closestTable.start;
141
143
  const $nextCell = state.doc.resolve(firsCellInCurrentRow);
142
- return updateResizeHandleAndStatePosition(currentCellRect.top, 1, $nextCell.pos)(state, dispatch);
144
+ return updateResizeHandleAndStatePosition(currentCellRect.top, 1, $nextCell.pos, nodeViewPortalProviderAPI)(state, dispatch);
143
145
  }
144
146
  }
145
147
  return false;
@@ -437,7 +437,7 @@ export const showInsertRowButton = rowIndex => createCommand(_ => rowIndex > -1
437
437
  export const hideInsertColumnOrRowButton = () => createCommand({
438
438
  type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON'
439
439
  }, tr => tr.setMeta('addToHistory', false));
440
- export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip, isKeyboardResize) => createCommand(state => {
440
+ export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize) => createCommand(state => {
441
441
  const tableNode = findTable(state.selection);
442
442
  const {
443
443
  pluginConfig: {
@@ -451,7 +451,7 @@ export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip
451
451
  return {
452
452
  type: 'ADD_RESIZE_HANDLE_DECORATIONS',
453
453
  data: {
454
- decorationSet: buildColumnResizingDecorations(rowIndex, columnIndex, includeTooltip, getIntl)({
454
+ decorationSet: buildColumnResizingDecorations(rowIndex, columnIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI)({
455
455
  tr: state.tr,
456
456
  decorationSet: getDecorations(state)
457
457
  }),
@@ -462,7 +462,7 @@ export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip
462
462
  }
463
463
  };
464
464
  }, tr => tr.setMeta('addToHistory', false));
465
- export const updateResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip) => createCommand(state => {
465
+ export const updateResizeHandleDecorations = (nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip) => createCommand(state => {
466
466
  const tableNode = findTable(state.selection);
467
467
  const {
468
468
  resizeHandleRowIndex,
@@ -485,7 +485,7 @@ export const updateResizeHandleDecorations = (rowIndex, columnIndex, includeTool
485
485
  return {
486
486
  type: 'UPDATE_RESIZE_HANDLE_DECORATIONS',
487
487
  data: {
488
- decorationSet: buildColumnResizingDecorations(resolvedRowIndex, resolvedColumnIndex, resolvedIncludeTooltip, getIntl)({
488
+ decorationSet: buildColumnResizingDecorations(resolvedRowIndex, resolvedColumnIndex, resolvedIncludeTooltip, getIntl, nodeViewPortalProviderAPI)({
489
489
  tr: state.tr,
490
490
  decorationSet: getDecorations(state)
491
491
  }),
@@ -257,7 +257,7 @@ export const handleMouseLeave = (view, event) => {
257
257
 
258
258
  // IMPORTANT: The mouse move handler has been setup with RAF schedule to avoid Reflows which will occur as some methods
259
259
  // need to access the mouse event offset position and also the target clientWidth vallue.
260
- const handleMouseMoveDebounce = rafSchedule((view, event, offsetX) => {
260
+ const handleMouseMoveDebounce = nodeViewPortalProviderAPI => rafSchedule((view, event, offsetX) => {
261
261
  if (!(event.target instanceof HTMLElement)) {
262
262
  return false;
263
263
  }
@@ -313,14 +313,14 @@ const handleMouseMoveDebounce = rafSchedule((view, event, offsetX) => {
313
313
  columnEndIndexTarget
314
314
  })) && !isKeyboardResize // if initiated by keyboard don't need to react on hover for other resize sliders
315
315
  ) {
316
- return addResizeHandleDecorations(rowIndexTarget, columnEndIndexTarget, true)(state, dispatch);
316
+ return addResizeHandleDecorations(rowIndexTarget, columnEndIndexTarget, true, nodeViewPortalProviderAPI)(state, dispatch);
317
317
  }
318
318
  }
319
319
  }
320
320
  }
321
321
  return false;
322
322
  });
323
- export const handleMouseMove = (view, event) => {
323
+ export const handleMouseMove = nodeViewPortalProviderAPI => (view, event) => {
324
324
  if (!(event.target instanceof HTMLElement)) {
325
325
  return false;
326
326
  }
@@ -330,7 +330,7 @@ export const handleMouseMove = (view, event) => {
330
330
  // a reflow. So for now this will just grab the offsetX value immediately for gecko and chrome will calculate later
331
331
  // in the deferred callback handler.
332
332
  // Bug Tracking: https://bugzilla.mozilla.org/show_bug.cgi?id=1882903
333
- handleMouseMoveDebounce(view, event, browser.gecko ? event.offsetX : NaN);
333
+ handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, browser.gecko ? event.offsetX : NaN);
334
334
  return false;
335
335
  };
336
336
  export function handleTripleClick(view, pos) {
@@ -198,6 +198,7 @@ const tablesPlugin = ({
198
198
  dispatchAnalyticsEvent,
199
199
  dispatch,
200
200
  portalProviderAPI,
201
+ nodeViewPortalProviderAPI,
201
202
  eventDispatcher,
202
203
  getIntl
203
204
  }) => {
@@ -213,12 +214,13 @@ const tablesPlugin = ({
213
214
  isCommentEditor,
214
215
  isChromelessEditor
215
216
  } = options || {};
216
- return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
217
+ return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
217
218
  }
218
219
  }, {
219
220
  name: 'tablePMColResizing',
220
221
  plugin: ({
221
- dispatch
222
+ dispatch,
223
+ nodeViewPortalProviderAPI
222
224
  }) => {
223
225
  const {
224
226
  fullWidthEnabled,
@@ -233,7 +235,7 @@ const tablesPlugin = ({
233
235
  } = pluginConfig(tableOptions);
234
236
  return allowColumnResizing ? createFlexiResizingPlugin(dispatch, {
235
237
  lastColumnResizable: !fullWidthEnabled
236
- }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, isTableAlignmentEnabled, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
238
+ }, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, isTableAlignmentEnabled, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
237
239
  }
238
240
  }, {
239
241
  name: 'tableEditing',
@@ -244,7 +246,8 @@ const tablesPlugin = ({
244
246
  {
245
247
  name: 'tableKeymap',
246
248
  plugin: ({
247
- getIntl
249
+ getIntl,
250
+ nodeViewPortalProviderAPI
248
251
  }) => {
249
252
  const {
250
253
  dragAndDropEnabled,
@@ -255,7 +258,7 @@ const tablesPlugin = ({
255
258
  isChromelessEditor = false,
256
259
  tableResizingEnabled = false
257
260
  } = options || {};
258
- return keymapPlugin(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
261
+ return keymapPlugin(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
259
262
  }
260
263
  }, {
261
264
  name: 'tableSelectionKeymap',
@@ -301,8 +304,10 @@ const tablesPlugin = ({
301
304
  }
302
305
  }, {
303
306
  name: 'tableViewModeSort',
304
- plugin: () => {
305
- return api !== null && api !== void 0 && api.editorViewMode ? createViewModeSortPlugin(api) : undefined;
307
+ plugin: ({
308
+ nodeViewPortalProviderAPI
309
+ }) => {
310
+ return api !== null && api !== void 0 && api.editorViewMode ? createViewModeSortPlugin(api, nodeViewPortalProviderAPI) : undefined;
306
311
  }
307
312
  }, {
308
313
  name: 'tableLocalId',
@@ -10,13 +10,13 @@ const updateLastCellElement = lastCellElementsDecorations => ({
10
10
  decorationSet,
11
11
  tr
12
12
  }) => updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
13
- export const buildColumnResizingDecorations = (rowEndIndex, columnEndIndex, includeTooltip, getIntl) => ({
13
+ export const buildColumnResizingDecorations = (rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI) => ({
14
14
  tr,
15
15
  decorationSet
16
16
  }) => {
17
17
  const [columnResizesDecorations, lastCellElementsDecorations] = columnEndIndex < 0 ? emptyDecorations : createResizeHandleDecoration(tr, rowEndIndex, {
18
18
  right: columnEndIndex
19
- }, includeTooltip, getIntl);
19
+ }, includeTooltip, getIntl, nodeViewPortalProviderAPI);
20
20
  return composeDecorations([updateColumnResizeHandle(columnResizesDecorations), updateLastCellElement(lastCellElementsDecorations)])({
21
21
  decorationSet,
22
22
  tr
@@ -7,7 +7,7 @@ import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSele
7
7
  import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
8
8
  import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable } from '../commands/insert';
9
9
  import { moveSourceWithAnalyticsViaShortcut } from '../pm-plugins/drag-and-drop/commands-with-analytics';
10
- export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled = false, isTableAlignmentEnabled = false, isFullWidthEnabled, pluginInjectionApi, getIntl, isCellBackgroundDuplicated = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
10
+ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled = false, isTableAlignmentEnabled = false, isFullWidthEnabled, pluginInjectionApi, getIntl, isCellBackgroundDuplicated = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
11
11
  var _pluginInjectionApi$a;
12
12
  const list = {};
13
13
  const ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
@@ -46,17 +46,20 @@ export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, d
46
46
  }
47
47
  bindKeymapWithCommand(startColumnResizing.common, initiateKeyboardColumnResizing({
48
48
  ariaNotify: ariaNotifyPlugin,
49
- getIntl: getIntl
49
+ getIntl: getIntl,
50
+ nodeViewPortalProviderAPI
50
51
  }), list);
51
52
  bindKeymapWithCommand(moveRight.common, activateNextResizeArea({
52
53
  direction: 1,
53
54
  ariaNotify: ariaNotifyPlugin,
54
- getIntl: getIntl
55
+ getIntl: getIntl,
56
+ nodeViewPortalProviderAPI
55
57
  }), list);
56
58
  bindKeymapWithCommand(moveLeft.common, activateNextResizeArea({
57
59
  direction: -1,
58
60
  ariaNotify: ariaNotifyPlugin,
59
- getIntl: getIntl
61
+ getIntl: getIntl,
62
+ nodeViewPortalProviderAPI
60
63
  }), list);
61
64
  bindKeymapWithCommand(decreaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api)(-10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
62
65
  bindKeymapWithCommand(increaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api)(10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
@@ -19,7 +19,7 @@ import { isHeaderRowRequired, transformSliceTableLayoutDefaultToCenter } from '.
19
19
  import { defaultHoveredCell, defaultTableSelection } from './default-table-selection';
20
20
  import { createPluginState, getPluginState } from './plugin-factory';
21
21
  import { pluginKey } from './plugin-key';
22
- export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) => {
22
+ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) => {
23
23
  var _accessibilityUtils;
24
24
  const state = createPluginState(dispatch, {
25
25
  pluginConfig,
@@ -283,7 +283,7 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
283
283
  blur: handleBlur,
284
284
  mousedown: withCellTracking(handleMouseDown),
285
285
  mouseleave: handleMouseLeave,
286
- mousemove: whenTableInFocus(handleMouseMove),
286
+ mousemove: whenTableInFocus(handleMouseMove(nodeViewPortalProviderAPI)),
287
287
  mouseenter: handleMouseEnter,
288
288
  mouseup: whenTableInFocus(handleMouseUp),
289
289
  click: withCellTracking(whenTableInFocus(handleClick))