@atlaskit/smart-card 26.12.1 → 26.13.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 (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/messages.js +21 -1
  3. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +8 -0
  4. package/dist/cjs/utils/analytics/analytics.js +139 -125
  5. package/dist/cjs/version.json +1 -1
  6. package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -5
  7. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +31 -18
  8. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +6 -1
  9. package/dist/es2019/messages.js +21 -1
  10. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +8 -1
  11. package/dist/es2019/utils/analytics/analytics.js +13 -0
  12. package/dist/es2019/version.json +1 -1
  13. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +13 -5
  14. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +33 -20
  15. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -1
  16. package/dist/esm/messages.js +21 -1
  17. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +9 -1
  18. package/dist/esm/utils/analytics/analytics.js +130 -117
  19. package/dist/esm/version.json +1 -1
  20. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -5
  21. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +33 -20
  22. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +6 -1
  23. package/dist/types/messages.d.ts +1 -1
  24. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +4 -0
  25. package/dist/types/state/flexible-ui-context/index.d.ts +2 -0
  26. package/dist/types/state/hooks/useSmartLink.d.ts +1 -0
  27. package/dist/types/utils/analytics/analytics.d.ts +1 -0
  28. package/dist/types/utils/mocks.d.ts +1 -0
  29. package/dist/types-ts4.5/messages.d.ts +1 -1
  30. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +4 -0
  31. package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +2 -0
  32. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +1 -0
  33. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -0
  34. package/dist/types-ts4.5/utils/mocks.d.ts +1 -0
  35. package/package.json +2 -2
  36. package/report.api.md +1 -0
  37. package/tmp/api-report-tmp.d.ts +1 -0
@@ -4,7 +4,8 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
5
5
  var _excluded = ["smartLinkActionType"],
6
6
  _excluded2 = ["smartLinkActionType"],
7
- _excluded3 = ["smartLinkActionType"];
7
+ _excluded3 = ["smartLinkActionType"],
8
+ _excluded4 = ["display"];
8
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
10
  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; }
10
11
  import { name as packageName, version as packageVersion } from '../../version.json';
@@ -273,29 +274,19 @@ export var trackSmartLinkQuickActionFailed = function trackSmartLinkQuickActionF
273
274
  })
274
275
  };
275
276
  };
276
- export var uiAuthEvent = function uiAuthEvent(_ref11) {
277
- var definitionId = _ref11.definitionId,
278
- extensionKey = _ref11.extensionKey,
279
- destinationProduct = _ref11.destinationProduct,
280
- destinationSubproduct = _ref11.destinationSubproduct,
281
- location = _ref11.location,
282
- display = _ref11.display;
277
+ export var trackHoverCardResolutionStarted = function trackHoverCardResolutionStarted(_ref11) {
278
+ var display = _ref11.display,
279
+ attributes = _objectWithoutProperties(_ref11, _excluded4);
283
280
  return {
284
- action: 'clicked',
285
- actionSubject: 'button',
286
- actionSubjectId: 'connectAccount',
287
- eventType: 'ui',
288
- attributes: _objectSpread(_objectSpread({}, context), {}, {
289
- definitionId: definitionId,
290
- extensionKey: extensionKey,
291
- destinationProduct: destinationProduct,
292
- destinationSubproduct: destinationSubproduct,
293
- location: location,
281
+ action: 'resolved',
282
+ actionSubject: 'hoverCard',
283
+ eventType: 'track',
284
+ attributes: _objectSpread(_objectSpread(_objectSpread({}, context), attributes), {}, {
294
285
  display: display
295
286
  })
296
287
  };
297
288
  };
298
- export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref12) {
289
+ export var uiAuthEvent = function uiAuthEvent(_ref12) {
299
290
  var definitionId = _ref12.definitionId,
300
291
  extensionKey = _ref12.extensionKey,
301
292
  destinationProduct = _ref12.destinationProduct,
@@ -304,8 +295,8 @@ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_r
304
295
  display = _ref12.display;
305
296
  return {
306
297
  action: 'clicked',
307
- actionSubject: 'smartLink',
308
- actionSubjectId: 'tryAnotherAccount',
298
+ actionSubject: 'button',
299
+ actionSubjectId: 'connectAccount',
309
300
  eventType: 'ui',
310
301
  attributes: _objectSpread(_objectSpread({}, context), {}, {
311
302
  definitionId: definitionId,
@@ -317,49 +308,43 @@ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_r
317
308
  })
318
309
  };
319
310
  };
320
- export var uiCardClickedEvent = function uiCardClickedEvent(_ref13) {
321
- var id = _ref13.id,
322
- display = _ref13.display,
323
- status = _ref13.status,
324
- definitionId = _ref13.definitionId,
311
+ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref13) {
312
+ var definitionId = _ref13.definitionId,
325
313
  extensionKey = _ref13.extensionKey,
326
- isModifierKeyPressed = _ref13.isModifierKeyPressed,
327
- location = _ref13.location,
328
314
  destinationProduct = _ref13.destinationProduct,
329
315
  destinationSubproduct = _ref13.destinationSubproduct,
330
- actionSubjectId = _ref13.actionSubjectId;
316
+ location = _ref13.location,
317
+ display = _ref13.display;
331
318
  return {
332
319
  action: 'clicked',
333
320
  actionSubject: 'smartLink',
334
- actionSubjectId: actionSubjectId,
321
+ actionSubjectId: 'tryAnotherAccount',
335
322
  eventType: 'ui',
336
323
  attributes: _objectSpread(_objectSpread({}, context), {}, {
337
- id: id,
338
- status: status,
339
324
  definitionId: definitionId,
340
325
  extensionKey: extensionKey,
341
- display: display,
342
- isModifierKeyPressed: isModifierKeyPressed,
343
- location: location,
344
326
  destinationProduct: destinationProduct,
345
- destinationSubproduct: destinationSubproduct
327
+ destinationSubproduct: destinationSubproduct,
328
+ location: location,
329
+ display: display
346
330
  })
347
331
  };
348
332
  };
349
- export var uiIframeDwelledEvent = function uiIframeDwelledEvent(_ref14) {
333
+ export var uiCardClickedEvent = function uiCardClickedEvent(_ref14) {
350
334
  var id = _ref14.id,
351
335
  display = _ref14.display,
352
336
  status = _ref14.status,
353
337
  definitionId = _ref14.definitionId,
354
338
  extensionKey = _ref14.extensionKey,
339
+ isModifierKeyPressed = _ref14.isModifierKeyPressed,
355
340
  location = _ref14.location,
356
341
  destinationProduct = _ref14.destinationProduct,
357
342
  destinationSubproduct = _ref14.destinationSubproduct,
358
- dwellTime = _ref14.dwellTime,
359
- dwellPercentVisible = _ref14.dwellPercentVisible;
343
+ actionSubjectId = _ref14.actionSubjectId;
360
344
  return {
361
- action: 'dwelled',
362
- actionSubject: 'smartLinkIframe',
345
+ action: 'clicked',
346
+ actionSubject: 'smartLink',
347
+ actionSubjectId: actionSubjectId,
363
348
  eventType: 'ui',
364
349
  attributes: _objectSpread(_objectSpread({}, context), {}, {
365
350
  id: id,
@@ -367,15 +352,14 @@ export var uiIframeDwelledEvent = function uiIframeDwelledEvent(_ref14) {
367
352
  definitionId: definitionId,
368
353
  extensionKey: extensionKey,
369
354
  display: display,
355
+ isModifierKeyPressed: isModifierKeyPressed,
370
356
  location: location,
371
357
  destinationProduct: destinationProduct,
372
- destinationSubproduct: destinationSubproduct,
373
- dwellTime: dwellTime,
374
- dwellPercentVisible: dwellPercentVisible
358
+ destinationSubproduct: destinationSubproduct
375
359
  })
376
360
  };
377
361
  };
378
- export var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref15) {
362
+ export var uiIframeDwelledEvent = function uiIframeDwelledEvent(_ref15) {
379
363
  var id = _ref15.id,
380
364
  display = _ref15.display,
381
365
  status = _ref15.status,
@@ -383,9 +367,11 @@ export var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref15) {
383
367
  extensionKey = _ref15.extensionKey,
384
368
  location = _ref15.location,
385
369
  destinationProduct = _ref15.destinationProduct,
386
- destinationSubproduct = _ref15.destinationSubproduct;
370
+ destinationSubproduct = _ref15.destinationSubproduct,
371
+ dwellTime = _ref15.dwellTime,
372
+ dwellPercentVisible = _ref15.dwellPercentVisible;
387
373
  return {
388
- action: 'focused',
374
+ action: 'dwelled',
389
375
  actionSubject: 'smartLinkIframe',
390
376
  eventType: 'ui',
391
377
  attributes: _objectSpread(_objectSpread({}, context), {}, {
@@ -396,154 +382,153 @@ export var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref15) {
396
382
  display: display,
397
383
  location: location,
398
384
  destinationProduct: destinationProduct,
399
- destinationSubproduct: destinationSubproduct
385
+ destinationSubproduct: destinationSubproduct,
386
+ dwellTime: dwellTime,
387
+ dwellPercentVisible: dwellPercentVisible
400
388
  })
401
389
  };
402
390
  };
403
- export var uiActionClickedEvent = function uiActionClickedEvent(_ref16) {
391
+ export var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref16) {
404
392
  var id = _ref16.id,
405
- actionType = _ref16.actionType,
406
- extensionKey = _ref16.extensionKey,
407
393
  display = _ref16.display,
394
+ status = _ref16.status,
408
395
  definitionId = _ref16.definitionId,
396
+ extensionKey = _ref16.extensionKey,
397
+ location = _ref16.location,
409
398
  destinationProduct = _ref16.destinationProduct,
410
- destinationSubproduct = _ref16.destinationSubproduct,
411
- location = _ref16.location;
399
+ destinationSubproduct = _ref16.destinationSubproduct;
412
400
  return {
413
- action: 'clicked',
414
- actionSubject: 'button',
415
- actionSubjectId: uiActionSubjectIds[actionType],
401
+ action: 'focused',
402
+ actionSubject: 'smartLinkIframe',
416
403
  eventType: 'ui',
417
404
  attributes: _objectSpread(_objectSpread({}, context), {}, {
418
405
  id: id,
419
- display: display,
420
- actionType: actionType,
421
- extensionKey: extensionKey,
406
+ status: status,
422
407
  definitionId: definitionId,
408
+ extensionKey: extensionKey,
409
+ display: display,
410
+ location: location,
423
411
  destinationProduct: destinationProduct,
424
- destinationSubproduct: destinationSubproduct,
425
- location: location
412
+ destinationSubproduct: destinationSubproduct
426
413
  })
427
414
  };
428
415
  };
429
- export var uiClosedAuthEvent = function uiClosedAuthEvent(_ref17) {
430
- var display = _ref17.display,
416
+ export var uiActionClickedEvent = function uiActionClickedEvent(_ref17) {
417
+ var id = _ref17.id,
418
+ actionType = _ref17.actionType,
431
419
  extensionKey = _ref17.extensionKey,
420
+ display = _ref17.display,
432
421
  definitionId = _ref17.definitionId,
433
422
  destinationProduct = _ref17.destinationProduct,
434
423
  destinationSubproduct = _ref17.destinationSubproduct,
435
424
  location = _ref17.location;
436
425
  return {
437
- action: 'closed',
438
- actionSubject: 'consentModal',
426
+ action: 'clicked',
427
+ actionSubject: 'button',
428
+ actionSubjectId: uiActionSubjectIds[actionType],
439
429
  eventType: 'ui',
440
430
  attributes: _objectSpread(_objectSpread({}, context), {}, {
431
+ id: id,
432
+ display: display,
433
+ actionType: actionType,
441
434
  extensionKey: extensionKey,
442
435
  definitionId: definitionId,
443
436
  destinationProduct: destinationProduct,
444
437
  destinationSubproduct: destinationSubproduct,
445
- location: location,
446
- display: display
438
+ location: location
447
439
  })
448
440
  };
449
441
  };
450
- export var screenAuthPopupEvent = function screenAuthPopupEvent(_ref18) {
451
- var extensionKey = _ref18.extensionKey,
442
+ export var uiClosedAuthEvent = function uiClosedAuthEvent(_ref18) {
443
+ var display = _ref18.display,
444
+ extensionKey = _ref18.extensionKey,
452
445
  definitionId = _ref18.definitionId,
453
446
  destinationProduct = _ref18.destinationProduct,
454
447
  destinationSubproduct = _ref18.destinationSubproduct,
455
448
  location = _ref18.location;
456
449
  return {
450
+ action: 'closed',
457
451
  actionSubject: 'consentModal',
458
- eventType: 'screen',
452
+ eventType: 'ui',
459
453
  attributes: _objectSpread(_objectSpread({}, context), {}, {
460
454
  extensionKey: extensionKey,
461
455
  definitionId: definitionId,
462
456
  destinationProduct: destinationProduct,
463
457
  destinationSubproduct: destinationSubproduct,
464
- location: location
458
+ location: location,
459
+ display: display
465
460
  })
466
461
  };
467
462
  };
468
- export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref19) {
469
- var display = _ref19.display,
470
- status = _ref19.status,
471
- extensionKey = _ref19.extensionKey,
463
+ export var screenAuthPopupEvent = function screenAuthPopupEvent(_ref19) {
464
+ var extensionKey = _ref19.extensionKey,
472
465
  definitionId = _ref19.definitionId,
473
466
  destinationProduct = _ref19.destinationProduct,
474
467
  destinationSubproduct = _ref19.destinationSubproduct,
475
468
  location = _ref19.location;
476
469
  return {
477
- action: 'renderSuccess',
478
- actionSubject: 'smartLink',
479
- eventType: 'ui',
470
+ actionSubject: 'consentModal',
471
+ eventType: 'screen',
480
472
  attributes: _objectSpread(_objectSpread({}, context), {}, {
481
- status: status,
482
473
  extensionKey: extensionKey,
483
474
  definitionId: definitionId,
484
475
  destinationProduct: destinationProduct,
485
476
  destinationSubproduct: destinationSubproduct,
486
- location: location,
487
- display: display
477
+ location: location
488
478
  })
489
479
  };
490
480
  };
491
- export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref20) {
481
+ export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref20) {
492
482
  var display = _ref20.display,
493
- error = _ref20.error,
494
- errorInfo = _ref20.errorInfo,
483
+ status = _ref20.status,
495
484
  extensionKey = _ref20.extensionKey,
496
485
  definitionId = _ref20.definitionId,
497
486
  destinationProduct = _ref20.destinationProduct,
498
487
  destinationSubproduct = _ref20.destinationSubproduct,
499
488
  location = _ref20.location;
500
489
  return {
490
+ action: 'renderSuccess',
501
491
  actionSubject: 'smartLink',
502
- action: 'renderFailed',
503
492
  eventType: 'ui',
504
493
  attributes: _objectSpread(_objectSpread({}, context), {}, {
505
- error: error,
506
- errorInfo: errorInfo,
507
- display: display,
494
+ status: status,
508
495
  extensionKey: extensionKey,
509
496
  definitionId: definitionId,
510
497
  destinationProduct: destinationProduct,
511
498
  destinationSubproduct: destinationSubproduct,
512
- location: location
499
+ location: location,
500
+ display: display
513
501
  })
514
502
  };
515
503
  };
516
- export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref21) {
517
- var id = _ref21.id,
518
- previewDisplay = _ref21.previewDisplay,
504
+ export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref21) {
505
+ var display = _ref21.display,
506
+ error = _ref21.error,
507
+ errorInfo = _ref21.errorInfo,
519
508
  extensionKey = _ref21.extensionKey,
520
509
  definitionId = _ref21.definitionId,
521
510
  destinationProduct = _ref21.destinationProduct,
522
511
  destinationSubproduct = _ref21.destinationSubproduct,
523
- location = _ref21.location,
524
- previewInvokeMethod = _ref21.previewInvokeMethod,
525
- status = _ref21.status;
512
+ location = _ref21.location;
526
513
  return {
527
- action: 'viewed',
528
- actionSubject: 'hoverCard',
514
+ actionSubject: 'smartLink',
515
+ action: 'renderFailed',
529
516
  eventType: 'ui',
530
517
  attributes: _objectSpread(_objectSpread({}, context), {}, {
531
- id: id,
532
- previewDisplay: previewDisplay,
518
+ error: error,
519
+ errorInfo: errorInfo,
520
+ display: display,
533
521
  extensionKey: extensionKey,
534
522
  definitionId: definitionId,
535
523
  destinationProduct: destinationProduct,
536
524
  destinationSubproduct: destinationSubproduct,
537
- location: location,
538
- previewInvokeMethod: previewInvokeMethod,
539
- status: status
525
+ location: location
540
526
  })
541
527
  };
542
528
  };
543
- export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref22) {
529
+ export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref22) {
544
530
  var id = _ref22.id,
545
531
  previewDisplay = _ref22.previewDisplay,
546
- hoverTime = _ref22.hoverTime,
547
532
  extensionKey = _ref22.extensionKey,
548
533
  definitionId = _ref22.definitionId,
549
534
  destinationProduct = _ref22.destinationProduct,
@@ -552,13 +537,12 @@ export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref22
552
537
  previewInvokeMethod = _ref22.previewInvokeMethod,
553
538
  status = _ref22.status;
554
539
  return {
555
- action: 'dismissed',
540
+ action: 'viewed',
556
541
  actionSubject: 'hoverCard',
557
542
  eventType: 'ui',
558
543
  attributes: _objectSpread(_objectSpread({}, context), {}, {
559
544
  id: id,
560
545
  previewDisplay: previewDisplay,
561
- hoverTime: hoverTime,
562
546
  extensionKey: extensionKey,
563
547
  definitionId: definitionId,
564
548
  destinationProduct: destinationProduct,
@@ -569,15 +553,44 @@ export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref22
569
553
  })
570
554
  };
571
555
  };
572
- export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref23) {
556
+ export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref23) {
573
557
  var id = _ref23.id,
574
558
  previewDisplay = _ref23.previewDisplay,
559
+ hoverTime = _ref23.hoverTime,
575
560
  extensionKey = _ref23.extensionKey,
576
561
  definitionId = _ref23.definitionId,
577
562
  destinationProduct = _ref23.destinationProduct,
578
563
  destinationSubproduct = _ref23.destinationSubproduct,
579
564
  location = _ref23.location,
580
- previewInvokeMethod = _ref23.previewInvokeMethod;
565
+ previewInvokeMethod = _ref23.previewInvokeMethod,
566
+ status = _ref23.status;
567
+ return {
568
+ action: 'dismissed',
569
+ actionSubject: 'hoverCard',
570
+ eventType: 'ui',
571
+ attributes: _objectSpread(_objectSpread({}, context), {}, {
572
+ id: id,
573
+ previewDisplay: previewDisplay,
574
+ hoverTime: hoverTime,
575
+ extensionKey: extensionKey,
576
+ definitionId: definitionId,
577
+ destinationProduct: destinationProduct,
578
+ destinationSubproduct: destinationSubproduct,
579
+ location: location,
580
+ previewInvokeMethod: previewInvokeMethod,
581
+ status: status
582
+ })
583
+ };
584
+ };
585
+ export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref24) {
586
+ var id = _ref24.id,
587
+ previewDisplay = _ref24.previewDisplay,
588
+ extensionKey = _ref24.extensionKey,
589
+ definitionId = _ref24.definitionId,
590
+ destinationProduct = _ref24.destinationProduct,
591
+ destinationSubproduct = _ref24.destinationSubproduct,
592
+ location = _ref24.location,
593
+ previewInvokeMethod = _ref24.previewInvokeMethod;
581
594
  return {
582
595
  action: 'clicked',
583
596
  actionSubject: 'button',
@@ -604,15 +617,15 @@ export var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent()
604
617
  attributes: _objectSpread({}, context)
605
618
  };
606
619
  };
607
- export var chunkloadFailedEvent = function chunkloadFailedEvent(_ref24) {
608
- var display = _ref24.display,
609
- error = _ref24.error,
610
- errorInfo = _ref24.errorInfo,
611
- extensionKey = _ref24.extensionKey,
612
- definitionId = _ref24.definitionId,
613
- destinationProduct = _ref24.destinationProduct,
614
- destinationSubproduct = _ref24.destinationSubproduct,
615
- location = _ref24.location;
620
+ export var chunkloadFailedEvent = function chunkloadFailedEvent(_ref25) {
621
+ var display = _ref25.display,
622
+ error = _ref25.error,
623
+ errorInfo = _ref25.errorInfo,
624
+ extensionKey = _ref25.extensionKey,
625
+ definitionId = _ref25.definitionId,
626
+ destinationProduct = _ref25.destinationProduct,
627
+ destinationSubproduct = _ref25.destinationSubproduct,
628
+ location = _ref25.location;
616
629
  return {
617
630
  action: 'chunkLoadFailed',
618
631
  actionSubject: 'smartLink',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.12.1",
3
+ "version": "26.13.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,8 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
3
  var _templateObject;
3
4
  import React, { useCallback, useMemo } from 'react';
5
+ import { FormattedMessage } from 'react-intl-next';
4
6
  import FlexibleCard from '../../../FlexibleCard';
5
7
  import { AuthorizeAction } from '../../actions/flexible/AuthorizeAction';
6
8
  import BlockCardFooter from '../../components/flexible/footer';
@@ -10,6 +12,7 @@ import { extractProvider } from '@atlaskit/link-extractors';
10
12
  import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
11
13
  import { css } from '@emotion/react';
12
14
  import { tokens } from '../../../../utils/token';
15
+ import { messages } from '../../../../messages';
13
16
  var contentStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n margin-top: 0.5rem;\n font-size: 0.75rem;\n"])), tokens.text);
14
17
 
15
18
  /**
@@ -43,6 +46,17 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
43
46
  onAuthorize();
44
47
  }
45
48
  }, [onAuthorize, extensionKey, analytics.track]);
49
+ var content = useMemo(function () {
50
+ return onAuthorize ? /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
51
+ providerName: providerName,
52
+ analytics: analytics,
53
+ testId: testId
54
+ }) : /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
55
+ values: {
56
+ context: providerName
57
+ }
58
+ }));
59
+ }, [analytics, onAuthorize, providerName, testId]);
46
60
  var actions = useMemo(function () {
47
61
  return onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [];
48
62
  }, [handleAuthorize, onAuthorize, providerName]);
@@ -61,11 +75,7 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
61
75
  }), /*#__PURE__*/React.createElement(CustomBlock, {
62
76
  overrideCss: contentStyles,
63
77
  testId: "".concat(testId, "-content")
64
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
65
- providerName: providerName,
66
- analytics: analytics,
67
- testId: testId
68
- }))), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
78
+ }, /*#__PURE__*/React.createElement("div", null, content)), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
69
79
  actions: actions,
70
80
  status: SmartLinkStatus.Unauthorized,
71
81
  actionGroupAppearance: "primary"
@@ -1,11 +1,10 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import { EmbedCardUnresolvedView } from './UnresolvedView';
3
- import { UnauthorisedImage } from '../constants';
3
+ import { LockImage, UnauthorisedImage } from '../constants';
4
4
  import { ExpandedFrame } from '../components/ExpandedFrame';
5
5
  import { ImageIcon } from '../components/ImageIcon';
6
6
  import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
7
7
  export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
8
- var _context$image;
9
8
  var analytics = _ref.analytics,
10
9
  link = _ref.link,
11
10
  context = _ref.context,
@@ -27,6 +26,36 @@ export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref)
27
26
  onAuthorise();
28
27
  }
29
28
  }, [onAuthorise, analytics.track, extensionKey]);
29
+ var view = useMemo(function () {
30
+ var _context$image2;
31
+ if (onAuthorise) {
32
+ var _context$image;
33
+ return /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
34
+ button: {
35
+ appearance: 'primary',
36
+ text: 'connect_unauthorised_account_action',
37
+ testId: 'connect-account'
38
+ },
39
+ context: context && context.text,
40
+ description: "connect_unauthorised_account_description",
41
+ image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : UnauthorisedImage,
42
+ onClick: handleOnAuthorizeClick,
43
+ testId: testId,
44
+ title: "connect_link_account_card_name"
45
+ }, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
46
+ analytics: analytics,
47
+ providerName: context === null || context === void 0 ? void 0 : context.text,
48
+ testId: testId
49
+ }));
50
+ }
51
+ return /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
52
+ description: context !== null && context !== void 0 && context.text ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider',
53
+ image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 : LockImage,
54
+ context: context === null || context === void 0 ? void 0 : context.text,
55
+ testId: testId,
56
+ title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
57
+ });
58
+ }, [analytics, context, handleOnAuthorizeClick, onAuthorise, testId]);
30
59
  return /*#__PURE__*/React.createElement(ExpandedFrame, {
31
60
  href: link,
32
61
  icon: icon,
@@ -37,21 +66,5 @@ export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref)
37
66
  onClick: onClick,
38
67
  testId: testId,
39
68
  allowScrollBar: true
40
- }, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
41
- image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : UnauthorisedImage,
42
- title: "connect_link_account_card_name",
43
- description: "connect_unauthorised_account_description",
44
- context: context && context.text,
45
- button: onAuthorise ? {
46
- appearance: 'primary',
47
- text: 'connect_unauthorised_account_action',
48
- testId: 'connect-account'
49
- } : undefined,
50
- onClick: onAuthorise ? handleOnAuthorizeClick : undefined,
51
- testId: testId
52
- }, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
53
- analytics: analytics,
54
- providerName: context === null || context === void 0 ? void 0 : context.text,
55
- testId: testId
56
- })));
69
+ }, view);
57
70
  };
@@ -13,6 +13,7 @@ import { CardDisplay } from '../../../constants';
13
13
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
14
14
  import { useSmartCardActions } from '../../../state/actions';
15
15
  import { useSmartLinkAnalytics } from '../../../state/analytics';
16
+ import { useFeatureFlag } from '@atlaskit/link-provider';
16
17
  var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
17
18
  var FADE_IN_DELAY = 500;
18
19
  var FADE_OUT_DELAY = 300;
@@ -50,6 +51,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
50
51
  var analytics = useSmartLinkAnalytics(url, undefined, id);
51
52
  var _useSmartCardActions = useSmartCardActions(id, url, analytics),
52
53
  loadMetadata = _useSmartCardActions.loadMetadata;
54
+ var enableHoverCardResolutionTracking = useFeatureFlag('enableHoverCardResolutionTracking');
53
55
  var setMousePosition = useCallback(function (event) {
54
56
  if (isOpen && canOpen) {
55
57
  return;
@@ -118,9 +120,12 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
118
120
  if (!resolveTimeOutId.current && isLinkUnresolved) {
119
121
  resolveTimeOutId.current = setTimeout(function () {
120
122
  loadMetadata();
123
+ if (enableHoverCardResolutionTracking) {
124
+ analytics.track.hoverCardResolutionStarted();
125
+ }
121
126
  }, RESOLVE_DELAY);
122
127
  }
123
- }, [linkState, loadMetadata]);
128
+ }, [analytics.track, enableHoverCardResolutionTracking, linkState.metadataStatus, linkState.status, loadMetadata]);
124
129
  var initShowCard = useCallback(function (event) {
125
130
  // clearing out fadeOutTimeoutId in case it's already counting down to hide the card
126
131
  if (fadeOutTimeoutId.current) {
@@ -1,6 +1,6 @@
1
1
  import { MessageDescriptor } from 'react-intl-next';
2
2
  export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
3
- export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
3
+ export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
4
4
  type Messages = {
5
5
  [K in MessageKey]: MessageDescriptor;
6
6
  };
@@ -267,6 +267,10 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
267
267
  reason?: TrackQuickActionFailureReason;
268
268
  step?: string;
269
269
  }) => void;
270
+ /**
271
+ * Fires a track event when we call loadMetadata() to get information for a hover card
272
+ */
273
+ hoverCardResolutionStarted: () => void;
270
274
  };
271
275
  screen: {
272
276
  /**
@@ -61,6 +61,7 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
61
61
  reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
62
62
  step?: string | undefined;
63
63
  }) => void;
64
+ hoverCardResolutionStarted: () => void;
64
65
  };
65
66
  screen: {
66
67
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
@@ -119,6 +120,7 @@ export declare const useFlexibleUiAnalyticsContext: () => {
119
120
  reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
120
121
  step?: string | undefined;
121
122
  }) => void;
123
+ hoverCardResolutionStarted: () => void;
122
124
  };
123
125
  screen: {
124
126
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
@@ -64,6 +64,7 @@ dispatchAnalytics?: AnalyticsHandler): {
64
64
  reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
65
65
  step?: string | undefined;
66
66
  }) => void;
67
+ hoverCardResolutionStarted: () => void;
67
68
  };
68
69
  screen: {
69
70
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;