@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
|
@@ -196,6 +196,47 @@ function signInLabel(params) {
|
|
|
196
196
|
"Sign-in: nobody can sign in any more. " +
|
|
197
197
|
"Run phis auth restore-preset --site <site key> to bring it back.";
|
|
198
198
|
}
|
|
199
|
+
/** What the Modules table says when a Module that brings its own shell is switched on over a stored one. */
|
|
200
|
+
export const PHI_BUILDER_SHELL_PROVIDER_NOTICE = "This Module brings its own Header and Footer. The saved structure stays and comes back when the Module is switched off.";
|
|
201
|
+
/**
|
|
202
|
+
* The Module that already brings the shell of one of these Areas, if switching this one on there would
|
|
203
|
+
* make it the second. One provider per Area (MODULES.md): the newcomer is refused with the holder named,
|
|
204
|
+
* the way a Site Page on its package path refuses it (`package-path-taken`).
|
|
205
|
+
*/
|
|
206
|
+
export function findPhiBuilderShellProviderHolder(state, moduleId, cmsAreas) {
|
|
207
|
+
for (const areaKey of cmsAreas) {
|
|
208
|
+
if (!isPhiBuilderAreaKey(areaKey))
|
|
209
|
+
continue;
|
|
210
|
+
const providers = state.areaShellsByArea?.[areaKey]?.providerModuleIds ?? [];
|
|
211
|
+
if (!providers.includes(moduleId))
|
|
212
|
+
continue;
|
|
213
|
+
const holderModuleId = providers.find((candidate) => {
|
|
214
|
+
if (candidate === moduleId)
|
|
215
|
+
return false;
|
|
216
|
+
const definition = state.runtimeModuleDefinitions.find((entry) => entry.moduleId === candidate);
|
|
217
|
+
return definition != null && isModuleActiveInArea(state, definition, areaKey);
|
|
218
|
+
});
|
|
219
|
+
if (holderModuleId)
|
|
220
|
+
return { areaKey, holderModuleId };
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Whether switching this Module on in these Areas puts its shell over a structure the Area stores for
|
|
226
|
+
* another shell. Nothing is lost -- the structure is kept and applies again once the Module is off --
|
|
227
|
+
* but what the Area looks like changes at once, so it is said.
|
|
228
|
+
*/
|
|
229
|
+
export function coversPhiBuilderStoredShellStructure(state, moduleId, cmsAreas) {
|
|
230
|
+
return cmsAreas.some((areaKey) => {
|
|
231
|
+
if (!isPhiBuilderAreaKey(areaKey))
|
|
232
|
+
return false;
|
|
233
|
+
const shells = state.areaShellsByArea?.[areaKey];
|
|
234
|
+
return shells != null &&
|
|
235
|
+
shells.providerModuleIds.includes(moduleId) &&
|
|
236
|
+
shells.storedSource != null &&
|
|
237
|
+
shells.storedSource.ownerModuleId !== moduleId;
|
|
238
|
+
});
|
|
239
|
+
}
|
|
199
240
|
/**
|
|
200
241
|
* Whether switching this Module off in these Areas leaves Public with no Auth UI provider.
|
|
201
242
|
*
|
|
@@ -461,6 +502,26 @@ export function PhiBuilderRuntimeModulesTableProviderClient({ children }) {
|
|
|
461
502
|
}
|
|
462
503
|
return null;
|
|
463
504
|
};
|
|
505
|
+
const refuseShellProviderTaken = (cmsAreas) => {
|
|
506
|
+
if (!proposedActive)
|
|
507
|
+
return null;
|
|
508
|
+
const held = findPhiBuilderShellProviderHolder(builderState, definition.moduleId, cmsAreas);
|
|
509
|
+
if (!held)
|
|
510
|
+
return null;
|
|
511
|
+
const holderTitle = builderState.runtimeModuleDefinitions
|
|
512
|
+
.find((entry) => entry.moduleId === held.holderModuleId)?.title ?? held.holderModuleId;
|
|
513
|
+
return {
|
|
514
|
+
status: "rejected",
|
|
515
|
+
invalidation: "none",
|
|
516
|
+
errorCode: "shell-provider-taken",
|
|
517
|
+
message: `"${definition.title}" brings its own Header and Footer for Area ${areaLabelFor(held.areaKey, request.params)}, `
|
|
518
|
+
+ `where "${holderTitle}" already brings them. Switch "${holderTitle}" off there first.`,
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
// Said once the switch is accepted: the Area's look changes, and the structure it stored is kept.
|
|
522
|
+
const shellProviderNotice = (cmsAreas) => proposedActive && coversPhiBuilderStoredShellStructure(builderState, definition.moduleId, cmsAreas)
|
|
523
|
+
? { message: PHI_BUILDER_SHELL_PROVIDER_NOTICE }
|
|
524
|
+
: {};
|
|
464
525
|
const refusePackagePathTaken = (held) => ({
|
|
465
526
|
status: "rejected",
|
|
466
527
|
invalidation: "none",
|
|
@@ -548,6 +609,9 @@ export function PhiBuilderRuntimeModulesTableProviderClient({ children }) {
|
|
|
548
609
|
message: `"${definition.title}" is Area "${baseAreaKey}"'s Base module and always runs there.`,
|
|
549
610
|
};
|
|
550
611
|
}
|
|
612
|
+
const shellProviderTaken = refuseShellProviderTaken(definition.eligibleAreas);
|
|
613
|
+
if (shellProviderTaken)
|
|
614
|
+
return shellProviderTaken;
|
|
551
615
|
const heldPackagePath = await findSitePageOnPackagePath(definition.eligibleAreas);
|
|
552
616
|
if (heldPackagePath)
|
|
553
617
|
return refusePackagePathTaken(heldPackagePath);
|
|
@@ -573,7 +637,12 @@ export function PhiBuilderRuntimeModulesTableProviderClient({ children }) {
|
|
|
573
637
|
message: error instanceof Error ? error.message : "Invalid Module selection.",
|
|
574
638
|
};
|
|
575
639
|
}
|
|
576
|
-
return {
|
|
640
|
+
return {
|
|
641
|
+
status: "accepted",
|
|
642
|
+
invalidation: "view",
|
|
643
|
+
rowPatch: { active: proposedActive },
|
|
644
|
+
...shellProviderNotice(definition.eligibleAreas),
|
|
645
|
+
};
|
|
577
646
|
}
|
|
578
647
|
// An area_* checkbox: one Area's own choice.
|
|
579
648
|
const areaKey = request.fieldKey.startsWith("area_") ? request.fieldKey.slice("area_".length) : null;
|
|
@@ -596,6 +665,9 @@ export function PhiBuilderRuntimeModulesTableProviderClient({ children }) {
|
|
|
596
665
|
message: `"${definition.title}" is not eligible for Area "${areaKey}".`,
|
|
597
666
|
};
|
|
598
667
|
}
|
|
668
|
+
const areaShellProviderTaken = refuseShellProviderTaken([areaKey]);
|
|
669
|
+
if (areaShellProviderTaken)
|
|
670
|
+
return areaShellProviderTaken;
|
|
599
671
|
const heldAreaPackagePath = await findSitePageOnPackagePath([areaKey]);
|
|
600
672
|
if (heldAreaPackagePath)
|
|
601
673
|
return refusePackagePathTaken(heldAreaPackagePath);
|
|
@@ -621,7 +693,12 @@ export function PhiBuilderRuntimeModulesTableProviderClient({ children }) {
|
|
|
621
693
|
message: error instanceof Error ? error.message : "Invalid Module selection.",
|
|
622
694
|
};
|
|
623
695
|
}
|
|
624
|
-
return {
|
|
696
|
+
return {
|
|
697
|
+
status: "accepted",
|
|
698
|
+
invalidation: "view",
|
|
699
|
+
rowPatch: { [request.fieldKey]: proposedActive },
|
|
700
|
+
...shellProviderNotice([areaKey]),
|
|
701
|
+
};
|
|
625
702
|
};
|
|
626
703
|
return {
|
|
627
704
|
key: PHI_BUILDER_RUNTIME_DATA_PROVIDER_KEYS.runtimeModulesTable,
|
package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js
CHANGED
|
@@ -226,7 +226,6 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
226
226
|
label: "Builder inspector header",
|
|
227
227
|
config: {
|
|
228
228
|
anchor: { horizontal: "left", vertical: "middle" },
|
|
229
|
-
gap: PHI_SPACE.sm,
|
|
230
229
|
padding: 0,
|
|
231
230
|
paddingLeft: PHI_SPACE.lg,
|
|
232
231
|
},
|
|
@@ -134,5 +134,4 @@ export declare function buildPhiDefaultBuilderPagePresetTree({ page, runtime, ow
|
|
|
134
134
|
resolvedContent?: import("../../../../types").PhiCmsResolvedContent | null;
|
|
135
135
|
}[];
|
|
136
136
|
pageMeta?: import("../../../../types").PhiCmsResolvedPageMeta | null;
|
|
137
|
-
runtimeModuleIds?: PhiRuntimeModuleId[] | null;
|
|
138
137
|
}>;
|
|
@@ -18,7 +18,6 @@ import { PHI_BUILDER_RUNTIME_MODULE_ID } from "../ids";
|
|
|
18
18
|
import { PHI_BUILDER_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
19
19
|
import { PHI_BUILDER_MODULES_TABLE_ALL_AREAS_VALUE, PHI_BUILDER_MODULES_TABLE_FILTER_KEYS, } from "../data-providers";
|
|
20
20
|
import { PHI_BUILDER_NAVIGATION_DND_TYPE_PAGE } from "../../../../constants/builder-navigation-dnd";
|
|
21
|
-
import { createPhiDefaultAreaRuntimeModuleIds } from "../../area-module-defaults";
|
|
22
21
|
import { getPhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-sets/builder-chrome";
|
|
23
22
|
import { PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/builder-chrome";
|
|
24
23
|
import { getPhiRegionWidgetLabels } from "../../../../components/widgets/label-sets/region";
|
|
@@ -347,7 +346,6 @@ export async function buildPhiDefaultBuilderAreaPresetTree({ page, runtime, }) {
|
|
|
347
346
|
},
|
|
348
347
|
description: null,
|
|
349
348
|
},
|
|
350
|
-
runtimeModuleIds: createPhiDefaultAreaRuntimeModuleIds("builder"),
|
|
351
349
|
/*
|
|
352
350
|
* The Shell's own receivers: the header's Area selector and debug switch, which the Controller arms
|
|
353
351
|
* on the Pages that use them. The Inspector Overlay contribution adds its receivers to this setting
|
|
@@ -493,7 +491,6 @@ export async function buildPhiDefaultBuilderAreaPresetTree({ page, runtime, }) {
|
|
|
493
491
|
sortOrder: 0,
|
|
494
492
|
label: "dev header main right actions",
|
|
495
493
|
config: {
|
|
496
|
-
gap: PHI_SPACE.sm,
|
|
497
494
|
anchor: { horizontal: "right", vertical: "middle" },
|
|
498
495
|
wrap: false,
|
|
499
496
|
padding: 0,
|
|
@@ -904,7 +901,6 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
904
901
|
horizontal: "center",
|
|
905
902
|
vertical: "top",
|
|
906
903
|
},
|
|
907
|
-
gap: PHI_SPACE.sm,
|
|
908
904
|
margin: 0,
|
|
909
905
|
padding: PHI_SPACE.base,
|
|
910
906
|
},
|
|
@@ -927,7 +923,6 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
927
923
|
horizontal: "left",
|
|
928
924
|
vertical: "top",
|
|
929
925
|
},
|
|
930
|
-
gap: PHI_SPACE.sm,
|
|
931
926
|
wrap: true,
|
|
932
927
|
margin: 0,
|
|
933
928
|
padding: PHI_SPACE.base,
|
|
@@ -953,7 +948,6 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
953
948
|
horizontal: "center",
|
|
954
949
|
vertical: "top",
|
|
955
950
|
},
|
|
956
|
-
gap: PHI_SPACE.sm,
|
|
957
951
|
margin: 0,
|
|
958
952
|
padding: PHI_SPACE.base,
|
|
959
953
|
},
|
|
@@ -987,7 +981,6 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
987
981
|
config: {
|
|
988
982
|
balancedSides: true,
|
|
989
983
|
contentAlign: "center",
|
|
990
|
-
gap: PHI_SPACE.sm,
|
|
991
984
|
padding: PHI_SPACE.xs,
|
|
992
985
|
paddingLeft: 0,
|
|
993
986
|
paddingRight: 0,
|
|
@@ -1082,9 +1075,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1082
1075
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
1083
1076
|
sortOrder: 0,
|
|
1084
1077
|
label: "Builder area settings fields",
|
|
1085
|
-
config: {
|
|
1086
|
-
gap: PHI_SPACE.sm,
|
|
1087
|
-
},
|
|
1078
|
+
config: {},
|
|
1088
1079
|
}),
|
|
1089
1080
|
nodes.layout({
|
|
1090
1081
|
creationPreset: { layoutKind: "flex", preset: "overlay-actions" },
|
|
@@ -25,7 +25,7 @@ export declare function assignPhiWorkspacePublicRoutePaths(moduleId: PhiRuntimeM
|
|
|
25
25
|
/** Catalog fields an undo or redo puts back (`splitWorkspacePatch`). */
|
|
26
26
|
export declare function restorePhiWorkspaceCatalog(fields: Partial<PhiWorkspaceCatalogState>): void;
|
|
27
27
|
/** What the server rendered the Builder with, as its preload hands it in. */
|
|
28
|
-
export type PhiWorkspaceCatalogPreload = Pick<PhiWorkspaceCatalogState, "areaPresetSourcesByArea" | "unresolvedModuleIdsByArea" | "serverUnavailableModules" | "publicRouteClaims" | "publicRoutePaths"> & {
|
|
28
|
+
export type PhiWorkspaceCatalogPreload = Pick<PhiWorkspaceCatalogState, "areaPresetSourcesByArea" | "areaShellsByArea" | "unresolvedModuleIdsByArea" | "serverUnavailableModules" | "publicRouteClaims" | "publicRoutePaths"> & {
|
|
29
29
|
runtimeModuleDefinitions: readonly PhiWorkspaceCatalogState["runtimeModuleDefinitions"][number][];
|
|
30
30
|
runtimeModuleIdsByArea: Readonly<Record<string, PhiRuntimeModuleId[]>>;
|
|
31
31
|
/** The Pages and surfaces of the active Modules, which is what the catalog holds. */
|
|
@@ -39,6 +39,7 @@ export type PhiWorkspaceCatalogPreload = Pick<PhiWorkspaceCatalogState, "areaPre
|
|
|
39
39
|
runtimeModuleDefinitions: string;
|
|
40
40
|
modulePresetPagesByArea: string;
|
|
41
41
|
areaPresetSourcesByArea: string;
|
|
42
|
+
areaShellsByArea: string;
|
|
42
43
|
navigationSurfacesByArea: string;
|
|
43
44
|
unresolvedModuleIdsByArea: string;
|
|
44
45
|
publicRouteClaims: string;
|
|
@@ -96,6 +96,7 @@ export function applyPhiWorkspaceCatalogPreload(preload) {
|
|
|
96
96
|
const definitionsChanged = JSON.stringify(current.runtimeModuleDefinitions ?? []) !== preload.keys.runtimeModuleDefinitions;
|
|
97
97
|
const modulePresetPagesChanged = JSON.stringify(current.modulePresetPagesByArea) !== preload.keys.modulePresetPagesByArea;
|
|
98
98
|
const areaPresetSourcesChanged = JSON.stringify(current.areaPresetSourcesByArea) !== preload.keys.areaPresetSourcesByArea;
|
|
99
|
+
const areaShellsChanged = JSON.stringify(current.areaShellsByArea) !== preload.keys.areaShellsByArea;
|
|
99
100
|
const navigationSurfacesChanged = JSON.stringify(current.navigationSurfacesByArea) !== preload.keys.navigationSurfacesByArea;
|
|
100
101
|
const unresolvedModuleIdsChanged = JSON.stringify(current.unresolvedModuleIdsByArea) !== preload.keys.unresolvedModuleIdsByArea;
|
|
101
102
|
const publicRouteClaimsChanged = JSON.stringify(current.publicRouteClaims) !== preload.keys.publicRouteClaims;
|
|
@@ -119,7 +120,7 @@ export function applyPhiWorkspaceCatalogPreload(preload) {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
openedPageKey = initialPageChanged ? initialPageKey : null;
|
|
122
|
-
return changed || definitionsChanged || modulePresetPagesChanged || areaPresetSourcesChanged ||
|
|
123
|
+
return changed || definitionsChanged || modulePresetPagesChanged || areaPresetSourcesChanged || areaShellsChanged ||
|
|
123
124
|
navigationSurfacesChanged || unresolvedModuleIdsChanged || serverUnavailableModulesChanged ||
|
|
124
125
|
publicRouteClaimsChanged || publicRoutePathsChanged || catalogHydrationChanged || initialPageChanged
|
|
125
126
|
? {
|
|
@@ -130,6 +131,7 @@ export function applyPhiWorkspaceCatalogPreload(preload) {
|
|
|
130
131
|
catalogHydrated: true,
|
|
131
132
|
modulePresetPagesByArea: preload.activeCatalogs.modulePresetPagesByArea,
|
|
132
133
|
areaPresetSourcesByArea: preload.areaPresetSourcesByArea,
|
|
134
|
+
areaShellsByArea: preload.areaShellsByArea,
|
|
133
135
|
navigationSurfacesByArea: preload.activeCatalogs.navigationSurfacesByArea,
|
|
134
136
|
unresolvedModuleIdsByArea: preload.unresolvedModuleIdsByArea,
|
|
135
137
|
serverUnavailableModules: preload.serverUnavailableModules,
|
|
@@ -11,10 +11,10 @@ export declare const PHI_CASCADER_WIDGET_BUILDER_PLUGIN: {
|
|
|
11
11
|
icon?: string | undefined;
|
|
12
12
|
iconFamily?: string | undefined;
|
|
13
13
|
pluginKey: string;
|
|
14
|
-
runtimeSignals?: (import("../../../../../types").PhiSignalPluginMeta | null) | undefined;
|
|
15
14
|
typeKey: string;
|
|
16
15
|
iconName?: string | undefined;
|
|
17
16
|
commercial?: import("../../../../../types").PhiCmsPluginCommercialMeta | undefined;
|
|
17
|
+
runtimeSignals?: (import("../../../../../types").PhiSignalPluginMeta | null) | undefined;
|
|
18
18
|
signalSubcontrols?: readonly import("../../../../../types").PhiCmsWidgetSignalSubcontrolCollection[] | undefined;
|
|
19
19
|
requiredRuntimeControllers?: import("../../../../../types").PhiCmsWidgetRuntimeControllerRequirementResolver<PhiCascaderWidgetConfig> | undefined;
|
|
20
20
|
requiredDataProviders?: readonly import("@phis/contracts/controls").PhiRuntimeDataProviderKey[] | undefined;
|
|
@@ -2,7 +2,7 @@ import { type PhiCmsAreaKey } from "../../constants/cms-areas";
|
|
|
2
2
|
import type { PhiFormDescriptor } from "@phis/contracts/forms";
|
|
3
3
|
import { type PhiCmsInstanceId } from "../../types/cms-instance-id";
|
|
4
4
|
import type { PhiThemeFontsBlock, PhiThemeGroundBlock, PhiThemeSetBlock, PhiThemeStyleBlock } from "../../theme/phi-theme-blocks";
|
|
5
|
-
import type { PhiCmsActiveRouteTable, PhiCmsAreaDefinition, PhiCmsAreaShellPresetBinding, PhiCmsCompiledDescriptorCatalog, PhiCmsCompiledRoutePattern, PhiCmsNavigationOverlay, PhiCmsNavigationOverlayResolution, PhiCmsResolvedNavigationSurface, PhiCmsRoutePresetBinding, PhiCmsRoutePresetDescriptor, PhiCmsCompiledThemeDescriptors, PhiCmsThemeDescriptorContribution, PhiCmsThemePresetBinding, PhiRuntimeModuleId } from "../../types/cms-module-descriptors";
|
|
5
|
+
import type { PhiCmsActiveRouteTable, PhiCmsAreaDefinition, PhiCmsAreaShellPresetBinding, PhiCmsAreaShellProviderBinding, PhiCmsCompiledDescriptorCatalog, PhiCmsCompiledRoutePattern, PhiCmsNavigationOverlay, PhiCmsNavigationOverlayResolution, PhiCmsResolvedNavigationSurface, PhiCmsRoutePresetBinding, PhiCmsRoutePresetDescriptor, PhiCmsCompiledThemeDescriptors, PhiCmsThemeDescriptorContribution, PhiCmsThemePresetBinding, PhiRuntimeModuleId } from "../../types/cms-module-descriptors";
|
|
6
6
|
import type { PhiCmsPageNode, PhiResolvedCmsAreaPresetTree, PhiResolvedCmsPageTree } from "../../types/cms";
|
|
7
7
|
import type { PhiRuntimeModuleCatalog } from "../../types/cms-plugins";
|
|
8
8
|
import type { PhiBlockRuntime } from "../../types/widget-runtime";
|
|
@@ -78,7 +78,21 @@ export declare function resolvePhiCmsModuleNavigationFolderTargets(input: {
|
|
|
78
78
|
export declare function resolvePhiCmsNavigationOverlay(surface: PhiCmsResolvedNavigationSurface, overlay: PhiCmsNavigationOverlay | null): PhiCmsNavigationOverlayResolution;
|
|
79
79
|
export declare function resolvePhiCmsRoutePreset(table: PhiCmsActiveRouteTable, requestedPath: string): PhiCmsRoutePresetBinding | null;
|
|
80
80
|
export declare function resolvePhiCmsRoutePresetByPageId(table: PhiCmsActiveRouteTable, pageId: PhiCmsInstanceId): PhiCmsRoutePresetBinding | null;
|
|
81
|
-
|
|
81
|
+
/** The shell of the Area's base Module, whatever the Area runs: what it takes while no active Module brings one. */
|
|
82
|
+
export declare function resolvePhiCmsAreaBaseShellPresetBinding(catalog: PhiCmsCompiledDescriptorCatalog, area: PhiCmsAreaKey): PhiCmsAreaShellPresetBinding | null;
|
|
83
|
+
/** The shells optional Modules bring for the Area, active or not. */
|
|
84
|
+
export declare function listPhiCmsAreaShellProviders(catalog: PhiCmsCompiledDescriptorCatalog, area: PhiCmsAreaKey): readonly PhiCmsAreaShellProviderBinding[];
|
|
85
|
+
/**
|
|
86
|
+
* The Area's effective shell: the shell of the one active Module that brings one, otherwise the base
|
|
87
|
+
* shell. The active Modules are the Area's selection as `resolveActivePresetModuleKeys` reads it, so a
|
|
88
|
+
* provider that is installed but not selected -- or selected but off for want of its server half --
|
|
89
|
+
* changes nothing.
|
|
90
|
+
*
|
|
91
|
+
* Two active providers is a selection the Builder refuses to make (one provider per Area); a stored one
|
|
92
|
+
* that holds two anyway is refused here rather than settled by catalog order, which would hand the
|
|
93
|
+
* Area to whichever package happened to be listed first.
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolvePhiCmsAreaShellPresetBinding(catalog: PhiCmsCompiledDescriptorCatalog, area: PhiCmsAreaKey, activeModuleIds: ReadonlySet<PhiRuntimeModuleId>): PhiCmsAreaShellPresetBinding | null;
|
|
82
96
|
export declare function resolvePhiCmsRoutePresetByIdentity(catalog: PhiCmsCompiledDescriptorCatalog, ownerModuleId: PhiRuntimeModuleId, presetKey: string): PhiCmsRoutePresetDescriptor | null;
|
|
83
97
|
export declare function resolvePhiCmsThemePresetBinding(catalog: PhiCmsCompiledDescriptorCatalog, themeKey: string, activeModuleIds: ReadonlySet<PhiRuntimeModuleId>): PhiCmsThemePresetBinding | null;
|
|
84
98
|
export declare function instantiatePhiCmsThemePreset(binding: PhiCmsThemePresetBinding): Promise<import("../../theme").PhiThemePresetPlugin>;
|
|
@@ -8,7 +8,7 @@ import { canPhiViewerAccess, PHI_VIEWER_ACCESS_ANYONE, } from "../../types/acces
|
|
|
8
8
|
import { mergePhiCmsShellTrees, omitPhiCmsShellCompositionNodes, } from "./shell-tree-composition";
|
|
9
9
|
import { resolvePhiRuntimeModuleAreaRoutePath } from "../../helpers/runtime-module-route-path";
|
|
10
10
|
import { createPhiPageReference } from "../../types/references";
|
|
11
|
-
import { choosePhiAreaRootApplicant, orderPhiAreaPathClaimsByCover, isPhiAssignablePublicRoutePath, } from "../../helpers/cms-area-config";
|
|
11
|
+
import { choosePhiAreaRootApplicant, describePhiAreaShellSettingsError, orderPhiAreaPathClaimsByCover, isPhiAssignablePublicRoutePath, } from "../../helpers/cms-area-config";
|
|
12
12
|
import { resolvePhiLayoutCreationPreset } from "../../helpers/cms-layout-defaults";
|
|
13
13
|
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH, isPhiFormSingleColumn, } from "../../helpers/cms-dialog";
|
|
14
14
|
import { PhiCmsWidgetType } from "../../constants/cms-widget-types";
|
|
@@ -198,6 +198,13 @@ function assertAreaDefinitions(areaDefinitions, catalog) {
|
|
|
198
198
|
throw new Error(`Area "${definition.area}" base owner "${definition.baseModuleId}" must be a module contribution.`);
|
|
199
199
|
}
|
|
200
200
|
normalizeRequiredKey(definition.shellPresetKey, `${definition.area} shell preset key`);
|
|
201
|
+
if (definition.shellProviders !== "base" && definition.shellProviders !== "module") {
|
|
202
|
+
throw new Error(`Area "${definition.area}" must say who brings its shell ("base" or "module").`);
|
|
203
|
+
}
|
|
204
|
+
// The Builder repairs a broken shell; a shell a Module brought could lock the Site out of it.
|
|
205
|
+
if (definition.area === "builder" && definition.shellProviders !== "base") {
|
|
206
|
+
throw new Error('Area "builder" takes its shell from its base Module only.');
|
|
207
|
+
}
|
|
201
208
|
const navKeys = new Set();
|
|
202
209
|
for (const surface of definition.navigationSurfaces ?? []) {
|
|
203
210
|
if (surface.navKey !== surface.navKey.trim().toLowerCase()) {
|
|
@@ -249,7 +256,8 @@ function assertAreaDefinitions(areaDefinitions, catalog) {
|
|
|
249
256
|
}
|
|
250
257
|
export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
251
258
|
const definitionsByArea = assertAreaDefinitions(areaDefinitions, catalog);
|
|
252
|
-
const
|
|
259
|
+
const areaBaseShellByArea = new Map();
|
|
260
|
+
const areaShellProvidersByArea = new Map();
|
|
253
261
|
const areaShellByIdentity = new Map();
|
|
254
262
|
const areaOverlaysByArea = new Map();
|
|
255
263
|
const routeByIdentity = new Map();
|
|
@@ -285,6 +293,10 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
|
285
293
|
throw new Error(`${moduleId}: shell preset "${descriptor.presetKey}" has a different owner.`);
|
|
286
294
|
}
|
|
287
295
|
assertPositiveVersion(descriptor.shellPresetVersion, `${moduleId}/${descriptor.presetKey} shellPresetVersion`);
|
|
296
|
+
const settingsError = describePhiAreaShellSettingsError(descriptor.settings);
|
|
297
|
+
if (settingsError) {
|
|
298
|
+
throw new Error(`${moduleId}/${descriptor.presetKey}: ${settingsError}.`);
|
|
299
|
+
}
|
|
288
300
|
const areaDefinition = definitionsByArea.get(descriptor.area);
|
|
289
301
|
if (!areaDefinition) {
|
|
290
302
|
throw new Error(`${moduleId}/${descriptor.presetKey}: Area "${descriptor.area}" is not declared.`);
|
|
@@ -292,16 +304,35 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
|
292
304
|
if (!entry.definition.eligibleAreas.includes(descriptor.area)) {
|
|
293
305
|
throw new Error(`${moduleId}/${descriptor.presetKey}: owner module is not eligible for Area "${descriptor.area}".`);
|
|
294
306
|
}
|
|
295
|
-
if (areaDefinition.baseModuleId
|
|
296
|
-
areaDefinition.shellPresetKey !== descriptor.presetKey) {
|
|
297
|
-
|
|
307
|
+
if (areaDefinition.baseModuleId === moduleId) {
|
|
308
|
+
if (areaDefinition.shellPresetKey !== descriptor.presetKey) {
|
|
309
|
+
throw new Error(`${moduleId}/${descriptor.presetKey}: shell preset does not match Area "${descriptor.area}" base definition.`);
|
|
310
|
+
}
|
|
311
|
+
const identity = registerIdentity(descriptor.presetKey);
|
|
312
|
+
if (areaBaseShellByArea.has(descriptor.area)) {
|
|
313
|
+
throw new Error(`Area "${descriptor.area}" has more than one shell preset.`);
|
|
314
|
+
}
|
|
315
|
+
const binding = { descriptor };
|
|
316
|
+
areaBaseShellByArea.set(descriptor.area, binding);
|
|
317
|
+
areaShellByIdentity.set(identity, binding);
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
/*
|
|
321
|
+
* Another Module's shell for the Area: allowed only where the Area's definition takes one, and kept
|
|
322
|
+
* apart from the base shell. It stands in for the base while its Module is active there
|
|
323
|
+
* (`resolvePhiCmsAreaShellPresetBinding`); being installed changes nothing.
|
|
324
|
+
*/
|
|
325
|
+
if (areaDefinition.shellProviders !== "module") {
|
|
326
|
+
throw new Error(`${moduleId}/${descriptor.presetKey}: Area "${descriptor.area}" takes its shell from its base Module only.`);
|
|
298
327
|
}
|
|
299
328
|
const identity = registerIdentity(descriptor.presetKey);
|
|
300
|
-
|
|
301
|
-
|
|
329
|
+
const providers = areaShellProvidersByArea.get(descriptor.area) ?? new Map();
|
|
330
|
+
if (providers.has(moduleId)) {
|
|
331
|
+
throw new Error(`${moduleId}: more than one shell preset for Area "${descriptor.area}".`);
|
|
302
332
|
}
|
|
303
|
-
const binding = { descriptor };
|
|
304
|
-
|
|
333
|
+
const binding = { descriptor, moduleId };
|
|
334
|
+
providers.set(moduleId, binding);
|
|
335
|
+
areaShellProvidersByArea.set(descriptor.area, providers);
|
|
305
336
|
areaShellByIdentity.set(identity, binding);
|
|
306
337
|
}
|
|
307
338
|
for (const descriptor of entry.areaOverlays ?? []) {
|
|
@@ -357,7 +388,7 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
|
357
388
|
registerPhiCmsThemeDescriptors({ moduleId, themes: entry.themes, themeBlocks: entry.themeBlocks }, registerIdentity, { themeByKey, themeBlockByKey });
|
|
358
389
|
}
|
|
359
390
|
for (const [area, definition] of definitionsByArea) {
|
|
360
|
-
if (!
|
|
391
|
+
if (!areaBaseShellByArea.has(area)) {
|
|
361
392
|
throw new Error(`Area "${area}" is missing shell preset "${definition.baseModuleId}/${definition.shellPresetKey}".`);
|
|
362
393
|
}
|
|
363
394
|
}
|
|
@@ -627,7 +658,8 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
|
627
658
|
}
|
|
628
659
|
return {
|
|
629
660
|
areaDefinitions: definitionsByArea,
|
|
630
|
-
|
|
661
|
+
areaBaseShellByArea,
|
|
662
|
+
areaShellProvidersByArea,
|
|
631
663
|
areaShellByIdentity,
|
|
632
664
|
areaOverlaysByArea,
|
|
633
665
|
moduleNavigationByArea,
|
|
@@ -1399,8 +1431,32 @@ export function resolvePhiCmsRoutePresetByPageId(table, pageId) {
|
|
|
1399
1431
|
const descriptor = table.byPageId.get(pageId);
|
|
1400
1432
|
return descriptor ? { descriptor, params: {} } : null;
|
|
1401
1433
|
}
|
|
1402
|
-
|
|
1403
|
-
|
|
1434
|
+
/** The shell of the Area's base Module, whatever the Area runs: what it takes while no active Module brings one. */
|
|
1435
|
+
export function resolvePhiCmsAreaBaseShellPresetBinding(catalog, area) {
|
|
1436
|
+
return catalog.areaBaseShellByArea.get(area) ?? null;
|
|
1437
|
+
}
|
|
1438
|
+
/** The shells optional Modules bring for the Area, active or not. */
|
|
1439
|
+
export function listPhiCmsAreaShellProviders(catalog, area) {
|
|
1440
|
+
return [...(catalog.areaShellProvidersByArea.get(area)?.values() ?? [])];
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* The Area's effective shell: the shell of the one active Module that brings one, otherwise the base
|
|
1444
|
+
* shell. The active Modules are the Area's selection as `resolveActivePresetModuleKeys` reads it, so a
|
|
1445
|
+
* provider that is installed but not selected -- or selected but off for want of its server half --
|
|
1446
|
+
* changes nothing.
|
|
1447
|
+
*
|
|
1448
|
+
* Two active providers is a selection the Builder refuses to make (one provider per Area); a stored one
|
|
1449
|
+
* that holds two anyway is refused here rather than settled by catalog order, which would hand the
|
|
1450
|
+
* Area to whichever package happened to be listed first.
|
|
1451
|
+
*/
|
|
1452
|
+
export function resolvePhiCmsAreaShellPresetBinding(catalog, area, activeModuleIds) {
|
|
1453
|
+
const active = listPhiCmsAreaShellProviders(catalog, area)
|
|
1454
|
+
.filter((binding) => activeModuleIds.has(binding.moduleId));
|
|
1455
|
+
if (active.length > 1) {
|
|
1456
|
+
throw new Error(`Area "${area}" has more than one active Module that brings its shell: ` +
|
|
1457
|
+
`${active.map((binding) => binding.moduleId).join(", ")}. Switch all but one off.`);
|
|
1458
|
+
}
|
|
1459
|
+
return active[0] ?? resolvePhiCmsAreaBaseShellPresetBinding(catalog, area);
|
|
1404
1460
|
}
|
|
1405
1461
|
export function resolvePhiCmsRoutePresetByIdentity(catalog, ownerModuleId, presetKey) {
|
|
1406
1462
|
return catalog.routeByIdentity.get(buildPhiCmsPresetIdentityKey(ownerModuleId, presetKey)) ?? null;
|
|
@@ -91,20 +91,21 @@ function toReleaseRow(item) {
|
|
|
91
91
|
reject: null,
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
case "area":
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
case "area": {
|
|
95
|
+
/*
|
|
96
|
+
* A structure's publish names the Shell preset it stands on; a structure draft without one has
|
|
97
|
+
* nothing to name. A Module selection names no shell and is published by its Area alone.
|
|
98
|
+
*/
|
|
99
|
+
const modules = item.part === "modules";
|
|
100
|
+
const publish = modules
|
|
101
|
+
? {
|
|
102
|
+
path: "/api/site/cms/area/modules/publish",
|
|
103
|
+
method: "POST",
|
|
104
|
+
body: { area: item.area, revisionId: item.revisionId },
|
|
105
|
+
}
|
|
106
|
+
: readText(item.ownerModuleId) && readText(item.presetKey)
|
|
106
107
|
? {
|
|
107
|
-
path:
|
|
108
|
+
path: "/api/site/cms/area/publish",
|
|
108
109
|
method: "POST",
|
|
109
110
|
body: {
|
|
110
111
|
area: item.area,
|
|
@@ -113,9 +114,20 @@ function toReleaseRow(item) {
|
|
|
113
114
|
presetKey: item.presetKey,
|
|
114
115
|
},
|
|
115
116
|
}
|
|
116
|
-
: null
|
|
117
|
+
: null;
|
|
118
|
+
return {
|
|
119
|
+
id: `area:${String(item.area)}:${String(item.part)}`,
|
|
120
|
+
kind: "area",
|
|
121
|
+
what: String(item.part ?? ""),
|
|
122
|
+
where: String(item.area ?? ""),
|
|
123
|
+
by: readPerson(item.savedBy),
|
|
124
|
+
at: item.savedAt,
|
|
125
|
+
publishable: publish != null,
|
|
126
|
+
rejectable: false,
|
|
127
|
+
publish,
|
|
117
128
|
reject: null,
|
|
118
129
|
};
|
|
130
|
+
}
|
|
119
131
|
default:
|
|
120
132
|
return null;
|
|
121
133
|
}
|
|
@@ -2,7 +2,6 @@ import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-
|
|
|
2
2
|
import { PHI_EDITOR_RUNTIME_MODULE_ID } from "../ids";
|
|
3
3
|
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
4
4
|
import { buildPhiAreaShellHeaderNodes, buildPhiAreaShellSiderLeftNodes, concatPhiAreaShellPresetNodes, } from "../../../../components/regions/presets/phi-area-shell-preset-nodes";
|
|
5
|
-
import { createPhiDefaultAreaRuntimeModuleIds } from "../../area-module-defaults";
|
|
6
5
|
const SYNTHETIC_EDITOR_REGION_IDS = {
|
|
7
6
|
regionHeaderTop: -140,
|
|
8
7
|
regionSiderLeft: -150,
|
|
@@ -31,7 +30,6 @@ export async function buildPhiDefaultEditorAreaPresetTree({ page, runtime, }) {
|
|
|
31
30
|
const ids = { ...SYNTHETIC_EDITOR_REGION_IDS, ...SYNTHETIC_EDITOR_LAYOUT_IDS, ...SYNTHETIC_EDITOR_WIDGET_IDS };
|
|
32
31
|
return {
|
|
33
32
|
page,
|
|
34
|
-
runtimeModuleIds: createPhiDefaultAreaRuntimeModuleIds("editor"),
|
|
35
33
|
overlays: [],
|
|
36
34
|
...concatPhiAreaShellPresetNodes(buildPhiAreaShellHeaderNodes({ nodes, runtime, labelPrefix: "editor", ids }), buildPhiAreaShellSiderLeftNodes({
|
|
37
35
|
nodes,
|
|
@@ -250,7 +250,7 @@ export declare const PHI_GROUPS_RUNTIME_MODULE_DEFINITION: {
|
|
|
250
250
|
iconFamily: string;
|
|
251
251
|
mediaSpaces: {
|
|
252
252
|
group: {
|
|
253
|
-
kinds: ("image" | "video" | "markdown" | "
|
|
253
|
+
kinds: ("image" | "video" | "markdown" | "document" | "audio" | "pdf" | "archive")[];
|
|
254
254
|
};
|
|
255
255
|
};
|
|
256
256
|
threadKinds: ("group" | "crossGroup")[];
|
|
@@ -7,7 +7,6 @@ import { createPhiSignalAddress, PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../ty
|
|
|
7
7
|
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
|
|
8
8
|
import { getPhiAdminLocalesPageLabels } from "./admin-locales-label-set";
|
|
9
9
|
import { getPhiAdminLocalesWidgetLabels } from "../../../../components/widgets/label-sets/admin-locales";
|
|
10
|
-
import { PHI_SPACE } from "../../../../theme/antd-css-var-contract";
|
|
11
10
|
import { PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
12
11
|
import { PHI_LOCALIZATION_FORM_IDS } from "../forms";
|
|
13
12
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
@@ -66,7 +65,6 @@ export async function buildPhiDefaultAdminLocalesPageTree({ page, runtime, }) {
|
|
|
66
65
|
sortOrder: 0,
|
|
67
66
|
label: labels.contentLabel,
|
|
68
67
|
config: {
|
|
69
|
-
gap: PHI_SPACE.sm,
|
|
70
68
|
// One slot a row at every width: the form and the list stand under one another.
|
|
71
69
|
columns: { compact: 1, medium: 1, wide: 1 },
|
|
72
70
|
padding: 0,
|
|
@@ -11,7 +11,6 @@ import { createPhiCmsPresetNodes } from "../../helpers/cms-preset-nodes";
|
|
|
11
11
|
import { resolvePhiShellHeaderHeight, resolvePhiShellMetric } from "../../helpers/shell-region-style";
|
|
12
12
|
import { resolvePhiLayoutCreationPreset } from "../../helpers/cms-layout-defaults";
|
|
13
13
|
import { PHI_DEFAULT_PUB_AREA_PRESET } from "./pub-area-preset";
|
|
14
|
-
import { createPhiDefaultAreaRuntimeModuleIds } from "./area-module-defaults";
|
|
15
14
|
import { PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS, PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS, } from "./preset-contracts/pub-area";
|
|
16
15
|
const SYNTHETIC_REGION_IDS = {
|
|
17
16
|
regionHeaderMain: -2,
|
|
@@ -70,7 +69,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
70
69
|
const nodes = createPhiCmsPresetNodes(page);
|
|
71
70
|
return {
|
|
72
71
|
page,
|
|
73
|
-
runtimeModuleIds: createPhiDefaultAreaRuntimeModuleIds(runtimeModuleArea),
|
|
74
72
|
overlays: [],
|
|
75
73
|
regions: [
|
|
76
74
|
...(headerMainRegion
|
|
@@ -211,7 +209,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
211
209
|
horizontal: "right",
|
|
212
210
|
vertical: "middle",
|
|
213
211
|
},
|
|
214
|
-
gap: PHI_SPACE.sm,
|
|
215
212
|
paddingTop: PHI_SPACE.sm,
|
|
216
213
|
paddingRight: PHI_SPACE.lg,
|
|
217
214
|
paddingBottom: PHI_SPACE.sm,
|
|
@@ -264,7 +261,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
264
261
|
horizontal: "center",
|
|
265
262
|
vertical: "middle",
|
|
266
263
|
},
|
|
267
|
-
gap: PHI_SPACE.sm,
|
|
268
264
|
paddingTop: PHI_SPACE.sm,
|
|
269
265
|
paddingRight: PHI_SPACE.base,
|
|
270
266
|
paddingBottom: PHI_SPACE.sm,
|
|
@@ -66,14 +66,20 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
66
66
|
persistedPageCatalogByArea,
|
|
67
67
|
]);
|
|
68
68
|
/*
|
|
69
|
-
* Deletes the Area's own
|
|
69
|
+
* Deletes the Area's own structure, then asks the workspace for everything again. Its Module selection
|
|
70
|
+
* is stored apart and stays.
|
|
70
71
|
*
|
|
71
|
-
* What stands afterwards is the
|
|
72
|
-
* not the root route, not the SEO answers. Every one of them is now a value only the
|
|
72
|
+
* What stands afterwards is the preset of the shell the Area takes, and this client holds none of it
|
|
73
|
+
* -- not the Regions, not the root route, not the SEO answers. Every one of them is now a value only the
|
|
74
|
+
* server knows. The identity named is the one the stored structure stands on, which need not be the
|
|
75
|
+
* shell the Area takes now: a structure of the base shell outlives switching on a Module that brings
|
|
76
|
+
* its own.
|
|
73
77
|
*/
|
|
74
78
|
const deleteAreaShell = useCallback(async (area, correlationId) => {
|
|
75
|
-
const
|
|
76
|
-
|
|
79
|
+
const catalog = getPhiWorkspaceCatalogSnapshot();
|
|
80
|
+
const source = catalog.areaShellsByArea?.[area]?.storedSource
|
|
81
|
+
?? catalog.areaPresetSourcesByArea?.[area]
|
|
82
|
+
?? null;
|
|
77
83
|
try {
|
|
78
84
|
await deleteCmsDraft("/api/site/cms/area/override", {
|
|
79
85
|
area,
|
|
@@ -82,7 +88,7 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
82
88
|
});
|
|
83
89
|
emitCapability("deleteAreaClose", null, correlationId);
|
|
84
90
|
emitCapability("historyReload", null, correlationId);
|
|
85
|
-
showMessage({ level: "success", content: `Cleared ${area} back to its preset.` });
|
|
91
|
+
showMessage({ level: "success", content: `Cleared the ${area} structure back to its preset. Its Modules are kept.` });
|
|
86
92
|
router.refresh();
|
|
87
93
|
}
|
|
88
94
|
catch (error) {
|
|
@@ -115,7 +121,7 @@ function PhiRevisionsControllerMount({ address, config, }) {
|
|
|
115
121
|
* pointed at when it is pressed.
|
|
116
122
|
*/
|
|
117
123
|
const area = getPhiWorkspaceCatalogSnapshot().area;
|
|
118
|
-
emitCapability("deleteAreaWarning", `
|
|
124
|
+
emitCapability("deleteAreaWarning", `The structure this Site stored for ${area} is cleared -- its Shell, drafts and published alike. What is live changes at once, the shell's preset takes the Area back, and no revision is left to restore it from. It cannot be undone. The Module selection is kept.`, signal.correlationId);
|
|
119
125
|
emitCapability("deleteAreaOpen", null, signal.correlationId);
|
|
120
126
|
return;
|
|
121
127
|
}
|