@amplifyup/sdk 0.2.4 → 0.3.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.
Files changed (42) hide show
  1. package/README.md +13 -1
  2. package/dist/{AmplifyRenderer-BNWBrFQN.d.ts → AmplifyRenderer-CwAYY8K1.d.mts} +4 -5
  3. package/dist/{AmplifyRenderer-CPUr9Bkc.d.mts → AmplifyRenderer-D40crBWY.d.ts} +4 -5
  4. package/dist/AmplifyRenderer.d.mts +2 -3
  5. package/dist/AmplifyRenderer.d.ts +2 -3
  6. package/dist/AmplifyRenderer.js +3 -30
  7. package/dist/AmplifyRenderer.js.map +1 -1
  8. package/dist/AmplifyRenderer.mjs +3 -30
  9. package/dist/AmplifyRenderer.mjs.map +1 -1
  10. package/dist/index.d.mts +240 -4
  11. package/dist/index.d.ts +240 -4
  12. package/dist/index.js +59 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +57 -2
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/next.js +101 -8
  17. package/dist/next.js.map +1 -1
  18. package/dist/next.mjs +100 -8
  19. package/dist/next.mjs.map +1 -1
  20. package/dist/{query-Xo9cy-2F.d.ts → query-BeQibYGm.d.ts} +56 -56
  21. package/dist/{query-DYjs4LQQ.d.mts → query-CwtZtJX8.d.mts} +56 -56
  22. package/dist/react.d.mts +23 -17
  23. package/dist/react.d.ts +23 -17
  24. package/dist/react.js +4 -31
  25. package/dist/react.js.map +1 -1
  26. package/dist/react.mjs +4 -31
  27. package/dist/react.mjs.map +1 -1
  28. package/dist/server.d.mts +3 -3
  29. package/dist/server.d.ts +3 -3
  30. package/dist/server.js +1 -1
  31. package/dist/server.js.map +1 -1
  32. package/dist/server.mjs +1 -1
  33. package/dist/server.mjs.map +1 -1
  34. package/dist/{types-ffQNIQCK.d.ts → types-CxucvIL6.d.mts} +1 -1
  35. package/dist/{types-ffQNIQCK.d.mts → types-CxucvIL6.d.ts} +1 -1
  36. package/package.json +8 -7
  37. package/dist/cli.d.mts +0 -1
  38. package/dist/cli.d.ts +0 -1
  39. package/dist/cli.js +0 -266
  40. package/dist/cli.js.map +0 -1
  41. package/dist/cli.mjs +0 -260
  42. package/dist/cli.mjs.map +0 -1
@@ -1,58 +1,4 @@
1
- import { A as AmplifyUpTarget } from './types-ffQNIQCK.js';
2
-
3
- /**
4
- * On-request variant selection (tier 3).
5
- *
6
- * Decisions happen on AmplifyUp Edge. The client asks after the view has
7
- * rendered; the Worker returns variant keys only. Profile data never leaves
8
- * the edge. This helper is the JS wrapper around POST /v1/select — the same
9
- * wire format is the contract for Flutter / native / .NET clients. No DOM
10
- * or Next.js assumptions.
11
- */
12
-
13
- interface SelectVariantsResult {
14
- siteId: string;
15
- view: string;
16
- variantKeys: Record<string, string>;
17
- meta?: Record<string, unknown>;
18
- }
19
- declare class SelectVariantsError extends Error {
20
- status: number;
21
- body: unknown;
22
- constructor(message: string, status: number, body?: unknown);
23
- }
24
- interface FetchEdgeSelectOptions {
25
- edgeUrl: string;
26
- trackingId?: string;
27
- site?: string;
28
- view: string;
29
- anonId: string;
30
- sessionId?: string;
31
- zones?: string[];
32
- /** Request-local facts the edge cannot observe (app version, screen class). */
33
- context?: Record<string, unknown>;
34
- fetch?: typeof fetch;
35
- signal?: AbortSignal;
36
- }
37
- declare function fetchEdgeSelect(options: FetchEdgeSelectOptions): Promise<SelectVariantsResult>;
38
- interface SelectVariantsOptions {
39
- trackingId?: string;
40
- site?: string;
41
- view: string;
42
- anonId: string;
43
- sessionId?: string;
44
- zones?: string[];
45
- context?: Record<string, unknown>;
46
- target?: AmplifyUpTarget;
47
- edgeUrl?: string;
48
- fetch?: typeof fetch;
49
- signal?: AbortSignal;
50
- }
51
- /**
52
- * Ask Edge to decide deferred rules for a view. Returns variant keys to pass
53
- * to `/v1/resolve?variants=`.
54
- */
55
- declare function selectVariants(options: SelectVariantsOptions): Promise<SelectVariantsResult>;
1
+ import { j as AmplifyUpTarget } from './types-CxucvIL6.js';
56
2
 
57
3
  /**
58
4
  * Field envelopes — same shape in published, draft, and Composer edit.
@@ -155,6 +101,60 @@ declare function envelopeListRows<T extends Record<string, unknown> = Record<str
155
101
  /** Attach branded `fields` once. Keeps sibling keys (e.g. zoneId). */
156
102
  declare function attachFieldEnvelopes(props: Record<string, unknown> | null | undefined, sources?: EnvelopeSources | Record<string, ConnectionLike | null | undefined>): Record<string, unknown>;
157
103
 
104
+ /**
105
+ * On-request variant selection (tier 3).
106
+ *
107
+ * Decisions happen on AmplifyUp Edge. The client asks after the view has
108
+ * rendered; the Worker returns variant keys only. Profile data never leaves
109
+ * the edge. This helper is the JS wrapper around POST /v1/select — the same
110
+ * wire format is the contract for Flutter / native / .NET clients. No DOM
111
+ * or Next.js assumptions.
112
+ */
113
+
114
+ interface SelectVariantsResult {
115
+ siteId: string;
116
+ view: string;
117
+ variantKeys: Record<string, string>;
118
+ meta?: Record<string, unknown>;
119
+ }
120
+ declare class SelectVariantsError extends Error {
121
+ status: number;
122
+ body: unknown;
123
+ constructor(message: string, status: number, body?: unknown);
124
+ }
125
+ interface FetchEdgeSelectOptions {
126
+ edgeUrl: string;
127
+ trackingId?: string;
128
+ site?: string;
129
+ view: string;
130
+ anonId: string;
131
+ sessionId?: string;
132
+ zones?: string[];
133
+ /** Request-local facts the edge cannot observe (app version, screen class). */
134
+ context?: Record<string, unknown>;
135
+ fetch?: typeof fetch;
136
+ signal?: AbortSignal;
137
+ }
138
+ declare function fetchEdgeSelect(options: FetchEdgeSelectOptions): Promise<SelectVariantsResult>;
139
+ interface SelectVariantsOptions {
140
+ trackingId?: string;
141
+ site?: string;
142
+ view: string;
143
+ anonId: string;
144
+ sessionId?: string;
145
+ zones?: string[];
146
+ context?: Record<string, unknown>;
147
+ target?: AmplifyUpTarget;
148
+ edgeUrl?: string;
149
+ fetch?: typeof fetch;
150
+ signal?: AbortSignal;
151
+ }
152
+ /**
153
+ * Ask Edge to decide deferred rules for a view. Returns variant keys to pass
154
+ * to `/v1/resolve?variants=`.
155
+ */
156
+ declare function selectVariants(options: SelectVariantsOptions): Promise<SelectVariantsResult>;
157
+
158
158
  /**
159
159
  * Runtime content queries.
160
160
  *
@@ -259,4 +259,4 @@ declare function nextPageSpec(pagination: QueryPagination): QuerySpec;
259
259
  */
260
260
  declare function searchSpec(pagination: QueryPagination, field: string, term: string): QuerySpec;
261
261
 
262
- export { type FieldRef as A, type Fields as B, type LayoutComponentProps as C, type FetchEdgeSelectOptions as F, type ImageValue as I, type ListRow as L, type PortableRef as P, QueryContentError as Q, SelectVariantsError as S, type SelectVariantsOptions as a, type SelectVariantsResult as b, fetchEdgeQuery as c, searchSpec as d, type QueryContentOptions as e, fetchEdgeSelect as f, type FetchEdgeQueryOptions as g, type QueryResult as h, type QueryPagination as i, type QuerySpec as j, type QueryFilter as k, type QueryFilterOp as l, type QuerySort as m, nextPageSpec as n, type Field as o, FIELDS_BRAND as p, queryContent as q, attachFieldEnvelopes as r, selectVariants as s, toFieldEnvelopes as t, envelopeListRows as u, composerStoreKey as v, listOwnerFromSpec as w, isFieldEnvelope as x, isReadOnlyRowField as y, isBrandedFields as z };
262
+ export { isReadOnlyRowField as A, listOwnerFromSpec as B, toFieldEnvelopes as C, type FetchEdgeQueryOptions as F, type ImageValue as I, type LayoutComponentProps as L, type PortableRef as P, QueryContentError as Q, SelectVariantsError as S, type FetchEdgeSelectOptions as a, type QueryContentOptions as b, type QueryFilter as c, type QueryFilterOp as d, type QueryPagination as e, type QueryResult as f, type QuerySort as g, type QuerySpec as h, type SelectVariantsOptions as i, type SelectVariantsResult as j, fetchEdgeQuery as k, fetchEdgeSelect as l, selectVariants as m, nextPageSpec as n, type Field as o, FIELDS_BRAND as p, queryContent as q, type FieldRef as r, searchSpec as s, type Fields as t, type ListRow as u, attachFieldEnvelopes as v, composerStoreKey as w, envelopeListRows as x, isBrandedFields as y, isFieldEnvelope as z };
@@ -1,58 +1,4 @@
1
- import { A as AmplifyUpTarget } from './types-ffQNIQCK.mjs';
2
-
3
- /**
4
- * On-request variant selection (tier 3).
5
- *
6
- * Decisions happen on AmplifyUp Edge. The client asks after the view has
7
- * rendered; the Worker returns variant keys only. Profile data never leaves
8
- * the edge. This helper is the JS wrapper around POST /v1/select — the same
9
- * wire format is the contract for Flutter / native / .NET clients. No DOM
10
- * or Next.js assumptions.
11
- */
12
-
13
- interface SelectVariantsResult {
14
- siteId: string;
15
- view: string;
16
- variantKeys: Record<string, string>;
17
- meta?: Record<string, unknown>;
18
- }
19
- declare class SelectVariantsError extends Error {
20
- status: number;
21
- body: unknown;
22
- constructor(message: string, status: number, body?: unknown);
23
- }
24
- interface FetchEdgeSelectOptions {
25
- edgeUrl: string;
26
- trackingId?: string;
27
- site?: string;
28
- view: string;
29
- anonId: string;
30
- sessionId?: string;
31
- zones?: string[];
32
- /** Request-local facts the edge cannot observe (app version, screen class). */
33
- context?: Record<string, unknown>;
34
- fetch?: typeof fetch;
35
- signal?: AbortSignal;
36
- }
37
- declare function fetchEdgeSelect(options: FetchEdgeSelectOptions): Promise<SelectVariantsResult>;
38
- interface SelectVariantsOptions {
39
- trackingId?: string;
40
- site?: string;
41
- view: string;
42
- anonId: string;
43
- sessionId?: string;
44
- zones?: string[];
45
- context?: Record<string, unknown>;
46
- target?: AmplifyUpTarget;
47
- edgeUrl?: string;
48
- fetch?: typeof fetch;
49
- signal?: AbortSignal;
50
- }
51
- /**
52
- * Ask Edge to decide deferred rules for a view. Returns variant keys to pass
53
- * to `/v1/resolve?variants=`.
54
- */
55
- declare function selectVariants(options: SelectVariantsOptions): Promise<SelectVariantsResult>;
1
+ import { j as AmplifyUpTarget } from './types-CxucvIL6.mjs';
56
2
 
57
3
  /**
58
4
  * Field envelopes — same shape in published, draft, and Composer edit.
@@ -155,6 +101,60 @@ declare function envelopeListRows<T extends Record<string, unknown> = Record<str
155
101
  /** Attach branded `fields` once. Keeps sibling keys (e.g. zoneId). */
156
102
  declare function attachFieldEnvelopes(props: Record<string, unknown> | null | undefined, sources?: EnvelopeSources | Record<string, ConnectionLike | null | undefined>): Record<string, unknown>;
157
103
 
104
+ /**
105
+ * On-request variant selection (tier 3).
106
+ *
107
+ * Decisions happen on AmplifyUp Edge. The client asks after the view has
108
+ * rendered; the Worker returns variant keys only. Profile data never leaves
109
+ * the edge. This helper is the JS wrapper around POST /v1/select — the same
110
+ * wire format is the contract for Flutter / native / .NET clients. No DOM
111
+ * or Next.js assumptions.
112
+ */
113
+
114
+ interface SelectVariantsResult {
115
+ siteId: string;
116
+ view: string;
117
+ variantKeys: Record<string, string>;
118
+ meta?: Record<string, unknown>;
119
+ }
120
+ declare class SelectVariantsError extends Error {
121
+ status: number;
122
+ body: unknown;
123
+ constructor(message: string, status: number, body?: unknown);
124
+ }
125
+ interface FetchEdgeSelectOptions {
126
+ edgeUrl: string;
127
+ trackingId?: string;
128
+ site?: string;
129
+ view: string;
130
+ anonId: string;
131
+ sessionId?: string;
132
+ zones?: string[];
133
+ /** Request-local facts the edge cannot observe (app version, screen class). */
134
+ context?: Record<string, unknown>;
135
+ fetch?: typeof fetch;
136
+ signal?: AbortSignal;
137
+ }
138
+ declare function fetchEdgeSelect(options: FetchEdgeSelectOptions): Promise<SelectVariantsResult>;
139
+ interface SelectVariantsOptions {
140
+ trackingId?: string;
141
+ site?: string;
142
+ view: string;
143
+ anonId: string;
144
+ sessionId?: string;
145
+ zones?: string[];
146
+ context?: Record<string, unknown>;
147
+ target?: AmplifyUpTarget;
148
+ edgeUrl?: string;
149
+ fetch?: typeof fetch;
150
+ signal?: AbortSignal;
151
+ }
152
+ /**
153
+ * Ask Edge to decide deferred rules for a view. Returns variant keys to pass
154
+ * to `/v1/resolve?variants=`.
155
+ */
156
+ declare function selectVariants(options: SelectVariantsOptions): Promise<SelectVariantsResult>;
157
+
158
158
  /**
159
159
  * Runtime content queries.
160
160
  *
@@ -259,4 +259,4 @@ declare function nextPageSpec(pagination: QueryPagination): QuerySpec;
259
259
  */
260
260
  declare function searchSpec(pagination: QueryPagination, field: string, term: string): QuerySpec;
261
261
 
262
- export { type FieldRef as A, type Fields as B, type LayoutComponentProps as C, type FetchEdgeSelectOptions as F, type ImageValue as I, type ListRow as L, type PortableRef as P, QueryContentError as Q, SelectVariantsError as S, type SelectVariantsOptions as a, type SelectVariantsResult as b, fetchEdgeQuery as c, searchSpec as d, type QueryContentOptions as e, fetchEdgeSelect as f, type FetchEdgeQueryOptions as g, type QueryResult as h, type QueryPagination as i, type QuerySpec as j, type QueryFilter as k, type QueryFilterOp as l, type QuerySort as m, nextPageSpec as n, type Field as o, FIELDS_BRAND as p, queryContent as q, attachFieldEnvelopes as r, selectVariants as s, toFieldEnvelopes as t, envelopeListRows as u, composerStoreKey as v, listOwnerFromSpec as w, isFieldEnvelope as x, isReadOnlyRowField as y, isBrandedFields as z };
262
+ export { isReadOnlyRowField as A, listOwnerFromSpec as B, toFieldEnvelopes as C, type FetchEdgeQueryOptions as F, type ImageValue as I, type LayoutComponentProps as L, type PortableRef as P, QueryContentError as Q, SelectVariantsError as S, type FetchEdgeSelectOptions as a, type QueryContentOptions as b, type QueryFilter as c, type QueryFilterOp as d, type QueryPagination as e, type QueryResult as f, type QuerySort as g, type QuerySpec as h, type SelectVariantsOptions as i, type SelectVariantsResult as j, fetchEdgeQuery as k, fetchEdgeSelect as l, selectVariants as m, nextPageSpec as n, type Field as o, FIELDS_BRAND as p, queryContent as q, type FieldRef as r, searchSpec as s, type Fields as t, type ListRow as u, attachFieldEnvelopes as v, composerStoreKey as w, envelopeListRows as x, isBrandedFields as y, isFieldEnvelope as z };
package/dist/react.d.mts CHANGED
@@ -1,11 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { P as PageConfig, f as AmplifyUpConfig, h as AmplifyPageContextInput, C as ContentSource, a as AmplifyContentMeta } from './types-ffQNIQCK.mjs';
3
- export { Z as ZoneConfig } from './types-ffQNIQCK.mjs';
4
- import react__default, { ReactNode, FC } from 'react';
5
- import { C as ComponentRegistry } from './AmplifyRenderer-CPUr9Bkc.mjs';
6
- export { A as AmplifyRenderer, d as defineComponentRegistry } from './AmplifyRenderer-CPUr9Bkc.mjs';
7
- import { o as Field$1, p as FIELDS_BRAND } from './query-DYjs4LQQ.mjs';
8
- export { A as FieldRef, B as Fields, I as ImageValue, C as LayoutComponentProps, L as ListRow, P as PortableRef, 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, r as attachFieldEnvelopes, v as composerStoreKey, u as envelopeListRows, z as isBrandedFields, x as isFieldEnvelope, y as isReadOnlyRowField, w as listOwnerFromSpec, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants, t as toFieldEnvelopes } from './query-DYjs4LQQ.mjs';
1
+ import { P as PageConfig, d as AmplifyUpConfig, f as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-CxucvIL6.mjs';
2
+ export { Z as ZoneConfig } from './types-CxucvIL6.mjs';
3
+ import React__default, { ReactNode, FC } from 'react';
4
+ import { C as ComponentRegistry } from './AmplifyRenderer-CwAYY8K1.mjs';
5
+ export { A as AmplifyRenderer, d as defineComponentRegistry } from './AmplifyRenderer-CwAYY8K1.mjs';
6
+ import { o as Field$1, p as FIELDS_BRAND } from './query-CwtZtJX8.mjs';
7
+ export { r as FieldRef, t as Fields, I as ImageValue, L as LayoutComponentProps, u as ListRow, P as PortableRef, Q as QueryContentError, b as QueryContentOptions, c as QueryFilter, d as QueryFilterOp, e as QueryPagination, f as QueryResult, g as QuerySort, h as QuerySpec, S as SelectVariantsError, i as SelectVariantsOptions, j as SelectVariantsResult, v as attachFieldEnvelopes, w as composerStoreKey, x as envelopeListRows, y as isBrandedFields, z as isFieldEnvelope, A as isReadOnlyRowField, B as listOwnerFromSpec, n as nextPageSpec, q as queryContent, s as searchSpec, m as selectVariants, C as toFieldEnvelopes } from './query-CwtZtJX8.mjs';
9
8
  export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.mjs';
10
9
 
11
10
  interface AmplifyPageContentProps {
@@ -38,7 +37,7 @@ interface AmplifyPageContentProps {
38
37
  * Live pages paint the SSG/ISR layout first. Client Edge resolve (visitor id)
39
38
  * overlays only when the personalized tree differs from that static HTML.
40
39
  */
41
- declare function AmplifyPageContent(contentProps: AmplifyPageContentProps): react_jsx_runtime.JSX.Element | null;
40
+ declare function AmplifyPageContent(contentProps: AmplifyPageContentProps): React__default.JSX.Element | null;
42
41
 
43
42
  type AmplifyPageProps = Omit<AmplifyPageContentProps, 'registry'>;
44
43
  /**
@@ -62,6 +61,13 @@ declare function useInComposer(force?: boolean): boolean;
62
61
  /** @deprecated Prefer `useInComposer`. Kept for internal AmplifyPageContent. */
63
62
  declare function useComposerPreviewFlag(force?: boolean): boolean;
64
63
 
64
+ /**
65
+ * SDK Components for Slot and Field rendering
66
+ *
67
+ * These components allow developers to explicitly define where slots and fields
68
+ * are rendered in their components, with full control over styling and structure.
69
+ */
70
+
65
71
  /**
66
72
  * Slot Component
67
73
  *
@@ -91,7 +97,7 @@ declare function useComposerPreviewFlag(force?: boolean): boolean;
91
97
  declare function Slot({ name, className }: {
92
98
  name: string;
93
99
  className?: string;
94
- }): react_jsx_runtime.JSX.Element | null;
100
+ }): React__default.JSX.Element | null;
95
101
  type RejectFieldInput<T> = [T] extends [readonly unknown[]] ? never : T extends {
96
102
  readonly [FIELDS_BRAND]: true;
97
103
  } ? never : T;
@@ -126,7 +132,7 @@ declare function Field<T = unknown>(props: {
126
132
  /** Required with `value` for computed values. */
127
133
  name?: string;
128
134
  className?: string;
129
- }): react_jsx_runtime.JSX.Element | null;
135
+ }): React__default.JSX.Element | null;
130
136
  /**
131
137
  * RichText - Renders a markdown (or HTML string) value as formatted HTML.
132
138
  *
@@ -155,7 +161,7 @@ declare function RichText<T = string | null>(props: {
155
161
  as?: keyof JSX.IntrinsicElements;
156
162
  /** String children are treated as the markdown value (same as `value`). */
157
163
  children?: ReactNode;
158
- }): react_jsx_runtime.JSX.Element | null;
164
+ }): React__default.JSX.Element | null;
159
165
  /**
160
166
  * Image — renders a provider-backed image value as `<img>`.
161
167
  *
@@ -178,13 +184,13 @@ declare function Image<T = unknown>(props: {
178
184
  /** Required with `value` for computed values. */
179
185
  name?: string;
180
186
  alt?: string;
181
- } & Omit<react__default.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'name'>): react_jsx_runtime.JSX.Element | null;
187
+ } & Omit<React__default.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'name'>): React__default.JSX.Element | null;
182
188
 
183
189
  /** Tells Slot whether the layout/provider fetch has settled. */
184
190
  declare function ComposerLayoutStatusProvider({ ready, children, }: {
185
191
  ready: boolean;
186
192
  children: ReactNode;
187
- }): react_jsx_runtime.JSX.Element;
193
+ }): React__default.JSX.Element;
188
194
 
189
195
  /** Composer slot lifecycle. Loading ≠ empty. */
190
196
  type SlotState = 'loading' | 'empty' | 'filled';
@@ -202,12 +208,12 @@ declare function ComposerProvider({ children, enabled, }: {
202
208
  children: ReactNode;
203
209
  /** When false, pass through any parent store without creating or wiring one. */
204
210
  enabled?: boolean;
205
- }): react_jsx_runtime.JSX.Element;
211
+ }): React__default.JSX.Element;
206
212
  declare function MaybeComposerProvider({ enabled, layoutNodeId, children, }: {
207
213
  enabled: boolean;
208
214
  layoutNodeId?: string;
209
215
  children: ReactNode;
210
- }): react_jsx_runtime.JSX.Element;
216
+ }): React__default.JSX.Element;
211
217
 
212
218
  interface AmplifyUpContextType {
213
219
  pageConfig: PageConfig | null;
@@ -225,7 +231,7 @@ interface AmplifyUpProviderProps {
225
231
  */
226
232
  pageContext?: AmplifyPageContextInput;
227
233
  }
228
- declare function AmplifyUpProvider({ children, config, pageContext, }: AmplifyUpProviderProps): react_jsx_runtime.JSX.Element;
234
+ declare function AmplifyUpProvider({ children, config, pageContext, }: AmplifyUpProviderProps): React__default.JSX.Element;
229
235
  declare function useAmplifyUp(): AmplifyUpContextType;
230
236
 
231
237
  export { AmplifyContentMeta, AmplifyPageContent, type AmplifyPageContentProps, type AmplifyPageProps, AmplifyUpProvider, ComponentRegistry, ComposerLayoutStatusProvider, ComposerProvider, ContentSource, Field, Field$1 as FieldEnvelope, Image, MaybeComposerProvider, PageConfig, RichText, Slot, type SlotState, bindAmplifyPage, resolveSlotState, slotShowsAddComponent, slotStateFromEl, useAmplifyUp, useComposerPreviewFlag, useInComposer };
package/dist/react.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { P as PageConfig, f as AmplifyUpConfig, h as AmplifyPageContextInput, C as ContentSource, a as AmplifyContentMeta } from './types-ffQNIQCK.js';
3
- export { Z as ZoneConfig } from './types-ffQNIQCK.js';
4
- import react__default, { ReactNode, FC } from 'react';
5
- import { C as ComponentRegistry } from './AmplifyRenderer-BNWBrFQN.js';
6
- export { A as AmplifyRenderer, d as defineComponentRegistry } from './AmplifyRenderer-BNWBrFQN.js';
7
- import { o as Field$1, p as FIELDS_BRAND } from './query-Xo9cy-2F.js';
8
- export { A as FieldRef, B as Fields, I as ImageValue, C as LayoutComponentProps, L as ListRow, P as PortableRef, 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, r as attachFieldEnvelopes, v as composerStoreKey, u as envelopeListRows, z as isBrandedFields, x as isFieldEnvelope, y as isReadOnlyRowField, w as listOwnerFromSpec, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants, t as toFieldEnvelopes } from './query-Xo9cy-2F.js';
1
+ import { P as PageConfig, d as AmplifyUpConfig, f as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-CxucvIL6.js';
2
+ export { Z as ZoneConfig } from './types-CxucvIL6.js';
3
+ import React__default, { ReactNode, FC } from 'react';
4
+ import { C as ComponentRegistry } from './AmplifyRenderer-D40crBWY.js';
5
+ export { A as AmplifyRenderer, d as defineComponentRegistry } from './AmplifyRenderer-D40crBWY.js';
6
+ import { o as Field$1, p as FIELDS_BRAND } from './query-BeQibYGm.js';
7
+ export { r as FieldRef, t as Fields, I as ImageValue, L as LayoutComponentProps, u as ListRow, P as PortableRef, Q as QueryContentError, b as QueryContentOptions, c as QueryFilter, d as QueryFilterOp, e as QueryPagination, f as QueryResult, g as QuerySort, h as QuerySpec, S as SelectVariantsError, i as SelectVariantsOptions, j as SelectVariantsResult, v as attachFieldEnvelopes, w as composerStoreKey, x as envelopeListRows, y as isBrandedFields, z as isFieldEnvelope, A as isReadOnlyRowField, B as listOwnerFromSpec, n as nextPageSpec, q as queryContent, s as searchSpec, m as selectVariants, C as toFieldEnvelopes } from './query-BeQibYGm.js';
9
8
  export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.js';
10
9
 
11
10
  interface AmplifyPageContentProps {
@@ -38,7 +37,7 @@ interface AmplifyPageContentProps {
38
37
  * Live pages paint the SSG/ISR layout first. Client Edge resolve (visitor id)
39
38
  * overlays only when the personalized tree differs from that static HTML.
40
39
  */
41
- declare function AmplifyPageContent(contentProps: AmplifyPageContentProps): react_jsx_runtime.JSX.Element | null;
40
+ declare function AmplifyPageContent(contentProps: AmplifyPageContentProps): React__default.JSX.Element | null;
42
41
 
43
42
  type AmplifyPageProps = Omit<AmplifyPageContentProps, 'registry'>;
44
43
  /**
@@ -62,6 +61,13 @@ declare function useInComposer(force?: boolean): boolean;
62
61
  /** @deprecated Prefer `useInComposer`. Kept for internal AmplifyPageContent. */
63
62
  declare function useComposerPreviewFlag(force?: boolean): boolean;
64
63
 
64
+ /**
65
+ * SDK Components for Slot and Field rendering
66
+ *
67
+ * These components allow developers to explicitly define where slots and fields
68
+ * are rendered in their components, with full control over styling and structure.
69
+ */
70
+
65
71
  /**
66
72
  * Slot Component
67
73
  *
@@ -91,7 +97,7 @@ declare function useComposerPreviewFlag(force?: boolean): boolean;
91
97
  declare function Slot({ name, className }: {
92
98
  name: string;
93
99
  className?: string;
94
- }): react_jsx_runtime.JSX.Element | null;
100
+ }): React__default.JSX.Element | null;
95
101
  type RejectFieldInput<T> = [T] extends [readonly unknown[]] ? never : T extends {
96
102
  readonly [FIELDS_BRAND]: true;
97
103
  } ? never : T;
@@ -126,7 +132,7 @@ declare function Field<T = unknown>(props: {
126
132
  /** Required with `value` for computed values. */
127
133
  name?: string;
128
134
  className?: string;
129
- }): react_jsx_runtime.JSX.Element | null;
135
+ }): React__default.JSX.Element | null;
130
136
  /**
131
137
  * RichText - Renders a markdown (or HTML string) value as formatted HTML.
132
138
  *
@@ -155,7 +161,7 @@ declare function RichText<T = string | null>(props: {
155
161
  as?: keyof JSX.IntrinsicElements;
156
162
  /** String children are treated as the markdown value (same as `value`). */
157
163
  children?: ReactNode;
158
- }): react_jsx_runtime.JSX.Element | null;
164
+ }): React__default.JSX.Element | null;
159
165
  /**
160
166
  * Image — renders a provider-backed image value as `<img>`.
161
167
  *
@@ -178,13 +184,13 @@ declare function Image<T = unknown>(props: {
178
184
  /** Required with `value` for computed values. */
179
185
  name?: string;
180
186
  alt?: string;
181
- } & Omit<react__default.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'name'>): react_jsx_runtime.JSX.Element | null;
187
+ } & Omit<React__default.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'name'>): React__default.JSX.Element | null;
182
188
 
183
189
  /** Tells Slot whether the layout/provider fetch has settled. */
184
190
  declare function ComposerLayoutStatusProvider({ ready, children, }: {
185
191
  ready: boolean;
186
192
  children: ReactNode;
187
- }): react_jsx_runtime.JSX.Element;
193
+ }): React__default.JSX.Element;
188
194
 
189
195
  /** Composer slot lifecycle. Loading ≠ empty. */
190
196
  type SlotState = 'loading' | 'empty' | 'filled';
@@ -202,12 +208,12 @@ declare function ComposerProvider({ children, enabled, }: {
202
208
  children: ReactNode;
203
209
  /** When false, pass through any parent store without creating or wiring one. */
204
210
  enabled?: boolean;
205
- }): react_jsx_runtime.JSX.Element;
211
+ }): React__default.JSX.Element;
206
212
  declare function MaybeComposerProvider({ enabled, layoutNodeId, children, }: {
207
213
  enabled: boolean;
208
214
  layoutNodeId?: string;
209
215
  children: ReactNode;
210
- }): react_jsx_runtime.JSX.Element;
216
+ }): React__default.JSX.Element;
211
217
 
212
218
  interface AmplifyUpContextType {
213
219
  pageConfig: PageConfig | null;
@@ -225,7 +231,7 @@ interface AmplifyUpProviderProps {
225
231
  */
226
232
  pageContext?: AmplifyPageContextInput;
227
233
  }
228
- declare function AmplifyUpProvider({ children, config, pageContext, }: AmplifyUpProviderProps): react_jsx_runtime.JSX.Element;
234
+ declare function AmplifyUpProvider({ children, config, pageContext, }: AmplifyUpProviderProps): React__default.JSX.Element;
229
235
  declare function useAmplifyUp(): AmplifyUpContextType;
230
236
 
231
237
  export { AmplifyContentMeta, AmplifyPageContent, type AmplifyPageContentProps, type AmplifyPageProps, AmplifyUpProvider, ComponentRegistry, ComposerLayoutStatusProvider, ComposerProvider, ContentSource, Field, Field$1 as FieldEnvelope, Image, MaybeComposerProvider, PageConfig, RichText, Slot, type SlotState, bindAmplifyPage, resolveSlotState, slotShowsAddComponent, slotStateFromEl, useAmplifyUp, useComposerPreviewFlag, useInComposer };
package/dist/react.js CHANGED
@@ -437,7 +437,7 @@ function isComposerPreview() {
437
437
  }
438
438
 
439
439
  // src/field-envelope.ts
440
- var FIELDS_BRAND = Symbol("amplifyup.fields");
440
+ var FIELDS_BRAND = /* @__PURE__ */ Symbol("amplifyup.fields");
441
441
  var IDENTIFIER_KEYS = /* @__PURE__ */ new Set([
442
442
  "id",
443
443
  "_id",
@@ -3938,7 +3938,6 @@ function getSDK(adapter) {
3938
3938
  sdkInstance.ensureWindowBridge();
3939
3939
  return sdkInstance;
3940
3940
  }
3941
- var trackContentView = (contentId, contentType, properties) => getSDK().trackContentView(contentId, contentType, properties);
3942
3941
  var refreshEventTracking = () => getSDK().refreshEventTracking();
3943
3942
  getSDK();
3944
3943
  var PageContentRegistryContext = React3.createContext(null);
@@ -4914,14 +4913,14 @@ function Image(props) {
4914
4913
 
4915
4914
  // src/component-key.ts
4916
4915
  var componentKey = (id) => id.toLowerCase().replace(/[^a-z0-9]/g, "");
4917
- var REGISTRY_BRAND = Symbol.for("amplifyup.componentRegistry");
4916
+ var REGISTRY_BRAND = /* @__PURE__ */ Symbol.for("amplifyup.componentRegistry");
4918
4917
  var defineComponentRegistry = (components) => {
4919
4918
  const index = /* @__PURE__ */ new Map();
4920
4919
  for (const [name, component] of Object.entries(components)) {
4921
4920
  const key = componentKey(name);
4922
4921
  if (index.has(key)) {
4923
4922
  throw new Error(
4924
- `[Amplify UP] Component registry has two components named like "${name}". Rebuild it with withAmplifyUp or \`amplifyup registry\`.`
4923
+ `[Amplify UP] Component registry has two components named like "${name}". Rebuild it with withAmplifyUp or \`amplifyup registry\` from @amplifyup/cli.`
4925
4924
  );
4926
4925
  }
4927
4926
  index.set(key, component);
@@ -4993,7 +4992,7 @@ var assertComponentRegistry = (owner, props) => {
4993
4992
  }
4994
4993
  if (!isComponentRegistry(props.registry)) {
4995
4994
  throw new Error(
4996
- `[Amplify UP] ${owner} needs your component registry. Render <AmplifyPage /> from the generated .amplifyup/component-registry module (created by withAmplifyUp or \`amplifyup registry\`).`
4995
+ `[Amplify UP] ${owner} needs your component registry. Render <AmplifyPage /> from the generated .amplifyup/component-registry module (created by withAmplifyUp or \`amplifyup registry\` from @amplifyup/cli).`
4997
4996
  );
4998
4997
  }
4999
4998
  };
@@ -5098,32 +5097,6 @@ function AmplifyRendererInner(rendererProps) {
5098
5097
  const error = serverPageConfig ? null : clientHook.error;
5099
5098
  const contentSource = clientHook.source;
5100
5099
  const [variantCache, setVariantCache] = React3.useState({});
5101
- React3.useEffect(() => {
5102
- if (typeof window !== "undefined") {
5103
- if (window.__AMPLIFYUP_PREVIEW_MODE__ === true) {
5104
- return;
5105
- }
5106
- if (window.location.pathname.includes("/api/pages/proxy")) {
5107
- return;
5108
- }
5109
- if (window.self !== window.top) {
5110
- return;
5111
- }
5112
- const urlParams = new URLSearchParams(window.location.search);
5113
- if (urlParams.get("preview") === "true" || urlParams.get("visualEditor") === "true") {
5114
- return;
5115
- }
5116
- if (window.location.href.includes("preview=true") || window.location.href.includes("visualEditor=true")) {
5117
- return;
5118
- }
5119
- }
5120
- if (pageConfig && pageConfig.id !== "default") {
5121
- trackContentView(pageConfig.id, "page", {
5122
- route: pageConfig.route,
5123
- title: pageConfig.title
5124
- });
5125
- }
5126
- }, [pageConfig]);
5127
5100
  React3.useEffect(() => {
5128
5101
  if (!pageConfig?.eventTracking?.length) return;
5129
5102
  const sdk = getSDK();