@phis/ui 0.5.3 → 0.5.5

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 (211) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +17 -7
  2. package/components/controls/phi-cascader-control.d.ts +9 -1
  3. package/components/controls/phi-cascader-control.js +25 -3
  4. package/components/controls/phi-money-control.d.ts +39 -0
  5. package/components/controls/phi-money-control.js +34 -0
  6. package/components/controls/phi-number-control.d.ts +6 -1
  7. package/components/controls/phi-number-control.js +3 -3
  8. package/components/controls/phi-options-provider.d.ts +7 -0
  9. package/components/controls/phi-options-provider.js +11 -0
  10. package/components/forms/extended-form-field-controls.d.ts +1 -0
  11. package/components/forms/extended-form-field-controls.js +23 -1
  12. package/components/forms/form-descriptor-runtime-client.js +13 -0
  13. package/components/forms/form-provider-contract.d.ts +43 -0
  14. package/components/forms/form-provider-contract.js +40 -0
  15. package/components/forms/money-field.d.ts +27 -0
  16. package/components/forms/money-field.js +78 -0
  17. package/components/forms/shared-form-provider-registry.js +4 -0
  18. package/components/layouts/clients/phi-flex-layout-client.js +17 -2
  19. package/components/layouts/clients/phi-layout-anchored-overlay.d.ts +2 -0
  20. package/components/layouts/clients/phi-layout-anchored-overlay.js +2 -0
  21. package/components/media/phi-media-picker-binding.js +6 -1
  22. package/components/media/phi-site-font-assets.js +6 -1
  23. package/components/motion/phi-sequence-run.d.ts +14 -1
  24. package/components/motion/phi-sequence-run.js +22 -3
  25. package/components/motion/phi-sequence-viewport.js +3 -1
  26. package/components/regions/presets/content-entry-editor-page-tree.js +5 -1
  27. package/components/regions/presets/content-entry-public-page-trees.js +2 -0
  28. package/components/tables/client/phi-table-binding.js +16 -3
  29. package/components/trees/client/phi-tree-binding.js +6 -2
  30. package/components/widgets/builder/stack-tabs.d.ts +2 -1
  31. package/components/widgets/builder/stack-tabs.js +18 -2
  32. package/components/widgets/client/shared/phi-collection-view-binding.js +10 -2
  33. package/components/widgets/client/shared/phi-rendered-value.d.ts +9 -1
  34. package/components/widgets/client/shared/phi-rendered-value.js +20 -1
  35. package/components/widgets/config/choice-shared.d.ts +1 -49
  36. package/components/widgets/config/choice-shared.js +0 -1
  37. package/components/widgets/config/stack-tabs.js +4 -3
  38. package/components/widgets/label-sets/gallery.js +6 -0
  39. package/components/widgets/label-sets/interval.d.ts +4 -0
  40. package/components/widgets/label-sets/interval.js +31 -0
  41. package/components/widgets/label-sets/record.js +6 -1
  42. package/components/widgets/label-sets/slot-upload.d.ts +4 -0
  43. package/components/widgets/label-sets/slot-upload.js +36 -0
  44. package/components/widgets/label-sets/table.js +6 -1
  45. package/components/widgets/label-types/gallery.d.ts +7 -0
  46. package/components/widgets/label-types/gallery.js +6 -0
  47. package/components/widgets/label-types/interval.d.ts +16 -0
  48. package/components/widgets/label-types/interval.js +21 -0
  49. package/components/widgets/label-types/record.d.ts +3 -0
  50. package/components/widgets/label-types/record.js +2 -0
  51. package/components/widgets/label-types/slot-upload.d.ts +24 -0
  52. package/components/widgets/label-types/slot-upload.js +16 -0
  53. package/components/widgets/label-types/table.d.ts +3 -0
  54. package/components/widgets/label-types/table.js +2 -0
  55. package/constants/record-field-kinds.d.ts +1 -1
  56. package/constants/record-field-kinds.js +1 -1
  57. package/constants/runtime-module-ownership.js +1 -0
  58. package/controls.d.ts +7 -0
  59. package/controls.js +4 -0
  60. package/helpers/cms-dialog.d.ts +39 -3
  61. package/helpers/cms-dialog.js +46 -4
  62. package/helpers/cms-page-catalog.d.ts +8 -0
  63. package/helpers/cms-page-catalog.js +18 -2
  64. package/helpers/cms-preset-nodes.d.ts +13 -3
  65. package/helpers/cms-preset-nodes.js +3 -2
  66. package/helpers/config-text-fields.d.ts +49 -0
  67. package/helpers/config-text-fields.js +122 -0
  68. package/helpers/money-amount.d.ts +48 -0
  69. package/helpers/money-amount.js +131 -0
  70. package/helpers/page-layout-check.js +15 -2
  71. package/helpers/preset-text-source-check.d.ts +22 -0
  72. package/helpers/preset-text-source-check.js +45 -0
  73. package/helpers/record-fields.d.ts +18 -5
  74. package/helpers/record-fields.js +38 -13
  75. package/helpers/text-source.d.ts +14 -5
  76. package/helpers/text-source.js +16 -3
  77. package/module-page-check.d.ts +1 -0
  78. package/module-page-check.js +1 -0
  79. package/module-records.d.ts +6 -3
  80. package/module-records.js +4 -2
  81. package/package.json +2 -2
  82. package/plugins/runtime/phi-slot-child-frame-view.js +1 -1
  83. package/plugins/runtime/slot-size-policy.d.ts +8 -2
  84. package/plugins/runtime/slot-size-policy.js +51 -16
  85. package/plugins/runtime-modules/accounting/module.d.ts +1 -1
  86. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-page-tree.js +2 -0
  87. package/plugins/runtime-modules/app/module.d.ts +1 -1
  88. package/plugins/runtime-modules/asset/services/collection.js +1 -0
  89. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -2
  90. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +3 -0
  91. package/plugins/runtime-modules/builder/clients/widget-inspector.js +2 -2
  92. package/plugins/runtime-modules/builder/offered-page-catalog.js +3 -3
  93. package/plugins/runtime-modules/builder/options-providers.js +7 -0
  94. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -0
  95. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +17 -3
  96. package/plugins/runtime-modules/contracts.d.ts +1 -1
  97. package/plugins/runtime-modules/core/definition.d.ts +43 -0
  98. package/plugins/runtime-modules/core/form-providers.d.ts +43 -0
  99. package/plugins/runtime-modules/core/widgets/breadcrumb/client.d.ts +6 -3
  100. package/plugins/runtime-modules/core/widgets/breadcrumb/client.js +6 -5
  101. package/plugins/runtime-modules/core/widgets/breadcrumb/plugin.js +1 -1
  102. package/plugins/runtime-modules/core/widgets/breadcrumb/server.d.ts +9 -1
  103. package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +29 -3
  104. package/plugins/runtime-modules/core/widgets/button/config.d.ts +0 -1
  105. package/plugins/runtime-modules/core/widgets/button/config.js +0 -1
  106. package/plugins/runtime-modules/core/widgets/button/plugin.js +6 -25
  107. package/plugins/runtime-modules/core/widgets/card/config.d.ts +18 -2
  108. package/plugins/runtime-modules/core/widgets/card/config.js +16 -1
  109. package/plugins/runtime-modules/core/widgets/card/plugin.js +8 -10
  110. package/plugins/runtime-modules/core/widgets/card/server.d.ts +1 -2
  111. package/plugins/runtime-modules/core/widgets/card/server.js +16 -28
  112. package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +4 -3
  113. package/plugins/runtime-modules/core/widgets/cascader/client.js +1 -1
  114. package/plugins/runtime-modules/core/widgets/cascader/config.d.ts +8 -2
  115. package/plugins/runtime-modules/core/widgets/cascader/config.js +22 -0
  116. package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +8 -2
  117. package/plugins/runtime-modules/core/widgets/checkbox-group/config.js +1 -1
  118. package/plugins/runtime-modules/core/widgets/description/config.d.ts +2 -1
  119. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +2 -2
  120. package/plugins/runtime-modules/core/widgets/entry-list/config.js +0 -1
  121. package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -3
  122. package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +1 -3
  123. package/plugins/runtime-modules/core/widgets/entry-list/server.js +3 -3
  124. package/plugins/runtime-modules/core/widgets/gallery/authoring.js +12 -3
  125. package/plugins/runtime-modules/core/widgets/gallery/client.js +10 -1
  126. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +4 -1
  127. package/plugins/runtime-modules/core/widgets/gallery/config.js +8 -0
  128. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  129. package/plugins/runtime-modules/core/widgets/image/server.js +5 -9
  130. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +2 -1
  131. package/plugins/runtime-modules/core/widgets/markdown-toc/server.js +3 -5
  132. package/plugins/runtime-modules/core/widgets/multi-select/config.d.ts +1 -1
  133. package/plugins/runtime-modules/core/widgets/quick-links/plugin.js +2 -4
  134. package/plugins/runtime-modules/core/widgets/quick-links/server.d.ts +2 -5
  135. package/plugins/runtime-modules/core/widgets/quick-links/server.js +2 -6
  136. package/plugins/runtime-modules/core/widgets/record/client.js +8 -2
  137. package/plugins/runtime-modules/core/widgets/record/config.js +4 -0
  138. package/plugins/runtime-modules/core/widgets/result/config.d.ts +2 -2
  139. package/plugins/runtime-modules/core/widgets/result/config.js +0 -1
  140. package/plugins/runtime-modules/core/widgets/result/plugin.js +2 -4
  141. package/plugins/runtime-modules/core/widgets/result/server.d.ts +2 -3
  142. package/plugins/runtime-modules/core/widgets/result/server.js +11 -33
  143. package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +1 -1
  144. package/plugins/runtime-modules/core/widgets/select-box/config.d.ts +1 -1
  145. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +2 -1
  146. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +1 -1
  147. package/plugins/runtime-modules/core/widgets/slider/config.d.ts +11 -0
  148. package/plugins/runtime-modules/core/widgets/slider/config.js +1 -1
  149. package/plugins/runtime-modules/core/widgets/slot-upload/authoring.js +2 -1
  150. package/plugins/runtime-modules/core/widgets/slot-upload/client.d.ts +3 -1
  151. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +45 -24
  152. package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +11 -4
  153. package/plugins/runtime-modules/core/widgets/slot-upload/config.js +16 -1
  154. package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +2 -2
  155. package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +8 -3
  156. package/plugins/runtime-modules/core/widgets/slot-upload/server.js +9 -3
  157. package/plugins/runtime-modules/core/widgets/spacer/config.d.ts +1 -1
  158. package/plugins/runtime-modules/core/widgets/spacer/config.js +1 -1
  159. package/plugins/runtime-modules/core/widgets/steps/config.d.ts +8 -3
  160. package/plugins/runtime-modules/core/widgets/steps/config.js +1 -2
  161. package/plugins/runtime-modules/core/widgets/steps/plugin.js +6 -30
  162. package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
  163. package/plugins/runtime-modules/core/widgets/table/config.d.ts +6 -3
  164. package/plugins/runtime-modules/core/widgets/table/config.js +4 -1
  165. package/plugins/runtime-modules/core/widgets/timeline/config.d.ts +8 -1
  166. package/plugins/runtime-modules/core/widgets/timeline/config.js +1 -2
  167. package/plugins/runtime-modules/core/widgets/timeline/plugin.js +6 -37
  168. package/plugins/runtime-modules/descriptor-compiler.d.ts +11 -1
  169. package/plugins/runtime-modules/descriptor-compiler.js +49 -8
  170. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  171. package/plugins/runtime-modules/groups/forms.d.ts +18 -0
  172. package/plugins/runtime-modules/groups/forms.js +2 -2
  173. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +8 -4
  174. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +2 -0
  175. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +3 -0
  176. package/plugins/runtime-modules/page-preset-overlays.d.ts +18 -0
  177. package/plugins/runtime-modules/page-preset-overlays.js +70 -0
  178. package/plugins/runtime-modules/public/module.d.ts +1 -1
  179. package/plugins/runtime-modules/public/trees/phi-default-pub-welcome-page-tree.js +1 -0
  180. package/plugins/runtime-modules/resolver.js +5 -0
  181. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +5 -2
  182. package/plugins/runtime-modules/search/widgets/search-box/server.js +3 -5
  183. package/plugins/runtime-modules/search/widgets/search-results/server.js +3 -5
  184. package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +4 -0
  185. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +6 -2
  186. package/plugins/runtime-modules/user-management/controller/client.js +6 -1
  187. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -3
  188. package/runtime-render-client.d.ts +1 -1
  189. package/runtime-render-client.js +2 -1
  190. package/server-helpers/cms-page-record.d.ts +2 -2
  191. package/server-helpers/cms-page-record.js +15 -5
  192. package/server-helpers/cms-request.js +34 -12
  193. package/server-helpers/cms-widget-texts.d.ts +14 -0
  194. package/server-helpers/cms-widget-texts.js +117 -0
  195. package/server-helpers/record-fields.d.ts +1 -1
  196. package/server-helpers/record-fields.js +1 -2
  197. package/server-helpers/record-samples.d.ts +4 -4
  198. package/server-helpers/record-samples.js +10 -2
  199. package/server-helpers/search-index.js +12 -3
  200. package/styles/root.css +6 -2
  201. package/types/cms-module-descriptors.d.ts +3 -0
  202. package/types/cms-plugins.d.ts +38 -5
  203. package/types/collection-provider.d.ts +7 -0
  204. package/types/core-widget-placements.d.ts +37 -0
  205. package/types/record-provider.d.ts +19 -3
  206. package/types/slot-size-policy.d.ts +19 -2
  207. package/types/table-widget.d.ts +33 -1
  208. package/types/table-widget.js +1 -0
  209. package/types/tree-widget.d.ts +7 -0
  210. package/types/widget-runtime.d.ts +1 -1
  211. package/types.d.ts +1 -0
@@ -1,4 +1,5 @@
1
1
  import { type PhiCmsAreaKey } from "../../constants/cms-areas";
2
+ import type { PhiFormDescriptor } from "@phis/contracts/forms";
2
3
  import { type PhiCmsInstanceId } from "../../types/cms-instance-id";
3
4
  import type { PhiThemeFontsBlock, PhiThemeGroundBlock, PhiThemeSetBlock, PhiThemeStyleBlock } from "../../theme/phi-theme-blocks";
4
5
  import type { PhiCmsActiveRouteTable, PhiCmsAreaDefinition, PhiCmsAreaShellPresetBinding, PhiCmsCompiledDescriptorCatalog, PhiCmsCompiledRoutePattern, PhiCmsNavigationOverlay, PhiCmsNavigationOverlayResolution, PhiCmsResolvedNavigationSurface, PhiCmsRoutePresetBinding, PhiCmsRoutePresetDescriptor, PhiCmsCompiledThemeDescriptors, PhiCmsThemeDescriptorContribution, PhiCmsThemePresetBinding, PhiRuntimeModuleId } from "../../types/cms-module-descriptors";
@@ -78,7 +79,15 @@ export declare function instantiatePhiCmsThemeBlocks(catalog: PhiCmsCompiledThem
78
79
  fonts: PhiThemeFontsBlock[];
79
80
  sets: PhiThemeSetBlock[];
80
81
  }>;
81
- export declare function assertPhiCmsPresetTreeContract(tree: PhiResolvedCmsPageTree, expectedPage?: PhiCmsPageNode): void;
82
+ /** What the tree contract reads of a Form a Module ships: its descriptor, for a dialog's width. */
83
+ type PhiCmsPresetTreeForm = {
84
+ descriptor: PhiFormDescriptor;
85
+ };
86
+ /**
87
+ * `forms` are the Forms the compiler can see -- the ones the catalog's Modules ship, by id. A Form it
88
+ * cannot see (one stored on the Site, one of a Module outside the catalog) is not judged.
89
+ */
90
+ export declare function assertPhiCmsPresetTreeContract(tree: PhiResolvedCmsPageTree, expectedPage?: PhiCmsPageNode, forms?: ReadonlyMap<string, PhiCmsPresetTreeForm>): void;
82
91
  export declare function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, activeModuleIds, siteId, area, path, runtime, }: {
83
92
  tree: PhiResolvedCmsAreaPresetTree;
84
93
  catalog: PhiCmsCompiledDescriptorCatalog;
@@ -104,3 +113,4 @@ export declare function instantiatePhiCmsRoutePreset({ binding, catalog, activeM
104
113
  runtime: PhiBlockRuntime;
105
114
  resolveMissingPageTitle?: (sourceTitle: string) => string | Promise<string>;
106
115
  }): Promise<PhiResolvedCmsPageTree>;
116
+ export {};
@@ -9,7 +9,7 @@ import { mergePhiCmsShellTrees, omitPhiCmsShellCompositionNodes, } from "./shell
9
9
  import { resolvePhiRuntimeModuleAreaRoutePath } from "../../helpers/runtime-module-route-path";
10
10
  import { choosePhiAreaRootApplicant, orderPhiAreaPathClaimsByCover, isPhiAssignablePublicRoutePath, } from "../../helpers/cms-area-config";
11
11
  import { resolvePhiLayoutCreationPreset } from "../../helpers/cms-layout-defaults";
12
- import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, } from "../../helpers/cms-dialog";
12
+ import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH, isPhiFormSingleColumn, } from "../../helpers/cms-dialog";
13
13
  import { PhiCmsWidgetType } from "../../constants/cms-widget-types";
14
14
  import { buildPhiBasePageLayoutNode, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "../../components/regions/presets/phi-base-page-layout";
15
15
  import { concatPhiCmsTreeControllerSettings } from "../../helpers/cms-tree-controller-settings";
@@ -263,8 +263,12 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
263
263
  const themeByKey = new Map();
264
264
  const themeBlockByKey = new Map();
265
265
  const sourceLocaleByModuleId = new Map();
266
+ const formDefinitionsById = new Map();
266
267
  for (const [moduleId, entry] of catalog) {
267
268
  sourceLocaleByModuleId.set(moduleId, resolvePhiRuntimeModuleSourceLocale(entry.definition));
269
+ for (const form of entry.forms ?? []) {
270
+ formDefinitionsById.set(form.formId, form);
271
+ }
268
272
  const descriptorKeys = new Set();
269
273
  const registerIdentity = (presetKey) => {
270
274
  normalizeRequiredKey(presetKey, `${moduleId} preset key`);
@@ -621,6 +625,7 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
621
625
  themeByKey,
622
626
  themeBlockByKey,
623
627
  sourceLocaleByModuleId,
628
+ formDefinitionsById,
624
629
  };
625
630
  }
626
631
  const descriptorCatalogByRuntimeCatalog = new WeakMap();
@@ -1415,7 +1420,11 @@ function assertPhiCmsBasePageLayoutNode(tree, layoutsById) {
1415
1420
  `${stablePresetNodeJson(node[mismatch])}, canonical is ${stablePresetNodeJson(canonical[mismatch])}.`);
1416
1421
  }
1417
1422
  }
1418
- export function assertPhiCmsPresetTreeContract(tree, expectedPage) {
1423
+ /**
1424
+ * `forms` are the Forms the compiler can see -- the ones the catalog's Modules ship, by id. A Form it
1425
+ * cannot see (one stored on the Site, one of a Module outside the catalog) is not judged.
1426
+ */
1427
+ export function assertPhiCmsPresetTreeContract(tree, expectedPage, forms) {
1419
1428
  const layoutIds = new Set();
1420
1429
  const allIds = new Set();
1421
1430
  if (expectedPage &&
@@ -1503,6 +1512,8 @@ export function assertPhiCmsPresetTreeContract(tree, expectedPage) {
1503
1512
  for (const overlay of tree.overlays) {
1504
1513
  if (overlay.overlayType === "modal") {
1505
1514
  assertPhiCmsDialogBody(overlay.id, layoutsById.get(overlay.bodyLayoutNodeId));
1515
+ if (forms)
1516
+ assertPhiCmsDialogWidth(overlay, tree, forms);
1506
1517
  }
1507
1518
  }
1508
1519
  for (const rootLayoutNodeId of [
@@ -1518,8 +1529,8 @@ export function assertPhiCmsPresetTreeContract(tree, expectedPage) {
1518
1529
  }
1519
1530
  }
1520
1531
  }
1521
- function assertPhiCmsAreaOverlayTree(descriptor, tree, page) {
1522
- assertPhiCmsPresetTreeContract(tree, page);
1532
+ function assertPhiCmsAreaOverlayTree(descriptor, tree, page, forms) {
1533
+ assertPhiCmsPresetTreeContract(tree, page, forms);
1523
1534
  if (tree.regions.length > 0) {
1524
1535
  throw new Error(`${descriptor.ownerModuleId}/${descriptor.presetKey}: Area Overlay preset must not contribute Regions.`);
1525
1536
  }
@@ -1553,7 +1564,7 @@ export async function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, act
1553
1564
  const contributions = await Promise.all(descriptors.map((descriptor) => descriptor.loadTree({ page, runtime: targetRuntime, catalog })));
1554
1565
  for (const [index, descriptor] of descriptors.entries()) {
1555
1566
  const contribution = contributions[index];
1556
- assertPhiCmsAreaOverlayTree(descriptor, contribution, page);
1567
+ assertPhiCmsAreaOverlayTree(descriptor, contribution, page, catalog.formDefinitionsById);
1557
1568
  for (const node of [
1558
1569
  ...contribution.overlays,
1559
1570
  ...contribution.layoutNodes,
@@ -1591,13 +1602,13 @@ async function loadShellTree(descriptor, catalog, page, runtime) {
1591
1602
  composedTree = composedTree ? mergePhiCmsShellTrees(composedTree, sourceTree) : sourceTree;
1592
1603
  }
1593
1604
  const ownTree = await descriptor.loadTree({ page, runtime, catalog });
1594
- assertPhiCmsPresetTreeContract(ownTree, page);
1605
+ assertPhiCmsPresetTreeContract(ownTree, page, catalog.formDefinitionsById);
1595
1606
  return composedTree ? mergePhiCmsShellTrees(composedTree, ownTree) : ownTree;
1596
1607
  }
1597
1608
  export async function instantiatePhiCmsAreaShellPreset({ binding, catalog, siteId, path, runtime, }) {
1598
1609
  const page = createSyntheticPresetPage({ siteId, area: binding.descriptor.area, path });
1599
1610
  const tree = await loadShellTree(binding.descriptor, catalog, page, resolveTargetRuntime(runtime, binding.descriptor.area));
1600
- assertPhiCmsPresetTreeContract(tree, page);
1611
+ assertPhiCmsPresetTreeContract(tree, page, catalog.formDefinitionsById);
1601
1612
  return tree;
1602
1613
  }
1603
1614
  export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeModuleIds, siteId, path, runtime, resolveMissingPageTitle, }) {
@@ -1630,7 +1641,7 @@ export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeMod
1630
1641
  description: loadedTree.pageMeta?.description ?? null,
1631
1642
  },
1632
1643
  };
1633
- assertPhiCmsPresetTreeContract(tree, page);
1644
+ assertPhiCmsPresetTreeContract(tree, page, catalog.formDefinitionsById);
1634
1645
  return tree;
1635
1646
  }
1636
1647
  /*
@@ -1662,3 +1673,33 @@ function assertPhiCmsDialogCommands(overlayId, footerLayoutId, widgets) {
1662
1673
  }
1663
1674
  }
1664
1675
  }
1676
+ /*
1677
+ * A dialog is as wide as its Form needs (`helpers/cms-dialog.ts`): one column takes
1678
+ * `PHI_DIALOG_WIDTH_SINGLE_COLUMN`, two keep `PHI_DIALOG_WIDTH`. What is refused is the one width a Preset
1679
+ * did not choose -- the default, holding nothing but Forms of one column. Any other width was stated, by a
1680
+ * caller that knows what else the body holds; a Form the compiler cannot see is not judged.
1681
+ */
1682
+ function assertPhiCmsDialogWidth(overlay, tree, forms) {
1683
+ if (stablePresetNodeJson(overlay.config.width) !== stablePresetNodeJson(PHI_DIALOG_WIDTH))
1684
+ return;
1685
+ const bodyLayoutIds = new Set([overlay.bodyLayoutNodeId]);
1686
+ for (let grown = true; grown;) {
1687
+ grown = false;
1688
+ for (const node of tree.layoutNodes) {
1689
+ if (node.parentLayoutNodeId != null && bodyLayoutIds.has(node.parentLayoutNodeId) && !bodyLayoutIds.has(node.id)) {
1690
+ bodyLayoutIds.add(node.id);
1691
+ grown = true;
1692
+ }
1693
+ }
1694
+ }
1695
+ const formIds = tree.contentWidgets
1696
+ .filter((widget) => widget.widgetType === PhiCmsWidgetType.Form && bodyLayoutIds.has(widget.parentLayoutNodeId))
1697
+ .map((widget) => widget.config.formId);
1698
+ if (formIds.length === 0)
1699
+ return;
1700
+ const descriptors = formIds.map((formId) => (typeof formId === "string" ? forms.get(formId) : undefined)?.descriptor);
1701
+ if (descriptors.every((descriptor) => descriptor != null && isPhiFormSingleColumn(descriptor))) {
1702
+ throw new Error(`Preset Overlay "${overlay.id}" holds the one-column Form "${String(formIds[0])}" at the full dialog width ` +
1703
+ "(PHI_DIALOG_WIDTH). Hand the Form to `dialog` as `body.form`, or state `width: PHI_DIALOG_WIDTH_SINGLE_COLUMN`.");
1704
+ }
1705
+ }
@@ -250,7 +250,7 @@ export declare const PHI_GROUPS_RUNTIME_MODULE_DEFINITION: {
250
250
  iconFamily: string;
251
251
  mediaSpaces: {
252
252
  group: {
253
- kinds: ("image" | "markdown" | "video" | "audio" | "pdf" | "document" | "archive")[];
253
+ kinds: ("image" | "video" | "markdown" | "audio" | "pdf" | "document" | "archive")[];
254
254
  };
255
255
  };
256
256
  threadKinds: ("group" | "crossGroup")[];
@@ -1,8 +1,26 @@
1
+ import type { PhiFormDescriptor } from "../../../types";
1
2
  export declare const PHI_GROUPS_FORM_IDS: {
2
3
  readonly create: `${string}/forms/${string}`;
3
4
  readonly membership: `${string}/forms/${string}`;
4
5
  readonly myMembership: `${string}/forms/${string}`;
5
6
  };
7
+ /**
8
+ * Creating a group is Site administration, not group membership: a group is an authorization unit that
9
+ * Pages, Navigation, and Assets refer to. The Core route this relays to enforces that -- the form only
10
+ * carries the two values a group starts with.
11
+ */
12
+ export declare const PHI_GROUPS_CREATE_FORM_DESCRIPTOR: PhiFormDescriptor;
13
+ /**
14
+ * Writing one membership.
15
+ *
16
+ * Every value is named explicitly, including the group: a Form relays to a fixed path, so it cannot
17
+ * inherit the row a table happens to have selected.
18
+ *
19
+ * This adds a member. Someone already in the group is listed but not selectable here, because the level
20
+ * they already hold is changed in the cell it is read in -- the route accepts either, but a control
21
+ * that means one thing is better than one that quietly means two.
22
+ */
23
+ export declare const PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR: PhiFormDescriptor;
6
24
  export declare const PHI_GROUPS_RUNTIME_MODULE_FORMS: readonly [import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition];
7
25
  export declare const PHI_GROUPS_FORM_HANDLER_PROVIDER_DESCRIPTORS: ({
8
26
  key: `${string}/${string}`;
@@ -23,7 +23,7 @@ const LABEL_SET_KEY = "@phis/ui/modules/groups/labels/forms";
23
23
  * Pages, Navigation, and Assets refer to. The Core route this relays to enforces that -- the form only
24
24
  * carries the two values a group starts with.
25
25
  */
26
- const PHI_GROUPS_CREATE_FORM_DESCRIPTOR = {
26
+ export const PHI_GROUPS_CREATE_FORM_DESCRIPTOR = {
27
27
  schemaVersion: 1,
28
28
  key: PHI_GROUPS_FORM_IDS.create,
29
29
  labelSetKey: LABEL_SET_KEY,
@@ -68,7 +68,7 @@ const PHI_GROUPS_CREATE_FORM_DESCRIPTOR = {
68
68
  * they already hold is changed in the cell it is read in -- the route accepts either, but a control
69
69
  * that means one thing is better than one that quietly means two.
70
70
  */
71
- const PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR = {
71
+ export const PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR = {
72
72
  schemaVersion: 1,
73
73
  key: PHI_GROUPS_FORM_IDS.membership,
74
74
  labelSetKey: LABEL_SET_KEY,
@@ -1,3 +1,4 @@
1
+ import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
1
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
2
3
  import { PhiCmsPageType } from "../../../../constants/phi-cms";
3
4
  import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
@@ -8,7 +9,7 @@ import { PHI_GROUPS_PAGE_LAYOUT_IDS, PHI_GROUPS_PAGE_OVERLAY_IDS, PHI_GROUPS_PAG
8
9
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
9
10
  import { getPhiGroupFormLabels } from "../labels";
10
11
  import { buildPhiGroupMembersTable, buildPhiGroupRetireAction, buildPhiGroupSettingColumns, buildPhiGroupsFooter, } from "./group-tables";
11
- import { PHI_GROUPS_FORM_IDS } from "../forms";
12
+ import { PHI_GROUPS_CREATE_FORM_DESCRIPTOR, PHI_GROUPS_FORM_IDS, PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR, } from "../forms";
12
13
  import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
13
14
  const SYNTHETIC_ADMIN_GROUPS_REGION_IDS = {
14
15
  regionContent: -451,
@@ -44,12 +45,14 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
44
45
  * speak to their receiver directly -- the dialog closes, the Form submits -- so nothing has to relay
45
46
  * them. The Form's success goes to the Controller, which reloads and closes the dialog.
46
47
  */
47
- const dialog = (workflow, ids, text, formId, openActionKey, overlayAddress, formAddress, sortOrder) => {
48
+ const dialog = (workflow, ids, text, formId, descriptor, openActionKey, overlayAddress, formAddress, sortOrder) => {
48
49
  const built = nodes.dialog({
49
50
  id: ids.overlay,
50
51
  bodyLayoutNodeId: ids.body,
51
52
  sortOrder,
52
53
  label: `admin-groups-${workflow}-modal`,
54
+ // The dialog takes the width its Form needs.
55
+ body: { form: { descriptor } },
53
56
  config: {
54
57
  title: text.title,
55
58
  // Opened afresh each time, so a dialog cancelled half filled starts empty again.
@@ -83,6 +86,7 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
83
86
  label: text.submit,
84
87
  config: {
85
88
  key: `admin-groups-${workflow}-commands`,
89
+ textSource: PHI_TEXT_SOURCE_PRESET,
86
90
  buttons: [
87
91
  { key: "cancel", emits: [{ capabilityId: "close", value: null }], label: labels.actions.cancel, icon: "close" },
88
92
  { key: "save", emits: [{ capabilityId: "submit", value: null }], label: text.submit, variant: "primary", icon: "save" },
@@ -174,14 +178,14 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
174
178
  footer: PHI_GROUPS_PAGE_LAYOUT_IDS.layoutCreateFooter,
175
179
  form: PHI_GROUPS_PAGE_WIDGET_IDS.widgetCreateForm,
176
180
  commands: PHI_GROUPS_PAGE_WIDGET_IDS.widgetCreateCommands,
177
- }, { title: labels.create.title, submit: labels.actions.create }, PHI_GROUPS_FORM_IDS.create, "create", createOverlayAddress, createFormAddress, 0);
181
+ }, { title: labels.create.title, submit: labels.actions.create }, PHI_GROUPS_FORM_IDS.create, PHI_GROUPS_CREATE_FORM_DESCRIPTOR, "create", createOverlayAddress, createFormAddress, 0);
178
182
  const membershipDialog = dialog("membership", {
179
183
  overlay: PHI_GROUPS_PAGE_OVERLAY_IDS.overlayMembership,
180
184
  body: PHI_GROUPS_PAGE_LAYOUT_IDS.layoutMembership,
181
185
  footer: PHI_GROUPS_PAGE_LAYOUT_IDS.layoutMembershipFooter,
182
186
  form: PHI_GROUPS_PAGE_WIDGET_IDS.widgetMembershipForm,
183
187
  commands: PHI_GROUPS_PAGE_WIDGET_IDS.widgetMembershipCommands,
184
- }, { title: labels.membership.title, submit: labels.membership.submit }, PHI_GROUPS_FORM_IDS.membership, "addMember", membershipOverlayAddress, membershipFormAddress, 1);
188
+ }, { title: labels.membership.title, submit: labels.membership.submit }, PHI_GROUPS_FORM_IDS.membership, PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR, "addMember", membershipOverlayAddress, membershipFormAddress, 1);
185
189
  return {
186
190
  page: nodes.page({ pageType: PhiCmsPageType.Standard }),
187
191
  pageMeta: {
@@ -1,3 +1,4 @@
1
+ import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
1
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
2
3
  import { PhiCmsPageType } from "../../../../constants/phi-cms";
3
4
  import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
@@ -257,6 +258,7 @@ export async function buildPhiDefaultAppGroupsPageTree({ page, runtime, }) {
257
258
  label: labels.membership.submit,
258
259
  config: {
259
260
  key: "app-groups-membership-commands",
261
+ textSource: PHI_TEXT_SOURCE_PRESET,
260
262
  compact: false,
261
263
  wrap: true,
262
264
  showLabels: true,
@@ -1,3 +1,4 @@
1
+ import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
1
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX, PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS, } from "../../../../constants/cms-layout-types";
2
3
  import { PhiCmsPageType } from "../../../../constants/phi-cms";
3
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
@@ -122,6 +123,7 @@ export async function buildPhiDefaultEditorTranslationsPageTree({ page, runtime,
122
123
  label: "editor source locale",
123
124
  config: {
124
125
  text: sourceLocaleText,
126
+ textSource: PHI_TEXT_SOURCE_PRESET,
125
127
  placeholder: widgetLabels.sourceLocaleLabel,
126
128
  readOnly: true,
127
129
  allowClear: false,
@@ -301,6 +303,7 @@ export async function buildPhiDefaultEditorTranslationsPageTree({ page, runtime,
301
303
  label: "editor translation commands",
302
304
  config: {
303
305
  key: "editor-translation-commands",
306
+ textSource: PHI_TEXT_SOURCE_PRESET,
304
307
  ...PHI_DIALOG_COMMANDS_CONFIG,
305
308
  buttons: [
306
309
  { key: "cancel", emits: [{ capabilityId: "command", value: "cancel" }], label: widgetLabels.actions.cancel, icon: "close" },
@@ -0,0 +1,18 @@
1
+ import type { PhiResolvedCmsPageTree } from "../../types/cms";
2
+ /**
3
+ * Lays the Overlays of a Page preset over a stored Page that answers for it (OVERLAYS.md, "Page
4
+ * preset Overlays").
5
+ *
6
+ * A stored Page holds no copy of an Overlay its preset declares, so the preset's are taken from
7
+ * `presetTree`, the same preset instantiated beside the stored tree: each Overlay, every Layout reachable
8
+ * from its Header, Body and Footer roots, and every Widget under those Layouts, in the preset's order. A
9
+ * stored Overlay with the id of a preset Overlay wins and its preset subtree is left out. Regions, the
10
+ * Page row, Controller settings and every stored node stay as stored; with nothing to take the stored
11
+ * tree itself is returned.
12
+ *
13
+ * The Area precedent is `composePhiCmsActiveAreaOverlayPresets` (descriptor-compiler.ts).
14
+ */
15
+ export declare function composePhiCmsPagePresetOverlays({ tree, presetTree, }: {
16
+ tree: PhiResolvedCmsPageTree;
17
+ presetTree: PhiResolvedCmsPageTree;
18
+ }): PhiResolvedCmsPageTree;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Lays the Overlays of a Page preset over a stored Page that answers for it (OVERLAYS.md, "Page
3
+ * preset Overlays").
4
+ *
5
+ * A stored Page holds no copy of an Overlay its preset declares, so the preset's are taken from
6
+ * `presetTree`, the same preset instantiated beside the stored tree: each Overlay, every Layout reachable
7
+ * from its Header, Body and Footer roots, and every Widget under those Layouts, in the preset's order. A
8
+ * stored Overlay with the id of a preset Overlay wins and its preset subtree is left out. Regions, the
9
+ * Page row, Controller settings and every stored node stay as stored; with nothing to take the stored
10
+ * tree itself is returned.
11
+ *
12
+ * The Area precedent is `composePhiCmsActiveAreaOverlayPresets` (descriptor-compiler.ts).
13
+ */
14
+ export function composePhiCmsPagePresetOverlays({ tree, presetTree, }) {
15
+ const storedOverlayIds = new Set(tree.overlays.map((node) => node.id));
16
+ const presetOverlays = presetTree.overlays.filter((overlay) => !storedOverlayIds.has(overlay.id));
17
+ if (presetOverlays.length === 0)
18
+ return tree;
19
+ const childLayoutsByParent = new Map();
20
+ for (const layout of presetTree.layoutNodes) {
21
+ if (layout.parentLayoutNodeId === null)
22
+ continue;
23
+ const siblings = childLayoutsByParent.get(layout.parentLayoutNodeId);
24
+ if (siblings)
25
+ siblings.push(layout);
26
+ else
27
+ childLayoutsByParent.set(layout.parentLayoutNodeId, [layout]);
28
+ }
29
+ const layoutsById = new Map(presetTree.layoutNodes.map((layout) => [layout.id, layout]));
30
+ const takenLayoutIds = new Set();
31
+ const visit = (rootId) => {
32
+ if (rootId === null)
33
+ return;
34
+ const stack = [rootId];
35
+ while (stack.length > 0) {
36
+ const id = stack.pop();
37
+ if (takenLayoutIds.has(id))
38
+ continue;
39
+ const layout = layoutsById.get(id);
40
+ if (!layout)
41
+ continue;
42
+ takenLayoutIds.add(id);
43
+ for (const child of childLayoutsByParent.get(id) ?? [])
44
+ stack.push(child.id);
45
+ }
46
+ };
47
+ for (const overlay of presetOverlays) {
48
+ visit(overlay.headerLayoutNodeId);
49
+ visit(overlay.bodyLayoutNodeId);
50
+ visit(overlay.footerLayoutNodeId);
51
+ }
52
+ const layouts = presetTree.layoutNodes.filter((layout) => takenLayoutIds.has(layout.id));
53
+ const widgets = presetTree.contentWidgets.filter((widget) => takenLayoutIds.has(widget.parentLayoutNodeId));
54
+ const occupiedIds = new Set([
55
+ ...tree.layoutNodes.map((node) => node.id),
56
+ ...tree.contentWidgets.map((node) => node.id),
57
+ ]);
58
+ for (const node of [...presetOverlays, ...layouts, ...widgets]) {
59
+ if (occupiedIds.has(node.id)) {
60
+ throw new Error(`Page preset Overlay composition contains duplicate instance id "${node.id}".`);
61
+ }
62
+ occupiedIds.add(node.id);
63
+ }
64
+ return {
65
+ ...tree,
66
+ overlays: [...tree.overlays, ...presetOverlays],
67
+ layoutNodes: [...tree.layoutNodes, ...layouts],
68
+ contentWidgets: [...tree.contentWidgets, ...widgets],
69
+ };
70
+ }
@@ -4,10 +4,10 @@
4
4
  * to the Core Runtime Controller; a Module's own goes into that Module's Controller, mounted on demand.
5
5
  */
6
6
  export declare const PHI_PUBLIC_RUNTIME_MODULE: {
7
- icon: string;
8
7
  moduleId: "@phis/ui/modules/public";
9
8
  category: "foundation";
10
9
  description: string;
10
+ icon: string;
11
11
  serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
12
12
  formProviders: {
13
13
  handlers: readonly [{
@@ -160,6 +160,7 @@ export async function buildPhiDefaultPubWelcomePageTree({ page, runtime, }) {
160
160
  label: "pub welcome read more button",
161
161
  config: {
162
162
  key: "read-more",
163
+ textSource: PHI_TEXT_SOURCE_PRESET,
163
164
  label: "Read more...",
164
165
  variant: "primary",
165
166
  /*
@@ -8,6 +8,7 @@ import { PHI_VIEWER_ACCESS_ANYONE, } from "../../types/access";
8
8
  import { stripRenderableBlockDefaults } from "../../helpers/renderable-block-serialization";
9
9
  import { PhiCmsWidgetType } from "../../constants/cms-widget-types";
10
10
  import { parsePhiFormWidgetConfig } from "../../components/forms/form-widget-config";
11
+ import { buildPhiRecordDeclarationsByKey } from "../../helpers/record-fields";
11
12
  function loadRuntimeWidgetPlugin(entry) {
12
13
  return entry.loadRuntime();
13
14
  }
@@ -620,6 +621,10 @@ export async function resolvePhiRuntimeRenderRegistry({ catalog, moduleSet, tree
620
621
  recordProviderLoadersByKey: new Map([...moduleSet.moduleDefinitionsById.keys()].flatMap((moduleId) => (catalog.get(moduleId)?.recordProviders ?? []).map((provider) => [provider.key, provider.load]))),
621
622
  recordFieldsLoadersByKey: new Map([...moduleSet.moduleDefinitionsById.keys()].flatMap((moduleId) => (catalog.get(moduleId)?.recordProviders ?? []).flatMap((provider) => provider.loadFields ? [[provider.key, provider.loadFields]] : []))),
622
623
  recordSamplesLoadersByKey: new Map([...moduleSet.moduleDefinitionsById.keys()].flatMap((moduleId) => (catalog.get(moduleId)?.recordProviders ?? []).flatMap((provider) => provider.loadSamples ? [[provider.key, provider.loadSamples]] : []))),
624
+ recordDeclarationsByKey: buildPhiRecordDeclarationsByKey([...moduleSet.moduleDefinitionsById.keys()].flatMap((moduleId) => {
625
+ const entry = catalog.get(moduleId);
626
+ return entry ? [entry] : [];
627
+ })),
623
628
  dataProviderDescriptorsByKey,
624
629
  formDefinitionsById: moduleSet.formDefinitionsById,
625
630
  };
@@ -1,3 +1,4 @@
1
+ import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
1
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX, PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS, PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX, } from "../../../../constants/cms-layout-types";
2
3
  import { PhiCmsFlags, PhiCmsRegionType, PhiCmsStatus } from "../../../../constants/phi-cms";
3
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
@@ -11,7 +12,7 @@ import { createPhiRevisionsControllerAddress, PHI_REVISIONS_CONTROLLER_INSTANCE_
11
12
  import { PHI_REVISIONS_FORM_IDS } from "../forms";
12
13
  import { PHI_REVISIONS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
13
14
  import { PHI_REVISIONS_DELETE_AREA_LAYOUT_IDS, PHI_REVISIONS_DELETE_AREA_OVERLAY_IDS, PHI_REVISIONS_DELETE_AREA_WIDGET_IDS, PHI_REVISIONS_PAGE_LAYOUT_IDS, PHI_REVISIONS_PAGE_WIDGET_IDS, PHI_REVISIONS_TABLE_WIDGET_ID, } from "../page-ids";
14
- import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
15
+ import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
15
16
  import { PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM } from "../../../../helpers/cms-scope-search-params";
16
17
  /** Where the history's kind stands in the address, for a `page` condition. */
17
18
  const KIND_QUERY_PATH = `query.${PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM}`;
@@ -94,7 +95,7 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
94
95
  label: "Builder delete area",
95
96
  config: {
96
97
  title: revisionsLabels.deleteArea.title,
97
- width: { compact: "calc(100vw - 32px)", medium: 520, wide: 560 },
98
+ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
98
99
  /*
99
100
  * `remount` rather than `lazy-keep`: the field is the confirmation, and a dialog that kept a
100
101
  * half-typed Area key from the last time it was opened would carry an answer across to a
@@ -227,6 +228,7 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
227
228
  label: "dev revisions area shell delete",
228
229
  config: {
229
230
  key: "revisions-area-shell-delete",
231
+ textSource: PHI_TEXT_SOURCE_PRESET,
230
232
  controlSize: "small",
231
233
  compact: true,
232
234
  showLabels: true,
@@ -350,6 +352,7 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
350
352
  label: "Builder delete area commands",
351
353
  config: {
352
354
  key: "delete-area-commands",
355
+ textSource: PHI_TEXT_SOURCE_PRESET,
353
356
  ...PHI_DIALOG_COMMANDS_CONFIG,
354
357
  buttons: [
355
358
  {
@@ -6,7 +6,6 @@ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
6
6
  import { resolvePhiLinkHref } from "../../../../../helpers/link-target";
7
7
  import { resolvePhiLinkTargetReferences } from "../../../../../server-helpers/cms-link-targets";
8
8
  import { phiRuntime } from "../../../../../server-helpers/phi-runtime";
9
- import { trBulkForLocale } from "../../../../../server-helpers/translate";
10
9
  import { resolvePhiSearchPageLinkTarget } from "../../page-references";
11
10
  /**
12
11
  * The search box, resolved on the server: where the form goes, what the box says, what it already holds.
@@ -30,10 +29,9 @@ export async function PhiSearchBoxWidget({ config, runtime }) {
30
29
  if (!href) {
31
30
  return null;
32
31
  }
33
- const [labels, [placeholder]] = await Promise.all([
34
- getPhiSearchWidgetLabels({ apiBaseUrl: rt.apiBaseUrl, internalToken: rt.internalToken, locale }),
35
- config?.placeholder ? trBulkForLocale(locale, [config.placeholder]) : [""],
36
- ]);
32
+ // The placeholder arrives translated (server-helpers/cms-widget-texts.ts).
33
+ const placeholder = config?.placeholder ?? "";
34
+ const labels = await getPhiSearchWidgetLabels({ apiBaseUrl: rt.apiBaseUrl, internalToken: rt.internalToken, locale });
37
35
  return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.SearchBox, componentProps: {
38
36
  labels,
39
37
  config: {
@@ -8,7 +8,6 @@ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
8
8
  import { resolvePhiNavHref } from "../../../../../helpers/locale";
9
9
  import { fetchPhiSiteSearch } from "../../../../../gateway/site-search";
10
10
  import { phiRuntime } from "../../../../../server-helpers/phi-runtime";
11
- import { trBulkForLocale } from "../../../../../server-helpers/translate";
12
11
  import { readPhiRuntimeTreeRenderMode } from "../../../render-mode";
13
12
  /** The Areas a reader standing in `area` may search (SEARCH.md): App and Public from the App, else Public. */
14
13
  function resolvePhiSearchedAreas(area) {
@@ -33,10 +32,9 @@ export async function PhiSearchResultsWidget({ config, runtime, widgetId }) {
33
32
  const rt = phiRuntime(runtime);
34
33
  const locale = runtime.locale.current;
35
34
  const renderMode = readPhiRuntimeTreeRenderMode(config ?? {});
36
- const [labels, [title]] = await Promise.all([
37
- getPhiSearchResultsWidgetLabels({ apiBaseUrl: rt.apiBaseUrl, internalToken: rt.internalToken, locale }),
38
- config?.title ? trBulkForLocale(locale, [config.title]) : [""],
39
- ]);
35
+ // The heading arrives translated (server-helpers/cms-widget-texts.ts).
36
+ const title = config?.title ?? "";
37
+ const labels = await getPhiSearchResultsWidgetLabels({ apiBaseUrl: rt.apiBaseUrl, internalToken: rt.internalToken, locale });
40
38
  const raw = runtime.request?.searchParams?.[PHI_SEARCH_QUERY_PARAM];
41
39
  const query = readPhiSearchQuery(raw);
42
40
  const base = { title: title || undefined, minLength: PHI_SEARCH_MIN_QUERY_LENGTH };
@@ -1,3 +1,4 @@
1
+ import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
1
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX, PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS, PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX, } from "../../../../constants/cms-layout-types";
2
3
  import { PhiCmsFlags, PhiCmsRegionType, PhiCmsStatus } from "../../../../constants/phi-cms";
3
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
@@ -357,6 +358,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
357
358
  draft: runtime.site.themeRevision?.workingDraftRevisionId != null,
358
359
  }),
359
360
  key: "brand-theme-preset",
361
+ textSource: PHI_TEXT_SOURCE_PRESET,
360
362
  signalRoutes: {
361
363
  emits: [
362
364
  {
@@ -428,6 +430,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
428
430
  checkedLabel: labels.themeSwitch.dark,
429
431
  uncheckedLabel: labels.themeSwitch.light,
430
432
  key: "brandPreviewThemeMode",
433
+ textSource: PHI_TEXT_SOURCE_PRESET,
431
434
  signalRoutes: {
432
435
  emits: [
433
436
  {
@@ -453,6 +456,7 @@ export async function buildPhiDefaultBuilderThemePageTree({ page, runtime, regis
453
456
  config: {
454
457
  value: "0",
455
458
  valueMode: "stack-slot-index",
459
+ textSource: PHI_TEXT_SOURCE_PRESET,
456
460
  key: PHI_THEME_STACK_SIGNAL_KEY,
457
461
  signalRoutes: {
458
462
  emits: [
@@ -1,3 +1,4 @@
1
+ import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
1
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
2
3
  import { PhiCmsFlags, PhiCmsPageType } from "../../../../constants/phi-cms";
3
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
@@ -11,7 +12,7 @@ import { PHI_SHARED_FORM_IDS } from "../../../../components/forms/shared-form-id
11
12
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
12
13
  import { getPhiThreadPageLabels } from "../labels";
13
14
  import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
14
- import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
15
+ import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
15
16
  /** The content region of each Area's conversations Page. */
16
17
  const SYNTHETIC_THREADS_REGION_ID_BY_AREA = {
17
18
  app: -453,
@@ -72,6 +73,8 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
72
73
  label: "app-threads-reply-modal",
73
74
  config: {
74
75
  title: labels.composerLabel,
76
+ // Core's Reply Form is one column, and not this Module's to hand to `dialog` (`body.form`).
77
+ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
75
78
  mountPolicy: "remount",
76
79
  closeMode: "immediate",
77
80
  openActionKey: "reply",
@@ -263,7 +266,7 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
263
266
  label: "app-threads-new-modal",
264
267
  config: {
265
268
  title: labels.newConversationLabel,
266
- width: { compact: "calc(100vw - 32px)", medium: 560, wide: 600 },
269
+ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
267
270
  mountPolicy: "remount",
268
271
  closeMode: "request",
269
272
  signalRoutes: {
@@ -641,6 +644,7 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
641
644
  label: labels.openConversationLabel,
642
645
  config: {
643
646
  key: "app-threads-new-commands",
647
+ textSource: PHI_TEXT_SOURCE_PRESET,
644
648
  ...PHI_DIALOG_COMMANDS_CONFIG,
645
649
  buttons: [
646
650
  { key: "cancel", emits: [{ capabilityId: "command", value: "cancel" }], label: labels.cancelLabel, icon: "close" },
@@ -10,6 +10,7 @@ import { usePhiRuntimeConditionStateResponder } from "../../../../components/run
10
10
  import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../components/runtime/runtime-signal-bus";
11
11
  import { dispatchPhiSignalCapability } from "../../../../components/runtime/runtime-signal-identity";
12
12
  import { usePhiTableProvider } from "../../../../components/widgets/client/shared/phi-table-provider";
13
+ import { usePhiIntlLocale, usePhiIntlTimeZone } from "../../../../components/root/phi-intl-locale";
13
14
  import { PHI_USER_MANAGEMENT_RUNTIME_CONTROLLER_DEFINITION, } from "../controller/definition";
14
15
  /*
15
16
  * The workflow a signal belongs to, read off its channel: the Page routes the create and the edit half
@@ -30,6 +31,8 @@ function PhiUserManagementControllerView({ address, runtime, config, }) {
30
31
  resourceKey: "users",
31
32
  }), []);
32
33
  const { provider } = usePhiTableProvider(source);
34
+ const locale = usePhiIntlLocale();
35
+ const timeZone = usePhiIntlTimeZone();
33
36
  // The route lets a Developer in; only a Site admin may change anything. Stated as the policy the
34
37
  // rest of the system speaks rather than as a role check, so a widened admin mask carries here too.
35
38
  const readOnly = !canPhiViewerAccess(runtime.viewer, PHI_VIEWER_ACCESS_SITE_ADMIN);
@@ -68,6 +71,8 @@ function PhiUserManagementControllerView({ address, runtime, config, }) {
68
71
  resourceKey: "users",
69
72
  rowIdentity,
70
73
  params: {},
74
+ locale,
75
+ timeZone,
71
76
  signal: new AbortController().signal,
72
77
  });
73
78
  if (workflowRef.current.correlationId !== correlationId)
@@ -78,7 +83,7 @@ function PhiUserManagementControllerView({ address, runtime, config, }) {
78
83
  catch {
79
84
  workflowRef.current.selectedSelf = true;
80
85
  }
81
- }, [conditionState, emitCapability, provider]);
86
+ }, [conditionState, emitCapability, locale, provider, timeZone]);
82
87
  usePhiRuntimeConditionStateResponder({ address, scope: "page", state: conditionState });
83
88
  usePhiSignalListener(useCallback((signal) => {
84
89
  if (signal.receiver !== address)