@atlaskit/smart-card 32.7.5 → 32.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/extractors/flexible/actions/index.js +5 -7
  3. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +9 -6
  4. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +4 -5
  5. package/dist/cjs/state/hooks/use-ai-summary/index.js +18 -4
  6. package/dist/cjs/utils/analytics/analytics.js +4 -6
  7. package/dist/cjs/utils/mocks.js +5 -7
  8. package/dist/cjs/view/BlockCard/views/styled.js +1 -1
  9. package/dist/cjs/view/Card/index.js +5 -7
  10. package/dist/cjs/view/EmbedCard/EmbedResizeMessageListener.js +7 -10
  11. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
  12. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +10 -12
  13. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
  14. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +61 -61
  15. package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +1 -1
  16. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +34 -34
  17. package/dist/cjs/view/FlexibleCard/components/utils.js +5 -5
  18. package/dist/cjs/view/HoverCard/styled.js +1 -1
  19. package/dist/cjs/view/InlineCard/ErroredView/index.js +8 -11
  20. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +10 -13
  21. package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +7 -10
  22. package/dist/cjs/view/InlineCard/ResolvedView/index.js +5 -7
  23. package/dist/cjs/view/InlineCard/ResolvingView/index.js +5 -7
  24. package/dist/cjs/view/LinkUrl/index.js +1 -1
  25. package/dist/cjs/view/LinkView/index.js +5 -7
  26. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -1
  27. package/dist/es2019/state/hooks/use-ai-summary/index.js +13 -1
  28. package/dist/es2019/utils/analytics/analytics.js +1 -1
  29. package/dist/es2019/view/BlockCard/views/styled.js +1 -1
  30. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
  31. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +3 -3
  32. package/dist/es2019/view/FlexibleCard/components/utils.js +3 -3
  33. package/dist/es2019/view/HoverCard/styled.js +1 -1
  34. package/dist/es2019/view/LinkUrl/index.js +1 -1
  35. package/dist/esm/extractors/flexible/actions/index.js +5 -7
  36. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +9 -6
  37. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +4 -5
  38. package/dist/esm/state/hooks/use-ai-summary/index.js +18 -4
  39. package/dist/esm/utils/analytics/analytics.js +4 -6
  40. package/dist/esm/utils/mocks.js +5 -7
  41. package/dist/esm/view/BlockCard/views/styled.js +1 -1
  42. package/dist/esm/view/Card/index.js +5 -7
  43. package/dist/esm/view/EmbedCard/EmbedResizeMessageListener.js +7 -10
  44. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
  45. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +10 -12
  46. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
  47. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +61 -61
  48. package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +1 -1
  49. package/dist/esm/view/FlexibleCard/components/elements/utils.js +34 -34
  50. package/dist/esm/view/FlexibleCard/components/utils.js +5 -5
  51. package/dist/esm/view/HoverCard/styled.js +1 -1
  52. package/dist/esm/view/InlineCard/ErroredView/index.js +8 -11
  53. package/dist/esm/view/InlineCard/ForbiddenView/index.js +10 -13
  54. package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +7 -10
  55. package/dist/esm/view/InlineCard/ResolvedView/index.js +5 -7
  56. package/dist/esm/view/InlineCard/ResolvingView/index.js +5 -7
  57. package/dist/esm/view/LinkUrl/index.js +1 -1
  58. package/dist/esm/view/LinkView/index.js +5 -7
  59. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +1 -0
  60. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -0
  61. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +1 -0
  62. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -0
  63. package/package.json +4 -1
@@ -8,10 +8,9 @@ exports.InlineCardForbiddenView = 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 _reactIntlNext = require("react-intl-next");
@@ -27,7 +26,7 @@ var _IconAndTitleLayout = require("../IconAndTitleLayout");
27
26
  var _styled = require("../IconAndTitleLayout/styled");
28
27
  var _styled2 = require("../styled");
29
28
  var _withFrameStyleControl = _interopRequireDefault(require("../utils/withFrameStyleControl"));
30
- 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); }; }
29
+ 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)); }
31
30
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
32
31
  var FallbackForbiddenIcon = /*#__PURE__*/_react.default.createElement(_Icon.AKIconWrapper, null, /*#__PURE__*/_react.default.createElement(_lockFilled.default, {
33
32
  label: "error",
@@ -36,8 +35,6 @@ var FallbackForbiddenIcon = /*#__PURE__*/_react.default.createElement(_Icon.AKIc
36
35
  testId: "forbidden-view-fallback-icon"
37
36
  }));
38
37
  var InlineCardForbiddenView = exports.InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
39
- (0, _inherits2.default)(InlineCardForbiddenView, _React$Component);
40
- var _super = _createSuper(InlineCardForbiddenView);
41
38
  function InlineCardForbiddenView() {
42
39
  var _this$props;
43
40
  var _this;
@@ -45,12 +42,12 @@ var InlineCardForbiddenView = exports.InlineCardForbiddenView = /*#__PURE__*/fun
45
42
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
46
43
  args[_key] = arguments[_key];
47
44
  }
48
- _this = _super.call.apply(_super, [this].concat(args));
49
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "frameRef", /*#__PURE__*/_react.default.createRef());
50
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
45
+ _this = _callSuper(this, InlineCardForbiddenView, [].concat(args));
46
+ (0, _defineProperty2.default)(_this, "frameRef", /*#__PURE__*/_react.default.createRef());
47
+ (0, _defineProperty2.default)(_this, "state", {
51
48
  hasRequestAccessContextMessage: !!((_this$props = _this.props) !== null && _this$props !== void 0 && (_this$props = _this$props.requestAccessContext) !== null && _this$props !== void 0 && _this$props.callToActionMessageKey)
52
49
  });
53
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRetry", function (event) {
50
+ (0, _defineProperty2.default)(_this, "handleRetry", function (event) {
54
51
  var onAuthorise = _this.props.onAuthorise;
55
52
  event.preventDefault();
56
53
  event.stopPropagation();
@@ -61,7 +58,7 @@ var InlineCardForbiddenView = exports.InlineCardForbiddenView = /*#__PURE__*/fun
61
58
  (_this$props2 = _this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.requestAccessContext) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.action) === null || _this$props2 === void 0 || _this$props2.promise();
62
59
  }
63
60
  });
64
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderForbiddenAccessMessage", function () {
61
+ (0, _defineProperty2.default)(_this, "renderForbiddenAccessMessage", function () {
65
62
  var _this$props3;
66
63
  if ((_this$props3 = _this.props) !== null && _this$props3 !== void 0 && (_this$props3 = _this$props3.requestAccessContext) !== null && _this$props3 !== void 0 && _this$props3.callToActionMessageKey) {
67
64
  var callToActionMessageKey = _this.props.requestAccessContext.callToActionMessageKey;
@@ -75,7 +72,7 @@ var InlineCardForbiddenView = exports.InlineCardForbiddenView = /*#__PURE__*/fun
75
72
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formattedMessage);
76
73
  }));
77
74
  });
78
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderActionButton", function () {
75
+ (0, _defineProperty2.default)(_this, "renderActionButton", function () {
79
76
  var _this$props$requestAc;
80
77
  var onAuthorise = _this.props.onAuthorise;
81
78
  var ActionButton = (0, _withFrameStyleControl.default)(_button.default, _this.frameRef);
@@ -105,7 +102,8 @@ var InlineCardForbiddenView = exports.InlineCardForbiddenView = /*#__PURE__*/fun
105
102
  });
106
103
  return _this;
107
104
  }
108
- (0, _createClass2.default)(InlineCardForbiddenView, [{
105
+ (0, _inherits2.default)(InlineCardForbiddenView, _React$Component);
106
+ return (0, _createClass2.default)(InlineCardForbiddenView, [{
109
107
  key: "render",
110
108
  value: function render() {
111
109
  var _this$props4 = this.props,
@@ -136,5 +134,4 @@ var InlineCardForbiddenView = exports.InlineCardForbiddenView = /*#__PURE__*/fun
136
134
  return content;
137
135
  }
138
136
  }]);
139
- return InlineCardForbiddenView;
140
137
  }(_react.default.Component);
@@ -7,10 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.IconAndTitleLayout = 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 _reactRenderImage = _interopRequireDefault(require("react-render-image"));
@@ -18,19 +17,17 @@ var _link = _interopRequireDefault(require("@atlaskit/icon/core/migration/link")
18
17
  var _Icon = require("../Icon");
19
18
  var _styled = require("../styled");
20
19
  var _styled2 = require("./styled");
21
- 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); }; }
20
+ 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)); }
22
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
22
  var IconAndTitleLayout = exports.IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
24
- (0, _inherits2.default)(IconAndTitleLayout, _React$Component);
25
- var _super = _createSuper(IconAndTitleLayout);
26
23
  function IconAndTitleLayout() {
27
24
  var _this;
28
25
  (0, _classCallCheck2.default)(this, IconAndTitleLayout);
29
26
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
30
27
  args[_key] = arguments[_key];
31
28
  }
32
- _this = _super.call.apply(_super, [this].concat(args));
33
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (event) {
29
+ _this = _callSuper(this, IconAndTitleLayout, [].concat(args));
30
+ (0, _defineProperty2.default)(_this, "handleClick", function (event) {
34
31
  var onClick = _this.props.onClick;
35
32
  if (onClick) {
36
33
  event.preventDefault();
@@ -38,7 +35,7 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = /*#__PURE__*/function (_Re
38
35
  onClick(event);
39
36
  }
40
37
  });
41
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyPress", function (event) {
38
+ (0, _defineProperty2.default)(_this, "handleKeyPress", function (event) {
42
39
  var onClick = _this.props.onClick;
43
40
  if (event.key !== ' ' && event.key !== 'Enter') {
44
41
  return;
@@ -51,7 +48,8 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = /*#__PURE__*/function (_Re
51
48
  });
52
49
  return _this;
53
50
  }
54
- (0, _createClass2.default)(IconAndTitleLayout, [{
51
+ (0, _inherits2.default)(IconAndTitleLayout, _React$Component);
52
+ return (0, _createClass2.default)(IconAndTitleLayout, [{
55
53
  key: "renderAtlaskitIcon",
56
54
  value: function renderAtlaskitIcon() {
57
55
  var _this$props = this.props,
@@ -158,7 +156,6 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = /*#__PURE__*/function (_Re
158
156
  );
159
157
  }
160
158
  }]);
161
- return IconAndTitleLayout;
162
159
  }(_react.default.Component);
163
160
  (0, _defineProperty2.default)(IconAndTitleLayout, "defaultProps", {
164
161
  rightSideSpacer: true
@@ -7,25 +7,24 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.InlineCardResolvedView = 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 _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
15
15
  var _HoverCard = require("../../HoverCard");
16
16
  var _Frame = require("../Frame");
17
17
  var _IconAndTitleLayout = require("../IconAndTitleLayout");
18
18
  var _styled = require("../IconAndTitleLayout/styled");
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); }; }
19
+ 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
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
21
  var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
22
- (0, _inherits2.default)(InlineCardResolvedView, _React$Component);
23
- var _super = _createSuper(InlineCardResolvedView);
24
22
  function InlineCardResolvedView() {
25
23
  (0, _classCallCheck2.default)(this, InlineCardResolvedView);
26
- return _super.apply(this, arguments);
24
+ return _callSuper(this, InlineCardResolvedView, arguments);
27
25
  }
28
- (0, _createClass2.default)(InlineCardResolvedView, [{
26
+ (0, _inherits2.default)(InlineCardResolvedView, _React$Component);
27
+ return (0, _createClass2.default)(InlineCardResolvedView, [{
29
28
  key: "renderLozenge",
30
29
  value: function renderLozenge() {
31
30
  var lozenge = this.props.lozenge;
@@ -87,5 +86,4 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
87
86
  return inlineCardResolvedView;
88
87
  }
89
88
  }]);
90
- return InlineCardResolvedView;
91
89
  }(_react.default.Component);
@@ -7,25 +7,24 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.InlineCardResolvingView = 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 _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
15
15
  var _Frame = require("../Frame");
16
16
  var _IconAndTitleLayout = require("../IconAndTitleLayout");
17
17
  var _styled = require("../IconAndTitleLayout/styled");
18
18
  var _styled2 = require("./styled");
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); }; }
19
+ 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
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
21
  var InlineCardResolvingView = exports.InlineCardResolvingView = /*#__PURE__*/function (_React$Component) {
22
- (0, _inherits2.default)(InlineCardResolvingView, _React$Component);
23
- var _super = _createSuper(InlineCardResolvingView);
24
22
  function InlineCardResolvingView() {
25
23
  (0, _classCallCheck2.default)(this, InlineCardResolvingView);
26
- return _super.apply(this, arguments);
24
+ return _callSuper(this, InlineCardResolvingView, arguments);
27
25
  }
28
- (0, _createClass2.default)(InlineCardResolvingView, [{
26
+ (0, _inherits2.default)(InlineCardResolvingView, _React$Component);
27
+ return (0, _createClass2.default)(InlineCardResolvingView, [{
29
28
  key: "render",
30
29
  value: function render() {
31
30
  var _this$props = this.props,
@@ -68,5 +67,4 @@ var InlineCardResolvingView = exports.InlineCardResolvingView = /*#__PURE__*/fun
68
67
  }
69
68
  }
70
69
  }]);
71
- return InlineCardResolvingView;
72
70
  }(_react.default.Component);
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
20
20
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
21
21
  var PACKAGE_DATA = {
22
22
  packageName: "@atlaskit/smart-card",
23
- packageVersion: "32.7.5",
23
+ packageVersion: "32.7.7",
24
24
  componentName: 'linkUrl'
25
25
  };
26
26
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -8,21 +8,20 @@ exports.CardLinkView = 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 _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _Frame = require("../InlineCard/Frame");
16
- 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); }; }
16
+ 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)); }
17
17
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
18
  var CardLinkView = exports.CardLinkView = /*#__PURE__*/function (_React$PureComponent) {
19
- (0, _inherits2.default)(CardLinkView, _React$PureComponent);
20
- var _super = _createSuper(CardLinkView);
21
19
  function CardLinkView() {
22
20
  (0, _classCallCheck2.default)(this, CardLinkView);
23
- return _super.apply(this, arguments);
21
+ return _callSuper(this, CardLinkView, arguments);
24
22
  }
25
- (0, _createClass2.default)(CardLinkView, [{
23
+ (0, _inherits2.default)(CardLinkView, _React$PureComponent);
24
+ return (0, _createClass2.default)(CardLinkView, [{
26
25
  key: "render",
27
26
  value: function render() {
28
27
  return /*#__PURE__*/_react.default.createElement(_Frame.Frame, (0, _extends2.default)({
@@ -30,5 +29,4 @@ var CardLinkView = exports.CardLinkView = /*#__PURE__*/function (_React$PureComp
30
29
  }, this.props), this.props.placeholder || this.props.link);
31
30
  }
32
31
  }]);
33
- return CardLinkView;
34
32
  }(_react.default.PureComponent);
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import uuid from 'uuid';
3
3
  import { getBaseUrl } from '@atlaskit/linking-common';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { readStream } from './readStream';
5
6
  import { ChunkProcessingError } from './types';
6
7
  import { addPath, getXProductHeaderValue } from './utils';
@@ -27,7 +28,10 @@ export class AISummaryService {
27
28
  content_url: this.url,
28
29
  content_ari: this.ari,
29
30
  prompt_id: 'smart_links',
30
- summary_output_mimetype: 'text/markdown'
31
+ summary_output_mimetype: 'text/markdown',
32
+ ...(fg('send_locale_to_summarize_in_assistance-service') && {
33
+ locale: this.locale
34
+ })
31
35
  }
32
36
  };
33
37
  const options = {
@@ -53,6 +57,7 @@ export class AISummaryService {
53
57
  };
54
58
  this.url = props.url;
55
59
  this.ari = props.ari;
60
+ this.locale = props.locale;
56
61
  this.onStart = props.onStart;
57
62
  this.onSuccess = props.onSuccess;
58
63
  this.onError = props.onError;
@@ -1,4 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
2
4
  import { AISummaryService } from './ai-summary-service';
3
5
  import { AISummariesStore } from './ai-summary-service/store';
4
6
  /**
@@ -21,6 +23,13 @@ export const useAISummary = props => {
21
23
  status: 'ready',
22
24
  content: ''
23
25
  });
26
+ const {
27
+ locale
28
+ } = fg('send_locale_to_summarize_in_assistance-service') ?
29
+ // eslint-disable-next-line react-hooks/rules-of-hooks
30
+ useIntl() : {
31
+ locale: undefined
32
+ };
24
33
  useEffect(() => {
25
34
  var _AISummariesStore$get2;
26
35
  //do not create a service for the empty URL string when the link data is not yet available,
@@ -32,6 +41,9 @@ export const useAISummary = props => {
32
41
  baseUrl,
33
42
  product,
34
43
  envKey,
44
+ ...(fg('send_locale_to_summarize_in_assistance-service') && {
45
+ locale
46
+ }),
35
47
  onError,
36
48
  onStart,
37
49
  onSuccess
@@ -40,7 +52,7 @@ export const useAISummary = props => {
40
52
 
41
53
  //returns function that calls unsubscribe method
42
54
  return (_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.subscribe(setState);
43
- }, [url, baseUrl, onError, onStart, onSuccess, product, ari, envKey]);
55
+ }, [url, baseUrl, onError, onStart, onSuccess, product, ari, envKey, locale]);
44
56
  const summariseUrl = () => {
45
57
  var _AISummariesStore$get3;
46
58
  return (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.summariseUrl();
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "32.7.5"
7
+ packageVersion: "32.7.7"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -23,7 +23,7 @@ export const titleBlockCss = css({
23
23
  gap: "var(--ds-space-100, 0.5em)",
24
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
25
25
  "[data-smart-element='Title']": {
26
- fontWeight: 600
26
+ fontWeight: "var(--ds-font-weight-semibold, 600)"
27
27
  }
28
28
  });
29
29
 
@@ -26,7 +26,7 @@ const getButtonStyle = (size, iconOnly) => {
26
26
  case SmartLinkSize.Small:
27
27
  return css({
28
28
  fontSize: '0.75rem',
29
- fontWeight: 500,
29
+ fontWeight: "var(--ds-font-weight-medium, 500)",
30
30
  lineHeight: '1rem',
31
31
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
32
32
  'button, button:hover, button:focus, button:active': [{
@@ -57,8 +57,8 @@ export const renderWithDi = (node, dependencies = [], options) => render(node, {
57
57
  }
58
58
  });
59
59
  export const createGenericComponent = (displayName, renderChildren = true, childrenParams) => {
60
- var _class;
61
- return _class = class extends Component {
60
+ var _Class;
61
+ return _Class = class extends Component {
62
62
  render() {
63
63
  if (renderChildren && typeof this.props.children === 'function') {
64
64
  if (childrenParams) {
@@ -71,5 +71,5 @@ export const createGenericComponent = (displayName, renderChildren = true, child
71
71
  }
72
72
  return null;
73
73
  }
74
- }, _defineProperty(_class, "displayName", displayName), _class;
74
+ }, _defineProperty(_Class, "displayName", displayName), _Class;
75
75
  };
@@ -98,7 +98,7 @@ export const getLinkSizeStyles = size => {
98
98
  case SmartLinkSize.XLarge:
99
99
  return css({
100
100
  fontSize: '1.25rem',
101
- fontWeight: 400,
101
+ fontWeight: "var(--ds-font-weight-regular, 400)",
102
102
  letterSpacing: '-0.008em',
103
103
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
104
104
  lineHeight: getLinkLineHeight(size)
@@ -107,7 +107,7 @@ export const getLinkSizeStyles = size => {
107
107
  case SmartLinkSize.Medium:
108
108
  return css({
109
109
  fontSize: '0.875rem',
110
- fontWeight: 400,
110
+ fontWeight: "var(--ds-font-weight-regular, 400)",
111
111
  letterSpacing: '-0.003em',
112
112
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
113
113
  lineHeight: getLinkLineHeight(size)
@@ -116,7 +116,7 @@ export const getLinkSizeStyles = size => {
116
116
  default:
117
117
  return css({
118
118
  fontSize: '0.75rem',
119
- fontWeight: 400,
119
+ fontWeight: "var(--ds-font-weight-regular, 400)",
120
120
  letterSpacing: '0em',
121
121
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
122
122
  lineHeight: getLinkLineHeight(size)
@@ -58,7 +58,7 @@ export const titleBlockCss = css`
58
58
  }
59
59
 
60
60
  [data-smart-element='Title'] {
61
- font-weight: 600;
61
+ font-weight: ${"var(--ds-font-weight-semibold, 600)"};
62
62
  }
63
63
  `;
64
64
  export const getTransitionStyles = snippetHeight => css({
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "32.7.5",
13
+ packageVersion: "32.7.7",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -11,7 +11,6 @@ import extractFollowAction from './extract-follow-action';
11
11
  import { extractPreviewAction, extractPreviewClientAction } from './extract-preview-action';
12
12
  import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
13
13
  export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref) {
14
- var _objectSpread2;
15
14
  var actionOptions = _ref.actionOptions,
16
15
  aiSummaryConfig = _ref.aiSummaryConfig,
17
16
  appearance = _ref.appearance,
@@ -20,24 +19,24 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
20
19
  origin = _ref.origin,
21
20
  response = _ref.response,
22
21
  url = _ref.url;
23
- var action = _objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, ActionName.CopyLinkAction, extractCopyLinkClientAction({
22
+ var action = _objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ActionName.CopyLinkAction, extractCopyLinkClientAction({
24
23
  actionOptions: actionOptions,
25
24
  appearance: appearance,
26
25
  id: id,
27
26
  response: response
28
- })), _defineProperty(_objectSpread2, ActionName.DownloadAction, extractDownloadClientAction({
27
+ })), ActionName.DownloadAction, extractDownloadClientAction({
29
28
  actionOptions: actionOptions,
30
29
  appearance: appearance,
31
30
  id: id,
32
31
  response: response
33
- })), _defineProperty(_objectSpread2, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_objectSpread2, ActionName.PreviewAction, extractPreviewClientAction({
32
+ })), ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), ActionName.PreviewAction, extractPreviewClientAction({
34
33
  actionOptions: actionOptions,
35
34
  appearance: appearance,
36
35
  fireEvent: fireEvent,
37
36
  id: id,
38
37
  origin: origin,
39
38
  response: response
40
- })), _defineProperty(_objectSpread2, ActionName.AutomationAction, extractAutomationAction(response)), _defineProperty(_objectSpread2, InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), _objectSpread2), fg('platform-smart-card-view-related-urls-action') ? _defineProperty({}, InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response)) : {});
39
+ })), ActionName.AutomationAction, extractAutomationAction(response)), InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), fg('platform-smart-card-view-related-urls-action') ? _defineProperty({}, InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response)) : {});
41
40
  return Object.values(action).some(function (value) {
42
41
  return Boolean(value);
43
42
  }) ? action : undefined;
@@ -48,9 +47,8 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
48
47
  * Replaced with extractFlexibleCardActions()
49
48
  */
50
49
  var extractActions = function extractActions(response, url, actionOptions, id, aiSummaryConfig) {
51
- var _objectSpread3;
52
50
  var data = response.data;
53
- var action = _objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), _defineProperty(_objectSpread3, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_objectSpread3, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_objectSpread3, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _defineProperty(_objectSpread3, ActionName.AutomationAction, extractAutomationAction(response)), _defineProperty(_objectSpread3, InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), _objectSpread3), fg('platform-smart-card-view-related-urls-action') ? _defineProperty({}, InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response)) : {});
51
+ var action = _objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), ActionName.AutomationAction, extractAutomationAction(response)), InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), fg('platform-smart-card-view-related-urls-action') ? _defineProperty({}, InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response)) : {});
54
52
  return Object.values(action).some(function (value) {
55
53
  return Boolean(value);
56
54
  }) ? action : undefined;
@@ -2,16 +2,17 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- 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; }
6
- 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; }
7
5
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
8
6
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
9
7
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
10
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
+ 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
+ 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
11
  function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
12
12
  function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
13
13
  import uuid from 'uuid';
14
14
  import { getBaseUrl } from '@atlaskit/linking-common';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import { readStream } from './readStream';
16
17
  import { ChunkProcessingError } from './types';
17
18
  import { addPath, getXProductHeaderValue } from './utils';
@@ -40,12 +41,14 @@ export var AISummaryService = /*#__PURE__*/function () {
40
41
  case 0:
41
42
  payload = {
42
43
  recipient_agent_named_id: 'smartlink_summary_agent',
43
- agent_input_context: {
44
+ agent_input_context: _objectSpread({
44
45
  content_url: _this.url,
45
46
  content_ari: _this.ari,
46
47
  prompt_id: 'smart_links',
47
48
  summary_output_mimetype: 'text/markdown'
48
- }
49
+ }, fg('send_locale_to_summarize_in_assistance-service') && {
50
+ locale: _this.locale
51
+ })
49
52
  };
50
53
  options = {
51
54
  method: 'POST',
@@ -80,11 +83,12 @@ export var AISummaryService = /*#__PURE__*/function () {
80
83
  };
81
84
  this.url = props.url;
82
85
  this.ari = props.ari;
86
+ this.locale = props.locale;
83
87
  this.onStart = props.onStart;
84
88
  this.onSuccess = props.onSuccess;
85
89
  this.onError = props.onError;
86
90
  }
87
- _createClass(AISummaryService, [{
91
+ return _createClass(AISummaryService, [{
88
92
  key: "summariseUrl",
89
93
  value: function () {
90
94
  var _summariseUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
@@ -238,5 +242,4 @@ export var AISummaryService = /*#__PURE__*/function () {
238
242
  };
239
243
  }
240
244
  }]);
241
- return AISummaryService;
242
245
  }();
@@ -1,18 +1,17 @@
1
1
  import _createClass from "@babel/runtime/helpers/createClass";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
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";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
7
- 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)); }
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  export var ChunkProcessingError = /*#__PURE__*/function (_Error) {
10
- _inherits(ChunkProcessingError, _Error);
11
- var _super = _createSuper(ChunkProcessingError);
12
10
  function ChunkProcessingError(error) {
13
11
  _classCallCheck(this, ChunkProcessingError);
14
- return _super.call(this, error);
12
+ return _callSuper(this, ChunkProcessingError, [error]);
15
13
  }
14
+ _inherits(ChunkProcessingError, _Error);
16
15
  return _createClass(ChunkProcessingError);
17
16
  }( /*#__PURE__*/_wrapNativeSuper(Error));
18
17
  export var errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED', 'HIPAA_CONTENT_DETECTED', 'EXCEEDING_CONTEXT_LENGTH_ERROR'];
@@ -1,5 +1,10 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ 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; }
4
+ 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; }
2
5
  import { useEffect, useState } from 'react';
6
+ import { useIntl } from 'react-intl-next';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
3
8
  import { AISummaryService } from './ai-summary-service';
4
9
  import { AISummariesStore } from './ai-summary-service/store';
5
10
  /**
@@ -23,26 +28,35 @@ export var useAISummary = function useAISummary(props) {
23
28
  _useState2 = _slicedToArray(_useState, 2),
24
29
  state = _useState2[0],
25
30
  setState = _useState2[1];
31
+ var _ref = fg('send_locale_to_summarize_in_assistance-service') ?
32
+ // eslint-disable-next-line react-hooks/rules-of-hooks
33
+ useIntl() : {
34
+ locale: undefined
35
+ },
36
+ locale = _ref.locale;
26
37
  useEffect(function () {
27
38
  var _AISummariesStore$get2;
28
39
  //do not create a service for the empty URL string when the link data is not yet available,
29
40
  //or the service has already been created and cached.
30
41
  if (url && !AISummariesStore.get(url)) {
31
- AISummariesStore.set(url, new AISummaryService({
42
+ AISummariesStore.set(url, new AISummaryService(_objectSpread(_objectSpread({
32
43
  url: url,
33
44
  ari: ari,
34
45
  baseUrl: baseUrl,
35
46
  product: product,
36
- envKey: envKey,
47
+ envKey: envKey
48
+ }, fg('send_locale_to_summarize_in_assistance-service') && {
49
+ locale: locale
50
+ }), {}, {
37
51
  onError: onError,
38
52
  onStart: onStart,
39
53
  onSuccess: onSuccess
40
- }));
54
+ })));
41
55
  }
42
56
 
43
57
  //returns function that calls unsubscribe method
44
58
  return (_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.subscribe(setState);
45
- }, [url, baseUrl, onError, onStart, onSuccess, product, ari, envKey]);
59
+ }, [url, baseUrl, onError, onStart, onSuccess, product, ari, envKey, locale]);
46
60
  var summariseUrl = function summariseUrl() {
47
61
  var _AISummariesStore$get3;
48
62
  return (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.summariseUrl();