@atlaskit/smart-card 32.7.7 → 32.7.8

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 (49) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/state/actions/index.js +13 -38
  3. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +54 -305
  4. package/dist/cjs/utils/analytics/analytics.js +27 -301
  5. package/dist/cjs/utils/analytics/index.js +0 -66
  6. package/dist/cjs/view/CardWithUrl/component.js +7 -22
  7. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  8. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  9. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  10. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
  13. package/dist/es2019/state/actions/index.js +13 -38
  14. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +2 -238
  15. package/dist/es2019/utils/analytics/analytics.js +2 -286
  16. package/dist/es2019/utils/analytics/index.js +1 -1
  17. package/dist/es2019/view/CardWithUrl/component.js +8 -23
  18. package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  19. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  20. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  21. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
  22. package/dist/es2019/view/LinkUrl/index.js +1 -1
  23. package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
  24. package/dist/esm/state/actions/index.js +13 -38
  25. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +55 -306
  26. package/dist/esm/utils/analytics/analytics.js +26 -300
  27. package/dist/esm/utils/analytics/index.js +1 -1
  28. package/dist/esm/view/CardWithUrl/component.js +8 -23
  29. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  30. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  31. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  32. package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
  33. package/dist/esm/view/LinkUrl/index.js +1 -1
  34. package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
  35. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
  36. package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
  37. package/dist/types/utils/analytics/analytics.d.ts +1 -51
  38. package/dist/types/utils/analytics/index.d.ts +1 -1
  39. package/dist/types/utils/analytics/types.d.ts +0 -60
  40. package/dist/types/utils/mocks.d.ts +0 -12
  41. package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
  42. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
  43. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
  44. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -51
  45. package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
  46. package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -60
  47. package/dist/types-ts4.5/utils/mocks.d.ts +0 -12
  48. package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
  49. package/package.json +2 -5
@@ -1,10 +1,9 @@
1
- import { SmartLinkActionType } from '@atlaskit/linking-types';
2
1
  import { getMeasure } from '../performance';
3
2
  export const ANALYTICS_CHANNEL = 'media';
4
3
  export const context = {
5
4
  componentName: 'smart-cards',
6
5
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "32.7.7"
6
+ packageVersion: "32.7.8"
8
7
  };
9
8
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
9
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -16,15 +15,6 @@ export let TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
16
15
  TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
17
16
  return TrackQuickActionFailureReason;
18
17
  }({});
19
- export const SmartLinkActionTypeTrackingEventMapper = {
20
- [SmartLinkActionType.FollowEntityAction]: 'Follow',
21
- [SmartLinkActionType.StatusUpdateAction]: 'StatusUpdate',
22
- [SmartLinkActionType.UnfollowEntityAction]: 'Unfollow'
23
- };
24
- export const SmartLinkActionTypeUiEventMapper = {
25
- [SmartLinkActionType.FollowEntityAction]: 'smartLinkFollowButton',
26
- [SmartLinkActionType.UnfollowEntityAction]: 'smartLinkFollowButton'
27
- };
28
18
  const uiActionSubjectIds = {
29
19
  DownloadAction: 'downloadDocument',
30
20
  PreviewAction: 'invokePreviewScreen',
@@ -111,91 +101,6 @@ export const invokeFailedEvent = ({
111
101
  }
112
102
  };
113
103
  };
114
-
115
- /**
116
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
117
- */
118
- export const uiAuthEvent = ({
119
- definitionId,
120
- extensionKey,
121
- destinationProduct,
122
- destinationSubproduct,
123
- location,
124
- display
125
- }) => ({
126
- action: 'clicked',
127
- actionSubject: 'button',
128
- actionSubjectId: 'connectAccount',
129
- eventType: 'ui',
130
- attributes: {
131
- ...context,
132
- definitionId,
133
- extensionKey,
134
- destinationProduct,
135
- destinationSubproduct,
136
- location,
137
- display
138
- }
139
- });
140
-
141
- /**
142
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
143
- */
144
- export const uiAuthAlternateAccountEvent = ({
145
- definitionId,
146
- extensionKey,
147
- destinationProduct,
148
- destinationSubproduct,
149
- location,
150
- display
151
- }) => ({
152
- action: 'clicked',
153
- actionSubject: 'smartLink',
154
- actionSubjectId: 'tryAnotherAccount',
155
- eventType: 'ui',
156
- attributes: {
157
- ...context,
158
- definitionId,
159
- extensionKey,
160
- destinationProduct,
161
- destinationSubproduct,
162
- location,
163
- display
164
- }
165
- });
166
-
167
- /**
168
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
169
- */
170
- export const uiCardClickedEvent = ({
171
- id,
172
- display,
173
- status,
174
- definitionId,
175
- extensionKey,
176
- isModifierKeyPressed,
177
- location,
178
- destinationProduct,
179
- destinationSubproduct,
180
- actionSubjectId
181
- }) => ({
182
- action: 'clicked',
183
- actionSubject: 'smartLink',
184
- actionSubjectId,
185
- eventType: 'ui',
186
- attributes: {
187
- ...context,
188
- id,
189
- status,
190
- definitionId,
191
- extensionKey,
192
- display,
193
- isModifierKeyPressed,
194
- location,
195
- destinationProduct,
196
- destinationSubproduct
197
- }
198
- });
199
104
  export const uiActionClickedEvent = ({
200
105
  id,
201
106
  actionType,
@@ -222,31 +127,6 @@ export const uiActionClickedEvent = ({
222
127
  location
223
128
  }
224
129
  });
225
-
226
- /**
227
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
228
- */
229
- export const uiClosedAuthEvent = ({
230
- display,
231
- extensionKey,
232
- definitionId,
233
- destinationProduct,
234
- destinationSubproduct,
235
- location
236
- }) => ({
237
- action: 'closed',
238
- actionSubject: 'consentModal',
239
- eventType: 'ui',
240
- attributes: {
241
- ...context,
242
- extensionKey,
243
- definitionId,
244
- destinationProduct,
245
- destinationSubproduct,
246
- location,
247
- display
248
- }
249
- });
250
130
  export const uiRenderSuccessEvent = ({
251
131
  display,
252
132
  status,
@@ -296,168 +176,4 @@ export const uiRenderFailedEvent = ({
296
176
  destinationSubproduct,
297
177
  location
298
178
  }
299
- });
300
-
301
- /**
302
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
303
- */
304
- export const uiHoverCardViewedEvent = ({
305
- id,
306
- previewDisplay,
307
- extensionKey,
308
- definitionId,
309
- destinationProduct,
310
- destinationSubproduct,
311
- location,
312
- previewInvokeMethod,
313
- status
314
- }) => ({
315
- action: 'viewed',
316
- actionSubject: 'hoverCard',
317
- eventType: 'ui',
318
- attributes: {
319
- ...context,
320
- id,
321
- previewDisplay,
322
- extensionKey,
323
- definitionId,
324
- destinationProduct,
325
- destinationSubproduct,
326
- location,
327
- previewInvokeMethod,
328
- status
329
- }
330
- });
331
-
332
- /**
333
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
334
- */
335
- export const uiHoverCardDismissedEvent = ({
336
- id,
337
- previewDisplay,
338
- hoverTime,
339
- extensionKey,
340
- definitionId,
341
- destinationProduct,
342
- destinationSubproduct,
343
- location,
344
- previewInvokeMethod,
345
- status
346
- }) => ({
347
- action: 'dismissed',
348
- actionSubject: 'hoverCard',
349
- eventType: 'ui',
350
- attributes: {
351
- ...context,
352
- id,
353
- previewDisplay,
354
- hoverTime,
355
- extensionKey,
356
- definitionId,
357
- destinationProduct,
358
- destinationSubproduct,
359
- location,
360
- previewInvokeMethod,
361
- status
362
- }
363
- });
364
-
365
- /**
366
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
367
- */
368
- export const uiHoverCardOpenLinkClickedEvent = ({
369
- id,
370
- previewDisplay,
371
- extensionKey,
372
- definitionId,
373
- destinationProduct,
374
- destinationSubproduct,
375
- location,
376
- previewInvokeMethod
377
- }) => ({
378
- action: 'clicked',
379
- actionSubject: 'button',
380
- actionSubjectId: 'shortcutGoToLink',
381
- eventType: 'ui',
382
- attributes: {
383
- ...context,
384
- id,
385
- previewDisplay,
386
- extensionKey,
387
- definitionId,
388
- destinationProduct,
389
- destinationSubproduct,
390
- location,
391
- previewInvokeMethod
392
- }
393
- });
394
-
395
- /**
396
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
397
- */
398
- export const uiLearnMoreLinkClickedEvent = () => ({
399
- action: 'clicked',
400
- actionSubject: 'button',
401
- actionSubjectId: 'learnMore',
402
- eventType: 'ui',
403
- attributes: {
404
- ...context
405
- }
406
- });
407
-
408
- /**
409
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
410
- */
411
- export const uiSmartLinkStatusLozengeButtonClicked = () => ({
412
- action: 'clicked',
413
- actionSubject: 'button',
414
- actionSubjectId: 'smartLinkStatusLozenge',
415
- eventType: 'ui',
416
- attributes: {
417
- ...context
418
- }
419
- });
420
-
421
- /**
422
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
423
- */
424
- export const uiSmartLinkStatusListItemButtonClicked = () => ({
425
- action: 'clicked',
426
- actionSubject: 'button',
427
- actionSubjectId: 'smartLinkStatusListItem',
428
- eventType: 'ui',
429
- attributes: {
430
- ...context
431
- }
432
- });
433
-
434
- /**
435
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
436
- */
437
- export const uiSmartLinkStatusOpenPreviewButtonClicked = () => ({
438
- action: 'clicked',
439
- actionSubject: 'button',
440
- actionSubjectId: 'smartLinkStatusOpenPreview',
441
- eventType: 'ui',
442
- attributes: {
443
- ...context
444
- }
445
- });
446
-
447
- /**
448
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
449
- */
450
- export const uiServerActionClicked = ({
451
- smartLinkActionType
452
- }) => {
453
- var _SmartLinkActionTypeU;
454
- return {
455
- action: 'clicked',
456
- actionSubject: 'button',
457
- actionSubjectId: (_SmartLinkActionTypeU = SmartLinkActionTypeUiEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeU !== void 0 ? _SmartLinkActionTypeU : smartLinkActionType,
458
- eventType: 'ui',
459
- attributes: {
460
- ...context
461
- }
462
- };
463
- };
179
+ });
@@ -1 +1 @@
1
- export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from './analytics';
1
+ export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiActionClickedEvent, uiRenderSuccessEvent, uiRenderFailedEvent } from './analytics';
@@ -5,7 +5,7 @@ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analyti
5
5
  import { CardDisplay } from '../../constants';
6
6
  import { useSmartLink } from '../../state';
7
7
  import { succeedUfoExperience } from '../../state/analytics';
8
- import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getProduct, getResourceType, getServices, getSubproduct, isFinalState } from '../../state/helpers';
8
+ import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getResourceType, getServices, isFinalState } from '../../state/helpers';
9
9
  import { SmartLinkModalProvider } from '../../state/modal';
10
10
  import { isSpecialEvent } from '../../utils';
11
11
  import { combineActionOptions } from '../../utils/actions/combine-action-options';
@@ -64,8 +64,6 @@ function Component({
64
64
  const definitionId = getDefinitionId(state.details);
65
65
  const extensionKey = getExtensionKey(state.details);
66
66
  const resourceType = getResourceType(state.details);
67
- const product = getProduct(state.details);
68
- const subproduct = getSubproduct(state.details);
69
67
  const services = getServices(state.details);
70
68
  const canBeDatasource = getCanBeDatasource(state.details);
71
69
  let isFlexibleUi = useMemo(() => isFlexibleUiCard(children), [children]);
@@ -77,25 +75,12 @@ function Component({
77
75
  // Setup UI handlers.
78
76
  const handleClickWrapper = useCallback(event => {
79
77
  const isModifierKeyPressed = isSpecialEvent(event);
80
- if (fg('platform_migrate-some-ui-events-smart-card')) {
81
- fireEvent('ui.smartLink.clicked', {
82
- id,
83
- display: isFlexibleUi ? CardDisplay.Flexible : appearance,
84
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
85
- isModifierKeyPressed
86
- });
87
- } else {
88
- analytics.ui.cardClickedEvent({
89
- id,
90
- display: isFlexibleUi ? CardDisplay.Flexible : appearance,
91
- status: state.status,
92
- definitionId,
93
- extensionKey,
94
- isModifierKeyPressed,
95
- destinationProduct: product,
96
- destinationSubproduct: subproduct
97
- });
98
- }
78
+ fireEvent('ui.smartLink.clicked', {
79
+ id,
80
+ display: isFlexibleUi ? CardDisplay.Flexible : appearance,
81
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
82
+ isModifierKeyPressed
83
+ });
99
84
  if (!onClick && !isFlexibleUi) {
100
85
  const clickUrl = getClickUrl(url, state.details);
101
86
  // Ctrl+left click on mac typically doesn't trigger onClick
@@ -115,7 +100,7 @@ function Component({
115
100
  }
116
101
  fireLinkClickedEvent(createAnalyticsEvent)(event);
117
102
  }
118
- }, [id, url, state.details, state.status, analytics.ui, appearance, definitionId, extensionKey, onClick, isFlexibleUi, product, subproduct, createAnalyticsEvent, fireEvent]);
103
+ }, [id, url, state.details, appearance, definitionId, onClick, isFlexibleUi, createAnalyticsEvent, fireEvent]);
119
104
  const handleAuthorize = useCallback(() => actions.authorize(appearance), [actions, appearance]);
120
105
  const handleRetry = useCallback(() => {
121
106
  actions.reload();
@@ -1,8 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useState } from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
5
- import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
6
4
  import useInvoke from '../../../../../../state/hooks/use-invoke';
7
5
  import { getInvokeFailureReason } from '../../../../../../state/hooks/use-invoke/utils';
8
6
  import useResolve from '../../../../../../state/hooks/use-resolve';
@@ -15,7 +13,6 @@ const ServerAction = ({
15
13
  ...props
16
14
  }) => {
17
15
  const [isLoading, setIsLoading] = useState(false);
18
- const analytics = useFlexibleUiAnalyticsContext();
19
16
  const invoke = useInvoke();
20
17
  const reload = useResolve();
21
18
  const {
@@ -27,16 +24,10 @@ const ServerAction = ({
27
24
  const smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
28
25
  try {
29
26
  setIsLoading(true);
30
- if (fg('platform_migrate-some-ui-events-smart-card')) {
31
- if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
32
- fireEvent('ui.button.clicked.smartLinkFollowButton', {});
33
- } else {
34
- fireEvent(`ui.button.clicked.${smartLinkActionType}`, {});
35
- }
27
+ if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
28
+ fireEvent('ui.button.clicked.smartLinkFollowButton', {});
36
29
  } else {
37
- analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkServerActionClickedEvent({
38
- smartLinkActionType
39
- });
30
+ fireEvent(`ui.button.clicked.${smartLinkActionType}`, {});
40
31
  }
41
32
  fireEvent('track.smartLinkQuickAction.started', {
42
33
  smartLinkActionType
@@ -62,7 +53,7 @@ const ServerAction = ({
62
53
  onErrorCallback === null || onErrorCallback === void 0 ? void 0 : onErrorCallback();
63
54
  }
64
55
  }
65
- }, [action, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, onErrorCallback, reload, fireEvent]);
56
+ }, [action, invoke, onClick, onErrorCallback, reload, fireEvent]);
66
57
  return /*#__PURE__*/React.createElement(Action, _extends({}, props, {
67
58
  isLoading: isLoading,
68
59
  onClick: handleClick
@@ -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 {
@@ -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
@@ -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.8",
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: {