@atlaskit/smart-card 21.2.0 → 22.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/cjs/extractors/block/index.js +6 -7
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +16 -19
- package/dist/cjs/state/actions/index.js +54 -10
- package/dist/cjs/state/analytics/types.js +5 -0
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +429 -109
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +5 -3
- package/dist/cjs/utils/analytics/analytics.js +241 -74
- package/dist/cjs/utils/analytics/index.js +32 -5
- package/dist/cjs/utils/mocks.js +28 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +2 -2
- package/dist/cjs/view/BlockCard/index.js +6 -5
- package/dist/cjs/view/CardWithUrl/component.js +27 -5
- package/dist/cjs/view/CardWithUrl/loader.js +6 -1
- package/dist/cjs/view/EmbedCard/index.js +3 -2
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +100 -0
- package/dist/cjs/view/EmbedModal/components/analytics/types.js +5 -0
- package/dist/cjs/view/EmbedModal/components/size-experiment/index.js +5 -10
- package/dist/cjs/view/EmbedModal/index.js +54 -15
- package/dist/cjs/view/EmbedModal/types.js +9 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +17 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +5 -2
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +5 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +11 -3
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +36 -8
- package/dist/cjs/view/HoverCard/components/SnippetOrPreview.js +74 -0
- package/dist/cjs/view/HoverCard/index.js +6 -1
- package/dist/cjs/view/HoverCard/styled.js +11 -3
- package/dist/cjs/view/common/Modal.js +29 -4
- package/dist/cjs/view/common/ModalHeader.js +3 -2
- package/dist/es2019/extractors/block/index.js +6 -7
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +16 -10
- package/dist/es2019/state/actions/index.js +54 -10
- package/dist/es2019/state/analytics/types.js +1 -0
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +424 -41
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +5 -3
- package/dist/es2019/utils/analytics/analytics.js +254 -79
- package/dist/es2019/utils/analytics/index.js +32 -4
- package/dist/es2019/utils/mocks.js +26 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/PreviewAction.js +3 -3
- package/dist/es2019/view/BlockCard/index.js +5 -4
- package/dist/es2019/view/CardWithUrl/component.js +27 -5
- package/dist/es2019/view/CardWithUrl/loader.js +6 -1
- package/dist/es2019/view/EmbedCard/index.js +3 -2
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +80 -0
- package/dist/es2019/view/EmbedModal/components/analytics/types.js +1 -0
- package/dist/es2019/view/EmbedModal/components/size-experiment/index.js +5 -9
- package/dist/es2019/view/EmbedModal/index.js +46 -13
- package/dist/es2019/view/EmbedModal/types.js +6 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +17 -7
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +4 -1
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +5 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +11 -3
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +36 -10
- package/dist/es2019/view/HoverCard/components/SnippetOrPreview.js +42 -0
- package/dist/es2019/view/HoverCard/index.js +6 -1
- package/dist/es2019/view/HoverCard/styled.js +8 -0
- package/dist/es2019/view/common/Modal.js +27 -6
- package/dist/es2019/view/common/ModalHeader.js +3 -2
- package/dist/esm/extractors/block/index.js +6 -7
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +17 -19
- package/dist/esm/state/actions/index.js +54 -10
- package/dist/esm/state/analytics/types.js +1 -0
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +428 -111
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +5 -3
- package/dist/esm/utils/analytics/analytics.js +241 -74
- package/dist/esm/utils/analytics/index.js +31 -4
- package/dist/esm/utils/mocks.js +25 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +3 -3
- package/dist/esm/view/BlockCard/index.js +5 -4
- package/dist/esm/view/CardWithUrl/component.js +27 -5
- package/dist/esm/view/CardWithUrl/loader.js +6 -1
- package/dist/esm/view/EmbedCard/index.js +3 -2
- package/dist/esm/view/EmbedModal/components/analytics/index.js +82 -0
- package/dist/esm/view/EmbedModal/components/analytics/types.js +1 -0
- package/dist/esm/view/EmbedModal/components/size-experiment/index.js +5 -10
- package/dist/esm/view/EmbedModal/index.js +52 -15
- package/dist/esm/view/EmbedModal/types.js +6 -1
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +11 -3
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -2
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/elements/media/index.js +5 -2
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +11 -3
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +36 -10
- package/dist/esm/view/HoverCard/components/SnippetOrPreview.js +53 -0
- package/dist/esm/view/HoverCard/index.js +6 -1
- package/dist/esm/view/HoverCard/styled.js +6 -2
- package/dist/esm/view/common/Modal.js +28 -6
- package/dist/esm/view/common/ModalHeader.js +3 -2
- package/dist/types/extractors/block/types.d.ts +4 -2
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +7 -5
- package/dist/types/state/analytics/types.d.ts +9 -0
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +41 -24
- package/dist/types/state/hooks/useSmartLink.d.ts +26 -18
- package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +6 -2
- package/dist/types/utils/analytics/analytics.d.ts +19 -21
- package/dist/types/utils/analytics/index.d.ts +2 -2
- package/dist/types/utils/analytics/types.d.ts +91 -0
- package/dist/types/utils/mocks.d.ts +48 -0
- package/dist/types/utils/types.d.ts +3 -1
- package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +4 -0
- package/dist/types/view/BlockCard/index.d.ts +2 -2
- package/dist/types/view/BlockCard/types.d.ts +4 -4
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/EmbedCard/types.d.ts +2 -2
- package/dist/types/view/EmbedModal/components/analytics/index.d.ts +5 -0
- package/dist/types/view/EmbedModal/components/analytics/types.d.ts +6 -0
- package/dist/types/view/EmbedModal/components/size-experiment/index.d.ts +4 -3
- package/dist/types/view/EmbedModal/index.d.ts +3 -1
- package/dist/types/view/EmbedModal/types.d.ts +14 -4
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/types.d.ts +7 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +15 -0
- package/dist/types/view/FlexibleCard/components/common/image-icon/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +5 -0
- package/dist/types/view/HoverCard/components/SnippetOrPreview.d.ts +4 -0
- package/dist/types/view/HoverCard/styled.d.ts +2 -0
- package/dist/types/view/HoverCard/types.d.ts +5 -0
- package/dist/types/view/common/Modal.d.ts +6 -8
- package/package.json +1 -1
- package/report.api.md +324 -108
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.useSmartLinkAnalytics = void 0;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
8
14
|
var _react = require("react");
|
|
9
15
|
|
|
10
16
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
@@ -17,6 +23,25 @@ var _helpers = require("../helpers");
|
|
|
17
23
|
|
|
18
24
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
19
25
|
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var applyCommonAttributes = function applyCommonAttributes(event, commonAttributes) {
|
|
31
|
+
if (event && event.attributes) {
|
|
32
|
+
for (var _i = 0, _Object$entries = Object.entries(commonAttributes); _i < _Object$entries.length; _i++) {
|
|
33
|
+
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
34
|
+
key = _Object$entries$_i[0],
|
|
35
|
+
value = _Object$entries$_i[1];
|
|
36
|
+
|
|
37
|
+
if (event.attributes[key] === undefined) {
|
|
38
|
+
event.attributes[key] = value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return event;
|
|
44
|
+
};
|
|
20
45
|
/**
|
|
21
46
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
22
47
|
* Can be provided to Card via the analyticsEvents prop to change the analytics events.
|
|
@@ -26,6 +51,8 @@ var _linkProvider = require("@atlaskit/link-provider");
|
|
|
26
51
|
* @param defaultLocation location attribute to be used
|
|
27
52
|
* @returns
|
|
28
53
|
*/
|
|
54
|
+
|
|
55
|
+
|
|
29
56
|
var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytics, id, defaultLocation) {
|
|
30
57
|
var defaultId = id || 'NULL'; // We don't want to trigger a re-render by using useSmartCardState
|
|
31
58
|
|
|
@@ -39,6 +66,17 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
39
66
|
var extractedResourceType = (0, _helpers.getResourceType)(details);
|
|
40
67
|
var extractedSubproduct = (0, _helpers.getSubproduct)(details);
|
|
41
68
|
var extractedProduct = (0, _helpers.getProduct)(details);
|
|
69
|
+
var commonAttributes = (0, _react.useMemo)(function () {
|
|
70
|
+
return {
|
|
71
|
+
id: defaultId,
|
|
72
|
+
definitionId: extractedDefinitionId,
|
|
73
|
+
extensionKey: extractedExtensionKey,
|
|
74
|
+
resourceType: extractedResourceType,
|
|
75
|
+
destinationSubproduct: extractedSubproduct,
|
|
76
|
+
destinationProduct: extractedProduct,
|
|
77
|
+
location: defaultLocation
|
|
78
|
+
};
|
|
79
|
+
}, [defaultId, extractedDefinitionId, extractedExtensionKey, extractedResourceType, extractedSubproduct, extractedProduct, defaultLocation]);
|
|
42
80
|
/** Contains all ui analytics events */
|
|
43
81
|
|
|
44
82
|
var ui = (0, _react.useMemo)(function () {
|
|
@@ -51,10 +89,23 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
51
89
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
52
90
|
* @returns
|
|
53
91
|
*/
|
|
54
|
-
authEvent: function authEvent(
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
92
|
+
authEvent: function authEvent(_ref) {
|
|
93
|
+
var display = _ref.display,
|
|
94
|
+
extensionKey = _ref.extensionKey,
|
|
95
|
+
definitionId = _ref.definitionId,
|
|
96
|
+
resourceType = _ref.resourceType,
|
|
97
|
+
destinationProduct = _ref.destinationProduct,
|
|
98
|
+
destinationSubproduct = _ref.destinationSubproduct,
|
|
99
|
+
location = _ref.location;
|
|
100
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiAuthEvent)({
|
|
101
|
+
display: display,
|
|
102
|
+
extensionKey: extensionKey,
|
|
103
|
+
definitionId: definitionId,
|
|
104
|
+
resourceType: resourceType,
|
|
105
|
+
destinationProduct: destinationProduct,
|
|
106
|
+
destinationSubproduct: destinationSubproduct,
|
|
107
|
+
location: location
|
|
108
|
+
}), commonAttributes));
|
|
58
109
|
},
|
|
59
110
|
|
|
60
111
|
/**
|
|
@@ -65,10 +116,38 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
65
116
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
66
117
|
* @returns
|
|
67
118
|
*/
|
|
68
|
-
authAlternateAccountEvent: function authAlternateAccountEvent(
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
119
|
+
authAlternateAccountEvent: function authAlternateAccountEvent(_ref2) {
|
|
120
|
+
var display = _ref2.display,
|
|
121
|
+
extensionKey = _ref2.extensionKey,
|
|
122
|
+
definitionId = _ref2.definitionId,
|
|
123
|
+
resourceType = _ref2.resourceType,
|
|
124
|
+
destinationProduct = _ref2.destinationProduct,
|
|
125
|
+
destinationSubproduct = _ref2.destinationSubproduct,
|
|
126
|
+
location = _ref2.location;
|
|
127
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiAuthAlternateAccountEvent)({
|
|
128
|
+
display: display,
|
|
129
|
+
extensionKey: extensionKey,
|
|
130
|
+
definitionId: definitionId,
|
|
131
|
+
resourceType: resourceType,
|
|
132
|
+
destinationProduct: destinationProduct,
|
|
133
|
+
destinationSubproduct: destinationSubproduct,
|
|
134
|
+
location: location
|
|
135
|
+
}), commonAttributes));
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* This fires an event that represents when a user
|
|
140
|
+
* click a button.
|
|
141
|
+
* @param data A partial analytics event payload
|
|
142
|
+
*/
|
|
143
|
+
buttonClickedEvent: function buttonClickedEvent(data) {
|
|
144
|
+
return dispatchAnalytics(applyCommonAttributes({
|
|
145
|
+
action: 'clicked',
|
|
146
|
+
actionSubject: 'button',
|
|
147
|
+
actionSubjectId: data.actionSubjectId,
|
|
148
|
+
attributes: _objectSpread(_objectSpread({}, _analytics.context), data.attributes),
|
|
149
|
+
eventType: 'ui'
|
|
150
|
+
}, commonAttributes));
|
|
72
151
|
},
|
|
73
152
|
|
|
74
153
|
/**
|
|
@@ -83,18 +162,29 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
83
162
|
* @param destinationProduct The product the Smart Link is linked to.
|
|
84
163
|
* @returns
|
|
85
164
|
*/
|
|
86
|
-
cardClickedEvent: function cardClickedEvent() {
|
|
87
|
-
var id =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return dispatchAnalytics((0, _analytics.uiCardClickedEvent)(
|
|
165
|
+
cardClickedEvent: function cardClickedEvent(_ref3) {
|
|
166
|
+
var id = _ref3.id,
|
|
167
|
+
display = _ref3.display,
|
|
168
|
+
status = _ref3.status,
|
|
169
|
+
definitionId = _ref3.definitionId,
|
|
170
|
+
extensionKey = _ref3.extensionKey,
|
|
171
|
+
isModifierKeyPressed = _ref3.isModifierKeyPressed,
|
|
172
|
+
location = _ref3.location,
|
|
173
|
+
destinationProduct = _ref3.destinationProduct,
|
|
174
|
+
destinationSubproduct = _ref3.destinationSubproduct,
|
|
175
|
+
actionSubjectId = _ref3.actionSubjectId;
|
|
176
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiCardClickedEvent)({
|
|
177
|
+
id: id,
|
|
178
|
+
display: display,
|
|
179
|
+
status: status,
|
|
180
|
+
definitionId: definitionId,
|
|
181
|
+
extensionKey: extensionKey,
|
|
182
|
+
isModifierKeyPressed: isModifierKeyPressed,
|
|
183
|
+
location: location,
|
|
184
|
+
destinationProduct: destinationProduct,
|
|
185
|
+
destinationSubproduct: destinationSubproduct,
|
|
186
|
+
actionSubjectId: actionSubjectId
|
|
187
|
+
}), commonAttributes));
|
|
98
188
|
},
|
|
99
189
|
|
|
100
190
|
/**
|
|
@@ -107,19 +197,34 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
107
197
|
* @param invokeType Whether the action invoked made a call to a server.
|
|
108
198
|
* @returns
|
|
109
199
|
*/
|
|
110
|
-
actionClickedEvent: function actionClickedEvent() {
|
|
111
|
-
var id =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
200
|
+
actionClickedEvent: function actionClickedEvent(_ref4) {
|
|
201
|
+
var id = _ref4.id,
|
|
202
|
+
actionType = _ref4.actionType,
|
|
203
|
+
display = _ref4.display,
|
|
204
|
+
invokeType = _ref4.invokeType,
|
|
205
|
+
extensionKey = _ref4.extensionKey,
|
|
206
|
+
definitionId = _ref4.definitionId,
|
|
207
|
+
resourceType = _ref4.resourceType,
|
|
208
|
+
destinationProduct = _ref4.destinationProduct,
|
|
209
|
+
destinationSubproduct = _ref4.destinationSubproduct,
|
|
210
|
+
location = _ref4.location;
|
|
116
211
|
(0, _ufoExperiences.startUfoExperience)('smart-link-action-invocation', id, {
|
|
117
212
|
actionType: actionType,
|
|
118
213
|
display: display,
|
|
119
214
|
extensionKey: extensionKey,
|
|
120
215
|
invokeType: invokeType
|
|
121
216
|
});
|
|
122
|
-
dispatchAnalytics((0, _analytics.uiActionClickedEvent)(
|
|
217
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.uiActionClickedEvent)({
|
|
218
|
+
id: id,
|
|
219
|
+
actionType: actionType,
|
|
220
|
+
display: display,
|
|
221
|
+
extensionKey: extensionKey,
|
|
222
|
+
definitionId: definitionId,
|
|
223
|
+
resourceType: resourceType,
|
|
224
|
+
destinationProduct: destinationProduct,
|
|
225
|
+
destinationSubproduct: destinationSubproduct,
|
|
226
|
+
location: location
|
|
227
|
+
}), commonAttributes));
|
|
123
228
|
},
|
|
124
229
|
|
|
125
230
|
/**
|
|
@@ -130,11 +235,24 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
130
235
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
131
236
|
* @param previewInvokeMethod How the preview was triggered.
|
|
132
237
|
*/
|
|
133
|
-
hoverCardOpenLinkClickedEvent: function hoverCardOpenLinkClickedEvent(
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
238
|
+
hoverCardOpenLinkClickedEvent: function hoverCardOpenLinkClickedEvent(_ref5) {
|
|
239
|
+
var previewDisplay = _ref5.previewDisplay,
|
|
240
|
+
definitionId = _ref5.definitionId,
|
|
241
|
+
extensionKey = _ref5.extensionKey,
|
|
242
|
+
destinationProduct = _ref5.destinationProduct,
|
|
243
|
+
destinationSubproduct = _ref5.destinationSubproduct,
|
|
244
|
+
location = _ref5.location,
|
|
245
|
+
previewInvokeMethod = _ref5.previewInvokeMethod;
|
|
246
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardOpenLinkClickedEvent)({
|
|
247
|
+
id: defaultId,
|
|
248
|
+
previewDisplay: previewDisplay,
|
|
249
|
+
definitionId: definitionId,
|
|
250
|
+
extensionKey: extensionKey,
|
|
251
|
+
destinationProduct: destinationProduct,
|
|
252
|
+
destinationSubproduct: destinationSubproduct,
|
|
253
|
+
location: location,
|
|
254
|
+
previewInvokeMethod: previewInvokeMethod
|
|
255
|
+
}), commonAttributes));
|
|
138
256
|
},
|
|
139
257
|
|
|
140
258
|
/**
|
|
@@ -144,10 +262,37 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
144
262
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
145
263
|
* @returns
|
|
146
264
|
*/
|
|
147
|
-
closedAuthEvent: function closedAuthEvent(
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
|
|
265
|
+
closedAuthEvent: function closedAuthEvent(_ref6) {
|
|
266
|
+
var display = _ref6.display,
|
|
267
|
+
extensionKey = _ref6.extensionKey,
|
|
268
|
+
definitionId = _ref6.definitionId,
|
|
269
|
+
resourceType = _ref6.resourceType,
|
|
270
|
+
destinationProduct = _ref6.destinationProduct,
|
|
271
|
+
destinationSubproduct = _ref6.destinationSubproduct,
|
|
272
|
+
location = _ref6.location;
|
|
273
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiClosedAuthEvent)({
|
|
274
|
+
display: display,
|
|
275
|
+
extensionKey: extensionKey,
|
|
276
|
+
definitionId: definitionId,
|
|
277
|
+
resourceType: resourceType,
|
|
278
|
+
destinationProduct: destinationProduct,
|
|
279
|
+
destinationSubproduct: destinationSubproduct,
|
|
280
|
+
location: location
|
|
281
|
+
}), commonAttributes));
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* This fires an event that represents when a user close a modal.
|
|
286
|
+
* @param data A partial analytics event payload
|
|
287
|
+
*/
|
|
288
|
+
modalClosedEvent: function modalClosedEvent(data) {
|
|
289
|
+
return dispatchAnalytics(applyCommonAttributes({
|
|
290
|
+
action: 'closed',
|
|
291
|
+
actionSubject: 'modal',
|
|
292
|
+
actionSubjectId: data.actionSubjectId,
|
|
293
|
+
attributes: _objectSpread(_objectSpread({}, _analytics.context), data.attributes),
|
|
294
|
+
eventType: 'ui'
|
|
295
|
+
}, commonAttributes));
|
|
151
296
|
},
|
|
152
297
|
|
|
153
298
|
/**
|
|
@@ -158,19 +303,35 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
158
303
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
159
304
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
160
305
|
*/
|
|
161
|
-
renderSuccessEvent: function renderSuccessEvent(
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
306
|
+
renderSuccessEvent: function renderSuccessEvent(_ref7) {
|
|
307
|
+
var display = _ref7.display,
|
|
308
|
+
status = _ref7.status,
|
|
309
|
+
id = _ref7.id,
|
|
310
|
+
extensionKey = _ref7.extensionKey,
|
|
311
|
+
definitionId = _ref7.definitionId,
|
|
312
|
+
resourceType = _ref7.resourceType,
|
|
313
|
+
destinationProduct = _ref7.destinationProduct,
|
|
314
|
+
destinationSubproduct = _ref7.destinationSubproduct,
|
|
315
|
+
location = _ref7.location;
|
|
316
|
+
var experienceId = id ? id : defaultId;
|
|
317
|
+
(0, _ufoExperiences.succeedUfoExperience)('smart-link-rendered', experienceId, {
|
|
166
318
|
extensionKey: extensionKey,
|
|
167
319
|
display: display
|
|
168
320
|
}); // UFO will disregard this if authentication experience has not yet been started
|
|
169
321
|
|
|
170
|
-
(0, _ufoExperiences.succeedUfoExperience)('smart-link-authenticated',
|
|
322
|
+
(0, _ufoExperiences.succeedUfoExperience)('smart-link-authenticated', experienceId, {
|
|
171
323
|
display: display
|
|
172
324
|
});
|
|
173
|
-
dispatchAnalytics((0, _analytics.uiRenderSuccessEvent)(
|
|
325
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.uiRenderSuccessEvent)({
|
|
326
|
+
display: display,
|
|
327
|
+
status: status,
|
|
328
|
+
extensionKey: extensionKey,
|
|
329
|
+
definitionId: definitionId,
|
|
330
|
+
resourceType: resourceType,
|
|
331
|
+
destinationProduct: destinationProduct,
|
|
332
|
+
destinationSubproduct: destinationSubproduct,
|
|
333
|
+
location: location
|
|
334
|
+
}), commonAttributes));
|
|
174
335
|
},
|
|
175
336
|
|
|
176
337
|
/**
|
|
@@ -180,16 +341,34 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
180
341
|
* @param error: An error representing why the Smart Link render failed.
|
|
181
342
|
* @param errorInfo: Additional details about the error including the stack trace.
|
|
182
343
|
*/
|
|
183
|
-
renderFailedEvent: function renderFailedEvent(
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
344
|
+
renderFailedEvent: function renderFailedEvent(_ref8) {
|
|
345
|
+
var display = _ref8.display,
|
|
346
|
+
id = _ref8.id,
|
|
347
|
+
error = _ref8.error,
|
|
348
|
+
errorInfo = _ref8.errorInfo,
|
|
349
|
+
extensionKey = _ref8.extensionKey,
|
|
350
|
+
definitionId = _ref8.definitionId,
|
|
351
|
+
resourceType = _ref8.resourceType,
|
|
352
|
+
destinationProduct = _ref8.destinationProduct,
|
|
353
|
+
destinationSubproduct = _ref8.destinationSubproduct,
|
|
354
|
+
location = _ref8.location;
|
|
355
|
+
var experienceId = id ? id : defaultId; // Start and fail the smart-link-rendered experience. If it has already
|
|
188
356
|
// been started nothing happens.
|
|
189
|
-
|
|
190
|
-
(0, _ufoExperiences.
|
|
191
|
-
(0, _ufoExperiences.failUfoExperience)('smart-link-
|
|
192
|
-
|
|
357
|
+
|
|
358
|
+
(0, _ufoExperiences.startUfoExperience)('smart-link-rendered', experienceId);
|
|
359
|
+
(0, _ufoExperiences.failUfoExperience)('smart-link-rendered', experienceId);
|
|
360
|
+
(0, _ufoExperiences.failUfoExperience)('smart-link-authenticated', experienceId);
|
|
361
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.uiRenderFailedEvent)({
|
|
362
|
+
display: display,
|
|
363
|
+
error: error,
|
|
364
|
+
errorInfo: errorInfo,
|
|
365
|
+
extensionKey: extensionKey,
|
|
366
|
+
definitionId: definitionId,
|
|
367
|
+
resourceType: resourceType,
|
|
368
|
+
destinationProduct: destinationProduct,
|
|
369
|
+
destinationSubproduct: destinationSubproduct,
|
|
370
|
+
location: location
|
|
371
|
+
}), commonAttributes));
|
|
193
372
|
},
|
|
194
373
|
|
|
195
374
|
/**
|
|
@@ -200,11 +379,27 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
200
379
|
* @param previewInvokeMethod How the preview was triggered.
|
|
201
380
|
* @returns
|
|
202
381
|
*/
|
|
203
|
-
hoverCardViewedEvent: function hoverCardViewedEvent(
|
|
204
|
-
var
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
382
|
+
hoverCardViewedEvent: function hoverCardViewedEvent(_ref9) {
|
|
383
|
+
var previewDisplay = _ref9.previewDisplay,
|
|
384
|
+
previewInvokeMethod = _ref9.previewInvokeMethod,
|
|
385
|
+
id = _ref9.id,
|
|
386
|
+
extensionKey = _ref9.extensionKey,
|
|
387
|
+
definitionId = _ref9.definitionId,
|
|
388
|
+
resourceType = _ref9.resourceType,
|
|
389
|
+
destinationProduct = _ref9.destinationProduct,
|
|
390
|
+
destinationSubproduct = _ref9.destinationSubproduct,
|
|
391
|
+
location = _ref9.location;
|
|
392
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardViewedEvent)({
|
|
393
|
+
id: id,
|
|
394
|
+
previewDisplay: previewDisplay,
|
|
395
|
+
extensionKey: extensionKey,
|
|
396
|
+
definitionId: definitionId,
|
|
397
|
+
resourceType: resourceType,
|
|
398
|
+
destinationProduct: destinationProduct,
|
|
399
|
+
destinationSubproduct: destinationSubproduct,
|
|
400
|
+
location: location,
|
|
401
|
+
previewInvokeMethod: previewInvokeMethod
|
|
402
|
+
}), commonAttributes));
|
|
208
403
|
},
|
|
209
404
|
|
|
210
405
|
/**
|
|
@@ -216,14 +411,32 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
216
411
|
* @param previewInvokeMethod How the preview was triggered.
|
|
217
412
|
* @returns
|
|
218
413
|
*/
|
|
219
|
-
hoverCardDismissedEvent: function hoverCardDismissedEvent(
|
|
220
|
-
var id =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
414
|
+
hoverCardDismissedEvent: function hoverCardDismissedEvent(_ref10) {
|
|
415
|
+
var id = _ref10.id,
|
|
416
|
+
previewDisplay = _ref10.previewDisplay,
|
|
417
|
+
hoverTime = _ref10.hoverTime,
|
|
418
|
+
previewInvokeMethod = _ref10.previewInvokeMethod,
|
|
419
|
+
extensionKey = _ref10.extensionKey,
|
|
420
|
+
definitionId = _ref10.definitionId,
|
|
421
|
+
resourceType = _ref10.resourceType,
|
|
422
|
+
destinationProduct = _ref10.destinationProduct,
|
|
423
|
+
destinationSubproduct = _ref10.destinationSubproduct,
|
|
424
|
+
location = _ref10.location;
|
|
425
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardDismissedEvent)({
|
|
426
|
+
previewDisplay: previewDisplay,
|
|
427
|
+
id: id,
|
|
428
|
+
hoverTime: hoverTime,
|
|
429
|
+
extensionKey: extensionKey,
|
|
430
|
+
definitionId: definitionId,
|
|
431
|
+
resourceType: resourceType,
|
|
432
|
+
destinationProduct: destinationProduct,
|
|
433
|
+
destinationSubproduct: destinationSubproduct,
|
|
434
|
+
location: location,
|
|
435
|
+
previewInvokeMethod: previewInvokeMethod
|
|
436
|
+
}), commonAttributes));
|
|
224
437
|
}
|
|
225
438
|
};
|
|
226
|
-
}, [
|
|
439
|
+
}, [defaultId, commonAttributes, dispatchAnalytics]);
|
|
227
440
|
/** Contains all operational analytics events */
|
|
228
441
|
|
|
229
442
|
var operational = (0, _react.useMemo)(function () {
|
|
@@ -235,13 +448,28 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
235
448
|
* @param actionType The type of action invoked, e.g. PreviewAction
|
|
236
449
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
237
450
|
*/
|
|
238
|
-
invokeSucceededEvent: function invokeSucceededEvent() {
|
|
239
|
-
var id =
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
451
|
+
invokeSucceededEvent: function invokeSucceededEvent(_ref11) {
|
|
452
|
+
var id = _ref11.id,
|
|
453
|
+
actionType = _ref11.actionType,
|
|
454
|
+
display = _ref11.display,
|
|
455
|
+
extensionKey = _ref11.extensionKey,
|
|
456
|
+
definitionId = _ref11.definitionId,
|
|
457
|
+
resourceType = _ref11.resourceType,
|
|
458
|
+
destinationProduct = _ref11.destinationProduct,
|
|
459
|
+
destinationSubproduct = _ref11.destinationSubproduct,
|
|
460
|
+
location = _ref11.location;
|
|
243
461
|
(0, _ufoExperiences.succeedUfoExperience)('smart-link-action-invocation', id);
|
|
244
|
-
dispatchAnalytics((0, _analytics.invokeSucceededEvent)(
|
|
462
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.invokeSucceededEvent)({
|
|
463
|
+
id: id,
|
|
464
|
+
actionType: actionType,
|
|
465
|
+
display: display,
|
|
466
|
+
extensionKey: extensionKey,
|
|
467
|
+
definitionId: definitionId,
|
|
468
|
+
resourceType: resourceType,
|
|
469
|
+
destinationProduct: destinationProduct,
|
|
470
|
+
destinationSubproduct: destinationSubproduct,
|
|
471
|
+
location: location
|
|
472
|
+
}), commonAttributes));
|
|
245
473
|
},
|
|
246
474
|
|
|
247
475
|
/**
|
|
@@ -252,14 +480,30 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
252
480
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
253
481
|
* @param reason The reason the invocation failed.
|
|
254
482
|
*/
|
|
255
|
-
invokeFailedEvent: function invokeFailedEvent() {
|
|
256
|
-
var id =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
483
|
+
invokeFailedEvent: function invokeFailedEvent(_ref12) {
|
|
484
|
+
var id = _ref12.id,
|
|
485
|
+
actionType = _ref12.actionType,
|
|
486
|
+
display = _ref12.display,
|
|
487
|
+
reason = _ref12.reason,
|
|
488
|
+
extensionKey = _ref12.extensionKey,
|
|
489
|
+
definitionId = _ref12.definitionId,
|
|
490
|
+
resourceType = _ref12.resourceType,
|
|
491
|
+
destinationProduct = _ref12.destinationProduct,
|
|
492
|
+
destinationSubproduct = _ref12.destinationSubproduct,
|
|
493
|
+
location = _ref12.location;
|
|
261
494
|
(0, _ufoExperiences.failUfoExperience)('smart-link-action-invocation', id);
|
|
262
|
-
dispatchAnalytics((0, _analytics.invokeFailedEvent)(
|
|
495
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.invokeFailedEvent)({
|
|
496
|
+
id: id,
|
|
497
|
+
actionType: actionType,
|
|
498
|
+
display: display,
|
|
499
|
+
reason: reason,
|
|
500
|
+
extensionKey: extensionKey,
|
|
501
|
+
definitionId: definitionId,
|
|
502
|
+
resourceType: resourceType,
|
|
503
|
+
destinationProduct: destinationProduct,
|
|
504
|
+
destinationSubproduct: destinationSubproduct,
|
|
505
|
+
location: location
|
|
506
|
+
}), commonAttributes));
|
|
263
507
|
},
|
|
264
508
|
|
|
265
509
|
/**
|
|
@@ -268,15 +512,28 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
268
512
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
269
513
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
270
514
|
*/
|
|
271
|
-
connectSucceededEvent: function connectSucceededEvent() {
|
|
272
|
-
var id =
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
515
|
+
connectSucceededEvent: function connectSucceededEvent(_ref13) {
|
|
516
|
+
var id = _ref13.id,
|
|
517
|
+
extensionKey = _ref13.extensionKey,
|
|
518
|
+
definitionId = _ref13.definitionId,
|
|
519
|
+
resourceType = _ref13.resourceType,
|
|
520
|
+
destinationProduct = _ref13.destinationProduct,
|
|
521
|
+
destinationSubproduct = _ref13.destinationSubproduct,
|
|
522
|
+
location = _ref13.location;
|
|
523
|
+
var experienceId = id ? id : defaultId;
|
|
524
|
+
(0, _ufoExperiences.startUfoExperience)('smart-link-authenticated', experienceId, {
|
|
276
525
|
extensionKey: extensionKey,
|
|
277
526
|
status: 'success'
|
|
278
527
|
});
|
|
279
|
-
dispatchAnalytics((0, _analytics.connectSucceededEvent)(
|
|
528
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.connectSucceededEvent)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
529
|
+
id: experienceId,
|
|
530
|
+
extensionKey: extensionKey,
|
|
531
|
+
definitionId: definitionId,
|
|
532
|
+
resourceType: resourceType,
|
|
533
|
+
destinationProduct: destinationProduct,
|
|
534
|
+
destinationSubproduct: destinationSubproduct,
|
|
535
|
+
location: location
|
|
536
|
+
})), commonAttributes));
|
|
280
537
|
},
|
|
281
538
|
|
|
282
539
|
/**
|
|
@@ -286,16 +543,30 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
286
543
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
287
544
|
* @param reason The reason why the Smart Link connect account failed.
|
|
288
545
|
*/
|
|
289
|
-
connectFailedEvent: function connectFailedEvent() {
|
|
290
|
-
var id =
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
546
|
+
connectFailedEvent: function connectFailedEvent(_ref14) {
|
|
547
|
+
var id = _ref14.id,
|
|
548
|
+
reason = _ref14.reason,
|
|
549
|
+
extensionKey = _ref14.extensionKey,
|
|
550
|
+
definitionId = _ref14.definitionId,
|
|
551
|
+
resourceType = _ref14.resourceType,
|
|
552
|
+
destinationProduct = _ref14.destinationProduct,
|
|
553
|
+
destinationSubproduct = _ref14.destinationSubproduct,
|
|
554
|
+
location = _ref14.location;
|
|
555
|
+
var experienceId = id ? id : defaultId;
|
|
556
|
+
(0, _ufoExperiences.startUfoExperience)('smart-link-authenticated', experienceId, {
|
|
295
557
|
extensionKey: extensionKey,
|
|
296
558
|
status: reason
|
|
297
559
|
});
|
|
298
|
-
dispatchAnalytics((0, _analytics.connectFailedEvent)(
|
|
560
|
+
dispatchAnalytics(applyCommonAttributes((0, _analytics.connectFailedEvent)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
561
|
+
id: experienceId,
|
|
562
|
+
reason: reason,
|
|
563
|
+
extensionKey: extensionKey,
|
|
564
|
+
definitionId: definitionId,
|
|
565
|
+
resourceType: resourceType,
|
|
566
|
+
destinationProduct: destinationProduct,
|
|
567
|
+
destinationSubproduct: destinationSubproduct,
|
|
568
|
+
location: location
|
|
569
|
+
})), commonAttributes));
|
|
299
570
|
},
|
|
300
571
|
|
|
301
572
|
/**
|
|
@@ -307,21 +578,34 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
307
578
|
* @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
|
|
308
579
|
* @param error An error representing why the Smart Link request failed.
|
|
309
580
|
*/
|
|
310
|
-
instrument: function instrument() {
|
|
311
|
-
var id =
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
581
|
+
instrument: function instrument(_ref15) {
|
|
582
|
+
var id = _ref15.id,
|
|
583
|
+
status = _ref15.status,
|
|
584
|
+
extensionKey = _ref15.extensionKey,
|
|
585
|
+
definitionId = _ref15.definitionId,
|
|
586
|
+
resourceType = _ref15.resourceType,
|
|
587
|
+
destinationProduct = _ref15.destinationProduct,
|
|
588
|
+
destinationSubproduct = _ref15.destinationSubproduct,
|
|
589
|
+
location = _ref15.location,
|
|
590
|
+
error = _ref15.error;
|
|
591
|
+
var event = (0, _analytics.instrumentEvent)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
592
|
+
id: id,
|
|
593
|
+
status: status,
|
|
594
|
+
extensionKey: extensionKey,
|
|
595
|
+
definitionId: definitionId,
|
|
596
|
+
resourceType: resourceType,
|
|
597
|
+
destinationProduct: destinationProduct,
|
|
598
|
+
destinationSubproduct: destinationSubproduct,
|
|
599
|
+
location: location,
|
|
600
|
+
error: error
|
|
601
|
+
}));
|
|
318
602
|
|
|
319
603
|
if (event) {
|
|
320
|
-
dispatchAnalytics(event);
|
|
604
|
+
dispatchAnalytics(applyCommonAttributes(event, commonAttributes));
|
|
321
605
|
}
|
|
322
606
|
}
|
|
323
607
|
};
|
|
324
|
-
}, [defaultId,
|
|
608
|
+
}, [defaultId, commonAttributes, dispatchAnalytics]);
|
|
325
609
|
/** Contains all track analytics events */
|
|
326
610
|
|
|
327
611
|
var track = (0, _react.useMemo)(function () {
|
|
@@ -332,13 +616,24 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
332
616
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
333
617
|
* @returns
|
|
334
618
|
*/
|
|
335
|
-
appAccountConnected: function appAccountConnected() {
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
|
|
619
|
+
appAccountConnected: function appAccountConnected(_ref16) {
|
|
620
|
+
var extensionKey = _ref16.extensionKey,
|
|
621
|
+
definitionId = _ref16.definitionId,
|
|
622
|
+
resourceType = _ref16.resourceType,
|
|
623
|
+
destinationProduct = _ref16.destinationProduct,
|
|
624
|
+
destinationSubproduct = _ref16.destinationSubproduct,
|
|
625
|
+
location = _ref16.location;
|
|
626
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.trackAppAccountConnected)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
627
|
+
extensionKey: extensionKey,
|
|
628
|
+
definitionId: definitionId,
|
|
629
|
+
resourceType: resourceType,
|
|
630
|
+
destinationProduct: destinationProduct,
|
|
631
|
+
destinationSubproduct: destinationSubproduct,
|
|
632
|
+
location: location
|
|
633
|
+
})), commonAttributes));
|
|
339
634
|
}
|
|
340
635
|
};
|
|
341
|
-
}, [
|
|
636
|
+
}, [commonAttributes, dispatchAnalytics]);
|
|
342
637
|
/** Contains all screen analytics events */
|
|
343
638
|
|
|
344
639
|
var screen = (0, _react.useMemo)(function () {
|
|
@@ -349,13 +644,38 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
|
|
|
349
644
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
350
645
|
* @returns
|
|
351
646
|
*/
|
|
352
|
-
authPopupEvent: function authPopupEvent() {
|
|
353
|
-
var
|
|
354
|
-
|
|
355
|
-
|
|
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;
|
|
654
|
+
return dispatchAnalytics(applyCommonAttributes((0, _analytics.screenAuthPopupEvent)(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
655
|
+
extensionKey: extensionKey,
|
|
656
|
+
definitionId: definitionId,
|
|
657
|
+
resourceType: resourceType,
|
|
658
|
+
destinationProduct: destinationProduct,
|
|
659
|
+
destinationSubproduct: destinationSubproduct,
|
|
660
|
+
location: location
|
|
661
|
+
})), commonAttributes));
|
|
662
|
+
},
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* This fires an event that represents when a user view a modal.
|
|
666
|
+
* @param data A partial analytics event payload
|
|
667
|
+
*/
|
|
668
|
+
modalViewedEvent: function modalViewedEvent(data) {
|
|
669
|
+
return dispatchAnalytics(applyCommonAttributes({
|
|
670
|
+
action: 'viewed',
|
|
671
|
+
actionSubject: data.name,
|
|
672
|
+
attributes: _objectSpread(_objectSpread({}, _analytics.context), data.attributes),
|
|
673
|
+
eventType: 'screen',
|
|
674
|
+
name: data.name
|
|
675
|
+
}, commonAttributes));
|
|
356
676
|
}
|
|
357
677
|
};
|
|
358
|
-
}, [
|
|
678
|
+
}, [commonAttributes, dispatchAnalytics]);
|
|
359
679
|
return (0, _react.useMemo)(function () {
|
|
360
680
|
return {
|
|
361
681
|
ui: ui,
|