@atlaskit/smart-card 44.24.1 → 44.25.0
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 +19 -0
- package/dist/cjs/extractors/flexible/extract-state.js +4 -1
- package/dist/cjs/ssr.js +14 -3
- package/dist/cjs/state/actions/index.js +111 -23
- package/dist/cjs/state/hooks/use-resolve/index.js +7 -13
- package/dist/cjs/state/hooks/use-response/index.js +9 -3
- package/dist/cjs/state/hooks/usePrefetch.js +7 -6
- package/dist/cjs/state/hooks/useSmartLink.js +12 -3
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +3 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +25 -3
- package/dist/cjs/view/CardWithUrl/loader.js +7 -1
- package/dist/cjs/view/EmbedCard/useEmbedResolvePostMessageListener.js +4 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +5 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +5 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/extract-state.js +4 -1
- package/dist/es2019/ssr.js +14 -3
- package/dist/es2019/state/actions/index.js +85 -12
- package/dist/es2019/state/hooks/use-resolve/index.js +11 -2
- package/dist/es2019/state/hooks/use-response/index.js +9 -5
- package/dist/es2019/state/hooks/usePrefetch.js +8 -7
- package/dist/es2019/state/hooks/useSmartLink.js +13 -3
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +3 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +28 -4
- package/dist/es2019/view/CardWithUrl/loader.js +7 -1
- package/dist/es2019/view/EmbedCard/useEmbedResolvePostMessageListener.js +4 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +5 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +5 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/extract-state.js +4 -1
- package/dist/esm/ssr.js +14 -3
- package/dist/esm/state/actions/index.js +111 -23
- package/dist/esm/state/hooks/use-resolve/index.js +7 -13
- package/dist/esm/state/hooks/use-response/index.js +9 -3
- package/dist/esm/state/hooks/usePrefetch.js +7 -6
- package/dist/esm/state/hooks/useSmartLink.js +13 -3
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +3 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +26 -4
- package/dist/esm/view/CardWithUrl/loader.js +7 -1
- package/dist/esm/view/EmbedCard/useEmbedResolvePostMessageListener.js +4 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +5 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +5 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/actions/index.d.ts +3 -2
- package/dist/types/state/hooks/use-resolve/index.d.ts +9 -1
- package/dist/types/state/hooks/use-response/index.d.ts +2 -2
- package/dist/types/state/hooks/usePrefetch.d.ts +2 -1
- package/dist/types/state/hooks/useSmartLink.d.ts +14 -6
- package/dist/types-ts4.5/state/actions/index.d.ts +3 -2
- package/dist/types-ts4.5/state/hooks/use-resolve/index.d.ts +9 -1
- package/dist/types-ts4.5/state/hooks/use-response/index.d.ts +2 -2
- package/dist/types-ts4.5/state/hooks/usePrefetch.d.ts +2 -1
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +14 -6
- package/package.json +7 -4
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CardAppearance } from '@atlaskit/linking-common';
|
|
2
|
+
export interface ResolveUrlParams {
|
|
3
|
+
appearance?: CardAppearance;
|
|
4
|
+
id?: string;
|
|
5
|
+
isMetadataRequest?: boolean;
|
|
6
|
+
isReloading?: boolean;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
declare const useResolve: () => ((params: ResolveUrlParams) => Promise<void>);
|
|
2
10
|
export default useResolve;
|
|
3
11
|
export type ResolveFunction = ReturnType<typeof useResolve>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type JsonLd } from '@atlaskit/json-ld-types';
|
|
2
|
-
import { APIError } from '@atlaskit/linking-common';
|
|
2
|
+
import { APIError, type MetadataStatus } from '@atlaskit/linking-common';
|
|
3
3
|
declare const useResponse: () => {
|
|
4
4
|
handleResolvedLinkError: (url: string, error: APIError, response?: JsonLd.Response, isMetadataRequest?: boolean) => void;
|
|
5
|
-
handleResolvedLinkResponse: (resourceUrl: string, response: JsonLd.Response | undefined, isReloading?: boolean, isMetadataRequest?: boolean) => void;
|
|
5
|
+
handleResolvedLinkResponse: (resourceUrl: string, response: JsonLd.Response | undefined, isReloading?: boolean, isMetadataRequest?: boolean, metadataStatus?: MetadataStatus) => void;
|
|
6
6
|
};
|
|
7
7
|
export default useResponse;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CardAppearance } from '@atlaskit/linking-common';
|
|
2
|
+
export declare function usePrefetch(url: string, appearance?: CardAppearance): () => Promise<void>;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import type { JsonLd } from '@atlaskit/json-ld-types';
|
|
2
2
|
import { type CardAuthFlowOpts, type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
3
|
-
import type { CardState } from '@atlaskit/linking-common';
|
|
3
|
+
import type { CardAppearance, CardState } from '@atlaskit/linking-common';
|
|
4
4
|
import type { InvokeClientOpts, InvokeServerOpts } from '../../model/invoke-opts';
|
|
5
5
|
import type { CardInnerAppearance } from '../../view/Card/types';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Hook for smart link state and actions.
|
|
8
|
+
* @param id - Unique identifier for the smart link
|
|
9
|
+
* @param url - The URL to resolve
|
|
10
|
+
* @param appearance - Card appearance hint for ORS to optimize response payload.
|
|
11
|
+
* When 'inline', ORS returns minimal data (title, status).
|
|
12
|
+
* When 'block' or 'embed', ORS returns full data including summary.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useSmartLink(id: string, url: string, appearance?: CardAppearance): {
|
|
8
15
|
actions: {
|
|
9
|
-
register: () => Promise<void>;
|
|
10
|
-
reload: () => void;
|
|
11
16
|
authorize: (appearance: CardInnerAppearance) => void;
|
|
12
17
|
invoke: (opts: InvokeClientOpts | InvokeServerOpts, appearance: CardInnerAppearance) => Promise<JsonLd.Response | void>;
|
|
13
18
|
loadMetadata: () => Promise<void> | undefined;
|
|
19
|
+
register: () => Promise<void>;
|
|
20
|
+
reload: (appearance?: CardAppearance) => void;
|
|
14
21
|
};
|
|
15
22
|
config: CardAuthFlowOpts | undefined;
|
|
16
|
-
renderers: CardProviderRenderers | undefined;
|
|
17
23
|
error: Error | null;
|
|
18
24
|
isPreviewPanelAvailable: ((props: {
|
|
19
25
|
ari: string;
|
|
@@ -27,4 +33,6 @@ export declare function useSmartLink(id: string, url: string): {
|
|
|
27
33
|
};
|
|
28
34
|
url: string;
|
|
29
35
|
}) => void) | undefined;
|
|
36
|
+
renderers: CardProviderRenderers | undefined;
|
|
37
|
+
state: CardState;
|
|
30
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.25.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
"@atlaskit/textfield": "^8.3.0",
|
|
88
88
|
"@atlaskit/theme": "^25.0.0",
|
|
89
89
|
"@atlaskit/tile": "^1.1.0",
|
|
90
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
90
|
+
"@atlaskit/tmp-editor-statsig": "^93.0.0",
|
|
91
91
|
"@atlaskit/tokens": "^13.3.0",
|
|
92
92
|
"@atlaskit/tooltip": "^22.6.0",
|
|
93
93
|
"@atlaskit/ufo": "^0.5.0",
|
|
94
94
|
"@atlaskit/width-detector": "^5.1.0",
|
|
95
95
|
"@babel/runtime": "^7.0.0",
|
|
96
|
-
"@compiled/react": "
|
|
96
|
+
"@compiled/react": "^0.20.0",
|
|
97
97
|
"@formatjs/intl-utils": "^3.8.4",
|
|
98
98
|
"facepaint": "^1.2.1",
|
|
99
99
|
"lru_map": "^0.4.1",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"uuid": "^3.1.0"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@atlaskit/link-provider": "^4.
|
|
110
|
+
"@atlaskit/link-provider": "^4.7.0",
|
|
111
111
|
"react": "^18.2.0",
|
|
112
112
|
"react-dom": "^18.2.0",
|
|
113
113
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -282,6 +282,9 @@
|
|
|
282
282
|
},
|
|
283
283
|
"platform_sl_3p_auth_inline_tailored_cta_killswitch": {
|
|
284
284
|
"type": "boolean"
|
|
285
|
+
},
|
|
286
|
+
"platform_smartlink_inline_resolve_optimization": {
|
|
287
|
+
"type": "boolean"
|
|
285
288
|
}
|
|
286
289
|
},
|
|
287
290
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|