@atlaskit/smart-card 33.2.0 → 33.3.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 (152) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/state/actions/index.js +2 -4
  3. package/dist/cjs/state/analytics/index.js +1 -8
  4. package/dist/cjs/state/flexible-ui-context/index.js +1 -10
  5. package/dist/cjs/state/hooks/useSmartLink.js +1 -4
  6. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +1 -3
  7. package/dist/cjs/state/hooks-external/useSmartLinkReload.js +1 -3
  8. package/dist/cjs/state/index.js +1 -8
  9. package/dist/cjs/utils/analytics/analytics.js +2 -144
  10. package/dist/cjs/utils/analytics/index.js +0 -30
  11. package/dist/cjs/utils/analytics/types.js +1 -5
  12. package/dist/cjs/utils/mocks.js +1 -23
  13. package/dist/cjs/view/BlockCard/index.js +1 -3
  14. package/dist/cjs/view/BlockCard/views/ResolvedView.js +1 -3
  15. package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +2 -4
  16. package/dist/cjs/view/CardWithUrl/component.js +1 -8
  17. package/dist/cjs/view/EmbedCard/index.js +0 -4
  18. package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +3 -5
  19. package/dist/cjs/view/EmbedModal/index.js +1 -3
  20. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -4
  21. package/dist/cjs/view/FlexibleCard/components/actions/download-action/index.js +1 -4
  22. package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +1 -4
  23. package/dist/cjs/view/FlexibleCard/index.js +3 -17
  24. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -3
  25. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -8
  26. package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +3 -5
  27. package/dist/cjs/view/InlineCard/index.js +1 -3
  28. package/dist/cjs/view/LinkUrl/index.js +1 -1
  29. package/dist/es2019/state/actions/index.js +2 -4
  30. package/dist/es2019/state/analytics/index.js +1 -2
  31. package/dist/es2019/state/flexible-ui-context/index.js +0 -7
  32. package/dist/es2019/state/hooks/useSmartLink.js +1 -4
  33. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +1 -3
  34. package/dist/es2019/state/hooks-external/useSmartLinkReload.js +1 -3
  35. package/dist/es2019/state/index.js +1 -2
  36. package/dist/es2019/utils/analytics/analytics.js +2 -145
  37. package/dist/es2019/utils/analytics/index.js +1 -1
  38. package/dist/es2019/utils/analytics/types.js +0 -1
  39. package/dist/es2019/utils/mocks.js +1 -23
  40. package/dist/es2019/view/BlockCard/index.js +1 -3
  41. package/dist/es2019/view/BlockCard/views/ResolvedView.js +1 -3
  42. package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +1 -3
  43. package/dist/es2019/view/CardWithUrl/component.js +1 -8
  44. package/dist/es2019/view/EmbedCard/index.js +0 -4
  45. package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +1 -3
  46. package/dist/es2019/view/EmbedModal/index.js +0 -2
  47. package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -5
  48. package/dist/es2019/view/FlexibleCard/components/actions/download-action/index.js +2 -5
  49. package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -5
  50. package/dist/es2019/view/FlexibleCard/index.js +3 -15
  51. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -3
  52. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -8
  53. package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +2 -4
  54. package/dist/es2019/view/InlineCard/index.js +0 -2
  55. package/dist/es2019/view/LinkUrl/index.js +1 -1
  56. package/dist/esm/state/actions/index.js +2 -4
  57. package/dist/esm/state/analytics/index.js +1 -2
  58. package/dist/esm/state/flexible-ui-context/index.js +0 -9
  59. package/dist/esm/state/hooks/useSmartLink.js +1 -4
  60. package/dist/esm/state/hooks-external/useSmartLinkActions.js +1 -3
  61. package/dist/esm/state/hooks-external/useSmartLinkReload.js +1 -3
  62. package/dist/esm/state/index.js +1 -2
  63. package/dist/esm/utils/analytics/analytics.js +1 -143
  64. package/dist/esm/utils/analytics/index.js +1 -1
  65. package/dist/esm/utils/analytics/types.js +0 -1
  66. package/dist/esm/utils/mocks.js +0 -22
  67. package/dist/esm/view/BlockCard/index.js +1 -3
  68. package/dist/esm/view/BlockCard/views/ResolvedView.js +1 -3
  69. package/dist/esm/view/BlockCard/views/UnauthorisedView.js +2 -4
  70. package/dist/esm/view/CardWithUrl/component.js +1 -8
  71. package/dist/esm/view/EmbedCard/index.js +0 -4
  72. package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +3 -5
  73. package/dist/esm/view/EmbedModal/index.js +1 -3
  74. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -5
  75. package/dist/esm/view/FlexibleCard/components/actions/download-action/index.js +2 -5
  76. package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -5
  77. package/dist/esm/view/FlexibleCard/index.js +4 -18
  78. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -3
  79. package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -8
  80. package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +3 -5
  81. package/dist/esm/view/InlineCard/index.js +1 -3
  82. package/dist/esm/view/LinkUrl/index.js +1 -1
  83. package/dist/types/extractors/common/actions/types.d.ts +0 -2
  84. package/dist/types/state/actions/index.d.ts +1 -2
  85. package/dist/types/state/analytics/index.d.ts +0 -2
  86. package/dist/types/state/flexible-ui-context/index.d.ts +1 -7
  87. package/dist/types/state/flexible-ui-context/types.d.ts +0 -6
  88. package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +0 -6
  89. package/dist/types/state/hooks/useSmartLink.d.ts +0 -7
  90. package/dist/types/state/index.d.ts +0 -1
  91. package/dist/types/utils/analytics/analytics.d.ts +0 -6
  92. package/dist/types/utils/analytics/index.d.ts +1 -1
  93. package/dist/types/utils/analytics/types.d.ts +0 -42
  94. package/dist/types/utils/mocks.d.ts +0 -7
  95. package/dist/types/view/BlockCard/index.d.ts +1 -1
  96. package/dist/types/view/BlockCard/types.d.ts +0 -2
  97. package/dist/types/view/BlockCard/views/types.d.ts +1 -1
  98. package/dist/types/view/CardWithUrl/types.d.ts +0 -2
  99. package/dist/types/view/EmbedCard/types.d.ts +0 -2
  100. package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +1 -1
  101. package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +0 -2
  102. package/dist/types/view/EmbedModal/components/analytics/types.d.ts +0 -2
  103. package/dist/types/view/FlexibleCard/index.d.ts +1 -1
  104. package/dist/types/view/FlexibleCard/types.d.ts +0 -6
  105. package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -1
  106. package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -2
  107. package/dist/types/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
  108. package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +0 -5
  109. package/dist/types/view/HoverCard/types.d.ts +0 -3
  110. package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +0 -3
  111. package/dist/types/view/InlineCard/index.d.ts +1 -1
  112. package/dist/types/view/InlineCard/types.d.ts +0 -2
  113. package/dist/types/view/common/UnauthorisedViewContent.d.ts +0 -6
  114. package/dist/types-ts4.5/extractors/common/actions/types.d.ts +0 -2
  115. package/dist/types-ts4.5/state/actions/index.d.ts +1 -2
  116. package/dist/types-ts4.5/state/analytics/index.d.ts +0 -2
  117. package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +1 -7
  118. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +0 -6
  119. package/dist/types-ts4.5/state/hooks/use-invoke-client-action/types.d.ts +0 -6
  120. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -7
  121. package/dist/types-ts4.5/state/index.d.ts +0 -1
  122. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +0 -6
  123. package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
  124. package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -42
  125. package/dist/types-ts4.5/utils/mocks.d.ts +0 -7
  126. package/dist/types-ts4.5/view/BlockCard/index.d.ts +1 -1
  127. package/dist/types-ts4.5/view/BlockCard/types.d.ts +0 -2
  128. package/dist/types-ts4.5/view/BlockCard/views/types.d.ts +1 -1
  129. package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +0 -2
  130. package/dist/types-ts4.5/view/EmbedCard/types.d.ts +0 -2
  131. package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/index.d.ts +1 -1
  132. package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +0 -2
  133. package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +0 -2
  134. package/dist/types-ts4.5/view/FlexibleCard/index.d.ts +1 -1
  135. package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +0 -6
  136. package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +1 -1
  137. package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +0 -2
  138. package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
  139. package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/types.d.ts +0 -5
  140. package/dist/types-ts4.5/view/HoverCard/types.d.ts +0 -3
  141. package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +0 -3
  142. package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
  143. package/dist/types-ts4.5/view/InlineCard/types.d.ts +0 -2
  144. package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +0 -6
  145. package/package.json +1 -1
  146. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +0 -139
  147. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +0 -126
  148. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +0 -132
  149. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +0 -33
  150. package/dist/types/utils/analytics/__mocks__/analytics.d.ts +0 -2
  151. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +0 -33
  152. package/dist/types-ts4.5/utils/analytics/__mocks__/analytics.d.ts +0 -2
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
10
  var _react = _interopRequireWildcard(require("react"));
12
11
  var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
13
12
  var _constants = require("../../constants");
@@ -18,8 +17,6 @@ var _container = _interopRequireDefault(require("./components/container"));
18
17
  var _utils = require("./utils");
19
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
20
  /**
24
21
  * This represents a Flexible Card: a link represented by a card with metadata.
25
22
  * This is the container in which all Flexible UI Blocks and Elements exist.
@@ -27,9 +24,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
27
24
  * @see Container
28
25
  */
29
26
  var FlexibleCard = function FlexibleCard(_ref) {
30
- var _details$meta2;
31
- var analytics = _ref.analytics,
32
- _ref$appearance = _ref.appearance,
27
+ var _ref$appearance = _ref.appearance,
33
28
  appearance = _ref$appearance === void 0 ? 'flexible' : _ref$appearance,
34
29
  cardState = _ref.cardState,
35
30
  children = _ref.children,
@@ -71,13 +66,6 @@ var FlexibleCard = function FlexibleCard(_ref) {
71
66
  var retry = (0, _utils.getRetryOptions)(url, status, details, onAuthorize);
72
67
  var _ref2 = context || {},
73
68
  title = _ref2.title;
74
- var analyticsContext = (0, _react.useMemo)(function () {
75
- var _details$meta;
76
- return analytics ? _objectSpread(_objectSpread({}, analytics), {}, {
77
- display: appearance,
78
- extensionKey: details === null || details === void 0 || (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.key
79
- }) : undefined;
80
- }, [analytics, appearance, details === null || details === void 0 || (_details$meta2 = details.meta) === null || _details$meta2 === void 0 ? void 0 : _details$meta2.key]);
81
69
  (0, _react.useEffect)(function () {
82
70
  switch (status) {
83
71
  case _constants.SmartLinkStatus.Resolved:
@@ -102,9 +90,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
102
90
  break;
103
91
  }
104
92
  }, [onError, onResolve, status, title, url]);
105
- return /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiAnalyticsContext.Provider, {
106
- value: analyticsContext
107
- }, /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiOptionContext.Provider, {
93
+ return /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiOptionContext.Provider, {
108
94
  value: ui
109
95
  }, /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiContext.Provider, {
110
96
  value: context
@@ -117,6 +103,6 @@ var FlexibleCard = function FlexibleCard(_ref) {
117
103
  hoverPreviewOptions: hoverPreviewOptions,
118
104
  actionOptions: actionOptions,
119
105
  status: status
120
- }), children))));
106
+ }), children)));
121
107
  };
122
108
  var _default = exports.default = FlexibleCard;
@@ -14,7 +14,6 @@ var _react2 = require("@emotion/react");
14
14
  var _popup = _interopRequireDefault(require("@atlaskit/popup"));
15
15
  var _constants = require("../../../constants");
16
16
  var _actions = require("../../../state/actions");
17
- var _analytics = require("../../../state/analytics");
18
17
  var _renderers = require("../../../state/renderers");
19
18
  var _store = require("../../../state/store");
20
19
  var _SmartLinkAnalyticsContext = require("../../../utils/analytics/SmartLinkAnalyticsContext");
@@ -64,8 +63,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
64
63
  var parentSpan = (0, _react.useRef)(null);
65
64
  var renderers = (0, _renderers.useSmartLinkRenderers)();
66
65
  var linkState = (0, _store.useSmartCardState)(url);
67
- var analytics = (0, _analytics.useSmartLinkAnalytics)(url, id);
68
- var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
66
+ var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url),
69
67
  loadMetadata = _useSmartCardActions.loadMetadata;
70
68
  var setMousePosition = (0, _react.useCallback)(function (event) {
71
69
  if (isOpen && canOpen) {
@@ -12,7 +12,6 @@ var _analyticsNext = require("@atlaskit/analytics-next");
12
12
  var _linkProvider = require("@atlaskit/link-provider");
13
13
  var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
14
14
  var _constants = require("../../../constants");
15
- var _analytics2 = require("../../../state/analytics");
16
15
  var _helpers = require("../../../state/helpers");
17
16
  var _store = require("../../../state/store");
18
17
  var _utils = require("../../../utils");
@@ -39,7 +38,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
39
38
  var _linkState$status, _cardState$details;
40
39
  var _ref$id = _ref.id,
41
40
  id = _ref$id === void 0 ? '' : _ref$id,
42
- _analytics = _ref.analytics,
43
41
  cardState = _ref.cardState,
44
42
  onActionClick = _ref.onActionClick,
45
43
  onResolve = _ref.onResolve,
@@ -52,8 +50,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
52
50
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
53
51
  var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
54
52
  fireEvent = _useAnalyticsEvents.fireEvent;
55
- var defaultAnalytics = (0, _analytics2.useSmartLinkAnalytics)(url, id);
56
- var analytics = _analytics !== null && _analytics !== void 0 ? _analytics : defaultAnalytics;
57
53
  var extensionKey = (0, _react.useMemo)(function () {
58
54
  return (0, _helpers.getExtensionKey)(cardState.details);
59
55
  }, [cardState.details]);
@@ -137,8 +133,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
137
133
  actionOptions: actionOptions,
138
134
  ui: _styled.flexibleUiOptions,
139
135
  url: url,
140
- children: null,
141
- analytics: analytics
136
+ children: null
142
137
  };
143
138
  var onClickStopPropagation = (0, _react.useCallback)(function (e) {
144
139
  return e.stopPropagation();
@@ -152,7 +147,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
152
147
  }
153
148
  if (cardState.status === 'unauthorized' && services !== null && services !== void 0 && services.length) {
154
149
  return (0, _react2.jsx)(_unauthorised.default, {
155
- analytics: analytics,
156
150
  extensionKey: extensionKey,
157
151
  id: id,
158
152
  flexibleCardProps: flexibleCardProps,
@@ -166,7 +160,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
166
160
  }
167
161
  if (cardState.status === 'resolved') {
168
162
  return (0, _react2.jsx)(_resolved.default, {
169
- analytics: analytics,
170
163
  cardState: cardState,
171
164
  extensionKey: extensionKey,
172
165
  flexibleCardProps: flexibleCardProps,
@@ -25,8 +25,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
26
  var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
27
27
  var _cardState$details, _extractProvider;
28
- var analytics = _ref.analytics,
29
- _ref$id = _ref.id,
28
+ var _ref$id = _ref.id,
30
29
  id = _ref$id === void 0 ? '' : _ref$id,
31
30
  flexibleCardProps = _ref.flexibleCardProps,
32
31
  _ref$testId = _ref.testId,
@@ -36,7 +35,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
36
35
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
37
36
  var providerName = (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
38
37
  var isProductIntegrationSupported = (0, _helpers.hasAuthScopeOverrides)(cardState.details);
39
- var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
38
+ var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url),
40
39
  authorize = _useSmartCardActions.authorize;
41
40
  var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
42
41
  fireEvent = _useAnalyticsEvents.fireEvent;
@@ -71,8 +70,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
71
70
  testId: "".concat(testId, "-content")
72
71
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
73
72
  providerName: providerName,
74
- isProductIntegrationSupported: isProductIntegrationSupported,
75
- analytics: analytics
73
+ isProductIntegrationSupported: isProductIntegrationSupported
76
74
  }))), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, {
77
75
  overrideCss: _styled.connectButtonStyles,
78
76
  testId: "".concat(testId, "-button")
@@ -56,8 +56,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
56
56
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
57
57
  var InlineCard = exports.InlineCard = function InlineCard(_ref) {
58
58
  var _details$meta, _providerForbidden$te;
59
- var analytics = _ref.analytics,
60
- id = _ref.id,
59
+ var id = _ref.id,
61
60
  url = _ref.url,
62
61
  cardState = _ref.cardState,
63
62
  handleAuthorize = _ref.handleAuthorize,
@@ -146,7 +145,6 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
146
145
  testId: testIdWithStatus,
147
146
  showHoverPreview: showHoverPreview,
148
147
  id: id,
149
- analytics: analytics,
150
148
  extensionKey: extensionKey,
151
149
  truncateInline: truncateInline
152
150
  });
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
20
20
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
21
21
  var PACKAGE_DATA = {
22
22
  packageName: "@atlaskit/smart-card",
23
- packageVersion: "33.2.0",
23
+ packageVersion: "33.3.0",
24
24
  componentName: 'linkUrl'
25
25
  };
26
26
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -8,11 +8,9 @@ import { startUfoExperience } from '../analytics';
8
8
  import { getByDefinitionId, getDefinitionId, getExtensionKey, getServices } from '../helpers';
9
9
  import useInvokeClientAction from '../hooks/use-invoke-client-action';
10
10
  import useResolve from '../hooks/use-resolve';
11
- export const useSmartCardActions = (id, url, analytics) => {
11
+ export const useSmartCardActions = (id, url) => {
12
12
  const resolveUrl = useResolve();
13
- const invokeClientAction = useInvokeClientAction({
14
- analytics
15
- });
13
+ const invokeClientAction = useInvokeClientAction({});
16
14
  const {
17
15
  fireEvent
18
16
  } = useAnalyticsEvents();
@@ -1,2 +1 @@
1
- export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience } from './ufoExperiences';
2
- export { useSmartLinkAnalytics } from './useSmartLinkAnalytics';
1
+ export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience } from './ufoExperiences';
@@ -6,13 +6,6 @@ import { createContext, useContext } from 'react';
6
6
  export const FlexibleUiContext = /*#__PURE__*/createContext(undefined);
7
7
  export const useFlexibleUiContext = () => useContext(FlexibleUiContext);
8
8
 
9
- /**
10
- * This provides the data that will be used by Smart Links Flexible UI to populate it's
11
- * underlying elements.
12
- */
13
- export const FlexibleUiAnalyticsContext = /*#__PURE__*/createContext(undefined);
14
- export const useFlexibleUiAnalyticsContext = () => useContext(FlexibleUiAnalyticsContext);
15
-
16
9
  /**
17
10
  * This provides the ui options that will be used by Smart Links Flexible UI
18
11
  * to render its underlying elements.
@@ -1,7 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { useSmartLinkContext } from '@atlaskit/link-provider';
3
3
  import { useSmartCardActions as useSmartLinkActions } from '../actions';
4
- import { useSmartLinkAnalytics } from '../analytics';
5
4
  import { useSmartLinkConfig } from '../config';
6
5
  import { useSmartLinkRenderers } from '../renderers';
7
6
  import { useSmartCardState as useSmartLinkState } from '../store';
@@ -10,8 +9,7 @@ export function useSmartLink(id, url) {
10
9
  const {
11
10
  store
12
11
  } = useSmartLinkContext();
13
- const analytics = useSmartLinkAnalytics(url, id);
14
- const actions = useSmartLinkActions(id, url, analytics);
12
+ const actions = useSmartLinkActions(id, url);
15
13
  const config = useSmartLinkConfig();
16
14
  const renderers = useSmartLinkRenderers();
17
15
 
@@ -30,7 +28,6 @@ export function useSmartLink(id, url) {
30
28
  state,
31
29
  actions,
32
30
  config,
33
- analytics,
34
31
  renderers,
35
32
  error
36
33
  };
@@ -6,7 +6,6 @@ import { extractInvokePreviewAction } from '../../extractors/action/extract-invo
6
6
  import { extractInvokeViewAction } from '../../extractors/action/extract-invoke-view-action';
7
7
  import { messages } from '../../messages';
8
8
  import { toAction } from '../../utils/actions/to-action';
9
- import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
10
9
  import useInvokeClientAction from '../hooks/use-invoke-client-action';
11
10
  import { useSmartCardState as useLinkState } from '../store';
12
11
  export function useSmartLinkActions({
@@ -17,12 +16,11 @@ export function useSmartLinkActions({
17
16
  }) {
18
17
  const id = useMemo(() => uuid(), []);
19
18
  const linkState = useLinkState(url);
20
- const linkAnalytics = useLinkAnalytics(url, id);
21
19
  const {
22
20
  fireEvent
23
21
  } = useAnalyticsEvents();
24
22
  const invokeClientAction = useInvokeClientAction({
25
- analytics: linkAnalytics
23
+ fireEvent
26
24
  });
27
25
  if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
28
26
  const actions = [];
@@ -1,7 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  import uuid from 'uuid';
3
3
  import { useSmartCardActions as useLinkActions } from '../actions';
4
- import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
5
4
  /**
6
5
  * Exposes a programmatic way to reload the data being used to render a Smart Link.
7
6
  * @param
@@ -11,7 +10,6 @@ export function useSmartLinkReload({
11
10
  url
12
11
  }) {
13
12
  const id = useMemo(() => uuid(), []);
14
- const linkAnalytics = useLinkAnalytics(url, id);
15
- const linkActions = useLinkActions(id, url, linkAnalytics);
13
+ const linkActions = useLinkActions(id, url);
16
14
  return linkActions.reload;
17
15
  }
@@ -1,3 +1,2 @@
1
1
  export { SmartCardContext, SmartCardProvider, useSmartLinkContext } from '@atlaskit/link-provider';
2
- export { useSmartLink, usePrefetch } from './hooks';
3
- export { useSmartLinkAnalytics } from './analytics';
2
+ export { useSmartLink, usePrefetch } from './hooks';
@@ -1,9 +1,8 @@
1
- import { getMeasure } from '../performance';
2
1
  export const ANALYTICS_CHANNEL = 'media';
3
2
  export const context = {
4
3
  componentName: 'smart-cards',
5
4
  packageName: "@atlaskit/smart-card",
6
- packageVersion: "33.2.0"
5
+ packageVersion: "33.3.0"
7
6
  };
8
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
9
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -15,12 +14,6 @@ export let TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
15
14
  TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
16
15
  return TrackQuickActionFailureReason;
17
16
  }({});
18
- const uiActionSubjectIds = {
19
- DownloadAction: 'downloadDocument',
20
- PreviewAction: 'invokePreviewScreen',
21
- ViewAction: 'shortcutGoToLink',
22
- StatusAction: 'issueStatusUpdate'
23
- };
24
17
  export class SmartLinkEvents {
25
18
  insertSmartLink(url, type, createAnalyticsEvent) {
26
19
  fireSmartLinkEvent({
@@ -40,140 +33,4 @@ export const fireSmartLinkEvent = (payload, createAnalyticsEvent) => {
40
33
  if (createAnalyticsEvent) {
41
34
  createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
42
35
  }
43
- };
44
- export const invokeSucceededEvent = ({
45
- id,
46
- actionType,
47
- display,
48
- extensionKey,
49
- definitionId,
50
- destinationProduct,
51
- destinationSubproduct,
52
- location
53
- }) => {
54
- const measure = id ? getMeasure(id, 'resolved') : undefined;
55
- return {
56
- action: 'resolved',
57
- actionSubject: 'smartLinkAction',
58
- eventType: 'operational',
59
- attributes: {
60
- ...context,
61
- id,
62
- actionType,
63
- display,
64
- definitionId,
65
- destinationProduct,
66
- destinationSubproduct,
67
- location,
68
- extensionKey,
69
- duration: measure === null || measure === void 0 ? void 0 : measure.duration
70
- }
71
- };
72
- };
73
- export const invokeFailedEvent = ({
74
- id,
75
- actionType,
76
- display,
77
- reason,
78
- extensionKey,
79
- definitionId,
80
- destinationProduct,
81
- destinationSubproduct,
82
- location
83
- }) => {
84
- const measure = id ? getMeasure(id, 'errored') : undefined;
85
- return {
86
- action: 'unresolved',
87
- actionSubject: 'smartLinkAction',
88
- eventType: 'operational',
89
- attributes: {
90
- ...context,
91
- id,
92
- actionType,
93
- display,
94
- extensionKey,
95
- definitionId,
96
- destinationProduct,
97
- destinationSubproduct,
98
- location,
99
- duration: measure === null || measure === void 0 ? void 0 : measure.duration,
100
- reason
101
- }
102
- };
103
- };
104
- export const uiActionClickedEvent = ({
105
- id,
106
- actionType,
107
- extensionKey,
108
- display,
109
- definitionId,
110
- destinationProduct,
111
- destinationSubproduct,
112
- location
113
- }) => ({
114
- action: 'clicked',
115
- actionSubject: 'button',
116
- actionSubjectId: uiActionSubjectIds[actionType],
117
- eventType: 'ui',
118
- attributes: {
119
- ...context,
120
- id,
121
- display,
122
- actionType: actionType,
123
- extensionKey: extensionKey,
124
- definitionId,
125
- destinationProduct,
126
- destinationSubproduct,
127
- location
128
- }
129
- });
130
- export const uiRenderSuccessEvent = ({
131
- display,
132
- status,
133
- extensionKey,
134
- definitionId,
135
- destinationProduct,
136
- destinationSubproduct,
137
- location,
138
- canBeDatasource
139
- }) => ({
140
- action: 'renderSuccess',
141
- actionSubject: 'smartLink',
142
- eventType: 'ui',
143
- attributes: {
144
- ...context,
145
- status,
146
- extensionKey,
147
- definitionId,
148
- destinationProduct,
149
- destinationSubproduct,
150
- location,
151
- display,
152
- canBeDatasource
153
- }
154
- });
155
- export const uiRenderFailedEvent = ({
156
- display,
157
- error,
158
- errorInfo,
159
- extensionKey,
160
- definitionId,
161
- destinationProduct,
162
- destinationSubproduct,
163
- location
164
- }) => ({
165
- actionSubject: 'smartLink',
166
- action: 'renderFailed',
167
- eventType: 'ui',
168
- attributes: {
169
- ...context,
170
- error,
171
- errorInfo,
172
- display,
173
- extensionKey,
174
- definitionId,
175
- destinationProduct,
176
- destinationSubproduct,
177
- location
178
- }
179
- });
36
+ };
@@ -1 +1 @@
1
- export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiActionClickedEvent, uiRenderSuccessEvent, uiRenderFailedEvent } from './analytics';
1
+ export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent } from './analytics';
@@ -1 +0,0 @@
1
- export {};
@@ -204,26 +204,4 @@ export const fakeFactory = (implementation, implementationPost, implementationPr
204
204
  return await implementationAri(aris);
205
205
  }
206
206
  };
207
- export const waitFor = (time = 1) => new Promise(res => setTimeout(res, time));
208
- export const mockAnalytics = {
209
- ui: {
210
- actionClickedEvent: () => {},
211
- buttonClickedEvent: () => {},
212
- modalClosedEvent: () => {},
213
- renderSuccessEvent: () => {},
214
- renderFailedEvent: () => {},
215
- smartLinkServerActionClickedEvent: () => {}
216
- },
217
- operational: {
218
- invokeSucceededEvent: () => {},
219
- invokeFailedEvent: () => {}
220
- },
221
- track: {
222
- smartLinkQuickActionFailed: () => {},
223
- smartLinkQuickActionStarted: () => {},
224
- smartLinkQuickActionSuccess: () => {}
225
- },
226
- screen: {
227
- modalViewedEvent: () => {}
228
- }
229
- };
207
+ export const waitFor = (time = 1) => new Promise(res => setTimeout(res, time));
@@ -19,7 +19,6 @@ export const BlockCard = ({
19
19
  onResolve,
20
20
  onError,
21
21
  testId,
22
- analytics,
23
22
  actionOptions
24
23
  }) => {
25
24
  const {
@@ -34,8 +33,7 @@ export const BlockCard = ({
34
33
  onError,
35
34
  onResolve,
36
35
  renderers,
37
- actionOptions,
38
- analytics
36
+ actionOptions
39
37
  };
40
38
  switch (status) {
41
39
  case 'pending':
@@ -19,8 +19,7 @@ const ResolvedView = ({
19
19
  onResolve,
20
20
  actionOptions,
21
21
  testId = 'smart-block-resolved-view',
22
- url,
23
- analytics
22
+ url
24
23
  }) => {
25
24
  const [isPreviewBlockErrored, setIsPreviewBlockErrored] = useState(false);
26
25
  useEffect(() => {
@@ -42,7 +41,6 @@ const ResolvedView = ({
42
41
  hideIcon: true
43
42
  }], []);
44
43
  return /*#__PURE__*/React.createElement(FlexibleCard, {
45
- analytics: analytics,
46
44
  appearance: "block",
47
45
  cardState: cardState,
48
46
  onClick: onClick,
@@ -35,7 +35,6 @@ const UnauthorisedView = ({
35
35
  }) => {
36
36
  var _cardState$details, _extractProvider;
37
37
  const {
38
- analytics,
39
38
  cardState,
40
39
  onAuthorize
41
40
  } = props;
@@ -54,13 +53,12 @@ const UnauthorisedView = ({
54
53
  const content = useMemo(() => onAuthorize ? jsx(UnauthorisedViewContent, {
55
54
  providerName: providerName,
56
55
  isProductIntegrationSupported: isProductIntegrationSupported,
57
- analytics: analytics,
58
56
  testId: testId
59
57
  }) : jsx(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
60
58
  values: {
61
59
  context: providerName
62
60
  }
63
- })), [analytics, isProductIntegrationSupported, onAuthorize, providerName, testId]);
61
+ })), [isProductIntegrationSupported, onAuthorize, providerName, testId]);
64
62
  const actions = useMemo(() => onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [], [handleAuthorize, onAuthorize, providerName]);
65
63
  return jsx(UnresolvedView, _extends({}, props, {
66
64
  actions: actions,
@@ -37,7 +37,6 @@ function Component({
37
37
  children,
38
38
  showHoverPreview,
39
39
  hoverPreviewOptions,
40
- analyticsEvents,
41
40
  removeTextHighlightingFromTitle,
42
41
  resolvingPlaceholder,
43
42
  truncateInline
@@ -53,12 +52,10 @@ function Component({
53
52
  const {
54
53
  state,
55
54
  actions,
56
- analytics: defaultAnalytics,
57
55
  config,
58
56
  renderers,
59
57
  error
60
58
  } = useSmartLink(id, url);
61
- const analytics = analyticsEvents || defaultAnalytics;
62
59
  const definitionId = getDefinitionId(state.details);
63
60
  const extensionKey = getExtensionKey(state.details);
64
61
  const resourceType = getResourceType(state.details);
@@ -192,8 +189,7 @@ function Component({
192
189
  url: url,
193
190
  testId: testId,
194
191
  onResolve: onResolve,
195
- onError: onError,
196
- analytics: analytics
192
+ onError: onError
197
193
  }, children);
198
194
  }
199
195
 
@@ -204,7 +200,6 @@ function Component({
204
200
  switch (appearance) {
205
201
  case 'inline':
206
202
  return /*#__PURE__*/React.createElement(InlineCard, {
207
- analytics: analytics,
208
203
  id: id,
209
204
  url: url,
210
205
  renderers: renderers,
@@ -233,7 +228,6 @@ function Component({
233
228
  cardState: state,
234
229
  handleAuthorize: services.length && handleAuthorize || undefined,
235
230
  handleFrameClick: handleClickWrapper,
236
- analytics: analytics,
237
231
  isSelected: isSelected,
238
232
  onResolve: onResolve,
239
233
  onError: onError,
@@ -251,7 +245,6 @@ function Component({
251
245
  handleErrorRetry: handleRetry,
252
246
  handleFrameClick: handleClickWrapper,
253
247
  handleInvoke: handleInvoke,
254
- analytics: analytics,
255
248
  isSelected: isSelected,
256
249
  frameStyle: frameStyle,
257
250
  platform: platform,
@@ -19,7 +19,6 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
19
19
  handleAuthorize,
20
20
  handleErrorRetry,
21
21
  handleFrameClick,
22
- analytics,
23
22
  isSelected,
24
23
  frameStyle,
25
24
  platform,
@@ -56,7 +55,6 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
56
55
  onResolve: onResolve,
57
56
  renderers: renderers,
58
57
  actionOptions: actionOptions,
59
- analytics: analytics,
60
58
  testId: testId ? `${testId}-resolving-view` : 'embed-card-resolving-view'
61
59
  });
62
60
  case 'resolved':
@@ -97,7 +95,6 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
97
95
  onResolve: onResolve,
98
96
  renderers: renderers,
99
97
  actionOptions: actionOptions,
100
- analytics: analytics,
101
98
  testId: testId
102
99
  });
103
100
  }
@@ -110,7 +107,6 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
110
107
  }
111
108
  const unauthorisedViewProps = extractEmbedProps(data, meta, platform);
112
109
  return /*#__PURE__*/React.createElement(UnauthorizedView, {
113
- analytics: analytics,
114
110
  context: unauthorisedViewProps.context,
115
111
  extensionKey: extensionKey,
116
112
  frameStyle: frameStyle,