@atlaskit/smart-card 32.7.0 → 32.7.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 +7 -0
- package/analytics.spec.yaml +63 -9
- package/dist/cjs/common/analytics/types.js +5 -0
- package/dist/cjs/extractors/action/extract-invoke-copy-link-action.js +53 -0
- package/dist/cjs/extractors/action/extract-invoke-download-action.js +57 -0
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +78 -0
- package/dist/cjs/extractors/action/extract-invoke-view-action.js +60 -0
- package/dist/cjs/extractors/action/extractDownloadActionProps.js +4 -0
- package/dist/cjs/extractors/action/extractPreviewActionProps.js +4 -0
- package/dist/cjs/extractors/action/extractViewActionProps.js +4 -0
- package/dist/cjs/extractors/action/types.js +5 -0
- package/dist/cjs/extractors/flexible/actions/extract-copy-link-action.js +12 -1
- package/dist/cjs/extractors/flexible/actions/extract-download-action.js +12 -1
- package/dist/cjs/extractors/flexible/actions/extract-preview-action.js +12 -1
- package/dist/cjs/extractors/flexible/actions/extract-view-action.js +3 -0
- package/dist/cjs/extractors/flexible/actions/index.js +40 -3
- package/dist/cjs/extractors/flexible/extract-state.js +19 -5
- package/dist/cjs/extractors/flexible/index.js +22 -8
- package/dist/cjs/state/hooks/use-invoke-client-action/index.js +56 -17
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +22 -3
- package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +7 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/mocks.js +4 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +1 -0
- package/dist/cjs/view/BlockCard/views/flexible/unresolved-view/index.js +1 -0
- package/dist/cjs/view/CardWithUrl/component.js +1 -0
- package/dist/cjs/view/EmbedModal/index.js +72 -51
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +65 -32
- package/dist/cjs/view/FlexibleCard/components/actions/download-action/index.js +36 -28
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +40 -32
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +13 -6
- package/dist/cjs/view/FlexibleCard/components/utils.js +4 -0
- package/dist/cjs/view/FlexibleCard/index.js +11 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/common/analytics/types.js +1 -0
- package/dist/es2019/extractors/action/extract-invoke-copy-link-action.js +29 -0
- package/dist/es2019/extractors/action/extract-invoke-download-action.js +31 -0
- package/dist/es2019/extractors/action/extract-invoke-preview-action.js +57 -0
- package/dist/es2019/extractors/action/extract-invoke-view-action.js +34 -0
- package/dist/es2019/extractors/action/extractDownloadActionProps.js +5 -0
- package/dist/es2019/extractors/action/extractPreviewActionProps.js +5 -0
- package/dist/es2019/extractors/action/extractViewActionProps.js +5 -0
- package/dist/es2019/extractors/action/types.js +1 -0
- package/dist/es2019/extractors/flexible/actions/extract-copy-link-action.js +11 -0
- package/dist/es2019/extractors/flexible/actions/extract-download-action.js +12 -0
- package/dist/es2019/extractors/flexible/actions/extract-preview-action.js +12 -0
- package/dist/es2019/extractors/flexible/actions/extract-view-action.js +4 -0
- package/dist/es2019/extractors/flexible/actions/index.js +48 -3
- package/dist/es2019/extractors/flexible/extract-state.js +17 -5
- package/dist/es2019/extractors/flexible/index.js +17 -6
- package/dist/es2019/state/hooks/use-invoke-client-action/index.js +91 -43
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +21 -3
- package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +3 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/mocks.js +4 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +1 -0
- package/dist/es2019/view/BlockCard/views/flexible/unresolved-view/index.js +1 -0
- package/dist/es2019/view/CardWithUrl/component.js +1 -0
- package/dist/es2019/view/EmbedModal/index.js +41 -20
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +31 -16
- package/dist/es2019/view/FlexibleCard/components/actions/download-action/index.js +20 -12
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +25 -17
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +14 -7
- package/dist/es2019/view/FlexibleCard/components/utils.js +4 -0
- package/dist/es2019/view/FlexibleCard/index.js +12 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/common/analytics/types.js +1 -0
- package/dist/esm/extractors/action/extract-invoke-copy-link-action.js +46 -0
- package/dist/esm/extractors/action/extract-invoke-download-action.js +50 -0
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +71 -0
- package/dist/esm/extractors/action/extract-invoke-view-action.js +53 -0
- package/dist/esm/extractors/action/extractDownloadActionProps.js +5 -0
- package/dist/esm/extractors/action/extractPreviewActionProps.js +5 -0
- package/dist/esm/extractors/action/extractViewActionProps.js +5 -0
- package/dist/esm/extractors/action/types.js +1 -0
- package/dist/esm/extractors/flexible/actions/extract-copy-link-action.js +11 -0
- package/dist/esm/extractors/flexible/actions/extract-download-action.js +12 -0
- package/dist/esm/extractors/flexible/actions/extract-preview-action.js +12 -0
- package/dist/esm/extractors/flexible/actions/extract-view-action.js +4 -0
- package/dist/esm/extractors/flexible/actions/index.js +42 -5
- package/dist/esm/extractors/flexible/extract-state.js +19 -5
- package/dist/esm/extractors/flexible/index.js +19 -8
- package/dist/esm/state/hooks/use-invoke-client-action/index.js +56 -17
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +22 -3
- package/dist/esm/utils/analytics/LinkAnalyticsContext.js +7 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/mocks.js +4 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +1 -0
- package/dist/esm/view/BlockCard/views/flexible/unresolved-view/index.js +1 -0
- package/dist/esm/view/CardWithUrl/component.js +1 -0
- package/dist/esm/view/EmbedModal/index.js +73 -52
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +65 -32
- package/dist/esm/view/FlexibleCard/components/actions/download-action/index.js +36 -28
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +40 -32
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +13 -6
- package/dist/esm/view/FlexibleCard/components/utils.js +4 -0
- package/dist/esm/view/FlexibleCard/index.js +11 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +63 -2
- package/dist/types/common/analytics/types.d.ts +2 -0
- package/dist/types/extractors/action/extract-invoke-copy-link-action.d.ts +3 -0
- package/dist/types/extractors/action/extract-invoke-download-action.d.ts +3 -0
- package/dist/types/extractors/action/extract-invoke-preview-action.d.ts +11 -0
- package/dist/types/extractors/action/extract-invoke-view-action.d.ts +3 -0
- package/dist/types/extractors/action/extractDownloadActionProps.d.ts +4 -0
- package/dist/types/extractors/action/extractPreviewActionProps.d.ts +5 -1
- package/dist/types/extractors/action/extractViewActionProps.d.ts +4 -0
- package/dist/types/extractors/action/types.d.ts +9 -0
- package/dist/types/extractors/flexible/actions/extract-copy-link-action.d.ts +6 -0
- package/dist/types/extractors/flexible/actions/extract-download-action.d.ts +6 -0
- package/dist/types/extractors/flexible/actions/extract-preview-action.d.ts +6 -0
- package/dist/types/extractors/flexible/actions/extract-view-action.d.ts +3 -0
- package/dist/types/extractors/flexible/actions/index.d.ts +21 -4
- package/dist/types/extractors/flexible/extract-state.d.ts +5 -2
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +9 -3
- package/dist/types/state/hooks/use-invoke/types.d.ts +7 -1
- package/dist/types/state/hooks/use-invoke-client-action/index.d.ts +2 -2
- package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +24 -2
- package/dist/types/state/hooks/use-resolve/index.d.ts +1 -0
- package/dist/types/view/EmbedModal/index.d.ts +4 -0
- package/dist/types/view/EmbedModal/types.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/utils.d.ts +3 -0
- package/dist/types/view/FlexibleCard/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +12 -3
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +63 -2
- package/dist/types-ts4.5/common/analytics/types.d.ts +2 -0
- package/dist/types-ts4.5/extractors/action/extract-invoke-copy-link-action.d.ts +3 -0
- package/dist/types-ts4.5/extractors/action/extract-invoke-download-action.d.ts +3 -0
- package/dist/types-ts4.5/extractors/action/extract-invoke-preview-action.d.ts +11 -0
- package/dist/types-ts4.5/extractors/action/extract-invoke-view-action.d.ts +3 -0
- package/dist/types-ts4.5/extractors/action/extractDownloadActionProps.d.ts +4 -0
- package/dist/types-ts4.5/extractors/action/extractPreviewActionProps.d.ts +5 -1
- package/dist/types-ts4.5/extractors/action/extractViewActionProps.d.ts +4 -0
- package/dist/types-ts4.5/extractors/action/types.d.ts +9 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-copy-link-action.d.ts +6 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-download-action.d.ts +6 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-preview-action.d.ts +6 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-view-action.d.ts +3 -0
- package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +21 -4
- package/dist/types-ts4.5/extractors/flexible/extract-state.d.ts +5 -2
- package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +9 -3
- package/dist/types-ts4.5/state/hooks/use-invoke/types.d.ts +7 -1
- package/dist/types-ts4.5/state/hooks/use-invoke-client-action/index.d.ts +2 -2
- package/dist/types-ts4.5/state/hooks/use-invoke-client-action/types.d.ts +24 -2
- package/dist/types-ts4.5/state/hooks/use-resolve/index.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedModal/index.d.ts +8 -0
- package/dist/types-ts4.5/view/EmbedModal/types.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/types.d.ts +6 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +12 -3
- package/package.json +4 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
2
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
3
3
|
import { CardAction } from '../../../view/Card/types';
|
|
4
|
+
import { extractInvokeCopyLinkAction } from '../../action/extract-invoke-copy-link-action';
|
|
5
|
+
/**
|
|
6
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
7
|
+
* Replaced with extractCopyLinkClientAction()
|
|
8
|
+
*/
|
|
4
9
|
export const extractCopyLinkAction = (data, actionOptions) => {
|
|
5
10
|
if (!canShowAction(CardAction.CopyLinkAction, actionOptions)) {
|
|
6
11
|
return;
|
|
@@ -12,4 +17,10 @@ export const extractCopyLinkAction = (data, actionOptions) => {
|
|
|
12
17
|
return {
|
|
13
18
|
url
|
|
14
19
|
};
|
|
20
|
+
};
|
|
21
|
+
export const extractCopyLinkClientAction = param => {
|
|
22
|
+
const invokeAction = extractInvokeCopyLinkAction(param);
|
|
23
|
+
return invokeAction ? {
|
|
24
|
+
invokeAction
|
|
25
|
+
} : undefined;
|
|
15
26
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
2
2
|
import { CardAction } from '../../../view/Card/types';
|
|
3
|
+
import { extractInvokeDownloadAction } from '../../action/extract-invoke-download-action';
|
|
3
4
|
import { getActionsFromJsonLd } from '../../common/actions/extractActions';
|
|
4
5
|
import { extractDownloadUrl } from '../../common/detail';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
9
|
+
* Replaced with extractDownloadClientAction()
|
|
10
|
+
*/
|
|
5
11
|
export const extractDownloadAction = (data, actionOptions) => {
|
|
6
12
|
if (!canShowAction(CardAction.DownloadAction, actionOptions)) {
|
|
7
13
|
return;
|
|
@@ -13,4 +19,10 @@ export const extractDownloadAction = (data, actionOptions) => {
|
|
|
13
19
|
};
|
|
14
20
|
}
|
|
15
21
|
return;
|
|
22
|
+
};
|
|
23
|
+
export const extractDownloadClientAction = param => {
|
|
24
|
+
const invokeAction = extractInvokeDownloadAction(param);
|
|
25
|
+
return invokeAction ? {
|
|
26
|
+
invokeAction
|
|
27
|
+
} : undefined;
|
|
16
28
|
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { extractLink, extractPreview as extractPreviewData, extractProvider, extractTitle } from '@atlaskit/link-extractors';
|
|
2
2
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
3
3
|
import { CardAction } from '../../../view/Card/types';
|
|
4
|
+
import { extractInvokePreviewAction } from '../../action/extract-invoke-preview-action';
|
|
4
5
|
import { extractDownloadUrl } from '../../common/detail';
|
|
5
6
|
import { extractIsSupportTheming } from '../../common/meta/extractIsSupportTheming';
|
|
6
7
|
import { extractIsTrusted } from '../../common/meta/extractIsTrusted';
|
|
7
8
|
import { extractLinkIcon } from '../icon';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
12
|
+
* Replaced with extractPreviewClientAction()
|
|
13
|
+
*/
|
|
8
14
|
export const extractPreviewAction = (response, actionOptions) => {
|
|
9
15
|
var _extractPreviewData;
|
|
10
16
|
if (!canShowAction(CardAction.PreviewAction, actionOptions)) {
|
|
@@ -26,4 +32,10 @@ export const extractPreviewAction = (response, actionOptions) => {
|
|
|
26
32
|
isTrusted: extractIsTrusted(meta)
|
|
27
33
|
};
|
|
28
34
|
}
|
|
35
|
+
};
|
|
36
|
+
export const extractPreviewClientAction = param => {
|
|
37
|
+
const invokeAction = extractInvokePreviewAction(param);
|
|
38
|
+
return invokeAction ? {
|
|
39
|
+
invokeAction
|
|
40
|
+
} : undefined;
|
|
29
41
|
};
|
|
@@ -2,6 +2,10 @@ import { extractLink } from '@atlaskit/link-extractors';
|
|
|
2
2
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
3
3
|
import { CardAction } from '../../../view/Card/types';
|
|
4
4
|
import { getActionsFromJsonLd } from '../../common/actions/extractActions';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
8
|
+
*/
|
|
5
9
|
export const extractViewAction = (data, actionOptions) => {
|
|
6
10
|
if (!canShowAction(CardAction.ViewAction, actionOptions)) {
|
|
7
11
|
return;
|
|
@@ -2,11 +2,56 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
2
2
|
import { ActionName, InternalActionName } from '../../../constants';
|
|
3
3
|
import { extractAISummaryAction } from './extract-ai-summary-action';
|
|
4
4
|
import { extractAutomationAction } from './extract-automation-action';
|
|
5
|
-
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
6
|
-
import { extractDownloadAction } from './extract-download-action';
|
|
5
|
+
import { extractCopyLinkAction, extractCopyLinkClientAction } from './extract-copy-link-action';
|
|
6
|
+
import { extractDownloadAction, extractDownloadClientAction } from './extract-download-action';
|
|
7
7
|
import extractFollowAction from './extract-follow-action';
|
|
8
|
-
import { extractPreviewAction } from './extract-preview-action';
|
|
8
|
+
import { extractPreviewAction, extractPreviewClientAction } from './extract-preview-action';
|
|
9
9
|
import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
|
|
10
|
+
export const extractFlexibleCardActions = ({
|
|
11
|
+
actionOptions,
|
|
12
|
+
aiSummaryConfig,
|
|
13
|
+
appearance,
|
|
14
|
+
fireEvent,
|
|
15
|
+
id,
|
|
16
|
+
origin,
|
|
17
|
+
response,
|
|
18
|
+
url
|
|
19
|
+
}) => {
|
|
20
|
+
const action = {
|
|
21
|
+
[ActionName.CopyLinkAction]: extractCopyLinkClientAction({
|
|
22
|
+
actionOptions,
|
|
23
|
+
appearance,
|
|
24
|
+
id,
|
|
25
|
+
response
|
|
26
|
+
}),
|
|
27
|
+
[ActionName.DownloadAction]: extractDownloadClientAction({
|
|
28
|
+
actionOptions,
|
|
29
|
+
appearance,
|
|
30
|
+
id,
|
|
31
|
+
response
|
|
32
|
+
}),
|
|
33
|
+
[ActionName.FollowAction]: extractFollowAction(response, actionOptions, id),
|
|
34
|
+
[ActionName.PreviewAction]: extractPreviewClientAction({
|
|
35
|
+
actionOptions,
|
|
36
|
+
appearance,
|
|
37
|
+
fireEvent,
|
|
38
|
+
id,
|
|
39
|
+
origin,
|
|
40
|
+
response
|
|
41
|
+
}),
|
|
42
|
+
[ActionName.AutomationAction]: extractAutomationAction(response),
|
|
43
|
+
[InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig),
|
|
44
|
+
...(fg('platform-smart-card-view-related-urls-action') ? {
|
|
45
|
+
[InternalActionName.ViewRelatedLinksAction]: extractViewRelatedLinksAction(response)
|
|
46
|
+
} : {})
|
|
47
|
+
};
|
|
48
|
+
return Object.values(action).some(value => Boolean(value)) ? action : undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
53
|
+
* Replaced with extractFlexibleCardActions()
|
|
54
|
+
*/
|
|
10
55
|
const extractActions = (response, url, actionOptions, id, aiSummaryConfig) => {
|
|
11
56
|
const data = response.data;
|
|
12
57
|
const action = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { getExtensionKey } from '../../state/helpers';
|
|
3
4
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
4
5
|
import { CardAction } from '../../view/Card/types';
|
|
6
|
+
import { extractInvokePreviewAction } from '../action/extract-invoke-preview-action';
|
|
5
7
|
import { extractLozenge } from '../common/lozenge';
|
|
6
8
|
import { extractPreviewAction } from './actions/extract-preview-action';
|
|
7
9
|
import extractServerAction from './extract-server-action';
|
|
@@ -18,7 +20,7 @@ const toInvokeRequest = (extensionKey, resourceIdentifiers, actionType, details)
|
|
|
18
20
|
details
|
|
19
21
|
};
|
|
20
22
|
};
|
|
21
|
-
const extractAction = (response, id) => {
|
|
23
|
+
const extractAction = (response, id, actionOptions, appearance, origin, fireEvent, resolve) => {
|
|
22
24
|
var _action$dataRetrieval, _action$dataUpdateAct;
|
|
23
25
|
const extensionKey = getExtensionKey(response);
|
|
24
26
|
const data = response === null || response === void 0 ? void 0 : response.data;
|
|
@@ -32,11 +34,21 @@ const extractAction = (response, id) => {
|
|
|
32
34
|
}
|
|
33
35
|
const read = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataRetrieval = action.dataRetrievalAction) === null || _action$dataRetrieval === void 0 ? void 0 : _action$dataRetrieval.name);
|
|
34
36
|
const url = extractLink(data);
|
|
35
|
-
const previewData = response ? extractPreviewAction(response) : null;
|
|
37
|
+
const previewData = !fg('platform-smart-card-migrate-embed-modal-analytics') ? response ? extractPreviewAction(response) : null : undefined;
|
|
38
|
+
const invokePreviewAction = response && fg('platform-smart-card-migrate-embed-modal-analytics') ? extractInvokePreviewAction({
|
|
39
|
+
actionOptions,
|
|
40
|
+
appearance,
|
|
41
|
+
fireEvent,
|
|
42
|
+
id,
|
|
43
|
+
onClose: resolve ? () => url && resolve(url, true) : undefined,
|
|
44
|
+
origin,
|
|
45
|
+
response
|
|
46
|
+
}) : undefined;
|
|
36
47
|
const details = {
|
|
37
48
|
id,
|
|
38
49
|
url,
|
|
39
|
-
previewData
|
|
50
|
+
previewData,
|
|
51
|
+
invokePreviewAction
|
|
40
52
|
};
|
|
41
53
|
const update = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataUpdateAct = action.dataUpdateAction) === null || _action$dataUpdateAct === void 0 ? void 0 : _action$dataUpdateAct.name, details);
|
|
42
54
|
return read || update ? {
|
|
@@ -44,7 +56,7 @@ const extractAction = (response, id) => {
|
|
|
44
56
|
update
|
|
45
57
|
} : undefined;
|
|
46
58
|
};
|
|
47
|
-
const extractState = (response, actionOptions, id) => {
|
|
59
|
+
const extractState = (response, actionOptions, id, appearance, origin, fireEvent, resolve) => {
|
|
48
60
|
if (!response || !response.data) {
|
|
49
61
|
return;
|
|
50
62
|
}
|
|
@@ -55,7 +67,7 @@ const extractState = (response, actionOptions, id) => {
|
|
|
55
67
|
if (!canShowAction(CardAction.ChangeStatusAction, actionOptions)) {
|
|
56
68
|
return lozenge;
|
|
57
69
|
}
|
|
58
|
-
const action = extractAction(response, id);
|
|
70
|
+
const action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve);
|
|
59
71
|
return {
|
|
60
72
|
...lozenge,
|
|
61
73
|
action
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractAri, extractDateCreated, extractDateUpdated, extractLink, extractPersonCreatedBy, extractPersonOwnedBy, extractTitle } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { extractSummary } from '../common/primitives';
|
|
3
|
-
import extractActions from './actions';
|
|
4
|
-
import { extractViewAction } from './actions/extract-view-action';
|
|
4
|
+
import extractActions, { extractFlexibleCardActions } from './actions';
|
|
5
5
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
6
6
|
import extractPreview from './extract-preview';
|
|
7
7
|
import extractPriority from './extract-priority';
|
|
@@ -11,8 +11,12 @@ import extractProviderIcon from './icon/extract-provider-icon';
|
|
|
11
11
|
import { extractLatestCommit } from './latest-commit';
|
|
12
12
|
import { extractAssignedTo, extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractDueOn, extractLocation, extractModifiedBy, extractOwnedBy, extractPersonAssignedToAsArray, extractProgrammingLanguage, extractReactCount, extractReadTime, extractSentOn, extractSourceBranch, extractStoryPoints, extractSubscriberCount, extractSubTasksProgress, extractTargetBranch, extractViewCount, extractVoteCount } from './utils';
|
|
13
13
|
const extractFlexibleUiContext = ({
|
|
14
|
+
appearance,
|
|
15
|
+
fireEvent,
|
|
14
16
|
id,
|
|
17
|
+
origin,
|
|
15
18
|
renderers,
|
|
19
|
+
resolve,
|
|
16
20
|
actionOptions,
|
|
17
21
|
response,
|
|
18
22
|
aiSummaryConfig,
|
|
@@ -24,8 +28,16 @@ const extractFlexibleUiContext = ({
|
|
|
24
28
|
const data = response.data;
|
|
25
29
|
const url = extractLink(data);
|
|
26
30
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
actions: fg('platform-smart-card-migrate-embed-modal-analytics') ? extractFlexibleCardActions({
|
|
32
|
+
actionOptions,
|
|
33
|
+
aiSummaryConfig,
|
|
34
|
+
appearance,
|
|
35
|
+
fireEvent,
|
|
36
|
+
id,
|
|
37
|
+
origin,
|
|
38
|
+
response,
|
|
39
|
+
url: props.url // Use the original URL in edge cases, such as short links for AI summary and copy link actions.
|
|
40
|
+
}) : extractActions(response, props.url, actionOptions, id, aiSummaryConfig),
|
|
29
41
|
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
30
42
|
attachmentCount: extractAttachmentCount(data),
|
|
31
43
|
authorGroup: extractPersonCreatedBy(data),
|
|
@@ -41,7 +53,6 @@ const extractFlexibleUiContext = ({
|
|
|
41
53
|
assignedTo: extractAssignedTo(data),
|
|
42
54
|
createdOn: extractDateCreated(data),
|
|
43
55
|
dueOn: extractDueOn(data),
|
|
44
|
-
viewAction: extractViewAction(data, actionOptions),
|
|
45
56
|
latestCommit: extractLatestCommit(data),
|
|
46
57
|
linkIcon: extractLinkIcon(response, renderers),
|
|
47
58
|
location: extractLocation(data),
|
|
@@ -56,7 +67,7 @@ const extractFlexibleUiContext = ({
|
|
|
56
67
|
snippet: extractSummary(data) || undefined,
|
|
57
68
|
// Explicitly set here to remove an empty string
|
|
58
69
|
sourceBranch: extractSourceBranch(data),
|
|
59
|
-
state: extractState(response, actionOptions, id),
|
|
70
|
+
state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve),
|
|
60
71
|
subscriberCount: extractSubscriberCount(data),
|
|
61
72
|
subTasksProgress: extractSubTasksProgress(data),
|
|
62
73
|
storyPoints: extractStoryPoints(data),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
3
5
|
import * as measure from '../../../utils/performance';
|
|
4
6
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from '../../analytics';
|
|
5
7
|
const ACTION_EXPERIENCE_NAME = 'smart-link-action-invocation';
|
|
@@ -8,51 +10,97 @@ const ACTION_EXPERIENCE_NAME = 'smart-link-action-invocation';
|
|
|
8
10
|
* Invoke client action such as preview, download and open link
|
|
9
11
|
*/
|
|
10
12
|
const useInvokeClientAction = ({
|
|
11
|
-
analytics
|
|
12
|
-
|
|
13
|
-
actionType,
|
|
14
|
-
actionFn,
|
|
15
|
-
extensionKey,
|
|
16
|
-
display
|
|
13
|
+
analytics,
|
|
14
|
+
fireEvent: fireEventProp
|
|
17
15
|
}) => {
|
|
18
|
-
const
|
|
16
|
+
const {
|
|
17
|
+
fireEvent: defaultFireEvent
|
|
18
|
+
} = useAnalyticsEvents();
|
|
19
|
+
const fireEvent = fireEventProp !== null && fireEventProp !== void 0 ? fireEventProp : defaultFireEvent;
|
|
20
|
+
return useCallback(async ({
|
|
21
|
+
actionSubjectId,
|
|
22
|
+
actionType,
|
|
23
|
+
actionFn,
|
|
24
|
+
definitionId = null,
|
|
25
|
+
extensionKey,
|
|
26
|
+
display,
|
|
27
|
+
id,
|
|
28
|
+
resourceType = null
|
|
29
|
+
}) => {
|
|
30
|
+
const experienceId = uuid();
|
|
19
31
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
// Begin performance instrumentation.
|
|
33
|
+
const markName = `${experienceId}-${actionType}`;
|
|
34
|
+
measure.mark(markName, 'pending');
|
|
35
|
+
try {
|
|
36
|
+
// Begin UFO experience
|
|
37
|
+
startUfoExperience(ACTION_EXPERIENCE_NAME, experienceId, {
|
|
38
|
+
actionType,
|
|
39
|
+
display,
|
|
40
|
+
extensionKey,
|
|
41
|
+
invokeType: 'client'
|
|
42
|
+
});
|
|
31
43
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
// Begin analytics instrumentation.
|
|
45
|
+
if (actionSubjectId && fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
46
|
+
fireEvent(`ui.button.clicked.${actionSubjectId}`, {
|
|
47
|
+
actionType: actionType !== null && actionType !== void 0 ? actionType : null,
|
|
48
|
+
definitionId,
|
|
49
|
+
display: display !== null && display !== void 0 ? display : null,
|
|
50
|
+
id: id !== null && id !== void 0 ? id : experienceId,
|
|
51
|
+
resourceType
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.ui.actionClickedEvent({
|
|
55
|
+
actionType,
|
|
56
|
+
display
|
|
57
|
+
});
|
|
58
|
+
}
|
|
37
59
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
60
|
+
// Invoke action
|
|
61
|
+
const result = await actionFn();
|
|
62
|
+
measure.mark(markName, 'resolved');
|
|
63
|
+
succeedUfoExperience(ACTION_EXPERIENCE_NAME, experienceId);
|
|
64
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
65
|
+
var _measure$getMeasure$d, _measure$getMeasure;
|
|
66
|
+
fireEvent('operational.smartLinkAction.resolved', {
|
|
67
|
+
actionType: actionType !== null && actionType !== void 0 ? actionType : null,
|
|
68
|
+
definitionId,
|
|
69
|
+
display: display !== null && display !== void 0 ? display : null,
|
|
70
|
+
duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(markName, 'resolved')) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null,
|
|
71
|
+
id: id !== null && id !== void 0 ? id : experienceId,
|
|
72
|
+
resourceType
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.operational.invokeSucceededEvent({
|
|
76
|
+
actionType,
|
|
77
|
+
display
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
} catch (err) {
|
|
82
|
+
measure.mark(markName, 'errored');
|
|
83
|
+
failUfoExperience(ACTION_EXPERIENCE_NAME, experienceId);
|
|
84
|
+
const reason = typeof err === 'string' ? err : err === null || err === void 0 ? void 0 : err.message;
|
|
85
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
86
|
+
var _measure$getMeasure$d2, _measure$getMeasure2;
|
|
87
|
+
fireEvent('operational.smartLinkAction.unresolved', {
|
|
88
|
+
actionType: actionType !== null && actionType !== void 0 ? actionType : null,
|
|
89
|
+
definitionId,
|
|
90
|
+
display: display !== null && display !== void 0 ? display : null,
|
|
91
|
+
duration: (_measure$getMeasure$d2 = (_measure$getMeasure2 = measure.getMeasure(markName, 'errored')) === null || _measure$getMeasure2 === void 0 ? void 0 : _measure$getMeasure2.duration) !== null && _measure$getMeasure$d2 !== void 0 ? _measure$getMeasure$d2 : null,
|
|
92
|
+
id: id !== null && id !== void 0 ? id : experienceId,
|
|
93
|
+
reason,
|
|
94
|
+
resourceType
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.operational.invokeFailedEvent({
|
|
98
|
+
actionType,
|
|
99
|
+
display,
|
|
100
|
+
reason
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.operational, analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent]);
|
|
105
|
+
};
|
|
58
106
|
export default useInvokeClientAction;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
5
|
+
import { extractInvokeDownloadAction } from '../../extractors/action/extract-invoke-download-action';
|
|
6
|
+
import { extractInvokePreviewAction } from '../../extractors/action/extract-invoke-preview-action';
|
|
7
|
+
import { extractInvokeViewAction } from '../../extractors/action/extract-invoke-view-action';
|
|
3
8
|
import { extractDownloadActionProps } from '../../extractors/action/extractDownloadActionProps';
|
|
4
9
|
import { extractPreviewActionProps } from '../../extractors/action/extractPreviewActionProps';
|
|
5
10
|
import { extractViewActionProps } from '../../extractors/action/extractViewActionProps';
|
|
@@ -18,6 +23,9 @@ export function useSmartLinkActions({
|
|
|
18
23
|
const id = useMemo(() => uuid(), []);
|
|
19
24
|
const linkState = useLinkState(url);
|
|
20
25
|
const linkAnalytics = useLinkAnalytics(url, id);
|
|
26
|
+
const {
|
|
27
|
+
fireEvent
|
|
28
|
+
} = useAnalyticsEvents();
|
|
21
29
|
const invokeClientAction = useInvokeClientAction({
|
|
22
30
|
analytics: linkAnalytics
|
|
23
31
|
});
|
|
@@ -32,15 +40,25 @@ export function useSmartLinkActions({
|
|
|
32
40
|
actionOptions
|
|
33
41
|
};
|
|
34
42
|
const actions = [];
|
|
35
|
-
const
|
|
43
|
+
const invokeParam = {
|
|
44
|
+
actionOptions,
|
|
45
|
+
appearance,
|
|
46
|
+
id,
|
|
47
|
+
response: linkState.details
|
|
48
|
+
};
|
|
49
|
+
const downloadActionProps = fg('platform-smart-card-migrate-embed-modal-analytics') ? extractInvokeDownloadAction(invokeParam) : extractDownloadActionProps(opts);
|
|
36
50
|
if (downloadActionProps) {
|
|
37
51
|
actions.push(toAction(downloadActionProps, invokeClientAction, messages.download, 'download-content'));
|
|
38
52
|
}
|
|
39
|
-
const viewActionProps = extractViewActionProps(opts);
|
|
53
|
+
const viewActionProps = fg('platform-smart-card-migrate-embed-modal-analytics') ? extractInvokeViewAction(invokeParam) : extractViewActionProps(opts);
|
|
40
54
|
if (viewActionProps) {
|
|
41
55
|
actions.push(toAction(viewActionProps, invokeClientAction, messages.view, 'view-content'));
|
|
42
56
|
}
|
|
43
|
-
const previewActionProps =
|
|
57
|
+
const previewActionProps = fg('platform-smart-card-migrate-embed-modal-analytics') ? extractInvokePreviewAction({
|
|
58
|
+
...invokeParam,
|
|
59
|
+
fireEvent,
|
|
60
|
+
origin
|
|
61
|
+
}) : extractPreviewActionProps(opts);
|
|
44
62
|
if (previewActionProps) {
|
|
45
63
|
actions.push(toAction(previewActionProps, invokeClientAction, messages.preview_improved, 'preview-content'));
|
|
46
64
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { context } from './analytics';
|
|
3
5
|
/**
|
|
4
6
|
* Provides an analytics context to supply attributes to events based on a URL
|
|
5
7
|
*/
|
|
@@ -14,6 +16,7 @@ export const LinkAnalyticsContext = ({
|
|
|
14
16
|
data: {
|
|
15
17
|
source,
|
|
16
18
|
attributes: {
|
|
19
|
+
...(fg('platform-smart-card-migrate-embed-modal-analytics') ? context : {}),
|
|
17
20
|
displayCategory,
|
|
18
21
|
display,
|
|
19
22
|
id
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "32.7.
|
|
7
|
+
packageVersion: "32.7.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -16,7 +16,10 @@ export const mockByUrl = url => {
|
|
|
16
16
|
access: 'granted',
|
|
17
17
|
auth: [],
|
|
18
18
|
definitionId: 'd1',
|
|
19
|
-
key: 'object-provider'
|
|
19
|
+
key: 'object-provider',
|
|
20
|
+
resourceType: 'object-resource',
|
|
21
|
+
subproduct: 'object-subproduct',
|
|
22
|
+
product: 'object-product'
|
|
20
23
|
},
|
|
21
24
|
data: {
|
|
22
25
|
'@context': {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React, { useCallback, useRef, useState } from 'react';
|
|
2
3
|
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
5
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
4
|
-
import { ActionName, CardDisplay } from '../../constants';
|
|
6
|
+
import { ActionName, CardDisplay, SmartLinkSize } from '../../constants';
|
|
5
7
|
import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
|
|
6
8
|
import { downloadUrl, getPreviewUrlWithTheme, openUrl } from '../../utils';
|
|
9
|
+
import Icon from '../FlexibleCard/components/elements/icon';
|
|
7
10
|
import withAnalytics from './components/analytics';
|
|
8
11
|
import EmbedContent from './components/embed-content';
|
|
9
12
|
import withErrorBoundary from './components/error-boundary';
|
|
@@ -15,11 +18,14 @@ const toWidth = size => size === EmbedModalSize.Large ? MAX_MODAL_SIZE : MIN_MOD
|
|
|
15
18
|
const EmbedModal = ({
|
|
16
19
|
analytics,
|
|
17
20
|
download,
|
|
21
|
+
invokeDownloadAction,
|
|
18
22
|
extensionKey,
|
|
23
|
+
fireEvent,
|
|
19
24
|
icon,
|
|
20
25
|
iframeName,
|
|
21
26
|
isSupportTheming,
|
|
22
27
|
isTrusted = false,
|
|
28
|
+
linkIcon,
|
|
23
29
|
onClose,
|
|
24
30
|
onOpen,
|
|
25
31
|
onResize,
|
|
@@ -29,14 +35,16 @@ const EmbedModal = ({
|
|
|
29
35
|
src,
|
|
30
36
|
testId = 'smart-embed-preview-modal',
|
|
31
37
|
title,
|
|
32
|
-
url
|
|
38
|
+
url,
|
|
39
|
+
invokeViewAction
|
|
33
40
|
}) => {
|
|
34
41
|
const defaultWidth = toWidth(size);
|
|
35
42
|
const [isOpen, setIsOpen] = useState(showModal);
|
|
36
43
|
const [width, setWidth] = useState(defaultWidth);
|
|
37
44
|
const openAt = useRef();
|
|
38
45
|
const invoke = useInvokeClientAction({
|
|
39
|
-
analytics
|
|
46
|
+
analytics,
|
|
47
|
+
fireEvent
|
|
40
48
|
});
|
|
41
49
|
const handleOnOpenComplete = useCallback(() => {
|
|
42
50
|
openAt.current = Date.now();
|
|
@@ -68,21 +76,29 @@ const EmbedModal = ({
|
|
|
68
76
|
const themeState = useThemeObserver();
|
|
69
77
|
let previewUrl = src;
|
|
70
78
|
const handleOnViewActionClick = useCallback(() => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
80
|
+
invokeViewAction && invoke(invokeViewAction);
|
|
81
|
+
} else {
|
|
82
|
+
invoke({
|
|
83
|
+
actionType: 'ViewAction',
|
|
84
|
+
actionFn: async () => openUrl(url),
|
|
85
|
+
display: CardDisplay.EmbedPreview,
|
|
86
|
+
extensionKey
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}, [extensionKey, invoke, url, invokeViewAction]);
|
|
78
90
|
const handleOnDownloadActionClick = useCallback(() => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
92
|
+
invokeDownloadAction && invoke(invokeDownloadAction);
|
|
93
|
+
} else {
|
|
94
|
+
invoke({
|
|
95
|
+
actionType: ActionName.DownloadAction,
|
|
96
|
+
actionFn: async () => downloadUrl(download),
|
|
97
|
+
display: CardDisplay.EmbedPreview,
|
|
98
|
+
extensionKey
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, [download, invokeDownloadAction, extensionKey, invoke]);
|
|
86
102
|
if (previewUrl && isSupportTheming) {
|
|
87
103
|
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
88
104
|
}
|
|
@@ -94,10 +110,15 @@ const EmbedModal = ({
|
|
|
94
110
|
testId: testId,
|
|
95
111
|
width: width
|
|
96
112
|
}, /*#__PURE__*/React.createElement(LinkInfo, {
|
|
97
|
-
icon:
|
|
113
|
+
icon: fg('platform-smart-card-migrate-embed-modal-analytics') ? linkIcon ? {
|
|
114
|
+
icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
|
|
115
|
+
size: SmartLinkSize.Large
|
|
116
|
+
})),
|
|
117
|
+
isFlexibleUi: true
|
|
118
|
+
} : undefined : icon,
|
|
98
119
|
providerName: providerName,
|
|
99
|
-
onViewButtonClick: url ? handleOnViewActionClick : undefined,
|
|
100
|
-
onDownloadButtonClick: download ? handleOnDownloadActionClick : undefined,
|
|
120
|
+
onViewButtonClick: fg('platform-smart-card-migrate-embed-modal-analytics') ? invokeViewAction ? handleOnViewActionClick : undefined : url ? handleOnViewActionClick : undefined,
|
|
121
|
+
onDownloadButtonClick: fg('platform-smart-card-migrate-embed-modal-analytics') ? invokeDownloadAction ? handleOnDownloadActionClick : undefined : download ? handleOnDownloadActionClick : undefined,
|
|
101
122
|
onResizeButtonClick: handleOnResizeClick,
|
|
102
123
|
size: width,
|
|
103
124
|
title: title,
|