@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.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { P as PageConfig, C as ContentSource, A as AmplifyContentMeta, E as EventTrackingConfig$1, a as CDPAdapter, b as AmplifyUpConfig, c as EventProperties, I as IdentifyInput, d as IdentifyTraits, e as ProfileFieldsInput, f as AmplifyUpTarget } from './types-npF_lNoq.mjs';
2
2
  export { Z as ZoneConfig, i as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, g as resolveAmplifyUpUrls } from './types-npF_lNoq.mjs';
3
- export { i as isComposerPreview, a as isPreviewRequest } from './preview-BMrIgUvp.mjs';
3
+ export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.mjs';
4
4
 
5
5
  interface FetchContentResult {
6
6
  pageConfig: PageConfig | null;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { P as PageConfig, C as ContentSource, A as AmplifyContentMeta, E as EventTrackingConfig$1, a as CDPAdapter, b as AmplifyUpConfig, c as EventProperties, I as IdentifyInput, d as IdentifyTraits, e as ProfileFieldsInput, f as AmplifyUpTarget } from './types-npF_lNoq.js';
2
2
  export { Z as ZoneConfig, i as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, g as resolveAmplifyUpUrls } from './types-npF_lNoq.js';
3
- export { i as isComposerPreview, a as isPreviewRequest } from './preview-BMrIgUvp.js';
3
+ export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.js';
4
4
 
5
5
  interface FetchContentResult {
6
6
  pageConfig: PageConfig | null;
package/dist/index.js CHANGED
@@ -316,12 +316,17 @@ function resolveAmplifyUpUrls(target) {
316
316
 
317
317
  // src/preview.ts
318
318
  function isPreviewRequest(searchParams) {
319
+ return paramIsTrue(searchParams, "preview") || paramIsTrue(searchParams, "visualEditor");
320
+ }
321
+ function isWorkingContentRequest(searchParams) {
322
+ return paramIsTrue(searchParams, "working");
323
+ }
324
+ function paramIsTrue(searchParams, key) {
319
325
  if (searchParams instanceof URLSearchParams) {
320
- return searchParams.get("preview") === "true" || searchParams.get("visualEditor") === "true";
326
+ return searchParams.get(key) === "true";
321
327
  }
322
- const preview = searchParams.preview;
323
- const visualEditor = searchParams.visualEditor;
324
- return preview === "true" || visualEditor === "true";
328
+ const value = searchParams[key];
329
+ return value === "true" || Array.isArray(value) && value[0] === "true";
325
330
  }
326
331
  function isComposerPreview() {
327
332
  if (typeof window === "undefined") return false;
@@ -1457,6 +1462,9 @@ Available Console Commands:
1457
1462
  });
1458
1463
  if (preview) {
1459
1464
  params.set("preview", "true");
1465
+ if (typeof window !== "undefined" && isWorkingContentRequest(new URLSearchParams(window.location.search))) {
1466
+ params.set("working", "true");
1467
+ }
1460
1468
  }
1461
1469
  if (isOnOrchestratorOrigin) {
1462
1470
  return `/api/layout/provider?${params.toString()}`;
@@ -2860,6 +2868,7 @@ exports.init = init;
2860
2868
  exports.isAmplifyUpTarget = isAmplifyUpTarget;
2861
2869
  exports.isComposerPreview = isComposerPreview;
2862
2870
  exports.isPreviewRequest = isPreviewRequest;
2871
+ exports.isWorkingContentRequest = isWorkingContentRequest;
2863
2872
  exports.mapResolvedToPageConfig = mapResolvedToPageConfig;
2864
2873
  exports.normalizeAmplifyUpTarget = normalizeAmplifyUpTarget;
2865
2874
  exports.normalizeRoute = normalizeRoute;