@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,4 +1,7 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type ViewActionData } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
/**
|
|
5
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
6
|
+
*/
|
|
4
7
|
export declare const extractViewAction: (data: JsonLd.Data.BaseData, actionOptions?: CardActionOptions) => ViewActionData | undefined;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
1
|
+
import { type JsonLd } from 'json-ld-types';
|
|
2
|
+
import { type FireEventFunction } from '../../../common/analytics/types';
|
|
3
|
+
import { type FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
4
|
+
import { type AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
5
|
+
import { type AnalyticsOrigin } from '../../../utils/types';
|
|
6
|
+
import { type CardActionOptions, type CardInnerAppearance } from '../../../view/Card/types';
|
|
7
|
+
export type ExtractActionsParam = {
|
|
8
|
+
response: JsonLd.Response;
|
|
9
|
+
url?: string;
|
|
10
|
+
actionOptions?: CardActionOptions;
|
|
11
|
+
id?: string;
|
|
12
|
+
aiSummaryConfig?: AISummaryConfig;
|
|
13
|
+
appearance?: CardInnerAppearance;
|
|
14
|
+
origin?: AnalyticsOrigin;
|
|
15
|
+
fireEvent?: FireEventFunction;
|
|
16
|
+
};
|
|
17
|
+
export declare const extractFlexibleCardActions: ({ actionOptions, aiSummaryConfig, appearance, fireEvent, id, origin, response, url, }: ExtractActionsParam) => FlexibleUiActions | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
20
|
+
* Replaced with extractFlexibleCardActions()
|
|
21
|
+
*/
|
|
5
22
|
declare const extractActions: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, id?: string, aiSummaryConfig?: AISummaryConfig) => FlexibleUiActions | undefined;
|
|
6
23
|
export default extractActions;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
|
-
import { type
|
|
2
|
+
import { type FireEventFunction } from '../../common/analytics/types';
|
|
3
|
+
import { type ResolveFunction } from '../../state/hooks/use-resolve';
|
|
4
|
+
import { type AnalyticsOrigin } from '../../utils/types';
|
|
5
|
+
import { type CardActionOptions, type CardInnerAppearance } from '../../view/Card/types';
|
|
3
6
|
import { type LinkLozenge } from '../common/lozenge/types';
|
|
4
|
-
declare const extractState: (response?: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => LinkLozenge | undefined;
|
|
7
|
+
declare const extractState: (response?: JsonLd.Response, actionOptions?: CardActionOptions, id?: string, appearance?: CardInnerAppearance, origin?: AnalyticsOrigin, fireEvent?: FireEventFunction, resolve?: ResolveFunction) => LinkLozenge | undefined;
|
|
5
8
|
export default extractState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
2
2
|
import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
|
|
3
|
-
declare const extractFlexibleUiContext: ({ id, renderers, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
3
|
+
declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, origin, renderers, resolve, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
4
4
|
export default extractFlexibleUiContext;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type LinkPerson } from '@atlaskit/link-extractors';
|
|
2
2
|
import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
|
|
3
3
|
import { type LinkLozenge } from '../../extractors/common/lozenge/types';
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
4
|
+
import { type AnalyticsOrigin } from '../../utils/types';
|
|
5
|
+
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
6
|
+
import { type AnalyticsFacade } from '../analytics';
|
|
7
|
+
import { type InvokeClientActionProps } from '../hooks/use-invoke-client-action/types';
|
|
6
8
|
import { type InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
7
9
|
/**
|
|
8
10
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
@@ -250,9 +252,11 @@ export type FlexibleUiActions = {
|
|
|
250
252
|
[InternalActionName.ViewRelatedLinksAction]?: ViewRelatedLinksActionData;
|
|
251
253
|
};
|
|
252
254
|
export type PreviewActionData = {
|
|
255
|
+
invokeAction?: InvokeClientActionProps;
|
|
253
256
|
downloadUrl?: string;
|
|
254
257
|
linkIcon?: Icon;
|
|
255
258
|
providerName?: string;
|
|
259
|
+
origin?: AnalyticsOrigin;
|
|
256
260
|
src?: string;
|
|
257
261
|
title?: string;
|
|
258
262
|
url?: string;
|
|
@@ -263,10 +267,12 @@ export type ViewActionData = {
|
|
|
263
267
|
viewUrl?: string;
|
|
264
268
|
};
|
|
265
269
|
export type DownloadActionData = {
|
|
270
|
+
invokeAction?: InvokeClientActionProps;
|
|
266
271
|
downloadUrl?: string;
|
|
267
272
|
};
|
|
268
273
|
export type CopyLinkActionData = {
|
|
269
|
-
|
|
274
|
+
invokeAction?: InvokeClientActionProps;
|
|
275
|
+
url?: string;
|
|
270
276
|
};
|
|
271
277
|
export type AISummaryActionData = {
|
|
272
278
|
url: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InvokeRequest } from '@atlaskit/linking-types/smart-link-actions';
|
|
2
2
|
import { type PreviewActionData } from '../../flexible-ui-context/types';
|
|
3
|
+
import type { InvokeClientActionProps } from '../use-invoke-client-action/types';
|
|
3
4
|
/**
|
|
4
5
|
* Additional details for invoke function that may be required for component
|
|
5
6
|
*/
|
|
@@ -8,12 +9,17 @@ export type CardDetails = {
|
|
|
8
9
|
* An identifier for Smart Link analytics
|
|
9
10
|
*/
|
|
10
11
|
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* A open embed modal action to invoke with useInvokeClientAction
|
|
14
|
+
*/
|
|
15
|
+
invokePreviewAction?: InvokeClientActionProps;
|
|
11
16
|
/**
|
|
12
17
|
* The URL of the Smart Link
|
|
13
18
|
*/
|
|
14
19
|
url?: string;
|
|
15
20
|
/**
|
|
16
21
|
* Preview Modal information. If present, will be used to render an embed modal on an error link click
|
|
22
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
17
23
|
*/
|
|
18
24
|
previewData?: PreviewActionData | null;
|
|
19
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InvokeClientActionHandler, type UseInvokeClientActionProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Invoke client action such as preview, download and open link
|
|
4
4
|
*/
|
|
5
|
-
declare const useInvokeClientAction: ({ analytics, }: UseInvokeClientActionProps) => InvokeClientActionHandler;
|
|
5
|
+
declare const useInvokeClientAction: ({ analytics, fireEvent: fireEventProp, }: UseInvokeClientActionProps) => InvokeClientActionHandler;
|
|
6
6
|
export default useInvokeClientAction;
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type FireEventFunction } from '../../../common/analytics/types';
|
|
2
|
+
import { type CardInnerAppearance } from '../../../view/Card/types';
|
|
3
|
+
import { type AnalyticsFacade } from '../../analytics';
|
|
3
4
|
export type UseInvokeClientActionProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Analytics object
|
|
6
7
|
*/
|
|
7
8
|
analytics?: AnalyticsFacade;
|
|
9
|
+
/**
|
|
10
|
+
* A function to dispatch analytics events.
|
|
11
|
+
*/
|
|
12
|
+
fireEvent?: FireEventFunction;
|
|
8
13
|
};
|
|
14
|
+
export type InvokeClientActionSubjectId = 'copyLink' | 'downloadDocument' | 'invokePreviewScreen' | 'shortcutGoToLink';
|
|
9
15
|
export type InvokeClientActionProps = {
|
|
10
16
|
/**
|
|
11
17
|
* Invoke action to execute.
|
|
12
18
|
*/
|
|
13
19
|
actionFn: () => Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Invoke action subject id for analytics purposes.
|
|
22
|
+
*/
|
|
23
|
+
actionSubjectId?: InvokeClientActionSubjectId;
|
|
14
24
|
/**
|
|
15
25
|
* Invoke action type for analytics purposes.
|
|
16
26
|
*/
|
|
17
27
|
actionType: string;
|
|
28
|
+
/**
|
|
29
|
+
* Definition id for analytics purposes.
|
|
30
|
+
*/
|
|
31
|
+
definitionId?: string;
|
|
18
32
|
/**
|
|
19
33
|
* Smart card display type
|
|
20
34
|
* This value should already be set in analytics context.
|
|
@@ -27,5 +41,13 @@ export type InvokeClientActionProps = {
|
|
|
27
41
|
* useSmartLinkAnalytics() and/or into the analytic context.
|
|
28
42
|
*/
|
|
29
43
|
extensionKey?: string;
|
|
44
|
+
/**
|
|
45
|
+
* ID for analytics purposes.
|
|
46
|
+
*/
|
|
47
|
+
id?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Resource type for analytics purposes.
|
|
50
|
+
*/
|
|
51
|
+
resourceType?: string;
|
|
30
52
|
};
|
|
31
53
|
export type InvokeClientActionHandler = (opts: InvokeClientActionProps) => Promise<void>;
|
|
@@ -2,10 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { EmbedModalSize } from './types';
|
|
3
3
|
declare const _default: (props: {
|
|
4
4
|
download?: string | undefined;
|
|
5
|
+
fireEvent?: (<K extends keyof import("../../common/analytics/generated/analytics.types").AnalyticsEventAttributes>(eventKey: K, ...params_1: undefined extends import("../../common/analytics/generated/analytics.types").AnalyticsEventAttributes[K] ? [param?: import("../../common/analytics/generated/analytics.types").AnalyticsEventAttributes[K] | undefined] : [param: import("../../common/analytics/generated/analytics.types").AnalyticsEventAttributes[K]]) => void) | undefined;
|
|
5
6
|
icon?: import("../common/Icon").IconProps | undefined;
|
|
7
|
+
invokeDownloadAction?: import("../../state/hooks/use-invoke-client-action/types").InvokeClientActionProps | undefined;
|
|
8
|
+
invokeViewAction?: import("../../state/hooks/use-invoke-client-action/types").InvokeClientActionProps | undefined;
|
|
6
9
|
iframeName: string;
|
|
7
10
|
isTrusted?: boolean | undefined;
|
|
8
11
|
isSupportTheming?: boolean | undefined;
|
|
12
|
+
linkIcon?: import("../../state/flexible-ui-context/types").Icon | undefined;
|
|
9
13
|
onClose: (context: import("./types").EmbedModalContext) => void;
|
|
10
14
|
onOpen?: ((context: import("./types").EmbedModalContext) => void) | undefined;
|
|
11
15
|
onOpenFailed?: ((error: Error, errorInfo: React.ErrorInfo) => void) | undefined;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type ErrorInfo } from 'react';
|
|
2
|
+
import { type FireEventFunction } from '../../common/analytics/types';
|
|
3
|
+
import { type Icon } from '../../state/flexible-ui-context/types';
|
|
4
|
+
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
5
|
import { type IconProps } from '../common/Icon';
|
|
3
6
|
import { type WithAnalytics } from './components/analytics/types';
|
|
4
7
|
export declare enum EmbedModalSize {
|
|
@@ -11,10 +14,14 @@ export type EmbedModalContext = {
|
|
|
11
14
|
};
|
|
12
15
|
export type EmbedModalProps = {
|
|
13
16
|
download?: string;
|
|
17
|
+
fireEvent?: FireEventFunction;
|
|
14
18
|
icon?: IconProps;
|
|
19
|
+
invokeDownloadAction?: InvokeClientActionProps;
|
|
20
|
+
invokeViewAction?: InvokeClientActionProps;
|
|
15
21
|
iframeName: string;
|
|
16
22
|
isTrusted?: boolean;
|
|
17
23
|
isSupportTheming?: boolean;
|
|
24
|
+
linkIcon?: Icon;
|
|
18
25
|
onClose: (context: EmbedModalContext) => void;
|
|
19
26
|
onOpen?: (context: EmbedModalContext) => void;
|
|
20
27
|
onOpenFailed?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { LozengeActionErrorProps } from './types';
|
|
3
|
-
declare const LozengeActionError: ({ errorMessage, testId, maxLineNumber, url, previewData, }: LozengeActionErrorProps) => jsx.JSX.Element;
|
|
3
|
+
declare const LozengeActionError: ({ errorMessage, testId, maxLineNumber, invokePreviewAction, url, previewData, }: LozengeActionErrorProps) => jsx.JSX.Element;
|
|
4
4
|
export default LozengeActionError;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { type PreviewActionData } from '../../../../../../../state/flexible-ui-context/types';
|
|
2
|
+
import { type InvokeClientActionProps } from '../../../../../../../state/hooks/use-invoke-client-action/types';
|
|
2
3
|
import { type MessageProps } from '../../../../types';
|
|
3
4
|
export type LozengeActionErrorProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Error message to be displayed inside the dropdown
|
|
6
7
|
*/
|
|
7
8
|
errorMessage: string | MessageProps;
|
|
9
|
+
/**
|
|
10
|
+
* A preview link action to invoke with useInvokeClientAction
|
|
11
|
+
*/
|
|
12
|
+
invokePreviewAction?: InvokeClientActionProps;
|
|
8
13
|
/**
|
|
9
14
|
* Data test id used for testing purposes
|
|
10
15
|
*/
|
|
@@ -19,6 +24,7 @@ export type LozengeActionErrorProps = {
|
|
|
19
24
|
url?: string;
|
|
20
25
|
/**
|
|
21
26
|
* Preview Modal information. If present, will be used to render an embed modal on an error link click
|
|
27
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
22
28
|
*/
|
|
23
29
|
previewData?: PreviewActionData | null;
|
|
24
30
|
};
|
|
@@ -29,4 +29,7 @@ export declare const getPrimitivesInlineSpaceBySize: (size: SmartLinkSize) => Sp
|
|
|
29
29
|
export declare const getPrimitivesPaddingSpaceBySize: (size: SmartLinkSize) => Space;
|
|
30
30
|
export declare const getTruncateStyles: (maxLines: number, lineHeight?: string, wordBreak?: 'break-word' | 'break-all') => SerializedStyles;
|
|
31
31
|
export declare const hasWhiteSpace: (str: string) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
34
|
+
*/
|
|
32
35
|
export declare const openEmbedModalWithFlexibleUiIcon: ({ linkIcon, ...props }: Partial<EmbedModalProps> & Pick<PreviewActionData, 'linkIcon'>) => Promise<void>;
|
|
@@ -6,5 +6,5 @@ import { type FlexibleCardProps } from './types';
|
|
|
6
6
|
* Note: TitleBlock is mandatory for a Flexible Card to render.
|
|
7
7
|
* @see Container
|
|
8
8
|
*/
|
|
9
|
-
declare const FlexibleCard: ({ analytics, appearance, cardState, children, id, onAuthorize, onClick, onError, onResolve, renderers, showAuthTooltip, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps) => JSX.Element;
|
|
9
|
+
declare const FlexibleCard: ({ analytics, appearance, cardState, children, id, onAuthorize, onClick, onError, onResolve, origin, renderers, showAuthTooltip, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps) => JSX.Element;
|
|
10
10
|
export default FlexibleCard;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type JsonLd } from 'json-ld-types';
|
|
3
3
|
import { type MessageDescriptor } from 'react-intl-next';
|
|
4
4
|
import { type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
5
5
|
import { type CardState, type LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
|
|
6
|
+
import { type FireEventFunction } from '../../common/analytics/types';
|
|
6
7
|
import { type SmartLinkSize, type SmartLinkStatus, type SmartLinkTheme } from '../../constants';
|
|
7
8
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
8
9
|
import { type AISummaryConfig } from '../../state/hooks/use-ai-summary-config/types';
|
|
9
|
-
import
|
|
10
|
+
import { type ResolveFunction } from '../../state/hooks/use-resolve';
|
|
11
|
+
import { type AnalyticsOrigin } from '../../utils/types';
|
|
12
|
+
import { type CardActionOptions, type CardInnerAppearance, type OnResolveCallback } from '../Card/types';
|
|
10
13
|
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
11
14
|
import { type OnErrorCallback } from '../types';
|
|
12
15
|
export type FlexibleCardProps = {
|
|
@@ -53,6 +56,10 @@ export type FlexibleCardProps = {
|
|
|
53
56
|
* function to be called after a flexible card has rendered its resolved state
|
|
54
57
|
*/
|
|
55
58
|
onResolve?: OnResolveCallback;
|
|
59
|
+
/**
|
|
60
|
+
* Smart links origin for analytics purposes
|
|
61
|
+
*/
|
|
62
|
+
origin?: AnalyticsOrigin;
|
|
56
63
|
/**
|
|
57
64
|
* Any additional renderers required by Flexible UI. Currently used by icon
|
|
58
65
|
* to render Emoji.
|
|
@@ -142,9 +149,11 @@ export type RetryOptions = {
|
|
|
142
149
|
*/
|
|
143
150
|
values?: Record<string, string>;
|
|
144
151
|
};
|
|
145
|
-
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'id' | 'actionOptions' | 'renderers' | 'url'> & {
|
|
152
|
+
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'renderers' | 'url'> & {
|
|
153
|
+
fireEvent?: FireEventFunction;
|
|
146
154
|
status?: SmartLinkStatus;
|
|
147
155
|
response?: JsonLd.Response;
|
|
156
|
+
resolve?: ResolveFunction;
|
|
148
157
|
featureFlags?: Partial<LinkingPlatformFeatureFlags>;
|
|
149
158
|
aiSummaryConfig?: AISummaryConfig;
|
|
150
159
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::f06f113d9e5f9e84ba897b1fbfca3db4>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
@@ -12,7 +12,6 @@ export type PackageMetaDataContextType = {
|
|
|
12
12
|
};
|
|
13
13
|
export type CommonContextType = {
|
|
14
14
|
extensionKey: string | null;
|
|
15
|
-
resourceType: string | null;
|
|
16
15
|
destinationObjectType: string | null;
|
|
17
16
|
destinationSubproduct: string | null;
|
|
18
17
|
destinationProduct: string | null;
|
|
@@ -33,6 +32,33 @@ export type ResolvedContextType = {
|
|
|
33
32
|
destinationTenantId: string | null;
|
|
34
33
|
canBeDatasource: boolean | null;
|
|
35
34
|
location: string | null;
|
|
35
|
+
};
|
|
36
|
+
export type ButtonClickedCopyLinkAttributesType = {
|
|
37
|
+
actionType: string | null;
|
|
38
|
+
id: string | null;
|
|
39
|
+
definitionId: string | null;
|
|
40
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
41
|
+
resourceType: string | null;
|
|
42
|
+
};
|
|
43
|
+
export type ButtonClickedDownloadDocumentAttributesType = {
|
|
44
|
+
actionType: string | null;
|
|
45
|
+
id: string | null;
|
|
46
|
+
definitionId: string | null;
|
|
47
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
48
|
+
resourceType: string | null;
|
|
49
|
+
};
|
|
50
|
+
export type ButtonClickedInvokePreviewScreenAttributesType = {
|
|
51
|
+
actionType: string | null;
|
|
52
|
+
id: string | null;
|
|
53
|
+
definitionId: string | null;
|
|
54
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
55
|
+
resourceType: string | null;
|
|
56
|
+
};
|
|
57
|
+
export type ButtonClickedShortcutGoToLinkAttributesType = {
|
|
58
|
+
actionType: string | null;
|
|
59
|
+
id: string | null;
|
|
60
|
+
definitionId: string | null;
|
|
61
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
36
62
|
resourceType: string | null;
|
|
37
63
|
};
|
|
38
64
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
@@ -115,6 +141,23 @@ export type SmartLinkChunkLoadFailedAttributesType = {
|
|
|
115
141
|
error: Record<string, unknown>;
|
|
116
142
|
errorInfo: Record<string, unknown>;
|
|
117
143
|
};
|
|
144
|
+
export type SmartLinkActionResolvedAttributesType = {
|
|
145
|
+
actionType: string | null;
|
|
146
|
+
id: string | null;
|
|
147
|
+
definitionId: string | null;
|
|
148
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
149
|
+
resourceType: string | null;
|
|
150
|
+
duration: number | null;
|
|
151
|
+
};
|
|
152
|
+
export type SmartLinkActionUnresolvedAttributesType = {
|
|
153
|
+
actionType: string | null;
|
|
154
|
+
id: string | null;
|
|
155
|
+
definitionId: string | null;
|
|
156
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
157
|
+
resourceType: string | null;
|
|
158
|
+
duration: number | null;
|
|
159
|
+
reason: string | null;
|
|
160
|
+
};
|
|
118
161
|
export type SmartLinkClickedAttributesType = {
|
|
119
162
|
id: string;
|
|
120
163
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
@@ -158,6 +201,18 @@ export type ButtonClickedSmartLinkFollowButtonAttributesType = {};
|
|
|
158
201
|
export type ButtonClickedStatusUpdateActionAttributesType = {};
|
|
159
202
|
export type ButtonClickedGetStatusTransitionsActionAttributesType = {};
|
|
160
203
|
export type AnalyticsEventAttributes = {
|
|
204
|
+
/**
|
|
205
|
+
* Fired when an copy link is clicked */
|
|
206
|
+
'ui.button.clicked.copyLink': ButtonClickedCopyLinkAttributesType;
|
|
207
|
+
/**
|
|
208
|
+
* Fired when an download is clicked */
|
|
209
|
+
'ui.button.clicked.downloadDocument': ButtonClickedDownloadDocumentAttributesType;
|
|
210
|
+
/**
|
|
211
|
+
* Fired when an preview is clicked */
|
|
212
|
+
'ui.button.clicked.invokePreviewScreen': ButtonClickedInvokePreviewScreenAttributesType;
|
|
213
|
+
/**
|
|
214
|
+
* Fired when an view link is clicked */
|
|
215
|
+
'ui.button.clicked.shortcutGoToLink': ButtonClickedShortcutGoToLinkAttributesType;
|
|
161
216
|
/**
|
|
162
217
|
* fired when an ai summary is clicked */
|
|
163
218
|
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
@@ -236,6 +291,12 @@ export type AnalyticsEventAttributes = {
|
|
|
236
291
|
/**
|
|
237
292
|
* fires an event that represents when a Smart Link renders unsuccessfully. */
|
|
238
293
|
'operational.smartLink.chunkLoadFailed': SmartLinkChunkLoadFailedAttributesType;
|
|
294
|
+
/**
|
|
295
|
+
* Fires an event when a Smart Link action is successfully resolved. */
|
|
296
|
+
'operational.smartLinkAction.resolved': SmartLinkActionResolvedAttributesType;
|
|
297
|
+
/**
|
|
298
|
+
* Fires an event when a Smart Link action is failed to resolved. */
|
|
299
|
+
'operational.smartLinkAction.unresolved': SmartLinkActionUnresolvedAttributesType;
|
|
239
300
|
/**
|
|
240
301
|
* fires an event that represents when a user clicks on a Smart Link. */
|
|
241
302
|
'ui.smartLink.clicked': SmartLinkClickedAttributesType;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
|
+
import { type ExtractClientActionsParam } from './types';
|
|
3
|
+
export declare const extractInvokeCopyLinkAction: ({ actionOptions, appearance, id, response, }: ExtractClientActionsParam) => InvokeClientActionProps | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
|
+
import { type ExtractClientActionsParam } from './types';
|
|
3
|
+
export declare const extractInvokeDownloadAction: ({ actionOptions, appearance, id, response, }: ExtractClientActionsParam) => InvokeClientActionProps | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FireEventFunction } from '../../common/analytics/types';
|
|
2
|
+
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
3
|
+
import { type AnalyticsOrigin } from '../../utils/types';
|
|
4
|
+
import { type EmbedModalProps } from '../../view/EmbedModal/types';
|
|
5
|
+
import { type ExtractClientActionsParam } from './types';
|
|
6
|
+
export type ExtractInvokePreviewActionParam = ExtractClientActionsParam & {
|
|
7
|
+
fireEvent?: FireEventFunction;
|
|
8
|
+
onClose?: EmbedModalProps['onClose'];
|
|
9
|
+
origin?: AnalyticsOrigin;
|
|
10
|
+
};
|
|
11
|
+
export declare const extractInvokePreviewAction: (param: ExtractInvokePreviewActionParam) => InvokeClientActionProps | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
|
+
import { type ExtractClientActionsParam } from './types';
|
|
3
|
+
export declare const extractInvokeViewAction: ({ actionOptions, appearance, id, response }: ExtractClientActionsParam, force?: boolean) => InvokeClientActionProps | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
2
|
import { type ExtractActionsProps } from '../common/actions/types';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
5
|
+
* Replace with platform/packages/linking-platform/smart-card/src/extractors/action/extract-invoke-download-action.ts
|
|
6
|
+
*/
|
|
3
7
|
export declare const extractDownloadActionProps: ({ response, actionOptions, extensionKey, source, }: ExtractActionsProps) => InvokeClientActionProps | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
|
-
import type
|
|
2
|
+
import { type ExtractActionsProps } from '../common/actions/types';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
5
|
+
* Replaced with platform/packages/linking-platform/smart-card/src/extractors/action/extract-invoke-preview-action.ts
|
|
6
|
+
*/
|
|
3
7
|
export declare const extractPreviewActionProps: ({ response, analytics, extensionKey, source, actionOptions, origin, }: ExtractActionsProps) => InvokeClientActionProps | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { type InvokeClientActionProps } from '../../state/hooks/use-invoke-client-action/types';
|
|
2
2
|
import { type ExtractActionsProps } from '../common/actions/types';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
5
|
+
* Replace with platform/packages/linking-platform/smart-card/src/extractors/action/extract-invoke-view-action.ts
|
|
6
|
+
*/
|
|
3
7
|
export declare const extractViewActionProps: ({ response, actionOptions, extensionKey, source, }: ExtractActionsProps) => InvokeClientActionProps | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JsonLd } from 'json-ld-types';
|
|
2
|
+
import type { CardActionOptions } from '../../view/Card/types';
|
|
3
|
+
import type { FlexibleCardProps } from '../../view/FlexibleCard/types';
|
|
4
|
+
export type ExtractClientActionsParam = {
|
|
5
|
+
actionOptions?: CardActionOptions;
|
|
6
|
+
appearance?: FlexibleCardProps['appearance'];
|
|
7
|
+
id?: string;
|
|
8
|
+
response: JsonLd.Response;
|
|
9
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type CopyLinkActionData } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
import { type ExtractClientActionsParam } from '../../action/types';
|
|
5
|
+
/**
|
|
6
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
7
|
+
* Replaced with extractCopyLinkClientAction()
|
|
8
|
+
*/
|
|
4
9
|
export declare const extractCopyLinkAction: (data: JsonLd.Data.BaseData, actionOptions?: CardActionOptions) => CopyLinkActionData | undefined;
|
|
10
|
+
export declare const extractCopyLinkClientAction: (param: ExtractClientActionsParam) => CopyLinkActionData | undefined;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type DownloadActionData } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
import { type ExtractClientActionsParam } from '../../action/types';
|
|
5
|
+
/**
|
|
6
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
7
|
+
* Replaced with extractDownloadClientAction()
|
|
8
|
+
*/
|
|
4
9
|
export declare const extractDownloadAction: (data: JsonLd.Data.BaseData, actionOptions?: CardActionOptions) => DownloadActionData | undefined;
|
|
10
|
+
export declare const extractDownloadClientAction: (param: ExtractClientActionsParam) => DownloadActionData | undefined;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
import { type ExtractInvokePreviewActionParam } from '../../action/extract-invoke-preview-action';
|
|
5
|
+
/**
|
|
6
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
7
|
+
* Replaced with extractPreviewClientAction()
|
|
8
|
+
*/
|
|
4
9
|
export declare const extractPreviewAction: (response: JsonLd.Response, actionOptions?: CardActionOptions) => PreviewActionData | undefined;
|
|
10
|
+
export declare const extractPreviewClientAction: (param: ExtractInvokePreviewActionParam) => PreviewActionData | undefined;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type ViewActionData } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
/**
|
|
5
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
6
|
+
*/
|
|
4
7
|
export declare const extractViewAction: (data: JsonLd.Data.BaseData, actionOptions?: CardActionOptions) => ViewActionData | undefined;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
1
|
+
import { type JsonLd } from 'json-ld-types';
|
|
2
|
+
import { type FireEventFunction } from '../../../common/analytics/types';
|
|
3
|
+
import { type FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
4
|
+
import { type AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
5
|
+
import { type AnalyticsOrigin } from '../../../utils/types';
|
|
6
|
+
import { type CardActionOptions, type CardInnerAppearance } from '../../../view/Card/types';
|
|
7
|
+
export type ExtractActionsParam = {
|
|
8
|
+
response: JsonLd.Response;
|
|
9
|
+
url?: string;
|
|
10
|
+
actionOptions?: CardActionOptions;
|
|
11
|
+
id?: string;
|
|
12
|
+
aiSummaryConfig?: AISummaryConfig;
|
|
13
|
+
appearance?: CardInnerAppearance;
|
|
14
|
+
origin?: AnalyticsOrigin;
|
|
15
|
+
fireEvent?: FireEventFunction;
|
|
16
|
+
};
|
|
17
|
+
export declare const extractFlexibleCardActions: ({ actionOptions, aiSummaryConfig, appearance, fireEvent, id, origin, response, url, }: ExtractActionsParam) => FlexibleUiActions | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
20
|
+
* Replaced with extractFlexibleCardActions()
|
|
21
|
+
*/
|
|
5
22
|
declare const extractActions: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, id?: string, aiSummaryConfig?: AISummaryConfig) => FlexibleUiActions | undefined;
|
|
6
23
|
export default extractActions;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
|
-
import { type
|
|
2
|
+
import { type FireEventFunction } from '../../common/analytics/types';
|
|
3
|
+
import { type ResolveFunction } from '../../state/hooks/use-resolve';
|
|
4
|
+
import { type AnalyticsOrigin } from '../../utils/types';
|
|
5
|
+
import { type CardActionOptions, type CardInnerAppearance } from '../../view/Card/types';
|
|
3
6
|
import { type LinkLozenge } from '../common/lozenge/types';
|
|
4
|
-
declare const extractState: (response?: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => LinkLozenge | undefined;
|
|
7
|
+
declare const extractState: (response?: JsonLd.Response, actionOptions?: CardActionOptions, id?: string, appearance?: CardInnerAppearance, origin?: AnalyticsOrigin, fireEvent?: FireEventFunction, resolve?: ResolveFunction) => LinkLozenge | undefined;
|
|
5
8
|
export default extractState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
2
2
|
import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
|
|
3
|
-
declare const extractFlexibleUiContext: ({ id, renderers, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
3
|
+
declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, origin, renderers, resolve, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
4
4
|
export default extractFlexibleUiContext;
|