@phis/ui 0.7.8 → 0.8.1

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 (462) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +15 -7
  2. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  3. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  4. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  5. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  6. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  7. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  8. package/components/cms/phi-cms-root-layout.js +3 -1
  9. package/components/controls/phi-address-control.d.ts +23 -0
  10. package/components/controls/phi-address-control.js +43 -0
  11. package/components/controls/phi-color-control.d.ts +3 -1
  12. package/components/controls/phi-color-control.js +2 -2
  13. package/components/controls/phi-country-select-control.d.ts +22 -0
  14. package/components/controls/phi-country-select-control.js +16 -0
  15. package/components/controls/phi-dialog-control.d.ts +1 -1
  16. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  17. package/components/controls/phi-drawer-control-adapter.js +5 -3
  18. package/components/controls/phi-drawer-control.d.ts +7 -5
  19. package/components/controls/phi-float-button-control.d.ts +8 -1
  20. package/components/controls/phi-float-button-control.js +19 -3
  21. package/components/controls/phi-form-control.js +52 -8
  22. package/components/controls/phi-media-picker-control.d.ts +9 -0
  23. package/components/controls/phi-media-picker-control.js +1 -1
  24. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  25. package/components/controls/phi-modal-control-adapter.js +14 -37
  26. package/components/controls/phi-modal-control.d.ts +5 -5
  27. package/components/controls/phi-options-provider.d.ts +1 -0
  28. package/components/controls/phi-options-provider.js +1 -0
  29. package/components/controls/phi-overlay-control-contract.d.ts +52 -17
  30. package/components/controls/phi-overlay-control-contract.js +55 -30
  31. package/components/controls/phi-popover-control.js +4 -1
  32. package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
  33. package/components/controls/phi-reveal-once-dialog-control.js +52 -0
  34. package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
  35. package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
  36. package/components/controls/phi-table-control.d.ts +7 -1
  37. package/components/controls/phi-table-control.js +23 -8
  38. package/components/forms/flags-field.d.ts +22 -0
  39. package/components/forms/flags-field.js +58 -0
  40. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  41. package/components/forms/form-descriptor-field-check.js +41 -0
  42. package/components/forms/form-descriptor-runtime-client.js +11 -10
  43. package/components/forms/form-option-flags.d.ts +20 -0
  44. package/components/forms/form-option-flags.js +38 -0
  45. package/components/forms/form-provider-contract.d.ts +23 -0
  46. package/components/forms/form-provider-contract.js +36 -0
  47. package/components/forms/form-provider-registry.d.ts +5 -1
  48. package/components/forms/form-record-source.d.ts +38 -0
  49. package/components/forms/form-record-source.js +48 -0
  50. package/components/forms/shared-form-descriptors.d.ts +0 -34
  51. package/components/forms/shared-form-descriptors.js +0 -6
  52. package/components/forms/shared-form-ids.d.ts +1 -1
  53. package/components/forms/shared-form-ids.js +1 -1
  54. package/components/forms/shared-form-provider-registry.js +13 -0
  55. package/components/forms/structured-field-labels.d.ts +24 -0
  56. package/components/forms/structured-field-labels.js +43 -0
  57. package/components/forms/structured-form-field-controls.d.ts +12 -0
  58. package/components/forms/structured-form-field-controls.js +65 -0
  59. package/components/media/media-settings-labels.d.ts +1 -0
  60. package/components/media/media-settings-labels.js +2 -0
  61. package/components/media/phi-media-picker-binding.d.ts +41 -33
  62. package/components/media/phi-media-picker-binding.js +2 -1
  63. package/components/media/use-media-library-add-picker.d.ts +33 -32
  64. package/components/overlays/phi-overlay-container-client.js +13 -11
  65. package/components/regions/phi-cms-region-shell.js +2 -2
  66. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  67. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +13 -2
  68. package/components/regions/presets/phi-settings-page-shell-tree.js +4 -4
  69. package/components/root/phi-root-theme-resolver.js +3 -0
  70. package/components/shell/phi-antd-icon.d.ts +1 -8
  71. package/components/shell/phi-antd-icon.js +1 -227
  72. package/components/shell/phi-icon-names.d.ts +22 -0
  73. package/components/shell/phi-icon-names.js +267 -0
  74. package/components/shell/phi-icon.d.ts +4 -15
  75. package/components/shell/phi-icon.js +9 -50
  76. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  77. package/components/tables/client/phi-table-binding-params.js +39 -0
  78. package/components/tables/client/phi-table-binding.d.ts +1 -3
  79. package/components/tables/client/phi-table-binding.js +5 -9
  80. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  81. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  82. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  83. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  84. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  85. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  86. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  87. package/components/widgets/client/shared/phi-command-buttons.d.ts +29 -2
  88. package/components/widgets/client/shared/phi-command-buttons.js +19 -5
  89. package/components/widgets/client/shared/phi-rendered-value.js +27 -3
  90. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  91. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  92. package/components/widgets/config/background.d.ts +3 -2
  93. package/components/widgets/config/choice-shared.d.ts +10 -1
  94. package/components/widgets/config/choice-shared.js +8 -2
  95. package/components/widgets/label-sets/admin-locales.js +1 -1
  96. package/components/widgets/label-sets/admin-users.d.ts +3 -5
  97. package/components/widgets/label-sets/admin-users.js +6 -10
  98. package/components/widgets/label-sets/builder-modules.js +4 -0
  99. package/components/widgets/label-sets/effects.js +2 -4
  100. package/components/widgets/label-sets/profile.d.ts +13 -16
  101. package/components/widgets/label-sets/profile.js +24 -33
  102. package/components/widgets/label-sets/registration.d.ts +0 -1
  103. package/components/widgets/label-sets/registration.js +0 -2
  104. package/components/widgets/label-sets/revisions.js +2 -0
  105. package/components/widgets/label-sets/search-results.js +2 -4
  106. package/components/widgets/label-sets/signals.js +2 -0
  107. package/components/widgets/label-sets/table.js +9 -0
  108. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  109. package/components/widgets/label-types/builder-modules.js +2 -0
  110. package/components/widgets/label-types/effects.d.ts +3 -2
  111. package/components/widgets/label-types/effects.js +1 -2
  112. package/components/widgets/label-types/revisions.d.ts +2 -0
  113. package/components/widgets/label-types/revisions.js +2 -1
  114. package/components/widgets/label-types/search-results.d.ts +2 -2
  115. package/components/widgets/label-types/search-results.js +1 -2
  116. package/components/widgets/label-types/signals.d.ts +2 -0
  117. package/components/widgets/label-types/signals.js +1 -0
  118. package/components/widgets/label-types/table.d.ts +3 -0
  119. package/components/widgets/label-types/table.js +2 -0
  120. package/components/widgets/server/builder-chrome.d.ts +4 -1
  121. package/components/widgets/server/builder-chrome.js +2 -2
  122. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  123. package/components/widgets/shared/markdown-body-client.js +31 -1
  124. package/components/widgets/shared/markdown-render.d.ts +10 -2
  125. package/components/widgets/shared/markdown-render.js +35 -13
  126. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  127. package/components/widgets/shared/widget-failure-audience.js +21 -0
  128. package/components/widgets/shared/widget-failure-client.js +5 -2
  129. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  130. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  131. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  132. package/components/widgets/shared/widget-failure-notice.js +17 -0
  133. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  134. package/components/widgets/shared/widget-failure-staff.js +18 -0
  135. package/components/widgets/shared/widget-failure.d.ts +9 -6
  136. package/components/widgets/shared/widget-failure.js +0 -9
  137. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  138. package/components/widgets/shared/widget-failure.server.js +8 -3
  139. package/constants/countries.d.ts +9 -0
  140. package/constants/countries.js +28 -0
  141. package/constants/customer-file.d.ts +34 -0
  142. package/constants/customer-file.js +35 -0
  143. package/constants/record-field-kinds.d.ts +15 -0
  144. package/constants/record-field-kinds.js +13 -0
  145. package/constants/runtime-module-ownership.js +15 -2
  146. package/constants/runtime-render-client-types.d.ts +5 -0
  147. package/constants/runtime-render-client-types.js +5 -0
  148. package/constants/site-address.d.ts +9 -0
  149. package/constants/site-address.js +10 -0
  150. package/constants/table-loading.d.ts +14 -0
  151. package/constants/table-loading.js +14 -0
  152. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  153. package/constants.d.ts +2 -0
  154. package/constants.js +4 -0
  155. package/gateway/form-handler-request.d.ts +22 -0
  156. package/gateway/form-handler-request.js +40 -0
  157. package/gateway/label-set.d.ts +15 -2
  158. package/gateway/label-set.js +60 -22
  159. package/gateway/site-cms-write-validation.js +19 -3
  160. package/gateway/site-form-route.js +11 -2
  161. package/helpers/address-field.d.ts +43 -0
  162. package/helpers/address-field.js +68 -0
  163. package/helpers/announced-action.d.ts +17 -0
  164. package/helpers/announced-action.js +29 -0
  165. package/helpers/cms-dialog.d.ts +5 -20
  166. package/helpers/cms-dialog.js +8 -13
  167. package/helpers/cms-page-catalog.d.ts +10 -0
  168. package/helpers/cms-page-catalog.js +19 -0
  169. package/helpers/cms-preset-nodes.d.ts +4 -4
  170. package/helpers/cms-preset-nodes.js +1 -1
  171. package/helpers/cms-region-keys.d.ts +1 -1
  172. package/helpers/country-names.d.ts +12 -0
  173. package/helpers/country-names.js +14 -0
  174. package/helpers/phi-metadata.d.ts +25 -1
  175. package/helpers/phi-metadata.js +53 -1
  176. package/helpers/phi-site-description.d.ts +11 -0
  177. package/helpers/phi-site-description.js +13 -0
  178. package/helpers/preset-form-check.d.ts +14 -0
  179. package/helpers/preset-form-check.js +12 -0
  180. package/helpers/preset-table-check.d.ts +38 -0
  181. package/helpers/preset-table-check.js +118 -0
  182. package/helpers/preset-text-source-check.d.ts +4 -1
  183. package/helpers/preset-text-source-check.js +6 -1
  184. package/helpers/preset-tree-contract-check.d.ts +3 -2
  185. package/helpers/preset-tree-contract-check.js +30 -5
  186. package/helpers/public-route-claims.d.ts +9 -1
  187. package/helpers/public-route-claims.js +23 -3
  188. package/helpers/record-fields.d.ts +1 -5
  189. package/helpers/record-fields.js +15 -6
  190. package/helpers/record-widget-binding.d.ts +10 -0
  191. package/helpers/record-widget-binding.js +35 -0
  192. package/helpers/record-widget.d.ts +1 -10
  193. package/helpers/record-widget.js +4 -33
  194. package/helpers/route-address-check.d.ts +22 -2
  195. package/helpers/route-address-check.js +29 -8
  196. package/helpers/site-address-row.d.ts +23 -0
  197. package/helpers/site-address-row.js +36 -0
  198. package/helpers/surface-style.d.ts +8 -1
  199. package/helpers/surface-style.js +12 -2
  200. package/helpers/table-widget-binding.d.ts +12 -0
  201. package/helpers/table-widget-binding.js +296 -0
  202. package/helpers/thread-inbox-row.d.ts +20 -0
  203. package/helpers/thread-inbox-row.js +26 -0
  204. package/helpers/translation-format.d.ts +26 -0
  205. package/helpers/translation-format.js +31 -0
  206. package/helpers/tree-widget-binding.d.ts +19 -0
  207. package/helpers/tree-widget-binding.js +72 -0
  208. package/helpers/typed-confirmation.d.ts +9 -0
  209. package/helpers/typed-confirmation.js +13 -0
  210. package/helpers/widget-binding-check.d.ts +22 -0
  211. package/helpers/widget-binding-check.js +91 -0
  212. package/module-labels.d.ts +1 -1
  213. package/module-labels.js +1 -1
  214. package/module-page-check.d.ts +3 -0
  215. package/module-page-check.js +3 -0
  216. package/module-records.d.ts +2 -2
  217. package/module-records.js +1 -0
  218. package/next/area-route.js +34 -1
  219. package/next/root-route.js +4 -4
  220. package/package.json +2 -2
  221. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  222. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  223. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  224. package/plugins/runtime-modules/accounting/ids.d.ts +14 -0
  225. package/plugins/runtime-modules/accounting/ids.js +34 -0
  226. package/plugins/runtime-modules/accounting/presets.js +32 -5
  227. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +78 -0
  228. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +136 -0
  229. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  230. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +29 -0
  231. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +450 -0
  232. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  233. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  234. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  235. package/plugins/runtime-modules/app/data-providers.d.ts +43 -0
  236. package/plugins/runtime-modules/app/data-providers.js +45 -0
  237. package/plugins/runtime-modules/app/definition.d.ts +60 -1
  238. package/plugins/runtime-modules/app/definition.js +2 -0
  239. package/plugins/runtime-modules/app/forms.d.ts +33 -3
  240. package/plugins/runtime-modules/app/forms.js +166 -31
  241. package/plugins/runtime-modules/app/ids.d.ts +8 -0
  242. package/plugins/runtime-modules/app/ids.js +9 -0
  243. package/plugins/runtime-modules/app/module.d.ts +60 -1
  244. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  245. package/plugins/runtime-modules/app/services/addresses-collection.js +105 -0
  246. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +21 -0
  247. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +143 -0
  248. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +57 -0
  249. package/plugins/runtime-modules/app/trees/addresses-label-set.js +104 -0
  250. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  251. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +28 -19
  252. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -2
  253. package/plugins/runtime-modules/app/trees/profile-label-set.js +5 -14
  254. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  255. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  256. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  257. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  258. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  259. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  260. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  261. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  262. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  263. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  264. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  265. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  266. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  267. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +6 -3
  268. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  269. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  270. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  271. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  272. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  273. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  274. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  275. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
  276. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  277. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  278. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  279. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  280. package/plugins/runtime-modules/builder/persistence.js +4 -0
  281. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  282. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  283. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
  284. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +47 -7
  285. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  286. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  287. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  288. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  289. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  290. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  291. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  292. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  293. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  294. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  295. package/plugins/runtime-modules/contracts.js +31 -1
  296. package/plugins/runtime-modules/core/definition.d.ts +23 -0
  297. package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
  298. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  299. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  300. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -2
  301. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  302. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  303. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  304. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  305. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  306. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +173 -0
  307. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  308. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  309. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  310. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  311. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  312. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  313. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  314. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  315. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  316. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  317. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  318. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  319. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  320. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  321. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  322. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  323. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  324. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  325. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  326. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  327. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  328. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  329. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  330. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  331. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  332. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  333. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  334. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  335. package/plugins/runtime-modules/core/widgets/table/client.js +48 -51
  336. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  337. package/plugins/runtime-modules/core/widgets/table/config.js +9 -0
  338. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  339. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  340. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  341. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  342. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  343. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  344. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  345. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  346. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  347. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  348. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  349. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  350. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  351. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  352. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  353. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  354. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  355. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  356. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  357. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +9 -2
  358. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  359. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  360. package/plugins/runtime-modules/resolver.js +17 -0
  361. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  362. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  363. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  364. package/plugins/runtime-modules/revisions/controller/client.js +86 -60
  365. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  366. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  367. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  368. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  369. package/plugins/runtime-modules/revisions/forms.js +1 -1
  370. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  371. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  372. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  373. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  374. package/plugins/runtime-modules/revisions/services/table.js +54 -25
  375. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +79 -4
  376. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  377. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  378. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  379. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +105 -7
  380. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  381. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  382. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  383. package/plugins/runtime-modules/threads/client-data-providers.js +10 -0
  384. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  385. package/plugins/runtime-modules/threads/controller/definition.js +49 -1
  386. package/plugins/runtime-modules/threads/data-providers.d.ts +100 -2
  387. package/plugins/runtime-modules/threads/data-providers.js +96 -0
  388. package/plugins/runtime-modules/threads/definition.d.ts +100 -2
  389. package/plugins/runtime-modules/threads/definition.js +1 -1
  390. package/plugins/runtime-modules/threads/ids.d.ts +4 -0
  391. package/plugins/runtime-modules/threads/ids.js +5 -0
  392. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  393. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  394. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  395. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  396. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +126 -0
  397. package/plugins/runtime-modules/threads/services/customer-file-table.js +79 -0
  398. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  399. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  400. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  401. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  402. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  403. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  404. package/plugins/runtime-modules/user-management/ids.js +9 -0
  405. package/plugins/runtime-modules/user-management/presets.js +17 -1
  406. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  407. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  408. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +90 -0
  409. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +122 -0
  410. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  411. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +181 -0
  412. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +24 -18
  413. package/server-helpers/cms-page-record.d.ts +9 -1
  414. package/server-helpers/cms-page-record.js +11 -1
  415. package/server-helpers/cms-request.js +8 -5
  416. package/server-helpers/link-preview-image.d.ts +30 -0
  417. package/server-helpers/link-preview-image.js +57 -0
  418. package/server-helpers/runtime.js +0 -1
  419. package/server-helpers/search-text.js +3 -0
  420. package/server-helpers.d.ts +1 -1
  421. package/server-helpers.js +1 -1
  422. package/styles/controls.css +4 -2
  423. package/styles/layout.css +7 -0
  424. package/styles/shell.css +30 -6
  425. package/theme/phi-antd-token-resolver.d.ts +8 -0
  426. package/theme/phi-antd-token-resolver.js +10 -0
  427. package/theme/phi-theme-color.d.ts +19 -0
  428. package/theme/phi-theme-color.js +42 -0
  429. package/theme/phi-theme-composition.js +9 -0
  430. package/theme/phi-theme-gradients.js +4 -22
  431. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  432. package/theme/phi-theme-inverse-ground.js +103 -0
  433. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  434. package/theme/phi-theme-palette-defaults.js +103 -0
  435. package/theme/phi-theme-tokens.d.ts +2 -1
  436. package/theme/phi-theme-tokens.js +2 -0
  437. package/types/cms-module-descriptors.d.ts +14 -0
  438. package/types/cms-overlay.d.ts +13 -6
  439. package/types/cms-overlay.js +6 -22
  440. package/types/cms-plugins.d.ts +20 -3
  441. package/types/cms.d.ts +10 -0
  442. package/types/collection-provider.d.ts +27 -0
  443. package/types/collection-signal-values.d.ts +2 -0
  444. package/types/collection-signal-values.js +23 -0
  445. package/types/collection-view-widget.d.ts +9 -0
  446. package/types/core-widget-placements.d.ts +9 -3
  447. package/types/link-preview.d.ts +19 -0
  448. package/types/link-preview.js +19 -0
  449. package/types/record-provider.d.ts +22 -1
  450. package/types/signals.d.ts +2 -0
  451. package/types/signals.js +2 -0
  452. package/types/site-theme.d.ts +27 -0
  453. package/types/table-embed.d.ts +48 -0
  454. package/types/table-embed.js +1 -0
  455. package/types/table-widget.d.ts +29 -1
  456. package/types/table-widget.js +0 -282
  457. package/types/tree-widget.d.ts +0 -1
  458. package/types/tree-widget.js +0 -60
  459. package/types/widget-runtime.d.ts +3 -1
  460. package/types.d.ts +2 -1
  461. package/types.js +1 -1
  462. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -0,0 +1,58 @@
1
+ import { isPhiRecord } from "../../helpers/is-record";
2
+ function readBit(value, where) {
3
+ const bit = /^[1-9][0-9]*$/u.test(value) ? Number(value) : Number.NaN;
4
+ if (!Number.isSafeInteger(bit) || (bit & (bit - 1)) !== 0) {
5
+ throw new Error(`The flags field ${where} "${value}" is no bit: an option's value is a power of two as a decimal number.`);
6
+ }
7
+ return bit;
8
+ }
9
+ /** The field's bits and dependencies, or an Error naming what is wrong: a field nobody can read the value of is refused. */
10
+ export function readPhiFlagsFieldConfig(config, options) {
11
+ const bits = new Map();
12
+ let all = 0;
13
+ for (const option of options) {
14
+ const bit = readBit(option.value, "option");
15
+ if ((all & bit) !== 0)
16
+ throw new Error(`The flags field names the bit ${bit} twice.`);
17
+ all |= bit;
18
+ bits.set(option.value, bit);
19
+ }
20
+ const requires = new Map();
21
+ const stated = config?.requires;
22
+ if (stated !== undefined) {
23
+ if (!isPhiRecord(stated)) {
24
+ throw new Error("The flags field's requires is no map of option values.");
25
+ }
26
+ for (const [dependent, needed] of Object.entries(stated)) {
27
+ const dependentBit = bits.get(dependent);
28
+ const neededBit = typeof needed === "string" ? bits.get(needed) : undefined;
29
+ if (dependentBit === undefined || neededBit === undefined || dependentBit === neededBit) {
30
+ throw new Error(`The flags field's requires names "${dependent}" -> "${String(needed)}", which are not two of its options.`);
31
+ }
32
+ requires.set(dependentBit, neededBit);
33
+ }
34
+ }
35
+ return { bits, requires };
36
+ }
37
+ /** The value as a number of the field's bits: anything else is none, and bits it does not offer are kept. */
38
+ export function readPhiFlagsFieldValue(value) {
39
+ return Number.isSafeInteger(value) && value >= 0 ? value : 0;
40
+ }
41
+ /**
42
+ * The value after a change of the checked options: the bits of those checked set, the field's other bits
43
+ * cleared, an option whose required one is not set cleared with it, and bits the field does not offer
44
+ * kept as they were.
45
+ */
46
+ export function writePhiFlagsFieldValue(config, previous, checked) {
47
+ let offered = 0;
48
+ for (const bit of config.bits.values())
49
+ offered |= bit;
50
+ let next = previous & ~offered;
51
+ for (const value of checked)
52
+ next |= config.bits.get(value) ?? 0;
53
+ for (const [dependent, needed] of config.requires) {
54
+ if ((next & needed) === 0)
55
+ next &= ~dependent;
56
+ }
57
+ return next;
58
+ }
@@ -0,0 +1,18 @@
1
+ import type { PhiFormDescriptor } from "@phis/contracts/forms";
2
+ /**
3
+ * What a Form's fields break of the rules their Controls read them by, as messages, checked where the
4
+ * Form is made (owner, 2026-11-24) rather than when a Control throws on a live page:
5
+ *
6
+ * - a `money` field's config: exactly one of `currency`, `currencies`, `currencyField` or an
7
+ * `optionsProvider`, every currency stated an ISO 4217 code a payment accepts, the bounds whole minor
8
+ * units (`readPhiMoneyFieldConfig`); and a `currencyField` naming another field of the same Form;
9
+ * - a `flags` field with options written out: each option's value a bit, none twice, and `requires`
10
+ * naming two of its options (`readPhiFlagsFieldConfig`). Options an Options Provider answers are only
11
+ * known once it answers, and are read by the Control then.
12
+ *
13
+ * A validation rule naming a Provider nobody declares is refused by catalog construction, which knows
14
+ * the Area's Providers (`plugins/runtime-modules/resolver.ts`); this check knows only the descriptor.
15
+ * It runs at verify time, from `checkPhiPresetForms` (`@phis/ui/module/page-check`) in a package's tests
16
+ * and phis-ui's own: a Site never loads it, and the Controls still read their configs strictly.
17
+ */
18
+ export declare function checkPhiFormDescriptorFields(descriptor: Pick<PhiFormDescriptor, "fields">): string[];
@@ -0,0 +1,41 @@
1
+ import { readPhiFlagsFieldConfig } from "./flags-field";
2
+ import { readPhiMoneyFieldConfig } from "./money-field";
3
+ import { PHI_FORM_FIELD_PROVIDER_KEYS } from "./form-provider-contract";
4
+ /**
5
+ * What a Form's fields break of the rules their Controls read them by, as messages, checked where the
6
+ * Form is made (owner, 2026-11-24) rather than when a Control throws on a live page:
7
+ *
8
+ * - a `money` field's config: exactly one of `currency`, `currencies`, `currencyField` or an
9
+ * `optionsProvider`, every currency stated an ISO 4217 code a payment accepts, the bounds whole minor
10
+ * units (`readPhiMoneyFieldConfig`); and a `currencyField` naming another field of the same Form;
11
+ * - a `flags` field with options written out: each option's value a bit, none twice, and `requires`
12
+ * naming two of its options (`readPhiFlagsFieldConfig`). Options an Options Provider answers are only
13
+ * known once it answers, and are read by the Control then.
14
+ *
15
+ * A validation rule naming a Provider nobody declares is refused by catalog construction, which knows
16
+ * the Area's Providers (`plugins/runtime-modules/resolver.ts`); this check knows only the descriptor.
17
+ * It runs at verify time, from `checkPhiPresetForms` (`@phis/ui/module/page-check`) in a package's tests
18
+ * and phis-ui's own: a Site never loads it, and the Controls still read their configs strictly.
19
+ */
20
+ export function checkPhiFormDescriptorFields(descriptor) {
21
+ const findings = [];
22
+ const keys = new Set(descriptor.fields.map((field) => field.key));
23
+ for (const field of descriptor.fields) {
24
+ const where = `Field "${field.key}"`;
25
+ try {
26
+ if (field.fieldProviderKey === PHI_FORM_FIELD_PROVIDER_KEYS.money) {
27
+ const money = readPhiMoneyFieldConfig(field.config, { hasOptionsProvider: field.optionsProvider != null });
28
+ if (money.currencyField !== undefined && (money.currencyField === field.key || !keys.has(money.currencyField))) {
29
+ findings.push(`${where} takes its currency from "${money.currencyField}", which is no other field of its Form.`);
30
+ }
31
+ }
32
+ else if (field.fieldProviderKey === PHI_FORM_FIELD_PROVIDER_KEYS.flags && field.options && !field.optionsProvider) {
33
+ readPhiFlagsFieldConfig(field.config, field.options);
34
+ }
35
+ }
36
+ catch (error) {
37
+ findings.push(`${where}: ${error instanceof Error ? error.message : String(error)}`);
38
+ }
39
+ }
40
+ return findings;
41
+ }
@@ -2,14 +2,13 @@
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { isPhiRecord } from "../../helpers/is-record";
4
4
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
- import { readPhiTableActionSignalValue } from "../../types/table-signal-values";
6
5
  import { usePhiSignalListener } from "../runtime/runtime-signal-bus";
7
6
  import { createPhiSignalCorrelationId } from "../runtime/runtime-signal-bus";
8
7
  import { emitPhiSignalCapability, usePhiSignalEmitter, usePhiSignalIdentity, } from "../runtime/runtime-signal-identity";
9
8
  import { isPhiControllerSignalAddress } from "../../types/signals";
10
9
  import { readPhiRuntimeConditionStateSignalValue } from "../../types/runtime-condition";
11
10
  import { collectPhiRuntimeValueConditions } from "../../types/runtime-condition";
12
- import { usePhiTableProvider } from "../widgets/client/shared/phi-table-provider";
11
+ import { readPhiFormRecordOpenKey, usePhiFormRecordSource } from "./form-record-source";
13
12
  import { usePhiIntlLocale, usePhiIntlTimeZone } from "../root/phi-intl-locale";
14
13
  import { PhiFormControl } from "../controls/phi-form-control";
15
14
  import { readPhiRuntimeFormValuesSignalValue } from "./runtime-form-state";
@@ -41,7 +40,8 @@ export function PhiFormDescriptorRuntimeClient({ descriptor, labels, loadedIniti
41
40
  const inDialogBody = usePhiInDialogBody();
42
41
  const emitSignal = usePhiSignalEmitter(identity.sender);
43
42
  const source = widgetConfig?.source ?? null;
44
- const { provider, resource, bindingError } = usePhiTableProvider(source);
43
+ // A Table resource's or a Collection resource's, whichever Provider answers the source's key.
44
+ const recordSource = usePhiFormRecordSource(source);
45
45
  /*
46
46
  * Sent with the record read, but held in a ref rather than made part of what starts one: a Form's
47
47
  * values are what somebody is editing, and a language switch that read the record again would throw
@@ -175,17 +175,17 @@ export function PhiFormDescriptorRuntimeClient({ descriptor, labels, loadedIniti
175
175
  if (!source) {
176
176
  return configuredInitialValues;
177
177
  }
178
- if (bindingError || resource?.recordRead !== true || !provider?.readRecord) {
179
- throw new Error(bindingError ?? `Table resource "${source.resourceKey}" is not a Form record read source.`);
178
+ if (!recordSource.read) {
179
+ throw new Error(recordSource.error ?? `Resource "${source.resourceKey}" is not a Form record read source.`);
180
180
  }
181
- return provider.readRecord({
181
+ return recordSource.read({
182
182
  resourceKey: source.resourceKey,
183
183
  rowIdentity,
184
184
  params: source.params,
185
185
  ...intlRef.current,
186
186
  signal,
187
187
  });
188
- }, [bindingError, configuredInitialValues, provider, resource?.recordRead, source]);
188
+ }, [configuredInitialValues, recordSource, source]);
189
189
  /*
190
190
  * The one record read in flight. Every new read aborts the one before it, and unmount aborts the
191
191
  * last: two reads racing meant the slower one wrote `record` and `recordIdentityRef` last, so a Form
@@ -270,11 +270,12 @@ export function PhiFormDescriptorRuntimeClient({ descriptor, labels, loadedIniti
270
270
  if (!route)
271
271
  return;
272
272
  if (route.capabilityId === "recordOpen") {
273
- const action = readPhiTableActionSignalValue(signal.value);
274
- if (!action || action.actionKey !== (widgetConfig?.openActionKey ?? "edit") || action.rowIdentity == null)
273
+ // A Table's row action or a Collection View's item action, whichever the route carries.
274
+ const recordKey = readPhiFormRecordOpenKey(route.valueSchema, signal.value, widgetConfig?.openActionKey ?? "edit");
275
+ if (recordKey == null)
275
276
  return;
276
277
  announceRecordTitle(null, signal.correlationId);
277
- void loadRecord(action.rowIdentity, signal.correlationId);
278
+ void loadRecord(recordKey, signal.correlationId);
278
279
  emitCapability("conditionStateRequest", null, signal.correlationId);
279
280
  }
280
281
  else if (route.capabilityId === "close") {
@@ -0,0 +1,20 @@
1
+ import type { PhiFormFieldDescriptor } from "../../types/form-descriptor";
2
+ /**
3
+ * The fields whose chosen option an `optionFlag` condition of the Form reads, by key.
4
+ *
5
+ * Only these report their option's flags upward: every other field's options stay its own business, so
6
+ * a Form without such a condition renders exactly as before.
7
+ */
8
+ export declare function collectFormOptionFlagFieldKeys(fields: readonly PhiFormFieldDescriptor[]): ReadonlySet<string>;
9
+ /**
10
+ * The flags of what a field holds, among the options it offers: every chosen option's `flags` together,
11
+ * 0 for a field that holds nothing.
12
+ *
13
+ * `undefined` where a held value is among none of the options -- the list still loading, or a value the
14
+ * answer left out -- because then nobody knows what was chosen, and an `optionFlag` condition on it is
15
+ * unavailable rather than false.
16
+ */
17
+ export declare function resolveFormChosenOptionFlags(options: readonly {
18
+ value: string | number;
19
+ flags?: number;
20
+ }[] | null | undefined, held: unknown): number | undefined;
@@ -0,0 +1,38 @@
1
+ import { collectPhiRuntimeValueConditions } from "../../types/runtime-condition";
2
+ /**
3
+ * The fields whose chosen option an `optionFlag` condition of the Form reads, by key.
4
+ *
5
+ * Only these report their option's flags upward: every other field's options stay its own business, so
6
+ * a Form without such a condition renders exactly as before.
7
+ */
8
+ export function collectFormOptionFlagFieldKeys(fields) {
9
+ const keys = new Set();
10
+ for (const field of fields) {
11
+ for (const expression of [field.visibleWhen, field.disabledWhen]) {
12
+ for (const condition of collectPhiRuntimeValueConditions(expression)) {
13
+ if (condition.operator === "optionFlag")
14
+ keys.add(condition.valuePath);
15
+ }
16
+ }
17
+ }
18
+ return keys;
19
+ }
20
+ /**
21
+ * The flags of what a field holds, among the options it offers: every chosen option's `flags` together,
22
+ * 0 for a field that holds nothing.
23
+ *
24
+ * `undefined` where a held value is among none of the options -- the list still loading, or a value the
25
+ * answer left out -- because then nobody knows what was chosen, and an `optionFlag` condition on it is
26
+ * unavailable rather than false.
27
+ */
28
+ export function resolveFormChosenOptionFlags(options, held) {
29
+ const values = (Array.isArray(held) ? held : [held]).filter((entry) => (typeof entry === "string" && entry !== "") || (typeof entry === "number" && Number.isFinite(entry)));
30
+ let flags = 0;
31
+ for (const value of values) {
32
+ const option = options?.find((entry) => entry.value === value);
33
+ if (!option)
34
+ return undefined;
35
+ flags |= option.flags ?? 0;
36
+ }
37
+ return flags;
38
+ }
@@ -25,6 +25,9 @@ export declare const PHI_FORM_FIELD_PROVIDER_KEYS: {
25
25
  readonly upload: `${string}/${string}`;
26
26
  readonly linkTarget: `${string}/${string}`;
27
27
  readonly money: `${string}/${string}`;
28
+ readonly country: `${string}/${string}`;
29
+ readonly address: `${string}/${string}`;
30
+ readonly flags: `${string}/${string}`;
28
31
  };
29
32
  export declare const PHI_AUTH_FORM_FIELD_PROVIDER_KEYS: {
30
33
  readonly termsConsent: `${string}/${string}`;
@@ -442,6 +445,26 @@ export declare const PHI_SHARED_FORM_FIELD_TYPE_PROVIDER_DESCRIPTORS: readonly [
442
445
  readonly min: 0;
443
446
  readonly precision: 0;
444
447
  }];
448
+ }, {
449
+ readonly key: `${string}/${string}`;
450
+ readonly title: "Country";
451
+ readonly valueType: "string";
452
+ readonly presentation: "control";
453
+ readonly settingsFields: readonly [{
454
+ readonly key: "allowClear";
455
+ readonly type: "boolean";
456
+ readonly label: "Allow clear";
457
+ }];
458
+ }, {
459
+ readonly key: `${string}/${string}`;
460
+ readonly title: "Address";
461
+ readonly valueType: "json";
462
+ readonly presentation: "control";
463
+ }, {
464
+ readonly key: `${string}/${string}`;
465
+ readonly title: "Flags";
466
+ readonly valueType: "number";
467
+ readonly presentation: "control";
445
468
  }];
446
469
  export declare const PHI_SHARED_FORM_VALIDATION_PROVIDER_DESCRIPTORS: readonly [{
447
470
  readonly key: `${string}/${string}`;
@@ -36,6 +36,9 @@ export const PHI_FORM_FIELD_PROVIDER_KEYS = {
36
36
  upload: PHI_FORM_UPLOAD_FIELD_PROVIDER_KEY,
37
37
  linkTarget: createPhiSharedFormProviderKey("field", "link-target"),
38
38
  money: createPhiSharedFormProviderKey("field", "money"),
39
+ country: createPhiSharedFormProviderKey("field", "country"),
40
+ address: createPhiSharedFormProviderKey("field", "address"),
41
+ flags: createPhiSharedFormProviderKey("field", "flags"),
39
42
  };
40
43
  export const PHI_AUTH_FORM_FIELD_PROVIDER_KEYS = {
41
44
  termsConsent: createPhiSharedFormProviderKey("field", "auth-terms-consent"),
@@ -311,6 +314,39 @@ export const PHI_SHARED_FORM_FIELD_TYPE_PROVIDER_DESCRIPTORS = [
311
314
  { key: "max", type: "number", label: "Maximum", description: "In minor units.", min: 0, precision: 0 },
312
315
  ],
313
316
  },
317
+ /*
318
+ * A country of ISO 3166-1: the value is its alpha-2 code, uppercase, as Core stores an address's
319
+ * country; the options are named in the reader's language (`helpers/country-names.ts`) and searchable.
320
+ */
321
+ {
322
+ key: PHI_FORM_FIELD_PROVIDER_KEYS.country,
323
+ title: "Country",
324
+ valueType: "string",
325
+ presentation: "control",
326
+ settingsFields: [{ key: "allowClear", type: "boolean", label: "Allow clear" }],
327
+ },
328
+ /*
329
+ * One postal address as Core writes it (`PhisSiteAddressInput` of `@phis/contracts/users`): `json`, the
330
+ * parts in one object, an empty optional part `null`. The field holds each part to what Core takes
331
+ * (`helpers/address-field.ts`) and reads its words from the Form's Label Set
332
+ * (`PHI_FORM_ADDRESS_LABEL_KEYS`).
333
+ */
334
+ {
335
+ key: PHI_FORM_FIELD_PROVIDER_KEYS.address,
336
+ title: "Address",
337
+ valueType: "json",
338
+ presentation: "control",
339
+ },
340
+ /*
341
+ * Several yes-or-no answers as one bit-flag number: each option's value is its bit as a decimal number,
342
+ * `config.requires` an option another needs (`flags-field.ts`).
343
+ */
344
+ {
345
+ key: PHI_FORM_FIELD_PROVIDER_KEYS.flags,
346
+ title: "Flags",
347
+ valueType: "number",
348
+ presentation: "control",
349
+ },
314
350
  ];
315
351
  export const PHI_SHARED_FORM_VALIDATION_PROVIDER_DESCRIPTORS = [
316
352
  { key: PHI_FORM_VALIDATION_PROVIDER_KEYS.required, title: "Required" },
@@ -33,8 +33,12 @@ export type PhiFormFieldProviderProps = {
33
33
  * shows if somebody submits anyway; `null` releases it. For a value that only arrives later -- an
34
34
  * upload whose Asset id comes once the body is there. A submit while a hold stands does not reach
35
35
  * the handler: it fails the way a rule fails, on this field and through `onValidationFailed`.
36
+ *
37
+ * A field whose parts each say what is wrong with them (the address) passes `onRefused`: a refused
38
+ * submit then calls it instead of writing the sentence under the whole field, so no part's sentence
39
+ * stands a second time below the last part.
36
40
  */
37
- holdSubmit(fieldKey: string, reason: string | null): void;
41
+ holdSubmit(fieldKey: string, reason: string | null, onRefused?: () => void): void;
38
42
  };
39
43
  /**
40
44
  * The live values of the fields this Form watches -- those a `visibleWhen`, `disabledWhen` or options
@@ -0,0 +1,38 @@
1
+ import type { PhiProviderResourceSource } from "../../types/runtime-data-provider";
2
+ import type { PhiTableProviderRecordRequest } from "../../types/table-widget";
3
+ import type { PhiSignalValueSchema } from "../../types/signals";
4
+ type RecordReader = (request: PhiTableProviderRecordRequest) => Promise<Record<string, unknown>>;
5
+ type ProviderLookup = {
6
+ provider: {
7
+ readRecord?: RecordReader;
8
+ } | null;
9
+ resource: {
10
+ recordRead?: boolean;
11
+ } | null;
12
+ bindingError: string | null;
13
+ };
14
+ /**
15
+ * Where a record-bound Form reads its record (`source`): a Table Provider's resource, or a Collection
16
+ * Provider's, whichever of the two the Area mounted under the source's key -- a Provider key names one
17
+ * kind, so at most one answers. Either reads through its Client's `readRecord`, in the one request shape
18
+ * (`PhiTableProviderRecordRequest`), and only for a resource that declares `recordRead: true`.
19
+ *
20
+ * `read` is null where there is nothing to read with, and `error` then says why; both are null without a
21
+ * source, which is a Form that starts from its placement's values.
22
+ */
23
+ export declare function resolvePhiFormRecordSource(source: PhiProviderResourceSource | null, table: ProviderLookup, collection: ProviderLookup): {
24
+ read: RecordReader | null;
25
+ error: string | null;
26
+ };
27
+ export declare function usePhiFormRecordSource(source: PhiProviderResourceSource | null): {
28
+ read: RecordReader | null;
29
+ error: string | null;
30
+ };
31
+ /**
32
+ * The record a `recordOpen` asks for, or null where it is not meant for this Form: a Table's row action
33
+ * (`table-action`, its `rowIdentity`) or a Collection View's item action (`collection-action`, its
34
+ * `itemKey`), named by the Form's `openActionKey` and carrying a record. Which of the two arrived is the
35
+ * route's schema; anything else opens nothing.
36
+ */
37
+ export declare function readPhiFormRecordOpenKey(valueSchema: PhiSignalValueSchema | null | undefined, value: unknown, openActionKey: string): string | number | null;
38
+ export {};
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { usePhiTableProvider } from "../widgets/client/shared/phi-table-provider";
4
+ import { usePhiCollectionProvider } from "../widgets/client/shared/phi-collection-provider";
5
+ import { readPhiAnnouncedAction } from "../../helpers/announced-action";
6
+ /**
7
+ * Where a record-bound Form reads its record (`source`): a Table Provider's resource, or a Collection
8
+ * Provider's, whichever of the two the Area mounted under the source's key -- a Provider key names one
9
+ * kind, so at most one answers. Either reads through its Client's `readRecord`, in the one request shape
10
+ * (`PhiTableProviderRecordRequest`), and only for a resource that declares `recordRead: true`.
11
+ *
12
+ * `read` is null where there is nothing to read with, and `error` then says why; both are null without a
13
+ * source, which is a Form that starts from its placement's values.
14
+ */
15
+ export function resolvePhiFormRecordSource(source, table, collection) {
16
+ if (!source)
17
+ return { read: null, error: null };
18
+ const lookup = table.provider ? table : collection.provider ? collection : null;
19
+ if (!lookup)
20
+ return { read: null, error: table.bindingError };
21
+ if (lookup.bindingError)
22
+ return { read: null, error: lookup.bindingError };
23
+ const readRecord = lookup.provider?.readRecord;
24
+ if (lookup.resource?.recordRead !== true || !readRecord) {
25
+ return {
26
+ read: null,
27
+ error: `${lookup === table ? "Table" : "Collection"} resource "${source.resourceKey}" is not a Form record read source.`,
28
+ };
29
+ }
30
+ return { read: readRecord, error: null };
31
+ }
32
+ export function usePhiFormRecordSource(source) {
33
+ const { provider: tableProvider, resource: tableResource, bindingError: tableError } = usePhiTableProvider(source);
34
+ const { provider: collectionProvider, resource: collectionResource, bindingError: collectionError, } = usePhiCollectionProvider(source);
35
+ return useMemo(() => resolvePhiFormRecordSource(source, { provider: tableProvider, resource: tableResource, bindingError: tableError }, { provider: collectionProvider, resource: collectionResource, bindingError: collectionError }), [collectionError, collectionProvider, collectionResource, source, tableError, tableProvider, tableResource]);
36
+ }
37
+ /**
38
+ * The record a `recordOpen` asks for, or null where it is not meant for this Form: a Table's row action
39
+ * (`table-action`, its `rowIdentity`) or a Collection View's item action (`collection-action`, its
40
+ * `itemKey`), named by the Form's `openActionKey` and carrying a record. Which of the two arrived is the
41
+ * route's schema; anything else opens nothing.
42
+ */
43
+ export function readPhiFormRecordOpenKey(valueSchema, value, openActionKey) {
44
+ const announced = readPhiAnnouncedAction(valueSchema, value);
45
+ if (!announced || announced.actionKey !== openActionKey)
46
+ return null;
47
+ return announced.recordKey;
48
+ }
@@ -226,40 +226,6 @@ export declare const PHI_REGISTRATION_FORM_DESCRIPTOR: {
226
226
  readonly fallback: "/terms-and-conditions";
227
227
  };
228
228
  };
229
- }, {
230
- readonly key: "newsletter";
231
- readonly fieldProviderKey: `${string}/${string}`;
232
- readonly controlLabel: PhiFormTextDescriptor;
233
- readonly placement: {
234
- readonly label: {
235
- readonly compact: {
236
- readonly start: 1;
237
- readonly end: number;
238
- };
239
- readonly medium: {
240
- readonly start: 1;
241
- readonly end: number;
242
- };
243
- readonly wide: {
244
- readonly start: 1;
245
- readonly end: number;
246
- };
247
- };
248
- readonly control: {
249
- readonly compact: {
250
- readonly start: 1;
251
- readonly end: number;
252
- };
253
- readonly medium: {
254
- readonly start: 1;
255
- readonly end: number;
256
- };
257
- readonly wide: {
258
- readonly start: 1;
259
- readonly end: number;
260
- };
261
- };
262
- };
263
229
  }];
264
230
  readonly success: {
265
231
  readonly title: PhiFormTextDescriptor;
@@ -176,12 +176,6 @@ export const PHI_REGISTRATION_FORM_DESCRIPTOR = {
176
176
  href: { kind: "config", key: "termsHref", fallback: "/terms-and-conditions" },
177
177
  },
178
178
  },
179
- {
180
- key: "newsletter",
181
- fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.checkbox,
182
- controlLabel: label("consent.newsletter", "Send me product and platform updates."),
183
- placement: PHI_FORM_STACKED_FULL,
184
- },
185
179
  ],
186
180
  success: {
187
181
  title: label("feedback.successTitle", "Account created"),
@@ -26,7 +26,7 @@ export declare const PHI_SHARED_FORM_IDS: {
26
26
  /**
27
27
  * The two credentials a signed-in person changes about themselves.
28
28
  *
29
- * They belong beside the sign-in Forms rather than with the profile's name and newsletter, for the
29
+ * They belong beside the sign-in Forms rather than with the profile's name and language, for the
30
30
  * same reason the security Page belongs to this Module: a password and the address it is tied to are
31
31
  * how somebody proves who they are, and whoever answers that question owns the Forms that change it.
32
32
  */
@@ -28,7 +28,7 @@ export const PHI_SHARED_FORM_IDS = {
28
28
  /**
29
29
  * The two credentials a signed-in person changes about themselves.
30
30
  *
31
- * They belong beside the sign-in Forms rather than with the profile's name and newsletter, for the
31
+ * They belong beside the sign-in Forms rather than with the profile's name and language, for the
32
32
  * same reason the security Page belongs to this Module: a password and the address it is tied to are
33
33
  * how somebody proves who they are, and whoever answers that question owns the Forms that change it.
34
34
  */
@@ -14,6 +14,10 @@ const PhiLazySegmentedFormControl = lazyPhiFormFieldControl(() => import("./choi
14
14
  const PhiLazyNumberFormControl = lazyPhiFormFieldControl(() => import("./extended-form-field-controls").then((module) => module.PhiNumberFormControl));
15
15
  const PhiLazyStorageSizeFormControl = lazyPhiFormFieldControl(() => import("./extended-form-field-controls").then((module) => module.PhiStorageSizeFormControl));
16
16
  const PhiLazyMoneyFormControl = lazyPhiFormFieldControl(() => import("./extended-form-field-controls").then((module) => module.PhiMoneyFormControl));
17
+ const PhiLazyCountryFormControl = lazyPhiFormFieldControl(() => import("./structured-form-field-controls").then((module) => module.PhiCountryFormControl));
18
+ // Eight parts in six rows.
19
+ const PhiLazyAddressFormControl = lazyPhiFormFieldControl(() => import("./structured-form-field-controls").then((module) => module.PhiAddressFormControl), 6);
20
+ const PhiLazyFlagsFormControl = lazyPhiFormFieldControl(() => import("./structured-form-field-controls").then((module) => module.PhiFlagsFormControl), 2);
17
21
  const PhiLazySliderFormControl = lazyPhiFormFieldControl(() => import("./extended-form-field-controls").then((module) => module.PhiSliderFormControl));
18
22
  const PhiLazyCascaderFormControl = lazyPhiFormFieldControl(() => import("./extended-form-field-controls").then((module) => module.PhiCascaderFormControl));
19
23
  const PhiLazyDateTimeFormControl = lazyPhiFormFieldControl(() => import("./datetime-form-control").then((module) => module.PhiDateTimeFormControl));
@@ -128,6 +132,15 @@ export const PHI_SHARED_FORM_PROVIDER_REGISTRY = createPhiFormProviderRegistry({
128
132
  phiSharedFieldType(PHI_FORM_FIELD_PROVIDER_KEYS.money, {
129
133
  Control: PhiLazyMoneyFormControl,
130
134
  }),
135
+ phiSharedFieldType(PHI_FORM_FIELD_PROVIDER_KEYS.country, {
136
+ Control: PhiLazyCountryFormControl,
137
+ }),
138
+ phiSharedFieldType(PHI_FORM_FIELD_PROVIDER_KEYS.address, {
139
+ Control: PhiLazyAddressFormControl,
140
+ }),
141
+ phiSharedFieldType(PHI_FORM_FIELD_PROVIDER_KEYS.flags, {
142
+ Control: PhiLazyFlagsFormControl,
143
+ }),
131
144
  ],
132
145
  validationRules: [
133
146
  phiSharedValidationRule(PHI_FORM_VALIDATION_PROVIDER_KEYS.required, {
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The `address` field's own wording, read from the Form's Label Set under these keys and falling back to
3
+ * English, as the Media fields' are: one label per part, the sentence for each required part left empty,
4
+ * one for a part longer than Core stores (`%1` the part's label, `%2` the most characters) and one for a
5
+ * country that is no code of the list. A Form that places an address field states them in its Label Set.
6
+ */
7
+ export declare const PHI_FORM_ADDRESS_LABEL_KEYS: {
8
+ readonly name: "addressName";
9
+ readonly companyName: "addressCompanyName";
10
+ readonly line1: "addressLine1";
11
+ readonly line2: "addressLine2";
12
+ readonly postalCode: "addressPostalCode";
13
+ readonly city: "addressCity";
14
+ readonly region: "addressRegion";
15
+ readonly country: "addressCountry";
16
+ readonly nameRequired: "addressNameRequired";
17
+ readonly line1Required: "addressLine1Required";
18
+ readonly cityRequired: "addressCityRequired";
19
+ readonly countryRequired: "addressCountryRequired";
20
+ readonly tooLong: "addressTooLong";
21
+ };
22
+ export type PhiFormAddressLabels = Record<keyof typeof PHI_FORM_ADDRESS_LABEL_KEYS, string>;
23
+ /** The address field's words from the Form's Label Set, each empty one in English. */
24
+ export declare function readPhiFormAddressLabels(labels: Readonly<Record<string, string>> | undefined): PhiFormAddressLabels;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The `address` field's own wording, read from the Form's Label Set under these keys and falling back to
3
+ * English, as the Media fields' are: one label per part, the sentence for each required part left empty,
4
+ * one for a part longer than Core stores (`%1` the part's label, `%2` the most characters) and one for a
5
+ * country that is no code of the list. A Form that places an address field states them in its Label Set.
6
+ */
7
+ export const PHI_FORM_ADDRESS_LABEL_KEYS = {
8
+ name: "addressName",
9
+ companyName: "addressCompanyName",
10
+ line1: "addressLine1",
11
+ line2: "addressLine2",
12
+ postalCode: "addressPostalCode",
13
+ city: "addressCity",
14
+ region: "addressRegion",
15
+ country: "addressCountry",
16
+ nameRequired: "addressNameRequired",
17
+ line1Required: "addressLine1Required",
18
+ cityRequired: "addressCityRequired",
19
+ countryRequired: "addressCountryRequired",
20
+ tooLong: "addressTooLong",
21
+ };
22
+ const PHI_FORM_ADDRESS_DEFAULT_LABELS = {
23
+ name: "Name",
24
+ companyName: "Company",
25
+ line1: "Street and number",
26
+ line2: "Address line 2",
27
+ postalCode: "Postal code",
28
+ city: "City",
29
+ region: "Region",
30
+ country: "Country",
31
+ nameRequired: "Enter the name the address is made out to.",
32
+ line1Required: "Enter the street and number.",
33
+ cityRequired: "Enter the city.",
34
+ countryRequired: "Choose the country.",
35
+ tooLong: "%1 takes at most %2 characters.",
36
+ };
37
+ /** The address field's words from the Form's Label Set, each empty one in English. */
38
+ export function readPhiFormAddressLabels(labels) {
39
+ return Object.fromEntries(Object.keys(PHI_FORM_ADDRESS_LABEL_KEYS).map((key) => [
40
+ key,
41
+ labels?.[PHI_FORM_ADDRESS_LABEL_KEYS[key]]?.trim() || PHI_FORM_ADDRESS_DEFAULT_LABELS[key],
42
+ ]));
43
+ }
@@ -0,0 +1,12 @@
1
+ import { type ComponentType } from "react";
2
+ import type { PhiFormFieldProviderProps } from "./form-provider-registry";
3
+ export declare const PhiCountryFormControl: ComponentType<PhiFormFieldProviderProps>;
4
+ /**
5
+ * One address, `PhisSiteAddressInput`, as one value. Each part is held to what Core takes -- the four
6
+ * required parts, the column widths, a country of the list -- and while one is not, the field holds the
7
+ * Form's submit with the first sentence (`formContext.holdSubmit`); a part says what is wrong with it once
8
+ * it has been left.
9
+ */
10
+ export declare const PhiAddressFormControl: ComponentType<PhiFormFieldProviderProps>;
11
+ /** Several yes-or-no answers as one bit-flag number (`flags-field.ts`). */
12
+ export declare const PhiFlagsFormControl: ComponentType<PhiFormFieldProviderProps>;