@atlaskit/smart-card 23.7.3 → 23.8.1
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 +12 -0
- package/dist/cjs/constants.js +14 -2
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -1
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +41 -13
- package/dist/cjs/utils/analytics/analytics.js +128 -96
- package/dist/cjs/utils/analytics/index.js +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +4 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -3
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +17 -4
- package/dist/cjs/view/CardWithUrl/component.js +3 -1
- package/dist/cjs/view/EmbedCard/index.js +6 -2
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +21 -4
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +4 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +14 -24
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +61 -34
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +26 -7
- package/dist/cjs/view/HoverCard/index.js +6 -3
- package/dist/cjs/view/HoverCard/utils.js +1 -4
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/cjs/view/InlineCard/index.js +2 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +14 -3
- package/dist/es2019/constants.js +12 -1
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +33 -8
- package/dist/es2019/utils/analytics/analytics.js +28 -4
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +4 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -3
- package/dist/es2019/view/CardWithUrl/component.js +2 -1
- package/dist/es2019/view/EmbedCard/index.js +6 -2
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +14 -3
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +3 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +14 -20
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +52 -30
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -3
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +23 -7
- package/dist/es2019/view/HoverCard/index.js +6 -3
- package/dist/es2019/view/HoverCard/utils.js +0 -1
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/es2019/view/InlineCard/index.js +2 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +18 -11
- package/dist/esm/constants.js +12 -1
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +42 -14
- package/dist/esm/utils/analytics/analytics.js +118 -92
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/esm/view/BlockCard/index.js +4 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +18 -5
- package/dist/esm/view/CardWithUrl/component.js +2 -1
- package/dist/esm/view/EmbedCard/index.js +6 -2
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +15 -4
- package/dist/esm/view/EmbedModal/components/analytics/index.js +3 -2
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +14 -22
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +54 -30
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -3
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +27 -9
- package/dist/esm/view/HoverCard/index.js +6 -3
- package/dist/esm/view/HoverCard/utils.js +0 -1
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/esm/view/InlineCard/index.js +2 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +8 -3
- package/dist/types/constants.d.ts +8 -0
- package/dist/types/state/actions/index.d.ts +1 -2
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +17 -4
- package/dist/types/state/flexible-ui-context/index.d.ts +8 -4
- package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types/utils/analytics/analytics.d.ts +4 -2
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +2 -0
- package/dist/types/utils/mocks.d.ts +4 -2
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +1 -1
- package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
- package/dist/types/view/BlockCard/views/flexible/types.d.ts +17 -13
- package/dist/types/view/Card/types.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +3 -0
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +0 -1
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -0
- package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +15 -4
- package/dist/types/view/HoverCard/types.d.ts +3 -3
- package/dist/types/view/HoverCard/utils.d.ts +0 -1
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +7 -1
- package/package.json +5 -5
- package/report.api.md +15 -1
- package/tmp/api-report-tmp.d.ts +8 -4
|
@@ -215,29 +215,20 @@ export var trackAppAccountConnected = function trackAppAccountConnected(_ref6) {
|
|
|
215
215
|
})
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
|
-
export var
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
destinationProduct = _ref7.destinationProduct,
|
|
222
|
-
destinationSubproduct = _ref7.destinationSubproduct,
|
|
223
|
-
location = _ref7.location,
|
|
224
|
-
display = _ref7.display;
|
|
218
|
+
export var trackAppAccountAuthStarted = function trackAppAccountAuthStarted(_ref7) {
|
|
219
|
+
var extensionKey = _ref7.extensionKey,
|
|
220
|
+
location = _ref7.location;
|
|
225
221
|
return {
|
|
226
|
-
action: '
|
|
227
|
-
actionSubject: '
|
|
228
|
-
|
|
229
|
-
eventType: 'ui',
|
|
222
|
+
action: 'authStarted',
|
|
223
|
+
actionSubject: 'applicationAccount',
|
|
224
|
+
eventType: 'track',
|
|
230
225
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
231
|
-
definitionId: definitionId,
|
|
232
226
|
extensionKey: extensionKey,
|
|
233
|
-
|
|
234
|
-
destinationSubproduct: destinationSubproduct,
|
|
235
|
-
location: location,
|
|
236
|
-
display: display
|
|
227
|
+
location: location
|
|
237
228
|
})
|
|
238
229
|
};
|
|
239
230
|
};
|
|
240
|
-
export var
|
|
231
|
+
export var uiAuthEvent = function uiAuthEvent(_ref8) {
|
|
241
232
|
var definitionId = _ref8.definitionId,
|
|
242
233
|
extensionKey = _ref8.extensionKey,
|
|
243
234
|
destinationProduct = _ref8.destinationProduct,
|
|
@@ -246,8 +237,8 @@ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_r
|
|
|
246
237
|
display = _ref8.display;
|
|
247
238
|
return {
|
|
248
239
|
action: 'clicked',
|
|
249
|
-
actionSubject: '
|
|
250
|
-
actionSubjectId: '
|
|
240
|
+
actionSubject: 'button',
|
|
241
|
+
actionSubjectId: 'connectAccount',
|
|
251
242
|
eventType: 'ui',
|
|
252
243
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
253
244
|
definitionId: definitionId,
|
|
@@ -259,209 +250,235 @@ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_r
|
|
|
259
250
|
})
|
|
260
251
|
};
|
|
261
252
|
};
|
|
262
|
-
export var
|
|
263
|
-
var
|
|
264
|
-
display = _ref9.display,
|
|
265
|
-
status = _ref9.status,
|
|
266
|
-
definitionId = _ref9.definitionId,
|
|
253
|
+
export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref9) {
|
|
254
|
+
var definitionId = _ref9.definitionId,
|
|
267
255
|
extensionKey = _ref9.extensionKey,
|
|
268
|
-
isModifierKeyPressed = _ref9.isModifierKeyPressed,
|
|
269
|
-
location = _ref9.location,
|
|
270
256
|
destinationProduct = _ref9.destinationProduct,
|
|
271
257
|
destinationSubproduct = _ref9.destinationSubproduct,
|
|
272
|
-
|
|
258
|
+
location = _ref9.location,
|
|
259
|
+
display = _ref9.display;
|
|
273
260
|
return {
|
|
274
261
|
action: 'clicked',
|
|
275
262
|
actionSubject: 'smartLink',
|
|
276
|
-
actionSubjectId:
|
|
263
|
+
actionSubjectId: 'tryAnotherAccount',
|
|
277
264
|
eventType: 'ui',
|
|
278
265
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
279
|
-
id: id,
|
|
280
|
-
status: status,
|
|
281
266
|
definitionId: definitionId,
|
|
282
267
|
extensionKey: extensionKey,
|
|
283
|
-
display: display,
|
|
284
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
285
|
-
location: location,
|
|
286
268
|
destinationProduct: destinationProduct,
|
|
287
|
-
destinationSubproduct: destinationSubproduct
|
|
269
|
+
destinationSubproduct: destinationSubproduct,
|
|
270
|
+
location: location,
|
|
271
|
+
display: display
|
|
288
272
|
})
|
|
289
273
|
};
|
|
290
274
|
};
|
|
291
|
-
export var
|
|
275
|
+
export var uiCardClickedEvent = function uiCardClickedEvent(_ref10) {
|
|
292
276
|
var id = _ref10.id,
|
|
293
|
-
actionType = _ref10.actionType,
|
|
294
|
-
extensionKey = _ref10.extensionKey,
|
|
295
277
|
display = _ref10.display,
|
|
278
|
+
status = _ref10.status,
|
|
296
279
|
definitionId = _ref10.definitionId,
|
|
280
|
+
extensionKey = _ref10.extensionKey,
|
|
281
|
+
isModifierKeyPressed = _ref10.isModifierKeyPressed,
|
|
282
|
+
location = _ref10.location,
|
|
297
283
|
destinationProduct = _ref10.destinationProduct,
|
|
298
284
|
destinationSubproduct = _ref10.destinationSubproduct,
|
|
299
|
-
|
|
285
|
+
actionSubjectId = _ref10.actionSubjectId;
|
|
300
286
|
return {
|
|
301
287
|
action: 'clicked',
|
|
302
|
-
actionSubject: '
|
|
303
|
-
actionSubjectId:
|
|
288
|
+
actionSubject: 'smartLink',
|
|
289
|
+
actionSubjectId: actionSubjectId,
|
|
304
290
|
eventType: 'ui',
|
|
305
291
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
306
292
|
id: id,
|
|
307
|
-
|
|
308
|
-
actionType: actionType,
|
|
309
|
-
extensionKey: extensionKey,
|
|
293
|
+
status: status,
|
|
310
294
|
definitionId: definitionId,
|
|
295
|
+
extensionKey: extensionKey,
|
|
296
|
+
display: display,
|
|
297
|
+
isModifierKeyPressed: isModifierKeyPressed,
|
|
298
|
+
location: location,
|
|
311
299
|
destinationProduct: destinationProduct,
|
|
312
|
-
destinationSubproduct: destinationSubproduct
|
|
313
|
-
location: location
|
|
300
|
+
destinationSubproduct: destinationSubproduct
|
|
314
301
|
})
|
|
315
302
|
};
|
|
316
303
|
};
|
|
317
|
-
export var
|
|
318
|
-
var
|
|
304
|
+
export var uiActionClickedEvent = function uiActionClickedEvent(_ref11) {
|
|
305
|
+
var id = _ref11.id,
|
|
306
|
+
actionType = _ref11.actionType,
|
|
319
307
|
extensionKey = _ref11.extensionKey,
|
|
308
|
+
display = _ref11.display,
|
|
320
309
|
definitionId = _ref11.definitionId,
|
|
321
310
|
destinationProduct = _ref11.destinationProduct,
|
|
322
311
|
destinationSubproduct = _ref11.destinationSubproduct,
|
|
323
312
|
location = _ref11.location;
|
|
324
313
|
return {
|
|
325
|
-
action: '
|
|
326
|
-
actionSubject: '
|
|
314
|
+
action: 'clicked',
|
|
315
|
+
actionSubject: 'button',
|
|
316
|
+
actionSubjectId: uiActionSubjectIds[actionType],
|
|
327
317
|
eventType: 'ui',
|
|
328
318
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
319
|
+
id: id,
|
|
320
|
+
display: display,
|
|
321
|
+
actionType: actionType,
|
|
329
322
|
extensionKey: extensionKey,
|
|
330
323
|
definitionId: definitionId,
|
|
331
324
|
destinationProduct: destinationProduct,
|
|
332
325
|
destinationSubproduct: destinationSubproduct,
|
|
333
|
-
location: location
|
|
334
|
-
display: display
|
|
326
|
+
location: location
|
|
335
327
|
})
|
|
336
328
|
};
|
|
337
329
|
};
|
|
338
|
-
export var
|
|
339
|
-
var
|
|
330
|
+
export var uiClosedAuthEvent = function uiClosedAuthEvent(_ref12) {
|
|
331
|
+
var display = _ref12.display,
|
|
332
|
+
extensionKey = _ref12.extensionKey,
|
|
340
333
|
definitionId = _ref12.definitionId,
|
|
341
334
|
destinationProduct = _ref12.destinationProduct,
|
|
342
335
|
destinationSubproduct = _ref12.destinationSubproduct,
|
|
343
336
|
location = _ref12.location;
|
|
344
337
|
return {
|
|
338
|
+
action: 'closed',
|
|
345
339
|
actionSubject: 'consentModal',
|
|
346
|
-
eventType: '
|
|
340
|
+
eventType: 'ui',
|
|
347
341
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
348
342
|
extensionKey: extensionKey,
|
|
349
343
|
definitionId: definitionId,
|
|
350
344
|
destinationProduct: destinationProduct,
|
|
351
345
|
destinationSubproduct: destinationSubproduct,
|
|
352
|
-
location: location
|
|
346
|
+
location: location,
|
|
347
|
+
display: display
|
|
353
348
|
})
|
|
354
349
|
};
|
|
355
350
|
};
|
|
356
|
-
export var
|
|
357
|
-
var
|
|
358
|
-
status = _ref13.status,
|
|
359
|
-
extensionKey = _ref13.extensionKey,
|
|
351
|
+
export var screenAuthPopupEvent = function screenAuthPopupEvent(_ref13) {
|
|
352
|
+
var extensionKey = _ref13.extensionKey,
|
|
360
353
|
definitionId = _ref13.definitionId,
|
|
361
354
|
destinationProduct = _ref13.destinationProduct,
|
|
362
355
|
destinationSubproduct = _ref13.destinationSubproduct,
|
|
363
356
|
location = _ref13.location;
|
|
364
357
|
return {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
eventType: 'ui',
|
|
358
|
+
actionSubject: 'consentModal',
|
|
359
|
+
eventType: 'screen',
|
|
368
360
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
369
|
-
status: status,
|
|
370
361
|
extensionKey: extensionKey,
|
|
371
362
|
definitionId: definitionId,
|
|
372
363
|
destinationProduct: destinationProduct,
|
|
373
364
|
destinationSubproduct: destinationSubproduct,
|
|
374
|
-
location: location
|
|
375
|
-
display: display
|
|
365
|
+
location: location
|
|
376
366
|
})
|
|
377
367
|
};
|
|
378
368
|
};
|
|
379
|
-
export var
|
|
369
|
+
export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref14) {
|
|
380
370
|
var display = _ref14.display,
|
|
381
|
-
|
|
382
|
-
errorInfo = _ref14.errorInfo,
|
|
371
|
+
status = _ref14.status,
|
|
383
372
|
extensionKey = _ref14.extensionKey,
|
|
384
373
|
definitionId = _ref14.definitionId,
|
|
385
374
|
destinationProduct = _ref14.destinationProduct,
|
|
386
375
|
destinationSubproduct = _ref14.destinationSubproduct,
|
|
387
376
|
location = _ref14.location;
|
|
388
377
|
return {
|
|
378
|
+
action: 'renderSuccess',
|
|
389
379
|
actionSubject: 'smartLink',
|
|
390
|
-
action: 'renderFailed',
|
|
391
380
|
eventType: 'ui',
|
|
392
381
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
393
|
-
|
|
394
|
-
errorInfo: errorInfo,
|
|
395
|
-
display: display,
|
|
382
|
+
status: status,
|
|
396
383
|
extensionKey: extensionKey,
|
|
397
384
|
definitionId: definitionId,
|
|
398
385
|
destinationProduct: destinationProduct,
|
|
399
386
|
destinationSubproduct: destinationSubproduct,
|
|
400
|
-
location: location
|
|
387
|
+
location: location,
|
|
388
|
+
display: display
|
|
401
389
|
})
|
|
402
390
|
};
|
|
403
391
|
};
|
|
404
|
-
export var
|
|
405
|
-
var
|
|
406
|
-
|
|
392
|
+
export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref15) {
|
|
393
|
+
var display = _ref15.display,
|
|
394
|
+
error = _ref15.error,
|
|
395
|
+
errorInfo = _ref15.errorInfo,
|
|
407
396
|
extensionKey = _ref15.extensionKey,
|
|
408
397
|
definitionId = _ref15.definitionId,
|
|
409
398
|
destinationProduct = _ref15.destinationProduct,
|
|
410
399
|
destinationSubproduct = _ref15.destinationSubproduct,
|
|
411
|
-
location = _ref15.location
|
|
412
|
-
previewInvokeMethod = _ref15.previewInvokeMethod;
|
|
400
|
+
location = _ref15.location;
|
|
413
401
|
return {
|
|
414
|
-
|
|
415
|
-
|
|
402
|
+
actionSubject: 'smartLink',
|
|
403
|
+
action: 'renderFailed',
|
|
416
404
|
eventType: 'ui',
|
|
417
405
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
418
|
-
|
|
419
|
-
|
|
406
|
+
error: error,
|
|
407
|
+
errorInfo: errorInfo,
|
|
408
|
+
display: display,
|
|
420
409
|
extensionKey: extensionKey,
|
|
421
410
|
definitionId: definitionId,
|
|
422
411
|
destinationProduct: destinationProduct,
|
|
423
412
|
destinationSubproduct: destinationSubproduct,
|
|
424
|
-
location: location
|
|
425
|
-
previewInvokeMethod: previewInvokeMethod
|
|
413
|
+
location: location
|
|
426
414
|
})
|
|
427
415
|
};
|
|
428
416
|
};
|
|
429
|
-
export var
|
|
417
|
+
export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref16) {
|
|
430
418
|
var id = _ref16.id,
|
|
431
419
|
previewDisplay = _ref16.previewDisplay,
|
|
432
|
-
hoverTime = _ref16.hoverTime,
|
|
433
420
|
extensionKey = _ref16.extensionKey,
|
|
434
421
|
definitionId = _ref16.definitionId,
|
|
435
422
|
destinationProduct = _ref16.destinationProduct,
|
|
436
423
|
destinationSubproduct = _ref16.destinationSubproduct,
|
|
437
424
|
location = _ref16.location,
|
|
438
|
-
previewInvokeMethod = _ref16.previewInvokeMethod
|
|
425
|
+
previewInvokeMethod = _ref16.previewInvokeMethod,
|
|
426
|
+
status = _ref16.status;
|
|
439
427
|
return {
|
|
440
|
-
action: '
|
|
428
|
+
action: 'viewed',
|
|
441
429
|
actionSubject: 'hoverCard',
|
|
442
430
|
eventType: 'ui',
|
|
443
431
|
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
444
432
|
id: id,
|
|
445
433
|
previewDisplay: previewDisplay,
|
|
446
|
-
hoverTime: hoverTime,
|
|
447
434
|
extensionKey: extensionKey,
|
|
448
435
|
definitionId: definitionId,
|
|
449
436
|
destinationProduct: destinationProduct,
|
|
450
437
|
destinationSubproduct: destinationSubproduct,
|
|
451
438
|
location: location,
|
|
452
|
-
previewInvokeMethod: previewInvokeMethod
|
|
439
|
+
previewInvokeMethod: previewInvokeMethod,
|
|
440
|
+
status: status
|
|
453
441
|
})
|
|
454
442
|
};
|
|
455
443
|
};
|
|
456
|
-
export var
|
|
444
|
+
export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref17) {
|
|
457
445
|
var id = _ref17.id,
|
|
458
446
|
previewDisplay = _ref17.previewDisplay,
|
|
447
|
+
hoverTime = _ref17.hoverTime,
|
|
459
448
|
extensionKey = _ref17.extensionKey,
|
|
460
449
|
definitionId = _ref17.definitionId,
|
|
461
450
|
destinationProduct = _ref17.destinationProduct,
|
|
462
451
|
destinationSubproduct = _ref17.destinationSubproduct,
|
|
463
452
|
location = _ref17.location,
|
|
464
|
-
previewInvokeMethod = _ref17.previewInvokeMethod
|
|
453
|
+
previewInvokeMethod = _ref17.previewInvokeMethod,
|
|
454
|
+
status = _ref17.status;
|
|
455
|
+
return {
|
|
456
|
+
action: 'dismissed',
|
|
457
|
+
actionSubject: 'hoverCard',
|
|
458
|
+
eventType: 'ui',
|
|
459
|
+
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
460
|
+
id: id,
|
|
461
|
+
previewDisplay: previewDisplay,
|
|
462
|
+
hoverTime: hoverTime,
|
|
463
|
+
extensionKey: extensionKey,
|
|
464
|
+
definitionId: definitionId,
|
|
465
|
+
destinationProduct: destinationProduct,
|
|
466
|
+
destinationSubproduct: destinationSubproduct,
|
|
467
|
+
location: location,
|
|
468
|
+
previewInvokeMethod: previewInvokeMethod,
|
|
469
|
+
status: status
|
|
470
|
+
})
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref18) {
|
|
474
|
+
var id = _ref18.id,
|
|
475
|
+
previewDisplay = _ref18.previewDisplay,
|
|
476
|
+
extensionKey = _ref18.extensionKey,
|
|
477
|
+
definitionId = _ref18.definitionId,
|
|
478
|
+
destinationProduct = _ref18.destinationProduct,
|
|
479
|
+
destinationSubproduct = _ref18.destinationSubproduct,
|
|
480
|
+
location = _ref18.location,
|
|
481
|
+
previewInvokeMethod = _ref18.previewInvokeMethod;
|
|
465
482
|
return {
|
|
466
483
|
action: 'clicked',
|
|
467
484
|
actionSubject: 'button',
|
|
@@ -478,4 +495,13 @@ export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClicked
|
|
|
478
495
|
previewInvokeMethod: previewInvokeMethod
|
|
479
496
|
})
|
|
480
497
|
};
|
|
498
|
+
};
|
|
499
|
+
export var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent() {
|
|
500
|
+
return {
|
|
501
|
+
action: 'clicked',
|
|
502
|
+
actionSubject: 'button',
|
|
503
|
+
actionSubjectId: 'learnMore',
|
|
504
|
+
eventType: 'ui',
|
|
505
|
+
attributes: _objectSpread({}, context)
|
|
506
|
+
};
|
|
481
507
|
};
|
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { getMeasure } from '../performance';
|
|
8
8
|
import { resolvedEvent, unresolvedEvent } from './analytics';
|
|
9
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent } from './analytics';
|
|
9
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountAuthStarted, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent } from './analytics';
|
|
10
10
|
export var instrumentEvent = function instrumentEvent(_ref) {
|
|
11
11
|
var id = _ref.id,
|
|
12
12
|
status = _ref.status,
|
package/dist/esm/version.json
CHANGED
|
@@ -20,7 +20,7 @@ var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
|
20
20
|
|
|
21
21
|
var providerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n span:first-child {\n margin-right: 0.375rem;\n }\n"])));
|
|
22
22
|
/**
|
|
23
|
-
* This
|
|
23
|
+
* This Component is a footer that is used in a Block Card with Flexible UI.
|
|
24
24
|
* It contains a provider icon if provider is present and an actions list if one is passed.
|
|
25
25
|
* To be shown as a part of Flexible UI, needs to be wrapped inside of a CustomBlock
|
|
26
26
|
*
|
|
@@ -51,11 +51,12 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
51
51
|
details = cardState.details;
|
|
52
52
|
var data = details && details.data || getEmptyJsonLd();
|
|
53
53
|
var meta = details && details.meta;
|
|
54
|
+
var extensionKey = getExtensionKey(details);
|
|
54
55
|
var extractorOpts = {
|
|
55
56
|
analytics: analytics,
|
|
56
57
|
origin: 'smartLinkCard',
|
|
57
58
|
handleInvoke: handleInvoke,
|
|
58
|
-
extensionKey:
|
|
59
|
+
extensionKey: extensionKey
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
if (enableFlexibleBlockCard) {
|
|
@@ -70,7 +71,8 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
70
71
|
onError: onError,
|
|
71
72
|
renderers: renderers,
|
|
72
73
|
ui: ui,
|
|
73
|
-
analytics: analytics
|
|
74
|
+
analytics: analytics,
|
|
75
|
+
extensionKey: extensionKey
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
switch (status) {
|
|
@@ -45,7 +45,7 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
|
|
|
45
45
|
message: {
|
|
46
46
|
descriptor: messages.not_found_description
|
|
47
47
|
},
|
|
48
|
-
testId: testId
|
|
48
|
+
testId: "".concat(testId, "-message")
|
|
49
49
|
})), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
50
50
|
status: status
|
|
51
51
|
})));
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import FlexibleCard from '../../../FlexibleCard';
|
|
4
4
|
import TitleBlock from '../../../FlexibleCard/components/blocks/title-block';
|
|
5
5
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock } from '../../../FlexibleCard/components/blocks';
|
|
6
|
-
import { ActionName, ElementName, MediaPlacement, SmartLinkPosition } from '../../../../constants';
|
|
6
|
+
import { ActionName, CardDisplay, ElementName, MediaPlacement, SmartLinkPosition } from '../../../../constants';
|
|
7
7
|
import uuid from 'uuid';
|
|
8
8
|
/**
|
|
9
9
|
* This view represents a Block card that has an 'Resolved' status.
|
|
@@ -91,7 +91,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
91
91
|
analytics.operational.invokeSucceededEvent({
|
|
92
92
|
id: analyticsId,
|
|
93
93
|
actionType: 'preview',
|
|
94
|
-
display:
|
|
94
|
+
display: CardDisplay.Block
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
}, {
|
|
@@ -101,7 +101,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
101
101
|
analytics.operational.invokeSucceededEvent({
|
|
102
102
|
id: analyticsId,
|
|
103
103
|
actionType: 'view',
|
|
104
|
-
display:
|
|
104
|
+
display: CardDisplay.Block
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
}, {
|
|
@@ -111,7 +111,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
111
111
|
analytics.operational.invokeSucceededEvent({
|
|
112
112
|
id: analyticsId,
|
|
113
113
|
actionType: 'download',
|
|
114
|
-
display:
|
|
114
|
+
display: CardDisplay.Block
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
}]
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
import FlexibleCard from '../../../FlexibleCard';
|
|
7
7
|
import { AuthorizeAction } from '../../actions/flexible/AuthorizeAction';
|
|
8
8
|
import BlockCardFooter from '../../components/flexible/footer';
|
|
@@ -24,7 +24,10 @@ var contentStyles = css(_templateObject || (_templateObject = _taggedTemplateLit
|
|
|
24
24
|
var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
25
25
|
var _cardState$details, _extractProvider;
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var analytics = _ref.analytics,
|
|
28
|
+
cardState = _ref.cardState,
|
|
29
|
+
_ref$extensionKey = _ref.extensionKey,
|
|
30
|
+
extensionKey = _ref$extensionKey === void 0 ? '' : _ref$extensionKey,
|
|
28
31
|
onAuthorize = _ref.onAuthorize,
|
|
29
32
|
onClick = _ref.onClick,
|
|
30
33
|
onError = _ref.onError,
|
|
@@ -34,9 +37,17 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
34
37
|
url = _ref.url;
|
|
35
38
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
36
39
|
var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
40
|
+
var handleAuthorize = useCallback(function () {
|
|
41
|
+
if (onAuthorize) {
|
|
42
|
+
analytics.track.appAccountAuthStarted({
|
|
43
|
+
extensionKey: extensionKey
|
|
44
|
+
});
|
|
45
|
+
onAuthorize();
|
|
46
|
+
}
|
|
47
|
+
}, [onAuthorize, extensionKey, analytics.track]);
|
|
37
48
|
var actions = useMemo(function () {
|
|
38
|
-
return onAuthorize ? [AuthorizeAction(
|
|
39
|
-
}, [onAuthorize, providerName]);
|
|
49
|
+
return onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [];
|
|
50
|
+
}, [handleAuthorize, onAuthorize, providerName]);
|
|
40
51
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
41
52
|
appearance: "block",
|
|
42
53
|
cardState: cardState,
|
|
@@ -52,7 +63,9 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
52
63
|
overrideCss: contentStyles,
|
|
53
64
|
testId: "".concat(testId, "-content")
|
|
54
65
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
55
|
-
providerName: providerName
|
|
66
|
+
providerName: providerName,
|
|
67
|
+
analytics: analytics,
|
|
68
|
+
testId: testId
|
|
56
69
|
}))), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
57
70
|
actions: actions,
|
|
58
71
|
status: SmartLinkStatus.Unauthorized,
|
|
@@ -10,6 +10,7 @@ import { EmbedCard } from '../EmbedCard';
|
|
|
10
10
|
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
11
11
|
import FlexibleCard from '../FlexibleCard';
|
|
12
12
|
import { APIError } from '../..';
|
|
13
|
+
import { CardDisplay } from '../../constants';
|
|
13
14
|
export function CardWithUrlContent(_ref) {
|
|
14
15
|
var id = _ref.id,
|
|
15
16
|
url = _ref.url,
|
|
@@ -68,7 +69,7 @@ export function CardWithUrlContent(_ref) {
|
|
|
68
69
|
var isModifierKeyPressed = isSpecialEvent(event);
|
|
69
70
|
analytics.ui.cardClickedEvent({
|
|
70
71
|
id: id,
|
|
71
|
-
display: isFlexibleUi ?
|
|
72
|
+
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
72
73
|
status: state.status,
|
|
73
74
|
definitionId: definitionId,
|
|
74
75
|
extensionKey: extensionKey,
|
|
@@ -35,6 +35,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
35
35
|
inheritDimensions = _ref.inheritDimensions;
|
|
36
36
|
var data = details && details.data || getEmptyJsonLd();
|
|
37
37
|
var meta = details && details.meta;
|
|
38
|
+
var extensionKey = getExtensionKey(details);
|
|
38
39
|
|
|
39
40
|
switch (status) {
|
|
40
41
|
case 'pending':
|
|
@@ -80,7 +81,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
80
81
|
analytics: analytics,
|
|
81
82
|
origin: 'smartLinkEmbed',
|
|
82
83
|
handleInvoke: handleInvoke,
|
|
83
|
-
extensionKey:
|
|
84
|
+
extensionKey: extensionKey
|
|
84
85
|
});
|
|
85
86
|
return /*#__PURE__*/React.createElement(BlockCardResolvedView, _extends({}, resolvedBlockViewProps, {
|
|
86
87
|
isSelected: isSelected,
|
|
@@ -103,7 +104,10 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
103
104
|
isSelected: isSelected,
|
|
104
105
|
onAuthorise: handleAuthorize,
|
|
105
106
|
inheritDimensions: inheritDimensions,
|
|
106
|
-
onClick: handleFrameClick
|
|
107
|
+
onClick: handleFrameClick,
|
|
108
|
+
analytics: analytics,
|
|
109
|
+
extensionKey: extensionKey,
|
|
110
|
+
testId: testId
|
|
107
111
|
}));
|
|
108
112
|
|
|
109
113
|
case 'forbidden':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
3
|
import { UnauthorisedImage } from '../constants';
|
|
4
4
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
@@ -7,17 +7,27 @@ import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
|
7
7
|
export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
8
8
|
var _context$image;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var analytics = _ref.analytics,
|
|
11
|
+
link = _ref.link,
|
|
11
12
|
context = _ref.context,
|
|
12
13
|
isSelected = _ref.isSelected,
|
|
13
14
|
_ref$testId = _ref.testId,
|
|
14
15
|
testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
|
|
15
16
|
onAuthorise = _ref.onAuthorise,
|
|
16
17
|
inheritDimensions = _ref.inheritDimensions,
|
|
17
|
-
onClick = _ref.onClick
|
|
18
|
+
onClick = _ref.onClick,
|
|
19
|
+
extensionKey = _ref.extensionKey;
|
|
18
20
|
var icon = context && context.icon && /*#__PURE__*/React.createElement(ImageIcon, {
|
|
19
21
|
src: typeof context.icon === 'string' ? context.icon : undefined
|
|
20
22
|
});
|
|
23
|
+
var handleOnAuthorizeClick = useCallback(function () {
|
|
24
|
+
if (onAuthorise) {
|
|
25
|
+
analytics.track.appAccountAuthStarted({
|
|
26
|
+
extensionKey: extensionKey
|
|
27
|
+
});
|
|
28
|
+
onAuthorise();
|
|
29
|
+
}
|
|
30
|
+
}, [onAuthorise, analytics.track, extensionKey]);
|
|
21
31
|
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
22
32
|
href: link,
|
|
23
33
|
icon: icon,
|
|
@@ -38,9 +48,10 @@ export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref)
|
|
|
38
48
|
text: 'connect_unauthorised_account_action',
|
|
39
49
|
testId: 'connect-account'
|
|
40
50
|
},
|
|
41
|
-
onClick:
|
|
51
|
+
onClick: handleOnAuthorizeClick,
|
|
42
52
|
testId: testId
|
|
43
53
|
}, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
54
|
+
analytics: analytics,
|
|
44
55
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
45
56
|
testId: testId
|
|
46
57
|
})));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { EmbedModalSize } from '../../types';
|
|
4
|
+
import { CardDisplay } from '../../../../constants';
|
|
4
5
|
|
|
5
6
|
var getResizeFrom = function getResizeFrom(size) {
|
|
6
7
|
return size === EmbedModalSize.Small ? EmbedModalSize.Large : EmbedModalSize.Small;
|
|
@@ -24,7 +25,7 @@ var withAnalytics = function withAnalytics(Component) {
|
|
|
24
25
|
});
|
|
25
26
|
analytics.ui.renderSuccessEvent({
|
|
26
27
|
status: 'resolved',
|
|
27
|
-
display:
|
|
28
|
+
display: CardDisplay.EmbedPreview
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
if (onOpen) {
|
|
@@ -33,7 +34,7 @@ var withAnalytics = function withAnalytics(Component) {
|
|
|
33
34
|
}, [analytics.screen, analytics.ui, onOpen, origin]);
|
|
34
35
|
var handleOnOpenFailed = useCallback(function (error, errorInfo) {
|
|
35
36
|
analytics.ui.renderFailedEvent({
|
|
36
|
-
display:
|
|
37
|
+
display: CardDisplay.EmbedPreview,
|
|
37
38
|
error: error,
|
|
38
39
|
errorInfo: errorInfo
|
|
39
40
|
});
|