@atlaskit/smart-card 32.7.7 → 32.7.9

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 (82) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/analytics.spec.yaml +31 -5
  3. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -6
  4. package/dist/cjs/state/actions/index.js +13 -38
  5. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +59 -306
  6. package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +2 -7
  7. package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +99 -6
  8. package/dist/cjs/utils/analytics/analytics.js +27 -301
  9. package/dist/cjs/utils/analytics/index.js +0 -66
  10. package/dist/cjs/view/CardWithUrl/component.js +7 -23
  11. package/dist/cjs/view/CardWithUrl/loader.js +14 -5
  12. package/dist/cjs/view/EmbedModal/components/analytics/index.js +88 -32
  13. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  14. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  15. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  16. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -2
  17. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
  18. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +0 -1
  19. package/dist/cjs/view/HoverCard/index.js +15 -8
  20. package/dist/cjs/view/LinkUrl/index.js +1 -1
  21. package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
  22. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +8 -7
  23. package/dist/es2019/state/actions/index.js +13 -38
  24. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +7 -239
  25. package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -3
  26. package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +97 -2
  27. package/dist/es2019/utils/analytics/analytics.js +2 -286
  28. package/dist/es2019/utils/analytics/index.js +1 -1
  29. package/dist/es2019/view/CardWithUrl/component.js +8 -24
  30. package/dist/es2019/view/CardWithUrl/loader.js +9 -1
  31. package/dist/es2019/view/EmbedModal/components/analytics/index.js +88 -32
  32. package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  33. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  34. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  35. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -1
  36. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
  37. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +0 -1
  38. package/dist/es2019/view/HoverCard/index.js +10 -2
  39. package/dist/es2019/view/LinkUrl/index.js +1 -1
  40. package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
  41. package/dist/esm/extractors/action/extract-invoke-preview-action.js +8 -7
  42. package/dist/esm/state/actions/index.js +13 -38
  43. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +60 -307
  44. package/dist/esm/utils/analytics/LinkAnalyticsContext.js +2 -7
  45. package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +95 -5
  46. package/dist/esm/utils/analytics/analytics.js +26 -300
  47. package/dist/esm/utils/analytics/index.js +1 -1
  48. package/dist/esm/view/CardWithUrl/component.js +8 -24
  49. package/dist/esm/view/CardWithUrl/loader.js +14 -5
  50. package/dist/esm/view/EmbedModal/components/analytics/index.js +88 -32
  51. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  52. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  53. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  54. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -1
  55. package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
  56. package/dist/esm/view/HoverCard/components/views/resolved/index.js +0 -1
  57. package/dist/esm/view/HoverCard/index.js +14 -4
  58. package/dist/esm/view/LinkUrl/index.js +1 -1
  59. package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
  60. package/dist/types/common/analytics/generated/analytics.types.d.ts +16 -2
  61. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
  62. package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
  63. package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
  64. package/dist/types/utils/analytics/analytics.d.ts +1 -51
  65. package/dist/types/utils/analytics/index.d.ts +1 -1
  66. package/dist/types/utils/analytics/types.d.ts +0 -60
  67. package/dist/types/utils/mocks.d.ts +0 -12
  68. package/dist/types/view/EmbedModal/components/analytics/types.d.ts +1 -0
  69. package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
  70. package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
  71. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +16 -2
  72. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
  73. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
  74. package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
  75. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -51
  76. package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
  77. package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -60
  78. package/dist/types-ts4.5/utils/mocks.d.ts +0 -12
  79. package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +1 -0
  80. package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
  81. package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
  82. package/package.json +2 -5
@@ -8,10 +8,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { jsx } from '@emotion/react';
10
10
  import DropdownMenu from '@atlaskit/dropdown-menu';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
13
12
  import extractLozengeActionItems from '../../../../../../extractors/action/extract-lozenge-action-items';
14
- import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
15
13
  import useInvoke from '../../../../../../state/hooks/use-invoke';
16
14
  import { isInvokeCustomError } from '../../../../../../state/hooks/use-invoke/utils';
17
15
  import useResolve from '../../../../../../state/hooks/use-resolve';
@@ -44,8 +42,6 @@ const LozengeAction = ({
44
42
  const [items, setItems] = useState();
45
43
  const [errorMessage, setErrorMessage] = useState();
46
44
  const reload = useResolve();
47
- //TODO EDM-6583 Replace usage of useFlexibleUiAnalyticsContext with linking platform analytics context from find team.
48
- const analytics = useFlexibleUiAnalyticsContext();
49
45
  const invoke = useInvoke();
50
46
  const {
51
47
  fireEvent
@@ -64,11 +60,7 @@ const LozengeAction = ({
64
60
  const handleOpenChange = useCallback(async args => {
65
61
  setIsOpen(args.isOpen);
66
62
  if (args.isOpen) {
67
- if (fg('platform_migrate-some-ui-events-smart-card')) {
68
- fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
69
- } else {
70
- analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionClickedEvent();
71
- }
63
+ fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
72
64
  fireEvent('track.smartLinkQuickAction.started', {
73
65
  smartLinkActionType: TrackQuickActionType.StatusUpdate
74
66
  });
@@ -96,7 +88,7 @@ const LozengeAction = ({
96
88
  if (!args.isOpen) {
97
89
  setErrorMessage(undefined);
98
90
  }
99
- }, [action.read, analytics, invoke, isLoaded, text, fireEvent]);
91
+ }, [action.read, invoke, isLoaded, text, fireEvent]);
100
92
  const trigger = useCallback(props => jsx(LozengeActionTrigger, _extends({}, props, {
101
93
  appearance: selected.appearance,
102
94
  isOpen: isOpen,
@@ -105,11 +97,7 @@ const LozengeAction = ({
105
97
  })), [selected.appearance, selected.text, isOpen, testId]);
106
98
  const handleItemClick = useCallback(async (id, text, appearance) => {
107
99
  try {
108
- if (fg('platform_migrate-some-ui-events-smart-card')) {
109
- fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
110
- } else {
111
- analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionListItemClickedEvent();
112
- }
100
+ fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
113
101
  const updateAction = action === null || action === void 0 ? void 0 : action.update;
114
102
  if (updateAction && id) {
115
103
  setIsLoading(true);
@@ -140,7 +128,7 @@ const LozengeAction = ({
140
128
  fireEvent('track.smartLinkQuickAction.failed', unknownUpdateErrorAnalyticsPayload);
141
129
  }
142
130
  }
143
- }, [action === null || action === void 0 ? void 0 : action.update, analytics, invoke, linkId, reload, url, fireEvent]);
131
+ }, [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
144
132
  const dropdownItemGroup = useMemo(() => {
145
133
  if (errorMessage) {
146
134
  return jsx(LozengeActionError, {
@@ -41,11 +41,7 @@ const LozengeActionError = ({
41
41
  }, [reload, url]);
42
42
  const handlePreviewOpen = useCallback(() => {
43
43
  if (isPreviewAvailable) {
44
- if (fg('platform_migrate-some-ui-events-smart-card')) {
45
- fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
46
- } else {
47
- analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
48
- }
44
+ fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
49
45
  if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
50
46
  invokePreviewAction && invoke(invokePreviewAction);
51
47
  } else {
@@ -17,7 +17,7 @@ import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAna
17
17
  import CustomPopupContainer from '../components/CustomPopupContainer';
18
18
  import HoverCardContent from '../components/HoverCardContent';
19
19
  import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
20
- const HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
20
+ export const HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
21
21
  const FADE_IN_DELAY = 500;
22
22
  const FADE_OUT_DELAY = 300;
23
23
  const RESOLVE_DELAY = 100;
@@ -8,7 +8,6 @@ import React, { useCallback, useEffect, useMemo, useRef } from 'react';
8
8
  import { jsx } from '@emotion/react';
9
9
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
10
10
  import { useSmartLinkContext } from '@atlaskit/link-provider';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
13
12
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
14
13
  import { useSmartLinkAnalytics } from '../../../state/analytics';
@@ -56,17 +55,13 @@ const HoverCardContent = ({
56
55
  const isAISummaryEnabled = getIsAISummaryEnabled(isAdminHubAIEnabled, cardState.details);
57
56
  const services = getServices(linkState.details);
58
57
  const statusRef = useRef(linkStatus);
59
- const analyticsRef = useRef(analytics);
60
58
  const fireEventRef = useRef(fireEvent);
61
59
  const definitionIdRef = useRef(definitionId);
62
60
  useEffect(() => {
63
61
  /**
64
- * Must access current analytics object value via ref because its not stable
62
+ * Must access object value via ref because its not stable
65
63
  * and it can trigger useEffect to re-run below
66
64
  */
67
- if (analyticsRef.current !== analytics) {
68
- analyticsRef.current = analytics;
69
- }
70
65
  if (statusRef.current !== linkStatus) {
71
66
  statusRef.current = linkStatus;
72
67
  }
@@ -76,66 +71,39 @@ const HoverCardContent = ({
76
71
  if (definitionIdRef.current !== definitionId) {
77
72
  definitionIdRef.current = definitionId;
78
73
  }
79
- }, [analytics, linkStatus, fireEvent, definitionId]);
74
+ }, [linkStatus, fireEvent, definitionId]);
80
75
  useEffect(() => {
76
+ var _definitionIdRef$curr;
81
77
  const previewDisplay = 'card';
82
78
  const previewInvokeMethod = 'mouse_hover';
83
79
  const cardOpenTime = Date.now();
84
80
  const fireEventCurrent = fireEventRef.current;
85
- if (fg('platform_migrate-some-ui-events-smart-card')) {
86
- var _definitionIdRef$curr;
87
- fireEventCurrent('ui.hoverCard.viewed', {
88
- previewDisplay,
89
- previewInvokeMethod,
90
- definitionId: (_definitionIdRef$curr = definitionIdRef.current) !== null && _definitionIdRef$curr !== void 0 ? _definitionIdRef$curr : null
91
- });
92
- } else {
93
- analyticsRef.current.ui.hoverCardViewedEvent({
81
+ fireEventCurrent('ui.hoverCard.viewed', {
82
+ previewDisplay,
83
+ previewInvokeMethod,
84
+ definitionId: (_definitionIdRef$curr = definitionIdRef.current) !== null && _definitionIdRef$curr !== void 0 ? _definitionIdRef$curr : null
85
+ });
86
+ return () => {
87
+ var _definitionIdRef$curr2;
88
+ const hoverTime = Date.now() - cardOpenTime;
89
+ fireEventCurrent('ui.hoverCard.dismissed', {
94
90
  previewDisplay,
95
91
  previewInvokeMethod,
96
- status: statusRef.current
92
+ hoverTime,
93
+ definitionId: (_definitionIdRef$curr2 = definitionIdRef.current) !== null && _definitionIdRef$curr2 !== void 0 ? _definitionIdRef$curr2 : null
97
94
  });
98
- }
99
- return () => {
100
- const hoverTime = Date.now() - cardOpenTime;
101
- if (fg('platform_migrate-some-ui-events-smart-card')) {
102
- var _definitionIdRef$curr2;
103
- fireEventCurrent('ui.hoverCard.dismissed', {
104
- previewDisplay,
105
- previewInvokeMethod,
106
- hoverTime,
107
- definitionId: (_definitionIdRef$curr2 = definitionIdRef.current) !== null && _definitionIdRef$curr2 !== void 0 ? _definitionIdRef$curr2 : null
108
- });
109
- } else {
110
- analyticsRef.current.ui.hoverCardDismissedEvent({
111
- previewDisplay,
112
- previewInvokeMethod,
113
- hoverTime,
114
- status: statusRef.current
115
- });
116
- }
117
95
  };
118
96
  }, []);
119
97
  const onClick = useCallback(event => {
120
98
  const isModifierKeyPressed = isSpecialEvent(event);
121
- if (fg('platform_migrate-some-ui-events-smart-card')) {
122
- fireEvent('ui.smartLink.clicked.titleGoToLink', {
123
- id,
124
- display: CardDisplay.HoverCardPreview,
125
- isModifierKeyPressed,
126
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
127
- });
128
- } else {
129
- analytics.ui.cardClickedEvent({
130
- id,
131
- display: CardDisplay.HoverCardPreview,
132
- status: cardState.status,
133
- isModifierKeyPressed,
134
- actionSubjectId: 'titleGoToLink'
135
- });
136
- }
99
+ fireEvent('ui.smartLink.clicked.titleGoToLink', {
100
+ id,
101
+ display: CardDisplay.HoverCardPreview,
102
+ isModifierKeyPressed,
103
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
104
+ });
137
105
  fireLinkClickedEvent(createAnalyticsEvent)(event);
138
- }, [createAnalyticsEvent, cardState.status, analytics.ui, id, fireEvent, definitionId]);
106
+ }, [createAnalyticsEvent, id, fireEvent, definitionId]);
139
107
  const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
140
108
  const {
141
109
  subtitle
@@ -40,7 +40,6 @@ const HoverCardResolvedView = ({
40
40
  display: CardDisplay.HoverCardPreview
41
41
  });
42
42
  fireEvent('ui.smartLink.renderSuccess', {
43
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
44
43
  display: CardDisplay.HoverCardPreview
45
44
  });
46
45
  } else {
@@ -15,7 +15,8 @@ import { CardDisplay } from '../../constants';
15
15
  import { useSmartLinkAnalytics } from '../../state';
16
16
  import { failUfoExperience, startUfoExperience } from '../../state/analytics';
17
17
  import { SmartLinkModalProvider } from '../../state/modal';
18
- import { HoverCardComponent } from './components/HoverCardComponent';
18
+ import { useSmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
19
+ import { HOVER_CARD_SOURCE, HoverCardComponent } from './components/HoverCardComponent';
19
20
  const HoverCardWithErrorBoundary = props => {
20
21
  const {
21
22
  fireEvent
@@ -26,12 +27,19 @@ const HoverCardWithErrorBoundary = props => {
26
27
  children
27
28
  } = props;
28
29
  const analytics = useSmartLinkAnalytics(url, id);
30
+ const analyticsContext = useSmartLinkAnalyticsContext({
31
+ display: CardDisplay.HoverCardPreview,
32
+ id,
33
+ source: HOVER_CARD_SOURCE,
34
+ url
35
+ });
29
36
  const onError = useCallback((error, info) => {
30
37
  if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
31
38
  startUfoExperience('smart-link-rendered', id || 'NULL');
32
39
  failUfoExperience('smart-link-rendered', id || 'NULL');
33
40
  failUfoExperience('smart-link-authenticated', id || 'NULL');
34
41
  fireEvent('ui.smartLink.renderFailed', {
42
+ ...(analyticsContext === null || analyticsContext === void 0 ? void 0 : analyticsContext.attributes),
35
43
  display: CardDisplay.HoverCardPreview,
36
44
  id: id !== null && id !== void 0 ? id : null,
37
45
  error: error,
@@ -45,7 +53,7 @@ const HoverCardWithErrorBoundary = props => {
45
53
  errorInfo: info
46
54
  });
47
55
  }
48
- }, [analytics.ui, id, fireEvent]);
56
+ }, [analytics.ui, analyticsContext, id, fireEvent]);
49
57
  return jsx(ErrorBoundary, {
50
58
  fallback: children,
51
59
  onError: onError
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "32.7.7",
13
+ packageVersion: "32.7.9",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
6
5
  import { CONTENT_URL_3P_ACCOUNT_AUTH, CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
7
6
  import { messages } from '../../messages';
@@ -12,19 +11,14 @@ import { messages } from '../../messages';
12
11
  const UnauthorisedViewContent = ({
13
12
  providerName,
14
13
  isProductIntegrationSupported,
15
- testId = 'unauthorised-view-content',
16
- analytics
14
+ testId = 'unauthorised-view-content'
17
15
  }) => {
18
16
  const {
19
17
  fireEvent
20
18
  } = useAnalyticsEvents();
21
19
  const handleLearnMoreClick = useCallback(() => {
22
- if (fg('platform_migrate-some-ui-events-smart-card')) {
23
- fireEvent('ui.button.clicked.learnMore', {});
24
- } else {
25
- analytics === null || analytics === void 0 ? void 0 : analytics.ui.learnMoreClickedEvent();
26
- }
27
- }, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent]);
20
+ fireEvent('ui.button.clicked.learnMore', {});
21
+ }, [fireEvent]);
28
22
  const learnMoreMessage = isProductIntegrationSupported ? messages.learn_more_about_connecting_account : messages.learn_more_about_smart_links;
29
23
  return /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
30
24
  values: {
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { extractLink, extractPreview as extractPreviewData, extractProvider, extractTitle } from '@atlaskit/link-extractors';
4
4
  import { ActionName, CardAction } from '../../index';
5
- import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
5
+ import { getExtensionKey } from '../../state/helpers';
6
6
  import { canShowAction } from '../../utils/actions/can-show-action';
7
7
  import { openEmbedModal } from '../../view/EmbedModal/utils';
8
8
  import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
@@ -27,6 +27,7 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
27
27
  var src = (_extractPreviewData = extractPreviewData(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
28
28
  if (src) {
29
29
  var url = extractLink(data);
30
+ var extensionKey = getExtensionKey(response);
30
31
  return {
31
32
  actionFn: function () {
32
33
  var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -36,7 +37,10 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
36
37
  case 0:
37
38
  return _context.abrupt("return", openEmbedModal({
38
39
  fireEvent: fireEvent,
40
+ extensionKey: extensionKey,
41
+ id: id,
39
42
  invokeDownloadAction: extractInvokeDownloadAction(param),
43
+ invokeViewAction: extractInvokeViewAction(param, true),
40
44
  isSupportTheming: extractIsSupportTheming(meta),
41
45
  isTrusted: extractIsTrusted(meta),
42
46
  linkIcon: extractLinkIcon(response),
@@ -45,8 +49,7 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
45
49
  origin: origin,
46
50
  src: src,
47
51
  title: extractTitle(data),
48
- url: url,
49
- invokeViewAction: extractInvokeViewAction(param, true)
52
+ url: url
50
53
  }));
51
54
  case 1:
52
55
  case "end":
@@ -61,11 +64,9 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
61
64
  }(),
62
65
  actionSubjectId: 'invokePreviewScreen',
63
66
  actionType: ActionName.PreviewAction,
64
- definitionId: getDefinitionId(response),
65
67
  display: display,
66
- extensionKey: getExtensionKey(response),
67
- id: id,
68
- resourceType: getResourceType(response)
68
+ extensionKey: extensionKey,
69
+ id: id
69
70
  };
70
71
  }
71
72
  };
@@ -4,7 +4,6 @@ import { useCallback, useMemo } from 'react';
4
4
  import { useSmartLinkContext } from '@atlaskit/link-provider';
5
5
  import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
6
6
  import { auth } from '@atlaskit/outbound-auth-flow-client';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
9
8
  import { SmartLinkStatus } from '../../constants';
10
9
  import { startUfoExperience } from '../analytics';
@@ -100,32 +99,16 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
100
99
  var services = getServices(details);
101
100
  // When authentication is triggered, let GAS know!
102
101
  if (status === 'unauthorized') {
103
- if (fg('platform_migrate-some-ui-events-smart-card')) {
104
- fireEvent('ui.button.clicked.connectAccount', {
105
- display: appearance,
106
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
107
- });
108
- } else {
109
- analytics.ui.authEvent({
110
- display: appearance,
111
- definitionId: definitionId,
112
- extensionKey: extensionKey
113
- });
114
- }
102
+ fireEvent('ui.button.clicked.connectAccount', {
103
+ display: appearance,
104
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
105
+ });
115
106
  }
116
107
  if (status === 'forbidden') {
117
- if (fg('platform_migrate-some-ui-events-smart-card')) {
118
- fireEvent('ui.smartLink.clicked.tryAnotherAccount', {
119
- display: appearance,
120
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
121
- });
122
- } else {
123
- analytics.ui.authAlternateAccountEvent({
124
- display: appearance,
125
- definitionId: definitionId,
126
- extensionKey: extensionKey
127
- });
128
- }
108
+ fireEvent('ui.smartLink.clicked.tryAnotherAccount', {
109
+ display: appearance,
110
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
111
+ });
129
112
  }
130
113
  if (services.length > 0) {
131
114
  fireEvent('screen.consentModal.viewed', {
@@ -154,23 +137,15 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
154
137
  reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
155
138
  });
156
139
  if (err.type === 'auth_window_closed') {
157
- if (fg('platform_migrate-some-ui-events-smart-card')) {
158
- fireEvent('ui.consentModal.closed', {
159
- display: appearance,
160
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
161
- });
162
- } else {
163
- analytics.ui.closedAuthEvent({
164
- display: appearance,
165
- definitionId: definitionId,
166
- extensionKey: extensionKey
167
- });
168
- }
140
+ fireEvent('ui.consentModal.closed', {
141
+ display: appearance,
142
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
143
+ });
169
144
  }
170
145
  reload();
171
146
  });
172
147
  }
173
- }, [getSmartLinkState, analytics.ui, id, reload, fireEvent]);
148
+ }, [getSmartLinkState, id, reload, fireEvent]);
174
149
  var invoke = useCallback( /*#__PURE__*/function () {
175
150
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(opts, appearance) {
176
151
  var key, action, source;