@phis/ui 0.6.2 → 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.
Files changed (201) hide show
  1. package/components/cms/phi-cms-root-layout.js +2 -0
  2. package/components/controls/phi-mask-picker-control.d.ts +7 -1
  3. package/components/controls/phi-mask-picker-control.js +18 -16
  4. package/components/controls/phi-media-picker-control.d.ts +30 -1
  5. package/components/controls/phi-media-picker-control.js +15 -2
  6. package/components/controls/phi-media-source-item-tile-control.d.ts +22 -0
  7. package/components/controls/phi-media-source-item-tile-control.js +65 -0
  8. package/components/forms/form-field-labels.d.ts +19 -0
  9. package/components/forms/form-field-labels.js +78 -0
  10. package/components/forms/form-provider-contract.d.ts +1 -17
  11. package/components/forms/form-provider-contract.js +4 -18
  12. package/components/forms/media-asset-field-keys.d.ts +27 -0
  13. package/components/forms/media-asset-field-keys.js +27 -0
  14. package/components/forms/phi-form-widget.js +5 -1
  15. package/components/forms/upload-field-keys.d.ts +27 -0
  16. package/components/forms/upload-field-keys.js +27 -0
  17. package/components/forms/upload-form-control.js +11 -5
  18. package/components/media/asset-controller-requirement.d.ts +9 -0
  19. package/components/media/asset-controller-requirement.js +42 -0
  20. package/components/media/label-sets/media-upload.d.ts +10 -0
  21. package/components/media/label-sets/media-upload.js +85 -0
  22. package/components/media/label-sets/media.js +31 -135
  23. package/components/media/media-upload-labels.d.ts +43 -0
  24. package/components/media/media-upload-labels.js +23 -0
  25. package/components/media/media-upload-refusals.d.ts +12 -0
  26. package/components/media/media-upload-refusals.js +28 -0
  27. package/components/media/media-widget-labels.d.ts +33 -26
  28. package/components/media/media-widget-labels.js +27 -36
  29. package/components/media/phi-area-upload-widget.js +3 -4
  30. package/components/media/phi-asset-inspector-section.d.ts +2 -2
  31. package/components/media/phi-image-inspector-widget.d.ts +2 -5
  32. package/components/media/phi-media-picker-binding.d.ts +17 -0
  33. package/components/media/phi-media-picker-binding.js +199 -4
  34. package/components/media/phi-media-picker-labels.d.ts +7 -0
  35. package/components/media/phi-media-picker-labels.js +25 -0
  36. package/components/media/phi-media-sources.d.ts +69 -0
  37. package/components/media/phi-media-sources.js +254 -0
  38. package/components/media/phi-media-upload.d.ts +1 -27
  39. package/components/media/phi-media-upload.js +4 -48
  40. package/components/runtime/runtime-controller-materialization.d.ts +5 -4
  41. package/components/runtime/runtime-controller-materialization.js +5 -4
  42. package/components/runtime/runtime-module-context.d.ts +5 -1
  43. package/components/runtime/runtime-module-context.js +4 -1
  44. package/components/runtime/runtime-module-media-source-client-manifest.d.ts +17 -0
  45. package/components/runtime/runtime-module-media-source-client-manifest.js +53 -0
  46. package/components/widgets/client/shared/phi-mask-picker.js +23 -13
  47. package/components/widgets/client/shared/phi-widget-image-tool-button.d.ts +7 -5
  48. package/components/widgets/client/shared/phi-widget-image-tool-button.js +11 -7
  49. package/components/widgets/client/shared/phi-widget-tool-buttons.js +2 -2
  50. package/components/widgets/config/mask.d.ts +6 -8
  51. package/components/widgets/config/mask.js +14 -12
  52. package/components/widgets/label-sets/authoring-tools.js +55 -1
  53. package/components/widgets/label-sets/history.js +0 -2
  54. package/components/widgets/label-sets/slot-upload.js +4 -4
  55. package/components/widgets/label-types/authoring-tools.d.ts +10 -0
  56. package/components/widgets/label-types/authoring-tools.js +6 -0
  57. package/components/widgets/label-types/history.d.ts +1 -1
  58. package/components/widgets/label-types/history.js +0 -1
  59. package/components/widgets/label-types/mask-picker.d.ts +31 -0
  60. package/components/widgets/label-types/mask-picker.js +30 -0
  61. package/components/widgets/label-types/slot-upload.d.ts +2 -2
  62. package/controls.d.ts +2 -0
  63. package/controls.js +1 -0
  64. package/helpers/cms-region-keys.d.ts +1 -1
  65. package/module-client.d.ts +5 -1
  66. package/module-projection-client.js +1 -0
  67. package/next/areas/accounting-client.js +3 -2
  68. package/next/areas/admin-client.js +3 -2
  69. package/next/areas/app-client.js +3 -2
  70. package/next/areas/builder-client.js +3 -2
  71. package/next/areas/editor-client.js +3 -2
  72. package/next/areas/public-client.js +3 -2
  73. package/next/runtime-module-client-boundary.d.ts +3 -1
  74. package/next/runtime-module-client-boundary.js +3 -2
  75. package/package.json +7 -2
  76. package/plugins/runtime-modules/area-module-defaults.js +4 -3
  77. package/plugins/runtime-modules/asset/controller/definition.d.ts +2 -2
  78. package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
  79. package/plugins/runtime-modules/asset/definition.d.ts +3 -2
  80. package/plugins/runtime-modules/asset/definition.js +11 -3
  81. package/plugins/runtime-modules/asset/ids.d.ts +8 -0
  82. package/plugins/runtime-modules/asset/ids.js +8 -0
  83. package/plugins/runtime-modules/asset/labels.d.ts +4 -0
  84. package/plugins/runtime-modules/asset/labels.js +94 -0
  85. package/plugins/runtime-modules/asset/media-asset-form-control.js +32 -7
  86. package/plugins/runtime-modules/asset/metadata-form.js +27 -18
  87. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +14 -11
  88. package/plugins/runtime-modules/asset/widgets/area-upload/config.d.ts +2 -0
  89. package/plugins/runtime-modules/asset/widgets/area-upload/config.js +3 -0
  90. package/plugins/runtime-modules/asset/widgets/area-upload/server.js +3 -3
  91. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.d.ts +2 -0
  92. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.js +3 -0
  93. package/plugins/runtime-modules/asset/widgets/image-inspector/config.d.ts +2 -0
  94. package/plugins/runtime-modules/asset/widgets/image-inspector/config.js +3 -0
  95. package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -2
  96. package/plugins/runtime-modules/asset/widgets/media-picker/config.d.ts +1 -0
  97. package/plugins/runtime-modules/asset/widgets/media-picker/config.js +3 -0
  98. package/plugins/runtime-modules/auth/presets.d.ts +11 -0
  99. package/plugins/runtime-modules/auth/presets.js +17 -8
  100. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +1 -4
  101. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +2 -2
  102. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +1 -3
  103. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +4 -5
  104. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -8
  105. package/plugins/runtime-modules/builder/clients/pages-header.js +2 -0
  106. package/plugins/runtime-modules/builder/clients/widget-inspector.js +0 -1
  107. package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -1
  108. package/plugins/runtime-modules/builder/controller/page-controller.js +3 -3
  109. package/plugins/runtime-modules/builder/controller/workspace-controller.js +4 -1
  110. package/plugins/runtime-modules/builder/inspector-section-widget.js +5 -2
  111. package/plugins/runtime-modules/builder/module-authoring-catalog.server.js +3 -1
  112. package/plugins/runtime-modules/builder/navigation-catalog.server.js +3 -0
  113. package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +1 -1
  114. package/plugins/runtime-modules/builder/offered-page-catalog.js +8 -3
  115. package/plugins/runtime-modules/builder/options-providers.js +2 -2
  116. package/plugins/runtime-modules/builder/page-address-rule.d.ts +7 -0
  117. package/plugins/runtime-modules/builder/page-address-rule.js +12 -0
  118. package/plugins/runtime-modules/builder/page-presets.server.js +4 -0
  119. package/plugins/runtime-modules/builder/persistence.js +2 -3
  120. package/plugins/runtime-modules/builder/public-route-collisions.d.ts +1 -1
  121. package/plugins/runtime-modules/builder/public-route-collisions.js +6 -1
  122. package/plugins/runtime-modules/builder/runtime-module-sandbox.server.js +8 -1
  123. package/plugins/runtime-modules/builder/runtime-module-selection.js +5 -5
  124. package/plugins/runtime-modules/builder/services/runtime-modules-table.js +24 -6
  125. package/plugins/runtime-modules/builder/signal-endpoints.js +2 -1
  126. package/plugins/runtime-modules/builder/use-offered-page-catalog.d.ts +2 -2
  127. package/plugins/runtime-modules/builder/use-offered-page-catalog.js +5 -3
  128. package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +19 -12
  129. package/plugins/runtime-modules/client-manifests/accounting.d.ts +1 -0
  130. package/plugins/runtime-modules/client-manifests/accounting.js +1 -0
  131. package/plugins/runtime-modules/client-manifests/admin.d.ts +1 -0
  132. package/plugins/runtime-modules/client-manifests/admin.js +1 -0
  133. package/plugins/runtime-modules/client-manifests/app.d.ts +1 -0
  134. package/plugins/runtime-modules/client-manifests/app.js +1 -0
  135. package/plugins/runtime-modules/client-manifests/builder.d.ts +1 -0
  136. package/plugins/runtime-modules/client-manifests/builder.js +1 -0
  137. package/plugins/runtime-modules/client-manifests/common.d.ts +1 -0
  138. package/plugins/runtime-modules/client-manifests/common.js +3 -0
  139. package/plugins/runtime-modules/client-manifests/editor.d.ts +1 -0
  140. package/plugins/runtime-modules/client-manifests/editor.js +1 -0
  141. package/plugins/runtime-modules/client-manifests/public.d.ts +1 -0
  142. package/plugins/runtime-modules/client-manifests/public.js +1 -0
  143. package/plugins/runtime-modules/contracts.js +61 -0
  144. package/plugins/runtime-modules/core/client-media-sources.d.ts +5 -0
  145. package/plugins/runtime-modules/core/client-media-sources.js +6 -0
  146. package/plugins/runtime-modules/core/messaging/forms.js +2 -15
  147. package/plugins/runtime-modules/core/messaging/labels.d.ts +0 -12
  148. package/plugins/runtime-modules/core/messaging/labels.js +0 -24
  149. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -6
  150. package/plugins/runtime-modules/core/widgets/collection-view/config.d.ts +1 -0
  151. package/plugins/runtime-modules/core/widgets/collection-view/config.js +7 -0
  152. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +8 -2
  153. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
  154. package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +1 -1
  155. package/plugins/runtime-modules/core/widgets/collection-view/server.js +14 -2
  156. package/plugins/runtime-modules/core/widgets/image/authoring.js +1 -1
  157. package/plugins/runtime-modules/core/widgets/image/editor.d.ts +1 -4
  158. package/plugins/runtime-modules/core/widgets/image/editor.js +2 -2
  159. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +2 -3
  160. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -25
  161. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  162. package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -1
  163. package/plugins/runtime-modules/resolver.js +27 -1
  164. package/plugins/runtime-modules/settings.d.ts +20 -3
  165. package/plugins/runtime-modules/settings.js +35 -5
  166. package/plugins/runtime-modules/site-module-client-manifests.d.ts +2 -0
  167. package/plugins/runtime-modules/site-module-client-manifests.js +2 -0
  168. package/plugins/runtime-modules/site-modules-client.d.ts +5 -0
  169. package/plugins/runtime-modules/site-modules-client.js +1 -0
  170. package/plugins/runtime-modules/theme/brand-theme-model.js +0 -1
  171. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +97 -192
  172. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +6 -2
  173. package/runtime-client-manifests-accounting.d.ts +1 -1
  174. package/runtime-client-manifests-accounting.js +1 -1
  175. package/runtime-client-manifests-admin.d.ts +1 -1
  176. package/runtime-client-manifests-admin.js +1 -1
  177. package/runtime-client-manifests-app.d.ts +1 -1
  178. package/runtime-client-manifests-app.js +1 -1
  179. package/runtime-client-manifests-builder.d.ts +1 -1
  180. package/runtime-client-manifests-builder.js +1 -1
  181. package/runtime-client-manifests-editor.d.ts +1 -1
  182. package/runtime-client-manifests-editor.js +1 -1
  183. package/runtime-client-manifests-public.d.ts +2 -1
  184. package/runtime-client-manifests-public.js +1 -1
  185. package/runtime-media-source-client.d.ts +3 -0
  186. package/runtime-media-source-client.js +2 -0
  187. package/server-helpers/cms-request.js +10 -4
  188. package/theme/phi-theme-presets.d.ts +13 -3
  189. package/theme/phi-theme-presets.js +20 -3
  190. package/theme/phi-theme-seed-derivation.d.ts +240 -0
  191. package/theme/phi-theme-seed-derivation.js +126 -0
  192. package/types/cms-plugins.d.ts +29 -0
  193. package/types/media-source.d.ts +48 -0
  194. package/types/media-source.js +1 -0
  195. package/types/site-config.d.ts +1 -2
  196. package/types/site-theme.d.ts +0 -6
  197. package/types.d.ts +1 -0
  198. package/components/media/asset-controller-routes.d.ts +0 -8
  199. package/components/media/asset-controller-routes.js +0 -31
  200. package/helpers/brand-contact.d.ts +0 -14
  201. 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 Area runs that Controller for every Page -- its pickers need it everywhere -- and this Page is
51
- * the one with an inspector, a folder dialog and a gallery to reload. So the Page says so here, and
52
- * while it is shown the running Controller is told (`collectPhiRuntimeControllerConfigOverlays`).
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: mediaLabels?.inspector.inspectorTitle ?? "Asset inspector",
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: mediaLabels?.editor.focalRectLabel ?? "Focal rectangle",
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: mediaLabels?.editor.createFolderTitle ?? "Create folder",
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
- mediaLabels?.inspector.previewTitle ?? "Preview",
334
- mediaLabels?.inspector.metadataTitle ?? "Metadata",
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?.tool.uploadToggleLabel ?? "Upload",
443
- description: mediaLabels?.tool.uploadToggleLabel ?? "Upload",
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 { getPhiMediaWidgetLabels } from "../../../../../components/media/label-sets/media";
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 labels = await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
8
- return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.AreaUpload, componentProps: { labels: labels.upload, config } }));
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 { getPhiMediaWidgetLabels } from "../../../../../components/media/label-sets/media";
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 getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
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
- // Unanchored: the Public header exports no base item, so the entry lands at the end of the surface.
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
- itemKey: `@phis/ui/modules/auth/nav/public/${template.key}`,
58
- label: { defaultMessage: template.title },
59
- /* Signing up, not signing in: the account trigger beside it carries the way back. */
60
- icon: "antd:user-add",
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, blockId, }: {
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 = [], blockId, }) {
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, blockId: blockId, disabled: disabled, ...(onChange ? { onChange } : {}) }));
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, blockId, disabled, onChange, }: {
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 { PHI_MEDIA_WIDGET_DEFAULT_LABELS } from "../../../../components/media/media-widget-labels";
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, blockId, disabled, onChange, }) {
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
- signalRoutes: createPhiMediaPickerAssetControllerRoutes(`inspector-image-${blockId ?? "field"}`, "area"),
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 { PHI_MEDIA_WIDGET_DEFAULT_LABELS } from "../../../../components/media/media-widget-labels";
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
- signalRoutes: PHI_BUILDER_BACKGROUND_MEDIA_ROUTES[props.purpose],
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);
@@ -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,
@@ -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,7 +13,7 @@ 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";
@@ -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.runtimeModuleIdsByArea[effectiveArea] ?? [],
173
+ activeModuleIds: listPhiBuilderAddressedModuleIds(state, effectiveArea),
174
174
  catalog: currentPageTree,
175
175
  baseModuleId: resolvePhiRuntimeAreaDefinition(resolvePhiBuilderAreaAsCmsArea(effectiveArea)).baseModuleId,
176
176
  })
@@ -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.runtimeModuleIdsByArea[effectiveArea] ?? [],
259
+ activeModuleIds: listPhiBuilderAddressedModuleIds(state, effectiveArea),
260
260
  catalog: currentPageTree,
261
261
  baseModuleId: resolvePhiRuntimeAreaDefinition(resolvePhiBuilderAreaAsCmsArea(effectiveArea)).baseModuleId,
262
262
  });
@@ -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(() => {
@@ -9,6 +9,8 @@ import { getPhiInspectorWidgetLabels } from "../../../components/widgets/label-s
9
9
  import { resolvePhiInspectorSurfaceLabels } from "./clients/inspector-surface-labels";
10
10
  import { getPhiColorPickerLabels } from "../../../components/widgets/label-sets/color-picker";
11
11
  import { getPhiIconPickerLabels } from "../../../components/widgets/label-sets/icon-picker";
12
+ import { getPhiMediaWidgetLabels } from "../../../components/media/label-sets/media";
13
+ import { PhiMediaPickerLabelsProvider } from "../../../components/media/phi-media-picker-labels";
12
14
  import { PhiBuilderLayoutInspectorSectionWidgetClient, PhiBuilderRegionInspectorSectionWidgetClient, PhiBuilderWidgetInspectorSectionWidgetClient, } from "./clients/inspector-section-widget";
13
15
  import { buildPhiBuilderRuntimeModuleIdsForArea } from "./area-shell-presets.server";
14
16
  import { resolvePhiBuilderAreaAsCmsArea } from "../../../constants/cms-areas";
@@ -39,7 +41,7 @@ export async function PhiBuilderInspectorSectionWidget({ runtime, registry, view
39
41
  ...targetDataProviderDescriptors.map((descriptor) => descriptor.key),
40
42
  ]),
41
43
  ];
42
- const [backgroundLabels, borderLabels, paddingLabels, geometryLabels, signalsLabels, colorPickerLabels, iconPickerLabels, inspectorLabels,] = await Promise.all([
44
+ const [backgroundLabels, borderLabels, paddingLabels, geometryLabels, signalsLabels, colorPickerLabels, iconPickerLabels, inspectorLabels, mediaPickerLabels,] = await Promise.all([
43
45
  getPhiBackgroundWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
44
46
  getPhiBorderWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
45
47
  getPhiPaddingWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
@@ -48,7 +50,8 @@ export async function PhiBuilderInspectorSectionWidget({ runtime, registry, view
48
50
  getPhiColorPickerLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
49
51
  getPhiIconPickerLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
50
52
  getPhiInspectorWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
53
+ getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
51
54
  ]);
52
55
  const surfaceLabels = resolvePhiInspectorSurfaceLabels(inspectorLabels);
53
- return (_jsx(PhiRuntimeModuleAuthoringDataProviderHost, { providerKeys: authoringDataProviderKeys, children: _jsx(PhiRuntimeModuleDataProviderClientHost, { providerKeys: resolvePhiBuilderAuthoringPickerDataProviderKeysFromCatalog(registry.runtimeModuleCatalog), mode: "live", children: view === "region" ? (_jsx(PhiBuilderRegionInspectorSectionWidgetClient, { section: section, signalRoutes: signalRoutes, geometryLabels: geometryLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, paddingLabels: paddingLabels, surfaceLabels: surfaceLabels, visibilityLabels: inspectorLabels.regionVisibility, colorPickerLabels: colorPickerLabels })) : view === "layout" ? (_jsx(PhiBuilderLayoutInspectorSectionWidgetClient, { section: section, signalRoutes: signalRoutes, signalsLabels: signalsLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, paddingLabels: paddingLabels, surfaceLabels: surfaceLabels, gridLabels: inspectorLabels.grid, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, fieldLabels: inspectorLabels.fields })) : (_jsx(PhiBuilderWidgetInspectorSectionWidgetClient, { section: section, signalRoutes: signalRoutes, geometryLabels: geometryLabels, surfaceLabels: surfaceLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, signalsLabels: signalsLabels, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, fieldLabels: inspectorLabels.fields })) }) }));
56
+ return (_jsx(PhiMediaPickerLabelsProvider, { labels: mediaPickerLabels, children: _jsx(PhiRuntimeModuleAuthoringDataProviderHost, { providerKeys: authoringDataProviderKeys, children: _jsx(PhiRuntimeModuleDataProviderClientHost, { providerKeys: resolvePhiBuilderAuthoringPickerDataProviderKeysFromCatalog(registry.runtimeModuleCatalog), mode: "live", children: view === "region" ? (_jsx(PhiBuilderRegionInspectorSectionWidgetClient, { section: section, signalRoutes: signalRoutes, geometryLabels: geometryLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, paddingLabels: paddingLabels, surfaceLabels: surfaceLabels, visibilityLabels: inspectorLabels.regionVisibility, colorPickerLabels: colorPickerLabels })) : view === "layout" ? (_jsx(PhiBuilderLayoutInspectorSectionWidgetClient, { section: section, signalRoutes: signalRoutes, signalsLabels: signalsLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, paddingLabels: paddingLabels, surfaceLabels: surfaceLabels, gridLabels: inspectorLabels.grid, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, fieldLabels: inspectorLabels.fields })) : (_jsx(PhiBuilderWidgetInspectorSectionWidgetClient, { section: section, signalRoutes: signalRoutes, geometryLabels: geometryLabels, surfaceLabels: surfaceLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, signalsLabels: signalsLabels, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, fieldLabels: inspectorLabels.fields })) }) }) }));
54
57
  }
@@ -18,7 +18,9 @@ export function buildPhiBuilderModuleAuthoringCatalog({ catalog, area, activeMod
18
18
  areaDefinition.baseModuleId,
19
19
  ]);
20
20
  return [...catalog.entries()].flatMap(([moduleId, entry]) => {
21
- const locked = lockedModuleIds.has(moduleId);
21
+ // Locked is "active without being selected": the client keeps a locked entry whatever the Area's
22
+ // selection says, and a Module declared `activation: "always"` is in no selection.
23
+ const locked = lockedModuleIds.has(moduleId) || entry.definition.activation === "always";
22
24
  if (!activeModuleIds.has(moduleId)) {
23
25
  return [];
24
26
  }
@@ -2,6 +2,7 @@ import "server-only";
2
2
  import { PHI_BUILDER_AREA_KEYS, resolvePhiBuilderAreaAsCmsArea, } from "../../../constants/cms-areas";
3
3
  import { compilePhiCmsActiveRouteTable, resolvePhiCmsActiveNavigationSurfaces, resolvePhiCmsDescriptorCatalog, } from "../../../plugins/runtime-modules/descriptor-compiler";
4
4
  import { fetchSiteNavigationScopes } from "../../../gateway/site-nav";
5
+ import { listPhiAlwaysActiveRuntimeModuleIds } from "../settings";
5
6
  import { createPhiBuilderCustomNavigationSurface } from "../../../helpers/cms-navigation-catalog";
6
7
  import { readPhiServerApiCredentials } from "../../../helpers/phis-server-credentials";
7
8
  export async function buildPhiBuilderNavigationSurfacesByArea(runtime, runtimeModuleCatalog, optionalModuleIdsByArea) {
@@ -15,6 +16,7 @@ export async function buildPhiBuilderNavigationSurfacesByArea(runtime, runtimeMo
15
16
  internalToken: readPhiServerApiCredentials().internalToken,
16
17
  siteKey: runtime.site.key,
17
18
  });
19
+ const moduleDefinitions = [...runtimeModuleCatalog.values()].map((entry) => entry.definition);
18
20
  return Object.fromEntries(PHI_BUILDER_AREA_KEYS.map((builderArea) => {
19
21
  const area = resolvePhiBuilderAreaAsCmsArea(builderArea);
20
22
  const areaDefinition = catalog.areaDefinitions.get(area);
@@ -24,6 +26,7 @@ export async function buildPhiBuilderNavigationSurfacesByArea(runtime, runtimeMo
24
26
  const activeModuleIds = new Set([
25
27
  platformModuleId,
26
28
  areaDefinition.baseModuleId,
29
+ ...listPhiAlwaysActiveRuntimeModuleIds(area, moduleDefinitions),
27
30
  ...(optionalModuleIdsByArea[builderArea] ?? []),
28
31
  ]);
29
32
  // The declared table: this catalog names surfaces and entries, and reads no Area config, so a
@@ -7,7 +7,7 @@ import type { PhiDeveloperBuilderWorkspaceState } from "./developer-workspace-ty
7
7
  * controller its state -- and both are the same store; saying which fields are consulted keeps that a
8
8
  * fact rather than a coincidence.
9
9
  */
10
- export type PhiBuilderOfferedCatalogState = Pick<PhiDeveloperBuilderWorkspaceState, "modulePresetPagesByArea" | "customPages" | "persistedPageCatalogByArea" | "navigationSurfacesByArea" | "runtimeModuleIdsByArea" | "areaRootRoutes">;
10
+ export type PhiBuilderOfferedCatalogState = Pick<PhiDeveloperBuilderWorkspaceState, "modulePresetPagesByArea" | "customPages" | "persistedPageCatalogByArea" | "navigationSurfacesByArea" | "runtimeModuleIdsByArea" | "runtimeModuleDefinitions" | "areaRootRoutes">;
11
11
  /**
12
12
  * Every Page that could stand at this Area's root, whether or not it applied for the job.
13
13
  *