@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
@@ -1,5 +1,6 @@
1
1
  import { definePhiAreaBaseRuntimeModuleDefinition } from "../area-base-definition";
2
2
  import { PHI_APP_FORM_HANDLER_PROVIDER_DESCRIPTORS } from "./forms";
3
+ import { PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "./data-providers";
3
4
  import { PHI_APP_RUNTIME_MODULE_IDENTITY } from "./ids";
4
5
  import { PHI_CORE_SERVER_BINDING, } from "../../../types/server-capabilities";
5
6
  export const PHI_APP_RUNTIME_MODULE_DEFINITION = definePhiAreaBaseRuntimeModuleDefinition({
@@ -12,4 +13,5 @@ export const PHI_APP_RUNTIME_MODULE_DEFINITION = definePhiAreaBaseRuntimeModuleD
12
13
  formProviders: {
13
14
  handlers: PHI_APP_FORM_HANDLER_PROVIDER_DESCRIPTORS,
14
15
  },
16
+ dataProviders: PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS,
15
17
  });
@@ -12,11 +12,13 @@
12
12
  */
13
13
  export declare const PHI_APP_FORM_IDS: {
14
14
  readonly profileName: `${string}/forms/${string}`;
15
- readonly profileNewsletter: `${string}/forms/${string}`;
15
+ readonly profilePhone: `${string}/forms/${string}`;
16
+ readonly addressCreate: `${string}/forms/${string}`;
17
+ readonly addressEdit: `${string}/forms/${string}`;
16
18
  readonly profileLocale: `${string}/forms/${string}`;
17
19
  readonly profileTheme: `${string}/forms/${string}`;
18
20
  };
19
- export declare const PHI_APP_RUNTIME_MODULE_FORMS: readonly [import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition];
21
+ export declare const PHI_APP_RUNTIME_MODULE_FORMS: readonly [import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition, import("../contracts").PhiRuntimeModuleFormDefinition];
20
22
  export declare const PHI_APP_FORM_HANDLER_PROVIDER_DESCRIPTORS: ({
21
23
  key: `${string}/${string}`;
22
24
  ownerModuleId: "@phis/ui/modules/app";
@@ -36,7 +38,7 @@ export declare const PHI_APP_FORM_HANDLER_PROVIDER_DESCRIPTORS: ({
36
38
  ownerModuleId: "@phis/ui/modules/app";
37
39
  title: string;
38
40
  phase: "submit";
39
- handlerKey: "site.app.profile-newsletter";
41
+ handlerKey: "site.app.profile-phone";
40
42
  category: "site";
41
43
  transport: "relay";
42
44
  method: "PATCH";
@@ -45,6 +47,34 @@ export declare const PHI_APP_FORM_HANDLER_PROVIDER_DESCRIPTORS: ({
45
47
  csrfPath: string;
46
48
  requiresCsrf: true;
47
49
  credentialPolicy: "site-session";
50
+ } | {
51
+ key: `${string}/${string}`;
52
+ ownerModuleId: "@phis/ui/modules/app";
53
+ title: string;
54
+ phase: "submit";
55
+ handlerKey: "site.app.address-create";
56
+ category: "site";
57
+ transport: "relay";
58
+ method: "POST";
59
+ endpointKey: null;
60
+ upstreamPath: string;
61
+ csrfPath: null;
62
+ requiresCsrf: false;
63
+ credentialPolicy: "site-session";
64
+ } | {
65
+ key: `${string}/${string}`;
66
+ ownerModuleId: "@phis/ui/modules/app";
67
+ title: string;
68
+ phase: "submit";
69
+ handlerKey: "site.app.address-edit";
70
+ category: "site";
71
+ transport: "relay";
72
+ method: "PUT";
73
+ endpointKey: null;
74
+ upstreamPath: string;
75
+ csrfPath: null;
76
+ requiresCsrf: false;
77
+ credentialPolicy: "site-session";
48
78
  } | {
49
79
  key: `${string}/${string}`;
50
80
  ownerModuleId: "@phis/ui/modules/app";
@@ -1,11 +1,12 @@
1
1
  import { createPhiFormLabelSetLoader } from "../../../components/forms/shared-form-loaders";
2
2
  import { createPhiFormId } from "../../../types/form-id";
3
3
  import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
4
- import { PHI_FORM_FIELD_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../components/forms/form-provider-contract";
4
+ import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_VALIDATION_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../components/forms/form-provider-contract";
5
5
  import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-data-provider-keys";
6
6
  import { definePhiRuntimeModuleForm } from "../../../components/forms/form-registry";
7
7
  import { PHI_APP_RUNTIME_MODULE_ID } from "./ids";
8
8
  import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
9
+ import { PhisSiteAddressFlags } from "@phis/contracts/users";
9
10
  /**
10
11
  * What a signed-in person can settle about their own account, as Forms rather than as Widgets.
11
12
  *
@@ -20,18 +21,23 @@ import { phiFormLabel as label } from "../../../components/forms/form-descriptor
20
21
  */
21
22
  export const PHI_APP_FORM_IDS = {
22
23
  profileName: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/profile-name"),
23
- profileNewsletter: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/profile-newsletter"),
24
+ profilePhone: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/profile-phone"),
25
+ addressCreate: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/address-create"),
26
+ addressEdit: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/address-edit"),
24
27
  profileLocale: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/profile-locale"),
25
28
  profileTheme: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "app/profile-theme"),
26
29
  };
27
30
  const PHI_APP_FORM_HANDLER_KEYS = {
28
31
  profileName: "site.app.profile-name",
29
- profileNewsletter: "site.app.profile-newsletter",
32
+ profilePhone: "site.app.profile-phone",
33
+ addressCreate: "site.app.address-create",
34
+ addressEdit: "site.app.address-edit",
30
35
  profileLocale: "site.app.profile-locale",
31
36
  profileTheme: "site.app.profile-theme",
32
37
  };
33
38
  const NAME_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-name";
34
- const NEWSLETTER_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-newsletter";
39
+ const PHONE_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-phone";
40
+ const ADDRESS_LABEL_SET_KEY = "@phis/ui/modules/app/labels/address";
35
41
  const LOCALE_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-locale";
36
42
  const THEME_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-theme";
37
43
  const nameDescriptor = {
@@ -80,28 +86,90 @@ const nameDescriptor = {
80
86
  layout: { gap: { compact: "sm", medium: "base" } },
81
87
  };
82
88
  /**
83
- * One switch, and therefore no Save button: the Preset routes the Form's own `stateChange` back to
84
- * its `submit` channel, so flipping it is the submit. A panel holding more than one field states a
85
- * Save instead -- two fields changed one at a time would otherwise be two writes and one of them a
86
- * half-finished thought.
87
- *
88
- * It says nothing on success for the same reason. A switch that stays where it was put has already
89
- * told the person it worked; an alert under it would be a second answer to a question nobody asked.
89
+ * The two numbers beside the name, a Form of their own because Core keeps them behind their own write
90
+ * (`PATCH /api/v1/auth/profile/phone`), which takes both at once: what is sent is what is kept, an empty
91
+ * field clears its number. They are written as the person writes them -- spaces, a leading `+`, an
92
+ * extension -- so the rule is the Core's own length and nothing about the digits; the member picker finds a
93
+ * person by them either way.
90
94
  */
91
- const newsletterDescriptor = {
95
+ const PHONE_MAX_LENGTH = 64;
96
+ const phoneDescriptor = {
92
97
  schemaVersion: 1,
93
- key: PHI_APP_FORM_IDS.profileNewsletter,
94
- labelSetKey: NEWSLETTER_LABEL_SET_KEY,
98
+ key: PHI_APP_FORM_IDS.profilePhone,
99
+ labelSetKey: PHONE_LABEL_SET_KEY,
95
100
  fields: [
96
101
  {
97
- key: "newsletterOptIn",
98
- fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.switch,
99
- controlLabel: label("newsletter", "Newsletter"),
100
- description: label("newsletterDescription", "Receive product and platform updates for this site."),
102
+ key: "phone",
103
+ fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.tel,
104
+ label: label("phone", "Business phone"),
105
+ autoComplete: "work tel",
106
+ validation: [{
107
+ providerKey: PHI_FORM_VALIDATION_PROVIDER_KEYS.maxLength,
108
+ message: label("tooLong", "At most 64 characters."),
109
+ config: { max: PHONE_MAX_LENGTH },
110
+ }],
111
+ },
112
+ {
113
+ key: "mobile",
114
+ fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.tel,
115
+ label: label("mobile", "Mobile"),
116
+ autoComplete: "mobile tel",
117
+ validation: [{
118
+ providerKey: PHI_FORM_VALIDATION_PROVIDER_KEYS.maxLength,
119
+ message: label("tooLong", "At most 64 characters."),
120
+ config: { max: PHONE_MAX_LENGTH },
121
+ }],
101
122
  },
102
123
  ],
124
+ success: {
125
+ title: label("successTitle", "Numbers updated"),
126
+ text: label("successText", "Your telephone numbers have been saved."),
127
+ },
103
128
  layout: { gap: { compact: "sm", medium: "base" } },
104
129
  };
130
+ /**
131
+ * One address of the account's book, added or changed (`users:v1`, phis-server
132
+ * `/api/site/account/addresses`): the same two fields twice, the change with the hidden id of the version
133
+ * it replaces in its address. Core takes `{ address, flags }`, and the fields are those two values: the
134
+ * `address` field holds the parts as `PhisSiteAddressInput` and its own rules, the `flags` field what the
135
+ * address is for as `PhisSiteAddressFlags`, a default offered only beside its purpose -- Core refuses a
136
+ * default for a purpose the address does not have.
137
+ */
138
+ const ADDRESS_FLAG_OPTIONS = [
139
+ { value: String(PhisSiteAddressFlags.Billing), label: label("billing", "Billing address") },
140
+ { value: String(PhisSiteAddressFlags.Shipping), label: label("shipping", "Shipping address") },
141
+ { value: String(PhisSiteAddressFlags.DefaultBilling), label: label("defaultBilling", "Default for billing") },
142
+ { value: String(PhisSiteAddressFlags.DefaultShipping), label: label("defaultShipping", "Default for shipping") },
143
+ ];
144
+ function addressDescriptor(formId, mode) {
145
+ return {
146
+ schemaVersion: 1,
147
+ key: formId,
148
+ labelSetKey: ADDRESS_LABEL_SET_KEY,
149
+ fields: [
150
+ ...(mode === "edit" ? [{ key: "id", fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.hidden }] : []),
151
+ { key: "address", fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.address },
152
+ {
153
+ key: "flags",
154
+ fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.flags,
155
+ label: label("purposes", "Used for"),
156
+ options: ADDRESS_FLAG_OPTIONS,
157
+ config: {
158
+ requires: {
159
+ [String(PhisSiteAddressFlags.DefaultBilling)]: String(PhisSiteAddressFlags.Billing),
160
+ [String(PhisSiteAddressFlags.DefaultShipping)]: String(PhisSiteAddressFlags.Shipping),
161
+ },
162
+ },
163
+ ...(mode === "create" ? { initialValue: PhisSiteAddressFlags.Billing | PhisSiteAddressFlags.Shipping } : {}),
164
+ },
165
+ ],
166
+ success: {
167
+ title: label("successTitle", "Address saved"),
168
+ text: label("successText", "Your address has been saved."),
169
+ },
170
+ layout: { gap: { compact: "sm", medium: "base" } },
171
+ };
172
+ }
105
173
  /**
106
174
  * The one language question, whose answers only the Site knows.
107
175
  *
@@ -177,10 +245,15 @@ const loadNameLabels = createPhiFormLabelSetLoader(() => import("../../../compon
177
245
  successText: labels.feedback.successText,
178
246
  actions: { submitLabel: labels.submitLabel },
179
247
  }));
180
- const loadNewsletterLabels = createPhiFormLabelSetLoader(() => import("../../../components/widgets/label-sets/profile").then((module) => module.getPhiProfileOverviewWidgetLabels), (labels) => ({
181
- newsletter: labels.newsletterLabel,
182
- newsletterDescription: labels.newsletterDescription,
248
+ const loadPhoneLabels = createPhiFormLabelSetLoader(() => import("../../../components/widgets/label-sets/profile").then((module) => module.getPhiProfilePhoneWidgetLabels), (labels) => ({
249
+ phone: labels.fields.phone,
250
+ mobile: labels.fields.mobile,
251
+ tooLong: labels.tooLong,
252
+ successTitle: labels.feedback.successTitle,
253
+ successText: labels.feedback.successText,
254
+ actions: { submitLabel: labels.submitLabel },
183
255
  }));
256
+ const loadAddressLabels = createPhiFormLabelSetLoader(() => import("./trees/addresses-label-set").then((module) => module.getPhiAppAddressesLabels), (labels) => ({ ...labels.form, actions: { submitLabel: labels.save } }));
184
257
  const loadLocaleLabels = createPhiFormLabelSetLoader(() => import("../../../components/widgets/label-sets/profile").then((module) => module.getPhiProfileLocaleWidgetLabels), (labels) => ({
185
258
  fieldLabel: labels.fieldLabel,
186
259
  }));
@@ -208,16 +281,44 @@ export const PHI_APP_RUNTIME_MODULE_FORMS = [
208
281
  definePhiRuntimeModuleForm({
209
282
  ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
210
283
  areas: ["app"],
211
- formId: PHI_APP_FORM_IDS.profileNewsletter,
284
+ formId: PHI_APP_FORM_IDS.profilePhone,
212
285
  version: 1,
213
286
  flags: 0,
214
- title: "Newsletter",
215
- description: "Whether this account receives product and platform updates.",
287
+ title: "Telephone numbers",
288
+ description: "The business telephone and mobile number this account can be reached at.",
216
289
  category: "forms",
217
290
  tags: ["profile", "account"],
218
- descriptor: newsletterDescriptor,
219
- submitHandlerKey: PHI_APP_FORM_HANDLER_KEYS.profileNewsletter,
220
- loadLabels: loadNewsletterLabels,
291
+ descriptor: phoneDescriptor,
292
+ submitHandlerKey: PHI_APP_FORM_HANDLER_KEYS.profilePhone,
293
+ loadLabels: loadPhoneLabels,
294
+ }),
295
+ definePhiRuntimeModuleForm({
296
+ ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
297
+ areas: ["app"],
298
+ formId: PHI_APP_FORM_IDS.addressCreate,
299
+ version: 1,
300
+ flags: 0,
301
+ title: "Add address",
302
+ description: "A billing or shipping address of this account on this site.",
303
+ category: "forms",
304
+ tags: ["profile", "account", "address"],
305
+ descriptor: addressDescriptor(PHI_APP_FORM_IDS.addressCreate, "create"),
306
+ submitHandlerKey: PHI_APP_FORM_HANDLER_KEYS.addressCreate,
307
+ loadLabels: loadAddressLabels,
308
+ }),
309
+ definePhiRuntimeModuleForm({
310
+ ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
311
+ areas: ["app"],
312
+ formId: PHI_APP_FORM_IDS.addressEdit,
313
+ version: 1,
314
+ flags: 0,
315
+ title: "Change address",
316
+ description: "A new version of one of this account's addresses, replacing it.",
317
+ category: "forms",
318
+ tags: ["profile", "account", "address"],
319
+ descriptor: addressDescriptor(PHI_APP_FORM_IDS.addressEdit, "edit"),
320
+ submitHandlerKey: PHI_APP_FORM_HANDLER_KEYS.addressEdit,
321
+ loadLabels: loadAddressLabels,
221
322
  }),
222
323
  definePhiRuntimeModuleForm({
223
324
  ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
@@ -272,20 +373,54 @@ export const PHI_APP_FORM_HANDLER_PROVIDER_DESCRIPTORS = [
272
373
  credentialPolicy: "site-session",
273
374
  },
274
375
  {
275
- key: createPhiSharedFormProviderKey("handler", "app-profile-newsletter"),
376
+ key: createPhiSharedFormProviderKey("handler", "app-profile-phone"),
276
377
  ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
277
- title: "Profile newsletter",
378
+ title: "Profile telephone numbers",
278
379
  phase: "submit",
279
- handlerKey: PHI_APP_FORM_HANDLER_KEYS.profileNewsletter,
380
+ handlerKey: PHI_APP_FORM_HANDLER_KEYS.profilePhone,
280
381
  category: "site",
281
382
  transport: "relay",
282
383
  method: "PATCH",
283
384
  endpointKey: null,
284
- upstreamPath: "/api/v1/auth/profile/newsletter",
385
+ upstreamPath: "/api/v1/auth/profile/phone",
285
386
  csrfPath: "/api/v1/auth/csrf",
286
387
  requiresCsrf: true,
287
388
  credentialPolicy: "site-session",
288
389
  },
390
+ /*
391
+ * The address book's two writes. The Form's two values are Core's `{ address, flags }`; a change names
392
+ * the version it replaces in its path, the hidden `id` as `{id}`.
393
+ */
394
+ {
395
+ key: createPhiSharedFormProviderKey("handler", "app-address-create"),
396
+ ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
397
+ title: "Add address",
398
+ phase: "submit",
399
+ handlerKey: PHI_APP_FORM_HANDLER_KEYS.addressCreate,
400
+ category: "site",
401
+ transport: "relay",
402
+ method: "POST",
403
+ endpointKey: null,
404
+ upstreamPath: "/api/site/account/addresses",
405
+ csrfPath: null,
406
+ requiresCsrf: false,
407
+ credentialPolicy: "site-session",
408
+ },
409
+ {
410
+ key: createPhiSharedFormProviderKey("handler", "app-address-edit"),
411
+ ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
412
+ title: "Change address",
413
+ phase: "submit",
414
+ handlerKey: PHI_APP_FORM_HANDLER_KEYS.addressEdit,
415
+ category: "site",
416
+ transport: "relay",
417
+ method: "PUT",
418
+ endpointKey: null,
419
+ upstreamPath: "/api/site/account/addresses/{id}",
420
+ csrfPath: null,
421
+ requiresCsrf: false,
422
+ credentialPolicy: "site-session",
423
+ },
289
424
  {
290
425
  key: createPhiSharedFormProviderKey("handler", "app-profile-theme"),
291
426
  ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
@@ -8,3 +8,11 @@ export declare const PHI_APP_RUNTIME_MODULE_ID: "@phis/ui/modules/app";
8
8
  export declare const PHI_APP_RUNTIME_MODULE_IDENTITY: {
9
9
  readonly moduleId: "@phis/ui/modules/app";
10
10
  };
11
+ /**
12
+ * The signed-in person's own addresses on this Site (phis-server `GET /api/site/account/addresses`,
13
+ * `users:v1`), as the account lists, adds, changes and removes them: a Collection drawn as address tiles
14
+ * (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`).
15
+ */
16
+ export declare const PHI_APP_ADDRESSES_DATA_PROVIDER_KEY: `${string}/${string}`;
17
+ /** The one resource the addresses Provider answers. */
18
+ export declare const PHI_APP_ADDRESSES_RESOURCE_KEY = "addresses";
@@ -1,4 +1,5 @@
1
1
  import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
2
+ import { createPhiSharedRuntimeDataProviderKey } from "../../../constants/runtime-data-provider-key";
2
3
  export const PHI_APP_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/app`;
3
4
  /**
4
5
  * The Module's identity as its Label Sets inherit it (`definePhiRuntimeModuleLabelSet`): the id and,
@@ -9,3 +10,11 @@ export const PHI_APP_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/app
9
10
  export const PHI_APP_RUNTIME_MODULE_IDENTITY = {
10
11
  moduleId: PHI_APP_RUNTIME_MODULE_ID,
11
12
  };
13
+ /**
14
+ * The signed-in person's own addresses on this Site (phis-server `GET /api/site/account/addresses`,
15
+ * `users:v1`), as the account lists, adds, changes and removes them: a Collection drawn as address tiles
16
+ * (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`).
17
+ */
18
+ export const PHI_APP_ADDRESSES_DATA_PROVIDER_KEY = createPhiSharedRuntimeDataProviderKey("collections", "app-addresses");
19
+ /** The one resource the addresses Provider answers. */
20
+ export const PHI_APP_ADDRESSES_RESOURCE_KEY = "addresses";
@@ -9,6 +9,37 @@ export declare const PHI_APP_RUNTIME_MODULE: {
9
9
  description: string;
10
10
  icon: string;
11
11
  serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
12
+ dataProviders: {
13
+ key: `${string}/${string}`;
14
+ ownerModuleId: "@phis/ui/modules/app";
15
+ kind: "collection";
16
+ executionMode: "live";
17
+ authoringMode: "none";
18
+ title: string;
19
+ description: string;
20
+ resources: {
21
+ resourceKey: string;
22
+ title: string;
23
+ itemIdentityPath: string;
24
+ itemRendererKey: `${string}/${string}`;
25
+ selectionValueSchema: `${string}/signals/${string}`;
26
+ recordRead: true;
27
+ defaultForWidget: true;
28
+ query: {
29
+ search: false;
30
+ pagination: false;
31
+ };
32
+ actions: ({
33
+ key: string;
34
+ title: string;
35
+ scope: "resource";
36
+ } | {
37
+ key: string;
38
+ title: string;
39
+ scope: "item";
40
+ })[];
41
+ }[];
42
+ }[];
12
43
  formProviders: {
13
44
  handlers: ({
14
45
  key: `${string}/${string}`;
@@ -29,7 +60,7 @@ export declare const PHI_APP_RUNTIME_MODULE: {
29
60
  ownerModuleId: "@phis/ui/modules/app";
30
61
  title: string;
31
62
  phase: "submit";
32
- handlerKey: "site.app.profile-newsletter";
63
+ handlerKey: "site.app.profile-phone";
33
64
  category: "site";
34
65
  transport: "relay";
35
66
  method: "PATCH";
@@ -38,6 +69,34 @@ export declare const PHI_APP_RUNTIME_MODULE: {
38
69
  csrfPath: string;
39
70
  requiresCsrf: true;
40
71
  credentialPolicy: "site-session";
72
+ } | {
73
+ key: `${string}/${string}`;
74
+ ownerModuleId: "@phis/ui/modules/app";
75
+ title: string;
76
+ phase: "submit";
77
+ handlerKey: "site.app.address-create";
78
+ category: "site";
79
+ transport: "relay";
80
+ method: "POST";
81
+ endpointKey: null;
82
+ upstreamPath: string;
83
+ csrfPath: null;
84
+ requiresCsrf: false;
85
+ credentialPolicy: "site-session";
86
+ } | {
87
+ key: `${string}/${string}`;
88
+ ownerModuleId: "@phis/ui/modules/app";
89
+ title: string;
90
+ phase: "submit";
91
+ handlerKey: "site.app.address-edit";
92
+ category: "site";
93
+ transport: "relay";
94
+ method: "PUT";
95
+ endpointKey: null;
96
+ upstreamPath: string;
97
+ csrfPath: null;
98
+ requiresCsrf: false;
99
+ credentialPolicy: "site-session";
41
100
  } | {
42
101
  key: `${string}/${string}`;
43
102
  ownerModuleId: "@phis/ui/modules/app";
@@ -0,0 +1,59 @@
1
+ import type { PhiCollectionProviderActionRequest, PhiCollectionProviderData, PhiCollectionProviderQueryRequest, PhiCollectionProviderRecordRequest } from "../../../../types/collection-provider";
2
+ /** The account's own address book (phis-server `/api/site/account/addresses`). */
3
+ export declare const PHI_APP_ADDRESSES_PATH = "/api/site/account/addresses";
4
+ declare function queryAddresses({ resourceKey, signal }: PhiCollectionProviderQueryRequest): Promise<PhiCollectionProviderData>;
5
+ /** One address for the change Form, opened from its tile: read from the list, as Core has no single read. */
6
+ declare function readAddressRecord({ resourceKey, rowIdentity, signal }: PhiCollectionProviderRecordRequest): Promise<{
7
+ createdAt: {} | null;
8
+ flags: number;
9
+ billing: boolean;
10
+ shipping: boolean;
11
+ defaultBilling: boolean;
12
+ defaultShipping: boolean;
13
+ address: {
14
+ [k: string]: string | null;
15
+ };
16
+ lines: string;
17
+ purposes: ("billing" | "shipping" | "defaultBilling" | "defaultShipping")[];
18
+ id: unknown;
19
+ }>;
20
+ /** The request that gives a listed address the default it asks for, or throws where it has none listed. */
21
+ export declare function buildPhiAppAddressDefaultRequest(address: Record<string, unknown>, actionKey: "makeDefaultBilling" | "makeDefaultShipping"): {
22
+ address: {
23
+ [k: string]: {} | null;
24
+ };
25
+ flags: number;
26
+ };
27
+ declare function actOnAddress(request: PhiCollectionProviderActionRequest): Promise<PhiCollectionProviderData>;
28
+ export declare const PHI_APP_ADDRESSES_COLLECTION_PROVIDER_REGISTRATION: {
29
+ key: `${string}/${string}`;
30
+ resources: {
31
+ resourceKey: string;
32
+ title: string;
33
+ itemIdentityPath: string;
34
+ itemRendererKey: `${string}/${string}`;
35
+ selectionValueSchema: `${string}/signals/${string}`;
36
+ recordRead: true;
37
+ defaultForWidget: true;
38
+ query: {
39
+ search: false;
40
+ pagination: false;
41
+ };
42
+ actions: ({
43
+ key: string;
44
+ title: string;
45
+ scope: "resource";
46
+ } | {
47
+ key: string;
48
+ title: string;
49
+ scope: "item";
50
+ })[];
51
+ }[];
52
+ query: typeof queryAddresses;
53
+ readRecord: typeof readAddressRecord;
54
+ action: typeof actOnAddress;
55
+ };
56
+ export declare const PhiAppAddressesCollectionProviderClient: import("react").ComponentType<{
57
+ children: import("react").ReactNode;
58
+ }>;
59
+ export {};
@@ -0,0 +1,105 @@
1
+ "use client";
2
+ import { PhisSiteAddressFlags } from "@phis/contracts/users";
3
+ import { isPhiRecord } from "../../../../helpers/is-record";
4
+ import { createPhiTableProviderRequestInit, readPhiPositiveInteger, readPhiTableRows, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
5
+ import { readPhiTableProviderResponse, } from "../../../../components/widgets/client/shared/phi-table-provider-response";
6
+ import { createPhiCollectionProviderClient, } from "../../../../components/widgets/client/shared/phi-collection-provider";
7
+ import { PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "../data-providers";
8
+ import { PHI_APP_ADDRESSES_DATA_PROVIDER_KEY, PHI_APP_ADDRESSES_RESOURCE_KEY } from "../ids";
9
+ import { PHI_SITE_ADDRESS_TEXT_KEYS, toPhiSiteAddressRow } from "../../../../helpers/site-address-row";
10
+ /** The account's own address book (phis-server `/api/site/account/addresses`). */
11
+ export const PHI_APP_ADDRESSES_PATH = "/api/site/account/addresses";
12
+ const RESPONSE_OPTIONS = { subject: "Addresses" };
13
+ /*
14
+ * The addresses as the last list answered them, which a default is set from: Core takes an address equal in
15
+ * every part to a current one as that one, given the purposes and defaults asked besides, so setting a
16
+ * default sends the address again rather than writing a new version of it.
17
+ */
18
+ const listed = new Map();
19
+ function requireResource(resourceKey) {
20
+ if (resourceKey !== PHI_APP_ADDRESSES_RESOURCE_KEY) {
21
+ throw new Error(`Unknown addresses resource "${resourceKey}".`);
22
+ }
23
+ }
24
+ async function readAddresses(signal) {
25
+ const result = await readPhiTableProviderResponse(await fetch(PHI_APP_ADDRESSES_PATH, createPhiTableProviderRequestInit(signal)), RESPONSE_OPTIONS);
26
+ const items = readPhiTableRows(result?.items);
27
+ listed.clear();
28
+ for (const item of items) {
29
+ const id = readPhiPositiveInteger(item.id);
30
+ if (id)
31
+ listed.set(id, item);
32
+ }
33
+ return items;
34
+ }
35
+ async function listAddresses(signal) {
36
+ const items = (await readAddresses(signal)).map(toPhiSiteAddressRow);
37
+ return { resourceKey: PHI_APP_ADDRESSES_RESOURCE_KEY, items, total: items.length, loading: false, error: null };
38
+ }
39
+ async function queryAddresses({ resourceKey, signal }) {
40
+ requireResource(resourceKey);
41
+ return listAddresses(signal);
42
+ }
43
+ /** One address for the change Form, opened from its tile: read from the list, as Core has no single read. */
44
+ async function readAddressRecord({ resourceKey, rowIdentity, signal }) {
45
+ requireResource(resourceKey);
46
+ const id = readPhiPositiveInteger(rowIdentity);
47
+ const address = (await readAddresses(signal)).find((item) => item.id === id);
48
+ if (!id || !address) {
49
+ throw new Error("This address is no longer one of yours.");
50
+ }
51
+ return toPhiSiteAddressRow(address);
52
+ }
53
+ /** The request that gives a listed address the default it asks for, or throws where it has none listed. */
54
+ export function buildPhiAppAddressDefaultRequest(address, actionKey) {
55
+ const flags = typeof address.flags === "number" ? address.flags : 0;
56
+ const added = actionKey === "makeDefaultBilling"
57
+ ? PhisSiteAddressFlags.Billing | PhisSiteAddressFlags.DefaultBilling
58
+ : PhisSiteAddressFlags.Shipping | PhisSiteAddressFlags.DefaultShipping;
59
+ const writable = PhisSiteAddressFlags.Billing | PhisSiteAddressFlags.Shipping |
60
+ PhisSiteAddressFlags.DefaultBilling | PhisSiteAddressFlags.DefaultShipping;
61
+ return {
62
+ address: Object.fromEntries(PHI_SITE_ADDRESS_TEXT_KEYS.map((key) => [key, address[key] ?? null])),
63
+ flags: (flags & writable) | added,
64
+ };
65
+ }
66
+ /*
67
+ * A removal and the two defaults, each answered by the list as it now stands: a default moves from the
68
+ * address that held it, and a removal takes a tile. `create` and `edit` are announced by the tiles and
69
+ * open the Module's two Forms; they never reach here.
70
+ */
71
+ async function actOnAddress(request) {
72
+ requireResource(request.resourceKey);
73
+ const id = readPhiPositiveInteger(request.itemKey);
74
+ if (!id)
75
+ throw new Error("An address id is required.");
76
+ const init = createPhiTableProviderRequestInit(request.signal);
77
+ if (request.actionKey === "delete") {
78
+ await readPhiTableProviderResponse(await fetch(`${PHI_APP_ADDRESSES_PATH}/${id}`, { ...init, method: "DELETE" }), RESPONSE_OPTIONS);
79
+ }
80
+ else if (request.actionKey === "makeDefaultBilling" || request.actionKey === "makeDefaultShipping") {
81
+ const address = listed.get(id);
82
+ if (!isPhiRecord(address))
83
+ throw new Error("This address is no longer listed.");
84
+ await readPhiTableProviderResponse(await fetch(PHI_APP_ADDRESSES_PATH, {
85
+ ...init,
86
+ method: "POST",
87
+ headers: { ...init.headers, "content-type": "application/json" },
88
+ body: JSON.stringify(buildPhiAppAddressDefaultRequest(address, request.actionKey)),
89
+ }), RESPONSE_OPTIONS);
90
+ }
91
+ else {
92
+ throw new Error(`Unsupported addresses action "${request.actionKey}".`);
93
+ }
94
+ return listAddresses(request.signal);
95
+ }
96
+ const resources = PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS
97
+ .find((descriptor) => descriptor.key === PHI_APP_ADDRESSES_DATA_PROVIDER_KEY)?.resources ?? [];
98
+ export const PHI_APP_ADDRESSES_COLLECTION_PROVIDER_REGISTRATION = {
99
+ key: PHI_APP_ADDRESSES_DATA_PROVIDER_KEY,
100
+ resources,
101
+ query: queryAddresses,
102
+ readRecord: readAddressRecord,
103
+ action: actOnAddress,
104
+ };
105
+ export const PhiAppAddressesCollectionProviderClient = createPhiCollectionProviderClient(PHI_APP_ADDRESSES_COLLECTION_PROVIDER_REGISTRATION);
@@ -0,0 +1,21 @@
1
+ import type { PhiSettingsPageShellOverlay, PhiSettingsPageShellPanel } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
2
+ import type { getPhiAppAddressesLabels } from "./addresses-label-set";
3
+ type Labels = Awaited<ReturnType<typeof getPhiAppAddressesLabels>>;
4
+ /**
5
+ * The account's addresses on the Profile page: one panel holding the address tiles, and the two dialogs
6
+ * they open.
7
+ *
8
+ * A Collection View drawn by Core's address renderer (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`, COLLECTIONS.md
9
+ * "The address renderer"), arranged as the Admin's provider installations are (the Settings shell's
10
+ * overlays): `+` in its toolbar announces `create` and opens the add dialog, a tile's pencil announces
11
+ * `edit` with the address id and opens the change dialog, whose Form reads that address through the same
12
+ * Provider (`recordOpen` on `collection-action`, FORMS.md "A record opened from a Collection View"); either
13
+ * Form's success reads the tiles again. Removing (after its confirmation) and the two defaults are the
14
+ * Provider's actions, each answered by the list as it now stands. An address is an item of a list somebody
15
+ * keeps, not a part of the page, so a panel per Form would describe things nobody is looking at.
16
+ */
17
+ export declare function buildPhiAccountAddressesPanel(labels: Labels, presetKey: string): {
18
+ panel: PhiSettingsPageShellPanel;
19
+ overlays: PhiSettingsPageShellOverlay[];
20
+ };
21
+ export {};