@amplifyup/sdk 0.1.62 → 0.1.64
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/README.md +446 -12
- package/dist/AmplifyRenderer.d.mts +40 -4
- package/dist/AmplifyRenderer.d.ts +40 -4
- package/dist/AmplifyRenderer.js +219 -27
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +220 -28
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +155 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +155 -9
- package/dist/index.mjs.map +1 -1
- package/dist/{query-3AXnQgzO.d.ts → query-BLjZYjHJ.d.ts} +4 -3
- package/dist/{query-DIZjc7st.d.mts → query-DuRilU_n.d.mts} +4 -3
- package/dist/react.d.mts +44 -21
- package/dist/react.d.ts +44 -21
- package/dist/react.js +356 -127
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +353 -129
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +155 -9
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +155 -9
- package/dist/server.mjs.map +1 -1
- package/dist/{types-Db_eLrfU.d.mts → types-C32MgOiv.d.mts} +96 -1
- package/dist/{types-Db_eLrfU.d.ts → types-C32MgOiv.d.ts} +96 -1
- package/package.json +1 -1
- package/dist/AmplifyRenderer-BQ8-H2H4.d.ts +0 -74
- package/dist/AmplifyRenderer-W7eqltSj.d.mts +0 -74
package/package.json
CHANGED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { P as PageConfig } from './types-Db_eLrfU.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Field envelopes — same shape in published, draft, and Composer edit.
|
|
8
|
-
* `{ value, name }` where `name` is the full dot path (`hero.image`).
|
|
9
|
-
* Produced once at the Edge resolve boundary (`fetchEdgeResolve`).
|
|
10
|
-
*/
|
|
11
|
-
declare const FIELDS_BRAND: unique symbol;
|
|
12
|
-
type ImageValue = {
|
|
13
|
-
url: string;
|
|
14
|
-
alt?: string;
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
};
|
|
18
|
-
type Field<T> = {
|
|
19
|
-
value: T;
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
22
|
-
type IsPlainObject<T> = T extends object ? T extends readonly unknown[] ? false : T extends ImageValue ? false : true : false;
|
|
23
|
-
type Fields<T> = {
|
|
24
|
-
readonly [FIELDS_BRAND]: true;
|
|
25
|
-
} & {
|
|
26
|
-
[K in keyof T]-?: NonNullable<T[K]> extends ImageValue ? Field<T[K] | null> : IsPlainObject<NonNullable<T[K]>> extends true ? Fields<NonNullable<T[K]>> : Field<T[K]>;
|
|
27
|
-
};
|
|
28
|
-
/** Props passed into site components. Raw CMS bags are not assignable. */
|
|
29
|
-
type LayoutComponentProps<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
30
|
-
fields: Fields<T>;
|
|
31
|
-
};
|
|
32
|
-
declare function isBrandedFields(value: unknown): value is Fields<Record<string, unknown>>;
|
|
33
|
-
declare function isFieldEnvelope(value: unknown): value is Field<unknown>;
|
|
34
|
-
/**
|
|
35
|
-
* Wrap a props bag as envelopes. Already-enveloped bags are returned as-is.
|
|
36
|
-
* Nested plain objects become nested bags; portable images stay a leaf.
|
|
37
|
-
*/
|
|
38
|
-
declare function toFieldEnvelopes<T extends Record<string, unknown>>(source: T | null | undefined, prefix?: string): Fields<T>;
|
|
39
|
-
|
|
40
|
-
interface AmplifyRendererProps {
|
|
41
|
-
/**
|
|
42
|
-
* Component renderer function that maps componentId to React component
|
|
43
|
-
* This is site-specific and must be provided by the developer
|
|
44
|
-
*/
|
|
45
|
-
renderComponent: (componentId: string, props: LayoutComponentProps, slots?: Record<string, ReactNode>, context?: {
|
|
46
|
-
layoutNodeId: string;
|
|
47
|
-
}) => ReactNode;
|
|
48
|
-
/**
|
|
49
|
-
* Optional page config for server-side rendering (SSR/SSG)
|
|
50
|
-
* If provided, the component will use this instead of fetching client-side
|
|
51
|
-
*/
|
|
52
|
-
pageConfig?: PageConfig;
|
|
53
|
-
/**
|
|
54
|
-
* Optional loading component
|
|
55
|
-
*/
|
|
56
|
-
loadingComponent?: ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* Optional error component
|
|
59
|
-
*/
|
|
60
|
-
errorComponent?: (error: string) => ReactNode;
|
|
61
|
-
/**
|
|
62
|
-
* Optional empty state component (when no content is configured)
|
|
63
|
-
*/
|
|
64
|
-
emptyComponent?: ReactNode;
|
|
65
|
-
/**
|
|
66
|
-
* Force Composer page-slot wrapper (avoids SSR miss when window isn't available yet).
|
|
67
|
-
* When true, root components stay under [data-slot-source="page"] so hierarchy can climb to Page.
|
|
68
|
-
*/
|
|
69
|
-
composerPreview?: boolean;
|
|
70
|
-
}
|
|
71
|
-
declare function AmplifyRendererInner({ renderComponent, pageConfig: serverPageConfig, loadingComponent, errorComponent, emptyComponent, composerPreview, }: AmplifyRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
72
|
-
declare const AmplifyRenderer: React.MemoExoticComponent<typeof AmplifyRendererInner>;
|
|
73
|
-
|
|
74
|
-
export { AmplifyRenderer as A, type Field as F, type ImageValue as I, type LayoutComponentProps as L, isBrandedFields as a, type Fields as b, isFieldEnvelope as i, toFieldEnvelopes as t };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { P as PageConfig } from './types-Db_eLrfU.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Field envelopes — same shape in published, draft, and Composer edit.
|
|
8
|
-
* `{ value, name }` where `name` is the full dot path (`hero.image`).
|
|
9
|
-
* Produced once at the Edge resolve boundary (`fetchEdgeResolve`).
|
|
10
|
-
*/
|
|
11
|
-
declare const FIELDS_BRAND: unique symbol;
|
|
12
|
-
type ImageValue = {
|
|
13
|
-
url: string;
|
|
14
|
-
alt?: string;
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
};
|
|
18
|
-
type Field<T> = {
|
|
19
|
-
value: T;
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
22
|
-
type IsPlainObject<T> = T extends object ? T extends readonly unknown[] ? false : T extends ImageValue ? false : true : false;
|
|
23
|
-
type Fields<T> = {
|
|
24
|
-
readonly [FIELDS_BRAND]: true;
|
|
25
|
-
} & {
|
|
26
|
-
[K in keyof T]-?: NonNullable<T[K]> extends ImageValue ? Field<T[K] | null> : IsPlainObject<NonNullable<T[K]>> extends true ? Fields<NonNullable<T[K]>> : Field<T[K]>;
|
|
27
|
-
};
|
|
28
|
-
/** Props passed into site components. Raw CMS bags are not assignable. */
|
|
29
|
-
type LayoutComponentProps<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
30
|
-
fields: Fields<T>;
|
|
31
|
-
};
|
|
32
|
-
declare function isBrandedFields(value: unknown): value is Fields<Record<string, unknown>>;
|
|
33
|
-
declare function isFieldEnvelope(value: unknown): value is Field<unknown>;
|
|
34
|
-
/**
|
|
35
|
-
* Wrap a props bag as envelopes. Already-enveloped bags are returned as-is.
|
|
36
|
-
* Nested plain objects become nested bags; portable images stay a leaf.
|
|
37
|
-
*/
|
|
38
|
-
declare function toFieldEnvelopes<T extends Record<string, unknown>>(source: T | null | undefined, prefix?: string): Fields<T>;
|
|
39
|
-
|
|
40
|
-
interface AmplifyRendererProps {
|
|
41
|
-
/**
|
|
42
|
-
* Component renderer function that maps componentId to React component
|
|
43
|
-
* This is site-specific and must be provided by the developer
|
|
44
|
-
*/
|
|
45
|
-
renderComponent: (componentId: string, props: LayoutComponentProps, slots?: Record<string, ReactNode>, context?: {
|
|
46
|
-
layoutNodeId: string;
|
|
47
|
-
}) => ReactNode;
|
|
48
|
-
/**
|
|
49
|
-
* Optional page config for server-side rendering (SSR/SSG)
|
|
50
|
-
* If provided, the component will use this instead of fetching client-side
|
|
51
|
-
*/
|
|
52
|
-
pageConfig?: PageConfig;
|
|
53
|
-
/**
|
|
54
|
-
* Optional loading component
|
|
55
|
-
*/
|
|
56
|
-
loadingComponent?: ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* Optional error component
|
|
59
|
-
*/
|
|
60
|
-
errorComponent?: (error: string) => ReactNode;
|
|
61
|
-
/**
|
|
62
|
-
* Optional empty state component (when no content is configured)
|
|
63
|
-
*/
|
|
64
|
-
emptyComponent?: ReactNode;
|
|
65
|
-
/**
|
|
66
|
-
* Force Composer page-slot wrapper (avoids SSR miss when window isn't available yet).
|
|
67
|
-
* When true, root components stay under [data-slot-source="page"] so hierarchy can climb to Page.
|
|
68
|
-
*/
|
|
69
|
-
composerPreview?: boolean;
|
|
70
|
-
}
|
|
71
|
-
declare function AmplifyRendererInner({ renderComponent, pageConfig: serverPageConfig, loadingComponent, errorComponent, emptyComponent, composerPreview, }: AmplifyRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
72
|
-
declare const AmplifyRenderer: React.MemoExoticComponent<typeof AmplifyRendererInner>;
|
|
73
|
-
|
|
74
|
-
export { AmplifyRenderer as A, type Field as F, type ImageValue as I, type LayoutComponentProps as L, isBrandedFields as a, type Fields as b, isFieldEnvelope as i, toFieldEnvelopes as t };
|