@phis/ui 0.6.1 → 0.6.3
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-root-layout.js +2 -0
- package/components/controls/phi-mask-picker-control.d.ts +7 -1
- package/components/controls/phi-mask-picker-control.js +18 -16
- package/components/controls/phi-media-picker-control.d.ts +30 -1
- package/components/controls/phi-media-picker-control.js +15 -2
- package/components/controls/phi-media-source-item-tile-control.d.ts +22 -0
- package/components/controls/phi-media-source-item-tile-control.js +65 -0
- package/components/forms/form-field-labels.d.ts +19 -0
- package/components/forms/form-field-labels.js +78 -0
- package/components/forms/form-provider-contract.d.ts +1 -17
- package/components/forms/form-provider-contract.js +4 -18
- package/components/forms/media-asset-field-keys.d.ts +27 -0
- package/components/forms/media-asset-field-keys.js +27 -0
- package/components/forms/phi-form-widget.js +5 -1
- package/components/forms/upload-field-keys.d.ts +27 -0
- package/components/forms/upload-field-keys.js +27 -0
- package/components/forms/upload-form-control.js +11 -5
- package/components/media/asset-controller-requirement.d.ts +9 -0
- package/components/media/asset-controller-requirement.js +42 -0
- package/components/media/label-sets/media-upload.d.ts +10 -0
- package/components/media/label-sets/media-upload.js +85 -0
- package/components/media/label-sets/media.js +31 -135
- package/components/media/media-upload-labels.d.ts +43 -0
- package/components/media/media-upload-labels.js +23 -0
- package/components/media/media-upload-refusals.d.ts +12 -0
- package/components/media/media-upload-refusals.js +28 -0
- package/components/media/media-widget-labels.d.ts +33 -26
- package/components/media/media-widget-labels.js +27 -36
- package/components/media/phi-area-upload-widget.js +3 -4
- package/components/media/phi-asset-inspector-section.d.ts +2 -2
- package/components/media/phi-image-inspector-widget.d.ts +2 -5
- package/components/media/phi-media-picker-binding.d.ts +17 -0
- package/components/media/phi-media-picker-binding.js +199 -4
- package/components/media/phi-media-picker-labels.d.ts +7 -0
- package/components/media/phi-media-picker-labels.js +25 -0
- package/components/media/phi-media-sources.d.ts +69 -0
- package/components/media/phi-media-sources.js +254 -0
- package/components/media/phi-media-upload.d.ts +1 -27
- package/components/media/phi-media-upload.js +4 -48
- package/components/runtime/runtime-controller-materialization.d.ts +5 -4
- package/components/runtime/runtime-controller-materialization.js +5 -4
- package/components/runtime/runtime-module-context.d.ts +5 -1
- package/components/runtime/runtime-module-context.js +4 -1
- package/components/runtime/runtime-module-media-source-client-manifest.d.ts +17 -0
- package/components/runtime/runtime-module-media-source-client-manifest.js +53 -0
- package/components/widgets/client/shared/phi-mask-picker.js +23 -13
- package/components/widgets/client/shared/phi-widget-image-tool-button.d.ts +7 -5
- package/components/widgets/client/shared/phi-widget-image-tool-button.js +11 -7
- package/components/widgets/client/shared/phi-widget-tool-buttons.js +2 -2
- package/components/widgets/config/mask.d.ts +6 -8
- package/components/widgets/config/mask.js +14 -12
- package/components/widgets/label-sets/authoring-tools.js +55 -1
- package/components/widgets/label-sets/history.js +0 -2
- package/components/widgets/label-sets/slot-upload.js +4 -4
- package/components/widgets/label-types/authoring-tools.d.ts +10 -0
- package/components/widgets/label-types/authoring-tools.js +6 -0
- package/components/widgets/label-types/history.d.ts +1 -1
- package/components/widgets/label-types/history.js +0 -1
- package/components/widgets/label-types/mask-picker.d.ts +31 -0
- package/components/widgets/label-types/mask-picker.js +30 -0
- package/components/widgets/label-types/slot-upload.d.ts +2 -2
- package/controls.d.ts +2 -0
- package/controls.js +1 -0
- package/helpers/cms-region-keys.d.ts +1 -1
- package/module-client.d.ts +5 -1
- package/module-projection-client.js +1 -0
- package/next/areas/accounting-client.js +3 -2
- package/next/areas/admin-client.js +3 -2
- package/next/areas/app-client.js +3 -2
- package/next/areas/builder-client.js +3 -2
- package/next/areas/editor-client.js +3 -2
- package/next/areas/public-client.js +3 -2
- package/next/runtime-module-client-boundary.d.ts +3 -1
- package/next/runtime-module-client-boundary.js +3 -2
- package/package.json +7 -2
- package/plugins/runtime-modules/area-module-defaults.js +4 -3
- package/plugins/runtime-modules/asset/controller/definition.d.ts +2 -2
- package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
- package/plugins/runtime-modules/asset/definition.d.ts +3 -2
- package/plugins/runtime-modules/asset/definition.js +11 -3
- package/plugins/runtime-modules/asset/ids.d.ts +8 -0
- package/plugins/runtime-modules/asset/ids.js +8 -0
- package/plugins/runtime-modules/asset/labels.d.ts +4 -0
- package/plugins/runtime-modules/asset/labels.js +94 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.js +32 -7
- package/plugins/runtime-modules/asset/metadata-form.js +27 -18
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +14 -11
- package/plugins/runtime-modules/asset/widgets/area-upload/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/area-upload/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/area-upload/server.js +3 -3
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -2
- package/plugins/runtime-modules/asset/widgets/media-picker/config.d.ts +1 -0
- package/plugins/runtime-modules/asset/widgets/media-picker/config.js +3 -0
- package/plugins/runtime-modules/auth/presets.d.ts +11 -0
- package/plugins/runtime-modules/auth/presets.js +17 -8
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +1 -4
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +2 -2
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +1 -3
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +4 -5
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -8
- package/plugins/runtime-modules/builder/clients/pages-header.js +2 -0
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +4 -4
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +0 -1
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +2 -2
- package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -1
- package/plugins/runtime-modules/builder/controller/page-controller.js +8 -8
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +4 -1
- package/plugins/runtime-modules/builder/inspector-section-widget.js +5 -2
- package/plugins/runtime-modules/builder/module-authoring-catalog.server.js +3 -1
- package/plugins/runtime-modules/builder/navigation-catalog.server.js +3 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +1 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.js +8 -3
- package/plugins/runtime-modules/builder/options-providers.js +2 -2
- package/plugins/runtime-modules/builder/page-address-rule.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-address-rule.js +12 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +4 -0
- package/plugins/runtime-modules/builder/persistence.js +6 -7
- package/plugins/runtime-modules/builder/public-route-collisions.d.ts +1 -1
- package/plugins/runtime-modules/builder/public-route-collisions.js +6 -1
- package/plugins/runtime-modules/builder/region-keys.d.ts +10 -0
- package/plugins/runtime-modules/builder/region-keys.js +10 -0
- package/plugins/runtime-modules/builder/runtime-module-sandbox.server.js +8 -1
- package/plugins/runtime-modules/builder/runtime-module-selection.js +5 -5
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +24 -6
- package/plugins/runtime-modules/builder/signal-endpoints.js +2 -1
- package/plugins/runtime-modules/builder/use-offered-page-catalog.d.ts +2 -2
- package/plugins/runtime-modules/builder/use-offered-page-catalog.js +5 -3
- package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +19 -12
- package/plugins/runtime-modules/client-manifests/accounting.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/accounting.js +1 -0
- package/plugins/runtime-modules/client-manifests/admin.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/admin.js +1 -0
- package/plugins/runtime-modules/client-manifests/app.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/app.js +1 -0
- package/plugins/runtime-modules/client-manifests/builder.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/builder.js +1 -0
- package/plugins/runtime-modules/client-manifests/common.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/common.js +3 -0
- package/plugins/runtime-modules/client-manifests/editor.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/editor.js +1 -0
- package/plugins/runtime-modules/client-manifests/public.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/public.js +1 -0
- package/plugins/runtime-modules/contracts.js +61 -0
- package/plugins/runtime-modules/core/client-media-sources.d.ts +5 -0
- package/plugins/runtime-modules/core/client-media-sources.js +6 -0
- package/plugins/runtime-modules/core/messaging/forms.js +2 -15
- package/plugins/runtime-modules/core/messaging/labels.d.ts +0 -12
- package/plugins/runtime-modules/core/messaging/labels.js +0 -24
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -6
- package/plugins/runtime-modules/core/widgets/collection-view/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +7 -0
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +8 -2
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
- package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/server.js +14 -2
- package/plugins/runtime-modules/core/widgets/image/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/editor.d.ts +1 -4
- package/plugins/runtime-modules/core/widgets/image/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +2 -3
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -25
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
- package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -1
- package/plugins/runtime-modules/resolver.js +27 -1
- package/plugins/runtime-modules/settings.d.ts +20 -3
- package/plugins/runtime-modules/settings.js +35 -5
- package/plugins/runtime-modules/site-module-client-manifests.d.ts +2 -0
- package/plugins/runtime-modules/site-module-client-manifests.js +2 -0
- package/plugins/runtime-modules/site-modules-client.d.ts +5 -0
- package/plugins/runtime-modules/site-modules-client.js +1 -0
- package/plugins/runtime-modules/theme/brand-theme-model.js +0 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +97 -192
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +6 -2
- package/runtime-client-manifests-accounting.d.ts +1 -1
- package/runtime-client-manifests-accounting.js +1 -1
- package/runtime-client-manifests-admin.d.ts +1 -1
- package/runtime-client-manifests-admin.js +1 -1
- package/runtime-client-manifests-app.d.ts +1 -1
- package/runtime-client-manifests-app.js +1 -1
- package/runtime-client-manifests-builder.d.ts +1 -1
- package/runtime-client-manifests-builder.js +1 -1
- package/runtime-client-manifests-editor.d.ts +1 -1
- package/runtime-client-manifests-editor.js +1 -1
- package/runtime-client-manifests-public.d.ts +2 -1
- package/runtime-client-manifests-public.js +1 -1
- package/runtime-media-source-client.d.ts +3 -0
- package/runtime-media-source-client.js +2 -0
- package/server-helpers/cms-request.js +10 -4
- package/server-helpers/search-index.js +7 -6
- package/server-helpers/site-build-id.d.ts +25 -0
- package/server-helpers/site-build-id.js +27 -0
- package/theme/phi-theme-presets.d.ts +13 -3
- package/theme/phi-theme-presets.js +20 -3
- package/theme/phi-theme-seed-derivation.d.ts +240 -0
- package/theme/phi-theme-seed-derivation.js +126 -0
- package/types/cms-plugins.d.ts +29 -0
- package/types/media-source.d.ts +48 -0
- package/types/media-source.js +1 -0
- package/types/site-config.d.ts +1 -2
- package/types/site-theme.d.ts +0 -6
- package/types.d.ts +1 -0
- package/components/media/asset-controller-routes.d.ts +0 -8
- package/components/media/asset-controller-routes.js +0 -31
- package/helpers/brand-contact.d.ts +0 -14
- package/helpers/brand-contact.js +0 -26
|
@@ -7,6 +7,7 @@ import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress, createPhiSignalSubcon
|
|
|
7
7
|
import { PHI_SPACE } from "../../../../theme/antd-css-var-contract";
|
|
8
8
|
import { getPhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-sets/builder-chrome";
|
|
9
9
|
import { getPhiMediaWidgetLabels } from "../../../../components/media/label-sets/media";
|
|
10
|
+
import { getPhiAssetModuleLabels } from "../labels";
|
|
10
11
|
import { createPhiAssetControllerAddress, PHI_ASSET_CONTROLLER_INSTANCE_KEY, PHI_ASSET_CONTROLLER_TYPE, } from "../../../../components/media/asset-controller-address";
|
|
11
12
|
import { createPhiRuntimeFormControllerAddress } from "../../../../components/forms/runtime-form-controller-address";
|
|
12
13
|
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
@@ -30,9 +31,10 @@ const PHI_ASSET_MEDIA_PAGE_REGION_IDS = {
|
|
|
30
31
|
export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
31
32
|
const nodes = createPhiCmsPresetNodes(page);
|
|
32
33
|
const credentials = buildPhiWidgetLabelTranslatorOptions(runtime);
|
|
33
|
-
const [chromeLabels, mediaLabels] = await Promise.all([
|
|
34
|
+
const [chromeLabels, mediaLabels, assetLabels] = await Promise.all([
|
|
34
35
|
getPhiBuilderChromeWidgetLabels(credentials),
|
|
35
36
|
getPhiMediaWidgetLabels(credentials),
|
|
37
|
+
getPhiAssetModuleLabels(credentials),
|
|
36
38
|
]);
|
|
37
39
|
const inspectorOverlay = createPhiSignalAddress("cms", PHI_ASSET_INSPECTOR_OVERLAY_IDS.overlayMediaInspector);
|
|
38
40
|
const folderOverlay = createPhiSignalAddress("cms", PHI_ASSET_INSPECTOR_OVERLAY_IDS.overlayMediaFolderCreate);
|
|
@@ -47,9 +49,10 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
47
49
|
/*
|
|
48
50
|
* Whom the Asset Controller answers into on this Page.
|
|
49
51
|
*
|
|
50
|
-
* The
|
|
51
|
-
*
|
|
52
|
-
*
|
|
52
|
+
* The Controller mounts on demand, and this Page is the one with an inspector, a folder dialog and
|
|
53
|
+
* a gallery to reload. So the Page states it here: the setting mounts the Controller for the Page,
|
|
54
|
+
* with these routes, and the Widgets on it that ask for the Controller get this one instance
|
|
55
|
+
* (`materializePhiRuntimeControllerSettings`).
|
|
53
56
|
*/
|
|
54
57
|
controllerSettings: [{
|
|
55
58
|
type: PHI_ASSET_CONTROLLER_TYPE,
|
|
@@ -128,7 +131,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
128
131
|
sortOrder: 0,
|
|
129
132
|
label: "Asset inspector",
|
|
130
133
|
config: {
|
|
131
|
-
title:
|
|
134
|
+
title: assetLabels.inspector.inspectorTitle ?? "Asset inspector",
|
|
132
135
|
placement: "right",
|
|
133
136
|
size: 377,
|
|
134
137
|
mountPolicy: "lazy-keep",
|
|
@@ -168,7 +171,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
168
171
|
sortOrder: 1,
|
|
169
172
|
label: "Asset focal rectangle",
|
|
170
173
|
config: {
|
|
171
|
-
title:
|
|
174
|
+
title: assetLabels.editor.focalRectLabel ?? "Focal rectangle",
|
|
172
175
|
controlSize: "large",
|
|
173
176
|
flags: PhiCmsFlags.Centered,
|
|
174
177
|
mountPolicy: "remount",
|
|
@@ -207,7 +210,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
207
210
|
sortOrder: 2,
|
|
208
211
|
label: "Create asset folder",
|
|
209
212
|
config: {
|
|
210
|
-
title:
|
|
213
|
+
title: assetLabels.editor.createFolderTitle ?? "Create folder",
|
|
211
214
|
controlSize: "medium",
|
|
212
215
|
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
213
216
|
flags: PhiCmsFlags.Centered,
|
|
@@ -330,8 +333,8 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
330
333
|
padding: PHI_SPACE.sm,
|
|
331
334
|
innerPadding: PHI_SPACE.sm,
|
|
332
335
|
slotTitles: [
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
assetLabels.inspector.previewTitle ?? "Preview",
|
|
337
|
+
assetLabels.inspector.metadataTitle ?? "Metadata",
|
|
335
338
|
],
|
|
336
339
|
defaultOpenSlotKeys: ["slot_0", "slot_1"],
|
|
337
340
|
},
|
|
@@ -439,8 +442,8 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
439
442
|
toolbar: [
|
|
440
443
|
{
|
|
441
444
|
key: "upload",
|
|
442
|
-
label: mediaLabels?.
|
|
443
|
-
description: mediaLabels?.
|
|
445
|
+
label: mediaLabels?.upload.uploadToggleLabel ?? "Upload",
|
|
446
|
+
description: mediaLabels?.upload.uploadToggleLabel ?? "Upload",
|
|
444
447
|
icon: "upload",
|
|
445
448
|
display: "icon",
|
|
446
449
|
mode: "primary",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PhiCmsAreaUploadWidgetConfig } from "../../../../../types/media";
|
|
2
|
+
import { requirePhiAssetController } from "../../../../../components/media/asset-controller-requirement";
|
|
2
3
|
declare function parsePhiCmsAreaUploadWidgetConfig(config: Record<string, unknown>): PhiCmsAreaUploadWidgetConfig;
|
|
3
4
|
export declare const PHI_AREA_UPLOAD_WIDGET_DEFINITION: {
|
|
4
5
|
kind: "widget";
|
|
5
6
|
pluginKey: string;
|
|
6
7
|
typeKey: string;
|
|
8
|
+
requiredRuntimeControllers: typeof requirePhiAssetController;
|
|
7
9
|
title: string;
|
|
8
10
|
description: string;
|
|
9
11
|
category: "media";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isPhiRecord } from "../../../../../helpers/is-record";
|
|
2
2
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
3
|
+
import { requirePhiAssetController } from "../../../../../components/media/asset-controller-requirement";
|
|
3
4
|
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "../../ids";
|
|
4
5
|
import { readBoolean, readInteger, readRenderableBlockConfig, readString, } from "../../../../../components/widgets/config/parser-primitives";
|
|
5
6
|
function normalizePhiCmsAreaUploadWidgetConfig(config) {
|
|
@@ -29,6 +30,8 @@ export const PHI_AREA_UPLOAD_WIDGET_DEFINITION = {
|
|
|
29
30
|
kind: "widget",
|
|
30
31
|
pluginKey: resolvePhiCmsWidgetPluginKey("area-upload"),
|
|
31
32
|
typeKey: "area-upload",
|
|
33
|
+
// An upload goes into the folder the Asset Controller holds, so the Controller is where this is.
|
|
34
|
+
requiredRuntimeControllers: requirePhiAssetController,
|
|
32
35
|
title: "Area Upload",
|
|
33
36
|
description: "Dropzone and temporary upload wall for area-scoped media assets.",
|
|
34
37
|
category: "media",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getPhiMediaUploadLabels } from "../../../../../components/media/label-sets/media-upload";
|
|
3
3
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
4
4
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
5
5
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
|
|
6
6
|
export async function PhiAreaUploadWidgetServer({ runtime, config, }) {
|
|
7
|
-
const
|
|
8
|
-
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.AreaUpload, componentProps: { labels:
|
|
7
|
+
const { upload } = await getPhiMediaUploadLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
8
|
+
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.AreaUpload, componentProps: { labels: upload, config } }));
|
|
9
9
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PhiCmsAssetFocalRectWidgetConfig } from "../../../../../types/media";
|
|
2
|
+
import { requirePhiAssetController } from "../../../../../components/media/asset-controller-requirement";
|
|
2
3
|
declare function parsePhiCmsAssetFocalRectWidgetConfig(config: Record<string, unknown>): PhiCmsAssetFocalRectWidgetConfig;
|
|
3
4
|
export declare const PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION: {
|
|
4
5
|
kind: "widget";
|
|
5
6
|
pluginKey: string;
|
|
6
7
|
typeKey: string;
|
|
8
|
+
requiredRuntimeControllers: typeof requirePhiAssetController;
|
|
7
9
|
title: string;
|
|
8
10
|
description: string;
|
|
9
11
|
category: "media";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
2
|
+
import { requirePhiAssetController } from "../../../../../components/media/asset-controller-requirement";
|
|
2
3
|
import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet, } from "../../../../../types/signals";
|
|
3
4
|
function parsePhiCmsAssetFocalRectWidgetConfig(config) {
|
|
4
5
|
return {
|
|
@@ -9,6 +10,8 @@ export const PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION = {
|
|
|
9
10
|
kind: "widget",
|
|
10
11
|
pluginKey: resolvePhiCmsWidgetPluginKey("asset-focal-rect"),
|
|
11
12
|
typeKey: "asset-focal-rect",
|
|
13
|
+
// It edits the Asset the Controller was told is selected, so the Controller is where this is.
|
|
14
|
+
requiredRuntimeControllers: requirePhiAssetController,
|
|
12
15
|
title: "Asset Focal Rectangle",
|
|
13
16
|
description: "Spatial editor for the selected Asset focal rectangle.",
|
|
14
17
|
category: "media",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PhiCmsAssetInspectorWidgetConfig } from "../../../../../types/media";
|
|
2
|
+
import { requirePhiAssetController } from "../../../../../components/media/asset-controller-requirement";
|
|
2
3
|
declare function parsePhiCmsAssetInspectorWidgetConfig(config: Record<string, unknown>): PhiCmsAssetInspectorWidgetConfig;
|
|
3
4
|
export declare const PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION: {
|
|
4
5
|
kind: "widget";
|
|
5
6
|
pluginKey: string;
|
|
6
7
|
typeKey: string;
|
|
8
|
+
requiredRuntimeControllers: typeof requirePhiAssetController;
|
|
7
9
|
title: string;
|
|
8
10
|
description: string;
|
|
9
11
|
category: "media";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isPhiRecord } from "../../../../../helpers/is-record";
|
|
2
2
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
3
|
+
import { requirePhiAssetController } from "../../../../../components/media/asset-controller-requirement";
|
|
3
4
|
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "../../ids";
|
|
4
5
|
import { readPhiSignalRouteSet } from "../../../../../types/signals";
|
|
5
6
|
function normalizePhiCmsAssetInspectorWidgetConfig(config) {
|
|
@@ -18,6 +19,8 @@ export const PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION = {
|
|
|
18
19
|
kind: "widget",
|
|
19
20
|
pluginKey: resolvePhiCmsWidgetPluginKey("image-inspector"),
|
|
20
21
|
typeKey: "image-inspector",
|
|
22
|
+
// It draws the Asset the Controller was told is selected, so the Controller is where this is.
|
|
23
|
+
requiredRuntimeControllers: requirePhiAssetController,
|
|
21
24
|
title: "Asset Inspector",
|
|
22
25
|
description: "Drawer inspector for the selected asset.",
|
|
23
26
|
category: "media",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getPhiAssetModuleLabels } from "../../labels";
|
|
3
3
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
4
4
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
5
5
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
|
|
6
6
|
export async function PhiAssetConfigWidgetServer({ runtime, config, }) {
|
|
7
|
-
const labels = await
|
|
7
|
+
const labels = await getPhiAssetModuleLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
8
8
|
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.ImageInspector, componentProps: {
|
|
9
9
|
labels: { inspector: labels.inspector, editor: labels.editor },
|
|
10
10
|
config,
|
|
@@ -5,6 +5,7 @@ export declare const PHI_MEDIA_PICKER_WIDGET_DEFINITION: {
|
|
|
5
5
|
pluginKey: string;
|
|
6
6
|
typeKey: string;
|
|
7
7
|
slotSizePolicy: "intrinsic";
|
|
8
|
+
requiredRuntimeControllers: ({ config }: import("../../../../../types").PhiCmsWidgetRuntimeControllerRequirementArgs<PhiCmsMediaPickerWidgetConfig>) => import("../../../../../types").PhiRuntimeControllerRequirement[];
|
|
8
9
|
title: string;
|
|
9
10
|
description: string;
|
|
10
11
|
category: "media";
|
|
@@ -3,6 +3,7 @@ import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widge
|
|
|
3
3
|
import { normalizePhiMediaKind, PhiMediaKind } from "../../../../../constants/media";
|
|
4
4
|
import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet, } from "../../../../../types/signals";
|
|
5
5
|
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "../../ids";
|
|
6
|
+
import { resolvePhiAssetControllerRouteRequirements } from "../../../../../components/media/asset-controller-requirement";
|
|
6
7
|
import { readBoolean, readNumber, readString } from "../../../../../components/widgets/config/parser-primitives";
|
|
7
8
|
import { PHI_MEDIA_PICKER_DEFAULT_COLUMN_WIDTH, PHI_MEDIA_PICKER_MAX_COLUMN_WIDTH, PHI_MEDIA_PICKER_MIN_COLUMN_WIDTH, normalizePhiMediaPickerMinColumnWidth, } from "../../../../../components/controls/phi-media-picker-control-contract";
|
|
8
9
|
const PHI_MEDIA_PICKER_DATA_SOURCE = {
|
|
@@ -45,6 +46,8 @@ export const PHI_MEDIA_PICKER_WIDGET_DEFINITION = {
|
|
|
45
46
|
pluginKey: resolvePhiCmsWidgetPluginKey("media-picker"),
|
|
46
47
|
typeKey: "media-picker",
|
|
47
48
|
slotSizePolicy: "intrinsic",
|
|
49
|
+
// The Controller this picker's routes tell what is searched and chosen, where the placement wires any.
|
|
50
|
+
requiredRuntimeControllers: ({ config }) => resolvePhiAssetControllerRouteRequirements(config.signalRoutes),
|
|
48
51
|
title: "Mediathek",
|
|
49
52
|
description: "Button-based media picker with search, read-only folder context, thumbnails, and pagination.",
|
|
50
53
|
category: "media",
|
|
@@ -18,6 +18,17 @@ export declare const PHI_AUTH_RUNTIME_MODULE_ROUTES: (PhiCmsRoutePresetDescripto
|
|
|
18
18
|
readonly icon: "antd:user-add";
|
|
19
19
|
readonly routePresetKey: "public-registration-page";
|
|
20
20
|
};
|
|
21
|
+
}, {
|
|
22
|
+
readonly navKey: "public:footer";
|
|
23
|
+
readonly parentItemKey: null;
|
|
24
|
+
readonly item: {
|
|
25
|
+
readonly itemKey: "@phis/ui/modules/auth/nav/public/registration";
|
|
26
|
+
readonly label: {
|
|
27
|
+
readonly defaultMessage: "Register";
|
|
28
|
+
};
|
|
29
|
+
readonly icon: "antd:user-add";
|
|
30
|
+
readonly routePresetKey: "public-registration-page";
|
|
31
|
+
};
|
|
21
32
|
}];
|
|
22
33
|
loadTree: (context: PhiCmsDescriptorBuildContext) => Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
23
34
|
})[];
|
|
@@ -49,17 +49,26 @@ function buildFormRouteNavigation(template) {
|
|
|
49
49
|
if (template.key !== "registration") {
|
|
50
50
|
return [];
|
|
51
51
|
}
|
|
52
|
-
//
|
|
52
|
+
// One key on both surfaces, as Contact has: it is one entry, offered in two places.
|
|
53
|
+
const item = {
|
|
54
|
+
itemKey: `@phis/ui/modules/auth/nav/public/${template.key}`,
|
|
55
|
+
label: { defaultMessage: template.title },
|
|
56
|
+
/* Signing up, not signing in: the account trigger beside it carries the way back. */
|
|
57
|
+
icon: "antd:user-add",
|
|
58
|
+
routePresetKey: `public-${template.key}-page`,
|
|
59
|
+
};
|
|
60
|
+
/*
|
|
61
|
+
* Unanchored on both surfaces, so the entry lands at the end of each: the Public header exports no
|
|
62
|
+
* base item, and in the footer's Quick Links it belongs after the legal entries and Contact.
|
|
63
|
+
*/
|
|
53
64
|
return [{
|
|
54
65
|
navKey: "public:header",
|
|
55
66
|
parentItemKey: null,
|
|
56
|
-
item
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
routePresetKey: `public-${template.key}-page`,
|
|
62
|
-
},
|
|
67
|
+
item,
|
|
68
|
+
}, {
|
|
69
|
+
navKey: "public:footer",
|
|
70
|
+
parentItemKey: null,
|
|
71
|
+
item,
|
|
63
72
|
}];
|
|
64
73
|
}
|
|
65
74
|
export const PHI_AUTH_RUNTIME_MODULE_ROUTES = [
|
|
@@ -8,7 +8,6 @@ import { type PhiRenderableBlockSize } from "../../../../types";
|
|
|
8
8
|
import { type PhiCmsPaddingWidgetConfig } from "../../../../types/cms-config";
|
|
9
9
|
import type { PhiColorPickerLabels } from "../../../../components/widgets/label-types/color-picker";
|
|
10
10
|
import type { PhiIconPickerControlLabels } from "../../../../components/widgets/label-types/icon-picker";
|
|
11
|
-
import type { PhiCmsInstanceId } from "../../../../types/cms-instance-id";
|
|
12
11
|
import type { PhiPaddingWidgetLabels } from "../../../../components/widgets/label-types/padding";
|
|
13
12
|
import type { PhiBackgroundWidgetLabels } from "../../../../components/widgets/label-types/background";
|
|
14
13
|
import type { PhiBorderWidgetLabels } from "../../../../components/widgets/label-types/border";
|
|
@@ -71,15 +70,13 @@ export declare function renderPhiInspectorPaddingConfigControl({ field, config,
|
|
|
71
70
|
onChange?: (nextPadding: PhiCmsPaddingWidgetConfig | null, patch: Record<string, unknown>) => void;
|
|
72
71
|
}): import("react").JSX.Element;
|
|
73
72
|
export declare function renderPhiInspectorConfigField(args: Parameters<typeof renderPhiInspectorConfigFieldBody>[0]): import("react").JSX.Element | null;
|
|
74
|
-
declare function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, pageRecordFields,
|
|
73
|
+
declare function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, pageRecordFields, }: {
|
|
75
74
|
field: PhiCmsConfigField;
|
|
76
75
|
value: unknown;
|
|
77
76
|
defaultValue: unknown;
|
|
78
77
|
config: Record<string, unknown>;
|
|
79
78
|
defaultConfig?: Record<string, unknown> | null;
|
|
80
79
|
disabled: boolean;
|
|
81
|
-
/** The edited node, for a field that opens something addressed by it -- the image field's picker. */
|
|
82
|
-
blockId?: PhiCmsInstanceId | null;
|
|
83
80
|
widgetReferenceOptions?: PhiInspectorWidgetReferenceOption[];
|
|
84
81
|
paddingLabels?: PhiPaddingWidgetLabels;
|
|
85
82
|
backgroundLabels?: PhiBackgroundWidgetLabels;
|
|
@@ -513,7 +513,7 @@ export function renderPhiInspectorConfigField(args) {
|
|
|
513
513
|
return body;
|
|
514
514
|
return (_jsxs(Fragment, { children: [_jsx(PhiDividerControl, { titlePlacement: "start", style: { marginBlock: 0 }, children: args.field.heading }), body] }, args.field.key));
|
|
515
515
|
}
|
|
516
|
-
function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels = PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], pageRecordFields = [],
|
|
516
|
+
function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels = PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], pageRecordFields = [], }) {
|
|
517
517
|
if (field.type === "readonly") {
|
|
518
518
|
const displayValue = value ?? defaultValue;
|
|
519
519
|
return renderPhiInspectorConfigFieldControl(field, _jsx(PhiTextControl, { value: displayValue == null ? "" : String(displayValue), readOnly: true, allowClear: false, style: { width: "100%" } }));
|
|
@@ -762,7 +762,7 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
762
762
|
* squeezing three stacked parts into the label column's other half leaves none of them usable.
|
|
763
763
|
*/
|
|
764
764
|
if (field.type === "image") {
|
|
765
|
-
return renderPhiInspectorConfigFieldBlock(field, _jsx(PhiInspectorImageFieldControl, { config: config,
|
|
765
|
+
return renderPhiInspectorConfigFieldBlock(field, _jsx(PhiInspectorImageFieldControl, { config: config, disabled: disabled, ...(onChange ? { onChange } : {}) }));
|
|
766
766
|
}
|
|
767
767
|
if (field.type === "link-target") {
|
|
768
768
|
return renderPhiInspectorConfigFieldBlock(field, _jsx(PhiInspectorLinkTargetFieldControl, { value: value ?? defaultValue, disabled: disabled || !onChange, labels: fieldLabels.linkTarget, onChange: (next, none) => onChange?.({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { PhiCmsInstanceId } from "../../../../types/cms-instance-id";
|
|
2
1
|
/**
|
|
3
2
|
* A Widget's picture, chosen and described in one place: which picture, in which rendition, and what it
|
|
4
3
|
* says to a reader who cannot see it. The picture is chosen with the house's media picker, the one the
|
|
@@ -9,9 +8,8 @@ import type { PhiCmsInstanceId } from "../../../../types/cms-instance-id";
|
|
|
9
8
|
* library; without one, an address stands for a picture from elsewhere. Removing the picture clears both,
|
|
10
9
|
* so nothing of the old one is left to come back.
|
|
11
10
|
*/
|
|
12
|
-
export declare function PhiInspectorImageFieldControl({ config,
|
|
11
|
+
export declare function PhiInspectorImageFieldControl({ config, disabled, onChange, }: {
|
|
13
12
|
config: Record<string, unknown>;
|
|
14
|
-
blockId?: PhiCmsInstanceId | null;
|
|
15
13
|
disabled?: boolean;
|
|
16
14
|
onChange?: (patch: Record<string, unknown>) => void;
|
|
17
15
|
}): import("react").JSX.Element;
|
|
@@ -4,8 +4,7 @@ import { PhiFlexControl } from "../../../../components/controls/phi-flex-control
|
|
|
4
4
|
import { PhiSelectControl } from "../../../../components/controls/phi-select-control";
|
|
5
5
|
import { PhiTextControl } from "../../../../components/controls/phi-text-control";
|
|
6
6
|
import { PhiMediaPickerBinding } from "../../../../components/media/phi-media-picker-binding";
|
|
7
|
-
import {
|
|
8
|
-
import { createPhiMediaPickerAssetControllerRoutes } from "../../../../components/media/asset-controller-routes";
|
|
7
|
+
import { usePhiMediaPickerLabels } from "../../../../components/media/phi-media-picker-labels";
|
|
9
8
|
import { PHI_SEARCH_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/search";
|
|
10
9
|
import { PHI_IMAGE_VARIANT_OPTIONS } from "../../../../components/widgets/config/image-variant-options";
|
|
11
10
|
import { PhiInspectorFieldRow } from "../../../../components/widgets/inspector-field-row";
|
|
@@ -22,7 +21,8 @@ const PHI_IMAGE_FIELD_ORIGINAL_VARIANT = "__original__";
|
|
|
22
21
|
* library; without one, an address stands for a picture from elsewhere. Removing the picture clears both,
|
|
23
22
|
* so nothing of the old one is left to come back.
|
|
24
23
|
*/
|
|
25
|
-
export function PhiInspectorImageFieldControl({ config,
|
|
24
|
+
export function PhiInspectorImageFieldControl({ config, disabled, onChange, }) {
|
|
25
|
+
const mediaPickerLabels = usePhiMediaPickerLabels();
|
|
26
26
|
const assetId = config.sourceKind === "asset" && typeof config.assetId === "number" ? config.assetId : null;
|
|
27
27
|
const asset = usePhiAuthoringAssetDetails(assetId);
|
|
28
28
|
const sourceUrl = typeof config.sourceUrl === "string" ? config.sourceUrl : "";
|
|
@@ -34,8 +34,7 @@ export function PhiInspectorImageFieldControl({ config, blockId, disabled, onCha
|
|
|
34
34
|
showPagination: true,
|
|
35
35
|
showGroupFilter: true,
|
|
36
36
|
showSearchBar: true,
|
|
37
|
-
|
|
38
|
-
}, labels: PHI_MEDIA_WIDGET_DEFAULT_LABELS, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, value: assetId, onAssetSelect: editable
|
|
37
|
+
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, value: assetId, onAssetSelect: editable
|
|
39
38
|
? (picked) => onChange?.({
|
|
40
39
|
sourceKind: "asset",
|
|
41
40
|
assetId: picked.id,
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { findPhiPageNodePath } from "../../../../helpers/cms-page-catalog";
|
|
5
5
|
import { PhiMediaPickerBinding } from "../../../../components/media/phi-media-picker-binding";
|
|
6
|
-
import {
|
|
6
|
+
import { usePhiMediaPickerLabels } from "../../../../components/media/phi-media-picker-labels";
|
|
7
7
|
import { PHI_SEARCH_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/search";
|
|
8
8
|
import { PhiMediaAssetFlags, PhiMediaKind } from "../../../../constants/media";
|
|
9
9
|
import { PHI_SIGNAL_VALUE_SCHEMAS, } from "../../../../types/signals";
|
|
@@ -21,11 +21,6 @@ import { PhiModuleIconsProvider } from "../../../../components/shell/phi-module-
|
|
|
21
21
|
import { normalizePhiPaddingWidgetConfig } from "../../../../types/cms-config";
|
|
22
22
|
import { usePhiBuilderModuleMetas, } from "../plugin-meta-store";
|
|
23
23
|
import { findPhiBuilderLayoutNodeById, findPhiBuilderWidgetNodeByIdInLayouts, } from "../node-finders";
|
|
24
|
-
import { createPhiMediaPickerAssetControllerRoutes } from "../../../../components/media/asset-controller-routes";
|
|
25
|
-
const PHI_BUILDER_BACKGROUND_MEDIA_ROUTES = {
|
|
26
|
-
preview: createPhiMediaPickerAssetControllerRoutes("builder-background-preview-media", "area"),
|
|
27
|
-
field: createPhiMediaPickerAssetControllerRoutes("builder-background-field-media", "area"),
|
|
28
|
-
};
|
|
29
24
|
function collectWidgetReferenceOptionsFromWidgets(widgets, options) {
|
|
30
25
|
for (const widget of widgets ?? []) {
|
|
31
26
|
options.push({
|
|
@@ -77,6 +72,7 @@ function resolveDraftFromLayoutNode(node, meta) {
|
|
|
77
72
|
};
|
|
78
73
|
}
|
|
79
74
|
function usePhiBuilderInspectorSectionState(signalRoutes) {
|
|
75
|
+
const mediaPickerLabels = usePhiMediaPickerLabels();
|
|
80
76
|
const dispatchSignal = usePhiSignalDispatcher();
|
|
81
77
|
const area = usePhiDeveloperBuilderStateValue((state) => state.area);
|
|
82
78
|
const pageKey = usePhiDeveloperBuilderStateValue((state) => state.pageKey);
|
|
@@ -167,8 +163,7 @@ function usePhiBuilderInspectorSectionState(signalRoutes) {
|
|
|
167
163
|
showPagination: true,
|
|
168
164
|
showGroupFilter: true,
|
|
169
165
|
showSearchBar: true,
|
|
170
|
-
|
|
171
|
-
}, labels: PHI_MEDIA_WIDGET_DEFAULT_LABELS, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, value: props.value, open: props.open, trigger: props.trigger, onOpenChange: props.onOpenChange, onCommit: props.onCommit, onDiscard: props.onDiscard, onAssetSelect: props.onAssetSelect, onAssetClear: props.onAssetClear })), []);
|
|
166
|
+
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, value: props.value, open: props.open, trigger: props.trigger, onOpenChange: props.onOpenChange, onCommit: props.onCommit, onDiscard: props.onDiscard, onAssetSelect: props.onAssetSelect, onAssetClear: props.onAssetClear })), [mediaPickerLabels]);
|
|
172
167
|
return {
|
|
173
168
|
activeCalendarAdapterDescriptors,
|
|
174
169
|
activeVideoProviderDescriptors,
|
|
@@ -49,6 +49,7 @@ export function PhiDeveloperBuilderPagesHeaderSection({ mode, pageTitle, disable
|
|
|
49
49
|
*/
|
|
50
50
|
const navigationSurfacesByArea = usePhiDeveloperBuilderStateValue((state) => state.navigationSurfacesByArea);
|
|
51
51
|
const runtimeModuleIdsByArea = usePhiDeveloperBuilderStateValue((state) => state.runtimeModuleIdsByArea);
|
|
52
|
+
const runtimeModuleDefinitions = usePhiDeveloperBuilderStateValue((state) => state.runtimeModuleDefinitions);
|
|
52
53
|
const areaRootRoutes = usePhiDeveloperBuilderStateValue((state) => state.areaRootRoutes);
|
|
53
54
|
const pageCatalogHydratedByArea = usePhiDeveloperBuilderStateValue((state) => state.pageCatalogHydratedByArea);
|
|
54
55
|
const resolvedCustomPages = customPages ?? {};
|
|
@@ -66,6 +67,7 @@ export function PhiDeveloperBuilderPagesHeaderSection({ mode, pageTitle, disable
|
|
|
66
67
|
persistedPageCatalogByArea,
|
|
67
68
|
navigationSurfacesByArea,
|
|
68
69
|
runtimeModuleIdsByArea,
|
|
70
|
+
runtimeModuleDefinitions,
|
|
69
71
|
areaRootRoutes,
|
|
70
72
|
};
|
|
71
73
|
const pageTree = resolvePhiBuilderOfferedPageCatalog(offeredCatalogState, area);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { PhiDeveloperBuilderCanvasWidgetClient } from "./canvas-widget";
|
|
5
|
-
import {
|
|
5
|
+
import { getPhiBuilderPageDraftKey } from "../region-keys";
|
|
6
6
|
import { mergePhiDeveloperDeletedPageDrafts, mergePhiDeveloperPageMetaDrafts, setPhiDeveloperBuilderPageControllerSettings, usePhiDeveloperBuilderStateValue, } from "../developer-workspace-store";
|
|
7
7
|
import { isPhiBuilderConstructedRootPage } from "../offered-page-catalog";
|
|
8
8
|
export function PhiDeveloperBuilderPagesWorkspaceWidgetClient({ pageDraftsByScope, pageMeta, pageMetaArea, pageMetaPageKey, serverPreviewRegions, previewRegionDrafts = null, regionLabels, pickerLabels, }) {
|
|
@@ -13,14 +13,14 @@ export function PhiDeveloperBuilderPagesWorkspaceWidgetClient({ pageDraftsByScop
|
|
|
13
13
|
const constructedRoot = usePhiDeveloperBuilderStateValue((state) => isPhiBuilderConstructedRootPage(state, pageMetaArea, pageMetaPageKey));
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
mergePhiDeveloperPageMetaDrafts(pageMetaArea, {
|
|
16
|
-
[
|
|
16
|
+
[getPhiBuilderPageDraftKey(pageMetaArea, "page_meta", pageMetaPageKey)]: {
|
|
17
17
|
title: pageMeta?.title ?? null,
|
|
18
18
|
description: pageMeta?.description ?? null,
|
|
19
19
|
index: pageMeta?.index ?? true,
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
mergePhiDeveloperDeletedPageDrafts(pageMetaArea, {
|
|
23
|
-
[
|
|
23
|
+
[getPhiBuilderPageDraftKey(pageMetaArea, "page_delete", pageMetaPageKey)]: pageMeta?.isDeleted === true,
|
|
24
24
|
});
|
|
25
25
|
}, [
|
|
26
26
|
pageMeta?.description,
|
|
@@ -37,7 +37,7 @@ export function PhiDeveloperBuilderPagesWorkspaceWidgetClient({ pageDraftsByScop
|
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (!pageMeta)
|
|
39
39
|
return;
|
|
40
|
-
setPhiDeveloperBuilderPageControllerSettings(
|
|
40
|
+
setPhiDeveloperBuilderPageControllerSettings(getPhiBuilderPageDraftKey(pageMetaArea, "page_meta", pageMetaPageKey), constructedRoot ? [] : pageMeta.controllerSettings);
|
|
41
41
|
}, [constructedRoot, pageMeta, pageMetaArea, pageMetaPageKey]);
|
|
42
42
|
return (_jsx("div", { style: { minWidth: 0, width: "100%", minHeight: 0, flex: "1 1 auto" }, children: _jsx(PhiDeveloperBuilderCanvasWidgetClient, { workspace: "pages", pageDraftsByScope: pageDraftsByScope, serverPreviewRegions: serverPreviewRegions, previewRegionDrafts: previewRegionDrafts, targetArea: pageMetaArea, regionLabels: regionLabels, pickerLabels: pickerLabels }) }));
|
|
43
43
|
}
|
|
@@ -65,7 +65,6 @@ export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builde
|
|
|
65
65
|
const lock = resolvePhiInspectorFieldLock(field, selectedStructureWidgetMeta?.fields ?? [], currentWidgetSettingsConfigRecord);
|
|
66
66
|
return renderPhiInspectorConfigField({
|
|
67
67
|
field,
|
|
68
|
-
blockId: currentDraft?.id ?? null,
|
|
69
68
|
value: lock ? lock.value : readPhiInspectorConfigPathValue(currentWidgetSettingsConfigRecord, field.key),
|
|
70
69
|
defaultValue: readPhiInspectorConfigPathValue(widgetDefaultConfigRecord, field.key),
|
|
71
70
|
config: currentWidgetSettingsConfigRecord,
|
|
@@ -5,7 +5,7 @@ import { usePhiConfirmDialog } from "../../../../components/controls/phi-confirm
|
|
|
5
5
|
import { formatPhiHistoryMoveMessage, } from "../../../../components/widgets/label-types/history";
|
|
6
6
|
import { usePhiApplicationFeedback } from "../../../../components/runtime/use-phi-application-feedback";
|
|
7
7
|
import { createPhiDefaultAreaRuntimeModuleIds } from "../../area-module-defaults";
|
|
8
|
-
import {
|
|
8
|
+
import { getPhiBuilderPageDraftKey } from "../region-keys";
|
|
9
9
|
import { resolvePhiBuilderCmsStoragePath } from "../../../../helpers/cms-paths";
|
|
10
10
|
import { resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, resolvePhiBuilderPagePresetSource, } from "../../../../helpers/cms-page-catalog";
|
|
11
11
|
import { deleteCmsDraft } from "../../../../helpers/cms-draft-delete";
|
|
@@ -388,7 +388,7 @@ export function usePhiBuilderDraftCommandController({ effectiveArea, effectiveNa
|
|
|
388
388
|
pageKey: effectivePageKey,
|
|
389
389
|
title: "",
|
|
390
390
|
});
|
|
391
|
-
const pageDeleteDraftKey =
|
|
391
|
+
const pageDeleteDraftKey = getPhiBuilderPageDraftKey(effectiveArea, "page_delete", effectivePageKey);
|
|
392
392
|
mergePhiDeveloperRegionDrafts(nextDrafts);
|
|
393
393
|
markPhiBuilderPageDeleted(pageDeleteDraftKey);
|
|
394
394
|
const result = await savePhiDeveloperBuilderDraft({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PhiDeveloperBuilderArea, PhiDeveloperBuilderWorkspaceState } from "../developer-workspace-types";
|
|
2
2
|
import { type PhiSignalValue } from "../../../../types/signals";
|
|
3
3
|
import type { PhiBuilderPageMetaPresentationLabels } from "../controller/definition";
|
|
4
|
-
type PhiBuilderPageControllerState = Pick<PhiDeveloperBuilderWorkspaceState, "customPages" | "modulePresetPagesByArea" | "pageMetaDrafts" | "persistedPageCatalogByArea" | "runtimeModuleIdsByArea">;
|
|
4
|
+
type PhiBuilderPageControllerState = Pick<PhiDeveloperBuilderWorkspaceState, "customPages" | "modulePresetPagesByArea" | "pageMetaDrafts" | "persistedPageCatalogByArea" | "runtimeModuleIdsByArea" | "runtimeModuleDefinitions">;
|
|
5
5
|
type PhiPageMetaDialogMode = "create" | "update";
|
|
6
6
|
export declare function usePhiBuilderPageController({ emitCapability, effectiveArea, effectivePageKey, pageMetaLabels, state, }: {
|
|
7
7
|
/** The Builder Controller's own output: the Page metadata dialog is routed by the Pages Page. */
|
|
@@ -13,11 +13,11 @@ import { resolvePhiBuilderAreaAsCmsArea } from "../../../../constants/cms-areas"
|
|
|
13
13
|
import { resolvePhiRuntimeAreaDefinition } from "../../area-definitions";
|
|
14
14
|
import { collectPhiDeveloperBuilderPageKeys, collectPhiDeveloperBuilderPageStoragePaths, findPhiDeveloperBuilderPageNode, resolveUniquePhiDeveloperBuilderPagePath, } from "./page-controller-helpers";
|
|
15
15
|
import { createPhiDeveloperBuilderInitialPageDrafts, createPhiDeveloperBuilderPageDraft, PhiBuilderPageExistsError, } from "../persistence";
|
|
16
|
-
import { describePhiBuilderModuleAddressConflict, describePhiBuilderPageAddressConflict, findPhiBuilderModuleAddressConflict, findPhiBuilderSitePageAddressConflict, } from "../page-address-rule";
|
|
16
|
+
import { describePhiBuilderModuleAddressConflict, describePhiBuilderPageAddressConflict, findPhiBuilderModuleAddressConflict, findPhiBuilderSitePageAddressConflict, listPhiBuilderAddressedModuleIds, } from "../page-address-rule";
|
|
17
17
|
import { PHI_BUILDER_AREA_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, } from "../../../../helpers/cms-scope-search-params";
|
|
18
18
|
import { PHI_BUILDER_PREVIEW_SEARCH_PARAM } from "../preview-transport";
|
|
19
19
|
import { mergePhiDeveloperRegionDrafts, openPhiBuilderPage, setPhiBuilderPageMetaDraft, startPhiBuilderNewPageDrafts, getPhiDeveloperBuilderStateSnapshot, } from "../developer-workspace-store";
|
|
20
|
-
import {
|
|
20
|
+
import { getPhiBuilderPageDraftKey } from "../region-keys";
|
|
21
21
|
import { capturePhiBuilderWorkspaceHistoryState, createPhiBuilderHistoryContext, phiBuilderHistory, } from "../history";
|
|
22
22
|
import { createPhiBuilderControllerAddress } from "../controller/address";
|
|
23
23
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
@@ -80,7 +80,7 @@ export function usePhiBuilderPageController({ emitCapability, effectiveArea, eff
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
function openPageMetaDialog(mode) {
|
|
83
|
-
const pageMetaDraftKey =
|
|
83
|
+
const pageMetaDraftKey = getPhiBuilderPageDraftKey(effectiveArea, "page_meta", effectivePageKey);
|
|
84
84
|
const currentMetaDraft = state.pageMetaDrafts[pageMetaDraftKey] ?? {};
|
|
85
85
|
const pageTitle = currentMetaDraft.title?.trim() || resolvePageTitleForInput(effectivePageKey);
|
|
86
86
|
const currentPath = normalizePhiBuilderCmsCatalogPath(resolvePhiBuilderCmsStoragePath(effectiveArea, effectivePageKey, currentPageTree));
|
|
@@ -170,7 +170,7 @@ export function usePhiBuilderPageController({ emitCapability, effectiveArea, eff
|
|
|
170
170
|
const moveModuleConflict = pathChanged
|
|
171
171
|
? findPhiBuilderModuleAddressConflict(requestedPath, {
|
|
172
172
|
area: effectiveArea,
|
|
173
|
-
activeModuleIds: state
|
|
173
|
+
activeModuleIds: listPhiBuilderAddressedModuleIds(state, effectiveArea),
|
|
174
174
|
catalog: currentPageTree,
|
|
175
175
|
baseModuleId: resolvePhiRuntimeAreaDefinition(resolvePhiBuilderAreaAsCmsArea(effectiveArea)).baseModuleId,
|
|
176
176
|
})
|
|
@@ -188,7 +188,7 @@ export function usePhiBuilderPageController({ emitCapability, effectiveArea, eff
|
|
|
188
188
|
path: requestedPath,
|
|
189
189
|
})
|
|
190
190
|
: null;
|
|
191
|
-
const pageMetaDraftKey =
|
|
191
|
+
const pageMetaDraftKey = getPhiBuilderPageDraftKey(effectiveArea, "page_meta", effectivePageKey);
|
|
192
192
|
const historyBefore = capturePhiBuilderWorkspaceHistoryState(getPhiDeveloperBuilderStateSnapshot());
|
|
193
193
|
setPhiBuilderPageMetaDraft(pageMetaDraftKey, { title: editedTitle, description, ...indexPatch });
|
|
194
194
|
phiBuilderHistory.record(createPhiBuilderHistoryContext({
|
|
@@ -256,7 +256,7 @@ export function usePhiBuilderPageController({ emitCapability, effectiveArea, eff
|
|
|
256
256
|
}
|
|
257
257
|
const createModuleConflict = findPhiBuilderModuleAddressConflict(requestedStoragePath, {
|
|
258
258
|
area: effectiveArea,
|
|
259
|
-
activeModuleIds: state
|
|
259
|
+
activeModuleIds: listPhiBuilderAddressedModuleIds(state, effectiveArea),
|
|
260
260
|
catalog: currentPageTree,
|
|
261
261
|
baseModuleId: resolvePhiRuntimeAreaDefinition(resolvePhiBuilderAreaAsCmsArea(effectiveArea)).baseModuleId,
|
|
262
262
|
});
|
|
@@ -283,9 +283,9 @@ export function usePhiBuilderPageController({ emitCapability, effectiveArea, eff
|
|
|
283
283
|
addPhiWorkspaceCustomPage(effectiveArea, { key: requestedKey, title, storagePath: requestedStoragePath });
|
|
284
284
|
// The page's meta and delete drafts are edits in progress, so they stay with the Builder.
|
|
285
285
|
startPhiBuilderNewPageDrafts({
|
|
286
|
-
metaDraftKey:
|
|
286
|
+
metaDraftKey: getPhiBuilderPageDraftKey(effectiveArea, "page_meta", requestedKey),
|
|
287
287
|
meta: { title, description, ...indexPatch },
|
|
288
|
-
deleteDraftKey:
|
|
288
|
+
deleteDraftKey: getPhiBuilderPageDraftKey(effectiveArea, "page_delete", requestedKey),
|
|
289
289
|
});
|
|
290
290
|
await reloadPersistedPageCatalog(effectiveArea);
|
|
291
291
|
navigateToBuilderPage(requestedKey);
|
|
@@ -10,7 +10,7 @@ import { readPhiTableBindingParamsSignalValue } from "../../../../types/table-si
|
|
|
10
10
|
import { readPhiCmsInstanceId } from "../../../../types/cms-instance-id";
|
|
11
11
|
import { usePhiSignalDispatcher, usePhiSignalListener, } from "../../../../components/runtime/runtime-signal-bus";
|
|
12
12
|
import { usePhiApplicationFeedback } from "../../../../components/runtime/use-phi-application-feedback";
|
|
13
|
-
import { resolvePhiRuntimeModuleIdsForArea } from "../../../../plugins/runtime-modules/settings";
|
|
13
|
+
import { listPhiAlwaysActiveRuntimeModuleIds, resolvePhiRuntimeModuleIdsForArea, } from "../../../../plugins/runtime-modules/settings";
|
|
14
14
|
import { PHI_BUILDER_PREVIEW_SEARCH_PARAM, } from "../preview-transport";
|
|
15
15
|
import { PHI_BUILDER_AREA_SEARCH_PARAM, PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, PHI_BUILDER_RUNTIME_MODULES_SEARCH_PARAM, normalizePhiBuilderAreaSearchParam, normalizePhiBuilderPageSearchParam, serializePhiBuilderRuntimeModuleIdsSearchParam, } from "../../../../helpers/cms-scope-search-params";
|
|
16
16
|
import { createPhiBuilderControllerAddress } from "../controller/address";
|
|
@@ -82,6 +82,7 @@ function resolveBuilderActiveModuleIds(area, moduleIds, definitions) {
|
|
|
82
82
|
...definitions
|
|
83
83
|
.filter((definition) => definition.kind === "platform")
|
|
84
84
|
.map((definition) => definition.moduleId),
|
|
85
|
+
...listPhiAlwaysActiveRuntimeModuleIds(area, definitions),
|
|
85
86
|
...selectRuntimeModuleIds(moduleIds, area, definitions),
|
|
86
87
|
]);
|
|
87
88
|
return activeModuleIds;
|
|
@@ -657,6 +658,7 @@ function usePhiDeveloperBuilderWorkspaceController(options) {
|
|
|
657
658
|
persistedPageCatalogByArea: state.persistedPageCatalogByArea,
|
|
658
659
|
navigationSurfacesByArea: state.navigationSurfacesByArea,
|
|
659
660
|
runtimeModuleIdsByArea: state.runtimeModuleIdsByArea,
|
|
661
|
+
runtimeModuleDefinitions: state.runtimeModuleDefinitions,
|
|
660
662
|
areaRootRoutes: state.areaRootRoutes,
|
|
661
663
|
}), [
|
|
662
664
|
state.modulePresetPagesByArea,
|
|
@@ -664,6 +666,7 @@ function usePhiDeveloperBuilderWorkspaceController(options) {
|
|
|
664
666
|
state.persistedPageCatalogByArea,
|
|
665
667
|
state.navigationSurfacesByArea,
|
|
666
668
|
state.runtimeModuleIdsByArea,
|
|
669
|
+
state.runtimeModuleDefinitions,
|
|
667
670
|
state.areaRootRoutes,
|
|
668
671
|
]);
|
|
669
672
|
useEffect(() => {
|