@amplifyup/sdk 0.1.73 → 0.1.74
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/AmplifyRenderer.d.mts +1 -1
- package/dist/AmplifyRenderer.d.ts +1 -1
- package/dist/AmplifyRenderer.js +22 -10
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +22 -10
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +24 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{query-Hay-oVYp.d.ts → query-NcrxJQvI.d.ts} +1 -1
- package/dist/{query-B_DU7yEm.d.mts → query-_SMo6VRf.d.mts} +1 -1
- package/dist/react.d.mts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +26 -12
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +26 -12
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +2 -1
- package/dist/server.mjs.map +1 -1
- package/dist/{types-CGeBbx84.d.mts → types-BGZYaFxP.d.mts} +16 -1
- package/dist/{types-CGeBbx84.d.ts → types-BGZYaFxP.d.ts} +16 -1
- package/package.json +1 -1
package/dist/react.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { L as LayoutComponentProps, P as PageConfig, F as Field$1, l as FIELDS_BRAND, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-
|
|
3
|
-
export { w as FieldRef, x as Fields, z as ImageValue, y as ListRow, B as PortableRef, Z as ZoneConfig, m as attachFieldEnvelopes, p as composerStoreKey, o as envelopeListRows, v as isBrandedFields, s as isFieldEnvelope, u as isReadOnlyRowField, q as listOwnerFromSpec, t as toFieldEnvelopes } from './types-
|
|
2
|
+
import { L as LayoutComponentProps, P as PageConfig, F as Field$1, l as FIELDS_BRAND, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-BGZYaFxP.mjs';
|
|
3
|
+
export { w as FieldRef, x as Fields, z as ImageValue, y as ListRow, B as PortableRef, Z as ZoneConfig, m as attachFieldEnvelopes, p as composerStoreKey, o as envelopeListRows, v as isBrandedFields, s as isFieldEnvelope, u as isReadOnlyRowField, q as listOwnerFromSpec, t as toFieldEnvelopes } from './types-BGZYaFxP.mjs';
|
|
4
4
|
import react__default, { ReactNode } from 'react';
|
|
5
5
|
export { AmplifyRenderer } from './AmplifyRenderer.mjs';
|
|
6
|
-
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-
|
|
6
|
+
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-_SMo6VRf.mjs';
|
|
7
7
|
export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.mjs';
|
|
8
8
|
|
|
9
9
|
type RenderComponentContext = {
|
package/dist/react.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { L as LayoutComponentProps, P as PageConfig, F as Field$1, l as FIELDS_BRAND, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-
|
|
3
|
-
export { w as FieldRef, x as Fields, z as ImageValue, y as ListRow, B as PortableRef, Z as ZoneConfig, m as attachFieldEnvelopes, p as composerStoreKey, o as envelopeListRows, v as isBrandedFields, s as isFieldEnvelope, u as isReadOnlyRowField, q as listOwnerFromSpec, t as toFieldEnvelopes } from './types-
|
|
2
|
+
import { L as LayoutComponentProps, P as PageConfig, F as Field$1, l as FIELDS_BRAND, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-BGZYaFxP.js';
|
|
3
|
+
export { w as FieldRef, x as Fields, z as ImageValue, y as ListRow, B as PortableRef, Z as ZoneConfig, m as attachFieldEnvelopes, p as composerStoreKey, o as envelopeListRows, v as isBrandedFields, s as isFieldEnvelope, u as isReadOnlyRowField, q as listOwnerFromSpec, t as toFieldEnvelopes } from './types-BGZYaFxP.js';
|
|
4
4
|
import react__default, { ReactNode } from 'react';
|
|
5
5
|
export { AmplifyRenderer } from './AmplifyRenderer.js';
|
|
6
|
-
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-
|
|
6
|
+
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-NcrxJQvI.js';
|
|
7
7
|
export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.js';
|
|
8
8
|
|
|
9
9
|
type RenderComponentContext = {
|
package/dist/react.js
CHANGED
|
@@ -888,7 +888,8 @@ function mergeEventContext(properties, attached) {
|
|
|
888
888
|
...properties,
|
|
889
889
|
...attached.resource ? { resource: attached.resource } : {},
|
|
890
890
|
page: attached.page,
|
|
891
|
-
...attached.pageRoute ? { pageRoute: attached.pageRoute } : {}
|
|
891
|
+
...attached.pageRoute ? { pageRoute: attached.pageRoute } : {},
|
|
892
|
+
...attached.pageResource ? { pageResource: attached.pageResource } : {}
|
|
892
893
|
};
|
|
893
894
|
}
|
|
894
895
|
var PAGE_RESOURCE_MARKER = "__amplifyupPageResource";
|
|
@@ -1188,7 +1189,8 @@ function mapResolvedToPageConfig(payload) {
|
|
|
1188
1189
|
description: payload.meta?.degraded ? "degraded" : void 0
|
|
1189
1190
|
},
|
|
1190
1191
|
...payload.eventTracking && payload.eventTracking.length > 0 ? { eventTracking: payload.eventTracking } : {},
|
|
1191
|
-
...payload.pageData ? { pageData: payload.pageData } : {}
|
|
1192
|
+
...payload.pageData ? { pageData: payload.pageData } : {},
|
|
1193
|
+
...payload.pageResources ? { pageResources: payload.pageResources } : {}
|
|
1192
1194
|
};
|
|
1193
1195
|
}
|
|
1194
1196
|
function collectDegraded(payload) {
|
|
@@ -1490,6 +1492,7 @@ var AmplifyUpSDK = class {
|
|
|
1490
1492
|
this.pendingPageContext = null;
|
|
1491
1493
|
this.attachedPageContext = null;
|
|
1492
1494
|
this.resolvedPageData = null;
|
|
1495
|
+
this.resolvedPageResource = null;
|
|
1493
1496
|
this.resolvedPageRoute = "";
|
|
1494
1497
|
this.resolvedRouteParams = {};
|
|
1495
1498
|
this.historyHooksInstalled = false;
|
|
@@ -2022,28 +2025,38 @@ var AmplifyUpSDK = class {
|
|
|
2022
2025
|
* Apply published pageData (from /v1/resolve) so field validation and
|
|
2023
2026
|
* mapped page fields can run.
|
|
2024
2027
|
*/
|
|
2025
|
-
applyResolvedPageData(pageData, pageRoute, routeParams) {
|
|
2028
|
+
applyResolvedPageData(pageData, pageRoute, routeParams, pageResources) {
|
|
2026
2029
|
this.resolvedPageData = pageData || null;
|
|
2027
2030
|
if (pageRoute) this.resolvedPageRoute = pageRoute;
|
|
2028
2031
|
if (routeParams) this.resolvedRouteParams = routeParams;
|
|
2032
|
+
const firstResourceName = pageData?.resources?.[0]?.name;
|
|
2033
|
+
const resolvedForPage = (firstResourceName ? pageResources?.[firstResourceName] : void 0) || (pageResources ? Object.values(pageResources)[0] : void 0);
|
|
2034
|
+
this.resolvedPageResource = resolvedForPage || null;
|
|
2029
2035
|
this.recomputeAttachedContext();
|
|
2030
2036
|
}
|
|
2031
2037
|
recomputeAttachedContext() {
|
|
2032
2038
|
if (!this.pendingPageContext) {
|
|
2033
|
-
this.attachedPageContext =
|
|
2034
|
-
this.resolvedPageData,
|
|
2035
|
-
this.resolvedPageRoute
|
|
2039
|
+
this.attachedPageContext = this.withPageResource(
|
|
2040
|
+
attachStaticPageContext(this.resolvedPageData, this.resolvedPageRoute)
|
|
2036
2041
|
);
|
|
2037
2042
|
setPageResourceFields(null);
|
|
2038
2043
|
return;
|
|
2039
2044
|
}
|
|
2040
|
-
this.attachedPageContext =
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
+
this.attachedPageContext = this.withPageResource(
|
|
2046
|
+
applyPageContext(this.pendingPageContext, {
|
|
2047
|
+
pageData: this.resolvedPageData,
|
|
2048
|
+
routeParams: this.resolvedRouteParams,
|
|
2049
|
+
pageRoute: this.resolvedPageRoute
|
|
2050
|
+
})
|
|
2051
|
+
);
|
|
2045
2052
|
setPageResourceFields(this.attachedPageContext?.resource?.fields || null);
|
|
2046
2053
|
}
|
|
2054
|
+
/** Stamp the resolved entry onto the context so events carry it. */
|
|
2055
|
+
withPageResource(context) {
|
|
2056
|
+
if (!context || !this.resolvedPageResource) return context;
|
|
2057
|
+
const { entity, providerId, docId } = this.resolvedPageResource;
|
|
2058
|
+
return { ...context, pageResource: { entity, providerId, docId } };
|
|
2059
|
+
}
|
|
2047
2060
|
getAttachedPageContext() {
|
|
2048
2061
|
return this.attachedPageContext;
|
|
2049
2062
|
}
|
|
@@ -5596,7 +5609,8 @@ function AmplifyUpProvider({
|
|
|
5596
5609
|
sdk.applyResolvedPageData(
|
|
5597
5610
|
result.pageConfig.pageData || null,
|
|
5598
5611
|
result.pageConfig.route,
|
|
5599
|
-
extractRouteParams(result.pageConfig.route, actualRoute)
|
|
5612
|
+
extractRouteParams(result.pageConfig.route, actualRoute),
|
|
5613
|
+
result.pageConfig.pageResources || null
|
|
5600
5614
|
);
|
|
5601
5615
|
}
|
|
5602
5616
|
setInitialized(true);
|