@atlaskit/smart-card 21.1.4 → 22.0.0

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 (105) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cjs/extractors/block/index.js +3 -2
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +12 -2
  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 +386 -109
  7. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +12 -2
  8. package/dist/cjs/utils/analytics/analytics.js +239 -72
  9. package/dist/cjs/utils/analytics/index.js +32 -5
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +1 -1
  12. package/dist/cjs/view/BlockCard/index.js +10 -0
  13. package/dist/cjs/view/CardWithUrl/component.js +26 -4
  14. package/dist/cjs/view/CardWithUrl/loader.js +6 -1
  15. package/dist/cjs/view/EmbedModal/components/size-experiment/index.js +41 -0
  16. package/dist/cjs/view/EmbedModal/components/size-experiment/types.js +5 -0
  17. package/dist/cjs/view/EmbedModal/index.js +7 -3
  18. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +17 -3
  19. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +5 -2
  20. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +20 -8
  21. package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -2
  22. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -2
  23. package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +5 -2
  24. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -2
  25. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +36 -8
  26. package/dist/cjs/view/HoverCard/components/SnippetOrPreview.js +74 -0
  27. package/dist/cjs/view/HoverCard/index.js +6 -1
  28. package/dist/cjs/view/HoverCard/styled.js +11 -3
  29. package/dist/es2019/extractors/block/index.js +2 -1
  30. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +12 -3
  31. package/dist/es2019/state/actions/index.js +54 -10
  32. package/dist/es2019/state/analytics/types.js +1 -0
  33. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +379 -39
  34. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +11 -2
  35. package/dist/es2019/utils/analytics/analytics.js +253 -78
  36. package/dist/es2019/utils/analytics/index.js +32 -4
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/es2019/view/BlockCard/actions/PreviewAction.js +1 -1
  39. package/dist/es2019/view/BlockCard/index.js +9 -0
  40. package/dist/es2019/view/CardWithUrl/component.js +26 -4
  41. package/dist/es2019/view/CardWithUrl/loader.js +6 -1
  42. package/dist/es2019/view/EmbedModal/components/size-experiment/index.js +28 -0
  43. package/dist/es2019/view/EmbedModal/components/size-experiment/types.js +1 -0
  44. package/dist/es2019/view/EmbedModal/index.js +5 -3
  45. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +17 -7
  46. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +4 -1
  47. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +17 -6
  48. package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +4 -2
  49. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -3
  50. package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +5 -2
  51. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +9 -2
  52. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +36 -10
  53. package/dist/es2019/view/HoverCard/components/SnippetOrPreview.js +42 -0
  54. package/dist/es2019/view/HoverCard/index.js +6 -1
  55. package/dist/es2019/view/HoverCard/styled.js +8 -0
  56. package/dist/esm/extractors/block/index.js +3 -2
  57. package/dist/esm/extractors/common/actions/extractPreviewAction.js +12 -2
  58. package/dist/esm/state/actions/index.js +54 -10
  59. package/dist/esm/state/analytics/types.js +1 -0
  60. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +383 -109
  61. package/dist/esm/state/hooks-external/useSmartLinkActions.js +11 -2
  62. package/dist/esm/utils/analytics/analytics.js +239 -72
  63. package/dist/esm/utils/analytics/index.js +31 -4
  64. package/dist/esm/version.json +1 -1
  65. package/dist/esm/view/BlockCard/actions/PreviewAction.js +1 -1
  66. package/dist/esm/view/BlockCard/index.js +9 -0
  67. package/dist/esm/view/CardWithUrl/component.js +26 -4
  68. package/dist/esm/view/CardWithUrl/loader.js +6 -1
  69. package/dist/esm/view/EmbedModal/components/size-experiment/index.js +28 -0
  70. package/dist/esm/view/EmbedModal/components/size-experiment/types.js +1 -0
  71. package/dist/esm/view/EmbedModal/index.js +6 -3
  72. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +11 -3
  73. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -2
  74. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +18 -8
  75. package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +4 -2
  76. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -2
  77. package/dist/esm/view/FlexibleCard/components/elements/media/index.js +5 -2
  78. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -2
  79. package/dist/esm/view/HoverCard/components/HoverCardContent.js +36 -10
  80. package/dist/esm/view/HoverCard/components/SnippetOrPreview.js +53 -0
  81. package/dist/esm/view/HoverCard/index.js +6 -1
  82. package/dist/esm/view/HoverCard/styled.js +6 -2
  83. package/dist/types/extractors/block/types.d.ts +2 -0
  84. package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +2 -1
  85. package/dist/types/state/analytics/types.d.ts +9 -0
  86. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +18 -23
  87. package/dist/types/state/hooks/useSmartLink.d.ts +17 -18
  88. package/dist/types/utils/analytics/analytics.d.ts +19 -21
  89. package/dist/types/utils/analytics/index.d.ts +2 -2
  90. package/dist/types/utils/analytics/types.d.ts +91 -0
  91. package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +4 -2
  92. package/dist/types/view/Card/index.d.ts +1 -1
  93. package/dist/types/view/EmbedModal/components/size-experiment/index.d.ts +6 -0
  94. package/dist/types/view/EmbedModal/components/size-experiment/types.d.ts +4 -0
  95. package/dist/types/view/EmbedModal/index.d.ts +1 -1
  96. package/dist/types/view/EmbedModal/types.d.ts +4 -0
  97. package/dist/types/view/FlexibleCard/components/blocks/preview-block/types.d.ts +7 -1
  98. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +15 -0
  99. package/dist/types/view/FlexibleCard/components/common/image-icon/types.d.ts +1 -0
  100. package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +5 -0
  101. package/dist/types/view/HoverCard/components/SnippetOrPreview.d.ts +4 -0
  102. package/dist/types/view/HoverCard/styled.d.ts +2 -0
  103. package/dist/types/view/HoverCard/types.d.ts +5 -0
  104. package/package.json +2 -2
  105. package/report.api.md +294 -110
package/report.api.md CHANGED
@@ -29,6 +29,7 @@ import { SmartCardProvider as Provider } from '@atlaskit/link-provider';
29
29
  import { ProviderProps } from '@atlaskit/link-provider';
30
30
  import { default as React_2 } from 'react';
31
31
  import { ReactChild } from 'react';
32
+ import { Ref } from 'react';
32
33
  import { SerializedStyles } from '@emotion/core';
33
34
  import { SmartCardContext } from '@atlaskit/link-provider';
34
35
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
@@ -237,6 +238,20 @@ declare type BlockProps = {
237
238
  * serving as a hook for automated tests
238
239
  */
239
240
  testId?: string;
241
+ /**
242
+ * Ref to block wrapper div.
243
+ */
244
+ blockRef?: Ref<HTMLDivElement>;
245
+ /**
246
+ * Function to be called on render of block.
247
+ * @internal
248
+ */
249
+ onRender?: () => void;
250
+ /**
251
+ * Function to be called on transition end of block.
252
+ * @internal
253
+ */
254
+ onTransitionEnd?: () => void;
240
255
  };
241
256
 
242
257
  export declare const Card: React_2.ForwardRefExoticComponent<
@@ -263,12 +278,12 @@ export declare const Card: React_2.ForwardRefExoticComponent<
263
278
  | 'key'
264
279
  | 'url'
265
280
  | 'ui'
281
+ | 'showHoverPreview'
266
282
  | 'showActions'
267
283
  | 'onResolve'
268
284
  | 'platform'
269
285
  | 'isFrameVisible'
270
286
  | 'embedIframeRef'
271
- | 'showHoverPreview'
272
287
  | 'inlinePreloaderStyle'
273
288
  | 'importer'
274
289
  | 'container'
@@ -333,6 +348,25 @@ declare type CommentCount = {
333
348
  name: ElementName.CommentCount;
334
349
  };
335
350
 
351
+ declare interface CommonEventProps {
352
+ id?: string;
353
+ definitionId?: string;
354
+ extensionKey?: string;
355
+ resourceType?: string;
356
+ destinationSubproduct?: DestinationSubproduct | string;
357
+ destinationProduct?: DestinationProduct | string;
358
+ location?: string;
359
+ }
360
+
361
+ declare type ConnectFailedEventProps = CommonEventProps & {
362
+ id?: string;
363
+ reason?: string;
364
+ };
365
+
366
+ declare type ConnectSucceededEventProps = CommonEventProps & {
367
+ id?: string;
368
+ };
369
+
336
370
  export declare const contentFooterClassName = 'smart-link-content-footer';
337
371
 
338
372
  /**
@@ -554,6 +588,25 @@ declare type InlinePreloaderStyle =
554
588
  | 'on-left-with-skeleton'
555
589
  | 'on-right-without-skeleton';
556
590
 
591
+ declare type InstrumentEventProps = CommonEventProps & {
592
+ error?: APIError;
593
+ status: CardType;
594
+ id: string;
595
+ };
596
+
597
+ declare type InvokeFailedEventProps = CommonEventProps & {
598
+ id: string;
599
+ actionType: string;
600
+ display: CardInnerAppearance;
601
+ reason: string;
602
+ };
603
+
604
+ declare type InvokeSucceededEventProps = CommonEventProps & {
605
+ id: string;
606
+ actionType: string;
607
+ display: CardInnerAppearance;
608
+ };
609
+
557
610
  declare type InvokeType = 'server' | 'client';
558
611
 
559
612
  /**
@@ -672,7 +725,13 @@ declare type Preview = {
672
725
  */
673
726
  export declare const PreviewBlock: React_2.FC<PreviewBlockProps>;
674
727
 
675
- declare type PreviewBlockProps = BlockProps;
728
+ declare type PreviewBlockProps = {
729
+ /**
730
+ * Function to be called on error loading media.
731
+ * @internal
732
+ */
733
+ onError?: () => void;
734
+ } & BlockProps;
676
735
 
677
736
  declare type PreviewDisplay = 'card' | 'embed';
678
737
 
@@ -739,6 +798,8 @@ declare type RetryOptions = {
739
798
  values?: Record<string, string>;
740
799
  };
741
800
 
801
+ declare type ScreenAuthPopupEventProps = CommonEventProps;
802
+
742
803
  export { SmartCardContext as Context };
743
804
  export { SmartCardContext };
744
805
 
@@ -962,6 +1023,62 @@ declare type TitleBlockProps = {
962
1023
  theme?: SmartLinkTheme;
963
1024
  } & BlockProps;
964
1025
 
1026
+ declare type TrackAppAccountConnectedProps = CommonEventProps;
1027
+
1028
+ declare type UiActionClickedEventProps = CommonEventProps & {
1029
+ id: string;
1030
+ display: CardInnerAppearance;
1031
+ actionType: string;
1032
+ invokeType?: InvokeType;
1033
+ };
1034
+
1035
+ declare type UiAuthAlternateAccountEventProps = CommonEventProps & {
1036
+ display: CardInnerAppearance;
1037
+ };
1038
+
1039
+ declare type UiAuthEventProps = CommonEventProps & {
1040
+ display: CardInnerAppearance;
1041
+ };
1042
+
1043
+ declare type UiCardClickedEventProps = CommonEventProps & {
1044
+ id: string;
1045
+ display: CardInnerAppearance;
1046
+ status: CardType;
1047
+ isModifierKeyPressed?: boolean;
1048
+ actionSubjectId?: string;
1049
+ };
1050
+
1051
+ declare type UiClosedAuthEventProps = CommonEventProps & {
1052
+ display: CardInnerAppearance;
1053
+ };
1054
+
1055
+ declare type UiHoverCardDismissedEventProps = CommonEventProps & {
1056
+ previewDisplay: PreviewDisplay;
1057
+ hoverTime: number;
1058
+ previewInvokeMethod?: PreviewInvokeMethod;
1059
+ };
1060
+
1061
+ declare type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
1062
+ previewDisplay: PreviewDisplay;
1063
+ previewInvokeMethod?: PreviewInvokeMethod;
1064
+ };
1065
+
1066
+ declare type UiHoverCardViewedEventProps = CommonEventProps & {
1067
+ previewDisplay: PreviewDisplay;
1068
+ previewInvokeMethod?: PreviewInvokeMethod;
1069
+ };
1070
+
1071
+ declare type UiRenderFailedEventProps = CommonEventProps & {
1072
+ display: CardInnerAppearance;
1073
+ error: Error;
1074
+ errorInfo: ErrorInfo;
1075
+ };
1076
+
1077
+ declare type UiRenderSuccessEventProps = CommonEventProps & {
1078
+ display: CardInnerAppearance;
1079
+ status: CardType;
1080
+ };
1081
+
965
1082
  /**
966
1083
  * This hook provides usage of Smart Link analytics outside of the Card component.
967
1084
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
@@ -986,11 +1103,15 @@ export declare const useSmartLinkAnalytics: (
986
1103
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
987
1104
  * @returns
988
1105
  */
989
- authEvent: (
990
- display: CardInnerAppearance,
991
- definitionId?: string | undefined,
992
- extensionKey?: string | undefined,
993
- ) => void;
1106
+ authEvent: ({
1107
+ display,
1108
+ extensionKey,
1109
+ definitionId,
1110
+ resourceType,
1111
+ destinationProduct,
1112
+ destinationSubproduct,
1113
+ location,
1114
+ }: UiAuthEventProps) => void;
994
1115
  /**
995
1116
  * This fires an event that represents when a user clicks on the authentication
996
1117
  * call to action with a forbidden authenticated account. (i.e. Try another account).
@@ -999,11 +1120,15 @@ export declare const useSmartLinkAnalytics: (
999
1120
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1000
1121
  * @returns
1001
1122
  */
1002
- authAlternateAccountEvent: (
1003
- display: CardInnerAppearance,
1004
- definitionId?: string | undefined,
1005
- extensionKey?: string | undefined,
1006
- ) => void;
1123
+ authAlternateAccountEvent: ({
1124
+ display,
1125
+ extensionKey,
1126
+ definitionId,
1127
+ resourceType,
1128
+ destinationProduct,
1129
+ destinationSubproduct,
1130
+ location,
1131
+ }: UiAuthAlternateAccountEventProps) => void;
1007
1132
  /**
1008
1133
  * This fires an event that represents when a user clicks on a Smart Link.
1009
1134
  * @param id The unique ID for this Smart Link.
@@ -1016,18 +1141,18 @@ export declare const useSmartLinkAnalytics: (
1016
1141
  * @param destinationProduct The product the Smart Link is linked to.
1017
1142
  * @returns
1018
1143
  */
1019
- cardClickedEvent: (
1020
- id: string | undefined,
1021
- display: CardInnerAppearance,
1022
- status: CardType,
1023
- definitionId?: string | undefined,
1024
- extensionKey?: string | undefined,
1025
- isModifierKeyPressed?: boolean | undefined,
1026
- location?: string | undefined,
1027
- destinationProduct?: DestinationProduct | string | undefined,
1028
- destinationSubproduct?: DestinationSubproduct | string | undefined,
1029
- actionSubjectId?: string | undefined,
1030
- ) => void;
1144
+ cardClickedEvent: ({
1145
+ id,
1146
+ display,
1147
+ status,
1148
+ definitionId,
1149
+ extensionKey,
1150
+ isModifierKeyPressed,
1151
+ location,
1152
+ destinationProduct,
1153
+ destinationSubproduct,
1154
+ actionSubjectId,
1155
+ }: UiCardClickedEventProps) => void;
1031
1156
  /**
1032
1157
  * This fires an event that represents when a user clicks on a Smart Link action.
1033
1158
  * Note: This also starts the UFO smart-link-action-invocation experience.
@@ -1038,13 +1163,18 @@ export declare const useSmartLinkAnalytics: (
1038
1163
  * @param invokeType Whether the action invoked made a call to a server.
1039
1164
  * @returns
1040
1165
  */
1041
- actionClickedEvent: (
1042
- id: string | undefined,
1043
- extensionKey: string | undefined,
1044
- actionType: string,
1045
- display: CardInnerAppearance,
1046
- invokeType: InvokeType,
1047
- ) => void;
1166
+ actionClickedEvent: ({
1167
+ id,
1168
+ actionType,
1169
+ display,
1170
+ invokeType,
1171
+ extensionKey,
1172
+ definitionId,
1173
+ resourceType,
1174
+ destinationProduct,
1175
+ destinationSubproduct,
1176
+ location,
1177
+ }: UiActionClickedEventProps) => void;
1048
1178
  /**
1049
1179
  * This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
1050
1180
  * https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
@@ -1053,12 +1183,15 @@ export declare const useSmartLinkAnalytics: (
1053
1183
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1054
1184
  * @param previewInvokeMethod How the preview was triggered.
1055
1185
  */
1056
- hoverCardOpenLinkClickedEvent: (
1057
- previewDisplay: PreviewDisplay,
1058
- definitionId?: string | undefined,
1059
- extensionKey?: string | undefined,
1060
- previewInvokeMethod?: PreviewInvokeMethod | undefined,
1061
- ) => void;
1186
+ hoverCardOpenLinkClickedEvent: ({
1187
+ previewDisplay,
1188
+ definitionId,
1189
+ extensionKey,
1190
+ destinationProduct,
1191
+ destinationSubproduct,
1192
+ location,
1193
+ previewInvokeMethod,
1194
+ }: UiHoverCardOpenLinkClickedEventProps) => void;
1062
1195
  /**
1063
1196
  * This fires an event that represents when a user closed the authentication window without authenticating after opening it.
1064
1197
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -1066,11 +1199,15 @@ export declare const useSmartLinkAnalytics: (
1066
1199
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1067
1200
  * @returns
1068
1201
  */
1069
- closedAuthEvent: (
1070
- display: CardInnerAppearance,
1071
- definitionId?: string | undefined,
1072
- extensionKey?: string | undefined,
1073
- ) => void;
1202
+ closedAuthEvent: ({
1203
+ display,
1204
+ extensionKey,
1205
+ definitionId,
1206
+ resourceType,
1207
+ destinationProduct,
1208
+ destinationSubproduct,
1209
+ location,
1210
+ }: UiClosedAuthEventProps) => void;
1074
1211
  /**
1075
1212
  * This fires an event that represents when a Smart Link was rendered successfully.
1076
1213
  * Note: this fires even if the Smart Link request errored out.
@@ -1079,13 +1216,17 @@ export declare const useSmartLinkAnalytics: (
1079
1216
  * @param definitionId The definitionId of the Smart Link resolver invoked.
1080
1217
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1081
1218
  */
1082
- renderSuccessEvent: (
1083
- display: CardInnerAppearance,
1084
- status: CardType,
1085
- id?: string,
1086
- definitionId?: string | undefined,
1087
- extensionKey?: string | undefined,
1088
- ) => void;
1219
+ renderSuccessEvent: ({
1220
+ display,
1221
+ status,
1222
+ id,
1223
+ extensionKey,
1224
+ definitionId,
1225
+ resourceType,
1226
+ destinationProduct,
1227
+ destinationSubproduct,
1228
+ location,
1229
+ }: UiRenderSuccessEventProps) => void;
1089
1230
  /**
1090
1231
  * This fires an event that represents when a Smart Link renders unsuccessfuly.
1091
1232
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -1093,12 +1234,18 @@ export declare const useSmartLinkAnalytics: (
1093
1234
  * @param error: An error representing why the Smart Link render failed.
1094
1235
  * @param errorInfo: Additional details about the error including the stack trace.
1095
1236
  */
1096
- renderFailedEvent: (
1097
- display: CardInnerAppearance,
1098
- id: string | undefined,
1099
- error: Error,
1100
- errorInfo: ErrorInfo,
1101
- ) => void;
1237
+ renderFailedEvent: ({
1238
+ display,
1239
+ id,
1240
+ error,
1241
+ errorInfo,
1242
+ extensionKey,
1243
+ definitionId,
1244
+ resourceType,
1245
+ destinationProduct,
1246
+ destinationSubproduct,
1247
+ location,
1248
+ }: UiRenderFailedEventProps) => void;
1102
1249
  /**
1103
1250
  * This fires an event that represents a hover preview being opened.
1104
1251
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -1107,13 +1254,17 @@ export declare const useSmartLinkAnalytics: (
1107
1254
  * @param previewInvokeMethod How the preview was triggered.
1108
1255
  * @returns
1109
1256
  */
1110
- hoverCardViewedEvent: (
1111
- previewDisplay: PreviewDisplay,
1112
- previewInvokeMethod?: PreviewInvokeMethod | undefined,
1113
- id?: string,
1114
- definitionId?: string | undefined,
1115
- extensionKey?: string | undefined,
1116
- ) => void;
1257
+ hoverCardViewedEvent: ({
1258
+ previewDisplay,
1259
+ previewInvokeMethod,
1260
+ id,
1261
+ extensionKey,
1262
+ definitionId,
1263
+ resourceType,
1264
+ destinationProduct,
1265
+ destinationSubproduct,
1266
+ location,
1267
+ }: UiHoverCardViewedEventProps) => void;
1117
1268
  /**
1118
1269
  * This fires an event that represents a hover preview being dismissed.
1119
1270
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -1123,14 +1274,18 @@ export declare const useSmartLinkAnalytics: (
1123
1274
  * @param previewInvokeMethod How the preview was triggered.
1124
1275
  * @returns
1125
1276
  */
1126
- hoverCardDismissedEvent: (
1127
- previewDisplay: PreviewDisplay,
1128
- hoverTime: number,
1129
- previewInvokeMethod?: PreviewInvokeMethod | undefined,
1130
- id?: string,
1131
- definitionId?: string | undefined,
1132
- extensionKey?: string | undefined,
1133
- ) => void;
1277
+ hoverCardDismissedEvent: ({
1278
+ id,
1279
+ previewDisplay,
1280
+ hoverTime,
1281
+ previewInvokeMethod,
1282
+ extensionKey,
1283
+ definitionId,
1284
+ resourceType,
1285
+ destinationProduct,
1286
+ destinationSubproduct,
1287
+ location,
1288
+ }: UiHoverCardDismissedEventProps) => void;
1134
1289
  };
1135
1290
  operational: {
1136
1291
  /**
@@ -1140,12 +1295,17 @@ export declare const useSmartLinkAnalytics: (
1140
1295
  * @param actionType The type of action invoked, e.g. PreviewAction
1141
1296
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
1142
1297
  */
1143
- invokeSucceededEvent: (
1144
- id: string | undefined,
1145
- extensionKey: string | undefined,
1146
- actionType: string,
1147
- display: CardInnerAppearance,
1148
- ) => void;
1298
+ invokeSucceededEvent: ({
1299
+ id,
1300
+ actionType,
1301
+ display,
1302
+ extensionKey,
1303
+ definitionId,
1304
+ resourceType,
1305
+ destinationProduct,
1306
+ destinationSubproduct,
1307
+ location,
1308
+ }: InvokeSucceededEventProps) => void;
1149
1309
  /**
1150
1310
  * This fires an event that represents an action being unsuccessfully invoked.
1151
1311
  * @param id The unique ID for this Smart Link.
@@ -1154,24 +1314,33 @@ export declare const useSmartLinkAnalytics: (
1154
1314
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
1155
1315
  * @param reason The reason the invocation failed.
1156
1316
  */
1157
- invokeFailedEvent: (
1158
- id: string | undefined,
1159
- providerKey: string | undefined,
1160
- actionType: string,
1161
- display: CardInnerAppearance,
1162
- reason: string,
1163
- ) => void;
1317
+ invokeFailedEvent: ({
1318
+ id,
1319
+ actionType,
1320
+ display,
1321
+ reason,
1322
+ extensionKey,
1323
+ definitionId,
1324
+ resourceType,
1325
+ destinationProduct,
1326
+ destinationSubproduct,
1327
+ location,
1328
+ }: InvokeFailedEventProps) => void;
1164
1329
  /**
1165
1330
  * This fires an event that represents an account successfully being connected via a Smart Link.
1166
1331
  * @param id The unique ID for this Smart Link.
1167
1332
  * @param definitionId The definitionId of the Smart Link resolver invoked.
1168
1333
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1169
1334
  */
1170
- connectSucceededEvent: (
1171
- id?: string,
1172
- definitionId?: string | undefined,
1173
- extensionKey?: string | undefined,
1174
- ) => void;
1335
+ connectSucceededEvent: ({
1336
+ id,
1337
+ extensionKey,
1338
+ definitionId,
1339
+ resourceType,
1340
+ destinationProduct,
1341
+ destinationSubproduct,
1342
+ location,
1343
+ }: ConnectSucceededEventProps) => void;
1175
1344
  /**
1176
1345
  * This fires an event that represents an account unsuccessfully being connected.
1177
1346
  * @param id The unique ID for this Smart Link.
@@ -1179,12 +1348,16 @@ export declare const useSmartLinkAnalytics: (
1179
1348
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1180
1349
  * @param reason The reason why the Smart Link connect account failed.
1181
1350
  */
1182
- connectFailedEvent: (
1183
- id?: string,
1184
- definitionId?: string | undefined,
1185
- extensionKey?: string | undefined,
1186
- reason?: string | undefined,
1187
- ) => void;
1351
+ connectFailedEvent: ({
1352
+ id,
1353
+ reason,
1354
+ extensionKey,
1355
+ definitionId,
1356
+ resourceType,
1357
+ destinationProduct,
1358
+ destinationSubproduct,
1359
+ location,
1360
+ }: ConnectFailedEventProps) => void;
1188
1361
  /**
1189
1362
  * This fires an event which represents a Smart Link request succeeding or failing based on the status.
1190
1363
  * @param id The unique ID for this Smart Link.
@@ -1194,14 +1367,17 @@ export declare const useSmartLinkAnalytics: (
1194
1367
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
1195
1368
  * @param error An error representing why the Smart Link request failed.
1196
1369
  */
1197
- instrument: (
1198
- id: string | undefined,
1199
- status: CardType,
1200
- definitionId?: string | undefined,
1201
- extensionKey?: string | undefined,
1202
- resourceType?: string | undefined,
1203
- error?: APIError | undefined,
1204
- ) => void;
1370
+ instrument: ({
1371
+ id,
1372
+ status,
1373
+ extensionKey,
1374
+ definitionId,
1375
+ resourceType,
1376
+ destinationProduct,
1377
+ destinationSubproduct,
1378
+ location,
1379
+ error,
1380
+ }: InstrumentEventProps) => void;
1205
1381
  };
1206
1382
  track: {
1207
1383
  /**
@@ -1210,10 +1386,14 @@ export declare const useSmartLinkAnalytics: (
1210
1386
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1211
1387
  * @returns
1212
1388
  */
1213
- appAccountConnected: (
1214
- definitionId?: string | undefined,
1215
- extensionKey?: string | undefined,
1216
- ) => void;
1389
+ appAccountConnected: ({
1390
+ extensionKey,
1391
+ definitionId,
1392
+ resourceType,
1393
+ destinationProduct,
1394
+ destinationSubproduct,
1395
+ location,
1396
+ }: TrackAppAccountConnectedProps) => void;
1217
1397
  };
1218
1398
  screen: {
1219
1399
  /**
@@ -1222,10 +1402,14 @@ export declare const useSmartLinkAnalytics: (
1222
1402
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
1223
1403
  * @returns
1224
1404
  */
1225
- authPopupEvent: (
1226
- definitionId?: string | undefined,
1227
- extensionKey?: string | undefined,
1228
- ) => void;
1405
+ authPopupEvent: ({
1406
+ extensionKey,
1407
+ definitionId,
1408
+ resourceType,
1409
+ destinationProduct,
1410
+ destinationSubproduct,
1411
+ location,
1412
+ }: ScreenAuthPopupEventProps) => void;
1229
1413
  };
1230
1414
  };
1231
1415