@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
@@ -1 +1 @@
1
- export { PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/editor";
1
+ export { PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/editor";
@@ -1 +1 @@
1
- export { PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/editor";
1
+ export { PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/editor";
@@ -1,5 +1,6 @@
1
- export { PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/public";
1
+ export { PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/public";
2
2
  export type { PhiRuntimeModuleControllerClientManifest } from "./components/runtime/runtime-module-controller-client-manifest";
3
3
  export type { PhiRuntimeModuleRenderClientManifest } from "./components/runtime/runtime-module-render-client-manifest";
4
4
  export type { PhiRuntimeModuleDataProviderClientManifest } from "./components/runtime/runtime-module-data-provider-client-manifest";
5
5
  export type { PhiRuntimeModuleCalendarAdapterClientManifest } from "./components/runtime/runtime-module-calendar-adapter-client-manifest";
6
+ export type { PhiRuntimeModuleMediaSourceClientManifest } from "./components/runtime/runtime-module-media-source-client-manifest";
@@ -1 +1 @@
1
- export { PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/public";
1
+ export { PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "./plugins/runtime-modules/client-manifests/public";
@@ -0,0 +1,3 @@
1
+ export { createPhiRuntimeModuleMediaSourceClientManifest, extendPhiRuntimeModuleMediaSourceClientManifest, PhiRuntimeModuleMediaSourceClientManifestProvider, usePhiMediaSourceClientDefinitions, } from "./components/runtime/runtime-module-media-source-client-manifest";
2
+ export type { PhiRuntimeModuleMediaSourceClientManifest, } from "./components/runtime/runtime-module-media-source-client-manifest";
3
+ export type { PhiMediaSourceClient, PhiMediaSourceClientDefinition, PhiMediaSourceDescriptor, PhiMediaSourceKey, PhiMediaSourceTakenFile, } from "./types/media-source";
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { createPhiRuntimeModuleMediaSourceClientManifest, extendPhiRuntimeModuleMediaSourceClientManifest, PhiRuntimeModuleMediaSourceClientManifestProvider, usePhiMediaSourceClientDefinitions, } from "./components/runtime/runtime-module-media-source-client-manifest";
@@ -4,7 +4,7 @@ import { notFound } from "next/navigation";
4
4
  import { resolvePhiCmsAreaKey, resolvePhiCmsAreaMask, } from "../constants/cms-areas";
5
5
  import { canPhiViewerAccess } from "../types/access";
6
6
  import { compilePhiCmsActiveRouteTable, instantiatePhiCmsRoutePreset, normalizePhiCmsRoutePath, resolvePhiCmsAreaShellPresetBinding, resolvePhiCmsDescriptorCatalog, resolvePhiCmsModuleNavigationFolderTargets, resolvePhiCmsRoutePreset, } from "../plugins/runtime-modules/descriptor-compiler";
7
- import { resolvePhiRuntimeModuleIdsForArea } from "../plugins/runtime-modules/settings";
7
+ import { listPhiAlwaysActiveRuntimeModuleIds, resolvePhiRuntimeModuleIdsForArea, } from "../plugins/runtime-modules/settings";
8
8
  import { composePhiCmsPagePresetOverlays } from "../plugins/runtime-modules/page-preset-overlays";
9
9
  import { resolvePhiCmsRoutePage } from "../plugins/runtime-modules/route-page-resolution";
10
10
  import { PhiCmsFlags } from "../constants/phi-cms";
@@ -96,18 +96,24 @@ export function resolveActivePresetModuleKeys(runtimeModuleCatalog, area, areaPr
96
96
  }
97
97
  activeModuleKeys.add(areaDefinition.baseModuleId);
98
98
  const configuredModuleKeys = readPhiAreaPresetRuntimeModuleIds(areaPreset?.preset, area);
99
- for (const moduleKey of resolvePhiRuntimeModuleIdsForArea(area, configuredModuleKeys, [...runtimeModuleCatalog.values()].map((entry) => entry.definition))) {
99
+ const moduleDefinitions = [...runtimeModuleCatalog.values()].map((entry) => entry.definition);
100
+ // The Modules declared `activation: "always"` come first and on the same terms as the selected ones:
101
+ // the active set here has to be the one `resolvePhiRuntimeModuleSet` builds for the render.
102
+ for (const moduleKey of [
103
+ ...listPhiAlwaysActiveRuntimeModuleIds(area, moduleDefinitions),
104
+ ...resolvePhiRuntimeModuleIdsForArea(area, configuredModuleKeys, moduleDefinitions),
105
+ ]) {
100
106
  const definition = runtimeModuleCatalog.get(moduleKey)?.definition;
101
107
  if (definition) {
102
108
  // A Module is on for an Area or it is not. It is never switched off for one reader (ACCESS.md):
103
109
  // what its Widgets show may differ per person, that it is loaded may not.
104
110
  const bindingResolution = resolvePhiRuntimeModuleServerBinding(definition.serverBinding, serverCapabilities);
105
111
  if (!bindingResolution.available) {
106
- // The Module is selected and installed, and the server half it needs is not there. It stays off
112
+ // The Module is active and installed, and the server half it needs is not there. It stays off
107
113
  // for the whole Area -- and the log names it, because the page it leaves looks like a page the
108
114
  // Site chose.
109
115
  logRuntimeEvent("warn", "runtime_modules.server_capability.unavailable", {
110
- message: "A selected Module is off: its server capability requirement is unavailable.",
116
+ message: "An active Module is off: its server capability requirement is unavailable.",
111
117
  area,
112
118
  pluginKey: moduleKey,
113
119
  meta: {
@@ -98,8 +98,9 @@ export declare function resolvePhiThemePresetPlugin(plugins: readonly PhiThemePr
98
98
  *
99
99
  * This is the whole authoring model for colour: the block a Site follows is the base, what the Site
100
100
  * owns -- a palette it took over from a Module, or the seeds its author changed -- lies on top. A key
101
- * the upper palette states wins; everything else shows through. Merging before resolving is what keeps
102
- * a Site's shared seed from being undercut by a mode override the block declares.
101
+ * the upper palette states wins; everything else shows through. The colour tokens are not resolved from
102
+ * this merge: there a Site's value must win across levels too (`resolvePhiThemeColorTokens`). It serves
103
+ * what is matched slot by slot -- custom colours, gradients -- and a palette taken over from a Module.
103
104
  */
104
105
  export declare function mergePhiThemePalettes(base: PhiThemePalette | null | undefined, own: PhiThemePalette | null | undefined): PhiThemePalette;
105
106
  /** The Ant Design token input one palette contributes in one mode: shared seeds, mode seeds, mode overrides. */
@@ -108,5 +109,14 @@ export declare function resolvePhiThemePaletteTokens(palette: PhiThemePalette |
108
109
  * The token input of a Site in one mode: the palette block it follows, with the Site's own palette on
109
110
  * top. Every colour consumer -- root layout, server snapshot, workspace preview -- resolves through this
110
111
  * one function so the two can never disagree.
112
+ *
113
+ * The block only proposes. Each side is resolved on its own (shared seeds, mode seeds, mode overrides)
114
+ * and everything the Site states lies over everything the block states, whatever level either put it on:
115
+ * a Site's shared `colorPrimary` wins over a dark `colorPrimary` the block states for its own dark mode.
116
+ * And a seed the Site states takes the block's derived colours of that seed with it
117
+ * (`PHI_THEME_COLOR_SEED_DERIVATIONS`): a hover tone the block tuned to its own primary would not suit
118
+ * the Site's, so Ant Design derives it from the Site's seed. Derived colours the Site states itself stay.
111
119
  */
112
- export declare function resolvePhiThemeColorTokens(preset: PhiThemePresetPlugin, sitePalette: PhiThemePalette | null | undefined, mode: PhiThemeMode): Record<string, string>;
120
+ export declare function resolvePhiThemeColorTokens(preset: PhiThemePresetPlugin, sitePalette: PhiThemePalette | null | undefined, mode: PhiThemeMode): {
121
+ [x: string]: string;
122
+ };
@@ -1,3 +1,4 @@
1
+ import { PHI_THEME_COLOR_SEED_DERIVATIONS } from "./phi-theme-seed-derivation";
1
2
  import { assertPhiThemeVocabulary } from "./phi-theme-tokens";
2
3
  /**
3
4
  * The seeds that belong to a mode rather than to the palette as a whole.
@@ -117,8 +118,9 @@ function mergePhiThemePaletteModes(base, own) {
117
118
  *
118
119
  * This is the whole authoring model for colour: the block a Site follows is the base, what the Site
119
120
  * owns -- a palette it took over from a Module, or the seeds its author changed -- lies on top. A key
120
- * the upper palette states wins; everything else shows through. Merging before resolving is what keeps
121
- * a Site's shared seed from being undercut by a mode override the block declares.
121
+ * the upper palette states wins; everything else shows through. The colour tokens are not resolved from
122
+ * this merge: there a Site's value must win across levels too (`resolvePhiThemeColorTokens`). It serves
123
+ * what is matched slot by slot -- custom colours, gradients -- and a palette taken over from a Module.
122
124
  */
123
125
  export function mergePhiThemePalettes(base, own) {
124
126
  const modes = {};
@@ -145,6 +147,13 @@ export function resolvePhiThemePaletteTokens(palette, mode) {
145
147
  * The token input of a Site in one mode: the palette block it follows, with the Site's own palette on
146
148
  * top. Every colour consumer -- root layout, server snapshot, workspace preview -- resolves through this
147
149
  * one function so the two can never disagree.
150
+ *
151
+ * The block only proposes. Each side is resolved on its own (shared seeds, mode seeds, mode overrides)
152
+ * and everything the Site states lies over everything the block states, whatever level either put it on:
153
+ * a Site's shared `colorPrimary` wins over a dark `colorPrimary` the block states for its own dark mode.
154
+ * And a seed the Site states takes the block's derived colours of that seed with it
155
+ * (`PHI_THEME_COLOR_SEED_DERIVATIONS`): a hover tone the block tuned to its own primary would not suit
156
+ * the Site's, so Ant Design derives it from the Site's seed. Derived colours the Site states itself stay.
148
157
  */
149
158
  export function resolvePhiThemeColorTokens(preset, sitePalette, mode) {
150
159
  /*
@@ -162,5 +171,13 @@ export function resolvePhiThemeColorTokens(preset, sitePalette, mode) {
162
171
  modeSeedKeys: PHI_THEME_PALETTE_MODE_SEED_KEYS,
163
172
  source: "The Site's own Theme",
164
173
  });
165
- return resolvePhiThemePaletteTokens(mergePhiThemePalettes(preset.palette, sitePalette), mode);
174
+ const blockTokens = resolvePhiThemePaletteTokens(preset.palette, mode);
175
+ const siteTokens = resolvePhiThemePaletteTokens(sitePalette, mode);
176
+ for (const seed of PHI_THEME_COLOR_SEED_DERIVATIONS) {
177
+ if (!Object.prototype.hasOwnProperty.call(siteTokens, seed.key))
178
+ continue;
179
+ for (const item of seed.derived)
180
+ delete blockTokens[item.key];
181
+ }
182
+ return { ...blockTokens, ...siteTokens };
166
183
  }
@@ -0,0 +1,240 @@
1
+ export declare const PHI_THEME_COLOR_SEED_DERIVATIONS: readonly [{
2
+ readonly key: "colorPrimary";
3
+ readonly derived: readonly [{
4
+ readonly key: "colorPrimaryBg";
5
+ readonly label: "Bg";
6
+ }, {
7
+ readonly key: "colorPrimaryBgHover";
8
+ readonly label: "Bg Hover";
9
+ }, {
10
+ readonly key: "colorPrimaryBorder";
11
+ readonly label: "Border";
12
+ }, {
13
+ readonly key: "colorPrimaryBorderHover";
14
+ readonly label: "Border Hover";
15
+ }, {
16
+ readonly key: "colorPrimaryHover";
17
+ readonly label: "Hover";
18
+ }, {
19
+ readonly key: "colorPrimaryActive";
20
+ readonly label: "Active";
21
+ }, {
22
+ readonly key: "colorPrimaryText";
23
+ readonly label: "Text";
24
+ }, {
25
+ readonly key: "colorPrimaryTextHover";
26
+ readonly label: "Text Hover";
27
+ }, {
28
+ readonly key: "colorPrimaryTextActive";
29
+ readonly label: "Text Active";
30
+ }];
31
+ }, {
32
+ readonly key: "colorInfo";
33
+ readonly derived: readonly [{
34
+ readonly key: "colorInfoBg";
35
+ readonly label: "Bg";
36
+ }, {
37
+ readonly key: "colorInfoBgHover";
38
+ readonly label: "Bg Hover";
39
+ }, {
40
+ readonly key: "colorInfoBorder";
41
+ readonly label: "Border";
42
+ }, {
43
+ readonly key: "colorInfoBorderHover";
44
+ readonly label: "Border Hover";
45
+ }, {
46
+ readonly key: "colorInfoHover";
47
+ readonly label: "Hover";
48
+ }, {
49
+ readonly key: "colorInfoActive";
50
+ readonly label: "Active";
51
+ }, {
52
+ readonly key: "colorInfoText";
53
+ readonly label: "Text";
54
+ }, {
55
+ readonly key: "colorInfoTextHover";
56
+ readonly label: "Text Hover";
57
+ }, {
58
+ readonly key: "colorInfoTextActive";
59
+ readonly label: "Text Active";
60
+ }];
61
+ }, {
62
+ readonly key: "colorSuccess";
63
+ readonly derived: readonly [{
64
+ readonly key: "colorSuccessBg";
65
+ readonly label: "Bg";
66
+ }, {
67
+ readonly key: "colorSuccessBgHover";
68
+ readonly label: "Bg Hover";
69
+ }, {
70
+ readonly key: "colorSuccessBorder";
71
+ readonly label: "Border";
72
+ }, {
73
+ readonly key: "colorSuccessBorderHover";
74
+ readonly label: "Border Hover";
75
+ }, {
76
+ readonly key: "colorSuccessHover";
77
+ readonly label: "Hover";
78
+ }, {
79
+ readonly key: "colorSuccessActive";
80
+ readonly label: "Active";
81
+ }, {
82
+ readonly key: "colorSuccessText";
83
+ readonly label: "Text";
84
+ }, {
85
+ readonly key: "colorSuccessTextHover";
86
+ readonly label: "Text Hover";
87
+ }, {
88
+ readonly key: "colorSuccessTextActive";
89
+ readonly label: "Text Active";
90
+ }];
91
+ }, {
92
+ readonly key: "colorWarning";
93
+ readonly derived: readonly [{
94
+ readonly key: "colorWarningBg";
95
+ readonly label: "Bg";
96
+ }, {
97
+ readonly key: "colorWarningBgHover";
98
+ readonly label: "Bg Hover";
99
+ }, {
100
+ readonly key: "colorWarningBorder";
101
+ readonly label: "Border";
102
+ }, {
103
+ readonly key: "colorWarningBorderHover";
104
+ readonly label: "Border Hover";
105
+ }, {
106
+ readonly key: "colorWarningHover";
107
+ readonly label: "Hover";
108
+ }, {
109
+ readonly key: "colorWarningActive";
110
+ readonly label: "Active";
111
+ }, {
112
+ readonly key: "colorWarningText";
113
+ readonly label: "Text";
114
+ }, {
115
+ readonly key: "colorWarningTextHover";
116
+ readonly label: "Text Hover";
117
+ }, {
118
+ readonly key: "colorWarningTextActive";
119
+ readonly label: "Text Active";
120
+ }];
121
+ }, {
122
+ readonly key: "colorError";
123
+ readonly derived: readonly [{
124
+ readonly key: "colorErrorBg";
125
+ readonly label: "Bg";
126
+ }, {
127
+ readonly key: "colorErrorBgHover";
128
+ readonly label: "Bg Hover";
129
+ }, {
130
+ readonly key: "colorErrorBgFilledHover";
131
+ readonly label: "Bg Filled Hover";
132
+ }, {
133
+ readonly key: "colorErrorBgActive";
134
+ readonly label: "Bg Active";
135
+ }, {
136
+ readonly key: "colorErrorBorder";
137
+ readonly label: "Border";
138
+ }, {
139
+ readonly key: "colorErrorBorderHover";
140
+ readonly label: "Border Hover";
141
+ }, {
142
+ readonly key: "colorErrorHover";
143
+ readonly label: "Hover";
144
+ }, {
145
+ readonly key: "colorErrorActive";
146
+ readonly label: "Active";
147
+ }, {
148
+ readonly key: "colorErrorText";
149
+ readonly label: "Text";
150
+ }, {
151
+ readonly key: "colorErrorTextHover";
152
+ readonly label: "Text Hover";
153
+ }, {
154
+ readonly key: "colorErrorTextActive";
155
+ readonly label: "Text Active";
156
+ }];
157
+ }, {
158
+ readonly key: "colorLink";
159
+ readonly derived: readonly [{
160
+ readonly key: "colorLinkHover";
161
+ readonly label: "Hover";
162
+ }, {
163
+ readonly key: "colorLinkActive";
164
+ readonly label: "Active";
165
+ }];
166
+ }, {
167
+ readonly key: "colorTextBase";
168
+ readonly derived: readonly [{
169
+ readonly key: "colorText";
170
+ readonly label: "Text";
171
+ }, {
172
+ readonly key: "colorTextSecondary";
173
+ readonly label: "Secondary";
174
+ }, {
175
+ readonly key: "colorTextTertiary";
176
+ readonly label: "Tertiary";
177
+ }, {
178
+ readonly key: "colorTextQuaternary";
179
+ readonly label: "Quaternary";
180
+ }, {
181
+ readonly key: "colorTextHeading";
182
+ readonly label: "Heading";
183
+ }, {
184
+ readonly key: "colorTextLabel";
185
+ readonly label: "Label";
186
+ }, {
187
+ readonly key: "colorTextDescription";
188
+ readonly label: "Description";
189
+ }, {
190
+ readonly key: "colorTextDisabled";
191
+ readonly label: "Disabled";
192
+ }, {
193
+ readonly key: "colorTextPlaceholder";
194
+ readonly label: "Placeholder";
195
+ }, {
196
+ readonly key: "colorTextLightSolid";
197
+ readonly label: "Light Solid";
198
+ }];
199
+ }, {
200
+ readonly key: "colorBgBase";
201
+ readonly derived: readonly [{
202
+ readonly key: "colorBgLayout";
203
+ readonly label: "Layout";
204
+ }, {
205
+ readonly key: "colorBgContainer";
206
+ readonly label: "Container";
207
+ }, {
208
+ readonly key: "colorBgElevated";
209
+ readonly label: "Elevated";
210
+ }, {
211
+ readonly key: "colorBgSpotlight";
212
+ readonly label: "Spotlight";
213
+ }, {
214
+ readonly key: "colorBgContainerDisabled";
215
+ readonly label: "Container Disabled";
216
+ }, {
217
+ readonly key: "colorFill";
218
+ readonly label: "Fill";
219
+ }, {
220
+ readonly key: "colorFillSecondary";
221
+ readonly label: "Fill Secondary";
222
+ }, {
223
+ readonly key: "colorFillTertiary";
224
+ readonly label: "Fill Tertiary";
225
+ }, {
226
+ readonly key: "colorFillQuaternary";
227
+ readonly label: "Fill Quaternary";
228
+ }, {
229
+ readonly key: "colorBorder";
230
+ readonly label: "Border";
231
+ }, {
232
+ readonly key: "colorBorderSecondary";
233
+ readonly label: "Border Secondary";
234
+ }, {
235
+ readonly key: "colorBorderDisabled";
236
+ readonly label: "Border Disabled";
237
+ }];
238
+ }];
239
+ /** Every derived token of the table, whichever seed it belongs to. */
240
+ export declare const PHI_THEME_COLOR_DERIVED_TOKEN_KEYS: ReadonlySet<string>;
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Which colour tokens Ant Design derives from which seed, as far as an author edits them: the seed the
3
+ * Brand tab shows as a section, and the derived tokens it shows below it.
4
+ *
5
+ * The palette resolver reads it to decide what a seed the Site states takes over: a Theme's palette
6
+ * block may state a derived colour outright (a hover tone, a container background) because it suits the
7
+ * block's own seed. Once the Site states that seed, the block's derived colours of it no longer apply and
8
+ * Ant Design derives them from the Site's seed instead (`resolvePhiThemeColorTokens`). The Brand tab
9
+ * builds its sections from the same table, so what it offers below a seed is exactly what that seed
10
+ * takes over.
11
+ */
12
+ export const PHI_THEME_COLOR_SEED_DERIVATIONS = [
13
+ {
14
+ key: "colorPrimary",
15
+ derived: [
16
+ { key: "colorPrimaryBg", label: "Bg" },
17
+ { key: "colorPrimaryBgHover", label: "Bg Hover" },
18
+ { key: "colorPrimaryBorder", label: "Border" },
19
+ { key: "colorPrimaryBorderHover", label: "Border Hover" },
20
+ { key: "colorPrimaryHover", label: "Hover" },
21
+ { key: "colorPrimaryActive", label: "Active" },
22
+ { key: "colorPrimaryText", label: "Text" },
23
+ { key: "colorPrimaryTextHover", label: "Text Hover" },
24
+ { key: "colorPrimaryTextActive", label: "Text Active" },
25
+ ],
26
+ },
27
+ {
28
+ key: "colorInfo",
29
+ derived: [
30
+ { key: "colorInfoBg", label: "Bg" },
31
+ { key: "colorInfoBgHover", label: "Bg Hover" },
32
+ { key: "colorInfoBorder", label: "Border" },
33
+ { key: "colorInfoBorderHover", label: "Border Hover" },
34
+ { key: "colorInfoHover", label: "Hover" },
35
+ { key: "colorInfoActive", label: "Active" },
36
+ { key: "colorInfoText", label: "Text" },
37
+ { key: "colorInfoTextHover", label: "Text Hover" },
38
+ { key: "colorInfoTextActive", label: "Text Active" },
39
+ ],
40
+ },
41
+ {
42
+ key: "colorSuccess",
43
+ derived: [
44
+ { key: "colorSuccessBg", label: "Bg" },
45
+ { key: "colorSuccessBgHover", label: "Bg Hover" },
46
+ { key: "colorSuccessBorder", label: "Border" },
47
+ { key: "colorSuccessBorderHover", label: "Border Hover" },
48
+ { key: "colorSuccessHover", label: "Hover" },
49
+ { key: "colorSuccessActive", label: "Active" },
50
+ { key: "colorSuccessText", label: "Text" },
51
+ { key: "colorSuccessTextHover", label: "Text Hover" },
52
+ { key: "colorSuccessTextActive", label: "Text Active" },
53
+ ],
54
+ },
55
+ {
56
+ key: "colorWarning",
57
+ derived: [
58
+ { key: "colorWarningBg", label: "Bg" },
59
+ { key: "colorWarningBgHover", label: "Bg Hover" },
60
+ { key: "colorWarningBorder", label: "Border" },
61
+ { key: "colorWarningBorderHover", label: "Border Hover" },
62
+ { key: "colorWarningHover", label: "Hover" },
63
+ { key: "colorWarningActive", label: "Active" },
64
+ { key: "colorWarningText", label: "Text" },
65
+ { key: "colorWarningTextHover", label: "Text Hover" },
66
+ { key: "colorWarningTextActive", label: "Text Active" },
67
+ ],
68
+ },
69
+ {
70
+ key: "colorError",
71
+ derived: [
72
+ { key: "colorErrorBg", label: "Bg" },
73
+ { key: "colorErrorBgHover", label: "Bg Hover" },
74
+ { key: "colorErrorBgFilledHover", label: "Bg Filled Hover" },
75
+ { key: "colorErrorBgActive", label: "Bg Active" },
76
+ { key: "colorErrorBorder", label: "Border" },
77
+ { key: "colorErrorBorderHover", label: "Border Hover" },
78
+ { key: "colorErrorHover", label: "Hover" },
79
+ { key: "colorErrorActive", label: "Active" },
80
+ { key: "colorErrorText", label: "Text" },
81
+ { key: "colorErrorTextHover", label: "Text Hover" },
82
+ { key: "colorErrorTextActive", label: "Text Active" },
83
+ ],
84
+ },
85
+ {
86
+ key: "colorLink",
87
+ derived: [
88
+ { key: "colorLinkHover", label: "Hover" },
89
+ { key: "colorLinkActive", label: "Active" },
90
+ ],
91
+ },
92
+ {
93
+ key: "colorTextBase",
94
+ derived: [
95
+ { key: "colorText", label: "Text" },
96
+ { key: "colorTextSecondary", label: "Secondary" },
97
+ { key: "colorTextTertiary", label: "Tertiary" },
98
+ { key: "colorTextQuaternary", label: "Quaternary" },
99
+ { key: "colorTextHeading", label: "Heading" },
100
+ { key: "colorTextLabel", label: "Label" },
101
+ { key: "colorTextDescription", label: "Description" },
102
+ { key: "colorTextDisabled", label: "Disabled" },
103
+ { key: "colorTextPlaceholder", label: "Placeholder" },
104
+ { key: "colorTextLightSolid", label: "Light Solid" },
105
+ ],
106
+ },
107
+ {
108
+ key: "colorBgBase",
109
+ derived: [
110
+ { key: "colorBgLayout", label: "Layout" },
111
+ { key: "colorBgContainer", label: "Container" },
112
+ { key: "colorBgElevated", label: "Elevated" },
113
+ { key: "colorBgSpotlight", label: "Spotlight" },
114
+ { key: "colorBgContainerDisabled", label: "Container Disabled" },
115
+ { key: "colorFill", label: "Fill" },
116
+ { key: "colorFillSecondary", label: "Fill Secondary" },
117
+ { key: "colorFillTertiary", label: "Fill Tertiary" },
118
+ { key: "colorFillQuaternary", label: "Fill Quaternary" },
119
+ { key: "colorBorder", label: "Border" },
120
+ { key: "colorBorderSecondary", label: "Border Secondary" },
121
+ { key: "colorBorderDisabled", label: "Border Disabled" },
122
+ ],
123
+ },
124
+ ];
125
+ /** Every derived token of the table, whichever seed it belongs to. */
126
+ export const PHI_THEME_COLOR_DERIVED_TOKEN_KEYS = new Set(PHI_THEME_COLOR_SEED_DERIVATIONS.flatMap((seed) => seed.derived.map((item) => item.key)));
@@ -19,6 +19,7 @@ import type { PhiFormFieldTypeProviderDescriptor, PhiFormHandlerProviderDescript
19
19
  import type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
20
20
  import type { PhiCalendarAdapterClientDefinition, PhiCalendarAdapterDescriptor, PhiCalendarAdapterKey } from "./calendar";
21
21
  export type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
22
+ import type { PhiMediaSourceDescriptor, PhiMediaSourceKey } from "./media-source";
22
23
  import type { PhiBuilderAreaKey } from "../constants/cms-areas";
23
24
  import type { PhiBuilderNavigationTree } from "../helpers/cms-navigation-catalog";
24
25
  import type { PhiBuilderActivePageCatalog } from "../helpers/cms-page-catalog";
@@ -845,6 +846,27 @@ type PhiRuntimeModuleIconMetadata = {
845
846
  export type PhiRuntimeModuleDefinition = {
846
847
  moduleId: PhiRuntimeModuleId;
847
848
  kind: "platform" | "module";
849
+ /**
850
+ * Whether a Site chooses this Module, or has it.
851
+ *
852
+ * Absent, a Module is selected per Area: its id is stored in the Area's `runtimeModules`, and a Site
853
+ * switches it on and off in the Builder. `"always"` takes the choice away. The Module is active in
854
+ * every Area it is eligible for (`eligibleAreas`), the Builder shows it switched on and locked the way
855
+ * it shows an Area's Base Module, and its id is never part of a stored selection -- a write that names
856
+ * it is refused, and a stored list that still does is read past and logged.
857
+ *
858
+ * It is for what the platform cannot work without and no Site would ever switch off: the Media library
859
+ * is what every image picker opens, in every Area. Only a Module of this package may declare it.
860
+ * Installing a third-party package enables nothing (THIRD_PARTY_MODULES.md), and a package that could
861
+ * mark itself always active would be switched on by its installation.
862
+ *
863
+ * An always-active Module declares none of `mediaSpaces`, `threadKinds`, `seed`, `userState` and
864
+ * `authUiProvider`. All five are derived from the stored selection -- here when the selection is
865
+ * saved, and by phi-server for `userState`, which reads `runtimeModules` of the published Areas -- and
866
+ * an always-active Module is not in it. The catalog refuses the combination rather than letting the
867
+ * declaration be dropped without a word.
868
+ */
869
+ activation?: "always";
848
870
  eligibleAreas: readonly PhiCmsAreaKey[];
849
871
  serverBinding: import("./server-capabilities").PhiRuntimeModuleServerBinding;
850
872
  controllerType?: `${string}/${string}`;
@@ -938,6 +960,12 @@ export type PhiRuntimeModuleDefinition = {
938
960
  */
939
961
  collectionItemRenderers?: readonly import("./collection-provider").PhiCollectionItemRendererDescriptor[];
940
962
  calendarAdapters?: readonly PhiCalendarAdapterDescriptor[];
963
+ /**
964
+ * Media sources this Module offers the Media picker: somewhere else a file can be taken from. The
965
+ * picker lists them beside the Site's library when the Module is active in the Area, and imports what
966
+ * is chosen as an ordinary Asset. The Client half is `mediaSources` of `phiModuleClientContributions`.
967
+ */
968
+ mediaSources?: readonly PhiMediaSourceDescriptor[];
941
969
  /**
942
970
  * Places a video may be fetched from, once somebody has asked for it.
943
971
  *
@@ -1126,6 +1154,7 @@ export type PhiResolvedRuntimeModuleSet = {
1126
1154
  layoutDefinitionsByType: ReadonlyMap<string, PhiRuntimeModuleLayoutDefinition>;
1127
1155
  dataProviderDescriptorsByKey: ReadonlyMap<PhiRuntimeDataProviderKey, PhiRuntimeModuleDataProviderDescriptor>;
1128
1156
  calendarAdapterDescriptorsByKey: ReadonlyMap<PhiCalendarAdapterKey, PhiCalendarAdapterDescriptor>;
1157
+ mediaSourceDescriptorsByKey: ReadonlyMap<PhiMediaSourceKey, PhiMediaSourceDescriptor>;
1129
1158
  videoProviderDescriptorsByKey: ReadonlyMap<import("./video").PhiVideoProviderKey, import("./video").PhiVideoProviderDescriptor>;
1130
1159
  formFieldTypeProviderDescriptorsByKey: ReadonlyMap<PhiFormProviderKey, PhiFormFieldTypeProviderDescriptor>;
1131
1160
  formValidationProviderDescriptorsByKey: ReadonlyMap<PhiFormProviderKey, PhiFormValidationProviderDescriptor>;
@@ -0,0 +1,48 @@
1
+ import type { PhisMediaSourceListInput, PhisMediaSourcePage } from "@phis/contracts/media-source";
2
+ import type { PhiRuntimeModuleId } from "./cms-module-descriptors";
3
+ /**
4
+ * A media source a Module offers: somewhere other than the Site's library a file can be taken from. The
5
+ * list contract is `@phis/contracts/media-source`; what is chosen is imported into the library as an
6
+ * ordinary Asset, and nothing ever stores a reference into the source (THIRD_PARTY_MODULES.md, "Offering a
7
+ * media source").
8
+ */
9
+ /** Namespaced like a data provider key: `<owner>/<name>`. */
10
+ export type PhiMediaSourceKey = `${string}/${string}`;
11
+ /** What the Server half declares: the catalog validates the key and that the declaring Module owns it. */
12
+ export type PhiMediaSourceDescriptor = {
13
+ key: PhiMediaSourceKey;
14
+ ownerModuleId: PhiRuntimeModuleId;
15
+ title: string;
16
+ description?: string;
17
+ };
18
+ /**
19
+ * An item, taken: the bytes in the browser and what is known about them. The picker uploads the file
20
+ * into the Site's library; the Module never writes an Asset itself.
21
+ */
22
+ export type PhiMediaSourceTakenFile = {
23
+ file: Blob;
24
+ fileName: string;
25
+ title: string;
26
+ altText?: string | null;
27
+ credit?: string | null;
28
+ };
29
+ export type PhiMediaSourceClient = {
30
+ /** What the picker's source switch says, in the reader's language; the Module translates its own words. */
31
+ describe(input: {
32
+ locale: string;
33
+ }): Promise<{
34
+ label: string;
35
+ }>;
36
+ list(input: PhisMediaSourceListInput & {
37
+ signal: AbortSignal;
38
+ }): Promise<PhisMediaSourcePage>;
39
+ take(input: {
40
+ itemId: string;
41
+ signal: AbortSignal;
42
+ }): Promise<PhiMediaSourceTakenFile>;
43
+ };
44
+ export type PhiMediaSourceClientDefinition = {
45
+ key: PhiMediaSourceKey;
46
+ ownerModuleId: PhiRuntimeModuleId;
47
+ load: () => Promise<PhiMediaSourceClient>;
48
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { PhiShellTheme } from "../components/shell/shell-types";
2
- import type { PhiSiteFontSlots, PhiSiteThemeBrand, PhiSiteThemeContact, PhiSiteThemeRoot } from "./site-theme";
2
+ import type { PhiSiteFontSlots, PhiSiteThemeBrand, PhiSiteThemeRoot } from "./site-theme";
3
3
  import type { PhiLocaleCapability } from "../helpers/site-locale-config";
4
4
  import type { PhiThemePalette } from "../theme/phi-theme-presets";
5
5
  import type { PhiThemeBlockSelection } from "../theme/phi-theme-composition";
@@ -22,7 +22,6 @@ export type PhiSiteTheme = {
22
22
  controls?: PhiControlShapeCorners | null;
23
23
  } | null;
24
24
  fonts?: PhiSiteFontSlots;
25
- contact?: PhiSiteThemeContact | null;
26
25
  brand?: PhiSiteThemeBrand | null;
27
26
  widgets?: {
28
27
  locale?: {
@@ -178,12 +178,6 @@ export type PhiSiteThemeBrand = {
178
178
  location?: PhiSiteThemeBrandLine | null;
179
179
  wordmark?: PhiSiteThemeWordmark | null;
180
180
  };
181
- /** The one way to reach whoever runs this Site, as the frame offers it. */
182
- export type PhiSiteThemeContact = {
183
- label?: string | null;
184
- href?: string | null;
185
- icon?: string | null;
186
- };
187
181
  export type PhiWidgetFontFamilyKey = "inherit" | "system" | "body" | "mono" | "serif" | "accent" | "display";
188
182
  export type PhiWidgetFontSizeKey = "inherit" | "xs" | "sm" | "base" | "lg" | "xl" | "xxl";
189
183
  export type PhiSiteFontSlots = {