@atlaskit/smart-card 21.3.0 → 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 (45) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +10 -2
  3. package/dist/cjs/state/actions/index.js +54 -10
  4. package/dist/cjs/state/analytics/types.js +5 -0
  5. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +386 -109
  6. package/dist/cjs/utils/analytics/analytics.js +239 -72
  7. package/dist/cjs/utils/analytics/index.js +32 -5
  8. package/dist/cjs/version.json +1 -1
  9. package/dist/cjs/view/CardWithUrl/component.js +25 -3
  10. package/dist/cjs/view/CardWithUrl/loader.js +6 -1
  11. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -2
  12. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +15 -4
  13. package/dist/cjs/view/HoverCard/index.js +6 -1
  14. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +10 -2
  15. package/dist/es2019/state/actions/index.js +54 -10
  16. package/dist/es2019/state/analytics/types.js +1 -0
  17. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +379 -39
  18. package/dist/es2019/utils/analytics/analytics.js +253 -78
  19. package/dist/es2019/utils/analytics/index.js +32 -4
  20. package/dist/es2019/version.json +1 -1
  21. package/dist/es2019/view/CardWithUrl/component.js +25 -3
  22. package/dist/es2019/view/CardWithUrl/loader.js +6 -1
  23. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +9 -2
  24. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +15 -4
  25. package/dist/es2019/view/HoverCard/index.js +6 -1
  26. package/dist/esm/extractors/common/actions/extractPreviewAction.js +10 -2
  27. package/dist/esm/state/actions/index.js +54 -10
  28. package/dist/esm/state/analytics/types.js +1 -0
  29. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +383 -109
  30. package/dist/esm/utils/analytics/analytics.js +239 -72
  31. package/dist/esm/utils/analytics/index.js +31 -4
  32. package/dist/esm/version.json +1 -1
  33. package/dist/esm/view/CardWithUrl/component.js +25 -3
  34. package/dist/esm/view/CardWithUrl/loader.js +6 -1
  35. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -2
  36. package/dist/esm/view/HoverCard/components/HoverCardContent.js +15 -4
  37. package/dist/esm/view/HoverCard/index.js +6 -1
  38. package/dist/types/state/analytics/types.d.ts +9 -0
  39. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +18 -23
  40. package/dist/types/state/hooks/useSmartLink.d.ts +17 -18
  41. package/dist/types/utils/analytics/analytics.d.ts +19 -21
  42. package/dist/types/utils/analytics/index.d.ts +2 -2
  43. package/dist/types/utils/analytics/types.d.ts +91 -0
  44. package/package.json +1 -1
  45. package/report.api.md +271 -108
@@ -48,28 +48,29 @@ export var fireSmartLinkEvent = function fireSmartLinkEvent(payload, createAnaly
48
48
  createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
49
49
  }
50
50
  };
51
- export var resolvedEvent = function resolvedEvent(id, definitionId, extensionKey, resourceType) {
51
+ export var resolvedEvent = function resolvedEvent(props) {
52
52
  return {
53
53
  action: 'resolved',
54
54
  actionSubject: 'smartLink',
55
55
  eventType: 'operational',
56
- attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread({
57
- id: id
58
- }, context), definitionId ? {
59
- definitionId: definitionId
60
- } : {}), extensionKey ? {
61
- extensionKey: extensionKey
62
- } : {}), resourceType ? {
63
- resourceType: resourceType
64
- } : {})
56
+ attributes: _objectSpread(_objectSpread({}, props), context)
65
57
  };
66
58
  };
67
- export var unresolvedEvent = function unresolvedEvent(id, status, definitionId, extensionKey, resourceType, error) {
59
+ export var unresolvedEvent = function unresolvedEvent(_ref) {
60
+ var id = _ref.id,
61
+ definitionId = _ref.definitionId,
62
+ extensionKey = _ref.extensionKey,
63
+ resourceType = _ref.resourceType,
64
+ destinationSubproduct = _ref.destinationSubproduct,
65
+ destinationProduct = _ref.destinationProduct,
66
+ error = _ref.error,
67
+ status = _ref.status,
68
+ location = _ref.location;
68
69
  return {
69
70
  action: 'unresolved',
70
71
  actionSubject: 'smartLink',
71
72
  eventType: 'operational',
72
- attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
73
+ attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
73
74
  id: id
74
75
  }, context), definitionId ? {
75
76
  definitionId: definitionId
@@ -77,17 +78,31 @@ export var unresolvedEvent = function unresolvedEvent(id, status, definitionId,
77
78
  extensionKey: extensionKey
78
79
  } : {}), resourceType ? {
79
80
  resourceType: resourceType
81
+ } : {}), destinationSubproduct ? {
82
+ destinationSubproduct: destinationSubproduct
83
+ } : {}), destinationProduct ? {
84
+ destinationProduct: destinationProduct
85
+ } : {}), location ? {
86
+ location: location
80
87
  } : {}), {}, {
81
88
  reason: status,
82
89
  error: error ? {
83
- message: error.message,
84
- kind: error.kind,
85
- type: error.type
90
+ message: error === null || error === void 0 ? void 0 : error.message,
91
+ kind: error === null || error === void 0 ? void 0 : error.kind,
92
+ type: error === null || error === void 0 ? void 0 : error.type
86
93
  } : undefined
87
94
  })
88
95
  };
89
96
  };
90
- export var invokeSucceededEvent = function invokeSucceededEvent(id, actionType, display, extensionKey) {
97
+ export var invokeSucceededEvent = function invokeSucceededEvent(_ref2) {
98
+ var id = _ref2.id,
99
+ actionType = _ref2.actionType,
100
+ display = _ref2.display,
101
+ extensionKey = _ref2.extensionKey,
102
+ definitionId = _ref2.definitionId,
103
+ destinationProduct = _ref2.destinationProduct,
104
+ destinationSubproduct = _ref2.destinationSubproduct,
105
+ location = _ref2.location;
91
106
  var measure = getMeasure(id, 'resolved') || {
92
107
  duration: undefined
93
108
  };
@@ -99,12 +114,25 @@ export var invokeSucceededEvent = function invokeSucceededEvent(id, actionType,
99
114
  id: id,
100
115
  actionType: actionType,
101
116
  display: display,
102
- extensionKey: extensionKey || '',
117
+ definitionId: definitionId,
118
+ destinationProduct: destinationProduct,
119
+ destinationSubproduct: destinationSubproduct,
120
+ location: location,
121
+ extensionKey: extensionKey,
103
122
  duration: measure.duration
104
123
  })
105
124
  };
106
125
  };
107
- export var invokeFailedEvent = function invokeFailedEvent(id, actionType, display, reason, extensionKey) {
126
+ export var invokeFailedEvent = function invokeFailedEvent(_ref3) {
127
+ var id = _ref3.id,
128
+ actionType = _ref3.actionType,
129
+ display = _ref3.display,
130
+ reason = _ref3.reason,
131
+ extensionKey = _ref3.extensionKey,
132
+ definitionId = _ref3.definitionId,
133
+ destinationProduct = _ref3.destinationProduct,
134
+ destinationSubproduct = _ref3.destinationSubproduct,
135
+ location = _ref3.location;
108
136
  var measure = getMeasure(id, 'errored') || {
109
137
  duration: undefined
110
138
  };
@@ -116,78 +144,131 @@ export var invokeFailedEvent = function invokeFailedEvent(id, actionType, displa
116
144
  id: id,
117
145
  actionType: actionType,
118
146
  display: display,
119
- extensionKey: extensionKey || '',
147
+ extensionKey: extensionKey,
148
+ definitionId: definitionId,
149
+ destinationProduct: destinationProduct,
150
+ destinationSubproduct: destinationSubproduct,
151
+ location: location,
120
152
  duration: measure.duration,
121
153
  reason: reason
122
154
  })
123
155
  };
124
156
  };
125
- export var connectSucceededEvent = function connectSucceededEvent(definitionId, extensionKey) {
157
+ export var connectSucceededEvent = function connectSucceededEvent(_ref4) {
158
+ var definitionId = _ref4.definitionId,
159
+ extensionKey = _ref4.extensionKey,
160
+ destinationProduct = _ref4.destinationProduct,
161
+ destinationSubproduct = _ref4.destinationSubproduct,
162
+ location = _ref4.location;
126
163
  return {
127
164
  action: 'connectSucceeded',
128
165
  actionSubject: 'smartLink',
129
166
  eventType: 'operational',
130
- attributes: _objectSpread(_objectSpread(_objectSpread({}, context), definitionId ? {
131
- definitionId: definitionId
132
- } : {}), extensionKey ? {
133
- extensionKey: extensionKey
134
- } : {})
167
+ attributes: _objectSpread(_objectSpread({}, context), {}, {
168
+ definitionId: definitionId,
169
+ extensionKey: extensionKey,
170
+ destinationProduct: destinationProduct,
171
+ destinationSubproduct: destinationSubproduct,
172
+ location: location
173
+ })
135
174
  };
136
175
  };
137
- export var connectFailedEvent = function connectFailedEvent(definitionId, extensionKey, reason) {
176
+ export var connectFailedEvent = function connectFailedEvent(_ref5) {
177
+ var definitionId = _ref5.definitionId,
178
+ extensionKey = _ref5.extensionKey,
179
+ destinationProduct = _ref5.destinationProduct,
180
+ destinationSubproduct = _ref5.destinationSubproduct,
181
+ location = _ref5.location,
182
+ reason = _ref5.reason;
138
183
  return {
139
184
  action: 'connectFailed',
140
185
  actionSubject: 'smartLink',
141
186
  actionSubjectId: reason,
142
187
  eventType: 'operational',
143
- attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, context), reason ? {
144
- reason: reason
145
- } : {}), definitionId ? {
146
- definitionId: definitionId
147
- } : {}), extensionKey ? {
148
- extensionKey: extensionKey
149
- } : {})
188
+ attributes: _objectSpread(_objectSpread({}, context), {}, {
189
+ reason: reason,
190
+ extensionKey: extensionKey,
191
+ definitionId: definitionId,
192
+ destinationProduct: destinationProduct,
193
+ destinationSubproduct: destinationSubproduct,
194
+ location: location
195
+ })
150
196
  };
151
197
  };
152
- export var trackAppAccountConnected = function trackAppAccountConnected(definitionId, extensionKey) {
198
+ export var trackAppAccountConnected = function trackAppAccountConnected(_ref6) {
199
+ var definitionId = _ref6.definitionId,
200
+ extensionKey = _ref6.extensionKey,
201
+ destinationProduct = _ref6.destinationProduct,
202
+ destinationSubproduct = _ref6.destinationSubproduct,
203
+ location = _ref6.location;
153
204
  return {
154
205
  action: 'connected',
155
206
  actionSubject: 'applicationAccount',
156
207
  eventType: 'track',
157
- attributes: _objectSpread(_objectSpread(_objectSpread({}, context), definitionId ? {
158
- definitionId: definitionId
159
- } : {}), extensionKey ? {
160
- extensionKey: extensionKey
161
- } : {})
208
+ attributes: _objectSpread(_objectSpread({}, context), {}, {
209
+ definitionId: definitionId,
210
+ extensionKey: extensionKey,
211
+ destinationProduct: destinationProduct,
212
+ destinationSubproduct: destinationSubproduct,
213
+ location: location
214
+ })
162
215
  };
163
216
  };
164
- export var uiAuthEvent = function uiAuthEvent(display, definitionId, extensionKey) {
217
+ export var uiAuthEvent = function uiAuthEvent(_ref7) {
218
+ var definitionId = _ref7.definitionId,
219
+ extensionKey = _ref7.extensionKey,
220
+ destinationProduct = _ref7.destinationProduct,
221
+ destinationSubproduct = _ref7.destinationSubproduct,
222
+ location = _ref7.location,
223
+ display = _ref7.display;
165
224
  return {
166
225
  action: 'clicked',
167
226
  actionSubject: 'button',
168
227
  actionSubjectId: 'connectAccount',
169
228
  eventType: 'ui',
170
229
  attributes: _objectSpread(_objectSpread({}, context), {}, {
171
- definitionId: definitionId || '',
172
- extensionKey: extensionKey || '',
230
+ definitionId: definitionId,
231
+ extensionKey: extensionKey,
232
+ destinationProduct: destinationProduct,
233
+ destinationSubproduct: destinationSubproduct,
234
+ location: location,
173
235
  display: display
174
236
  })
175
237
  };
176
238
  };
177
- export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(display, definitionId, extensionKey) {
239
+ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref8) {
240
+ var definitionId = _ref8.definitionId,
241
+ extensionKey = _ref8.extensionKey,
242
+ destinationProduct = _ref8.destinationProduct,
243
+ destinationSubproduct = _ref8.destinationSubproduct,
244
+ location = _ref8.location,
245
+ display = _ref8.display;
178
246
  return {
179
247
  action: 'clicked',
180
248
  actionSubject: 'smartLink',
181
249
  actionSubjectId: 'tryAnotherAccount',
182
250
  eventType: 'ui',
183
251
  attributes: _objectSpread(_objectSpread({}, context), {}, {
184
- definitionId: definitionId || '',
185
- extensionKey: extensionKey || '',
252
+ definitionId: definitionId,
253
+ extensionKey: extensionKey,
254
+ destinationProduct: destinationProduct,
255
+ destinationSubproduct: destinationSubproduct,
256
+ location: location,
186
257
  display: display
187
258
  })
188
259
  };
189
260
  };
190
- export var uiCardClickedEvent = function uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId) {
261
+ export var uiCardClickedEvent = function uiCardClickedEvent(_ref9) {
262
+ var id = _ref9.id,
263
+ display = _ref9.display,
264
+ status = _ref9.status,
265
+ definitionId = _ref9.definitionId,
266
+ extensionKey = _ref9.extensionKey,
267
+ isModifierKeyPressed = _ref9.isModifierKeyPressed,
268
+ location = _ref9.location,
269
+ destinationProduct = _ref9.destinationProduct,
270
+ destinationSubproduct = _ref9.destinationSubproduct,
271
+ actionSubjectId = _ref9.actionSubjectId;
191
272
  return {
192
273
  action: 'clicked',
193
274
  actionSubject: 'smartLink',
@@ -196,8 +277,8 @@ export var uiCardClickedEvent = function uiCardClickedEvent(id, display, status,
196
277
  attributes: _objectSpread(_objectSpread({}, context), {}, {
197
278
  id: id,
198
279
  status: status,
199
- definitionId: definitionId || '',
200
- extensionKey: extensionKey || '',
280
+ definitionId: definitionId,
281
+ extensionKey: extensionKey,
201
282
  display: display,
202
283
  isModifierKeyPressed: isModifierKeyPressed,
203
284
  location: location,
@@ -206,7 +287,15 @@ export var uiCardClickedEvent = function uiCardClickedEvent(id, display, status,
206
287
  })
207
288
  };
208
289
  };
209
- export var uiActionClickedEvent = function uiActionClickedEvent(id, actionType, extensionKey, display) {
290
+ export var uiActionClickedEvent = function uiActionClickedEvent(_ref10) {
291
+ var id = _ref10.id,
292
+ actionType = _ref10.actionType,
293
+ extensionKey = _ref10.extensionKey,
294
+ display = _ref10.display,
295
+ definitionId = _ref10.definitionId,
296
+ destinationProduct = _ref10.destinationProduct,
297
+ destinationSubproduct = _ref10.destinationSubproduct,
298
+ location = _ref10.location;
210
299
  return {
211
300
  action: 'clicked',
212
301
  actionSubject: 'button',
@@ -215,47 +304,86 @@ export var uiActionClickedEvent = function uiActionClickedEvent(id, actionType,
215
304
  attributes: _objectSpread(_objectSpread({}, context), {}, {
216
305
  id: id,
217
306
  display: display,
218
- extensionKey: extensionKey || '',
219
- actionType: actionType
307
+ actionType: actionType,
308
+ extensionKey: extensionKey,
309
+ definitionId: definitionId,
310
+ destinationProduct: destinationProduct,
311
+ destinationSubproduct: destinationSubproduct,
312
+ location: location
220
313
  })
221
314
  };
222
315
  };
223
- export var uiClosedAuthEvent = function uiClosedAuthEvent(display, definitionId, extensionKey) {
316
+ export var uiClosedAuthEvent = function uiClosedAuthEvent(_ref11) {
317
+ var display = _ref11.display,
318
+ extensionKey = _ref11.extensionKey,
319
+ definitionId = _ref11.definitionId,
320
+ destinationProduct = _ref11.destinationProduct,
321
+ destinationSubproduct = _ref11.destinationSubproduct,
322
+ location = _ref11.location;
224
323
  return {
225
324
  action: 'closed',
226
325
  actionSubject: 'consentModal',
227
326
  eventType: 'ui',
228
327
  attributes: _objectSpread(_objectSpread({}, context), {}, {
229
- definitionId: definitionId || '',
230
- extensionKey: extensionKey || '',
328
+ extensionKey: extensionKey,
329
+ definitionId: definitionId,
330
+ destinationProduct: destinationProduct,
331
+ destinationSubproduct: destinationSubproduct,
332
+ location: location,
231
333
  display: display
232
334
  })
233
335
  };
234
336
  };
235
- export var screenAuthPopupEvent = function screenAuthPopupEvent(definitionId, extensionKey) {
337
+ export var screenAuthPopupEvent = function screenAuthPopupEvent(_ref12) {
338
+ var extensionKey = _ref12.extensionKey,
339
+ definitionId = _ref12.definitionId,
340
+ destinationProduct = _ref12.destinationProduct,
341
+ destinationSubproduct = _ref12.destinationSubproduct,
342
+ location = _ref12.location;
236
343
  return {
237
344
  actionSubject: 'consentModal',
238
345
  eventType: 'screen',
239
346
  attributes: _objectSpread(_objectSpread({}, context), {}, {
240
- definitionId: definitionId || '',
241
- extensionKey: extensionKey || ''
347
+ extensionKey: extensionKey,
348
+ definitionId: definitionId,
349
+ destinationProduct: destinationProduct,
350
+ destinationSubproduct: destinationSubproduct,
351
+ location: location
242
352
  })
243
353
  };
244
354
  };
245
- export var uiRenderSuccessEvent = function uiRenderSuccessEvent(display, status, definitionId, extensionKey) {
355
+ export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref13) {
356
+ var display = _ref13.display,
357
+ status = _ref13.status,
358
+ extensionKey = _ref13.extensionKey,
359
+ definitionId = _ref13.definitionId,
360
+ destinationProduct = _ref13.destinationProduct,
361
+ destinationSubproduct = _ref13.destinationSubproduct,
362
+ location = _ref13.location;
246
363
  return {
247
364
  action: 'renderSuccess',
248
365
  actionSubject: 'smartLink',
249
366
  eventType: 'ui',
250
367
  attributes: _objectSpread(_objectSpread({}, context), {}, {
251
368
  status: status,
252
- definitionId: definitionId || '',
253
- extensionKey: extensionKey || '',
369
+ extensionKey: extensionKey,
370
+ definitionId: definitionId,
371
+ destinationProduct: destinationProduct,
372
+ destinationSubproduct: destinationSubproduct,
373
+ location: location,
254
374
  display: display
255
375
  })
256
376
  };
257
377
  };
258
- export var uiRenderFailedEvent = function uiRenderFailedEvent(display, error, errorInfo) {
378
+ export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref14) {
379
+ var display = _ref14.display,
380
+ error = _ref14.error,
381
+ errorInfo = _ref14.errorInfo,
382
+ extensionKey = _ref14.extensionKey,
383
+ definitionId = _ref14.definitionId,
384
+ destinationProduct = _ref14.destinationProduct,
385
+ destinationSubproduct = _ref14.destinationSubproduct,
386
+ location = _ref14.location;
259
387
  return {
260
388
  actionSubject: 'smartLink',
261
389
  action: 'renderFailed',
@@ -263,40 +391,76 @@ export var uiRenderFailedEvent = function uiRenderFailedEvent(display, error, er
263
391
  attributes: {
264
392
  error: error,
265
393
  errorInfo: errorInfo,
266
- display: display
394
+ display: display,
395
+ extensionKey: extensionKey,
396
+ definitionId: definitionId,
397
+ destinationProduct: destinationProduct,
398
+ destinationSubproduct: destinationSubproduct,
399
+ location: location
267
400
  }
268
401
  };
269
402
  };
270
- export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(id, previewDisplay, definitionId, extensionKey, previewInvokeMethod) {
403
+ export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref15) {
404
+ var id = _ref15.id,
405
+ previewDisplay = _ref15.previewDisplay,
406
+ extensionKey = _ref15.extensionKey,
407
+ definitionId = _ref15.definitionId,
408
+ destinationProduct = _ref15.destinationProduct,
409
+ destinationSubproduct = _ref15.destinationSubproduct,
410
+ location = _ref15.location,
411
+ previewInvokeMethod = _ref15.previewInvokeMethod;
271
412
  return {
272
413
  action: 'viewed',
273
414
  actionSubject: 'hoverCard',
274
415
  eventType: 'ui',
275
416
  attributes: _objectSpread(_objectSpread({}, context), {}, {
276
417
  id: id,
277
- definitionId: definitionId || '',
278
- extensionKey: extensionKey || '',
279
418
  previewDisplay: previewDisplay,
419
+ extensionKey: extensionKey,
420
+ definitionId: definitionId,
421
+ destinationProduct: destinationProduct,
422
+ destinationSubproduct: destinationSubproduct,
423
+ location: location,
280
424
  previewInvokeMethod: previewInvokeMethod
281
425
  })
282
426
  };
283
427
  };
284
- export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(id, previewDisplay, hoverTime, definitionId, extensionKey, previewInvokeMethod) {
428
+ export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref16) {
429
+ var id = _ref16.id,
430
+ previewDisplay = _ref16.previewDisplay,
431
+ hoverTime = _ref16.hoverTime,
432
+ extensionKey = _ref16.extensionKey,
433
+ definitionId = _ref16.definitionId,
434
+ destinationProduct = _ref16.destinationProduct,
435
+ destinationSubproduct = _ref16.destinationSubproduct,
436
+ location = _ref16.location,
437
+ previewInvokeMethod = _ref16.previewInvokeMethod;
285
438
  return {
286
439
  action: 'dismissed',
287
440
  actionSubject: 'hoverCard',
288
441
  eventType: 'ui',
289
442
  attributes: _objectSpread(_objectSpread({}, context), {}, {
290
443
  id: id,
291
- definitionId: definitionId || '',
292
- extensionKey: extensionKey || '',
293
- hoverTime: hoverTime,
294
444
  previewDisplay: previewDisplay,
445
+ hoverTime: hoverTime,
446
+ extensionKey: extensionKey,
447
+ definitionId: definitionId,
448
+ destinationProduct: destinationProduct,
449
+ destinationSubproduct: destinationSubproduct,
450
+ location: location,
295
451
  previewInvokeMethod: previewInvokeMethod
296
452
  })
297
453
  };
298
454
  };
299
- export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(id, previewDisplay, definitionId, extensionKey, previewInvokeMethod) {
455
+ export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref17) {
456
+ var id = _ref17.id,
457
+ previewDisplay = _ref17.previewDisplay,
458
+ extensionKey = _ref17.extensionKey,
459
+ definitionId = _ref17.definitionId,
460
+ destinationProduct = _ref17.destinationProduct,
461
+ destinationSubproduct = _ref17.destinationSubproduct,
462
+ location = _ref17.location,
463
+ previewInvokeMethod = _ref17.previewInvokeMethod;
300
464
  return {
301
465
  action: 'clicked',
302
466
  actionSubject: 'button',
@@ -304,9 +468,12 @@ export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClicked
304
468
  eventType: 'ui',
305
469
  attributes: _objectSpread(_objectSpread({}, context), {}, {
306
470
  id: id,
307
- definitionId: definitionId || '',
308
- extensionKey: extensionKey || '',
309
471
  previewDisplay: previewDisplay,
472
+ extensionKey: extensionKey,
473
+ definitionId: definitionId,
474
+ destinationProduct: destinationProduct,
475
+ destinationSubproduct: destinationSubproduct,
476
+ location: location,
310
477
  previewInvokeMethod: previewInvokeMethod
311
478
  })
312
479
  };
@@ -4,16 +4,33 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
- import { resolvedEvent, unresolvedEvent } from './analytics';
8
7
  import { getMeasure } from '../performance';
8
+ import { resolvedEvent, unresolvedEvent } from './analytics';
9
9
  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';
10
- export var instrumentEvent = function instrumentEvent(id, status, definitionId, extensionKey, resourceType, error) {
10
+ export var instrumentEvent = function instrumentEvent(_ref) {
11
+ var id = _ref.id,
12
+ status = _ref.status,
13
+ extensionKey = _ref.extensionKey,
14
+ definitionId = _ref.definitionId,
15
+ resourceType = _ref.resourceType,
16
+ destinationProduct = _ref.destinationProduct,
17
+ destinationSubproduct = _ref.destinationSubproduct,
18
+ location = _ref.location,
19
+ error = _ref.error;
11
20
  var measure = getMeasure(id, status) || {
12
21
  duration: undefined
13
22
  };
14
23
 
15
24
  if (status === 'resolved') {
16
- var event = resolvedEvent(id, definitionId, extensionKey, resourceType);
25
+ var event = resolvedEvent({
26
+ id: id,
27
+ extensionKey: extensionKey,
28
+ definitionId: definitionId,
29
+ resourceType: resourceType,
30
+ destinationProduct: destinationProduct,
31
+ destinationSubproduct: destinationSubproduct,
32
+ location: location
33
+ });
17
34
  return _objectSpread(_objectSpread({}, event), {}, {
18
35
  attributes: _objectSpread(_objectSpread({}, event.attributes), {}, {
19
36
  duration: measure.duration
@@ -21,7 +38,17 @@ export var instrumentEvent = function instrumentEvent(id, status, definitionId,
21
38
  });
22
39
  } else {
23
40
  if ((error === null || error === void 0 ? void 0 : error.type) !== 'ResolveUnsupportedError') {
24
- var _event = unresolvedEvent(id, status, definitionId, extensionKey, resourceType, error);
41
+ var _event = unresolvedEvent({
42
+ id: id,
43
+ status: status,
44
+ extensionKey: extensionKey,
45
+ definitionId: definitionId,
46
+ resourceType: resourceType,
47
+ destinationProduct: destinationProduct,
48
+ destinationSubproduct: destinationSubproduct,
49
+ location: location,
50
+ error: error
51
+ });
25
52
 
26
53
  return _objectSpread(_objectSpread({}, _event), {}, {
27
54
  attributes: _objectSpread(_objectSpread({}, _event.attributes), {}, {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "21.3.0",
3
+ "version": "22.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -63,7 +63,16 @@ export function CardWithUrlContent(_ref) {
63
63
  }, [state.details, url]);
64
64
  var handleClickWrapper = useCallback(function (event) {
65
65
  var isModifierKeyPressed = isSpecialEvent(event);
66
- analytics.ui.cardClickedEvent(id, isFlexibleUi ? 'flexible' : appearance, state.status, definitionId, extensionKey, isModifierKeyPressed, undefined, product, subproduct);
66
+ analytics.ui.cardClickedEvent({
67
+ id: id,
68
+ display: isFlexibleUi ? 'flexible' : appearance,
69
+ status: state.status,
70
+ definitionId: definitionId,
71
+ extensionKey: extensionKey,
72
+ isModifierKeyPressed: isModifierKeyPressed,
73
+ destinationProduct: product,
74
+ destinationSubproduct: subproduct
75
+ });
67
76
 
68
77
  if (onClick) {
69
78
  onClick(event);
@@ -87,7 +96,14 @@ export function CardWithUrlContent(_ref) {
87
96
 
88
97
  if (state.status !== 'pending') {
89
98
  measure.create(id, state.status);
90
- analytics.operational.instrument(id, state.status, definitionId, extensionKey, resourceType, state.error);
99
+ analytics.operational.instrument({
100
+ id: id,
101
+ status: state.status,
102
+ definitionId: definitionId,
103
+ extensionKey: extensionKey,
104
+ resourceType: resourceType,
105
+ error: state.error
106
+ });
91
107
  }
92
108
  }, [id, appearance, state.status, state.error, definitionId, extensionKey, resourceType, analytics.operational]); // NB: once the smart-card has rendered into an end state, we capture
93
109
  // this as a successful render. These can be one of:
@@ -96,7 +112,13 @@ export function CardWithUrlContent(_ref) {
96
112
 
97
113
  useEffect(function () {
98
114
  if (isFinalState(state.status)) {
99
- analytics.ui.renderSuccessEvent(appearance, state.status, id, definitionId, extensionKey);
115
+ analytics.ui.renderSuccessEvent({
116
+ display: appearance,
117
+ status: state.status,
118
+ id: id,
119
+ definitionId: definitionId,
120
+ extensionKey: extensionKey
121
+ });
100
122
  }
101
123
  }, [appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
102
124
 
@@ -72,7 +72,12 @@ export function CardWithURLRenderer(props) {
72
72
  var errorInfo = {
73
73
  componentStack: componentStack
74
74
  };
75
- analytics.ui.renderFailedEvent(appearance, id, error, errorInfo);
75
+ analytics.ui.renderFailedEvent({
76
+ display: appearance,
77
+ id: id,
78
+ error: error,
79
+ errorInfo: errorInfo
80
+ });
76
81
  }
77
82
  }, [analytics.ui, appearance, id]);
78
83
 
@@ -48,7 +48,11 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
48
48
  //Check its previously open to avoid firing events when moving between the child and hover card components
49
49
  if (isOpen === true && cardOpenTime.current) {
50
50
  var hoverTime = Date.now() - cardOpenTime.current;
51
- analytics.ui.hoverCardDismissedEvent('card', hoverTime, 'mouse_hover');
51
+ analytics.ui.hoverCardDismissedEvent({
52
+ previewDisplay: 'card',
53
+ hoverTime: hoverTime,
54
+ previewInvokeMethod: 'mouse_hover'
55
+ });
52
56
  }
53
57
 
54
58
  setIsOpen(false);
@@ -73,7 +77,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
73
77
  //Check if its previously closed to avoid firing events when moving between the child and hover card components
74
78
  if (isOpen === false) {
75
79
  cardOpenTime.current = Date.now();
76
- analytics.ui.hoverCardViewedEvent(hoverDisplay, invokeMethod);
80
+ analytics.ui.hoverCardViewedEvent({
81
+ previewDisplay: hoverDisplay,
82
+ previewInvokeMethod: invokeMethod
83
+ });
77
84
  } //If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
78
85
 
79
86