@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,9 +1,32 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
|
|
1
8
|
import { useMemo } from 'react';
|
|
2
9
|
import { getUrl } from '@atlaskit/linking-common';
|
|
3
|
-
import {
|
|
10
|
+
import { connectFailedEvent as _connectFailedEvent, connectSucceededEvent as _connectSucceededEvent, context, instrumentEvent, invokeFailedEvent as _invokeFailedEvent, invokeSucceededEvent as _invokeSucceededEvent, screenAuthPopupEvent, trackAppAccountConnected, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
|
|
4
11
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
|
|
5
|
-
import { getDefinitionId, getExtensionKey, getResourceType, getSubproduct
|
|
12
|
+
import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getSubproduct } from '../helpers';
|
|
6
13
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
14
|
+
|
|
15
|
+
var applyCommonAttributes = function applyCommonAttributes(event, commonAttributes) {
|
|
16
|
+
if (event && event.attributes) {
|
|
17
|
+
for (var _i = 0, _Object$entries = Object.entries(commonAttributes); _i < _Object$entries.length; _i++) {
|
|
18
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
19
|
+
key = _Object$entries$_i[0],
|
|
20
|
+
value = _Object$entries$_i[1];
|
|
21
|
+
|
|
22
|
+
if (event.attributes[key] === undefined) {
|
|
23
|
+
event.attributes[key] = value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return event;
|
|
29
|
+
};
|
|
7
30
|
/**
|
|
8
31
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
9
32
|
* Can be provided to Card via the analyticsEvents prop to change the analytics events.
|
|
@@ -14,6 +37,7 @@ import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
|
14
37
|
* @returns
|
|
15
38
|
*/
|
|
16
39
|
|
|
40
|
+
|
|
17
41
|
export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytics, id, defaultLocation) {
|
|
18
42
|
var defaultId = id || 'NULL'; // We don't want to trigger a re-render by using useSmartCardState
|
|
19
43
|
|
|
@@ -27,6 +51,17 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
27
51
|
var extractedResourceType = getResourceType(details);
|
|
28
52
|
var extractedSubproduct = getSubproduct(details);
|
|
29
53
|
var extractedProduct = getProduct(details);
|
|
54
|
+
var commonAttributes = useMemo(function () {
|
|
55
|
+
return {
|
|
56
|
+
id: defaultId,
|
|
57
|
+
definitionId: extractedDefinitionId,
|
|
58
|
+
extensionKey: extractedExtensionKey,
|
|
59
|
+
resourceType: extractedResourceType,
|
|
60
|
+
destinationSubproduct: extractedSubproduct,
|
|
61
|
+
destinationProduct: extractedProduct,
|
|
62
|
+
location: defaultLocation
|
|
63
|
+
};
|
|
64
|
+
}, [defaultId, extractedDefinitionId, extractedExtensionKey, extractedResourceType, extractedSubproduct, extractedProduct, defaultLocation]);
|
|
30
65
|
/** Contains all ui analytics events */
|
|
31
66
|
|
|
32
67
|
var ui = useMemo(function () {
|
|
@@ -39,10 +74,23 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
39
74
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
40
75
|
* @returns
|
|
41
76
|
*/
|
|
42
|
-
authEvent: function authEvent(
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
77
|
+
authEvent: function authEvent(_ref) {
|
|
78
|
+
var display = _ref.display,
|
|
79
|
+
extensionKey = _ref.extensionKey,
|
|
80
|
+
definitionId = _ref.definitionId,
|
|
81
|
+
resourceType = _ref.resourceType,
|
|
82
|
+
destinationProduct = _ref.destinationProduct,
|
|
83
|
+
destinationSubproduct = _ref.destinationSubproduct,
|
|
84
|
+
location = _ref.location;
|
|
85
|
+
return dispatchAnalytics(applyCommonAttributes(uiAuthEvent({
|
|
86
|
+
display: display,
|
|
87
|
+
extensionKey: extensionKey,
|
|
88
|
+
definitionId: definitionId,
|
|
89
|
+
resourceType: resourceType,
|
|
90
|
+
destinationProduct: destinationProduct,
|
|
91
|
+
destinationSubproduct: destinationSubproduct,
|
|
92
|
+
location: location
|
|
93
|
+
}), commonAttributes));
|
|
46
94
|
},
|
|
47
95
|
|
|
48
96
|
/**
|
|
@@ -53,10 +101,38 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
53
101
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
54
102
|
* @returns
|
|
55
103
|
*/
|
|
56
|
-
authAlternateAccountEvent: function authAlternateAccountEvent(
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
104
|
+
authAlternateAccountEvent: function authAlternateAccountEvent(_ref2) {
|
|
105
|
+
var display = _ref2.display,
|
|
106
|
+
extensionKey = _ref2.extensionKey,
|
|
107
|
+
definitionId = _ref2.definitionId,
|
|
108
|
+
resourceType = _ref2.resourceType,
|
|
109
|
+
destinationProduct = _ref2.destinationProduct,
|
|
110
|
+
destinationSubproduct = _ref2.destinationSubproduct,
|
|
111
|
+
location = _ref2.location;
|
|
112
|
+
return dispatchAnalytics(applyCommonAttributes(uiAuthAlternateAccountEvent({
|
|
113
|
+
display: display,
|
|
114
|
+
extensionKey: extensionKey,
|
|
115
|
+
definitionId: definitionId,
|
|
116
|
+
resourceType: resourceType,
|
|
117
|
+
destinationProduct: destinationProduct,
|
|
118
|
+
destinationSubproduct: destinationSubproduct,
|
|
119
|
+
location: location
|
|
120
|
+
}), commonAttributes));
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* This fires an event that represents when a user
|
|
125
|
+
* click a button.
|
|
126
|
+
* @param data A partial analytics event payload
|
|
127
|
+
*/
|
|
128
|
+
buttonClickedEvent: function buttonClickedEvent(data) {
|
|
129
|
+
return dispatchAnalytics(applyCommonAttributes({
|
|
130
|
+
action: 'clicked',
|
|
131
|
+
actionSubject: 'button',
|
|
132
|
+
actionSubjectId: data.actionSubjectId,
|
|
133
|
+
attributes: _objectSpread(_objectSpread({}, context), data.attributes),
|
|
134
|
+
eventType: 'ui'
|
|
135
|
+
}, commonAttributes));
|
|
60
136
|
},
|
|
61
137
|
|
|
62
138
|
/**
|
|
@@ -71,18 +147,29 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
71
147
|
* @param destinationProduct The product the Smart Link is linked to.
|
|
72
148
|
* @returns
|
|
73
149
|
*/
|
|
74
|
-
cardClickedEvent: function cardClickedEvent() {
|
|
75
|
-
var id =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return dispatchAnalytics(uiCardClickedEvent(
|
|
150
|
+
cardClickedEvent: function cardClickedEvent(_ref3) {
|
|
151
|
+
var id = _ref3.id,
|
|
152
|
+
display = _ref3.display,
|
|
153
|
+
status = _ref3.status,
|
|
154
|
+
definitionId = _ref3.definitionId,
|
|
155
|
+
extensionKey = _ref3.extensionKey,
|
|
156
|
+
isModifierKeyPressed = _ref3.isModifierKeyPressed,
|
|
157
|
+
location = _ref3.location,
|
|
158
|
+
destinationProduct = _ref3.destinationProduct,
|
|
159
|
+
destinationSubproduct = _ref3.destinationSubproduct,
|
|
160
|
+
actionSubjectId = _ref3.actionSubjectId;
|
|
161
|
+
return dispatchAnalytics(applyCommonAttributes(uiCardClickedEvent({
|
|
162
|
+
id: id,
|
|
163
|
+
display: display,
|
|
164
|
+
status: status,
|
|
165
|
+
definitionId: definitionId,
|
|
166
|
+
extensionKey: extensionKey,
|
|
167
|
+
isModifierKeyPressed: isModifierKeyPressed,
|
|
168
|
+
location: location,
|
|
169
|
+
destinationProduct: destinationProduct,
|
|
170
|
+
destinationSubproduct: destinationSubproduct,
|
|
171
|
+
actionSubjectId: actionSubjectId
|
|
172
|
+
}), commonAttributes));
|
|
86
173
|
},
|
|
87
174
|
|
|
88
175
|
/**
|
|
@@ -95,19 +182,34 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
95
182
|
* @param invokeType Whether the action invoked made a call to a server.
|
|
96
183
|
* @returns
|
|
97
184
|
*/
|
|
98
|
-
actionClickedEvent: function actionClickedEvent() {
|
|
99
|
-
var id =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
185
|
+
actionClickedEvent: function actionClickedEvent(_ref4) {
|
|
186
|
+
var id = _ref4.id,
|
|
187
|
+
actionType = _ref4.actionType,
|
|
188
|
+
display = _ref4.display,
|
|
189
|
+
invokeType = _ref4.invokeType,
|
|
190
|
+
extensionKey = _ref4.extensionKey,
|
|
191
|
+
definitionId = _ref4.definitionId,
|
|
192
|
+
resourceType = _ref4.resourceType,
|
|
193
|
+
destinationProduct = _ref4.destinationProduct,
|
|
194
|
+
destinationSubproduct = _ref4.destinationSubproduct,
|
|
195
|
+
location = _ref4.location;
|
|
104
196
|
startUfoExperience('smart-link-action-invocation', id, {
|
|
105
197
|
actionType: actionType,
|
|
106
198
|
display: display,
|
|
107
199
|
extensionKey: extensionKey,
|
|
108
200
|
invokeType: invokeType
|
|
109
201
|
});
|
|
110
|
-
dispatchAnalytics(uiActionClickedEvent(
|
|
202
|
+
dispatchAnalytics(applyCommonAttributes(uiActionClickedEvent({
|
|
203
|
+
id: id,
|
|
204
|
+
actionType: actionType,
|
|
205
|
+
display: display,
|
|
206
|
+
extensionKey: extensionKey,
|
|
207
|
+
definitionId: definitionId,
|
|
208
|
+
resourceType: resourceType,
|
|
209
|
+
destinationProduct: destinationProduct,
|
|
210
|
+
destinationSubproduct: destinationSubproduct,
|
|
211
|
+
location: location
|
|
212
|
+
}), commonAttributes));
|
|
111
213
|
},
|
|
112
214
|
|
|
113
215
|
/**
|
|
@@ -118,11 +220,24 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
118
220
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
119
221
|
* @param previewInvokeMethod How the preview was triggered.
|
|
120
222
|
*/
|
|
121
|
-
hoverCardOpenLinkClickedEvent: function hoverCardOpenLinkClickedEvent(
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
223
|
+
hoverCardOpenLinkClickedEvent: function hoverCardOpenLinkClickedEvent(_ref5) {
|
|
224
|
+
var previewDisplay = _ref5.previewDisplay,
|
|
225
|
+
definitionId = _ref5.definitionId,
|
|
226
|
+
extensionKey = _ref5.extensionKey,
|
|
227
|
+
destinationProduct = _ref5.destinationProduct,
|
|
228
|
+
destinationSubproduct = _ref5.destinationSubproduct,
|
|
229
|
+
location = _ref5.location,
|
|
230
|
+
previewInvokeMethod = _ref5.previewInvokeMethod;
|
|
231
|
+
dispatchAnalytics(applyCommonAttributes(uiHoverCardOpenLinkClickedEvent({
|
|
232
|
+
id: defaultId,
|
|
233
|
+
previewDisplay: previewDisplay,
|
|
234
|
+
definitionId: definitionId,
|
|
235
|
+
extensionKey: extensionKey,
|
|
236
|
+
destinationProduct: destinationProduct,
|
|
237
|
+
destinationSubproduct: destinationSubproduct,
|
|
238
|
+
location: location,
|
|
239
|
+
previewInvokeMethod: previewInvokeMethod
|
|
240
|
+
}), commonAttributes));
|
|
126
241
|
},
|
|
127
242
|
|
|
128
243
|
/**
|
|
@@ -132,10 +247,37 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
132
247
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
133
248
|
* @returns
|
|
134
249
|
*/
|
|
135
|
-
closedAuthEvent: function closedAuthEvent(
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
|
|
250
|
+
closedAuthEvent: function closedAuthEvent(_ref6) {
|
|
251
|
+
var display = _ref6.display,
|
|
252
|
+
extensionKey = _ref6.extensionKey,
|
|
253
|
+
definitionId = _ref6.definitionId,
|
|
254
|
+
resourceType = _ref6.resourceType,
|
|
255
|
+
destinationProduct = _ref6.destinationProduct,
|
|
256
|
+
destinationSubproduct = _ref6.destinationSubproduct,
|
|
257
|
+
location = _ref6.location;
|
|
258
|
+
return dispatchAnalytics(applyCommonAttributes(uiClosedAuthEvent({
|
|
259
|
+
display: display,
|
|
260
|
+
extensionKey: extensionKey,
|
|
261
|
+
definitionId: definitionId,
|
|
262
|
+
resourceType: resourceType,
|
|
263
|
+
destinationProduct: destinationProduct,
|
|
264
|
+
destinationSubproduct: destinationSubproduct,
|
|
265
|
+
location: location
|
|
266
|
+
}), commonAttributes));
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* This fires an event that represents when a user close a modal.
|
|
271
|
+
* @param data A partial analytics event payload
|
|
272
|
+
*/
|
|
273
|
+
modalClosedEvent: function modalClosedEvent(data) {
|
|
274
|
+
return dispatchAnalytics(applyCommonAttributes({
|
|
275
|
+
action: 'closed',
|
|
276
|
+
actionSubject: 'modal',
|
|
277
|
+
actionSubjectId: data.actionSubjectId,
|
|
278
|
+
attributes: _objectSpread(_objectSpread({}, context), data.attributes),
|
|
279
|
+
eventType: 'ui'
|
|
280
|
+
}, commonAttributes));
|
|
139
281
|
},
|
|
140
282
|
|
|
141
283
|
/**
|
|
@@ -146,19 +288,35 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
146
288
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
147
289
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
148
290
|
*/
|
|
149
|
-
renderSuccessEvent: function renderSuccessEvent(
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
291
|
+
renderSuccessEvent: function renderSuccessEvent(_ref7) {
|
|
292
|
+
var display = _ref7.display,
|
|
293
|
+
status = _ref7.status,
|
|
294
|
+
id = _ref7.id,
|
|
295
|
+
extensionKey = _ref7.extensionKey,
|
|
296
|
+
definitionId = _ref7.definitionId,
|
|
297
|
+
resourceType = _ref7.resourceType,
|
|
298
|
+
destinationProduct = _ref7.destinationProduct,
|
|
299
|
+
destinationSubproduct = _ref7.destinationSubproduct,
|
|
300
|
+
location = _ref7.location;
|
|
301
|
+
var experienceId = id ? id : defaultId;
|
|
302
|
+
succeedUfoExperience('smart-link-rendered', experienceId, {
|
|
154
303
|
extensionKey: extensionKey,
|
|
155
304
|
display: display
|
|
156
305
|
}); // UFO will disregard this if authentication experience has not yet been started
|
|
157
306
|
|
|
158
|
-
succeedUfoExperience('smart-link-authenticated',
|
|
307
|
+
succeedUfoExperience('smart-link-authenticated', experienceId, {
|
|
159
308
|
display: display
|
|
160
309
|
});
|
|
161
|
-
dispatchAnalytics(uiRenderSuccessEvent(
|
|
310
|
+
dispatchAnalytics(applyCommonAttributes(uiRenderSuccessEvent({
|
|
311
|
+
display: display,
|
|
312
|
+
status: status,
|
|
313
|
+
extensionKey: extensionKey,
|
|
314
|
+
definitionId: definitionId,
|
|
315
|
+
resourceType: resourceType,
|
|
316
|
+
destinationProduct: destinationProduct,
|
|
317
|
+
destinationSubproduct: destinationSubproduct,
|
|
318
|
+
location: location
|
|
319
|
+
}), commonAttributes));
|
|
162
320
|
},
|
|
163
321
|
|
|
164
322
|
/**
|
|
@@ -168,16 +326,34 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
168
326
|
* @param error: An error representing why the Smart Link render failed.
|
|
169
327
|
* @param errorInfo: Additional details about the error including the stack trace.
|
|
170
328
|
*/
|
|
171
|
-
renderFailedEvent: function renderFailedEvent(
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
329
|
+
renderFailedEvent: function renderFailedEvent(_ref8) {
|
|
330
|
+
var display = _ref8.display,
|
|
331
|
+
id = _ref8.id,
|
|
332
|
+
error = _ref8.error,
|
|
333
|
+
errorInfo = _ref8.errorInfo,
|
|
334
|
+
extensionKey = _ref8.extensionKey,
|
|
335
|
+
definitionId = _ref8.definitionId,
|
|
336
|
+
resourceType = _ref8.resourceType,
|
|
337
|
+
destinationProduct = _ref8.destinationProduct,
|
|
338
|
+
destinationSubproduct = _ref8.destinationSubproduct,
|
|
339
|
+
location = _ref8.location;
|
|
340
|
+
var experienceId = id ? id : defaultId; // Start and fail the smart-link-rendered experience. If it has already
|
|
176
341
|
// been started nothing happens.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
failUfoExperience('smart-link-
|
|
180
|
-
|
|
342
|
+
|
|
343
|
+
startUfoExperience('smart-link-rendered', experienceId);
|
|
344
|
+
failUfoExperience('smart-link-rendered', experienceId);
|
|
345
|
+
failUfoExperience('smart-link-authenticated', experienceId);
|
|
346
|
+
dispatchAnalytics(applyCommonAttributes(uiRenderFailedEvent({
|
|
347
|
+
display: display,
|
|
348
|
+
error: error,
|
|
349
|
+
errorInfo: errorInfo,
|
|
350
|
+
extensionKey: extensionKey,
|
|
351
|
+
definitionId: definitionId,
|
|
352
|
+
resourceType: resourceType,
|
|
353
|
+
destinationProduct: destinationProduct,
|
|
354
|
+
destinationSubproduct: destinationSubproduct,
|
|
355
|
+
location: location
|
|
356
|
+
}), commonAttributes));
|
|
181
357
|
},
|
|
182
358
|
|
|
183
359
|
/**
|
|
@@ -188,11 +364,27 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
188
364
|
* @param previewInvokeMethod How the preview was triggered.
|
|
189
365
|
* @returns
|
|
190
366
|
*/
|
|
191
|
-
hoverCardViewedEvent: function hoverCardViewedEvent(
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
367
|
+
hoverCardViewedEvent: function hoverCardViewedEvent(_ref9) {
|
|
368
|
+
var previewDisplay = _ref9.previewDisplay,
|
|
369
|
+
previewInvokeMethod = _ref9.previewInvokeMethod,
|
|
370
|
+
id = _ref9.id,
|
|
371
|
+
extensionKey = _ref9.extensionKey,
|
|
372
|
+
definitionId = _ref9.definitionId,
|
|
373
|
+
resourceType = _ref9.resourceType,
|
|
374
|
+
destinationProduct = _ref9.destinationProduct,
|
|
375
|
+
destinationSubproduct = _ref9.destinationSubproduct,
|
|
376
|
+
location = _ref9.location;
|
|
377
|
+
return dispatchAnalytics(applyCommonAttributes(uiHoverCardViewedEvent({
|
|
378
|
+
id: id,
|
|
379
|
+
previewDisplay: previewDisplay,
|
|
380
|
+
extensionKey: extensionKey,
|
|
381
|
+
definitionId: definitionId,
|
|
382
|
+
resourceType: resourceType,
|
|
383
|
+
destinationProduct: destinationProduct,
|
|
384
|
+
destinationSubproduct: destinationSubproduct,
|
|
385
|
+
location: location,
|
|
386
|
+
previewInvokeMethod: previewInvokeMethod
|
|
387
|
+
}), commonAttributes));
|
|
196
388
|
},
|
|
197
389
|
|
|
198
390
|
/**
|
|
@@ -204,14 +396,32 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
204
396
|
* @param previewInvokeMethod How the preview was triggered.
|
|
205
397
|
* @returns
|
|
206
398
|
*/
|
|
207
|
-
hoverCardDismissedEvent: function hoverCardDismissedEvent(
|
|
208
|
-
var id =
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
399
|
+
hoverCardDismissedEvent: function hoverCardDismissedEvent(_ref10) {
|
|
400
|
+
var id = _ref10.id,
|
|
401
|
+
previewDisplay = _ref10.previewDisplay,
|
|
402
|
+
hoverTime = _ref10.hoverTime,
|
|
403
|
+
previewInvokeMethod = _ref10.previewInvokeMethod,
|
|
404
|
+
extensionKey = _ref10.extensionKey,
|
|
405
|
+
definitionId = _ref10.definitionId,
|
|
406
|
+
resourceType = _ref10.resourceType,
|
|
407
|
+
destinationProduct = _ref10.destinationProduct,
|
|
408
|
+
destinationSubproduct = _ref10.destinationSubproduct,
|
|
409
|
+
location = _ref10.location;
|
|
410
|
+
return dispatchAnalytics(applyCommonAttributes(uiHoverCardDismissedEvent({
|
|
411
|
+
previewDisplay: previewDisplay,
|
|
412
|
+
id: id,
|
|
413
|
+
hoverTime: hoverTime,
|
|
414
|
+
extensionKey: extensionKey,
|
|
415
|
+
definitionId: definitionId,
|
|
416
|
+
resourceType: resourceType,
|
|
417
|
+
destinationProduct: destinationProduct,
|
|
418
|
+
destinationSubproduct: destinationSubproduct,
|
|
419
|
+
location: location,
|
|
420
|
+
previewInvokeMethod: previewInvokeMethod
|
|
421
|
+
}), commonAttributes));
|
|
212
422
|
}
|
|
213
423
|
};
|
|
214
|
-
}, [
|
|
424
|
+
}, [defaultId, commonAttributes, dispatchAnalytics]);
|
|
215
425
|
/** Contains all operational analytics events */
|
|
216
426
|
|
|
217
427
|
var operational = useMemo(function () {
|
|
@@ -223,13 +433,28 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
223
433
|
* @param actionType The type of action invoked, e.g. PreviewAction
|
|
224
434
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
225
435
|
*/
|
|
226
|
-
invokeSucceededEvent: function invokeSucceededEvent() {
|
|
227
|
-
var id =
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
436
|
+
invokeSucceededEvent: function invokeSucceededEvent(_ref11) {
|
|
437
|
+
var id = _ref11.id,
|
|
438
|
+
actionType = _ref11.actionType,
|
|
439
|
+
display = _ref11.display,
|
|
440
|
+
extensionKey = _ref11.extensionKey,
|
|
441
|
+
definitionId = _ref11.definitionId,
|
|
442
|
+
resourceType = _ref11.resourceType,
|
|
443
|
+
destinationProduct = _ref11.destinationProduct,
|
|
444
|
+
destinationSubproduct = _ref11.destinationSubproduct,
|
|
445
|
+
location = _ref11.location;
|
|
231
446
|
succeedUfoExperience('smart-link-action-invocation', id);
|
|
232
|
-
dispatchAnalytics(_invokeSucceededEvent(
|
|
447
|
+
dispatchAnalytics(applyCommonAttributes(_invokeSucceededEvent({
|
|
448
|
+
id: id,
|
|
449
|
+
actionType: actionType,
|
|
450
|
+
display: display,
|
|
451
|
+
extensionKey: extensionKey,
|
|
452
|
+
definitionId: definitionId,
|
|
453
|
+
resourceType: resourceType,
|
|
454
|
+
destinationProduct: destinationProduct,
|
|
455
|
+
destinationSubproduct: destinationSubproduct,
|
|
456
|
+
location: location
|
|
457
|
+
}), commonAttributes));
|
|
233
458
|
},
|
|
234
459
|
|
|
235
460
|
/**
|
|
@@ -240,14 +465,30 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
240
465
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
241
466
|
* @param reason The reason the invocation failed.
|
|
242
467
|
*/
|
|
243
|
-
invokeFailedEvent: function invokeFailedEvent() {
|
|
244
|
-
var id =
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
468
|
+
invokeFailedEvent: function invokeFailedEvent(_ref12) {
|
|
469
|
+
var id = _ref12.id,
|
|
470
|
+
actionType = _ref12.actionType,
|
|
471
|
+
display = _ref12.display,
|
|
472
|
+
reason = _ref12.reason,
|
|
473
|
+
extensionKey = _ref12.extensionKey,
|
|
474
|
+
definitionId = _ref12.definitionId,
|
|
475
|
+
resourceType = _ref12.resourceType,
|
|
476
|
+
destinationProduct = _ref12.destinationProduct,
|
|
477
|
+
destinationSubproduct = _ref12.destinationSubproduct,
|
|
478
|
+
location = _ref12.location;
|
|
249
479
|
failUfoExperience('smart-link-action-invocation', id);
|
|
250
|
-
dispatchAnalytics(_invokeFailedEvent(
|
|
480
|
+
dispatchAnalytics(applyCommonAttributes(_invokeFailedEvent({
|
|
481
|
+
id: id,
|
|
482
|
+
actionType: actionType,
|
|
483
|
+
display: display,
|
|
484
|
+
reason: reason,
|
|
485
|
+
extensionKey: extensionKey,
|
|
486
|
+
definitionId: definitionId,
|
|
487
|
+
resourceType: resourceType,
|
|
488
|
+
destinationProduct: destinationProduct,
|
|
489
|
+
destinationSubproduct: destinationSubproduct,
|
|
490
|
+
location: location
|
|
491
|
+
}), commonAttributes));
|
|
251
492
|
},
|
|
252
493
|
|
|
253
494
|
/**
|
|
@@ -256,15 +497,28 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
256
497
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
257
498
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
258
499
|
*/
|
|
259
|
-
connectSucceededEvent: function connectSucceededEvent() {
|
|
260
|
-
var id =
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
500
|
+
connectSucceededEvent: function connectSucceededEvent(_ref13) {
|
|
501
|
+
var id = _ref13.id,
|
|
502
|
+
extensionKey = _ref13.extensionKey,
|
|
503
|
+
definitionId = _ref13.definitionId,
|
|
504
|
+
resourceType = _ref13.resourceType,
|
|
505
|
+
destinationProduct = _ref13.destinationProduct,
|
|
506
|
+
destinationSubproduct = _ref13.destinationSubproduct,
|
|
507
|
+
location = _ref13.location;
|
|
508
|
+
var experienceId = id ? id : defaultId;
|
|
509
|
+
startUfoExperience('smart-link-authenticated', experienceId, {
|
|
264
510
|
extensionKey: extensionKey,
|
|
265
511
|
status: 'success'
|
|
266
512
|
});
|
|
267
|
-
dispatchAnalytics(_connectSucceededEvent(
|
|
513
|
+
dispatchAnalytics(applyCommonAttributes(_connectSucceededEvent(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
514
|
+
id: experienceId,
|
|
515
|
+
extensionKey: extensionKey,
|
|
516
|
+
definitionId: definitionId,
|
|
517
|
+
resourceType: resourceType,
|
|
518
|
+
destinationProduct: destinationProduct,
|
|
519
|
+
destinationSubproduct: destinationSubproduct,
|
|
520
|
+
location: location
|
|
521
|
+
})), commonAttributes));
|
|
268
522
|
},
|
|
269
523
|
|
|
270
524
|
/**
|
|
@@ -274,16 +528,30 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
274
528
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
275
529
|
* @param reason The reason why the Smart Link connect account failed.
|
|
276
530
|
*/
|
|
277
|
-
connectFailedEvent: function connectFailedEvent() {
|
|
278
|
-
var id =
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
531
|
+
connectFailedEvent: function connectFailedEvent(_ref14) {
|
|
532
|
+
var id = _ref14.id,
|
|
533
|
+
reason = _ref14.reason,
|
|
534
|
+
extensionKey = _ref14.extensionKey,
|
|
535
|
+
definitionId = _ref14.definitionId,
|
|
536
|
+
resourceType = _ref14.resourceType,
|
|
537
|
+
destinationProduct = _ref14.destinationProduct,
|
|
538
|
+
destinationSubproduct = _ref14.destinationSubproduct,
|
|
539
|
+
location = _ref14.location;
|
|
540
|
+
var experienceId = id ? id : defaultId;
|
|
541
|
+
startUfoExperience('smart-link-authenticated', experienceId, {
|
|
283
542
|
extensionKey: extensionKey,
|
|
284
543
|
status: reason
|
|
285
544
|
});
|
|
286
|
-
dispatchAnalytics(_connectFailedEvent(
|
|
545
|
+
dispatchAnalytics(applyCommonAttributes(_connectFailedEvent(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
546
|
+
id: experienceId,
|
|
547
|
+
reason: reason,
|
|
548
|
+
extensionKey: extensionKey,
|
|
549
|
+
definitionId: definitionId,
|
|
550
|
+
resourceType: resourceType,
|
|
551
|
+
destinationProduct: destinationProduct,
|
|
552
|
+
destinationSubproduct: destinationSubproduct,
|
|
553
|
+
location: location
|
|
554
|
+
})), commonAttributes));
|
|
287
555
|
},
|
|
288
556
|
|
|
289
557
|
/**
|
|
@@ -295,21 +563,34 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
295
563
|
* @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
|
|
296
564
|
* @param error An error representing why the Smart Link request failed.
|
|
297
565
|
*/
|
|
298
|
-
instrument: function instrument() {
|
|
299
|
-
var id =
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
566
|
+
instrument: function instrument(_ref15) {
|
|
567
|
+
var id = _ref15.id,
|
|
568
|
+
status = _ref15.status,
|
|
569
|
+
extensionKey = _ref15.extensionKey,
|
|
570
|
+
definitionId = _ref15.definitionId,
|
|
571
|
+
resourceType = _ref15.resourceType,
|
|
572
|
+
destinationProduct = _ref15.destinationProduct,
|
|
573
|
+
destinationSubproduct = _ref15.destinationSubproduct,
|
|
574
|
+
location = _ref15.location,
|
|
575
|
+
error = _ref15.error;
|
|
576
|
+
var event = instrumentEvent(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
577
|
+
id: id,
|
|
578
|
+
status: status,
|
|
579
|
+
extensionKey: extensionKey,
|
|
580
|
+
definitionId: definitionId,
|
|
581
|
+
resourceType: resourceType,
|
|
582
|
+
destinationProduct: destinationProduct,
|
|
583
|
+
destinationSubproduct: destinationSubproduct,
|
|
584
|
+
location: location,
|
|
585
|
+
error: error
|
|
586
|
+
}));
|
|
306
587
|
|
|
307
588
|
if (event) {
|
|
308
|
-
dispatchAnalytics(event);
|
|
589
|
+
dispatchAnalytics(applyCommonAttributes(event, commonAttributes));
|
|
309
590
|
}
|
|
310
591
|
}
|
|
311
592
|
};
|
|
312
|
-
}, [defaultId,
|
|
593
|
+
}, [defaultId, commonAttributes, dispatchAnalytics]);
|
|
313
594
|
/** Contains all track analytics events */
|
|
314
595
|
|
|
315
596
|
var track = useMemo(function () {
|
|
@@ -320,13 +601,24 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
320
601
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
321
602
|
* @returns
|
|
322
603
|
*/
|
|
323
|
-
appAccountConnected: function appAccountConnected() {
|
|
324
|
-
var
|
|
325
|
-
|
|
326
|
-
|
|
604
|
+
appAccountConnected: function appAccountConnected(_ref16) {
|
|
605
|
+
var extensionKey = _ref16.extensionKey,
|
|
606
|
+
definitionId = _ref16.definitionId,
|
|
607
|
+
resourceType = _ref16.resourceType,
|
|
608
|
+
destinationProduct = _ref16.destinationProduct,
|
|
609
|
+
destinationSubproduct = _ref16.destinationSubproduct,
|
|
610
|
+
location = _ref16.location;
|
|
611
|
+
return dispatchAnalytics(applyCommonAttributes(trackAppAccountConnected(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
612
|
+
extensionKey: extensionKey,
|
|
613
|
+
definitionId: definitionId,
|
|
614
|
+
resourceType: resourceType,
|
|
615
|
+
destinationProduct: destinationProduct,
|
|
616
|
+
destinationSubproduct: destinationSubproduct,
|
|
617
|
+
location: location
|
|
618
|
+
})), commonAttributes));
|
|
327
619
|
}
|
|
328
620
|
};
|
|
329
|
-
}, [
|
|
621
|
+
}, [commonAttributes, dispatchAnalytics]);
|
|
330
622
|
/** Contains all screen analytics events */
|
|
331
623
|
|
|
332
624
|
var screen = useMemo(function () {
|
|
@@ -337,13 +629,38 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
|
|
|
337
629
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
338
630
|
* @returns
|
|
339
631
|
*/
|
|
340
|
-
authPopupEvent: function authPopupEvent() {
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
|
|
632
|
+
authPopupEvent: function authPopupEvent(_ref17) {
|
|
633
|
+
var extensionKey = _ref17.extensionKey,
|
|
634
|
+
definitionId = _ref17.definitionId,
|
|
635
|
+
resourceType = _ref17.resourceType,
|
|
636
|
+
destinationProduct = _ref17.destinationProduct,
|
|
637
|
+
destinationSubproduct = _ref17.destinationSubproduct,
|
|
638
|
+
location = _ref17.location;
|
|
639
|
+
return dispatchAnalytics(applyCommonAttributes(screenAuthPopupEvent(_objectSpread(_objectSpread({}, commonAttributes), {}, {
|
|
640
|
+
extensionKey: extensionKey,
|
|
641
|
+
definitionId: definitionId,
|
|
642
|
+
resourceType: resourceType,
|
|
643
|
+
destinationProduct: destinationProduct,
|
|
644
|
+
destinationSubproduct: destinationSubproduct,
|
|
645
|
+
location: location
|
|
646
|
+
})), commonAttributes));
|
|
647
|
+
},
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* This fires an event that represents when a user view a modal.
|
|
651
|
+
* @param data A partial analytics event payload
|
|
652
|
+
*/
|
|
653
|
+
modalViewedEvent: function modalViewedEvent(data) {
|
|
654
|
+
return dispatchAnalytics(applyCommonAttributes({
|
|
655
|
+
action: 'viewed',
|
|
656
|
+
actionSubject: data.name,
|
|
657
|
+
attributes: _objectSpread(_objectSpread({}, context), data.attributes),
|
|
658
|
+
eventType: 'screen',
|
|
659
|
+
name: data.name
|
|
660
|
+
}, commonAttributes));
|
|
344
661
|
}
|
|
345
662
|
};
|
|
346
|
-
}, [
|
|
663
|
+
}, [commonAttributes, dispatchAnalytics]);
|
|
347
664
|
return useMemo(function () {
|
|
348
665
|
return {
|
|
349
666
|
ui: ui,
|