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