@amplifyup/sdk 0.2.3 → 0.2.5

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
@@ -431,7 +431,7 @@ function isComposerPreview() {
431
431
  }
432
432
 
433
433
  // src/field-envelope.ts
434
- var FIELDS_BRAND = Symbol("amplifyup.fields");
434
+ var FIELDS_BRAND = /* @__PURE__ */ Symbol("amplifyup.fields");
435
435
  var IDENTIFIER_KEYS = /* @__PURE__ */ new Set([
436
436
  "id",
437
437
  "_id",
@@ -3932,7 +3932,6 @@ function getSDK(adapter) {
3932
3932
  sdkInstance.ensureWindowBridge();
3933
3933
  return sdkInstance;
3934
3934
  }
3935
- var trackContentView = (contentId, contentType, properties) => getSDK().trackContentView(contentId, contentType, properties);
3936
3935
  var refreshEventTracking = () => getSDK().refreshEventTracking();
3937
3936
  getSDK();
3938
3937
  var PageContentRegistryContext = createContext(null);
@@ -4908,7 +4907,7 @@ function Image(props) {
4908
4907
 
4909
4908
  // src/component-key.ts
4910
4909
  var componentKey = (id) => id.toLowerCase().replace(/[^a-z0-9]/g, "");
4911
- var REGISTRY_BRAND = Symbol.for("amplifyup.componentRegistry");
4910
+ var REGISTRY_BRAND = /* @__PURE__ */ Symbol.for("amplifyup.componentRegistry");
4912
4911
  var defineComponentRegistry = (components) => {
4913
4912
  const index = /* @__PURE__ */ new Map();
4914
4913
  for (const [name, component] of Object.entries(components)) {
@@ -5092,32 +5091,6 @@ function AmplifyRendererInner(rendererProps) {
5092
5091
  const error = serverPageConfig ? null : clientHook.error;
5093
5092
  const contentSource = clientHook.source;
5094
5093
  const [variantCache, setVariantCache] = useState({});
5095
- useEffect(() => {
5096
- if (typeof window !== "undefined") {
5097
- if (window.__AMPLIFYUP_PREVIEW_MODE__ === true) {
5098
- return;
5099
- }
5100
- if (window.location.pathname.includes("/api/pages/proxy")) {
5101
- return;
5102
- }
5103
- if (window.self !== window.top) {
5104
- return;
5105
- }
5106
- const urlParams = new URLSearchParams(window.location.search);
5107
- if (urlParams.get("preview") === "true" || urlParams.get("visualEditor") === "true") {
5108
- return;
5109
- }
5110
- if (window.location.href.includes("preview=true") || window.location.href.includes("visualEditor=true")) {
5111
- return;
5112
- }
5113
- }
5114
- if (pageConfig && pageConfig.id !== "default") {
5115
- trackContentView(pageConfig.id, "page", {
5116
- route: pageConfig.route,
5117
- title: pageConfig.title
5118
- });
5119
- }
5120
- }, [pageConfig]);
5121
5094
  useEffect(() => {
5122
5095
  if (!pageConfig?.eventTracking?.length) return;
5123
5096
  const sdk = getSDK();
@@ -5522,6 +5495,9 @@ function AmplifyPageContent(contentProps) {
5522
5495
  return /* @__PURE__ */ jsx(ComposerLayoutStatusProvider, { ready: false, children: previewLoading });
5523
5496
  }
5524
5497
  const layoutSettled = !client.loading || !!clientLayout;
5498
+ if (!pageConfig) {
5499
+ return /* @__PURE__ */ jsx(ComposerLayoutStatusProvider, { ready: layoutSettled, children: previewEmpty });
5500
+ }
5525
5501
  return /* @__PURE__ */ jsx(ComposerLayoutStatusProvider, { ready: layoutSettled, children: /* @__PURE__ */ jsx(
5526
5502
  AmplifyRenderer,
5527
5503
  {