@atlaskit/smart-card 43.27.2 → 43.27.3

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 (30) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +1 -1
  4. package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -2
  5. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +34 -3
  6. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +3 -18
  7. package/dist/cjs/view/LinkUrl/index.js +1 -1
  8. package/dist/es2019/utils/analytics/analytics.js +1 -1
  9. package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +1 -1
  10. package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -2
  11. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +35 -4
  12. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +2 -15
  13. package/dist/es2019/view/LinkUrl/index.js +1 -1
  14. package/dist/esm/utils/analytics/analytics.js +1 -1
  15. package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +1 -1
  16. package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -2
  17. package/dist/esm/view/HoverCard/components/HoverCardContent.js +35 -4
  18. package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -18
  19. package/dist/esm/view/LinkUrl/index.js +1 -1
  20. package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/action-button.d.ts +1 -1
  21. package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +2 -2
  22. package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
  23. package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +1 -0
  24. package/dist/types/view/HoverCard/types.d.ts +1 -0
  25. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/action-button.d.ts +1 -1
  26. package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +2 -2
  27. package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
  28. package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +1 -0
  29. package/dist/types-ts4.5/view/HoverCard/types.d.ts +1 -0
  30. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.27.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`972c9cf1a64ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/972c9cf1a64ee) -
8
+ Add viewVarient to HoverCard content analytics events
9
+ - Updated dependencies
10
+
3
11
  ## 43.27.2
4
12
 
5
13
  ### Patch Changes
@@ -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.27.1"
14
+ packageVersion: "43.27.2"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -55,7 +55,7 @@ var ActionButton = function ActionButton(_ref) {
55
55
  ,
56
56
  style: style
57
57
  }, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
58
- "aria-label": ariaLabel
58
+ 'aria-label': ariaLabel
59
59
  } : {}), /*#__PURE__*/React.createElement(_compiled.Inline, {
60
60
  alignBlock: "center",
61
61
  grow: "fill",
@@ -60,7 +60,6 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
60
60
  key: name,
61
61
  as: "stack-item",
62
62
  content: "",
63
- testId: "".concat(testId, "-").concat(name),
64
63
  onClick: function onClick() {
65
64
  return onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick(name);
66
65
  },
@@ -68,7 +67,7 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
68
67
  iconSize: 'small'
69
68
  }) : null;
70
69
  });
71
- }, [context === null || context === void 0 ? void 0 : context.actions, onActionClick, testId, size]);
70
+ }, [context === null || context === void 0 ? void 0 : context.actions, onActionClick, size]);
72
71
  return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
73
72
  size: size,
74
73
  testId: "".concat(testId, "-resolved-view"),
@@ -12,9 +12,13 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _analyticsNext = require("@atlaskit/analytics-next");
13
13
  var _linkProvider = require("@atlaskit/link-provider");
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
16
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
15
17
  var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
16
18
  var _constants = require("../../../constants");
19
+ var _extractRovoChatAction = _interopRequireDefault(require("../../../extractors/flexible/actions/extract-rovo-chat-action"));
17
20
  var _helpers = require("../../../state/helpers");
21
+ var _useRovoConfig = _interopRequireDefault(require("../../../state/hooks/use-rovo-config"));
18
22
  var _store = require("../../../state/store");
19
23
  var _utils = require("../../../utils");
20
24
  var _aiSummary = require("../../../utils/ai-summary");
@@ -42,7 +46,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
42
46
  onMouseEnter = _ref.onMouseEnter,
43
47
  onMouseLeave = _ref.onMouseLeave,
44
48
  actionOptions = _ref.actionOptions,
45
- hoverPreviewOptions = _ref.hoverPreviewOptions;
49
+ hoverPreviewOptions = _ref.hoverPreviewOptions,
50
+ showRovoResolvedView = _ref.showRovoResolvedView;
46
51
  var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
47
52
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
48
53
  var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
@@ -173,7 +178,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
173
178
  }
174
179
  if (cardState.status === 'resolved') {
175
180
  return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
176
- actionOptions: actionOptions
181
+ actionOptions: actionOptions,
182
+ showRovoResolvedView: showRovoResolvedView
177
183
  } : undefined, {
178
184
  cardState: cardState,
179
185
  extensionKey: extensionKey,
@@ -195,4 +201,29 @@ var HoverCardContent = function HoverCardContent(_ref) {
195
201
  url: url
196
202
  }, cardView) : null;
197
203
  };
198
- var _default = exports.default = HoverCardContent;
204
+ var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(props) {
205
+ var _props$cardState2, _props$cardState3;
206
+ var rovoConfig = (0, _useRovoConfig.default)();
207
+ var showRovoResolvedView = (0, _react.useMemo)(function () {
208
+ var _props$cardState;
209
+ return (props === null || props === void 0 || (_props$cardState = props.cardState) === null || _props$cardState === void 0 ? void 0 : _props$cardState.status) === 'resolved' && (props === null || props === void 0 ? void 0 : props.cardState.details) && (0, _extractRovoChatAction.default)({
210
+ response: props === null || props === void 0 ? void 0 : props.cardState.details,
211
+ rovoConfig: rovoConfig,
212
+ actionOptions: props === null || props === void 0 ? void 0 : props.actionOptions
213
+ }) !== undefined;
214
+ }, [props === null || props === void 0 ? void 0 : props.actionOptions, props === null || props === void 0 || (_props$cardState2 = props.cardState) === null || _props$cardState2 === void 0 ? void 0 : _props$cardState2.details, props === null || props === void 0 || (_props$cardState3 = props.cardState) === null || _props$cardState3 === void 0 ? void 0 : _props$cardState3.status, rovoConfig]);
215
+ var data = (0, _react.useMemo)(function () {
216
+ var viewVariant = showRovoResolvedView && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_rovo_action', 'isEnabled', true) ? 'rovo-resolved-view' : 'default';
217
+ return {
218
+ attributes: {
219
+ viewVariant: viewVariant
220
+ }
221
+ };
222
+ }, [showRovoResolvedView]);
223
+ return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
224
+ data: data
225
+ }, /*#__PURE__*/_react.default.createElement(HoverCardContent, (0, _extends2.default)({}, props, {
226
+ showRovoResolvedView: showRovoResolvedView
227
+ })));
228
+ };
229
+ var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithFG)('platform_sl_3p_auth_rovo_action_kill_switch', HoverCardContentWithViewVariant, HoverCardContent);
@@ -12,14 +12,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
14
  var _reactMagneticDi = require("react-magnetic-di");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
16
  var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
18
17
  var _constants = require("../../../../../constants");
19
- var _extractRovoChatAction = _interopRequireDefault(require("../../../../../extractors/flexible/actions/extract-rovo-chat-action"));
20
18
  var _analytics = require("../../../../../state/analytics");
21
19
  var _useAiSummaryAction = _interopRequireDefault(require("../../../../../state/hooks/use-ai-summary-action"));
22
- var _useRovoConfig = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
23
20
  var _FlexibleCard = _interopRequireDefault(require("../../../../FlexibleCard"));
24
21
  var _blocks = require("../../../../FlexibleCard/components/blocks");
25
22
  var _aiSummaryBlock = require("../../../../FlexibleCard/components/blocks/ai-summary-block");
@@ -32,33 +29,21 @@ var snippetBlockCss = null;
32
29
  var actionBlockCss = null;
33
30
  var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
34
31
  var _cardState$details;
35
- var actionOptions = _ref.actionOptions,
36
- cardState = _ref.cardState,
32
+ var cardState = _ref.cardState,
37
33
  extensionKey = _ref.extensionKey,
38
34
  flexibleCardProps = _ref.flexibleCardProps,
39
35
  isAISummaryEnabled = _ref.isAISummaryEnabled,
40
36
  onActionClick = _ref.onActionClick,
37
+ showRovoResolvedView = _ref.showRovoResolvedView,
41
38
  titleBlockProps = _ref.titleBlockProps,
42
39
  id = _ref.id,
43
40
  url = _ref.url;
44
41
  var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
45
42
  fireEvent = _useAnalyticsEvents.fireEvent;
46
- var rovoConfig = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ?
47
- // eslint-disable-next-line react-hooks/rules-of-hooks
48
- (0, _useRovoConfig.default)() : undefined;
49
- var isRovoSummaryEnabled = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ?
50
- // eslint-disable-next-line react-hooks/rules-of-hooks
51
- (0, _react.useMemo)(function () {
52
- return (cardState === null || cardState === void 0 ? void 0 : cardState.details) && (0, _extractRovoChatAction.default)({
53
- response: cardState.details,
54
- rovoConfig: rovoConfig,
55
- actionOptions: actionOptions
56
- }) !== undefined;
57
- }, [actionOptions, cardState === null || cardState === void 0 ? void 0 : cardState.details, rovoConfig]) : false;
58
43
 
59
44
  // We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
60
45
  // by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
61
- var is3PAuthRovoActionsExperimentOn = isRovoSummaryEnabled && (0, _expValEquals.expValEquals)('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
46
+ var is3PAuthRovoActionsExperimentOn = showRovoResolvedView && (0, _expValEquals.expValEquals)('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
62
47
  (0, _react.useEffect)(function () {
63
48
  // Since this hover view is only rendered on resolved status,
64
49
  // there is no need to check for statuses.
@@ -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.27.1",
25
+ packageVersion: "43.27.2",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -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.27.1"
5
+ packageVersion: "43.27.2"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -47,7 +47,7 @@ const ActionButton = ({
47
47
  ,
48
48
  style: style
49
49
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
50
- "aria-label": ariaLabel
50
+ 'aria-label': ariaLabel
51
51
  } : {}), /*#__PURE__*/React.createElement(Inline, {
52
52
  alignBlock: "center",
53
53
  grow: "fill",
@@ -48,13 +48,12 @@ const ResolvedHoverCardFooterBlock = ({
48
48
  key: name,
49
49
  as: "stack-item",
50
50
  content: "",
51
- testId: `${testId}-${name}`,
52
51
  onClick: () => onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick(name),
53
52
  size: size,
54
53
  iconSize: 'small'
55
54
  }) : null;
56
55
  });
57
- }, [context === null || context === void 0 ? void 0 : context.actions, onActionClick, testId, size]);
56
+ }, [context === null || context === void 0 ? void 0 : context.actions, onActionClick, size]);
58
57
  return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
59
58
  size: size,
60
59
  testId: `${testId}-resolved-view`,
@@ -1,11 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
3
- import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
3
+ import { AnalyticsContext, useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
4
4
  import { useSmartLinkContext } from '@atlaskit/link-provider';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
7
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
6
8
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
7
9
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
10
+ import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
8
11
  import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
12
+ import useRovoConfig from '../../../state/hooks/use-rovo-config';
9
13
  import { useSmartCardState } from '../../../state/store';
10
14
  import { isSpecialEvent } from '../../../utils';
11
15
  import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
@@ -28,7 +32,8 @@ const HoverCardContent = ({
28
32
  onMouseEnter,
29
33
  onMouseLeave,
30
34
  actionOptions,
31
- hoverPreviewOptions
35
+ hoverPreviewOptions,
36
+ showRovoResolvedView
32
37
  }) => {
33
38
  var _linkState$status, _cardState$details;
34
39
  const {
@@ -160,7 +165,8 @@ const HoverCardContent = ({
160
165
  }
161
166
  if (cardState.status === 'resolved') {
162
167
  return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
163
- actionOptions
168
+ actionOptions,
169
+ showRovoResolvedView
164
170
  } : undefined, {
165
171
  cardState: cardState,
166
172
  extensionKey: extensionKey,
@@ -182,4 +188,29 @@ const HoverCardContent = ({
182
188
  url: url
183
189
  }, cardView) : null;
184
190
  };
185
- export default HoverCardContent;
191
+ const HoverCardContentWithViewVariant = props => {
192
+ var _props$cardState2, _props$cardState3;
193
+ const rovoConfig = useRovoConfig();
194
+ const showRovoResolvedView = useMemo(() => {
195
+ var _props$cardState;
196
+ return (props === null || props === void 0 ? void 0 : (_props$cardState = props.cardState) === null || _props$cardState === void 0 ? void 0 : _props$cardState.status) === 'resolved' && (props === null || props === void 0 ? void 0 : props.cardState.details) && extractRovoChatAction({
197
+ response: props === null || props === void 0 ? void 0 : props.cardState.details,
198
+ rovoConfig,
199
+ actionOptions: props === null || props === void 0 ? void 0 : props.actionOptions
200
+ }) !== undefined;
201
+ }, [props === null || props === void 0 ? void 0 : props.actionOptions, props === null || props === void 0 ? void 0 : (_props$cardState2 = props.cardState) === null || _props$cardState2 === void 0 ? void 0 : _props$cardState2.details, props === null || props === void 0 ? void 0 : (_props$cardState3 = props.cardState) === null || _props$cardState3 === void 0 ? void 0 : _props$cardState3.status, rovoConfig]);
202
+ const data = useMemo(() => {
203
+ const viewVariant = showRovoResolvedView && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true) ? 'rovo-resolved-view' : 'default';
204
+ return {
205
+ attributes: {
206
+ viewVariant
207
+ }
208
+ };
209
+ }, [showRovoResolvedView]);
210
+ return /*#__PURE__*/React.createElement(AnalyticsContext, {
211
+ data: data
212
+ }, /*#__PURE__*/React.createElement(HoverCardContent, _extends({}, props, {
213
+ showRovoResolvedView: showRovoResolvedView
214
+ })));
215
+ };
216
+ export default componentWithFG('platform_sl_3p_auth_rovo_action_kill_switch', HoverCardContentWithViewVariant, HoverCardContent);
@@ -4,14 +4,11 @@ import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
6
6
  import { di } from 'react-magnetic-di';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
8
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
10
9
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
11
- import extractRovoChatAction from '../../../../../extractors/flexible/actions/extract-rovo-chat-action';
12
10
  import { succeedUfoExperience } from '../../../../../state/analytics';
13
11
  import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
14
- import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
15
12
  import FlexibleCard from '../../../../FlexibleCard';
16
13
  import { ActionBlock, AIFooterBlock, AISummaryBlock, ResolvedHoverCardFooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
17
14
  import { RovoSummaryBlock } from '../../../../FlexibleCard/components/blocks/ai-summary-block';
@@ -22,12 +19,12 @@ const titleBlockStyles = null;
22
19
  const snippetBlockCss = null;
23
20
  const actionBlockCss = null;
24
21
  const HoverCardResolvedView = ({
25
- actionOptions,
26
22
  cardState,
27
23
  extensionKey,
28
24
  flexibleCardProps,
29
25
  isAISummaryEnabled,
30
26
  onActionClick,
27
+ showRovoResolvedView,
31
28
  titleBlockProps,
32
29
  id,
33
30
  url
@@ -36,20 +33,10 @@ const HoverCardResolvedView = ({
36
33
  const {
37
34
  fireEvent
38
35
  } = useAnalyticsEvents();
39
- const rovoConfig = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
40
- // eslint-disable-next-line react-hooks/rules-of-hooks
41
- useRovoConfig() : undefined;
42
- const isRovoSummaryEnabled = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
43
- // eslint-disable-next-line react-hooks/rules-of-hooks
44
- useMemo(() => (cardState === null || cardState === void 0 ? void 0 : cardState.details) && extractRovoChatAction({
45
- response: cardState.details,
46
- rovoConfig,
47
- actionOptions
48
- }) !== undefined, [actionOptions, cardState === null || cardState === void 0 ? void 0 : cardState.details, rovoConfig]) : false;
49
36
 
50
37
  // We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
51
38
  // by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
52
- const is3PAuthRovoActionsExperimentOn = isRovoSummaryEnabled && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
39
+ const is3PAuthRovoActionsExperimentOn = showRovoResolvedView && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
53
40
  useEffect(() => {
54
41
  // Since this hover view is only rendered on resolved status,
55
42
  // there is no need to check for statuses.
@@ -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.27.1",
15
+ packageVersion: "43.27.2",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -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.27.1"
7
+ packageVersion: "43.27.2"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -46,7 +46,7 @@ var ActionButton = function ActionButton(_ref) {
46
46
  ,
47
47
  style: style
48
48
  }, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
49
- "aria-label": ariaLabel
49
+ 'aria-label': ariaLabel
50
50
  } : {}), /*#__PURE__*/React.createElement(Inline, {
51
51
  alignBlock: "center",
52
52
  grow: "fill",
@@ -52,7 +52,6 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
52
52
  key: name,
53
53
  as: "stack-item",
54
54
  content: "",
55
- testId: "".concat(testId, "-").concat(name),
56
55
  onClick: function onClick() {
57
56
  return onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick(name);
58
57
  },
@@ -60,7 +59,7 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
60
59
  iconSize: 'small'
61
60
  }) : null;
62
61
  });
63
- }, [context === null || context === void 0 ? void 0 : context.actions, onActionClick, testId, size]);
62
+ }, [context === null || context === void 0 ? void 0 : context.actions, onActionClick, size]);
64
63
  return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
65
64
  size: size,
66
65
  testId: "".concat(testId, "-resolved-view"),
@@ -3,12 +3,16 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
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
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; }
5
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
6
- import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
6
+ import { AnalyticsContext, useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
7
7
  import { useSmartLinkContext } from '@atlaskit/link-provider';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
10
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
11
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
10
12
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
13
+ import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
11
14
  import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
15
+ import useRovoConfig from '../../../state/hooks/use-rovo-config';
12
16
  import { useSmartCardState } from '../../../state/store';
13
17
  import { isSpecialEvent } from '../../../utils';
14
18
  import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
@@ -33,7 +37,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
33
37
  onMouseEnter = _ref.onMouseEnter,
34
38
  onMouseLeave = _ref.onMouseLeave,
35
39
  actionOptions = _ref.actionOptions,
36
- hoverPreviewOptions = _ref.hoverPreviewOptions;
40
+ hoverPreviewOptions = _ref.hoverPreviewOptions,
41
+ showRovoResolvedView = _ref.showRovoResolvedView;
37
42
  var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
38
43
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
39
44
  var _useAnalyticsEvents = useAnalyticsEvents(),
@@ -164,7 +169,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
164
169
  }
165
170
  if (cardState.status === 'resolved') {
166
171
  return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
167
- actionOptions: actionOptions
172
+ actionOptions: actionOptions,
173
+ showRovoResolvedView: showRovoResolvedView
168
174
  } : undefined, {
169
175
  cardState: cardState,
170
176
  extensionKey: extensionKey,
@@ -186,4 +192,29 @@ var HoverCardContent = function HoverCardContent(_ref) {
186
192
  url: url
187
193
  }, cardView) : null;
188
194
  };
189
- export default HoverCardContent;
195
+ var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(props) {
196
+ var _props$cardState2, _props$cardState3;
197
+ var rovoConfig = useRovoConfig();
198
+ var showRovoResolvedView = useMemo(function () {
199
+ var _props$cardState;
200
+ return (props === null || props === void 0 || (_props$cardState = props.cardState) === null || _props$cardState === void 0 ? void 0 : _props$cardState.status) === 'resolved' && (props === null || props === void 0 ? void 0 : props.cardState.details) && extractRovoChatAction({
201
+ response: props === null || props === void 0 ? void 0 : props.cardState.details,
202
+ rovoConfig: rovoConfig,
203
+ actionOptions: props === null || props === void 0 ? void 0 : props.actionOptions
204
+ }) !== undefined;
205
+ }, [props === null || props === void 0 ? void 0 : props.actionOptions, props === null || props === void 0 || (_props$cardState2 = props.cardState) === null || _props$cardState2 === void 0 ? void 0 : _props$cardState2.details, props === null || props === void 0 || (_props$cardState3 = props.cardState) === null || _props$cardState3 === void 0 ? void 0 : _props$cardState3.status, rovoConfig]);
206
+ var data = useMemo(function () {
207
+ var viewVariant = showRovoResolvedView && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true) ? 'rovo-resolved-view' : 'default';
208
+ return {
209
+ attributes: {
210
+ viewVariant: viewVariant
211
+ }
212
+ };
213
+ }, [showRovoResolvedView]);
214
+ return /*#__PURE__*/React.createElement(AnalyticsContext, {
215
+ data: data
216
+ }, /*#__PURE__*/React.createElement(HoverCardContent, _extends({}, props, {
217
+ showRovoResolvedView: showRovoResolvedView
218
+ })));
219
+ };
220
+ export default componentWithFG('platform_sl_3p_auth_rovo_action_kill_switch', HoverCardContentWithViewVariant, HoverCardContent);
@@ -4,14 +4,11 @@ import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
6
6
  import { di } from 'react-magnetic-di';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
8
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
10
9
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
11
- import extractRovoChatAction from '../../../../../extractors/flexible/actions/extract-rovo-chat-action';
12
10
  import { succeedUfoExperience } from '../../../../../state/analytics';
13
11
  import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
14
- import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
15
12
  import FlexibleCard from '../../../../FlexibleCard';
16
13
  import { ActionBlock, AIFooterBlock, AISummaryBlock, ResolvedHoverCardFooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
17
14
  import { RovoSummaryBlock } from '../../../../FlexibleCard/components/blocks/ai-summary-block';
@@ -23,33 +20,21 @@ var snippetBlockCss = null;
23
20
  var actionBlockCss = null;
24
21
  var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
25
22
  var _cardState$details;
26
- var actionOptions = _ref.actionOptions,
27
- cardState = _ref.cardState,
23
+ var cardState = _ref.cardState,
28
24
  extensionKey = _ref.extensionKey,
29
25
  flexibleCardProps = _ref.flexibleCardProps,
30
26
  isAISummaryEnabled = _ref.isAISummaryEnabled,
31
27
  onActionClick = _ref.onActionClick,
28
+ showRovoResolvedView = _ref.showRovoResolvedView,
32
29
  titleBlockProps = _ref.titleBlockProps,
33
30
  id = _ref.id,
34
31
  url = _ref.url;
35
32
  var _useAnalyticsEvents = useAnalyticsEvents(),
36
33
  fireEvent = _useAnalyticsEvents.fireEvent;
37
- var rovoConfig = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
38
- // eslint-disable-next-line react-hooks/rules-of-hooks
39
- useRovoConfig() : undefined;
40
- var isRovoSummaryEnabled = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
41
- // eslint-disable-next-line react-hooks/rules-of-hooks
42
- useMemo(function () {
43
- return (cardState === null || cardState === void 0 ? void 0 : cardState.details) && extractRovoChatAction({
44
- response: cardState.details,
45
- rovoConfig: rovoConfig,
46
- actionOptions: actionOptions
47
- }) !== undefined;
48
- }, [actionOptions, cardState === null || cardState === void 0 ? void 0 : cardState.details, rovoConfig]) : false;
49
34
 
50
35
  // We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
51
36
  // by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
52
- var is3PAuthRovoActionsExperimentOn = isRovoSummaryEnabled && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
37
+ var is3PAuthRovoActionsExperimentOn = showRovoResolvedView && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
53
38
  useEffect(function () {
54
39
  // Since this hover view is only rendered on resolved status,
55
40
  // there is no need to check for statuses.
@@ -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.27.1",
18
+ packageVersion: "43.27.2",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -1,6 +1,6 @@
1
1
  import type { TriggerProps } from '@atlaskit/tooltip';
2
2
  import type { ActionStackItemProps } from './types';
3
- declare const ActionButton: ({ content, icon: iconOption, isDisabled, isLoading, onClick: onClickCallback, size, space: spaceOption, testId, tooltipProps, style, ariaLabel }: ActionStackItemProps & {
3
+ declare const ActionButton: ({ content, icon: iconOption, isDisabled, isLoading, onClick: onClickCallback, size, space: spaceOption, testId, tooltipProps, style, ariaLabel, }: ActionStackItemProps & {
4
4
  tooltipProps?: TriggerProps;
5
5
  }) => JSX.Element;
6
6
  export default ActionButton;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type HoverCardContentProps } from '../types';
3
3
  export declare const hoverCardClassName = "smart-links-hover-preview";
4
- declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, hoverPreviewOptions, }: HoverCardContentProps) => React.JSX.Element | null;
5
- export default HoverCardContent;
4
+ declare const _default: React.FC<HoverCardContentProps>;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
1
  import { type HoverCardResolvedProps } from './types';
2
- declare const HoverCardResolvedView: ({ actionOptions, cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, titleBlockProps, id, url, }: HoverCardResolvedProps) => JSX.Element;
2
+ declare const HoverCardResolvedView: ({ cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, showRovoResolvedView, titleBlockProps, id, url, }: HoverCardResolvedProps) => JSX.Element;
3
3
  export default HoverCardResolvedView;
@@ -11,5 +11,6 @@ export type HoverCardResolvedProps = {
11
11
  id?: string;
12
12
  isAISummaryEnabled?: boolean;
13
13
  onActionClick: (actionId: string | ActionName) => void;
14
+ showRovoResolvedView?: boolean;
14
15
  url: string;
15
16
  } & HoverCardLoadingViewProps;
@@ -99,6 +99,7 @@ export type HoverCardContentProps = {
99
99
  onMouseLeave?: MouseEventHandler;
100
100
  onResolve: () => void;
101
101
  renderers?: CardProviderRenderers;
102
+ showRovoResolvedView?: boolean;
102
103
  url: string;
103
104
  };
104
105
  export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
@@ -1,6 +1,6 @@
1
1
  import type { TriggerProps } from '@atlaskit/tooltip';
2
2
  import type { ActionStackItemProps } from './types';
3
- declare const ActionButton: ({ content, icon: iconOption, isDisabled, isLoading, onClick: onClickCallback, size, space: spaceOption, testId, tooltipProps, style, ariaLabel }: ActionStackItemProps & {
3
+ declare const ActionButton: ({ content, icon: iconOption, isDisabled, isLoading, onClick: onClickCallback, size, space: spaceOption, testId, tooltipProps, style, ariaLabel, }: ActionStackItemProps & {
4
4
  tooltipProps?: TriggerProps;
5
5
  }) => JSX.Element;
6
6
  export default ActionButton;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type HoverCardContentProps } from '../types';
3
3
  export declare const hoverCardClassName = "smart-links-hover-preview";
4
- declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, hoverPreviewOptions, }: HoverCardContentProps) => React.JSX.Element | null;
5
- export default HoverCardContent;
4
+ declare const _default: React.FC<HoverCardContentProps>;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
1
  import { type HoverCardResolvedProps } from './types';
2
- declare const HoverCardResolvedView: ({ actionOptions, cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, titleBlockProps, id, url, }: HoverCardResolvedProps) => JSX.Element;
2
+ declare const HoverCardResolvedView: ({ cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, showRovoResolvedView, titleBlockProps, id, url, }: HoverCardResolvedProps) => JSX.Element;
3
3
  export default HoverCardResolvedView;
@@ -11,5 +11,6 @@ export type HoverCardResolvedProps = {
11
11
  id?: string;
12
12
  isAISummaryEnabled?: boolean;
13
13
  onActionClick: (actionId: string | ActionName) => void;
14
+ showRovoResolvedView?: boolean;
14
15
  url: string;
15
16
  } & HoverCardLoadingViewProps;
@@ -99,6 +99,7 @@ export type HoverCardContentProps = {
99
99
  onMouseLeave?: MouseEventHandler;
100
100
  onResolve: () => void;
101
101
  renderers?: CardProviderRenderers;
102
+ showRovoResolvedView?: boolean;
102
103
  url: string;
103
104
  };
104
105
  export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.27.2",
3
+ "version": "43.27.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/popup": "^4.14.0",
68
68
  "@atlaskit/primitives": "^18.0.0",
69
69
  "@atlaskit/react-ufo": "^5.4.0",
70
- "@atlaskit/rovo-triggers": "^5.30.0",
70
+ "@atlaskit/rovo-triggers": "^5.31.0",
71
71
  "@atlaskit/section-message": "^8.12.0",
72
72
  "@atlaskit/select": "^21.8.0",
73
73
  "@atlaskit/spinner": "^19.0.0",
@@ -75,7 +75,7 @@
75
75
  "@atlaskit/textfield": "^8.2.0",
76
76
  "@atlaskit/theme": "^22.0.0",
77
77
  "@atlaskit/tile": "^1.0.0",
78
- "@atlaskit/tmp-editor-statsig": "^44.1.0",
78
+ "@atlaskit/tmp-editor-statsig": "^44.2.0",
79
79
  "@atlaskit/tokens": "^11.1.0",
80
80
  "@atlaskit/tooltip": "^21.0.0",
81
81
  "@atlaskit/ufo": "^0.4.0",