@amplifyup/sdk 0.1.42 → 0.1.43

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/react.mjs CHANGED
@@ -1704,8 +1704,15 @@ Available Console Commands:
1704
1704
  });
1705
1705
  if (preview) {
1706
1706
  params.set("preview", "true");
1707
- if (typeof window !== "undefined" && isWorkingContentRequest(new URLSearchParams(window.location.search))) {
1708
- params.set("working", "true");
1707
+ if (typeof window !== "undefined") {
1708
+ const pageSearch = new URLSearchParams(window.location.search);
1709
+ if (isWorkingContentRequest(pageSearch)) {
1710
+ params.set("working", "true");
1711
+ }
1712
+ const zoneId = pageSearch.get("zoneId");
1713
+ const compositionId = pageSearch.get("compositionId");
1714
+ if (zoneId) params.set("zoneId", zoneId);
1715
+ if (compositionId) params.set("compositionId", compositionId);
1709
1716
  }
1710
1717
  }
1711
1718
  if (isOnOrchestratorOrigin) {
@@ -4279,6 +4286,17 @@ async function fetchPageConfigServer(route, trackingId, preview = false, options
4279
4286
  });
4280
4287
  if (isPreview) params.set("preview", "true");
4281
4288
  if (workingFlag) params.set("working", "true");
4289
+ if (options?.searchParams) {
4290
+ const sp = options.searchParams instanceof URLSearchParams ? options.searchParams : new URLSearchParams(
4291
+ Object.entries(options.searchParams).flatMap(
4292
+ ([k, v]) => v == null ? [] : Array.isArray(v) ? v.map((item) => [k, item]) : [[k, v]]
4293
+ )
4294
+ );
4295
+ const zoneId = sp.get("zoneId");
4296
+ const compositionId = sp.get("compositionId");
4297
+ if (zoneId) params.set("zoneId", zoneId);
4298
+ if (compositionId) params.set("compositionId", compositionId);
4299
+ }
4282
4300
  const url = `${orchestratorUrl}/api/layout/provider?${params.toString()}`;
4283
4301
  try {
4284
4302
  const res = await fetch(url, {