@atlaskit/editor-plugin-table 5.4.11 → 5.4.12

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 (31) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/plugins/table/toolbar.js +3 -6
  3. package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +3 -6
  4. package/dist/cjs/plugins/table/ui/DragHandle/index.js +12 -6
  5. package/dist/cjs/plugins/table/ui/DragPreview/index.js +2 -0
  6. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +7 -10
  7. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -11
  8. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +3 -6
  9. package/dist/cjs/plugins/table/ui/FloatingDragMenu/DragMenu.js +4 -7
  10. package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +1 -4
  11. package/dist/es2019/plugins/table/toolbar.js +3 -5
  12. package/dist/es2019/plugins/table/ui/ColumnResizeWidget/index.js +3 -5
  13. package/dist/es2019/plugins/table/ui/DragHandle/index.js +11 -4
  14. package/dist/es2019/plugins/table/ui/DragPreview/index.js +2 -0
  15. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +7 -9
  16. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +9 -11
  17. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +3 -5
  18. package/dist/es2019/plugins/table/ui/FloatingDragMenu/DragMenu.js +4 -6
  19. package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +1 -4
  20. package/dist/esm/plugins/table/toolbar.js +3 -5
  21. package/dist/esm/plugins/table/ui/ColumnResizeWidget/index.js +3 -5
  22. package/dist/esm/plugins/table/ui/DragHandle/index.js +11 -5
  23. package/dist/esm/plugins/table/ui/DragPreview/index.js +2 -0
  24. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +7 -9
  25. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +9 -11
  26. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +3 -5
  27. package/dist/esm/plugins/table/ui/FloatingDragMenu/DragMenu.js +4 -6
  28. package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +1 -4
  29. package/package.json +3 -3
  30. package/src/plugins/table/ui/DragHandle/index.tsx +30 -21
  31. package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +1 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 5.4.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#58717](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58717) [`d65ee171dc89`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d65ee171dc89) - Return focus to editor when a mouse up event on drag handle is called - this allows copying of table selection to still work
8
+ - [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763) [`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) - update ADF schema
9
+ - Updated dependencies
10
+
3
11
  ## 5.4.11
4
12
 
5
13
  ### Patch Changes
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.getToolbarMenuConfig = exports.getToolbarConfig = exports.getToolbarCellOptionsConfig = exports.getClosestSelectionRect = void 0;
9
- var _react = require("@emotion/react");
10
9
  var _customSteps = require("@atlaskit/custom-steps");
11
10
  var _analytics = require("@atlaskit/editor-common/analytics");
12
11
  var _keymaps = require("@atlaskit/editor-common/keymaps");
@@ -30,8 +29,6 @@ var _types = require("./types");
30
29
  var _utils4 = require("./utils");
31
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
31
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
- /** @jsx jsx */
34
-
35
32
  var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
36
33
  var formatMessage = _ref.formatMessage;
37
34
  var options = [{
@@ -98,7 +95,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
98
95
  },
99
96
  selected: false,
100
97
  disabled: false,
101
- elemAfter: (0, _react.jsx)("div", {
98
+ elemAfter: /*#__PURE__*/React.createElement("div", {
102
99
  css: _shortcut.shortcutStyle
103
100
  }, (0, _keymaps.tooltip)(_keymaps.addColumnAfter))
104
101
  }, {
@@ -117,7 +114,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
117
114
  },
118
115
  selected: false,
119
116
  disabled: false,
120
- elemAfter: (0, _react.jsx)("div", {
117
+ elemAfter: /*#__PURE__*/React.createElement("div", {
121
118
  css: _shortcut.shortcutStyle
122
119
  }, (0, _keymaps.tooltip)(_keymaps.addRowAfter))
123
120
  }, {
@@ -249,7 +246,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
249
246
  },
250
247
  selected: false,
251
248
  disabled: false,
252
- elemAfter: (0, _react.jsx)("div", {
249
+ elemAfter: /*#__PURE__*/React.createElement("div", {
253
250
  css: _shortcut.shortcutStyle
254
251
  }, (0, _keymaps.tooltip)(_keymaps.backspace))
255
252
  });
@@ -7,13 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ColumnResizeWidget = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
- var _react2 = require("@emotion/react");
11
10
  var _reactIntlNext = require("react-intl-next");
12
11
  var _messages = require("@atlaskit/editor-common/messages");
13
12
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
13
  var _types = require("../../types");
15
- /** @jsx jsx */
16
-
17
14
  var ColumnResizeWidget = exports.ColumnResizeWidget = function ColumnResizeWidget(_ref) {
18
15
  var startIndex = _ref.startIndex,
19
16
  endIndex = _ref.endIndex,
@@ -21,20 +18,20 @@ var ColumnResizeWidget = exports.ColumnResizeWidget = function ColumnResizeWidge
21
18
  var _useIntl = (0, _reactIntlNext.useIntl)(),
22
19
  formatMessage = _useIntl.formatMessage;
23
20
  if (!includeTooltip) {
24
- return (0, _react2.jsx)("div", {
21
+ return /*#__PURE__*/_react.default.createElement("div", {
25
22
  className: _types.TableCssClassName.RESIZE_HANDLE_DECORATION,
26
23
  "data-start-index": startIndex,
27
24
  "data-end-index": endIndex
28
25
  });
29
26
  }
30
- return (0, _react2.jsx)(_tooltip.default, {
27
+ return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
31
28
  content: formatMessage(_messages.tableMessages.adjustColumns),
32
29
  hideTooltipOnClick: true,
33
30
  hideTooltipOnMouseDown: true,
34
31
  position: "mouse",
35
32
  mousePosition: "auto-start"
36
33
  }, function (tooltipProps) {
37
- return (0, _react2.jsx)("div", (0, _extends2.default)({
34
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
38
35
  className: _types.TableCssClassName.RESIZE_HANDLE_DECORATION,
39
36
  "data-start-index": startIndex,
40
37
  "data-end-index": endIndex
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.DragHandle = void 0;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
- var _classnames = _interopRequireDefault(require("classnames"));
12
+ var _classnames2 = _interopRequireDefault(require("classnames"));
12
13
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
14
  var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
14
15
  var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview");
@@ -31,7 +32,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
31
32
  previewHeight = _ref.previewHeight,
32
33
  onMouseOver = _ref.onMouseOver,
33
34
  onMouseOut = _ref.onMouseOut,
34
- onMouseUp = _ref.onMouseUp,
35
+ _onMouseUp = _ref.onMouseUp,
35
36
  onClick = _ref.onClick,
36
37
  editorView = _ref.editorView;
37
38
  var dragHandleDivRef = (0, _react.useRef)(null);
@@ -112,8 +113,8 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
112
113
  });
113
114
  }
114
115
  }, [tableLocalId, direction, indexes, editorView.state.selection, hasMergedCells]);
115
- return /*#__PURE__*/_react.default.createElement("button", {
116
- className: (0, _classnames.default)(_types.TableCssClassName.DRAG_HANDLE_BUTTON_CONTAINER, appearance, isDragAndDropEnabled && hasMergedCells && _types.TableCssClassName.DRAG_HANDLE_DISABLED),
116
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
117
+ className: (0, _classnames2.default)(_types.TableCssClassName.DRAG_HANDLE_BUTTON_CONTAINER, _types.TableCssClassName.CONTROLS_BUTTON, appearance, (0, _defineProperty2.default)({}, _types.TableCssClassName.DRAG_HANDLE_DISABLED, isDragAndDropEnabled && hasMergedCells)),
117
118
  ref: dragHandleDivRef,
118
119
  style: {
119
120
  transform: direction === 'column' ? 'none' : 'rotate(90deg)',
@@ -122,9 +123,14 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
122
123
  "data-testid": "table-floating-column-controls-drag-handle",
123
124
  onMouseOver: onMouseOver,
124
125
  onMouseOut: onMouseOut,
125
- onMouseUp: onMouseUp,
126
+ onMouseUp: function onMouseUp(e) {
127
+ // return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
128
+ // -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
129
+ editorView.focus();
130
+ _onMouseUp && _onMouseUp(e);
131
+ },
126
132
  onClick: onClick
127
- }, /*#__PURE__*/_react.default.createElement(_HandleIconComponent.HandleIconComponent, handleIconProps), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_DragPreview.DragPreview, {
133
+ }, /*#__PURE__*/_react.default.createElement(_HandleIconComponent.HandleIconComponent, handleIconProps)), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_DragPreview.DragPreview, {
128
134
  direction: direction,
129
135
  width: previewWidth,
130
136
  height: previewHeight
@@ -1,3 +1,4 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.26.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.DragPreview = void 0;
9
+ var _runtime = require("@compiled/react/runtime");
8
10
  var _react = _interopRequireDefault(require("react"));
9
11
  var _primitives = require("@atlaskit/primitives");
10
12
  var _DragInMotionIcon = require("../icons/DragInMotionIcon");
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = _default;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _react2 = require("@emotion/react");
10
9
  var _reactIntlNext = require("react-intl-next");
11
10
  var _analytics = require("@atlaskit/editor-common/analytics");
12
11
  var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
@@ -20,8 +19,6 @@ var _commands = require("../../commands");
20
19
  var _types = require("../../types");
21
20
  var _FixedButton = _interopRequireDefault(require("./FixedButton"));
22
21
  var _styles = require("./styles");
23
- /** @jsx jsx */
24
-
25
22
  var BUTTON_OFFSET = 3;
26
23
  var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (props) {
27
24
  var editorView = props.editorView,
@@ -52,7 +49,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
52
49
  return null;
53
50
  }
54
51
  var labelCellOptions = formatMessage(_messages.tableMessages.cellOptions);
55
- var button = (0, _react2.jsx)("div", {
52
+ var button = /*#__PURE__*/_react.default.createElement("div", {
56
53
  css: function css(theme) {
57
54
  return [(0, _styles.tableFloatingCellButtonStyles)({
58
55
  theme: theme
@@ -60,19 +57,19 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
60
57
  theme: theme
61
58
  })];
62
59
  }
63
- }, (0, _react2.jsx)(_uiMenu.ToolbarButton, {
60
+ }, /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarButton, {
64
61
  className: _types.TableCssClassName.CONTEXTUAL_MENU_BUTTON,
65
62
  selected: isContextualMenuOpen,
66
63
  title: labelCellOptions,
67
64
  onClick: handleClick,
68
- iconBefore: (0, _react2.jsx)(_chevronDown.default, {
65
+ iconBefore: /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
69
66
  label: ""
70
67
  }),
71
68
  "aria-label": labelCellOptions
72
69
  }));
73
70
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
74
71
  if (stickyHeader && parentSticky && tableWrapper) {
75
- return (0, _react2.jsx)(_FixedButton.default, {
72
+ return /*#__PURE__*/_react.default.createElement(_FixedButton.default, {
76
73
  offset: BUTTON_OFFSET,
77
74
  stickyHeader: stickyHeader,
78
75
  tableWrapper: tableWrapper,
@@ -82,7 +79,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
82
79
  isContextualMenuOpen: isContextualMenuOpen
83
80
  }, button);
84
81
  }
85
- return (0, _react2.jsx)(_ui.Popup, {
82
+ return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
86
83
  alignX: "right",
87
84
  alignY: "start",
88
85
  target: targetCellRef,
@@ -97,9 +94,9 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
97
94
  });
98
95
  var FloatingContextualButton = (0, _reactIntlNext.injectIntl)(FloatingContextualButtonInner);
99
96
  function _default(props) {
100
- return (0, _react2.jsx)(_errorBoundary.ErrorBoundary, {
97
+ return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
101
98
  component: _analytics.ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON,
102
99
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
103
100
  fallbackComponent: null
104
- }, (0, _react2.jsx)(FloatingContextualButton, props));
101
+ }, /*#__PURE__*/_react.default.createElement(FloatingContextualButton, props));
105
102
  }
@@ -13,7 +13,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
13
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _react = require("react");
16
- var _react2 = require("@emotion/react");
17
16
  var _reactIntlNext = require("react-intl-next");
18
17
  var _customSteps = require("@atlaskit/custom-steps");
19
18
  var _analytics = require("@atlaskit/editor-common/analytics");
@@ -38,7 +37,7 @@ var _styles2 = require("./styles");
38
37
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
39
38
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
40
39
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
41
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
40
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
42
41
  var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component) {
43
42
  (0, _inherits2.default)(ContextualMenu, _Component);
44
43
  var _super = _createSuper(ContextualMenu);
@@ -88,15 +87,15 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
88
87
  value: {
89
88
  name: 'background'
90
89
  },
91
- elemAfter: (0, _react2.jsx)("div", {
90
+ elemAfter: /*#__PURE__*/React.createElement("div", {
92
91
  className: _styles.DropdownMenuSharedCssClassName.SUBMENU
93
- }, (0, _react2.jsx)("div", {
92
+ }, /*#__PURE__*/React.createElement("div", {
94
93
  css: (0, _styles2.cellColourPreviewStyles)(background),
95
94
  className: _types.TableCssClassName.CONTEXTUAL_MENU_ICON
96
- }), isSubmenuOpen && (0, _react2.jsx)("div", {
95
+ }), isSubmenuOpen && /*#__PURE__*/React.createElement("div", {
97
96
  className: _types.TableCssClassName.CONTEXTUAL_SUBMENU,
98
97
  ref: _this.handleSubMenuRef
99
- }, (0, _react2.jsx)(_uiColor.ColorPalette, {
98
+ }, /*#__PURE__*/React.createElement(_uiColor.ColorPalette, {
100
99
  cols: 7,
101
100
  onClick: _this.setColor,
102
101
  selectedColor: background,
@@ -113,7 +112,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
113
112
  value: {
114
113
  name: 'insert_column'
115
114
  },
116
- elemAfter: (0, _react2.jsx)("div", {
115
+ elemAfter: /*#__PURE__*/React.createElement("div", {
117
116
  css: _shortcut.shortcutStyle
118
117
  }, (0, _keymaps.tooltip)(_keymaps.addColumnAfter))
119
118
  });
@@ -122,7 +121,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
122
121
  value: {
123
122
  name: 'insert_row'
124
123
  },
125
- elemAfter: (0, _react2.jsx)("div", {
124
+ elemAfter: /*#__PURE__*/React.createElement("div", {
126
125
  css: _shortcut.shortcutStyle
127
126
  }, (0, _keymaps.tooltip)(_keymaps.addRowAfter))
128
127
  });
@@ -202,7 +201,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
202
201
  value: {
203
202
  name: 'clear'
204
203
  },
205
- elemAfter: (0, _react2.jsx)("div", {
204
+ elemAfter: /*#__PURE__*/React.createElement("div", {
206
205
  css: _shortcut.shortcutStyle
207
206
  }, (0, _keymaps.tooltip)(_keymaps.backspace))
208
207
  });
@@ -364,10 +363,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
364
363
  if (!items) {
365
364
  return null;
366
365
  }
367
- return (0, _react2.jsx)("div", {
366
+ return /*#__PURE__*/React.createElement("div", {
368
367
  "data-testid": "table-cell-contextual-menu",
369
368
  onMouseLeave: this.closeSubmenu
370
- }, (0, _react2.jsx)(_uiMenu.DropdownMenu, {
369
+ }, /*#__PURE__*/React.createElement(_uiMenu.DropdownMenu, {
371
370
  mountTo: mountPoint
372
371
  //This needs be removed when the a11y is completely handled
373
372
  //Disabling key navigation now as it works only partially
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("@emotion/react");
9
8
  var _ui = require("@atlaskit/editor-common/ui");
10
9
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
@@ -14,8 +13,6 @@ var _pluginFactory = require("../../pm-plugins/plugin-factory");
14
13
  var _consts = require("../consts");
15
14
  var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu"));
16
15
  var _styles = require("./styles");
17
- /** @jsx jsx */
18
-
19
16
  var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
20
17
  var mountPoint = _ref.mountPoint,
21
18
  boundariesElement = _ref.boundariesElement,
@@ -42,7 +39,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
42
39
  return null;
43
40
  }
44
41
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
45
- return (0, _react.jsx)(_ui.Popup, {
42
+ return /*#__PURE__*/React.createElement(_ui.Popup, {
46
43
  alignX: "right",
47
44
  alignY: "top",
48
45
  target: targetCellRef,
@@ -58,9 +55,9 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
58
55
  forcePlacement: true,
59
56
  offset: [-7, 0],
60
57
  stick: true
61
- }, (0, _react.jsx)("div", {
58
+ }, /*#__PURE__*/React.createElement("div", {
62
59
  css: _styles.tablePopupStyles
63
- }, (0, _react.jsx)(_ContextualMenu.default, {
60
+ }, /*#__PURE__*/React.createElement(_ContextualMenu.default, {
64
61
  editorView: editorView,
65
62
  offset: [_consts.contextualMenuTriggerSize / 2, -_consts.contextualMenuTriggerSize],
66
63
  isOpen: isOpen,
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.DragMenu = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _react = require("@emotion/react");
10
9
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
11
10
  var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
12
11
  var _tableMap = require("@atlaskit/editor-tables/table-map");
@@ -17,8 +16,6 @@ var _pluginFactory = require("../../pm-plugins/drag-and-drop/plugin-factory");
17
16
  var _utils2 = require("../../utils");
18
17
  var _dragMenu = require("../../utils/drag-menu");
19
18
  var _consts = require("../consts");
20
- /** @jsx jsx */
21
-
22
19
  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'], ['sort_column_asc', 'sort_column_desc']];
23
20
  var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
24
21
  var menuItemsArr = (0, _toConsumableArray2.default)(Array(groupedDragMenuConfig.length)).map(function () {
@@ -39,15 +36,15 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
39
36
  name: item.id
40
37
  },
41
38
  isDisabled: item.disabled,
42
- elemBefore: item.icon ? (0, _react.jsx)("div", {
39
+ elemBefore: item.icon ? /*#__PURE__*/React.createElement("div", {
43
40
  style: {
44
41
  marginRight: "var(--ds-space-negative-075, -6px)",
45
42
  display: 'flex'
46
43
  }
47
- }, (0, _react.jsx)(item.icon, {
44
+ }, /*#__PURE__*/React.createElement(item.icon, {
48
45
  label: item.title
49
46
  })) : undefined,
50
- elemAfter: item.keymap ? (0, _react.jsx)("div", {
47
+ elemAfter: item.keymap ? /*#__PURE__*/React.createElement("div", {
51
48
  css: _shortcut.shortcutStyle
52
49
  }, item.keymap) : undefined
53
50
  });
@@ -139,7 +136,7 @@ var DragMenu = exports.DragMenu = function DragMenu(_ref) {
139
136
  if (!menuItems) {
140
137
  return null;
141
138
  }
142
- return (0, _react.jsx)(_uiMenu.DropdownMenu, {
139
+ return /*#__PURE__*/React.createElement(_uiMenu.DropdownMenu, {
143
140
  mountTo: mountPoint
144
141
  //This needs be removed when the a11y is completely handled
145
142
  //Disabling key navigation now as it works only partially
@@ -99,14 +99,11 @@ var TableFloatingColumnControls = exports.TableFloatingColumnControls = function
99
99
  }
100
100
  return [0];
101
101
  }, [tableRef, tableRect.height]);
102
- if (!tableRef) {
102
+ if (!tableRef || !tableActive) {
103
103
  return null;
104
104
  }
105
105
  var colWidths = (0, _utils.getColumnsWidths)(editorView);
106
106
  var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
107
- if (!tableActive) {
108
- return null;
109
- }
110
107
  return /*#__PURE__*/_react.default.createElement("div", {
111
108
  className: _types.TableCssClassName.DRAG_COLUMN_CONTROLS_WRAPPER,
112
109
  "data-testid": "table-floating-column-controls-wrapper"
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
1
  import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
4
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
3
  import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
@@ -89,7 +87,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
89
87
  },
90
88
  selected: false,
91
89
  disabled: false,
92
- elemAfter: jsx("div", {
90
+ elemAfter: /*#__PURE__*/React.createElement("div", {
93
91
  css: shortcutStyle
94
92
  }, tooltip(addColumnAfter))
95
93
  }, {
@@ -108,7 +106,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
108
106
  },
109
107
  selected: false,
110
108
  disabled: false,
111
- elemAfter: jsx("div", {
109
+ elemAfter: /*#__PURE__*/React.createElement("div", {
112
110
  css: shortcutStyle
113
111
  }, tooltip(addRowAfter))
114
112
  }, {
@@ -241,7 +239,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
241
239
  },
242
240
  selected: false,
243
241
  disabled: false,
244
- elemAfter: jsx("div", {
242
+ elemAfter: /*#__PURE__*/React.createElement("div", {
245
243
  css: shortcutStyle
246
244
  }, tooltip(backspace))
247
245
  });
@@ -1,7 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
3
2
  import React from 'react';
4
- import { jsx } from '@emotion/react';
5
3
  import { useIntl } from 'react-intl-next';
6
4
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
7
5
  import Tooltip from '@atlaskit/tooltip';
@@ -15,19 +13,19 @@ export const ColumnResizeWidget = ({
15
13
  formatMessage
16
14
  } = useIntl();
17
15
  if (!includeTooltip) {
18
- return jsx("div", {
16
+ return /*#__PURE__*/React.createElement("div", {
19
17
  className: TableCssClassName.RESIZE_HANDLE_DECORATION,
20
18
  "data-start-index": startIndex,
21
19
  "data-end-index": endIndex
22
20
  });
23
21
  }
24
- return jsx(Tooltip, {
22
+ return /*#__PURE__*/React.createElement(Tooltip, {
25
23
  content: formatMessage(messages.adjustColumns),
26
24
  hideTooltipOnClick: true,
27
25
  hideTooltipOnMouseDown: true,
28
26
  position: "mouse",
29
27
  mousePosition: "auto-start"
30
- }, tooltipProps => jsx("div", _extends({
28
+ }, tooltipProps => /*#__PURE__*/React.createElement("div", _extends({
31
29
  className: TableCssClassName.RESIZE_HANDLE_DECORATION,
32
30
  "data-start-index": startIndex,
33
31
  "data-end-index": endIndex
@@ -100,8 +100,10 @@ export const DragHandle = ({
100
100
  });
101
101
  }
102
102
  }, [tableLocalId, direction, indexes, editorView.state.selection, hasMergedCells]);
103
- return /*#__PURE__*/React.createElement("button", {
104
- className: classnames(ClassName.DRAG_HANDLE_BUTTON_CONTAINER, appearance, isDragAndDropEnabled && hasMergedCells && ClassName.DRAG_HANDLE_DISABLED),
103
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
104
+ className: classnames(ClassName.DRAG_HANDLE_BUTTON_CONTAINER, ClassName.CONTROLS_BUTTON, appearance, {
105
+ [ClassName.DRAG_HANDLE_DISABLED]: isDragAndDropEnabled && hasMergedCells
106
+ }),
105
107
  ref: dragHandleDivRef,
106
108
  style: {
107
109
  transform: direction === 'column' ? 'none' : 'rotate(90deg)',
@@ -110,9 +112,14 @@ export const DragHandle = ({
110
112
  "data-testid": "table-floating-column-controls-drag-handle",
111
113
  onMouseOver: onMouseOver,
112
114
  onMouseOut: onMouseOut,
113
- onMouseUp: onMouseUp,
115
+ onMouseUp: e => {
116
+ // return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
117
+ // -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
118
+ editorView.focus();
119
+ onMouseUp && onMouseUp(e);
120
+ },
114
121
  onClick: onClick
115
- }, /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(DragPreview, {
122
+ }, /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps)), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(DragPreview, {
116
123
  direction: direction,
117
124
  width: previewWidth,
118
125
  height: previewHeight
@@ -1,3 +1,5 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.26.1 */
2
+ import { ax, ix } from "@compiled/react/runtime";
1
3
  import React from 'react';
2
4
  import { Box, xcss } from '@atlaskit/primitives';
3
5
  import { DragInMotionIcon } from '../icons/DragInMotionIcon';
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import React from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  import { injectIntl } from 'react-intl-next';
5
3
  import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
6
4
  import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
@@ -50,25 +48,25 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
50
48
  return null;
51
49
  }
52
50
  const labelCellOptions = formatMessage(messages.cellOptions);
53
- const button = jsx("div", {
51
+ const button = /*#__PURE__*/React.createElement("div", {
54
52
  css: theme => [tableFloatingCellButtonStyles({
55
53
  theme
56
54
  }), isContextualMenuOpen && tableFloatingCellButtonSelectedStyles({
57
55
  theme
58
56
  })]
59
- }, jsx(ToolbarButton, {
57
+ }, /*#__PURE__*/React.createElement(ToolbarButton, {
60
58
  className: ClassName.CONTEXTUAL_MENU_BUTTON,
61
59
  selected: isContextualMenuOpen,
62
60
  title: labelCellOptions,
63
61
  onClick: handleClick,
64
- iconBefore: jsx(ExpandIcon, {
62
+ iconBefore: /*#__PURE__*/React.createElement(ExpandIcon, {
65
63
  label: ""
66
64
  }),
67
65
  "aria-label": labelCellOptions
68
66
  }));
69
67
  const parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
70
68
  if (stickyHeader && parentSticky && tableWrapper) {
71
- return jsx(FixedButton, {
69
+ return /*#__PURE__*/React.createElement(FixedButton, {
72
70
  offset: BUTTON_OFFSET,
73
71
  stickyHeader: stickyHeader,
74
72
  tableWrapper: tableWrapper,
@@ -78,7 +76,7 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
78
76
  isContextualMenuOpen: isContextualMenuOpen
79
77
  }, button);
80
78
  }
81
- return jsx(Popup, {
79
+ return /*#__PURE__*/React.createElement(Popup, {
82
80
  alignX: "right",
83
81
  alignY: "start",
84
82
  target: targetCellRef,
@@ -93,9 +91,9 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
93
91
  });
94
92
  const FloatingContextualButton = injectIntl(FloatingContextualButtonInner);
95
93
  export default function (props) {
96
- return jsx(ErrorBoundary, {
94
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
97
95
  component: ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON,
98
96
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
99
97
  fallbackComponent: null
100
- }, jsx(FloatingContextualButton, props));
98
+ }, /*#__PURE__*/React.createElement(FloatingContextualButton, props));
101
99
  }
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /** @jsx jsx */
3
2
  import { Component } from 'react';
4
- import { jsx } from '@emotion/react';
5
3
  import { injectIntl } from 'react-intl-next';
6
4
  import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
7
5
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
@@ -75,15 +73,15 @@ export class ContextualMenu extends Component {
75
73
  value: {
76
74
  name: 'background'
77
75
  },
78
- elemAfter: jsx("div", {
76
+ elemAfter: /*#__PURE__*/React.createElement("div", {
79
77
  className: DropdownMenuSharedCssClassName.SUBMENU
80
- }, jsx("div", {
78
+ }, /*#__PURE__*/React.createElement("div", {
81
79
  css: cellColourPreviewStyles(background),
82
80
  className: ClassName.CONTEXTUAL_MENU_ICON
83
- }), isSubmenuOpen && jsx("div", {
81
+ }), isSubmenuOpen && /*#__PURE__*/React.createElement("div", {
84
82
  className: ClassName.CONTEXTUAL_SUBMENU,
85
83
  ref: this.handleSubMenuRef
86
- }, jsx(ColorPalette, {
84
+ }, /*#__PURE__*/React.createElement(ColorPalette, {
87
85
  cols: 7,
88
86
  onClick: this.setColor,
89
87
  selectedColor: background,
@@ -100,7 +98,7 @@ export class ContextualMenu extends Component {
100
98
  value: {
101
99
  name: 'insert_column'
102
100
  },
103
- elemAfter: jsx("div", {
101
+ elemAfter: /*#__PURE__*/React.createElement("div", {
104
102
  css: shortcutStyle
105
103
  }, tooltip(addColumnAfter))
106
104
  });
@@ -109,7 +107,7 @@ export class ContextualMenu extends Component {
109
107
  value: {
110
108
  name: 'insert_row'
111
109
  },
112
- elemAfter: jsx("div", {
110
+ elemAfter: /*#__PURE__*/React.createElement("div", {
113
111
  css: shortcutStyle
114
112
  }, tooltip(addRowAfter))
115
113
  });
@@ -193,7 +191,7 @@ export class ContextualMenu extends Component {
193
191
  value: {
194
192
  name: 'clear'
195
193
  },
196
- elemAfter: jsx("div", {
194
+ elemAfter: /*#__PURE__*/React.createElement("div", {
197
195
  css: shortcutStyle
198
196
  }, tooltip(backspace))
199
197
  });
@@ -375,10 +373,10 @@ export class ContextualMenu extends Component {
375
373
  if (!items) {
376
374
  return null;
377
375
  }
378
- return jsx("div", {
376
+ return /*#__PURE__*/React.createElement("div", {
379
377
  "data-testid": "table-cell-contextual-menu",
380
378
  onMouseLeave: this.closeSubmenu
381
- }, jsx(DropdownMenu, {
379
+ }, /*#__PURE__*/React.createElement(DropdownMenu, {
382
380
  mountTo: mountPoint
383
381
  //This needs be removed when the a11y is completely handled
384
382
  //Disabling key navigation now as it works only partially
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
1
  import { Popup } from '@atlaskit/editor-common/ui';
4
2
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
5
3
  import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
@@ -38,7 +36,7 @@ const FloatingContextualMenu = ({
38
36
  return null;
39
37
  }
40
38
  const parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
41
- return jsx(Popup, {
39
+ return /*#__PURE__*/React.createElement(Popup, {
42
40
  alignX: "right",
43
41
  alignY: "top",
44
42
  target: targetCellRef,
@@ -54,9 +52,9 @@ const FloatingContextualMenu = ({
54
52
  forcePlacement: true,
55
53
  offset: [-7, 0],
56
54
  stick: true
57
- }, jsx("div", {
55
+ }, /*#__PURE__*/React.createElement("div", {
58
56
  css: tablePopupStyles
59
- }, jsx(ContextualMenu, {
57
+ }, /*#__PURE__*/React.createElement(ContextualMenu, {
60
58
  editorView: editorView,
61
59
  offset: [contextualMenuTriggerSize / 2, -contextualMenuTriggerSize],
62
60
  isOpen: isOpen,
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
1
  import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
4
2
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
5
3
  import { TableMap } from '@atlaskit/editor-tables/table-map';
@@ -26,15 +24,15 @@ const convertToDropdownItems = dragMenuConfig => {
26
24
  name: item.id
27
25
  },
28
26
  isDisabled: item.disabled,
29
- elemBefore: item.icon ? jsx("div", {
27
+ elemBefore: item.icon ? /*#__PURE__*/React.createElement("div", {
30
28
  style: {
31
29
  marginRight: "var(--ds-space-negative-075, -6px)",
32
30
  display: 'flex'
33
31
  }
34
- }, jsx(item.icon, {
32
+ }, /*#__PURE__*/React.createElement(item.icon, {
35
33
  label: item.title
36
34
  })) : undefined,
37
- elemAfter: item.keymap ? jsx("div", {
35
+ elemAfter: item.keymap ? /*#__PURE__*/React.createElement("div", {
38
36
  css: shortcutStyle
39
37
  }, item.keymap) : undefined
40
38
  });
@@ -137,7 +135,7 @@ export const DragMenu = ({
137
135
  if (!menuItems) {
138
136
  return null;
139
137
  }
140
- return jsx(DropdownMenu, {
138
+ return /*#__PURE__*/React.createElement(DropdownMenu, {
141
139
  mountTo: mountPoint
142
140
  //This needs be removed when the a11y is completely handled
143
141
  //Disabling key navigation now as it works only partially
@@ -70,14 +70,11 @@ export const TableFloatingColumnControls = ({
70
70
  }
71
71
  return [0];
72
72
  }, [tableRef, tableRect.height]);
73
- if (!tableRef) {
73
+ if (!tableRef || !tableActive) {
74
74
  return null;
75
75
  }
76
76
  const colWidths = getColumnsWidths(editorView);
77
77
  const stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
78
- if (!tableActive) {
79
- return null;
80
- }
81
78
  return /*#__PURE__*/React.createElement("div", {
82
79
  className: ClassName.DRAG_COLUMN_CONTROLS_WRAPPER,
83
80
  "data-testid": "table-floating-column-controls-wrapper"
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
1
  import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
4
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
3
  import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
@@ -87,7 +85,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
87
85
  },
88
86
  selected: false,
89
87
  disabled: false,
90
- elemAfter: jsx("div", {
88
+ elemAfter: /*#__PURE__*/React.createElement("div", {
91
89
  css: shortcutStyle
92
90
  }, tooltip(addColumnAfter))
93
91
  }, {
@@ -106,7 +104,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
106
104
  },
107
105
  selected: false,
108
106
  disabled: false,
109
- elemAfter: jsx("div", {
107
+ elemAfter: /*#__PURE__*/React.createElement("div", {
110
108
  css: shortcutStyle
111
109
  }, tooltip(addRowAfter))
112
110
  }, {
@@ -238,7 +236,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
238
236
  },
239
237
  selected: false,
240
238
  disabled: false,
241
- elemAfter: jsx("div", {
239
+ elemAfter: /*#__PURE__*/React.createElement("div", {
242
240
  css: shortcutStyle
243
241
  }, tooltip(backspace))
244
242
  });
@@ -1,7 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
3
2
  import React from 'react';
4
- import { jsx } from '@emotion/react';
5
3
  import { useIntl } from 'react-intl-next';
6
4
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
7
5
  import Tooltip from '@atlaskit/tooltip';
@@ -13,20 +11,20 @@ export var ColumnResizeWidget = function ColumnResizeWidget(_ref) {
13
11
  var _useIntl = useIntl(),
14
12
  formatMessage = _useIntl.formatMessage;
15
13
  if (!includeTooltip) {
16
- return jsx("div", {
14
+ return /*#__PURE__*/React.createElement("div", {
17
15
  className: TableCssClassName.RESIZE_HANDLE_DECORATION,
18
16
  "data-start-index": startIndex,
19
17
  "data-end-index": endIndex
20
18
  });
21
19
  }
22
- return jsx(Tooltip, {
20
+ return /*#__PURE__*/React.createElement(Tooltip, {
23
21
  content: formatMessage(messages.adjustColumns),
24
22
  hideTooltipOnClick: true,
25
23
  hideTooltipOnMouseDown: true,
26
24
  position: "mouse",
27
25
  mousePosition: "auto-start"
28
26
  }, function (tooltipProps) {
29
- return jsx("div", _extends({
27
+ return /*#__PURE__*/React.createElement("div", _extends({
30
28
  className: TableCssClassName.RESIZE_HANDLE_DECORATION,
31
29
  "data-start-index": startIndex,
32
30
  "data-end-index": endIndex
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import React, { useEffect, useMemo, useRef, useState } from 'react';
3
4
  import classnames from 'classnames';
@@ -21,7 +22,7 @@ export var DragHandle = function DragHandle(_ref) {
21
22
  previewHeight = _ref.previewHeight,
22
23
  onMouseOver = _ref.onMouseOver,
23
24
  onMouseOut = _ref.onMouseOut,
24
- onMouseUp = _ref.onMouseUp,
25
+ _onMouseUp = _ref.onMouseUp,
25
26
  onClick = _ref.onClick,
26
27
  editorView = _ref.editorView;
27
28
  var dragHandleDivRef = useRef(null);
@@ -102,8 +103,8 @@ export var DragHandle = function DragHandle(_ref) {
102
103
  });
103
104
  }
104
105
  }, [tableLocalId, direction, indexes, editorView.state.selection, hasMergedCells]);
105
- return /*#__PURE__*/React.createElement("button", {
106
- className: classnames(ClassName.DRAG_HANDLE_BUTTON_CONTAINER, appearance, isDragAndDropEnabled && hasMergedCells && ClassName.DRAG_HANDLE_DISABLED),
106
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
107
+ className: classnames(ClassName.DRAG_HANDLE_BUTTON_CONTAINER, ClassName.CONTROLS_BUTTON, appearance, _defineProperty({}, ClassName.DRAG_HANDLE_DISABLED, isDragAndDropEnabled && hasMergedCells)),
107
108
  ref: dragHandleDivRef,
108
109
  style: {
109
110
  transform: direction === 'column' ? 'none' : 'rotate(90deg)',
@@ -112,9 +113,14 @@ export var DragHandle = function DragHandle(_ref) {
112
113
  "data-testid": "table-floating-column-controls-drag-handle",
113
114
  onMouseOver: onMouseOver,
114
115
  onMouseOut: onMouseOut,
115
- onMouseUp: onMouseUp,
116
+ onMouseUp: function onMouseUp(e) {
117
+ // return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
118
+ // -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
119
+ editorView.focus();
120
+ _onMouseUp && _onMouseUp(e);
121
+ },
116
122
  onClick: onClick
117
- }, /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(DragPreview, {
123
+ }, /*#__PURE__*/React.createElement(HandleIconComponent, handleIconProps)), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(DragPreview, {
118
124
  direction: direction,
119
125
  width: previewWidth,
120
126
  height: previewHeight
@@ -1,3 +1,5 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.26.1 */
2
+ import { ax, ix } from "@compiled/react/runtime";
1
3
  import React from 'react';
2
4
  import { Box, xcss } from '@atlaskit/primitives';
3
5
  import { DragInMotionIcon } from '../icons/DragInMotionIcon';
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import React from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  import { injectIntl } from 'react-intl-next';
5
3
  import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
6
4
  import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
@@ -44,7 +42,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
44
42
  return null;
45
43
  }
46
44
  var labelCellOptions = formatMessage(messages.cellOptions);
47
- var button = jsx("div", {
45
+ var button = /*#__PURE__*/React.createElement("div", {
48
46
  css: function css(theme) {
49
47
  return [tableFloatingCellButtonStyles({
50
48
  theme: theme
@@ -52,19 +50,19 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
52
50
  theme: theme
53
51
  })];
54
52
  }
55
- }, jsx(ToolbarButton, {
53
+ }, /*#__PURE__*/React.createElement(ToolbarButton, {
56
54
  className: ClassName.CONTEXTUAL_MENU_BUTTON,
57
55
  selected: isContextualMenuOpen,
58
56
  title: labelCellOptions,
59
57
  onClick: handleClick,
60
- iconBefore: jsx(ExpandIcon, {
58
+ iconBefore: /*#__PURE__*/React.createElement(ExpandIcon, {
61
59
  label: ""
62
60
  }),
63
61
  "aria-label": labelCellOptions
64
62
  }));
65
63
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
66
64
  if (stickyHeader && parentSticky && tableWrapper) {
67
- return jsx(FixedButton, {
65
+ return /*#__PURE__*/React.createElement(FixedButton, {
68
66
  offset: BUTTON_OFFSET,
69
67
  stickyHeader: stickyHeader,
70
68
  tableWrapper: tableWrapper,
@@ -74,7 +72,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
74
72
  isContextualMenuOpen: isContextualMenuOpen
75
73
  }, button);
76
74
  }
77
- return jsx(Popup, {
75
+ return /*#__PURE__*/React.createElement(Popup, {
78
76
  alignX: "right",
79
77
  alignY: "start",
80
78
  target: targetCellRef,
@@ -89,9 +87,9 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
89
87
  });
90
88
  var FloatingContextualButton = injectIntl(FloatingContextualButtonInner);
91
89
  export default function (props) {
92
- return jsx(ErrorBoundary, {
90
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
93
91
  component: ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON,
94
92
  dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
95
93
  fallbackComponent: null
96
- }, jsx(FloatingContextualButton, props));
94
+ }, /*#__PURE__*/React.createElement(FloatingContextualButton, props));
97
95
  }
@@ -9,9 +9,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
- /** @jsx jsx */
13
12
  import { Component } from 'react';
14
- import { jsx } from '@emotion/react';
15
13
  import { injectIntl } from 'react-intl-next';
16
14
  import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
17
15
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
@@ -82,15 +80,15 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
82
80
  value: {
83
81
  name: 'background'
84
82
  },
85
- elemAfter: jsx("div", {
83
+ elemAfter: /*#__PURE__*/React.createElement("div", {
86
84
  className: DropdownMenuSharedCssClassName.SUBMENU
87
- }, jsx("div", {
85
+ }, /*#__PURE__*/React.createElement("div", {
88
86
  css: cellColourPreviewStyles(background),
89
87
  className: ClassName.CONTEXTUAL_MENU_ICON
90
- }), isSubmenuOpen && jsx("div", {
88
+ }), isSubmenuOpen && /*#__PURE__*/React.createElement("div", {
91
89
  className: ClassName.CONTEXTUAL_SUBMENU,
92
90
  ref: _this.handleSubMenuRef
93
- }, jsx(ColorPalette, {
91
+ }, /*#__PURE__*/React.createElement(ColorPalette, {
94
92
  cols: 7,
95
93
  onClick: _this.setColor,
96
94
  selectedColor: background,
@@ -107,7 +105,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
107
105
  value: {
108
106
  name: 'insert_column'
109
107
  },
110
- elemAfter: jsx("div", {
108
+ elemAfter: /*#__PURE__*/React.createElement("div", {
111
109
  css: shortcutStyle
112
110
  }, tooltip(addColumnAfter))
113
111
  });
@@ -116,7 +114,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
116
114
  value: {
117
115
  name: 'insert_row'
118
116
  },
119
- elemAfter: jsx("div", {
117
+ elemAfter: /*#__PURE__*/React.createElement("div", {
120
118
  css: shortcutStyle
121
119
  }, tooltip(addRowAfter))
122
120
  });
@@ -196,7 +194,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
196
194
  value: {
197
195
  name: 'clear'
198
196
  },
199
- elemAfter: jsx("div", {
197
+ elemAfter: /*#__PURE__*/React.createElement("div", {
200
198
  css: shortcutStyle
201
199
  }, tooltip(backspace))
202
200
  });
@@ -358,10 +356,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
358
356
  if (!items) {
359
357
  return null;
360
358
  }
361
- return jsx("div", {
359
+ return /*#__PURE__*/React.createElement("div", {
362
360
  "data-testid": "table-cell-contextual-menu",
363
361
  onMouseLeave: this.closeSubmenu
364
- }, jsx(DropdownMenu, {
362
+ }, /*#__PURE__*/React.createElement(DropdownMenu, {
365
363
  mountTo: mountPoint
366
364
  //This needs be removed when the a11y is completely handled
367
365
  //Disabling key navigation now as it works only partially
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
1
  import { Popup } from '@atlaskit/editor-common/ui';
4
2
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
5
3
  import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
@@ -34,7 +32,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
34
32
  return null;
35
33
  }
36
34
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
37
- return jsx(Popup, {
35
+ return /*#__PURE__*/React.createElement(Popup, {
38
36
  alignX: "right",
39
37
  alignY: "top",
40
38
  target: targetCellRef,
@@ -50,9 +48,9 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
50
48
  forcePlacement: true,
51
49
  offset: [-7, 0],
52
50
  stick: true
53
- }, jsx("div", {
51
+ }, /*#__PURE__*/React.createElement("div", {
54
52
  css: tablePopupStyles
55
- }, jsx(ContextualMenu, {
53
+ }, /*#__PURE__*/React.createElement(ContextualMenu, {
56
54
  editorView: editorView,
57
55
  offset: [contextualMenuTriggerSize / 2, -contextualMenuTriggerSize],
58
56
  isOpen: isOpen,
@@ -1,6 +1,4 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- /** @jsx jsx */
3
- import { jsx } from '@emotion/react';
4
2
  import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
5
3
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
6
4
  import { TableMap } from '@atlaskit/editor-tables/table-map';
@@ -31,15 +29,15 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
31
29
  name: item.id
32
30
  },
33
31
  isDisabled: item.disabled,
34
- elemBefore: item.icon ? jsx("div", {
32
+ elemBefore: item.icon ? /*#__PURE__*/React.createElement("div", {
35
33
  style: {
36
34
  marginRight: "var(--ds-space-negative-075, -6px)",
37
35
  display: 'flex'
38
36
  }
39
- }, jsx(item.icon, {
37
+ }, /*#__PURE__*/React.createElement(item.icon, {
40
38
  label: item.title
41
39
  })) : undefined,
42
- elemAfter: item.keymap ? jsx("div", {
40
+ elemAfter: item.keymap ? /*#__PURE__*/React.createElement("div", {
43
41
  css: shortcutStyle
44
42
  }, item.keymap) : undefined
45
43
  });
@@ -131,7 +129,7 @@ export var DragMenu = function DragMenu(_ref) {
131
129
  if (!menuItems) {
132
130
  return null;
133
131
  }
134
- return jsx(DropdownMenu, {
132
+ return /*#__PURE__*/React.createElement(DropdownMenu, {
135
133
  mountTo: mountPoint
136
134
  //This needs be removed when the a11y is completely handled
137
135
  //Disabling key navigation now as it works only partially
@@ -89,14 +89,11 @@ export var TableFloatingColumnControls = function TableFloatingColumnControls(_r
89
89
  }
90
90
  return [0];
91
91
  }, [tableRef, tableRect.height]);
92
- if (!tableRef) {
92
+ if (!tableRef || !tableActive) {
93
93
  return null;
94
94
  }
95
95
  var colWidths = getColumnsWidths(editorView);
96
96
  var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
97
- if (!tableActive) {
98
- return null;
99
- }
100
97
  return /*#__PURE__*/React.createElement("div", {
101
98
  className: ClassName.DRAG_COLUMN_CONTROLS_WRAPPER,
102
99
  "data-testid": "table-floating-column-controls-wrapper"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "5.4.11",
3
+ "version": "5.4.12",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,8 +27,8 @@
27
27
  "releaseModel": "continuous"
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/adf-schema": "^34.0.1",
31
- "@atlaskit/custom-steps": "^0.0.5",
30
+ "@atlaskit/adf-schema": "^35.0.0",
31
+ "@atlaskit/custom-steps": "^0.0.6",
32
32
  "@atlaskit/editor-common": "^76.24.0",
33
33
  "@atlaskit/editor-palette": "1.5.2",
34
34
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
@@ -134,26 +134,35 @@ export const DragHandle = ({
134
134
  ]);
135
135
 
136
136
  return (
137
- <button
138
- className={classnames(
139
- ClassName.DRAG_HANDLE_BUTTON_CONTAINER,
140
- appearance,
141
- isDragAndDropEnabled &&
142
- hasMergedCells &&
143
- ClassName.DRAG_HANDLE_DISABLED,
144
- )}
145
- ref={dragHandleDivRef}
146
- style={{
147
- transform: direction === 'column' ? 'none' : 'rotate(90deg)',
148
- pointerEvents: 'auto',
149
- }}
150
- data-testid="table-floating-column-controls-drag-handle"
151
- onMouseOver={onMouseOver}
152
- onMouseOut={onMouseOut}
153
- onMouseUp={onMouseUp}
154
- onClick={onClick}
155
- >
156
- <HandleIconComponent {...handleIconProps} />
137
+ <>
138
+ <button
139
+ className={classnames(
140
+ ClassName.DRAG_HANDLE_BUTTON_CONTAINER,
141
+ ClassName.CONTROLS_BUTTON,
142
+ appearance,
143
+ {
144
+ [ClassName.DRAG_HANDLE_DISABLED]:
145
+ isDragAndDropEnabled && hasMergedCells,
146
+ },
147
+ )}
148
+ ref={dragHandleDivRef}
149
+ style={{
150
+ transform: direction === 'column' ? 'none' : 'rotate(90deg)',
151
+ pointerEvents: 'auto',
152
+ }}
153
+ data-testid="table-floating-column-controls-drag-handle"
154
+ onMouseOver={onMouseOver}
155
+ onMouseOut={onMouseOut}
156
+ onMouseUp={(e) => {
157
+ // return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
158
+ // -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
159
+ editorView.focus();
160
+ onMouseUp && onMouseUp(e);
161
+ }}
162
+ onClick={onClick}
163
+ >
164
+ <HandleIconComponent {...handleIconProps} />
165
+ </button>
157
166
  {previewContainer &&
158
167
  previewWidth !== undefined &&
159
168
  previewHeight !== undefined &&
@@ -165,6 +174,6 @@ export const DragHandle = ({
165
174
  />,
166
175
  previewContainer,
167
176
  )}
168
- </button>
177
+ </>
169
178
  );
170
179
  };
@@ -108,7 +108,7 @@ export const TableFloatingColumnControls: React.FC<Props> = ({
108
108
  return [0];
109
109
  }, [tableRef, tableRect.height]);
110
110
 
111
- if (!tableRef) {
111
+ if (!tableRef || !tableActive) {
112
112
  return null;
113
113
  }
114
114
 
@@ -119,10 +119,6 @@ export const TableFloatingColumnControls: React.FC<Props> = ({
119
119
  ? stickyHeader.top
120
120
  : undefined;
121
121
 
122
- if (!tableActive) {
123
- return null;
124
- }
125
-
126
122
  return (
127
123
  <div
128
124
  className={ClassName.DRAG_COLUMN_CONTROLS_WRAPPER}