@amplifyup/sdk 0.1.32 → 0.1.33

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.
@@ -323,12 +323,17 @@ function resolveAmplifyUpUrls(target) {
323
323
 
324
324
  // src/preview.ts
325
325
  function isPreviewRequest(searchParams) {
326
+ return paramIsTrue(searchParams, "preview") || paramIsTrue(searchParams, "visualEditor");
327
+ }
328
+ function isWorkingContentRequest(searchParams) {
329
+ return paramIsTrue(searchParams, "working");
330
+ }
331
+ function paramIsTrue(searchParams, key) {
326
332
  if (searchParams instanceof URLSearchParams) {
327
- return searchParams.get("preview") === "true" || searchParams.get("visualEditor") === "true";
333
+ return searchParams.get(key) === "true";
328
334
  }
329
- const preview = searchParams.preview;
330
- const visualEditor = searchParams.visualEditor;
331
- return preview === "true" || visualEditor === "true";
335
+ const value = searchParams[key];
336
+ return value === "true" || Array.isArray(value) && value[0] === "true";
332
337
  }
333
338
  function isComposerPreview() {
334
339
  if (typeof window === "undefined") return false;
@@ -1292,6 +1297,9 @@ Available Console Commands:
1292
1297
  });
1293
1298
  if (preview) {
1294
1299
  params.set("preview", "true");
1300
+ if (typeof window !== "undefined" && isWorkingContentRequest(new URLSearchParams(window.location.search))) {
1301
+ params.set("working", "true");
1302
+ }
1295
1303
  }
1296
1304
  if (isOnOrchestratorOrigin) {
1297
1305
  return `/api/layout/provider?${params.toString()}`;