@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
package/report.api.md CHANGED
@@ -115,12 +115,16 @@ export declare type AnalyticsActionSubject =
115
115
  | 'applicationAccount'
116
116
  | 'button'
117
117
  | 'consentModal'
118
- | 'hoverCard';
118
+ | 'hoverCard'
119
+ | 'modal'
120
+ | 'embedPreviewModal';
119
121
 
120
122
  declare type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
121
123
 
122
124
  export declare type AnalyticsHandler = (event: AnalyticsPayload) => void;
123
125
 
126
+ declare type AnalyticsName = 'embedPreviewModal';
127
+
124
128
  export declare type AnalyticsPayload = GasPayload & {
125
129
  action?: AnalyticsAction;
126
130
  actionSubject: AnalyticsActionSubject;
@@ -278,8 +282,8 @@ export declare const Card: React_2.ForwardRefExoticComponent<
278
282
  | 'key'
279
283
  | 'url'
280
284
  | 'ui'
281
- | 'showHoverPreview'
282
285
  | 'showActions'
286
+ | 'showHoverPreview'
283
287
  | 'onResolve'
284
288
  | 'platform'
285
289
  | 'isFrameVisible'
@@ -348,6 +352,25 @@ declare type CommentCount = {
348
352
  name: ElementName.CommentCount;
349
353
  };
350
354
 
355
+ declare interface CommonEventProps {
356
+ id?: string;
357
+ definitionId?: string;
358
+ extensionKey?: string;
359
+ resourceType?: string;
360
+ destinationSubproduct?: DestinationSubproduct | string;
361
+ destinationProduct?: DestinationProduct | string;
362
+ location?: string;
363
+ }
364
+
365
+ declare type ConnectFailedEventProps = CommonEventProps & {
366
+ id?: string;
367
+ reason?: string;
368
+ };
369
+
370
+ declare type ConnectSucceededEventProps = CommonEventProps & {
371
+ id?: string;
372
+ };
373
+
351
374
  export declare const contentFooterClassName = 'smart-link-content-footer';
352
375
 
353
376
  /**
@@ -569,6 +592,25 @@ declare type InlinePreloaderStyle =
569
592
  | 'on-left-with-skeleton'
570
593
  | 'on-right-without-skeleton';
571
594
 
595
+ declare type InstrumentEventProps = CommonEventProps & {
596
+ error?: APIError;
597
+ status: CardType;
598
+ id: string;
599
+ };
600
+
601
+ declare type InvokeFailedEventProps = CommonEventProps & {
602
+ id: string;
603
+ actionType: string;
604
+ display: CardInnerAppearance;
605
+ reason: string;
606
+ };
607
+
608
+ declare type InvokeSucceededEventProps = CommonEventProps & {
609
+ id: string;
610
+ actionType: string;
611
+ display: CardInnerAppearance;
612
+ };
613
+
572
614
  declare type InvokeType = 'server' | 'client';
573
615
 
574
616
  /**
@@ -760,6 +802,8 @@ declare type RetryOptions = {
760
802
  values?: Record<string, string>;
761
803
  };
762
804
 
805
+ declare type ScreenAuthPopupEventProps = CommonEventProps;
806
+
763
807
  export { SmartCardContext as Context };
764
808
  export { SmartCardContext };
765
809
 
@@ -983,6 +1027,62 @@ declare type TitleBlockProps = {
983
1027
  theme?: SmartLinkTheme;
984
1028
  } & BlockProps;
985
1029
 
1030
+ declare type TrackAppAccountConnectedProps = CommonEventProps;
1031
+
1032
+ declare type UiActionClickedEventProps = CommonEventProps & {
1033
+ id: string;
1034
+ display: CardInnerAppearance;
1035
+ actionType: string;
1036
+ invokeType?: InvokeType;
1037
+ };
1038
+
1039
+ declare type UiAuthAlternateAccountEventProps = CommonEventProps & {
1040
+ display: CardInnerAppearance;
1041
+ };
1042
+
1043
+ declare type UiAuthEventProps = CommonEventProps & {
1044
+ display: CardInnerAppearance;
1045
+ };
1046
+
1047
+ declare type UiCardClickedEventProps = CommonEventProps & {
1048
+ id: string;
1049
+ display: CardInnerAppearance;
1050
+ status: CardType;
1051
+ isModifierKeyPressed?: boolean;
1052
+ actionSubjectId?: string;
1053
+ };
1054
+
1055
+ declare type UiClosedAuthEventProps = CommonEventProps & {
1056
+ display: CardInnerAppearance;
1057
+ };
1058
+
1059
+ declare type UiHoverCardDismissedEventProps = CommonEventProps & {
1060
+ previewDisplay: PreviewDisplay;
1061
+ hoverTime: number;
1062
+ previewInvokeMethod?: PreviewInvokeMethod;
1063
+ };
1064
+
1065
+ declare type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
1066
+ previewDisplay: PreviewDisplay;
1067
+ previewInvokeMethod?: PreviewInvokeMethod;
1068
+ };
1069
+
1070
+ declare type UiHoverCardViewedEventProps = CommonEventProps & {
1071
+ previewDisplay: PreviewDisplay;
1072
+ previewInvokeMethod?: PreviewInvokeMethod;
1073
+ };
1074
+
1075
+ declare type UiRenderFailedEventProps = CommonEventProps & {
1076
+ display: CardInnerAppearance;
1077
+ error: Error;
1078
+ errorInfo: ErrorInfo;
1079
+ };
1080
+
1081
+ declare type UiRenderSuccessEventProps = CommonEventProps & {
1082
+ display: CardInnerAppearance;
1083
+ status: CardType;
1084
+ };
1085
+
986
1086
  /**
987
1087
  * This hook provides usage of Smart Link analytics outside of the Card component.
988
1088
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
@@ -1007,11 +1107,15 @@ export declare const useSmartLinkAnalytics: (
1007
1107
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1008
1108
  * @returns
1009
1109
  */
1010
- authEvent: (
1011
- display: CardInnerAppearance,
1012
- definitionId?: string | undefined,
1013
- extensionKey?: string | undefined,
1014
- ) => void;
1110
+ authEvent: ({
1111
+ display,
1112
+ extensionKey,
1113
+ definitionId,
1114
+ resourceType,
1115
+ destinationProduct,
1116
+ destinationSubproduct,
1117
+ location,
1118
+ }: UiAuthEventProps) => void;
1015
1119
  /**
1016
1120
  * This fires an event that represents when a user clicks on the authentication
1017
1121
  * call to action with a forbidden authenticated account. (i.e. Try another account).
@@ -1020,10 +1124,24 @@ export declare const useSmartLinkAnalytics: (
1020
1124
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1021
1125
  * @returns
1022
1126
  */
1023
- authAlternateAccountEvent: (
1024
- display: CardInnerAppearance,
1025
- definitionId?: string | undefined,
1026
- extensionKey?: string | undefined,
1127
+ authAlternateAccountEvent: ({
1128
+ display,
1129
+ extensionKey,
1130
+ definitionId,
1131
+ resourceType,
1132
+ destinationProduct,
1133
+ destinationSubproduct,
1134
+ location,
1135
+ }: UiAuthAlternateAccountEventProps) => void;
1136
+ /**
1137
+ * This fires an event that represents when a user
1138
+ * click a button.
1139
+ * @param data A partial analytics event payload
1140
+ */
1141
+ buttonClickedEvent: (
1142
+ data: Partial<AnalyticsPayload> & {
1143
+ actionSubjectId: Required<string>;
1144
+ },
1027
1145
  ) => void;
1028
1146
  /**
1029
1147
  * This fires an event that represents when a user clicks on a Smart Link.
@@ -1037,18 +1155,18 @@ export declare const useSmartLinkAnalytics: (
1037
1155
  * @param destinationProduct The product the Smart Link is linked to.
1038
1156
  * @returns
1039
1157
  */
1040
- cardClickedEvent: (
1041
- id: string | undefined,
1042
- display: CardInnerAppearance,
1043
- status: CardType,
1044
- definitionId?: string | undefined,
1045
- extensionKey?: string | undefined,
1046
- isModifierKeyPressed?: boolean | undefined,
1047
- location?: string | undefined,
1048
- destinationProduct?: DestinationProduct | string | undefined,
1049
- destinationSubproduct?: DestinationSubproduct | string | undefined,
1050
- actionSubjectId?: string | undefined,
1051
- ) => void;
1158
+ cardClickedEvent: ({
1159
+ id,
1160
+ display,
1161
+ status,
1162
+ definitionId,
1163
+ extensionKey,
1164
+ isModifierKeyPressed,
1165
+ location,
1166
+ destinationProduct,
1167
+ destinationSubproduct,
1168
+ actionSubjectId,
1169
+ }: UiCardClickedEventProps) => void;
1052
1170
  /**
1053
1171
  * This fires an event that represents when a user clicks on a Smart Link action.
1054
1172
  * Note: This also starts the UFO smart-link-action-invocation experience.
@@ -1059,13 +1177,18 @@ export declare const useSmartLinkAnalytics: (
1059
1177
  * @param invokeType Whether the action invoked made a call to a server.
1060
1178
  * @returns
1061
1179
  */
1062
- actionClickedEvent: (
1063
- id: string | undefined,
1064
- extensionKey: string | undefined,
1065
- actionType: string,
1066
- display: CardInnerAppearance,
1067
- invokeType: InvokeType,
1068
- ) => void;
1180
+ actionClickedEvent: ({
1181
+ id,
1182
+ actionType,
1183
+ display,
1184
+ invokeType,
1185
+ extensionKey,
1186
+ definitionId,
1187
+ resourceType,
1188
+ destinationProduct,
1189
+ destinationSubproduct,
1190
+ location,
1191
+ }: UiActionClickedEventProps) => void;
1069
1192
  /**
1070
1193
  * This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
1071
1194
  * https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
@@ -1074,12 +1197,15 @@ export declare const useSmartLinkAnalytics: (
1074
1197
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1075
1198
  * @param previewInvokeMethod How the preview was triggered.
1076
1199
  */
1077
- hoverCardOpenLinkClickedEvent: (
1078
- previewDisplay: PreviewDisplay,
1079
- definitionId?: string | undefined,
1080
- extensionKey?: string | undefined,
1081
- previewInvokeMethod?: PreviewInvokeMethod | undefined,
1082
- ) => void;
1200
+ hoverCardOpenLinkClickedEvent: ({
1201
+ previewDisplay,
1202
+ definitionId,
1203
+ extensionKey,
1204
+ destinationProduct,
1205
+ destinationSubproduct,
1206
+ location,
1207
+ previewInvokeMethod,
1208
+ }: UiHoverCardOpenLinkClickedEventProps) => void;
1083
1209
  /**
1084
1210
  * This fires an event that represents when a user closed the authentication window without authenticating after opening it.
1085
1211
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -1087,10 +1213,23 @@ export declare const useSmartLinkAnalytics: (
1087
1213
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1088
1214
  * @returns
1089
1215
  */
1090
- closedAuthEvent: (
1091
- display: CardInnerAppearance,
1092
- definitionId?: string | undefined,
1093
- extensionKey?: string | undefined,
1216
+ closedAuthEvent: ({
1217
+ display,
1218
+ extensionKey,
1219
+ definitionId,
1220
+ resourceType,
1221
+ destinationProduct,
1222
+ destinationSubproduct,
1223
+ location,
1224
+ }: UiClosedAuthEventProps) => void;
1225
+ /**
1226
+ * This fires an event that represents when a user close a modal.
1227
+ * @param data A partial analytics event payload
1228
+ */
1229
+ modalClosedEvent: (
1230
+ data: Partial<AnalyticsPayload> & {
1231
+ actionSubjectId: Required<string>;
1232
+ },
1094
1233
  ) => void;
1095
1234
  /**
1096
1235
  * This fires an event that represents when a Smart Link was rendered successfully.
@@ -1100,13 +1239,17 @@ export declare const useSmartLinkAnalytics: (
1100
1239
  * @param definitionId The definitionId of the Smart Link resolver invoked.
1101
1240
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1102
1241
  */
1103
- renderSuccessEvent: (
1104
- display: CardInnerAppearance,
1105
- status: CardType,
1106
- id?: string,
1107
- definitionId?: string | undefined,
1108
- extensionKey?: string | undefined,
1109
- ) => void;
1242
+ renderSuccessEvent: ({
1243
+ display,
1244
+ status,
1245
+ id,
1246
+ extensionKey,
1247
+ definitionId,
1248
+ resourceType,
1249
+ destinationProduct,
1250
+ destinationSubproduct,
1251
+ location,
1252
+ }: UiRenderSuccessEventProps) => void;
1110
1253
  /**
1111
1254
  * This fires an event that represents when a Smart Link renders unsuccessfuly.
1112
1255
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -1114,12 +1257,18 @@ export declare const useSmartLinkAnalytics: (
1114
1257
  * @param error: An error representing why the Smart Link render failed.
1115
1258
  * @param errorInfo: Additional details about the error including the stack trace.
1116
1259
  */
1117
- renderFailedEvent: (
1118
- display: CardInnerAppearance,
1119
- id: string | undefined,
1120
- error: Error,
1121
- errorInfo: ErrorInfo,
1122
- ) => void;
1260
+ renderFailedEvent: ({
1261
+ display,
1262
+ id,
1263
+ error,
1264
+ errorInfo,
1265
+ extensionKey,
1266
+ definitionId,
1267
+ resourceType,
1268
+ destinationProduct,
1269
+ destinationSubproduct,
1270
+ location,
1271
+ }: UiRenderFailedEventProps) => void;
1123
1272
  /**
1124
1273
  * This fires an event that represents a hover preview being opened.
1125
1274
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -1128,13 +1277,17 @@ export declare const useSmartLinkAnalytics: (
1128
1277
  * @param previewInvokeMethod How the preview was triggered.
1129
1278
  * @returns
1130
1279
  */
1131
- hoverCardViewedEvent: (
1132
- previewDisplay: PreviewDisplay,
1133
- previewInvokeMethod?: PreviewInvokeMethod | undefined,
1134
- id?: string,
1135
- definitionId?: string | undefined,
1136
- extensionKey?: string | undefined,
1137
- ) => void;
1280
+ hoverCardViewedEvent: ({
1281
+ previewDisplay,
1282
+ previewInvokeMethod,
1283
+ id,
1284
+ extensionKey,
1285
+ definitionId,
1286
+ resourceType,
1287
+ destinationProduct,
1288
+ destinationSubproduct,
1289
+ location,
1290
+ }: UiHoverCardViewedEventProps) => void;
1138
1291
  /**
1139
1292
  * This fires an event that represents a hover preview being dismissed.
1140
1293
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -1144,14 +1297,18 @@ export declare const useSmartLinkAnalytics: (
1144
1297
  * @param previewInvokeMethod How the preview was triggered.
1145
1298
  * @returns
1146
1299
  */
1147
- hoverCardDismissedEvent: (
1148
- previewDisplay: PreviewDisplay,
1149
- hoverTime: number,
1150
- previewInvokeMethod?: PreviewInvokeMethod | undefined,
1151
- id?: string,
1152
- definitionId?: string | undefined,
1153
- extensionKey?: string | undefined,
1154
- ) => void;
1300
+ hoverCardDismissedEvent: ({
1301
+ id,
1302
+ previewDisplay,
1303
+ hoverTime,
1304
+ previewInvokeMethod,
1305
+ extensionKey,
1306
+ definitionId,
1307
+ resourceType,
1308
+ destinationProduct,
1309
+ destinationSubproduct,
1310
+ location,
1311
+ }: UiHoverCardDismissedEventProps) => void;
1155
1312
  };
1156
1313
  operational: {
1157
1314
  /**
@@ -1161,12 +1318,17 @@ export declare const useSmartLinkAnalytics: (
1161
1318
  * @param actionType The type of action invoked, e.g. PreviewAction
1162
1319
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
1163
1320
  */
1164
- invokeSucceededEvent: (
1165
- id: string | undefined,
1166
- extensionKey: string | undefined,
1167
- actionType: string,
1168
- display: CardInnerAppearance,
1169
- ) => void;
1321
+ invokeSucceededEvent: ({
1322
+ id,
1323
+ actionType,
1324
+ display,
1325
+ extensionKey,
1326
+ definitionId,
1327
+ resourceType,
1328
+ destinationProduct,
1329
+ destinationSubproduct,
1330
+ location,
1331
+ }: InvokeSucceededEventProps) => void;
1170
1332
  /**
1171
1333
  * This fires an event that represents an action being unsuccessfully invoked.
1172
1334
  * @param id The unique ID for this Smart Link.
@@ -1175,24 +1337,33 @@ export declare const useSmartLinkAnalytics: (
1175
1337
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
1176
1338
  * @param reason The reason the invocation failed.
1177
1339
  */
1178
- invokeFailedEvent: (
1179
- id: string | undefined,
1180
- providerKey: string | undefined,
1181
- actionType: string,
1182
- display: CardInnerAppearance,
1183
- reason: string,
1184
- ) => void;
1340
+ invokeFailedEvent: ({
1341
+ id,
1342
+ actionType,
1343
+ display,
1344
+ reason,
1345
+ extensionKey,
1346
+ definitionId,
1347
+ resourceType,
1348
+ destinationProduct,
1349
+ destinationSubproduct,
1350
+ location,
1351
+ }: InvokeFailedEventProps) => void;
1185
1352
  /**
1186
1353
  * This fires an event that represents an account successfully being connected via a Smart Link.
1187
1354
  * @param id The unique ID for this Smart Link.
1188
1355
  * @param definitionId The definitionId of the Smart Link resolver invoked.
1189
1356
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1190
1357
  */
1191
- connectSucceededEvent: (
1192
- id?: string,
1193
- definitionId?: string | undefined,
1194
- extensionKey?: string | undefined,
1195
- ) => void;
1358
+ connectSucceededEvent: ({
1359
+ id,
1360
+ extensionKey,
1361
+ definitionId,
1362
+ resourceType,
1363
+ destinationProduct,
1364
+ destinationSubproduct,
1365
+ location,
1366
+ }: ConnectSucceededEventProps) => void;
1196
1367
  /**
1197
1368
  * This fires an event that represents an account unsuccessfully being connected.
1198
1369
  * @param id The unique ID for this Smart Link.
@@ -1200,12 +1371,16 @@ export declare const useSmartLinkAnalytics: (
1200
1371
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1201
1372
  * @param reason The reason why the Smart Link connect account failed.
1202
1373
  */
1203
- connectFailedEvent: (
1204
- id?: string,
1205
- definitionId?: string | undefined,
1206
- extensionKey?: string | undefined,
1207
- reason?: string | undefined,
1208
- ) => void;
1374
+ connectFailedEvent: ({
1375
+ id,
1376
+ reason,
1377
+ extensionKey,
1378
+ definitionId,
1379
+ resourceType,
1380
+ destinationProduct,
1381
+ destinationSubproduct,
1382
+ location,
1383
+ }: ConnectFailedEventProps) => void;
1209
1384
  /**
1210
1385
  * This fires an event which represents a Smart Link request succeeding or failing based on the status.
1211
1386
  * @param id The unique ID for this Smart Link.
@@ -1215,14 +1390,17 @@ export declare const useSmartLinkAnalytics: (
1215
1390
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
1216
1391
  * @param error An error representing why the Smart Link request failed.
1217
1392
  */
1218
- instrument: (
1219
- id: string | undefined,
1220
- status: CardType,
1221
- definitionId?: string | undefined,
1222
- extensionKey?: string | undefined,
1223
- resourceType?: string | undefined,
1224
- error?: APIError | undefined,
1225
- ) => void;
1393
+ instrument: ({
1394
+ id,
1395
+ status,
1396
+ extensionKey,
1397
+ definitionId,
1398
+ resourceType,
1399
+ destinationProduct,
1400
+ destinationSubproduct,
1401
+ location,
1402
+ error,
1403
+ }: InstrumentEventProps) => void;
1226
1404
  };
1227
1405
  track: {
1228
1406
  /**
@@ -1231,10 +1409,14 @@ export declare const useSmartLinkAnalytics: (
1231
1409
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1232
1410
  * @returns
1233
1411
  */
1234
- appAccountConnected: (
1235
- definitionId?: string | undefined,
1236
- extensionKey?: string | undefined,
1237
- ) => void;
1412
+ appAccountConnected: ({
1413
+ extensionKey,
1414
+ definitionId,
1415
+ resourceType,
1416
+ destinationProduct,
1417
+ destinationSubproduct,
1418
+ location,
1419
+ }: TrackAppAccountConnectedProps) => void;
1238
1420
  };
1239
1421
  screen: {
1240
1422
  /**
@@ -1243,9 +1425,22 @@ export declare const useSmartLinkAnalytics: (
1243
1425
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1244
1426
  * @returns
1245
1427
  */
1246
- authPopupEvent: (
1247
- definitionId?: string | undefined,
1248
- extensionKey?: string | undefined,
1428
+ authPopupEvent: ({
1429
+ extensionKey,
1430
+ definitionId,
1431
+ resourceType,
1432
+ destinationProduct,
1433
+ destinationSubproduct,
1434
+ location,
1435
+ }: ScreenAuthPopupEventProps) => void;
1436
+ /**
1437
+ * This fires an event that represents when a user view a modal.
1438
+ * @param data A partial analytics event payload
1439
+ */
1440
+ modalViewedEvent: (
1441
+ data: Partial<AnalyticsPayload> & {
1442
+ name: Extract<AnalyticsName, 'embedPreviewModal'>;
1443
+ },
1249
1444
  ) => void;
1250
1445
  };
1251
1446
  };