@atlaskit/smart-card 32.7.6 → 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 +16 -0
- package/dist/cjs/extractors/flexible/actions/index.js +5 -7
- package/dist/cjs/state/actions/index.js +13 -38
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +54 -305
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -2
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +4 -5
- package/dist/cjs/utils/analytics/analytics.js +28 -304
- package/dist/cjs/utils/analytics/index.js +0 -66
- package/dist/cjs/utils/mocks.js +5 -7
- package/dist/cjs/view/BlockCard/views/styled.js +1 -1
- package/dist/cjs/view/Card/index.js +5 -7
- package/dist/cjs/view/CardWithUrl/component.js +7 -22
- package/dist/cjs/view/EmbedCard/EmbedResizeMessageListener.js +7 -10
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +10 -12
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +61 -61
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +1 -1
- 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/FlexibleCard/components/elements/utils.js +34 -34
- package/dist/cjs/view/FlexibleCard/components/utils.js +5 -5
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/cjs/view/HoverCard/styled.js +1 -1
- package/dist/cjs/view/InlineCard/ErroredView/index.js +8 -11
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +10 -13
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +7 -10
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +5 -7
- package/dist/cjs/view/InlineCard/ResolvingView/index.js +5 -7
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/LinkView/index.js +5 -7
- 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/BlockCard/views/styled.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +8 -23
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +3 -3
- 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/FlexibleCard/components/utils.js +3 -3
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/es2019/view/HoverCard/styled.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/esm/extractors/flexible/actions/index.js +5 -7
- package/dist/esm/state/actions/index.js +13 -38
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +55 -306
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -2
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +4 -5
- package/dist/esm/utils/analytics/analytics.js +27 -303
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/utils/mocks.js +5 -7
- package/dist/esm/view/BlockCard/views/styled.js +1 -1
- package/dist/esm/view/Card/index.js +5 -7
- package/dist/esm/view/CardWithUrl/component.js +8 -23
- package/dist/esm/view/EmbedCard/EmbedResizeMessageListener.js +7 -10
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +10 -12
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +61 -61
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +1 -1
- 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/FlexibleCard/components/elements/utils.js +34 -34
- package/dist/esm/view/FlexibleCard/components/utils.js +5 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/esm/view/HoverCard/styled.js +1 -1
- package/dist/esm/view/InlineCard/ErroredView/index.js +8 -11
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +10 -13
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +7 -10
- package/dist/esm/view/InlineCard/ResolvedView/index.js +5 -7
- package/dist/esm/view/InlineCard/ResolvingView/index.js +5 -7
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/LinkView/index.js +5 -7
- 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,10 +1,9 @@
|
|
|
1
|
-
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
2
1
|
import { getMeasure } from '../performance';
|
|
3
2
|
export const ANALYTICS_CHANNEL = 'media';
|
|
4
3
|
export const context = {
|
|
5
4
|
componentName: 'smart-cards',
|
|
6
5
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "32.7.
|
|
6
|
+
packageVersion: "32.7.8"
|
|
8
7
|
};
|
|
9
8
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
9
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -16,15 +15,6 @@ export let TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
|
|
|
16
15
|
TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
|
|
17
16
|
return TrackQuickActionFailureReason;
|
|
18
17
|
}({});
|
|
19
|
-
export const SmartLinkActionTypeTrackingEventMapper = {
|
|
20
|
-
[SmartLinkActionType.FollowEntityAction]: 'Follow',
|
|
21
|
-
[SmartLinkActionType.StatusUpdateAction]: 'StatusUpdate',
|
|
22
|
-
[SmartLinkActionType.UnfollowEntityAction]: 'Unfollow'
|
|
23
|
-
};
|
|
24
|
-
export const SmartLinkActionTypeUiEventMapper = {
|
|
25
|
-
[SmartLinkActionType.FollowEntityAction]: 'smartLinkFollowButton',
|
|
26
|
-
[SmartLinkActionType.UnfollowEntityAction]: 'smartLinkFollowButton'
|
|
27
|
-
};
|
|
28
18
|
const uiActionSubjectIds = {
|
|
29
19
|
DownloadAction: 'downloadDocument',
|
|
30
20
|
PreviewAction: 'invokePreviewScreen',
|
|
@@ -111,91 +101,6 @@ export const invokeFailedEvent = ({
|
|
|
111
101
|
}
|
|
112
102
|
};
|
|
113
103
|
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
117
|
-
*/
|
|
118
|
-
export const uiAuthEvent = ({
|
|
119
|
-
definitionId,
|
|
120
|
-
extensionKey,
|
|
121
|
-
destinationProduct,
|
|
122
|
-
destinationSubproduct,
|
|
123
|
-
location,
|
|
124
|
-
display
|
|
125
|
-
}) => ({
|
|
126
|
-
action: 'clicked',
|
|
127
|
-
actionSubject: 'button',
|
|
128
|
-
actionSubjectId: 'connectAccount',
|
|
129
|
-
eventType: 'ui',
|
|
130
|
-
attributes: {
|
|
131
|
-
...context,
|
|
132
|
-
definitionId,
|
|
133
|
-
extensionKey,
|
|
134
|
-
destinationProduct,
|
|
135
|
-
destinationSubproduct,
|
|
136
|
-
location,
|
|
137
|
-
display
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
143
|
-
*/
|
|
144
|
-
export const uiAuthAlternateAccountEvent = ({
|
|
145
|
-
definitionId,
|
|
146
|
-
extensionKey,
|
|
147
|
-
destinationProduct,
|
|
148
|
-
destinationSubproduct,
|
|
149
|
-
location,
|
|
150
|
-
display
|
|
151
|
-
}) => ({
|
|
152
|
-
action: 'clicked',
|
|
153
|
-
actionSubject: 'smartLink',
|
|
154
|
-
actionSubjectId: 'tryAnotherAccount',
|
|
155
|
-
eventType: 'ui',
|
|
156
|
-
attributes: {
|
|
157
|
-
...context,
|
|
158
|
-
definitionId,
|
|
159
|
-
extensionKey,
|
|
160
|
-
destinationProduct,
|
|
161
|
-
destinationSubproduct,
|
|
162
|
-
location,
|
|
163
|
-
display
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
169
|
-
*/
|
|
170
|
-
export const uiCardClickedEvent = ({
|
|
171
|
-
id,
|
|
172
|
-
display,
|
|
173
|
-
status,
|
|
174
|
-
definitionId,
|
|
175
|
-
extensionKey,
|
|
176
|
-
isModifierKeyPressed,
|
|
177
|
-
location,
|
|
178
|
-
destinationProduct,
|
|
179
|
-
destinationSubproduct,
|
|
180
|
-
actionSubjectId
|
|
181
|
-
}) => ({
|
|
182
|
-
action: 'clicked',
|
|
183
|
-
actionSubject: 'smartLink',
|
|
184
|
-
actionSubjectId,
|
|
185
|
-
eventType: 'ui',
|
|
186
|
-
attributes: {
|
|
187
|
-
...context,
|
|
188
|
-
id,
|
|
189
|
-
status,
|
|
190
|
-
definitionId,
|
|
191
|
-
extensionKey,
|
|
192
|
-
display,
|
|
193
|
-
isModifierKeyPressed,
|
|
194
|
-
location,
|
|
195
|
-
destinationProduct,
|
|
196
|
-
destinationSubproduct
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
104
|
export const uiActionClickedEvent = ({
|
|
200
105
|
id,
|
|
201
106
|
actionType,
|
|
@@ -222,31 +127,6 @@ export const uiActionClickedEvent = ({
|
|
|
222
127
|
location
|
|
223
128
|
}
|
|
224
129
|
});
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
228
|
-
*/
|
|
229
|
-
export const uiClosedAuthEvent = ({
|
|
230
|
-
display,
|
|
231
|
-
extensionKey,
|
|
232
|
-
definitionId,
|
|
233
|
-
destinationProduct,
|
|
234
|
-
destinationSubproduct,
|
|
235
|
-
location
|
|
236
|
-
}) => ({
|
|
237
|
-
action: 'closed',
|
|
238
|
-
actionSubject: 'consentModal',
|
|
239
|
-
eventType: 'ui',
|
|
240
|
-
attributes: {
|
|
241
|
-
...context,
|
|
242
|
-
extensionKey,
|
|
243
|
-
definitionId,
|
|
244
|
-
destinationProduct,
|
|
245
|
-
destinationSubproduct,
|
|
246
|
-
location,
|
|
247
|
-
display
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
130
|
export const uiRenderSuccessEvent = ({
|
|
251
131
|
display,
|
|
252
132
|
status,
|
|
@@ -296,168 +176,4 @@ export const uiRenderFailedEvent = ({
|
|
|
296
176
|
destinationSubproduct,
|
|
297
177
|
location
|
|
298
178
|
}
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
303
|
-
*/
|
|
304
|
-
export const uiHoverCardViewedEvent = ({
|
|
305
|
-
id,
|
|
306
|
-
previewDisplay,
|
|
307
|
-
extensionKey,
|
|
308
|
-
definitionId,
|
|
309
|
-
destinationProduct,
|
|
310
|
-
destinationSubproduct,
|
|
311
|
-
location,
|
|
312
|
-
previewInvokeMethod,
|
|
313
|
-
status
|
|
314
|
-
}) => ({
|
|
315
|
-
action: 'viewed',
|
|
316
|
-
actionSubject: 'hoverCard',
|
|
317
|
-
eventType: 'ui',
|
|
318
|
-
attributes: {
|
|
319
|
-
...context,
|
|
320
|
-
id,
|
|
321
|
-
previewDisplay,
|
|
322
|
-
extensionKey,
|
|
323
|
-
definitionId,
|
|
324
|
-
destinationProduct,
|
|
325
|
-
destinationSubproduct,
|
|
326
|
-
location,
|
|
327
|
-
previewInvokeMethod,
|
|
328
|
-
status
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
334
|
-
*/
|
|
335
|
-
export const uiHoverCardDismissedEvent = ({
|
|
336
|
-
id,
|
|
337
|
-
previewDisplay,
|
|
338
|
-
hoverTime,
|
|
339
|
-
extensionKey,
|
|
340
|
-
definitionId,
|
|
341
|
-
destinationProduct,
|
|
342
|
-
destinationSubproduct,
|
|
343
|
-
location,
|
|
344
|
-
previewInvokeMethod,
|
|
345
|
-
status
|
|
346
|
-
}) => ({
|
|
347
|
-
action: 'dismissed',
|
|
348
|
-
actionSubject: 'hoverCard',
|
|
349
|
-
eventType: 'ui',
|
|
350
|
-
attributes: {
|
|
351
|
-
...context,
|
|
352
|
-
id,
|
|
353
|
-
previewDisplay,
|
|
354
|
-
hoverTime,
|
|
355
|
-
extensionKey,
|
|
356
|
-
definitionId,
|
|
357
|
-
destinationProduct,
|
|
358
|
-
destinationSubproduct,
|
|
359
|
-
location,
|
|
360
|
-
previewInvokeMethod,
|
|
361
|
-
status
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
367
|
-
*/
|
|
368
|
-
export const uiHoverCardOpenLinkClickedEvent = ({
|
|
369
|
-
id,
|
|
370
|
-
previewDisplay,
|
|
371
|
-
extensionKey,
|
|
372
|
-
definitionId,
|
|
373
|
-
destinationProduct,
|
|
374
|
-
destinationSubproduct,
|
|
375
|
-
location,
|
|
376
|
-
previewInvokeMethod
|
|
377
|
-
}) => ({
|
|
378
|
-
action: 'clicked',
|
|
379
|
-
actionSubject: 'button',
|
|
380
|
-
actionSubjectId: 'shortcutGoToLink',
|
|
381
|
-
eventType: 'ui',
|
|
382
|
-
attributes: {
|
|
383
|
-
...context,
|
|
384
|
-
id,
|
|
385
|
-
previewDisplay,
|
|
386
|
-
extensionKey,
|
|
387
|
-
definitionId,
|
|
388
|
-
destinationProduct,
|
|
389
|
-
destinationSubproduct,
|
|
390
|
-
location,
|
|
391
|
-
previewInvokeMethod
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
397
|
-
*/
|
|
398
|
-
export const uiLearnMoreLinkClickedEvent = () => ({
|
|
399
|
-
action: 'clicked',
|
|
400
|
-
actionSubject: 'button',
|
|
401
|
-
actionSubjectId: 'learnMore',
|
|
402
|
-
eventType: 'ui',
|
|
403
|
-
attributes: {
|
|
404
|
-
...context
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
410
|
-
*/
|
|
411
|
-
export const uiSmartLinkStatusLozengeButtonClicked = () => ({
|
|
412
|
-
action: 'clicked',
|
|
413
|
-
actionSubject: 'button',
|
|
414
|
-
actionSubjectId: 'smartLinkStatusLozenge',
|
|
415
|
-
eventType: 'ui',
|
|
416
|
-
attributes: {
|
|
417
|
-
...context
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
423
|
-
*/
|
|
424
|
-
export const uiSmartLinkStatusListItemButtonClicked = () => ({
|
|
425
|
-
action: 'clicked',
|
|
426
|
-
actionSubject: 'button',
|
|
427
|
-
actionSubjectId: 'smartLinkStatusListItem',
|
|
428
|
-
eventType: 'ui',
|
|
429
|
-
attributes: {
|
|
430
|
-
...context
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
436
|
-
*/
|
|
437
|
-
export const uiSmartLinkStatusOpenPreviewButtonClicked = () => ({
|
|
438
|
-
action: 'clicked',
|
|
439
|
-
actionSubject: 'button',
|
|
440
|
-
actionSubjectId: 'smartLinkStatusOpenPreview',
|
|
441
|
-
eventType: 'ui',
|
|
442
|
-
attributes: {
|
|
443
|
-
...context
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
449
|
-
*/
|
|
450
|
-
export const uiServerActionClicked = ({
|
|
451
|
-
smartLinkActionType
|
|
452
|
-
}) => {
|
|
453
|
-
var _SmartLinkActionTypeU;
|
|
454
|
-
return {
|
|
455
|
-
action: 'clicked',
|
|
456
|
-
actionSubject: 'button',
|
|
457
|
-
actionSubjectId: (_SmartLinkActionTypeU = SmartLinkActionTypeUiEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeU !== void 0 ? _SmartLinkActionTypeU : smartLinkActionType,
|
|
458
|
-
eventType: 'ui',
|
|
459
|
-
attributes: {
|
|
460
|
-
...context
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
};
|
|
179
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent,
|
|
1
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiActionClickedEvent, uiRenderSuccessEvent, uiRenderFailedEvent } from './analytics';
|
|
@@ -23,7 +23,7 @@ export const titleBlockCss = css({
|
|
|
23
23
|
gap: "var(--ds-space-100, 0.5em)",
|
|
24
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
25
25
|
"[data-smart-element='Title']": {
|
|
26
|
-
fontWeight: 600
|
|
26
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)"
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -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';
|
|
@@ -64,8 +64,6 @@ function Component({
|
|
|
64
64
|
const definitionId = getDefinitionId(state.details);
|
|
65
65
|
const extensionKey = getExtensionKey(state.details);
|
|
66
66
|
const resourceType = getResourceType(state.details);
|
|
67
|
-
const product = getProduct(state.details);
|
|
68
|
-
const subproduct = getSubproduct(state.details);
|
|
69
67
|
const services = getServices(state.details);
|
|
70
68
|
const canBeDatasource = getCanBeDatasource(state.details);
|
|
71
69
|
let isFlexibleUi = useMemo(() => isFlexibleUiCard(children), [children]);
|
|
@@ -77,25 +75,12 @@ function Component({
|
|
|
77
75
|
// Setup UI handlers.
|
|
78
76
|
const handleClickWrapper = useCallback(event => {
|
|
79
77
|
const isModifierKeyPressed = isSpecialEvent(event);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
87
|
-
} else {
|
|
88
|
-
analytics.ui.cardClickedEvent({
|
|
89
|
-
id,
|
|
90
|
-
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
91
|
-
status: state.status,
|
|
92
|
-
definitionId,
|
|
93
|
-
extensionKey,
|
|
94
|
-
isModifierKeyPressed,
|
|
95
|
-
destinationProduct: product,
|
|
96
|
-
destinationSubproduct: subproduct
|
|
97
|
-
});
|
|
98
|
-
}
|
|
78
|
+
fireEvent('ui.smartLink.clicked', {
|
|
79
|
+
id,
|
|
80
|
+
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
81
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
82
|
+
isModifierKeyPressed
|
|
83
|
+
});
|
|
99
84
|
if (!onClick && !isFlexibleUi) {
|
|
100
85
|
const clickUrl = getClickUrl(url, state.details);
|
|
101
86
|
// Ctrl+left click on mac typically doesn't trigger onClick
|
|
@@ -115,7 +100,7 @@ function Component({
|
|
|
115
100
|
}
|
|
116
101
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
117
102
|
}
|
|
118
|
-
}, [id, url, state.details,
|
|
103
|
+
}, [id, url, state.details, appearance, definitionId, onClick, isFlexibleUi, createAnalyticsEvent, fireEvent]);
|
|
119
104
|
const handleAuthorize = useCallback(() => actions.authorize(appearance), [actions, appearance]);
|
|
120
105
|
const handleRetry = useCallback(() => {
|
|
121
106
|
actions.reload();
|
|
@@ -26,7 +26,7 @@ const getButtonStyle = (size, iconOnly) => {
|
|
|
26
26
|
case SmartLinkSize.Small:
|
|
27
27
|
return css({
|
|
28
28
|
fontSize: '0.75rem',
|
|
29
|
-
fontWeight: 500,
|
|
29
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
30
30
|
lineHeight: '1rem',
|
|
31
31
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
32
|
'button, button:hover, button:focus, button:active': [{
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useState } from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
5
|
-
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
6
4
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
7
5
|
import { getInvokeFailureReason } from '../../../../../../state/hooks/use-invoke/utils';
|
|
8
6
|
import useResolve from '../../../../../../state/hooks/use-resolve';
|
|
@@ -15,7 +13,6 @@ const ServerAction = ({
|
|
|
15
13
|
...props
|
|
16
14
|
}) => {
|
|
17
15
|
const [isLoading, setIsLoading] = useState(false);
|
|
18
|
-
const analytics = useFlexibleUiAnalyticsContext();
|
|
19
16
|
const invoke = useInvoke();
|
|
20
17
|
const reload = useResolve();
|
|
21
18
|
const {
|
|
@@ -27,16 +24,10 @@ const ServerAction = ({
|
|
|
27
24
|
const smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
28
25
|
try {
|
|
29
26
|
setIsLoading(true);
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
33
|
-
} else {
|
|
34
|
-
fireEvent(`ui.button.clicked.${smartLinkActionType}`, {});
|
|
35
|
-
}
|
|
27
|
+
if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
|
|
28
|
+
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
36
29
|
} else {
|
|
37
|
-
|
|
38
|
-
smartLinkActionType
|
|
39
|
-
});
|
|
30
|
+
fireEvent(`ui.button.clicked.${smartLinkActionType}`, {});
|
|
40
31
|
}
|
|
41
32
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
42
33
|
smartLinkActionType
|
|
@@ -62,7 +53,7 @@ const ServerAction = ({
|
|
|
62
53
|
onErrorCallback === null || onErrorCallback === void 0 ? void 0 : onErrorCallback();
|
|
63
54
|
}
|
|
64
55
|
}
|
|
65
|
-
}, [action,
|
|
56
|
+
}, [action, invoke, onClick, onErrorCallback, reload, fireEvent]);
|
|
66
57
|
return /*#__PURE__*/React.createElement(Action, _extends({}, props, {
|
|
67
58
|
isLoading: isLoading,
|
|
68
59
|
onClick: handleClick
|
|
@@ -57,8 +57,8 @@ export const renderWithDi = (node, dependencies = [], options) => render(node, {
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
export const createGenericComponent = (displayName, renderChildren = true, childrenParams) => {
|
|
60
|
-
var
|
|
61
|
-
return
|
|
60
|
+
var _Class;
|
|
61
|
+
return _Class = class extends Component {
|
|
62
62
|
render() {
|
|
63
63
|
if (renderChildren && typeof this.props.children === 'function') {
|
|
64
64
|
if (childrenParams) {
|
|
@@ -71,5 +71,5 @@ export const createGenericComponent = (displayName, renderChildren = true, child
|
|
|
71
71
|
}
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
}, _defineProperty(
|
|
74
|
+
}, _defineProperty(_Class, "displayName", displayName), _Class;
|
|
75
75
|
};
|
|
@@ -8,10 +8,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
13
12
|
import extractLozengeActionItems from '../../../../../../extractors/action/extract-lozenge-action-items';
|
|
14
|
-
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
15
13
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
16
14
|
import { isInvokeCustomError } from '../../../../../../state/hooks/use-invoke/utils';
|
|
17
15
|
import useResolve from '../../../../../../state/hooks/use-resolve';
|
|
@@ -44,8 +42,6 @@ const LozengeAction = ({
|
|
|
44
42
|
const [items, setItems] = useState();
|
|
45
43
|
const [errorMessage, setErrorMessage] = useState();
|
|
46
44
|
const reload = useResolve();
|
|
47
|
-
//TODO EDM-6583 Replace usage of useFlexibleUiAnalyticsContext with linking platform analytics context from find team.
|
|
48
|
-
const analytics = useFlexibleUiAnalyticsContext();
|
|
49
45
|
const invoke = useInvoke();
|
|
50
46
|
const {
|
|
51
47
|
fireEvent
|
|
@@ -64,11 +60,7 @@ const LozengeAction = ({
|
|
|
64
60
|
const handleOpenChange = useCallback(async args => {
|
|
65
61
|
setIsOpen(args.isOpen);
|
|
66
62
|
if (args.isOpen) {
|
|
67
|
-
|
|
68
|
-
fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
|
|
69
|
-
} else {
|
|
70
|
-
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionClickedEvent();
|
|
71
|
-
}
|
|
63
|
+
fireEvent('ui.button.clicked.smartLinkStatusLozenge', {});
|
|
72
64
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
73
65
|
smartLinkActionType: TrackQuickActionType.StatusUpdate
|
|
74
66
|
});
|
|
@@ -96,7 +88,7 @@ const LozengeAction = ({
|
|
|
96
88
|
if (!args.isOpen) {
|
|
97
89
|
setErrorMessage(undefined);
|
|
98
90
|
}
|
|
99
|
-
}, [action.read,
|
|
91
|
+
}, [action.read, invoke, isLoaded, text, fireEvent]);
|
|
100
92
|
const trigger = useCallback(props => jsx(LozengeActionTrigger, _extends({}, props, {
|
|
101
93
|
appearance: selected.appearance,
|
|
102
94
|
isOpen: isOpen,
|
|
@@ -105,11 +97,7 @@ const LozengeAction = ({
|
|
|
105
97
|
})), [selected.appearance, selected.text, isOpen, testId]);
|
|
106
98
|
const handleItemClick = useCallback(async (id, text, appearance) => {
|
|
107
99
|
try {
|
|
108
|
-
|
|
109
|
-
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
110
|
-
} else {
|
|
111
|
-
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionListItemClickedEvent();
|
|
112
|
-
}
|
|
100
|
+
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
113
101
|
const updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
114
102
|
if (updateAction && id) {
|
|
115
103
|
setIsLoading(true);
|
|
@@ -140,7 +128,7 @@ const LozengeAction = ({
|
|
|
140
128
|
fireEvent('track.smartLinkQuickAction.failed', unknownUpdateErrorAnalyticsPayload);
|
|
141
129
|
}
|
|
142
130
|
}
|
|
143
|
-
}, [action === null || action === void 0 ? void 0 : action.update,
|
|
131
|
+
}, [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
|
|
144
132
|
const dropdownItemGroup = useMemo(() => {
|
|
145
133
|
if (errorMessage) {
|
|
146
134
|
return jsx(LozengeActionError, {
|
|
@@ -41,11 +41,7 @@ const LozengeActionError = ({
|
|
|
41
41
|
}, [reload, url]);
|
|
42
42
|
const handlePreviewOpen = useCallback(() => {
|
|
43
43
|
if (isPreviewAvailable) {
|
|
44
|
-
|
|
45
|
-
fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
|
|
46
|
-
} else {
|
|
47
|
-
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
|
|
48
|
-
}
|
|
44
|
+
fireEvent('ui.button.clicked.smartLinkStatusOpenPreview', {});
|
|
49
45
|
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
50
46
|
invokePreviewAction && invoke(invokePreviewAction);
|
|
51
47
|
} else {
|
|
@@ -98,7 +98,7 @@ export const getLinkSizeStyles = size => {
|
|
|
98
98
|
case SmartLinkSize.XLarge:
|
|
99
99
|
return css({
|
|
100
100
|
fontSize: '1.25rem',
|
|
101
|
-
fontWeight: 400,
|
|
101
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
102
102
|
letterSpacing: '-0.008em',
|
|
103
103
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
104
104
|
lineHeight: getLinkLineHeight(size)
|
|
@@ -107,7 +107,7 @@ export const getLinkSizeStyles = size => {
|
|
|
107
107
|
case SmartLinkSize.Medium:
|
|
108
108
|
return css({
|
|
109
109
|
fontSize: '0.875rem',
|
|
110
|
-
fontWeight: 400,
|
|
110
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
111
111
|
letterSpacing: '-0.003em',
|
|
112
112
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
113
113
|
lineHeight: getLinkLineHeight(size)
|
|
@@ -116,7 +116,7 @@ export const getLinkSizeStyles = size => {
|
|
|
116
116
|
default:
|
|
117
117
|
return css({
|
|
118
118
|
fontSize: '0.75rem',
|
|
119
|
-
fontWeight: 400,
|
|
119
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
120
120
|
letterSpacing: '0em',
|
|
121
121
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
122
122
|
lineHeight: getLinkLineHeight(size)
|