@atlaskit/smart-card 21.3.0 → 22.1.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 (103) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/cjs/extractors/block/index.js +6 -7
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +16 -19
  4. package/dist/cjs/state/actions/index.js +54 -10
  5. package/dist/cjs/state/analytics/types.js +5 -0
  6. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +429 -109
  7. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +5 -3
  8. package/dist/cjs/utils/analytics/analytics.js +241 -74
  9. package/dist/cjs/utils/analytics/index.js +32 -5
  10. package/dist/cjs/utils/mocks.js +28 -2
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +2 -2
  13. package/dist/cjs/view/BlockCard/index.js +6 -5
  14. package/dist/cjs/view/CardWithUrl/component.js +27 -5
  15. package/dist/cjs/view/CardWithUrl/loader.js +6 -1
  16. package/dist/cjs/view/EmbedCard/index.js +3 -2
  17. package/dist/cjs/view/EmbedModal/components/analytics/index.js +100 -0
  18. package/dist/cjs/view/EmbedModal/components/analytics/types.js +5 -0
  19. package/dist/cjs/view/EmbedModal/components/size-experiment/index.js +5 -10
  20. package/dist/cjs/view/EmbedModal/index.js +54 -15
  21. package/dist/cjs/view/EmbedModal/types.js +9 -1
  22. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +11 -3
  23. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +15 -4
  24. package/dist/cjs/view/HoverCard/index.js +6 -1
  25. package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +2 -2
  26. package/dist/cjs/view/common/Modal.js +29 -4
  27. package/dist/cjs/view/common/ModalHeader.js +3 -2
  28. package/dist/es2019/extractors/block/index.js +6 -7
  29. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +16 -10
  30. package/dist/es2019/state/actions/index.js +54 -10
  31. package/dist/es2019/state/analytics/types.js +1 -0
  32. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +424 -41
  33. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +5 -3
  34. package/dist/es2019/utils/analytics/analytics.js +254 -79
  35. package/dist/es2019/utils/analytics/index.js +32 -4
  36. package/dist/es2019/utils/mocks.js +26 -1
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/es2019/view/BlockCard/actions/PreviewAction.js +3 -3
  39. package/dist/es2019/view/BlockCard/index.js +5 -4
  40. package/dist/es2019/view/CardWithUrl/component.js +27 -5
  41. package/dist/es2019/view/CardWithUrl/loader.js +6 -1
  42. package/dist/es2019/view/EmbedCard/index.js +3 -2
  43. package/dist/es2019/view/EmbedModal/components/analytics/index.js +80 -0
  44. package/dist/es2019/view/EmbedModal/components/analytics/types.js +1 -0
  45. package/dist/es2019/view/EmbedModal/components/size-experiment/index.js +5 -9
  46. package/dist/es2019/view/EmbedModal/index.js +46 -13
  47. package/dist/es2019/view/EmbedModal/types.js +6 -1
  48. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +11 -3
  49. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +15 -4
  50. package/dist/es2019/view/HoverCard/index.js +6 -1
  51. package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +0 -2
  52. package/dist/es2019/view/common/Modal.js +27 -6
  53. package/dist/es2019/view/common/ModalHeader.js +3 -2
  54. package/dist/esm/extractors/block/index.js +6 -7
  55. package/dist/esm/extractors/common/actions/extractPreviewAction.js +17 -19
  56. package/dist/esm/state/actions/index.js +54 -10
  57. package/dist/esm/state/analytics/types.js +1 -0
  58. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +428 -111
  59. package/dist/esm/state/hooks-external/useSmartLinkActions.js +5 -3
  60. package/dist/esm/utils/analytics/analytics.js +241 -74
  61. package/dist/esm/utils/analytics/index.js +31 -4
  62. package/dist/esm/utils/mocks.js +25 -0
  63. package/dist/esm/version.json +1 -1
  64. package/dist/esm/view/BlockCard/actions/PreviewAction.js +3 -3
  65. package/dist/esm/view/BlockCard/index.js +5 -4
  66. package/dist/esm/view/CardWithUrl/component.js +27 -5
  67. package/dist/esm/view/CardWithUrl/loader.js +6 -1
  68. package/dist/esm/view/EmbedCard/index.js +3 -2
  69. package/dist/esm/view/EmbedModal/components/analytics/index.js +82 -0
  70. package/dist/esm/view/EmbedModal/components/analytics/types.js +1 -0
  71. package/dist/esm/view/EmbedModal/components/size-experiment/index.js +5 -10
  72. package/dist/esm/view/EmbedModal/index.js +52 -15
  73. package/dist/esm/view/EmbedModal/types.js +6 -1
  74. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +11 -3
  75. package/dist/esm/view/HoverCard/components/HoverCardContent.js +15 -4
  76. package/dist/esm/view/HoverCard/index.js +6 -1
  77. package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +2 -2
  78. package/dist/esm/view/common/Modal.js +28 -6
  79. package/dist/esm/view/common/ModalHeader.js +3 -2
  80. package/dist/types/extractors/block/types.d.ts +4 -2
  81. package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +7 -5
  82. package/dist/types/state/analytics/types.d.ts +9 -0
  83. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +41 -24
  84. package/dist/types/state/hooks/useSmartLink.d.ts +26 -18
  85. package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +6 -2
  86. package/dist/types/utils/analytics/analytics.d.ts +19 -21
  87. package/dist/types/utils/analytics/index.d.ts +2 -2
  88. package/dist/types/utils/analytics/types.d.ts +91 -0
  89. package/dist/types/utils/mocks.d.ts +48 -0
  90. package/dist/types/utils/types.d.ts +3 -1
  91. package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +4 -0
  92. package/dist/types/view/BlockCard/index.d.ts +2 -2
  93. package/dist/types/view/BlockCard/types.d.ts +4 -4
  94. package/dist/types/view/Card/index.d.ts +1 -1
  95. package/dist/types/view/EmbedCard/types.d.ts +2 -2
  96. package/dist/types/view/EmbedModal/components/analytics/index.d.ts +5 -0
  97. package/dist/types/view/EmbedModal/components/analytics/types.d.ts +6 -0
  98. package/dist/types/view/EmbedModal/components/size-experiment/index.d.ts +4 -3
  99. package/dist/types/view/EmbedModal/index.d.ts +3 -1
  100. package/dist/types/view/EmbedModal/types.d.ts +14 -4
  101. package/dist/types/view/common/Modal.d.ts +6 -8
  102. package/package.json +17 -17
  103. package/report.api.md +302 -107
@@ -1,10 +1,5 @@
1
- import { ErrorInfo } from 'react';
2
- import { CardType, APIError } from '@atlaskit/linking-common';
3
- import { AnalyticsHandler } from '../../utils/types';
4
- import { CardInnerAppearance } from '../../view/Card/types';
5
- import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
6
- import { InvokeType } from '../../model/invoke-opts';
7
- import { DestinationProduct, DestinationSubproduct } from '../../utils/analytics/types';
1
+ import { AnalyticsHandler, AnalyticsName, AnalyticsPayload } from '../../utils/types';
2
+ import { ConnectFailedEventProps, ConnectSucceededEventProps, InstrumentEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps } from '../../utils/analytics/types';
8
3
  /**
9
4
  * This hook provides usage of Smart Link analytics outside of the Card component.
10
5
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
@@ -24,7 +19,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
24
19
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
25
20
  * @returns
26
21
  */
27
- authEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
22
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthEventProps) => void;
28
23
  /**
29
24
  * This fires an event that represents when a user clicks on the authentication
30
25
  * call to action with a forbidden authenticated account. (i.e. Try another account).
@@ -33,7 +28,15 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
33
28
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
34
29
  * @returns
35
30
  */
36
- authAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
31
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthAlternateAccountEventProps) => void;
32
+ /**
33
+ * This fires an event that represents when a user
34
+ * click a button.
35
+ * @param data A partial analytics event payload
36
+ */
37
+ buttonClickedEvent: (data: Partial<AnalyticsPayload> & {
38
+ actionSubjectId: Required<string>;
39
+ }) => void;
37
40
  /**
38
41
  * This fires an event that represents when a user clicks on a Smart Link.
39
42
  * @param id The unique ID for this Smart Link.
@@ -46,7 +49,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
46
49
  * @param destinationProduct The product the Smart Link is linked to.
47
50
  * @returns
48
51
  */
49
- cardClickedEvent: (id: string | undefined, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: DestinationProduct | string | undefined, destinationSubproduct?: DestinationSubproduct | string | undefined, actionSubjectId?: string | undefined) => void;
52
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => void;
50
53
  /**
51
54
  * This fires an event that represents when a user clicks on a Smart Link action.
52
55
  * Note: This also starts the UFO smart-link-action-invocation experience.
@@ -57,7 +60,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
57
60
  * @param invokeType Whether the action invoked made a call to a server.
58
61
  * @returns
59
62
  */
60
- actionClickedEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: CardInnerAppearance, invokeType: InvokeType) => void;
63
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
61
64
  /**
62
65
  * This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
63
66
  * https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
@@ -66,7 +69,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
66
69
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
67
70
  * @param previewInvokeMethod How the preview was triggered.
68
71
  */
69
- hoverCardOpenLinkClickedEvent: (previewDisplay: PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => void;
72
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => void;
70
73
  /**
71
74
  * This fires an event that represents when a user closed the authentication window without authenticating after opening it.
72
75
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -74,7 +77,14 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
74
77
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
75
78
  * @returns
76
79
  */
77
- closedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
80
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => void;
81
+ /**
82
+ * This fires an event that represents when a user close a modal.
83
+ * @param data A partial analytics event payload
84
+ */
85
+ modalClosedEvent: (data: Partial<AnalyticsPayload> & {
86
+ actionSubjectId: Required<string>;
87
+ }) => void;
78
88
  /**
79
89
  * This fires an event that represents when a Smart Link was rendered successfully.
80
90
  * Note: this fires even if the Smart Link request errored out.
@@ -83,7 +93,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
83
93
  * @param definitionId The definitionId of the Smart Link resolver invoked.
84
94
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
85
95
  */
86
- renderSuccessEvent: (display: CardInnerAppearance, status: CardType, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
96
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderSuccessEventProps) => void;
87
97
  /**
88
98
  * This fires an event that represents when a Smart Link renders unsuccessfuly.
89
99
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -91,7 +101,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
91
101
  * @param error: An error representing why the Smart Link render failed.
92
102
  * @param errorInfo: Additional details about the error including the stack trace.
93
103
  */
94
- renderFailedEvent: (display: CardInnerAppearance, id: string | undefined, error: Error, errorInfo: ErrorInfo) => void;
104
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
95
105
  /**
96
106
  * This fires an event that represents a hover preview being opened.
97
107
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -100,7 +110,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
100
110
  * @param previewInvokeMethod How the preview was triggered.
101
111
  * @returns
102
112
  */
103
- hoverCardViewedEvent: (previewDisplay: PreviewDisplay, previewInvokeMethod?: PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
113
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiHoverCardViewedEventProps) => void;
104
114
  /**
105
115
  * This fires an event that represents a hover preview being dismissed.
106
116
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -110,7 +120,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
110
120
  * @param previewInvokeMethod How the preview was triggered.
111
121
  * @returns
112
122
  */
113
- hoverCardDismissedEvent: (previewDisplay: PreviewDisplay, hoverTime: number, previewInvokeMethod?: PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
123
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiHoverCardDismissedEventProps) => void;
114
124
  };
115
125
  operational: {
116
126
  /**
@@ -120,7 +130,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
120
130
  * @param actionType The type of action invoked, e.g. PreviewAction
121
131
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
122
132
  */
123
- invokeSucceededEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: CardInnerAppearance) => void;
133
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
124
134
  /**
125
135
  * This fires an event that represents an action being unsuccessfully invoked.
126
136
  * @param id The unique ID for this Smart Link.
@@ -129,14 +139,14 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
129
139
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
130
140
  * @param reason The reason the invocation failed.
131
141
  */
132
- invokeFailedEvent: (id: string | undefined, providerKey: string | undefined, actionType: string, display: CardInnerAppearance, reason: string) => void;
142
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
133
143
  /**
134
144
  * This fires an event that represents an account successfully being connected via a Smart Link.
135
145
  * @param id The unique ID for this Smart Link.
136
146
  * @param definitionId The definitionId of the Smart Link resolver invoked.
137
147
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
138
148
  */
139
- connectSucceededEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
149
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => void;
140
150
  /**
141
151
  * This fires an event that represents an account unsuccessfully being connected.
142
152
  * @param id The unique ID for this Smart Link.
@@ -144,7 +154,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
144
154
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
145
155
  * @param reason The reason why the Smart Link connect account failed.
146
156
  */
147
- connectFailedEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => void;
157
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectFailedEventProps) => void;
148
158
  /**
149
159
  * This fires an event which represents a Smart Link request succeeding or failing based on the status.
150
160
  * @param id The unique ID for this Smart Link.
@@ -154,7 +164,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
154
164
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
155
165
  * @param error An error representing why the Smart Link request failed.
156
166
  */
157
- instrument: (id: string | undefined, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => void;
167
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => void;
158
168
  };
159
169
  track: {
160
170
  /**
@@ -163,7 +173,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
163
173
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
164
174
  * @returns
165
175
  */
166
- appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
176
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => void;
167
177
  };
168
178
  screen: {
169
179
  /**
@@ -172,7 +182,14 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
172
182
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
173
183
  * @returns
174
184
  */
175
- authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
185
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => void;
186
+ /**
187
+ * This fires an event that represents when a user view a modal.
188
+ * @param data A partial analytics event payload
189
+ */
190
+ modalViewedEvent: (data: Partial<AnalyticsPayload> & {
191
+ name: Extract<AnalyticsName, 'embedPreviewModal'>;
192
+ }) => void;
176
193
  };
177
194
  };
178
195
  export declare type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AnalyticsHandler } from '../../utils/types';
3
2
  export declare function useSmartLink(id: string, url: string, dispatchAnalytics: AnalyticsHandler): {
4
3
  state: import("@atlaskit/linking-common").CardState;
@@ -12,29 +11,38 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
12
11
  config: (import("@atlaskit/link-provider").CardProviderCacheOpts & import("@atlaskit/link-provider").CardAuthFlowOpts) | undefined;
13
12
  analytics: {
14
13
  ui: {
15
- authEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
16
- authAlternateAccountEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
17
- cardClickedEvent: (id: string | undefined, display: import("../../view/Card/types").CardInnerAppearance, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined, actionSubjectId?: string | undefined) => void;
18
- actionClickedEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance, invokeType: import("../../model/invoke-opts").InvokeType) => void;
19
- hoverCardOpenLinkClickedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined) => void;
20
- closedAuthEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
21
- renderSuccessEvent: (display: import("../../view/Card/types").CardInnerAppearance, status: import("@atlaskit/linking-common/types").CardType, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
22
- renderFailedEvent: (display: import("../../view/Card/types").CardInnerAppearance, id: string | undefined, error: Error, errorInfo: import("react").ErrorInfo) => void;
23
- hoverCardViewedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
24
- hoverCardDismissedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, hoverTime: number, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
14
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthEventProps) => void;
15
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthAlternateAccountEventProps) => void;
16
+ buttonClickedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
17
+ actionSubjectId: string;
18
+ }) => void;
19
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
20
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
21
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
22
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
23
+ modalClosedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
24
+ actionSubjectId: string;
25
+ }) => void;
26
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
27
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderFailedEventProps) => void;
28
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
29
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
25
30
  };
26
31
  operational: {
27
- invokeSucceededEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance) => void;
28
- invokeFailedEvent: (id: string | undefined, providerKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance, reason: string) => void;
29
- connectSucceededEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
30
- connectFailedEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => void;
31
- instrument: (id: string | undefined, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: import("@atlaskit/linking-common").APIError | undefined) => void;
32
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
33
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
34
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
35
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
36
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
32
37
  };
33
38
  track: {
34
- appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
39
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
35
40
  };
36
41
  screen: {
37
- authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
42
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
43
+ modalViewedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
44
+ name: "embedPreviewModal";
45
+ }) => void;
38
46
  };
39
47
  };
40
48
  renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { JsonLd } from 'json-ld-types';
3
- import type { AnalyticsHandler } from '../../utils/types';
3
+ import type { AnalyticsHandler, AnalyticsOrigin } from '../../utils/types';
4
4
  import type { CardInnerAppearance } from '../../view/Card/types';
5
5
  export interface LinkAction {
6
6
  /**
@@ -41,5 +41,9 @@ export interface UseSmartLinkActionsOpts {
41
41
  * @default 'web'
42
42
  */
43
43
  platform?: JsonLd.Primitives.Platforms;
44
+ /**
45
+ * Smart link origin that the action being invoked from.
46
+ */
47
+ origin?: AnalyticsOrigin;
44
48
  }
45
- export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, }: UseSmartLinkActionsOpts): LinkAction[];
49
+ export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, origin, }: UseSmartLinkActionsOpts): LinkAction[];
@@ -1,9 +1,7 @@
1
1
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { APIError, CardType } from '@atlaskit/linking-common';
3
2
  import { AnalyticsPayload } from '../types';
4
- import { ErrorInfo } from 'react';
5
3
  import { CardInnerAppearance } from '../../view/Card/types';
6
- import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
4
+ import { ConnectFailedEventProps, ConnectSucceededEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ResolvedEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps, UnresolvedEventProps } from './types';
7
5
  export declare const ANALYTICS_CHANNEL = "media";
8
6
  export declare const context: {
9
7
  componentName: string;
@@ -14,21 +12,21 @@ export declare class SmartLinkEvents {
14
12
  insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
15
13
  }
16
14
  export declare const fireSmartLinkEvent: (payload: AnalyticsPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined) => void;
17
- export declare const resolvedEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined) => AnalyticsPayload;
18
- export declare const unresolvedEvent: (id: string, status: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => AnalyticsPayload;
19
- export declare const invokeSucceededEvent: (id: string, actionType: string, display: CardInnerAppearance, extensionKey?: string | undefined) => AnalyticsPayload;
20
- export declare const invokeFailedEvent: (id: string, actionType: string, display: CardInnerAppearance, reason: string, extensionKey?: string | undefined) => AnalyticsPayload;
21
- export declare const connectSucceededEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
22
- export declare const connectFailedEvent: (definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => AnalyticsPayload;
23
- export declare const trackAppAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
24
- export declare const uiAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
25
- export declare const uiAuthAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
26
- export declare const uiCardClickedEvent: (id: string, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined, actionSubjectId?: string | undefined) => AnalyticsPayload;
27
- export declare const uiActionClickedEvent: (id: string, actionType: string, extensionKey?: string | undefined, display?: CardInnerAppearance | undefined) => AnalyticsPayload;
28
- export declare const uiClosedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
29
- export declare const screenAuthPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
30
- export declare const uiRenderSuccessEvent: (display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
31
- export declare const uiRenderFailedEvent: (display: CardInnerAppearance, error: Error, errorInfo: ErrorInfo) => AnalyticsPayload;
32
- export declare const uiHoverCardViewedEvent: (id: string, previewDisplay: PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => AnalyticsPayload;
33
- export declare const uiHoverCardDismissedEvent: (id: string, previewDisplay: PreviewDisplay, hoverTime: number, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => AnalyticsPayload;
34
- export declare const uiHoverCardOpenLinkClickedEvent: (id: string, previewDisplay: string, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => AnalyticsPayload;
15
+ export declare const resolvedEvent: (props: ResolvedEventProps) => AnalyticsPayload;
16
+ export declare const unresolvedEvent: ({ id, definitionId, extensionKey, resourceType, destinationSubproduct, destinationProduct, error, status, location, }: UnresolvedEventProps) => AnalyticsPayload;
17
+ export declare const invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => AnalyticsPayload;
18
+ export declare const invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => AnalyticsPayload;
19
+ export declare const connectSucceededEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => AnalyticsPayload;
20
+ export declare const connectFailedEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, reason, }: ConnectFailedEventProps) => AnalyticsPayload;
21
+ export declare const trackAppAccountConnected: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
22
+ export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
23
+ export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
24
+ export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
25
+ export declare const uiActionClickedEvent: ({ id, actionType, extensionKey, display, definitionId, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => AnalyticsPayload;
26
+ export declare const uiClosedAuthEvent: ({ display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => AnalyticsPayload;
27
+ export declare const screenAuthPopupEvent: ({ extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => AnalyticsPayload;
28
+ export declare const uiRenderSuccessEvent: ({ display, status, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderSuccessEventProps) => AnalyticsPayload;
29
+ export declare const uiRenderFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => AnalyticsPayload;
30
+ export declare const uiHoverCardViewedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardViewedEventProps) => AnalyticsPayload;
31
+ export declare const uiHoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardDismissedEventProps) => AnalyticsPayload;
32
+ export declare const uiHoverCardOpenLinkClickedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => AnalyticsPayload;
@@ -1,4 +1,4 @@
1
- import { APIError, CardType } from '@atlaskit/linking-common';
2
1
  import { AnalyticsPayload } from '../types';
2
+ import { InstrumentEventProps } from './types';
3
3
  export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, } from './analytics';
4
- export declare const instrumentEvent: (id: string, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => AnalyticsPayload | undefined;
4
+ export declare const instrumentEvent: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => AnalyticsPayload | undefined;
@@ -1,2 +1,93 @@
1
+ import { APIError, CardType } from '@atlaskit/linking-common';
2
+ import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
3
+ import { ErrorInfo } from 'react';
4
+ import { CardInnerAppearance } from '../../view/Card/types';
5
+ import { InvokeType } from '../../model/invoke-opts';
1
6
  export declare type DestinationProduct = 'jira' | 'confluence' | 'bitbucket' | 'trello';
2
7
  export declare type DestinationSubproduct = 'core' | 'software' | 'servicedesk';
8
+ export interface CommonEventProps {
9
+ id?: string;
10
+ definitionId?: string;
11
+ extensionKey?: string;
12
+ resourceType?: string;
13
+ destinationSubproduct?: DestinationSubproduct | string;
14
+ destinationProduct?: DestinationProduct | string;
15
+ location?: string;
16
+ }
17
+ export declare type ResolvedEventProps = CommonEventProps & {
18
+ id: string;
19
+ };
20
+ export declare type UnresolvedEventProps = CommonEventProps & {
21
+ id: string;
22
+ status: string;
23
+ error?: APIError;
24
+ };
25
+ export declare type InvokeSucceededEventProps = CommonEventProps & {
26
+ id: string;
27
+ actionType: string;
28
+ display: CardInnerAppearance;
29
+ };
30
+ export declare type InvokeFailedEventProps = CommonEventProps & {
31
+ id: string;
32
+ actionType: string;
33
+ display: CardInnerAppearance;
34
+ reason: string;
35
+ };
36
+ export declare type ConnectSucceededEventProps = CommonEventProps & {
37
+ id?: string;
38
+ };
39
+ export declare type ConnectFailedEventProps = CommonEventProps & {
40
+ id?: string;
41
+ reason?: string;
42
+ };
43
+ export declare type TrackAppAccountConnectedProps = CommonEventProps;
44
+ export declare type UiAuthEventProps = CommonEventProps & {
45
+ display: CardInnerAppearance;
46
+ };
47
+ export declare type UiAuthAlternateAccountEventProps = CommonEventProps & {
48
+ display: CardInnerAppearance;
49
+ };
50
+ export declare type UiCardClickedEventProps = CommonEventProps & {
51
+ id: string;
52
+ display: CardInnerAppearance;
53
+ status: CardType;
54
+ isModifierKeyPressed?: boolean;
55
+ actionSubjectId?: string;
56
+ };
57
+ export declare type UiActionClickedEventProps = CommonEventProps & {
58
+ id: string;
59
+ display: CardInnerAppearance;
60
+ actionType: string;
61
+ invokeType?: InvokeType;
62
+ };
63
+ export declare type ScreenAuthPopupEventProps = CommonEventProps;
64
+ export declare type UiClosedAuthEventProps = CommonEventProps & {
65
+ display: CardInnerAppearance;
66
+ };
67
+ export declare type UiRenderSuccessEventProps = CommonEventProps & {
68
+ display: CardInnerAppearance;
69
+ status: CardType;
70
+ };
71
+ export declare type UiRenderFailedEventProps = CommonEventProps & {
72
+ display: CardInnerAppearance;
73
+ error: Error;
74
+ errorInfo: ErrorInfo;
75
+ };
76
+ export declare type UiHoverCardViewedEventProps = CommonEventProps & {
77
+ previewDisplay: PreviewDisplay;
78
+ previewInvokeMethod?: PreviewInvokeMethod;
79
+ };
80
+ export declare type UiHoverCardDismissedEventProps = CommonEventProps & {
81
+ previewDisplay: PreviewDisplay;
82
+ hoverTime: number;
83
+ previewInvokeMethod?: PreviewInvokeMethod;
84
+ };
85
+ export declare type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
86
+ previewDisplay: PreviewDisplay;
87
+ previewInvokeMethod?: PreviewInvokeMethod;
88
+ };
89
+ export declare type InstrumentEventProps = CommonEventProps & {
90
+ error?: APIError;
91
+ status: CardType;
92
+ id: string;
93
+ };
@@ -20,7 +20,55 @@ export declare const mocks: {
20
20
  status: string;
21
21
  };
22
22
  };
23
+ analytics: {
24
+ status: string;
25
+ details: {
26
+ meta: {
27
+ definitionId: string;
28
+ key: string;
29
+ resourceType: string;
30
+ subproduct: string;
31
+ product: string;
32
+ };
33
+ };
34
+ };
23
35
  };
24
36
  export declare const fakeResponse: () => Promise<JsonLd.Response<JsonLd.Data.BaseData>>;
25
37
  export declare const fakeFactory: any;
26
38
  export declare const waitFor: (time?: number) => Promise<unknown>;
39
+ export declare const mockAnalytics: {
40
+ ui: {
41
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiAuthEventProps) => void;
42
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiAuthAlternateAccountEventProps) => void;
43
+ buttonClickedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
44
+ actionSubjectId: string;
45
+ }) => void;
46
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("./analytics/types").UiCardClickedEventProps) => void;
47
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
48
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("./analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
49
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiClosedAuthEventProps) => void;
50
+ modalClosedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
51
+ actionSubjectId: string;
52
+ }) => void;
53
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderSuccessEventProps) => void;
54
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderFailedEventProps) => void;
55
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiHoverCardViewedEventProps) => void;
56
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiHoverCardDismissedEventProps) => void;
57
+ };
58
+ operational: {
59
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
60
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
61
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectSucceededEventProps) => void;
62
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectFailedEventProps) => void;
63
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("./analytics/types").InstrumentEventProps) => void;
64
+ };
65
+ track: {
66
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
67
+ };
68
+ screen: {
69
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
70
+ modalViewedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
71
+ name: "embedPreviewModal";
72
+ }) => void;
73
+ };
74
+ };
@@ -1,7 +1,9 @@
1
1
  import { GasPayload } from '@atlaskit/analytics-gas-types';
2
2
  import { CardInnerAppearance } from '../view/Card/types';
3
3
  export declare type AnalyticsAction = 'resolved' | 'unresolved' | 'connectSucceeded' | 'connectFailed' | 'connected' | 'clicked' | 'closed' | 'renderFailed' | 'renderWithStatus' | 'renderSuccess' | 'inserted' | 'viewed' | 'dismissed' | 'created';
4
- export declare type AnalyticsActionSubject = 'smartLink' | 'smartLinkAction' | 'applicationAccount' | 'button' | 'consentModal' | 'hoverCard';
4
+ export declare type AnalyticsActionSubject = 'smartLink' | 'smartLinkAction' | 'applicationAccount' | 'button' | 'consentModal' | 'hoverCard' | 'modal' | 'embedPreviewModal';
5
+ export declare type AnalyticsName = 'embedPreviewModal';
6
+ export declare type AnalyticsOrigin = 'smartLinkCard' | 'smartLinkEmbed' | 'smartLinkInline' | 'smartLinkPreviewHoverCard';
5
7
  export declare type AnalyticsPayload = GasPayload & {
6
8
  action?: AnalyticsAction;
7
9
  actionSubject: AnalyticsActionSubject;
@@ -1,9 +1,11 @@
1
1
  import React, { ErrorInfo } from 'react';
2
2
  import { LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
3
+ import { AnalyticsFacade } from '../../../state/analytics';
3
4
  import { EmbedModalWithExperimentProps } from '../../EmbedModal/types';
4
5
  import { ActionProps } from '../components/Action';
5
6
  import { IconProps } from '../../common/Icon';
6
7
  import { MetadataProps } from '../../common/Metadata';
8
+ import { AnalyticsOrigin } from '../../../utils/types';
7
9
  export interface PreviewFunctionArg extends EmbedModalWithExperimentProps {
8
10
  popupMountPointId: string;
9
11
  }
@@ -23,6 +25,8 @@ declare type PreviewInfo = {
23
25
  onOpen?: () => void;
24
26
  onOpenFailed?: (error: Error, errorInfo: ErrorInfo) => void;
25
27
  featureFlags?: Partial<LinkingPlatformFeatureFlags>;
28
+ analytics: AnalyticsFacade;
29
+ origin?: AnalyticsOrigin;
26
30
  };
27
31
  declare const _default: ({ details, ...rest }: PreviewInfo) => ActionProps;
28
32
  export default _default;
@@ -1,14 +1,14 @@
1
1
  import { FC } from 'react';
2
2
  import { BlockCardProps } from './types';
3
- export { default as PreviewAction } from './actions/PreviewAction';
4
3
  import { AuthorizeAction } from './actions/AuthorizeAction';
5
4
  import { ForbiddenAction } from './actions/ForbiddenAction';
6
5
  import { ResolvedView as BlockCardResolvedView } from './views/ResolvedView';
7
- export type { ResolvedViewProps as BlockCardResolvedViewProps } from './views/ResolvedView';
8
6
  import { NotFoundView as BlockCardNotFoundView } from './views/NotFoundView';
9
7
  import { ResolvingView as BlockCardResolvingView } from './views/ResolvingView';
10
8
  import { UnauthorizedView as BlockCardUnauthorisedView } from './views/UnauthorizedView';
11
9
  import { ForbiddenView as BlockCardForbiddenView } from './views/ForbiddenView';
12
10
  import { ErroredView as BlockCardErroredView } from './views/ErroredView';
11
+ export { default as PreviewAction } from './actions/PreviewAction';
12
+ export type { ResolvedViewProps as BlockCardResolvedViewProps } from './views/ResolvedView';
13
13
  export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView, };
14
14
  export declare const BlockCard: FC<BlockCardProps>;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { CardProviderRenderers, CardAuthFlowOpts } from '@atlaskit/link-provider';
2
+ import { CardAuthFlowOpts, CardProviderRenderers } from '@atlaskit/link-provider';
3
3
  import { CardState } from '../../state/types';
4
4
  import { InvokeHandler } from '../../model/invoke-handler';
5
- import { AnalyticsHandler } from '../../utils/types';
6
- import { OnResolveCallback, CardPlatform } from '../Card/types';
5
+ import { CardPlatform, OnResolveCallback } from '../Card/types';
7
6
  import { OnErrorCallback } from '../types';
7
+ import { AnalyticsFacade } from '../../state/analytics';
8
8
  export declare type BlockCardProps = {
9
9
  id: string;
10
10
  url: string;
@@ -12,7 +12,6 @@ export declare type BlockCardProps = {
12
12
  authFlow?: CardAuthFlowOpts['authFlow'];
13
13
  handleAuthorize: (() => void) | undefined;
14
14
  handleErrorRetry: () => void;
15
- handleAnalytics: AnalyticsHandler;
16
15
  handleInvoke: InvokeHandler;
17
16
  handleFrameClick: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
18
17
  isSelected?: boolean;
@@ -22,4 +21,5 @@ export declare type BlockCardProps = {
22
21
  showActions?: boolean;
23
22
  renderers?: CardProviderRenderers;
24
23
  platform?: CardPlatform;
24
+ analytics: AnalyticsFacade;
25
25
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { CardAppearance, CardPlatform, CardProps } from './types';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
- export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "id" | "placeholder" | "onError" | "onClick" | "analyticsContext" | "key" | "url" | "ui" | "showHoverPreview" | "showActions" | "onResolve" | "platform" | "isFrameVisible" | "embedIframeRef" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
4
+ export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "id" | "placeholder" | "onError" | "onClick" | "analyticsContext" | "key" | "url" | "ui" | "showActions" | "showHoverPreview" | "onResolve" | "platform" | "isFrameVisible" | "embedIframeRef" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
5
5
  export type { CardAppearance, CardProps, CardPlatform };