@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
@@ -456,6 +456,46 @@ function assertNavigationItemAccessPolicies(moduleId, ownerProviderId, items) {
456
456
  }
457
457
  }
458
458
  }
459
+ /**
460
+ * What `activation: "always"` may be declared with (`PhiRuntimeModuleDefinition.activation`).
461
+ *
462
+ * The declarations it refuses are the ones read from an Area's stored selection, which an always-active
463
+ * Module is never in: they would be accepted here and then dropped by every reader.
464
+ */
465
+ const PHI_SELECTION_DERIVED_DECLARATIONS = [
466
+ "mediaSpaces",
467
+ "threadKinds",
468
+ "seed",
469
+ "userState",
470
+ "authUiProvider",
471
+ ];
472
+ function assertPhiRuntimeModuleActivation(definition, areaDefinitions) {
473
+ const activation = definition.activation;
474
+ if (activation === undefined) {
475
+ return;
476
+ }
477
+ if (activation !== "always") {
478
+ throw new Error(`${definition.moduleId}: activation must be "always" or absent.`);
479
+ }
480
+ if (definition.kind !== "module") {
481
+ throw new Error(`${definition.moduleId}: the Platform Module is active everywhere already and must not declare activation.`);
482
+ }
483
+ if (areaDefinitions.some(({ baseModuleId }) => baseModuleId === definition.moduleId)) {
484
+ throw new Error(`${definition.moduleId}: an Area's Base Module is active in its own Area and must not declare activation.`);
485
+ }
486
+ if (!definition.moduleId.startsWith(`${PHI_SHARED_PACKAGE_NAME}/${PHI_MODULE_MARKER}/`)) {
487
+ throw new Error(`${definition.moduleId}: only a Module of ${PHI_SHARED_PACKAGE_NAME} may declare activation "always"; ` +
488
+ `installing a package must not switch a Module on.`);
489
+ }
490
+ if (definition.eligibleAreas.length === 0) {
491
+ throw new Error(`${definition.moduleId}: an always-active Module must be eligible for at least one Area.`);
492
+ }
493
+ const declared = PHI_SELECTION_DERIVED_DECLARATIONS.filter((key) => definition[key] !== undefined);
494
+ if (declared.length > 0) {
495
+ throw new Error(`${definition.moduleId}: an always-active Module must not declare ${declared.join(", ")}. ` +
496
+ `They are derived from an Area's stored Module selection, which an always-active Module is never part of.`);
497
+ }
498
+ }
459
499
  export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
460
500
  const catalog = new Map();
461
501
  const ownerModuleIdByControllerType = new Map();
@@ -463,6 +503,7 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
463
503
  const ownerModuleIdByLayoutType = new Map();
464
504
  const ownerModuleIdByDataProviderKey = new Map();
465
505
  const ownerModuleIdByCalendarAdapterKey = new Map();
506
+ const ownerModuleIdByMediaSourceKey = new Map();
466
507
  const ownerModuleIdByVideoProviderKey = new Map();
467
508
  const ownerModuleIdByFormFieldTypeKey = new Map();
468
509
  const ownerModuleIdByFormValidationKey = new Map();
@@ -479,6 +520,7 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
479
520
  }
480
521
  assertPhiRuntimeModuleMetadata(definition);
481
522
  assertPhiRuntimeModuleServerBinding(definition);
523
+ assertPhiRuntimeModuleActivation(definition, areaDefinitions);
482
524
  const ownerProviderId = definition.serverBinding.providerId;
483
525
  const hasController = hasPhiRuntimeModuleController(definition);
484
526
  if (hasController) {
@@ -572,6 +614,19 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
572
614
  }
573
615
  ownerModuleIdByCalendarAdapterKey.set(adapter.key, definition.moduleId);
574
616
  }
617
+ for (const source of definition.mediaSources ?? []) {
618
+ if (!isPhiNamespacedRuntimeKey(source.key)) {
619
+ throw new Error(`${definition.moduleId}: invalid media source key "${source.key}".`);
620
+ }
621
+ if (source.ownerModuleId !== definition.moduleId) {
622
+ throw new Error(`${definition.moduleId}: media source "${source.key}" has a different owner module id.`);
623
+ }
624
+ const currentSourceOwner = ownerModuleIdByMediaSourceKey.get(source.key);
625
+ if (currentSourceOwner) {
626
+ throw new Error(`Media source "${source.key}" is owned by both "${currentSourceOwner}" and "${definition.moduleId}".`);
627
+ }
628
+ ownerModuleIdByMediaSourceKey.set(source.key, definition.moduleId);
629
+ }
575
630
  for (const provider of definition.videoProviders ?? []) {
576
631
  if (!isPhiVideoProviderKey(provider.key)) {
577
632
  throw new Error(`${definition.moduleId}: invalid video provider key "${provider.key}".`);
@@ -691,6 +746,7 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
691
746
  (entry.themes?.length ?? 0) + (entry.themeBlocks?.length ?? 0) +
692
747
  (entry.dashboardCards ? 1 : 0) +
693
748
  (definition.dataProviders?.length ?? 0) + (definition.calendarAdapters?.length ?? 0) +
749
+ (definition.mediaSources?.length ?? 0) +
694
750
  (definition.videoProviders?.length ?? 0) + (definition.collectionItemRenderers?.length ?? 0) +
695
751
  (definition.icons?.length ?? 0) +
696
752
  Object.values(definition.formProviders ?? {}).reduce((count, providers) => count + (providers?.length ?? 0), 0);
@@ -901,6 +957,11 @@ export function assertPhiRuntimeModule(module) {
901
957
  throw new Error(`${module.moduleId}: Calendar adapter "${descriptor.key}" has a different owner module id.`);
902
958
  }
903
959
  }
960
+ for (const descriptor of module.mediaSources ?? []) {
961
+ if (descriptor.ownerModuleId !== module.moduleId) {
962
+ throw new Error(`${module.moduleId}: media source "${descriptor.key}" has a different owner module id.`);
963
+ }
964
+ }
904
965
  for (const descriptor of module.videoProviders ?? []) {
905
966
  if (descriptor.ownerModuleId !== module.moduleId) {
906
967
  throw new Error(`${module.moduleId}: video provider "${descriptor.key}" has a different owner module id.`);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The first-party media sources: none. No Module of ours offers a source; one comes from a Module
3
+ * package of a Site (`mediaSources` of its client contributions) or from an Add-on on the server.
4
+ */
5
+ export declare const PHI_CORE_MEDIA_SOURCE_CLIENT_DEFINITIONS: readonly [];
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ /**
3
+ * The first-party media sources: none. No Module of ours offers a source; one comes from a Module
4
+ * package of a Site (`mediaSources` of its client contributions) or from an Add-on on the server.
5
+ */
6
+ export const PHI_CORE_MEDIA_SOURCE_CLIENT_DEFINITIONS = [];
@@ -1,5 +1,5 @@
1
1
  import { createPhiFormLabelSetLoader } from "../../../../components/forms/shared-form-loaders";
2
- import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_UPLOAD_LABEL_KEYS, PHI_FORM_VALIDATION_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../../components/forms/form-provider-contract";
2
+ import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_VALIDATION_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../../components/forms/form-provider-contract";
3
3
  import { PHI_FORM_GRID_LAST_LINE } from "../../../../components/forms/form-descriptor-contract";
4
4
  import { definePhiRuntimeModuleForm } from "../../../../components/forms/form-registry";
5
5
  import { PHI_SHARED_FORM_IDS } from "../../../../components/forms/shared-form-ids";
@@ -71,12 +71,11 @@ const PHI_THREAD_REPLY_FORM_DESCRIPTOR = {
71
71
  /*
72
72
  * The attachment narrows nothing the Site has not narrowed already: the kinds are what the writer's
73
73
  * own Space accepts, which the control plane answers for. An area rather than a button, because a
74
- * file is part of what a reply says.
74
+ * file is part of what a reply says. What it says is the upload field's own (`widget:upload`).
75
75
  */
76
76
  {
77
77
  key: "assetIds",
78
78
  fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.upload,
79
- placeholder: label("replyAttach", "Attach a file"),
80
79
  config: { space: PHI_THREAD_REPLY_SPACE, presentation: "area" },
81
80
  },
82
81
  ],
@@ -91,19 +90,7 @@ const loadLabels = createPhiFormLabelSetLoader(() => import("./labels").then((mo
91
90
  replyThreadRequired: labels.replyThreadRequired,
92
91
  audienceEveryone: labels.audienceEveryone,
93
92
  audienceInternal: labels.audienceInternal,
94
- replyAttach: labels.replyAttachLabel,
95
93
  replySend: labels.replySendLabel,
96
- [PHI_FORM_UPLOAD_LABEL_KEYS.dropHint]: labels.replyAttachDropHint,
97
- [PHI_FORM_UPLOAD_LABEL_KEYS.tooMany]: labels.replyAttachTooMany,
98
- [PHI_FORM_UPLOAD_LABEL_KEYS.pending]: labels.replyAttachPending,
99
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorGeneric]: labels.replyErrorGeneric,
100
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorNetwork]: labels.replyErrorNetwork,
101
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorTooLarge]: labels.replyErrorTooLarge,
102
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorDuplicate]: labels.replyErrorDuplicate,
103
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorTypeNotAllowed]: labels.replyErrorTypeNotAllowed,
104
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorQuotaExceeded]: labels.replyErrorQuotaExceeded,
105
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorSpaceUnavailable]: labels.replyErrorSpaceUnavailable,
106
- [PHI_FORM_UPLOAD_LABEL_KEYS.errorStorageUnreachable]: labels.replyErrorStorageUnreachable,
107
94
  }));
108
95
  // Every Area: a conversation may be placed wherever a Site runs one.
109
96
  export const PHI_CORE_MESSAGING_FORMS = [
@@ -7,19 +7,7 @@ export declare function getPhiThreadReplyFormLabels(options: PhiGlobalTranslator
7
7
  replyThreadRequired: string;
8
8
  audienceEveryone: string;
9
9
  audienceInternal: string;
10
- replyAttachLabel: string;
11
- replyAttachDropHint: string;
12
10
  replySendLabel: string;
13
- replyAttachTooMany: string;
14
- replyAttachPending: string;
15
- replyErrorGeneric: string;
16
- replyErrorNetwork: string;
17
- replyErrorTooLarge: string;
18
- replyErrorDuplicate: string;
19
- replyErrorTypeNotAllowed: string;
20
- replyErrorQuotaExceeded: string;
21
- replyErrorSpaceUnavailable: string;
22
- replyErrorStorageUnreachable: string;
23
11
  }>;
24
12
  export declare function getPhiThreadConversationLabels(options: PhiGlobalTranslatorOptions): Promise<{
25
13
  noThreadText: string;
@@ -86,19 +86,7 @@ const PHI_THREAD_REPLY_FORM_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_CORE_
86
86
  */
87
87
  audience_everyone: "To everyone in it",
88
88
  audience_internal: "Internal note",
89
- reply_attach_label: "Attach a file",
90
- reply_attach_drop_hint: "or drop it here",
91
89
  reply_send_label: "Send",
92
- reply_attach_too_many: definePhiMessageLabel("No more files fit here."),
93
- reply_attach_pending: definePhiMessageLabel("Wait until the file has arrived, then send."),
94
- reply_error_generic: definePhiMessageLabel("The file could not be attached."),
95
- reply_error_network: definePhiMessageLabel("The site could not be reached."),
96
- reply_error_too_large: definePhiMessageLabel("That file is too large."),
97
- reply_error_duplicate: definePhiMessageLabel("That file is already attached."),
98
- reply_error_type_not_allowed: definePhiMessageLabel("That kind of file cannot be attached."),
99
- reply_error_quota_exceeded: definePhiMessageLabel("There is no room left in your space."),
100
- reply_error_space_unavailable: definePhiMessageLabel("Files cannot be attached on this site."),
101
- reply_error_storage_unreachable: definePhiMessageLabel("The file storage could not be reached."),
102
90
  },
103
91
  });
104
92
  export async function getPhiThreadReplyFormLabels(options) {
@@ -110,19 +98,7 @@ export async function getPhiThreadReplyFormLabels(options) {
110
98
  replyThreadRequired: labels.reply_thread_required,
111
99
  audienceEveryone: labels.audience_everyone,
112
100
  audienceInternal: labels.audience_internal,
113
- replyAttachLabel: labels.reply_attach_label,
114
- replyAttachDropHint: labels.reply_attach_drop_hint,
115
101
  replySendLabel: labels.reply_send_label,
116
- replyAttachTooMany: labels.reply_attach_too_many,
117
- replyAttachPending: labels.reply_attach_pending,
118
- replyErrorGeneric: labels.reply_error_generic,
119
- replyErrorNetwork: labels.reply_error_network,
120
- replyErrorTooLarge: labels.reply_error_too_large,
121
- replyErrorDuplicate: labels.reply_error_duplicate,
122
- replyErrorTypeNotAllowed: labels.reply_error_type_not_allowed,
123
- replyErrorQuotaExceeded: labels.reply_error_quota_exceeded,
124
- replyErrorSpaceUnavailable: labels.reply_error_space_unavailable,
125
- replyErrorStorageUnreachable: labels.reply_error_storage_unreachable,
126
102
  };
127
103
  }
128
104
  export async function getPhiThreadConversationLabels(options) {
@@ -63,7 +63,11 @@ function overlayPhiAssetLabels(base, override) {
63
63
  return result;
64
64
  }
65
65
  export function PhiAssetCollectionViewBinding({ config, binding, labels: rawLabels, widgetId, renderMode, }) {
66
- const labels = useMemo(() => overlayPhiAssetLabels(PHI_MEDIA_WIDGET_DEFAULT_LABELS, config.presentation.labels ?? rawLabels), [config.presentation.labels, rawLabels]);
66
+ /*
67
+ * The English defaults, under what the server half loaded for this Widget (`rawLabels`, the Media Label
68
+ * Set in the reader's language), under what the Widget's own configuration says.
69
+ */
70
+ const labels = useMemo(() => overlayPhiAssetLabels(overlayPhiAssetLabels(PHI_MEDIA_WIDGET_DEFAULT_LABELS, rawLabels), config.presentation.labels), [config.presentation.labels, rawLabels]);
67
71
  const { token } = usePhiConfig();
68
72
  const { showMessage } = usePhiApplicationFeedback();
69
73
  const selectionState = usePhiImagePreviewStore(PHI_ASSET_CONTROLLER_STORE_KEY);
@@ -251,10 +255,10 @@ export function PhiAssetCollectionViewBinding({ config, binding, labels: rawLabe
251
255
  }
252
256
  if (filter.key === "presentationFlags" && filter.control === "multi-select") {
253
257
  return (_jsx(PhiMultiSelectControl, { value: readAssetFlagValues(state.presentationFlags), placeholder: filter.placeholder ?? labels.tool.flagPlaceholder, options: [
254
- { value: PhiMediaAssetFlags.Featured, label: labels.editor.featuredFlagLabel },
255
- { value: PhiMediaAssetFlags.Locked, label: labels.editor.lockedFlagLabel },
256
- { value: PhiMediaAssetFlags.Mask, label: labels.editor.maskFlagLabel },
257
- { value: PhiMediaAssetFlags.Background, label: labels.editor.backgroundFlagLabel },
258
+ { value: PhiMediaAssetFlags.Featured, label: labels.tool.featuredFlagLabel },
259
+ { value: PhiMediaAssetFlags.Locked, label: labels.tool.lockedFlagLabel },
260
+ { value: PhiMediaAssetFlags.Mask, label: labels.tool.maskFlagLabel },
261
+ { value: PhiMediaAssetFlags.Background, label: labels.tool.backgroundFlagLabel },
258
262
  ], allowClear: true, maxTagCount: 1, size: controlSize, style: { ...style, minWidth: style.minWidth ?? 128 }, onChange: (value) => binding.setQuery((current) => ({
259
263
  ...current,
260
264
  page: 1,
@@ -289,7 +293,7 @@ export function PhiAssetCollectionViewBinding({ config, binding, labels: rawLabe
289
293
  }), features.search?.enabled ? (_jsx(PhiTextControl, { inputType: "search", value: searchDraft, placeholder: features.search.placeholder ?? labels.tool.searchPlaceholder, ariaLabel: features.search.placeholder ?? labels.tool.searchPlaceholder, size: controlSize, style: { flex: "1 1 12rem", minWidth: normalizePhiCssSize(features.search.minWidth) ?? "10rem" }, onChange: (value) => setSearchDraft(value ?? "") })) : null] })) : null;
290
294
  const toolbar = selfContained && ((features.actions?.toolbar?.length ?? 0) > 0 || features.tools.reset || features.tools.reload) ? (_jsxs(PhiToolbarControl, { compact: true, size: controlSize, children: [(features.actions?.toolbar ?? []).map((action) => {
291
295
  const display = action.display ?? "icon";
292
- const label = action.label ?? (action.key === "upload" ? labels.tool.uploadToggleLabel : action.key);
296
+ const label = action.label ?? (action.key === "upload" ? labels.upload.uploadToggleLabel : action.key);
293
297
  return (_jsx(PhiButtonControl, { label: display === "icon" ? undefined : label, ariaLabel: label, tooltip: action.description, icon: display === "label" || !action.icon ? undefined : resolvePhiButtonIcon(action.icon), type: action.mode === "primary" ? "primary" : "default", danger: action.mode === "danger", size: controlSize, disabled: action.key === "upload" && currentFolderLocked, onClick: action.key === "upload" ? () => binding.setOpenPanelKey(state.uploadPanelOpen ? null : "upload") : undefined }, action.key));
294
298
  }), features.tools.reset ? (_jsx(PhiButtonControl, { ariaLabel: labels.tool.resetLabel, tooltip: labels.tool.resetLabel, icon: resolvePhiButtonIcon("antd:rollback-outlined"), size: controlSize, onClick: () => binding.setQuery({
295
299
  ...(config.initialQuery ?? {}),
@@ -8,6 +8,7 @@ export declare const PHI_COLLECTION_VIEW_WIDGET_DEFINITION: {
8
8
  kind: "widget";
9
9
  pluginKey: string;
10
10
  typeKey: string;
11
+ requiredRuntimeControllers: ({ config }: import("../../../../../types").PhiCmsWidgetRuntimeControllerRequirementArgs<PhiCmsCollectionViewWidgetConfig>) => import("../../../../../types").PhiRuntimeControllerRequirement[];
11
12
  title: string;
12
13
  description: string;
13
14
  category: "data";
@@ -3,6 +3,7 @@ import { PHI_CARD_VARIANTS, readPhiCardBillingPeriod } from "../../../../../comp
3
3
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
4
4
  import { readPhiProviderResourceSource } from "../../../../../types/runtime-data-provider";
5
5
  import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet } from "../../../../../types/signals";
6
+ import { resolvePhiAssetControllerRouteRequirements } from "../../../../../components/media/asset-controller-requirement";
6
7
  import { isPhiNamespacedRuntimeKey } from "../../../../../types/runtime-data-provider";
7
8
  import { PHI_AUTHORING_OPTION_PROVIDER_KEYS } from "../../../../../constants/authoring-option-provider-keys";
8
9
  import { readPhiLengthValue } from "../../../../../types/length";
@@ -153,6 +154,12 @@ export const PHI_COLLECTION_VIEW_WIDGET_DEFINITION = {
153
154
  kind: "widget",
154
155
  pluginKey: resolvePhiCmsWidgetPluginKey("collection-view"),
155
156
  typeKey: "collection-view",
157
+ /*
158
+ * The Media collection is drawn here (`asset-binding.tsx`), and where its placement sends a selection
159
+ * or an action to the Asset Controller, that Controller is mounted with it -- it mounts on demand. A
160
+ * collection that only lists asks for nothing.
161
+ */
162
+ requiredRuntimeControllers: ({ config }) => resolvePhiAssetControllerRouteRequirements(config.signalRoutes),
156
163
  title: "Collection View",
157
164
  description: "Provider-backed visual collection with generic tools and pagination.",
158
165
  category: "data",
@@ -1,10 +1,16 @@
1
1
  import type { PhiCmsAssetPreviewGridWidgetConfig } from "./config";
2
- import type { PhiAssetPreviewGridWidgetLabels } from "../../../../../components/media/media-widget-labels";
2
+ import type { PhiAssetPreviewGridWidgetLabels, PhiAssetWidgetLabels } from "../../../../../components/media/media-widget-labels";
3
3
  import type { PhiRenderableBlockRenderMode } from "../../../../../types/renderable-block";
4
4
  export type PhiAssetPreviewGridWidgetProps = {
5
5
  config?: PhiCmsAssetPreviewGridWidgetConfig | null;
6
6
  labels: PhiAssetPreviewGridWidgetLabels;
7
+ /**
8
+ * The Media Label Set in full (`getPhiMediaWidgetLabels`), for a caller that has it. It replaces the
9
+ * English defaults the widget spreads around `labels`, so the toolbar, upload and picker words are
10
+ * the reader's language too; `labels` is still the grid's own.
11
+ */
12
+ mediaLabels?: PhiAssetWidgetLabels;
7
13
  /** Who reads a failure of the asset source: the author outside "live", the log on a live page. */
8
14
  renderMode: PhiRenderableBlockRenderMode;
9
15
  };
10
- export declare function PhiAssetPreviewGridWidget({ config, labels, renderMode }: PhiAssetPreviewGridWidgetProps): import("react").JSX.Element;
16
+ export declare function PhiAssetPreviewGridWidget({ config, labels, mediaLabels, renderMode }: PhiAssetPreviewGridWidgetProps): import("react").JSX.Element;
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PHI_MEDIA_WIDGET_DEFAULT_LABELS } from "../../../../../components/media/media-widget-labels";
3
3
  import { PHI_ASSET_COLLECTION_DATA_SOURCE } from "../../../../../components/media/asset-collection-runtime";
4
4
  import { PhiCollectionViewWidget } from "./client";
5
- export function PhiAssetPreviewGridWidget({ config, labels, renderMode }) {
5
+ export function PhiAssetPreviewGridWidget({ config, labels, mediaLabels, renderMode }) {
6
6
  return (_jsx(PhiCollectionViewWidget, { config: {
7
7
  presentation: {
8
8
  mode: "grid",
@@ -12,5 +12,5 @@ export function PhiAssetPreviewGridWidget({ config, labels, renderMode }) {
12
12
  },
13
13
  features: { tools: { mode: "external" }, pagination: { enabled: false } },
14
14
  source: PHI_ASSET_COLLECTION_DATA_SOURCE,
15
- }, labels: { ...PHI_MEDIA_WIDGET_DEFAULT_LABELS, grid: labels }, renderMode: renderMode }));
15
+ }, labels: { ...(mediaLabels ?? PHI_MEDIA_WIDGET_DEFAULT_LABELS), grid: labels }, renderMode: renderMode }));
16
16
  }
@@ -12,4 +12,4 @@ export type PhiCollectionViewWidgetServerProps = {
12
12
  renderMode: PhiRenderableBlockRenderMode;
13
13
  preview?: boolean;
14
14
  };
15
- export declare function PhiCollectionViewWidgetServer({ config, widgetId, registry, renderMode, preview, }: PhiCollectionViewWidgetServerProps): Promise<import("react").JSX.Element>;
15
+ export declare function PhiCollectionViewWidgetServer({ runtime, config, widgetId, registry, renderMode, preview, }: PhiCollectionViewWidgetServerProps): Promise<import("react").JSX.Element>;
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
3
+ import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS } from "../../../../../constants/media-library-provider-keys";
4
+ import { getPhiMediaWidgetLabels } from "../../../../../components/media/label-sets/media";
5
+ import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
3
6
  import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
4
7
  import { readPhiCollectionViewDeclaredFailure } from "../../../../../components/widgets/shared/collection-source-failure";
5
8
  import { PhiWidgetFailureServer } from "../../../../../components/widgets/shared/widget-failure.server";
6
- export async function PhiCollectionViewWidgetServer({ config, widgetId, registry, renderMode, preview = false, }) {
9
+ export async function PhiCollectionViewWidgetServer({ runtime, config, widgetId, registry, renderMode, preview = false, }) {
7
10
  if (preview) {
8
11
  /*
9
12
  * The preview reads no data, so this is the one place its binding is judged: against the providers
@@ -23,5 +26,14 @@ export async function PhiCollectionViewWidgetServer({ config, widgetId, registry
23
26
  }
24
27
  return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.CollectionView, componentProps: { config, widgetId, renderMode, preview: true } }));
25
28
  }
26
- return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.CollectionView, componentProps: { config, widgetId, renderMode, preview: false } }));
29
+ /*
30
+ * The Media collection's renderer says the Media Label Set's words (the toolbar, the flag filter, the
31
+ * grid, the upload surface) and Core may not import the Asset Module to get them, so they are the
32
+ * Foundation's and loaded here -- only for a Widget bound to that collection, so no other source pays.
33
+ * `config.presentation.labels` still lays over them.
34
+ */
35
+ const labels = config?.source?.providerKey === PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection
36
+ ? await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime))
37
+ : undefined;
38
+ return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.CollectionView, componentProps: { config, widgetId, renderMode, preview: false, labels } }));
27
39
  }
@@ -11,5 +11,5 @@ const PhiImageWidgetEditorTools = lazy(async () => ({
11
11
  export const PHI_IMAGE_WIDGET_BUILDER_PLUGIN = {
12
12
  ...PHI_IMAGE_WIDGET_DEFINITION,
13
13
  renderEditor: ({ config, authoring }) => (_jsx(Suspense, { fallback: null, children: _jsx(PhiImageWidgetEditor, { config: config, onChange: authoring?.updateConfig }) })),
14
- renderEditorTools: ({ widget, config, authoring }) => authoring ? (_jsx(Suspense, { fallback: null, children: _jsx(PhiImageWidgetEditorTools, { blockId: widget.id, config: config, onChange: authoring.updateConfig }) })) : null,
14
+ renderEditorTools: ({ config, authoring }) => authoring ? (_jsx(Suspense, { fallback: null, children: _jsx(PhiImageWidgetEditorTools, { config: config, onChange: authoring.updateConfig }) })) : null,
15
15
  };
@@ -1,10 +1,7 @@
1
- import type { PhiCmsInstanceId } from "../../../../../types/cms-instance-id";
2
1
  import type { PhiCmsImageWidgetConfig } from "./config";
3
2
  export type PhiImageWidgetEditorProps = {
4
3
  config?: PhiCmsImageWidgetConfig | null;
5
4
  onChange?: (patch: Partial<PhiCmsImageWidgetConfig>) => void;
6
5
  };
7
6
  export declare function PhiImageWidgetEditor({ config, onChange }: PhiImageWidgetEditorProps): import("react").JSX.Element;
8
- export declare function PhiImageWidgetEditorTools({ blockId, config, onChange, }: PhiImageWidgetEditorProps & {
9
- blockId: PhiCmsInstanceId;
10
- }): import("react").JSX.Element;
7
+ export declare function PhiImageWidgetEditorTools({ config, onChange, }: PhiImageWidgetEditorProps): import("react").JSX.Element;
@@ -75,8 +75,8 @@ export function PhiImageWidgetEditor({ config, onChange }) {
75
75
  pointerEvents: "none",
76
76
  }, children: overlaySize })) : null] }));
77
77
  }
78
- export function PhiImageWidgetEditorTools({ blockId, config, onChange, }) {
79
- return (_jsxs("span", { style: { display: "inline-flex" }, children: [_jsx(PhiWidgetImageToolButton, { blockId: blockId, onChange: (patch) => onChange?.(patch) }), _jsx(PhiMaskPickerButton, { placement: "topRight", value: config?.mask, onChange: (mask) => {
78
+ export function PhiImageWidgetEditorTools({ config, onChange, }) {
79
+ return (_jsxs("span", { style: { display: "inline-flex" }, children: [_jsx(PhiWidgetImageToolButton, { onChange: (patch) => onChange?.(patch) }), _jsx(PhiMaskPickerButton, { placement: "topRight", value: config?.mask, onChange: (mask) => {
80
80
  onChange?.({ mask });
81
81
  } })] }));
82
82
  }
@@ -6,7 +6,7 @@ import { PhiButtonControl } from "../../../../../components/controls/phi-button-
6
6
  import { useCallback, useEffect, useMemo, useState } from "react";
7
7
  import { usePhiMediaUpload } from "../../../../../components/media/phi-media-upload";
8
8
  import { runPhiAddonAssetUpload, } from "../../../../../components/media/media-upload-flow";
9
- import { resolvePhiAreaUploadLabels, resolvePhiUploadStatusLabel } from "../../../../../components/media/phi-media-upload";
9
+ import { resolvePhiUploadStatusLabel } from "../../../../../components/media/phi-media-upload";
10
10
  import { PhiUploadDropArea } from "../../../../../components/media/phi-upload-drop-area";
11
11
  import { PhiTagControl } from "../../../../../components/controls/phi-tag-control";
12
12
  import { readPhiSlotUploadAcceptance } from "./slot";
@@ -193,9 +193,8 @@ export function PhiSlotUploadWidgetClient({ config, labels }) {
193
193
  return { asset: { id: view.mediaAssetId } };
194
194
  }, [base, ownerId, read, slotName]);
195
195
  const slotUpload = useMemo(() => readPhiSlotUploadAcceptance(slot), [slot]);
196
- const uploadLabels = useMemo(() => resolvePhiAreaUploadLabels(labels.upload), [labels.upload]);
197
196
  const upload = usePhiMediaUpload({
198
- labels: uploadLabels,
197
+ labels: labels.upload.refusals,
199
198
  ...(slotUpload ? { acceptance: slotUpload.acceptance } : {}),
200
199
  runSession,
201
200
  onUploaded: async () => {
@@ -8,7 +8,6 @@ import { PHI_TEXT_SOURCE_PRESET } from "../../helpers/text-source";
8
8
  import { PHI_SPACE } from "../../theme/antd-css-var-contract";
9
9
  import { buildPhiCmsWidgetNamespacedTypeKey } from "../../constants/cms-widget-types";
10
10
  import { createPhiCmsPresetNodes } from "../../helpers/cms-preset-nodes";
11
- import { resolvePhiBrandContact } from "../../helpers/brand-contact";
12
11
  import { resolvePhiShellHeaderHeight, resolvePhiShellMetric } from "../../helpers/shell-region-style";
13
12
  import { resolvePhiLayoutCreationPreset } from "../../helpers/cms-layout-defaults";
14
13
  import { PHI_DEFAULT_PUB_AREA_PRESET } from "./pub-area-preset";
@@ -35,14 +34,13 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
35
34
  const footerMainRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "footer_main");
36
35
  const footerTopRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "footer_top");
37
36
  const footerBottomRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "footer_bottom");
38
- const { label: contactLabel, href: contactHref, icon: contactIcon, } = resolvePhiBrandContact(runtime);
39
37
  /*
40
38
  * The Preset's words stay in the source language and say they are the Preset's; the Widgets translate
41
- * them through the global store (`helpers/text-source.ts`). The contact label is the Preset's only
42
- * while the Site's theme names none. It stands in the Footer; the Header has no strip above its main
43
- * band, which a Site adds in the Builder when it wants one.
39
+ * them through the global store (`helpers/text-source.ts`).
40
+ *
41
+ * The Footer's right column is left empty. It used to hold a mailto link to whoever runs the Site,
42
+ * which the Site's own contact page (`/contact`, with its Form) and the App's Support have replaced.
44
43
  */
45
- const contactLabelIsPreset = !runtime.site.theme?.contact?.label?.trim();
46
44
  /*
47
45
  * A template rather than a finished sentence, and left untranslated here.
48
46
  *
@@ -407,25 +405,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
407
405
  },
408
406
  contentVersionId: null,
409
407
  },
410
- {
411
- id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetFooterRight,
412
- siteId: page.siteId,
413
- parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutFooterMain,
414
- widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("simple-text"), "simple-text"),
415
- slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Right,
416
- sortOrder: 20,
417
- status: 1,
418
- flags: 0,
419
- visibilityMask: page.visibilityMask,
420
- label: "pub footer main right",
421
- config: {
422
- text: contactLabel,
423
- ...(contactLabelIsPreset ? { textSource: PHI_TEXT_SOURCE_PRESET } : {}),
424
- href: contactHref,
425
- icon: contactIcon,
426
- },
427
- contentVersionId: null,
428
- },
429
408
  ]
430
409
  : []),
431
410
  ...(footerBottomRegion
@@ -1,4 +1,4 @@
1
1
  export declare const PHI_DEFAULT_PUB_AREA_PRESET_KEY = "public-area-preset";
2
2
  export declare const PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS: readonly ["layoutHeaderMain", "layoutHeaderActions", "layoutHeaderBottom", "layoutSiderRight", "layoutFooterTop", "layoutFooterMain", "layoutFooterBottom"];
3
- export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetSearch", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterRight", "widgetFooterBottomText"];
3
+ export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetSearch", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterBottomText"];
4
4
  export declare const PHI_DEFAULT_PUB_AREA_COMPOSITION_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetLocale"];
@@ -17,7 +17,6 @@ export const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS = [
17
17
  "widgetSiderRightNav",
18
18
  "widgetFooterLeft",
19
19
  "widgetFooterMiddle",
20
- "widgetFooterRight",
21
20
  "widgetFooterBottomText",
22
21
  ];
23
22
  export const PHI_DEFAULT_PUB_AREA_COMPOSITION_NODE_KEYS = [
@@ -4,6 +4,7 @@ import { PHI_FORM_CONTROLLER_TYPE } from "../../components/forms/runtime-form-co
4
4
  import { assertPhiRuntimeModule, buildPhiRuntimeModuleLayoutType, buildPhiRuntimeModuleControllerDescriptor, buildPhiRuntimeModuleWidgetType, hasPhiRuntimeModuleController, } from "./contracts";
5
5
  import { readPhiRuntimeTreeRenderMode, resolvePhiRuntimeWidgetImplementationMode, } from "./render-mode";
6
6
  import { resolvePhiRuntimeModuleServerBinding } from "./server-capabilities";
7
+ import { listPhiAlwaysActiveRuntimeModuleIds } from "./settings";
7
8
  import { PHI_VIEWER_ACCESS_ANYONE, } from "../../types/access";
8
9
  import { stripRenderableBlockDefaults } from "../../helpers/renderable-block-serialization";
9
10
  import { PhiCmsWidgetType } from "../../constants/cms-widget-types";
@@ -59,6 +60,10 @@ function loadModule(catalog, moduleId) {
59
60
  JSON.stringify(catalogEntry.definition.calendarAdapters ?? [])) {
60
61
  throw new Error(`Runtime module "${moduleId}" Calendar adapter descriptors do not match its catalog definition.`);
61
62
  }
63
+ if (JSON.stringify(runtimeModule.mediaSources ?? []) !==
64
+ JSON.stringify(catalogEntry.definition.mediaSources ?? [])) {
65
+ throw new Error(`Runtime module "${moduleId}" media source descriptors do not match its catalog definition.`);
66
+ }
62
67
  if (JSON.stringify(runtimeModule.videoProviders ?? []) !==
63
68
  JSON.stringify(catalogEntry.definition.videoProviders ?? [])) {
64
69
  throw new Error(`Runtime module "${moduleId}" video provider descriptors do not match its catalog definition.`);
@@ -109,9 +114,22 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
109
114
  if (area && !catalogEntry.definition.eligibleAreas.includes(area)) {
110
115
  throw new Error(`Runtime module "${moduleId}" is not eligible for Area "${area}".`);
111
116
  }
112
- if (catalogEntry.definition.kind === "platform" || baseModuleIds.has(moduleId)) {
117
+ if (catalogEntry.definition.kind === "platform" ||
118
+ catalogEntry.definition.activation === "always" ||
119
+ baseModuleIds.has(moduleId)) {
113
120
  throw new Error(`Locked runtime module "${moduleId}" must not be selected in Area runtimeModules.`);
114
121
  }
122
+ }
123
+ /*
124
+ * A Module declared `activation: "always"` is active in every Area it is eligible for, ahead of what
125
+ * the Area selects and on the same terms: where its server part is missing it stays off and is named
126
+ * with the selected Modules that are. Without an Area there is nothing to be eligible for.
127
+ */
128
+ const alwaysActiveModuleIds = area
129
+ ? listPhiAlwaysActiveRuntimeModuleIds(area, [...catalog.values()].map((entry) => entry.definition))
130
+ : [];
131
+ for (const moduleId of [...alwaysActiveModuleIds, ...selectedModuleIds]) {
132
+ const catalogEntry = catalog.get(moduleId);
115
133
  const bindingResolution = resolvePhiRuntimeModuleServerBinding(catalogEntry.definition.serverBinding, serverCapabilities);
116
134
  if (!bindingResolution.available) {
117
135
  unavailableModuleBindings.set(moduleId, bindingResolution);
@@ -124,6 +142,7 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
124
142
  const layoutDefinitionsByType = new Map();
125
143
  const dataProviderDescriptorsByKey = new Map();
126
144
  const calendarAdapterDescriptorsByKey = new Map();
145
+ const mediaSourceDescriptorsByKey = new Map();
127
146
  const videoProviderDescriptorsByKey = new Map();
128
147
  const formFieldTypeProviderDescriptorsByKey = new Map();
129
148
  const formValidationProviderDescriptorsByKey = new Map();
@@ -177,6 +196,12 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
177
196
  }
178
197
  calendarAdapterDescriptorsByKey.set(descriptor.key, descriptor);
179
198
  }
199
+ for (const descriptor of definition.mediaSources ?? []) {
200
+ if (mediaSourceDescriptorsByKey.has(descriptor.key)) {
201
+ throw new Error(`Media source "${descriptor.key}" is owned by more than one runtime module.`);
202
+ }
203
+ mediaSourceDescriptorsByKey.set(descriptor.key, descriptor);
204
+ }
180
205
  for (const descriptor of definition.videoProviders ?? []) {
181
206
  if (videoProviderDescriptorsByKey.has(descriptor.key)) {
182
207
  throw new Error(`Video provider "${descriptor.key}" is owned by more than one runtime module.`);
@@ -247,6 +272,7 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
247
272
  layoutDefinitionsByType,
248
273
  dataProviderDescriptorsByKey,
249
274
  calendarAdapterDescriptorsByKey,
275
+ mediaSourceDescriptorsByKey,
250
276
  videoProviderDescriptorsByKey,
251
277
  formFieldTypeProviderDescriptorsByKey,
252
278
  formValidationProviderDescriptorsByKey,
@@ -3,6 +3,22 @@ import type { PhisDeclarableThreadKind } from "../../types/threads";
3
3
  import type { PhiDeclaredModuleSeed } from "../../types/seed";
4
4
  import type { PhiRuntimeModuleDefinition, PhiRuntimeModuleId } from "./contracts";
5
5
  export declare function readPhiRuntimeModuleIds(value: unknown): PhiRuntimeModuleId[] | null;
6
+ /**
7
+ * Whether a Site chooses this Module per Area, or it is active without being chosen.
8
+ *
9
+ * Three kinds of Module are locked: the Platform Module, an Area's Base Module, and a Module declared
10
+ * `activation: "always"`. None of them is ever part of a stored selection -- each is added where the
11
+ * active set is built -- so this is the one question every reader and writer of a selection asks.
12
+ */
13
+ export declare function isPhiRuntimeModuleSelectable(definition: Pick<PhiRuntimeModuleDefinition, "moduleId" | "kind" | "activation">): boolean;
14
+ /**
15
+ * The Modules declared `activation: "always"` that are active in an Area: every one eligible for it.
16
+ *
17
+ * In catalog order, so the active set a render builds is the same on every request. Whether its server
18
+ * part is there is not answered here; the callers that build an active set ask that of every Module
19
+ * they add, selected or not.
20
+ */
21
+ export declare function listPhiAlwaysActiveRuntimeModuleIds(area: string, moduleDefinitions: Iterable<Pick<PhiRuntimeModuleDefinition, "moduleId" | "activation" | "eligibleAreas">>): PhiRuntimeModuleId[];
6
22
  export declare function assertPhiRuntimeModuleIdsAllowedForArea(area: string, moduleIds: readonly PhiRuntimeModuleId[], moduleDefinitions: readonly PhiRuntimeModuleDefinition[]): void;
7
23
  export declare function resolvePhiAuthUiProviderModuleId(moduleIds: readonly PhiRuntimeModuleId[], moduleDefinitions: readonly PhiRuntimeModuleDefinition[]): PhiRuntimeModuleId | null;
8
24
  /** Why a stored Module id is not part of the selection this build can serve. */
@@ -27,9 +43,10 @@ export type PhiRuntimeModuleSelectionReading = {
27
43
  * `assertPhiRuntimeModuleIdsAllowedForArea` is what a Builder save still goes through, so nothing
28
44
  * unresolvable is ever written back.
29
45
  *
30
- * The Area's own Base Module and the Platform Module are not part of this at all. They are implicit and
31
- * added elsewhere; a build missing one of those cannot serve the Area, and that is a failure rather
32
- * than a selection to trim.
46
+ * The Area's own Base Module, the Platform Module and a Module declared `activation: "always"` are not
47
+ * part of this at all. They are implicit and added where the active set is built
48
+ * (`listPhiAlwaysActiveRuntimeModuleIds` for the last); a build missing a Base or the Platform Module
49
+ * cannot serve the Area, and that is a failure rather than a selection to trim.
33
50
  */
34
51
  export declare function readPhiRuntimeModuleIdsForArea(area: string, moduleIds: readonly PhiRuntimeModuleId[] | null | undefined, moduleDefinitions: readonly PhiRuntimeModuleDefinition[]): PhiRuntimeModuleSelectionReading;
35
52
  /**