@atlaskit/smart-card 32.7.7 → 32.7.8
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 +8 -0
- package/dist/cjs/state/actions/index.js +13 -38
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +54 -305
- 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 -22
- 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/HoverCardContent.js +21 -53
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/es2019/state/actions/index.js +13 -38
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +2 -238
- 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 -23
- 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/HoverCardContent.js +21 -53
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/esm/state/actions/index.js +13 -38
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +55 -306
- 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 -23
- 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/HoverCardContent.js +21 -53
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
- 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/common/UnauthorisedViewContent.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
- 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/common/UnauthorisedViewContent.d.ts +1 -1
- package/package.json +2 -5
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
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; }
|
|
5
5
|
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) { _defineProperty(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; }
|
|
6
|
-
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
7
6
|
import { getMeasure } from '../performance';
|
|
8
7
|
export var ANALYTICS_CHANNEL = 'media';
|
|
9
8
|
export var context = {
|
|
10
9
|
componentName: 'smart-cards',
|
|
11
10
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "32.7.
|
|
11
|
+
packageVersion: "32.7.8"
|
|
13
12
|
};
|
|
14
13
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
15
14
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -21,8 +20,6 @@ export var TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
|
|
|
21
20
|
TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
|
|
22
21
|
return TrackQuickActionFailureReason;
|
|
23
22
|
}({});
|
|
24
|
-
export var SmartLinkActionTypeTrackingEventMapper = _defineProperty(_defineProperty(_defineProperty({}, SmartLinkActionType.FollowEntityAction, 'Follow'), SmartLinkActionType.StatusUpdateAction, 'StatusUpdate'), SmartLinkActionType.UnfollowEntityAction, 'Unfollow');
|
|
25
|
-
export var SmartLinkActionTypeUiEventMapper = _defineProperty(_defineProperty({}, SmartLinkActionType.FollowEntityAction, 'smartLinkFollowButton'), SmartLinkActionType.UnfollowEntityAction, 'smartLinkFollowButton');
|
|
26
23
|
var uiActionSubjectIds = {
|
|
27
24
|
DownloadAction: 'downloadDocument',
|
|
28
25
|
PreviewAction: 'invokePreviewScreen',
|
|
@@ -111,100 +108,15 @@ export var invokeFailedEvent = function invokeFailedEvent(_ref2) {
|
|
|
111
108
|
})
|
|
112
109
|
};
|
|
113
110
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
export var uiAuthEvent = function uiAuthEvent(_ref3) {
|
|
119
|
-
var definitionId = _ref3.definitionId,
|
|
111
|
+
export var uiActionClickedEvent = function uiActionClickedEvent(_ref3) {
|
|
112
|
+
var id = _ref3.id,
|
|
113
|
+
actionType = _ref3.actionType,
|
|
120
114
|
extensionKey = _ref3.extensionKey,
|
|
115
|
+
display = _ref3.display,
|
|
116
|
+
definitionId = _ref3.definitionId,
|
|
121
117
|
destinationProduct = _ref3.destinationProduct,
|
|
122
118
|
destinationSubproduct = _ref3.destinationSubproduct,
|
|
123
|
-
location = _ref3.location
|
|
124
|
-
display = _ref3.display;
|
|
125
|
-
return {
|
|
126
|
-
action: 'clicked',
|
|
127
|
-
actionSubject: 'button',
|
|
128
|
-
actionSubjectId: 'connectAccount',
|
|
129
|
-
eventType: 'ui',
|
|
130
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
131
|
-
definitionId: definitionId,
|
|
132
|
-
extensionKey: extensionKey,
|
|
133
|
-
destinationProduct: destinationProduct,
|
|
134
|
-
destinationSubproduct: destinationSubproduct,
|
|
135
|
-
location: location,
|
|
136
|
-
display: display
|
|
137
|
-
})
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
143
|
-
*/
|
|
144
|
-
export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref4) {
|
|
145
|
-
var definitionId = _ref4.definitionId,
|
|
146
|
-
extensionKey = _ref4.extensionKey,
|
|
147
|
-
destinationProduct = _ref4.destinationProduct,
|
|
148
|
-
destinationSubproduct = _ref4.destinationSubproduct,
|
|
149
|
-
location = _ref4.location,
|
|
150
|
-
display = _ref4.display;
|
|
151
|
-
return {
|
|
152
|
-
action: 'clicked',
|
|
153
|
-
actionSubject: 'smartLink',
|
|
154
|
-
actionSubjectId: 'tryAnotherAccount',
|
|
155
|
-
eventType: 'ui',
|
|
156
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
157
|
-
definitionId: definitionId,
|
|
158
|
-
extensionKey: extensionKey,
|
|
159
|
-
destinationProduct: destinationProduct,
|
|
160
|
-
destinationSubproduct: destinationSubproduct,
|
|
161
|
-
location: location,
|
|
162
|
-
display: display
|
|
163
|
-
})
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
169
|
-
*/
|
|
170
|
-
export var uiCardClickedEvent = function uiCardClickedEvent(_ref5) {
|
|
171
|
-
var id = _ref5.id,
|
|
172
|
-
display = _ref5.display,
|
|
173
|
-
status = _ref5.status,
|
|
174
|
-
definitionId = _ref5.definitionId,
|
|
175
|
-
extensionKey = _ref5.extensionKey,
|
|
176
|
-
isModifierKeyPressed = _ref5.isModifierKeyPressed,
|
|
177
|
-
location = _ref5.location,
|
|
178
|
-
destinationProduct = _ref5.destinationProduct,
|
|
179
|
-
destinationSubproduct = _ref5.destinationSubproduct,
|
|
180
|
-
actionSubjectId = _ref5.actionSubjectId;
|
|
181
|
-
return {
|
|
182
|
-
action: 'clicked',
|
|
183
|
-
actionSubject: 'smartLink',
|
|
184
|
-
actionSubjectId: actionSubjectId,
|
|
185
|
-
eventType: 'ui',
|
|
186
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
187
|
-
id: id,
|
|
188
|
-
status: status,
|
|
189
|
-
definitionId: definitionId,
|
|
190
|
-
extensionKey: extensionKey,
|
|
191
|
-
display: display,
|
|
192
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
193
|
-
location: location,
|
|
194
|
-
destinationProduct: destinationProduct,
|
|
195
|
-
destinationSubproduct: destinationSubproduct
|
|
196
|
-
})
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
export var uiActionClickedEvent = function uiActionClickedEvent(_ref6) {
|
|
200
|
-
var id = _ref6.id,
|
|
201
|
-
actionType = _ref6.actionType,
|
|
202
|
-
extensionKey = _ref6.extensionKey,
|
|
203
|
-
display = _ref6.display,
|
|
204
|
-
definitionId = _ref6.definitionId,
|
|
205
|
-
destinationProduct = _ref6.destinationProduct,
|
|
206
|
-
destinationSubproduct = _ref6.destinationSubproduct,
|
|
207
|
-
location = _ref6.location;
|
|
119
|
+
location = _ref3.location;
|
|
208
120
|
return {
|
|
209
121
|
action: 'clicked',
|
|
210
122
|
actionSubject: 'button',
|
|
@@ -222,40 +134,15 @@ export var uiActionClickedEvent = function uiActionClickedEvent(_ref6) {
|
|
|
222
134
|
})
|
|
223
135
|
};
|
|
224
136
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
destinationSubproduct = _ref7.destinationSubproduct,
|
|
235
|
-
location = _ref7.location;
|
|
236
|
-
return {
|
|
237
|
-
action: 'closed',
|
|
238
|
-
actionSubject: 'consentModal',
|
|
239
|
-
eventType: 'ui',
|
|
240
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
241
|
-
extensionKey: extensionKey,
|
|
242
|
-
definitionId: definitionId,
|
|
243
|
-
destinationProduct: destinationProduct,
|
|
244
|
-
destinationSubproduct: destinationSubproduct,
|
|
245
|
-
location: location,
|
|
246
|
-
display: display
|
|
247
|
-
})
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref8) {
|
|
251
|
-
var display = _ref8.display,
|
|
252
|
-
status = _ref8.status,
|
|
253
|
-
extensionKey = _ref8.extensionKey,
|
|
254
|
-
definitionId = _ref8.definitionId,
|
|
255
|
-
destinationProduct = _ref8.destinationProduct,
|
|
256
|
-
destinationSubproduct = _ref8.destinationSubproduct,
|
|
257
|
-
location = _ref8.location,
|
|
258
|
-
canBeDatasource = _ref8.canBeDatasource;
|
|
137
|
+
export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref4) {
|
|
138
|
+
var display = _ref4.display,
|
|
139
|
+
status = _ref4.status,
|
|
140
|
+
extensionKey = _ref4.extensionKey,
|
|
141
|
+
definitionId = _ref4.definitionId,
|
|
142
|
+
destinationProduct = _ref4.destinationProduct,
|
|
143
|
+
destinationSubproduct = _ref4.destinationSubproduct,
|
|
144
|
+
location = _ref4.location,
|
|
145
|
+
canBeDatasource = _ref4.canBeDatasource;
|
|
259
146
|
return {
|
|
260
147
|
action: 'renderSuccess',
|
|
261
148
|
actionSubject: 'smartLink',
|
|
@@ -272,15 +159,15 @@ export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref8) {
|
|
|
272
159
|
})
|
|
273
160
|
};
|
|
274
161
|
};
|
|
275
|
-
export var uiRenderFailedEvent = function uiRenderFailedEvent(
|
|
276
|
-
var display =
|
|
277
|
-
error =
|
|
278
|
-
errorInfo =
|
|
279
|
-
extensionKey =
|
|
280
|
-
definitionId =
|
|
281
|
-
destinationProduct =
|
|
282
|
-
destinationSubproduct =
|
|
283
|
-
location =
|
|
162
|
+
export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref5) {
|
|
163
|
+
var display = _ref5.display,
|
|
164
|
+
error = _ref5.error,
|
|
165
|
+
errorInfo = _ref5.errorInfo,
|
|
166
|
+
extensionKey = _ref5.extensionKey,
|
|
167
|
+
definitionId = _ref5.definitionId,
|
|
168
|
+
destinationProduct = _ref5.destinationProduct,
|
|
169
|
+
destinationSubproduct = _ref5.destinationSubproduct,
|
|
170
|
+
location = _ref5.location;
|
|
284
171
|
return {
|
|
285
172
|
actionSubject: 'smartLink',
|
|
286
173
|
action: 'renderFailed',
|
|
@@ -296,165 +183,4 @@ export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref9) {
|
|
|
296
183
|
location: location
|
|
297
184
|
})
|
|
298
185
|
};
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
303
|
-
*/
|
|
304
|
-
export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref10) {
|
|
305
|
-
var id = _ref10.id,
|
|
306
|
-
previewDisplay = _ref10.previewDisplay,
|
|
307
|
-
extensionKey = _ref10.extensionKey,
|
|
308
|
-
definitionId = _ref10.definitionId,
|
|
309
|
-
destinationProduct = _ref10.destinationProduct,
|
|
310
|
-
destinationSubproduct = _ref10.destinationSubproduct,
|
|
311
|
-
location = _ref10.location,
|
|
312
|
-
previewInvokeMethod = _ref10.previewInvokeMethod,
|
|
313
|
-
status = _ref10.status;
|
|
314
|
-
return {
|
|
315
|
-
action: 'viewed',
|
|
316
|
-
actionSubject: 'hoverCard',
|
|
317
|
-
eventType: 'ui',
|
|
318
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
319
|
-
id: id,
|
|
320
|
-
previewDisplay: previewDisplay,
|
|
321
|
-
extensionKey: extensionKey,
|
|
322
|
-
definitionId: definitionId,
|
|
323
|
-
destinationProduct: destinationProduct,
|
|
324
|
-
destinationSubproduct: destinationSubproduct,
|
|
325
|
-
location: location,
|
|
326
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
327
|
-
status: status
|
|
328
|
-
})
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
334
|
-
*/
|
|
335
|
-
export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref11) {
|
|
336
|
-
var id = _ref11.id,
|
|
337
|
-
previewDisplay = _ref11.previewDisplay,
|
|
338
|
-
hoverTime = _ref11.hoverTime,
|
|
339
|
-
extensionKey = _ref11.extensionKey,
|
|
340
|
-
definitionId = _ref11.definitionId,
|
|
341
|
-
destinationProduct = _ref11.destinationProduct,
|
|
342
|
-
destinationSubproduct = _ref11.destinationSubproduct,
|
|
343
|
-
location = _ref11.location,
|
|
344
|
-
previewInvokeMethod = _ref11.previewInvokeMethod,
|
|
345
|
-
status = _ref11.status;
|
|
346
|
-
return {
|
|
347
|
-
action: 'dismissed',
|
|
348
|
-
actionSubject: 'hoverCard',
|
|
349
|
-
eventType: 'ui',
|
|
350
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
351
|
-
id: id,
|
|
352
|
-
previewDisplay: previewDisplay,
|
|
353
|
-
hoverTime: hoverTime,
|
|
354
|
-
extensionKey: extensionKey,
|
|
355
|
-
definitionId: definitionId,
|
|
356
|
-
destinationProduct: destinationProduct,
|
|
357
|
-
destinationSubproduct: destinationSubproduct,
|
|
358
|
-
location: location,
|
|
359
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
360
|
-
status: status
|
|
361
|
-
})
|
|
362
|
-
};
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
367
|
-
*/
|
|
368
|
-
export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref12) {
|
|
369
|
-
var id = _ref12.id,
|
|
370
|
-
previewDisplay = _ref12.previewDisplay,
|
|
371
|
-
extensionKey = _ref12.extensionKey,
|
|
372
|
-
definitionId = _ref12.definitionId,
|
|
373
|
-
destinationProduct = _ref12.destinationProduct,
|
|
374
|
-
destinationSubproduct = _ref12.destinationSubproduct,
|
|
375
|
-
location = _ref12.location,
|
|
376
|
-
previewInvokeMethod = _ref12.previewInvokeMethod;
|
|
377
|
-
return {
|
|
378
|
-
action: 'clicked',
|
|
379
|
-
actionSubject: 'button',
|
|
380
|
-
actionSubjectId: 'shortcutGoToLink',
|
|
381
|
-
eventType: 'ui',
|
|
382
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
383
|
-
id: id,
|
|
384
|
-
previewDisplay: previewDisplay,
|
|
385
|
-
extensionKey: extensionKey,
|
|
386
|
-
definitionId: definitionId,
|
|
387
|
-
destinationProduct: destinationProduct,
|
|
388
|
-
destinationSubproduct: destinationSubproduct,
|
|
389
|
-
location: location,
|
|
390
|
-
previewInvokeMethod: previewInvokeMethod
|
|
391
|
-
})
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
397
|
-
*/
|
|
398
|
-
export var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent() {
|
|
399
|
-
return {
|
|
400
|
-
action: 'clicked',
|
|
401
|
-
actionSubject: 'button',
|
|
402
|
-
actionSubjectId: 'learnMore',
|
|
403
|
-
eventType: 'ui',
|
|
404
|
-
attributes: _objectSpread({}, context)
|
|
405
|
-
};
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
410
|
-
*/
|
|
411
|
-
export var uiSmartLinkStatusLozengeButtonClicked = function uiSmartLinkStatusLozengeButtonClicked() {
|
|
412
|
-
return {
|
|
413
|
-
action: 'clicked',
|
|
414
|
-
actionSubject: 'button',
|
|
415
|
-
actionSubjectId: 'smartLinkStatusLozenge',
|
|
416
|
-
eventType: 'ui',
|
|
417
|
-
attributes: _objectSpread({}, context)
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
423
|
-
*/
|
|
424
|
-
export var uiSmartLinkStatusListItemButtonClicked = function uiSmartLinkStatusListItemButtonClicked() {
|
|
425
|
-
return {
|
|
426
|
-
action: 'clicked',
|
|
427
|
-
actionSubject: 'button',
|
|
428
|
-
actionSubjectId: 'smartLinkStatusListItem',
|
|
429
|
-
eventType: 'ui',
|
|
430
|
-
attributes: _objectSpread({}, context)
|
|
431
|
-
};
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
436
|
-
*/
|
|
437
|
-
export var uiSmartLinkStatusOpenPreviewButtonClicked = function uiSmartLinkStatusOpenPreviewButtonClicked() {
|
|
438
|
-
return {
|
|
439
|
-
action: 'clicked',
|
|
440
|
-
actionSubject: 'button',
|
|
441
|
-
actionSubjectId: 'smartLinkStatusOpenPreview',
|
|
442
|
-
eventType: 'ui',
|
|
443
|
-
attributes: _objectSpread({}, context)
|
|
444
|
-
};
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
449
|
-
*/
|
|
450
|
-
export var uiServerActionClicked = function uiServerActionClicked(_ref13) {
|
|
451
|
-
var _SmartLinkActionTypeU2;
|
|
452
|
-
var smartLinkActionType = _ref13.smartLinkActionType;
|
|
453
|
-
return {
|
|
454
|
-
action: 'clicked',
|
|
455
|
-
actionSubject: 'button',
|
|
456
|
-
actionSubjectId: (_SmartLinkActionTypeU2 = SmartLinkActionTypeUiEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeU2 !== void 0 ? _SmartLinkActionTypeU2 : smartLinkActionType,
|
|
457
|
-
eventType: 'ui',
|
|
458
|
-
attributes: _objectSpread({}, context)
|
|
459
|
-
};
|
|
460
186
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent,
|
|
1
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiActionClickedEvent, uiRenderSuccessEvent, uiRenderFailedEvent } from './analytics';
|
|
@@ -5,7 +5,7 @@ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analyti
|
|
|
5
5
|
import { CardDisplay } from '../../constants';
|
|
6
6
|
import { useSmartLink } from '../../state';
|
|
7
7
|
import { succeedUfoExperience } from '../../state/analytics';
|
|
8
|
-
import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey,
|
|
8
|
+
import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getResourceType, getServices, isFinalState } from '../../state/helpers';
|
|
9
9
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
10
10
|
import { isSpecialEvent } from '../../utils';
|
|
11
11
|
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
@@ -60,8 +60,6 @@ function Component(_ref) {
|
|
|
60
60
|
var definitionId = getDefinitionId(state.details);
|
|
61
61
|
var extensionKey = getExtensionKey(state.details);
|
|
62
62
|
var resourceType = getResourceType(state.details);
|
|
63
|
-
var product = getProduct(state.details);
|
|
64
|
-
var subproduct = getSubproduct(state.details);
|
|
65
63
|
var services = getServices(state.details);
|
|
66
64
|
var canBeDatasource = getCanBeDatasource(state.details);
|
|
67
65
|
var isFlexibleUi = useMemo(function () {
|
|
@@ -75,25 +73,12 @@ function Component(_ref) {
|
|
|
75
73
|
// Setup UI handlers.
|
|
76
74
|
var handleClickWrapper = useCallback(function (event) {
|
|
77
75
|
var isModifierKeyPressed = isSpecialEvent(event);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
-
analytics.ui.cardClickedEvent({
|
|
87
|
-
id: id,
|
|
88
|
-
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
89
|
-
status: state.status,
|
|
90
|
-
definitionId: definitionId,
|
|
91
|
-
extensionKey: extensionKey,
|
|
92
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
93
|
-
destinationProduct: product,
|
|
94
|
-
destinationSubproduct: subproduct
|
|
95
|
-
});
|
|
96
|
-
}
|
|
76
|
+
fireEvent('ui.smartLink.clicked', {
|
|
77
|
+
id: id,
|
|
78
|
+
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
79
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
80
|
+
isModifierKeyPressed: isModifierKeyPressed
|
|
81
|
+
});
|
|
97
82
|
if (!onClick && !isFlexibleUi) {
|
|
98
83
|
var clickUrl = getClickUrl(url, state.details);
|
|
99
84
|
// Ctrl+left click on mac typically doesn't trigger onClick
|
|
@@ -113,7 +98,7 @@ function Component(_ref) {
|
|
|
113
98
|
}
|
|
114
99
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
115
100
|
}
|
|
116
|
-
}, [id, url, state.details,
|
|
101
|
+
}, [id, url, state.details, appearance, definitionId, onClick, isFlexibleUi, createAnalyticsEvent, fireEvent]);
|
|
117
102
|
var handleAuthorize = useCallback(function () {
|
|
118
103
|
return actions.authorize(appearance);
|
|
119
104
|
}, [actions, appearance]);
|
|
@@ -5,9 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
var _excluded = ["action", "onClick", "onError"];
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
10
|
-
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
11
9
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
12
10
|
import { getInvokeFailureReason } from '../../../../../../state/hooks/use-invoke/utils';
|
|
13
11
|
import useResolve from '../../../../../../state/hooks/use-resolve';
|
|
@@ -22,7 +20,6 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
22
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
21
|
isLoading = _useState2[0],
|
|
24
22
|
setIsLoading = _useState2[1];
|
|
25
|
-
var analytics = useFlexibleUiAnalyticsContext();
|
|
26
23
|
var invoke = useInvoke();
|
|
27
24
|
var reload = useResolve();
|
|
28
25
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -39,16 +36,10 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
39
36
|
smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
40
37
|
_context.prev = 2;
|
|
41
38
|
setIsLoading(true);
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
45
|
-
} else {
|
|
46
|
-
fireEvent("ui.button.clicked.".concat(smartLinkActionType), {});
|
|
47
|
-
}
|
|
39
|
+
if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
|
|
40
|
+
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
48
41
|
} else {
|
|
49
|
-
|
|
50
|
-
smartLinkActionType: smartLinkActionType
|
|
51
|
-
});
|
|
42
|
+
fireEvent("ui.button.clicked.".concat(smartLinkActionType), {});
|
|
52
43
|
}
|
|
53
44
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
54
45
|
smartLinkActionType: smartLinkActionType
|
|
@@ -87,7 +78,7 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
87
78
|
return _context.stop();
|
|
88
79
|
}
|
|
89
80
|
}, _callee, null, [[2, 17]]);
|
|
90
|
-
})), [action,
|
|
81
|
+
})), [action, invoke, onClick, onErrorCallback, reload, fireEvent]);
|
|
91
82
|
return /*#__PURE__*/React.createElement(Action, _extends({}, props, {
|
|
92
83
|
isLoading: isLoading,
|
|
93
84
|
onClick: handleClick
|
|
@@ -11,10 +11,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { jsx } from '@emotion/react';
|
|
13
13
|
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
16
15
|
import extractLozengeActionItems from '../../../../../../extractors/action/extract-lozenge-action-items';
|
|
17
|
-
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
18
16
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
19
17
|
import { isInvokeCustomError } from '../../../../../../state/hooks/use-invoke/utils';
|
|
20
18
|
import useResolve from '../../../../../../state/hooks/use-resolve';
|
|
@@ -69,8 +67,6 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
69
67
|
errorMessage = _useState12[0],
|
|
70
68
|
setErrorMessage = _useState12[1];
|
|
71
69
|
var reload = useResolve();
|
|
72
|
-
//TODO EDM-6583 Replace usage of useFlexibleUiAnalyticsContext with linking platform analytics context from find team.
|
|
73
|
-
var analytics = useFlexibleUiAnalyticsContext();
|
|
74
70
|
var invoke = useInvoke();
|
|
75
71
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
76
72
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
@@ -95,11 +91,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
95
91
|
_context.next = 24;
|
|
96
92
|
break;
|
|
97
93
|
}
|
|
98
|
-
|
|
99
|
-
fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
|
|
100
|
-
} else {
|
|
101
|
-
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionClickedEvent();
|
|
102
|
-
}
|
|
94
|
+
fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
|
|
103
95
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
104
96
|
smartLinkActionType: TrackQuickActionType.StatusUpdate
|
|
105
97
|
});
|
|
@@ -146,7 +138,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
146
138
|
return function (_x) {
|
|
147
139
|
return _ref3.apply(this, arguments);
|
|
148
140
|
};
|
|
149
|
-
}(), [action.read,
|
|
141
|
+
}(), [action.read, invoke, isLoaded, text, fireEvent]);
|
|
150
142
|
var trigger = useCallback(function (props) {
|
|
151
143
|
return jsx(LozengeActionTrigger, _extends({}, props, {
|
|
152
144
|
appearance: selected.appearance,
|
|
@@ -162,11 +154,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
162
154
|
while (1) switch (_context2.prev = _context2.next) {
|
|
163
155
|
case 0:
|
|
164
156
|
_context2.prev = 0;
|
|
165
|
-
|
|
166
|
-
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
167
|
-
} else {
|
|
168
|
-
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionListItemClickedEvent();
|
|
169
|
-
}
|
|
157
|
+
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
170
158
|
updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
171
159
|
if (!(updateAction && id)) {
|
|
172
160
|
_context2.next = 17;
|
|
@@ -217,7 +205,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
217
205
|
return function (_x2, _x3, _x4) {
|
|
218
206
|
return _ref4.apply(this, arguments);
|
|
219
207
|
};
|
|
220
|
-
}(), [action === null || action === void 0 ? void 0 : action.update,
|
|
208
|
+
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
|
|
221
209
|
var dropdownItemGroup = useMemo(function () {
|
|
222
210
|
if (errorMessage) {
|
|
223
211
|
return jsx(LozengeActionError, {
|
|
@@ -43,11 +43,7 @@ var LozengeActionError = function LozengeActionError(_ref) {
|
|
|
43
43
|
}, [reload, url]);
|
|
44
44
|
var handlePreviewOpen = useCallback(function () {
|
|
45
45
|
if (isPreviewAvailable) {
|
|
46
|
-
|
|
47
|
-
fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
|
|
48
|
-
} else {
|
|
49
|
-
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
|
|
50
|
-
}
|
|
46
|
+
fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
|
|
51
47
|
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
52
48
|
invokePreviewAction && invoke(invokePreviewAction);
|
|
53
49
|
} else {
|