@amplifyup/sdk 0.1.44 → 0.1.45

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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { P as PageConfig } from './types-BjlTE_cW.mjs';
3
+ import { P as PageConfig } from './types-NdLzHxZo.mjs';
4
4
 
5
5
  interface AmplifyRendererProps {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { P as PageConfig } from './types-BjlTE_cW.js';
3
+ import { P as PageConfig } from './types-NdLzHxZo.js';
4
4
 
5
5
  interface AmplifyRendererProps {
6
6
  /**
@@ -464,14 +464,14 @@ function applyPageContext(input, opts) {
464
464
  log.warn("AmplifyUp: pageContext needs resourceType and key");
465
465
  return null;
466
466
  }
467
- const slot = opts.pageData?.slots?.[0];
468
- if (slot && slot.type && slot.type !== input.resourceType) {
467
+ const resource = opts.pageData?.resources?.[0];
468
+ if (resource && resource.type && resource.type !== input.resourceType) {
469
469
  log.warn(
470
- `AmplifyUp: pageContext resourceType "${input.resourceType}" does not match page slot "${slot.type}"`
470
+ `AmplifyUp: pageContext resourceType "${input.resourceType}" does not match page resource "${resource.type}"`
471
471
  );
472
472
  return null;
473
473
  }
474
- const fieldDefs = slot?.fields || [];
474
+ const fieldDefs = resource?.fields || [];
475
475
  const defByKey = new Map(fieldDefs.map((f) => [f.key, f]));
476
476
  const rawFields = input.fields && typeof input.fields === "object" ? input.fields : {};
477
477
  const fields = {};
@@ -489,7 +489,7 @@ function applyPageContext(input, opts) {
489
489
  }
490
490
  }
491
491
  const params = { ...opts.routeParams || {} };
492
- const mapping = slot?.urlParamMapping;
492
+ const mapping = resource?.urlParamMapping;
493
493
  let resourceKey = key;
494
494
  if (mapping) {
495
495
  const fromUrl = params[mapping.param];
@@ -507,7 +507,7 @@ function applyPageContext(input, opts) {
507
507
  if (pf.value !== void 0) pageFields[pf.key] = pf.value;
508
508
  continue;
509
509
  }
510
- if (pf.source === "mapped" && pf.slot && pf.field) {
510
+ if (pf.source === "mapped" && pf.resource && pf.field) {
511
511
  pageFields[pf.key] = fields[pf.field];
512
512
  }
513
513
  }
@@ -551,7 +551,7 @@ function mergeEventContext(properties, attached) {
551
551
  ...attached.pageRoute ? { pageRoute: attached.pageRoute } : {}
552
552
  };
553
553
  }
554
- function setPageSlotFields(fields) {
554
+ function setPageResourceFields(fields) {
555
555
  }
556
556
 
557
557
  // src/index.ts
@@ -1184,7 +1184,7 @@ var AmplifyUpSDK = class {
1184
1184
  routeParams: this.resolvedRouteParams,
1185
1185
  pageRoute: this.resolvedPageRoute
1186
1186
  });
1187
- setPageSlotFields(this.attachedPageContext?.resource?.fields || null);
1187
+ setPageResourceFields(this.attachedPageContext?.resource?.fields || null);
1188
1188
  }
1189
1189
  getAttachedPageContext() {
1190
1190
  return this.attachedPageContext;