@phis/ui 0.6.2 → 0.6.4

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 (206) 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/controls/phi-segmented-control.js +15 -1
  9. package/components/forms/form-field-labels.d.ts +19 -0
  10. package/components/forms/form-field-labels.js +78 -0
  11. package/components/forms/form-provider-contract.d.ts +1 -17
  12. package/components/forms/form-provider-contract.js +4 -18
  13. package/components/forms/media-asset-field-keys.d.ts +27 -0
  14. package/components/forms/media-asset-field-keys.js +27 -0
  15. package/components/forms/phi-form-widget.js +5 -1
  16. package/components/forms/upload-field-keys.d.ts +27 -0
  17. package/components/forms/upload-field-keys.js +27 -0
  18. package/components/forms/upload-form-control.js +11 -5
  19. package/components/media/asset-controller-requirement.d.ts +9 -0
  20. package/components/media/asset-controller-requirement.js +42 -0
  21. package/components/media/label-sets/media-upload.d.ts +10 -0
  22. package/components/media/label-sets/media-upload.js +85 -0
  23. package/components/media/label-sets/media.js +31 -135
  24. package/components/media/media-upload-labels.d.ts +43 -0
  25. package/components/media/media-upload-labels.js +23 -0
  26. package/components/media/media-upload-refusals.d.ts +12 -0
  27. package/components/media/media-upload-refusals.js +28 -0
  28. package/components/media/media-widget-labels.d.ts +33 -26
  29. package/components/media/media-widget-labels.js +27 -36
  30. package/components/media/phi-area-upload-widget.js +3 -4
  31. package/components/media/phi-asset-inspector-section.d.ts +2 -2
  32. package/components/media/phi-image-inspector-widget.d.ts +2 -5
  33. package/components/media/phi-media-picker-binding.d.ts +17 -0
  34. package/components/media/phi-media-picker-binding.js +199 -4
  35. package/components/media/phi-media-picker-labels.d.ts +7 -0
  36. package/components/media/phi-media-picker-labels.js +25 -0
  37. package/components/media/phi-media-sources.d.ts +69 -0
  38. package/components/media/phi-media-sources.js +254 -0
  39. package/components/media/phi-media-upload.d.ts +1 -27
  40. package/components/media/phi-media-upload.js +4 -48
  41. package/components/runtime/runtime-controller-materialization.d.ts +5 -4
  42. package/components/runtime/runtime-controller-materialization.js +5 -4
  43. package/components/runtime/runtime-module-context.d.ts +5 -1
  44. package/components/runtime/runtime-module-context.js +4 -1
  45. package/components/runtime/runtime-module-media-source-client-manifest.d.ts +17 -0
  46. package/components/runtime/runtime-module-media-source-client-manifest.js +53 -0
  47. package/components/widgets/client/shared/phi-mask-picker.js +23 -13
  48. package/components/widgets/client/shared/phi-widget-image-tool-button.d.ts +7 -5
  49. package/components/widgets/client/shared/phi-widget-image-tool-button.js +11 -7
  50. package/components/widgets/client/shared/phi-widget-tool-buttons.js +2 -2
  51. package/components/widgets/config/mask.d.ts +6 -8
  52. package/components/widgets/config/mask.js +14 -12
  53. package/components/widgets/label-sets/authoring-tools.js +55 -1
  54. package/components/widgets/label-sets/history.js +0 -2
  55. package/components/widgets/label-sets/slot-upload.js +4 -4
  56. package/components/widgets/label-types/authoring-tools.d.ts +10 -0
  57. package/components/widgets/label-types/authoring-tools.js +6 -0
  58. package/components/widgets/label-types/history.d.ts +1 -1
  59. package/components/widgets/label-types/history.js +0 -1
  60. package/components/widgets/label-types/mask-picker.d.ts +31 -0
  61. package/components/widgets/label-types/mask-picker.js +30 -0
  62. package/components/widgets/label-types/slot-upload.d.ts +2 -2
  63. package/controls.d.ts +2 -0
  64. package/controls.js +1 -0
  65. package/helpers/cms-region-keys.d.ts +1 -1
  66. package/module-client.d.ts +5 -1
  67. package/module-projection-client.js +1 -0
  68. package/next/areas/accounting-client.js +3 -2
  69. package/next/areas/admin-client.js +3 -2
  70. package/next/areas/app-client.js +3 -2
  71. package/next/areas/builder-client.js +3 -2
  72. package/next/areas/editor-client.js +3 -2
  73. package/next/areas/public-client.js +3 -2
  74. package/next/runtime-module-client-boundary.d.ts +3 -1
  75. package/next/runtime-module-client-boundary.js +3 -2
  76. package/package.json +7 -2
  77. package/plugins/runtime-modules/area-module-defaults.js +4 -3
  78. package/plugins/runtime-modules/asset/controller/definition.d.ts +2 -2
  79. package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
  80. package/plugins/runtime-modules/asset/definition.d.ts +3 -2
  81. package/plugins/runtime-modules/asset/definition.js +11 -3
  82. package/plugins/runtime-modules/asset/ids.d.ts +8 -0
  83. package/plugins/runtime-modules/asset/ids.js +8 -0
  84. package/plugins/runtime-modules/asset/labels.d.ts +4 -0
  85. package/plugins/runtime-modules/asset/labels.js +94 -0
  86. package/plugins/runtime-modules/asset/media-asset-form-control.js +32 -7
  87. package/plugins/runtime-modules/asset/metadata-form.js +27 -18
  88. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +14 -11
  89. package/plugins/runtime-modules/asset/widgets/area-upload/config.d.ts +2 -0
  90. package/plugins/runtime-modules/asset/widgets/area-upload/config.js +3 -0
  91. package/plugins/runtime-modules/asset/widgets/area-upload/server.js +3 -3
  92. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.d.ts +2 -0
  93. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.js +3 -0
  94. package/plugins/runtime-modules/asset/widgets/image-inspector/config.d.ts +2 -0
  95. package/plugins/runtime-modules/asset/widgets/image-inspector/config.js +3 -0
  96. package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -2
  97. package/plugins/runtime-modules/asset/widgets/media-picker/config.d.ts +1 -0
  98. package/plugins/runtime-modules/asset/widgets/media-picker/config.js +3 -0
  99. package/plugins/runtime-modules/auth/presets.d.ts +11 -0
  100. package/plugins/runtime-modules/auth/presets.js +17 -8
  101. package/plugins/runtime-modules/auth/services/installations-table.js +3 -1
  102. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +1 -4
  103. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +2 -2
  104. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +1 -3
  105. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +4 -5
  106. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -8
  107. package/plugins/runtime-modules/builder/clients/pages-header.js +2 -0
  108. package/plugins/runtime-modules/builder/clients/widget-inspector.js +0 -1
  109. package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -1
  110. package/plugins/runtime-modules/builder/controller/page-controller.js +3 -3
  111. package/plugins/runtime-modules/builder/controller/workspace-controller.js +4 -1
  112. package/plugins/runtime-modules/builder/inspector-section-widget.js +5 -2
  113. package/plugins/runtime-modules/builder/module-authoring-catalog.server.js +3 -1
  114. package/plugins/runtime-modules/builder/navigation-catalog.server.js +3 -0
  115. package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +1 -1
  116. package/plugins/runtime-modules/builder/offered-page-catalog.js +8 -3
  117. package/plugins/runtime-modules/builder/options-providers.js +2 -2
  118. package/plugins/runtime-modules/builder/page-address-rule.d.ts +7 -0
  119. package/plugins/runtime-modules/builder/page-address-rule.js +12 -0
  120. package/plugins/runtime-modules/builder/page-presets.server.js +4 -0
  121. package/plugins/runtime-modules/builder/persistence.js +2 -3
  122. package/plugins/runtime-modules/builder/public-route-collisions.d.ts +1 -1
  123. package/plugins/runtime-modules/builder/public-route-collisions.js +6 -1
  124. package/plugins/runtime-modules/builder/runtime-module-sandbox.server.js +8 -1
  125. package/plugins/runtime-modules/builder/runtime-module-selection.js +5 -5
  126. package/plugins/runtime-modules/builder/services/runtime-modules-table.js +24 -6
  127. package/plugins/runtime-modules/builder/signal-endpoints.js +2 -1
  128. package/plugins/runtime-modules/builder/use-offered-page-catalog.d.ts +2 -2
  129. package/plugins/runtime-modules/builder/use-offered-page-catalog.js +5 -3
  130. package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +19 -12
  131. package/plugins/runtime-modules/client-manifests/accounting.d.ts +1 -0
  132. package/plugins/runtime-modules/client-manifests/accounting.js +1 -0
  133. package/plugins/runtime-modules/client-manifests/admin.d.ts +1 -0
  134. package/plugins/runtime-modules/client-manifests/admin.js +1 -0
  135. package/plugins/runtime-modules/client-manifests/app.d.ts +1 -0
  136. package/plugins/runtime-modules/client-manifests/app.js +1 -0
  137. package/plugins/runtime-modules/client-manifests/builder.d.ts +1 -0
  138. package/plugins/runtime-modules/client-manifests/builder.js +1 -0
  139. package/plugins/runtime-modules/client-manifests/common.d.ts +1 -0
  140. package/plugins/runtime-modules/client-manifests/common.js +3 -0
  141. package/plugins/runtime-modules/client-manifests/editor.d.ts +1 -0
  142. package/plugins/runtime-modules/client-manifests/editor.js +1 -0
  143. package/plugins/runtime-modules/client-manifests/public.d.ts +1 -0
  144. package/plugins/runtime-modules/client-manifests/public.js +1 -0
  145. package/plugins/runtime-modules/contracts.js +61 -0
  146. package/plugins/runtime-modules/core/client-media-sources.d.ts +5 -0
  147. package/plugins/runtime-modules/core/client-media-sources.js +6 -0
  148. package/plugins/runtime-modules/core/messaging/forms.js +2 -15
  149. package/plugins/runtime-modules/core/messaging/labels.d.ts +0 -12
  150. package/plugins/runtime-modules/core/messaging/labels.js +0 -24
  151. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -6
  152. package/plugins/runtime-modules/core/widgets/collection-view/config.d.ts +1 -0
  153. package/plugins/runtime-modules/core/widgets/collection-view/config.js +7 -0
  154. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +8 -2
  155. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
  156. package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +1 -1
  157. package/plugins/runtime-modules/core/widgets/collection-view/server.js +14 -2
  158. package/plugins/runtime-modules/core/widgets/image/authoring.js +1 -1
  159. package/plugins/runtime-modules/core/widgets/image/editor.d.ts +1 -4
  160. package/plugins/runtime-modules/core/widgets/image/editor.js +2 -2
  161. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +2 -3
  162. package/plugins/runtime-modules/editor/services/releases-table.js +4 -1
  163. package/plugins/runtime-modules/observability/services/table.js +3 -1
  164. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -25
  165. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  166. package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -1
  167. package/plugins/runtime-modules/resolver.js +27 -1
  168. package/plugins/runtime-modules/settings.d.ts +20 -3
  169. package/plugins/runtime-modules/settings.js +35 -5
  170. package/plugins/runtime-modules/site-module-client-manifests.d.ts +2 -0
  171. package/plugins/runtime-modules/site-module-client-manifests.js +2 -0
  172. package/plugins/runtime-modules/site-modules-client.d.ts +5 -0
  173. package/plugins/runtime-modules/site-modules-client.js +1 -0
  174. package/plugins/runtime-modules/theme/brand-theme-model.js +0 -1
  175. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +97 -192
  176. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +6 -2
  177. package/plugins/runtime-modules/user-management/services/table.js +3 -1
  178. package/runtime-client-manifests-accounting.d.ts +1 -1
  179. package/runtime-client-manifests-accounting.js +1 -1
  180. package/runtime-client-manifests-admin.d.ts +1 -1
  181. package/runtime-client-manifests-admin.js +1 -1
  182. package/runtime-client-manifests-app.d.ts +1 -1
  183. package/runtime-client-manifests-app.js +1 -1
  184. package/runtime-client-manifests-builder.d.ts +1 -1
  185. package/runtime-client-manifests-builder.js +1 -1
  186. package/runtime-client-manifests-editor.d.ts +1 -1
  187. package/runtime-client-manifests-editor.js +1 -1
  188. package/runtime-client-manifests-public.d.ts +2 -1
  189. package/runtime-client-manifests-public.js +1 -1
  190. package/runtime-media-source-client.d.ts +3 -0
  191. package/runtime-media-source-client.js +2 -0
  192. package/server-helpers/cms-request.js +10 -4
  193. package/theme/phi-theme-presets.d.ts +13 -3
  194. package/theme/phi-theme-presets.js +20 -3
  195. package/theme/phi-theme-seed-derivation.d.ts +240 -0
  196. package/theme/phi-theme-seed-derivation.js +126 -0
  197. package/types/cms-plugins.d.ts +29 -0
  198. package/types/media-source.d.ts +48 -0
  199. package/types/media-source.js +1 -0
  200. package/types/site-config.d.ts +1 -2
  201. package/types/site-theme.d.ts +0 -6
  202. package/types.d.ts +1 -0
  203. package/components/media/asset-controller-routes.d.ts +0 -8
  204. package/components/media/asset-controller-routes.js +0 -31
  205. package/helpers/brand-contact.d.ts +0 -14
  206. package/helpers/brand-contact.js +0 -26
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { PHI_ADMIN_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/admin";
3
+ import { PHI_ADMIN_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_ADMIN_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/admin";
4
4
  import { PhiNextRuntimeModuleClientBoundary } from "../runtime-module-client-boundary";
5
5
  import { extendWithPhiSiteModuleClientManifests, } from "../../plugins/runtime-modules/site-module-client-manifests";
6
6
  import { PHI_NO_SITE_MODULE_CLIENT_CONTRIBUTIONS, } from "../../plugins/runtime-modules/site-modules-client";
@@ -16,10 +16,11 @@ export function createPhiAdminRuntimeModuleClientBoundary(siteModules = PHI_NO_S
16
16
  render: PHI_ADMIN_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST,
17
17
  dataProvider: PHI_ADMIN_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST,
18
18
  calendarAdapter: PHI_ADMIN_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST,
19
+ mediaSource: PHI_ADMIN_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST,
19
20
  uiProvider: PHI_ADMIN_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST,
20
21
  });
21
22
  return function PhiAdminRuntimeModuleClientBoundary({ children, }) {
22
- return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
+ return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, mediaSourceManifest: manifests.mediaSource, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
24
  };
24
25
  }
25
26
  export const PhiAdminRuntimeModuleClientBoundary = createPhiAdminRuntimeModuleClientBoundary();
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { PHI_APP_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/app";
3
+ import { PHI_APP_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_APP_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/app";
4
4
  import { PhiNextRuntimeModuleClientBoundary } from "../runtime-module-client-boundary";
5
5
  import { extendWithPhiSiteModuleClientManifests, } from "../../plugins/runtime-modules/site-module-client-manifests";
6
6
  import { PHI_NO_SITE_MODULE_CLIENT_CONTRIBUTIONS, } from "../../plugins/runtime-modules/site-modules-client";
@@ -16,10 +16,11 @@ export function createPhiAppRuntimeModuleClientBoundary(siteModules = PHI_NO_SIT
16
16
  render: PHI_APP_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST,
17
17
  dataProvider: PHI_APP_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST,
18
18
  calendarAdapter: PHI_APP_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST,
19
+ mediaSource: PHI_APP_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST,
19
20
  uiProvider: PHI_APP_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST,
20
21
  });
21
22
  return function PhiAppRuntimeModuleClientBoundary({ children, }) {
22
- return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
+ return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, mediaSourceManifest: manifests.mediaSource, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
24
  };
24
25
  }
25
26
  export const PhiAppRuntimeModuleClientBoundary = createPhiAppRuntimeModuleClientBoundary();
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { PHI_BUILDER_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/builder";
3
+ import { PHI_BUILDER_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_BUILDER_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/builder";
4
4
  import { PHI_BUILDER_TARGET_RUNTIME_MODULE_AUTHORING_CLIENT_MANIFEST } from "../../plugins/runtime-modules/client-manifests/builder-authoring";
5
5
  import { PhiNextRuntimeModuleClientBoundary } from "../runtime-module-client-boundary";
6
6
  import { extendWithPhiSiteModuleClientManifests, readAllPhiSiteModuleAuthoringClientContributions, } from "../../plugins/runtime-modules/site-module-client-manifests";
@@ -23,12 +23,13 @@ export function createPhiBuilderRuntimeModuleClientBoundary(siteModules = PHI_NO
23
23
  render: PHI_BUILDER_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST,
24
24
  dataProvider: PHI_BUILDER_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST,
25
25
  calendarAdapter: PHI_BUILDER_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST,
26
+ mediaSource: PHI_BUILDER_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST,
26
27
  uiProvider: PHI_BUILDER_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST,
27
28
  });
28
29
  // The Builder authors every Area, so it receives the complete installed Authoring union.
29
30
  const authoringManifest = extendPhiRuntimeModuleAuthoringClientManifest(PHI_BUILDER_TARGET_RUNTIME_MODULE_AUTHORING_CLIENT_MANIFEST, readAllPhiSiteModuleAuthoringClientContributions(siteModuleAuthoring));
30
31
  return function PhiBuilderRuntimeModuleClientBoundary({ children, }) {
31
- return (_jsx(PhiNextRuntimeModuleClientBoundary, { authoringManifest: authoringManifest, calendarAdapterManifest: manifests.calendarAdapter, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
32
+ return (_jsx(PhiNextRuntimeModuleClientBoundary, { authoringManifest: authoringManifest, calendarAdapterManifest: manifests.calendarAdapter, mediaSourceManifest: manifests.mediaSource, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
32
33
  };
33
34
  }
34
35
  export const PhiBuilderRuntimeModuleClientBoundary = createPhiBuilderRuntimeModuleClientBoundary();
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { PHI_EDITOR_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/editor";
3
+ import { PHI_EDITOR_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/editor";
4
4
  import { PhiNextRuntimeModuleClientBoundary } from "../runtime-module-client-boundary";
5
5
  import { extendWithPhiSiteModuleClientManifests, } from "../../plugins/runtime-modules/site-module-client-manifests";
6
6
  import { PHI_NO_SITE_MODULE_CLIENT_CONTRIBUTIONS, } from "../../plugins/runtime-modules/site-modules-client";
@@ -16,10 +16,11 @@ export function createPhiEditorRuntimeModuleClientBoundary(siteModules = PHI_NO_
16
16
  render: PHI_EDITOR_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST,
17
17
  dataProvider: PHI_EDITOR_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST,
18
18
  calendarAdapter: PHI_EDITOR_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST,
19
+ mediaSource: PHI_EDITOR_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST,
19
20
  uiProvider: PHI_EDITOR_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST,
20
21
  });
21
22
  return function PhiEditorRuntimeModuleClientBoundary({ children, }) {
22
- return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
+ return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, mediaSourceManifest: manifests.mediaSource, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
24
  };
24
25
  }
25
26
  export const PhiEditorRuntimeModuleClientBoundary = createPhiEditorRuntimeModuleClientBoundary();
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { PHI_PUBLIC_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/public";
3
+ import { PHI_PUBLIC_RUNTIME_MODULE_CONTROLLER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST, } from "../../plugins/runtime-modules/client-manifests/public";
4
4
  import { PhiNextRuntimeModuleClientBoundary } from "../runtime-module-client-boundary";
5
5
  import { extendWithPhiSiteModuleClientManifests, } from "../../plugins/runtime-modules/site-module-client-manifests";
6
6
  import { PHI_NO_SITE_MODULE_CLIENT_CONTRIBUTIONS, } from "../../plugins/runtime-modules/site-modules-client";
@@ -16,10 +16,11 @@ export function createPhiPublicRuntimeModuleClientBoundary(siteModules = PHI_NO_
16
16
  render: PHI_PUBLIC_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST,
17
17
  dataProvider: PHI_PUBLIC_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST,
18
18
  calendarAdapter: PHI_PUBLIC_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST,
19
+ mediaSource: PHI_PUBLIC_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST,
19
20
  uiProvider: PHI_PUBLIC_RUNTIME_MODULE_UI_PROVIDER_CLIENT_MANIFEST,
20
21
  });
21
22
  return function PhiPublicRuntimeModuleClientBoundary({ children, }) {
22
- return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
+ return (_jsx(PhiNextRuntimeModuleClientBoundary, { calendarAdapterManifest: manifests.calendarAdapter, mediaSourceManifest: manifests.mediaSource, controllerManifest: manifests.controller, dataProviderManifest: manifests.dataProvider, renderManifest: manifests.render, uiProviderManifest: manifests.uiProvider, children: children }));
23
24
  };
24
25
  }
25
26
  export const PhiPublicRuntimeModuleClientBoundary = createPhiPublicRuntimeModuleClientBoundary();
@@ -3,13 +3,15 @@ import type { PhiRuntimeModuleRenderClientManifest } from "../components/runtime
3
3
  import type { PhiRuntimeModuleDataProviderClientManifest } from "../components/runtime/runtime-module-data-provider-client-manifest";
4
4
  import type { PhiRuntimeModuleAuthoringClientManifest } from "../components/runtime/runtime-module-authoring-client-manifest";
5
5
  import type { PhiRuntimeModuleCalendarAdapterClientManifest } from "../components/runtime/runtime-module-calendar-adapter-client-manifest";
6
+ import type { PhiRuntimeModuleMediaSourceClientManifest } from "../components/runtime/runtime-module-media-source-client-manifest";
6
7
  import { type PhiRuntimeModuleUiProviderClientManifest } from "../components/runtime/runtime-module-ui-provider-client-manifest";
7
- export declare function PhiNextRuntimeModuleClientBoundary({ children, controllerManifest, renderManifest, dataProviderManifest, authoringManifest, calendarAdapterManifest, uiProviderManifest, }: {
8
+ export declare function PhiNextRuntimeModuleClientBoundary({ children, controllerManifest, renderManifest, dataProviderManifest, authoringManifest, calendarAdapterManifest, mediaSourceManifest, uiProviderManifest, }: {
8
9
  children: React.ReactNode;
9
10
  controllerManifest: PhiRuntimeModuleControllerClientManifest;
10
11
  renderManifest: PhiRuntimeModuleRenderClientManifest;
11
12
  dataProviderManifest: PhiRuntimeModuleDataProviderClientManifest;
12
13
  authoringManifest?: PhiRuntimeModuleAuthoringClientManifest;
13
14
  calendarAdapterManifest?: PhiRuntimeModuleCalendarAdapterClientManifest;
15
+ mediaSourceManifest?: PhiRuntimeModuleMediaSourceClientManifest;
14
16
  uiProviderManifest: PhiRuntimeModuleUiProviderClientManifest;
15
17
  }): import("react").JSX.Element;
@@ -5,8 +5,9 @@ import { PhiRuntimeModuleRenderClientManifestProvider } from "../components/runt
5
5
  import { PhiRuntimeModuleDataProviderClientManifestProvider } from "../components/runtime/runtime-module-data-provider-client-manifest";
6
6
  import { PhiRuntimeModuleAuthoringClientManifestProvider } from "../components/runtime/runtime-module-authoring-client-manifest";
7
7
  import { PhiRuntimeModuleCalendarAdapterClientManifestProvider } from "../components/runtime/runtime-module-calendar-adapter-client-manifest";
8
+ import { PhiRuntimeModuleMediaSourceClientManifestProvider } from "../components/runtime/runtime-module-media-source-client-manifest";
8
9
  import { PhiRuntimeModuleUiProviderClientManifestProvider, } from "../components/runtime/runtime-module-ui-provider-client-manifest";
9
- export function PhiNextRuntimeModuleClientBoundary({ children, controllerManifest, renderManifest, dataProviderManifest, authoringManifest, calendarAdapterManifest, uiProviderManifest, }) {
10
+ export function PhiNextRuntimeModuleClientBoundary({ children, controllerManifest, renderManifest, dataProviderManifest, authoringManifest, calendarAdapterManifest, mediaSourceManifest, uiProviderManifest, }) {
10
11
  const content = authoringManifest ? (_jsx(PhiRuntimeModuleAuthoringClientManifestProvider, { manifest: authoringManifest, children: children })) : children;
11
- return (_jsx(PhiRuntimeModuleControllerClientManifestProvider, { manifest: controllerManifest, children: _jsx(PhiRuntimeModuleRenderClientManifestProvider, { manifest: renderManifest, children: _jsx(PhiRuntimeModuleCalendarAdapterClientManifestProvider, { manifest: calendarAdapterManifest, children: _jsx(PhiRuntimeModuleDataProviderClientManifestProvider, { manifest: dataProviderManifest, children: _jsx(PhiRuntimeModuleUiProviderClientManifestProvider, { manifest: uiProviderManifest, children: content }) }) }) }) }));
12
+ return (_jsx(PhiRuntimeModuleControllerClientManifestProvider, { manifest: controllerManifest, children: _jsx(PhiRuntimeModuleRenderClientManifestProvider, { manifest: renderManifest, children: _jsx(PhiRuntimeModuleCalendarAdapterClientManifestProvider, { manifest: calendarAdapterManifest, children: _jsx(PhiRuntimeModuleDataProviderClientManifestProvider, { manifest: dataProviderManifest, children: _jsx(PhiRuntimeModuleMediaSourceClientManifestProvider, { manifest: mediaSourceManifest, children: _jsx(PhiRuntimeModuleUiProviderClientManifestProvider, { manifest: uiProviderManifest, children: content }) }) }) }) }) }));
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -391,6 +391,11 @@
391
391
  "import": "./runtime-calendar-adapter-client.js",
392
392
  "default": "./runtime-calendar-adapter-client.js"
393
393
  },
394
+ "./runtime/media-source-client": {
395
+ "types": "./runtime-media-source-client.d.ts",
396
+ "import": "./runtime-media-source-client.js",
397
+ "default": "./runtime-media-source-client.js"
398
+ },
394
399
  "./runtime/signal-client": {
395
400
  "types": "./runtime-signal-client.d.ts",
396
401
  "import": "./runtime-signal-client.js",
@@ -516,7 +521,7 @@
516
521
  "@lexical/rich-text": "0.50.0",
517
522
  "@lexical/selection": "0.50.0",
518
523
  "@lexical/utils": "0.50.0",
519
- "@phis/contracts": "^0.7.9",
524
+ "@phis/contracts": "^0.7.12",
520
525
  "dayjs": "^1.11.23",
521
526
  "dom-serializer": "^2.0.0",
522
527
  "htmlparser2": "^10.1.0",
@@ -6,7 +6,6 @@ import { createPhiRuntimeModuleId } from "../../constants/module-identity";
6
6
  * "The dependency rule").
7
7
  */
8
8
  const firstPartyModuleId = (moduleKey) => createPhiRuntimeModuleId(PHI_SHARED_PACKAGE_NAME, moduleKey);
9
- const PHI_ASSET_RUNTIME_MODULE_ID = firstPartyModuleId("asset");
10
9
  const PHI_AUTH_RUNTIME_MODULE_ID = firstPartyModuleId("auth");
11
10
  const PHI_THEME_RUNTIME_MODULE_ID = firstPartyModuleId("theme");
12
11
  const PHI_LOCALIZATION_RUNTIME_MODULE_ID = firstPartyModuleId("localization");
@@ -31,6 +30,10 @@ const PHI_THREADS_RUNTIME_MODULE_ID = firstPartyModuleId("threads");
31
30
  * Pages carry their Tours either way, and without it their buttons stay hidden. Public has no Tour to give.
32
31
  */
33
32
  const PHI_TOUR_RUNTIME_MODULE_ID = firstPartyModuleId("tour");
33
+ /*
34
+ * The Asset Module is in none of these lists: it is declared `activation: "always"`, so it is active in
35
+ * every Area without being selected, and a list that named it would be refused on its first save.
36
+ */
34
37
  export function createPhiDefaultAreaRuntimeModuleIds(area) {
35
38
  const moduleIds = listAreaRuntimeModuleIds(area);
36
39
  return area === "public" ? moduleIds : [...moduleIds, PHI_TOUR_RUNTIME_MODULE_ID];
@@ -52,14 +55,12 @@ function listAreaRuntimeModuleIds(area) {
52
55
  PHI_DASHBOARD_RUNTIME_MODULE_ID,
53
56
  PHI_REVISIONS_RUNTIME_MODULE_ID,
54
57
  PHI_THEME_RUNTIME_MODULE_ID,
55
- PHI_ASSET_RUNTIME_MODULE_ID,
56
58
  PHI_THREADS_RUNTIME_MODULE_ID,
57
59
  ];
58
60
  }
59
61
  if (area === "admin") {
60
62
  return [
61
63
  PHI_AUTH_RUNTIME_MODULE_ID,
62
- PHI_ASSET_RUNTIME_MODULE_ID,
63
64
  PHI_DASHBOARD_RUNTIME_MODULE_ID,
64
65
  PHI_LOCALIZATION_RUNTIME_MODULE_ID,
65
66
  PHI_OBSERVABILITY_RUNTIME_MODULE_ID,
@@ -1,8 +1,8 @@
1
1
  import { type PhiSignalRouteSet } from "../../../../types/signals";
2
2
  /**
3
3
  * Whom the Controller answers into: the inspector and folder dialogs, their Forms and the collection
4
- * they reload. The Page that holds them says so (`controllerSettings`); an Area runs this Controller
5
- * for its pickers too, and there it is told nothing and opens nothing.
4
+ * they reload. The Page that holds them says so (`controllerSettings`); mounted for a Widget on a Page
5
+ * that says nothing, it is told nothing and opens nothing.
6
6
  */
7
7
  export type PhiAssetRuntimeControllerConfig = {
8
8
  signalRoutes: PhiSignalRouteSet | null;
@@ -52,8 +52,8 @@ export function usePhiAssetRuntimeController({ address, mountScope, config, }) {
52
52
  *
53
53
  * The receivers -- the inspector and folder dialogs, their Forms, the collection -- used to be Widget
54
54
  * ids of the Media Page written into this file, so the Controller worked on that one Page and on no
55
- * copy of it. The Page names them now (`controllerSettings`); a Page that names none, or an Area that
56
- * runs this Controller only for its pickers, gets a Controller that opens nothing.
55
+ * copy of it. The Page names them now (`controllerSettings`); a Page that names none gets a
56
+ * Controller that opens nothing.
57
57
  */
58
58
  const emitRoutes = useMemo(() => config.signalRoutes?.emits ?? [], [config.signalRoutes?.emits]);
59
59
  const emitCapability = useCallback((capabilityId, value, correlationId) => dispatchPhiSignalCapability(dispatchSignal, address, emitRoutes, capabilityId, value, correlationId), [address, dispatchSignal, emitRoutes]);
@@ -1,6 +1,6 @@
1
1
  export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
2
- moduleId: "@phis/ui/modules/asset";
3
2
  kind: "module";
3
+ activation: "always";
4
4
  eligibleAreas: readonly ["public", "app", "admin", "builder", "editor", "accounting"];
5
5
  serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
6
6
  controllerType: "@phis/ui/modules/asset/controller/default";
@@ -9,7 +9,7 @@ export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
9
9
  description: string;
10
10
  category: "media";
11
11
  iconFamily: string;
12
- controllerMountPolicy: "area";
12
+ controllerMountPolicy: "demand";
13
13
  dataProviders: ({
14
14
  key: `${string}/${string}`;
15
15
  ownerModuleId: "@phis/ui/modules/asset";
@@ -192,4 +192,5 @@ export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
192
192
  credentialPolicy: "site-session";
193
193
  })[];
194
194
  };
195
+ moduleId: "@phis/ui/modules/asset";
195
196
  };
@@ -1,7 +1,7 @@
1
1
  import { PHI_ASSET_RUNTIME_CONTROLLER_DEFINITION } from "./controller/definition";
2
2
  import { PHI_ASSET_CONTROLLER_TYPE } from "../../../components/media/asset-controller-address";
3
3
  import { buildPhiRuntimeModuleControllerDescriptor } from "../contracts";
4
- import { PHI_ASSET_RUNTIME_ITEM_RENDERER_KEY, PHI_ASSET_RUNTIME_MODULE_ID } from "./ids";
4
+ import { PHI_ASSET_RUNTIME_ITEM_RENDERER_KEY, PHI_ASSET_RUNTIME_MODULE_IDENTITY } from "./ids";
5
5
  import { PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "./data-providers";
6
6
  import { PHI_CMS_AREA_KEYS } from "../../../constants/cms-areas";
7
7
  import { PHI_CORE_SERVER_BINDING } from "../../../types/server-capabilities";
@@ -9,8 +9,10 @@ import { PHI_ASSET_FOLDER_FORM_HANDLER_PROVIDER_DESCRIPTOR, PHI_ASSET_METADATA_F
9
9
  import { PHI_ASSET_FOCAL_RECT_FORM_PROVIDER_DESCRIPTOR, PHI_ASSET_MEDIA_ASSET_FORM_PROVIDER_DESCRIPTOR, } from "./form-providers";
10
10
  import { PHI_MEDIA_SETTINGS_FORM_HANDLER_PROVIDER_DESCRIPTOR, PHI_MEDIA_STORAGE_SETTINGS_FORM_HANDLER_PROVIDER_DESCRIPTOR, } from "./settings-forms";
11
11
  export const PHI_ASSET_RUNTIME_MODULE_DEFINITION = {
12
- moduleId: PHI_ASSET_RUNTIME_MODULE_ID,
12
+ ...PHI_ASSET_RUNTIME_MODULE_IDENTITY,
13
13
  kind: "module",
14
+ // Part of the platform: every image picker in every Area opens this library. No Site selects it.
15
+ activation: "always",
14
16
  eligibleAreas: PHI_CMS_AREA_KEYS,
15
17
  serverBinding: PHI_CORE_SERVER_BINDING,
16
18
  controllerType: PHI_ASSET_CONTROLLER_TYPE,
@@ -19,7 +21,13 @@ export const PHI_ASSET_RUNTIME_MODULE_DEFINITION = {
19
21
  description: "Media, upload, asset picking, and asset-backed data orchestration.",
20
22
  category: "media",
21
23
  iconFamily: "media",
22
- controllerMountPolicy: "area",
24
+ /*
25
+ * On demand, because the Module is active everywhere: a Page that draws no Media mounts nothing for
26
+ * it. A Widget that draws the Controller's state, or whose placement routes to it, asks for it
27
+ * (`components/media/asset-controller-requirement.ts`), and the Media Page states it in its tree. A
28
+ * picker opened from authoring chrome sends it nothing.
29
+ */
30
+ controllerMountPolicy: "demand",
23
31
  dataProviders: PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS,
24
32
  // Its own card, declared like anybody else's would be: what a Site picks from is one list, and the
25
33
  // renderer a provider ships is in it under its own name rather than as an unnamed default.
@@ -1,4 +1,12 @@
1
1
  export declare const PHI_ASSET_RUNTIME_MODULE_ID: "@phis/ui/modules/asset";
2
+ /**
3
+ * The Module's identity as its Label Sets inherit it (`definePhiRuntimeModuleLabelSet`): the id and,
4
+ * where a Module declares one, its source locale. Stated here beside the id and spread into the
5
+ * definition, so a Label Set a tree or a form reads does not import the definition that imports the tree.
6
+ */
7
+ export declare const PHI_ASSET_RUNTIME_MODULE_IDENTITY: {
8
+ readonly moduleId: "@phis/ui/modules/asset";
9
+ };
2
10
  /**
3
11
  * The Module's own view of the two keys it answers. The names themselves are a Foundation contract, so
4
12
  * a Widget outside this Module cites those and never this file; these aliases exist because a Module
@@ -2,6 +2,14 @@ import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
2
2
  import { createPhiSharedRuntimeDataProviderKey } from "../../../constants/runtime-data-provider-key";
3
3
  import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS, PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY, } from "../../../constants/media-library-provider-keys";
4
4
  export const PHI_ASSET_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/asset`;
5
+ /**
6
+ * The Module's identity as its Label Sets inherit it (`definePhiRuntimeModuleLabelSet`): the id and,
7
+ * where a Module declares one, its source locale. Stated here beside the id and spread into the
8
+ * definition, so a Label Set a tree or a form reads does not import the definition that imports the tree.
9
+ */
10
+ export const PHI_ASSET_RUNTIME_MODULE_IDENTITY = {
11
+ moduleId: PHI_ASSET_RUNTIME_MODULE_ID,
12
+ };
5
13
  /**
6
14
  * The Module's own view of the two keys it answers. The names themselves are a Foundation contract, so
7
15
  * a Widget outside this Module cites those and never this file; these aliases exist because a Module
@@ -0,0 +1,4 @@
1
+ import "server-only";
2
+ import { type PhiGlobalTranslatorOptions } from "../../../gateway/tr";
3
+ import { type PhiAssetModuleLabels } from "../../../components/media/media-widget-labels";
4
+ export declare function getPhiAssetModuleLabels(options: PhiGlobalTranslatorOptions): Promise<PhiAssetModuleLabels>;
@@ -0,0 +1,94 @@
1
+ import "server-only";
2
+ import { PHI_TR_CTX_WEB_UI_LABEL } from "../../../gateway/tr";
3
+ import { definePhiRuntimeModuleLabelSet, definePhiMessageLabel, getPhiLabelSet } from "../../../gateway/label-set";
4
+ import { PHI_ASSET_MODULE_DEFAULT_LABELS, } from "../../../components/media/media-widget-labels";
5
+ import { PHI_ASSET_RUNTIME_MODULE_IDENTITY } from "./ids";
6
+ /**
7
+ * What the Asset Module's own surfaces say: the Inspector's sections (titles, variants, the public URL and
8
+ * the rest of an Asset's facts) and the metadata editor (the metadata form, the focal rect and the folder
9
+ * create form).
10
+ *
11
+ * The Foundation owns the types and the English defaults (`components/media/media-widget-labels.ts`)
12
+ * because Foundation components draw them; the set that translates them is the Module's. What Core's
13
+ * collection view also reads -- the toolbar's words and the four flag words -- is the Foundation's
14
+ * `widget:media`, which this Module reads like any other reader.
15
+ */
16
+ const PHI_ASSET_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_ASSET_RUNTIME_MODULE_IDENTITY, {
17
+ key: "widget:asset",
18
+ ctx: PHI_TR_CTX_WEB_UI_LABEL,
19
+ labels: {
20
+ inspector_inspector_title: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.inspectorTitle,
21
+ inspector_preview_title: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.previewTitle,
22
+ inspector_metadata_title: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.metadataTitle,
23
+ inspector_variants_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.variantsLabel,
24
+ inspector_original_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.originalVariantLabel,
25
+ inspector_thumbnail_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.thumbnailVariantLabel,
26
+ inspector_preview_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.previewVariantLabel,
27
+ inspector_banner_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.bannerVariantLabel,
28
+ inspector_header_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.headerVariantLabel,
29
+ inspector_card_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.cardVariantLabel,
30
+ inspector_hero_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.heroVariantLabel,
31
+ inspector_avatar_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.avatarVariantLabel,
32
+ inspector_logo_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.logoVariantLabel,
33
+ inspector_landscape_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.landscapeVariantLabel,
34
+ inspector_portrait_variant_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.portraitVariantLabel,
35
+ inspector_public_url_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.publicUrlLabel,
36
+ inspector_content_type_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.contentTypeLabel,
37
+ inspector_original_name_label: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.originalNameLabel,
38
+ inspector_copy_label_template: PHI_ASSET_MODULE_DEFAULT_LABELS.inspector.copyLabelTemplate,
39
+ editor_title_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.titleLabel,
40
+ editor_alt_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.altLabel,
41
+ editor_folder_path_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.folderPathLabel,
42
+ editor_folder_path_placeholder: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.folderPathPlaceholder,
43
+ editor_create_folder_title: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.createFolderTitle,
44
+ editor_folder_name_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.folderNameLabel,
45
+ editor_folder_name_placeholder: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.folderNamePlaceholder,
46
+ editor_folder_name_required: definePhiMessageLabel(PHI_ASSET_MODULE_DEFAULT_LABELS.editor.folderNameRequired),
47
+ editor_parent_folder_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.parentFolderLabel,
48
+ editor_top_level_folder_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.topLevelFolderLabel,
49
+ editor_flags_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.flagsLabel,
50
+ editor_focal_rect_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.focalRectLabel,
51
+ editor_focal_rect_button_label: PHI_ASSET_MODULE_DEFAULT_LABELS.editor.focalRectButtonLabel,
52
+ },
53
+ });
54
+ export async function getPhiAssetModuleLabels(options) {
55
+ const labels = await getPhiLabelSet(options, PHI_ASSET_LABEL_SET);
56
+ return {
57
+ inspector: {
58
+ inspectorTitle: labels.inspector_inspector_title,
59
+ previewTitle: labels.inspector_preview_title,
60
+ metadataTitle: labels.inspector_metadata_title,
61
+ variantsLabel: labels.inspector_variants_label,
62
+ originalVariantLabel: labels.inspector_original_variant_label,
63
+ thumbnailVariantLabel: labels.inspector_thumbnail_variant_label,
64
+ previewVariantLabel: labels.inspector_preview_variant_label,
65
+ bannerVariantLabel: labels.inspector_banner_variant_label,
66
+ headerVariantLabel: labels.inspector_header_variant_label,
67
+ cardVariantLabel: labels.inspector_card_variant_label,
68
+ heroVariantLabel: labels.inspector_hero_variant_label,
69
+ avatarVariantLabel: labels.inspector_avatar_variant_label,
70
+ logoVariantLabel: labels.inspector_logo_variant_label,
71
+ landscapeVariantLabel: labels.inspector_landscape_variant_label,
72
+ portraitVariantLabel: labels.inspector_portrait_variant_label,
73
+ publicUrlLabel: labels.inspector_public_url_label,
74
+ contentTypeLabel: labels.inspector_content_type_label,
75
+ originalNameLabel: labels.inspector_original_name_label,
76
+ copyLabelTemplate: labels.inspector_copy_label_template,
77
+ },
78
+ editor: {
79
+ titleLabel: labels.editor_title_label,
80
+ altLabel: labels.editor_alt_label,
81
+ folderPathLabel: labels.editor_folder_path_label,
82
+ folderPathPlaceholder: labels.editor_folder_path_placeholder,
83
+ createFolderTitle: labels.editor_create_folder_title,
84
+ folderNameLabel: labels.editor_folder_name_label,
85
+ folderNamePlaceholder: labels.editor_folder_name_placeholder,
86
+ folderNameRequired: labels.editor_folder_name_required,
87
+ parentFolderLabel: labels.editor_parent_folder_label,
88
+ topLevelFolderLabel: labels.editor_top_level_folder_label,
89
+ flagsLabel: labels.editor_flags_label,
90
+ focalRectLabel: labels.editor_focal_rect_label,
91
+ focalRectButtonLabel: labels.editor_focal_rect_button_label,
92
+ },
93
+ };
94
+ }
@@ -4,6 +4,7 @@ import { useMemo } from "react";
4
4
  import { PhiButtonControl } from "../../../components/controls/phi-button-control";
5
5
  import { PhiFlexControl } from "../../../components/controls/phi-flex-control";
6
6
  import { PhiMediaAssetTileControl } from "../../../components/controls/phi-media-asset-tile-control";
7
+ import { PHI_FORM_MEDIA_ASSET_PICKER_LABEL_KEYS } from "../../../components/forms/media-asset-field-keys";
7
8
  import { PhiMediaPickerControl } from "../../../components/controls/phi-media-picker-control";
8
9
  import { PhiTypographyControl } from "../../../components/controls/phi-typography-control";
9
10
  import { PHI_MEDIA_WIDGET_DEFAULT_LABELS } from "../../../components/media/media-widget-labels";
@@ -47,13 +48,37 @@ export const PhiMediaAssetFormControl = ({ field, value, labels, disabled, readO
47
48
  const read = (key) => labels?.[PHI_FORM_MEDIA_ASSET_LABEL_KEYS[key]]?.trim() || DEFAULT_LABELS[key];
48
49
  const choose = read("choose");
49
50
  const change = read("change");
50
- const pickerLabels = useMemo(() => ({
51
- ...PHI_MEDIA_WIDGET_DEFAULT_LABELS,
52
- picker: {
53
- ...PHI_MEDIA_WIDGET_DEFAULT_LABELS.picker,
54
- triggerLabel: assetId == null ? choose : change,
55
- },
56
- }), [assetId, change, choose]);
51
+ // The picker's words come from the Media Label Set, which the Form Widget read for this Form
52
+ // (`resolvePhiFormFieldLabels`); outside a Form that read them, the English defaults stand.
53
+ const pickerLabels = useMemo(() => {
54
+ const keys = PHI_FORM_MEDIA_ASSET_PICKER_LABEL_KEYS;
55
+ const readPicker = (key, fallback) => labels?.[keys[key]]?.trim() || fallback;
56
+ const base = PHI_MEDIA_WIDGET_DEFAULT_LABELS;
57
+ return {
58
+ ...base,
59
+ tool: {
60
+ ...base.tool,
61
+ searchPlaceholder: readPicker("searchPlaceholder", base.tool.searchPlaceholder),
62
+ folderLabel: readPicker("folderLabel", base.tool.folderLabel),
63
+ reloadLabel: readPicker("reloadLabel", base.tool.reloadLabel),
64
+ },
65
+ picker: {
66
+ ...base.picker,
67
+ triggerLabel: assetId == null ? choose : change,
68
+ popoverTitle: readPicker("popoverTitle", base.picker.popoverTitle),
69
+ emptyDescription: readPicker("emptyDescription", base.picker.emptyDescription),
70
+ loadFailedDescription: readPicker("loadFailedDescription", base.picker.loadFailedDescription),
71
+ clearLabel: readPicker("clearLabel", base.picker.clearLabel),
72
+ tileSizeLabel: readPicker("tileSizeLabel", base.picker.tileSizeLabel),
73
+ sourceLabel: readPicker("sourceLabel", base.picker.sourceLabel),
74
+ sourceFailedText: readPicker("sourceFailedText", base.picker.sourceFailedText),
75
+ importingLabel: readPicker("importingLabel", base.picker.importingLabel),
76
+ importFailedText: readPicker("importFailedText", base.picker.importFailedText),
77
+ loadMoreLabel: readPicker("loadMoreLabel", base.picker.loadMoreLabel),
78
+ },
79
+ space: { ...base.space, label: readPicker("spaceLabel", base.space.label) },
80
+ };
81
+ }, [assetId, change, choose, labels]);
57
82
  const picker = usePhiMediaPickerBinding({
58
83
  config: {
59
84
  mediaType: config.mediaType,
@@ -109,28 +109,37 @@ export const PHI_ASSET_FOLDER_FORM_DESCRIPTOR = {
109
109
  },
110
110
  };
111
111
  async function loadAssetFormLabels(context) {
112
- const { getPhiMediaWidgetLabels } = await import("../../../components/media/label-sets/media");
113
- const labels = await getPhiMediaWidgetLabels({
112
+ const [{ getPhiMediaWidgetLabels }, { getPhiAssetModuleLabels }] = await Promise.all([
113
+ import("../../../components/media/label-sets/media"),
114
+ import("./labels"),
115
+ ]);
116
+ const options = {
114
117
  apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
115
118
  internalToken: readPhiServerApiCredentials().internalToken,
116
119
  locale: context.runtime.locale.current,
117
- });
120
+ };
121
+ // The editor's own words are this Module's; the four flag words are the Foundation's, because Core's
122
+ // toolbar flag filter says the same ones.
123
+ const [{ editor }, { tool }] = await Promise.all([
124
+ getPhiAssetModuleLabels(options),
125
+ getPhiMediaWidgetLabels(options),
126
+ ]);
118
127
  return flattenPhiFormLabels({
119
- folderPathLabel: labels.editor.folderPathLabel,
120
- folderPathPlaceholder: labels.editor.folderPathPlaceholder,
121
- titleLabel: labels.editor.titleLabel,
122
- altLabel: labels.editor.altLabel,
123
- flagsLabel: labels.editor.flagsLabel,
124
- focalRectLabel: labels.editor.focalRectLabel,
125
- folderNameLabel: labels.editor.folderNameLabel,
126
- folderNamePlaceholder: labels.editor.folderNamePlaceholder,
127
- folderNameRequired: labels.editor.folderNameRequired,
128
- parentFolderLabel: labels.editor.parentFolderLabel,
129
- topLevelFolderLabel: labels.editor.topLevelFolderLabel,
130
- featuredFlagLabel: labels.editor.featuredFlagLabel,
131
- lockedFlagLabel: labels.editor.lockedFlagLabel,
132
- maskFlagLabel: labels.editor.maskFlagLabel,
133
- backgroundFlagLabel: labels.editor.backgroundFlagLabel,
128
+ folderPathLabel: editor.folderPathLabel,
129
+ folderPathPlaceholder: editor.folderPathPlaceholder,
130
+ titleLabel: editor.titleLabel,
131
+ altLabel: editor.altLabel,
132
+ flagsLabel: editor.flagsLabel,
133
+ focalRectLabel: editor.focalRectLabel,
134
+ folderNameLabel: editor.folderNameLabel,
135
+ folderNamePlaceholder: editor.folderNamePlaceholder,
136
+ folderNameRequired: editor.folderNameRequired,
137
+ parentFolderLabel: editor.parentFolderLabel,
138
+ topLevelFolderLabel: editor.topLevelFolderLabel,
139
+ featuredFlagLabel: tool.featuredFlagLabel,
140
+ lockedFlagLabel: tool.lockedFlagLabel,
141
+ maskFlagLabel: tool.maskFlagLabel,
142
+ backgroundFlagLabel: tool.backgroundFlagLabel,
134
143
  });
135
144
  }
136
145
  export const PHI_ASSET_METADATA_RUNTIME_MODULE_FORM = definePhiRuntimeModuleForm({