@phis/ui 0.6.10 → 0.7.0
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/components/cms/phi-cms-area-render-scope.d.ts +2 -0
- package/components/cms/phi-cms-area-render-scope.js +1 -1
- package/components/cms/phi-cms-error-page.js +1 -1
- package/components/cms/phi-cms-page-render-scope.d.ts +0 -1
- package/components/cms/phi-cms-page-render-scope.js +1 -1
- package/components/cms/phi-cms-root-layout.js +1 -0
- package/components/cms/phi-cms-runtime-registry.d.ts +4 -4
- package/components/cms/phi-cms-runtime-registry.js +4 -4
- package/components/controls/phi-padding-control.js +18 -5
- package/components/layouts/layout-definitions.d.ts +8 -0
- package/components/regions/presets/phi-base-page-column.js +1 -2
- package/components/regions/presets/phi-header-top-actions-layout.d.ts +2 -2
- package/components/regions/presets/phi-header-top-actions-layout.js +2 -4
- package/components/regions/presets/phi-settings-page-shell-tree.js +0 -2
- package/components/widgets/label-sets/padding.js +2 -0
- package/components/widgets/label-sets/region.js +2 -0
- package/components/widgets/label-types/padding.d.ts +2 -0
- package/components/widgets/label-types/padding.js +1 -0
- package/components/widgets/label-types/region.d.ts +2 -0
- package/components/widgets/label-types/region.js +1 -0
- package/components/widgets/label-types/revisions.js +2 -2
- package/components/workspace/catalog-state.d.ts +17 -1
- package/components/workspace/catalog-store.js +1 -0
- package/gateway/dashboard-cards-route.js +4 -9
- package/gateway/form-handler-resolution.js +10 -34
- package/gateway/navigation-target-route.js +4 -10
- package/gateway/page-references-route.js +3 -8
- package/gateway/site-area.d.ts +43 -6
- package/gateway/site-area.js +70 -17
- package/helpers/cms-area-config.d.ts +36 -14
- package/helpers/cms-area-config.js +72 -26
- package/helpers/cms-dialog.d.ts +0 -1
- package/helpers/cms-dialog.js +0 -1
- package/helpers/cms-layout-defaults.d.ts +4 -0
- package/helpers/cms-layout-defaults.js +14 -17
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/page-layout-check.js +4 -1
- package/next/seo-routes.js +24 -28
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/presets.d.ts +0 -1
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-area-preset-tree.js +0 -2
- package/plugins/runtime-modules/admin/presets.d.ts +0 -1
- package/plugins/runtime-modules/admin/trees/phi-default-admin-area-preset-tree.js +0 -2
- package/plugins/runtime-modules/app/presets.d.ts +0 -1
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.js +0 -2
- package/plugins/runtime-modules/area-definitions.d.ts +17 -0
- package/plugins/runtime-modules/area-definitions.js +6 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +0 -2
- package/plugins/runtime-modules/builder/area-shell-presets.server.d.ts +21 -5
- package/plugins/runtime-modules/builder/area-shell-presets.server.js +171 -63
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +12 -1
- package/plugins/runtime-modules/builder/controller/client.js +2 -0
- package/plugins/runtime-modules/builder/controller/definition.d.ts +1 -0
- package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +2 -3
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +56 -25
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +13 -7
- package/plugins/runtime-modules/builder/controller/server-definition.d.ts +1 -0
- package/plugins/runtime-modules/builder/controller/server-definition.js +7 -4
- package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +2 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +9 -3
- package/plugins/runtime-modules/builder/data-providers.d.ts +1 -1
- package/plugins/runtime-modules/builder/definition.d.ts +1 -1
- package/plugins/runtime-modules/builder/developer-workspace-store.js +1 -0
- package/plugins/runtime-modules/builder/page-preset-catalog.server.d.ts +0 -2
- package/plugins/runtime-modules/builder/page-preset-catalog.server.js +0 -16
- package/plugins/runtime-modules/builder/persistence.d.ts +20 -25
- package/plugins/runtime-modules/builder/persistence.js +67 -75
- package/plugins/runtime-modules/builder/services/runtime-modules-table.d.ts +17 -0
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +79 -2
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +0 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.d.ts +0 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +1 -10
- package/plugins/runtime-modules/builder/workspace-catalog-actions.d.ts +2 -1
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +3 -1
- package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +1 -1
- package/plugins/runtime-modules/descriptor-compiler.d.ts +16 -2
- package/plugins/runtime-modules/descriptor-compiler.js +69 -13
- package/plugins/runtime-modules/editor/services/releases-table.js +26 -14
- package/plugins/runtime-modules/editor/trees/phi-default-editor-area-preset-tree.js +0 -2
- package/plugins/runtime-modules/groups/definition.d.ts +1 -1
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +0 -2
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +0 -4
- package/plugins/runtime-modules/revisions/controller/client.js +13 -7
- package/plugins/runtime-modules/revisions/services/table.js +10 -3
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +0 -1
- package/plugins/runtime-modules/shell-tree-composition.d.ts +0 -2
- package/plugins/runtime-modules/shell-tree-composition.js +0 -3
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +0 -6
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +17 -1
- package/server-helpers/area-root-door-warmup.d.ts +5 -2
- package/server-helpers/area-root-door-warmup.js +2 -10
- package/server-helpers/cms-area.d.ts +9 -1
- package/server-helpers/cms-area.js +16 -11
- package/server-helpers/cms-lookup.js +1 -1
- package/server-helpers/cms-request.d.ts +58 -13
- package/server-helpers/cms-request.js +103 -33
- package/server-helpers/cms-root.d.ts +4 -0
- package/server-helpers/cms-root.js +48 -35
- package/server-helpers/cms.d.ts +5 -5
- package/server-helpers/public-login-route.js +4 -9
- package/server-helpers/search-index.js +9 -14
- package/styles/shell.css +12 -0
- package/theme/antd-css-var-contract.d.ts +6 -0
- package/theme/antd-css-var-contract.js +6 -0
- package/theme/phi-theme-tokens.d.ts +3 -2
- package/theme/phi-theme-tokens.js +11 -1
- package/theme/phi-theme.d.ts +2 -0
- package/theme/phi-theme.js +2 -0
- package/theme/phi-tokens.d.ts +1 -0
- package/theme/phi-tokens.js +7 -0
- package/theme.d.ts +1 -1
- package/theme.js +1 -1
- package/types/cms-module-descriptors.d.ts +26 -1
- package/types/cms-plugins.d.ts +3 -0
- package/types/cms.d.ts +10 -3
|
@@ -25,6 +25,8 @@ export declare function hasPhiCmsRevisionPreview(searchParams?: PhiCmsRequestSea
|
|
|
25
25
|
export declare function loadPhiCmsRootScope({ root, path, cmsBridge, }: LoadPhiCmsRootRequestArgs): Promise<{
|
|
26
26
|
resolvedRoute: import("./cms-route").PhiResolvedRootRoute;
|
|
27
27
|
resolvedAreaPreset: PhiResolvedCmsAreaPresetTree | null;
|
|
28
|
+
areaModules: import("../types/cms").PhiCmsAreaModulesSelection | null;
|
|
29
|
+
routeTable: import("../types/cms-module-descriptors").PhiCmsActiveRouteTable;
|
|
28
30
|
request: PhiCmsServerRequest;
|
|
29
31
|
runtime: {
|
|
30
32
|
authUiProvider: {
|
|
@@ -68,6 +70,8 @@ export declare function loadPhiCmsRootRequest({ root, path, cmsBridge, }: LoadPh
|
|
|
68
70
|
};
|
|
69
71
|
requestContext: import("../types/site-request-context").PhiSiteRequestContext;
|
|
70
72
|
resolvedAreaPreset: PhiResolvedCmsAreaPresetTree | null;
|
|
73
|
+
areaModules: import("../types/cms").PhiCmsAreaModulesSelection | null;
|
|
74
|
+
routeTable: import("../types/cms-module-descriptors").PhiCmsActiveRouteTable;
|
|
71
75
|
resolvedRequest: PhiResolvedCmsRequest | null;
|
|
72
76
|
}>;
|
|
73
77
|
export {};
|
|
@@ -12,9 +12,9 @@ import { hasPhiCmsAuthorizedPreviewRead, resolvePhiCmsReviewParams, resolvePhiCm
|
|
|
12
12
|
import { setPhiRequestNavigationContext, setPhiRequestRuntime, } from "./request-runtime";
|
|
13
13
|
import { buildPhiBlockRuntime, loadPhiSiteRequestContext } from "./runtime";
|
|
14
14
|
import { createPhiModuleMediaLoader } from "../gateway/server-module-media";
|
|
15
|
-
import { composePhiCmsActiveAreaOverlayPresets,
|
|
15
|
+
import { composePhiCmsActiveAreaOverlayPresets, resolvePhiCmsDescriptorCatalog, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
16
16
|
import { resolvePhiAuthUiRuntimeProjection } from "./auth-ui-provider";
|
|
17
|
-
import { resolvePhiAreaRouteScope } from "./cms-request";
|
|
17
|
+
import { readPhiCmsAreaForRequest, resolvePhiAreaRouteScope, resolvePhiCmsAreaShellSource, } from "./cms-request";
|
|
18
18
|
import { applyPhiBackgroundAssetProjection, resolvePhiBackgroundAssetProjection, } from "../components/widgets/helpers/background-reference-resolver.server";
|
|
19
19
|
import { PHIS_CLIENT_NAVIGATION_HEADER, PHIS_REQUEST_PATH_HEADER, PHIS_REQUEST_SEARCH_HEADER, } from "../constants/http-headers";
|
|
20
20
|
import { isPhiStaticCmsSiteBridge } from "./static-render";
|
|
@@ -83,31 +83,27 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
83
83
|
const resolvedAreaMask = resolvePhiCmsAreaMask(resolvedRoute.area);
|
|
84
84
|
const review = resolvePhiCmsReviewParams(request.searchParams);
|
|
85
85
|
const descriptorCatalog = resolvePhiCmsDescriptorCatalog(cmsBridge.runtimeModuleCatalog);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
throw new Error(`Area "${resolvedRoute.area}" has no shell preset binding.`);
|
|
89
|
-
}
|
|
90
|
-
/*
|
|
91
|
-
* The stored Area needs the route, the cookie and the review, none of which the request context
|
|
92
|
-
* supplies, so its read starts here and travels beside the context's. A failure is kept for the
|
|
93
|
-
* `await` below; the empty handler only stops it from being reported as unhandled when the context
|
|
94
|
-
* read fails first and that `await` is never reached.
|
|
95
|
-
*/
|
|
96
|
-
const exactAreaPresetRead = getPhiExactSiteArea({
|
|
86
|
+
const revision = resolvePhiCmsRevisionFromSearchParams(request.searchParams);
|
|
87
|
+
const loadArea = ({ sourcePreset, stage }) => getPhiExactSiteArea({
|
|
97
88
|
path: resolvedRoute.cmsPath,
|
|
98
89
|
apiBaseUrl: bridgeRuntime?.apiBaseUrl,
|
|
99
90
|
internalToken: bridgeRuntime?.internalToken,
|
|
100
91
|
siteKey,
|
|
101
92
|
locale: resolvedRoute.locale,
|
|
102
|
-
revision:
|
|
103
|
-
review,
|
|
93
|
+
...(stage === "requested" ? { revision, review } : {}),
|
|
104
94
|
cookieHeader,
|
|
105
|
-
sourcePreset
|
|
106
|
-
ownerModuleId: areaShellBinding.descriptor.ownerModuleId,
|
|
107
|
-
presetKey: areaShellBinding.descriptor.presetKey,
|
|
108
|
-
},
|
|
95
|
+
sourcePreset,
|
|
109
96
|
});
|
|
110
|
-
|
|
97
|
+
/*
|
|
98
|
+
* The stored Area needs the route, the cookie and the review, none of which the request context
|
|
99
|
+
* supplies, so its live read starts here and travels beside the context's. It is the read without an
|
|
100
|
+
* identity -- the selection and the one stored structure together -- because which shell applies is
|
|
101
|
+
* decided from the selection. A failure is kept for the `await` below; the empty handler only stops
|
|
102
|
+
* it from being reported as unhandled when the context read fails first and that `await` is never
|
|
103
|
+
* reached.
|
|
104
|
+
*/
|
|
105
|
+
const liveAreaRead = loadArea({ sourcePreset: null, stage: "live" });
|
|
106
|
+
liveAreaRead.catch(() => undefined);
|
|
111
107
|
const baseRequestContext = await loadPhiSiteRequestContext(siteKey, resolvedRoute.locale, cookieHeader, bridgeRuntime?.apiBaseUrl, bridgeRuntime?.internalToken);
|
|
112
108
|
const requestContext = await resolvePhiCmsThemeReviewRequestContext({
|
|
113
109
|
requestContext: baseRequestContext,
|
|
@@ -120,15 +116,39 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
120
116
|
request,
|
|
121
117
|
});
|
|
122
118
|
setPhiRequestRuntime(runtime);
|
|
123
|
-
const
|
|
119
|
+
const storedArea = await readPhiCmsAreaForRequest({
|
|
120
|
+
loadArea: (areaRequest) => areaRequest.stage === "live" && areaRequest.sourcePreset === null
|
|
121
|
+
? liveAreaRead
|
|
122
|
+
: loadArea(areaRequest),
|
|
123
|
+
previewsArea: revision != null || review?.kind === "area",
|
|
124
|
+
resolveShellSource: (modules) => resolvePhiCmsAreaShellSource({
|
|
125
|
+
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
126
|
+
area: resolvedRoute.area,
|
|
127
|
+
modules,
|
|
128
|
+
serverCapabilities: requestContext.serverCapabilities,
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
124
131
|
/*
|
|
125
|
-
* The
|
|
126
|
-
*
|
|
127
|
-
*
|
|
132
|
+
* The same table the page request compiles, from the same selection and the same shell: what the
|
|
133
|
+
* shell's navigation links has to be what the request answers, assigned Public addresses and the
|
|
134
|
+
* awarded root included.
|
|
135
|
+
*/
|
|
136
|
+
const { activeModuleIds, routeTable, shellBinding: areaShellBinding, structure: exactAreaPreset, } = resolvePhiAreaRouteScope({
|
|
137
|
+
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
138
|
+
catalog: descriptorCatalog,
|
|
139
|
+
area: resolvedRoute.area,
|
|
140
|
+
read: storedArea,
|
|
141
|
+
serverCapabilities: requestContext.serverCapabilities,
|
|
142
|
+
});
|
|
143
|
+
/*
|
|
144
|
+
* The code-owned Shell only where the Site has none stored on it. Building it beside the read, to save
|
|
145
|
+
* the round trip on a Site that never saved its Area, cost every other Site a full Shell instantiation
|
|
146
|
+
* -- tree loaders, translations, the preset contract check -- on every request, thrown away unread.
|
|
128
147
|
*/
|
|
129
148
|
const localAreaPreset = exactAreaPreset
|
|
130
149
|
? null
|
|
131
150
|
: await buildPhiLocalCmsAreaPayload({
|
|
151
|
+
binding: areaShellBinding,
|
|
132
152
|
areaMask: resolvedAreaMask,
|
|
133
153
|
siteId: requestContext.site.id,
|
|
134
154
|
path: resolvedRoute.cmsPath,
|
|
@@ -136,17 +156,6 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
136
156
|
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
137
157
|
});
|
|
138
158
|
const baseResolvedAreaPreset = exactAreaPreset?.preset ?? localAreaPreset?.preset ?? null;
|
|
139
|
-
/*
|
|
140
|
-
* The same table the page request compiles, from the same Area config: what the shell's navigation
|
|
141
|
-
* links has to be what the request answers, assigned Public addresses and the awarded root included.
|
|
142
|
-
*/
|
|
143
|
-
const { activeModuleIds, routeTable } = resolvePhiAreaRouteScope({
|
|
144
|
-
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
145
|
-
catalog: descriptorCatalog,
|
|
146
|
-
area: resolvedRoute.area,
|
|
147
|
-
preset: baseResolvedAreaPreset,
|
|
148
|
-
serverCapabilities: requestContext.serverCapabilities,
|
|
149
|
-
});
|
|
150
159
|
const composedAreaPreset = baseResolvedAreaPreset
|
|
151
160
|
? await composePhiCmsActiveAreaOverlayPresets({
|
|
152
161
|
tree: baseResolvedAreaPreset,
|
|
@@ -177,6 +186,8 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
177
186
|
return {
|
|
178
187
|
resolvedRoute,
|
|
179
188
|
resolvedAreaPreset,
|
|
189
|
+
areaModules: storedArea.modules,
|
|
190
|
+
routeTable,
|
|
180
191
|
request,
|
|
181
192
|
runtime: runtimeWithAuthProvider,
|
|
182
193
|
cookieHeader,
|
|
@@ -259,6 +270,8 @@ const loadPhiCmsRootRequestCached = cache(async function loadPhiCmsRootRequestCa
|
|
|
259
270
|
runtime: rootScope.runtime,
|
|
260
271
|
requestContext: rootScope.requestContext,
|
|
261
272
|
resolvedAreaPreset: rootScope.resolvedAreaPreset,
|
|
273
|
+
areaModules: rootScope.areaModules,
|
|
274
|
+
routeTable: rootScope.routeTable,
|
|
262
275
|
resolvedRequest: effectiveResolvedRequest,
|
|
263
276
|
};
|
|
264
277
|
});
|
package/server-helpers/cms.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
|
+
import { type PhiSiteAreaRead } from "../gateway/site-area";
|
|
2
3
|
import type { PhiCmsReviewParams } from "./cms-review";
|
|
3
|
-
import type {
|
|
4
|
+
import type { PhiResolvedCmsPagePayload } from "../types/cms";
|
|
4
5
|
import type { PhiCmsPresetIdentity } from "../types/cms-module-descriptors";
|
|
5
6
|
export type GetPhiCmsPageOptions = {
|
|
6
7
|
path: string;
|
|
@@ -14,7 +15,6 @@ export type GetPhiCmsPageOptions = {
|
|
|
14
15
|
sourcePreset?: PhiCmsPresetIdentity | null;
|
|
15
16
|
};
|
|
16
17
|
export declare function getPhiCmsPage({ path, apiBaseUrl, internalToken, siteKey, locale, revision, review, cookieHeader, sourcePreset, }: GetPhiCmsPageOptions): Promise<PhiResolvedCmsPagePayload | null>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export declare function getPhiExactSiteArea({ path, apiBaseUrl, internalToken, siteKey, locale, revision, review, cookieHeader, sourcePreset, }: GetPhiCmsAreaOptions): Promise<PhiResolvedCmsAreaPresetPayload | null>;
|
|
18
|
+
/** Without `sourcePreset` the Area answers its selection and its one stored structure, whatever identity it has. */
|
|
19
|
+
export type GetPhiCmsAreaOptions = GetPhiCmsPageOptions;
|
|
20
|
+
export declare function getPhiExactSiteArea({ path, apiBaseUrl, internalToken, siteKey, locale, revision, review, cookieHeader, sourcePreset, }: GetPhiCmsAreaOptions): Promise<PhiSiteAreaRead | null>;
|
|
@@ -5,7 +5,7 @@ import { PHI_CANONICAL_SOURCE_LOCALE, localizeAreaPath } from "../helpers/locale
|
|
|
5
5
|
import { getPhiExactSiteArea } from "./cms";
|
|
6
6
|
import { getPhiCapabilitySnapshot } from "../gateway/server-capabilities";
|
|
7
7
|
import { resolvePhiRequestLocale } from "./request-locale";
|
|
8
|
-
import {
|
|
8
|
+
import { resolvePhiCmsAreaBaseShellPresetBinding, resolvePhiCmsDescriptorCatalog, resolvePhiCmsRoutePresetByPageId, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
9
9
|
import { PHI_PUBLIC_LOGIN_ROUTE_IDENTITY } from "../constants/public-login-route";
|
|
10
10
|
import { createPhiPresetCmsPageId } from "../types/cms-instance-id";
|
|
11
11
|
import { resolvePhiAreaRouteScope } from "./cms-request";
|
|
@@ -49,8 +49,7 @@ function readPhiBridgeApiOptions(cmsBridge) {
|
|
|
49
49
|
*/
|
|
50
50
|
export const resolvePhiPublicLoginHref = cache(async function resolvePhiPublicLoginHref(cmsBridge, locale, serverCapabilities) {
|
|
51
51
|
const catalog = resolvePhiCmsDescriptorCatalog(cmsBridge.runtimeModuleCatalog);
|
|
52
|
-
|
|
53
|
-
if (!shellBinding) {
|
|
52
|
+
if (!resolvePhiCmsAreaBaseShellPresetBinding(catalog, "public")) {
|
|
54
53
|
/**
|
|
55
54
|
* This bridge does not carry the Public Area definition -- a staff Area catalog deliberately does
|
|
56
55
|
* not, which is what keeps its module graph small. The route cannot be verified from here, and
|
|
@@ -61,21 +60,17 @@ export const resolvePhiPublicLoginHref = cache(async function resolvePhiPublicLo
|
|
|
61
60
|
return localizeAreaPath(locale, "public", PHI_PUBLIC_LOGIN_PATH);
|
|
62
61
|
}
|
|
63
62
|
const cookieStore = await cookies();
|
|
64
|
-
const
|
|
63
|
+
const storedArea = await getPhiExactSiteArea({
|
|
65
64
|
path: "/",
|
|
66
65
|
...readPhiBridgeApiOptions(cmsBridge),
|
|
67
66
|
locale,
|
|
68
67
|
cookieHeader: cookieStore.toString(),
|
|
69
|
-
sourcePreset: {
|
|
70
|
-
ownerModuleId: shellBinding.descriptor.ownerModuleId,
|
|
71
|
-
presetKey: shellBinding.descriptor.presetKey,
|
|
72
|
-
},
|
|
73
68
|
});
|
|
74
69
|
const { routeTable } = resolvePhiAreaRouteScope({
|
|
75
70
|
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
76
71
|
catalog,
|
|
77
72
|
area: "public",
|
|
78
|
-
|
|
73
|
+
read: storedArea,
|
|
79
74
|
serverCapabilities: serverCapabilities ?? null,
|
|
80
75
|
});
|
|
81
76
|
const login = resolvePhiCmsRoutePresetByPageId(routeTable, PHI_PUBLIC_LOGIN_PAGE_ID);
|
|
@@ -11,7 +11,7 @@ import { onPhiSiteReadMarker } from "../gateway/site-read-marker-listeners";
|
|
|
11
11
|
import { fetchPhiSiteSearchIndexStates, putPhiSiteSearchIndexSet } from "../gateway/site-search";
|
|
12
12
|
import { buildPhiRuntimeModuleAccessRegistry, filterPhiCmsRenderableTreeForViewer, } from "../helpers/cms-access-policy";
|
|
13
13
|
import { collectPhiSitemapCandidates } from "../helpers/phi-seo";
|
|
14
|
-
import {
|
|
14
|
+
import { resolvePhiCmsAreaBaseShellPresetBinding, resolvePhiCmsDescriptorCatalog, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
15
15
|
import { resolvePhiCmsAreaRuntimeModuleScope } from "../components/cms/phi-cms-runtime-registry";
|
|
16
16
|
import { canPhiViewerAccess } from "../types/access";
|
|
17
17
|
import { resolvePhiCmsLookup } from "./cms-lookup";
|
|
@@ -159,34 +159,28 @@ function asIndexingReader(context, area) {
|
|
|
159
159
|
async function indexArea({ area, bridge, credentials, heldFingerprint, failures, }) {
|
|
160
160
|
const { apiBaseUrl, internalToken, siteKey } = credentials;
|
|
161
161
|
const catalog = resolvePhiCmsDescriptorCatalog(bridge.runtimeModuleCatalog);
|
|
162
|
-
|
|
163
|
-
if (!shellBinding) {
|
|
162
|
+
if (!resolvePhiCmsAreaBaseShellPresetBinding(catalog, area)) {
|
|
164
163
|
console.warn(`[phis-ui] The ${area} Area has no shell preset; nothing to index.`);
|
|
165
164
|
return;
|
|
166
165
|
}
|
|
167
|
-
const sourcePreset = {
|
|
168
|
-
ownerModuleId: shellBinding.descriptor.ownerModuleId,
|
|
169
|
-
presetKey: shellBinding.descriptor.presetKey,
|
|
170
|
-
};
|
|
171
166
|
const areaMask = area === "public" ? 1 : 2;
|
|
172
167
|
// The Site's languages and its server, read once as the anonymous reader; the locale is per set.
|
|
173
168
|
const anonymous = await loadPhiSiteRequestContext(siteKey, "", "", apiBaseUrl, internalToken);
|
|
174
169
|
// The Site config's change markers, from the same answer the context above was built from.
|
|
175
170
|
const { readMarker, translationMarkers } = await getResolvedSiteConfig({ apiBaseUrl, internalToken, siteKey });
|
|
176
171
|
const locales = anonymous.site.availableLocales.map((option) => option.code);
|
|
177
|
-
const { area:
|
|
172
|
+
const { area: storedArea, publishedPages } = await getSiteAreaWithPublishedPages({
|
|
178
173
|
apiBaseUrl,
|
|
179
174
|
internalToken,
|
|
180
175
|
siteKey,
|
|
181
176
|
locale: anonymous.site.defaultLocale,
|
|
182
|
-
sourcePreset,
|
|
183
177
|
area,
|
|
184
178
|
});
|
|
185
|
-
const { activeModuleIds, routeTable } = resolvePhiAreaRouteScope({
|
|
179
|
+
const { activeModuleIds, routeTable, structure } = resolvePhiAreaRouteScope({
|
|
186
180
|
runtimeModuleCatalog: bridge.runtimeModuleCatalog,
|
|
187
181
|
catalog,
|
|
188
182
|
area,
|
|
189
|
-
|
|
183
|
+
read: storedArea,
|
|
190
184
|
serverCapabilities: anonymous.serverCapabilities,
|
|
191
185
|
});
|
|
192
186
|
if (!activeModuleIds.has(PHI_SEARCH_RUNTIME_MODULE_ID))
|
|
@@ -211,17 +205,18 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, failures,
|
|
|
211
205
|
build: getPhiSiteBuildId(),
|
|
212
206
|
area,
|
|
213
207
|
publishedPages,
|
|
214
|
-
areaPreset:
|
|
208
|
+
areaPreset: structure?.preset ?? null,
|
|
209
|
+
areaModules: storedArea.modules,
|
|
215
210
|
activeModuleIds: [...activeModuleIds].sort(),
|
|
216
211
|
locales,
|
|
217
212
|
readMarker,
|
|
218
213
|
translationMarkers,
|
|
219
214
|
})).digest("hex");
|
|
220
|
-
// The Area's Module scope as the live render resolves it:
|
|
215
|
+
// The Area's Module scope as the live render resolves it: its selection, the locked ones implied.
|
|
221
216
|
const { moduleSet } = await resolvePhiCmsAreaRuntimeModuleScope({
|
|
222
217
|
cmsBridge: bridge,
|
|
223
218
|
area,
|
|
224
|
-
|
|
219
|
+
areaModules: storedArea.modules,
|
|
225
220
|
serverCapabilities: anonymous.serverCapabilities,
|
|
226
221
|
});
|
|
227
222
|
// The same access registry the live render filters a Page's tree with (phi-cms-page-render-scope.tsx).
|
package/styles/shell.css
CHANGED
|
@@ -24,6 +24,18 @@
|
|
|
24
24
|
container-type: inline-size;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/*
|
|
28
|
+
* Nothing makes the page wider than the window. A viewport effect moves and turns a block by a share of its
|
|
29
|
+
* own size, so a picture that fits its slot may be drawn past the window's edge -- and a transform counts
|
|
30
|
+
* toward the scrollable width, which gave the page a horizontal scroll at the widths where the block sat
|
|
31
|
+
* close to the edge. `clip`, not `hidden`: it starts no scroll container, so a sticky Header, Sider or
|
|
32
|
+
* Footer still sticks to the window, and the vertical overflow stays visible.
|
|
33
|
+
*/
|
|
34
|
+
.shell-sider-full,
|
|
35
|
+
.shell-sider-embedded {
|
|
36
|
+
overflow-x: clip;
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
/*
|
|
28
40
|
* A device band, not a content threshold, although it is written as a container query.
|
|
29
41
|
*
|
|
@@ -90,6 +90,12 @@ export declare const PHI_PAGE: {
|
|
|
90
90
|
readonly left: "var(--phi-signed-in-page-inset-left, var(--phi-signed-in-page-padding-left-desktop))";
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* The gap of a Layout that states none: the Theme's `layoutGap` (theme/phi-tokens.ts, `PHI_LAYOUT.layoutGap`,
|
|
95
|
+
* `sm` unless the Theme says otherwise). A Layout's defaults read it, so a Layout without a gap of its own
|
|
96
|
+
* follows the Theme; a preset leaves the gap out rather than stating this.
|
|
97
|
+
*/
|
|
98
|
+
export declare const PHI_LAYOUT_GAP = "var(--phi-layout-gap)";
|
|
93
99
|
export declare const PHI_RADIUS: {
|
|
94
100
|
readonly xxs: "var(--phi-border-radius-xs)";
|
|
95
101
|
readonly xs: "var(--phi-border-radius-sm)";
|
|
@@ -108,6 +108,12 @@ export const PHI_PAGE = {
|
|
|
108
108
|
left: "var(--phi-signed-in-page-inset-left, var(--phi-signed-in-page-padding-left-desktop))",
|
|
109
109
|
},
|
|
110
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* The gap of a Layout that states none: the Theme's `layoutGap` (theme/phi-tokens.ts, `PHI_LAYOUT.layoutGap`,
|
|
113
|
+
* `sm` unless the Theme says otherwise). A Layout's defaults read it, so a Layout without a gap of its own
|
|
114
|
+
* follows the Theme; a preset leaves the gap out rather than stating this.
|
|
115
|
+
*/
|
|
116
|
+
export const PHI_LAYOUT_GAP = "var(--phi-layout-gap)";
|
|
111
117
|
export const PHI_RADIUS = {
|
|
112
118
|
xxs: "var(--phi-border-radius-xs)",
|
|
113
119
|
xs: "var(--phi-border-radius-sm)",
|
|
@@ -36,7 +36,8 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
|
|
|
36
36
|
* needs one of these reads it as a CSS variable, the way a Server Component does.
|
|
37
37
|
*
|
|
38
38
|
* `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
|
|
39
|
-
* as `PHI_PAGE.max`.
|
|
39
|
+
* as `PHI_PAGE.max`. `layoutGap` is the gap of a Layout that states none (`PHI_LAYOUT.layoutGap`), read
|
|
40
|
+
* as `PHI_LAYOUT_GAP`.
|
|
40
41
|
*
|
|
41
42
|
* The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
|
|
42
43
|
* (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
|
|
@@ -45,7 +46,7 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
|
|
|
45
46
|
* the `display` of the mark behind a link that leaves the Site (theme/phi-link-mark.ts). The
|
|
46
47
|
* `surfaceShadow*` names are what a Surface's `soft` and `strong` steps draw (theme/phi-surface-shadow.ts).
|
|
47
48
|
*/
|
|
48
|
-
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "signedInPagePaddingTopPhone", "signedInPagePaddingRightPhone", "signedInPagePaddingBottomPhone", "signedInPagePaddingLeftPhone", "signedInPagePaddingTopTablet", "signedInPagePaddingRightTablet", "signedInPagePaddingBottomTablet", "signedInPagePaddingLeftTablet", "signedInPagePaddingTopDesktop", "signedInPagePaddingRightDesktop", "signedInPagePaddingBottomDesktop", "signedInPagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "surfaceShadowSoft", "surfaceShadowStrong", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
49
|
+
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "signedInPagePaddingTopPhone", "signedInPagePaddingRightPhone", "signedInPagePaddingBottomPhone", "signedInPagePaddingLeftPhone", "signedInPagePaddingTopTablet", "signedInPagePaddingRightTablet", "signedInPagePaddingBottomTablet", "signedInPagePaddingLeftTablet", "signedInPagePaddingTopDesktop", "signedInPagePaddingRightDesktop", "signedInPagePaddingBottomDesktop", "signedInPagePaddingLeftDesktop", "layoutGap", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "surfaceShadowSoft", "surfaceShadowStrong", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
49
50
|
/** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
|
|
50
51
|
export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
|
|
51
52
|
export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
|
|
@@ -168,7 +168,8 @@ export const PHI_THEME_TOKEN_KEYS = [
|
|
|
168
168
|
* needs one of these reads it as a CSS variable, the way a Server Component does.
|
|
169
169
|
*
|
|
170
170
|
* `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
|
|
171
|
-
* as `PHI_PAGE.max`.
|
|
171
|
+
* as `PHI_PAGE.max`. `layoutGap` is the gap of a Layout that states none (`PHI_LAYOUT.layoutGap`), read
|
|
172
|
+
* as `PHI_LAYOUT_GAP`.
|
|
172
173
|
*
|
|
173
174
|
* The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
|
|
174
175
|
* (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
|
|
@@ -204,6 +205,7 @@ export const PHI_THEME_OWN_TOKEN_KEYS = [
|
|
|
204
205
|
"signedInPagePaddingRightDesktop",
|
|
205
206
|
"signedInPagePaddingBottomDesktop",
|
|
206
207
|
"signedInPagePaddingLeftDesktop",
|
|
208
|
+
"layoutGap",
|
|
207
209
|
"gradient1",
|
|
208
210
|
"gradient1Text",
|
|
209
211
|
"gradient2",
|
|
@@ -295,6 +297,7 @@ export function assertPhiThemeVocabulary({ palette, styleToken, modeSeedKeys, so
|
|
|
295
297
|
}
|
|
296
298
|
violations.push(...readPhiThemePageMaxViolations(styleToken, source));
|
|
297
299
|
violations.push(...readPhiThemePagePaddingViolations(styleToken, source));
|
|
300
|
+
violations.push(...readPhiThemeLayoutGapViolations(styleToken, source));
|
|
298
301
|
if (violations.length > 0) {
|
|
299
302
|
throw new Error(violations.join(" "));
|
|
300
303
|
}
|
|
@@ -318,6 +321,13 @@ function readPhiThemePagePaddingViolations(styleToken, source) {
|
|
|
318
321
|
return [`${source}: the style token states ${key} as ${JSON.stringify(value)}, which is not a step of the spacing scale.`];
|
|
319
322
|
});
|
|
320
323
|
}
|
|
324
|
+
/** A Layout's gap is a step of the spacing scale, or none, for the same reason as a Page's inset. */
|
|
325
|
+
function readPhiThemeLayoutGapViolations(styleToken, source) {
|
|
326
|
+
const value = styleToken?.layoutGap;
|
|
327
|
+
if (value == null || new Set([...Object.values(PHI_SPACE), 0, "0"]).has(value))
|
|
328
|
+
return [];
|
|
329
|
+
return [`${source}: the style token states layoutGap as ${JSON.stringify(value)}, which is not a step of the spacing scale.`];
|
|
330
|
+
}
|
|
321
331
|
function readPhiThemePageMaxViolations(styleToken, source) {
|
|
322
332
|
const value = styleToken?.pageMax;
|
|
323
333
|
if (value == null)
|
package/theme/phi-theme.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export type PhiThemeTokens = {
|
|
|
58
58
|
signedInPagePaddingRightDesktop: string;
|
|
59
59
|
signedInPagePaddingBottomDesktop: string;
|
|
60
60
|
signedInPagePaddingLeftDesktop: string;
|
|
61
|
+
/** The gap of a Layout that states none (`PHI_LAYOUT.layoutGap`), published as `--phi-layout-gap`. */
|
|
62
|
+
layoutGap: string;
|
|
61
63
|
marginXXS: number;
|
|
62
64
|
marginXS: number;
|
|
63
65
|
marginSM: number;
|
package/theme/phi-theme.js
CHANGED
|
@@ -44,6 +44,8 @@ function buildPhiThemeTokens(options = {}) {
|
|
|
44
44
|
signedInPagePaddingRightDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
45
45
|
signedInPagePaddingBottomDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
46
46
|
signedInPagePaddingLeftDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
47
|
+
// The gap of a Layout that states none, a step of the spacing scale (`PHI_LAYOUT.layoutGap`).
|
|
48
|
+
layoutGap: PHI_SPACE[PHI_LAYOUT.layoutGap],
|
|
47
49
|
// Ant Design's second family, on the same scale: its own components read it (phi-tokens.ts).
|
|
48
50
|
marginXXS: PHI_PADDING_VALUES.xxs,
|
|
49
51
|
marginXS: PHI_PADDING_VALUES.xs,
|
package/theme/phi-tokens.d.ts
CHANGED
package/theme/phi-tokens.js
CHANGED
|
@@ -155,6 +155,13 @@ export const PHI_LAYOUT = {
|
|
|
155
155
|
* The Theme's as well, read as `PHI_PAGE.signedInPadding`.
|
|
156
156
|
*/
|
|
157
157
|
signedInPagePadding: { phone: "sm", tablet: "base", desktop: "base" },
|
|
158
|
+
/*
|
|
159
|
+
* The distance between a Layout's children, its rows and its columns alike, where the Layout states
|
|
160
|
+
* none: a Flex, a vertical Flex, a Grid, a Masonry, a Three-column row and a Split Card. A step of the
|
|
161
|
+
* spacing scale, `sm` by default; the Theme's to change for the whole Site, read as `PHI_LAYOUT_GAP`.
|
|
162
|
+
* A Layout that states its own gap keeps it.
|
|
163
|
+
*/
|
|
164
|
+
layoutGap: "sm",
|
|
158
165
|
/*
|
|
159
166
|
* How wide a column of prose is allowed to get: an article, an entry and what stands around it.
|
|
160
167
|
*
|
package/theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { isPhiThemePaletteModeSeedKey, mergePhiThemePalettes, PHI_THEME_CUSTOM_COLOR_KEYS, PHI_THEME_PALETTE_MODE_SEED_KEYS, type PhiThemeCustomColorKey, type PhiThemeCustomColorPalette, type PhiThemeMode, type PhiThemePalette, type PhiThemePaletteMode, type PhiThemePresetPlugin, } from "./theme/phi-theme-presets";
|
|
2
2
|
export * from "./theme/phi-tokens";
|
|
3
|
-
export { PHI_COLOR, PHI_PAGE, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
|
|
3
|
+
export { PHI_COLOR, PHI_LAYOUT_GAP, PHI_PAGE, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
|
|
4
4
|
export { type PhiThemeBlockIdentity, type PhiThemeFontsBlock, type PhiThemeGroundBlock, type PhiThemePaletteBlock, type PhiThemeSetBlock, type PhiThemeStyleBlock, } from "./theme/phi-theme-blocks";
|
package/theme.js
CHANGED
|
@@ -5,5 +5,5 @@ export * from "./theme/phi-tokens";
|
|
|
5
5
|
* Each is a reference the Theme resolves per Site and per mode, never a value of its own, so a preset
|
|
6
6
|
* that names one follows whatever Theme it lands in (THEME.md, "Phi scale").
|
|
7
7
|
*/
|
|
8
|
-
export { PHI_COLOR, PHI_PAGE, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
|
|
8
|
+
export { PHI_COLOR, PHI_LAYOUT_GAP, PHI_PAGE, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
|
|
9
9
|
export {} from "./theme/phi-theme-blocks";
|
|
@@ -9,6 +9,7 @@ import type { PhiSignalRoute } from "./signals";
|
|
|
9
9
|
import type { PhiCmsInstanceId } from "./cms-instance-id";
|
|
10
10
|
import type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
|
|
11
11
|
import type { PhiModuleMediaResolver } from "./module-media";
|
|
12
|
+
import type { PhiAreaShellSettings } from "../helpers/cms-area-config";
|
|
12
13
|
export type PhiRuntimeModuleId = `${string}/${string}`;
|
|
13
14
|
export type PhiCmsPresetIdentity = {
|
|
14
15
|
ownerModuleId: PhiRuntimeModuleId;
|
|
@@ -21,6 +22,12 @@ export type PhiCmsAreaDefinition = {
|
|
|
21
22
|
area: PhiCmsAreaKey;
|
|
22
23
|
baseModuleId: PhiRuntimeModuleId;
|
|
23
24
|
shellPresetKey: string;
|
|
25
|
+
/**
|
|
26
|
+
* Who may bring the Area's shell. `"base"`: only the base Module's `shellPresetKey`. `"module"`: an
|
|
27
|
+
* active Module eligible for the Area may bring its own `areaShells` descriptor, and while one does it
|
|
28
|
+
* replaces the base shell; one provider per Area (MODULES.md, "A Module's own Area shell").
|
|
29
|
+
*/
|
|
30
|
+
shellProviders: "base" | "module";
|
|
24
31
|
accessPolicy: PhiViewerAccessPolicy;
|
|
25
32
|
navigationSurfaces?: readonly PhiCmsNavigationSurfaceDescriptor[];
|
|
26
33
|
};
|
|
@@ -45,6 +52,16 @@ export type PhiCmsAreaShellPresetDescriptor = PhiCmsPresetIdentity & {
|
|
|
45
52
|
exportedNodeKeys?: readonly string[];
|
|
46
53
|
composition?: readonly PhiCmsAreaShellCompositionSource[];
|
|
47
54
|
loadTree: (context: PhiCmsDescriptorBuildContext) => PhiResolvedCmsPageTree | Promise<PhiResolvedCmsPageTree>;
|
|
55
|
+
/**
|
|
56
|
+
* What this shell proposes for the Area's settings -- how it is found (`meta`) and what its `/` does
|
|
57
|
+
* (`rootRoute`) -- in place of phis-ui's defaults.
|
|
58
|
+
*
|
|
59
|
+
* A proposal, like the shell itself: it stands while the Area stores no structure on this shell, and
|
|
60
|
+
* the Builder's settings dialog shows it as the current answer. The first save writes what the dialog
|
|
61
|
+
* showed, this proposal included, into the stored `config.shell`; from then on the Site's answer
|
|
62
|
+
* stands and a newer proposal no longer reaches it. A key left out keeps phis-ui's default.
|
|
63
|
+
*/
|
|
64
|
+
settings?: PhiAreaShellSettings;
|
|
48
65
|
};
|
|
49
66
|
export type PhiCmsAreaOverlayPresetDescriptor = PhiCmsPresetIdentity & {
|
|
50
67
|
presetVersion: number;
|
|
@@ -451,6 +468,10 @@ export type PhiCmsNavigationOverlayResolution = {
|
|
|
451
468
|
export type PhiCmsAreaShellPresetBinding = {
|
|
452
469
|
descriptor: PhiCmsAreaShellPresetDescriptor;
|
|
453
470
|
};
|
|
471
|
+
/** A shell an optional Module brings for an Area whose definition takes one (`shellProviders: "module"`). */
|
|
472
|
+
export type PhiCmsAreaShellProviderBinding = PhiCmsAreaShellPresetBinding & {
|
|
473
|
+
moduleId: PhiRuntimeModuleId;
|
|
474
|
+
};
|
|
454
475
|
export type PhiCmsRoutePresetBinding = {
|
|
455
476
|
descriptor: PhiCmsRoutePresetDescriptor;
|
|
456
477
|
params: Readonly<Record<string, string>>;
|
|
@@ -475,7 +496,11 @@ export type PhiCmsCompiledRoutePattern = {
|
|
|
475
496
|
};
|
|
476
497
|
export type PhiCmsCompiledDescriptorCatalog = {
|
|
477
498
|
areaDefinitions: ReadonlyMap<PhiCmsAreaKey, PhiCmsAreaDefinition>;
|
|
478
|
-
|
|
499
|
+
/** The shell of the Area's base Module: what the Area takes while no active Module brings one. */
|
|
500
|
+
areaBaseShellByArea: ReadonlyMap<PhiCmsAreaKey, PhiCmsAreaShellPresetBinding>;
|
|
501
|
+
/** The shells optional Modules bring, by Area and Module; only for `shellProviders: "module"`. */
|
|
502
|
+
areaShellProvidersByArea: ReadonlyMap<PhiCmsAreaKey, ReadonlyMap<PhiRuntimeModuleId, PhiCmsAreaShellProviderBinding>>;
|
|
503
|
+
/** Every shell, base and provider alike, by identity: what `composition` and identity lookups read. */
|
|
479
504
|
areaShellByIdentity: ReadonlyMap<string, PhiCmsAreaShellPresetBinding>;
|
|
480
505
|
areaOverlaysByArea: ReadonlyMap<PhiCmsAreaKey, readonly PhiCmsAreaOverlayPresetDescriptor[]>;
|
|
481
506
|
/** Navigation contributed by a Module that owns no Page in that Area. */
|
package/types/cms-plugins.d.ts
CHANGED
|
@@ -749,7 +749,10 @@ export type PhiCmsSiteRuntime = {
|
|
|
749
749
|
siteKey: string;
|
|
750
750
|
};
|
|
751
751
|
export type PhiResolvedCmsRequest = {
|
|
752
|
+
/** The Area's structure: the stored one where it stands on the effective shell, else that shell's preset. */
|
|
752
753
|
areaPreset: PhiResolvedCmsAreaPresetTree | null;
|
|
754
|
+
/** The Area's Module selection, stored apart from the structure; null where the Area never stored one. */
|
|
755
|
+
areaModules: import("./cms").PhiCmsAreaModulesSelection | null;
|
|
753
756
|
page: PhiResolvedCmsPageTree;
|
|
754
757
|
runtime: PhiBlockRuntime;
|
|
755
758
|
serverCapabilities: import("./server-capabilities").PhiCapabilitySnapshot | null;
|
package/types/cms.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PhiRuntimeControllerSetting
|
|
1
|
+
import type { PhiRuntimeControllerSetting } from "./cms-plugins";
|
|
2
2
|
import type { PhiCmsAreaKey } from "@phis/contracts/cms";
|
|
3
3
|
import type { PhiCmsInstanceId } from "./cms-instance-id";
|
|
4
4
|
import type { PhiCmsPresetSource } from "./cms-module-descriptors";
|
|
@@ -126,7 +126,6 @@ export type PhiCmsContentWidgetNode = PhiCmsNodeBase & {
|
|
|
126
126
|
export type PhiResolvedCmsPageTree = {
|
|
127
127
|
page: PhiCmsPageNode;
|
|
128
128
|
pageMeta?: PhiCmsResolvedPageMeta | null;
|
|
129
|
-
runtimeModuleIds?: PhiRuntimeModuleId[] | null;
|
|
130
129
|
regions: PhiCmsRegionNode[];
|
|
131
130
|
overlays: PhiCmsOverlayNode[];
|
|
132
131
|
layoutNodes: PhiCmsLayoutNode[];
|
|
@@ -174,7 +173,6 @@ export type PhiCmsAreaPresetNode = {
|
|
|
174
173
|
};
|
|
175
174
|
export type PhiResolvedCmsAreaPresetTree = {
|
|
176
175
|
preset: PhiCmsAreaPresetNode;
|
|
177
|
-
runtimeModuleIds?: PhiRuntimeModuleId[] | null;
|
|
178
176
|
regions: PhiCmsRegionNode[];
|
|
179
177
|
overlays: PhiCmsOverlayNode[];
|
|
180
178
|
layoutNodes: PhiCmsLayoutNode[];
|
|
@@ -186,6 +184,15 @@ export type PhiResolvedCmsAreaPresetPayload = {
|
|
|
186
184
|
sourcePreset: PhiCmsPresetSource;
|
|
187
185
|
preset: PhiResolvedCmsAreaPresetTree;
|
|
188
186
|
};
|
|
187
|
+
/**
|
|
188
|
+
* An Area's Module selection as Core stores it, apart from the structure: one Modules revision, whose
|
|
189
|
+
* `config` is `{ modules: { runtimeModules, publicRoutePaths, ... } }`. It names no shell identity --
|
|
190
|
+
* which shell the Area takes is decided from it (CMS.md, "The Area's Module selection").
|
|
191
|
+
*/
|
|
192
|
+
export type PhiCmsAreaModulesSelection = {
|
|
193
|
+
revisionId: number;
|
|
194
|
+
config: Record<string, unknown>;
|
|
195
|
+
};
|
|
189
196
|
export type PhiCmsLayoutRenderNode = PhiCmsLayoutNode & {
|
|
190
197
|
childLayouts: PhiCmsLayoutRenderNode[];
|
|
191
198
|
childWidgets: PhiCmsContentWidgetNode[];
|