@atlaskit/editor-common 74.7.5 → 74.7.7

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 (83) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/monitoring/error.js +1 -1
  3. package/dist/cjs/resizer/Resizer.js +35 -21
  4. package/dist/cjs/ui/DropList/index.js +1 -1
  5. package/dist/cjs/ui/Expand/index.js +2 -2
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/monitoring/error.js +1 -1
  8. package/dist/es2019/resizer/Resizer.js +27 -25
  9. package/dist/es2019/ui/DropList/index.js +1 -1
  10. package/dist/es2019/ui/Expand/index.js +2 -2
  11. package/dist/es2019/version.json +1 -1
  12. package/dist/esm/monitoring/error.js +1 -1
  13. package/dist/esm/resizer/Resizer.js +32 -21
  14. package/dist/esm/ui/DropList/index.js +1 -1
  15. package/dist/esm/ui/Expand/index.js +2 -2
  16. package/dist/esm/version.json +1 -1
  17. package/dist/types/analytics/utils.d.ts +2 -2
  18. package/dist/types/card/utils.d.ts +2 -2
  19. package/dist/types/core-utils/inside.d.ts +1 -1
  20. package/dist/types/event-dispatcher/index.d.ts +1 -1
  21. package/dist/types/provider-factory/card-provider.d.ts +1 -1
  22. package/dist/types/provider-factory/quick-insert-provider.d.ts +3 -3
  23. package/dist/types/resizer/Resizer.d.ts +3 -7
  24. package/dist/types/resizer/index.d.ts +1 -1
  25. package/dist/types/resizer/types.d.ts +6 -7
  26. package/dist/types/safe-plugin/index.d.ts +1 -1
  27. package/dist/types/selection/types.d.ts +2 -2
  28. package/dist/types/transforms/expand.d.ts +1 -1
  29. package/dist/types/types/annotation/index.d.ts +2 -2
  30. package/dist/types/types/command.d.ts +2 -2
  31. package/dist/types/types/copy-button.d.ts +3 -3
  32. package/dist/types/types/editor-actions.d.ts +4 -4
  33. package/dist/types/types/floating-toolbar.d.ts +1 -1
  34. package/dist/types/types/type-ahead.d.ts +1 -1
  35. package/dist/types/ui/MediaSingle/grid.d.ts +1 -1
  36. package/dist/types/utils/collab.d.ts +1 -1
  37. package/dist/types/utils/document.d.ts +3 -3
  38. package/dist/types/utils/filter/privacy-filter.d.ts +2 -2
  39. package/dist/types/utils/get-performance-options.d.ts +1 -1
  40. package/dist/types/utils/is-text-input.d.ts +1 -1
  41. package/dist/types/utils/nodes.d.ts +3 -3
  42. package/dist/types/utils/plugin-state-factory.d.ts +1 -1
  43. package/dist/types/utils/referentiality.d.ts +1 -1
  44. package/dist/types/utils/table.d.ts +1 -1
  45. package/dist/types/utils/track-unsupported-content.d.ts +2 -2
  46. package/dist/types/utils/validate-using-spec.d.ts +2 -2
  47. package/dist/types/utils/validator.d.ts +1 -1
  48. package/dist/types/with-plugin-state/index.d.ts +1 -1
  49. package/dist/types/with-plugin-state/types.d.ts +1 -1
  50. package/dist/types-ts4.5/analytics/utils.d.ts +2 -2
  51. package/dist/types-ts4.5/card/utils.d.ts +2 -2
  52. package/dist/types-ts4.5/core-utils/inside.d.ts +1 -1
  53. package/dist/types-ts4.5/event-dispatcher/index.d.ts +1 -1
  54. package/dist/types-ts4.5/provider-factory/card-provider.d.ts +1 -1
  55. package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +3 -3
  56. package/dist/types-ts4.5/resizer/Resizer.d.ts +3 -7
  57. package/dist/types-ts4.5/resizer/index.d.ts +1 -1
  58. package/dist/types-ts4.5/resizer/types.d.ts +6 -7
  59. package/dist/types-ts4.5/safe-plugin/index.d.ts +1 -1
  60. package/dist/types-ts4.5/selection/types.d.ts +2 -2
  61. package/dist/types-ts4.5/transforms/expand.d.ts +1 -1
  62. package/dist/types-ts4.5/types/annotation/index.d.ts +2 -2
  63. package/dist/types-ts4.5/types/command.d.ts +2 -2
  64. package/dist/types-ts4.5/types/copy-button.d.ts +3 -3
  65. package/dist/types-ts4.5/types/editor-actions.d.ts +4 -4
  66. package/dist/types-ts4.5/types/floating-toolbar.d.ts +1 -1
  67. package/dist/types-ts4.5/types/type-ahead.d.ts +1 -1
  68. package/dist/types-ts4.5/ui/MediaSingle/grid.d.ts +1 -1
  69. package/dist/types-ts4.5/utils/collab.d.ts +1 -1
  70. package/dist/types-ts4.5/utils/document.d.ts +3 -3
  71. package/dist/types-ts4.5/utils/filter/privacy-filter.d.ts +2 -2
  72. package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -1
  73. package/dist/types-ts4.5/utils/is-text-input.d.ts +1 -1
  74. package/dist/types-ts4.5/utils/nodes.d.ts +3 -3
  75. package/dist/types-ts4.5/utils/plugin-state-factory.d.ts +1 -1
  76. package/dist/types-ts4.5/utils/referentiality.d.ts +1 -1
  77. package/dist/types-ts4.5/utils/table.d.ts +1 -1
  78. package/dist/types-ts4.5/utils/track-unsupported-content.d.ts +2 -2
  79. package/dist/types-ts4.5/utils/validate-using-spec.d.ts +2 -2
  80. package/dist/types-ts4.5/utils/validator.d.ts +1 -1
  81. package/dist/types-ts4.5/with-plugin-state/index.d.ts +1 -1
  82. package/dist/types-ts4.5/with-plugin-state/types.d.ts +1 -1
  83. package/package.json +4 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.7.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8493df1e169`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8493df1e169) - NO-ISSUE Moved some purely type dependencies to dev dependencies
8
+
9
+ ## 74.7.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`0edc12510fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0edc12510fb) - Updating types, examples and general clean up of Resizer component
14
+
3
15
  ## 74.7.5
4
16
 
5
17
  ### Patch Changes
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  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; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "74.7.5";
19
+ var packageVersion = "74.7.7";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -1,30 +1,49 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = ResizerNext;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+ var _react = _interopRequireWildcard(require("react"));
10
14
  var _classnames3 = _interopRequireDefault(require("classnames"));
11
15
  var _reResizable = require("re-resizable");
12
16
  var _resizer = require("../styles/shared/resizer");
17
+ var _excluded = ["width", "children", "handleClassName", "className", "handleResize", "handleResizeStart", "handleResizeStop", "handleHeightSize", "handleAlignmentMethod", "resizeRatio", "innerPadding"];
18
+ 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); }
19
+ 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; }
13
20
  function ResizerNext(props) {
14
21
  var _classnames, _classnames2;
15
- var resizable = _react.default.useRef(null);
16
- var handleResize = props.handleResize,
22
+ var _useState = (0, _react.useState)(false),
23
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
24
+ isResizing = _useState2[0],
25
+ setIsResizing = _useState2[1];
26
+ var resizable = (0, _react.useRef)(null);
27
+ var width = props.width,
28
+ children = props.children,
29
+ handleClassName = props.handleClassName,
30
+ className = props.className,
31
+ handleResize = props.handleResize,
17
32
  handleResizeStart = props.handleResizeStart,
18
33
  handleResizeStop = props.handleResizeStop,
19
- _props$handlerHeightS = props.handlerHeightSize,
20
- handlerHeightSize = _props$handlerHeightS === void 0 ? 'medium' : _props$handlerHeightS,
34
+ _props$handleHeightSi = props.handleHeightSize,
35
+ handleHeightSize = _props$handleHeightSi === void 0 ? 'medium' : _props$handleHeightSi,
21
36
  _props$handleAlignmen = props.handleAlignmentMethod,
22
37
  handleAlignmentMethod = _props$handleAlignmen === void 0 ? 'center' : _props$handleAlignmen,
23
38
  _props$resizeRatio = props.resizeRatio,
24
- resizeRatio = _props$resizeRatio === void 0 ? 1 : _props$resizeRatio;
39
+ resizeRatio = _props$resizeRatio === void 0 ? 1 : _props$resizeRatio,
40
+ _props$innerPadding = props.innerPadding,
41
+ innerPadding = _props$innerPadding === void 0 ? _resizer.resizerHandlePadding : _props$innerPadding,
42
+ otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
25
43
  var onResizeStart = _react.default.useCallback(function (event) {
26
44
  // prevent creating a drag event on Firefox
27
45
  event.preventDefault();
46
+ setIsResizing(true);
28
47
  handleResizeStart();
29
48
  }, [handleResizeStart]);
30
49
  var onResize = _react.default.useCallback(function (_event, _direction, _elementRef, delta) {
@@ -51,13 +70,13 @@ function ResizerNext(props) {
51
70
  width: resizableCurrent.state.original.width,
52
71
  height: resizableCurrent.state.original.height
53
72
  };
73
+ setIsResizing(false);
54
74
  handleResizeStop(originalState, delta);
55
75
  }, [handleResizeStop]);
56
76
  var handles = {
57
- left: (0, _classnames3.default)((_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(props.handleClassName, "-left"), !!props.handleClassName), (0, _defineProperty2.default)(_classnames, _resizer.resizerHandleLeftClassName, !props.handleClassName), (0, _defineProperty2.default)(_classnames, _resizer.resizerHandlerClassName[handlerHeightSize], true), (0, _defineProperty2.default)(_classnames, _resizer.resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames)),
58
- right: (0, _classnames3.default)((_classnames2 = {}, (0, _defineProperty2.default)(_classnames2, "".concat(props.handleClassName, "-right"), !!props.handleClassName), (0, _defineProperty2.default)(_classnames2, _resizer.resizerHandleRightClassName, !props.handleClassName), (0, _defineProperty2.default)(_classnames2, _resizer.resizerHandlerClassName[handlerHeightSize], true), (0, _defineProperty2.default)(_classnames2, _resizer.resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames2))
77
+ left: (0, _classnames3.default)(_resizer.resizerHandlerClassName[handleHeightSize], (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(handleClassName, "-left"), !!handleClassName), (0, _defineProperty2.default)(_classnames, _resizer.resizerHandleLeftClassName, !handleClassName), (0, _defineProperty2.default)(_classnames, _resizer.resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames)),
78
+ right: (0, _classnames3.default)(_resizer.resizerHandlerClassName[handleHeightSize], (_classnames2 = {}, (0, _defineProperty2.default)(_classnames2, "".concat(handleClassName, "-right"), !!handleClassName), (0, _defineProperty2.default)(_classnames2, _resizer.resizerHandleRightClassName, !handleClassName), (0, _defineProperty2.default)(_classnames2, _resizer.resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames2))
59
79
  };
60
- var innerPadding = props.innerPadding || _resizer.resizerHandlePadding;
61
80
  var handleStyles = {
62
81
  left: {
63
82
  width: '24px',
@@ -72,27 +91,22 @@ function ResizerNext(props) {
72
91
  pointerEvents: 'auto'
73
92
  }
74
93
  };
75
- var className = (0, _classnames3.default)(props.className, _resizer.resizerItemClassName);
76
- return /*#__PURE__*/_react.default.createElement(_reResizable.Resizable, {
94
+ var resizerClassName = (0, _classnames3.default)(className, _resizer.resizerItemClassName, {
95
+ 'is-resizing': isResizing
96
+ });
97
+ return /*#__PURE__*/_react.default.createElement(_reResizable.Resizable, (0, _extends2.default)({
77
98
  ref: resizable,
78
99
  size: {
79
- width: props.width,
100
+ width: width,
80
101
  // just content itself (no paddings)
81
102
  height: 'auto'
82
103
  },
83
- maxWidth: props.maxWidth,
84
- minWidth: props.minWidth,
85
- className: className,
86
- enable: props.enable,
104
+ className: resizerClassName,
87
105
  handleClasses: handles,
88
106
  handleStyles: handleStyles,
89
- handleWrapperStyle: props.handleWrapperStyle // is used to override the style of resize handles wrapper, needed for media when it is selected and caption appears makes sure the handlers won't jump.
90
- ,
91
- handleComponent: props.handleComponent // in media was added as a workaround to fix Up arrow key bug when media has caption and the cursor is place below the image. Our epic has a separate ticket to address this problem.
92
- ,
93
107
  onResizeStart: onResizeStart,
94
108
  onResize: onResize,
95
109
  onResizeStop: onResizeStop,
96
110
  resizeRatio: resizeRatio
97
- }, props.children);
111
+ }, otherProps), children);
98
112
  }
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  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); }; }
25
25
  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 */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "74.7.5";
27
+ var packageVersion = "74.7.7";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -45,7 +45,7 @@ var messages = (0, _reactIntlNext.defineMessages)({
45
45
  }
46
46
  });
47
47
  exports.messages = messages;
48
- var BORDER_RADIUS = "var(--ds-radius-100, 4px)";
48
+ var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
49
49
  var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
50
50
  var EXPAND_SELECTED_BACKGROUND = (0, _components.themed)({
51
51
  light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
@@ -71,7 +71,7 @@ var expandIconWrapperStyle = function expandIconWrapperStyle(props) {
71
71
  return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", ";\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), (0, _components.themed)({
72
72
  light: "var(--ds-icon, ".concat(colors.N90, ")"),
73
73
  dark: "var(--ds-icon, #d9dde3)"
74
- })(props), "var(--ds-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), _editorSharedStyles.akEditorSwoopCubicBezier);
74
+ })(props), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), _editorSharedStyles.akEditorSwoopCubicBezier);
75
75
  };
76
76
  var expandIconWrapperExpandedStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n svg {\n transform: rotate(90deg);\n }\n"])));
77
77
  var expandLayoutWrapperStyle = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.5",
3
+ "version": "74.7.7",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "74.7.5";
3
+ const packageVersion = "74.7.7";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -1,20 +1,29 @@
1
- import React from 'react';
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useRef, useState } from 'react';
2
3
  import classnames from 'classnames';
3
4
  import { Resizable } from 're-resizable';
4
5
  import { resizerHandleLeftClassName, resizerHandlePadding, resizerHandlerClassName, resizerHandleRightClassName, resizerHandleStickyClassName, resizerHandleZIndex, resizerItemClassName } from '../styles/shared/resizer';
5
6
  export default function ResizerNext(props) {
6
- const resizable = React.useRef(null);
7
+ const [isResizing, setIsResizing] = useState(false);
8
+ const resizable = useRef(null);
7
9
  const {
10
+ width,
11
+ children,
12
+ handleClassName,
13
+ className,
8
14
  handleResize,
9
15
  handleResizeStart,
10
16
  handleResizeStop,
11
- handlerHeightSize = 'medium',
17
+ handleHeightSize = 'medium',
12
18
  handleAlignmentMethod = 'center',
13
- resizeRatio = 1
19
+ resizeRatio = 1,
20
+ innerPadding = resizerHandlePadding,
21
+ ...otherProps
14
22
  } = props;
15
23
  const onResizeStart = React.useCallback(event => {
16
24
  // prevent creating a drag event on Firefox
17
25
  event.preventDefault();
26
+ setIsResizing(true);
18
27
  handleResizeStart();
19
28
  }, [handleResizeStart]);
20
29
  const onResize = React.useCallback((_event, _direction, _elementRef, delta) => {
@@ -41,23 +50,21 @@ export default function ResizerNext(props) {
41
50
  width: resizableCurrent.state.original.width,
42
51
  height: resizableCurrent.state.original.height
43
52
  };
53
+ setIsResizing(false);
44
54
  handleResizeStop(originalState, delta);
45
55
  }, [handleResizeStop]);
46
56
  const handles = {
47
- left: classnames({
48
- [`${props.handleClassName}-left`]: !!props.handleClassName,
49
- [resizerHandleLeftClassName]: !props.handleClassName,
50
- [resizerHandlerClassName[handlerHeightSize]]: true,
57
+ left: classnames(resizerHandlerClassName[handleHeightSize], {
58
+ [`${handleClassName}-left`]: !!handleClassName,
59
+ [resizerHandleLeftClassName]: !handleClassName,
51
60
  [resizerHandleStickyClassName]: handleAlignmentMethod === 'sticky'
52
61
  }),
53
- right: classnames({
54
- [`${props.handleClassName}-right`]: !!props.handleClassName,
55
- [resizerHandleRightClassName]: !props.handleClassName,
56
- [resizerHandlerClassName[handlerHeightSize]]: true,
62
+ right: classnames(resizerHandlerClassName[handleHeightSize], {
63
+ [`${handleClassName}-right`]: !!handleClassName,
64
+ [resizerHandleRightClassName]: !handleClassName,
57
65
  [resizerHandleStickyClassName]: handleAlignmentMethod === 'sticky'
58
66
  })
59
67
  };
60
- const innerPadding = props.innerPadding || resizerHandlePadding;
61
68
  const handleStyles = {
62
69
  left: {
63
70
  width: '24px',
@@ -72,27 +79,22 @@ export default function ResizerNext(props) {
72
79
  pointerEvents: 'auto'
73
80
  }
74
81
  };
75
- const className = classnames(props.className, resizerItemClassName);
76
- return /*#__PURE__*/React.createElement(Resizable, {
82
+ const resizerClassName = classnames(className, resizerItemClassName, {
83
+ 'is-resizing': isResizing
84
+ });
85
+ return /*#__PURE__*/React.createElement(Resizable, _extends({
77
86
  ref: resizable,
78
87
  size: {
79
- width: props.width,
88
+ width,
80
89
  // just content itself (no paddings)
81
90
  height: 'auto'
82
91
  },
83
- maxWidth: props.maxWidth,
84
- minWidth: props.minWidth,
85
- className: className,
86
- enable: props.enable,
92
+ className: resizerClassName,
87
93
  handleClasses: handles,
88
94
  handleStyles: handleStyles,
89
- handleWrapperStyle: props.handleWrapperStyle // is used to override the style of resize handles wrapper, needed for media when it is selected and caption appears makes sure the handlers won't jump.
90
- ,
91
- handleComponent: props.handleComponent // in media was added as a workaround to fix Up arrow key bug when media has caption and the cursor is place below the image. Our epic has a separate ticket to address this problem.
92
- ,
93
95
  onResizeStart: onResizeStart,
94
96
  onResize: onResize,
95
97
  onResizeStop: onResizeStop,
96
98
  resizeRatio: resizeRatio
97
- }, props.children);
99
+ }, otherProps), children);
98
100
  }
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  import { borderRadius } from '@atlaskit/theme/constants';
9
9
  import Layer from '../Layer';
10
10
  const packageName = "@atlaskit/editor-common";
11
- const packageVersion = "74.7.5";
11
+ const packageVersion = "74.7.7";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -30,7 +30,7 @@ export const messages = defineMessages({
30
30
  description: 'Placeholder text for an expand node title input field'
31
31
  }
32
32
  });
33
- const BORDER_RADIUS = "var(--ds-radius-100, 4px)";
33
+ const BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
34
34
  const EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
35
35
  const EXPAND_SELECTED_BACKGROUND = themed({
36
36
  light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
@@ -57,7 +57,7 @@ const expandIconWrapperStyle = props => css`
57
57
  light: `var(--ds-icon, ${colors.N90})`,
58
58
  dark: "var(--ds-icon, #d9dde3)"
59
59
  })(props)};
60
- border-radius: ${"var(--ds-radius-100, 4px)"};
60
+ border-radius: ${"var(--ds-border-radius-100, 4px)"};
61
61
  width: 24px;
62
62
  height: 24px;
63
63
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.5",
3
+ "version": "74.7.7",
4
4
  "sideEffects": false
5
5
  }
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.7.5";
9
+ var packageVersion = "74.7.7";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -1,23 +1,39 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
+ var _excluded = ["width", "children", "handleClassName", "className", "handleResize", "handleResizeStart", "handleResizeStop", "handleHeightSize", "handleAlignmentMethod", "resizeRatio", "innerPadding"];
6
+ import React, { useRef, useState } from 'react';
3
7
  import classnames from 'classnames';
4
8
  import { Resizable } from 're-resizable';
5
9
  import { resizerHandleLeftClassName, resizerHandlePadding, resizerHandlerClassName, resizerHandleRightClassName, resizerHandleStickyClassName, resizerHandleZIndex, resizerItemClassName } from '../styles/shared/resizer';
6
10
  export default function ResizerNext(props) {
7
11
  var _classnames, _classnames2;
8
- var resizable = React.useRef(null);
9
- var handleResize = props.handleResize,
12
+ var _useState = useState(false),
13
+ _useState2 = _slicedToArray(_useState, 2),
14
+ isResizing = _useState2[0],
15
+ setIsResizing = _useState2[1];
16
+ var resizable = useRef(null);
17
+ var width = props.width,
18
+ children = props.children,
19
+ handleClassName = props.handleClassName,
20
+ className = props.className,
21
+ handleResize = props.handleResize,
10
22
  handleResizeStart = props.handleResizeStart,
11
23
  handleResizeStop = props.handleResizeStop,
12
- _props$handlerHeightS = props.handlerHeightSize,
13
- handlerHeightSize = _props$handlerHeightS === void 0 ? 'medium' : _props$handlerHeightS,
24
+ _props$handleHeightSi = props.handleHeightSize,
25
+ handleHeightSize = _props$handleHeightSi === void 0 ? 'medium' : _props$handleHeightSi,
14
26
  _props$handleAlignmen = props.handleAlignmentMethod,
15
27
  handleAlignmentMethod = _props$handleAlignmen === void 0 ? 'center' : _props$handleAlignmen,
16
28
  _props$resizeRatio = props.resizeRatio,
17
- resizeRatio = _props$resizeRatio === void 0 ? 1 : _props$resizeRatio;
29
+ resizeRatio = _props$resizeRatio === void 0 ? 1 : _props$resizeRatio,
30
+ _props$innerPadding = props.innerPadding,
31
+ innerPadding = _props$innerPadding === void 0 ? resizerHandlePadding : _props$innerPadding,
32
+ otherProps = _objectWithoutProperties(props, _excluded);
18
33
  var onResizeStart = React.useCallback(function (event) {
19
34
  // prevent creating a drag event on Firefox
20
35
  event.preventDefault();
36
+ setIsResizing(true);
21
37
  handleResizeStart();
22
38
  }, [handleResizeStart]);
23
39
  var onResize = React.useCallback(function (_event, _direction, _elementRef, delta) {
@@ -44,13 +60,13 @@ export default function ResizerNext(props) {
44
60
  width: resizableCurrent.state.original.width,
45
61
  height: resizableCurrent.state.original.height
46
62
  };
63
+ setIsResizing(false);
47
64
  handleResizeStop(originalState, delta);
48
65
  }, [handleResizeStop]);
49
66
  var handles = {
50
- left: classnames((_classnames = {}, _defineProperty(_classnames, "".concat(props.handleClassName, "-left"), !!props.handleClassName), _defineProperty(_classnames, resizerHandleLeftClassName, !props.handleClassName), _defineProperty(_classnames, resizerHandlerClassName[handlerHeightSize], true), _defineProperty(_classnames, resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames)),
51
- right: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(props.handleClassName, "-right"), !!props.handleClassName), _defineProperty(_classnames2, resizerHandleRightClassName, !props.handleClassName), _defineProperty(_classnames2, resizerHandlerClassName[handlerHeightSize], true), _defineProperty(_classnames2, resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames2))
67
+ left: classnames(resizerHandlerClassName[handleHeightSize], (_classnames = {}, _defineProperty(_classnames, "".concat(handleClassName, "-left"), !!handleClassName), _defineProperty(_classnames, resizerHandleLeftClassName, !handleClassName), _defineProperty(_classnames, resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames)),
68
+ right: classnames(resizerHandlerClassName[handleHeightSize], (_classnames2 = {}, _defineProperty(_classnames2, "".concat(handleClassName, "-right"), !!handleClassName), _defineProperty(_classnames2, resizerHandleRightClassName, !handleClassName), _defineProperty(_classnames2, resizerHandleStickyClassName, handleAlignmentMethod === 'sticky'), _classnames2))
52
69
  };
53
- var innerPadding = props.innerPadding || resizerHandlePadding;
54
70
  var handleStyles = {
55
71
  left: {
56
72
  width: '24px',
@@ -65,27 +81,22 @@ export default function ResizerNext(props) {
65
81
  pointerEvents: 'auto'
66
82
  }
67
83
  };
68
- var className = classnames(props.className, resizerItemClassName);
69
- return /*#__PURE__*/React.createElement(Resizable, {
84
+ var resizerClassName = classnames(className, resizerItemClassName, {
85
+ 'is-resizing': isResizing
86
+ });
87
+ return /*#__PURE__*/React.createElement(Resizable, _extends({
70
88
  ref: resizable,
71
89
  size: {
72
- width: props.width,
90
+ width: width,
73
91
  // just content itself (no paddings)
74
92
  height: 'auto'
75
93
  },
76
- maxWidth: props.maxWidth,
77
- minWidth: props.minWidth,
78
- className: className,
79
- enable: props.enable,
94
+ className: resizerClassName,
80
95
  handleClasses: handles,
81
96
  handleStyles: handleStyles,
82
- handleWrapperStyle: props.handleWrapperStyle // is used to override the style of resize handles wrapper, needed for media when it is selected and caption appears makes sure the handlers won't jump.
83
- ,
84
- handleComponent: props.handleComponent // in media was added as a workaround to fix Up arrow key bug when media has caption and the cursor is place below the image. Our epic has a separate ticket to address this problem.
85
- ,
86
97
  onResizeStart: onResizeStart,
87
98
  onResize: onResize,
88
99
  onResizeStop: onResizeStop,
89
100
  resizeRatio: resizeRatio
90
- }, props.children);
101
+ }, otherProps), children);
91
102
  }
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.7.5";
21
+ var packageVersion = "74.7.7";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -34,7 +34,7 @@ export var messages = defineMessages({
34
34
  description: 'Placeholder text for an expand node title input field'
35
35
  }
36
36
  });
37
- var BORDER_RADIUS = "var(--ds-radius-100, 4px)";
37
+ var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
38
38
  var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
39
39
  var EXPAND_SELECTED_BACKGROUND = themed({
40
40
  light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
@@ -59,7 +59,7 @@ var expandIconWrapperStyle = function expandIconWrapperStyle(props) {
59
59
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", ";\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), themed({
60
60
  light: "var(--ds-icon, ".concat(colors.N90, ")"),
61
61
  dark: "var(--ds-icon, #d9dde3)"
62
- })(props), "var(--ds-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), akEditorSwoopCubicBezier);
62
+ })(props), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), akEditorSwoopCubicBezier);
63
63
  };
64
64
  var expandIconWrapperExpandedStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n svg {\n transform: rotate(90deg);\n }\n"])));
65
65
  export var expandLayoutWrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.7.5",
3
+ "version": "74.7.7",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,3 @@
1
- import { ReadonlyTransaction, Transaction } from 'prosemirror-state';
2
- import { AnalyticsEventPayloadWithChannel } from './types';
1
+ import type { ReadonlyTransaction, Transaction } from 'prosemirror-state';
2
+ import type { AnalyticsEventPayloadWithChannel } from './types';
3
3
  export declare function getAnalyticsEventsFromTransaction(tr: Transaction | ReadonlyTransaction): AnalyticsEventPayloadWithChannel[];
@@ -1,5 +1,5 @@
1
- import { EditorState, ReadonlyTransaction, Selection, Transaction } from 'prosemirror-state';
2
- import { EditorView } from 'prosemirror-view';
1
+ import type { EditorState, ReadonlyTransaction, Selection, Transaction } from 'prosemirror-state';
2
+ import type { EditorView } from 'prosemirror-view';
3
3
  import { LinkStepMetadata } from '@atlaskit/adf-schema/steps';
4
4
  /**
5
5
  * Records metadata about the user action and input method relating to a transaction
@@ -1,2 +1,2 @@
1
- import { EditorState } from 'prosemirror-state';
1
+ import type { EditorState } from 'prosemirror-state';
2
2
  export declare const insideTable: (state: EditorState) => Boolean;
@@ -1,4 +1,4 @@
1
- import { PluginKey } from 'prosemirror-state';
1
+ import type { PluginKey } from 'prosemirror-state';
2
2
  export interface Listeners {
3
3
  [name: string]: Set<Listener>;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { CardAdf } from '@atlaskit/smart-card';
1
+ import type { CardAdf } from '@atlaskit/smart-card';
2
2
  export type CardAppearance = 'inline' | 'block' | 'embed';
3
3
  export type { CardAdf };
4
4
  export interface CardProvider {
@@ -1,6 +1,6 @@
1
- import { Node } from 'prosemirror-model';
2
- import { EditorState, Transaction } from 'prosemirror-state';
3
- import { TypeAheadItem } from '../types/type-ahead';
1
+ import type { Node } from 'prosemirror-model';
2
+ import type { EditorState, Transaction } from 'prosemirror-state';
3
+ import type { TypeAheadItem } from '../types/type-ahead';
4
4
  export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
5
5
  selectInlineNode?: boolean;
6
6
  }) => Transaction;
@@ -1,14 +1,10 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { HandleComponent } from 're-resizable';
3
- import { EnabledHandles, HandleAlignmentMethod, HandleResize, HandlerHeightSizeType } from './types';
4
- export interface ResizableNumberSize {
5
- width: number;
6
- height: number;
7
- }
3
+ import { EnabledHandles, HandleAlignmentMethod, HandleHeightSizeType, HandleResize } from './types';
8
4
  export type ResizerProps = {
9
5
  enable: EnabledHandles;
10
6
  width: number;
11
- handleResizeStart: () => number;
7
+ handleResizeStart: () => void;
12
8
  handleResize: HandleResize;
13
9
  handleResizeStop: HandleResize;
14
10
  innerPadding?: number;
@@ -18,7 +14,7 @@ export type ResizerProps = {
18
14
  maxWidth?: number;
19
15
  handleWrapperStyle?: React.CSSProperties;
20
16
  handleComponent?: HandleComponent;
21
- handlerHeightSize?: HandlerHeightSizeType;
17
+ handleHeightSize?: HandleHeightSizeType;
22
18
  handleAlignmentMethod?: HandleAlignmentMethod;
23
19
  resizeRatio?: number;
24
20
  };
@@ -1,2 +1,2 @@
1
1
  export { default as ResizerNext } from './Resizer';
2
- export type { HandlerHeightSizeType, EnabledHandles } from './types';
2
+ export type { HandleHeightSizeType, EnabledHandles, HandleResize, } from './types';
@@ -3,18 +3,17 @@ export type EnabledHandles = {
3
3
  left?: boolean;
4
4
  right?: boolean;
5
5
  };
6
+ export type Dimensions = {
7
+ width: number;
8
+ height: number;
9
+ };
6
10
  export type HandleResize = (newWidth: {
7
11
  x: number;
8
12
  y: number;
9
- width: number;
10
- height: number;
11
- }, delta: {
12
- width: number;
13
- height: number;
14
- }) => number;
13
+ } & Dimensions, delta: Dimensions) => void;
15
14
  export type HandleStyles = {
16
15
  right?: React.CSSProperties;
17
16
  left?: React.CSSProperties;
18
17
  };
19
- export type HandlerHeightSizeType = 'small' | 'medium' | 'large';
18
+ export type HandleHeightSizeType = 'small' | 'medium' | 'large';
20
19
  export type HandleAlignmentMethod = 'center' | 'sticky';
@@ -1,4 +1,4 @@
1
- import { Schema } from 'prosemirror-model';
1
+ import type { Schema } from 'prosemirror-model';
2
2
  import { Plugin, SafePluginSpec } from 'prosemirror-state';
3
3
  export declare class SafePlugin<T = any, S extends Schema = any> extends Plugin {
4
4
  _isATypeSafePlugin: never;
@@ -1,5 +1,5 @@
1
- import { EditorState, Selection, Transaction } from 'prosemirror-state';
2
- import { DecorationSet } from 'prosemirror-view';
1
+ import type { EditorState, Selection, Transaction } from 'prosemirror-state';
2
+ import type { DecorationSet } from 'prosemirror-view';
3
3
  export declare enum RelativeSelectionPos {
4
4
  Before = "Before",
5
5
  Start = "Start",
@@ -1,5 +1,5 @@
1
1
  import { Schema, Slice } from 'prosemirror-model';
2
- import { EditorState, Selection } from 'prosemirror-state';
2
+ import type { EditorState, Selection } from 'prosemirror-state';
3
3
  export declare const findExpand: (state: EditorState, selection?: Selection<any> | null) => import("prosemirror-utils").ContentNodeWithPos | undefined;
4
4
  export declare const transformSliceToRemoveOpenExpand: (slice: Slice, schema: Schema) => Slice;
5
5
  export declare const transformSliceNestedExpandToExpand: (slice: Slice, schema: Schema) => Slice;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { Step } from 'prosemirror-transform';
2
+ import type { Step } from 'prosemirror-transform';
3
3
  import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
4
- import { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
+ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
5
5
  import { AnnotationState, AnnotationUpdateEmitter, AnnotationUpdateEvent, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
6
6
  export type { AnnotationState };
7
7
  export type AnnotationByMatches = {
@@ -1,5 +1,5 @@
1
- import { EditorState, Transaction } from 'prosemirror-state';
2
- import { EditorView } from 'prosemirror-view';
1
+ import type { EditorState, Transaction } from 'prosemirror-state';
2
+ import type { EditorView } from 'prosemirror-view';
3
3
  export type CommandDispatch = (tr: Transaction) => void;
4
4
  export type Command = (state: EditorState, dispatch?: CommandDispatch, view?: EditorView) => boolean;
5
5
  export type HigherOrderCommand = (command: Command) => Command;