@phis/ui 0.5.2 → 0.5.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 (284) hide show
  1. package/README.md +1 -1
  2. package/components/controls/phi-border-control.js +1 -1
  3. package/components/controls/phi-bound-radius-control.js +9 -9
  4. package/components/controls/phi-brand-control.js +1 -1
  5. package/components/controls/phi-cascader-control.d.ts +9 -1
  6. package/components/controls/phi-cascader-control.js +25 -3
  7. package/components/controls/phi-drawer-control-adapter.js +4 -4
  8. package/components/controls/phi-dropdown-control.js +2 -2
  9. package/components/controls/phi-form-control.js +1 -1
  10. package/components/controls/phi-image-control.js +1 -1
  11. package/components/controls/phi-mask-picker-control.js +6 -6
  12. package/components/controls/phi-money-control.d.ts +39 -0
  13. package/components/controls/phi-money-control.js +34 -0
  14. package/components/controls/phi-number-control.d.ts +6 -1
  15. package/components/controls/phi-number-control.js +3 -3
  16. package/components/controls/phi-options-provider.d.ts +7 -0
  17. package/components/controls/phi-options-provider.js +11 -0
  18. package/components/controls/phi-select-control.js +1 -1
  19. package/components/controls/phi-theme-scope-control.js +1 -1
  20. package/components/controls/use-phi-color-control-presets.js +2 -2
  21. package/components/forms/compound-form-controls.js +2 -2
  22. package/components/forms/extended-form-field-controls.d.ts +1 -0
  23. package/components/forms/extended-form-field-controls.js +24 -2
  24. package/components/forms/form-descriptor-runtime-client.js +13 -0
  25. package/components/forms/form-provider-contract.d.ts +43 -0
  26. package/components/forms/form-provider-contract.js +40 -0
  27. package/components/forms/money-field.d.ts +27 -0
  28. package/components/forms/money-field.js +78 -0
  29. package/components/forms/shared-form-provider-registry.js +6 -2
  30. package/components/layouts/clients/phi-flex-layout-client.js +4 -4
  31. package/components/layouts/clients/phi-grid-layout-client.js +3 -3
  32. package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
  33. package/components/layouts/layout-definitions.d.ts +4 -4
  34. package/components/layouts/phi-page-region-layout.js +1 -1
  35. package/components/layouts/phi-structure-region-layout.js +3 -3
  36. package/components/media/phi-asset-focal-rect-widget.js +4 -4
  37. package/components/media/phi-asset-inspector-section.js +1 -1
  38. package/components/media/phi-media-kind-icon.js +2 -2
  39. package/components/media/phi-media-picker-binding.js +6 -1
  40. package/components/media/phi-media-restricted-icon.js +1 -1
  41. package/components/media/phi-site-font-assets.js +6 -1
  42. package/components/motion/phi-sequence-run.d.ts +14 -1
  43. package/components/motion/phi-sequence-run.js +22 -3
  44. package/components/motion/phi-sequence-viewport.js +3 -1
  45. package/components/overlays/phi-overlay-container-client.js +1 -1
  46. package/components/regions/presets/content-entry-editor-page-tree.js +3 -1
  47. package/components/regions/presets/phi-base-page-column.js +6 -2
  48. package/components/root/phi-config-provider.js +1 -1
  49. package/components/root/phi-root-background.js +1 -1
  50. package/components/root/phi-root-theme-resolver.js +1 -1
  51. package/components/shell/phi-module-icons.js +1 -1
  52. package/components/tables/client/phi-table-binding.js +16 -3
  53. package/components/trees/client/phi-tree-binding.js +6 -2
  54. package/components/widgets/built-in/builder-workspace-preview.js +8 -8
  55. package/components/widgets/client/bullet-list-entries-editor.js +2 -2
  56. package/components/widgets/client/external-document-editor.js +1 -1
  57. package/components/widgets/client/html-editor.js +3 -3
  58. package/components/widgets/client/shared/phi-collection-view-binding.js +10 -2
  59. package/components/widgets/client/shared/phi-rendered-value.d.ts +9 -1
  60. package/components/widgets/client/shared/phi-rendered-value.js +20 -1
  61. package/components/widgets/config/background.d.ts +1 -1
  62. package/components/widgets/config/background.js +1 -1
  63. package/components/widgets/config/choice-shared.d.ts +2 -2
  64. package/components/widgets/inspector-field-row.js +1 -1
  65. package/components/widgets/label-sets/gallery.js +6 -0
  66. package/components/widgets/label-sets/inspector.js +2 -0
  67. package/components/widgets/label-sets/interval.d.ts +4 -0
  68. package/components/widgets/label-sets/interval.js +31 -0
  69. package/components/widgets/label-sets/record.js +6 -1
  70. package/components/widgets/label-sets/slot-upload.d.ts +4 -0
  71. package/components/widgets/label-sets/slot-upload.js +36 -0
  72. package/components/widgets/label-sets/table.js +6 -1
  73. package/components/widgets/label-types/gallery.d.ts +7 -0
  74. package/components/widgets/label-types/gallery.js +6 -0
  75. package/components/widgets/label-types/inspector.d.ts +1 -0
  76. package/components/widgets/label-types/inspector.js +1 -0
  77. package/components/widgets/label-types/interval.d.ts +16 -0
  78. package/components/widgets/label-types/interval.js +21 -0
  79. package/components/widgets/label-types/record.d.ts +3 -0
  80. package/components/widgets/label-types/record.js +2 -0
  81. package/components/widgets/label-types/slot-upload.d.ts +24 -0
  82. package/components/widgets/label-types/slot-upload.js +16 -0
  83. package/components/widgets/label-types/table.d.ts +3 -0
  84. package/components/widgets/label-types/table.js +2 -0
  85. package/components/widgets/shared/card-body-client.js +1 -1
  86. package/components/widgets/shared/result-body-client.js +1 -1
  87. package/constants/media-library-provider-keys.d.ts +8 -1
  88. package/constants/media-library-provider-keys.js +8 -1
  89. package/constants/record-field-kinds.d.ts +6 -0
  90. package/constants/record-field-kinds.js +7 -0
  91. package/constants/runtime-module-ownership.js +2 -1
  92. package/controls.d.ts +7 -0
  93. package/controls.js +4 -0
  94. package/helpers/border-widget-style.d.ts +2 -2
  95. package/helpers/border-widget-style.js +2 -2
  96. package/helpers/cms-dialog.d.ts +43 -7
  97. package/helpers/cms-dialog.js +46 -4
  98. package/helpers/cms-layout-defaults.d.ts +2 -2
  99. package/helpers/cms-page-catalog.d.ts +13 -0
  100. package/helpers/cms-page-catalog.js +18 -2
  101. package/helpers/cms-preset-nodes.d.ts +13 -3
  102. package/helpers/cms-preset-nodes.js +3 -2
  103. package/helpers/cms-preset-page-tree.d.ts +4 -0
  104. package/helpers/cms-preset-page-tree.js +2 -0
  105. package/helpers/layout-style.d.ts +2 -2
  106. package/helpers/money-amount.d.ts +48 -0
  107. package/helpers/money-amount.js +131 -0
  108. package/helpers/page-layout-check.d.ts +4 -1
  109. package/helpers/page-layout-check.js +41 -2
  110. package/helpers/record-fields.d.ts +22 -0
  111. package/helpers/record-fields.js +109 -0
  112. package/helpers/surface-presets.d.ts +6 -6
  113. package/helpers/surface-style.d.ts +1 -1
  114. package/helpers.d.ts +0 -1
  115. package/helpers.js +0 -2
  116. package/module-page-check.d.ts +12 -0
  117. package/module-page-check.js +12 -0
  118. package/module-records.d.ts +7 -2
  119. package/module-records.js +5 -1
  120. package/next/antd-form-context-loader.mjs +31 -0
  121. package/next/config.d.mts +2 -0
  122. package/next/config.mjs +36 -3
  123. package/package.json +11 -2
  124. package/plugins/runtime-modules/accounting/module.d.ts +1 -1
  125. package/plugins/runtime-modules/app/module.d.ts +1 -1
  126. package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
  127. package/plugins/runtime-modules/asset/data-providers.js +0 -40
  128. package/plugins/runtime-modules/asset/definition.d.ts +0 -60
  129. package/plugins/runtime-modules/asset/ids.d.ts +0 -1
  130. package/plugins/runtime-modules/asset/ids.js +1 -2
  131. package/plugins/runtime-modules/asset/presets.d.ts +1 -0
  132. package/plugins/runtime-modules/asset/server.js +0 -5
  133. package/plugins/runtime-modules/asset/services/collection.js +1 -0
  134. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -2
  135. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +3 -0
  136. package/plugins/runtime-modules/blog/presets.d.ts +1 -0
  137. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  138. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
  139. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  140. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
  141. package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
  142. package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
  143. package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
  144. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
  145. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  146. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  147. package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
  148. package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
  149. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  150. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
  151. package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
  152. package/plugins/runtime-modules/builder/offered-page-catalog.js +3 -3
  153. package/plugins/runtime-modules/builder/options-providers.js +7 -0
  154. package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
  155. package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
  156. package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
  157. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
  158. package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
  159. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +6 -3
  160. package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
  161. package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
  162. package/plugins/runtime-modules/contracts.js +41 -1
  163. package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
  164. package/plugins/runtime-modules/core/data-providers.js +41 -0
  165. package/plugins/runtime-modules/core/definition.d.ts +98 -0
  166. package/plugins/runtime-modules/core/form-providers.d.ts +43 -0
  167. package/plugins/runtime-modules/core/server.js +5 -0
  168. package/plugins/runtime-modules/core/widgets/breadcrumb/client.d.ts +6 -3
  169. package/plugins/runtime-modules/core/widgets/breadcrumb/client.js +6 -5
  170. package/plugins/runtime-modules/core/widgets/breadcrumb/plugin.js +1 -1
  171. package/plugins/runtime-modules/core/widgets/breadcrumb/server.d.ts +9 -1
  172. package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +29 -3
  173. package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
  174. package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
  175. package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
  176. package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
  177. package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +3 -3
  178. package/plugins/runtime-modules/core/widgets/cascader/client.js +1 -1
  179. package/plugins/runtime-modules/core/widgets/cascader/config.d.ts +8 -2
  180. package/plugins/runtime-modules/core/widgets/cascader/config.js +22 -0
  181. package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +1 -1
  182. package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
  183. package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
  184. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
  185. package/plugins/runtime-modules/core/widgets/gallery/authoring.js +12 -3
  186. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
  187. package/plugins/runtime-modules/core/widgets/gallery/client.js +38 -21
  188. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +18 -0
  189. package/plugins/runtime-modules/core/widgets/gallery/config.js +24 -0
  190. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  191. package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
  192. package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
  193. package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
  194. package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
  195. package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
  196. package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
  197. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
  198. package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
  199. package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
  200. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  201. package/plugins/runtime-modules/core/widgets/multi-select/config.d.ts +1 -1
  202. package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
  203. package/plugins/runtime-modules/core/widgets/record/client.js +8 -2
  204. package/plugins/runtime-modules/core/widgets/record/config.js +4 -0
  205. package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
  206. package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +1 -1
  207. package/plugins/runtime-modules/core/widgets/select-box/config.d.ts +1 -1
  208. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
  209. package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
  210. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
  211. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
  212. package/plugins/runtime-modules/core/widgets/slot-upload/authoring.js +2 -1
  213. package/plugins/runtime-modules/core/widgets/slot-upload/client.d.ts +3 -1
  214. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +45 -24
  215. package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +12 -4
  216. package/plugins/runtime-modules/core/widgets/slot-upload/config.js +18 -1
  217. package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +4 -2
  218. package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +9 -3
  219. package/plugins/runtime-modules/core/widgets/slot-upload/server.js +17 -3
  220. package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
  221. package/plugins/runtime-modules/core/widgets/steps/config.d.ts +1 -1
  222. package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
  223. package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
  224. package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
  225. package/plugins/runtime-modules/descriptor-compiler.d.ts +11 -1
  226. package/plugins/runtime-modules/descriptor-compiler.js +57 -8
  227. package/plugins/runtime-modules/editor/presets.d.ts +1 -0
  228. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  229. package/plugins/runtime-modules/groups/forms.d.ts +18 -0
  230. package/plugins/runtime-modules/groups/forms.js +2 -2
  231. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +6 -4
  232. package/plugins/runtime-modules/localization/presets.d.ts +1 -0
  233. package/plugins/runtime-modules/news/presets.d.ts +1 -0
  234. package/plugins/runtime-modules/public/module.d.ts +1 -1
  235. package/plugins/runtime-modules/resolver.js +7 -0
  236. package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
  237. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +2 -2
  238. package/plugins/runtime-modules/theme/presets.d.ts +1 -0
  239. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
  240. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +4 -2
  241. package/plugins/runtime-modules/user-management/controller/client.js +6 -1
  242. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +3 -3
  243. package/runtime-render-client.d.ts +1 -1
  244. package/runtime-render-client.js +2 -1
  245. package/server-helpers/cms-page-record.d.ts +26 -0
  246. package/server-helpers/cms-page-record.js +52 -0
  247. package/server-helpers/cms-request.js +48 -4
  248. package/server-helpers/record-fields.d.ts +62 -0
  249. package/server-helpers/record-fields.js +86 -0
  250. package/server-helpers/record-samples.d.ts +21 -0
  251. package/server-helpers/record-samples.js +49 -0
  252. package/styles/builder-scaffold.css +19 -19
  253. package/styles/controls.css +109 -109
  254. package/styles/gradients.css +23 -23
  255. package/styles/layout-affordances.css +15 -15
  256. package/styles/layout-authoring-scaffold.css +20 -20
  257. package/styles/layout.css +9 -9
  258. package/styles/root.css +4 -4
  259. package/styles/shell.css +48 -17
  260. package/theme/antd-css-var-contract.d.ts +86 -80
  261. package/theme/antd-css-var-contract.js +92 -81
  262. package/theme/phi-control-shape.d.ts +1 -1
  263. package/theme/phi-theme-gradients.d.ts +2 -2
  264. package/theme/phi-theme-gradients.js +14 -14
  265. package/theme/phi-theme-palette.d.ts +1 -1
  266. package/theme/phi-theme-palette.js +2 -2
  267. package/theme/phi-theme-tokens.d.ts +8 -5
  268. package/theme/phi-theme-tokens.js +59 -28
  269. package/theme/phi-theme.d.ts +14 -2
  270. package/theme/phi-theme.js +14 -1
  271. package/theme/phi-tokens.d.ts +5 -0
  272. package/theme/phi-tokens.js +9 -0
  273. package/types/cms-module-descriptors.d.ts +9 -0
  274. package/types/cms-plugins.d.ts +27 -1
  275. package/types/collection-provider.d.ts +7 -0
  276. package/types/core-widget-placements.d.ts +42 -0
  277. package/types/record-provider.d.ts +109 -1
  278. package/types/table-widget.d.ts +33 -1
  279. package/types/table-widget.js +1 -0
  280. package/types/tree-widget.d.ts +7 -0
  281. package/types/widget-runtime.d.ts +5 -0
  282. package/types.d.ts +1 -0
  283. /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
  284. /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
@@ -52,6 +52,6 @@ export function PhiSpacerWidget({ config, }) {
52
52
  background: isEditor ? "rgba(71, 85, 105, 0.035)" : "transparent",
53
53
  boxShadow: isEditor ? "inset 0 0 0 1px rgba(71, 85, 105, 0.18)" : "none",
54
54
  border: isEditor ? "1px dashed rgba(71, 85, 105, 0.45)" : "0",
55
- borderRadius: isEditor ? "var(--ant-border-radius-lg)" : 0,
55
+ borderRadius: isEditor ? "var(--phi-border-radius-lg)" : 0,
56
56
  }, children: isEditor ? (_jsx("div", { "aria-hidden": "true", className: "phi-builder-spacer", children: _jsx(SpacerGlyph, { orientation: orientation }) })) : null }) }));
57
57
  }
@@ -79,7 +79,7 @@ export declare const PHI_STEPS_WIDGET_DEFINITION: {
79
79
  key: string;
80
80
  type: "collection";
81
81
  label: string;
82
- editorPlacement: "toolbar" | "inspector";
82
+ editorPlacement: "inspector" | "toolbar";
83
83
  itemKeyField: string;
84
84
  itemLabelField: string;
85
85
  defaultItem: {
@@ -56,8 +56,8 @@ const PHI_TABLE_ACTION_BUTTON_STYLE = { whiteSpace: "nowrap" };
56
56
  function formatTableActionTemplate(value, templateValue) {
57
57
  return value && templateValue != null ? formatPhiTableWidgetLabel(value, templateValue) : value;
58
58
  }
59
- function renderTableValue(value, column, row) {
60
- const content = renderPhiValueContent(value, column);
59
+ function renderTableValue(value, column, row, labels) {
60
+ const content = renderPhiValueContent(value, column, labels);
61
61
  if (!column.iconFieldKey) {
62
62
  return content;
63
63
  }
@@ -640,7 +640,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
640
640
  proposedValue,
641
641
  }).catch(() => undefined);
642
642
  } : undefined,
643
- render: (value, row) => renderTableValue(value, column, row),
643
+ render: (value, row) => renderTableValue(value, column, row, labels),
644
644
  }));
645
645
  if (rowActions.length || features.rowReordering?.enabled) {
646
646
  result.push({
@@ -665,7 +665,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
665
665
  });
666
666
  }
667
667
  return result;
668
- }, [activateAction, commitField, conditionSources, features.actions?.rowLayout, features.editing?.disabledWhen, features.editing?.mode, features.rowReordering?.enabled, isFieldMutationPending, labels.actions, loading, presentation.columns, resolvedControlSize, resource, rowActions]);
668
+ }, [activateAction, commitField, conditionSources, features.actions?.rowLayout, features.editing?.disabledWhen, features.editing?.mode, features.rowReordering?.enabled, isFieldMutationPending, labels, loading, presentation.columns, resolvedControlSize, resource, rowActions]);
669
669
  const resolveSummaryValue = useCallback((item) => {
670
670
  if (item.value.source === "provider")
671
671
  return summary[item.value.fieldKey];
@@ -135,6 +135,17 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
135
135
  editorPlacement?: "inspector" | "geometry" | "toolbar";
136
136
  visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
137
137
  heading?: string;
138
+ } & {
139
+ type: "record-field";
140
+ kinds: readonly import("../../../../../module-records").PhiRecordFieldKind[];
141
+ }) | ({
142
+ key: string;
143
+ label: string;
144
+ description?: string;
145
+ required?: boolean;
146
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
147
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
148
+ heading?: string;
138
149
  } & {
139
150
  type: "dimension";
140
151
  widthKey?: string;
@@ -438,6 +449,19 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
438
449
  editorPlacement?: "inspector" | "geometry" | "toolbar";
439
450
  heading?: string;
440
451
  type: "video-provider";
452
+ } | {
453
+ visibleWhen: {
454
+ field: string;
455
+ notEquals: string;
456
+ };
457
+ key: string;
458
+ label: string;
459
+ description?: string;
460
+ required?: boolean;
461
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
462
+ heading?: string;
463
+ type: "record-field";
464
+ kinds: readonly import("../../../../../module-records").PhiRecordFieldKind[];
441
465
  } | {
442
466
  visibleWhen: {
443
467
  field: string;
@@ -804,6 +828,19 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
804
828
  editorPlacement?: "inspector" | "geometry" | "toolbar";
805
829
  heading?: string;
806
830
  type: "video-provider";
831
+ } | {
832
+ visibleWhen: {
833
+ field: string;
834
+ equals: boolean;
835
+ };
836
+ key: string;
837
+ label: string;
838
+ description?: string;
839
+ required?: boolean;
840
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
841
+ heading?: string;
842
+ type: "record-field";
843
+ kinds: readonly import("../../../../../module-records").PhiRecordFieldKind[];
807
844
  } | {
808
845
  visibleWhen: {
809
846
  field: string;
@@ -123,6 +123,7 @@ const PHI_TABLE_ACTION_CONFIG_FIELDS = [
123
123
  ];
124
124
  const PHI_TABLE_COLUMN_RENDERERS = [
125
125
  "text", "email", "date", "datetime", "badge", "tags", "link", "code", "json", "switch", "checkbox", "icon",
126
+ "money", "interval",
126
127
  ];
127
128
  const PHI_TABLE_COLUMN_EDITOR_CONTROLS = [
128
129
  "switch", "checkbox", "select", "radio", "segmented", "multi-select", "checkbox-group", "icon-picker", "textarea",
@@ -633,6 +634,8 @@ export const PHI_TABLE_WIDGET_DEFINITION = {
633
634
  { value: "switch", label: "Switch" },
634
635
  { value: "checkbox", label: "Checkbox" },
635
636
  { value: "icon", label: "Icon" },
637
+ { value: "money", label: "Money" },
638
+ { value: "interval", label: "Interval" },
636
639
  ],
637
640
  },
638
641
  {
@@ -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";
@@ -114,6 +114,14 @@ export function compilePhiCmsRoutePattern(descriptor) {
114
114
  if (dynamicSegments.length > 1) {
115
115
  throw new Error(`${descriptor.ownerModuleId}/${descriptor.presetKey}: a route may contain at most one dynamic segment.`);
116
116
  }
117
+ // A page record is filled in from the address, so every route parameter it names has to be in the path.
118
+ if (descriptor.pageRecord) {
119
+ const routeParams = new Set(dynamicSegments.map((segment) => segment.slice(1)));
120
+ const named = Object.values(descriptor.pageRecord.params);
121
+ if (named.length === 0 || named.some((param) => !routeParams.has(param))) {
122
+ throw new Error(`${descriptor.ownerModuleId}/${descriptor.presetKey}: a page record's params must each name a parameter of the route path.`);
123
+ }
124
+ }
117
125
  for (const segment of segments) {
118
126
  if (segment.includes("*") ||
119
127
  segment.includes("?") ||
@@ -255,8 +263,12 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
255
263
  const themeByKey = new Map();
256
264
  const themeBlockByKey = new Map();
257
265
  const sourceLocaleByModuleId = new Map();
266
+ const formDefinitionsById = new Map();
258
267
  for (const [moduleId, entry] of catalog) {
259
268
  sourceLocaleByModuleId.set(moduleId, resolvePhiRuntimeModuleSourceLocale(entry.definition));
269
+ for (const form of entry.forms ?? []) {
270
+ formDefinitionsById.set(form.formId, form);
271
+ }
260
272
  const descriptorKeys = new Set();
261
273
  const registerIdentity = (presetKey) => {
262
274
  normalizeRequiredKey(presetKey, `${moduleId} preset key`);
@@ -613,6 +625,7 @@ export function compilePhiCmsDescriptorCatalog({ catalog, areaDefinitions, }) {
613
625
  themeByKey,
614
626
  themeBlockByKey,
615
627
  sourceLocaleByModuleId,
628
+ formDefinitionsById,
616
629
  };
617
630
  }
618
631
  const descriptorCatalogByRuntimeCatalog = new WeakMap();
@@ -1407,7 +1420,11 @@ function assertPhiCmsBasePageLayoutNode(tree, layoutsById) {
1407
1420
  `${stablePresetNodeJson(node[mismatch])}, canonical is ${stablePresetNodeJson(canonical[mismatch])}.`);
1408
1421
  }
1409
1422
  }
1410
- 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) {
1411
1428
  const layoutIds = new Set();
1412
1429
  const allIds = new Set();
1413
1430
  if (expectedPage &&
@@ -1495,6 +1512,8 @@ export function assertPhiCmsPresetTreeContract(tree, expectedPage) {
1495
1512
  for (const overlay of tree.overlays) {
1496
1513
  if (overlay.overlayType === "modal") {
1497
1514
  assertPhiCmsDialogBody(overlay.id, layoutsById.get(overlay.bodyLayoutNodeId));
1515
+ if (forms)
1516
+ assertPhiCmsDialogWidth(overlay, tree, forms);
1498
1517
  }
1499
1518
  }
1500
1519
  for (const rootLayoutNodeId of [
@@ -1510,8 +1529,8 @@ export function assertPhiCmsPresetTreeContract(tree, expectedPage) {
1510
1529
  }
1511
1530
  }
1512
1531
  }
1513
- function assertPhiCmsAreaOverlayTree(descriptor, tree, page) {
1514
- assertPhiCmsPresetTreeContract(tree, page);
1532
+ function assertPhiCmsAreaOverlayTree(descriptor, tree, page, forms) {
1533
+ assertPhiCmsPresetTreeContract(tree, page, forms);
1515
1534
  if (tree.regions.length > 0) {
1516
1535
  throw new Error(`${descriptor.ownerModuleId}/${descriptor.presetKey}: Area Overlay preset must not contribute Regions.`);
1517
1536
  }
@@ -1545,7 +1564,7 @@ export async function composePhiCmsActiveAreaOverlayPresets({ tree, catalog, act
1545
1564
  const contributions = await Promise.all(descriptors.map((descriptor) => descriptor.loadTree({ page, runtime: targetRuntime, catalog })));
1546
1565
  for (const [index, descriptor] of descriptors.entries()) {
1547
1566
  const contribution = contributions[index];
1548
- assertPhiCmsAreaOverlayTree(descriptor, contribution, page);
1567
+ assertPhiCmsAreaOverlayTree(descriptor, contribution, page, catalog.formDefinitionsById);
1549
1568
  for (const node of [
1550
1569
  ...contribution.overlays,
1551
1570
  ...contribution.layoutNodes,
@@ -1583,13 +1602,13 @@ async function loadShellTree(descriptor, catalog, page, runtime) {
1583
1602
  composedTree = composedTree ? mergePhiCmsShellTrees(composedTree, sourceTree) : sourceTree;
1584
1603
  }
1585
1604
  const ownTree = await descriptor.loadTree({ page, runtime, catalog });
1586
- assertPhiCmsPresetTreeContract(ownTree, page);
1605
+ assertPhiCmsPresetTreeContract(ownTree, page, catalog.formDefinitionsById);
1587
1606
  return composedTree ? mergePhiCmsShellTrees(composedTree, ownTree) : ownTree;
1588
1607
  }
1589
1608
  export async function instantiatePhiCmsAreaShellPreset({ binding, catalog, siteId, path, runtime, }) {
1590
1609
  const page = createSyntheticPresetPage({ siteId, area: binding.descriptor.area, path });
1591
1610
  const tree = await loadShellTree(binding.descriptor, catalog, page, resolveTargetRuntime(runtime, binding.descriptor.area));
1592
- assertPhiCmsPresetTreeContract(tree, page);
1611
+ assertPhiCmsPresetTreeContract(tree, page, catalog.formDefinitionsById);
1593
1612
  return tree;
1594
1613
  }
1595
1614
  export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeModuleIds, siteId, path, runtime, resolveMissingPageTitle, }) {
@@ -1622,7 +1641,7 @@ export async function instantiatePhiCmsRoutePreset({ binding, catalog, activeMod
1622
1641
  description: loadedTree.pageMeta?.description ?? null,
1623
1642
  },
1624
1643
  };
1625
- assertPhiCmsPresetTreeContract(tree, page);
1644
+ assertPhiCmsPresetTreeContract(tree, page, catalog.formDefinitionsById);
1626
1645
  return tree;
1627
1646
  }
1628
1647
  /*
@@ -1654,3 +1673,33 @@ function assertPhiCmsDialogCommands(overlayId, footerLayoutId, widgets) {
1654
1673
  }
1655
1674
  }
1656
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
+ }
@@ -43,5 +43,6 @@ export declare const PHI_EDITOR_RUNTIME_MODULE_ROUTES: (PhiCmsRoutePresetDescrip
43
43
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
44
44
  params: Readonly<Record<string, string>>;
45
45
  }) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
46
+ pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
46
47
  navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
47
48
  })[];
@@ -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" | "video" | "audio" | "pdf" | "markdown" | "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,
@@ -8,7 +8,7 @@ import { PHI_GROUPS_PAGE_LAYOUT_IDS, PHI_GROUPS_PAGE_OVERLAY_IDS, PHI_GROUPS_PAG
8
8
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
9
9
  import { getPhiGroupFormLabels } from "../labels";
10
10
  import { buildPhiGroupMembersTable, buildPhiGroupRetireAction, buildPhiGroupSettingColumns, buildPhiGroupsFooter, } from "./group-tables";
11
- import { PHI_GROUPS_FORM_IDS } from "../forms";
11
+ import { PHI_GROUPS_CREATE_FORM_DESCRIPTOR, PHI_GROUPS_FORM_IDS, PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR, } from "../forms";
12
12
  import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
13
13
  const SYNTHETIC_ADMIN_GROUPS_REGION_IDS = {
14
14
  regionContent: -451,
@@ -44,12 +44,14 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
44
44
  * speak to their receiver directly -- the dialog closes, the Form submits -- so nothing has to relay
45
45
  * them. The Form's success goes to the Controller, which reloads and closes the dialog.
46
46
  */
47
- const dialog = (workflow, ids, text, formId, openActionKey, overlayAddress, formAddress, sortOrder) => {
47
+ const dialog = (workflow, ids, text, formId, descriptor, openActionKey, overlayAddress, formAddress, sortOrder) => {
48
48
  const built = nodes.dialog({
49
49
  id: ids.overlay,
50
50
  bodyLayoutNodeId: ids.body,
51
51
  sortOrder,
52
52
  label: `admin-groups-${workflow}-modal`,
53
+ // The dialog takes the width its Form needs.
54
+ body: { form: { descriptor } },
53
55
  config: {
54
56
  title: text.title,
55
57
  // Opened afresh each time, so a dialog cancelled half filled starts empty again.
@@ -174,14 +176,14 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
174
176
  footer: PHI_GROUPS_PAGE_LAYOUT_IDS.layoutCreateFooter,
175
177
  form: PHI_GROUPS_PAGE_WIDGET_IDS.widgetCreateForm,
176
178
  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);
179
+ }, { title: labels.create.title, submit: labels.actions.create }, PHI_GROUPS_FORM_IDS.create, PHI_GROUPS_CREATE_FORM_DESCRIPTOR, "create", createOverlayAddress, createFormAddress, 0);
178
180
  const membershipDialog = dialog("membership", {
179
181
  overlay: PHI_GROUPS_PAGE_OVERLAY_IDS.overlayMembership,
180
182
  body: PHI_GROUPS_PAGE_LAYOUT_IDS.layoutMembership,
181
183
  footer: PHI_GROUPS_PAGE_LAYOUT_IDS.layoutMembershipFooter,
182
184
  form: PHI_GROUPS_PAGE_WIDGET_IDS.widgetMembershipForm,
183
185
  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);
186
+ }, { title: labels.membership.title, submit: labels.membership.submit }, PHI_GROUPS_FORM_IDS.membership, PHI_GROUPS_MEMBERSHIP_FORM_DESCRIPTOR, "addMember", membershipOverlayAddress, membershipFormAddress, 1);
185
187
  return {
186
188
  page: nodes.page({ pageType: PhiCmsPageType.Standard }),
187
189
  pageMeta: {
@@ -42,5 +42,6 @@ export declare const PHI_LOCALIZATION_RUNTIME_MODULE_ROUTES: (PhiCmsRoutePresetD
42
42
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
43
43
  params: Readonly<Record<string, string>>;
44
44
  }) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
45
+ pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
45
46
  navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
46
47
  })[];
@@ -49,5 +49,6 @@ export declare const PHI_NEWS_RUNTIME_MODULE_ROUTES: ({
49
49
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
50
50
  params: Readonly<Record<string, string>>;
51
51
  }) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
52
+ pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
52
53
  navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
53
54
  })[];
@@ -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 [{
@@ -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
  }
@@ -618,6 +619,12 @@ export async function resolvePhiRuntimeRenderRegistry({ catalog, moduleSet, tree
618
619
  * binding names a Provider, not the Module whose Widget it sits in.
619
620
  */
620
621
  recordProviderLoadersByKey: new Map([...moduleSet.moduleDefinitionsById.keys()].flatMap((moduleId) => (catalog.get(moduleId)?.recordProviders ?? []).map((provider) => [provider.key, provider.load]))),
622
+ recordFieldsLoadersByKey: new Map([...moduleSet.moduleDefinitionsById.keys()].flatMap((moduleId) => (catalog.get(moduleId)?.recordProviders ?? []).flatMap((provider) => provider.loadFields ? [[provider.key, provider.loadFields]] : []))),
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
+ })),
621
628
  dataProviderDescriptorsByKey,
622
629
  formDefinitionsById: moduleSet.formDefinitionsById,
623
630
  };
@@ -49,5 +49,6 @@ export declare const PHI_REVISIONS_RUNTIME_MODULE_ROUTES: {
49
49
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
50
50
  params: Readonly<Record<string, string>>;
51
51
  }) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
52
+ pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
52
53
  navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
53
54
  }[];
@@ -11,7 +11,7 @@ import { createPhiRevisionsControllerAddress, PHI_REVISIONS_CONTROLLER_INSTANCE_
11
11
  import { PHI_REVISIONS_FORM_IDS } from "../forms";
12
12
  import { PHI_REVISIONS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
13
13
  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";
14
+ import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
15
15
  import { PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM } from "../../../../helpers/cms-scope-search-params";
16
16
  /** Where the history's kind stands in the address, for a `page` condition. */
17
17
  const KIND_QUERY_PATH = `query.${PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM}`;
@@ -94,7 +94,7 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
94
94
  label: "Builder delete area",
95
95
  config: {
96
96
  title: revisionsLabels.deleteArea.title,
97
- width: { compact: "calc(100vw - 32px)", medium: 520, wide: 560 },
97
+ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
98
98
  /*
99
99
  * `remount` rather than `lazy-keep`: the field is the confirmation, and a dialog that kept a
100
100
  * half-typed Area key from the last time it was opened would carry an answer across to a
@@ -80,5 +80,6 @@ export declare const PHI_THEME_RUNTIME_MODULE_ROUTES: {
80
80
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
81
81
  params: Readonly<Record<string, string>>;
82
82
  }) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
83
+ pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
83
84
  navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
84
85
  }[];
@@ -23,6 +23,8 @@ import { resolvePhiAntdAliasTokens } from "../../../../../theme/phi-antd-token-r
23
23
  import { buildPhiThemeStructuralTokens } from "../../../../../theme/phi-theme";
24
24
  import { PHI_CONTROL_HEIGHTS, PHI_LAYOUT, PHI_PADDING, PHI_RADII, } from "../../../../../theme/phi-tokens";
25
25
  import { PHI_CONTAINER_BREAKPOINT_REGION } from "../../../../../theme/phi-container-breakpoints";
26
+ import { PHI_SPACE } from "../../../../../theme/antd-css-var-contract";
27
+ import { PHI_THEME_PAGE_PADDING_BANDS, PHI_THEME_PAGE_PADDING_SIDES } from "../../../../../theme/phi-theme-tokens";
26
28
  import { PHI_COLOR_PICKER_NEUTRAL_PRESETS, PHI_COLOR_PICKER_PRESETS } from "../../../../../components/widgets/config/color-picker-presets";
27
29
  import { PHI_SPACING_TOKEN_KEYS } from "../../../../../components/widgets/config/spacing-options";
28
30
  import { PhiColorFieldControl } from "../../../../../components/controls/phi-color-field-control";
@@ -42,6 +44,7 @@ import { PhiButtonControl } from "../../../../../components/controls/phi-button-
42
44
  import { PhiCheckboxControl } from "../../../../../components/controls/phi-checkbox-control";
43
45
  import { PhiLabeledControl } from "../../../../../components/controls/phi-labeled-control";
44
46
  import { PhiNumberControl } from "../../../../../components/controls/phi-number-control";
47
+ import { PhiPaddingControl } from "../../../../../components/controls/phi-padding-control";
45
48
  import { PhiColorControl } from "../../../../../components/controls/phi-color-control";
46
49
  import { PhiLinkTargetControl } from "../../../../../components/widgets/client/shared/phi-link-target-control";
47
50
  import { usePhiPageReferenceOptions } from "../../../../../components/widgets/client/shared/use-page-reference-options";
@@ -85,6 +88,7 @@ const BRAND_THEME_STYLE_SECTION_KEYS = [
85
88
  "fontSize",
86
89
  "wireframe",
87
90
  "pageWidth",
91
+ "pagePadding",
88
92
  ];
89
93
  /*
90
94
  * The shadow under each kind of Button (theme/phi-button-shadow.ts). "Theme" is no step at all -- the
@@ -1302,7 +1306,13 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
1302
1306
  /** One row per size step: a label and the preset picker; Border Radius and Control Height share it. */
1303
1307
  const renderPresetSizeRows = (items, options) => (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: items.map((item) => (_jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: item.label }), _jsx(PhiPresetSizeControl, { value: item.value, fallbackKey: item.fallbackPreset, options: options, onChange: (value) => updateToken({ [item.key]: value }) })] }, item.key))) }));
1304
1308
  const wireframe = readEffectiveTokenBoolean(styleTokenInput, "wireframe", true);
1305
- const pageMax = readEffectiveTokenNumber(styleTokenInput, "phiPageMax", PHI_LAYOUT.pageMax);
1309
+ const pageMax = readEffectiveTokenNumber(styleTokenInput, "pageMax", PHI_LAYOUT.pageMax);
1310
+ const [pagePaddingBand, setPagePaddingBand] = useState("Phone");
1311
+ const pagePaddingDefault = PHI_SPACE[PHI_LAYOUT.pagePadding[pagePaddingBand.toLowerCase()]];
1312
+ const pagePadding = Object.fromEntries(PHI_THEME_PAGE_PADDING_SIDES.map((side) => [
1313
+ `padding${side}`,
1314
+ readEffectiveTokenString(styleTokenInput, `pagePadding${side}${pagePaddingBand}`, pagePaddingDefault),
1315
+ ]));
1306
1316
  const baseFontSize = readEffectiveTokenNumber(styleTokenInput, "fontSize", 12);
1307
1317
  function updateToken(tokenPatch) {
1308
1318
  publishDraft(mergeThemeToken(state.draft, tokenPatch));
@@ -1420,7 +1430,20 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
1420
1430
  */
1421
1431
  key: "pageWidth",
1422
1432
  label: _jsx(PhiTypographyControl, { strong: true, children: "Page Width" }),
1423
- children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: "Maximum" }), _jsx(PhiNumberControl, { prefix: "px", value: pageMax, step: 1, min: PHI_CONTAINER_BREAKPOINT_REGION, onChange: (next) => updateToken({ phiPageMax: next == null ? undefined : next }) })] }), _jsxs(PhiTypographyControl, { type: "secondary", children: ["How wide a Page gets on a wide screen. At least ", PHI_CONTAINER_BREAKPOINT_REGION, "px, the width from which a Region counts as wide."] })] })),
1433
+ children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: "Maximum" }), _jsx(PhiNumberControl, { prefix: "px", value: pageMax, step: 1, min: PHI_CONTAINER_BREAKPOINT_REGION, onChange: (next) => updateToken({ pageMax: next == null ? undefined : next }) })] }), _jsxs(PhiTypographyControl, { type: "secondary", children: ["How wide a Page gets on a wide screen. At least ", PHI_CONTAINER_BREAKPOINT_REGION, "px, the width from which a Region counts as wide."] })] })),
1434
+ },
1435
+ {
1436
+ /*
1437
+ * How far a Page's content stands in (`PHI_PAGE.padding`), per side and per screen: a phone
1438
+ * below 768, a tablet below 1200, a desktop from there. Only the default of the Page column
1439
+ * the presets and packages build; a Layout that states its own padding keeps it.
1440
+ */
1441
+ key: "pagePadding",
1442
+ label: _jsx(PhiTypographyControl, { strong: true, children: "Page Padding" }),
1443
+ children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsx(PhiSegmentedControl, { value: pagePaddingBand, options: PHI_THEME_PAGE_PADDING_BANDS.map((band) => ({ value: band, label: band })), onChange: setPagePaddingBand }), _jsx(PhiPaddingControl, { value: pagePadding, showGap: false, onChange: (next) => updateToken(Object.fromEntries(PHI_THEME_PAGE_PADDING_SIDES.map((side) => {
1444
+ const value = next?.[`padding${side}`] ?? next?.padding;
1445
+ return [`pagePadding${side}${pagePaddingBand}`, value == null ? undefined : value];
1446
+ }))) }), _jsx(PhiTypographyControl, { type: "secondary", children: "The default of a Page that does not set its own: a phone below 768px, a tablet below 1200px." })] })),
1424
1447
  },
1425
1448
  ] }) })] }));
1426
1449
  }
@@ -11,7 +11,7 @@ import { PHI_SHARED_FORM_IDS } from "../../../../components/forms/shared-form-id
11
11
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
12
12
  import { getPhiThreadPageLabels } from "../labels";
13
13
  import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
14
- import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
14
+ import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
15
15
  /** The content region of each Area's conversations Page. */
16
16
  const SYNTHETIC_THREADS_REGION_ID_BY_AREA = {
17
17
  app: -453,
@@ -72,6 +72,8 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
72
72
  label: "app-threads-reply-modal",
73
73
  config: {
74
74
  title: labels.composerLabel,
75
+ // Core's Reply Form is one column, and not this Module's to hand to `dialog` (`body.form`).
76
+ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
75
77
  mountPolicy: "remount",
76
78
  closeMode: "immediate",
77
79
  openActionKey: "reply",
@@ -263,7 +265,7 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
263
265
  label: "app-threads-new-modal",
264
266
  config: {
265
267
  title: labels.newConversationLabel,
266
- width: { compact: "calc(100vw - 32px)", medium: 560, wide: 600 },
268
+ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
267
269
  mountPolicy: "remount",
268
270
  closeMode: "request",
269
271
  signalRoutes: {
@@ -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)