@atlaskit/editor-plugin-card 4.5.3 → 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 (32) hide show
  1. package/CHANGELOG.md +17 -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/cjs/ui/toolbar.js +14 -2
  15. package/dist/es2019/index.js +3 -0
  16. package/dist/es2019/nodeviews/datasource.js +7 -13
  17. package/dist/es2019/ui/toolbar.js +15 -3
  18. package/dist/esm/index.js +3 -0
  19. package/dist/esm/nodeviews/blockCard.js +14 -18
  20. package/dist/esm/nodeviews/datasource.js +25 -35
  21. package/dist/esm/nodeviews/embedCard.js +20 -24
  22. package/dist/esm/nodeviews/genericCard.js +8 -11
  23. package/dist/esm/ui/EditLinkToolbar.js +5 -7
  24. package/dist/esm/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +4 -5
  25. package/dist/esm/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +4 -5
  26. package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +5 -7
  27. package/dist/esm/ui/InlineCardOverlay/index.js +3 -4
  28. package/dist/esm/ui/LinkToolbarAppearance.js +6 -9
  29. package/dist/esm/ui/ResizableEmbedCard.js +11 -14
  30. package/dist/esm/ui/datasourceErrorBoundary.js +6 -9
  31. package/dist/esm/ui/toolbar.js +15 -3
  32. package/package.json +4 -4
@@ -7,25 +7,24 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.EditorLinkingPlatformAnalytics = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
13
  var _react = _interopRequireDefault(require("react"));
14
14
  var _linkProvider = require("@atlaskit/link-provider");
15
15
  var _EditorAnalyticsContext = require("../EditorAnalyticsContext");
16
16
  var _DatasourceEvents = require("./DatasourceEvents");
17
17
  var _LinkEvents = require("./LinkEvents");
18
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
18
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
19
19
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
20
  // eslint-disable-next-line @repo/internal/react/no-class-components
21
21
  var EditorLinkingPlatformAnalytics = exports.EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureComponent) {
22
- (0, _inherits2.default)(EditorLinkingPlatformAnalytics, _React$PureComponent);
23
- var _super = _createSuper(EditorLinkingPlatformAnalytics);
24
22
  function EditorLinkingPlatformAnalytics() {
25
23
  (0, _classCallCheck2.default)(this, EditorLinkingPlatformAnalytics);
26
- return _super.apply(this, arguments);
24
+ return _callSuper(this, EditorLinkingPlatformAnalytics, arguments);
27
25
  }
28
- (0, _createClass2.default)(EditorLinkingPlatformAnalytics, [{
26
+ (0, _inherits2.default)(EditorLinkingPlatformAnalytics, _React$PureComponent);
27
+ return (0, _createClass2.default)(EditorLinkingPlatformAnalytics, [{
29
28
  key: "render",
30
29
  value: function render() {
31
30
  return /*#__PURE__*/_react.default.createElement(_linkProvider.EditorSmartCardProvider, null, /*#__PURE__*/_react.default.createElement(_linkProvider.EditorSmartCardProviderValueGuard, null, /*#__PURE__*/_react.default.createElement(_EditorAnalyticsContext.EditorAnalyticsContext, {
@@ -33,5 +32,4 @@ var EditorLinkingPlatformAnalytics = exports.EditorLinkingPlatformAnalytics = /*
33
32
  }, /*#__PURE__*/_react.default.createElement(_LinkEvents.LinkEventsBinding, this.props), /*#__PURE__*/_react.default.createElement(_DatasourceEvents.DatasourceEventsBinding, this.props))));
34
33
  }
35
34
  }]);
36
- return EditorLinkingPlatformAnalytics;
37
35
  }(_react.default.PureComponent);
@@ -20,7 +20,6 @@ var _preferences = _interopRequireDefault(require("@atlaskit/icon/glyph/preferen
20
20
  var _colors = require("@atlaskit/theme/colors");
21
21
  var _utils = require("./utils");
22
22
  var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
23
- var _active;
24
23
  /* eslint-disable @atlaskit/design-system/no-nested-styles */
25
24
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
26
25
  /**
@@ -48,12 +47,12 @@ var containerStyles = (0, _react2.css)({
48
47
  position: 'relative',
49
48
  lineHeight: 'normal',
50
49
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
51
- ':active': (_active = {}, (0, _defineProperty2.default)(_active, ".".concat(ICON_AND_LABEL_CLASSNAME), {
50
+ ':active': (0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(ICON_AND_LABEL_CLASSNAME), {
52
51
  background: SMART_LINK_ACTIVE_COLOR
53
- }), (0, _defineProperty2.default)(_active, ".".concat(OVERLAY_GRADIENT_CLASSNAME), {
52
+ }), ".".concat(OVERLAY_GRADIENT_CLASSNAME), {
54
53
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
55
54
  background: getGradientWithColor(SMART_LINK_ACTIVE_COLOR)
56
- }), _active)
55
+ })
57
56
  });
58
57
  var overlayStyles = (0, _react2.css)({
59
58
  // Set default styling to be invisible but available in dom for width calculation.
@@ -8,10 +8,9 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.LinkToolbarAppearance = void 0;
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
15
  var _react = _interopRequireDefault(require("react"));
17
16
  var _analyticsNext = require("@atlaskit/analytics-next");
@@ -30,20 +29,18 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
30
29
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
30
  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; }
32
31
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
33
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
32
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
34
33
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
35
34
  // eslint-disable-next-line @repo/internal/react/no-class-components
36
35
  var LinkToolbarAppearance = exports.LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
37
- (0, _inherits2.default)(LinkToolbarAppearance, _React$Component);
38
- var _super = _createSuper(LinkToolbarAppearance);
39
36
  function LinkToolbarAppearance() {
40
37
  var _this;
41
38
  (0, _classCallCheck2.default)(this, LinkToolbarAppearance);
42
39
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
40
  args[_key] = arguments[_key];
44
41
  }
45
- _this = _super.call.apply(_super, [this].concat(args));
46
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderDropdown", function (view, cardContext) {
42
+ _this = _callSuper(this, LinkToolbarAppearance, [].concat(args));
43
+ (0, _defineProperty2.default)(_this, "renderDropdown", function (view, cardContext) {
47
44
  var _setSelectedCardAppea, _setSelectedCardAppea2, _changeSelectedCardTo, _setSelectedCardAppea3, _cardContext$store2;
48
45
  var _this$props = _this.props,
49
46
  url = _this$props.url,
@@ -143,7 +140,8 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = /*#__PURE__*/functio
143
140
  });
144
141
  return _this;
145
142
  }
146
- (0, _createClass2.default)(LinkToolbarAppearance, [{
143
+ (0, _inherits2.default)(LinkToolbarAppearance, _React$Component);
144
+ return (0, _createClass2.default)(LinkToolbarAppearance, [{
147
145
  key: "render",
148
146
  value: function render() {
149
147
  var _this2 = this;
@@ -153,7 +151,6 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = /*#__PURE__*/functio
153
151
  });
154
152
  }
155
153
  }]);
156
- return LinkToolbarAppearance;
157
154
  }(_react.default.Component);
158
155
  var getUnavailableMessage = function getUnavailableMessage(state, intl) {
159
156
  try {
@@ -8,10 +8,9 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
15
  var _react = _interopRequireDefault(require("react"));
17
16
  var _react2 = require("@emotion/react");
@@ -21,26 +20,24 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
20
  var _smartCard = require("@atlaskit/smart-card");
22
21
  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; }
23
22
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
23
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
25
24
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
26
25
  * @jsxRuntime classic
27
26
  * @jsx jsx
28
27
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
29
28
  // eslint-disable-next-line @repo/internal/react/no-class-components
30
29
  var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Component) {
31
- (0, _inherits2.default)(ResizableEmbedCard, _React$Component);
32
- var _super = _createSuper(ResizableEmbedCard);
33
30
  function ResizableEmbedCard() {
34
31
  var _this;
35
32
  (0, _classCallCheck2.default)(this, ResizableEmbedCard);
36
33
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
37
34
  args[_key] = arguments[_key];
38
35
  }
39
- _this = _super.call.apply(_super, [this].concat(args));
40
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
36
+ _this = _callSuper(this, ResizableEmbedCard, [].concat(args));
37
+ (0, _defineProperty2.default)(_this, "state", {
41
38
  offsetLeft: _this.calcOffsetLeft()
42
39
  });
43
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcNewSize", function (newWidth, stop) {
40
+ (0, _defineProperty2.default)(_this, "calcNewSize", function (newWidth, stop) {
44
41
  var _this$props = _this.props,
45
42
  layout = _this$props.layout,
46
43
  state = _this$props.view.state;
@@ -64,7 +61,7 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
64
61
  };
65
62
  }
66
63
  });
67
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcUnwrappedLayout", function (pct, width) {
64
+ (0, _defineProperty2.default)(_this, "calcUnwrappedLayout", function (pct, width) {
68
65
  if (pct <= 100) {
69
66
  return 'center';
70
67
  }
@@ -73,11 +70,11 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
73
70
  }
74
71
  return 'full-width';
75
72
  });
76
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcColumnLeftOffset", function () {
73
+ (0, _defineProperty2.default)(_this, "calcColumnLeftOffset", function () {
77
74
  var offsetLeft = _this.state.offsetLeft;
78
75
  return _this.insideInlineLike ? (0, _ui.calcColumnsFromPx)(offsetLeft, _this.props.lineLength, _this.props.gridSize) : 0;
79
76
  });
80
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcPxWidth", function (useLayout) {
77
+ (0, _defineProperty2.default)(_this, "calcPxWidth", function (useLayout) {
81
78
  var _this$props2 = _this.props,
82
79
  layout = _this$props2.layout,
83
80
  pctWidth = _this$props2.pctWidth,
@@ -103,7 +100,7 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
103
100
  resizedPctWidth: resizedPctWidth
104
101
  });
105
102
  });
106
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "highlights", function (newWidth, snapPoints) {
103
+ (0, _defineProperty2.default)(_this, "highlights", function (newWidth, snapPoints) {
107
104
  var snapWidth = (0, _ui.snapTo)(newWidth, snapPoints);
108
105
  var _this$props$view$stat = _this.props.view.state.schema.nodes,
109
106
  layoutColumn = _this$props$view$stat.layoutColumn,
@@ -136,7 +133,8 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
136
133
  });
137
134
  return _this;
138
135
  }
139
- (0, _createClass2.default)(ResizableEmbedCard, [{
136
+ (0, _inherits2.default)(ResizableEmbedCard, _React$Component);
137
+ return (0, _createClass2.default)(ResizableEmbedCard, [{
140
138
  key: "componentDidUpdate",
141
139
  value: function componentDidUpdate(prevProps) {
142
140
  var offsetLeft = this.calcOffsetLeft();
@@ -385,7 +383,6 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
385
383
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
386
384
  }
387
385
  }]);
388
- return ResizableEmbedCard;
389
386
  }(_react.default.Component);
390
387
  (0, _defineProperty2.default)(ResizableEmbedCard, "defaultProps", {
391
388
  aspectRatio: _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT
@@ -7,34 +7,32 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.DatasourceErrorBoundary = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
14
  var _react = _interopRequireDefault(require("react"));
16
15
  var _adfSchema = require("@atlaskit/adf-schema");
17
16
  var _linkDatasource = require("@atlaskit/link-datasource");
18
17
  var _doc = require("../pm-plugins/doc");
19
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
18
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
20
19
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/react/no-class-components */
21
20
  var DatasourceErrorBoundary = exports.DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
22
- (0, _inherits2.default)(DatasourceErrorBoundary, _React$Component);
23
- var _super = _createSuper(DatasourceErrorBoundary);
24
21
  function DatasourceErrorBoundary() {
25
22
  var _this;
26
23
  (0, _classCallCheck2.default)(this, DatasourceErrorBoundary);
27
24
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
25
  args[_key] = arguments[_key];
29
26
  }
30
- _this = _super.call.apply(_super, [this].concat(args));
31
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
27
+ _this = _callSuper(this, DatasourceErrorBoundary, [].concat(args));
28
+ (0, _defineProperty2.default)(_this, "state", {
32
29
  isError: false,
33
30
  error: null
34
31
  });
35
32
  return _this;
36
33
  }
37
- (0, _createClass2.default)(DatasourceErrorBoundary, [{
34
+ (0, _inherits2.default)(DatasourceErrorBoundary, _React$Component);
35
+ return (0, _createClass2.default)(DatasourceErrorBoundary, [{
38
36
  key: "componentDidCatch",
39
37
  value: function componentDidCatch(error) {
40
38
  if (this.props.handleError) {
@@ -84,5 +82,4 @@ var DatasourceErrorBoundary = exports.DatasourceErrorBoundary = /*#__PURE__*/fun
84
82
  };
85
83
  }
86
84
  }]);
87
- return DatasourceErrorBoundary;
88
85
  }(_react.default.Component);
@@ -218,9 +218,21 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
218
218
  });
219
219
  var isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard && (0, _platformFeatureFlags.fg)('platform_inline_node_as_valid_annotation_selection');
220
220
  var onCommentButtonClick = function onCommentButtonClick(state, dispatch) {
221
+ var _pluginInjectionApi$a3;
221
222
  if (!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.annotation) || !isCommentEnabled) {
222
223
  return false;
223
224
  }
225
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 || (_pluginInjectionApi$a3 = _pluginInjectionApi$a3.actions) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.fireAnalyticsEvent({
226
+ action: _analytics.ACTION.CLICKED,
227
+ actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
228
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU,
229
+ eventType: _analytics.EVENT_TYPE.UI,
230
+ attributes: {
231
+ source: 'highlightActionsMenu',
232
+ pageMode: 'edit',
233
+ sourceNode: 'inlineCard'
234
+ }
235
+ });
224
236
  var setInlineCommentDraftState = pluginInjectionApi.annotation.actions.setInlineCommentDraftState;
225
237
  var command = setInlineCommentDraftState(true, _analytics.INPUT_METHOD.FLOATING_TB);
226
238
  return command(state, dispatch);
@@ -313,8 +325,8 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
313
325
  onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
314
326
  }]);
315
327
  if (currentAppearance === 'embed') {
316
- var _pluginInjectionApi$a3;
317
- var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, cardOptions);
328
+ var _pluginInjectionApi$a4;
329
+ var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, cardOptions);
318
330
  if (alignmentOptions.length) {
319
331
  alignmentOptions.push({
320
332
  type: 'separator'
@@ -1 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
1
4
  export { cardPlugin } from './cardPlugin';
@@ -14,7 +14,6 @@ import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
14
14
  import { DatasourceTableView } from '@atlaskit/link-datasource';
15
15
  import { EditorSmartCardProvider, EditorSmartCardProviderValueGuard } from '@atlaskit/link-provider';
16
16
  import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
17
- import { fg } from '@atlaskit/platform-feature-flags';
18
17
  import { DatasourceErrorBoundary } from '../ui/datasourceErrorBoundary';
19
18
  import { EditorAnalyticsContext } from '../ui/EditorAnalyticsContext';
20
19
  const getPosSafely = pos => {
@@ -218,25 +217,20 @@ export class Datasource extends ReactNodeView {
218
217
  * @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
219
218
  */
220
219
  stopEvent(event) {
221
- if (fg('platform-datasources-enable-two-way-sync')) {
222
- const isFormElement = [HTMLButtonElement, HTMLInputElement].some(element => event.target instanceof element);
223
- if (isFormElement) {
224
- return true;
225
- }
220
+ const isFormElement = [HTMLButtonElement, HTMLInputElement].some(element => event.target instanceof element);
221
+ if (isFormElement) {
222
+ return true;
226
223
  }
227
224
  return false;
228
225
  }
229
226
  render() {
230
- var _attrs$datasource;
227
+ var _this$domRef, _attrs$datasource;
231
228
  const {
232
229
  attrs
233
230
  } = this.node;
234
- if (fg('platform-datasources-enable-two-way-sync')) {
235
- var _this$domRef;
236
- // EDM-10607: Workaround to remove datasource table draggable attribute
237
- // @ts-ignore TS2341: Property domRef is private
238
- (_this$domRef = this.domRef) === null || _this$domRef === void 0 ? void 0 : _this$domRef.setAttribute('draggable', 'false');
239
- }
231
+ // EDM-10607: Workaround to remove datasource table draggable attribute
232
+ // @ts-ignore TS2341: Property domRef is private
233
+ (_this$domRef = this.domRef) === null || _this$domRef === void 0 ? void 0 : _this$domRef.setAttribute('draggable', 'false');
240
234
  return jsx(DatasourceErrorBoundary, {
241
235
  unsupportedComponent: UnsupportedInline,
242
236
  view: this.view,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { isSafeUrl } from '@atlaskit/adf-schema';
3
- import { ACTION, ACTION_SUBJECT, buildOpenedSettingsPayload, buildVisitedLinkPayload, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID as ACTION_SUBJECTID, buildOpenedSettingsPayload, buildVisitedLinkPayload, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { buildLayoutButtons, commandWithMetadata } from '@atlaskit/editor-common/card';
5
5
  import { getLinkPreferencesURLFromENV } from '@atlaskit/editor-common/link';
6
6
  import commonMessages, { annotationMessages, linkMessages, linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
@@ -208,9 +208,21 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
208
208
  const activeCommentMark = node.marks.find(mark => mark.type.name === 'annotation' && (annotationApiState === null || annotationApiState === void 0 ? void 0 : annotationApiState.annotations[mark.attrs.id]) === false);
209
209
  const isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard && fg('platform_inline_node_as_valid_annotation_selection');
210
210
  const onCommentButtonClick = (state, dispatch) => {
211
+ var _pluginInjectionApi$a3, _pluginInjectionApi$a4;
211
212
  if (!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.annotation) || !isCommentEnabled) {
212
213
  return false;
213
214
  }
215
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : (_pluginInjectionApi$a4 = _pluginInjectionApi$a3.actions) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.fireAnalyticsEvent({
216
+ action: ACTION.CLICKED,
217
+ actionSubject: ACTION_SUBJECT.BUTTON,
218
+ actionSubjectId: ACTION_SUBJECTID.CREATE_INLINE_COMMENT_FROM_HIGHLIGHT_ACTIONS_MENU,
219
+ eventType: EVENT_TYPE.UI,
220
+ attributes: {
221
+ source: 'highlightActionsMenu',
222
+ pageMode: 'edit',
223
+ sourceNode: 'inlineCard'
224
+ }
225
+ });
214
226
  const {
215
227
  setInlineCommentDraftState
216
228
  } = pluginInjectionApi.annotation.actions;
@@ -305,8 +317,8 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
305
317
  onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
306
318
  }];
307
319
  if (currentAppearance === 'embed') {
308
- var _pluginInjectionApi$a3;
309
- const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, cardOptions);
320
+ var _pluginInjectionApi$a5;
321
+ const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions, cardOptions);
310
322
  if (alignmentOptions.length) {
311
323
  alignmentOptions.push({
312
324
  type: 'separator'
package/dist/esm/index.js CHANGED
@@ -1 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
1
4
  export { cardPlugin } from './cardPlugin';
@@ -1,12 +1,12 @@
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
- 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 _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; }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  import React from 'react';
12
12
  import rafSchedule from 'raf-schd';
@@ -22,13 +22,11 @@ import { Card } from './genericCard';
22
22
 
23
23
  // eslint-disable-next-line @repo/internal/react/no-class-components
24
24
  export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
25
- _inherits(BlockCardComponent, _React$PureComponent);
26
- var _super = _createSuper(BlockCardComponent);
27
25
  function BlockCardComponent(props) {
28
26
  var _this;
29
27
  _classCallCheck(this, BlockCardComponent);
30
- _this = _super.call(this, props);
31
- _defineProperty(_assertThisInitialized(_this), "onResolve", function (data) {
28
+ _this = _callSuper(this, BlockCardComponent, [props]);
29
+ _defineProperty(_this, "onResolve", function (data) {
32
30
  var _this$props = _this.props,
33
31
  getPos = _this$props.getPos,
34
32
  view = _this$props.view;
@@ -52,7 +50,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
52
50
  })(view.state.tr));
53
51
  })();
54
52
  });
55
- _defineProperty(_assertThisInitialized(_this), "gapCursorSpan", function () {
53
+ _defineProperty(_this, "gapCursorSpan", function () {
56
54
  // Don't render in EdgeHTMl version <= 18 (Edge version 44)
57
55
  // as it forces the edit popup to render 24px lower than it should
58
56
  if (browser.ie && browser.ie_version < 79) {
@@ -65,7 +63,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
65
63
  contentEditable: true
66
64
  });
67
65
  });
68
- _defineProperty(_assertThisInitialized(_this), "onError", function (_ref) {
66
+ _defineProperty(_this, "onError", function (_ref) {
69
67
  var err = _ref.err;
70
68
  if (err) {
71
69
  throw err;
@@ -74,7 +72,8 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
74
72
  _this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
75
73
  return _this;
76
74
  }
77
- _createClass(BlockCardComponent, [{
75
+ _inherits(BlockCardComponent, _React$PureComponent);
76
+ return _createClass(BlockCardComponent, [{
78
77
  key: "render",
79
78
  value: function render() {
80
79
  var _this$props2 = this.props,
@@ -103,25 +102,23 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
103
102
  }, cardInner) : data ? cardInner : null);
104
103
  }
105
104
  }]);
106
- return BlockCardComponent;
107
105
  }(React.PureComponent);
108
106
  var WrappedBlockCard = Card(BlockCardComponent, UnsupportedBlock);
109
107
  export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
110
- _inherits(BlockCard, _ReactNodeView);
111
- var _super2 = _createSuper(BlockCard);
112
108
  function BlockCard() {
113
109
  var _this2;
114
110
  _classCallCheck(this, BlockCard);
115
111
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
116
112
  args[_key] = arguments[_key];
117
113
  }
118
- _this2 = _super2.call.apply(_super2, [this].concat(args));
119
- _defineProperty(_assertThisInitialized(_this2), "updateContentEditable", function (editorViewModeState, divElement) {
114
+ _this2 = _callSuper(this, BlockCard, [].concat(args));
115
+ _defineProperty(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
120
116
  divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
121
117
  });
122
118
  return _this2;
123
119
  }
124
- _createClass(BlockCard, [{
120
+ _inherits(BlockCard, _ReactNodeView);
121
+ return _createClass(BlockCard, [{
125
122
  key: "createDomRef",
126
123
  value: function createDomRef() {
127
124
  var _this3 = this;
@@ -157,7 +154,7 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
157
154
  }, {
158
155
  key: "update",
159
156
  value: function update(node, decorations, _innerDecorations) {
160
- return _get(_getPrototypeOf(BlockCard.prototype), "update", this).call(this, node, decorations, _innerDecorations, this.validUpdate);
157
+ return _superPropGet(BlockCard, "update", this, 3)([node, decorations, _innerDecorations, this.validUpdate]);
161
158
  }
162
159
  }, {
163
160
  key: "render",
@@ -182,7 +179,6 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
182
179
  (_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 || _this$unsubscribe.call(this);
183
180
  }
184
181
  }]);
185
- return BlockCard;
186
182
  }(ReactNodeView);
187
183
  export var blockCardNodeView = function blockCardNodeView(_ref3) {
188
184
  var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,