@atlaskit/smart-card 23.7.3 → 23.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/constants.js +14 -2
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -1
  4. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +41 -13
  5. package/dist/cjs/utils/analytics/analytics.js +128 -96
  6. package/dist/cjs/utils/analytics/index.js +12 -0
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +1 -1
  9. package/dist/cjs/view/BlockCard/index.js +4 -2
  10. package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  11. package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -3
  12. package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +17 -4
  13. package/dist/cjs/view/CardWithUrl/component.js +3 -1
  14. package/dist/cjs/view/EmbedCard/index.js +6 -2
  15. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +21 -4
  16. package/dist/cjs/view/EmbedModal/components/analytics/index.js +4 -2
  17. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +11 -10
  18. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +6 -4
  19. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
  20. package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +26 -7
  21. package/dist/cjs/view/HoverCard/index.js +6 -3
  22. package/dist/cjs/view/HoverCard/utils.js +1 -4
  23. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +2 -1
  24. package/dist/cjs/view/InlineCard/index.js +2 -1
  25. package/dist/cjs/view/common/UnauthorisedViewContent.js +14 -3
  26. package/dist/es2019/constants.js +12 -1
  27. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -1
  28. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +33 -8
  29. package/dist/es2019/utils/analytics/analytics.js +28 -4
  30. package/dist/es2019/utils/analytics/index.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -1
  33. package/dist/es2019/view/BlockCard/index.js +4 -2
  34. package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  35. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
  36. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -3
  37. package/dist/es2019/view/CardWithUrl/component.js +2 -1
  38. package/dist/es2019/view/EmbedCard/index.js +6 -2
  39. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +14 -3
  40. package/dist/es2019/view/EmbedModal/components/analytics/index.js +3 -2
  41. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +11 -10
  42. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +8 -6
  43. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -3
  44. package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +23 -7
  45. package/dist/es2019/view/HoverCard/index.js +6 -3
  46. package/dist/es2019/view/HoverCard/utils.js +0 -1
  47. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +2 -1
  48. package/dist/es2019/view/InlineCard/index.js +2 -1
  49. package/dist/es2019/view/common/UnauthorisedViewContent.js +18 -11
  50. package/dist/esm/constants.js +12 -1
  51. package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
  52. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +42 -14
  53. package/dist/esm/utils/analytics/analytics.js +118 -92
  54. package/dist/esm/utils/analytics/index.js +1 -1
  55. package/dist/esm/version.json +1 -1
  56. package/dist/esm/view/BlockCard/components/flexible/footer/index.js +1 -1
  57. package/dist/esm/view/BlockCard/index.js +4 -2
  58. package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  59. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
  60. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +18 -5
  61. package/dist/esm/view/CardWithUrl/component.js +2 -1
  62. package/dist/esm/view/EmbedCard/index.js +6 -2
  63. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +15 -4
  64. package/dist/esm/view/EmbedModal/components/analytics/index.js +3 -2
  65. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +11 -10
  66. package/dist/esm/view/HoverCard/components/HoverCardContent.js +8 -6
  67. package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -3
  68. package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +27 -9
  69. package/dist/esm/view/HoverCard/index.js +6 -3
  70. package/dist/esm/view/HoverCard/utils.js +0 -1
  71. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +2 -1
  72. package/dist/esm/view/InlineCard/index.js +2 -1
  73. package/dist/esm/view/common/UnauthorisedViewContent.js +8 -3
  74. package/dist/types/constants.d.ts +8 -0
  75. package/dist/types/state/actions/index.d.ts +1 -2
  76. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +17 -4
  77. package/dist/types/state/flexible-ui-context/index.d.ts +8 -4
  78. package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
  79. package/dist/types/utils/analytics/analytics.d.ts +4 -2
  80. package/dist/types/utils/analytics/index.d.ts +1 -1
  81. package/dist/types/utils/analytics/types.d.ts +2 -0
  82. package/dist/types/utils/mocks.d.ts +4 -2
  83. package/dist/types/utils/types.d.ts +1 -1
  84. package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +1 -1
  85. package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
  86. package/dist/types/view/BlockCard/views/flexible/types.d.ts +17 -13
  87. package/dist/types/view/Card/types.d.ts +1 -1
  88. package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +3 -0
  89. package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +15 -4
  90. package/dist/types/view/HoverCard/types.d.ts +0 -2
  91. package/dist/types/view/HoverCard/utils.d.ts +0 -1
  92. package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
  93. package/dist/types/view/common/UnauthorisedViewContent.d.ts +7 -1
  94. package/package.json +5 -5
  95. package/report.api.md +15 -1
  96. package/tmp/api-report-tmp.d.ts +8 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 23.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d739aa7120c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d739aa7120c) - [ux] Analytics is added for Unauthorised view of Hover Card & to Unauthorised view of an Embed card & to Unauthorised view of a Block Card
8
+
3
9
  ## 23.7.3
4
10
 
5
11
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.MediaPlacement = exports.IconType = exports.ElementName = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.ActionName = void 0;
6
+ exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.MediaPlacement = exports.IconType = exports.ElementName = exports.CardDisplay = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.ActionName = void 0;
7
7
  var CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
8
8
  /**
9
9
  * The alignment of Flexible UI component.
@@ -259,4 +259,16 @@ exports.MediaPlacement = MediaPlacement;
259
259
  (function (MediaPlacement) {
260
260
  MediaPlacement["Left"] = "left";
261
261
  MediaPlacement["Right"] = "right";
262
- })(MediaPlacement || (exports.MediaPlacement = MediaPlacement = {}));
262
+ })(MediaPlacement || (exports.MediaPlacement = MediaPlacement = {}));
263
+
264
+ var CardDisplay;
265
+ exports.CardDisplay = CardDisplay;
266
+
267
+ (function (CardDisplay) {
268
+ CardDisplay["Inline"] = "inline";
269
+ CardDisplay["Block"] = "block";
270
+ CardDisplay["Embed"] = "embed";
271
+ CardDisplay["EmbedPreview"] = "embedPreview";
272
+ CardDisplay["Flexible"] = "flexible";
273
+ CardDisplay["HoverCardPreview"] = "hoverCardPreview";
274
+ })(CardDisplay || (exports.CardDisplay = CardDisplay = {}));
@@ -15,6 +15,8 @@ var _extractors = require("@atlaskit/linking-common/extractors");
15
15
 
16
16
  var _BlockCard = require("../../../view/BlockCard");
17
17
 
18
+ var _constants = require("../../../constants");
19
+
18
20
  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; }
19
21
 
20
22
  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; }
@@ -51,7 +53,7 @@ var getInvokeOpts = function getInvokeOpts(key, action, source) {
51
53
  // the actions on the preview state are invoked from the
52
54
  // preview card. Hence, we have a `source` for distinguishing
53
55
  // between the two.
54
- source: source || 'preview',
56
+ source: source || _constants.CardDisplay.EmbedPreview,
55
57
  action: {
56
58
  type: action,
57
59
  promise: function promise() {
@@ -388,7 +388,8 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
388
388
  resourceType = _ref9.resourceType,
389
389
  destinationProduct = _ref9.destinationProduct,
390
390
  destinationSubproduct = _ref9.destinationSubproduct,
391
- location = _ref9.location;
391
+ location = _ref9.location,
392
+ status = _ref9.status;
392
393
  return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardViewedEvent)({
393
394
  id: id,
394
395
  previewDisplay: previewDisplay,
@@ -398,7 +399,8 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
398
399
  destinationProduct: destinationProduct,
399
400
  destinationSubproduct: destinationSubproduct,
400
401
  location: location,
401
- previewInvokeMethod: previewInvokeMethod
402
+ previewInvokeMethod: previewInvokeMethod,
403
+ status: status
402
404
  }), commonAttributes));
403
405
  },
404
406
 
@@ -407,7 +409,7 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
407
409
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
408
410
  * @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
409
411
  * @param definitionId The definitionId of the Smart Link resolver invoked.
410
- * @param extensionKey The extensionKey of the Smart Link resovler invoked.
412
+ * @param extensionKey The extensionKey of the Smart Link resolver invoked.
411
413
  * @param previewInvokeMethod How the preview was triggered.
412
414
  * @returns
413
415
  */
@@ -421,7 +423,8 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
421
423
  resourceType = _ref10.resourceType,
422
424
  destinationProduct = _ref10.destinationProduct,
423
425
  destinationSubproduct = _ref10.destinationSubproduct,
424
- location = _ref10.location;
426
+ location = _ref10.location,
427
+ status = _ref10.status;
425
428
  return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardDismissedEvent)({
426
429
  previewDisplay: previewDisplay,
427
430
  id: id,
@@ -432,8 +435,18 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
432
435
  destinationProduct: destinationProduct,
433
436
  destinationSubproduct: destinationSubproduct,
434
437
  location: location,
435
- previewInvokeMethod: previewInvokeMethod
438
+ previewInvokeMethod: previewInvokeMethod,
439
+ status: status
436
440
  }), commonAttributes));
441
+ },
442
+
443
+ /**
444
+ * Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
445
+ * @param extensionKey The extensionKey of the Smart Link resovler invoked.
446
+ * @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
447
+ */
448
+ learnMoreClickedEvent: function learnMoreClickedEvent() {
449
+ return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiLearnMoreLinkClickedEvent)(), commonAttributes));
437
450
  }
438
451
  };
439
452
  }, [defaultId, commonAttributes, dispatchAnalytics]);
@@ -611,7 +624,7 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
611
624
  var track = (0, _react.useMemo)(function () {
612
625
  return {
613
626
  /**
614
- * This fires an event which represents a user starting the Smart Link connect account process.
627
+ * This fires an event which represents a user connecting their account to view a Smart Link.
615
628
  * @param definitionId The definitionId of the Smart Link resolver invoked.
616
629
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
617
630
  * @returns
@@ -631,6 +644,21 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
631
644
  destinationSubproduct: destinationSubproduct,
632
645
  location: location
633
646
  })), commonAttributes));
647
+ },
648
+
649
+ /**
650
+ * This fires an event which represents a user starting the Smart Link connect account process.
651
+ * @param location a location where the Smart Link auth action was initiated.
652
+ * @param extensionKey The extensionKey of the Smart Link resolver invoked.
653
+ * @returns
654
+ */
655
+ appAccountAuthStarted: function appAccountAuthStarted(_ref17) {
656
+ var extensionKey = _ref17.extensionKey,
657
+ location = _ref17.location;
658
+ return dispatchAnalytics(applyCommonAttributes((0, _analytics.trackAppAccountAuthStarted)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
659
+ extensionKey: extensionKey,
660
+ location: location
661
+ })), commonAttributes));
634
662
  }
635
663
  };
636
664
  }, [commonAttributes, dispatchAnalytics]);
@@ -644,13 +672,13 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
644
672
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
645
673
  * @returns
646
674
  */
647
- authPopupEvent: function authPopupEvent(_ref17) {
648
- var extensionKey = _ref17.extensionKey,
649
- definitionId = _ref17.definitionId,
650
- resourceType = _ref17.resourceType,
651
- destinationProduct = _ref17.destinationProduct,
652
- destinationSubproduct = _ref17.destinationSubproduct,
653
- location = _ref17.location;
675
+ authPopupEvent: function authPopupEvent(_ref18) {
676
+ var extensionKey = _ref18.extensionKey,
677
+ definitionId = _ref18.definitionId,
678
+ resourceType = _ref18.resourceType,
679
+ destinationProduct = _ref18.destinationProduct,
680
+ destinationSubproduct = _ref18.destinationSubproduct,
681
+ location = _ref18.location;
654
682
  return dispatchAnalytics(applyCommonAttributes((0, _analytics.screenAuthPopupEvent)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
655
683
  extensionKey: extensionKey,
656
684
  definitionId: definitionId,
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.unresolvedEvent = exports.uiRenderSuccessEvent = exports.uiRenderFailedEvent = exports.uiHoverCardViewedEvent = exports.uiHoverCardOpenLinkClickedEvent = exports.uiHoverCardDismissedEvent = exports.uiClosedAuthEvent = exports.uiCardClickedEvent = exports.uiAuthEvent = exports.uiAuthAlternateAccountEvent = exports.uiActionClickedEvent = exports.trackAppAccountConnected = exports.screenAuthPopupEvent = exports.resolvedEvent = exports.invokeSucceededEvent = exports.invokeFailedEvent = exports.fireSmartLinkEvent = exports.context = exports.connectSucceededEvent = exports.connectFailedEvent = exports.SmartLinkEvents = exports.ANALYTICS_CHANNEL = void 0;
8
+ exports.unresolvedEvent = exports.uiRenderSuccessEvent = exports.uiRenderFailedEvent = exports.uiLearnMoreLinkClickedEvent = exports.uiHoverCardViewedEvent = exports.uiHoverCardOpenLinkClickedEvent = exports.uiHoverCardDismissedEvent = exports.uiClosedAuthEvent = exports.uiCardClickedEvent = exports.uiAuthEvent = exports.uiAuthAlternateAccountEvent = exports.uiActionClickedEvent = exports.trackAppAccountConnected = exports.trackAppAccountAuthStarted = exports.screenAuthPopupEvent = exports.resolvedEvent = exports.invokeSucceededEvent = exports.invokeFailedEvent = exports.fireSmartLinkEvent = exports.context = exports.connectSucceededEvent = exports.connectFailedEvent = exports.SmartLinkEvents = exports.ANALYTICS_CHANNEL = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -257,13 +257,29 @@ var trackAppAccountConnected = function trackAppAccountConnected(_ref6) {
257
257
 
258
258
  exports.trackAppAccountConnected = trackAppAccountConnected;
259
259
 
260
- var uiAuthEvent = function uiAuthEvent(_ref7) {
261
- var definitionId = _ref7.definitionId,
262
- extensionKey = _ref7.extensionKey,
263
- destinationProduct = _ref7.destinationProduct,
264
- destinationSubproduct = _ref7.destinationSubproduct,
265
- location = _ref7.location,
266
- display = _ref7.display;
260
+ var trackAppAccountAuthStarted = function trackAppAccountAuthStarted(_ref7) {
261
+ var extensionKey = _ref7.extensionKey,
262
+ location = _ref7.location;
263
+ return {
264
+ action: 'authStarted',
265
+ actionSubject: 'applicationAccount',
266
+ eventType: 'track',
267
+ attributes: _objectSpread(_objectSpread({}, context), {}, {
268
+ extensionKey: extensionKey,
269
+ location: location
270
+ })
271
+ };
272
+ };
273
+
274
+ exports.trackAppAccountAuthStarted = trackAppAccountAuthStarted;
275
+
276
+ var uiAuthEvent = function uiAuthEvent(_ref8) {
277
+ var definitionId = _ref8.definitionId,
278
+ extensionKey = _ref8.extensionKey,
279
+ destinationProduct = _ref8.destinationProduct,
280
+ destinationSubproduct = _ref8.destinationSubproduct,
281
+ location = _ref8.location,
282
+ display = _ref8.display;
267
283
  return {
268
284
  action: 'clicked',
269
285
  actionSubject: 'button',
@@ -282,13 +298,13 @@ var uiAuthEvent = function uiAuthEvent(_ref7) {
282
298
 
283
299
  exports.uiAuthEvent = uiAuthEvent;
284
300
 
285
- var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref8) {
286
- var definitionId = _ref8.definitionId,
287
- extensionKey = _ref8.extensionKey,
288
- destinationProduct = _ref8.destinationProduct,
289
- destinationSubproduct = _ref8.destinationSubproduct,
290
- location = _ref8.location,
291
- display = _ref8.display;
301
+ var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref9) {
302
+ var definitionId = _ref9.definitionId,
303
+ extensionKey = _ref9.extensionKey,
304
+ destinationProduct = _ref9.destinationProduct,
305
+ destinationSubproduct = _ref9.destinationSubproduct,
306
+ location = _ref9.location,
307
+ display = _ref9.display;
292
308
  return {
293
309
  action: 'clicked',
294
310
  actionSubject: 'smartLink',
@@ -307,17 +323,17 @@ var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref8) {
307
323
 
308
324
  exports.uiAuthAlternateAccountEvent = uiAuthAlternateAccountEvent;
309
325
 
310
- var uiCardClickedEvent = function uiCardClickedEvent(_ref9) {
311
- var id = _ref9.id,
312
- display = _ref9.display,
313
- status = _ref9.status,
314
- definitionId = _ref9.definitionId,
315
- extensionKey = _ref9.extensionKey,
316
- isModifierKeyPressed = _ref9.isModifierKeyPressed,
317
- location = _ref9.location,
318
- destinationProduct = _ref9.destinationProduct,
319
- destinationSubproduct = _ref9.destinationSubproduct,
320
- actionSubjectId = _ref9.actionSubjectId;
326
+ var uiCardClickedEvent = function uiCardClickedEvent(_ref10) {
327
+ var id = _ref10.id,
328
+ display = _ref10.display,
329
+ status = _ref10.status,
330
+ definitionId = _ref10.definitionId,
331
+ extensionKey = _ref10.extensionKey,
332
+ isModifierKeyPressed = _ref10.isModifierKeyPressed,
333
+ location = _ref10.location,
334
+ destinationProduct = _ref10.destinationProduct,
335
+ destinationSubproduct = _ref10.destinationSubproduct,
336
+ actionSubjectId = _ref10.actionSubjectId;
321
337
  return {
322
338
  action: 'clicked',
323
339
  actionSubject: 'smartLink',
@@ -339,15 +355,15 @@ var uiCardClickedEvent = function uiCardClickedEvent(_ref9) {
339
355
 
340
356
  exports.uiCardClickedEvent = uiCardClickedEvent;
341
357
 
342
- var uiActionClickedEvent = function uiActionClickedEvent(_ref10) {
343
- var id = _ref10.id,
344
- actionType = _ref10.actionType,
345
- extensionKey = _ref10.extensionKey,
346
- display = _ref10.display,
347
- definitionId = _ref10.definitionId,
348
- destinationProduct = _ref10.destinationProduct,
349
- destinationSubproduct = _ref10.destinationSubproduct,
350
- location = _ref10.location;
358
+ var uiActionClickedEvent = function uiActionClickedEvent(_ref11) {
359
+ var id = _ref11.id,
360
+ actionType = _ref11.actionType,
361
+ extensionKey = _ref11.extensionKey,
362
+ display = _ref11.display,
363
+ definitionId = _ref11.definitionId,
364
+ destinationProduct = _ref11.destinationProduct,
365
+ destinationSubproduct = _ref11.destinationSubproduct,
366
+ location = _ref11.location;
351
367
  return {
352
368
  action: 'clicked',
353
369
  actionSubject: 'button',
@@ -368,13 +384,13 @@ var uiActionClickedEvent = function uiActionClickedEvent(_ref10) {
368
384
 
369
385
  exports.uiActionClickedEvent = uiActionClickedEvent;
370
386
 
371
- var uiClosedAuthEvent = function uiClosedAuthEvent(_ref11) {
372
- var display = _ref11.display,
373
- extensionKey = _ref11.extensionKey,
374
- definitionId = _ref11.definitionId,
375
- destinationProduct = _ref11.destinationProduct,
376
- destinationSubproduct = _ref11.destinationSubproduct,
377
- location = _ref11.location;
387
+ var uiClosedAuthEvent = function uiClosedAuthEvent(_ref12) {
388
+ var display = _ref12.display,
389
+ extensionKey = _ref12.extensionKey,
390
+ definitionId = _ref12.definitionId,
391
+ destinationProduct = _ref12.destinationProduct,
392
+ destinationSubproduct = _ref12.destinationSubproduct,
393
+ location = _ref12.location;
378
394
  return {
379
395
  action: 'closed',
380
396
  actionSubject: 'consentModal',
@@ -392,12 +408,12 @@ var uiClosedAuthEvent = function uiClosedAuthEvent(_ref11) {
392
408
 
393
409
  exports.uiClosedAuthEvent = uiClosedAuthEvent;
394
410
 
395
- var screenAuthPopupEvent = function screenAuthPopupEvent(_ref12) {
396
- var extensionKey = _ref12.extensionKey,
397
- definitionId = _ref12.definitionId,
398
- destinationProduct = _ref12.destinationProduct,
399
- destinationSubproduct = _ref12.destinationSubproduct,
400
- location = _ref12.location;
411
+ var screenAuthPopupEvent = function screenAuthPopupEvent(_ref13) {
412
+ var extensionKey = _ref13.extensionKey,
413
+ definitionId = _ref13.definitionId,
414
+ destinationProduct = _ref13.destinationProduct,
415
+ destinationSubproduct = _ref13.destinationSubproduct,
416
+ location = _ref13.location;
401
417
  return {
402
418
  actionSubject: 'consentModal',
403
419
  eventType: 'screen',
@@ -413,14 +429,14 @@ var screenAuthPopupEvent = function screenAuthPopupEvent(_ref12) {
413
429
 
414
430
  exports.screenAuthPopupEvent = screenAuthPopupEvent;
415
431
 
416
- var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref13) {
417
- var display = _ref13.display,
418
- status = _ref13.status,
419
- extensionKey = _ref13.extensionKey,
420
- definitionId = _ref13.definitionId,
421
- destinationProduct = _ref13.destinationProduct,
422
- destinationSubproduct = _ref13.destinationSubproduct,
423
- location = _ref13.location;
432
+ var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref14) {
433
+ var display = _ref14.display,
434
+ status = _ref14.status,
435
+ extensionKey = _ref14.extensionKey,
436
+ definitionId = _ref14.definitionId,
437
+ destinationProduct = _ref14.destinationProduct,
438
+ destinationSubproduct = _ref14.destinationSubproduct,
439
+ location = _ref14.location;
424
440
  return {
425
441
  action: 'renderSuccess',
426
442
  actionSubject: 'smartLink',
@@ -439,15 +455,15 @@ var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref13) {
439
455
 
440
456
  exports.uiRenderSuccessEvent = uiRenderSuccessEvent;
441
457
 
442
- var uiRenderFailedEvent = function uiRenderFailedEvent(_ref14) {
443
- var display = _ref14.display,
444
- error = _ref14.error,
445
- errorInfo = _ref14.errorInfo,
446
- extensionKey = _ref14.extensionKey,
447
- definitionId = _ref14.definitionId,
448
- destinationProduct = _ref14.destinationProduct,
449
- destinationSubproduct = _ref14.destinationSubproduct,
450
- location = _ref14.location;
458
+ var uiRenderFailedEvent = function uiRenderFailedEvent(_ref15) {
459
+ var display = _ref15.display,
460
+ error = _ref15.error,
461
+ errorInfo = _ref15.errorInfo,
462
+ extensionKey = _ref15.extensionKey,
463
+ definitionId = _ref15.definitionId,
464
+ destinationProduct = _ref15.destinationProduct,
465
+ destinationSubproduct = _ref15.destinationSubproduct,
466
+ location = _ref15.location;
451
467
  return {
452
468
  actionSubject: 'smartLink',
453
469
  action: 'renderFailed',
@@ -467,15 +483,16 @@ var uiRenderFailedEvent = function uiRenderFailedEvent(_ref14) {
467
483
 
468
484
  exports.uiRenderFailedEvent = uiRenderFailedEvent;
469
485
 
470
- var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref15) {
471
- var id = _ref15.id,
472
- previewDisplay = _ref15.previewDisplay,
473
- extensionKey = _ref15.extensionKey,
474
- definitionId = _ref15.definitionId,
475
- destinationProduct = _ref15.destinationProduct,
476
- destinationSubproduct = _ref15.destinationSubproduct,
477
- location = _ref15.location,
478
- previewInvokeMethod = _ref15.previewInvokeMethod;
486
+ var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref16) {
487
+ var id = _ref16.id,
488
+ previewDisplay = _ref16.previewDisplay,
489
+ extensionKey = _ref16.extensionKey,
490
+ definitionId = _ref16.definitionId,
491
+ destinationProduct = _ref16.destinationProduct,
492
+ destinationSubproduct = _ref16.destinationSubproduct,
493
+ location = _ref16.location,
494
+ previewInvokeMethod = _ref16.previewInvokeMethod,
495
+ status = _ref16.status;
479
496
  return {
480
497
  action: 'viewed',
481
498
  actionSubject: 'hoverCard',
@@ -488,23 +505,25 @@ var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref15) {
488
505
  destinationProduct: destinationProduct,
489
506
  destinationSubproduct: destinationSubproduct,
490
507
  location: location,
491
- previewInvokeMethod: previewInvokeMethod
508
+ previewInvokeMethod: previewInvokeMethod,
509
+ status: status
492
510
  })
493
511
  };
494
512
  };
495
513
 
496
514
  exports.uiHoverCardViewedEvent = uiHoverCardViewedEvent;
497
515
 
498
- var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref16) {
499
- var id = _ref16.id,
500
- previewDisplay = _ref16.previewDisplay,
501
- hoverTime = _ref16.hoverTime,
502
- extensionKey = _ref16.extensionKey,
503
- definitionId = _ref16.definitionId,
504
- destinationProduct = _ref16.destinationProduct,
505
- destinationSubproduct = _ref16.destinationSubproduct,
506
- location = _ref16.location,
507
- previewInvokeMethod = _ref16.previewInvokeMethod;
516
+ var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref17) {
517
+ var id = _ref17.id,
518
+ previewDisplay = _ref17.previewDisplay,
519
+ hoverTime = _ref17.hoverTime,
520
+ extensionKey = _ref17.extensionKey,
521
+ definitionId = _ref17.definitionId,
522
+ destinationProduct = _ref17.destinationProduct,
523
+ destinationSubproduct = _ref17.destinationSubproduct,
524
+ location = _ref17.location,
525
+ previewInvokeMethod = _ref17.previewInvokeMethod,
526
+ status = _ref17.status;
508
527
  return {
509
528
  action: 'dismissed',
510
529
  actionSubject: 'hoverCard',
@@ -518,22 +537,23 @@ var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref16) {
518
537
  destinationProduct: destinationProduct,
519
538
  destinationSubproduct: destinationSubproduct,
520
539
  location: location,
521
- previewInvokeMethod: previewInvokeMethod
540
+ previewInvokeMethod: previewInvokeMethod,
541
+ status: status
522
542
  })
523
543
  };
524
544
  };
525
545
 
526
546
  exports.uiHoverCardDismissedEvent = uiHoverCardDismissedEvent;
527
547
 
528
- var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref17) {
529
- var id = _ref17.id,
530
- previewDisplay = _ref17.previewDisplay,
531
- extensionKey = _ref17.extensionKey,
532
- definitionId = _ref17.definitionId,
533
- destinationProduct = _ref17.destinationProduct,
534
- destinationSubproduct = _ref17.destinationSubproduct,
535
- location = _ref17.location,
536
- previewInvokeMethod = _ref17.previewInvokeMethod;
548
+ var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref18) {
549
+ var id = _ref18.id,
550
+ previewDisplay = _ref18.previewDisplay,
551
+ extensionKey = _ref18.extensionKey,
552
+ definitionId = _ref18.definitionId,
553
+ destinationProduct = _ref18.destinationProduct,
554
+ destinationSubproduct = _ref18.destinationSubproduct,
555
+ location = _ref18.location,
556
+ previewInvokeMethod = _ref18.previewInvokeMethod;
537
557
  return {
538
558
  action: 'clicked',
539
559
  actionSubject: 'button',
@@ -552,4 +572,16 @@ var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_
552
572
  };
553
573
  };
554
574
 
555
- exports.uiHoverCardOpenLinkClickedEvent = uiHoverCardOpenLinkClickedEvent;
575
+ exports.uiHoverCardOpenLinkClickedEvent = uiHoverCardOpenLinkClickedEvent;
576
+
577
+ var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent() {
578
+ return {
579
+ action: 'clicked',
580
+ actionSubject: 'button',
581
+ actionSubjectId: 'learnMore',
582
+ eventType: 'ui',
583
+ attributes: _objectSpread({}, context)
584
+ };
585
+ };
586
+
587
+ exports.uiLearnMoreLinkClickedEvent = uiLearnMoreLinkClickedEvent;
@@ -60,6 +60,12 @@ Object.defineProperty(exports, "screenAuthPopupEvent", {
60
60
  return _analytics.screenAuthPopupEvent;
61
61
  }
62
62
  });
63
+ Object.defineProperty(exports, "trackAppAccountAuthStarted", {
64
+ enumerable: true,
65
+ get: function get() {
66
+ return _analytics.trackAppAccountAuthStarted;
67
+ }
68
+ });
63
69
  Object.defineProperty(exports, "trackAppAccountConnected", {
64
70
  enumerable: true,
65
71
  get: function get() {
@@ -114,6 +120,12 @@ Object.defineProperty(exports, "uiHoverCardViewedEvent", {
114
120
  return _analytics.uiHoverCardViewedEvent;
115
121
  }
116
122
  });
123
+ Object.defineProperty(exports, "uiLearnMoreLinkClickedEvent", {
124
+ enumerable: true,
125
+ get: function get() {
126
+ return _analytics.uiLearnMoreLinkClickedEvent;
127
+ }
128
+ });
117
129
  Object.defineProperty(exports, "uiRenderFailedEvent", {
118
130
  enumerable: true,
119
131
  get: function get() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "23.7.3",
3
+ "version": "23.8.0",
4
4
  "sideEffects": false
5
5
  }
@@ -34,7 +34,7 @@ var getActionGroupStyles = function getActionGroupStyles(size) {
34
34
 
35
35
  var providerStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n span:first-child {\n margin-right: 0.375rem;\n }\n"])));
36
36
  /**
37
- * This Components is a footer that is used in a Block Card with Flexible UI.
37
+ * This Component is a footer that is used in a Block Card with Flexible UI.
38
38
  * It contains a provider icon if provider is present and an actions list if one is passed.
39
39
  * To be shown as a part of Flexible UI, needs to be wrapped inside of a CustomBlock
40
40
  *
@@ -135,11 +135,12 @@ var BlockCard = function BlockCard(_ref) {
135
135
  details = cardState.details;
136
136
  var data = details && details.data || (0, _jsonld.getEmptyJsonLd)();
137
137
  var meta = details && details.meta;
138
+ var extensionKey = (0, _helpers.getExtensionKey)(details);
138
139
  var extractorOpts = {
139
140
  analytics: analytics,
140
141
  origin: 'smartLinkCard',
141
142
  handleInvoke: handleInvoke,
142
- extensionKey: (0, _helpers.getExtensionKey)(details)
143
+ extensionKey: extensionKey
143
144
  };
144
145
 
145
146
  if (enableFlexibleBlockCard) {
@@ -154,7 +155,8 @@ var BlockCard = function BlockCard(_ref) {
154
155
  onError: onError,
155
156
  renderers: renderers,
156
157
  ui: ui,
157
- analytics: analytics
158
+ analytics: analytics,
159
+ extensionKey: extensionKey
158
160
  };
159
161
 
160
162
  switch (status) {
@@ -63,7 +63,7 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
63
63
  message: {
64
64
  descriptor: _messages.messages.not_found_description
65
65
  },
66
- testId: testId
66
+ testId: "".concat(testId, "-message")
67
67
  })), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, null, /*#__PURE__*/_react.default.createElement(_footer.default, {
68
68
  status: status
69
69
  })));
@@ -112,7 +112,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
112
112
  analytics.operational.invokeSucceededEvent({
113
113
  id: analyticsId,
114
114
  actionType: 'preview',
115
- display: 'block'
115
+ display: _constants.CardDisplay.Block
116
116
  });
117
117
  }
118
118
  }, {
@@ -122,7 +122,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
122
122
  analytics.operational.invokeSucceededEvent({
123
123
  id: analyticsId,
124
124
  actionType: 'view',
125
- display: 'block'
125
+ display: _constants.CardDisplay.Block
126
126
  });
127
127
  }
128
128
  }, {
@@ -132,7 +132,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
132
132
  analytics.operational.invokeSucceededEvent({
133
133
  id: analyticsId,
134
134
  actionType: 'download',
135
- display: 'block'
135
+ display: _constants.CardDisplay.Block
136
136
  });
137
137
  }
138
138
  }]
@@ -49,7 +49,10 @@ var contentStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _
49
49
  var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
50
50
  var _cardState$details, _extractProvider;
51
51
 
52
- var cardState = _ref.cardState,
52
+ var analytics = _ref.analytics,
53
+ cardState = _ref.cardState,
54
+ _ref$extensionKey = _ref.extensionKey,
55
+ extensionKey = _ref$extensionKey === void 0 ? '' : _ref$extensionKey,
53
56
  onAuthorize = _ref.onAuthorize,
54
57
  onClick = _ref.onClick,
55
58
  onError = _ref.onError,
@@ -59,9 +62,17 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
59
62
  url = _ref.url;
60
63
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
61
64
  var providerName = (_extractProvider = (0, _extractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
65
+ var handleAuthorize = (0, _react.useCallback)(function () {
66
+ if (onAuthorize) {
67
+ analytics.track.appAccountAuthStarted({
68
+ extensionKey: extensionKey
69
+ });
70
+ onAuthorize();
71
+ }
72
+ }, [onAuthorize, extensionKey, analytics.track]);
62
73
  var actions = (0, _react.useMemo)(function () {
63
- return onAuthorize ? [(0, _AuthorizeAction.AuthorizeAction)(onAuthorize, providerName)] : [];
64
- }, [onAuthorize, providerName]);
74
+ return onAuthorize ? [(0, _AuthorizeAction.AuthorizeAction)(handleAuthorize, providerName)] : [];
75
+ }, [handleAuthorize, onAuthorize, providerName]);
65
76
  return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, {
66
77
  appearance: "block",
67
78
  cardState: cardState,
@@ -77,7 +88,9 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
77
88
  overrideCss: contentStyles,
78
89
  testId: "".concat(testId, "-content")
79
90
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
80
- providerName: providerName
91
+ providerName: providerName,
92
+ analytics: analytics,
93
+ testId: testId
81
94
  }))), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, null, /*#__PURE__*/_react.default.createElement(_footer.default, {
82
95
  actions: actions,
83
96
  status: _constants.SmartLinkStatus.Unauthorized,