@amplifyup/sdk 0.1.75 → 0.1.77
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/dist/AmplifyRenderer.js +135 -113
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +136 -114
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.js +121 -97
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +121 -97
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +3 -1
- package/dist/react.d.ts +3 -1
- package/dist/react.js +144 -120
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +145 -121
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.d.mts
CHANGED
|
@@ -200,8 +200,10 @@ declare function slotStateFromEl(el: {
|
|
|
200
200
|
getAttribute: (name: string) => string | null;
|
|
201
201
|
} | null | undefined): SlotState | null;
|
|
202
202
|
|
|
203
|
-
declare function ComposerProvider({ children, }: {
|
|
203
|
+
declare function ComposerProvider({ children, enabled, }: {
|
|
204
204
|
children: ReactNode;
|
|
205
|
+
/** When false, pass through any parent store without creating or wiring one. */
|
|
206
|
+
enabled?: boolean;
|
|
205
207
|
}): react_jsx_runtime.JSX.Element;
|
|
206
208
|
declare function MaybeComposerProvider({ enabled, layoutNodeId, children, }: {
|
|
207
209
|
enabled: boolean;
|
package/dist/react.d.ts
CHANGED
|
@@ -200,8 +200,10 @@ declare function slotStateFromEl(el: {
|
|
|
200
200
|
getAttribute: (name: string) => string | null;
|
|
201
201
|
} | null | undefined): SlotState | null;
|
|
202
202
|
|
|
203
|
-
declare function ComposerProvider({ children, }: {
|
|
203
|
+
declare function ComposerProvider({ children, enabled, }: {
|
|
204
204
|
children: ReactNode;
|
|
205
|
+
/** When false, pass through any parent store without creating or wiring one. */
|
|
206
|
+
enabled?: boolean;
|
|
205
207
|
}): react_jsx_runtime.JSX.Element;
|
|
206
208
|
declare function MaybeComposerProvider({ enabled, layoutNodeId, children, }: {
|
|
207
209
|
enabled: boolean;
|
package/dist/react.js
CHANGED
|
@@ -17,7 +17,121 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
17
17
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
// src/storage.ts
|
|
21
|
+
var INSTANCE_ID_KEY = "amplifyup_instance_id";
|
|
22
|
+
var USER_ID_KEY = "amplifyup_user_id";
|
|
23
|
+
var SESSION_ID_KEY = "amplifyup_session_id";
|
|
24
|
+
var SESSION_ACTIVITY_KEY = "amplifyup_session_activity";
|
|
25
|
+
var VISITOR_FIRST_SEEN_KEY = "amplifyup_visitor_first_seen";
|
|
26
|
+
var ANON_COOKIE_NAME = "amplifyup_anon_id";
|
|
27
|
+
var SESSION_COOKIE_NAME = "amplifyup_session_id";
|
|
28
|
+
var SESSION_IDLE_GAP_MS = 30 * 60 * 1e3;
|
|
29
|
+
function generateGuid() {
|
|
30
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
31
|
+
return crypto.randomUUID();
|
|
32
|
+
}
|
|
33
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
34
|
+
const r = Math.random() * 16 | 0;
|
|
35
|
+
const v = c === "x" ? r : r & 3 | 8;
|
|
36
|
+
return v.toString(16);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function readCookie(name) {
|
|
40
|
+
if (typeof document === "undefined") return null;
|
|
41
|
+
const parts = document.cookie.split(";");
|
|
42
|
+
for (const part of parts) {
|
|
43
|
+
const idx = part.indexOf("=");
|
|
44
|
+
if (idx === -1) continue;
|
|
45
|
+
if (part.slice(0, idx).trim() !== name) continue;
|
|
46
|
+
const value = part.slice(idx + 1).trim();
|
|
47
|
+
try {
|
|
48
|
+
return value ? decodeURIComponent(value) : null;
|
|
49
|
+
} catch {
|
|
50
|
+
return value || null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function writeCookie(name, value, maxAgeSeconds = 31536e3) {
|
|
56
|
+
if (typeof document === "undefined") return;
|
|
57
|
+
document.cookie = `${name}=${encodeURIComponent(value)}; Path=/; Max-Age=${maxAgeSeconds}; SameSite=Lax`;
|
|
58
|
+
}
|
|
59
|
+
function getInstanceId() {
|
|
60
|
+
if (typeof window === "undefined") {
|
|
61
|
+
return "";
|
|
62
|
+
}
|
|
63
|
+
const fromCookie = readCookie(ANON_COOKIE_NAME);
|
|
64
|
+
const fromLs = localStorage.getItem(INSTANCE_ID_KEY);
|
|
65
|
+
const instanceId = fromLs || fromCookie || `browser_${generateGuid()}`;
|
|
66
|
+
if (fromLs !== instanceId) {
|
|
67
|
+
localStorage.setItem(INSTANCE_ID_KEY, instanceId);
|
|
68
|
+
}
|
|
69
|
+
if (fromCookie !== instanceId) {
|
|
70
|
+
writeCookie(ANON_COOKIE_NAME, instanceId);
|
|
71
|
+
}
|
|
72
|
+
return instanceId;
|
|
73
|
+
}
|
|
74
|
+
function getUserId() {
|
|
75
|
+
if (typeof window === "undefined") {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return localStorage.getItem(USER_ID_KEY);
|
|
79
|
+
}
|
|
80
|
+
function getSessionId() {
|
|
81
|
+
if (typeof window === "undefined") {
|
|
82
|
+
return "";
|
|
83
|
+
}
|
|
84
|
+
const now = Date.now();
|
|
85
|
+
const lastActivity = Number(localStorage.getItem(SESSION_ACTIVITY_KEY) || 0);
|
|
86
|
+
const fromCookie = readCookie(SESSION_COOKIE_NAME);
|
|
87
|
+
const fromLs = localStorage.getItem(SESSION_ID_KEY);
|
|
88
|
+
let sessionId = fromLs || fromCookie || "";
|
|
89
|
+
if (!sessionId || lastActivity > 0 && now - lastActivity >= SESSION_IDLE_GAP_MS) {
|
|
90
|
+
sessionId = generateGuid();
|
|
91
|
+
}
|
|
92
|
+
localStorage.setItem(SESSION_ID_KEY, sessionId);
|
|
93
|
+
localStorage.setItem(SESSION_ACTIVITY_KEY, String(now));
|
|
94
|
+
writeCookie(SESSION_COOKIE_NAME, sessionId, Math.floor(SESSION_IDLE_GAP_MS / 1e3));
|
|
95
|
+
return sessionId;
|
|
96
|
+
}
|
|
97
|
+
function getVisitorFirstSeenAt() {
|
|
98
|
+
if (typeof window === "undefined") {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const existing = localStorage.getItem(VISITOR_FIRST_SEEN_KEY);
|
|
103
|
+
if (existing) return existing;
|
|
104
|
+
const firstSeenAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
105
|
+
localStorage.setItem(VISITOR_FIRST_SEEN_KEY, firstSeenAt);
|
|
106
|
+
return firstSeenAt;
|
|
107
|
+
} catch {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function setUserId(userId) {
|
|
112
|
+
if (typeof window === "undefined") {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
localStorage.setItem(USER_ID_KEY, userId);
|
|
116
|
+
}
|
|
117
|
+
function clearIds() {
|
|
118
|
+
if (typeof window === "undefined") {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
localStorage.removeItem(INSTANCE_ID_KEY);
|
|
122
|
+
localStorage.removeItem(USER_ID_KEY);
|
|
123
|
+
localStorage.removeItem(SESSION_ID_KEY);
|
|
124
|
+
localStorage.removeItem(SESSION_ACTIVITY_KEY);
|
|
125
|
+
localStorage.removeItem(VISITOR_FIRST_SEEN_KEY);
|
|
126
|
+
document.cookie = `${ANON_COOKIE_NAME}=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
127
|
+
document.cookie = `${SESSION_COOKIE_NAME}=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
128
|
+
}
|
|
129
|
+
|
|
20
130
|
// src/adapters/aws.ts
|
|
131
|
+
function visitorContext() {
|
|
132
|
+
const firstSeenAt = getVisitorFirstSeenAt();
|
|
133
|
+
return firstSeenAt ? { firstSeenAt } : void 0;
|
|
134
|
+
}
|
|
21
135
|
var AWSAdapter = class {
|
|
22
136
|
constructor() {
|
|
23
137
|
this.initialized = false;
|
|
@@ -57,7 +171,9 @@ var AWSAdapter = class {
|
|
|
57
171
|
console.warn("AmplifyUp SDK: AWS configuration missing");
|
|
58
172
|
return;
|
|
59
173
|
}
|
|
60
|
-
const
|
|
174
|
+
const trackingId = eventData?.trackingId || this.config?.trackingId;
|
|
175
|
+
const query = trackingId ? `?tid=${encodeURIComponent(trackingId)}` : "";
|
|
176
|
+
const url = `${this.apiGatewayUrl}${endpoint}${query}`;
|
|
61
177
|
try {
|
|
62
178
|
const response = await fetch(url, {
|
|
63
179
|
method: "POST",
|
|
@@ -119,7 +235,8 @@ var AWSAdapter = class {
|
|
|
119
235
|
page: {
|
|
120
236
|
path: properties.path || properties.url,
|
|
121
237
|
referrer: properties.referrer
|
|
122
|
-
}
|
|
238
|
+
},
|
|
239
|
+
visitor: visitorContext()
|
|
123
240
|
},
|
|
124
241
|
timestamp: properties.timestamp || (/* @__PURE__ */ new Date()).toISOString()
|
|
125
242
|
};
|
|
@@ -157,7 +274,8 @@ var AWSAdapter = class {
|
|
|
157
274
|
...properties
|
|
158
275
|
},
|
|
159
276
|
context: {
|
|
160
|
-
url: properties.url || (typeof window !== "undefined" ? window.location.href : "")
|
|
277
|
+
url: properties.url || (typeof window !== "undefined" ? window.location.href : ""),
|
|
278
|
+
visitor: visitorContext()
|
|
161
279
|
},
|
|
162
280
|
timestamp: properties.timestamp || (/* @__PURE__ */ new Date()).toISOString()
|
|
163
281
|
};
|
|
@@ -213,100 +331,6 @@ var AWSAdapter = class {
|
|
|
213
331
|
}
|
|
214
332
|
};
|
|
215
333
|
|
|
216
|
-
// src/storage.ts
|
|
217
|
-
var INSTANCE_ID_KEY = "amplifyup_instance_id";
|
|
218
|
-
var USER_ID_KEY = "amplifyup_user_id";
|
|
219
|
-
var SESSION_ID_KEY = "amplifyup_session_id";
|
|
220
|
-
var SESSION_ACTIVITY_KEY = "amplifyup_session_activity";
|
|
221
|
-
var ANON_COOKIE_NAME = "amplifyup_anon_id";
|
|
222
|
-
var SESSION_COOKIE_NAME = "amplifyup_session_id";
|
|
223
|
-
var SESSION_IDLE_GAP_MS = 30 * 60 * 1e3;
|
|
224
|
-
function generateGuid() {
|
|
225
|
-
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
226
|
-
return crypto.randomUUID();
|
|
227
|
-
}
|
|
228
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
229
|
-
const r = Math.random() * 16 | 0;
|
|
230
|
-
const v = c === "x" ? r : r & 3 | 8;
|
|
231
|
-
return v.toString(16);
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
function readCookie(name) {
|
|
235
|
-
if (typeof document === "undefined") return null;
|
|
236
|
-
const parts = document.cookie.split(";");
|
|
237
|
-
for (const part of parts) {
|
|
238
|
-
const idx = part.indexOf("=");
|
|
239
|
-
if (idx === -1) continue;
|
|
240
|
-
if (part.slice(0, idx).trim() !== name) continue;
|
|
241
|
-
const value = part.slice(idx + 1).trim();
|
|
242
|
-
try {
|
|
243
|
-
return value ? decodeURIComponent(value) : null;
|
|
244
|
-
} catch {
|
|
245
|
-
return value || null;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
function writeCookie(name, value, maxAgeSeconds = 31536e3) {
|
|
251
|
-
if (typeof document === "undefined") return;
|
|
252
|
-
document.cookie = `${name}=${encodeURIComponent(value)}; Path=/; Max-Age=${maxAgeSeconds}; SameSite=Lax`;
|
|
253
|
-
}
|
|
254
|
-
function getInstanceId() {
|
|
255
|
-
if (typeof window === "undefined") {
|
|
256
|
-
return "";
|
|
257
|
-
}
|
|
258
|
-
const fromCookie = readCookie(ANON_COOKIE_NAME);
|
|
259
|
-
const fromLs = localStorage.getItem(INSTANCE_ID_KEY);
|
|
260
|
-
const instanceId = fromLs || fromCookie || `browser_${generateGuid()}`;
|
|
261
|
-
if (fromLs !== instanceId) {
|
|
262
|
-
localStorage.setItem(INSTANCE_ID_KEY, instanceId);
|
|
263
|
-
}
|
|
264
|
-
if (fromCookie !== instanceId) {
|
|
265
|
-
writeCookie(ANON_COOKIE_NAME, instanceId);
|
|
266
|
-
}
|
|
267
|
-
return instanceId;
|
|
268
|
-
}
|
|
269
|
-
function getUserId() {
|
|
270
|
-
if (typeof window === "undefined") {
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
273
|
-
return localStorage.getItem(USER_ID_KEY);
|
|
274
|
-
}
|
|
275
|
-
function getSessionId() {
|
|
276
|
-
if (typeof window === "undefined") {
|
|
277
|
-
return "";
|
|
278
|
-
}
|
|
279
|
-
const now = Date.now();
|
|
280
|
-
const lastActivity = Number(localStorage.getItem(SESSION_ACTIVITY_KEY) || 0);
|
|
281
|
-
const fromCookie = readCookie(SESSION_COOKIE_NAME);
|
|
282
|
-
const fromLs = localStorage.getItem(SESSION_ID_KEY);
|
|
283
|
-
let sessionId = fromLs || fromCookie || "";
|
|
284
|
-
if (!sessionId || lastActivity > 0 && now - lastActivity >= SESSION_IDLE_GAP_MS) {
|
|
285
|
-
sessionId = generateGuid();
|
|
286
|
-
}
|
|
287
|
-
localStorage.setItem(SESSION_ID_KEY, sessionId);
|
|
288
|
-
localStorage.setItem(SESSION_ACTIVITY_KEY, String(now));
|
|
289
|
-
writeCookie(SESSION_COOKIE_NAME, sessionId, Math.floor(SESSION_IDLE_GAP_MS / 1e3));
|
|
290
|
-
return sessionId;
|
|
291
|
-
}
|
|
292
|
-
function setUserId(userId) {
|
|
293
|
-
if (typeof window === "undefined") {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
localStorage.setItem(USER_ID_KEY, userId);
|
|
297
|
-
}
|
|
298
|
-
function clearIds() {
|
|
299
|
-
if (typeof window === "undefined") {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
localStorage.removeItem(INSTANCE_ID_KEY);
|
|
303
|
-
localStorage.removeItem(USER_ID_KEY);
|
|
304
|
-
localStorage.removeItem(SESSION_ID_KEY);
|
|
305
|
-
localStorage.removeItem(SESSION_ACTIVITY_KEY);
|
|
306
|
-
document.cookie = `${ANON_COOKIE_NAME}=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
307
|
-
document.cookie = `${SESSION_COOKIE_NAME}=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
334
|
// src/targets.ts
|
|
311
335
|
var AWS_DEV_API = "https://api-dev.amplifyup.ai";
|
|
312
336
|
var AWS_PROD_API = "https://api.amplifyup.ai";
|
|
@@ -1071,9 +1095,8 @@ function dedupeLayoutProviderFetch(key, fetchFn) {
|
|
|
1071
1095
|
return pending;
|
|
1072
1096
|
}
|
|
1073
1097
|
function previewLayoutReady(opts) {
|
|
1074
|
-
if (opts.hasClientLayout) return true;
|
|
1075
|
-
|
|
1076
|
-
return true;
|
|
1098
|
+
if (opts.hasClientLayout || opts.hasServerLayout) return true;
|
|
1099
|
+
return !opts.clientLoading;
|
|
1077
1100
|
}
|
|
1078
1101
|
|
|
1079
1102
|
// src/edge/variantKeys.ts
|
|
@@ -3992,14 +4015,16 @@ function applyComposerPatch(store, name, value, ref, layoutNodeId) {
|
|
|
3992
4015
|
store.set(composerStoreKey(name, ref, layoutNodeId), value);
|
|
3993
4016
|
}
|
|
3994
4017
|
function ComposerProvider({
|
|
3995
|
-
children
|
|
4018
|
+
children,
|
|
4019
|
+
enabled = true
|
|
3996
4020
|
}) {
|
|
3997
4021
|
const existing = React3.useContext(ComposerStoreContext);
|
|
3998
4022
|
const storeRef = React3.useRef(null);
|
|
3999
4023
|
if (!storeRef.current) storeRef.current = new ComposerFieldStore();
|
|
4000
|
-
const
|
|
4024
|
+
const ownsStore = !existing && enabled;
|
|
4025
|
+
const store = existing || (enabled ? storeRef.current : null);
|
|
4001
4026
|
React3.useEffect(() => {
|
|
4002
|
-
if (
|
|
4027
|
+
if (!ownsStore || !store) return;
|
|
4003
4028
|
const applyField = (fieldName, value, nodeId, ref) => {
|
|
4004
4029
|
if (!fieldName || typeof fieldName !== "string") return;
|
|
4005
4030
|
const fieldRef = isFieldRef(ref) ? ref : void 0;
|
|
@@ -4057,8 +4082,7 @@ function ComposerProvider({
|
|
|
4057
4082
|
window.removeEventListener("amplifyup:props-patch", onPropsPatch);
|
|
4058
4083
|
window.removeEventListener("message", onMessage);
|
|
4059
4084
|
};
|
|
4060
|
-
}, [
|
|
4061
|
-
if (existing) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
4085
|
+
}, [ownsStore, store]);
|
|
4062
4086
|
return /* @__PURE__ */ jsxRuntime.jsx(ComposerStoreContext.Provider, { value: store, children });
|
|
4063
4087
|
}
|
|
4064
4088
|
function useComposerFieldValue(name, fallback, ref) {
|
|
@@ -4085,9 +4109,7 @@ function MaybeComposerProvider({
|
|
|
4085
4109
|
layoutNodeId,
|
|
4086
4110
|
children
|
|
4087
4111
|
}) {
|
|
4088
|
-
|
|
4089
|
-
if (!enabled) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: content });
|
|
4090
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ComposerProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(ComposerNodeContext.Provider, { value: layoutNodeId, children }) });
|
|
4112
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComposerProvider, { enabled, children: /* @__PURE__ */ jsxRuntime.jsx(ComposerNodeContext.Provider, { value: enabled ? layoutNodeId : void 0, children }) });
|
|
4091
4113
|
}
|
|
4092
4114
|
function nodeRenderProps(node) {
|
|
4093
4115
|
const settings = node.settings || {};
|
|
@@ -4520,17 +4542,16 @@ function AmplifyRendererInner({
|
|
|
4520
4542
|
if (layoutTree.length === 0) {
|
|
4521
4543
|
return /* @__PURE__ */ jsxRuntime.jsx("main", { children: emptyComponent || /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-16", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "No content configured for this page." }) }) });
|
|
4522
4544
|
}
|
|
4523
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ComposerProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4524
|
-
"
|
|
4545
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComposerProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4546
|
+
"main",
|
|
4525
4547
|
{
|
|
4526
|
-
"data-slot-id": "main",
|
|
4527
|
-
"data-amplifyup-slot": "main",
|
|
4528
|
-
"data-slot-source": "page",
|
|
4529
|
-
"data-slot-state":
|
|
4530
|
-
"data-slot-empty": layoutTree.length === 0 ? "true" : void 0,
|
|
4548
|
+
"data-slot-id": composerPreviewFlag ? "main" : void 0,
|
|
4549
|
+
"data-amplifyup-slot": composerPreviewFlag ? "main" : void 0,
|
|
4550
|
+
"data-slot-source": composerPreviewFlag ? "page" : void 0,
|
|
4551
|
+
"data-slot-state": composerPreviewFlag ? "filled" : void 0,
|
|
4531
4552
|
children: layoutTree.map((node) => /* @__PURE__ */ jsxRuntime.jsx(React3.Fragment, { children: renderNode(node) }, node.id))
|
|
4532
4553
|
}
|
|
4533
|
-
)
|
|
4554
|
+
) });
|
|
4534
4555
|
}
|
|
4535
4556
|
var AmplifyRenderer = React3.memo(AmplifyRendererInner);
|
|
4536
4557
|
function AddComponentIcon({ size = 28 }) {
|
|
@@ -4706,11 +4727,14 @@ function AmplifyPageContent({
|
|
|
4706
4727
|
if (preview) {
|
|
4707
4728
|
const ready = previewLayoutReady({
|
|
4708
4729
|
clientLoading: client.loading,
|
|
4709
|
-
hasClientLayout: !!clientLayout
|
|
4730
|
+
hasClientLayout: !!clientLayout,
|
|
4731
|
+
hasServerLayout: !!serverLayout
|
|
4732
|
+
});
|
|
4710
4733
|
if (!ready) {
|
|
4711
4734
|
return /* @__PURE__ */ jsxRuntime.jsx(ComposerLayoutStatusProvider, { ready: false, children: previewLoading });
|
|
4712
4735
|
}
|
|
4713
|
-
|
|
4736
|
+
const layoutSettled = !client.loading || !!clientLayout;
|
|
4737
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComposerLayoutStatusProvider, { ready: layoutSettled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4714
4738
|
AmplifyRenderer,
|
|
4715
4739
|
{
|
|
4716
4740
|
pageConfig: pageConfig ?? void 0,
|
|
@@ -4732,7 +4756,7 @@ function AmplifyPageContent({
|
|
|
4732
4756
|
if (!hasAmplifyLayout(pageConfig)) {
|
|
4733
4757
|
return fallback ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback }) : null;
|
|
4734
4758
|
}
|
|
4735
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4759
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComposerLayoutStatusProvider, { ready: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4736
4760
|
AmplifyRenderer,
|
|
4737
4761
|
{
|
|
4738
4762
|
pageConfig: pageConfig ?? void 0,
|
|
@@ -4741,7 +4765,7 @@ function AmplifyPageContent({
|
|
|
4741
4765
|
emptyComponent,
|
|
4742
4766
|
errorComponent
|
|
4743
4767
|
}
|
|
4744
|
-
);
|
|
4768
|
+
) });
|
|
4745
4769
|
}
|
|
4746
4770
|
|
|
4747
4771
|
// src/slot-state.ts
|