@atlaskit/editor-common 96.4.0 → 96.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/analytics/analytics-queue.js +4 -5
  3. package/dist/cjs/annotation/index.js +9 -10
  4. package/dist/cjs/element-browser/ElementBrowser.js +11 -14
  5. package/dist/cjs/event-dispatcher/index.js +1 -2
  6. package/dist/cjs/extensibility/Extension/Lozenge/index.js +7 -10
  7. package/dist/cjs/extensibility/Extension.js +6 -9
  8. package/dist/cjs/extensibility/ExtensionComponent.js +25 -30
  9. package/dist/cjs/extensibility/extensionNodeView.js +5 -7
  10. package/dist/cjs/extensions/default-extension-provider.js +1 -2
  11. package/dist/cjs/hooks/useSharedPluginState.js +3 -0
  12. package/dist/cjs/hooks/useSharedPluginStateSelector/index.js +12 -0
  13. package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +114 -0
  14. package/dist/cjs/lazy-node-view/lazy-scheduler.js +1 -1
  15. package/dist/cjs/lazy-node-view/node-view.js +1 -2
  16. package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +39 -45
  17. package/dist/cjs/link/LinkSearch/LinkSearchList.js +5 -7
  18. package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +9 -12
  19. package/dist/cjs/link/LinkSearch/index.js +13 -16
  20. package/dist/cjs/link/LinkSearch/withActivityProvider.js +6 -9
  21. package/dist/cjs/media-inline/inline-image-wrapper.js +1 -2
  22. package/dist/cjs/monitoring/error.js +1 -1
  23. package/dist/cjs/portal/PortalManager.js +1 -2
  24. package/dist/cjs/preset/builder.js +2 -4
  25. package/dist/cjs/preset/editor-commands.js +4 -5
  26. package/dist/cjs/preset/plugin-injection-api.js +4 -8
  27. package/dist/cjs/provider-factory/provider-factory.js +1 -2
  28. package/dist/cjs/provider-factory/with-providers.js +8 -11
  29. package/dist/cjs/react-node-view/index.js +1 -2
  30. package/dist/cjs/safe-plugin/index.js +4 -5
  31. package/dist/cjs/selection/gap-cursor/selection.js +7 -11
  32. package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +10 -13
  33. package/dist/cjs/styles/shared/media-single.js +21 -20
  34. package/dist/cjs/styles/shared/paragraph.js +1 -1
  35. package/dist/cjs/styles/shared/shadow.js +9 -8
  36. package/dist/cjs/styles/shared/table.js +1 -1
  37. package/dist/cjs/types/annotation/emitter.js +1 -2
  38. package/dist/cjs/ui/Caption/index.js +5 -7
  39. package/dist/cjs/ui/ContextPanel/context.js +8 -11
  40. package/dist/cjs/ui/DropList/index.js +22 -25
  41. package/dist/cjs/ui/ErrorBoundary/index.js +6 -9
  42. package/dist/cjs/ui/Expand/sharedStyles.js +1 -1
  43. package/dist/cjs/ui/IntlErrorBoundary/index.js +6 -9
  44. package/dist/cjs/ui/Layer/index.js +9 -12
  45. package/dist/cjs/ui/Mention/index.js +6 -9
  46. package/dist/cjs/ui/Mention/mention-with-providers.js +6 -9
  47. package/dist/cjs/ui/Messages/index.js +1 -1
  48. package/dist/cjs/ui/OverflowShadow/index.js +13 -16
  49. package/dist/cjs/ui/OverflowShadow/shadowObserver.js +3 -5
  50. package/dist/cjs/ui/PanelTextInput/index.js +10 -13
  51. package/dist/cjs/ui/Popup/index.js +14 -17
  52. package/dist/cjs/ui/ResizerLegacy/index.js +12 -16
  53. package/dist/cjs/ui/WithCreateAnalyticsEvent/index.js +5 -7
  54. package/dist/cjs/ui/with-outer-listeners.js +10 -13
  55. package/dist/cjs/ui-menu/Dropdown/index.js +9 -12
  56. package/dist/cjs/ui-menu/DropdownMenu/index.js +11 -14
  57. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +8 -11
  58. package/dist/cjs/utils/error-reporter.js +1 -2
  59. package/dist/cjs/utils/hyperlink.js +2 -4
  60. package/dist/cjs/utils/imageLoader.js +14 -19
  61. package/dist/cjs/utils/profiler/render-count.js +3 -2
  62. package/dist/cjs/utils/traversor.js +1 -2
  63. package/dist/cjs/with-plugin-state/index.js +28 -35
  64. package/dist/es2019/analytics/analytics-queue.js +3 -3
  65. package/dist/es2019/hooks/useSharedPluginState.js +3 -0
  66. package/dist/es2019/hooks/useSharedPluginStateSelector/index.js +2 -0
  67. package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +98 -0
  68. package/dist/es2019/lazy-node-view/lazy-scheduler.js +1 -1
  69. package/dist/es2019/monitoring/error.js +1 -1
  70. package/dist/es2019/styles/shared/paragraph.js +1 -1
  71. package/dist/es2019/styles/shared/table.js +1 -1
  72. package/dist/es2019/ui/DropList/index.js +1 -1
  73. package/dist/es2019/ui/Expand/sharedStyles.js +1 -1
  74. package/dist/es2019/ui/Messages/index.js +1 -1
  75. package/dist/es2019/utils/profiler/render-count.js +2 -0
  76. package/dist/esm/analytics/analytics-queue.js +4 -5
  77. package/dist/esm/annotation/index.js +9 -10
  78. package/dist/esm/element-browser/ElementBrowser.js +11 -14
  79. package/dist/esm/event-dispatcher/index.js +1 -2
  80. package/dist/esm/extensibility/Extension/Lozenge/index.js +7 -10
  81. package/dist/esm/extensibility/Extension.js +6 -9
  82. package/dist/esm/extensibility/ExtensionComponent.js +25 -30
  83. package/dist/esm/extensibility/extensionNodeView.js +5 -7
  84. package/dist/esm/extensions/default-extension-provider.js +1 -2
  85. package/dist/esm/hooks/useSharedPluginState.js +3 -0
  86. package/dist/esm/hooks/useSharedPluginStateSelector/index.js +2 -0
  87. package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +108 -0
  88. package/dist/esm/lazy-node-view/lazy-scheduler.js +1 -1
  89. package/dist/esm/lazy-node-view/node-view.js +1 -2
  90. package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +39 -45
  91. package/dist/esm/link/LinkSearch/LinkSearchList.js +5 -7
  92. package/dist/esm/link/LinkSearch/LinkSearchListItem.js +9 -12
  93. package/dist/esm/link/LinkSearch/index.js +13 -16
  94. package/dist/esm/link/LinkSearch/withActivityProvider.js +6 -9
  95. package/dist/esm/media-inline/inline-image-wrapper.js +1 -2
  96. package/dist/esm/monitoring/error.js +1 -1
  97. package/dist/esm/portal/PortalManager.js +1 -2
  98. package/dist/esm/preset/builder.js +2 -4
  99. package/dist/esm/preset/editor-commands.js +4 -5
  100. package/dist/esm/preset/plugin-injection-api.js +4 -8
  101. package/dist/esm/provider-factory/provider-factory.js +1 -2
  102. package/dist/esm/provider-factory/with-providers.js +8 -11
  103. package/dist/esm/react-node-view/index.js +1 -2
  104. package/dist/esm/safe-plugin/index.js +4 -5
  105. package/dist/esm/selection/gap-cursor/selection.js +7 -11
  106. package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +10 -13
  107. package/dist/esm/styles/shared/media-single.js +19 -20
  108. package/dist/esm/styles/shared/paragraph.js +1 -1
  109. package/dist/esm/styles/shared/shadow.js +7 -8
  110. package/dist/esm/styles/shared/table.js +1 -1
  111. package/dist/esm/types/annotation/emitter.js +1 -2
  112. package/dist/esm/ui/Caption/index.js +5 -7
  113. package/dist/esm/ui/ContextPanel/context.js +8 -11
  114. package/dist/esm/ui/DropList/index.js +22 -25
  115. package/dist/esm/ui/ErrorBoundary/index.js +6 -9
  116. package/dist/esm/ui/Expand/sharedStyles.js +1 -1
  117. package/dist/esm/ui/IntlErrorBoundary/index.js +6 -9
  118. package/dist/esm/ui/Layer/index.js +9 -12
  119. package/dist/esm/ui/Mention/index.js +6 -9
  120. package/dist/esm/ui/Mention/mention-with-providers.js +6 -9
  121. package/dist/esm/ui/Messages/index.js +1 -1
  122. package/dist/esm/ui/OverflowShadow/index.js +13 -16
  123. package/dist/esm/ui/OverflowShadow/shadowObserver.js +3 -5
  124. package/dist/esm/ui/PanelTextInput/index.js +10 -13
  125. package/dist/esm/ui/Popup/index.js +14 -17
  126. package/dist/esm/ui/ResizerLegacy/index.js +12 -16
  127. package/dist/esm/ui/WithCreateAnalyticsEvent/index.js +5 -7
  128. package/dist/esm/ui/with-outer-listeners.js +10 -13
  129. package/dist/esm/ui-menu/Dropdown/index.js +9 -12
  130. package/dist/esm/ui-menu/DropdownMenu/index.js +11 -14
  131. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +8 -11
  132. package/dist/esm/utils/error-reporter.js +1 -2
  133. package/dist/esm/utils/hyperlink.js +2 -4
  134. package/dist/esm/utils/imageLoader.js +14 -19
  135. package/dist/esm/utils/profiler/render-count.js +3 -2
  136. package/dist/esm/utils/traversor.js +1 -2
  137. package/dist/esm/with-plugin-state/index.js +28 -35
  138. package/dist/types/hooks/useSharedPluginState.d.ts +5 -3
  139. package/dist/types/hooks/useSharedPluginStateSelector/index.d.ts +1 -0
  140. package/dist/types/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +74 -0
  141. package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +5 -3
  142. package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/index.d.ts +1 -0
  143. package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +74 -0
  144. package/package.json +4 -3
  145. package/use-shared-plugin-state-selector/package.json +15 -0
@@ -1,11 +1,10 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
9
  import React, { PureComponent } from 'react';
11
10
  import ReactDOM from 'react-dom';
@@ -15,36 +14,35 @@ import { fg } from '@atlaskit/platform-feature-flags';
15
14
  export var PlainOutsideClickTargetRefContext = /*#__PURE__*/React.createContext(function () {});
16
15
  export default function withOuterListeners(Component) {
17
16
  return /*#__PURE__*/function (_PureComponent) {
18
- _inherits(WithOutsideClick, _PureComponent);
19
- var _super = _createSuper(WithOutsideClick);
20
17
  function WithOutsideClick() {
21
18
  var _this;
22
19
  _classCallCheck(this, WithOutsideClick);
23
20
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
21
  args[_key] = arguments[_key];
25
22
  }
26
- _this = _super.call.apply(_super, [this].concat(args));
27
- _defineProperty(_assertThisInitialized(_this), "outsideClickTargetRef", /*#__PURE__*/React.createRef());
28
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (evt) {
23
+ _this = _callSuper(this, WithOutsideClick, [].concat(args));
24
+ _defineProperty(_this, "outsideClickTargetRef", /*#__PURE__*/React.createRef());
25
+ _defineProperty(_this, "handleClick", function (evt) {
29
26
  var _this$outsideClickTar;
30
- var domNode = fg('platform_editor_replace_finddomnode_in_common') ? (_this$outsideClickTar = _this.outsideClickTargetRef.current) === null || _this$outsideClickTar === void 0 ? void 0 : _this$outsideClickTar.deref() : ReactDOM.findDOMNode(_assertThisInitialized(_this)); // eslint-disable-line react/no-find-dom-node
27
+ var domNode = fg('platform_editor_replace_finddomnode_in_common') ? (_this$outsideClickTar = _this.outsideClickTargetRef.current) === null || _this$outsideClickTar === void 0 ? void 0 : _this$outsideClickTar.deref() : ReactDOM.findDOMNode(_this); // eslint-disable-line react/no-find-dom-node
31
28
 
32
29
  if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
33
30
  var _this$props$handleCli, _this$props;
34
31
  (_this$props$handleCli = (_this$props = _this.props).handleClickOutside) === null || _this$props$handleCli === void 0 || _this$props$handleCli.call(_this$props, evt);
35
32
  }
36
33
  });
37
- _defineProperty(_assertThisInitialized(_this), "handleKeydown", function (evt) {
34
+ _defineProperty(_this, "handleKeydown", function (evt) {
38
35
  if (evt.code === 'Escape' && _this.props.handleEscapeKeydown) {
39
36
  _this.props.handleEscapeKeydown(evt);
40
37
  }
41
38
  });
42
- _defineProperty(_assertThisInitialized(_this), "setOutsideClickTargetRef", function (el) {
39
+ _defineProperty(_this, "setOutsideClickTargetRef", function (el) {
43
40
  _this.outsideClickTargetRef.current = el && new WeakRef(el);
44
41
  });
45
42
  return _this;
46
43
  }
47
- _createClass(WithOutsideClick, [{
44
+ _inherits(WithOutsideClick, _PureComponent);
45
+ return _createClass(WithOutsideClick, [{
48
46
  key: "componentDidMount",
49
47
  value: function componentDidMount() {
50
48
  if (this.props.handleClickOutside) {
@@ -72,6 +70,5 @@ export default function withOuterListeners(Component) {
72
70
  }, /*#__PURE__*/React.createElement(Component, this.props));
73
71
  }
74
72
  }]);
75
- return WithOutsideClick;
76
73
  }(PureComponent);
77
74
  }
@@ -1,12 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
10
  import React, { PureComponent } from 'react';
12
11
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners } from '../../ui-react';
@@ -20,13 +19,11 @@ import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
20
19
  * Also it controls popper's placement.
21
20
  */
22
21
  export var Dropdown = /*#__PURE__*/function (_PureComponent) {
23
- _inherits(Dropdown, _PureComponent);
24
- var _super = _createSuper(Dropdown);
25
22
  function Dropdown(props) {
26
23
  var _this;
27
24
  _classCallCheck(this, Dropdown);
28
- _this = _super.call(this, props);
29
- _defineProperty(_assertThisInitialized(_this), "handleRef", function (setOutsideClickTargetRef) {
25
+ _this = _callSuper(this, Dropdown, [props]);
26
+ _defineProperty(_this, "handleRef", function (setOutsideClickTargetRef) {
30
27
  return function (target) {
31
28
  setOutsideClickTargetRef(target);
32
29
  _this.setState({
@@ -34,17 +31,17 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
34
31
  });
35
32
  };
36
33
  });
37
- _defineProperty(_assertThisInitialized(_this), "updatePopupPlacement", function (placement) {
34
+ _defineProperty(_this, "updatePopupPlacement", function (placement) {
38
35
  _this.setState({
39
36
  popupPlacement: placement
40
37
  });
41
38
  });
42
- _defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function (event) {
39
+ _defineProperty(_this, "handleCloseAndFocus", function (event) {
43
40
  var _this$state$target;
44
41
  (_this$state$target = _this.state.target) === null || _this$state$target === void 0 || (_this$state$target = _this$state$target.querySelector('button')) === null || _this$state$target === void 0 || _this$state$target.focus();
45
42
  _this.handleClose(event);
46
43
  });
47
- _defineProperty(_assertThisInitialized(_this), "handleClose", function (event) {
44
+ _defineProperty(_this, "handleClose", function (event) {
48
45
  if (_this.props.onOpenChange) {
49
46
  _this.props.onOpenChange({
50
47
  isOpen: false,
@@ -57,7 +54,8 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
57
54
  };
58
55
  return _this;
59
56
  }
60
- _createClass(Dropdown, [{
57
+ _inherits(Dropdown, _PureComponent);
58
+ return _createClass(Dropdown, [{
61
59
  key: "renderDropdown",
62
60
  value: function renderDropdown() {
63
61
  var _this$state = this.state,
@@ -115,7 +113,6 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
115
113
  });
116
114
  }
117
115
  }]);
118
- return Dropdown;
119
116
  }(PureComponent);
120
117
  var DropdownWithOuterListeners = withReactEditorViewOuterListeners(Dropdown);
121
118
  export default DropdownWithOuterListeners;
@@ -3,10 +3,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
7
- import _inherits from "@babel/runtime/helpers/inherits";
8
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
+ import _inherits from "@babel/runtime/helpers/inherits";
10
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
10
  import _extends from "@babel/runtime/helpers/extends";
12
11
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
@@ -14,7 +13,7 @@ var _excluded = ["children"];
14
13
  var _templateObject, _templateObject2;
15
14
  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; }
16
15
  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; }
17
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
16
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
18
17
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
19
18
  /**
20
19
  * @jsxRuntime classic
@@ -71,26 +70,24 @@ var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropListWit
71
70
  * Also it controls popper's placement.
72
71
  */
73
72
  var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
74
- _inherits(DropdownMenuWrapper, _PureComponent);
75
- var _super = _createSuper(DropdownMenuWrapper);
76
73
  function DropdownMenuWrapper() {
77
74
  var _this;
78
75
  _classCallCheck(this, DropdownMenuWrapper);
79
76
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
80
77
  args[_key] = arguments[_key];
81
78
  }
82
- _this = _super.call.apply(_super, [this].concat(args));
83
- _defineProperty(_assertThisInitialized(_this), "state", {
79
+ _this = _callSuper(this, DropdownMenuWrapper, [].concat(args));
80
+ _defineProperty(_this, "state", {
84
81
  popupPlacement: ['bottom', 'left'],
85
82
  selectionIndex: -1
86
83
  });
87
- _defineProperty(_assertThisInitialized(_this), "popupRef", /*#__PURE__*/React.createRef());
88
- _defineProperty(_assertThisInitialized(_this), "handleRef", function (target) {
84
+ _defineProperty(_this, "popupRef", /*#__PURE__*/React.createRef());
85
+ _defineProperty(_this, "handleRef", function (target) {
89
86
  _this.setState({
90
87
  target: target || undefined
91
88
  });
92
89
  });
93
- _defineProperty(_assertThisInitialized(_this), "updatePopupPlacement", function (placement) {
90
+ _defineProperty(_this, "updatePopupPlacement", function (placement) {
94
91
  var previousPlacement = _this.state.popupPlacement;
95
92
  if (placement[0] !== previousPlacement[0] || placement[1] !== previousPlacement[1]) {
96
93
  _this.setState({
@@ -98,12 +95,12 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
98
95
  });
99
96
  }
100
97
  });
101
- _defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function (event) {
98
+ _defineProperty(_this, "handleCloseAndFocus", function (event) {
102
99
  var _this$state$target;
103
100
  (_this$state$target = _this.state.target) === null || _this$state$target === void 0 || (_this$state$target = _this$state$target.querySelector('button')) === null || _this$state$target === void 0 || _this$state$target.focus();
104
101
  _this.handleClose(event);
105
102
  });
106
- _defineProperty(_assertThisInitialized(_this), "handleClose", function (event) {
103
+ _defineProperty(_this, "handleClose", function (event) {
107
104
  var onOpenChange = _this.props.onOpenChange;
108
105
  if (onOpenChange) {
109
106
  onOpenChange({
@@ -114,7 +111,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
114
111
  });
115
112
  return _this;
116
113
  }
117
- _createClass(DropdownMenuWrapper, [{
114
+ _inherits(DropdownMenuWrapper, _PureComponent);
115
+ return _createClass(DropdownMenuWrapper, [{
118
116
  key: "renderDropdownMenu",
119
117
  value: function renderDropdownMenu() {
120
118
  var _this2 = this;
@@ -244,7 +242,6 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
244
242
  }
245
243
  }
246
244
  }]);
247
- return DropdownMenuWrapper;
248
245
  }(PureComponent);
249
246
  export { DropdownMenuWrapper as default };
250
247
  var DropdownMenuItemCustomComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -2,13 +2,12 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
5
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _inherits from "@babel/runtime/helpers/inherits";
9
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
9
  var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
11
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
10
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
12
  import React, { PureComponent, useCallback, useEffect, useRef, useState } from 'react';
14
13
  import ReactDOM from 'react-dom';
@@ -20,23 +19,21 @@ export var OutsideClickTargetRefContext = /*#__PURE__*/React.createContext(funct
20
19
 
21
20
  // This needs exporting to be used alongside `withReactEditorViewOuterListeners`
22
21
  var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
23
- _inherits(WithOutsideClick, _PureComponent);
24
- var _super = _createSuper(WithOutsideClick);
25
22
  function WithOutsideClick() {
26
23
  var _this;
27
24
  _classCallCheck(this, WithOutsideClick);
28
25
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
26
  args[_key] = arguments[_key];
30
27
  }
31
- _this = _super.call.apply(_super, [this].concat(args));
32
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (evt) {
28
+ _this = _callSuper(this, WithOutsideClick, [].concat(args));
29
+ _defineProperty(_this, "handleClick", function (evt) {
33
30
  var _this$props$outsideCl;
34
31
  if (!_this.props.isActiveComponent || !_this.props.handleClickOutside) {
35
32
  return;
36
33
  }
37
34
  var domNode = fg('platform_editor_replace_finddomnode_in_common') ? (_this$props$outsideCl = _this.props.outsideClickTargetRef.current) === null || _this$props$outsideCl === void 0 ? void 0 : _this$props$outsideCl.deref() :
38
35
  // eslint-disable-next-line react/no-find-dom-node -- Ignored via go/ED-25883
39
- ReactDOM.findDOMNode(_assertThisInitialized(_this));
36
+ ReactDOM.findDOMNode(_this);
40
37
  if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
41
38
  var _this$props$editorVie;
42
39
  _this.props.handleClickOutside(evt);
@@ -47,7 +44,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
47
44
  }
48
45
  }
49
46
  });
50
- _defineProperty(_assertThisInitialized(_this), "handleKeydown", function (evt) {
47
+ _defineProperty(_this, "handleKeydown", function (evt) {
51
48
  if (!_this.props.isActiveComponent) {
52
49
  return;
53
50
  }
@@ -66,7 +63,8 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
66
63
  });
67
64
  return _this;
68
65
  }
69
- _createClass(WithOutsideClick, [{
66
+ _inherits(WithOutsideClick, _PureComponent);
67
+ return _createClass(WithOutsideClick, [{
70
68
  key: "componentDidMount",
71
69
  value: function componentDidMount() {
72
70
  if (this.props.handleClickOutside) {
@@ -95,7 +93,6 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
95
93
  return this.props.children;
96
94
  }
97
95
  }]);
98
- return WithOutsideClick;
99
96
  }(PureComponent);
100
97
  function hasIsOpen(props) {
101
98
  return 'isOpen' in props;
@@ -6,7 +6,7 @@ export var ErrorReporter = /*#__PURE__*/function () {
6
6
  _classCallCheck(this, ErrorReporter);
7
7
  _defineProperty(this, "handlerStorage", null);
8
8
  }
9
- _createClass(ErrorReporter, [{
9
+ return _createClass(ErrorReporter, [{
10
10
  key: "captureMessage",
11
11
  value: function captureMessage(msg, tags) {
12
12
  if (this.handlerStorage) {
@@ -26,5 +26,4 @@ export var ErrorReporter = /*#__PURE__*/function () {
26
26
  this.handlerStorage = handler;
27
27
  }
28
28
  }]);
29
- return ErrorReporter;
30
29
  }();
@@ -23,14 +23,14 @@ export var LinkMatcher = /*#__PURE__*/function () {
23
23
  function LinkMatcher() {
24
24
  _classCallCheck(this, LinkMatcher);
25
25
  }
26
- _createClass(LinkMatcher, null, [{
26
+ return _createClass(LinkMatcher, null, [{
27
27
  key: "create",
28
28
  value: function create() {
29
29
  var LinkMatcherRegex = /*#__PURE__*/function () {
30
30
  function LinkMatcherRegex() {
31
31
  _classCallCheck(this, LinkMatcherRegex);
32
32
  }
33
- _createClass(LinkMatcherRegex, [{
33
+ return _createClass(LinkMatcherRegex, [{
34
34
  key: "exec",
35
35
  value: function exec(str) {
36
36
  var stringsBySpace = str.slice(0, str.length - 1).split(' ');
@@ -54,12 +54,10 @@ export var LinkMatcher = /*#__PURE__*/function () {
54
54
  return lastLink;
55
55
  }
56
56
  }]);
57
- return LinkMatcherRegex;
58
57
  }();
59
58
  return new LinkMatcherRegex();
60
59
  }
61
60
  }]);
62
- return LinkMatcher;
63
61
  }();
64
62
 
65
63
  /**
@@ -1,30 +1,27 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
10
  import React, { Component } from 'react';
12
11
  import { fg } from '@atlaskit/platform-feature-flags';
13
12
  export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
14
13
  return /*#__PURE__*/function (_Component) {
15
- _inherits(WithImageLoader, _Component);
16
- var _super = _createSuper(WithImageLoader);
17
14
  function WithImageLoader() {
18
15
  var _this;
19
16
  _classCallCheck(this, WithImageLoader);
20
17
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
18
  args[_key] = arguments[_key];
22
19
  }
23
- _this = _super.call.apply(_super, [this].concat(args));
24
- _defineProperty(_assertThisInitialized(_this), "state", {
20
+ _this = _callSuper(this, WithImageLoader, [].concat(args));
21
+ _defineProperty(_this, "state", {
25
22
  imageStatus: 'loading'
26
23
  });
27
- _defineProperty(_assertThisInitialized(_this), "onLoad", function () {
24
+ _defineProperty(_this, "onLoad", function () {
28
25
  _this.setState({
29
26
  imageStatus: 'complete'
30
27
  });
@@ -36,14 +33,15 @@ export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
36
33
  });
37
34
  }
38
35
  });
39
- _defineProperty(_assertThisInitialized(_this), "onError", function () {
36
+ _defineProperty(_this, "onError", function () {
40
37
  _this.setState({
41
38
  imageStatus: 'error'
42
39
  });
43
40
  });
44
41
  return _this;
45
42
  }
46
- _createClass(WithImageLoader, [{
43
+ _inherits(WithImageLoader, _Component);
44
+ return _createClass(WithImageLoader, [{
47
45
  key: "componentDidMount",
48
46
  value: function componentDidMount() {
49
47
  this.fetchImage(this.props);
@@ -89,24 +87,21 @@ export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
89
87
  }));
90
88
  }
91
89
  }]);
92
- return WithImageLoader;
93
90
  }(Component);
94
91
  };
95
92
  var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
96
93
  return /*#__PURE__*/function (_Component2) {
97
- _inherits(WithImageLoader, _Component2);
98
- var _super2 = _createSuper(WithImageLoader);
99
94
  function WithImageLoader() {
100
95
  var _this2;
101
96
  _classCallCheck(this, WithImageLoader);
102
97
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
103
98
  args[_key2] = arguments[_key2];
104
99
  }
105
- _this2 = _super2.call.apply(_super2, [this].concat(args));
106
- _defineProperty(_assertThisInitialized(_this2), "state", {
100
+ _this2 = _callSuper(this, WithImageLoader, [].concat(args));
101
+ _defineProperty(_this2, "state", {
107
102
  imageStatus: 'loading'
108
103
  });
109
- _defineProperty(_assertThisInitialized(_this2), "onLoad", function () {
104
+ _defineProperty(_this2, "onLoad", function () {
110
105
  _this2.setState({
111
106
  imageStatus: 'complete'
112
107
  });
@@ -118,14 +113,15 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
118
113
  });
119
114
  }
120
115
  });
121
- _defineProperty(_assertThisInitialized(_this2), "onError", function () {
116
+ _defineProperty(_this2, "onError", function () {
122
117
  _this2.setState({
123
118
  imageStatus: 'error'
124
119
  });
125
120
  });
126
121
  return _this2;
127
122
  }
128
- _createClass(WithImageLoader, [{
123
+ _inherits(WithImageLoader, _Component2);
124
+ return _createClass(WithImageLoader, [{
129
125
  key: "componentDidMount",
130
126
  value: function componentDidMount() {
131
127
  this.fetchImage(this.props);
@@ -171,7 +167,6 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
171
167
  }));
172
168
  }
173
169
  }]);
174
- return WithImageLoader;
175
170
  }(Component);
176
171
  };
177
172
  export var withImageLoader = function withImageLoader(Wrapped) {
@@ -22,7 +22,7 @@ export var RenderCountProfiler = /*#__PURE__*/function () {
22
22
  * instance will be created using the given params. Returns the latest
23
23
  * singleton/instance.
24
24
  */
25
- _createClass(RenderCountProfiler, [{
25
+ return _createClass(RenderCountProfiler, [{
26
26
  key: "getData",
27
27
  value: function getData(profilerKey) {
28
28
  var _this$store;
@@ -70,6 +70,7 @@ export var RenderCountProfiler = /*#__PURE__*/function () {
70
70
  var componentId = _ref3.componentId;
71
71
  var component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 || (_this$store3 = _this$store3[PROFILER_KEY]) === null || _this$store3 === void 0 || (_this$store3 = _this$store3.components) === null || _this$store3 === void 0 ? void 0 : _this$store3[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
72
72
  var counters = [];
73
+ // eslint-disable-next-line guard-for-in
73
74
  for (var instanceId in component) {
74
75
  var counter = {
75
76
  instanceId: instanceId,
@@ -86,6 +87,7 @@ export var RenderCountProfiler = /*#__PURE__*/function () {
86
87
  var componentId = _ref4.componentId;
87
88
  var component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 || (_this$store4 = _this$store4[PROFILER_KEY]) === null || _this$store4 === void 0 || (_this$store4 = _this$store4.components) === null || _this$store4 === void 0 ? void 0 : _this$store4[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
88
89
  var total = 0;
90
+ // eslint-disable-next-line guard-for-in
89
91
  for (var instanceId in component) {
90
92
  total += component[instanceId].count;
91
93
  }
@@ -102,5 +104,4 @@ export var RenderCountProfiler = /*#__PURE__*/function () {
102
104
  return RenderCountProfiler.instance;
103
105
  }
104
106
  }]);
105
- return RenderCountProfiler;
106
107
  }();
@@ -7,7 +7,7 @@ var ADFTraversor = /*#__PURE__*/function () {
7
7
  _defineProperty(this, "subscribers", new Map());
8
8
  this.doc = doc;
9
9
  }
10
- _createClass(ADFTraversor, [{
10
+ return _createClass(ADFTraversor, [{
11
11
  key: "subscribe",
12
12
  value: function subscribe(type, callback) {
13
13
  var callbacks = this.subscribers.get(type);
@@ -39,6 +39,5 @@ var ADFTraversor = /*#__PURE__*/function () {
39
39
  }
40
40
  }
41
41
  }]);
42
- return ADFTraversor;
43
42
  }();
44
43
  export default ADFTraversor;