@atlaskit/smart-card 26.12.1 → 26.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d2ef5ede462`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d2ef5ede462) - Added a new analytics event that will fire on resolution of data for hover cards. The change is behind a FF and will only surface if we pass the FF as true to SmartCardProvider.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 26.12.1
4
14
 
5
15
  ### Patch Changes
@@ -776,6 +776,14 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatchAnalyti
776
776
  */
777
777
  smartLinkQuickActionFailed: function smartLinkQuickActionFailed(props) {
778
778
  return dispatchAnalytics(applyCommonAttributes((0, _analytics2.trackSmartLinkQuickActionFailed)(_objectSpread(_objectSpread({}, commonAttributes), props)), commonAttributes));
779
+ },
780
+ /**
781
+ * Fires a track event when we call loadMetadata() to get information for a hover card
782
+ */
783
+ hoverCardResolutionStarted: function hoverCardResolutionStarted() {
784
+ return dispatchAnalytics(applyCommonAttributes((0, _analytics2.trackHoverCardResolutionStarted)(_objectSpread({
785
+ display: 'hoverCardPreview'
786
+ }, commonAttributes)), commonAttributes));
779
787
  }
780
788
  };
781
789
  }, [commonAttributes, dispatchAnalytics]);
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.unresolvedEvent = exports.uiSmartLinkStatusOpenPreviewButtonClicked = exports.uiSmartLinkStatusLozengeButtonClicked = exports.uiSmartLinkStatusListItemButtonClicked = exports.uiRenderSuccessEvent = exports.uiRenderFailedEvent = exports.uiLearnMoreLinkClickedEvent = exports.uiIframeFocusedEvent = exports.uiIframeDwelledEvent = exports.uiHoverCardViewedEvent = exports.uiHoverCardOpenLinkClickedEvent = exports.uiHoverCardDismissedEvent = exports.uiClosedAuthEvent = exports.uiCardClickedEvent = exports.uiAuthEvent = exports.uiAuthAlternateAccountEvent = exports.uiActionClickedEvent = exports.trackSmartLinkQuickActionSuccess = exports.trackSmartLinkQuickActionStarted = exports.trackSmartLinkQuickActionFailed = exports.trackAppAccountConnected = exports.trackAppAccountAuthStarted = exports.screenAuthPopupEvent = exports.resolvedEvent = exports.invokeSucceededEvent = exports.invokeFailedEvent = exports.fireSmartLinkEvent = exports.context = exports.connectSucceededEvent = exports.connectFailedEvent = exports.chunkloadFailedEvent = exports.TrackQuickActionType = exports.TrackQuickActionFailureReason = exports.SmartLinkEvents = exports.ANALYTICS_CHANNEL = void 0;
7
+ exports.unresolvedEvent = exports.uiSmartLinkStatusOpenPreviewButtonClicked = exports.uiSmartLinkStatusLozengeButtonClicked = exports.uiSmartLinkStatusListItemButtonClicked = exports.uiRenderSuccessEvent = exports.uiRenderFailedEvent = exports.uiLearnMoreLinkClickedEvent = exports.uiIframeFocusedEvent = exports.uiIframeDwelledEvent = exports.uiHoverCardViewedEvent = exports.uiHoverCardOpenLinkClickedEvent = exports.uiHoverCardDismissedEvent = exports.uiClosedAuthEvent = exports.uiCardClickedEvent = exports.uiAuthEvent = exports.uiAuthAlternateAccountEvent = exports.uiActionClickedEvent = exports.trackSmartLinkQuickActionSuccess = exports.trackSmartLinkQuickActionStarted = exports.trackSmartLinkQuickActionFailed = exports.trackHoverCardResolutionStarted = exports.trackAppAccountConnected = exports.trackAppAccountAuthStarted = exports.screenAuthPopupEvent = exports.resolvedEvent = exports.invokeSucceededEvent = exports.invokeFailedEvent = exports.fireSmartLinkEvent = exports.context = exports.connectSucceededEvent = exports.connectFailedEvent = exports.chunkloadFailedEvent = exports.TrackQuickActionType = exports.TrackQuickActionFailureReason = exports.SmartLinkEvents = exports.ANALYTICS_CHANNEL = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -13,7 +13,8 @@ var _version = require("../../version.json");
13
13
  var _performance = require("../performance");
14
14
  var _excluded = ["smartLinkActionType"],
15
15
  _excluded2 = ["smartLinkActionType"],
16
- _excluded3 = ["smartLinkActionType"];
16
+ _excluded3 = ["smartLinkActionType"],
17
+ _excluded4 = ["display"];
17
18
  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; }
18
19
  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) { (0, _defineProperty2.default)(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; }
19
20
  var ANALYTICS_CHANNEL = 'media';
@@ -297,13 +298,26 @@ var trackSmartLinkQuickActionFailed = function trackSmartLinkQuickActionFailed(_
297
298
  };
298
299
  };
299
300
  exports.trackSmartLinkQuickActionFailed = trackSmartLinkQuickActionFailed;
300
- var uiAuthEvent = function uiAuthEvent(_ref11) {
301
- var definitionId = _ref11.definitionId,
302
- extensionKey = _ref11.extensionKey,
303
- destinationProduct = _ref11.destinationProduct,
304
- destinationSubproduct = _ref11.destinationSubproduct,
305
- location = _ref11.location,
306
- display = _ref11.display;
301
+ var trackHoverCardResolutionStarted = function trackHoverCardResolutionStarted(_ref11) {
302
+ var display = _ref11.display,
303
+ attributes = (0, _objectWithoutProperties2.default)(_ref11, _excluded4);
304
+ return {
305
+ action: 'resolved',
306
+ actionSubject: 'hoverCard',
307
+ eventType: 'track',
308
+ attributes: _objectSpread(_objectSpread(_objectSpread({}, context), attributes), {}, {
309
+ display: display
310
+ })
311
+ };
312
+ };
313
+ exports.trackHoverCardResolutionStarted = trackHoverCardResolutionStarted;
314
+ var uiAuthEvent = function uiAuthEvent(_ref12) {
315
+ var definitionId = _ref12.definitionId,
316
+ extensionKey = _ref12.extensionKey,
317
+ destinationProduct = _ref12.destinationProduct,
318
+ destinationSubproduct = _ref12.destinationSubproduct,
319
+ location = _ref12.location,
320
+ display = _ref12.display;
307
321
  return {
308
322
  action: 'clicked',
309
323
  actionSubject: 'button',
@@ -320,13 +334,13 @@ var uiAuthEvent = function uiAuthEvent(_ref11) {
320
334
  };
321
335
  };
322
336
  exports.uiAuthEvent = uiAuthEvent;
323
- var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref12) {
324
- var definitionId = _ref12.definitionId,
325
- extensionKey = _ref12.extensionKey,
326
- destinationProduct = _ref12.destinationProduct,
327
- destinationSubproduct = _ref12.destinationSubproduct,
328
- location = _ref12.location,
329
- display = _ref12.display;
337
+ var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref13) {
338
+ var definitionId = _ref13.definitionId,
339
+ extensionKey = _ref13.extensionKey,
340
+ destinationProduct = _ref13.destinationProduct,
341
+ destinationSubproduct = _ref13.destinationSubproduct,
342
+ location = _ref13.location,
343
+ display = _ref13.display;
330
344
  return {
331
345
  action: 'clicked',
332
346
  actionSubject: 'smartLink',
@@ -343,17 +357,17 @@ var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref12) {
343
357
  };
344
358
  };
345
359
  exports.uiAuthAlternateAccountEvent = uiAuthAlternateAccountEvent;
346
- var uiCardClickedEvent = function uiCardClickedEvent(_ref13) {
347
- var id = _ref13.id,
348
- display = _ref13.display,
349
- status = _ref13.status,
350
- definitionId = _ref13.definitionId,
351
- extensionKey = _ref13.extensionKey,
352
- isModifierKeyPressed = _ref13.isModifierKeyPressed,
353
- location = _ref13.location,
354
- destinationProduct = _ref13.destinationProduct,
355
- destinationSubproduct = _ref13.destinationSubproduct,
356
- actionSubjectId = _ref13.actionSubjectId;
360
+ var uiCardClickedEvent = function uiCardClickedEvent(_ref14) {
361
+ var id = _ref14.id,
362
+ display = _ref14.display,
363
+ status = _ref14.status,
364
+ definitionId = _ref14.definitionId,
365
+ extensionKey = _ref14.extensionKey,
366
+ isModifierKeyPressed = _ref14.isModifierKeyPressed,
367
+ location = _ref14.location,
368
+ destinationProduct = _ref14.destinationProduct,
369
+ destinationSubproduct = _ref14.destinationSubproduct,
370
+ actionSubjectId = _ref14.actionSubjectId;
357
371
  return {
358
372
  action: 'clicked',
359
373
  actionSubject: 'smartLink',
@@ -373,17 +387,17 @@ var uiCardClickedEvent = function uiCardClickedEvent(_ref13) {
373
387
  };
374
388
  };
375
389
  exports.uiCardClickedEvent = uiCardClickedEvent;
376
- var uiIframeDwelledEvent = function uiIframeDwelledEvent(_ref14) {
377
- var id = _ref14.id,
378
- display = _ref14.display,
379
- status = _ref14.status,
380
- definitionId = _ref14.definitionId,
381
- extensionKey = _ref14.extensionKey,
382
- location = _ref14.location,
383
- destinationProduct = _ref14.destinationProduct,
384
- destinationSubproduct = _ref14.destinationSubproduct,
385
- dwellTime = _ref14.dwellTime,
386
- dwellPercentVisible = _ref14.dwellPercentVisible;
390
+ var uiIframeDwelledEvent = function uiIframeDwelledEvent(_ref15) {
391
+ var id = _ref15.id,
392
+ display = _ref15.display,
393
+ status = _ref15.status,
394
+ definitionId = _ref15.definitionId,
395
+ extensionKey = _ref15.extensionKey,
396
+ location = _ref15.location,
397
+ destinationProduct = _ref15.destinationProduct,
398
+ destinationSubproduct = _ref15.destinationSubproduct,
399
+ dwellTime = _ref15.dwellTime,
400
+ dwellPercentVisible = _ref15.dwellPercentVisible;
387
401
  return {
388
402
  action: 'dwelled',
389
403
  actionSubject: 'smartLinkIframe',
@@ -403,15 +417,15 @@ var uiIframeDwelledEvent = function uiIframeDwelledEvent(_ref14) {
403
417
  };
404
418
  };
405
419
  exports.uiIframeDwelledEvent = uiIframeDwelledEvent;
406
- var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref15) {
407
- var id = _ref15.id,
408
- display = _ref15.display,
409
- status = _ref15.status,
410
- definitionId = _ref15.definitionId,
411
- extensionKey = _ref15.extensionKey,
412
- location = _ref15.location,
413
- destinationProduct = _ref15.destinationProduct,
414
- destinationSubproduct = _ref15.destinationSubproduct;
420
+ var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref16) {
421
+ var id = _ref16.id,
422
+ display = _ref16.display,
423
+ status = _ref16.status,
424
+ definitionId = _ref16.definitionId,
425
+ extensionKey = _ref16.extensionKey,
426
+ location = _ref16.location,
427
+ destinationProduct = _ref16.destinationProduct,
428
+ destinationSubproduct = _ref16.destinationSubproduct;
415
429
  return {
416
430
  action: 'focused',
417
431
  actionSubject: 'smartLinkIframe',
@@ -429,15 +443,15 @@ var uiIframeFocusedEvent = function uiIframeFocusedEvent(_ref15) {
429
443
  };
430
444
  };
431
445
  exports.uiIframeFocusedEvent = uiIframeFocusedEvent;
432
- var uiActionClickedEvent = function uiActionClickedEvent(_ref16) {
433
- var id = _ref16.id,
434
- actionType = _ref16.actionType,
435
- extensionKey = _ref16.extensionKey,
436
- display = _ref16.display,
437
- definitionId = _ref16.definitionId,
438
- destinationProduct = _ref16.destinationProduct,
439
- destinationSubproduct = _ref16.destinationSubproduct,
440
- location = _ref16.location;
446
+ var uiActionClickedEvent = function uiActionClickedEvent(_ref17) {
447
+ var id = _ref17.id,
448
+ actionType = _ref17.actionType,
449
+ extensionKey = _ref17.extensionKey,
450
+ display = _ref17.display,
451
+ definitionId = _ref17.definitionId,
452
+ destinationProduct = _ref17.destinationProduct,
453
+ destinationSubproduct = _ref17.destinationSubproduct,
454
+ location = _ref17.location;
441
455
  return {
442
456
  action: 'clicked',
443
457
  actionSubject: 'button',
@@ -456,13 +470,13 @@ var uiActionClickedEvent = function uiActionClickedEvent(_ref16) {
456
470
  };
457
471
  };
458
472
  exports.uiActionClickedEvent = uiActionClickedEvent;
459
- var uiClosedAuthEvent = function uiClosedAuthEvent(_ref17) {
460
- var display = _ref17.display,
461
- extensionKey = _ref17.extensionKey,
462
- definitionId = _ref17.definitionId,
463
- destinationProduct = _ref17.destinationProduct,
464
- destinationSubproduct = _ref17.destinationSubproduct,
465
- location = _ref17.location;
473
+ var uiClosedAuthEvent = function uiClosedAuthEvent(_ref18) {
474
+ var display = _ref18.display,
475
+ extensionKey = _ref18.extensionKey,
476
+ definitionId = _ref18.definitionId,
477
+ destinationProduct = _ref18.destinationProduct,
478
+ destinationSubproduct = _ref18.destinationSubproduct,
479
+ location = _ref18.location;
466
480
  return {
467
481
  action: 'closed',
468
482
  actionSubject: 'consentModal',
@@ -478,12 +492,12 @@ var uiClosedAuthEvent = function uiClosedAuthEvent(_ref17) {
478
492
  };
479
493
  };
480
494
  exports.uiClosedAuthEvent = uiClosedAuthEvent;
481
- var screenAuthPopupEvent = function screenAuthPopupEvent(_ref18) {
482
- var extensionKey = _ref18.extensionKey,
483
- definitionId = _ref18.definitionId,
484
- destinationProduct = _ref18.destinationProduct,
485
- destinationSubproduct = _ref18.destinationSubproduct,
486
- location = _ref18.location;
495
+ var screenAuthPopupEvent = function screenAuthPopupEvent(_ref19) {
496
+ var extensionKey = _ref19.extensionKey,
497
+ definitionId = _ref19.definitionId,
498
+ destinationProduct = _ref19.destinationProduct,
499
+ destinationSubproduct = _ref19.destinationSubproduct,
500
+ location = _ref19.location;
487
501
  return {
488
502
  actionSubject: 'consentModal',
489
503
  eventType: 'screen',
@@ -497,14 +511,14 @@ var screenAuthPopupEvent = function screenAuthPopupEvent(_ref18) {
497
511
  };
498
512
  };
499
513
  exports.screenAuthPopupEvent = screenAuthPopupEvent;
500
- var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref19) {
501
- var display = _ref19.display,
502
- status = _ref19.status,
503
- extensionKey = _ref19.extensionKey,
504
- definitionId = _ref19.definitionId,
505
- destinationProduct = _ref19.destinationProduct,
506
- destinationSubproduct = _ref19.destinationSubproduct,
507
- location = _ref19.location;
514
+ var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref20) {
515
+ var display = _ref20.display,
516
+ status = _ref20.status,
517
+ extensionKey = _ref20.extensionKey,
518
+ definitionId = _ref20.definitionId,
519
+ destinationProduct = _ref20.destinationProduct,
520
+ destinationSubproduct = _ref20.destinationSubproduct,
521
+ location = _ref20.location;
508
522
  return {
509
523
  action: 'renderSuccess',
510
524
  actionSubject: 'smartLink',
@@ -521,15 +535,15 @@ var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref19) {
521
535
  };
522
536
  };
523
537
  exports.uiRenderSuccessEvent = uiRenderSuccessEvent;
524
- var uiRenderFailedEvent = function uiRenderFailedEvent(_ref20) {
525
- var display = _ref20.display,
526
- error = _ref20.error,
527
- errorInfo = _ref20.errorInfo,
528
- extensionKey = _ref20.extensionKey,
529
- definitionId = _ref20.definitionId,
530
- destinationProduct = _ref20.destinationProduct,
531
- destinationSubproduct = _ref20.destinationSubproduct,
532
- location = _ref20.location;
538
+ var uiRenderFailedEvent = function uiRenderFailedEvent(_ref21) {
539
+ var display = _ref21.display,
540
+ error = _ref21.error,
541
+ errorInfo = _ref21.errorInfo,
542
+ extensionKey = _ref21.extensionKey,
543
+ definitionId = _ref21.definitionId,
544
+ destinationProduct = _ref21.destinationProduct,
545
+ destinationSubproduct = _ref21.destinationSubproduct,
546
+ location = _ref21.location;
533
547
  return {
534
548
  actionSubject: 'smartLink',
535
549
  action: 'renderFailed',
@@ -547,16 +561,16 @@ var uiRenderFailedEvent = function uiRenderFailedEvent(_ref20) {
547
561
  };
548
562
  };
549
563
  exports.uiRenderFailedEvent = uiRenderFailedEvent;
550
- var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref21) {
551
- var id = _ref21.id,
552
- previewDisplay = _ref21.previewDisplay,
553
- extensionKey = _ref21.extensionKey,
554
- definitionId = _ref21.definitionId,
555
- destinationProduct = _ref21.destinationProduct,
556
- destinationSubproduct = _ref21.destinationSubproduct,
557
- location = _ref21.location,
558
- previewInvokeMethod = _ref21.previewInvokeMethod,
559
- status = _ref21.status;
564
+ var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref22) {
565
+ var id = _ref22.id,
566
+ previewDisplay = _ref22.previewDisplay,
567
+ extensionKey = _ref22.extensionKey,
568
+ definitionId = _ref22.definitionId,
569
+ destinationProduct = _ref22.destinationProduct,
570
+ destinationSubproduct = _ref22.destinationSubproduct,
571
+ location = _ref22.location,
572
+ previewInvokeMethod = _ref22.previewInvokeMethod,
573
+ status = _ref22.status;
560
574
  return {
561
575
  action: 'viewed',
562
576
  actionSubject: 'hoverCard',
@@ -575,17 +589,17 @@ var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref21) {
575
589
  };
576
590
  };
577
591
  exports.uiHoverCardViewedEvent = uiHoverCardViewedEvent;
578
- var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref22) {
579
- var id = _ref22.id,
580
- previewDisplay = _ref22.previewDisplay,
581
- hoverTime = _ref22.hoverTime,
582
- extensionKey = _ref22.extensionKey,
583
- definitionId = _ref22.definitionId,
584
- destinationProduct = _ref22.destinationProduct,
585
- destinationSubproduct = _ref22.destinationSubproduct,
586
- location = _ref22.location,
587
- previewInvokeMethod = _ref22.previewInvokeMethod,
588
- status = _ref22.status;
592
+ var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref23) {
593
+ var id = _ref23.id,
594
+ previewDisplay = _ref23.previewDisplay,
595
+ hoverTime = _ref23.hoverTime,
596
+ extensionKey = _ref23.extensionKey,
597
+ definitionId = _ref23.definitionId,
598
+ destinationProduct = _ref23.destinationProduct,
599
+ destinationSubproduct = _ref23.destinationSubproduct,
600
+ location = _ref23.location,
601
+ previewInvokeMethod = _ref23.previewInvokeMethod,
602
+ status = _ref23.status;
589
603
  return {
590
604
  action: 'dismissed',
591
605
  actionSubject: 'hoverCard',
@@ -605,15 +619,15 @@ var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref22) {
605
619
  };
606
620
  };
607
621
  exports.uiHoverCardDismissedEvent = uiHoverCardDismissedEvent;
608
- var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref23) {
609
- var id = _ref23.id,
610
- previewDisplay = _ref23.previewDisplay,
611
- extensionKey = _ref23.extensionKey,
612
- definitionId = _ref23.definitionId,
613
- destinationProduct = _ref23.destinationProduct,
614
- destinationSubproduct = _ref23.destinationSubproduct,
615
- location = _ref23.location,
616
- previewInvokeMethod = _ref23.previewInvokeMethod;
622
+ var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref24) {
623
+ var id = _ref24.id,
624
+ previewDisplay = _ref24.previewDisplay,
625
+ extensionKey = _ref24.extensionKey,
626
+ definitionId = _ref24.definitionId,
627
+ destinationProduct = _ref24.destinationProduct,
628
+ destinationSubproduct = _ref24.destinationSubproduct,
629
+ location = _ref24.location,
630
+ previewInvokeMethod = _ref24.previewInvokeMethod;
617
631
  return {
618
632
  action: 'clicked',
619
633
  actionSubject: 'button',
@@ -642,15 +656,15 @@ var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent() {
642
656
  };
643
657
  };
644
658
  exports.uiLearnMoreLinkClickedEvent = uiLearnMoreLinkClickedEvent;
645
- var chunkloadFailedEvent = function chunkloadFailedEvent(_ref24) {
646
- var display = _ref24.display,
647
- error = _ref24.error,
648
- errorInfo = _ref24.errorInfo,
649
- extensionKey = _ref24.extensionKey,
650
- definitionId = _ref24.definitionId,
651
- destinationProduct = _ref24.destinationProduct,
652
- destinationSubproduct = _ref24.destinationSubproduct,
653
- location = _ref24.location;
659
+ var chunkloadFailedEvent = function chunkloadFailedEvent(_ref25) {
660
+ var display = _ref25.display,
661
+ error = _ref25.error,
662
+ errorInfo = _ref25.errorInfo,
663
+ extensionKey = _ref25.extensionKey,
664
+ definitionId = _ref25.definitionId,
665
+ destinationProduct = _ref25.destinationProduct,
666
+ destinationSubproduct = _ref25.destinationSubproduct,
667
+ location = _ref25.location;
654
668
  return {
655
669
  action: 'chunkLoadFailed',
656
670
  actionSubject: 'smartLink',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.12.1",
3
+ "version": "26.13.0",
4
4
  "sideEffects": false
5
5
  }
@@ -20,6 +20,7 @@ var _constants = require("../../../constants");
20
20
  var _SmartLinkAnalyticsContext = require("../../../utils/analytics/SmartLinkAnalyticsContext");
21
21
  var _actions = require("../../../state/actions");
22
22
  var _analytics = require("../../../state/analytics");
23
+ var _linkProvider = require("@atlaskit/link-provider");
23
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
26
  /** @jsx jsx */
@@ -61,6 +62,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
61
62
  var analytics = (0, _analytics.useSmartLinkAnalytics)(url, undefined, id);
62
63
  var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
63
64
  loadMetadata = _useSmartCardActions.loadMetadata;
65
+ var enableHoverCardResolutionTracking = (0, _linkProvider.useFeatureFlag)('enableHoverCardResolutionTracking');
64
66
  var setMousePosition = (0, _react2.useCallback)(function (event) {
65
67
  if (isOpen && canOpen) {
66
68
  return;
@@ -129,9 +131,12 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
129
131
  if (!resolveTimeOutId.current && isLinkUnresolved) {
130
132
  resolveTimeOutId.current = setTimeout(function () {
131
133
  loadMetadata();
134
+ if (enableHoverCardResolutionTracking) {
135
+ analytics.track.hoverCardResolutionStarted();
136
+ }
132
137
  }, RESOLVE_DELAY);
133
138
  }
134
- }, [linkState, loadMetadata]);
139
+ }, [analytics.track, enableHoverCardResolutionTracking, linkState.metadataStatus, linkState.status, loadMetadata]);
135
140
  var initShowCard = (0, _react2.useCallback)(function (event) {
136
141
  // clearing out fadeOutTimeoutId in case it's already counting down to hide the card
137
142
  if (fadeOutTimeoutId.current) {
@@ -4,7 +4,7 @@ import { chunkloadFailedEvent, connectFailedEvent, connectSucceededEvent, contex
4
4
  import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
5
5
  import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getStatusDetails, getSubproduct } from '../helpers';
6
6
  import { useSmartLinkContext } from '@atlaskit/link-provider';
7
- import { trackSmartLinkQuickActionFailed, trackSmartLinkQuickActionStarted, trackSmartLinkQuickActionSuccess, uiIframeDwelledEvent, uiIframeFocusedEvent } from '../../utils/analytics/analytics';
7
+ import { trackHoverCardResolutionStarted, trackSmartLinkQuickActionFailed, trackSmartLinkQuickActionStarted, trackSmartLinkQuickActionSuccess, uiIframeDwelledEvent, uiIframeFocusedEvent } from '../../utils/analytics/analytics';
8
8
  import { useDispatchAnalytics } from './useDispatchAnalytics';
9
9
  const applyCommonAttributes = (event, commonAttributes) => {
10
10
  if (event && event.attributes) {
@@ -759,6 +759,13 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
759
759
  smartLinkQuickActionFailed: props => dispatchAnalytics(applyCommonAttributes(trackSmartLinkQuickActionFailed({
760
760
  ...commonAttributes,
761
761
  ...props
762
+ }), commonAttributes)),
763
+ /**
764
+ * Fires a track event when we call loadMetadata() to get information for a hover card
765
+ */
766
+ hoverCardResolutionStarted: () => dispatchAnalytics(applyCommonAttributes(trackHoverCardResolutionStarted({
767
+ display: 'hoverCardPreview',
768
+ ...commonAttributes
762
769
  }), commonAttributes))
763
770
  }), [commonAttributes, dispatchAnalytics]);
764
771
 
@@ -270,6 +270,19 @@ export const trackSmartLinkQuickActionFailed = ({
270
270
  smartLinkActionType
271
271
  }
272
272
  });
273
+ export const trackHoverCardResolutionStarted = ({
274
+ display,
275
+ ...attributes
276
+ }) => ({
277
+ action: 'resolved',
278
+ actionSubject: 'hoverCard',
279
+ eventType: 'track',
280
+ attributes: {
281
+ ...context,
282
+ ...attributes,
283
+ display
284
+ }
285
+ });
273
286
  export const uiAuthEvent = ({
274
287
  definitionId,
275
288
  extensionKey,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.12.1",
3
+ "version": "26.13.0",
4
4
  "sideEffects": false
5
5
  }
@@ -12,6 +12,7 @@ import { CardDisplay } from '../../../constants';
12
12
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
13
13
  import { useSmartCardActions } from '../../../state/actions';
14
14
  import { useSmartLinkAnalytics } from '../../../state/analytics';
15
+ import { useFeatureFlag } from '@atlaskit/link-provider';
15
16
  const HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
16
17
  const FADE_IN_DELAY = 500;
17
18
  const FADE_OUT_DELAY = 300;
@@ -41,6 +42,7 @@ export const HoverCardComponent = ({
41
42
  const {
42
43
  loadMetadata
43
44
  } = useSmartCardActions(id, url, analytics);
45
+ const enableHoverCardResolutionTracking = useFeatureFlag('enableHoverCardResolutionTracking');
44
46
  const setMousePosition = useCallback(event => {
45
47
  if (isOpen && canOpen) {
46
48
  return;
@@ -108,9 +110,12 @@ export const HoverCardComponent = ({
108
110
  if (!resolveTimeOutId.current && isLinkUnresolved) {
109
111
  resolveTimeOutId.current = setTimeout(() => {
110
112
  loadMetadata();
113
+ if (enableHoverCardResolutionTracking) {
114
+ analytics.track.hoverCardResolutionStarted();
115
+ }
111
116
  }, RESOLVE_DELAY);
112
117
  }
113
- }, [linkState, loadMetadata]);
118
+ }, [analytics.track, enableHoverCardResolutionTracking, linkState.metadataStatus, linkState.status, loadMetadata]);
114
119
  const initShowCard = useCallback(event => {
115
120
  // clearing out fadeOutTimeoutId in case it's already counting down to hide the card
116
121
  if (fadeOutTimeoutId.current) {
@@ -8,7 +8,7 @@ import { chunkloadFailedEvent as _chunkloadFailedEvent, connectFailedEvent as _c
8
8
  import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
9
9
  import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getStatusDetails, getSubproduct } from '../helpers';
10
10
  import { useSmartLinkContext } from '@atlaskit/link-provider';
11
- import { trackSmartLinkQuickActionFailed, trackSmartLinkQuickActionStarted, trackSmartLinkQuickActionSuccess, uiIframeDwelledEvent, uiIframeFocusedEvent } from '../../utils/analytics/analytics';
11
+ import { trackHoverCardResolutionStarted, trackSmartLinkQuickActionFailed, trackSmartLinkQuickActionStarted, trackSmartLinkQuickActionSuccess, uiIframeDwelledEvent, uiIframeFocusedEvent } from '../../utils/analytics/analytics';
12
12
  import { useDispatchAnalytics } from './useDispatchAnalytics';
13
13
  var applyCommonAttributes = function applyCommonAttributes(event, commonAttributes) {
14
14
  if (event && event.attributes) {
@@ -769,6 +769,14 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatch
769
769
  */
770
770
  smartLinkQuickActionFailed: function smartLinkQuickActionFailed(props) {
771
771
  return dispatchAnalytics(applyCommonAttributes(trackSmartLinkQuickActionFailed(_objectSpread(_objectSpread({}, commonAttributes), props)), commonAttributes));
772
+ },
773
+ /**
774
+ * Fires a track event when we call loadMetadata() to get information for a hover card
775
+ */
776
+ hoverCardResolutionStarted: function hoverCardResolutionStarted() {
777
+ return dispatchAnalytics(applyCommonAttributes(trackHoverCardResolutionStarted(_objectSpread({
778
+ display: 'hoverCardPreview'
779
+ }, commonAttributes)), commonAttributes));
772
780
  }
773
781
  };
774
782
  }, [commonAttributes, dispatchAnalytics]);
@@ -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.0",
4
4
  "sideEffects": false
5
5
  }
@@ -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) {
@@ -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;
@@ -38,6 +38,7 @@ export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, .
38
38
  export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
39
39
  smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
40
40
  }) => AnalyticsPayload;
41
+ export declare const trackHoverCardResolutionStarted: ({ display, ...attributes }: UiAuthEventProps) => AnalyticsPayload;
41
42
  export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
42
43
  export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
43
44
  export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
@@ -89,6 +89,7 @@ export declare const mockAnalytics: {
89
89
  reason?: import("./analytics/analytics").TrackQuickActionFailureReason | undefined;
90
90
  step?: string | undefined;
91
91
  }) => void;
92
+ hoverCardResolutionStarted: () => void;
92
93
  };
93
94
  screen: {
94
95
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
@@ -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;
@@ -38,6 +38,7 @@ export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, .
38
38
  export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
39
39
  smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
40
40
  }) => AnalyticsPayload;
41
+ export declare const trackHoverCardResolutionStarted: ({ display, ...attributes }: UiAuthEventProps) => AnalyticsPayload;
41
42
  export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
42
43
  export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
43
44
  export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
@@ -89,6 +89,7 @@ export declare const mockAnalytics: {
89
89
  reason?: import("./analytics/analytics").TrackQuickActionFailureReason | undefined;
90
90
  step?: string | undefined;
91
91
  }) => void;
92
+ hoverCardResolutionStarted: () => void;
92
93
  };
93
94
  screen: {
94
95
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.12.1",
3
+ "version": "26.13.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/link-analytics": "^8.2.0",
38
38
  "@atlaskit/link-client-extension": "^1.5.0",
39
39
  "@atlaskit/link-extractors": "^1.1.0",
40
- "@atlaskit/linking-common": "^4.1.0",
40
+ "@atlaskit/linking-common": "^4.2.0",
41
41
  "@atlaskit/linking-types": "^8.2.0",
42
42
  "@atlaskit/logo": "^13.14.0",
43
43
  "@atlaskit/lozenge": "^11.4.0",
package/report.api.md CHANGED
@@ -1251,6 +1251,7 @@ export const useSmartLinkAnalytics: (
1251
1251
  reason?: TrackQuickActionFailureReason;
1252
1252
  step?: string;
1253
1253
  }) => void;
1254
+ hoverCardResolutionStarted: () => void;
1254
1255
  };
1255
1256
  screen: {
1256
1257
  authPopupEvent: ({
@@ -910,6 +910,7 @@ export const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: Analytics
910
910
  reason?: TrackQuickActionFailureReason;
911
911
  step?: string;
912
912
  }) => void;
913
+ hoverCardResolutionStarted: () => void;
913
914
  };
914
915
  screen: {
915
916
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => void;