@atlaskit/editor-plugin-card 4.5.4 → 4.5.5

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 (29) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/nodeviews/blockCard.js +14 -18
  3. package/dist/cjs/nodeviews/datasource.js +25 -35
  4. package/dist/cjs/nodeviews/embedCard.js +20 -24
  5. package/dist/cjs/nodeviews/genericCard.js +8 -11
  6. package/dist/cjs/ui/EditLinkToolbar.js +5 -7
  7. package/dist/cjs/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +4 -5
  8. package/dist/cjs/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +4 -5
  9. package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +5 -7
  10. package/dist/cjs/ui/InlineCardOverlay/index.js +3 -4
  11. package/dist/cjs/ui/LinkToolbarAppearance.js +6 -9
  12. package/dist/cjs/ui/ResizableEmbedCard.js +11 -14
  13. package/dist/cjs/ui/datasourceErrorBoundary.js +6 -9
  14. package/dist/es2019/index.js +3 -0
  15. package/dist/es2019/nodeviews/datasource.js +7 -13
  16. package/dist/esm/index.js +3 -0
  17. package/dist/esm/nodeviews/blockCard.js +14 -18
  18. package/dist/esm/nodeviews/datasource.js +25 -35
  19. package/dist/esm/nodeviews/embedCard.js +20 -24
  20. package/dist/esm/nodeviews/genericCard.js +8 -11
  21. package/dist/esm/ui/EditLinkToolbar.js +5 -7
  22. package/dist/esm/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +4 -5
  23. package/dist/esm/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +4 -5
  24. package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +5 -7
  25. package/dist/esm/ui/InlineCardOverlay/index.js +3 -4
  26. package/dist/esm/ui/LinkToolbarAppearance.js +6 -9
  27. package/dist/esm/ui/ResizableEmbedCard.js +11 -14
  28. package/dist/esm/ui/datasourceErrorBoundary.js +6 -9
  29. package/package.json +3 -3
@@ -1,15 +1,15 @@
1
1
  import _get from "@babel/runtime/helpers/get";
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
8
  import _extends from "@babel/runtime/helpers/extends";
9
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
10
10
  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; }
11
11
  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; }
12
- 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); }; }
12
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
13
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
14
  import React from 'react';
15
15
  import rafSchedule from 'raf-schd';
@@ -94,17 +94,15 @@ var CardInner = function CardInner(_ref) {
94
94
  };
95
95
  // eslint-disable-next-line @repo/internal/react/no-class-components
96
96
  export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
97
- _inherits(EmbedCardComponent, _React$PureComponent);
98
- var _super = _createSuper(EmbedCardComponent);
99
97
  function EmbedCardComponent(props) {
100
98
  var _this;
101
99
  _classCallCheck(this, EmbedCardComponent);
102
- _this = _super.call(this, props);
103
- _defineProperty(_assertThisInitialized(_this), "embedIframeRef", /*#__PURE__*/React.createRef());
104
- _defineProperty(_assertThisInitialized(_this), "state", {
100
+ _this = _callSuper(this, EmbedCardComponent, [props]);
101
+ _defineProperty(_this, "embedIframeRef", /*#__PURE__*/React.createRef());
102
+ _defineProperty(_this, "state", {
105
103
  hasPreview: true
106
104
  });
107
- _defineProperty(_assertThisInitialized(_this), "getPosSafely", function () {
105
+ _defineProperty(_this, "getPosSafely", function () {
108
106
  var getPos = _this.props.getPos;
109
107
  if (!getPos || typeof getPos === 'boolean') {
110
108
  return;
@@ -115,7 +113,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
115
113
  // Can blow up in rare cases, when node has been removed.
116
114
  }
117
115
  });
118
- _defineProperty(_assertThisInitialized(_this), "onResolve", function (data) {
116
+ _defineProperty(_this, "onResolve", function (data) {
119
117
  var view = _this.props.view;
120
118
  var title = data.title,
121
119
  url = data.url,
@@ -158,7 +156,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
158
156
  }
159
157
  } catch (e) {}
160
158
  });
161
- _defineProperty(_assertThisInitialized(_this), "updateSize", function (pctWidth, layout) {
159
+ _defineProperty(_this, "updateSize", function (pctWidth, layout) {
162
160
  var _this$props$view = _this.props.view,
163
161
  state = _this$props$view.state,
164
162
  dispatch = _this$props$view.dispatch;
@@ -174,7 +172,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
174
172
  dispatch(tr);
175
173
  return true;
176
174
  });
177
- _defineProperty(_assertThisInitialized(_this), "getLineLength", function (view, pos, originalLineLength) {
175
+ _defineProperty(_this, "getLineLength", function (view, pos, originalLineLength) {
178
176
  if (typeof pos === 'number' && isRichMediaInsideOfBlockNode(view, pos)) {
179
177
  var $pos = view.state.doc.resolve(pos);
180
178
  var domNode = view.nodeDOM($pos.pos);
@@ -192,7 +190,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
192
190
  * it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
193
191
  * we will show embed window of appropriate size and avoid unnecessary content jumping.
194
192
  */
195
- _defineProperty(_assertThisInitialized(_this), "saveOriginalDimensionsAttributes", function (height, width) {
193
+ _defineProperty(_this, "saveOriginalDimensionsAttributes", function (height, width) {
196
194
  var view = _this.props.view;
197
195
 
198
196
  // TODO: ED-15663
@@ -227,13 +225,13 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
227
225
  })).setMeta('addToHistory', false));
228
226
  })();
229
227
  });
230
- _defineProperty(_assertThisInitialized(_this), "onHeightUpdate", function (height) {
228
+ _defineProperty(_this, "onHeightUpdate", function (height) {
231
229
  _this.setState({
232
230
  liveHeight: height
233
231
  });
234
232
  _this.saveOriginalDimensionsAttributes(height, undefined);
235
233
  });
236
- _defineProperty(_assertThisInitialized(_this), "onError", function (_ref2) {
234
+ _defineProperty(_this, "onError", function (_ref2) {
237
235
  var err = _ref2.err;
238
236
  if (err) {
239
237
  throw err;
@@ -242,7 +240,8 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
242
240
  _this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
243
241
  return _this;
244
242
  }
245
- _createClass(EmbedCardComponent, [{
243
+ _inherits(EmbedCardComponent, _React$PureComponent);
244
+ return _createClass(EmbedCardComponent, [{
246
245
  key: "render",
247
246
  value: function render() {
248
247
  var _this$props = this.props,
@@ -316,31 +315,29 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
316
315
  }));
317
316
  }
318
317
  }]);
319
- return EmbedCardComponent;
320
318
  }(React.PureComponent);
321
319
  var WrappedBlockCard = Card(EmbedCardComponent, UnsupportedBlock);
322
320
  export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
323
- _inherits(EmbedCard, _ReactNodeView);
324
- var _super2 = _createSuper(EmbedCard);
325
321
  function EmbedCard() {
326
322
  var _this2;
327
323
  _classCallCheck(this, EmbedCard);
328
324
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
329
325
  args[_key] = arguments[_key];
330
326
  }
331
- _this2 = _super2.call.apply(_super2, [this].concat(args));
332
- _defineProperty(_assertThisInitialized(_this2), "updateContentEditable", function (editorViewModeState, divElement) {
327
+ _this2 = _callSuper(this, EmbedCard, [].concat(args));
328
+ _defineProperty(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
333
329
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
334
330
  });
335
331
  return _this2;
336
332
  }
337
- _createClass(EmbedCard, [{
333
+ _inherits(EmbedCard, _ReactNodeView);
334
+ return _createClass(EmbedCard, [{
338
335
  key: "viewShouldUpdate",
339
336
  value: function viewShouldUpdate(nextNode) {
340
337
  if (this.node.attrs !== nextNode.attrs) {
341
338
  return true;
342
339
  }
343
- return _get(_getPrototypeOf(EmbedCard.prototype), "viewShouldUpdate", this).call(this, nextNode);
340
+ return _superPropGet(EmbedCard, "viewShouldUpdate", this, 3)([nextNode]);
344
341
  }
345
342
  }, {
346
343
  key: "createDomRef",
@@ -390,7 +387,6 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
390
387
  (_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 || _this$unsubscribe.call(this);
391
388
  }
392
389
  }]);
393
- return EmbedCard;
394
390
  }(ReactNodeView);
395
391
  export var embedCardNodeView = function embedCardNodeView(_ref4) {
396
392
  var allowResizing = _ref4.allowResizing,
@@ -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, { useCallback } from 'react';
12
11
  import { isSafeUrl } from '@atlaskit/adf-schema';
@@ -59,21 +58,20 @@ var WithClickHandler = function WithClickHandler(_ref) {
59
58
  };
60
59
  export function Card(SmartCardComponent, UnsupportedComponent) {
61
60
  return /*#__PURE__*/function (_React$Component) {
62
- _inherits(_class2, _React$Component);
63
- var _super = _createSuper(_class2);
64
- function _class2() {
61
+ function _class() {
65
62
  var _this;
66
- _classCallCheck(this, _class2);
63
+ _classCallCheck(this, _class);
67
64
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
68
65
  args[_key] = arguments[_key];
69
66
  }
70
- _this = _super.call.apply(_super, [this].concat(args));
71
- _defineProperty(_assertThisInitialized(_this), "state", {
67
+ _this = _callSuper(this, _class, [].concat(args));
68
+ _defineProperty(_this, "state", {
72
69
  isError: false
73
70
  });
74
71
  return _this;
75
72
  }
76
- _createClass(_class2, [{
73
+ _inherits(_class, _React$Component);
74
+ return _createClass(_class, [{
77
75
  key: "render",
78
76
  value: function render() {
79
77
  var _getPluginState,
@@ -159,6 +157,5 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
159
157
  }
160
158
  }
161
159
  }]);
162
- return _class2;
163
160
  }(React.Component);
164
161
  }
@@ -1,9 +1,9 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- 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); }; }
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
8
  import React from 'react';
9
9
  import { ACTION, buildEditLinkPayload, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
@@ -47,13 +47,12 @@ export function HyperlinkAddToolbarWithState(_ref) {
47
47
 
48
48
  // eslint-disable-next-line @repo/internal/react/no-class-components
49
49
  export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
50
- _inherits(EditLinkToolbar, _React$Component);
51
- var _super = _createSuper(EditLinkToolbar);
52
50
  function EditLinkToolbar() {
53
51
  _classCallCheck(this, EditLinkToolbar);
54
- return _super.apply(this, arguments);
52
+ return _callSuper(this, EditLinkToolbar, arguments);
55
53
  }
56
- _createClass(EditLinkToolbar, [{
54
+ _inherits(EditLinkToolbar, _React$Component);
55
+ return _createClass(EditLinkToolbar, [{
57
56
  key: "componentDidUpdate",
58
57
  value: function componentDidUpdate(prevProps) {
59
58
  if (prevProps.node !== this.props.node) {
@@ -122,7 +121,6 @@ export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
122
121
  });
123
122
  }
124
123
  }]);
125
- return EditLinkToolbar;
126
124
  }(React.Component);
127
125
  export var getEditLinkCallback = function getEditLinkCallback(editorAnalyticsApi, scrollIntoView) {
128
126
  return function (state, dispatch) {
@@ -71,8 +71,7 @@ export var DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
71
71
  datasourceUpdated = _useDatasourceLifecyc.datasourceUpdated,
72
72
  datasourceDeleted = _useDatasourceLifecyc.datasourceDeleted;
73
73
  var eventHandlers = useMemo(function () {
74
- var _ref5;
75
- return _ref5 = {}, _defineProperty(_ref5, EVENT.CREATED, function (_ref2) {
74
+ return _defineProperty(_defineProperty(_defineProperty({}, EVENT.CREATED, function (_ref2) {
76
75
  var node = _ref2.node,
77
76
  nodeContext = _ref2.nodeContext,
78
77
  metadata = _objectWithoutProperties(_ref2, _excluded);
@@ -99,7 +98,7 @@ export var DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
99
98
  nodeContext: nodeContext,
100
99
  searchMethod: searchMethod
101
100
  }));
102
- }), _defineProperty(_ref5, EVENT.UPDATED, function (_ref3) {
101
+ }), EVENT.UPDATED, function (_ref3) {
103
102
  var node = _ref3.node,
104
103
  nodeContext = _ref3.nodeContext,
105
104
  metadata = _objectWithoutProperties(_ref3, _excluded2);
@@ -124,7 +123,7 @@ export var DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
124
123
  searchMethod: searchMethod,
125
124
  updateMethod: inputMethod
126
125
  });
127
- }), _defineProperty(_ref5, EVENT.DELETED, function (_ref4) {
126
+ }), EVENT.DELETED, function (_ref4) {
128
127
  var node = _ref4.node,
129
128
  nodeContext = _ref4.nodeContext,
130
129
  metadata = _objectWithoutProperties(_ref4, _excluded3);
@@ -147,7 +146,7 @@ export var DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
147
146
  nodeContext: nodeContext,
148
147
  searchMethod: searchMethod
149
148
  });
150
- }), _ref5;
149
+ });
151
150
  }, [datasourceCreated, datasourceUpdated, datasourceDeleted]);
152
151
 
153
152
  /**
@@ -35,8 +35,7 @@ export var LinkEventsBinding = function LinkEventsBinding(_ref) {
35
35
  linkUpdated = _useSmartLinkLifecycl.linkUpdated,
36
36
  linkDeleted = _useSmartLinkLifecycl.linkDeleted;
37
37
  var linkEvents = useMemo(function () {
38
- var _ref5;
39
- return _ref5 = {}, _defineProperty(_ref5, EVENT.CREATED, function (_ref2) {
38
+ return _defineProperty(_defineProperty(_defineProperty({}, EVENT.CREATED, function (_ref2) {
40
39
  var node = _ref2.node,
41
40
  nodeContext = _ref2.nodeContext,
42
41
  metadata = _objectWithoutProperties(_ref2, _excluded);
@@ -56,7 +55,7 @@ export var LinkEventsBinding = function LinkEventsBinding(_ref) {
56
55
  nodeContext: nodeContext,
57
56
  creationMethod: creationMethod
58
57
  });
59
- }), _defineProperty(_ref5, EVENT.UPDATED, function (_ref3) {
58
+ }), EVENT.UPDATED, function (_ref3) {
60
59
  var node = _ref3.node,
61
60
  nodeContext = _ref3.nodeContext,
62
61
  previousDisplay = _ref3.previousDisplay,
@@ -80,7 +79,7 @@ export var LinkEventsBinding = function LinkEventsBinding(_ref) {
80
79
  updateMethod: updateMethod,
81
80
  updateType: updateType
82
81
  });
83
- }), _defineProperty(_ref5, EVENT.DELETED, function (_ref4) {
82
+ }), EVENT.DELETED, function (_ref4) {
84
83
  var node = _ref4.node,
85
84
  nodeContext = _ref4.nodeContext,
86
85
  metadata = _objectWithoutProperties(_ref4, _excluded3);
@@ -102,7 +101,7 @@ export var LinkEventsBinding = function LinkEventsBinding(_ref) {
102
101
  deleteMethod: deleteMethod,
103
102
  deleteType: deleteType
104
103
  });
105
- }), _ref5;
104
+ });
106
105
  }, [linkCreated, linkUpdated, linkDeleted]);
107
106
 
108
107
  /**
@@ -1,9 +1,9 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- 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); }; }
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
8
  import React from 'react';
9
9
  import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
@@ -13,13 +13,12 @@ import { LinkEventsBinding } from './LinkEvents';
13
13
 
14
14
  // eslint-disable-next-line @repo/internal/react/no-class-components
15
15
  export var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureComponent) {
16
- _inherits(EditorLinkingPlatformAnalytics, _React$PureComponent);
17
- var _super = _createSuper(EditorLinkingPlatformAnalytics);
18
16
  function EditorLinkingPlatformAnalytics() {
19
17
  _classCallCheck(this, EditorLinkingPlatformAnalytics);
20
- return _super.apply(this, arguments);
18
+ return _callSuper(this, EditorLinkingPlatformAnalytics, arguments);
21
19
  }
22
- _createClass(EditorLinkingPlatformAnalytics, [{
20
+ _inherits(EditorLinkingPlatformAnalytics, _React$PureComponent);
21
+ return _createClass(EditorLinkingPlatformAnalytics, [{
23
22
  key: "render",
24
23
  value: function render() {
25
24
  return /*#__PURE__*/React.createElement(EditorSmartCardProvider, null, /*#__PURE__*/React.createElement(EditorSmartCardProviderValueGuard, null, /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
@@ -27,5 +26,4 @@ export var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureCo
27
26
  }, /*#__PURE__*/React.createElement(LinkEventsBinding, this.props), /*#__PURE__*/React.createElement(DatasourceEventsBinding, this.props))));
28
27
  }
29
28
  }]);
30
- return EditorLinkingPlatformAnalytics;
31
29
  }(React.PureComponent);
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
6
- var _active;
7
6
  /* eslint-disable @atlaskit/design-system/no-nested-styles */
8
7
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
9
8
  /**
@@ -39,12 +38,12 @@ var containerStyles = css({
39
38
  position: 'relative',
40
39
  lineHeight: 'normal',
41
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
42
- ':active': (_active = {}, _defineProperty(_active, ".".concat(ICON_AND_LABEL_CLASSNAME), {
41
+ ':active': _defineProperty(_defineProperty({}, ".".concat(ICON_AND_LABEL_CLASSNAME), {
43
42
  background: SMART_LINK_ACTIVE_COLOR
44
- }), _defineProperty(_active, ".".concat(OVERLAY_GRADIENT_CLASSNAME), {
43
+ }), ".".concat(OVERLAY_GRADIENT_CLASSNAME), {
45
44
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
46
45
  background: getGradientWithColor(SMART_LINK_ACTIVE_COLOR)
47
- }), _active)
46
+ })
48
47
  });
49
48
  var overlayStyles = css({
50
49
  // Set default styling to be invisible but available in dom for width calculation.
@@ -1,13 +1,12 @@
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
7
  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; }
9
8
  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
- 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); }; }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
11
  import React from 'react';
13
12
  import { AnalyticsContext } from '@atlaskit/analytics-next';
@@ -25,16 +24,14 @@ import { WithCardContext } from './WithCardContext';
25
24
  // eslint-disable-next-line @repo/internal/react/no-class-components
26
25
 
27
26
  export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
28
- _inherits(LinkToolbarAppearance, _React$Component);
29
- var _super = _createSuper(LinkToolbarAppearance);
30
27
  function LinkToolbarAppearance() {
31
28
  var _this;
32
29
  _classCallCheck(this, LinkToolbarAppearance);
33
30
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
31
  args[_key] = arguments[_key];
35
32
  }
36
- _this = _super.call.apply(_super, [this].concat(args));
37
- _defineProperty(_assertThisInitialized(_this), "renderDropdown", function (view, cardContext) {
33
+ _this = _callSuper(this, LinkToolbarAppearance, [].concat(args));
34
+ _defineProperty(_this, "renderDropdown", function (view, cardContext) {
38
35
  var _setSelectedCardAppea, _setSelectedCardAppea2, _changeSelectedCardTo, _setSelectedCardAppea3, _cardContext$store2;
39
36
  var _this$props = _this.props,
40
37
  url = _this$props.url,
@@ -134,7 +131,8 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
134
131
  });
135
132
  return _this;
136
133
  }
137
- _createClass(LinkToolbarAppearance, [{
134
+ _inherits(LinkToolbarAppearance, _React$Component);
135
+ return _createClass(LinkToolbarAppearance, [{
138
136
  key: "render",
139
137
  value: function render() {
140
138
  var _this2 = this;
@@ -144,7 +142,6 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
144
142
  });
145
143
  }
146
144
  }]);
147
- return LinkToolbarAppearance;
148
145
  }(React.Component);
149
146
  var getUnavailableMessage = function getUnavailableMessage(state, intl) {
150
147
  try {
@@ -1,14 +1,13 @@
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
8
  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; }
10
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; }
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
  /**
14
13
  * @jsxRuntime classic
@@ -24,19 +23,17 @@ import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorWid
24
23
  import { embedHeaderHeight } from '@atlaskit/smart-card';
25
24
  // eslint-disable-next-line @repo/internal/react/no-class-components
26
25
  var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
27
- _inherits(ResizableEmbedCard, _React$Component);
28
- var _super = _createSuper(ResizableEmbedCard);
29
26
  function ResizableEmbedCard() {
30
27
  var _this;
31
28
  _classCallCheck(this, ResizableEmbedCard);
32
29
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
30
  args[_key] = arguments[_key];
34
31
  }
35
- _this = _super.call.apply(_super, [this].concat(args));
36
- _defineProperty(_assertThisInitialized(_this), "state", {
32
+ _this = _callSuper(this, ResizableEmbedCard, [].concat(args));
33
+ _defineProperty(_this, "state", {
37
34
  offsetLeft: _this.calcOffsetLeft()
38
35
  });
39
- _defineProperty(_assertThisInitialized(_this), "calcNewSize", function (newWidth, stop) {
36
+ _defineProperty(_this, "calcNewSize", function (newWidth, stop) {
40
37
  var _this$props = _this.props,
41
38
  layout = _this$props.layout,
42
39
  state = _this$props.view.state;
@@ -60,7 +57,7 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
60
57
  };
61
58
  }
62
59
  });
63
- _defineProperty(_assertThisInitialized(_this), "calcUnwrappedLayout", function (pct, width) {
60
+ _defineProperty(_this, "calcUnwrappedLayout", function (pct, width) {
64
61
  if (pct <= 100) {
65
62
  return 'center';
66
63
  }
@@ -69,11 +66,11 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
69
66
  }
70
67
  return 'full-width';
71
68
  });
72
- _defineProperty(_assertThisInitialized(_this), "calcColumnLeftOffset", function () {
69
+ _defineProperty(_this, "calcColumnLeftOffset", function () {
73
70
  var offsetLeft = _this.state.offsetLeft;
74
71
  return _this.insideInlineLike ? calcColumnsFromPx(offsetLeft, _this.props.lineLength, _this.props.gridSize) : 0;
75
72
  });
76
- _defineProperty(_assertThisInitialized(_this), "calcPxWidth", function (useLayout) {
73
+ _defineProperty(_this, "calcPxWidth", function (useLayout) {
77
74
  var _this$props2 = _this.props,
78
75
  layout = _this$props2.layout,
79
76
  pctWidth = _this$props2.pctWidth,
@@ -99,7 +96,7 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
99
96
  resizedPctWidth: resizedPctWidth
100
97
  });
101
98
  });
102
- _defineProperty(_assertThisInitialized(_this), "highlights", function (newWidth, snapPoints) {
99
+ _defineProperty(_this, "highlights", function (newWidth, snapPoints) {
103
100
  var snapWidth = snapTo(newWidth, snapPoints);
104
101
  var _this$props$view$stat = _this.props.view.state.schema.nodes,
105
102
  layoutColumn = _this$props$view$stat.layoutColumn,
@@ -132,7 +129,8 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
132
129
  });
133
130
  return _this;
134
131
  }
135
- _createClass(ResizableEmbedCard, [{
132
+ _inherits(ResizableEmbedCard, _React$Component);
133
+ return _createClass(ResizableEmbedCard, [{
136
134
  key: "componentDidUpdate",
137
135
  value: function componentDidUpdate(prevProps) {
138
136
  var offsetLeft = this.calcOffsetLeft();
@@ -381,7 +379,6 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
381
379
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
382
380
  }
383
381
  }]);
384
- return ResizableEmbedCard;
385
382
  }(React.Component);
386
383
  _defineProperty(ResizableEmbedCard, "defaultProps", {
387
384
  aspectRatio: DEFAULT_EMBED_CARD_WIDTH / DEFAULT_EMBED_CARD_HEIGHT
@@ -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
  /* eslint-disable @repo/internal/react/no-class-components */
11
10
  import React from 'react';
@@ -13,22 +12,21 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
13
12
  import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
14
13
  import { setSelectedCardAppearance } from '../pm-plugins/doc';
15
14
  export var DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
16
- _inherits(DatasourceErrorBoundary, _React$Component);
17
- var _super = _createSuper(DatasourceErrorBoundary);
18
15
  function DatasourceErrorBoundary() {
19
16
  var _this;
20
17
  _classCallCheck(this, DatasourceErrorBoundary);
21
18
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22
19
  args[_key] = arguments[_key];
23
20
  }
24
- _this = _super.call.apply(_super, [this].concat(args));
25
- _defineProperty(_assertThisInitialized(_this), "state", {
21
+ _this = _callSuper(this, DatasourceErrorBoundary, [].concat(args));
22
+ _defineProperty(_this, "state", {
26
23
  isError: false,
27
24
  error: null
28
25
  });
29
26
  return _this;
30
27
  }
31
- _createClass(DatasourceErrorBoundary, [{
28
+ _inherits(DatasourceErrorBoundary, _React$Component);
29
+ return _createClass(DatasourceErrorBoundary, [{
32
30
  key: "componentDidCatch",
33
31
  value: function componentDidCatch(error) {
34
32
  if (this.props.handleError) {
@@ -78,5 +76,4 @@ export var DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
78
76
  };
79
77
  }
80
78
  }]);
81
- return DatasourceErrorBoundary;
82
79
  }(React.Component);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "4.5.4",
3
+ "version": "4.5.5",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
35
  "@atlaskit/analytics-next": "^10.2.0",
36
36
  "@atlaskit/custom-steps": "^0.9.0",
37
- "@atlaskit/editor-common": "^96.3.0",
37
+ "@atlaskit/editor-common": "^96.5.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
39
39
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
40
40
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/primitives": "^13.3.0",
58
58
  "@atlaskit/smart-card": "^32.7.0",
59
59
  "@atlaskit/theme": "^14.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^2.25.0",
60
+ "@atlaskit/tmp-editor-statsig": "^2.26.0",
61
61
  "@atlaskit/tokens": "^2.4.0",
62
62
  "@babel/runtime": "^7.0.0",
63
63
  "@emotion/react": "^11.7.1",