@atlaskit/smart-card 32.7.7 → 32.7.9
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 +16 -0
- package/analytics.spec.yaml +31 -5
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -6
- package/dist/cjs/state/actions/index.js +13 -38
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +59 -306
- package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +2 -7
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +99 -6
- package/dist/cjs/utils/analytics/analytics.js +27 -301
- package/dist/cjs/utils/analytics/index.js +0 -66
- package/dist/cjs/view/CardWithUrl/component.js +7 -23
- package/dist/cjs/view/CardWithUrl/loader.js +14 -5
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +88 -32
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -2
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/cjs/view/HoverCard/index.js +15 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/es2019/extractors/action/extract-invoke-preview-action.js +8 -7
- package/dist/es2019/state/actions/index.js +13 -38
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +7 -239
- package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -3
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +97 -2
- package/dist/es2019/utils/analytics/analytics.js +2 -286
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +8 -24
- package/dist/es2019/view/CardWithUrl/loader.js +9 -1
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +88 -32
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/es2019/view/HoverCard/index.js +10 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +8 -7
- package/dist/esm/state/actions/index.js +13 -38
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +60 -307
- package/dist/esm/utils/analytics/LinkAnalyticsContext.js +2 -7
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +95 -5
- package/dist/esm/utils/analytics/analytics.js +26 -300
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +8 -24
- package/dist/esm/view/CardWithUrl/loader.js +14 -5
- package/dist/esm/view/EmbedModal/components/analytics/index.js +88 -32
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/esm/view/HoverCard/index.js +14 -4
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/types/common/analytics/generated/analytics.types.d.ts +16 -2
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
- package/dist/types/utils/analytics/analytics.d.ts +1 -51
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +0 -60
- package/dist/types/utils/mocks.d.ts +0 -12
- package/dist/types/view/EmbedModal/components/analytics/types.d.ts +1 -0
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +16 -2
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -51
- package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -60
- package/dist/types-ts4.5/utils/mocks.d.ts +0 -12
- package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/package.json +2 -5
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.CardWithURLRenderer = CardWithURLRenderer;
|
|
8
8
|
exports.LazyCardWithUrlContent = void 0;
|
|
9
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _reactErrorBoundary = require("react-error-boundary");
|
|
@@ -17,9 +18,12 @@ var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analyti
|
|
|
17
18
|
var _state = require("../../state");
|
|
18
19
|
var _analytics = require("../../state/analytics");
|
|
19
20
|
var _utils = require("../../utils");
|
|
21
|
+
var _SmartLinkAnalyticsContext = require("../../utils/analytics/SmartLinkAnalyticsContext");
|
|
20
22
|
var _flexible = require("../../utils/flexible");
|
|
21
23
|
var _performance = require("../../utils/performance");
|
|
22
24
|
var _LoadingCardLink = require("./component-lazy/LoadingCardLink");
|
|
25
|
+
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; }
|
|
26
|
+
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
27
|
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); }
|
|
24
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(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; }
|
|
25
29
|
var LazyCardWithUrlContent = exports.LazyCardWithUrlContent = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
@@ -72,6 +76,11 @@ function CardWithURLRenderer(props) {
|
|
|
72
76
|
truncateInline = props.truncateInline;
|
|
73
77
|
var analytics = (0, _state.useSmartLinkAnalytics)(url !== null && url !== void 0 ? url : '', id);
|
|
74
78
|
var isFlexibleUi = (0, _flexible.isFlexibleUiCard)(children);
|
|
79
|
+
var analyticsContext = (0, _SmartLinkAnalyticsContext.useSmartLinkAnalyticsContext)({
|
|
80
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
81
|
+
id: id,
|
|
82
|
+
url: url !== null && url !== void 0 ? url : ''
|
|
83
|
+
});
|
|
75
84
|
var errorHandler = (0, _react.useCallback)(function (error, info) {
|
|
76
85
|
var componentStack = info.componentStack;
|
|
77
86
|
var errorInfo = {
|
|
@@ -83,23 +92,23 @@ function CardWithURLRenderer(props) {
|
|
|
83
92
|
// to the reliability of the smart-card front-end components.
|
|
84
93
|
// Likewise, chunk loading errors are not caused by a failure of smart-card rendering.
|
|
85
94
|
if (error.name === 'ChunkLoadError') {
|
|
86
|
-
fireEvent('operational.smartLink.chunkLoadFailed', {
|
|
95
|
+
fireEvent('operational.smartLink.chunkLoadFailed', _objectSpread(_objectSpread({}, analyticsContext === null || analyticsContext === void 0 ? void 0 : analyticsContext.attributes), {}, {
|
|
87
96
|
display: appearance,
|
|
88
97
|
error: error,
|
|
89
98
|
errorInfo: errorInfo,
|
|
90
99
|
definitionId: null
|
|
91
|
-
});
|
|
100
|
+
}));
|
|
92
101
|
} else if (error.name !== 'APIError') {
|
|
93
102
|
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
94
103
|
(0, _analytics.startUfoExperience)('smart-link-rendered', id || 'NULL');
|
|
95
104
|
(0, _analytics.failUfoExperience)('smart-link-rendered', id || 'NULL');
|
|
96
105
|
(0, _analytics.failUfoExperience)('smart-link-authenticated', id || 'NULL');
|
|
97
|
-
fireEvent('ui.smartLink.renderFailed', {
|
|
106
|
+
fireEvent('ui.smartLink.renderFailed', _objectSpread(_objectSpread({}, analyticsContext === null || analyticsContext === void 0 ? void 0 : analyticsContext.attributes), {}, {
|
|
98
107
|
display: isFlexibleUi ? 'flexible' : appearance,
|
|
99
108
|
id: id !== null && id !== void 0 ? id : null,
|
|
100
109
|
error: error,
|
|
101
110
|
errorInfo: errorInfo
|
|
102
|
-
});
|
|
111
|
+
}));
|
|
103
112
|
} else {
|
|
104
113
|
analytics.ui.renderFailedEvent({
|
|
105
114
|
display: isFlexibleUi ? 'flexible' : appearance,
|
|
@@ -114,7 +123,7 @@ function CardWithURLRenderer(props) {
|
|
|
114
123
|
url: url !== null && url !== void 0 ? url : '',
|
|
115
124
|
err: error
|
|
116
125
|
});
|
|
117
|
-
}, [analytics.ui, appearance, id, onError, url, isFlexibleUi, fireEvent]);
|
|
126
|
+
}, [analytics.ui, analyticsContext, appearance, id, onError, url, isFlexibleUi, fireEvent]);
|
|
118
127
|
if (!url) {
|
|
119
128
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
120
129
|
}
|
|
@@ -8,7 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _constants = require("../../../../constants");
|
|
13
|
+
var _analytics = require("../../../../state/analytics");
|
|
12
14
|
var _types = require("../../types");
|
|
13
15
|
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); }
|
|
14
16
|
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; }
|
|
@@ -18,63 +20,117 @@ var getResizeFrom = function getResizeFrom(size) {
|
|
|
18
20
|
var withAnalytics = function withAnalytics(Component) {
|
|
19
21
|
return function (props) {
|
|
20
22
|
var analytics = props.analytics,
|
|
23
|
+
fireEvent = props.fireEvent,
|
|
24
|
+
extensionKey = props.extensionKey,
|
|
25
|
+
id = props.id,
|
|
21
26
|
onClose = props.onClose,
|
|
22
27
|
onOpen = props.onOpen,
|
|
23
28
|
onOpenFailed = props.onOpenFailed,
|
|
24
29
|
onResize = props.onResize,
|
|
25
30
|
origin = props.origin;
|
|
26
31
|
var handleOnOpen = (0, _react.useCallback)(function (context) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
origin: origin,
|
|
32
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
33
|
+
fireEvent === null || fireEvent === void 0 || fireEvent('screen.embedPreviewModal.viewed', {
|
|
34
|
+
origin: origin !== null && origin !== void 0 ? origin : null,
|
|
31
35
|
size: context.size
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
analytics === null || analytics === void 0 || analytics.screen.modalViewedEvent({
|
|
39
|
+
name: 'embedPreviewModal',
|
|
40
|
+
attributes: {
|
|
41
|
+
origin: origin,
|
|
42
|
+
size: context.size
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
47
|
+
(0, _analytics.succeedUfoExperience)('smart-link-rendered', id || 'NULL', {
|
|
48
|
+
extensionKey: extensionKey,
|
|
49
|
+
display: _constants.CardDisplay.EmbedPreview
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// UFO will disregard this if authentication experience has not yet been started
|
|
53
|
+
(0, _analytics.succeedUfoExperience)('smart-link-authenticated', id || 'NULL', {
|
|
54
|
+
display: _constants.CardDisplay.EmbedPreview
|
|
55
|
+
});
|
|
56
|
+
fireEvent === null || fireEvent === void 0 || fireEvent('ui.smartLink.renderSuccess', {
|
|
57
|
+
display: _constants.CardDisplay.EmbedPreview
|
|
58
|
+
});
|
|
59
|
+
} else {
|
|
60
|
+
analytics === null || analytics === void 0 || analytics.ui.renderSuccessEvent({
|
|
61
|
+
status: 'resolved',
|
|
62
|
+
display: _constants.CardDisplay.EmbedPreview
|
|
63
|
+
});
|
|
64
|
+
}
|
|
38
65
|
if (onOpen) {
|
|
39
66
|
onOpen(context);
|
|
40
67
|
}
|
|
41
|
-
}, [analytics === null || analytics === void 0 ? void 0 : analytics.screen, analytics === null || analytics === void 0 ? void 0 : analytics.ui, onOpen, origin]);
|
|
68
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.screen, analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent, extensionKey, id, onOpen, origin]);
|
|
42
69
|
var handleOnOpenFailed = (0, _react.useCallback)(function (error, errorInfo) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
71
|
+
(0, _analytics.startUfoExperience)('smart-link-rendered', id || 'NULL');
|
|
72
|
+
(0, _analytics.failUfoExperience)('smart-link-rendered', id || 'NULL');
|
|
73
|
+
(0, _analytics.failUfoExperience)('smart-link-authenticated', id || 'NULL');
|
|
74
|
+
fireEvent === null || fireEvent === void 0 || fireEvent('ui.smartLink.renderFailed', {
|
|
75
|
+
display: _constants.CardDisplay.EmbedPreview,
|
|
76
|
+
error: error,
|
|
77
|
+
errorInfo: errorInfo,
|
|
78
|
+
id: id !== null && id !== void 0 ? id : null
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
analytics === null || analytics === void 0 || analytics.ui.renderFailedEvent({
|
|
82
|
+
display: _constants.CardDisplay.EmbedPreview,
|
|
83
|
+
error: error,
|
|
84
|
+
errorInfo: errorInfo
|
|
85
|
+
});
|
|
86
|
+
}
|
|
48
87
|
if (onOpenFailed) {
|
|
49
88
|
onOpenFailed(error, errorInfo);
|
|
50
89
|
}
|
|
51
|
-
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, onOpenFailed]);
|
|
90
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent, id, onOpenFailed]);
|
|
52
91
|
var handleOnClose = (0, _react.useCallback)(function (context) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
origin: origin,
|
|
57
|
-
previewTime: context.duration,
|
|
92
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
93
|
+
var _context$duration;
|
|
94
|
+
fireEvent === null || fireEvent === void 0 || fireEvent('ui.modal.closed.embedPreview', {
|
|
95
|
+
origin: origin !== null && origin !== void 0 ? origin : null,
|
|
96
|
+
previewTime: (_context$duration = context.duration) !== null && _context$duration !== void 0 ? _context$duration : null,
|
|
58
97
|
size: context.size
|
|
59
|
-
}
|
|
60
|
-
}
|
|
98
|
+
});
|
|
99
|
+
} else {
|
|
100
|
+
analytics === null || analytics === void 0 || analytics.ui.modalClosedEvent({
|
|
101
|
+
actionSubjectId: 'embedPreview',
|
|
102
|
+
attributes: {
|
|
103
|
+
origin: origin,
|
|
104
|
+
previewTime: context.duration,
|
|
105
|
+
size: context.size
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
61
109
|
if (onClose) {
|
|
62
110
|
onClose(context);
|
|
63
111
|
}
|
|
64
|
-
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, onClose, origin]);
|
|
112
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent, onClose, origin]);
|
|
65
113
|
var handleOnResize = (0, _react.useCallback)(function (context) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
attributes: {
|
|
114
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
115
|
+
fireEvent === null || fireEvent === void 0 || fireEvent('ui.button.clicked.embedPreviewResize', {
|
|
69
116
|
newSize: context.size,
|
|
70
|
-
origin: origin,
|
|
117
|
+
origin: origin !== null && origin !== void 0 ? origin : null,
|
|
71
118
|
previousSize: getResizeFrom(context.size)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
analytics === null || analytics === void 0 || analytics.ui.buttonClickedEvent({
|
|
122
|
+
actionSubjectId: 'embedPreviewResize',
|
|
123
|
+
attributes: {
|
|
124
|
+
newSize: context.size,
|
|
125
|
+
origin: origin,
|
|
126
|
+
previousSize: getResizeFrom(context.size)
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
74
130
|
if (onResize) {
|
|
75
131
|
onResize(context);
|
|
76
132
|
}
|
|
77
|
-
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, onResize, origin]);
|
|
133
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent, onResize, origin]);
|
|
78
134
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, props, {
|
|
79
135
|
onClose: handleOnClose,
|
|
80
136
|
onOpen: handleOnOpen,
|
|
@@ -12,9 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
17
|
-
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
18
16
|
var _useInvoke = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke"));
|
|
19
17
|
var _utils = require("../../../../../../state/hooks/use-invoke/utils");
|
|
20
18
|
var _useResolve = _interopRequireDefault(require("../../../../../../state/hooks/use-resolve"));
|
|
@@ -32,7 +30,6 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
32
30
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
31
|
isLoading = _useState2[0],
|
|
34
32
|
setIsLoading = _useState2[1];
|
|
35
|
-
var analytics = (0, _flexibleUiContext.useFlexibleUiAnalyticsContext)();
|
|
36
33
|
var invoke = (0, _useInvoke.default)();
|
|
37
34
|
var reload = (0, _useResolve.default)();
|
|
38
35
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -49,16 +46,10 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
49
46
|
smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
50
47
|
_context.prev = 2;
|
|
51
48
|
setIsLoading(true);
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
55
|
-
} else {
|
|
56
|
-
fireEvent("ui.button.clicked.".concat(smartLinkActionType), {});
|
|
57
|
-
}
|
|
49
|
+
if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
|
|
50
|
+
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
58
51
|
} else {
|
|
59
|
-
|
|
60
|
-
smartLinkActionType: smartLinkActionType
|
|
61
|
-
});
|
|
52
|
+
fireEvent("ui.button.clicked.".concat(smartLinkActionType), {});
|
|
62
53
|
}
|
|
63
54
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
64
55
|
smartLinkActionType: smartLinkActionType
|
|
@@ -97,7 +88,7 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
97
88
|
return _context.stop();
|
|
98
89
|
}
|
|
99
90
|
}, _callee, null, [[2, 17]]);
|
|
100
|
-
})), [action,
|
|
91
|
+
})), [action, invoke, onClick, onErrorCallback, reload, fireEvent]);
|
|
101
92
|
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
|
|
102
93
|
isLoading: isLoading,
|
|
103
94
|
onClick: handleClick
|
|
@@ -12,10 +12,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
14
|
var _dropdownMenu = _interopRequireDefault(require("@atlaskit/dropdown-menu"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
17
16
|
var _extractLozengeActionItems = _interopRequireDefault(require("../../../../../../extractors/action/extract-lozenge-action-items"));
|
|
18
|
-
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
19
17
|
var _useInvoke = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke"));
|
|
20
18
|
var _utils = require("../../../../../../state/hooks/use-invoke/utils");
|
|
21
19
|
var _useResolve = _interopRequireDefault(require("../../../../../../state/hooks/use-resolve"));
|
|
@@ -77,8 +75,6 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
77
75
|
errorMessage = _useState12[0],
|
|
78
76
|
setErrorMessage = _useState12[1];
|
|
79
77
|
var reload = (0, _useResolve.default)();
|
|
80
|
-
//TODO EDM-6583 Replace usage of useFlexibleUiAnalyticsContext with linking platform analytics context from find team.
|
|
81
|
-
var analytics = (0, _flexibleUiContext.useFlexibleUiAnalyticsContext)();
|
|
82
78
|
var invoke = (0, _useInvoke.default)();
|
|
83
79
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
84
80
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
@@ -103,11 +99,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
103
99
|
_context.next = 24;
|
|
104
100
|
break;
|
|
105
101
|
}
|
|
106
|
-
|
|
107
|
-
fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
|
|
108
|
-
} else {
|
|
109
|
-
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionClickedEvent();
|
|
110
|
-
}
|
|
102
|
+
fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
|
|
111
103
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
112
104
|
smartLinkActionType: _analytics.TrackQuickActionType.StatusUpdate
|
|
113
105
|
});
|
|
@@ -154,7 +146,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
154
146
|
return function (_x) {
|
|
155
147
|
return _ref3.apply(this, arguments);
|
|
156
148
|
};
|
|
157
|
-
}(), [action.read,
|
|
149
|
+
}(), [action.read, invoke, isLoaded, text, fireEvent]);
|
|
158
150
|
var trigger = (0, _react.useCallback)(function (props) {
|
|
159
151
|
return (0, _react2.jsx)(_lozengeActionTrigger.default, (0, _extends2.default)({}, props, {
|
|
160
152
|
appearance: selected.appearance,
|
|
@@ -170,11 +162,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
170
162
|
while (1) switch (_context2.prev = _context2.next) {
|
|
171
163
|
case 0:
|
|
172
164
|
_context2.prev = 0;
|
|
173
|
-
|
|
174
|
-
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
175
|
-
} else {
|
|
176
|
-
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionListItemClickedEvent();
|
|
177
|
-
}
|
|
165
|
+
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
178
166
|
updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
179
167
|
if (!(updateAction && id)) {
|
|
180
168
|
_context2.next = 17;
|
|
@@ -225,7 +213,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
225
213
|
return function (_x2, _x3, _x4) {
|
|
226
214
|
return _ref4.apply(this, arguments);
|
|
227
215
|
};
|
|
228
|
-
}(), [action === null || action === void 0 ? void 0 : action.update,
|
|
216
|
+
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
|
|
229
217
|
var dropdownItemGroup = (0, _react.useMemo)(function () {
|
|
230
218
|
if (errorMessage) {
|
|
231
219
|
return (0, _react2.jsx)(_lozengeActionError.default, {
|
|
@@ -47,11 +47,7 @@ var LozengeActionError = function LozengeActionError(_ref) {
|
|
|
47
47
|
}, [reload, url]);
|
|
48
48
|
var handlePreviewOpen = (0, _react.useCallback)(function () {
|
|
49
49
|
if (isPreviewAvailable) {
|
|
50
|
-
|
|
51
|
-
fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
|
|
52
|
-
} else {
|
|
53
|
-
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
|
|
54
|
-
}
|
|
50
|
+
fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
|
|
55
51
|
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
56
52
|
invokePreviewAction && invoke(invokePreviewAction);
|
|
57
53
|
} else {
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.HoverCardComponent = void 0;
|
|
8
|
+
exports.HoverCardComponent = exports.HOVER_CARD_SOURCE = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -29,7 +29,7 @@ var _excluded = ["aria-haspopup", "aria-expanded"];
|
|
|
29
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
30
|
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); }
|
|
31
31
|
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; }
|
|
32
|
-
var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
32
|
+
var HOVER_CARD_SOURCE = exports.HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
33
33
|
var FADE_IN_DELAY = 500;
|
|
34
34
|
var FADE_OUT_DELAY = 300;
|
|
35
35
|
var RESOLVE_DELAY = 100;
|
|
@@ -10,7 +10,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
12
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
15
14
|
var _constants = require("../../../constants");
|
|
16
15
|
var _analytics2 = require("../../../state/analytics");
|
|
@@ -68,17 +67,13 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
68
67
|
var isAISummaryEnabled = (0, _aiSummary.getIsAISummaryEnabled)(isAdminHubAIEnabled, cardState.details);
|
|
69
68
|
var services = (0, _helpers.getServices)(linkState.details);
|
|
70
69
|
var statusRef = (0, _react.useRef)(linkStatus);
|
|
71
|
-
var analyticsRef = (0, _react.useRef)(analytics);
|
|
72
70
|
var fireEventRef = (0, _react.useRef)(fireEvent);
|
|
73
71
|
var definitionIdRef = (0, _react.useRef)(definitionId);
|
|
74
72
|
(0, _react.useEffect)(function () {
|
|
75
73
|
/**
|
|
76
|
-
* Must access
|
|
74
|
+
* Must access object value via ref because its not stable
|
|
77
75
|
* and it can trigger useEffect to re-run below
|
|
78
76
|
*/
|
|
79
|
-
if (analyticsRef.current !== analytics) {
|
|
80
|
-
analyticsRef.current = analytics;
|
|
81
|
-
}
|
|
82
77
|
if (statusRef.current !== linkStatus) {
|
|
83
78
|
statusRef.current = linkStatus;
|
|
84
79
|
}
|
|
@@ -88,66 +83,39 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
88
83
|
if (definitionIdRef.current !== definitionId) {
|
|
89
84
|
definitionIdRef.current = definitionId;
|
|
90
85
|
}
|
|
91
|
-
}, [
|
|
86
|
+
}, [linkStatus, fireEvent, definitionId]);
|
|
92
87
|
(0, _react.useEffect)(function () {
|
|
88
|
+
var _definitionIdRef$curr;
|
|
93
89
|
var previewDisplay = 'card';
|
|
94
90
|
var previewInvokeMethod = 'mouse_hover';
|
|
95
91
|
var cardOpenTime = Date.now();
|
|
96
92
|
var fireEventCurrent = fireEventRef.current;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
fireEventCurrent('ui.hoverCard.viewed', {
|
|
94
|
+
previewDisplay: previewDisplay,
|
|
95
|
+
previewInvokeMethod: previewInvokeMethod,
|
|
96
|
+
definitionId: (_definitionIdRef$curr = definitionIdRef.current) !== null && _definitionIdRef$curr !== void 0 ? _definitionIdRef$curr : null
|
|
97
|
+
});
|
|
98
|
+
return function () {
|
|
99
|
+
var _definitionIdRef$curr2;
|
|
100
|
+
var hoverTime = Date.now() - cardOpenTime;
|
|
101
|
+
fireEventCurrent('ui.hoverCard.dismissed', {
|
|
106
102
|
previewDisplay: previewDisplay,
|
|
107
103
|
previewInvokeMethod: previewInvokeMethod,
|
|
108
|
-
|
|
104
|
+
hoverTime: hoverTime,
|
|
105
|
+
definitionId: (_definitionIdRef$curr2 = definitionIdRef.current) !== null && _definitionIdRef$curr2 !== void 0 ? _definitionIdRef$curr2 : null
|
|
109
106
|
});
|
|
110
|
-
}
|
|
111
|
-
return function () {
|
|
112
|
-
var hoverTime = Date.now() - cardOpenTime;
|
|
113
|
-
if ((0, _platformFeatureFlags.fg)('platform_migrate-some-ui-events-smart-card')) {
|
|
114
|
-
var _definitionIdRef$curr2;
|
|
115
|
-
fireEventCurrent('ui.hoverCard.dismissed', {
|
|
116
|
-
previewDisplay: previewDisplay,
|
|
117
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
118
|
-
hoverTime: hoverTime,
|
|
119
|
-
definitionId: (_definitionIdRef$curr2 = definitionIdRef.current) !== null && _definitionIdRef$curr2 !== void 0 ? _definitionIdRef$curr2 : null
|
|
120
|
-
});
|
|
121
|
-
} else {
|
|
122
|
-
analyticsRef.current.ui.hoverCardDismissedEvent({
|
|
123
|
-
previewDisplay: previewDisplay,
|
|
124
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
125
|
-
hoverTime: hoverTime,
|
|
126
|
-
status: statusRef.current
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
107
|
};
|
|
130
108
|
}, []);
|
|
131
109
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
132
110
|
var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
} else {
|
|
141
|
-
analytics.ui.cardClickedEvent({
|
|
142
|
-
id: id,
|
|
143
|
-
display: _constants.CardDisplay.HoverCardPreview,
|
|
144
|
-
status: cardState.status,
|
|
145
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
146
|
-
actionSubjectId: 'titleGoToLink'
|
|
147
|
-
});
|
|
148
|
-
}
|
|
111
|
+
fireEvent('ui.smartLink.clicked.titleGoToLink', {
|
|
112
|
+
id: id,
|
|
113
|
+
display: _constants.CardDisplay.HoverCardPreview,
|
|
114
|
+
isModifierKeyPressed: isModifierKeyPressed,
|
|
115
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
116
|
+
});
|
|
149
117
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
|
|
150
|
-
}, [createAnalyticsEvent,
|
|
118
|
+
}, [createAnalyticsEvent, id, fireEvent, definitionId]);
|
|
151
119
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
152
120
|
var _getMetadata = (0, _utils2.getMetadata)(extensionKey, data),
|
|
153
121
|
subtitle = _getMetadata.subtitle;
|
|
@@ -52,7 +52,6 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
52
52
|
display: _constants.CardDisplay.HoverCardPreview
|
|
53
53
|
});
|
|
54
54
|
fireEvent('ui.smartLink.renderSuccess', {
|
|
55
|
-
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
56
55
|
display: _constants.CardDisplay.HoverCardPreview
|
|
57
56
|
});
|
|
58
57
|
} else {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.StandaloneHoverCard = exports.HoverCard = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _react = require("react");
|
|
8
10
|
var _react2 = require("@emotion/react");
|
|
9
11
|
var _reactErrorBoundary = require("react-error-boundary");
|
|
@@ -15,14 +17,13 @@ var _constants = require("../../constants");
|
|
|
15
17
|
var _state = require("../../state");
|
|
16
18
|
var _analytics = require("../../state/analytics");
|
|
17
19
|
var _modal = require("../../state/modal");
|
|
20
|
+
var _SmartLinkAnalyticsContext = require("../../utils/analytics/SmartLinkAnalyticsContext");
|
|
18
21
|
var _HoverCardComponent = require("./components/HoverCardComponent");
|
|
19
|
-
|
|
22
|
+
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; }
|
|
23
|
+
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; } /**
|
|
20
24
|
* @jsxRuntime classic
|
|
21
25
|
* @jsx jsx
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
|
-
|
|
26
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
27
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
27
28
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
28
29
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
@@ -30,17 +31,23 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
30
31
|
id = props.id,
|
|
31
32
|
children = props.children;
|
|
32
33
|
var analytics = (0, _state.useSmartLinkAnalytics)(url, id);
|
|
34
|
+
var analyticsContext = (0, _SmartLinkAnalyticsContext.useSmartLinkAnalyticsContext)({
|
|
35
|
+
display: _constants.CardDisplay.HoverCardPreview,
|
|
36
|
+
id: id,
|
|
37
|
+
source: _HoverCardComponent.HOVER_CARD_SOURCE,
|
|
38
|
+
url: url
|
|
39
|
+
});
|
|
33
40
|
var onError = (0, _react.useCallback)(function (error, info) {
|
|
34
41
|
if ((0, _platformFeatureFlags.fg)('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
35
42
|
(0, _analytics.startUfoExperience)('smart-link-rendered', id || 'NULL');
|
|
36
43
|
(0, _analytics.failUfoExperience)('smart-link-rendered', id || 'NULL');
|
|
37
44
|
(0, _analytics.failUfoExperience)('smart-link-authenticated', id || 'NULL');
|
|
38
|
-
fireEvent('ui.smartLink.renderFailed', {
|
|
45
|
+
fireEvent('ui.smartLink.renderFailed', _objectSpread(_objectSpread({}, analyticsContext === null || analyticsContext === void 0 ? void 0 : analyticsContext.attributes), {}, {
|
|
39
46
|
display: _constants.CardDisplay.HoverCardPreview,
|
|
40
47
|
id: id !== null && id !== void 0 ? id : null,
|
|
41
48
|
error: error,
|
|
42
49
|
errorInfo: info
|
|
43
|
-
});
|
|
50
|
+
}));
|
|
44
51
|
} else {
|
|
45
52
|
analytics.ui.renderFailedEvent({
|
|
46
53
|
display: _constants.CardDisplay.HoverCardPreview,
|
|
@@ -49,7 +56,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
49
56
|
errorInfo: info
|
|
50
57
|
});
|
|
51
58
|
}
|
|
52
|
-
}, [analytics.ui, id, fireEvent]);
|
|
59
|
+
}, [analytics.ui, analyticsContext, id, fireEvent]);
|
|
53
60
|
return (0, _react2.jsx)(_reactErrorBoundary.ErrorBoundary, {
|
|
54
61
|
fallback: children,
|
|
55
62
|
onError: onError
|
|
@@ -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: "32.7.
|
|
23
|
+
packageVersion: "32.7.9",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -9,7 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
14
13
|
var _constants = require("../../constants");
|
|
15
14
|
var _messages = require("../../messages");
|
|
@@ -23,17 +22,12 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
23
22
|
var providerName = _ref.providerName,
|
|
24
23
|
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
25
24
|
_ref$testId = _ref.testId,
|
|
26
|
-
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId
|
|
27
|
-
analytics = _ref.analytics;
|
|
25
|
+
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId;
|
|
28
26
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
29
27
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
30
28
|
var handleLearnMoreClick = (0, _react.useCallback)(function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
analytics === null || analytics === void 0 || analytics.ui.learnMoreClickedEvent();
|
|
35
|
-
}
|
|
36
|
-
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent]);
|
|
29
|
+
fireEvent('ui.button.clicked.learnMore', {});
|
|
30
|
+
}, [fireEvent]);
|
|
37
31
|
var learnMoreMessage = isProductIntegrationSupported ? _messages.messages.learn_more_about_connecting_account : _messages.messages.learn_more_about_smart_links;
|
|
38
32
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, providerName ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_description, {
|
|
39
33
|
values: {
|