@amplifyup/sdk 0.1.60 → 0.1.62
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 +11 -6
- package/dist/AmplifyRenderer-BQ8-H2H4.d.ts +74 -0
- package/dist/AmplifyRenderer-W7eqltSj.d.mts +74 -0
- package/dist/AmplifyRenderer.d.mts +4 -40
- package/dist/AmplifyRenderer.d.ts +4 -40
- package/dist/AmplifyRenderer.js +257 -30
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +258 -31
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +98 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{query-BqApXxQi.d.ts → query-3AXnQgzO.d.ts} +1 -0
- package/dist/{query-DaJlqU-Z.d.mts → query-DIZjc7st.d.mts} +1 -0
- package/dist/react.d.mts +34 -36
- package/dist/react.d.ts +34 -36
- package/dist/react.js +1480 -1314
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1460 -1297
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +97 -2
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +97 -2
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -60,6 +60,7 @@ declare function selectVariants(options: SelectVariantsOptions): Promise<SelectV
|
|
|
60
60
|
* Page resolve covers data known at Deploy. Visitor-triggered data — search,
|
|
61
61
|
* load more, pickers — runs here: the browser asks AmplifyUp, AmplifyUp asks
|
|
62
62
|
* the CMS. Only entities published with the page can be queried.
|
|
63
|
+
* Results are plain CMS rows, not Field envelopes, and are not canvas-editable.
|
|
63
64
|
*/
|
|
64
65
|
|
|
65
66
|
type QueryFilterOp = 'eq' | 'neq' | 'in' | 'nin' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'exists';
|
|
@@ -60,6 +60,7 @@ declare function selectVariants(options: SelectVariantsOptions): Promise<SelectV
|
|
|
60
60
|
* Page resolve covers data known at Deploy. Visitor-triggered data — search,
|
|
61
61
|
* load more, pickers — runs here: the browser asks AmplifyUp, AmplifyUp asks
|
|
62
62
|
* the CMS. Only entities published with the page can be queried.
|
|
63
|
+
* Results are plain CMS rows, not Field envelopes, and are not canvas-editable.
|
|
63
64
|
*/
|
|
64
65
|
|
|
65
66
|
type QueryFilterOp = 'eq' | 'neq' | 'in' | 'nin' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'exists';
|
package/dist/react.d.mts
CHANGED
|
@@ -2,15 +2,16 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { P as PageConfig, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-Db_eLrfU.mjs';
|
|
3
3
|
export { Z as ZoneConfig } from './types-Db_eLrfU.mjs';
|
|
4
4
|
import React__default, { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
export {
|
|
5
|
+
import { L as LayoutComponentProps, F as Field$1 } from './AmplifyRenderer-W7eqltSj.mjs';
|
|
6
|
+
export { A as AmplifyRenderer, b as Fields, I as ImageValue, a as isBrandedFields, i as isFieldEnvelope, t as toFieldEnvelopes } from './AmplifyRenderer-W7eqltSj.mjs';
|
|
7
|
+
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-DIZjc7st.mjs';
|
|
7
8
|
export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.mjs';
|
|
8
9
|
|
|
9
10
|
type RenderComponentContext = {
|
|
10
11
|
/** Unique layout-tree node id — required when multiple instances share a component type. */
|
|
11
12
|
layoutNodeId: string;
|
|
12
13
|
};
|
|
13
|
-
type RenderComponentFn = (componentId: string, props:
|
|
14
|
+
type RenderComponentFn = (componentId: string, props: LayoutComponentProps, slots?: Record<string, ReactNode>, context?: RenderComponentContext) => ReactNode;
|
|
14
15
|
interface AmplifyPageContentProps {
|
|
15
16
|
/**
|
|
16
17
|
* Native page content shown to visitors when no AmplifyUp layout is configured.
|
|
@@ -43,12 +44,6 @@ interface AmplifyPageContentProps {
|
|
|
43
44
|
*/
|
|
44
45
|
declare function AmplifyPageContent({ fallback, renderComponent, pageConfig: pageConfigProp, forceComposerPreview, previewLoadingComponent, previewEmptyComponent, loadingComponent, emptyComponent, errorComponent, }: AmplifyPageContentProps): react_jsx_runtime.JSX.Element | null;
|
|
45
46
|
|
|
46
|
-
declare function useLiveComposerProps(layoutNodeId: string | undefined, props: Record<string, any>): Record<string, any>;
|
|
47
|
-
/**
|
|
48
|
-
* Live props for this layout node (CMS fields + settings).
|
|
49
|
-
* Same values `<Field>` reads — use this when you want to render yourself.
|
|
50
|
-
*/
|
|
51
|
-
declare function useComponentProps<T extends Record<string, any> = Record<string, any>>(): T;
|
|
52
47
|
declare function ComponentContextProvider({ children, slots, props, layoutNodeId, componentId, }: {
|
|
53
48
|
children: ReactNode;
|
|
54
49
|
slots?: Record<string, ReactNode>;
|
|
@@ -87,44 +82,39 @@ declare function Slot({ name, className, }: {
|
|
|
87
82
|
className?: string;
|
|
88
83
|
}): react_jsx_runtime.JSX.Element | null;
|
|
89
84
|
declare function Field(props: {
|
|
90
|
-
/**
|
|
85
|
+
/** Envelope from `props.fields` (`{ value, name }`). */
|
|
86
|
+
field?: Field$1<unknown>;
|
|
87
|
+
/** Computed value — requires `name`. */
|
|
91
88
|
value?: unknown;
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated Prefer `value={…}`. Still used as the Composer save key when
|
|
94
|
-
* the same value appears on more than one prop.
|
|
95
|
-
*/
|
|
89
|
+
/** Required with `value` for computed values. */
|
|
96
90
|
name?: string;
|
|
97
|
-
fallback?: ReactNode;
|
|
98
91
|
className?: string;
|
|
99
92
|
render?: (value: any) => ReactNode;
|
|
100
93
|
}): string | number | true | Iterable<React__default.ReactNode> | react_jsx_runtime.JSX.Element | null;
|
|
101
94
|
/**
|
|
102
95
|
* RichText - Renders a markdown (or HTML string) value as formatted HTML.
|
|
103
96
|
*
|
|
104
|
-
* Pass
|
|
105
|
-
* Markdown for portability across CMS platforms.
|
|
97
|
+
* Pass a field envelope: `<RichText field={fields.body} />`.
|
|
98
|
+
* Values are Markdown for portability across CMS platforms.
|
|
106
99
|
*
|
|
107
100
|
* @example
|
|
108
101
|
* ```tsx
|
|
109
|
-
* function Article({
|
|
102
|
+
* function Article({ fields }: { fields: Fields<{ title: string; body: string }> }) {
|
|
110
103
|
* return (
|
|
111
104
|
* <article>
|
|
112
|
-
* <h1><Field
|
|
113
|
-
* <RichText
|
|
105
|
+
* <h1><Field field={fields.title} /></h1>
|
|
106
|
+
* <RichText field={fields.body} className="prose" />
|
|
114
107
|
* </article>
|
|
115
108
|
* );
|
|
116
109
|
* }
|
|
117
110
|
* ```
|
|
118
111
|
*/
|
|
119
112
|
declare function RichText(props: {
|
|
120
|
-
|
|
113
|
+
field?: Field$1<string | null>;
|
|
114
|
+
/** Computed markdown — requires `name`. */
|
|
121
115
|
value?: string | null;
|
|
122
|
-
/**
|
|
123
|
-
* @deprecated Prefer `value={…}`. Still used as the Composer save key when
|
|
124
|
-
* the same value appears on more than one prop.
|
|
125
|
-
*/
|
|
116
|
+
/** Required with `value` for computed values. */
|
|
126
117
|
name?: string;
|
|
127
|
-
fallback?: ReactNode;
|
|
128
118
|
className?: string;
|
|
129
119
|
as?: keyof JSX.IntrinsicElements;
|
|
130
120
|
/** String children are treated as the markdown value (same as `value`). */
|
|
@@ -133,29 +123,37 @@ declare function RichText(props: {
|
|
|
133
123
|
/**
|
|
134
124
|
* Image — renders a provider-backed image value as `<img>`.
|
|
135
125
|
*
|
|
136
|
-
* Pass
|
|
137
|
-
*
|
|
126
|
+
* Pass a field envelope: `<Image field={fields.backgroundImage} />`.
|
|
127
|
+
* AmplifyUp does not host image files.
|
|
138
128
|
*
|
|
139
129
|
* @example
|
|
140
130
|
* ```tsx
|
|
141
|
-
* function Hero({
|
|
131
|
+
* function Hero({ fields }: { fields: Fields<{ backgroundImage: ImageValue }> }) {
|
|
142
132
|
* return (
|
|
143
|
-
* <Image
|
|
133
|
+
* <Image field={fields.backgroundImage} className="h-full w-full object-cover" />
|
|
144
134
|
* );
|
|
145
135
|
* }
|
|
146
136
|
* ```
|
|
147
137
|
*/
|
|
148
138
|
declare function Image(props: {
|
|
149
|
-
|
|
139
|
+
field?: Field$1<unknown>;
|
|
140
|
+
/** Computed image — requires `name`. */
|
|
150
141
|
value?: unknown;
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated Will be removed. Use `value={…}` and omit `name`.
|
|
153
|
-
* Do not pass `name` together with `value`.
|
|
154
|
-
*/
|
|
142
|
+
/** Required with `value` for computed values. */
|
|
155
143
|
name?: string;
|
|
156
144
|
alt?: string;
|
|
157
145
|
} & Omit<React__default.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'name'>): react_jsx_runtime.JSX.Element | null;
|
|
158
146
|
|
|
147
|
+
declare function ComposerProvider({ layoutNodeId, children, }: {
|
|
148
|
+
layoutNodeId?: string;
|
|
149
|
+
children: ReactNode;
|
|
150
|
+
}): react_jsx_runtime.JSX.Element;
|
|
151
|
+
declare function MaybeComposerProvider({ enabled, layoutNodeId, children, }: {
|
|
152
|
+
enabled: boolean;
|
|
153
|
+
layoutNodeId?: string;
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
}): react_jsx_runtime.JSX.Element;
|
|
156
|
+
|
|
159
157
|
interface AmplifyUpContextType {
|
|
160
158
|
pageConfig: PageConfig | null;
|
|
161
159
|
loading: boolean;
|
|
@@ -175,4 +173,4 @@ interface AmplifyUpProviderProps {
|
|
|
175
173
|
declare function AmplifyUpProvider({ children, config, pageContext, }: AmplifyUpProviderProps): react_jsx_runtime.JSX.Element;
|
|
176
174
|
declare function useAmplifyUp(): AmplifyUpContextType;
|
|
177
175
|
|
|
178
|
-
export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ContentSource, Field, Image, PageConfig, RichText, Slot, useAmplifyUp
|
|
176
|
+
export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ComposerProvider, ContentSource, Field, Field$1 as FieldEnvelope, Image, LayoutComponentProps, MaybeComposerProvider, PageConfig, RichText, Slot, useAmplifyUp };
|
package/dist/react.d.ts
CHANGED
|
@@ -2,15 +2,16 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { P as PageConfig, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-Db_eLrfU.js';
|
|
3
3
|
export { Z as ZoneConfig } from './types-Db_eLrfU.js';
|
|
4
4
|
import React__default, { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
export {
|
|
5
|
+
import { L as LayoutComponentProps, F as Field$1 } from './AmplifyRenderer-BQ8-H2H4.js';
|
|
6
|
+
export { A as AmplifyRenderer, b as Fields, I as ImageValue, a as isBrandedFields, i as isFieldEnvelope, t as toFieldEnvelopes } from './AmplifyRenderer-BQ8-H2H4.js';
|
|
7
|
+
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-3AXnQgzO.js';
|
|
7
8
|
export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.js';
|
|
8
9
|
|
|
9
10
|
type RenderComponentContext = {
|
|
10
11
|
/** Unique layout-tree node id — required when multiple instances share a component type. */
|
|
11
12
|
layoutNodeId: string;
|
|
12
13
|
};
|
|
13
|
-
type RenderComponentFn = (componentId: string, props:
|
|
14
|
+
type RenderComponentFn = (componentId: string, props: LayoutComponentProps, slots?: Record<string, ReactNode>, context?: RenderComponentContext) => ReactNode;
|
|
14
15
|
interface AmplifyPageContentProps {
|
|
15
16
|
/**
|
|
16
17
|
* Native page content shown to visitors when no AmplifyUp layout is configured.
|
|
@@ -43,12 +44,6 @@ interface AmplifyPageContentProps {
|
|
|
43
44
|
*/
|
|
44
45
|
declare function AmplifyPageContent({ fallback, renderComponent, pageConfig: pageConfigProp, forceComposerPreview, previewLoadingComponent, previewEmptyComponent, loadingComponent, emptyComponent, errorComponent, }: AmplifyPageContentProps): react_jsx_runtime.JSX.Element | null;
|
|
45
46
|
|
|
46
|
-
declare function useLiveComposerProps(layoutNodeId: string | undefined, props: Record<string, any>): Record<string, any>;
|
|
47
|
-
/**
|
|
48
|
-
* Live props for this layout node (CMS fields + settings).
|
|
49
|
-
* Same values `<Field>` reads — use this when you want to render yourself.
|
|
50
|
-
*/
|
|
51
|
-
declare function useComponentProps<T extends Record<string, any> = Record<string, any>>(): T;
|
|
52
47
|
declare function ComponentContextProvider({ children, slots, props, layoutNodeId, componentId, }: {
|
|
53
48
|
children: ReactNode;
|
|
54
49
|
slots?: Record<string, ReactNode>;
|
|
@@ -87,44 +82,39 @@ declare function Slot({ name, className, }: {
|
|
|
87
82
|
className?: string;
|
|
88
83
|
}): react_jsx_runtime.JSX.Element | null;
|
|
89
84
|
declare function Field(props: {
|
|
90
|
-
/**
|
|
85
|
+
/** Envelope from `props.fields` (`{ value, name }`). */
|
|
86
|
+
field?: Field$1<unknown>;
|
|
87
|
+
/** Computed value — requires `name`. */
|
|
91
88
|
value?: unknown;
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated Prefer `value={…}`. Still used as the Composer save key when
|
|
94
|
-
* the same value appears on more than one prop.
|
|
95
|
-
*/
|
|
89
|
+
/** Required with `value` for computed values. */
|
|
96
90
|
name?: string;
|
|
97
|
-
fallback?: ReactNode;
|
|
98
91
|
className?: string;
|
|
99
92
|
render?: (value: any) => ReactNode;
|
|
100
93
|
}): string | number | true | Iterable<React__default.ReactNode> | react_jsx_runtime.JSX.Element | null;
|
|
101
94
|
/**
|
|
102
95
|
* RichText - Renders a markdown (or HTML string) value as formatted HTML.
|
|
103
96
|
*
|
|
104
|
-
* Pass
|
|
105
|
-
* Markdown for portability across CMS platforms.
|
|
97
|
+
* Pass a field envelope: `<RichText field={fields.body} />`.
|
|
98
|
+
* Values are Markdown for portability across CMS platforms.
|
|
106
99
|
*
|
|
107
100
|
* @example
|
|
108
101
|
* ```tsx
|
|
109
|
-
* function Article({
|
|
102
|
+
* function Article({ fields }: { fields: Fields<{ title: string; body: string }> }) {
|
|
110
103
|
* return (
|
|
111
104
|
* <article>
|
|
112
|
-
* <h1><Field
|
|
113
|
-
* <RichText
|
|
105
|
+
* <h1><Field field={fields.title} /></h1>
|
|
106
|
+
* <RichText field={fields.body} className="prose" />
|
|
114
107
|
* </article>
|
|
115
108
|
* );
|
|
116
109
|
* }
|
|
117
110
|
* ```
|
|
118
111
|
*/
|
|
119
112
|
declare function RichText(props: {
|
|
120
|
-
|
|
113
|
+
field?: Field$1<string | null>;
|
|
114
|
+
/** Computed markdown — requires `name`. */
|
|
121
115
|
value?: string | null;
|
|
122
|
-
/**
|
|
123
|
-
* @deprecated Prefer `value={…}`. Still used as the Composer save key when
|
|
124
|
-
* the same value appears on more than one prop.
|
|
125
|
-
*/
|
|
116
|
+
/** Required with `value` for computed values. */
|
|
126
117
|
name?: string;
|
|
127
|
-
fallback?: ReactNode;
|
|
128
118
|
className?: string;
|
|
129
119
|
as?: keyof JSX.IntrinsicElements;
|
|
130
120
|
/** String children are treated as the markdown value (same as `value`). */
|
|
@@ -133,29 +123,37 @@ declare function RichText(props: {
|
|
|
133
123
|
/**
|
|
134
124
|
* Image — renders a provider-backed image value as `<img>`.
|
|
135
125
|
*
|
|
136
|
-
* Pass
|
|
137
|
-
*
|
|
126
|
+
* Pass a field envelope: `<Image field={fields.backgroundImage} />`.
|
|
127
|
+
* AmplifyUp does not host image files.
|
|
138
128
|
*
|
|
139
129
|
* @example
|
|
140
130
|
* ```tsx
|
|
141
|
-
* function Hero({
|
|
131
|
+
* function Hero({ fields }: { fields: Fields<{ backgroundImage: ImageValue }> }) {
|
|
142
132
|
* return (
|
|
143
|
-
* <Image
|
|
133
|
+
* <Image field={fields.backgroundImage} className="h-full w-full object-cover" />
|
|
144
134
|
* );
|
|
145
135
|
* }
|
|
146
136
|
* ```
|
|
147
137
|
*/
|
|
148
138
|
declare function Image(props: {
|
|
149
|
-
|
|
139
|
+
field?: Field$1<unknown>;
|
|
140
|
+
/** Computed image — requires `name`. */
|
|
150
141
|
value?: unknown;
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated Will be removed. Use `value={…}` and omit `name`.
|
|
153
|
-
* Do not pass `name` together with `value`.
|
|
154
|
-
*/
|
|
142
|
+
/** Required with `value` for computed values. */
|
|
155
143
|
name?: string;
|
|
156
144
|
alt?: string;
|
|
157
145
|
} & Omit<React__default.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'name'>): react_jsx_runtime.JSX.Element | null;
|
|
158
146
|
|
|
147
|
+
declare function ComposerProvider({ layoutNodeId, children, }: {
|
|
148
|
+
layoutNodeId?: string;
|
|
149
|
+
children: ReactNode;
|
|
150
|
+
}): react_jsx_runtime.JSX.Element;
|
|
151
|
+
declare function MaybeComposerProvider({ enabled, layoutNodeId, children, }: {
|
|
152
|
+
enabled: boolean;
|
|
153
|
+
layoutNodeId?: string;
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
}): react_jsx_runtime.JSX.Element;
|
|
156
|
+
|
|
159
157
|
interface AmplifyUpContextType {
|
|
160
158
|
pageConfig: PageConfig | null;
|
|
161
159
|
loading: boolean;
|
|
@@ -175,4 +173,4 @@ interface AmplifyUpProviderProps {
|
|
|
175
173
|
declare function AmplifyUpProvider({ children, config, pageContext, }: AmplifyUpProviderProps): react_jsx_runtime.JSX.Element;
|
|
176
174
|
declare function useAmplifyUp(): AmplifyUpContextType;
|
|
177
175
|
|
|
178
|
-
export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ContentSource, Field, Image, PageConfig, RichText, Slot, useAmplifyUp
|
|
176
|
+
export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ComposerProvider, ContentSource, Field, Field$1 as FieldEnvelope, Image, LayoutComponentProps, MaybeComposerProvider, PageConfig, RichText, Slot, useAmplifyUp };
|