@phis/ui 0.4.8 → 0.4.12
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-access-guard.js +9 -1
- package/components/cms/phi-cms-area-render-scope.d.ts +8 -4
- package/components/cms/phi-cms-area-render-scope.js +26 -11
- package/components/cms/phi-cms-root-layout.js +4 -2
- package/components/cms/phi-cms-runtime-registry.d.ts +2 -1
- package/components/cms/phi-cms-runtime-registry.js +1 -1
- package/components/controls/phi-color-control.js +2 -1
- package/components/controls/phi-drawer-control-adapter.js +2 -3
- package/components/controls/phi-drawer-control.js +3 -3
- package/components/controls/phi-dropdown-control.js +2 -1
- package/components/controls/phi-float-button-control.js +3 -3
- package/components/controls/phi-modal-control-adapter.js +2 -2
- package/components/controls/phi-modal-control.js +3 -3
- package/components/controls/phi-ribbon-wrap-control.js +2 -1
- package/components/controls/phi-zoom-image-overlay.js +11 -5
- package/components/forms/auth-admin-settings-labels.d.ts +35 -0
- package/components/forms/auth-admin-settings-labels.js +27 -0
- package/components/forms/content-entry-forms.js +1 -5
- package/components/forms/form-descriptor-runtime-client.js +2 -1
- package/components/forms/form-descriptor-text.d.ts +17 -0
- package/components/forms/form-descriptor-text.js +14 -0
- package/components/forms/runtime-form-controller-plugin.d.ts +0 -115
- package/components/forms/runtime-form-controller-plugin.js +1 -1
- package/components/forms/upload-form-control.d.ts +0 -7
- package/components/forms/upload-form-control.js +1 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -1
- package/components/layouts/clients/phi-flex-layout-client.js +7 -1
- package/components/layouts/clients/phi-sequence-slot-editor.js +2 -1
- package/components/layouts/clients/phi-split-card-half.js +2 -1
- package/components/layouts/phi-base-layout.js +2 -1
- package/components/layouts/phi-layout-surface-box.js +2 -1
- package/components/media/phi-media-picker-server.js +3 -11
- package/components/navigation/use-phi-protected-mail.js +1 -9
- package/components/regions/presets/clients/sider-context.js +4 -2
- package/components/root/phi-config-provider.js +2 -1
- package/components/root/phi-dayjs-locale.d.ts +4 -1
- package/components/root/phi-dayjs-locale.js +2 -2
- package/components/root/phi-intl-locale.d.ts +7 -1
- package/components/root/phi-intl-locale.js +20 -15
- package/components/root/phi-root-layout.js +2 -1
- package/components/runtime/core-runtime-controller-plugin.d.ts +0 -84
- package/components/runtime/core-runtime-controller-plugin.js +1 -1
- package/components/runtime/runtime-controller-server-host.js +20 -9
- package/components/runtime/runtime-signal-bus.js +39 -4
- package/components/shell/phi-antd-icon.d.ts +3 -0
- package/components/shell/phi-antd-icon.js +9 -0
- package/components/state/use-phi-hydrated.d.ts +6 -0
- package/components/state/use-phi-hydrated.js +11 -0
- package/components/tables/phi-plain-table.d.ts +4 -0
- package/components/tables/phi-plain-table.js +1 -1
- package/components/widgets/client/shared/phi-rendered-value.js +4 -3
- package/components/widgets/config/parser-primitives.d.ts +5 -0
- package/components/widgets/config/parser-primitives.js +11 -0
- package/components/widgets/label-sets/runtime-options.d.ts +1 -1
- package/components/widgets/server/builder-chrome.js +2 -6
- package/components/widgets/server/search.js +2 -6
- package/components/widgets/shared/markdown-body-client.d.ts +7 -0
- package/components/widgets/shared/markdown-body-client.js +2 -0
- package/components/widgets/shared/markdown-render.js +48 -1
- package/controls.d.ts +2 -0
- package/controls.js +3 -0
- package/gateway/dashboard-cards-route.js +5 -7
- package/gateway/navigation-target-route.js +7 -9
- package/gateway/page-references-route.js +6 -8
- package/gateway/site-config.js +3 -0
- package/gateway/site-proxy.js +13 -2
- package/helpers/class-names.d.ts +7 -0
- package/helpers/class-names.js +10 -0
- package/helpers/cms-navigation-catalog.js +4 -2
- package/helpers/cms-page-catalog.js +35 -6
- package/helpers/cms-region-keys.d.ts +0 -1
- package/helpers/cms-region-keys.js +1 -1
- package/helpers/format-date-time.d.ts +14 -3
- package/helpers/format-date-time.js +27 -11
- package/helpers/region-page-scope.d.ts +1 -3
- package/helpers/region-page-scope.js +0 -4
- package/helpers/translation-format.d.ts +6 -0
- package/helpers/translation-format.js +15 -8
- package/package.json +2 -2
- package/plugins/runtime/phi-slot-child-frame-view.js +2 -1
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +1 -1
- package/plugins/runtime-modules/admin/forms.js +1 -1
- package/plugins/runtime-modules/admin/trees/phi-default-admin-settings-page-tree.js +2 -5
- package/plugins/runtime-modules/app/forms.js +1 -1
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +2 -6
- package/plugins/runtime-modules/asset/metadata-form.js +2 -6
- package/plugins/runtime-modules/asset/settings-forms.js +1 -1
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -5
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -6
- package/plugins/runtime-modules/asset/widgets/area-upload/server.js +2 -6
- package/plugins/runtime-modules/asset/widgets/image-inspector/authoring.js +1 -3
- package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -6
- package/plugins/runtime-modules/asset/widgets.js +5 -7
- package/plugins/runtime-modules/auth/admin-settings-forms.js +1 -1
- package/plugins/runtime-modules/auth/data-providers.d.ts +5 -0
- package/plugins/runtime-modules/auth/data-providers.js +3 -0
- package/plugins/runtime-modules/auth/definition.d.ts +5 -0
- package/plugins/runtime-modules/auth/ids.d.ts +7 -7
- package/plugins/runtime-modules/auth/ids.js +7 -7
- package/plugins/runtime-modules/auth/services/installations-table.js +3 -1
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +2 -6
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +26 -14
- package/plugins/runtime-modules/auth/widgets/security/client.js +5 -1
- package/plugins/runtime-modules/auth/widgets.d.ts +1 -2
- package/plugins/runtime-modules/auth/widgets.js +5 -7
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +2 -6
- package/plugins/runtime-modules/avatar/widgets/account-avatar/server.js +2 -6
- package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/server.js +2 -6
- package/plugins/runtime-modules/avatar/widgets.js +3 -5
- package/plugins/runtime-modules/builder/clients/pages-workspace.d.ts +2 -3
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +5 -18
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +1 -0
- package/plugins/runtime-modules/builder/controller/page-controller.js +1 -1
- package/plugins/runtime-modules/builder/controller/server-definition.js +3 -11
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +2 -6
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +2 -8
- package/plugins/runtime-modules/builder/developer-workspace-store.js +24 -44
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +0 -5
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +2 -1
- package/plugins/runtime-modules/builder/inspector-section-widget.js +6 -31
- package/plugins/runtime-modules/builder/navigation-persistence.js +12 -3
- package/plugins/runtime-modules/builder/page-meta-form.js +4 -12
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +0 -1
- package/plugins/runtime-modules/builder/page-presets.server.js +0 -24
- package/plugins/runtime-modules/builder/pages-workspace.js +6 -16
- package/plugins/runtime-modules/builder/persistence.d.ts +6 -4
- package/plugins/runtime-modules/builder/persistence.js +6 -7
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +0 -1
- package/plugins/runtime-modules/builder/shells-workspace.js +3 -11
- package/plugins/runtime-modules/builder/signal-wiring-form.js +3 -7
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +2 -6
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +6 -26
- package/plugins/runtime-modules/builder/trees/phi-default-builder-settings-page-tree.js +2 -6
- package/plugins/runtime-modules/builder/widgets/developer-builder-pages-header/plugin.js +2 -6
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.js +2 -6
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +3 -2
- package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +1 -6
- package/plugins/runtime-modules/builder/widgets.js +10 -12
- package/plugins/runtime-modules/client-authoring-module.js +18 -1
- package/plugins/runtime-modules/contracts.d.ts +15 -1
- package/plugins/runtime-modules/contracts.js +10 -0
- package/plugins/runtime-modules/core/messaging/forms.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/description/server.js +12 -9
- package/plugins/runtime-modules/core/widgets/dimension/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/draft-status/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/entry-list/config.js +2 -9
- package/plugins/runtime-modules/core/widgets/entry-list/view.server.js +1 -1
- package/plugins/runtime-modules/core/widgets/form-preview/client.js +2 -15
- package/plugins/runtime-modules/core/widgets/gallery/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/image/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/length/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/markdown-toc/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/page-title/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/pagination/config.js +4 -8
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/result/config.js +15 -10
- package/plugins/runtime-modules/core/widgets/result/server.js +1 -1
- package/plugins/runtime-modules/core/widgets/search-results/config.js +2 -8
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/server.js +8 -13
- package/plugins/runtime-modules/core/widgets/table/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/theme-mode-switch/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +16 -31
- package/plugins/runtime-modules/core/widgets/timeline/client.js +9 -4
- package/plugins/runtime-modules/core/widgets/tour-button/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
- package/plugins/runtime-modules/core/widgets.js +59 -61
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +7 -5
- package/plugins/runtime-modules/dashboard/trees/phi-default-admin-dashboard-page-tree.js +2 -6
- package/plugins/runtime-modules/dashboard/trees/phi-default-area-dashboard-page-tree.js +2 -6
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +2 -6
- package/plugins/runtime-modules/descriptor-compiler.js +6 -6
- package/plugins/runtime-modules/groups/controller/client.d.ts +0 -56
- package/plugins/runtime-modules/groups/controller/client.js +1 -1
- package/plugins/runtime-modules/groups/forms.js +1 -5
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +2 -6
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +2 -6
- package/plugins/runtime-modules/localization/forms.js +2 -6
- package/plugins/runtime-modules/localization/services/options.js +19 -9
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -11
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +3 -11
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +3 -11
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -109
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +2 -2
- package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -4
- package/plugins/runtime-modules/pub-area-preset.js +0 -20
- package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +5 -5
- package/plugins/runtime-modules/revisions/forms.js +1 -1
- package/plugins/runtime-modules/revisions/services/table.js +6 -2
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +2 -2
- package/plugins/runtime-modules/theme/controller/server-definition.js +2 -6
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +2 -6
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +17 -21
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +0 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +0 -8
- package/plugins/runtime-modules/theme/widgets.js +6 -8
- package/plugins/runtime-modules/threads/controller/client.d.ts +0 -78
- package/plugins/runtime-modules/threads/controller/client.js +1 -1
- package/plugins/runtime-modules/threads/forms.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +0 -1
- package/plugins/runtime-modules/threads/ids.js +0 -2
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +8 -6
- package/plugins/runtime-modules/user-management/controller/client.d.ts +0 -73
- package/plugins/runtime-modules/user-management/controller/client.js +1 -1
- package/plugins/runtime-modules/user-management/forms.js +1 -5
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +3 -7
- package/plugins/runtime-modules/video/widgets.js +2 -4
- package/server-helpers/cms-request.d.ts +19 -0
- package/server-helpers/cms-request.js +26 -8
- package/server-helpers/cms-root.js +27 -21
- package/server-helpers/public-login-route.js +6 -8
- package/server-helpers/runtime.js +1 -1
- package/server-helpers/search-index.js +34 -14
- package/styles/controls.css +11 -0
- package/styles/shell.css +11 -1
- package/types/length.js +8 -3
- package/types/site-config.d.ts +6 -4
- package/types/widget-runtime.d.ts +2 -3
- package/types.d.ts +5 -3
- package/types.js +3 -0
|
@@ -9,17 +9,13 @@ import { createPhiSignalAddress, createPhiSignalSubcontrolAddress, PHI_SIGNAL_VA
|
|
|
9
9
|
import { createPhiUserManagementControllerAddress, PHI_USER_MANAGEMENT_CONTROLLER_INSTANCE_KEY, PHI_USER_MANAGEMENT_CONTROLLER_TYPE, } from "../controller/address";
|
|
10
10
|
import { PHI_USER_MANAGEMENT_FORM_IDS } from "../forms";
|
|
11
11
|
import { PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS, PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS, PHI_USER_MANAGEMENT_PAGE_WIDGET_IDS, } from "../addresses";
|
|
12
|
-
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
13
12
|
import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
|
|
13
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
14
14
|
const SYNTHETIC_ADMIN_USERS_REGION_IDS = {
|
|
15
15
|
regionContent: -431,
|
|
16
16
|
};
|
|
17
17
|
export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
|
|
18
|
-
const labelOptions =
|
|
19
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
20
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
21
|
-
locale: runtime.locale.current,
|
|
22
|
-
};
|
|
18
|
+
const labelOptions = buildPhiWidgetLabelTranslatorOptions(runtime);
|
|
23
19
|
const [labels, widgetLabels] = await Promise.all([
|
|
24
20
|
getPhiAdminUsersPageLabels(labelOptions),
|
|
25
21
|
getPhiAdminUsersTableWidgetLabels(labelOptions),
|
|
@@ -298,7 +294,7 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
|
|
|
298
294
|
{ key: "lastLoginAt", fieldKey: "lastLoginAt", title: widgetLabels.columns.lastLogin, renderer: "datetime", sizing: { mode: "content" }, sortable: true },
|
|
299
295
|
{ key: "createdAt", fieldKey: "createdAt", title: widgetLabels.columns.created, renderer: "datetime", sizing: { mode: "content" }, sortable: true },
|
|
300
296
|
],
|
|
301
|
-
emptyState: widgetLabels.empty,
|
|
297
|
+
emptyState: { title: widgetLabels.empty.title, description: widgetLabels.empty.text },
|
|
302
298
|
footer: {
|
|
303
299
|
template: widgetLabels.footer,
|
|
304
300
|
values: [
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { PHI_VIDEO_RUNTIME_MODULE_ID } from "./ids";
|
|
2
2
|
import { PHI_VIDEO_EMBED_WIDGET_DEFINITION } from "./widgets/embed/config";
|
|
3
|
-
|
|
4
|
-
return options;
|
|
5
|
-
}
|
|
3
|
+
import { definePhiFirstPartyWidget } from "../contracts";
|
|
6
4
|
export const PHI_VIDEO_RUNTIME_MODULE_WIDGETS = [
|
|
7
|
-
|
|
5
|
+
definePhiFirstPartyWidget({
|
|
8
6
|
definition: PHI_VIDEO_EMBED_WIDGET_DEFINITION,
|
|
9
7
|
ownerModuleId: PHI_VIDEO_RUNTIME_MODULE_ID,
|
|
10
8
|
renderPolicies: { runtime: "custom", preview: "custom", authoring: "custom" },
|
|
@@ -2,6 +2,7 @@ import "server-only";
|
|
|
2
2
|
import { type PhiCmsAreaKey } from "../constants/cms-areas";
|
|
3
3
|
import type { PhiResolvedCmsAreaPresetPayload, PhiResolvedCmsPagePayload } from "../types/cms";
|
|
4
4
|
import type { PhiResolvedCmsRequest, PhiRuntimeModuleCatalog, PhiRuntimeModuleId } from "../types/cms-plugins";
|
|
5
|
+
import { resolvePhiCmsDescriptorCatalog } from "../plugins/runtime-modules/descriptor-compiler";
|
|
5
6
|
import type { PhiCapabilitySnapshot } from "../types/server-capabilities";
|
|
6
7
|
import type { PhiSiteRequestContext } from "../types/site-request-context";
|
|
7
8
|
type LoadPhiResolvedCmsPage = (path: string, sourcePreset?: {
|
|
@@ -41,6 +42,24 @@ export type ResolvePhiCmsRequestArgs = {
|
|
|
41
42
|
*/
|
|
42
43
|
purpose?: "render" | "lookup" | "refusal";
|
|
43
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* What an Area answers under a preset: the active Module ids and the route table compiled from them.
|
|
47
|
+
*
|
|
48
|
+
* Nine readers -- the page request, the root shell, the dashboard cards, the navigation targets, the
|
|
49
|
+
* page references, the public login, the search index and two more -- each wrote these two steps out,
|
|
50
|
+
* and the two reads of the Area config between them. Stated once, the readers cannot drift in which
|
|
51
|
+
* config they compile from.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolvePhiAreaRouteScope(input: {
|
|
54
|
+
runtimeModuleCatalog: PhiRuntimeModuleCatalog;
|
|
55
|
+
catalog: ReturnType<typeof resolvePhiCmsDescriptorCatalog>;
|
|
56
|
+
area: PhiCmsAreaKey;
|
|
57
|
+
preset: PhiResolvedCmsAreaPresetPayload["preset"] | null;
|
|
58
|
+
serverCapabilities: PhiCapabilitySnapshot | null;
|
|
59
|
+
}): {
|
|
60
|
+
activeModuleIds: Set<`${string}/${string}`>;
|
|
61
|
+
routeTable: import("../types/cms-module-descriptors").PhiCmsActiveRouteTable;
|
|
62
|
+
};
|
|
44
63
|
export declare function resolveActivePresetModuleKeys(runtimeModuleCatalog: PhiRuntimeModuleCatalog, area: PhiCmsAreaKey, areaPreset: Pick<PhiResolvedCmsAreaPresetPayload, "preset"> | null, serverCapabilities: PhiCapabilitySnapshot | null): Set<`${string}/${string}`>;
|
|
45
64
|
export declare function resolvePhiCmsRequest({ siteKey, locale, area, path, cookieHeader, apiBaseUrl, internalToken, requestContext, searchParams, loadResolvedCmsPage, loadExactCmsArea, runtimeModuleCatalog, purpose, }: ResolvePhiCmsRequestArgs): Promise<PhiResolvedCmsRequest | null>;
|
|
46
65
|
export declare const loadPhiResolvedCmsRequest: (siteKey: string, locale: string, area: PhiCmsAreaKey, path: string, cookieHeader: string, apiBaseUrl: string | undefined, internalToken: string | undefined, requestContext: PhiSiteRequestContext | undefined, searchParams: Record<string, string | undefined> | undefined, runtimeModuleCatalog: PhiRuntimeModuleCatalog, purpose?: ResolvePhiCmsRequestArgs["purpose"]) => Promise<PhiResolvedCmsRequest | null>;
|
|
@@ -59,6 +59,25 @@ function resolveAreaOwnedStoragePath(path, areaMask) {
|
|
|
59
59
|
}
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* What an Area answers under a preset: the active Module ids and the route table compiled from them.
|
|
64
|
+
*
|
|
65
|
+
* Nine readers -- the page request, the root shell, the dashboard cards, the navigation targets, the
|
|
66
|
+
* page references, the public login, the search index and two more -- each wrote these two steps out,
|
|
67
|
+
* and the two reads of the Area config between them. Stated once, the readers cannot drift in which
|
|
68
|
+
* config they compile from.
|
|
69
|
+
*/
|
|
70
|
+
export function resolvePhiAreaRouteScope(input) {
|
|
71
|
+
const activeModuleIds = resolveActivePresetModuleKeys(input.runtimeModuleCatalog, input.area, input.preset ? { preset: input.preset } : null, input.serverCapabilities);
|
|
72
|
+
const routeTable = compilePhiCmsActiveRouteTable({
|
|
73
|
+
catalog: input.catalog,
|
|
74
|
+
area: input.area,
|
|
75
|
+
activeModuleIds,
|
|
76
|
+
publicRoutePaths: readPhiAreaPublicRoutePaths(input.preset?.preset.config),
|
|
77
|
+
landingSelection: readPhiAreaLandingSelection(input.preset?.preset.config),
|
|
78
|
+
});
|
|
79
|
+
return { activeModuleIds, routeTable };
|
|
80
|
+
}
|
|
62
81
|
export function resolveActivePresetModuleKeys(runtimeModuleCatalog, area, areaPreset, serverCapabilities) {
|
|
63
82
|
const platformModuleId = runtimeModuleCatalog.platformModuleId;
|
|
64
83
|
if (!platformModuleId) {
|
|
@@ -178,18 +197,17 @@ export async function resolvePhiCmsRequest({ siteKey, locale, area, path, cookie
|
|
|
178
197
|
const effectiveAreaPreset = exactAreaPreset ?? localAreaPreset;
|
|
179
198
|
const siteId = localAreaPreset?.preset.preset.siteId ?? resolvedRequestContext.site.id;
|
|
180
199
|
const areaOwnedStoragePath = resolveAreaOwnedStoragePath(path, areaMask);
|
|
181
|
-
const
|
|
200
|
+
const { activeModuleIds: activeModuleKeys, routeTable } = resolvePhiAreaRouteScope({
|
|
201
|
+
runtimeModuleCatalog,
|
|
202
|
+
catalog,
|
|
203
|
+
area: requestedAreaKey,
|
|
204
|
+
preset: effectiveAreaPreset?.preset ?? null,
|
|
205
|
+
serverCapabilities: resolvedRequestContext.serverCapabilities,
|
|
206
|
+
});
|
|
182
207
|
const runtimeWithAuthProvider = {
|
|
183
208
|
...runtime,
|
|
184
209
|
authUiProvider: resolvePhiAuthUiRuntimeProjection(runtimeModuleCatalog, activeModuleKeys, requestedAreaKey),
|
|
185
210
|
};
|
|
186
|
-
const routeTable = compilePhiCmsActiveRouteTable({
|
|
187
|
-
catalog,
|
|
188
|
-
area: requestedAreaKey,
|
|
189
|
-
activeModuleIds: activeModuleKeys,
|
|
190
|
-
publicRoutePaths: readPhiAreaPublicRoutePaths(effectiveAreaPreset?.preset.preset.config),
|
|
191
|
-
landingSelection: readPhiAreaLandingSelection(effectiveAreaPreset?.preset.preset.config),
|
|
192
|
-
});
|
|
193
211
|
if (ownsRequestState) {
|
|
194
212
|
setPhiRequestRuntime(runtimeWithAuthProvider);
|
|
195
213
|
setPhiRequestNavigationContext(requestedAreaKey, catalog, activeModuleKeys, routeTable);
|
|
@@ -11,10 +11,9 @@ import { getPhiExactSiteArea } from "./cms";
|
|
|
11
11
|
import { hasPhiCmsAuthorizedPreviewRead, resolvePhiCmsReviewParams, resolvePhiCmsRevisionFromSearchParams, resolvePhiCmsThemeReviewRequestContext, } from "./cms-review";
|
|
12
12
|
import { setPhiRequestNavigationContext, setPhiRequestRuntime, } from "./request-runtime";
|
|
13
13
|
import { buildPhiBlockRuntime, loadPhiSiteRequestContext } from "./runtime";
|
|
14
|
-
import {
|
|
15
|
-
import { readPhiAreaLandingSelection, readPhiAreaPublicRoutePaths, } from "../helpers/cms-area-config";
|
|
14
|
+
import { composePhiCmsActiveAreaOverlayPresets, resolvePhiCmsAreaShellPresetBinding, resolvePhiCmsDescriptorCatalog, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
16
15
|
import { resolvePhiAuthUiRuntimeProjection } from "./auth-ui-provider";
|
|
17
|
-
import {
|
|
16
|
+
import { resolvePhiAreaRouteScope } from "./cms-request";
|
|
18
17
|
import { applyPhiBackgroundAssetProjection, resolvePhiBackgroundAssetProjection, } from "../components/widgets/helpers/background-reference-resolver.server";
|
|
19
18
|
import { PHIS_CLIENT_NAVIGATION_HEADER, PHIS_REQUEST_PATH_HEADER, PHIS_REQUEST_SEARCH_HEADER, } from "../constants/http-headers";
|
|
20
19
|
import { isPhiStaticCmsSiteBridge } from "./static-render";
|
|
@@ -80,26 +79,20 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
80
79
|
const { request, cookieHeader } = await loadPhiCmsServerRequest(cmsBridge, root, path);
|
|
81
80
|
const effectivePath = path && path.length > 0 ? path : derivePathSegmentsFromRequestPath(root, request.pathname);
|
|
82
81
|
const resolvedRoute = await resolveCmsRootRoute(root, effectivePath, bridgeRuntime);
|
|
83
|
-
const baseRequestContext = await loadPhiSiteRequestContext(siteKey, resolvedRoute.locale, cookieHeader, bridgeRuntime?.apiBaseUrl, bridgeRuntime?.internalToken);
|
|
84
|
-
const requestContext = await resolvePhiCmsThemeReviewRequestContext({
|
|
85
|
-
requestContext: baseRequestContext,
|
|
86
|
-
searchParams: request.searchParams,
|
|
87
|
-
cookieHeader,
|
|
88
|
-
});
|
|
89
82
|
const resolvedAreaMask = resolvePhiCmsAreaMask(resolvedRoute.area);
|
|
90
83
|
const review = resolvePhiCmsReviewParams(request.searchParams);
|
|
91
|
-
const runtime = buildPhiBlockRuntime({
|
|
92
|
-
requestContext,
|
|
93
|
-
areaMask: resolvedAreaMask,
|
|
94
|
-
request,
|
|
95
|
-
});
|
|
96
|
-
setPhiRequestRuntime(runtime);
|
|
97
84
|
const descriptorCatalog = resolvePhiCmsDescriptorCatalog(cmsBridge.runtimeModuleCatalog);
|
|
98
85
|
const areaShellBinding = resolvePhiCmsAreaShellPresetBinding(descriptorCatalog, resolvedRoute.area);
|
|
99
86
|
if (!areaShellBinding) {
|
|
100
87
|
throw new Error(`Area "${resolvedRoute.area}" has no shell preset binding.`);
|
|
101
88
|
}
|
|
102
|
-
|
|
89
|
+
/*
|
|
90
|
+
* The stored Area needs the route, the cookie and the review, none of which the request context
|
|
91
|
+
* supplies, so its read starts here and travels beside the context's. A failure is kept for the
|
|
92
|
+
* `await` below; the empty handler only stops it from being reported as unhandled when the context
|
|
93
|
+
* read fails first and that `await` is never reached.
|
|
94
|
+
*/
|
|
95
|
+
const exactAreaPresetRead = getPhiExactSiteArea({
|
|
103
96
|
path: resolvedRoute.cmsPath,
|
|
104
97
|
apiBaseUrl: bridgeRuntime?.apiBaseUrl,
|
|
105
98
|
internalToken: bridgeRuntime?.internalToken,
|
|
@@ -113,6 +106,20 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
113
106
|
presetKey: areaShellBinding.descriptor.presetKey,
|
|
114
107
|
},
|
|
115
108
|
});
|
|
109
|
+
exactAreaPresetRead.catch(() => undefined);
|
|
110
|
+
const baseRequestContext = await loadPhiSiteRequestContext(siteKey, resolvedRoute.locale, cookieHeader, bridgeRuntime?.apiBaseUrl, bridgeRuntime?.internalToken);
|
|
111
|
+
const requestContext = await resolvePhiCmsThemeReviewRequestContext({
|
|
112
|
+
requestContext: baseRequestContext,
|
|
113
|
+
searchParams: request.searchParams,
|
|
114
|
+
cookieHeader,
|
|
115
|
+
});
|
|
116
|
+
const runtime = buildPhiBlockRuntime({
|
|
117
|
+
requestContext,
|
|
118
|
+
areaMask: resolvedAreaMask,
|
|
119
|
+
request,
|
|
120
|
+
});
|
|
121
|
+
setPhiRequestRuntime(runtime);
|
|
122
|
+
const exactAreaPreset = await exactAreaPresetRead;
|
|
116
123
|
/*
|
|
117
124
|
* The code-owned Shell only where the Site has none stored. Building it beside the read, to save the
|
|
118
125
|
* round trip on a Site that never saved its Area, cost every other Site a full Shell instantiation --
|
|
@@ -128,17 +135,16 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
|
|
|
128
135
|
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
129
136
|
});
|
|
130
137
|
const baseResolvedAreaPreset = exactAreaPreset?.preset ?? localAreaPreset?.preset ?? null;
|
|
131
|
-
const activeModuleIds = resolveActivePresetModuleKeys(cmsBridge.runtimeModuleCatalog, resolvedRoute.area, baseResolvedAreaPreset ? { preset: baseResolvedAreaPreset } : null, requestContext.serverCapabilities);
|
|
132
138
|
/*
|
|
133
139
|
* The same table the page request compiles, from the same Area config: what the shell's navigation
|
|
134
140
|
* links has to be what the request answers, assigned Public addresses and the awarded root included.
|
|
135
141
|
*/
|
|
136
|
-
const routeTable =
|
|
142
|
+
const { activeModuleIds, routeTable } = resolvePhiAreaRouteScope({
|
|
143
|
+
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
137
144
|
catalog: descriptorCatalog,
|
|
138
145
|
area: resolvedRoute.area,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
landingSelection: readPhiAreaLandingSelection(baseResolvedAreaPreset?.preset.config),
|
|
146
|
+
preset: baseResolvedAreaPreset,
|
|
147
|
+
serverCapabilities: requestContext.serverCapabilities,
|
|
142
148
|
});
|
|
143
149
|
const composedAreaPreset = baseResolvedAreaPreset
|
|
144
150
|
? await composePhiCmsActiveAreaOverlayPresets({
|
|
@@ -5,11 +5,10 @@ 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 {
|
|
9
|
-
import { compilePhiCmsActiveRouteTable, resolvePhiCmsAreaShellPresetBinding, resolvePhiCmsDescriptorCatalog, resolvePhiCmsRoutePresetByPageId, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
8
|
+
import { resolvePhiCmsAreaShellPresetBinding, resolvePhiCmsDescriptorCatalog, resolvePhiCmsRoutePresetByPageId, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
10
9
|
import { PHI_PUBLIC_LOGIN_ROUTE_IDENTITY } from "../constants/public-login-route";
|
|
11
10
|
import { createPhiPresetCmsPageId } from "../types/cms-instance-id";
|
|
12
|
-
import {
|
|
11
|
+
import { resolvePhiAreaRouteScope } from "./cms-request";
|
|
13
12
|
import { PHIS_REQUEST_PATH_HEADER, PHIS_REQUEST_SEARCH_HEADER } from "../constants/http-headers";
|
|
14
13
|
import { readPhiServerApiCredentials } from "../helpers/phis-server-credentials";
|
|
15
14
|
/** The address the Auth Module declares for signing in; what a Site that reassigned it answers is in the table. */
|
|
@@ -72,13 +71,12 @@ export const resolvePhiPublicLoginHref = cache(async function resolvePhiPublicLo
|
|
|
72
71
|
presetKey: shellBinding.descriptor.presetKey,
|
|
73
72
|
},
|
|
74
73
|
});
|
|
75
|
-
const
|
|
76
|
-
|
|
74
|
+
const { routeTable } = resolvePhiAreaRouteScope({
|
|
75
|
+
runtimeModuleCatalog: cmsBridge.runtimeModuleCatalog,
|
|
77
76
|
catalog,
|
|
78
77
|
area: "public",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
landingSelection: readPhiAreaLandingSelection(areaPreset?.preset.preset.config),
|
|
78
|
+
preset: areaPreset?.preset ?? null,
|
|
79
|
+
serverCapabilities: serverCapabilities ?? null,
|
|
82
80
|
});
|
|
83
81
|
const login = resolvePhiCmsRoutePresetByPageId(routeTable, PHI_PUBLIC_LOGIN_PAGE_ID);
|
|
84
82
|
return login ? localizeAreaPath(locale, "public", login.descriptor.path) : null;
|
|
@@ -40,7 +40,7 @@ async function getPhiCmsRuntimeInfo({ apiBaseUrl, internalToken, siteKey, cookie
|
|
|
40
40
|
availableLocales: site.availableLocales,
|
|
41
41
|
defaultLocale: site.defaultLocale,
|
|
42
42
|
sourceLocale: site.sourceLocale,
|
|
43
|
-
|
|
43
|
+
timeZone: site.timeZone,
|
|
44
44
|
themeRevision: site.themeRevision,
|
|
45
45
|
/*
|
|
46
46
|
* The Theme record whole, with the mode decided: a Site that never chose one is light, which is the
|
|
@@ -3,15 +3,16 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
import { PHI_SEARCH_MAX_DOCUMENTS } from "@phis/contracts/search";
|
|
4
4
|
import { resolvePhiCmsPageRedirect } from "../components/cms/phi-cms-page-redirect";
|
|
5
5
|
import { getSiteAreaWithPublishedPages } from "../gateway/site-area";
|
|
6
|
+
import { getResolvedSiteConfig } from "../gateway/site-config";
|
|
6
7
|
import { onPhiSiteReadMarker } from "../gateway/site-read-marker-listeners";
|
|
7
8
|
import { fetchPhiSiteSearchIndexStates, putPhiSiteSearchIndexSet } from "../gateway/site-search";
|
|
8
|
-
import {
|
|
9
|
+
import { buildPhiRuntimeModuleAccessRegistry, filterPhiCmsRenderableTreeForViewer, } from "../helpers/cms-access-policy";
|
|
9
10
|
import { collectPhiSitemapCandidates } from "../helpers/phi-seo";
|
|
10
|
-
import {
|
|
11
|
+
import { resolvePhiCmsAreaShellPresetBinding, resolvePhiCmsDescriptorCatalog, } from "../plugins/runtime-modules/descriptor-compiler";
|
|
11
12
|
import { resolvePhiCmsAreaRuntimeModuleScope } from "../components/cms/phi-cms-runtime-registry";
|
|
12
13
|
import { canPhiViewerAccess } from "../types/access";
|
|
13
14
|
import { resolvePhiCmsLookup } from "./cms-lookup";
|
|
14
|
-
import {
|
|
15
|
+
import { resolvePhiAreaRouteScope } from "./cms-request";
|
|
15
16
|
import { runWithPhiRequestRuntime } from "./request-runtime";
|
|
16
17
|
import { loadPhiSiteRequestContext } from "./runtime";
|
|
17
18
|
import { joinPhiSearchText } from "./search-text";
|
|
@@ -162,6 +163,8 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, }) {
|
|
|
162
163
|
const areaMask = area === "public" ? 1 : 2;
|
|
163
164
|
// The Site's languages and its server, read once as the anonymous reader; the locale is per set.
|
|
164
165
|
const anonymous = await loadPhiSiteRequestContext(siteKey, "", "", apiBaseUrl, internalToken);
|
|
166
|
+
// The Site config's change markers, from the same answer the context above was built from.
|
|
167
|
+
const { readMarker, translationMarkers } = await getResolvedSiteConfig({ apiBaseUrl, internalToken, siteKey });
|
|
165
168
|
const locales = anonymous.site.availableLocales.map((option) => option.code);
|
|
166
169
|
const { area: areaPreset, publishedPages } = await getSiteAreaWithPublishedPages({
|
|
167
170
|
apiBaseUrl,
|
|
@@ -171,18 +174,24 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, }) {
|
|
|
171
174
|
sourcePreset,
|
|
172
175
|
area,
|
|
173
176
|
});
|
|
174
|
-
const activeModuleIds
|
|
175
|
-
|
|
177
|
+
const { activeModuleIds, routeTable } = resolvePhiAreaRouteScope({
|
|
178
|
+
runtimeModuleCatalog: bridge.runtimeModuleCatalog,
|
|
176
179
|
catalog,
|
|
177
180
|
area,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
landingSelection: readPhiAreaLandingSelection(areaPreset?.preset.preset.config),
|
|
181
|
+
preset: areaPreset?.preset ?? null,
|
|
182
|
+
serverCapabilities: anonymous.serverCapabilities,
|
|
181
183
|
});
|
|
182
184
|
const candidates = collectPhiSitemapCandidates({
|
|
183
185
|
moduleRoutes: [...routeTable.exactByPath].map(([path, descriptor]) => [path, descriptor]),
|
|
184
186
|
publishedPages,
|
|
185
187
|
});
|
|
188
|
+
/*
|
|
189
|
+
* The read marker and the translation markers are in here because what a Page says is not only its
|
|
190
|
+
* structure: a Widget bound to content reads the content's published version, and every text is
|
|
191
|
+
* translated. Publishing content moves the read marker (the Site's publish triggers), correcting a
|
|
192
|
+
* translation moves a translation marker, and without them here either left the old words in the
|
|
193
|
+
* index. The price is a run per published change, which is what SEARCH.md promises.
|
|
194
|
+
*/
|
|
186
195
|
const fingerprint = createHash("sha256").update(JSON.stringify({
|
|
187
196
|
format: PHI_SEARCH_INDEX_FORMAT,
|
|
188
197
|
area,
|
|
@@ -190,6 +199,8 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, }) {
|
|
|
190
199
|
areaPreset: areaPreset?.preset ?? null,
|
|
191
200
|
activeModuleIds: [...activeModuleIds].sort(),
|
|
192
201
|
locales,
|
|
202
|
+
readMarker,
|
|
203
|
+
translationMarkers,
|
|
193
204
|
})).digest("hex");
|
|
194
205
|
// The Area's Module scope as the live render resolves it: the preset's selection, the locked ones implied.
|
|
195
206
|
const { moduleSet } = await resolvePhiCmsAreaRuntimeModuleScope({
|
|
@@ -198,6 +209,8 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, }) {
|
|
|
198
209
|
areaPreset: areaPreset?.preset ?? null,
|
|
199
210
|
serverCapabilities: anonymous.serverCapabilities,
|
|
200
211
|
});
|
|
212
|
+
// The same access registry the live render filters a Page's tree with (phi-cms-page-render-scope.tsx).
|
|
213
|
+
const accessRegistry = buildPhiRuntimeModuleAccessRegistry(moduleSet);
|
|
201
214
|
const plugins = new Map();
|
|
202
215
|
const loadPlugin = (type) => {
|
|
203
216
|
let pending = plugins.get(type);
|
|
@@ -219,7 +232,7 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, }) {
|
|
|
219
232
|
if (heldFingerprint(areaMask, locale) === fingerprint)
|
|
220
233
|
continue;
|
|
221
234
|
const context = asIndexingReader(await loadPhiSiteRequestContext(siteKey, locale, "", apiBaseUrl, internalToken), area);
|
|
222
|
-
const documents = await readDocuments({ bridge, area, locale, context, candidates, loadPlugin });
|
|
235
|
+
const documents = await readDocuments({ bridge, area, locale, context, candidates, loadPlugin, accessRegistry });
|
|
223
236
|
const answer = await putPhiSiteSearchIndexSet({
|
|
224
237
|
...credentials,
|
|
225
238
|
area,
|
|
@@ -234,7 +247,7 @@ async function indexArea({ area, bridge, credentials, heldFingerprint, }) {
|
|
|
234
247
|
console.info(`[phis-ui] Search index ${area}/${locale}: ${answer.accepted ? `${answer.state.documentCount} documents written` : "already held"}.`);
|
|
235
248
|
}
|
|
236
249
|
}
|
|
237
|
-
async function readDocuments({ bridge, area, locale, context, candidates, loadPlugin, }) {
|
|
250
|
+
async function readDocuments({ bridge, area, locale, context, candidates, loadPlugin, accessRegistry, }) {
|
|
238
251
|
const documents = new Array(candidates.length).fill(null);
|
|
239
252
|
let next = 0;
|
|
240
253
|
async function work() {
|
|
@@ -242,7 +255,7 @@ async function readDocuments({ bridge, area, locale, context, candidates, loadPl
|
|
|
242
255
|
const index = next++;
|
|
243
256
|
const path = candidates[index].path;
|
|
244
257
|
try {
|
|
245
|
-
documents[index] = await readDocument({ bridge, area, locale, context, path, loadPlugin });
|
|
258
|
+
documents[index] = await readDocument({ bridge, area, locale, context, path, loadPlugin, accessRegistry });
|
|
246
259
|
}
|
|
247
260
|
catch (error) {
|
|
248
261
|
console.error(`[phis-ui] The search index could not read ${area}:${path} (${locale}).`, error);
|
|
@@ -257,9 +270,11 @@ async function readDocuments({ bridge, area, locale, context, candidates, loadPl
|
|
|
257
270
|
/**
|
|
258
271
|
* One Page as a document, or `null` where a reader of this Area would not get one: nothing resolves
|
|
259
272
|
* there, it forwards, it asked to stay out of the index, or its access policy is narrower than the
|
|
260
|
-
* reader's. The words are the Page's title and description and every Widget's own answer, in tree order
|
|
273
|
+
* reader's. The words are the Page's title and description and every Widget's own answer, in tree order
|
|
274
|
+
* -- of the Widgets this reader would see: a Layout or Widget with a narrower policy than the Page's is
|
|
275
|
+
* left out here as the live render leaves it out, so its words never reach a reader it is hidden from.
|
|
261
276
|
*/
|
|
262
|
-
async function readDocument({ bridge, area, locale, context, path, loadPlugin, }) {
|
|
277
|
+
async function readDocument({ bridge, area, locale, context, path, loadPlugin, accessRegistry, }) {
|
|
263
278
|
const resolved = await resolvePhiCmsLookup({
|
|
264
279
|
bridge,
|
|
265
280
|
area,
|
|
@@ -284,9 +299,14 @@ async function readDocument({ bridge, area, locale, context, path, loadPlugin, }
|
|
|
284
299
|
* timer after a publish. Without this scope every Widget that translates fails and a Page is indexed
|
|
285
300
|
* by title and description alone, which is what the first production index was.
|
|
286
301
|
*/
|
|
302
|
+
const visible = filterPhiCmsRenderableTreeForViewer({
|
|
303
|
+
tree: resolved.page,
|
|
304
|
+
viewer: resolved.runtime.viewer,
|
|
305
|
+
registry: accessRegistry,
|
|
306
|
+
});
|
|
287
307
|
const lines = await runWithPhiRequestRuntime(resolved.runtime, async () => {
|
|
288
308
|
const collected = [];
|
|
289
|
-
for (const widget of
|
|
309
|
+
for (const widget of visible.contentWidgets) {
|
|
290
310
|
const plugin = await loadPlugin(widget.widgetType);
|
|
291
311
|
if (!plugin?.searchText)
|
|
292
312
|
continue;
|
package/styles/controls.css
CHANGED
|
@@ -698,11 +698,22 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
698
698
|
color: var(--ant-color-text);
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
+
/*
|
|
702
|
+
* No syllable breaks in a cell: a column is narrow by nature, and running text's `hyphens: auto` cut its
|
|
703
|
+
* words into pieces there. A cell breaks between words, and a word longer than its column still breaks
|
|
704
|
+
* rather than running into the next.
|
|
705
|
+
*/
|
|
701
706
|
.phi-plain-table th,
|
|
702
707
|
.phi-plain-table td {
|
|
703
708
|
padding: var(--ant-padding-xs) var(--ant-padding-sm);
|
|
704
709
|
text-align: start;
|
|
705
710
|
vertical-align: top;
|
|
711
|
+
hyphens: manual;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/* A column of short entries stays on one line; the scroll box above takes what does not fit. */
|
|
715
|
+
.phi-plain-table .phi-plain-table__nowrap {
|
|
716
|
+
white-space: nowrap;
|
|
706
717
|
}
|
|
707
718
|
|
|
708
719
|
.phi-plain-table th {
|
package/styles/shell.css
CHANGED
|
@@ -626,8 +626,14 @@
|
|
|
626
626
|
* and stands at the inline start, off screen, until `PhiShellSiderDrawer` marks the Shell open. The
|
|
627
627
|
* `!important`s win over the Region's inline geometry, which is the column's. Fixed inside the Shell
|
|
628
628
|
* means fixed to the Shell, a container: `--phi-shell-sider-drawer-top` moves it to the viewport's top.
|
|
629
|
+
*
|
|
630
|
+
* The button is portalled into `header_main`, and a Region's children are `display: flex` by a rule of
|
|
631
|
+
* two classes (`.shell-sider-full .phi-shell-region > *`). One class lost to it: the button stood under
|
|
632
|
+
* the brand on every width. Both display rules for the button are therefore stated through the Region
|
|
633
|
+
* as well, three classes, so the width decides and not the order of the sheet.
|
|
629
634
|
* ---------------------------------------------------------------------------------------------- */
|
|
630
635
|
.phi-shell-sider-drawer-button,
|
|
636
|
+
.phi-shell-region > .phi-shell-sider-drawer-button.phi-shell-sider-drawer-button,
|
|
631
637
|
.phi-shell-sider-drawer-mask {
|
|
632
638
|
display: none;
|
|
633
639
|
}
|
|
@@ -690,8 +696,12 @@
|
|
|
690
696
|
background: var(--ant-color-bg-mask);
|
|
691
697
|
}
|
|
692
698
|
|
|
693
|
-
.phi-shell-sider-drawer-button
|
|
699
|
+
.phi-shell-sider-drawer-button,
|
|
700
|
+
.phi-shell-region > .phi-shell-sider-drawer-button.phi-shell-sider-drawer-button {
|
|
694
701
|
display: inline-flex;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.phi-shell-sider-drawer-button {
|
|
695
705
|
position: absolute;
|
|
696
706
|
inset-inline-start: var(--ant-padding-xs);
|
|
697
707
|
top: 50%;
|
package/types/length.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const PHI_CSS_LENGTH_UNITS = ["px", "%", "em", "rem", "vw", "vh"];
|
|
2
2
|
const CSS_LENGTH_PATTERN = /^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(px|%|em|rem|vw|vh)$/;
|
|
3
|
+
const BARE_NUMBER_PATTERN = /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/;
|
|
3
4
|
export function readPhiCssLengthPart(value) {
|
|
4
5
|
if (typeof value === "number") {
|
|
5
6
|
return Number.isFinite(value) ? { value, unit: "px" } : null;
|
|
@@ -8,9 +9,13 @@ export function readPhiCssLengthPart(value) {
|
|
|
8
9
|
return null;
|
|
9
10
|
}
|
|
10
11
|
const trimmed = value.trim();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// `Number("")` is 0 and `Number("0x1f")` is 31: a field emptied in the Inspector read as "0px", and a
|
|
13
|
+
// hex literal as a length. Only a decimal, with or without a unit, is one.
|
|
14
|
+
if (!trimmed) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (BARE_NUMBER_PATTERN.test(trimmed)) {
|
|
18
|
+
return { value: Number(trimmed), unit: "px" };
|
|
14
19
|
}
|
|
15
20
|
const match = CSS_LENGTH_PATTERN.exec(trimmed);
|
|
16
21
|
if (!match) {
|
package/types/site-config.d.ts
CHANGED
|
@@ -73,13 +73,15 @@ export type PhiSiteConfig = {
|
|
|
73
73
|
* language a visitor is shown first, which is `defaultLocale` and may differ.
|
|
74
74
|
*/
|
|
75
75
|
sourceLocale: string;
|
|
76
|
+
/**
|
|
77
|
+
* The IANA zone every date and time of the Site is shown in (`phis site set --time-zone`). One zone
|
|
78
|
+
* for the server render and the browser: both format the same instant with it, so the text a page
|
|
79
|
+
* is hydrated against is the text the reader sees. Neither the host's zone nor the reader's.
|
|
80
|
+
*/
|
|
81
|
+
timeZone: string;
|
|
76
82
|
availableLocales: PhiSiteLocaleOption[];
|
|
77
83
|
/** What each served locale means, so a request naming one is resolved without asking Core. */
|
|
78
84
|
localeCapabilities: PhiLocaleCapability[];
|
|
79
|
-
/** Whether the Site runs a store; the server computes it for every Site, so it is never absent. */
|
|
80
|
-
store: {
|
|
81
|
-
enabled: boolean;
|
|
82
|
-
};
|
|
83
85
|
theme: PhiSiteTheme;
|
|
84
86
|
themeRevision: {
|
|
85
87
|
publishedRevisionId: number | null;
|
|
@@ -24,9 +24,8 @@ export type PhiBlockRuntimeSite = {
|
|
|
24
24
|
defaultLocale: string;
|
|
25
25
|
/** The language the Site's own words are written in (`PhiSiteConfig.sourceLocale`). */
|
|
26
26
|
sourceLocale: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
27
|
+
/** The IANA zone the Site's dates and times are shown in (`PhiSiteConfig.timeZone`). */
|
|
28
|
+
timeZone: string;
|
|
30
29
|
themeRevision?: {
|
|
31
30
|
publishedRevisionId: number | null;
|
|
32
31
|
workingDraftRevisionId: number | null;
|
package/types.d.ts
CHANGED
|
@@ -3,9 +3,11 @@ export * from "./types/cms-overlay";
|
|
|
3
3
|
export type * from "./types/cms-container";
|
|
4
4
|
export * from "./types/cms-instance-id";
|
|
5
5
|
export { type PhiCmsAreaDefinition, type PhiCmsAreaOverlayPresetDescriptor, type PhiCmsAreaShellCompositionSource, type PhiCmsAreaShellPresetBinding, type PhiCmsAreaShellPresetDescriptor, type PhiCmsDescriptorBuildContext, type PhiCmsNavigationAnchor, type PhiCmsNavigationAnchoredInjectionDescriptor, type PhiCmsNavigationAnchorPlacement, type PhiCmsNavigationBaseItemDescriptor, type PhiCmsNavigationCustomItem, type PhiCmsNavigationFolder, type PhiCmsNavigationFolderTarget, type PhiCmsNavigationInjectionDescriptor, type PhiCmsNavigationInjectionItemDescriptor, type PhiCmsNavigationItemOverride, type PhiCmsNavigationItemPlacement, type PhiCmsNavigationItemStanding, type PhiCmsNavigationKeyedInjectionDescriptor, type PhiCmsNavigationLabel, type PhiCmsNavigationSurfaceDescriptor, type PhiCmsPresetIdentity, type PhiCmsPresetSource, type PhiCmsRoutePresetBinding, type PhiCmsRoutePresetDescriptor, type PhiCmsThemeBlockBinding, type PhiCmsThemeBlockDescriptor, type PhiCmsThemeBlockKind, type PhiCmsThemeDescriptorContribution, type PhiCmsThemePresetBinding, type PhiCmsThemePresetDescriptor, type PhiRuntimeModuleId, } from "./types/cms-module-descriptors";
|
|
6
|
-
export
|
|
7
|
-
export type {
|
|
8
|
-
export
|
|
6
|
+
export { expandPhiBorderRadiusConfig, mergePhiBorderWidgetConfig, mergePhiCmsConfigValues, mergePhiPaddingWidgetConfig, normalizePhiPaddingWidgetConfig, } from "./types/cms-config";
|
|
7
|
+
export type { PhiCmsBorderWidgetConfig, PhiCmsPaddingWidgetConfig, PhiCmsPluginConfigBase, PhiCmsRenderableBlockConfigBase, } from "./types/cms-config";
|
|
8
|
+
export { readPhiCmsBorderWidgetConfig } from "./types/cms-border-config";
|
|
9
|
+
export { PHI_CMS_BORDER_SOURCES, readPhiCmsBorderSource, resolvePhiCmsBorderSource } from "./types/cms-border-source";
|
|
10
|
+
export type { PhiCmsBorderSource } from "./types/cms-border-source";
|
|
9
11
|
export type * from "./types/renderable-block";
|
|
10
12
|
export * from "./types/layout-style";
|
|
11
13
|
export * from "./types/control";
|
package/types.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from "./types/cms-overlay";
|
|
2
2
|
export * from "./types/cms-instance-id";
|
|
3
3
|
export {} from "./types/cms-module-descriptors";
|
|
4
|
+
export { expandPhiBorderRadiusConfig, mergePhiBorderWidgetConfig, mergePhiCmsConfigValues, mergePhiPaddingWidgetConfig, normalizePhiPaddingWidgetConfig, } from "./types/cms-config";
|
|
5
|
+
export { readPhiCmsBorderWidgetConfig } from "./types/cms-border-config";
|
|
6
|
+
export { PHI_CMS_BORDER_SOURCES, readPhiCmsBorderSource, resolvePhiCmsBorderSource } from "./types/cms-border-source";
|
|
4
7
|
export * from "./types/layout-style";
|
|
5
8
|
export * from "./types/control";
|
|
6
9
|
export * from "./types/calendar";
|