@phis/ui 0.5.4 → 0.5.6
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-layout-renderer.js +17 -7
- package/components/controls/phi-anchor-nav-control.js +18 -1
- package/components/layouts/clients/phi-flex-layout-client.js +17 -2
- package/components/layouts/clients/phi-layout-anchored-overlay.d.ts +2 -0
- package/components/layouts/clients/phi-layout-anchored-overlay.js +2 -0
- package/components/regions/presets/content-entry-editor-page-tree.js +2 -0
- package/components/regions/presets/content-entry-public-page-trees.js +2 -0
- package/components/widgets/builder/stack-tabs.d.ts +2 -1
- package/components/widgets/builder/stack-tabs.js +18 -2
- package/components/widgets/config/choice-shared.d.ts +0 -48
- package/components/widgets/config/choice-shared.js +0 -1
- package/components/widgets/config/stack-tabs.js +4 -3
- package/components/widgets/shared/card-body-client.d.ts +6 -2
- package/components/widgets/shared/card-body-client.js +27 -20
- package/components/widgets/shared/card-vocabulary.d.ts +7 -0
- package/components/widgets/shared/card-vocabulary.js +6 -0
- package/components/widgets/shared/markdown-body-client.js +7 -2
- package/constants/module-identity.d.ts +8 -0
- package/constants/module-identity.js +13 -0
- package/gateway/server-module-media.d.ts +12 -0
- package/gateway/server-module-media.js +83 -0
- package/helpers/cms-navigation-catalog.js +4 -1
- package/helpers/cms-page-catalog.d.ts +7 -0
- package/helpers/cms-preset-page-tree.js +16 -1
- package/helpers/config-text-fields.d.ts +49 -0
- package/helpers/config-text-fields.js +122 -0
- package/helpers/module-media-check.d.ts +23 -0
- package/helpers/module-media-check.js +32 -0
- package/helpers/module-media.d.ts +7 -0
- package/helpers/module-media.js +15 -0
- package/helpers/preset-text-source-check.d.ts +22 -0
- package/helpers/preset-text-source-check.js +45 -0
- package/helpers/route-address-check.d.ts +35 -0
- package/helpers/route-address-check.js +28 -0
- package/helpers/text-source.d.ts +14 -5
- package/helpers/text-source.js +16 -3
- package/module-page-check.d.ts +3 -0
- package/module-page-check.js +3 -0
- package/package.json +1 -1
- package/plugins/runtime/phi-slot-child-frame-view.js +1 -1
- package/plugins/runtime/slot-size-policy.d.ts +8 -2
- package/plugins/runtime/slot-size-policy.js +51 -16
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-page-tree.js +2 -0
- package/plugins/runtime-modules/builder/area-shell-presets.server.js +2 -0
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +2 -2
- package/plugins/runtime-modules/builder/navigation-folder-drop.js +2 -1
- package/plugins/runtime-modules/builder/options-providers.js +7 -1
- package/plugins/runtime-modules/builder/page-presets.server.js +2 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -0
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +11 -0
- package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +9 -2
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/button/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/button/plugin.js +6 -25
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +24 -2
- package/plugins/runtime-modules/core/widgets/card/config.js +35 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +2 -0
- package/plugins/runtime-modules/core/widgets/card/plugin.js +8 -10
- package/plugins/runtime-modules/core/widgets/card/server.d.ts +1 -2
- package/plugins/runtime-modules/core/widgets/card/server.js +18 -28
- package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +7 -1
- package/plugins/runtime-modules/core/widgets/checkbox-group/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +1 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.js +3 -3
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/image/server.js +5 -9
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/server.js +3 -5
- package/plugins/runtime-modules/core/widgets/quick-links/plugin.js +2 -4
- package/plugins/runtime-modules/core/widgets/quick-links/server.d.ts +2 -5
- package/plugins/runtime-modules/core/widgets/quick-links/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/result/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/result/plugin.js +2 -4
- package/plugins/runtime-modules/core/widgets/result/server.d.ts +2 -3
- package/plugins/runtime-modules/core/widgets/result/server.js +11 -33
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/slider/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/slider/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/config.js +0 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +2 -4
- package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +3 -4
- package/plugins/runtime-modules/core/widgets/slot-upload/server.js +5 -13
- package/plugins/runtime-modules/core/widgets/spacer/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/spacer/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/steps/config.d.ts +7 -2
- package/plugins/runtime-modules/core/widgets/steps/config.js +1 -2
- package/plugins/runtime-modules/core/widgets/steps/plugin.js +6 -30
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/table/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/timeline/config.d.ts +8 -1
- package/plugins/runtime-modules/core/widgets/timeline/config.js +1 -2
- package/plugins/runtime-modules/core/widgets/timeline/plugin.js +6 -37
- package/plugins/runtime-modules/descriptor-compiler.d.ts +23 -3
- package/plugins/runtime-modules/descriptor-compiler.js +107 -12
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +2 -0
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +2 -0
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +3 -0
- package/plugins/runtime-modules/page-preset-overlays.d.ts +18 -0
- package/plugins/runtime-modules/page-preset-overlays.js +70 -0
- package/plugins/runtime-modules/public/trees/phi-default-pub-welcome-page-tree.js +1 -0
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -0
- package/plugins/runtime-modules/search/widgets/search-box/server.js +3 -5
- package/plugins/runtime-modules/search/widgets/search-results/server.js +3 -5
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +4 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +2 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +2 -0
- package/server-helpers/cms-area.js +9 -1
- package/server-helpers/cms-request.js +49 -14
- package/server-helpers/cms-root.js +2 -0
- package/server-helpers/cms-widget-texts.d.ts +14 -0
- package/server-helpers/cms-widget-texts.js +117 -0
- package/server-helpers/module-folder-targets.d.ts +7 -0
- package/server-helpers/module-folder-targets.js +15 -0
- package/server-helpers/search-index.js +12 -3
- package/styles/root.css +6 -2
- package/types/cms-module-descriptors.d.ts +24 -0
- package/types/cms-plugins.d.ts +30 -5
- package/types/core-widget-placements.d.ts +5 -0
- package/types/module-media.d.ts +31 -0
- package/types/module-media.js +11 -0
- package/types/slot-size-policy.d.ts +19 -2
- package/types.d.ts +1 -0
|
@@ -50,18 +50,21 @@ export declare const PHI_SLIDER_WIDGET_DEFINITION: {
|
|
|
50
50
|
label: string;
|
|
51
51
|
min?: undefined;
|
|
52
52
|
options?: undefined;
|
|
53
|
+
text?: undefined;
|
|
53
54
|
} | {
|
|
54
55
|
key: string;
|
|
55
56
|
type: "number";
|
|
56
57
|
label: string;
|
|
57
58
|
min?: undefined;
|
|
58
59
|
options?: undefined;
|
|
60
|
+
text?: undefined;
|
|
59
61
|
} | {
|
|
60
62
|
key: string;
|
|
61
63
|
type: "number";
|
|
62
64
|
label: string;
|
|
63
65
|
min: number;
|
|
64
66
|
options?: undefined;
|
|
67
|
+
text?: undefined;
|
|
65
68
|
} | {
|
|
66
69
|
key: string;
|
|
67
70
|
type: "choice";
|
|
@@ -71,6 +74,14 @@ export declare const PHI_SLIDER_WIDGET_DEFINITION: {
|
|
|
71
74
|
label: string;
|
|
72
75
|
}[];
|
|
73
76
|
min?: undefined;
|
|
77
|
+
text?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
key: string;
|
|
80
|
+
type: "string";
|
|
81
|
+
label: string;
|
|
82
|
+
text: "label";
|
|
83
|
+
min?: undefined;
|
|
84
|
+
options?: undefined;
|
|
74
85
|
})[];
|
|
75
86
|
defaultConfig: {
|
|
76
87
|
key: string;
|
|
@@ -59,7 +59,7 @@ export const PHI_SLIDER_WIDGET_DEFINITION = {
|
|
|
59
59
|
{ value: "hidden", label: "Hidden" },
|
|
60
60
|
],
|
|
61
61
|
},
|
|
62
|
-
{ key: "tooltipSuffix", type: "string", label: "Tooltip suffix" },
|
|
62
|
+
{ key: "tooltipSuffix", type: "string", label: "Tooltip suffix", text: "label" },
|
|
63
63
|
...PHI_CONTROL_STATE_FIELDS,
|
|
64
64
|
],
|
|
65
65
|
defaultConfig: {
|
|
@@ -57,8 +57,6 @@ export const PHI_SLOT_UPLOAD_WIDGET_DEFINITION = {
|
|
|
57
57
|
],
|
|
58
58
|
defaultConfig: { ownerParam: "id" },
|
|
59
59
|
parseConfig: parsePhiSlotUploadWidgetConfig,
|
|
60
|
-
// The label is written into the config, so the Widget translates it on the server.
|
|
61
|
-
translatesOwnText: true,
|
|
62
60
|
runtimeSignals: {
|
|
63
61
|
emits: [
|
|
64
62
|
// So whatever shows the row can read it again. What changed is the row, not this widget.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PhiCmsFlags } from "../../../../../constants/phi-cms";
|
|
3
|
-
import { hasPhiFlag } from "../../../../../helpers/flags";
|
|
4
2
|
import { PHI_SLOT_UPLOAD_WIDGET_DEFINITION } from "./config";
|
|
5
3
|
import { PhiSlotUploadWidget } from "./server";
|
|
6
4
|
export const PHI_SLOT_UPLOAD_WIDGET_PLUGIN = {
|
|
7
5
|
...PHI_SLOT_UPLOAD_WIDGET_DEFINITION,
|
|
8
|
-
render: ({
|
|
9
|
-
renderPreview: ({
|
|
6
|
+
render: ({ config, runtime }) => _jsx(PhiSlotUploadWidget, { config: config, runtime: runtime }),
|
|
7
|
+
renderPreview: ({ config, runtime }) => (_jsx(PhiSlotUploadWidget, { config: { ...config, renderMode: "preview" }, runtime: runtime })),
|
|
10
8
|
};
|
|
@@ -4,11 +4,10 @@ import { type PhiSlotUploadWidgetConfig } from "./config";
|
|
|
4
4
|
/**
|
|
5
5
|
* Handed to the Render Client by type: what a slot holds depends on who is asking and on which row a
|
|
6
6
|
* surface is about, and neither is knowable where a page is rendered for a cache. Its texts are read
|
|
7
|
-
* here, in the page's language, and travel with it: the field's own captions from its Label Set
|
|
8
|
-
* label somebody wrote into the config
|
|
7
|
+
* here, in the page's language, and travel with it: the field's own captions from its Label Set; the
|
|
8
|
+
* label somebody wrote into the config arrives translated (server-helpers/cms-widget-texts.ts).
|
|
9
9
|
*/
|
|
10
|
-
export declare function PhiSlotUploadWidget({ config, runtime,
|
|
10
|
+
export declare function PhiSlotUploadWidget({ config, runtime, }: {
|
|
11
11
|
config?: PhiSlotUploadWidgetConfig;
|
|
12
12
|
runtime: PhiBlockRuntime;
|
|
13
|
-
translate?: boolean;
|
|
14
13
|
}): Promise<import("react").JSX.Element>;
|
|
@@ -3,22 +3,14 @@ import "server-only";
|
|
|
3
3
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../runtime-render-client";
|
|
4
4
|
import { getPhiSlotUploadWidgetLabels } from "../../../../../components/widgets/label-sets/slot-upload";
|
|
5
5
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
|
|
6
|
-
import { trBulk, trBulkForLocale } from "../../../../../server-helpers/translate";
|
|
7
6
|
import { PHI_SLOT_UPLOAD_WIDGET_TYPE } from "./config";
|
|
8
7
|
/**
|
|
9
8
|
* Handed to the Render Client by type: what a slot holds depends on who is asking and on which row a
|
|
10
9
|
* surface is about, and neither is knowable where a page is rendered for a cache. Its texts are read
|
|
11
|
-
* here, in the page's language, and travel with it: the field's own captions from its Label Set
|
|
12
|
-
* label somebody wrote into the config
|
|
10
|
+
* here, in the page's language, and travel with it: the field's own captions from its Label Set; the
|
|
11
|
+
* label somebody wrote into the config arrives translated (server-helpers/cms-widget-texts.ts).
|
|
13
12
|
*/
|
|
14
|
-
export async function PhiSlotUploadWidget({ config, runtime,
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
getPhiSlotUploadWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
|
|
18
|
-
translate && label
|
|
19
|
-
? (runtime.locale.current ? trBulkForLocale(runtime.locale.current, [label]) : trBulk([label]))
|
|
20
|
-
.then(([text]) => text?.trim() || label)
|
|
21
|
-
: Promise.resolve(label),
|
|
22
|
-
]);
|
|
23
|
-
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PHI_SLOT_UPLOAD_WIDGET_TYPE, componentProps: { config: config && translatedLabel ? { ...config, label: translatedLabel } : config, labels } }));
|
|
13
|
+
export async function PhiSlotUploadWidget({ config, runtime, }) {
|
|
14
|
+
const labels = await getPhiSlotUploadWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
15
|
+
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PHI_SLOT_UPLOAD_WIDGET_TYPE, componentProps: { config, labels } }));
|
|
24
16
|
}
|
|
@@ -10,7 +10,7 @@ export declare const PHI_SPACER_WIDGET_DEFINITION: {
|
|
|
10
10
|
category: "structure";
|
|
11
11
|
icon: string;
|
|
12
12
|
iconFamily: string;
|
|
13
|
-
slotSizePolicy: "
|
|
13
|
+
slotSizePolicy: "rest";
|
|
14
14
|
fields: never[];
|
|
15
15
|
parseConfig: (config: Record<string, unknown>) => PhiSpacerWidgetConfig;
|
|
16
16
|
};
|
|
@@ -9,7 +9,7 @@ export const PHI_SPACER_WIDGET_DEFINITION = {
|
|
|
9
9
|
category: "structure",
|
|
10
10
|
icon: "antd:column-width-outlined",
|
|
11
11
|
iconFamily: "layout",
|
|
12
|
-
slotSizePolicy: "
|
|
12
|
+
slotSizePolicy: "rest",
|
|
13
13
|
fields: [],
|
|
14
14
|
parseConfig: (config) => readRenderableBlockConfig(config),
|
|
15
15
|
};
|
|
@@ -18,13 +18,18 @@ export declare const PHI_STEPS_WIDGET_DEFINITION: {
|
|
|
18
18
|
kind: "widget";
|
|
19
19
|
pluginKey: string;
|
|
20
20
|
typeKey: string;
|
|
21
|
-
translatesOwnText: true;
|
|
22
21
|
title: string;
|
|
23
22
|
description: string;
|
|
24
23
|
category: "content";
|
|
25
24
|
icon: string;
|
|
26
25
|
iconFamily: string;
|
|
27
|
-
slotSizePolicy:
|
|
26
|
+
slotSizePolicy: {
|
|
27
|
+
configField: string;
|
|
28
|
+
byValue: {
|
|
29
|
+
vertical: "intrinsic";
|
|
30
|
+
};
|
|
31
|
+
otherwise: "fill-inline";
|
|
32
|
+
};
|
|
28
33
|
runtimeSignals: {
|
|
29
34
|
emits: ({
|
|
30
35
|
id: string;
|
|
@@ -15,13 +15,12 @@ export const PHI_STEPS_WIDGET_DEFINITION = {
|
|
|
15
15
|
kind: "widget",
|
|
16
16
|
pluginKey: resolvePhiCmsWidgetPluginKey("steps"),
|
|
17
17
|
typeKey: "steps",
|
|
18
|
-
translatesOwnText: true,
|
|
19
18
|
title: "Steps",
|
|
20
19
|
description: "Where a sequence stands, as numbered steps; can follow and drive a Stack.",
|
|
21
20
|
category: "content",
|
|
22
21
|
icon: "antd:ordered-list-outlined",
|
|
23
22
|
iconFamily: "basic",
|
|
24
|
-
slotSizePolicy: "intrinsic",
|
|
23
|
+
slotSizePolicy: { configField: "orientation", byValue: { vertical: "intrinsic" }, otherwise: "fill-inline" },
|
|
25
24
|
runtimeSignals: {
|
|
26
25
|
...PHI_SELECT_CONTROL_SIGNALS,
|
|
27
26
|
},
|
|
@@ -1,38 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PhiCmsFlags } from "../../../../../constants/phi-cms";
|
|
3
|
-
import { hasPhiFlag } from "../../../../../helpers/flags";
|
|
4
2
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
5
3
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
6
|
-
import { trBulkForLocale } from "../../../../../server-helpers/translate";
|
|
7
4
|
import { PHI_STEPS_WIDGET_DEFINITION } from "./config";
|
|
8
|
-
|
|
9
|
-
* The steps'
|
|
10
|
-
* they are
|
|
11
|
-
* at runtime, and those are the Stack's to translate.
|
|
5
|
+
/*
|
|
6
|
+
* The steps' titles and the lines under them arrive translated (server-helpers/cms-widget-texts.ts); the
|
|
7
|
+
* values stay as they are, they are what the steps send. Steps that follow a Stack take their titles
|
|
8
|
+
* from its slots at runtime, and those are the Stack's to translate.
|
|
12
9
|
*/
|
|
13
|
-
async function translatePhiStepsConfig(config, runtime, translate) {
|
|
14
|
-
if (!translate || config.options.length === 0)
|
|
15
|
-
return config;
|
|
16
|
-
const texts = config.options.flatMap((option) => [option.label, option.description ?? ""]);
|
|
17
|
-
const translated = await trBulkForLocale(runtime.locale.current, texts);
|
|
18
|
-
return {
|
|
19
|
-
...config,
|
|
20
|
-
options: config.options.map((option, index) => ({
|
|
21
|
-
...option,
|
|
22
|
-
label: translated[index * 2]?.trim() || option.label,
|
|
23
|
-
...(option.description ? { description: translated[index * 2 + 1]?.trim() || option.description } : {}),
|
|
24
|
-
})),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
10
|
export const PHI_STEPS_WIDGET_PLUGIN = {
|
|
28
11
|
...PHI_STEPS_WIDGET_DEFINITION,
|
|
29
|
-
render:
|
|
30
|
-
|
|
31
|
-
config: await translatePhiStepsConfig(config, runtime, !hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate)),
|
|
32
|
-
} })),
|
|
33
|
-
renderPreview: async ({ widget, config, runtime }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Steps, componentProps: {
|
|
34
|
-
blockId: widget.id,
|
|
35
|
-
config: await translatePhiStepsConfig(config, runtime, !hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate)),
|
|
36
|
-
signalsEnabled: false,
|
|
37
|
-
} })),
|
|
12
|
+
render: ({ widget, config }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Steps, componentProps: { blockId: widget.id, config } })),
|
|
13
|
+
renderPreview: ({ widget, config }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Steps, componentProps: { blockId: widget.id, config, signalsEnabled: false } })),
|
|
38
14
|
};
|
|
@@ -74,6 +74,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
|
|
|
74
74
|
type: "string" | "url" | "icon";
|
|
75
75
|
emptyValue?: "";
|
|
76
76
|
placeholder?: string;
|
|
77
|
+
text?: false | "label" | "message";
|
|
77
78
|
}) | ({
|
|
78
79
|
key: string;
|
|
79
80
|
label: string;
|
|
@@ -386,6 +387,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
|
|
|
386
387
|
type: "string" | "url" | "icon";
|
|
387
388
|
emptyValue?: "";
|
|
388
389
|
placeholder?: string;
|
|
390
|
+
text?: false | "label" | "message";
|
|
389
391
|
} | {
|
|
390
392
|
visibleWhen: {
|
|
391
393
|
field: string;
|
|
@@ -765,6 +767,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
|
|
|
765
767
|
type: "string" | "url" | "icon";
|
|
766
768
|
emptyValue?: "";
|
|
767
769
|
placeholder?: string;
|
|
770
|
+
text?: false | "label" | "message";
|
|
768
771
|
} | {
|
|
769
772
|
visibleWhen: {
|
|
770
773
|
field: string;
|
|
@@ -24,7 +24,7 @@ const PHI_TABLE_DISABLED_CONDITION_CONFIG_FIELDS = [
|
|
|
24
24
|
{ value: "contains", label: "Contains" },
|
|
25
25
|
] },
|
|
26
26
|
{ key: "value", type: "string", label: "String Value" },
|
|
27
|
-
{ key: "reason", type: "string", label: "Disabled Reason" },
|
|
27
|
+
{ key: "reason", type: "string", label: "Disabled Reason", text: "message" },
|
|
28
28
|
];
|
|
29
29
|
function buildPhiTableConditionExpressionConfigFields(key, label, match, emptyLabel) {
|
|
30
30
|
return [
|
|
@@ -17,7 +17,6 @@ export declare const PHI_TIMELINE_WIDGET_DEFINITION: {
|
|
|
17
17
|
kind: "widget";
|
|
18
18
|
pluginKey: string;
|
|
19
19
|
typeKey: string;
|
|
20
|
-
translatesOwnText: true;
|
|
21
20
|
title: string;
|
|
22
21
|
description: string;
|
|
23
22
|
category: "content";
|
|
@@ -52,11 +51,19 @@ export declare const PHI_TIMELINE_WIDGET_DEFINITION: {
|
|
|
52
51
|
type: "string";
|
|
53
52
|
label: string;
|
|
54
53
|
required: true;
|
|
54
|
+
text?: undefined;
|
|
55
55
|
} | {
|
|
56
56
|
key: string;
|
|
57
57
|
type: "string";
|
|
58
58
|
label: string;
|
|
59
59
|
required?: undefined;
|
|
60
|
+
text?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
key: string;
|
|
63
|
+
type: "string";
|
|
64
|
+
label: string;
|
|
65
|
+
text: "message";
|
|
66
|
+
required?: undefined;
|
|
60
67
|
})[];
|
|
61
68
|
providerKind?: undefined;
|
|
62
69
|
heading?: undefined;
|
|
@@ -26,7 +26,6 @@ export const PHI_TIMELINE_WIDGET_DEFINITION = {
|
|
|
26
26
|
kind: "widget",
|
|
27
27
|
pluginKey: resolvePhiCmsWidgetPluginKey("timeline"),
|
|
28
28
|
typeKey: "timeline",
|
|
29
|
-
translatesOwnText: true,
|
|
30
29
|
title: "Timeline",
|
|
31
30
|
description: "What happened, in order: entries with a time, a title and a line of text.",
|
|
32
31
|
category: "content",
|
|
@@ -63,7 +62,7 @@ export const PHI_TIMELINE_WIDGET_DEFINITION = {
|
|
|
63
62
|
itemFields: [
|
|
64
63
|
{ key: "key", type: "string", label: "Key", required: true },
|
|
65
64
|
{ key: "title", type: "string", label: "Title" },
|
|
66
|
-
{ key: "content", type: "string", label: "Text" },
|
|
65
|
+
{ key: "content", type: "string", label: "Text", text: "message" },
|
|
67
66
|
],
|
|
68
67
|
},
|
|
69
68
|
{ key: "entriesProvider", type: "data-provider", providerKind: "timeline", label: "Entries Source" },
|
|
@@ -1,45 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PhiCmsFlags } from "../../../../../constants/phi-cms";
|
|
3
|
-
import { hasPhiFlag } from "../../../../../helpers/flags";
|
|
4
2
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
5
3
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
6
|
-
import { trBulkForLocale } from "../../../../../server-helpers/translate";
|
|
7
4
|
import { PHI_TIMELINE_WIDGET_DEFINITION } from "./config";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
/*
|
|
6
|
+
* The entries' own words arrive translated (server-helpers/cms-widget-texts.ts), the time among them: an
|
|
7
|
+
* author writes "Yesterday" or "Spring 2026" as often as a date. A Provider's entries are its own to
|
|
8
|
+
* translate, as an options Provider's are.
|
|
12
9
|
*/
|
|
13
|
-
async function translatePhiTimelineConfig(config, runtime, translate) {
|
|
14
|
-
/* A Provider's entries are its own to translate, as an options Provider's are. */
|
|
15
|
-
if (!translate || config.entriesProvider || config.entries.length === 0)
|
|
16
|
-
return config;
|
|
17
|
-
const texts = config.entries.flatMap((entry) => PHI_TIMELINE_TRANSLATED_FIELDS.map((field) => entry[field] ?? ""));
|
|
18
|
-
const translated = await trBulkForLocale(runtime.locale.current, texts);
|
|
19
|
-
const width = PHI_TIMELINE_TRANSLATED_FIELDS.length;
|
|
20
|
-
return {
|
|
21
|
-
...config,
|
|
22
|
-
entries: config.entries.map((entry, index) => {
|
|
23
|
-
const next = { ...entry };
|
|
24
|
-
PHI_TIMELINE_TRANSLATED_FIELDS.forEach((field, offset) => {
|
|
25
|
-
const source = entry[field];
|
|
26
|
-
if (source)
|
|
27
|
-
next[field] = translated[index * width + offset]?.trim() || source;
|
|
28
|
-
});
|
|
29
|
-
return next;
|
|
30
|
-
}),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
10
|
export const PHI_TIMELINE_WIDGET_PLUGIN = {
|
|
34
11
|
...PHI_TIMELINE_WIDGET_DEFINITION,
|
|
35
|
-
render:
|
|
36
|
-
|
|
37
|
-
config: await translatePhiTimelineConfig(config, runtime, !hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate)),
|
|
38
|
-
locale: runtime.locale.current,
|
|
39
|
-
} })),
|
|
40
|
-
renderPreview: async ({ widget, config, runtime }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Timeline, componentProps: {
|
|
41
|
-
blockId: widget.id,
|
|
42
|
-
config: await translatePhiTimelineConfig(config, runtime, !hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate)),
|
|
43
|
-
locale: runtime.locale.current,
|
|
44
|
-
} })),
|
|
12
|
+
render: ({ widget, config, runtime }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Timeline, componentProps: { blockId: widget.id, config, locale: runtime.locale.current } })),
|
|
13
|
+
renderPreview: ({ widget, config, runtime }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Timeline, componentProps: { blockId: widget.id, config, locale: runtime.locale.current } })),
|
|
45
14
|
};
|
|
@@ -8,6 +8,7 @@ import type { PhiRuntimeModuleCatalog } from "../../types/cms-plugins";
|
|
|
8
8
|
import type { PhiBlockRuntime } from "../../types/widget-runtime";
|
|
9
9
|
import { type PhiAccessViewer } from "../../types/access";
|
|
10
10
|
import { type PhiAreaLandingSelection, type PhiPublicRoutePathAssignment } from "../../helpers/cms-area-config";
|
|
11
|
+
import type { PhiModuleMediaLoader } from "../../types/module-media";
|
|
11
12
|
export declare function buildPhiCmsPresetIdentityKey(ownerModuleId: PhiRuntimeModuleId, presetKey: string): string;
|
|
12
13
|
export declare function normalizePhiCmsRoutePath(value: string): `/${string}`;
|
|
13
14
|
export declare function compilePhiCmsRoutePattern(descriptor: PhiCmsRoutePresetDescriptor): PhiCmsCompiledRoutePattern;
|
|
@@ -58,6 +59,22 @@ export declare function resolvePhiCmsActiveNavigationSurfaces({ catalog, area, a
|
|
|
58
59
|
routeTable: PhiCmsActiveRouteTable;
|
|
59
60
|
viewer?: PhiAccessViewer;
|
|
60
61
|
}): readonly PhiCmsResolvedNavigationSurface[];
|
|
62
|
+
/**
|
|
63
|
+
* The Pages Module containers' folder addresses lead to by their descriptors (`folderTarget`), keyed by
|
|
64
|
+
* address; an address no Module container answers is not in the map.
|
|
65
|
+
*
|
|
66
|
+
* Asked where the Site's published Navigations name no target for an address -- a request no Page
|
|
67
|
+
* answers (`server-helpers/cms-request.ts`), a breadcrumb's folders -- so a Site's choice replaces the
|
|
68
|
+
* Module's, not the reverse. Every surface of the Area is searched once, because a folder address is the
|
|
69
|
+
* Area's, not one menu's.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolvePhiCmsModuleNavigationFolderTargets(input: {
|
|
72
|
+
catalog: PhiCmsCompiledDescriptorCatalog;
|
|
73
|
+
area: PhiCmsAreaKey;
|
|
74
|
+
activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
|
|
75
|
+
routeTable: PhiCmsActiveRouteTable;
|
|
76
|
+
addresses: readonly string[];
|
|
77
|
+
}): Map<string, string>;
|
|
61
78
|
export declare function resolvePhiCmsNavigationOverlay(surface: PhiCmsResolvedNavigationSurface, overlay: PhiCmsNavigationOverlay | null): PhiCmsNavigationOverlayResolution;
|
|
62
79
|
export declare function resolvePhiCmsRoutePreset(table: PhiCmsActiveRouteTable, requestedPath: string): PhiCmsRoutePresetBinding | null;
|
|
63
80
|
export declare function resolvePhiCmsRoutePresetByPageId(table: PhiCmsActiveRouteTable, pageId: PhiCmsInstanceId): PhiCmsRoutePresetBinding | null;
|
|
@@ -88,7 +105,7 @@ type PhiCmsPresetTreeForm = {
|
|
|
88
105
|
* cannot see (one stored on the Site, one of a Module outside the catalog) is not judged.
|
|
89
106
|
*/
|
|
90
107
|
export declare function assertPhiCmsPresetTreeContract(tree: PhiResolvedCmsPageTree, expectedPage?: PhiCmsPageNode, forms?: ReadonlyMap<string, PhiCmsPresetTreeForm>): void;
|
|
91
|
-
export declare function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, activeModuleIds, siteId, area, path, runtime, }: {
|
|
108
|
+
export declare function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, activeModuleIds, siteId, area, path, runtime, loadModuleMedia, }: {
|
|
92
109
|
tree: PhiResolvedCmsAreaPresetTree;
|
|
93
110
|
catalog: PhiCmsCompiledDescriptorCatalog;
|
|
94
111
|
activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
|
|
@@ -96,21 +113,24 @@ export declare function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, a
|
|
|
96
113
|
area: PhiCmsAreaKey;
|
|
97
114
|
path: string;
|
|
98
115
|
runtime: PhiBlockRuntime;
|
|
116
|
+
loadModuleMedia: PhiModuleMediaLoader;
|
|
99
117
|
}): Promise<PhiResolvedCmsAreaPresetTree>;
|
|
100
|
-
export declare function instantiatePhiCmsAreaShellPreset({ binding, catalog, siteId, path, runtime, }: {
|
|
118
|
+
export declare function instantiatePhiCmsAreaShellPreset({ binding, catalog, siteId, path, runtime, loadModuleMedia, }: {
|
|
101
119
|
binding: PhiCmsAreaShellPresetBinding;
|
|
102
120
|
catalog: PhiCmsCompiledDescriptorCatalog;
|
|
103
121
|
siteId: number;
|
|
104
122
|
path: string;
|
|
105
123
|
runtime: PhiBlockRuntime;
|
|
124
|
+
loadModuleMedia: PhiModuleMediaLoader;
|
|
106
125
|
}): Promise<PhiResolvedCmsPageTree>;
|
|
107
|
-
export declare function instantiatePhiCmsRoutePreset({ binding, catalog, activeModuleIds, siteId, path, runtime, resolveMissingPageTitle, }: {
|
|
126
|
+
export declare function instantiatePhiCmsRoutePreset({ binding, catalog, activeModuleIds, siteId, path, runtime, loadModuleMedia, resolveMissingPageTitle, }: {
|
|
108
127
|
binding: PhiCmsRoutePresetBinding;
|
|
109
128
|
catalog: PhiCmsCompiledDescriptorCatalog;
|
|
110
129
|
activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
|
|
111
130
|
siteId: number;
|
|
112
131
|
path: string;
|
|
113
132
|
runtime: PhiBlockRuntime;
|
|
133
|
+
loadModuleMedia: PhiModuleMediaLoader;
|
|
114
134
|
resolveMissingPageTitle?: (sourceTitle: string) => string | Promise<string>;
|
|
115
135
|
}): Promise<PhiResolvedCmsPageTree>;
|
|
116
136
|
export {};
|
|
@@ -7,12 +7,14 @@ import { resolvePhiRuntimeModuleSourceLocale } from "../../types/runtime-module-
|
|
|
7
7
|
import { canPhiViewerAccess, PHI_VIEWER_ACCESS_ANYONE, } from "../../types/access";
|
|
8
8
|
import { mergePhiCmsShellTrees, omitPhiCmsShellCompositionNodes, } from "./shell-tree-composition";
|
|
9
9
|
import { resolvePhiRuntimeModuleAreaRoutePath } from "../../helpers/runtime-module-route-path";
|
|
10
|
+
import { createPhiPageReference } from "../../types/references";
|
|
10
11
|
import { choosePhiAreaRootApplicant, orderPhiAreaPathClaimsByCover, isPhiAssignablePublicRoutePath, } from "../../helpers/cms-area-config";
|
|
11
12
|
import { resolvePhiLayoutCreationPreset } from "../../helpers/cms-layout-defaults";
|
|
12
13
|
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH, isPhiFormSingleColumn, } from "../../helpers/cms-dialog";
|
|
13
14
|
import { PhiCmsWidgetType } from "../../constants/cms-widget-types";
|
|
14
15
|
import { buildPhiBasePageLayoutNode, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "../../components/regions/presets/phi-base-page-layout";
|
|
15
16
|
import { concatPhiCmsTreeControllerSettings } from "../../helpers/cms-tree-controller-settings";
|
|
17
|
+
import { createPhiModuleMediaResolver } from "../../helpers/module-media";
|
|
16
18
|
const PHI_CMS_REGION_TYPE_VALUES = new Set(Object.values(PhiCmsRegionType));
|
|
17
19
|
const PHI_ROUTE_PARAMETER_PATTERN = /^:[A-Za-z][A-Za-z0-9_]*$/;
|
|
18
20
|
const PHI_NAVIGATION_ANCHORS = new Set([
|
|
@@ -468,6 +470,16 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
|
|
|
468
470
|
label: `${label}/${item.itemKey}`,
|
|
469
471
|
});
|
|
470
472
|
}
|
|
473
|
+
if (item.folderTarget !== undefined) {
|
|
474
|
+
/*
|
|
475
|
+
* The child's Page answers the folder address. Only a route has one: an Overlay, an external
|
|
476
|
+
* address or a sub-container is no Page to forward to.
|
|
477
|
+
*/
|
|
478
|
+
const child = (item.children ?? []).find((entry) => entry.itemKey === item.folderTarget);
|
|
479
|
+
if (!child?.routePresetKey) {
|
|
480
|
+
throw new Error(`${label}/${item.itemKey}: folderTarget "${item.folderTarget}" names no direct child that goes to a route.`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
471
483
|
visitNavigationRouteReferences(item.children ?? [], ownerModuleId, area, label);
|
|
472
484
|
}
|
|
473
485
|
};
|
|
@@ -908,10 +920,51 @@ function buildResolvedNavigationNode(catalog, routeTable, navKey, ownerModuleId,
|
|
|
908
920
|
standsLast: "standing" in descriptor && descriptor.standing === "last",
|
|
909
921
|
// An item that named a route and got nothing back. A container never is one: it named nothing.
|
|
910
922
|
isUnrouted: Boolean(descriptor.routePresetKey) && !target,
|
|
923
|
+
folderTargetItemKey: descriptor.folderTarget ?? null,
|
|
911
924
|
intrinsicChildren,
|
|
912
925
|
injection,
|
|
913
926
|
};
|
|
914
927
|
}
|
|
928
|
+
/** The folder a path lies in; `/` is the Area root, a slot and no folder. */
|
|
929
|
+
function parentNavigationFolder(path) {
|
|
930
|
+
const index = path.lastIndexOf("/");
|
|
931
|
+
return index > 0 ? path.slice(0, index) : "/";
|
|
932
|
+
}
|
|
933
|
+
function resolveModuleNavigationFolderAddress(children) {
|
|
934
|
+
const folders = new Set(children.flatMap((child) => {
|
|
935
|
+
const path = child.kind === "container"
|
|
936
|
+
? resolveModuleNavigationFolderAddress(child.children)
|
|
937
|
+
: child.target?.kind === "module" ? child.target.path : null;
|
|
938
|
+
return path ? [parentNavigationFolder(path)] : [];
|
|
939
|
+
}));
|
|
940
|
+
const [address] = folders;
|
|
941
|
+
return folders.size === 1 && address && address !== "/" ? address : null;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* A Module container's folder, as its `folderTarget` names it: the folder its direct children share --
|
|
945
|
+
* a link by its route's path, a sub-container by its own folder -- and the Page of the child it names.
|
|
946
|
+
* The same rule as a Site's folder (`builder/navigation-folder-address.ts`). None where the children
|
|
947
|
+
* share no folder, or the named child does not answer here: the address then leads nowhere, as a
|
|
948
|
+
* container without a target does.
|
|
949
|
+
*/
|
|
950
|
+
function resolveModuleNavigationFolder(node, children) {
|
|
951
|
+
const address = resolveModuleNavigationFolderAddress(children);
|
|
952
|
+
if (!address) {
|
|
953
|
+
return null;
|
|
954
|
+
}
|
|
955
|
+
const childId = node.intrinsicChildren.find((child) => child.definitionItemKey === node.folderTargetItemKey)?.item.id;
|
|
956
|
+
const target = children.find((child) => child.id === childId)?.target;
|
|
957
|
+
if (target?.kind !== "module") {
|
|
958
|
+
return null;
|
|
959
|
+
}
|
|
960
|
+
return {
|
|
961
|
+
address,
|
|
962
|
+
target: {
|
|
963
|
+
kind: "page",
|
|
964
|
+
reference: createPhiPageReference({ kind: "module", ownerModuleId: target.ownerModuleId, presetKey: target.presetKey }),
|
|
965
|
+
},
|
|
966
|
+
};
|
|
967
|
+
}
|
|
915
968
|
function orderNavigationSiblings(intrinsic, injected, parentItemKey) {
|
|
916
969
|
/*
|
|
917
970
|
* An Area's entries first, the contributed ones after -- except the entries that said they stand
|
|
@@ -1097,10 +1150,13 @@ export function resolvePhiCmsActiveNavigationSurfaces({ catalog, area, activeMod
|
|
|
1097
1150
|
*/
|
|
1098
1151
|
const materialize = (intrinsic, injected, parentItemKey) => orderNavigationSiblings(intrinsic, injected, parentItemKey)
|
|
1099
1152
|
.filter(isNavigationNodeVisible)
|
|
1100
|
-
.map((node) =>
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1153
|
+
.map((node) => {
|
|
1154
|
+
const children = materialize(node.intrinsicChildren, injectedByParent.get(node.definitionItemKey) ?? [], node.definitionItemKey);
|
|
1155
|
+
const folder = node.item.kind === "container" && node.folderTargetItemKey
|
|
1156
|
+
? resolveModuleNavigationFolder(node, children)
|
|
1157
|
+
: null;
|
|
1158
|
+
return { ...node.item, ...(folder ? { folder } : {}), children };
|
|
1159
|
+
})
|
|
1104
1160
|
.filter((item) => item.kind !== "container" || item.children.length > 0);
|
|
1105
1161
|
return {
|
|
1106
1162
|
area,
|
|
@@ -1110,6 +1166,34 @@ export function resolvePhiCmsActiveNavigationSurfaces({ catalog, area, activeMod
|
|
|
1110
1166
|
};
|
|
1111
1167
|
});
|
|
1112
1168
|
}
|
|
1169
|
+
/**
|
|
1170
|
+
* The Pages Module containers' folder addresses lead to by their descriptors (`folderTarget`), keyed by
|
|
1171
|
+
* address; an address no Module container answers is not in the map.
|
|
1172
|
+
*
|
|
1173
|
+
* Asked where the Site's published Navigations name no target for an address -- a request no Page
|
|
1174
|
+
* answers (`server-helpers/cms-request.ts`), a breadcrumb's folders -- so a Site's choice replaces the
|
|
1175
|
+
* Module's, not the reverse. Every surface of the Area is searched once, because a folder address is the
|
|
1176
|
+
* Area's, not one menu's.
|
|
1177
|
+
*/
|
|
1178
|
+
export function resolvePhiCmsModuleNavigationFolderTargets(input) {
|
|
1179
|
+
const wanted = new Set(input.addresses);
|
|
1180
|
+
const found = new Map();
|
|
1181
|
+
const visit = (items) => {
|
|
1182
|
+
for (const item of items) {
|
|
1183
|
+
const address = item.folder?.address;
|
|
1184
|
+
if (address && wanted.has(address) && !found.has(address) && item.folder?.target?.kind === "page") {
|
|
1185
|
+
found.set(address, item.folder.target.reference);
|
|
1186
|
+
}
|
|
1187
|
+
visit(item.children);
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
if (wanted.size === 0)
|
|
1191
|
+
return found;
|
|
1192
|
+
for (const surface of resolvePhiCmsActiveNavigationSurfaces(input)) {
|
|
1193
|
+
visit(surface.items);
|
|
1194
|
+
}
|
|
1195
|
+
return found;
|
|
1196
|
+
}
|
|
1113
1197
|
export function resolvePhiCmsNavigationOverlay(surface, overlay) {
|
|
1114
1198
|
if (!overlay) {
|
|
1115
1199
|
return { surface, diagnostics: [] };
|
|
@@ -1543,7 +1627,7 @@ function assertPhiCmsAreaOverlayTree(descriptor, tree, page, forms) {
|
|
|
1543
1627
|
}
|
|
1544
1628
|
}
|
|
1545
1629
|
}
|
|
1546
|
-
export async function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, activeModuleIds, siteId, area, path, runtime, }) {
|
|
1630
|
+
export async function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, activeModuleIds, siteId, area, path, runtime, loadModuleMedia, }) {
|
|
1547
1631
|
const descriptors = (catalog.areaOverlaysByArea.get(area) ?? [])
|
|
1548
1632
|
.filter((descriptor) => activeModuleIds.has(descriptor.ownerModuleId));
|
|
1549
1633
|
if (descriptors.length === 0)
|
|
@@ -1561,7 +1645,12 @@ export async function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, act
|
|
|
1561
1645
|
// Loaded side by side -- each contribution is a Core round trip of its own -- and merged in
|
|
1562
1646
|
// declaration order, which is what the ids and the controller settings below depend on.
|
|
1563
1647
|
const targetRuntime = resolveTargetRuntime(runtime, area);
|
|
1564
|
-
const contributions = await Promise.all(descriptors.map((descriptor) => descriptor.loadTree({
|
|
1648
|
+
const contributions = await Promise.all(descriptors.map((descriptor) => descriptor.loadTree({
|
|
1649
|
+
page,
|
|
1650
|
+
runtime: targetRuntime,
|
|
1651
|
+
catalog,
|
|
1652
|
+
media: createPhiModuleMediaResolver(descriptor.ownerModuleId, loadModuleMedia),
|
|
1653
|
+
})));
|
|
1565
1654
|
for (const [index, descriptor] of descriptors.entries()) {
|
|
1566
1655
|
const contribution = contributions[index];
|
|
1567
1656
|
assertPhiCmsAreaOverlayTree(descriptor, contribution, page, catalog.formDefinitionsById);
|
|
@@ -1591,27 +1680,32 @@ export async function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, act
|
|
|
1591
1680
|
function resolveTargetRuntime(runtime, area) {
|
|
1592
1681
|
return runtime.area === area ? runtime : { ...runtime, area };
|
|
1593
1682
|
}
|
|
1594
|
-
async function loadShellTree(descriptor, catalog, page, runtime) {
|
|
1683
|
+
async function loadShellTree(descriptor, catalog, page, runtime, loadModuleMedia) {
|
|
1595
1684
|
let composedTree = null;
|
|
1596
1685
|
for (const source of descriptor.composition ?? []) {
|
|
1597
1686
|
const sourceDescriptor = catalog.areaShellByIdentity.get(buildPhiCmsPresetIdentityKey(source.ownerModuleId, source.presetKey))?.descriptor;
|
|
1598
1687
|
if (!sourceDescriptor) {
|
|
1599
1688
|
throw new Error(`${descriptor.ownerModuleId}/${descriptor.presetKey}: unresolved shell composition source.`);
|
|
1600
1689
|
}
|
|
1601
|
-
const sourceTree = omitPhiCmsShellCompositionNodes(await loadShellTree(sourceDescriptor, catalog, page, runtime), sourceDescriptor, source.omitRegionTypes ?? [], source.omitNodeKeys ?? []);
|
|
1690
|
+
const sourceTree = omitPhiCmsShellCompositionNodes(await loadShellTree(sourceDescriptor, catalog, page, runtime, loadModuleMedia), sourceDescriptor, source.omitRegionTypes ?? [], source.omitNodeKeys ?? []);
|
|
1602
1691
|
composedTree = composedTree ? mergePhiCmsShellTrees(composedTree, sourceTree) : sourceTree;
|
|
1603
1692
|
}
|
|
1604
|
-
const ownTree = await descriptor.loadTree({
|
|
1693
|
+
const ownTree = await descriptor.loadTree({
|
|
1694
|
+
page,
|
|
1695
|
+
runtime,
|
|
1696
|
+
catalog,
|
|
1697
|
+
media: createPhiModuleMediaResolver(descriptor.ownerModuleId, loadModuleMedia),
|
|
1698
|
+
});
|
|
1605
1699
|
assertPhiCmsPresetTreeContract(ownTree, page, catalog.formDefinitionsById);
|
|
1606
1700
|
return composedTree ? mergePhiCmsShellTrees(composedTree, ownTree) : ownTree;
|
|
1607
1701
|
}
|
|
1608
|
-
export async function instantiatePhiCmsAreaShellPreset({ binding, catalog, siteId, path, runtime, }) {
|
|
1702
|
+
export async function instantiatePhiCmsAreaShellPreset({ binding, catalog, siteId, path, runtime, loadModuleMedia, }) {
|
|
1609
1703
|
const page = createSyntheticPresetPage({ siteId, area: binding.descriptor.area, path });
|
|
1610
|
-
const tree = await loadShellTree(binding.descriptor, catalog, page, resolveTargetRuntime(runtime, binding.descriptor.area));
|
|
1704
|
+
const tree = await loadShellTree(binding.descriptor, catalog, page, resolveTargetRuntime(runtime, binding.descriptor.area), loadModuleMedia);
|
|
1611
1705
|
assertPhiCmsPresetTreeContract(tree, page, catalog.formDefinitionsById);
|
|
1612
1706
|
return tree;
|
|
1613
1707
|
}
|
|
1614
|
-
export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeModuleIds, siteId, path, runtime, resolveMissingPageTitle, }) {
|
|
1708
|
+
export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeModuleIds, siteId, path, runtime, loadModuleMedia, resolveMissingPageTitle, }) {
|
|
1615
1709
|
const descriptor = binding.descriptor;
|
|
1616
1710
|
const page = createSyntheticPresetPage({
|
|
1617
1711
|
siteId,
|
|
@@ -1625,6 +1719,7 @@ export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeMod
|
|
|
1625
1719
|
catalog,
|
|
1626
1720
|
activeModuleIds,
|
|
1627
1721
|
params: binding.params,
|
|
1722
|
+
media: createPhiModuleMediaResolver(descriptor.ownerModuleId, loadModuleMedia),
|
|
1628
1723
|
});
|
|
1629
1724
|
const tree = loadedTree.pageMeta?.title
|
|
1630
1725
|
? loadedTree
|