@atlaskit/smart-card 43.24.10 → 43.25.1

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 +17 -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
@@ -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)}
@@ -4,14 +4,26 @@ import "./index.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { Fragment, useRef } from 'react';
7
+ import { FormattedMessage } from 'react-intl-next';
7
8
  import { di } from 'react-magnetic-di';
9
+ import { RovoIcon } from '@atlaskit/logo';
10
+ import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
8
11
  import { SmartLinkDirection } from '../../../../../../constants';
12
+ import { messages } from '../../../../../../messages';
9
13
  import useAISummaryAction from '../../../../../../state/hooks/use-ai-summary-action';
10
14
  import AISummary from '../../../../../common/ai-summary';
15
+ import AIFooter from '../../../../../common/ai-summary/ai-footer';
11
16
  import MotionWrapper from '../../../common/motion-wrapper';
12
17
  import Block from '../../block';
13
18
  import AIEventSummaryViewed from '../ai-event-summary-viewed';
19
+ import { EllipsesAnimation } from '../assets/ellipses';
14
20
  const styles = null;
21
+ const newStyles = {
22
+ iconWrapper: "_19bv1b66 _u5f3utpp _1e0c1txw _4cvr1h6o",
23
+ placeholderWrapper: "_1e0c1txw _4cvr1h6o",
24
+ summaryWrapper: "_ca0q1b66 _1e0c1txw",
25
+ ellipsesContainer: "_19bv1b66"
26
+ };
15
27
  const AISummaryBlockResolvedView = props => {
16
28
  const {
17
29
  testId,
@@ -35,11 +47,7 @@ const AISummaryBlockResolvedView = props => {
35
47
  }
36
48
  return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
37
49
  direction: SmartLinkDirection.Vertical,
38
- testId: `${testId}-resolved-view`
39
- /**
40
- * Enabled for feature discovery to allow box shadow to overflow
41
- * Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
42
- */,
50
+ testId: `${testId}-resolved-view`,
43
51
  className: ax(["_1reoewfl _18m9ewfl"])
44
52
  }), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
45
53
  fromCache: isSummarisedOnMountRef.current
@@ -53,4 +61,61 @@ const AISummaryBlockResolvedView = props => {
53
61
  content: content
54
62
  })));
55
63
  };
64
+ export const RovoSummaryBlockResolvedView = props => {
65
+ const {
66
+ testId,
67
+ aiSummaryMinHeight = 0,
68
+ url
69
+ } = props;
70
+ const {
71
+ state: {
72
+ content,
73
+ status
74
+ }
75
+ } = useAISummaryAction(url);
76
+ const showAISummary = status === 'done' ||
77
+ // We want to display the AI Summary component only when there is content available during the loading process.
78
+ status === 'loading' && !!content;
79
+ const isSummarisedOnMountRef = useRef(status === 'done');
80
+ const minHeight = isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
81
+ if (!showAISummary) {
82
+ return /*#__PURE__*/React.createElement(Inline, {
83
+ xcss: newStyles.placeholderWrapper
84
+ }, /*#__PURE__*/React.createElement("div", {
85
+ className: ax([newStyles.iconWrapper])
86
+ }, /*#__PURE__*/React.createElement(RovoIcon, {
87
+ shouldUseHexLogo: true,
88
+ size: 'xxsmall'
89
+ })), /*#__PURE__*/React.createElement(Text, {
90
+ size: "small",
91
+ color: "color.text"
92
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.rovo_summary_loading)), /*#__PURE__*/React.createElement(Box, {
93
+ xcss: newStyles.ellipsesContainer
94
+ }, /*#__PURE__*/React.createElement(EllipsesAnimation, {
95
+ isAnimated: true
96
+ })));
97
+ }
98
+ return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
99
+ direction: SmartLinkDirection.Vertical,
100
+ testId: `${testId}-resolved-view`,
101
+ className: ax(["_1reoewfl _18m9ewfl"])
102
+ }), /*#__PURE__*/React.createElement(Inline, {
103
+ xcss: newStyles.summaryWrapper
104
+ }, /*#__PURE__*/React.createElement("div", {
105
+ className: ax([newStyles.iconWrapper])
106
+ }, /*#__PURE__*/React.createElement(RovoIcon, {
107
+ shouldUseHexLogo: true,
108
+ size: 'xxsmall'
109
+ })), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
110
+ fromCache: isSummarisedOnMountRef.current
111
+ }), /*#__PURE__*/React.createElement(MotionWrapper, {
112
+ minHeight: minHeight,
113
+ show: showAISummary,
114
+ showTransition: !isSummarisedOnMountRef.current
115
+ }, /*#__PURE__*/React.createElement(AISummary, {
116
+ testId: `${testId}-ai-summary`,
117
+ minHeight: minHeight,
118
+ content: content
119
+ }), status === 'done' && /*#__PURE__*/React.createElement(AIFooter, null))));
120
+ };
56
121
  export default AISummaryBlockResolvedView;
@@ -3,11 +3,15 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
7
8
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
8
9
  import { succeedUfoExperience } from '../../../../../state/analytics';
10
+ import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
11
+ import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
9
12
  import FlexibleCard from '../../../../FlexibleCard';
10
13
  import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
14
+ import { RovoSummaryBlock } from '../../../../FlexibleCard/components/blocks/ai-summary-block';
11
15
  import { getMetadata } from '../../../utils';
12
16
  import ImagePreview from '../../ImagePreview';
13
17
  const hiddenSnippetStyles = null;
@@ -21,12 +25,14 @@ const HoverCardResolvedView = ({
21
25
  isAISummaryEnabled,
22
26
  onActionClick,
23
27
  titleBlockProps,
24
- id
28
+ id,
29
+ url
25
30
  }) => {
26
31
  var _cardState$details;
27
32
  const {
28
33
  fireEvent
29
34
  } = useAnalyticsEvents();
35
+ const rovoConfig = useRovoConfig();
30
36
  useEffect(() => {
31
37
  // Since this hover view is only rendered on resolved status,
32
38
  // there is no need to check for statuses.
@@ -64,6 +70,20 @@ const HoverCardResolvedView = ({
64
70
  className: ax(["_ca0q1b66"])
65
71
  });
66
72
  const aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
73
+ const isRovoSummaryEnabled = (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.isRovoEnabled) && extensionKey === 'google-object-provider' && fg('platform_sl_3p_auth_rovo_action_kill_switch');
74
+ const aiSummaryProps = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
75
+ // eslint-disable-next-line react-hooks/rules-of-hooks
76
+ useAISummaryAction(url) : undefined;
77
+ const hasSummarised = useRef(false);
78
+ useEffect(() => {
79
+ if (fg('platform_sl_3p_auth_rovo_action_kill_switch')) {
80
+ if ((aiSummaryProps === null || aiSummaryProps === void 0 ? void 0 : aiSummaryProps.state.status) !== 'ready' || hasSummarised.current) {
81
+ return;
82
+ }
83
+ hasSummarised.current = true;
84
+ aiSummaryProps === null || aiSummaryProps === void 0 ? void 0 : aiSummaryProps.summariseUrl();
85
+ }
86
+ }, [aiSummaryProps, isRovoSummaryEnabled]);
67
87
  return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
68
88
  metadataPosition: SmartLinkPosition.Top,
69
89
  className: ax(["_zulpu2gc _quenze3t _oebj1txw _13mh1pd9"])
@@ -72,7 +92,11 @@ const HoverCardResolvedView = ({
72
92
  secondary: secondary,
73
93
  maxLines: 1,
74
94
  size: SmartLinkSize.Medium
75
- }), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
95
+ }), isRovoSummaryEnabled ? /*#__PURE__*/React.createElement(RovoSummaryBlock, {
96
+ aiSummaryMinHeight: aiSummaryMinHeight,
97
+ placeholder: snippet,
98
+ url: url
99
+ }) : isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
76
100
  aiSummaryMinHeight: aiSummaryMinHeight,
77
101
  placeholder: snippet
78
102
  }) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
@@ -84,6 +108,7 @@ const HoverCardResolvedView = ({
84
108
  }), /*#__PURE__*/React.createElement(ActionBlock, {
85
109
  onClick: onActionClick,
86
110
  spaceInline: "space.100",
111
+ hideAISummaryAction: isRovoSummaryEnabled,
87
112
  className: ax(["_n3td1b66"])
88
113
  }), /*#__PURE__*/React.createElement(AIFooterBlock, null));
89
114
  };
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "43.24.9",
15
+ packageVersion: "43.25.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -0,0 +1 @@
1
+ ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
@@ -0,0 +1,28 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./index.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { FormattedMessage } from 'react-intl-next';
6
+ import InformationCircleIcon from '@atlaskit/icon/core/information-circle';
7
+ import Link from '@atlaskit/link';
8
+ import { Inline, Text } from '@atlaskit/primitives/compiled';
9
+ import { messages } from '../../../../messages';
10
+ const styles = {
11
+ aiFooterWrapper: "_ca0q1b66"
12
+ };
13
+ const AIFooter = () => /*#__PURE__*/React.createElement(Inline, {
14
+ alignBlock: "center",
15
+ space: "space.050",
16
+ xcss: styles.aiFooterWrapper
17
+ }, /*#__PURE__*/React.createElement(InformationCircleIcon, {
18
+ label: "",
19
+ color: "var(--ds-text-subtle, #505258)",
20
+ size: "small"
21
+ }), /*#__PURE__*/React.createElement(Text, {
22
+ size: "small"
23
+ }, /*#__PURE__*/React.createElement(Link, {
24
+ href: "https://www.atlassian.com/trust/atlassian-intelligence",
25
+ appearance: "subtle",
26
+ target: "_blank"
27
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_disclaimer))));
28
+ export 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}
@@ -3,8 +3,11 @@ import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import Markdown from 'markdown-to-jsx';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import UList from './ulist';
7
8
  const baseStyle = null;
9
+ const textStyleNew = null;
10
+ const textStyleOld = null;
8
11
 
9
12
  /**
10
13
  * A component to render a response from AI in markdown text.
@@ -24,7 +27,7 @@ const AISummary = ({
24
27
  "data-testid": testId
25
28
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
26
29
  ,
27
- className: ax(["_11c8wadc _syazazsu _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", className]),
30
+ className: ax(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", fg('platform_sl_3p_auth_rovo_action_kill_switch') ? "_syazi7uo" : "_syazazsu", className]),
28
31
  children: content,
29
32
  options: {
30
33
  forceWrapper: true,
@@ -834,5 +834,15 @@ export var 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
  });
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "43.24.9"
7
+ packageVersion: "43.25.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useCallback, useMemo, useState } from 'react';
7
7
  import { di } from 'react-magnetic-di';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { SmartLinkSize } from '../../../../../constants';
9
10
  import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
10
11
  import * as Actions from '../../actions';
@@ -47,7 +48,8 @@ var ActionBlock = function ActionBlock(_ref) {
47
48
  spaceInline = _ref.spaceInline,
48
49
  className = _ref.className,
49
50
  _ref$testId = _ref.testId,
50
- testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
51
+ testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId,
52
+ hideAISummaryAction = _ref.hideAISummaryAction;
51
53
  var context = useFlexibleUiContext();
52
54
  var ui = useFlexibleUiOptionContext();
53
55
  var _useState = useState(),
@@ -74,6 +76,11 @@ var ActionBlock = function ActionBlock(_ref) {
74
76
  return;
75
77
  }
76
78
  var arr = Object.keys(context.actions);
79
+ if (hideAISummaryAction && fg('platform_sl_3p_auth_rovo_action_kill_switch')) {
80
+ arr = arr.filter(function (name) {
81
+ return name !== 'AISummaryAction';
82
+ });
83
+ }
77
84
  arr.sort(sort);
78
85
  return arr.map(function (name) {
79
86
  var Action = name in Actions ? Actions[name] : undefined;
@@ -95,7 +102,7 @@ var ActionBlock = function ActionBlock(_ref) {
95
102
  hideTooltip: isLoading
96
103
  }) : null;
97
104
  });
98
- }, [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]);
105
+ }, [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]);
99
106
  return actions ? /*#__PURE__*/React.createElement("div", {
100
107
  ref: blockRef,
101
108
  "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,47 @@
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
+ var animation = null;
7
+ var animation1 = null;
8
+ var animation2 = null;
9
+ var dot1 = null;
10
+ var dot2 = null;
11
+ var dot3 = null;
12
+ var animatedOpacity = null;
13
+ export var EllipsesAnimation = function EllipsesAnimation(_ref) {
14
+ var _ref$isAnimated = _ref.isAnimated,
15
+ isAnimated = _ref$isAnimated === void 0 ? true : _ref$isAnimated;
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 && "_y44v1dzz", isAnimated && animatedOpacity]),
25
+ d: "M0.0800781 2V0.414062H1.67969V2H0.0800781Z",
26
+ fill: "#1868DB",
27
+ style: {
28
+ "--_8brvn1": ix("".concat(animation, " 1.5s forwards infinite"))
29
+ }
30
+ }), /*#__PURE__*/React.createElement("path", {
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
32
+ className: ax([isAnimated && "_y44v1uzy", isAnimated && animatedOpacity]),
33
+ d: "M3.83984 2V0.414062H5.43945V2H3.83984Z",
34
+ fill: "#BF63F3",
35
+ style: {
36
+ "--_lmysux": ix("".concat(animation1, " 1.5s forwards infinite"))
37
+ }
38
+ }), /*#__PURE__*/React.createElement("path", {
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
40
+ className: ax([isAnimated && "_y44v1bmh", isAnimated && animatedOpacity]),
41
+ d: "M7.59961 2V0.414062H9.19922V2H7.59961Z",
42
+ fill: "#FCA700",
43
+ style: {
44
+ "--_f6g77x": ix("".concat(animation2, " 1.5s forwards infinite"))
45
+ }
46
+ }));
47
+ };
@@ -1,10 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["testId"];
3
+ var _excluded = ["testId"],
4
+ _excluded2 = ["testId", "url"];
4
5
  import React from 'react';
5
6
  import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
6
7
  import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
7
- import AISummaryBlockResolvedView from './resolved';
8
+ import AISummaryBlockResolvedView, { RovoSummaryBlockResolvedView } from './resolved';
8
9
  /**
9
10
  * Represents an AISummaryBlock, designed to summarising link resource
10
11
  * content using AI.
@@ -32,4 +33,31 @@ var AISummaryBlock = function AISummaryBlock(_ref) {
32
33
  url: actionData.url
33
34
  }));
34
35
  };
36
+
37
+ /**
38
+ * Represents an AISummaryBlock, designed to summarising link resource
39
+ * content using AI.
40
+ * @public
41
+ * @param {RovoSummaryBlockProps} RovoSummaryBlock
42
+ * @see Block
43
+ */
44
+ export var RovoSummaryBlock = function RovoSummaryBlock(_ref2) {
45
+ var _props$size2, _cardContext$ui2;
46
+ var _ref2$testId = _ref2.testId,
47
+ testId = _ref2$testId === void 0 ? 'smart-ai-summary-block' : _ref2$testId,
48
+ url = _ref2.url,
49
+ props = _objectWithoutProperties(_ref2, _excluded2);
50
+ var cardContext = useFlexibleCardContext();
51
+ if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
52
+ return null;
53
+ }
54
+ if (!url) {
55
+ return null;
56
+ }
57
+ return /*#__PURE__*/React.createElement(RovoSummaryBlockResolvedView, _extends({}, props, {
58
+ 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,
59
+ testId: testId,
60
+ url: url
61
+ }));
62
+ };
35
63
  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)}
@@ -4,14 +4,26 @@ import "./index.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { Fragment, useRef } from 'react';
7
+ import { FormattedMessage } from 'react-intl-next';
7
8
  import { di } from 'react-magnetic-di';
9
+ import { RovoIcon } from '@atlaskit/logo';
10
+ import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
8
11
  import { SmartLinkDirection } from '../../../../../../constants';
12
+ import { messages } from '../../../../../../messages';
9
13
  import useAISummaryAction from '../../../../../../state/hooks/use-ai-summary-action';
10
14
  import AISummary from '../../../../../common/ai-summary';
15
+ import AIFooter from '../../../../../common/ai-summary/ai-footer';
11
16
  import MotionWrapper from '../../../common/motion-wrapper';
12
17
  import Block from '../../block';
13
18
  import AIEventSummaryViewed from '../ai-event-summary-viewed';
19
+ import { EllipsesAnimation } from '../assets/ellipses';
14
20
  var styles = null;
21
+ var newStyles = {
22
+ iconWrapper: "_19bv1b66 _u5f3utpp _1e0c1txw _4cvr1h6o",
23
+ placeholderWrapper: "_1e0c1txw _4cvr1h6o",
24
+ summaryWrapper: "_ca0q1b66 _1e0c1txw",
25
+ ellipsesContainer: "_19bv1b66"
26
+ };
15
27
  var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
16
28
  var testId = props.testId,
17
29
  _props$aiSummaryMinHe = props.aiSummaryMinHeight,
@@ -32,11 +44,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
32
44
  }
33
45
  return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
34
46
  direction: SmartLinkDirection.Vertical,
35
- testId: "".concat(testId, "-resolved-view")
36
- /**
37
- * Enabled for feature discovery to allow box shadow to overflow
38
- * Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
39
- */,
47
+ testId: "".concat(testId, "-resolved-view"),
40
48
  className: ax(["_1reoewfl _18m9ewfl"])
41
49
  }), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
42
50
  fromCache: isSummarisedOnMountRef.current
@@ -50,4 +58,58 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
50
58
  content: content
51
59
  })));
52
60
  };
61
+ export var RovoSummaryBlockResolvedView = function RovoSummaryBlockResolvedView(props) {
62
+ var testId = props.testId,
63
+ _props$aiSummaryMinHe2 = props.aiSummaryMinHeight,
64
+ aiSummaryMinHeight = _props$aiSummaryMinHe2 === void 0 ? 0 : _props$aiSummaryMinHe2,
65
+ url = props.url;
66
+ var _useAISummaryAction2 = useAISummaryAction(url),
67
+ _useAISummaryAction2$ = _useAISummaryAction2.state,
68
+ content = _useAISummaryAction2$.content,
69
+ status = _useAISummaryAction2$.status;
70
+ var showAISummary = status === 'done' ||
71
+ // We want to display the AI Summary component only when there is content available during the loading process.
72
+ status === 'loading' && !!content;
73
+ var isSummarisedOnMountRef = useRef(status === 'done');
74
+ var minHeight = isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
75
+ if (!showAISummary) {
76
+ return /*#__PURE__*/React.createElement(Inline, {
77
+ xcss: newStyles.placeholderWrapper
78
+ }, /*#__PURE__*/React.createElement("div", {
79
+ className: ax([newStyles.iconWrapper])
80
+ }, /*#__PURE__*/React.createElement(RovoIcon, {
81
+ shouldUseHexLogo: true,
82
+ size: 'xxsmall'
83
+ })), /*#__PURE__*/React.createElement(Text, {
84
+ size: "small",
85
+ color: "color.text"
86
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.rovo_summary_loading)), /*#__PURE__*/React.createElement(Box, {
87
+ xcss: newStyles.ellipsesContainer
88
+ }, /*#__PURE__*/React.createElement(EllipsesAnimation, {
89
+ isAnimated: true
90
+ })));
91
+ }
92
+ return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
93
+ direction: SmartLinkDirection.Vertical,
94
+ testId: "".concat(testId, "-resolved-view"),
95
+ className: ax(["_1reoewfl _18m9ewfl"])
96
+ }), /*#__PURE__*/React.createElement(Inline, {
97
+ xcss: newStyles.summaryWrapper
98
+ }, /*#__PURE__*/React.createElement("div", {
99
+ className: ax([newStyles.iconWrapper])
100
+ }, /*#__PURE__*/React.createElement(RovoIcon, {
101
+ shouldUseHexLogo: true,
102
+ size: 'xxsmall'
103
+ })), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
104
+ fromCache: isSummarisedOnMountRef.current
105
+ }), /*#__PURE__*/React.createElement(MotionWrapper, {
106
+ minHeight: minHeight,
107
+ show: showAISummary,
108
+ showTransition: !isSummarisedOnMountRef.current
109
+ }, /*#__PURE__*/React.createElement(AISummary, {
110
+ testId: "".concat(testId, "-ai-summary"),
111
+ minHeight: minHeight,
112
+ content: content
113
+ }), status === 'done' && /*#__PURE__*/React.createElement(AIFooter, null))));
114
+ };
53
115
  export default AISummaryBlockResolvedView;
@@ -3,11 +3,15 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
7
8
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
8
9
  import { succeedUfoExperience } from '../../../../../state/analytics';
10
+ import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
11
+ import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
9
12
  import FlexibleCard from '../../../../FlexibleCard';
10
13
  import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
14
+ import { RovoSummaryBlock } from '../../../../FlexibleCard/components/blocks/ai-summary-block';
11
15
  import { getMetadata } from '../../../utils';
12
16
  import ImagePreview from '../../ImagePreview';
13
17
  var hiddenSnippetStyles = null;
@@ -22,9 +26,11 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
22
26
  isAISummaryEnabled = _ref.isAISummaryEnabled,
23
27
  onActionClick = _ref.onActionClick,
24
28
  titleBlockProps = _ref.titleBlockProps,
25
- id = _ref.id;
29
+ id = _ref.id,
30
+ url = _ref.url;
26
31
  var _useAnalyticsEvents = useAnalyticsEvents(),
27
32
  fireEvent = _useAnalyticsEvents.fireEvent;
33
+ var rovoConfig = useRovoConfig();
28
34
  useEffect(function () {
29
35
  // Since this hover view is only rendered on resolved status,
30
36
  // there is no need to check for statuses.
@@ -61,6 +67,20 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
61
67
  className: ax(["_ca0q1b66"])
62
68
  });
63
69
  var aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
70
+ var isRovoSummaryEnabled = (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.isRovoEnabled) && extensionKey === 'google-object-provider' && fg('platform_sl_3p_auth_rovo_action_kill_switch');
71
+ var aiSummaryProps = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
72
+ // eslint-disable-next-line react-hooks/rules-of-hooks
73
+ useAISummaryAction(url) : undefined;
74
+ var hasSummarised = useRef(false);
75
+ useEffect(function () {
76
+ if (fg('platform_sl_3p_auth_rovo_action_kill_switch')) {
77
+ if ((aiSummaryProps === null || aiSummaryProps === void 0 ? void 0 : aiSummaryProps.state.status) !== 'ready' || hasSummarised.current) {
78
+ return;
79
+ }
80
+ hasSummarised.current = true;
81
+ aiSummaryProps === null || aiSummaryProps === void 0 || aiSummaryProps.summariseUrl();
82
+ }
83
+ }, [aiSummaryProps, isRovoSummaryEnabled]);
64
84
  return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
65
85
  metadataPosition: SmartLinkPosition.Top,
66
86
  className: ax(["_zulpu2gc _quenze3t _oebj1txw _13mh1pd9"])
@@ -69,7 +89,11 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
69
89
  secondary: secondary,
70
90
  maxLines: 1,
71
91
  size: SmartLinkSize.Medium
72
- }), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
92
+ }), isRovoSummaryEnabled ? /*#__PURE__*/React.createElement(RovoSummaryBlock, {
93
+ aiSummaryMinHeight: aiSummaryMinHeight,
94
+ placeholder: snippet,
95
+ url: url
96
+ }) : isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
73
97
  aiSummaryMinHeight: aiSummaryMinHeight,
74
98
  placeholder: snippet
75
99
  }) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
@@ -81,6 +105,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
81
105
  }), /*#__PURE__*/React.createElement(ActionBlock, {
82
106
  onClick: onActionClick,
83
107
  spaceInline: "space.100",
108
+ hideAISummaryAction: isRovoSummaryEnabled,
84
109
  className: ax(["_n3td1b66"])
85
110
  }), /*#__PURE__*/React.createElement(AIFooterBlock, null));
86
111
  };
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "43.24.9",
18
+ packageVersion: "43.25.0",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -0,0 +1 @@
1
+ ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
@@ -0,0 +1,30 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./index.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { FormattedMessage } from 'react-intl-next';
6
+ import InformationCircleIcon from '@atlaskit/icon/core/information-circle';
7
+ import Link from '@atlaskit/link';
8
+ import { Inline, Text } from '@atlaskit/primitives/compiled';
9
+ import { messages } from '../../../../messages';
10
+ var styles = {
11
+ aiFooterWrapper: "_ca0q1b66"
12
+ };
13
+ var AIFooter = function AIFooter() {
14
+ return /*#__PURE__*/React.createElement(Inline, {
15
+ alignBlock: "center",
16
+ space: "space.050",
17
+ xcss: styles.aiFooterWrapper
18
+ }, /*#__PURE__*/React.createElement(InformationCircleIcon, {
19
+ label: "",
20
+ color: "var(--ds-text-subtle, #505258)",
21
+ size: "small"
22
+ }), /*#__PURE__*/React.createElement(Text, {
23
+ size: "small"
24
+ }, /*#__PURE__*/React.createElement(Link, {
25
+ href: "https://www.atlassian.com/trust/atlassian-intelligence",
26
+ appearance: "subtle",
27
+ target: "_blank"
28
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_disclaimer))));
29
+ };
30
+ export 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}