@atlaskit/smart-card 43.24.10 → 43.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/messages.js +10 -0
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +9 -2
  5. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.compiled.css +3 -0
  6. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.js +55 -0
  7. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +33 -3
  8. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.compiled.css +6 -1
  9. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +68 -6
  10. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +27 -2
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/cjs/view/common/ai-summary/ai-footer/index.compiled.css +1 -0
  13. package/dist/cjs/view/common/ai-summary/ai-footer/index.js +39 -0
  14. package/dist/cjs/view/common/ai-summary/index.compiled.css +1 -0
  15. package/dist/cjs/view/common/ai-summary/index.js +4 -1
  16. package/dist/es2019/messages.js +10 -0
  17. package/dist/es2019/utils/analytics/analytics.js +1 -1
  18. package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +8 -3
  19. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.compiled.css +6 -0
  20. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.js +38 -0
  21. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +28 -1
  22. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.compiled.css +6 -1
  23. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +70 -5
  24. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +27 -2
  25. package/dist/es2019/view/LinkUrl/index.js +1 -1
  26. package/dist/es2019/view/common/ai-summary/ai-footer/index.compiled.css +1 -0
  27. package/dist/es2019/view/common/ai-summary/ai-footer/index.js +28 -0
  28. package/dist/es2019/view/common/ai-summary/index.compiled.css +1 -0
  29. package/dist/es2019/view/common/ai-summary/index.js +4 -1
  30. package/dist/esm/messages.js +10 -0
  31. package/dist/esm/utils/analytics/analytics.js +1 -1
  32. package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +9 -2
  33. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.compiled.css +3 -0
  34. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.js +47 -0
  35. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +30 -2
  36. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.compiled.css +6 -1
  37. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +67 -5
  38. package/dist/esm/view/HoverCard/components/views/resolved/index.js +27 -2
  39. package/dist/esm/view/LinkUrl/index.js +1 -1
  40. package/dist/esm/view/common/ai-summary/ai-footer/index.compiled.css +1 -0
  41. package/dist/esm/view/common/ai-summary/ai-footer/index.js +30 -0
  42. package/dist/esm/view/common/ai-summary/index.compiled.css +1 -0
  43. package/dist/esm/view/common/ai-summary/index.js +4 -1
  44. package/dist/types/messages.d.ts +1 -1
  45. package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +1 -1
  46. package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +5 -0
  47. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.d.ts +3 -0
  48. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +9 -1
  49. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -0
  50. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +11 -0
  51. package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
  52. package/dist/types/view/common/ai-summary/ai-footer/index.d.ts +2 -0
  53. package/dist/types-ts4.5/messages.d.ts +1 -1
  54. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/index.d.ts +1 -1
  55. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/types.d.ts +5 -0
  56. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/assets/ellipses.d.ts +3 -0
  57. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +9 -1
  58. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -0
  59. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +11 -0
  60. package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
  61. package/dist/types-ts4.5/view/common/ai-summary/ai-footer/index.d.ts +2 -0
  62. package/package.json +8 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`af73e2d13f2ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af73e2d13f2ad) -
8
+ [ux] NAVX-3597 show Rovo AI Summary for Google hovercards
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 43.24.10
4
15
 
5
16
  ### Patch Changes
@@ -840,5 +840,15 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
840
840
  id: 'fabric.linking.learn_more_about_connecting_account_experiment_short',
841
841
  defaultMessage: 'Turn your URLs into rich, interactive previews.',
842
842
  description: 'An anchor link to redirect user to a page about authorization with 3rd party accounts.'
843
+ },
844
+ rovo_summary_loading: {
845
+ id: 'fabric.linking.rovo_summary.loading.non-final',
846
+ defaultMessage: 'Rovo is thinking',
847
+ description: 'Shown when a Rovo summary is loading, indicating that the AI is generating a summary for the user.'
848
+ },
849
+ ai_disclaimer: {
850
+ id: 'fabric.linking.rovo_summary.ai_disclaimer.non-final',
851
+ defaultMessage: 'Uses AI. Verify Results.',
852
+ description: 'Shown on a Rovo summary to indicate that the summary was generated by AI and should be verified by the user for accuracy.'
843
853
  }
844
854
  });
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "43.24.9"
14
+ packageVersion: "43.25.0"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -13,6 +13,7 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
15
  var _reactMagneticDi = require("react-magnetic-di");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _constants = require("../../../../../constants");
17
18
  var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
18
19
  var Actions = _interopRequireWildcard(require("../../actions"));
@@ -56,7 +57,8 @@ var ActionBlock = function ActionBlock(_ref) {
56
57
  spaceInline = _ref.spaceInline,
57
58
  className = _ref.className,
58
59
  _ref$testId = _ref.testId,
59
- testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
60
+ testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId,
61
+ hideAISummaryAction = _ref.hideAISummaryAction;
60
62
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
61
63
  var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
62
64
  var _useState = (0, _react.useState)(),
@@ -83,6 +85,11 @@ var ActionBlock = function ActionBlock(_ref) {
83
85
  return;
84
86
  }
85
87
  var arr = Object.keys(context.actions);
88
+ if (hideAISummaryAction && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')) {
89
+ arr = arr.filter(function (name) {
90
+ return name !== 'AISummaryAction';
91
+ });
92
+ }
86
93
  arr.sort(sort);
87
94
  return arr.map(function (name) {
88
95
  var Action = name in Actions ? Actions[name] : undefined;
@@ -104,7 +111,7 @@ var ActionBlock = function ActionBlock(_ref) {
104
111
  hideTooltip: isLoading
105
112
  }) : null;
106
113
  });
107
- }, [context === null || context === void 0 ? void 0 : context.actions, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, _onClick]);
114
+ }, [context === null || context === void 0 ? void 0 : context.actions, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, _onClick, hideAISummaryAction]);
108
115
  return actions ? /*#__PURE__*/React.createElement("div", {
109
116
  ref: blockRef,
110
117
  "data-testid": testId
@@ -0,0 +1,3 @@
1
+ ._y44v1bmh{animation:var(--_f6g77x)}
2
+ ._y44v1dzz{animation:var(--_8brvn1)}
3
+ ._y44v1uzy{animation:var(--_lmysux)}
@@ -0,0 +1,55 @@
1
+ /* ellipses.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ // Copied from platform/packages/ai-mate/rovo-platform-ui-components/src/ui/primitives/ellipses-animation/EllipsesAnimation.tsx
3
+ "use strict";
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.EllipsesAnimation = void 0;
10
+ require("./ellipses.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
+ var animation = null;
15
+ var animation1 = null;
16
+ var animation2 = null;
17
+ var dot1 = null;
18
+ var dot2 = null;
19
+ var dot3 = null;
20
+ var animatedOpacity = null;
21
+ var EllipsesAnimation = exports.EllipsesAnimation = function EllipsesAnimation(_ref) {
22
+ var _ref$isAnimated = _ref.isAnimated,
23
+ isAnimated = _ref$isAnimated === void 0 ? true : _ref$isAnimated;
24
+ return /*#__PURE__*/React.createElement("svg", {
25
+ width: "10",
26
+ height: "2",
27
+ viewBox: "0 0 10 2",
28
+ fill: "none",
29
+ xmlns: "http://www.w3.org/2000/svg"
30
+ }, /*#__PURE__*/React.createElement("path", {
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
32
+ className: (0, _runtime.ax)([isAnimated && "_y44v1dzz", isAnimated && animatedOpacity]),
33
+ d: "M0.0800781 2V0.414062H1.67969V2H0.0800781Z",
34
+ fill: "#1868DB",
35
+ style: {
36
+ "--_8brvn1": (0, _runtime.ix)("".concat(animation, " 1.5s forwards infinite"))
37
+ }
38
+ }), /*#__PURE__*/React.createElement("path", {
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
40
+ className: (0, _runtime.ax)([isAnimated && "_y44v1uzy", isAnimated && animatedOpacity]),
41
+ d: "M3.83984 2V0.414062H5.43945V2H3.83984Z",
42
+ fill: "#BF63F3",
43
+ style: {
44
+ "--_lmysux": (0, _runtime.ix)("".concat(animation1, " 1.5s forwards infinite"))
45
+ }
46
+ }), /*#__PURE__*/React.createElement("path", {
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
48
+ className: (0, _runtime.ax)([isAnimated && "_y44v1bmh", isAnimated && animatedOpacity]),
49
+ d: "M7.59961 2V0.414062H9.19922V2H7.59961Z",
50
+ fill: "#FCA700",
51
+ style: {
52
+ "--_f6g77x": (0, _runtime.ix)("".concat(animation2, " 1.5s forwards infinite"))
53
+ }
54
+ }));
55
+ };
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
- exports.default = void 0;
8
+ exports.default = exports.RovoSummaryBlock = void 0;
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _react = _interopRequireDefault(require("react"));
11
12
  var _constants = require("../../../../../constants");
12
13
  var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
13
- var _resolved = _interopRequireDefault(require("./resolved"));
14
- var _excluded = ["testId"];
14
+ var _resolved = _interopRequireWildcard(require("./resolved"));
15
+ var _excluded = ["testId"],
16
+ _excluded2 = ["testId", "url"];
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15
18
  /**
16
19
  * Represents an AISummaryBlock, designed to summarising link resource
17
20
  * content using AI.
@@ -39,4 +42,31 @@ var AISummaryBlock = function AISummaryBlock(_ref) {
39
42
  url: actionData.url
40
43
  }));
41
44
  };
45
+
46
+ /**
47
+ * Represents an AISummaryBlock, designed to summarising link resource
48
+ * content using AI.
49
+ * @public
50
+ * @param {RovoSummaryBlockProps} RovoSummaryBlock
51
+ * @see Block
52
+ */
53
+ var RovoSummaryBlock = exports.RovoSummaryBlock = function RovoSummaryBlock(_ref2) {
54
+ var _props$size2, _cardContext$ui2;
55
+ var _ref2$testId = _ref2.testId,
56
+ testId = _ref2$testId === void 0 ? 'smart-ai-summary-block' : _ref2$testId,
57
+ url = _ref2.url,
58
+ props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
59
+ var cardContext = (0, _flexibleUiContext.useFlexibleCardContext)();
60
+ if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== _constants.SmartLinkStatus.Resolved) {
61
+ return null;
62
+ }
63
+ if (!url) {
64
+ return null;
65
+ }
66
+ return /*#__PURE__*/_react.default.createElement(_resolved.RovoSummaryBlockResolvedView, (0, _extends2.default)({}, props, {
67
+ size: (_props$size2 = props.size) !== null && _props$size2 !== void 0 ? _props$size2 : cardContext === null || cardContext === void 0 || (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size,
68
+ testId: testId,
69
+ url: url
70
+ }));
71
+ };
42
72
  var _default = exports.default = AISummaryBlock;
@@ -1,2 +1,7 @@
1
1
  ._18m9ewfl{overflow-y:visible}
2
- ._1reoewfl{overflow-x:visible}
2
+ ._19bv1b66{padding-left:var(--ds-space-050,4px)}
3
+ ._1e0c1txw{display:flex}
4
+ ._1reoewfl{overflow-x:visible}
5
+ ._4cvr1h6o{align-items:center}
6
+ ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
7
+ ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -6,21 +6,33 @@ var _typeof = require("@babel/runtime/helpers/typeof");
6
6
  Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
- exports.default = void 0;
9
+ exports.default = exports.RovoSummaryBlockResolvedView = void 0;
10
10
  require("./index.compiled.css");
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
+ var _reactIntlNext = require("react-intl-next");
15
16
  var _reactMagneticDi = require("react-magnetic-di");
17
+ var _logo = require("@atlaskit/logo");
18
+ var _compiled = require("@atlaskit/primitives/compiled");
16
19
  var _constants = require("../../../../../../constants");
20
+ var _messages = require("../../../../../../messages");
17
21
  var _useAiSummaryAction = _interopRequireDefault(require("../../../../../../state/hooks/use-ai-summary-action"));
18
22
  var _aiSummary = _interopRequireDefault(require("../../../../../common/ai-summary"));
23
+ var _aiFooter = _interopRequireDefault(require("../../../../../common/ai-summary/ai-footer"));
19
24
  var _motionWrapper = _interopRequireDefault(require("../../../common/motion-wrapper"));
20
25
  var _block = _interopRequireDefault(require("../../block"));
21
26
  var _aiEventSummaryViewed = _interopRequireDefault(require("../ai-event-summary-viewed"));
27
+ var _ellipses = require("../assets/ellipses");
22
28
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
29
  var styles = null;
30
+ var newStyles = {
31
+ iconWrapper: "_19bv1b66 _u5f3utpp _1e0c1txw _4cvr1h6o",
32
+ placeholderWrapper: "_1e0c1txw _4cvr1h6o",
33
+ summaryWrapper: "_ca0q1b66 _1e0c1txw",
34
+ ellipsesContainer: "_19bv1b66"
35
+ };
24
36
  var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
25
37
  var testId = props.testId,
26
38
  _props$aiSummaryMinHe = props.aiSummaryMinHeight,
@@ -41,11 +53,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
41
53
  }
42
54
  return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
43
55
  direction: _constants.SmartLinkDirection.Vertical,
44
- testId: "".concat(testId, "-resolved-view")
45
- /**
46
- * Enabled for feature discovery to allow box shadow to overflow
47
- * Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
48
- */,
56
+ testId: "".concat(testId, "-resolved-view"),
49
57
  className: (0, _runtime.ax)(["_1reoewfl _18m9ewfl"])
50
58
  }), status === 'done' && /*#__PURE__*/React.createElement(_aiEventSummaryViewed.default, {
51
59
  fromCache: isSummarisedOnMountRef.current
@@ -59,4 +67,58 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
59
67
  content: content
60
68
  })));
61
69
  };
70
+ var RovoSummaryBlockResolvedView = exports.RovoSummaryBlockResolvedView = function RovoSummaryBlockResolvedView(props) {
71
+ var testId = props.testId,
72
+ _props$aiSummaryMinHe2 = props.aiSummaryMinHeight,
73
+ aiSummaryMinHeight = _props$aiSummaryMinHe2 === void 0 ? 0 : _props$aiSummaryMinHe2,
74
+ url = props.url;
75
+ var _useAISummaryAction2 = (0, _useAiSummaryAction.default)(url),
76
+ _useAISummaryAction2$ = _useAISummaryAction2.state,
77
+ content = _useAISummaryAction2$.content,
78
+ status = _useAISummaryAction2$.status;
79
+ var showAISummary = status === 'done' ||
80
+ // We want to display the AI Summary component only when there is content available during the loading process.
81
+ status === 'loading' && !!content;
82
+ var isSummarisedOnMountRef = (0, _react.useRef)(status === 'done');
83
+ var minHeight = isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
84
+ if (!showAISummary) {
85
+ return /*#__PURE__*/React.createElement(_compiled.Inline, {
86
+ xcss: newStyles.placeholderWrapper
87
+ }, /*#__PURE__*/React.createElement("div", {
88
+ className: (0, _runtime.ax)([newStyles.iconWrapper])
89
+ }, /*#__PURE__*/React.createElement(_logo.RovoIcon, {
90
+ shouldUseHexLogo: true,
91
+ size: 'xxsmall'
92
+ })), /*#__PURE__*/React.createElement(_compiled.Text, {
93
+ size: "small",
94
+ color: "color.text"
95
+ }, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, _messages.messages.rovo_summary_loading)), /*#__PURE__*/React.createElement(_compiled.Box, {
96
+ xcss: newStyles.ellipsesContainer
97
+ }, /*#__PURE__*/React.createElement(_ellipses.EllipsesAnimation, {
98
+ isAnimated: true
99
+ })));
100
+ }
101
+ return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
102
+ direction: _constants.SmartLinkDirection.Vertical,
103
+ testId: "".concat(testId, "-resolved-view"),
104
+ className: (0, _runtime.ax)(["_1reoewfl _18m9ewfl"])
105
+ }), /*#__PURE__*/React.createElement(_compiled.Inline, {
106
+ xcss: newStyles.summaryWrapper
107
+ }, /*#__PURE__*/React.createElement("div", {
108
+ className: (0, _runtime.ax)([newStyles.iconWrapper])
109
+ }, /*#__PURE__*/React.createElement(_logo.RovoIcon, {
110
+ shouldUseHexLogo: true,
111
+ size: 'xxsmall'
112
+ })), status === 'done' && /*#__PURE__*/React.createElement(_aiEventSummaryViewed.default, {
113
+ fromCache: isSummarisedOnMountRef.current
114
+ }), /*#__PURE__*/React.createElement(_motionWrapper.default, {
115
+ minHeight: minHeight,
116
+ show: showAISummary,
117
+ showTransition: !isSummarisedOnMountRef.current
118
+ }, /*#__PURE__*/React.createElement(_aiSummary.default, {
119
+ testId: "".concat(testId, "-ai-summary"),
120
+ minHeight: minHeight,
121
+ content: content
122
+ }), status === 'done' && /*#__PURE__*/React.createElement(_aiFooter.default, null))));
123
+ };
62
124
  var _default = exports.default = AISummaryBlockResolvedView;
@@ -11,11 +11,15 @@ require("./index.compiled.css");
11
11
  var _runtime = require("@compiled/react/runtime");
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
15
16
  var _constants = require("../../../../../constants");
16
17
  var _analytics = require("../../../../../state/analytics");
18
+ var _useAiSummaryAction = _interopRequireDefault(require("../../../../../state/hooks/use-ai-summary-action"));
19
+ var _useRovoConfig = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
17
20
  var _FlexibleCard = _interopRequireDefault(require("../../../../FlexibleCard"));
18
21
  var _blocks = require("../../../../FlexibleCard/components/blocks");
22
+ var _aiSummaryBlock = require("../../../../FlexibleCard/components/blocks/ai-summary-block");
19
23
  var _utils = require("../../../utils");
20
24
  var _ImagePreview = _interopRequireDefault(require("../../ImagePreview"));
21
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -31,9 +35,11 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
31
35
  isAISummaryEnabled = _ref.isAISummaryEnabled,
32
36
  onActionClick = _ref.onActionClick,
33
37
  titleBlockProps = _ref.titleBlockProps,
34
- id = _ref.id;
38
+ id = _ref.id,
39
+ url = _ref.url;
35
40
  var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
36
41
  fireEvent = _useAnalyticsEvents.fireEvent;
42
+ var rovoConfig = (0, _useRovoConfig.default)();
37
43
  (0, _react.useEffect)(function () {
38
44
  // Since this hover view is only rendered on resolved status,
39
45
  // there is no need to check for statuses.
@@ -70,6 +76,20 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
70
76
  className: (0, _runtime.ax)(["_ca0q1b66"])
71
77
  });
72
78
  var aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
79
+ var isRovoSummaryEnabled = (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.isRovoEnabled) && extensionKey === 'google-object-provider' && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
80
+ var aiSummaryProps = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ?
81
+ // eslint-disable-next-line react-hooks/rules-of-hooks
82
+ (0, _useAiSummaryAction.default)(url) : undefined;
83
+ var hasSummarised = (0, _react.useRef)(false);
84
+ (0, _react.useEffect)(function () {
85
+ if ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')) {
86
+ if ((aiSummaryProps === null || aiSummaryProps === void 0 ? void 0 : aiSummaryProps.state.status) !== 'ready' || hasSummarised.current) {
87
+ return;
88
+ }
89
+ hasSummarised.current = true;
90
+ aiSummaryProps === null || aiSummaryProps === void 0 || aiSummaryProps.summariseUrl();
91
+ }
92
+ }, [aiSummaryProps, isRovoSummaryEnabled]);
73
93
  return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, flexibleCardProps, imagePreview, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, titleBlockProps, {
74
94
  metadataPosition: _constants.SmartLinkPosition.Top,
75
95
  className: (0, _runtime.ax)(["_zulpu2gc _quenze3t _oebj1txw _13mh1pd9"])
@@ -78,7 +98,11 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
78
98
  secondary: secondary,
79
99
  maxLines: 1,
80
100
  size: _constants.SmartLinkSize.Medium
81
- }), isAISummaryEnabled ? /*#__PURE__*/_react.default.createElement(_blocks.AISummaryBlock, {
101
+ }), isRovoSummaryEnabled ? /*#__PURE__*/_react.default.createElement(_aiSummaryBlock.RovoSummaryBlock, {
102
+ aiSummaryMinHeight: aiSummaryMinHeight,
103
+ placeholder: snippet,
104
+ url: url
105
+ }) : isAISummaryEnabled ? /*#__PURE__*/_react.default.createElement(_blocks.AISummaryBlock, {
82
106
  aiSummaryMinHeight: aiSummaryMinHeight,
83
107
  placeholder: snippet
84
108
  }) : snippet, /*#__PURE__*/_react.default.createElement(_blocks.SnippetBlock, {
@@ -90,6 +114,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
90
114
  }), /*#__PURE__*/_react.default.createElement(_blocks.ActionBlock, {
91
115
  onClick: onActionClick,
92
116
  spaceInline: "space.100",
117
+ hideAISummaryAction: isRovoSummaryEnabled,
93
118
  className: (0, _runtime.ax)(["_n3td1b66"])
94
119
  }), /*#__PURE__*/_react.default.createElement(_blocks.AIFooterBlock, null));
95
120
  };
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
22
22
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
23
23
  var PACKAGE_DATA = {
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "43.24.9",
25
+ packageVersion: "43.25.0",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -0,0 +1 @@
1
+ ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
@@ -0,0 +1,39 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.default = void 0;
10
+ require("./index.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
13
+ var _reactIntlNext = require("react-intl-next");
14
+ var _informationCircle = _interopRequireDefault(require("@atlaskit/icon/core/information-circle"));
15
+ var _link = _interopRequireDefault(require("@atlaskit/link"));
16
+ var _compiled = require("@atlaskit/primitives/compiled");
17
+ var _messages = require("../../../../messages");
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
+ var styles = {
20
+ aiFooterWrapper: "_ca0q1b66"
21
+ };
22
+ var AIFooter = function AIFooter() {
23
+ return /*#__PURE__*/React.createElement(_compiled.Inline, {
24
+ alignBlock: "center",
25
+ space: "space.050",
26
+ xcss: styles.aiFooterWrapper
27
+ }, /*#__PURE__*/React.createElement(_informationCircle.default, {
28
+ label: "",
29
+ color: "var(--ds-text-subtle, #505258)",
30
+ size: "small"
31
+ }), /*#__PURE__*/React.createElement(_compiled.Text, {
32
+ size: "small"
33
+ }, /*#__PURE__*/React.createElement(_link.default, {
34
+ href: "https://www.atlassian.com/trust/atlassian-intelligence",
35
+ appearance: "subtle",
36
+ target: "_blank"
37
+ }, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_disclaimer))));
38
+ };
39
+ var _default = exports.default = AIFooter;
@@ -5,5 +5,6 @@
5
5
  ._o5724jg8{white-space:normal}
6
6
  ._slp31hna{word-wrap:break-word}
7
7
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
8
+ ._syazi7uo{color:var(--ds-text,#292a2e)}
8
9
  ._te171kdv{-ms-user-select:text}
9
10
  ._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
@@ -11,9 +11,12 @@ require("./index.compiled.css");
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _markdownToJsx = _interopRequireDefault(require("markdown-to-jsx"));
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _ulist = _interopRequireDefault(require("./ulist"));
15
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
17
  var baseStyle = null;
18
+ var textStyleNew = null;
19
+ var textStyleOld = null;
17
20
 
18
21
  /**
19
22
  * A component to render a response from AI in markdown text.
@@ -35,7 +38,7 @@ var AISummary = function AISummary(_ref) {
35
38
  "data-testid": testId
36
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
37
40
  ,
38
- className: (0, _runtime.ax)(["_11c8wadc _syazazsu _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", className]),
41
+ className: (0, _runtime.ax)(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? "_syazi7uo" : "_syazazsu", className]),
39
42
  children: content,
40
43
  options: {
41
44
  forceWrapper: true,
@@ -834,5 +834,15 @@ export const messages = defineMessages({
834
834
  id: 'fabric.linking.learn_more_about_connecting_account_experiment_short',
835
835
  defaultMessage: 'Turn your URLs into rich, interactive previews.',
836
836
  description: 'An anchor link to redirect user to a page about authorization with 3rd party accounts.'
837
+ },
838
+ rovo_summary_loading: {
839
+ id: 'fabric.linking.rovo_summary.loading.non-final',
840
+ defaultMessage: 'Rovo is thinking',
841
+ description: 'Shown when a Rovo summary is loading, indicating that the AI is generating a summary for the user.'
842
+ },
843
+ ai_disclaimer: {
844
+ id: 'fabric.linking.rovo_summary.ai_disclaimer.non-final',
845
+ defaultMessage: 'Uses AI. Verify Results.',
846
+ description: 'Shown on a Rovo summary to indicate that the summary was generated by AI and should be verified by the user for accuracy.'
837
847
  }
838
848
  });
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "43.24.9"
5
+ packageVersion: "43.25.0"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { useCallback, useMemo, useState } from 'react';
6
6
  import { di } from 'react-magnetic-di';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { SmartLinkSize } from '../../../../../constants';
8
9
  import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
9
10
  import * as Actions from '../../actions';
@@ -45,7 +46,8 @@ const ActionBlock = ({
45
46
  size,
46
47
  spaceInline,
47
48
  className,
48
- testId = 'smart-block-action'
49
+ testId = 'smart-block-action',
50
+ hideAISummaryAction
49
51
  }) => {
50
52
  const context = useFlexibleUiContext();
51
53
  const ui = useFlexibleUiOptionContext();
@@ -66,7 +68,10 @@ const ActionBlock = ({
66
68
  if (!(context !== null && context !== void 0 && context.actions)) {
67
69
  return;
68
70
  }
69
- const arr = Object.keys(context.actions);
71
+ let arr = Object.keys(context.actions);
72
+ if (hideAISummaryAction && fg('platform_sl_3p_auth_rovo_action_kill_switch')) {
73
+ arr = arr.filter(name => name !== 'AISummaryAction');
74
+ }
70
75
  arr.sort(sort);
71
76
  return arr.map(name => {
72
77
  const Action = name in Actions ? Actions[name] : undefined;
@@ -86,7 +91,7 @@ const ActionBlock = ({
86
91
  hideTooltip: isLoading
87
92
  }) : null;
88
93
  });
89
- }, [context === null || context === void 0 ? void 0 : context.actions, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, onClick]);
94
+ }, [context === null || context === void 0 ? void 0 : context.actions, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, onClick, hideAISummaryAction]);
90
95
  return actions ? /*#__PURE__*/React.createElement("div", {
91
96
  ref: blockRef,
92
97
  "data-testid": testId
@@ -0,0 +1,6 @@
1
+ ._y44v18gg{animation:k1iz2f8l 1.5s infinite forwards}
2
+ ._y44v1gpk{animation:k1w4xhaz 1.5s infinite forwards}
3
+ ._y44voqx9{animation:kzhlxv2 1.5s infinite forwards}
4
+ @keyframes k1iz2f8l{0%{opacity:0}49%{opacity:0}50%{opacity:1}99%{opacity:1}to{opacity:0}}
5
+ @keyframes k1w4xhaz{0%{opacity:0}24%{opacity:0}25%{opacity:1}99%{opacity:1}to{opacity:0}}
6
+ @keyframes kzhlxv2{0%{opacity:0}74%{opacity:0}75%{opacity:1}99%{opacity:1}to{opacity:0}}
@@ -0,0 +1,38 @@
1
+ /* ellipses.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ // Copied from platform/packages/ai-mate/rovo-platform-ui-components/src/ui/primitives/ellipses-animation/EllipsesAnimation.tsx
3
+ import "./ellipses.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ const animation = null;
7
+ const animation1 = null;
8
+ const animation2 = null;
9
+ const dot1 = null;
10
+ const dot2 = null;
11
+ const dot3 = null;
12
+ const animatedOpacity = null;
13
+ export const EllipsesAnimation = ({
14
+ isAnimated = true
15
+ }) => {
16
+ return /*#__PURE__*/React.createElement("svg", {
17
+ width: "10",
18
+ height: "2",
19
+ viewBox: "0 0 10 2",
20
+ fill: "none",
21
+ xmlns: "http://www.w3.org/2000/svg"
22
+ }, /*#__PURE__*/React.createElement("path", {
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
24
+ className: ax([isAnimated && "", isAnimated && "_y44v1gpk", isAnimated && animatedOpacity]),
25
+ d: "M0.0800781 2V0.414062H1.67969V2H0.0800781Z",
26
+ fill: "#1868DB"
27
+ }), /*#__PURE__*/React.createElement("path", {
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
29
+ className: ax([isAnimated && "", isAnimated && "_y44v18gg", isAnimated && animatedOpacity]),
30
+ d: "M3.83984 2V0.414062H5.43945V2H3.83984Z",
31
+ fill: "#BF63F3"
32
+ }), /*#__PURE__*/React.createElement("path", {
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
34
+ className: ax([isAnimated && "", isAnimated && "_y44voqx9", isAnimated && animatedOpacity]),
35
+ d: "M7.59961 2V0.414062H9.19922V2H7.59961Z",
36
+ fill: "#FCA700"
37
+ }));
38
+ };
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
4
4
  import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
5
- import AISummaryBlockResolvedView from './resolved';
5
+ import AISummaryBlockResolvedView, { RovoSummaryBlockResolvedView } from './resolved';
6
6
  /**
7
7
  * Represents an AISummaryBlock, designed to summarising link resource
8
8
  * content using AI.
@@ -30,4 +30,31 @@ const AISummaryBlock = ({
30
30
  url: actionData.url
31
31
  }));
32
32
  };
33
+
34
+ /**
35
+ * Represents an AISummaryBlock, designed to summarising link resource
36
+ * content using AI.
37
+ * @public
38
+ * @param {RovoSummaryBlockProps} RovoSummaryBlock
39
+ * @see Block
40
+ */
41
+ export const RovoSummaryBlock = ({
42
+ testId = 'smart-ai-summary-block',
43
+ url,
44
+ ...props
45
+ }) => {
46
+ var _props$size2, _cardContext$ui2;
47
+ const cardContext = useFlexibleCardContext();
48
+ if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
49
+ return null;
50
+ }
51
+ if (!url) {
52
+ return null;
53
+ }
54
+ return /*#__PURE__*/React.createElement(RovoSummaryBlockResolvedView, _extends({}, props, {
55
+ size: (_props$size2 = props.size) !== null && _props$size2 !== void 0 ? _props$size2 : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size,
56
+ testId: testId,
57
+ url: url
58
+ }));
59
+ };
33
60
  export default AISummaryBlock;
@@ -1,2 +1,7 @@
1
1
  ._18m9ewfl{overflow-y:visible}
2
- ._1reoewfl{overflow-x:visible}
2
+ ._19bv1b66{padding-left:var(--ds-space-050,4px)}
3
+ ._1e0c1txw{display:flex}
4
+ ._1reoewfl{overflow-x:visible}
5
+ ._4cvr1h6o{align-items:center}
6
+ ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
7
+ ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}