@atlaskit/smart-card 23.7.3 → 23.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/constants.js +14 -2
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -1
  4. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +41 -13
  5. package/dist/cjs/utils/analytics/analytics.js +128 -96
  6. package/dist/cjs/utils/analytics/index.js +12 -0
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +1 -1
  9. package/dist/cjs/view/BlockCard/index.js +4 -2
  10. package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  11. package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -3
  12. package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +17 -4
  13. package/dist/cjs/view/CardWithUrl/component.js +3 -1
  14. package/dist/cjs/view/EmbedCard/index.js +6 -2
  15. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +21 -4
  16. package/dist/cjs/view/EmbedModal/components/analytics/index.js +4 -2
  17. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +14 -24
  18. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +61 -34
  19. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
  20. package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +26 -7
  21. package/dist/cjs/view/HoverCard/index.js +6 -3
  22. package/dist/cjs/view/HoverCard/utils.js +1 -4
  23. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +2 -1
  24. package/dist/cjs/view/InlineCard/index.js +2 -1
  25. package/dist/cjs/view/common/UnauthorisedViewContent.js +14 -3
  26. package/dist/es2019/constants.js +12 -1
  27. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -1
  28. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +33 -8
  29. package/dist/es2019/utils/analytics/analytics.js +28 -4
  30. package/dist/es2019/utils/analytics/index.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -1
  33. package/dist/es2019/view/BlockCard/index.js +4 -2
  34. package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  35. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
  36. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -3
  37. package/dist/es2019/view/CardWithUrl/component.js +2 -1
  38. package/dist/es2019/view/EmbedCard/index.js +6 -2
  39. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +14 -3
  40. package/dist/es2019/view/EmbedModal/components/analytics/index.js +3 -2
  41. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +14 -20
  42. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +52 -30
  43. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -3
  44. package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +23 -7
  45. package/dist/es2019/view/HoverCard/index.js +6 -3
  46. package/dist/es2019/view/HoverCard/utils.js +0 -1
  47. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +2 -1
  48. package/dist/es2019/view/InlineCard/index.js +2 -1
  49. package/dist/es2019/view/common/UnauthorisedViewContent.js +18 -11
  50. package/dist/esm/constants.js +12 -1
  51. package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
  52. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +42 -14
  53. package/dist/esm/utils/analytics/analytics.js +118 -92
  54. package/dist/esm/utils/analytics/index.js +1 -1
  55. package/dist/esm/version.json +1 -1
  56. package/dist/esm/view/BlockCard/components/flexible/footer/index.js +1 -1
  57. package/dist/esm/view/BlockCard/index.js +4 -2
  58. package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  59. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
  60. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +18 -5
  61. package/dist/esm/view/CardWithUrl/component.js +2 -1
  62. package/dist/esm/view/EmbedCard/index.js +6 -2
  63. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +15 -4
  64. package/dist/esm/view/EmbedModal/components/analytics/index.js +3 -2
  65. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +14 -22
  66. package/dist/esm/view/HoverCard/components/HoverCardContent.js +54 -30
  67. package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -3
  68. package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +27 -9
  69. package/dist/esm/view/HoverCard/index.js +6 -3
  70. package/dist/esm/view/HoverCard/utils.js +0 -1
  71. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +2 -1
  72. package/dist/esm/view/InlineCard/index.js +2 -1
  73. package/dist/esm/view/common/UnauthorisedViewContent.js +8 -3
  74. package/dist/types/constants.d.ts +8 -0
  75. package/dist/types/state/actions/index.d.ts +1 -2
  76. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +17 -4
  77. package/dist/types/state/flexible-ui-context/index.d.ts +8 -4
  78. package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
  79. package/dist/types/utils/analytics/analytics.d.ts +4 -2
  80. package/dist/types/utils/analytics/index.d.ts +1 -1
  81. package/dist/types/utils/analytics/types.d.ts +2 -0
  82. package/dist/types/utils/mocks.d.ts +4 -2
  83. package/dist/types/utils/types.d.ts +1 -1
  84. package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +1 -1
  85. package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
  86. package/dist/types/view/BlockCard/views/flexible/types.d.ts +17 -13
  87. package/dist/types/view/Card/types.d.ts +1 -1
  88. package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +3 -0
  89. package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +0 -1
  90. package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -0
  91. package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +15 -4
  92. package/dist/types/view/HoverCard/types.d.ts +3 -3
  93. package/dist/types/view/HoverCard/utils.d.ts +0 -1
  94. package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
  95. package/dist/types/view/common/UnauthorisedViewContent.d.ts +7 -1
  96. package/package.json +5 -5
  97. package/report.api.md +15 -1
  98. package/tmp/api-report-tmp.d.ts +8 -4
@@ -1,12 +1,12 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
2
  import { useFeatureFlag } from '@atlaskit/link-provider';
3
3
  import { extractType } from '@atlaskit/linking-common/extractors';
4
- import { ActionName, SmartLinkSize } from '../../../../../constants';
4
+ import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
5
5
  import { FooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
6
6
  import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
7
7
  import FlexibleCard from '../../../../FlexibleCard';
8
8
  import { useSmartCardActions } from '../../../../../state/actions';
9
- import { getSimulatedMetadata, toActionableMetadata, SMART_CARD_ANALYTICS_DISPLAY } from '../../../utils';
9
+ import { getSimulatedMetadata, toActionableMetadata } from '../../../utils';
10
10
  import SnippetOrPreview from '../../SnippetOrPreview';
11
11
  import { extractMetadata } from '../../../../../extractors/hover/extractMetadata';
12
12
  export const toFooterActions = (cardActions, onActionClick) => cardActions.map(action => ({
@@ -44,7 +44,7 @@ const HoverCardResolvedView = ({
44
44
  // Since this hover view is only rendered on resolved status,
45
45
  // there is no need to check for statuses.
46
46
  analytics.ui.renderSuccessEvent({
47
- display: SMART_CARD_ANALYTICS_DISPLAY,
47
+ display: CardDisplay.HoverCardPreview,
48
48
  status: cardState.status
49
49
  });
50
50
  }, [analytics.ui, cardState.status]);
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useMemo } from 'react';
2
+ import React, { useCallback, useMemo } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
4
  import FlexibleCard from '../../../../FlexibleCard';
5
5
  import { messages } from '../../../../../messages';
@@ -9,12 +9,16 @@ import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled'
9
9
  import UnauthorisedViewContent from '../../../../common/UnauthorisedViewContent';
10
10
  import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group';
11
11
  import { LinkIcon } from '../../../../FlexibleCard/components/elements';
12
- import { ActionName } from '../../../../../constants';
12
+ import { ActionName, CardDisplay } from '../../../../../constants';
13
+ import { useSmartCardActions } from '../../../../../state/actions';
13
14
 
14
15
  const HoverCardUnauthorisedView = ({
16
+ analytics,
17
+ extensionKey,
18
+ id = '',
15
19
  flexibleCardProps,
16
20
  testId = 'hover-card-unauthorised-view',
17
- onAuthorize
21
+ url
18
22
  }) => {
19
23
  var _cardState$details, _extractProvider;
20
24
 
@@ -23,15 +27,26 @@ const HoverCardUnauthorisedView = ({
23
27
  } = flexibleCardProps;
24
28
  const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
25
29
  const providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
26
- const actions = useMemo(() => onAuthorize ? [{
30
+ const {
31
+ authorize
32
+ } = useSmartCardActions(id, url, analytics);
33
+ const handleAuthorize = useCallback(() => {
34
+ if (authorize) {
35
+ analytics.track.appAccountAuthStarted({
36
+ extensionKey
37
+ });
38
+ authorize(CardDisplay.HoverCardPreview);
39
+ }
40
+ }, [authorize, extensionKey, analytics.track]);
41
+ const actions = useMemo(() => [{
27
42
  name: ActionName.CustomAction,
28
43
  content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
29
44
  values: {
30
45
  context: providerName
31
46
  }
32
47
  })),
33
- onClick: onAuthorize
34
- }] : [], [onAuthorize, providerName]);
48
+ onClick: handleAuthorize
49
+ }], [handleAuthorize, providerName]);
35
50
  return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
36
51
  testId: testId
37
52
  }), /*#__PURE__*/React.createElement(CustomBlock, {
@@ -45,7 +60,8 @@ const HoverCardUnauthorisedView = ({
45
60
  overrideCss: mainTextStyles,
46
61
  testId: `${testId}-content`
47
62
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
48
- providerName: providerName
63
+ providerName: providerName,
64
+ analytics: analytics
49
65
  }))), /*#__PURE__*/React.createElement(CustomBlock, {
50
66
  overrideCss: connectButtonStyles,
51
67
  testId: `${testId}-button`
@@ -8,7 +8,7 @@ import { ErrorBoundary } from 'react-error-boundary';
8
8
  import { useSmartLinkAnalytics } from '../../state/analytics';
9
9
  import { fireSmartLinkEvent } from '../../utils/analytics';
10
10
  import { HoverCardComponent } from './components/HoverCardComponent';
11
- import { SMART_CARD_ANALYTICS_DISPLAY } from './utils';
11
+ import { CardDisplay } from '../../constants';
12
12
 
13
13
  const HoverCardWithErrorBoundary = props => {
14
14
  const {
@@ -23,7 +23,7 @@ const HoverCardWithErrorBoundary = props => {
23
23
  const analytics = useSmartLinkAnalytics(url, analyticsHandler, id);
24
24
  const onError = useCallback((error, info) => {
25
25
  analytics.ui.renderFailedEvent({
26
- display: SMART_CARD_ANALYTICS_DISPLAY,
26
+ display: CardDisplay.HoverCardPreview,
27
27
  id,
28
28
  error,
29
29
  errorInfo: info
@@ -39,5 +39,8 @@ const HoverCardWithErrorBoundary = props => {
39
39
  };
40
40
 
41
41
  export const HoverCard = withAnalyticsContext({
42
- source: 'smartLinkPreviewHoverCard'
42
+ source: 'smartLinkPreviewHoverCard',
43
+ attributes: {
44
+ display: CardDisplay.HoverCardPreview
45
+ }
43
46
  })(withAnalyticsEvents()(HoverCardWithErrorBoundary));
@@ -1,5 +1,4 @@
1
1
  import { ElementName } from '../../constants';
2
- export const SMART_CARD_ANALYTICS_DISPLAY = 'flexible';
3
2
  export const getSimulatedMetadata = (extensionKey = '', types = []) => {
4
3
  switch (extensionKey) {
5
4
  case 'bitbucket-object-provider':
@@ -73,7 +73,8 @@ export class InlineCardUnauthorizedView extends React.Component {
73
73
  if (showAuthTooltip) {
74
74
  return /*#__PURE__*/React.createElement(HoverCard, {
75
75
  url: url,
76
- onAuthorize: this.props.onAuthorise
76
+ onAuthorize: this.props.onAuthorise,
77
+ id: this.props.id
77
78
  }, inlineCardUnauthenticatedView);
78
79
  }
79
80
 
@@ -82,7 +82,8 @@ export const InlineCard = ({
82
82
  onClick: handleFrameClick,
83
83
  onAuthorise: handleAuthorize,
84
84
  testId: testIdWithStatus,
85
- showAuthTooltip: showAuthTooltip
85
+ showAuthTooltip: showAuthTooltip,
86
+ id: id
86
87
  });
87
88
 
88
89
  case 'forbidden':
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+ import React, { useCallback } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
4
  import { messages } from '../../messages';
5
5
  import { CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
@@ -10,15 +10,22 @@ import { CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
10
10
  */
11
11
  const UnauthorisedViewContent = ({
12
12
  providerName,
13
- testId = 'unauthorised-view-content'
14
- }) => /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
15
- values: {
16
- context: providerName
17
- }
18
- })) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/React.createElement("a", {
19
- href: CONTENT_URL_SECURITY_AND_PERMISSIONS,
20
- target: "_blank",
21
- "data-testid": `${testId}-learn-more`
22
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.learn_more_about_smart_links)));
13
+ testId = 'unauthorised-view-content',
14
+ analytics
15
+ }) => {
16
+ const handleLearnMoreClick = useCallback(() => {
17
+ analytics === null || analytics === void 0 ? void 0 : analytics.ui.learnMoreClickedEvent();
18
+ }, [analytics === null || analytics === void 0 ? void 0 : analytics.ui]);
19
+ return /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
20
+ values: {
21
+ context: providerName
22
+ }
23
+ })) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/React.createElement("a", {
24
+ href: CONTENT_URL_SECURITY_AND_PERMISSIONS,
25
+ target: "_blank",
26
+ "data-testid": `${testId}-learn-more`,
27
+ onClick: handleLearnMoreClick
28
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.learn_more_about_smart_links)));
29
+ };
23
30
 
24
31
  export default UnauthorisedViewContent;
@@ -230,4 +230,15 @@ export var MediaPlacement;
230
230
  (function (MediaPlacement) {
231
231
  MediaPlacement["Left"] = "left";
232
232
  MediaPlacement["Right"] = "right";
233
- })(MediaPlacement || (MediaPlacement = {}));
233
+ })(MediaPlacement || (MediaPlacement = {}));
234
+
235
+ export var CardDisplay;
236
+
237
+ (function (CardDisplay) {
238
+ CardDisplay["Inline"] = "inline";
239
+ CardDisplay["Block"] = "block";
240
+ CardDisplay["Embed"] = "embed";
241
+ CardDisplay["EmbedPreview"] = "embedPreview";
242
+ CardDisplay["Flexible"] = "flexible";
243
+ CardDisplay["HoverCardPreview"] = "hoverCardPreview";
244
+ })(CardDisplay || (CardDisplay = {}));
@@ -7,6 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { extractDownloadUrl } from '../detail';
8
8
  import { extractPreview, extractProvider } from '@atlaskit/linking-common/extractors';
9
9
  import { PreviewAction } from '../../../view/BlockCard';
10
+ import { CardDisplay } from '../../../constants';
10
11
 
11
12
  var getMetadataFromJsonLd = function getMetadataFromJsonLd(jsonLd, platform) {
12
13
  var download = extractDownloadUrl(jsonLd);
@@ -40,7 +41,7 @@ var getInvokeOpts = function getInvokeOpts(key, action, source) {
40
41
  // the actions on the preview state are invoked from the
41
42
  // preview card. Hence, we have a `source` for distinguishing
42
43
  // between the two.
43
- source: source || 'preview',
44
+ source: source || CardDisplay.EmbedPreview,
44
45
  action: {
45
46
  type: action,
46
47
  promise: function promise() {
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
 
8
8
  import { useMemo } from 'react';
9
9
  import { getUrl } from '@atlaskit/linking-common';
10
- import { connectFailedEvent as _connectFailedEvent, connectSucceededEvent as _connectSucceededEvent, context, instrumentEvent, invokeFailedEvent as _invokeFailedEvent, invokeSucceededEvent as _invokeSucceededEvent, screenAuthPopupEvent, trackAppAccountConnected, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
10
+ import { connectFailedEvent as _connectFailedEvent, connectSucceededEvent as _connectSucceededEvent, context, instrumentEvent, invokeFailedEvent as _invokeFailedEvent, invokeSucceededEvent as _invokeSucceededEvent, screenAuthPopupEvent, trackAppAccountAuthStarted, trackAppAccountConnected, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiLearnMoreLinkClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
11
11
  import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
12
12
  import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getSubproduct } from '../helpers';
13
13
  import { useSmartLinkContext } from '@atlaskit/link-provider';
@@ -373,7 +373,8 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
373
373
  resourceType = _ref9.resourceType,
374
374
  destinationProduct = _ref9.destinationProduct,
375
375
  destinationSubproduct = _ref9.destinationSubproduct,
376
- location = _ref9.location;
376
+ location = _ref9.location,
377
+ status = _ref9.status;
377
378
  return dispatchAnalytics(applyCommonAttributes(uiHoverCardViewedEvent({
378
379
  id: id,
379
380
  previewDisplay: previewDisplay,
@@ -383,7 +384,8 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
383
384
  destinationProduct: destinationProduct,
384
385
  destinationSubproduct: destinationSubproduct,
385
386
  location: location,
386
- previewInvokeMethod: previewInvokeMethod
387
+ previewInvokeMethod: previewInvokeMethod,
388
+ status: status
387
389
  }), commonAttributes));
388
390
  },
389
391
 
@@ -392,7 +394,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
392
394
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
393
395
  * @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
394
396
  * @param definitionId The definitionId of the Smart Link resolver invoked.
395
- * @param extensionKey The extensionKey of the Smart Link resovler invoked.
397
+ * @param extensionKey The extensionKey of the Smart Link resolver invoked.
396
398
  * @param previewInvokeMethod How the preview was triggered.
397
399
  * @returns
398
400
  */
@@ -406,7 +408,8 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
406
408
  resourceType = _ref10.resourceType,
407
409
  destinationProduct = _ref10.destinationProduct,
408
410
  destinationSubproduct = _ref10.destinationSubproduct,
409
- location = _ref10.location;
411
+ location = _ref10.location,
412
+ status = _ref10.status;
410
413
  return dispatchAnalytics(applyCommonAttributes(uiHoverCardDismissedEvent({
411
414
  previewDisplay: previewDisplay,
412
415
  id: id,
@@ -417,8 +420,18 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
417
420
  destinationProduct: destinationProduct,
418
421
  destinationSubproduct: destinationSubproduct,
419
422
  location: location,
420
- previewInvokeMethod: previewInvokeMethod
423
+ previewInvokeMethod: previewInvokeMethod,
424
+ status: status
421
425
  }), commonAttributes));
426
+ },
427
+
428
+ /**
429
+ * Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
430
+ * @param extensionKey The extensionKey of the Smart Link resovler invoked.
431
+ * @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
432
+ */
433
+ learnMoreClickedEvent: function learnMoreClickedEvent() {
434
+ return dispatchAnalytics(applyCommonAttributes(uiLearnMoreLinkClickedEvent(), commonAttributes));
422
435
  }
423
436
  };
424
437
  }, [defaultId, commonAttributes, dispatchAnalytics]);
@@ -596,7 +609,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
596
609
  var track = useMemo(function () {
597
610
  return {
598
611
  /**
599
- * This fires an event which represents a user starting the Smart Link connect account process.
612
+ * This fires an event which represents a user connecting their account to view a Smart Link.
600
613
  * @param definitionId The definitionId of the Smart Link resolver invoked.
601
614
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
602
615
  * @returns
@@ -616,6 +629,21 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
616
629
  destinationSubproduct: destinationSubproduct,
617
630
  location: location
618
631
  })), commonAttributes));
632
+ },
633
+
634
+ /**
635
+ * This fires an event which represents a user starting the Smart Link connect account process.
636
+ * @param location a location where the Smart Link auth action was initiated.
637
+ * @param extensionKey The extensionKey of the Smart Link resolver invoked.
638
+ * @returns
639
+ */
640
+ appAccountAuthStarted: function appAccountAuthStarted(_ref17) {
641
+ var extensionKey = _ref17.extensionKey,
642
+ location = _ref17.location;
643
+ return dispatchAnalytics(applyCommonAttributes(trackAppAccountAuthStarted(_objectSpread(_objectSpread({}, commonAttributes), {}, {
644
+ extensionKey: extensionKey,
645
+ location: location
646
+ })), commonAttributes));
619
647
  }
620
648
  };
621
649
  }, [commonAttributes, dispatchAnalytics]);
@@ -629,13 +657,13 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
629
657
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
630
658
  * @returns
631
659
  */
632
- authPopupEvent: function authPopupEvent(_ref17) {
633
- var extensionKey = _ref17.extensionKey,
634
- definitionId = _ref17.definitionId,
635
- resourceType = _ref17.resourceType,
636
- destinationProduct = _ref17.destinationProduct,
637
- destinationSubproduct = _ref17.destinationSubproduct,
638
- location = _ref17.location;
660
+ authPopupEvent: function authPopupEvent(_ref18) {
661
+ var extensionKey = _ref18.extensionKey,
662
+ definitionId = _ref18.definitionId,
663
+ resourceType = _ref18.resourceType,
664
+ destinationProduct = _ref18.destinationProduct,
665
+ destinationSubproduct = _ref18.destinationSubproduct,
666
+ location = _ref18.location;
639
667
  return dispatchAnalytics(applyCommonAttributes(screenAuthPopupEvent(_objectSpread(_objectSpread({}, commonAttributes), {}, {
640
668
  extensionKey: extensionKey,
641
669
  definitionId: definitionId,