@atlaskit/editor-plugin-table 5.8.5 → 6.0.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/commands/column-resize.js +1 -1
  3. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +28 -12
  4. package/dist/cjs/ui/FloatingContextualMenu/styles.js +4 -3
  5. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +6 -6
  6. package/dist/cjs/ui/FloatingDragMenu/styles.js +5 -4
  7. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +4 -2
  8. package/dist/cjs/ui/TableFloatingColumnControls/index.js +7 -6
  9. package/dist/es2019/commands/column-resize.js +1 -1
  10. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +29 -13
  11. package/dist/es2019/ui/FloatingContextualMenu/styles.js +4 -0
  12. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +7 -7
  13. package/dist/es2019/ui/FloatingDragMenu/styles.js +4 -0
  14. package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +4 -2
  15. package/dist/es2019/ui/TableFloatingColumnControls/index.js +6 -5
  16. package/dist/esm/commands/column-resize.js +1 -1
  17. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +29 -13
  18. package/dist/esm/ui/FloatingContextualMenu/styles.js +3 -2
  19. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +7 -7
  20. package/dist/esm/ui/FloatingDragMenu/styles.js +4 -3
  21. package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +4 -2
  22. package/dist/esm/ui/TableFloatingColumnControls/index.js +7 -6
  23. package/dist/types/commands/column-resize.d.ts +1 -1
  24. package/dist/types/ui/FloatingContextualMenu/styles.d.ts +1 -0
  25. package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -0
  26. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
  27. package/dist/types-ts4.5/commands/column-resize.d.ts +1 -1
  28. package/dist/types-ts4.5/ui/FloatingContextualMenu/styles.d.ts +1 -0
  29. package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -0
  30. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
  31. package/package.json +2 -2
  32. package/src/commands/column-resize.ts +2 -5
  33. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +40 -24
  34. package/src/ui/FloatingContextualMenu/styles.ts +5 -0
  35. package/src/ui/FloatingDragMenu/DragMenu.tsx +9 -10
  36. package/src/ui/FloatingDragMenu/styles.ts +5 -0
  37. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +4 -0
  38. package/src/ui/TableFloatingColumnControls/index.tsx +5 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#67764](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67764) [`392964912fad`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/392964912fad) - Fixed incorrectly imported dependencies from src in the editor-plugin-table
8
+
9
+ ### Patch Changes
10
+
11
+ - [#67255](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67255) [`f73d19be272d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f73d19be272d) - Set pointer events to none on column controls while dragging. Fixes issue where column controls prevent drop targets from showing.
12
+
13
+ ## 5.8.6
14
+
15
+ ### Patch Changes
16
+
17
+ - [#67239](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67239) [`4b543688dfcb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4b543688dfcb) - [ux] ED-21242: Fixed some menu item not full visible on drag menu"
18
+ - Updated dependencies
19
+
3
20
  ## 5.8.5
4
21
 
5
22
  ### Patch Changes
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.initiateKeyboardColumnResizing = exports.changeColumnWidthByStep = exports.activateNextResizeArea = void 0;
7
7
  var _styles = require("@atlaskit/editor-common/styles");
8
8
  var _editorTables = require("@atlaskit/editor-tables");
9
- var _utils = require("@atlaskit/editor-tables/src/utils");
9
+ var _utils = require("@atlaskit/editor-tables/utils");
10
10
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
11
  var _pluginFactory = require("../pm-plugins/table-resizing/plugin-factory");
12
12
  var _utils2 = require("../pm-plugins/table-resizing/utils");
@@ -89,10 +89,12 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
89
89
  value: {
90
90
  name: 'background'
91
91
  },
92
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_backgroundColor.default, {
92
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
93
+ css: _styles2.elementBeforeIconStyles
94
+ }, (0, _react2.jsx)(_backgroundColor.default, {
93
95
  label: formatMessage(_messages.tableMessages.backgroundColor),
94
96
  size: "medium"
95
- }) : undefined,
97
+ })) : undefined,
96
98
  elemAfter: (0, _react2.jsx)("div", {
97
99
  className: _styles.DropdownMenuSharedCssClassName.SUBMENU
98
100
  }, (0, _react2.jsx)("div", {
@@ -129,14 +131,18 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
129
131
  name: 'merge'
130
132
  },
131
133
  isDisabled: !(0, _transforms.canMergeCells)(state.tr),
132
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.MergeCellsIcon, null) : undefined
134
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
135
+ css: _styles2.elementBeforeIconStyles
136
+ }, (0, _react2.jsx)(_icons.MergeCellsIcon, null)) : undefined
133
137
  }, {
134
138
  content: formatMessage(_messages.tableMessages.splitCell),
135
139
  value: {
136
140
  name: 'split'
137
141
  },
138
142
  isDisabled: !(0, _utils2.splitCell)(state),
139
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.SplitCellIcon, null) : undefined
143
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
144
+ css: _styles2.elementBeforeIconStyles
145
+ }, (0, _react2.jsx)(_icons.SplitCellIcon, null)) : undefined
140
146
  }];
141
147
  }
142
148
  return [];
@@ -155,7 +161,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
155
161
  elemAfter: (0, _react2.jsx)("div", {
156
162
  css: _shortcut.shortcutStyle
157
163
  }, (0, _keymaps.tooltip)(_keymaps.addColumnAfter)),
158
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.AddColRightIcon, null) : undefined
164
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
165
+ css: _styles2.elementBeforeIconStyles
166
+ }, (0, _react2.jsx)(_icons.AddColRightIcon, null)) : undefined
159
167
  };
160
168
  });
161
169
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createInsertRowItem", function () {
@@ -172,7 +180,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
172
180
  elemAfter: (0, _react2.jsx)("div", {
173
181
  css: _shortcut.shortcutStyle
174
182
  }, (0, _keymaps.tooltip)(_keymaps.addRowAfter)),
175
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.AddRowBelowIcon, null) : undefined
183
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
184
+ css: _styles2.elementBeforeIconStyles
185
+ }, (0, _react2.jsx)(_icons.AddRowBelowIcon, null)) : undefined
176
186
  };
177
187
  });
178
188
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createClearCellsItem", function () {
@@ -198,11 +208,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
198
208
  elemAfter: (0, _react2.jsx)("div", {
199
209
  css: _shortcut.shortcutStyle
200
210
  }, (0, _keymaps.tooltip)(_keymaps.backspace)),
201
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_crossCircle.default, {
211
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
212
+ css: _styles2.elementBeforeIconStyles
213
+ }, (0, _react2.jsx)(_crossCircle.default, {
202
214
  label: formatMessage(_messages.tableMessages.clearCells, {
203
215
  0: Math.max(noOfColumns, noOfRows)
204
216
  })
205
- }) : undefined
217
+ })) : undefined
206
218
  };
207
219
  });
208
220
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDeleteColumnItem", function () {
@@ -222,11 +234,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
222
234
  value: {
223
235
  name: 'delete_column'
224
236
  },
225
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_remove.default, {
237
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
238
+ css: _styles2.elementBeforeIconStyles
239
+ }, (0, _react2.jsx)(_remove.default, {
226
240
  label: formatMessage(_messages.tableMessages.removeColumns, {
227
241
  0: noOfColumns
228
242
  })
229
- }) : undefined
243
+ })) : undefined
230
244
  };
231
245
  });
232
246
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDeleteRowItem", function () {
@@ -246,11 +260,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
246
260
  value: {
247
261
  name: 'delete_row'
248
262
  },
249
- elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_remove.default, {
263
+ elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)("span", {
264
+ css: _styles2.elementBeforeIconStyles
265
+ }, (0, _react2.jsx)(_remove.default, {
250
266
  label: formatMessage(_messages.tableMessages.removeRows, {
251
267
  0: noOfRows
252
268
  })
253
- }) : undefined
269
+ })) : undefined
254
270
  };
255
271
  });
256
272
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDistributeColumnsItem", function () {
@@ -4,18 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.tablePopupStyles = exports.cellColourPreviewStyles = void 0;
7
+ exports.tablePopupStyles = exports.elementBeforeIconStyles = exports.cellColourPreviewStyles = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _colors = require("@atlaskit/theme/colors");
12
12
  var _types = require("../../types");
13
13
  var _consts = require("../consts");
14
- var _templateObject, _templateObject2;
14
+ var _templateObject, _templateObject2, _templateObject3;
15
15
  var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
16
16
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &::before {\n background: ", ";\n }\n"])), selectedColor);
17
17
  };
18
+ var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: ", ";\n display: flex;\n"])), "var(--ds-space-negative-075, -6px)");
18
19
 
19
20
  // TODO Delete this comment after verifying space token -> previous value `padding: 8px`
20
21
  // TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
21
- var tablePopupStyles = exports.tablePopupStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 20px;\n color: ", ";\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), _types.TableCssClassName.CONTEXTUAL_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.contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.CONTEXTUAL_MENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"), _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
22
+ var tablePopupStyles = exports.tablePopupStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 20px;\n color: ", ";\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), _types.TableCssClassName.CONTEXTUAL_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.contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.CONTEXTUAL_MENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"), _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
@@ -143,10 +143,8 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, for
143
143
  name: item.id
144
144
  },
145
145
  isDisabled: item.disabled,
146
- elemBefore: item.icon ? (0, _react2.jsx)("div", {
147
- style: {
148
- display: 'flex'
149
- }
146
+ elemBefore: item.icon ? (0, _react2.jsx)("span", {
147
+ css: _styles2.elementBeforeIconStyles
150
148
  }, (0, _react2.jsx)(item.icon, {
151
149
  label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options)
152
150
  })) : undefined,
@@ -232,10 +230,12 @@ var DragMenu = exports.DragMenu = function DragMenu(_ref) {
232
230
  value: {
233
231
  name: 'background'
234
232
  },
235
- elemBefore: (0, _react2.jsx)(_backgroundColor.default, {
233
+ elemBefore: (0, _react2.jsx)("span", {
234
+ css: _styles2.elementBeforeIconStyles
235
+ }, (0, _react2.jsx)(_backgroundColor.default, {
236
236
  label: formatMessage(_messages.tableMessages.backgroundColor),
237
237
  size: "medium"
238
- }),
238
+ })),
239
239
  elemAfter: (0, _react2.jsx)("div", {
240
240
  className: _styles.DropdownMenuSharedCssClassName.SUBMENU,
241
241
  css: _styles2.dragMenuBackgroundColorStyles
@@ -4,16 +4,17 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.toggleStyles = exports.dragMenuBackgroundColorStyles = exports.cellColourPreviewStyles = void 0;
7
+ exports.toggleStyles = exports.elementBeforeIconStyles = exports.dragMenuBackgroundColorStyles = exports.cellColourPreviewStyles = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _colors = require("@atlaskit/theme/colors");
12
12
  var _types = require("../../types");
13
13
  var _consts = require("../consts");
14
- var _templateObject, _templateObject2, _templateObject3;
14
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
15
15
  var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
16
16
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &::before {\n background: ", ";\n }\n"])), selectedColor);
17
17
  };
18
- var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\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.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, ")"));
19
- var toggleStyles = exports.toggleStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n input[type='checkbox'] {\n width: 30px;\n height: 14px;\n pointer-events: initial;\n cursor: pointer;\n }\n > label {\n margin: 0px;\n pointer-events: none;\n > span {\n pointer-events: none;\n }\n }\n"])));
18
+ var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: ", ";\n display: flex;\n"])), "var(--ds-space-negative-075, -6px)");
19
+ var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\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.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, ")"));
20
+ var toggleStyles = exports.toggleStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n input[type='checkbox'] {\n width: 30px;\n height: 14px;\n pointer-events: initial;\n cursor: pointer;\n }\n > label {\n margin: 0px;\n pointer-events: none;\n > span {\n pointer-events: none;\n }\n }\n"])));
@@ -46,7 +46,8 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
46
46
  isTableHovered = _ref.isTableHovered,
47
47
  canDrag = _ref.canDrag,
48
48
  tableContainerWidth = _ref.tableContainerWidth,
49
- isNumberColumnEnabled = _ref.isNumberColumnEnabled;
49
+ isNumberColumnEnabled = _ref.isNumberColumnEnabled,
50
+ isDragging = _ref.isDragging;
50
51
  var columnControlsRef = (0, _react.useRef)(null);
51
52
  var widths = (_colWidths$map$join = colWidths === null || colWidths === void 0 ? void 0 : colWidths.map(function (width) {
52
53
  return (
@@ -205,7 +206,8 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
205
206
  gridTemplateColumns: widths,
206
207
  marginTop: marginTop,
207
208
  width: stickyTop ? containerWidth : undefined,
208
- overflowX: stickyTop ? 'hidden' : 'visible'
209
+ overflowX: stickyTop ? 'hidden' : 'visible',
210
+ pointerEvents: isDragging ? 'none' : undefined
209
211
  }
210
212
  }, !isResizing && columnParams.map(function (_ref2, index) {
211
213
  var startIndex = _ref2.startIndex,
@@ -42,8 +42,8 @@ var TableFloatingColumnControls = exports.TableFloatingColumnControls = function
42
42
  setTableRect = _useState2[1];
43
43
  var _useState3 = (0, _react.useState)(false),
44
44
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
45
- hasDropTargets = _useState4[0],
46
- setHasDropTargets = _useState4[1];
45
+ isDragging = _useState4[0],
46
+ setIsDragging = _useState4[1];
47
47
  var containerRef = (0, _react.useRef)(null);
48
48
  var node = getNode();
49
49
  var currentNodeLocalId = node === null || node === void 0 ? void 0 : node.attrs.localId;
@@ -91,10 +91,10 @@ var TableFloatingColumnControls = exports.TableFloatingColumnControls = function
91
91
  return type === 'table-column' && !!(indexes !== null && indexes !== void 0 && indexes.length) && localId === currentNodeLocalId;
92
92
  },
93
93
  onDragStart: function onDragStart() {
94
- setHasDropTargets(true);
94
+ setIsDragging(true);
95
95
  },
96
96
  onDrop: function onDrop() {
97
- setHasDropTargets(false);
97
+ setIsDragging(false);
98
98
  }
99
99
  });
100
100
  }, [editorView, currentNodeLocalId]);
@@ -137,8 +137,9 @@ var TableFloatingColumnControls = exports.TableFloatingColumnControls = function
137
137
  hasHeaderColumn: hasHeaderColumn,
138
138
  canDrag: canDrag,
139
139
  tableContainerWidth: tableContainerWidth,
140
- isNumberColumnEnabled: isNumberColumnEnabled
141
- }), hasDropTargets && /*#__PURE__*/_react.default.createElement(_ColumnDropTargets.ColumnDropTargets, {
140
+ isNumberColumnEnabled: isNumberColumnEnabled,
141
+ isDragging: isDragging
142
+ }), isDragging && /*#__PURE__*/_react.default.createElement(_ColumnDropTargets.ColumnDropTargets, {
142
143
  tableRef: tableRef,
143
144
  stickyTop: tableActive ? stickyTop : undefined,
144
145
  tableHeight: tableRect.height,
@@ -1,6 +1,6 @@
1
1
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
2
2
  import { TableMap } from '@atlaskit/editor-tables';
3
- import { findCellClosestToPos, findCellRectClosestToPos, findTableClosestToPos, getSelectionRect, isSelectionType, nextCell } from '@atlaskit/editor-tables/src/utils';
3
+ import { findCellClosestToPos, findCellRectClosestToPos, findTableClosestToPos, getSelectionRect, isSelectionType, nextCell } from '@atlaskit/editor-tables/utils';
4
4
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
5
  import { getPluginState as getTableResizingPluginState, createCommand as tableResizingPluginCreateCommand } from '../pm-plugins/table-resizing/plugin-factory';
6
6
  import { currentColWidth, getResizeState, getTableMaxWidth, resizeColumn, updateControls } from '../pm-plugins/table-resizing/utils';
@@ -28,7 +28,7 @@ import { TableCssClassName as ClassName } from '../../types';
28
28
  import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
29
29
  import { contextualMenuDropdownWidth } from '../consts';
30
30
  import { AddColRightIcon, AddRowBelowIcon, MergeCellsIcon, SplitCellIcon } from '../icons';
31
- import { cellColourPreviewStyles } from './styles';
31
+ import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
32
32
  export class ContextualMenu extends Component {
33
33
  constructor(...args) {
34
34
  super(...args);
@@ -74,10 +74,12 @@ export class ContextualMenu extends Component {
74
74
  value: {
75
75
  name: 'background'
76
76
  },
77
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(EditorBackgroundColorIcon, {
77
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
78
+ css: elementBeforeIconStyles
79
+ }, jsx(EditorBackgroundColorIcon, {
78
80
  label: formatMessage(messages.backgroundColor),
79
81
  size: "medium"
80
- }) : undefined,
82
+ })) : undefined,
81
83
  elemAfter: jsx("div", {
82
84
  className: DropdownMenuSharedCssClassName.SUBMENU
83
85
  }, jsx("div", {
@@ -120,14 +122,18 @@ export class ContextualMenu extends Component {
120
122
  name: 'merge'
121
123
  },
122
124
  isDisabled: !canMergeCells(state.tr),
123
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(MergeCellsIcon, null) : undefined
125
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
126
+ css: elementBeforeIconStyles
127
+ }, jsx(MergeCellsIcon, null)) : undefined
124
128
  }, {
125
129
  content: formatMessage(messages.splitCell),
126
130
  value: {
127
131
  name: 'split'
128
132
  },
129
133
  isDisabled: !splitCell(state),
130
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(SplitCellIcon, null) : undefined
134
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
135
+ css: elementBeforeIconStyles
136
+ }, jsx(SplitCellIcon, null)) : undefined
131
137
  }];
132
138
  }
133
139
  return [];
@@ -150,7 +156,9 @@ export class ContextualMenu extends Component {
150
156
  elemAfter: jsx("div", {
151
157
  css: shortcutStyle
152
158
  }, tooltip(addColumnAfter)),
153
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(AddColRightIcon, null) : undefined
159
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
160
+ css: elementBeforeIconStyles
161
+ }, jsx(AddColRightIcon, null)) : undefined
154
162
  };
155
163
  });
156
164
  _defineProperty(this, "createInsertRowItem", () => {
@@ -171,7 +179,9 @@ export class ContextualMenu extends Component {
171
179
  elemAfter: jsx("div", {
172
180
  css: shortcutStyle
173
181
  }, tooltip(addRowAfter)),
174
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(AddRowBelowIcon, null) : undefined
182
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
183
+ css: elementBeforeIconStyles
184
+ }, jsx(AddRowBelowIcon, null)) : undefined
175
185
  };
176
186
  });
177
187
  _defineProperty(this, "createClearCellsItem", () => {
@@ -203,11 +213,13 @@ export class ContextualMenu extends Component {
203
213
  elemAfter: jsx("div", {
204
214
  css: shortcutStyle
205
215
  }, tooltip(backspace)),
206
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(CrossCircleIcon, {
216
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
217
+ css: elementBeforeIconStyles
218
+ }, jsx(CrossCircleIcon, {
207
219
  label: formatMessage(messages.clearCells, {
208
220
  0: Math.max(noOfColumns, noOfRows)
209
221
  })
210
- }) : undefined
222
+ })) : undefined
211
223
  };
212
224
  });
213
225
  _defineProperty(this, "createDeleteColumnItem", () => {
@@ -233,11 +245,13 @@ export class ContextualMenu extends Component {
233
245
  value: {
234
246
  name: 'delete_column'
235
247
  },
236
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(RemoveIcon, {
248
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
249
+ css: elementBeforeIconStyles
250
+ }, jsx(RemoveIcon, {
237
251
  label: formatMessage(messages.removeColumns, {
238
252
  0: noOfColumns
239
253
  })
240
- }) : undefined
254
+ })) : undefined
241
255
  };
242
256
  });
243
257
  _defineProperty(this, "createDeleteRowItem", () => {
@@ -263,11 +277,13 @@ export class ContextualMenu extends Component {
263
277
  value: {
264
278
  name: 'delete_row'
265
279
  },
266
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(RemoveIcon, {
280
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
281
+ css: elementBeforeIconStyles
282
+ }, jsx(RemoveIcon, {
267
283
  label: formatMessage(messages.removeRows, {
268
284
  0: noOfRows
269
285
  })
270
- }) : undefined
286
+ })) : undefined
271
287
  };
272
288
  });
273
289
  _defineProperty(this, "createDistributeColumnsItem", () => {
@@ -8,6 +8,10 @@ export const cellColourPreviewStyles = selectedColor => css`
8
8
  background: ${selectedColor};
9
9
  }
10
10
  `;
11
+ export const elementBeforeIconStyles = css`
12
+ margin-right: ${"var(--ds-space-negative-075, -6px)"};
13
+ display: flex;
14
+ `;
11
15
 
12
16
  // TODO Delete this comment after verifying space token -> previous value `padding: 8px`
13
17
  // TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
@@ -25,7 +25,7 @@ import { TableCssClassName as ClassName } from '../../types';
25
25
  import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes, hasMergedCellsInColumn, hasMergedCellsInRow } from '../../utils';
26
26
  import { getDragMenuConfig } from '../../utils/drag-menu';
27
27
  import { dragMenuDropdownWidth } from '../consts';
28
- import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, toggleStyles } from './styles';
28
+ import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, elementBeforeIconStyles, toggleStyles } from './styles';
29
29
  const MapDragMenuOptionIdToMessage = {
30
30
  add_row_above: {
31
31
  message: messages.addRowAbove,
@@ -131,10 +131,8 @@ const convertToDropdownItems = (dragMenuConfig, formatMessage, selectionRect) =>
131
131
  name: item.id
132
132
  },
133
133
  isDisabled: item.disabled,
134
- elemBefore: item.icon ? jsx("div", {
135
- style: {
136
- display: 'flex'
137
- }
134
+ elemBefore: item.icon ? jsx("span", {
135
+ css: elementBeforeIconStyles
138
136
  }, jsx(item.icon, {
139
137
  label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options)
140
138
  })) : undefined,
@@ -228,10 +226,12 @@ export const DragMenu = ({
228
226
  value: {
229
227
  name: 'background'
230
228
  },
231
- elemBefore: jsx(EditorBackgroundColorIcon, {
229
+ elemBefore: jsx("span", {
230
+ css: elementBeforeIconStyles
231
+ }, jsx(EditorBackgroundColorIcon, {
232
232
  label: formatMessage(messages.backgroundColor),
233
233
  size: "medium"
234
- }),
234
+ })),
235
235
  elemAfter: jsx("div", {
236
236
  className: DropdownMenuSharedCssClassName.SUBMENU,
237
237
  css: dragMenuBackgroundColorStyles
@@ -8,6 +8,10 @@ export const cellColourPreviewStyles = selectedColor => css`
8
8
  background: ${selectedColor};
9
9
  }
10
10
  `;
11
+ export const elementBeforeIconStyles = css`
12
+ margin-right: ${"var(--ds-space-negative-075, -6px)"};
13
+ display: flex;
14
+ `;
11
15
  export const dragMenuBackgroundColorStyles = css`
12
16
  .${ClassName.DRAG_SUBMENU} {
13
17
  border-radius: ${"var(--ds-border-radius, 3px)"};
@@ -36,7 +36,8 @@ export const ColumnControls = ({
36
36
  isTableHovered,
37
37
  canDrag,
38
38
  tableContainerWidth,
39
- isNumberColumnEnabled
39
+ isNumberColumnEnabled,
40
+ isDragging
40
41
  }) => {
41
42
  var _colWidths$map$join, _rowHeights$;
42
43
  const columnControlsRef = useRef(null);
@@ -202,7 +203,8 @@ export const ColumnControls = ({
202
203
  gridTemplateColumns: widths,
203
204
  marginTop,
204
205
  width: stickyTop ? containerWidth : undefined,
205
- overflowX: stickyTop ? 'hidden' : 'visible'
206
+ overflowX: stickyTop ? 'hidden' : 'visible',
207
+ pointerEvents: isDragging ? 'none' : undefined
206
208
  }
207
209
  }, !isResizing && columnParams.map(({
208
210
  startIndex,
@@ -24,7 +24,7 @@ export const TableFloatingColumnControls = ({
24
24
  width: 0,
25
25
  height: 0
26
26
  });
27
- const [hasDropTargets, setHasDropTargets] = useState(false);
27
+ const [isDragging, setIsDragging] = useState(false);
28
28
  const containerRef = useRef(null);
29
29
  const node = getNode();
30
30
  const currentNodeLocalId = node === null || node === void 0 ? void 0 : node.attrs.localId;
@@ -62,10 +62,10 @@ export const TableFloatingColumnControls = ({
62
62
  return type === 'table-column' && !!(indexes !== null && indexes !== void 0 && indexes.length) && localId === currentNodeLocalId;
63
63
  },
64
64
  onDragStart() {
65
- setHasDropTargets(true);
65
+ setIsDragging(true);
66
66
  },
67
67
  onDrop() {
68
- setHasDropTargets(false);
68
+ setIsDragging(false);
69
69
  }
70
70
  });
71
71
  }, [editorView, currentNodeLocalId]);
@@ -108,8 +108,9 @@ export const TableFloatingColumnControls = ({
108
108
  hasHeaderColumn: hasHeaderColumn,
109
109
  canDrag: canDrag,
110
110
  tableContainerWidth: tableContainerWidth,
111
- isNumberColumnEnabled: isNumberColumnEnabled
112
- }), hasDropTargets && /*#__PURE__*/React.createElement(ColumnDropTargets, {
111
+ isNumberColumnEnabled: isNumberColumnEnabled,
112
+ isDragging: isDragging
113
+ }), isDragging && /*#__PURE__*/React.createElement(ColumnDropTargets, {
113
114
  tableRef: tableRef,
114
115
  stickyTop: tableActive ? stickyTop : undefined,
115
116
  tableHeight: tableRect.height,
@@ -1,6 +1,6 @@
1
1
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
2
2
  import { TableMap } from '@atlaskit/editor-tables';
3
- import { findCellClosestToPos, findCellRectClosestToPos, findTableClosestToPos, getSelectionRect, isSelectionType, nextCell } from '@atlaskit/editor-tables/src/utils';
3
+ import { findCellClosestToPos, findCellRectClosestToPos, findTableClosestToPos, getSelectionRect, isSelectionType, nextCell } from '@atlaskit/editor-tables/utils';
4
4
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
5
  import { getPluginState as getTableResizingPluginState, createCommand as tableResizingPluginCreateCommand } from '../pm-plugins/table-resizing/plugin-factory';
6
6
  import { currentColWidth, getResizeState, getTableMaxWidth, resizeColumn, updateControls } from '../pm-plugins/table-resizing/utils';
@@ -39,7 +39,7 @@ import { TableCssClassName as ClassName } from '../../types';
39
39
  import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
40
40
  import { contextualMenuDropdownWidth } from '../consts';
41
41
  import { AddColRightIcon, AddRowBelowIcon, MergeCellsIcon, SplitCellIcon } from '../icons';
42
- import { cellColourPreviewStyles } from './styles';
42
+ import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
43
43
  export var ContextualMenu = /*#__PURE__*/function (_Component) {
44
44
  _inherits(ContextualMenu, _Component);
45
45
  var _super = _createSuper(ContextualMenu);
@@ -84,10 +84,12 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
84
84
  value: {
85
85
  name: 'background'
86
86
  },
87
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(EditorBackgroundColorIcon, {
87
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
88
+ css: elementBeforeIconStyles
89
+ }, jsx(EditorBackgroundColorIcon, {
88
90
  label: formatMessage(messages.backgroundColor),
89
91
  size: "medium"
90
- }) : undefined,
92
+ })) : undefined,
91
93
  elemAfter: jsx("div", {
92
94
  className: DropdownMenuSharedCssClassName.SUBMENU
93
95
  }, jsx("div", {
@@ -124,14 +126,18 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
124
126
  name: 'merge'
125
127
  },
126
128
  isDisabled: !canMergeCells(state.tr),
127
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(MergeCellsIcon, null) : undefined
129
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
130
+ css: elementBeforeIconStyles
131
+ }, jsx(MergeCellsIcon, null)) : undefined
128
132
  }, {
129
133
  content: formatMessage(messages.splitCell),
130
134
  value: {
131
135
  name: 'split'
132
136
  },
133
137
  isDisabled: !splitCell(state),
134
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(SplitCellIcon, null) : undefined
138
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
139
+ css: elementBeforeIconStyles
140
+ }, jsx(SplitCellIcon, null)) : undefined
135
141
  }];
136
142
  }
137
143
  return [];
@@ -150,7 +156,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
150
156
  elemAfter: jsx("div", {
151
157
  css: shortcutStyle
152
158
  }, tooltip(addColumnAfter)),
153
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(AddColRightIcon, null) : undefined
159
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
160
+ css: elementBeforeIconStyles
161
+ }, jsx(AddColRightIcon, null)) : undefined
154
162
  };
155
163
  });
156
164
  _defineProperty(_assertThisInitialized(_this), "createInsertRowItem", function () {
@@ -167,7 +175,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
167
175
  elemAfter: jsx("div", {
168
176
  css: shortcutStyle
169
177
  }, tooltip(addRowAfter)),
170
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(AddRowBelowIcon, null) : undefined
178
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
179
+ css: elementBeforeIconStyles
180
+ }, jsx(AddRowBelowIcon, null)) : undefined
171
181
  };
172
182
  });
173
183
  _defineProperty(_assertThisInitialized(_this), "createClearCellsItem", function () {
@@ -193,11 +203,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
193
203
  elemAfter: jsx("div", {
194
204
  css: shortcutStyle
195
205
  }, tooltip(backspace)),
196
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(CrossCircleIcon, {
206
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
207
+ css: elementBeforeIconStyles
208
+ }, jsx(CrossCircleIcon, {
197
209
  label: formatMessage(messages.clearCells, {
198
210
  0: Math.max(noOfColumns, noOfRows)
199
211
  })
200
- }) : undefined
212
+ })) : undefined
201
213
  };
202
214
  });
203
215
  _defineProperty(_assertThisInitialized(_this), "createDeleteColumnItem", function () {
@@ -217,11 +229,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
217
229
  value: {
218
230
  name: 'delete_column'
219
231
  },
220
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(RemoveIcon, {
232
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
233
+ css: elementBeforeIconStyles
234
+ }, jsx(RemoveIcon, {
221
235
  label: formatMessage(messages.removeColumns, {
222
236
  0: noOfColumns
223
237
  })
224
- }) : undefined
238
+ })) : undefined
225
239
  };
226
240
  });
227
241
  _defineProperty(_assertThisInitialized(_this), "createDeleteRowItem", function () {
@@ -241,11 +255,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
241
255
  value: {
242
256
  name: 'delete_row'
243
257
  },
244
- elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx(RemoveIcon, {
258
+ elemBefore: isDragAndDropEnabled && getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? jsx("span", {
259
+ css: elementBeforeIconStyles
260
+ }, jsx(RemoveIcon, {
245
261
  label: formatMessage(messages.removeRows, {
246
262
  0: noOfRows
247
263
  })
248
- }) : undefined
264
+ })) : undefined
249
265
  };
250
266
  });
251
267
  _defineProperty(_assertThisInitialized(_this), "createDistributeColumnsItem", function () {
@@ -1,5 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
2
+ var _templateObject, _templateObject2, _templateObject3;
3
3
  import { css } from '@emotion/react';
4
4
  import { tableBackgroundBorderColor } from '@atlaskit/adf-schema';
5
5
  import { N60A, N90 } from '@atlaskit/theme/colors';
@@ -8,7 +8,8 @@ import { contextualMenuDropdownWidth } from '../consts';
8
8
  export var cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
9
9
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &::before {\n background: ", ";\n }\n"])), selectedColor);
10
10
  };
11
+ export var elementBeforeIconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: ", ";\n display: flex;\n"])), "var(--ds-space-negative-075, -6px)");
11
12
 
12
13
  // TODO Delete this comment after verifying space token -> previous value `padding: 8px`
13
14
  // TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
14
- export var tablePopupStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 20px;\n color: ", ";\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), ClassName.CONTEXTUAL_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.CONTEXTUAL_MENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"), ClassName.CONTEXTUAL_MENU_ICON_SMALL, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
15
+ export var tablePopupStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 20px;\n color: ", ";\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), ClassName.CONTEXTUAL_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.CONTEXTUAL_MENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"), ClassName.CONTEXTUAL_MENU_ICON_SMALL, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
@@ -27,7 +27,7 @@ import { TableCssClassName as ClassName } from '../../types';
27
27
  import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes, hasMergedCellsInColumn, hasMergedCellsInRow } from '../../utils';
28
28
  import { getDragMenuConfig } from '../../utils/drag-menu';
29
29
  import { dragMenuDropdownWidth } from '../consts';
30
- import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, toggleStyles } from './styles';
30
+ import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, elementBeforeIconStyles, toggleStyles } from './styles';
31
31
  var MapDragMenuOptionIdToMessage = {
32
32
  add_row_above: {
33
33
  message: messages.addRowAbove,
@@ -135,10 +135,8 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, for
135
135
  name: item.id
136
136
  },
137
137
  isDisabled: item.disabled,
138
- elemBefore: item.icon ? jsx("div", {
139
- style: {
140
- display: 'flex'
141
- }
138
+ elemBefore: item.icon ? jsx("span", {
139
+ css: elementBeforeIconStyles
142
140
  }, jsx(item.icon, {
143
141
  label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options)
144
142
  })) : undefined,
@@ -224,10 +222,12 @@ export var DragMenu = function DragMenu(_ref) {
224
222
  value: {
225
223
  name: 'background'
226
224
  },
227
- elemBefore: jsx(EditorBackgroundColorIcon, {
225
+ elemBefore: jsx("span", {
226
+ css: elementBeforeIconStyles
227
+ }, jsx(EditorBackgroundColorIcon, {
228
228
  label: formatMessage(messages.backgroundColor),
229
229
  size: "medium"
230
- }),
230
+ })),
231
231
  elemAfter: jsx("div", {
232
232
  className: DropdownMenuSharedCssClassName.SUBMENU,
233
233
  css: dragMenuBackgroundColorStyles
@@ -1,5 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
3
  import { css } from '@emotion/react';
4
4
  import { tableBackgroundBorderColor } from '@atlaskit/adf-schema';
5
5
  import { N60A, N90 } from '@atlaskit/theme/colors';
@@ -8,5 +8,6 @@ import { dragMenuDropdownWidth } from '../consts';
8
8
  export var cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
9
9
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &::before {\n background: ", ";\n }\n"])), selectedColor);
10
10
  };
11
- export var dragMenuBackgroundColorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), ClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), dragMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.DRAG_SUBMENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
12
- export var toggleStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n input[type='checkbox'] {\n width: 30px;\n height: 14px;\n pointer-events: initial;\n cursor: pointer;\n }\n > label {\n margin: 0px;\n pointer-events: none;\n > span {\n pointer-events: none;\n }\n }\n"])));
11
+ export var elementBeforeIconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: ", ";\n display: flex;\n"])), "var(--ds-space-negative-075, -6px)");
12
+ export var dragMenuBackgroundColorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), ClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), dragMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.DRAG_SUBMENU_ICON, tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
13
+ export var toggleStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n input[type='checkbox'] {\n width: 30px;\n height: 14px;\n pointer-events: initial;\n cursor: pointer;\n }\n > label {\n margin: 0px;\n pointer-events: none;\n > span {\n pointer-events: none;\n }\n }\n"])));
@@ -37,7 +37,8 @@ export var ColumnControls = function ColumnControls(_ref) {
37
37
  isTableHovered = _ref.isTableHovered,
38
38
  canDrag = _ref.canDrag,
39
39
  tableContainerWidth = _ref.tableContainerWidth,
40
- isNumberColumnEnabled = _ref.isNumberColumnEnabled;
40
+ isNumberColumnEnabled = _ref.isNumberColumnEnabled,
41
+ isDragging = _ref.isDragging;
41
42
  var columnControlsRef = useRef(null);
42
43
  var widths = (_colWidths$map$join = colWidths === null || colWidths === void 0 ? void 0 : colWidths.map(function (width) {
43
44
  return (
@@ -196,7 +197,8 @@ export var ColumnControls = function ColumnControls(_ref) {
196
197
  gridTemplateColumns: widths,
197
198
  marginTop: marginTop,
198
199
  width: stickyTop ? containerWidth : undefined,
199
- overflowX: stickyTop ? 'hidden' : 'visible'
200
+ overflowX: stickyTop ? 'hidden' : 'visible',
201
+ pointerEvents: isDragging ? 'none' : undefined
200
202
  }
201
203
  }, !isResizing && columnParams.map(function (_ref2, index) {
202
204
  var startIndex = _ref2.startIndex,
@@ -32,8 +32,8 @@ export var TableFloatingColumnControls = function TableFloatingColumnControls(_r
32
32
  setTableRect = _useState2[1];
33
33
  var _useState3 = useState(false),
34
34
  _useState4 = _slicedToArray(_useState3, 2),
35
- hasDropTargets = _useState4[0],
36
- setHasDropTargets = _useState4[1];
35
+ isDragging = _useState4[0],
36
+ setIsDragging = _useState4[1];
37
37
  var containerRef = useRef(null);
38
38
  var node = getNode();
39
39
  var currentNodeLocalId = node === null || node === void 0 ? void 0 : node.attrs.localId;
@@ -81,10 +81,10 @@ export var TableFloatingColumnControls = function TableFloatingColumnControls(_r
81
81
  return type === 'table-column' && !!(indexes !== null && indexes !== void 0 && indexes.length) && localId === currentNodeLocalId;
82
82
  },
83
83
  onDragStart: function onDragStart() {
84
- setHasDropTargets(true);
84
+ setIsDragging(true);
85
85
  },
86
86
  onDrop: function onDrop() {
87
- setHasDropTargets(false);
87
+ setIsDragging(false);
88
88
  }
89
89
  });
90
90
  }, [editorView, currentNodeLocalId]);
@@ -127,8 +127,9 @@ export var TableFloatingColumnControls = function TableFloatingColumnControls(_r
127
127
  hasHeaderColumn: hasHeaderColumn,
128
128
  canDrag: canDrag,
129
129
  tableContainerWidth: tableContainerWidth,
130
- isNumberColumnEnabled: isNumberColumnEnabled
131
- }), hasDropTargets && /*#__PURE__*/React.createElement(ColumnDropTargets, {
130
+ isNumberColumnEnabled: isNumberColumnEnabled,
131
+ isDragging: isDragging
132
+ }), isDragging && /*#__PURE__*/React.createElement(ColumnDropTargets, {
132
133
  tableRef: tableRef,
133
134
  stickyTop: tableActive ? stickyTop : undefined,
134
135
  tableHeight: tableRect.height,
@@ -1,5 +1,5 @@
1
1
  import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
2
- import type { Direction } from '@atlaskit/editor-tables/src/types';
2
+ import type { Direction } from '@atlaskit/editor-tables/types';
3
3
  export declare const initiateKeyboardColumnResizing: Command;
4
4
  export declare const activateNextResizeArea: (direction: Direction) => Command;
5
5
  export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth) => Command;
@@ -1,2 +1,3 @@
1
1
  export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
+ export declare const elementBeforeIconStyles: import("@emotion/react").SerializedStyles;
2
3
  export declare const tablePopupStyles: import("@emotion/react").SerializedStyles;
@@ -1,3 +1,4 @@
1
1
  export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
+ export declare const elementBeforeIconStyles: import("@emotion/react").SerializedStyles;
2
3
  export declare const dragMenuBackgroundColorStyles: import("@emotion/react").SerializedStyles;
3
4
  export declare const toggleStyles: import("@emotion/react").SerializedStyles;
@@ -17,6 +17,7 @@ export interface ColumnControlsProps {
17
17
  canDrag?: boolean;
18
18
  tableContainerWidth?: number;
19
19
  isNumberColumnEnabled?: boolean;
20
+ isDragging?: boolean;
20
21
  }
21
- export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, isTableHovered, canDrag, tableContainerWidth, isNumberColumnEnabled, }: ColumnControlsProps) => JSX.Element;
22
+ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, isTableHovered, canDrag, tableContainerWidth, isNumberColumnEnabled, isDragging, }: ColumnControlsProps) => JSX.Element;
22
23
  export default ColumnControls;
@@ -1,5 +1,5 @@
1
1
  import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
2
- import type { Direction } from '@atlaskit/editor-tables/src/types';
2
+ import type { Direction } from '@atlaskit/editor-tables/types';
3
3
  export declare const initiateKeyboardColumnResizing: Command;
4
4
  export declare const activateNextResizeArea: (direction: Direction) => Command;
5
5
  export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth) => Command;
@@ -1,2 +1,3 @@
1
1
  export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
+ export declare const elementBeforeIconStyles: import("@emotion/react").SerializedStyles;
2
3
  export declare const tablePopupStyles: import("@emotion/react").SerializedStyles;
@@ -1,3 +1,4 @@
1
1
  export declare const cellColourPreviewStyles: (selectedColor: string) => import("@emotion/react").SerializedStyles;
2
+ export declare const elementBeforeIconStyles: import("@emotion/react").SerializedStyles;
2
3
  export declare const dragMenuBackgroundColorStyles: import("@emotion/react").SerializedStyles;
3
4
  export declare const toggleStyles: import("@emotion/react").SerializedStyles;
@@ -17,6 +17,7 @@ export interface ColumnControlsProps {
17
17
  canDrag?: boolean;
18
18
  tableContainerWidth?: number;
19
19
  isNumberColumnEnabled?: boolean;
20
+ isDragging?: boolean;
20
21
  }
21
- export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, isTableHovered, canDrag, tableContainerWidth, isNumberColumnEnabled, }: ColumnControlsProps) => JSX.Element;
22
+ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, isTableHovered, canDrag, tableContainerWidth, isNumberColumnEnabled, isDragging, }: ColumnControlsProps) => JSX.Element;
22
23
  export default ColumnControls;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "5.8.5",
3
+ "version": "6.0.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^35.3.0",
32
32
  "@atlaskit/custom-steps": "^0.0.11",
33
- "@atlaskit/editor-common": "^76.39.0",
33
+ "@atlaskit/editor-common": "^76.40.0",
34
34
  "@atlaskit/editor-palette": "1.5.2",
35
35
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
36
36
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
@@ -4,10 +4,7 @@ import type {
4
4
  GetEditorContainerWidth,
5
5
  } from '@atlaskit/editor-common/types';
6
6
  import { TableMap } from '@atlaskit/editor-tables';
7
- import type {
8
- CellAttributes,
9
- Direction,
10
- } from '@atlaskit/editor-tables/src/types';
7
+ import type { CellAttributes, Direction } from '@atlaskit/editor-tables/types';
11
8
  import {
12
9
  findCellClosestToPos,
13
10
  findCellRectClosestToPos,
@@ -15,7 +12,7 @@ import {
15
12
  getSelectionRect,
16
13
  isSelectionType,
17
14
  nextCell,
18
- } from '@atlaskit/editor-tables/src/utils';
15
+ } from '@atlaskit/editor-tables/utils';
19
16
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
20
17
 
21
18
  import {
@@ -81,7 +81,7 @@ import {
81
81
  SplitCellIcon,
82
82
  } from '../icons';
83
83
 
84
- import { cellColourPreviewStyles } from './styles';
84
+ import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
85
85
 
86
86
  export interface Props {
87
87
  editorView: EditorView;
@@ -210,10 +210,12 @@ export class ContextualMenu extends Component<
210
210
  getBooleanFF(
211
211
  'platform.editor.table.new-cell-context-menu-styling',
212
212
  ) ? (
213
- <EditorBackgroundColorIcon
214
- label={formatMessage(messages.backgroundColor)}
215
- size="medium"
216
- />
213
+ <span css={elementBeforeIconStyles}>
214
+ <EditorBackgroundColorIcon
215
+ label={formatMessage(messages.backgroundColor)}
216
+ size="medium"
217
+ />
218
+ </span>
217
219
  ) : undefined,
218
220
  elemAfter: (
219
221
  <div className={DropdownMenuSharedCssClassName.SUBMENU}>
@@ -272,7 +274,9 @@ export class ContextualMenu extends Component<
272
274
  getBooleanFF(
273
275
  'platform.editor.table.new-cell-context-menu-styling',
274
276
  ) ? (
275
- <MergeCellsIcon />
277
+ <span css={elementBeforeIconStyles}>
278
+ <MergeCellsIcon />
279
+ </span>
276
280
  ) : undefined,
277
281
  },
278
282
  {
@@ -284,7 +288,9 @@ export class ContextualMenu extends Component<
284
288
  getBooleanFF(
285
289
  'platform.editor.table.new-cell-context-menu-styling',
286
290
  ) ? (
287
- <SplitCellIcon />
291
+ <span css={elementBeforeIconStyles}>
292
+ <SplitCellIcon />
293
+ </span>
288
294
  ) : undefined,
289
295
  },
290
296
  ] as MenuItem[];
@@ -311,7 +317,9 @@ export class ContextualMenu extends Component<
311
317
  elemBefore:
312
318
  isDragAndDropEnabled &&
313
319
  getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? (
314
- <AddColRightIcon />
320
+ <span css={elementBeforeIconStyles}>
321
+ <AddColRightIcon />
322
+ </span>
315
323
  ) : undefined,
316
324
  } as MenuItem;
317
325
  };
@@ -335,7 +343,9 @@ export class ContextualMenu extends Component<
335
343
  elemBefore:
336
344
  isDragAndDropEnabled &&
337
345
  getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? (
338
- <AddRowBelowIcon />
346
+ <span css={elementBeforeIconStyles}>
347
+ <AddRowBelowIcon />
348
+ </span>
339
349
  ) : undefined,
340
350
  } as MenuItem;
341
351
  };
@@ -360,11 +370,13 @@ export class ContextualMenu extends Component<
360
370
  elemBefore:
361
371
  isDragAndDropEnabled &&
362
372
  getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? (
363
- <CrossCircleIcon
364
- label={formatMessage(messages.clearCells, {
365
- 0: Math.max(noOfColumns, noOfRows),
366
- })}
367
- />
373
+ <span css={elementBeforeIconStyles}>
374
+ <CrossCircleIcon
375
+ label={formatMessage(messages.clearCells, {
376
+ 0: Math.max(noOfColumns, noOfRows),
377
+ })}
378
+ />
379
+ </span>
368
380
  ) : undefined,
369
381
  } as MenuItem;
370
382
  };
@@ -388,11 +400,13 @@ export class ContextualMenu extends Component<
388
400
  elemBefore:
389
401
  isDragAndDropEnabled &&
390
402
  getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? (
391
- <RemoveIcon
392
- label={formatMessage(messages.removeColumns, {
393
- 0: noOfColumns,
394
- })}
395
- />
403
+ <span css={elementBeforeIconStyles}>
404
+ <RemoveIcon
405
+ label={formatMessage(messages.removeColumns, {
406
+ 0: noOfColumns,
407
+ })}
408
+ />
409
+ </span>
396
410
  ) : undefined,
397
411
  } as MenuItem;
398
412
  };
@@ -416,11 +430,13 @@ export class ContextualMenu extends Component<
416
430
  elemBefore:
417
431
  isDragAndDropEnabled &&
418
432
  getBooleanFF('platform.editor.table.new-cell-context-menu-styling') ? (
419
- <RemoveIcon
420
- label={formatMessage(messages.removeRows, {
421
- 0: noOfRows,
422
- })}
423
- />
433
+ <span css={elementBeforeIconStyles}>
434
+ <RemoveIcon
435
+ label={formatMessage(messages.removeRows, {
436
+ 0: noOfRows,
437
+ })}
438
+ />
439
+ </span>
424
440
  ) : undefined,
425
441
  } as MenuItem;
426
442
  };
@@ -13,6 +13,11 @@ export const cellColourPreviewStyles = (selectedColor: string) => css`
13
13
  }
14
14
  `;
15
15
 
16
+ export const elementBeforeIconStyles = css`
17
+ margin-right: ${token('space.negative.075', '-6px')};
18
+ display: flex;
19
+ `;
20
+
16
21
  // TODO Delete this comment after verifying space token -> previous value `padding: 8px`
17
22
  // TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
18
23
  export const tablePopupStyles = css`
@@ -77,6 +77,7 @@ import { dragMenuDropdownWidth } from '../consts';
77
77
  import {
78
78
  cellColourPreviewStyles,
79
79
  dragMenuBackgroundColorStyles,
80
+ elementBeforeIconStyles,
80
81
  toggleStyles,
81
82
  } from './styles';
82
83
 
@@ -230,18 +231,14 @@ const convertToDropdownItems = (
230
231
  value: { name: item.id },
231
232
  isDisabled: item.disabled,
232
233
  elemBefore: item.icon ? (
233
- <div
234
- style={{
235
- display: 'flex',
236
- }}
237
- >
234
+ <span css={elementBeforeIconStyles}>
238
235
  <item.icon
239
236
  label={formatMessage(
240
237
  MapDragMenuOptionIdToMessage[item.id].message,
241
238
  options,
242
239
  )}
243
240
  />
244
- </div>
241
+ </span>
245
242
  ) : undefined,
246
243
  elemAfter: item.keymap ? (
247
244
  <div css={shortcutStyle}>{item.keymap}</div>
@@ -349,10 +346,12 @@ export const DragMenu = ({
349
346
  content: formatMessage(messages.backgroundColor),
350
347
  value: { name: 'background' },
351
348
  elemBefore: (
352
- <EditorBackgroundColorIcon
353
- label={formatMessage(messages.backgroundColor)}
354
- size="medium"
355
- />
349
+ <span css={elementBeforeIconStyles}>
350
+ <EditorBackgroundColorIcon
351
+ label={formatMessage(messages.backgroundColor)}
352
+ size="medium"
353
+ />
354
+ </span>
356
355
  ),
357
356
  elemAfter: (
358
357
  <div
@@ -13,6 +13,11 @@ export const cellColourPreviewStyles = (selectedColor: string) => css`
13
13
  }
14
14
  `;
15
15
 
16
+ export const elementBeforeIconStyles = css`
17
+ margin-right: ${token('space.negative.075', '-6px')};
18
+ display: flex;
19
+ `;
20
+
16
21
  export const dragMenuBackgroundColorStyles = css`
17
22
  .${ClassName.DRAG_SUBMENU} {
18
23
  border-radius: ${token('border.radius', '3px')};
@@ -39,6 +39,7 @@ export interface ColumnControlsProps {
39
39
  canDrag?: boolean;
40
40
  tableContainerWidth?: number;
41
41
  isNumberColumnEnabled?: boolean;
42
+ isDragging?: boolean;
42
43
  }
43
44
 
44
45
  const getSelectedColumns = (selection: Selection) => {
@@ -68,6 +69,7 @@ export const ColumnControls = ({
68
69
  canDrag,
69
70
  tableContainerWidth,
70
71
  isNumberColumnEnabled,
72
+ isDragging,
71
73
  }: ColumnControlsProps) => {
72
74
  const columnControlsRef = useRef<HTMLDivElement>(null);
73
75
  const widths =
@@ -300,6 +302,7 @@ export const ColumnControls = ({
300
302
  isNumberColumnEnabled && tableContainerWidth
301
303
  ? tableContainerWidth - akEditorTableNumberColumnWidth
302
304
  : tableContainerWidth;
305
+
303
306
  return (
304
307
  <div
305
308
  className={ClassName.DRAG_COLUMN_CONTROLS}
@@ -314,6 +317,7 @@ export const ColumnControls = ({
314
317
  marginTop,
315
318
  width: stickyTop ? containerWidth : undefined,
316
319
  overflowX: stickyTop ? 'hidden' : 'visible',
320
+ pointerEvents: isDragging ? 'none' : undefined,
317
321
  }}
318
322
  >
319
323
  {!isResizing &&
@@ -59,7 +59,7 @@ export const TableFloatingColumnControls: React.FC<Props> = ({
59
59
  const [tableRect, setTableRect] = useState<{ width: number; height: number }>(
60
60
  { width: 0, height: 0 },
61
61
  );
62
- const [hasDropTargets, setHasDropTargets] = useState(false);
62
+ const [isDragging, setIsDragging] = useState(false);
63
63
  const containerRef = useRef<HTMLDivElement>(null);
64
64
 
65
65
  const node = getNode();
@@ -105,10 +105,10 @@ export const TableFloatingColumnControls: React.FC<Props> = ({
105
105
  );
106
106
  },
107
107
  onDragStart() {
108
- setHasDropTargets(true);
108
+ setIsDragging(true);
109
109
  },
110
110
  onDrop() {
111
- setHasDropTargets(false);
111
+ setIsDragging(false);
112
112
  },
113
113
  });
114
114
  }, [editorView, currentNodeLocalId]);
@@ -160,8 +160,9 @@ export const TableFloatingColumnControls: React.FC<Props> = ({
160
160
  canDrag={canDrag}
161
161
  tableContainerWidth={tableContainerWidth}
162
162
  isNumberColumnEnabled={isNumberColumnEnabled}
163
+ isDragging={isDragging}
163
164
  />
164
- {hasDropTargets && (
165
+ {isDragging && (
165
166
  <ColumnDropTargets
166
167
  tableRef={tableRef}
167
168
  stickyTop={tableActive ? stickyTop : undefined}