@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,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useCallback, useMemo, useState } from "react";
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
4
  import { findPhiSignalRoutesByCapabilityId, } from "../../../../types/signals";
5
5
  import { readPhiTableActionSignalValue, readPhiTableSelectionSignalValue, } from "../../../../types/table-signal-values";
6
6
  import { readPhiOverlayCloseRequest } from "../../../../types/cms-overlay";
@@ -10,6 +10,10 @@ import { usePhiRuntimeConditionStateResponder } from "../../../../components/run
10
10
  import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../components/runtime/runtime-signal-bus";
11
11
  import { dispatchPhiSignalCapability } from "../../../../components/runtime/runtime-signal-identity";
12
12
  import { PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION, } from "./definition";
13
+ import { isPhiRecord } from "../../../../helpers/is-record";
14
+ import { readPhiPositiveInteger } from "../../../../components/widgets/client/shared/phi-table-provider-request";
15
+ import { readPhiCustomerFileThreadId } from "../services/customer-file-read";
16
+ import { PHI_CUSTOMER_FILE_MEMBER_PARAM } from "../../../../constants/customer-file";
13
17
  /**
14
18
  * A row key is a conversation id, and this is the only code allowed to know it.
15
19
  *
@@ -31,6 +35,11 @@ function readSelectedThreadId(value) {
31
35
  * what came back. Reading `{ thread: { thread: { id } } }` out of it is a statement about the Core
32
36
  * route's answer, which is exactly the kind of knowledge that belongs in the Module and nowhere else.
33
37
  */
38
+ /** The member a customer file Page's person Table chose, from its query (`filters.userId`). */
39
+ function readChosenMemberId(value) {
40
+ const filters = isPhiRecord(value) && isPhiRecord(value.filters) ? value.filters : null;
41
+ return filters ? readPhiPositiveInteger(filters.userId) : null;
42
+ }
34
43
  function readCreatedThreadId(value) {
35
44
  const payload = value?.payload;
36
45
  const threadId = payload?.thread?.thread?.id;
@@ -48,6 +57,14 @@ function PhiThreadsControllerView({ address, config, }) {
48
57
  * it cannot merely pass through.
49
58
  */
50
59
  const [openThreadId, setOpenThreadId] = useState(null);
60
+ /*
61
+ * A customer file Page's two readers apart: the member's file, and the conversation a Reply was last
62
+ * pressed in -- the file's or the listing's -- so the note that lands is read again where it was written.
63
+ */
64
+ const [fileThreadId, setFileThreadId] = useState(null);
65
+ const [replyThreadId, setReplyThreadId] = useState(null);
66
+ const memberRead = useRef({ userId: null, controller: null });
67
+ useEffect(() => () => memberRead.current.controller?.abort(), []);
51
68
  const emitRoutes = useMemo(() => config.signalRoutes?.emits ?? [], [config.signalRoutes?.emits]);
52
69
  /*
53
70
  * One declared output, delivered through every route that names it.
@@ -87,6 +104,32 @@ function PhiThreadsControllerView({ address, config, }) {
87
104
  */
88
105
  emitCapability("conditionStateChange", { state: { ready: true, threadOpen: threadId != null } }, correlationId);
89
106
  }, [emitCapability]);
107
+ /*
108
+ * Another member chosen: their file, read from the request the Page's Tables make for the same choice
109
+ * (it joins that one, so a choice stays one entry in the access log), handed to the file panel. Nobody
110
+ * chosen, the reader's own file and a failed read all close the panel; the Tables say why. The member
111
+ * also goes to whatever shows something of theirs by binding params -- the addresses tiles.
112
+ */
113
+ const openMemberFile = useCallback((userId, correlationId) => {
114
+ if (memberRead.current.userId === userId)
115
+ return;
116
+ memberRead.current.controller?.abort();
117
+ const controller = userId == null ? null : new AbortController();
118
+ memberRead.current = { userId, controller };
119
+ setFileThreadId(null);
120
+ // The addresses ask in their next render, while the read below is under way, and join it.
121
+ emitCapability("memberParamsChange", { params: { [PHI_CUSTOMER_FILE_MEMBER_PARAM]: userId } }, correlationId);
122
+ emitCapability("fileThreadChange", { threadId: null }, correlationId);
123
+ if (userId == null || !controller)
124
+ return;
125
+ readPhiCustomerFileThreadId(userId, controller.signal).then((threadId) => {
126
+ if (controller.signal.aborted)
127
+ return;
128
+ setFileThreadId(threadId);
129
+ if (threadId != null)
130
+ emitCapability("fileThreadChange", { threadId }, correlationId);
131
+ }, () => undefined);
132
+ }, [emitCapability]);
90
133
  const reloadInbox = useCallback((correlationId) => emitCapability("reload", null, correlationId), [emitCapability]);
91
134
  const closeDialog = useCallback((correlationId) => emitCapability("dialogClose", null, correlationId), [emitCapability]);
92
135
  const resetForm = useCallback((correlationId) => emitCapability("formReset", null, correlationId), [emitCapability]);
@@ -106,7 +149,12 @@ function PhiThreadsControllerView({ address, config, }) {
106
149
  return;
107
150
  // The toolbar's `+`. A Table says which action was run and on which row; what that means is here.
108
151
  if (signal.channel === "action" && signal.action === "activate") {
109
- if (readPhiTableActionSignalValue(signal.value)?.actionKey !== "newConversation")
152
+ const tableAction = readPhiTableActionSignalValue(signal.value);
153
+ if (tableAction?.actionKey === "reply") {
154
+ setReplyThreadId(readPhiPositiveInteger(tableAction.rowIdentity));
155
+ return;
156
+ }
157
+ if (tableAction?.actionKey !== "newConversation")
110
158
  return;
111
159
  setSubmitting(false);
112
160
  emitCapability("dialogOpen", null, signal.correlationId);
@@ -157,6 +205,11 @@ function PhiThreadsControllerView({ address, config, }) {
157
205
  * A message landed in the open conversation, from the Reply dialog. The reader is asked to catch
158
206
  * up rather than to switch, and the listing is stale because its order is by last activity.
159
207
  */
208
+ // A note in the member's file: the file panel catches up, and the listing, which leaves it out, is as it was.
209
+ if (fileThreadId != null && replyThreadId === fileThreadId) {
210
+ emitCapability("fileThreadReload", { threadId: fileThreadId }, signal.correlationId);
211
+ return;
212
+ }
160
213
  reloadInbox(signal.correlationId);
161
214
  emitCapability("threadReload", { threadId: openThreadId }, signal.correlationId);
162
215
  return;
@@ -174,6 +227,10 @@ function PhiThreadsControllerView({ address, config, }) {
174
227
  sendThread(readSelectedThreadId(signal.value), signal.correlationId);
175
228
  return;
176
229
  }
230
+ if (signal.channel === "member" && signal.action === "change") {
231
+ openMemberFile(readChosenMemberId(signal.value), signal.correlationId);
232
+ return;
233
+ }
177
234
  if (signal.channel === "opened" && signal.action === "change") {
178
235
  const opened = readPhiThreadSignalValue(signal.value)?.threadId ?? null;
179
236
  if (opened != null)
@@ -184,8 +241,11 @@ function PhiThreadsControllerView({ address, config, }) {
184
241
  closeDialog,
185
242
  dialogFormAddresses,
186
243
  emitCapability,
244
+ fileThreadId,
245
+ openMemberFile,
187
246
  openThreadId,
188
247
  reloadInbox,
248
+ replyThreadId,
189
249
  resetForm,
190
250
  sendThread,
191
251
  submitting,
@@ -1,5 +1,5 @@
1
1
  import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet, } from "../../../../types/signals";
2
- import { PHI_THREADS_CONTROLLER_KEY, PHI_THREADS_CONTROLLER_PLUGIN_KEY, } from "./address";
2
+ import { PHI_THREADS_CONTROLLER_KEY, PHI_THREADS_CONTROLLER_PLUGIN_KEY, } from "../../../../constants/threads-controller-address";
3
3
  /**
4
4
  * Turns "a row is selected" into "that conversation", and runs the dialog that opens a new one.
5
5
  *
@@ -53,6 +53,36 @@ export const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION = {
53
53
  valueType: "json",
54
54
  valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.threadSelection,
55
55
  },
56
+ /*
57
+ * The member's file, on a customer file Page (THREADS.md, section 10): the file panel's conversation,
58
+ * apart from the one chosen in the listing, so the two readers never show each other's. Change when
59
+ * another member is chosen -- `{ threadId: null }` for nobody, or for the reader's own file, which
60
+ * Core refuses -- and reload after a note landed in it.
61
+ */
62
+ {
63
+ id: "fileThreadChange",
64
+ action: "change",
65
+ valueType: "json",
66
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.threadSelection,
67
+ },
68
+ {
69
+ id: "fileThreadReload",
70
+ action: "reload",
71
+ valueType: "json",
72
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.threadSelection,
73
+ },
74
+ /*
75
+ * The member a customer file Page chose, as binding params (`{ params: { userId } }`, `null` for
76
+ * nobody), for a Collection View that shows something of theirs -- the addresses tiles: the choice
77
+ * forwarded to the View's `bindingParamsChange` (COLLECTIONS.md, "Filtered by another Widget's
78
+ * choice"), once per member chosen.
79
+ */
80
+ {
81
+ id: "memberParamsChange",
82
+ action: "change",
83
+ valueType: "json",
84
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableBindingParams,
85
+ },
56
86
  { id: "dialogOpen", action: "activate", valueType: "none" },
57
87
  { id: "dialogClose", action: "close", valueType: "none" },
58
88
  { id: "formSubmit", action: "activate", valueType: "none" },
@@ -84,6 +114,24 @@ export const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION = {
84
114
  valueType: "json",
85
115
  valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableSelection,
86
116
  },
117
+ /*
118
+ * The member a customer file Page chose: its person Table's query, `filters.userId`. The file's id
119
+ * comes from the same read the Page's Tables make for that choice, joined rather than asked again
120
+ * (`readPhiCustomerFileThreadId`), and goes out as `fileThreadChange`; the member goes out as
121
+ * `memberParamsChange`.
122
+ */
123
+ {
124
+ id: "memberChange",
125
+ channel: "member",
126
+ action: "change",
127
+ valueType: "json",
128
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableQuery,
129
+ },
130
+ /*
131
+ * A Table's action, and a conversation's Reply, which a conversation says as a row action with the
132
+ * thread as its row: routed here too, the reply that lands is known to be the file's or the open
133
+ * conversation's, and only that one is read again.
134
+ */
87
135
  {
88
136
  id: "actionActivate",
89
137
  channel: "action",
@@ -1,5 +1,5 @@
1
1
  /** Who this viewer may write to, for this Module's own Form that opens a conversation. */
2
- export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
2
+ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
3
3
  key: `${string}/${string}`;
4
4
  ownerModuleId: "@phis/ui/modules/threads";
5
5
  kind: "options";
@@ -7,4 +7,102 @@ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
7
7
  authoringMode: "none";
8
8
  title: string;
9
9
  description: string;
10
- }[];
10
+ resources?: undefined;
11
+ } | {
12
+ key: `${string}/${string}`;
13
+ ownerModuleId: "@phis/ui/modules/threads";
14
+ kind: "table";
15
+ executionMode: "live";
16
+ authoringMode: "none";
17
+ title: string;
18
+ description: string;
19
+ resources: ({
20
+ resourceKey: "person";
21
+ title: string;
22
+ rowIdentityPath: string;
23
+ fields: ({
24
+ key: string;
25
+ title: string;
26
+ type: "number";
27
+ required: true;
28
+ } | {
29
+ key: string;
30
+ title: string;
31
+ type: "string";
32
+ required?: undefined;
33
+ })[];
34
+ summaryFields: {
35
+ key: string;
36
+ title: string;
37
+ type: "number";
38
+ }[];
39
+ query: {
40
+ search: false;
41
+ filterFields: string[];
42
+ sorting: "none";
43
+ pagination: "none";
44
+ total?: undefined;
45
+ };
46
+ rowActivation?: undefined;
47
+ } | {
48
+ resourceKey: "threads";
49
+ title: string;
50
+ rowIdentityPath: string;
51
+ rowActivation: true;
52
+ fields: ({
53
+ key: string;
54
+ title: string;
55
+ type: "number";
56
+ required: true;
57
+ options?: undefined;
58
+ } | {
59
+ key: string;
60
+ title: string;
61
+ type: "string";
62
+ required?: undefined;
63
+ options?: undefined;
64
+ } | {
65
+ key: string;
66
+ title: string;
67
+ type: "enum";
68
+ options: {
69
+ value: string;
70
+ label: string;
71
+ }[];
72
+ required?: undefined;
73
+ } | {
74
+ key: string;
75
+ title: string;
76
+ type: "datetime";
77
+ required?: undefined;
78
+ options?: undefined;
79
+ })[];
80
+ query: {
81
+ search: false;
82
+ filterFields: string[];
83
+ sorting: "none";
84
+ pagination: "offset";
85
+ total: false;
86
+ };
87
+ summaryFields?: undefined;
88
+ })[];
89
+ } | {
90
+ key: `${string}/${string}`;
91
+ ownerModuleId: "@phis/ui/modules/threads";
92
+ kind: "collection";
93
+ executionMode: "live";
94
+ authoringMode: "none";
95
+ title: string;
96
+ description: string;
97
+ resources: {
98
+ resourceKey: "addresses";
99
+ title: string;
100
+ itemIdentityPath: string;
101
+ itemRendererKey: `${string}/${string}`;
102
+ defaultForWidget: true;
103
+ query: {
104
+ search: false;
105
+ pagination: false;
106
+ };
107
+ }[];
108
+ })[];
@@ -1,4 +1,7 @@
1
1
  import { PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS, PHI_THREADS_RUNTIME_MODULE_ID, } from "./ids";
2
+ import { PhisThreadKind, PhisThreadStatus } from "../../../constants/threads";
3
+ import { PHI_CUSTOMER_FILE_RESOURCE_KEYS } from "../../../constants/customer-file";
4
+ import { PHI_SITE_ADDRESS_ITEM_RENDERER_KEY } from "../../../constants/site-address";
2
5
  /** Who this viewer may write to, for this Module's own Form that opens a conversation. */
3
6
  export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
4
7
  {
@@ -10,4 +13,97 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
10
13
  title: "People you can write to",
11
14
  description: "Whoever shares a group with this viewer, for naming them in a new conversation.",
12
15
  },
16
+ /*
17
+ * Staff's customer file on one member of the Site (`GET /api/site/members/{userId}/file`, for the
18
+ * holders of `accounting` or `support`): the person as the staff road of `users:v1` answers them, and
19
+ * the threads -- the person's file first, then every conversation they take part in that the actor
20
+ * sees. Two resources because a Table lists one kind of row; each reads the same route for the member
21
+ * its `userId` filter names, and none reads anything without one. Core writes every read to the Site's
22
+ * access log. Their addresses are the Collection below, from the same read.
23
+ */
24
+ {
25
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFile,
26
+ ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
27
+ kind: "table",
28
+ executionMode: "live",
29
+ authoringMode: "none",
30
+ title: "Customer file",
31
+ description: "One member as staff may read them: contact details, addresses, their file and their conversations.",
32
+ resources: [
33
+ {
34
+ resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.person,
35
+ title: "Person",
36
+ rowIdentityPath: "userId",
37
+ fields: [
38
+ { key: "userId", title: "User", type: "number", required: true },
39
+ { key: "displayName", title: "Shown as", type: "string" },
40
+ { key: "fullName", title: "Name", type: "string" },
41
+ { key: "companyName", title: "Company", type: "string" },
42
+ { key: "email", title: "E-mail", type: "string" },
43
+ { key: "phone", title: "Business phone", type: "string" },
44
+ { key: "mobile", title: "Mobile", type: "string" },
45
+ ],
46
+ // The member's number, for the line under the person: the one Core, the access log and support name.
47
+ summaryFields: [{ key: "userId", title: "Member number", type: "number" }],
48
+ query: { search: false, filterFields: ["userId"], sorting: "none", pagination: "none" },
49
+ },
50
+ {
51
+ resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.threads,
52
+ title: "Conversations",
53
+ rowIdentityPath: "id",
54
+ // Choosing one opens it in the conversation beside the list, as the inbox does.
55
+ rowActivation: true,
56
+ fields: [
57
+ { key: "id", title: "ID", type: "number", required: true },
58
+ { key: "subject", title: "Subject", type: "string" },
59
+ { key: "kind", title: "Kind", type: "enum", options: [
60
+ { value: String(PhisThreadKind.Direct), label: "Direct" },
61
+ { value: String(PhisThreadKind.Group), label: "Group" },
62
+ { value: String(PhisThreadKind.CrossGroup), label: "Between groups" },
63
+ { value: String(PhisThreadKind.Support), label: "Support" },
64
+ { value: String(PhisThreadKind.File), label: "File" },
65
+ ] },
66
+ { key: "status", title: "Status", type: "enum", options: [
67
+ { value: String(PhisThreadStatus.Open), label: "Open" },
68
+ { value: String(PhisThreadStatus.Archived), label: "Archived" },
69
+ ] },
70
+ { key: "state", title: "State", type: "enum", options: [
71
+ { value: "unread", label: "New" },
72
+ { value: "open", label: "Open" },
73
+ { value: "archived", label: "Archived" },
74
+ { value: "locked", label: "Locked" },
75
+ ] },
76
+ { key: "latestMessageAt", title: "Last activity", type: "datetime" },
77
+ ],
78
+ // Paged by Core without a count, so the list turns back and forth rather than to a page number.
79
+ query: { search: false, filterFields: ["userId"], sorting: "none", pagination: "offset", total: false },
80
+ },
81
+ ],
82
+ },
83
+ /*
84
+ * The member's current addresses, where the actor may read them, as Core's address tiles draw them
85
+ * (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`): read-only, so the resource declares no action and the tiles
86
+ * offer none. The member is the binding param `userId`, which the Conversations Controller forwards from
87
+ * the person Table's choice (COLLECTIONS.md, "Filtered by another Widget's choice"), and the answer is the
88
+ * same request the Tables and the Controller make for that choice, joined (`readPhiCustomerFile`).
89
+ */
90
+ {
91
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses,
92
+ ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
93
+ kind: "collection",
94
+ executionMode: "live",
95
+ authoringMode: "none",
96
+ title: "Customer file addresses",
97
+ description: "The chosen member's current billing and shipping addresses, as staff may read them.",
98
+ resources: [
99
+ {
100
+ resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.addresses,
101
+ title: "Addresses",
102
+ itemIdentityPath: "id",
103
+ itemRendererKey: PHI_SITE_ADDRESS_ITEM_RENDERER_KEY,
104
+ defaultForWidget: true,
105
+ query: { search: false, pagination: false },
106
+ },
107
+ ],
108
+ },
13
109
  ];
@@ -21,7 +21,7 @@ export declare const PHI_THREADS_RUNTIME_MODULE_DEFINITION: {
21
21
  controllerType: "@phis/ui/modules/threads/controller/default";
22
22
  controller: import("../contracts").PhiRuntimeModuleControllerDescriptor;
23
23
  controllerMountPolicy: "demand";
24
- dataProviders: {
24
+ dataProviders: ({
25
25
  key: `${string}/${string}`;
26
26
  ownerModuleId: "@phis/ui/modules/threads";
27
27
  kind: "options";
@@ -29,7 +29,105 @@ export declare const PHI_THREADS_RUNTIME_MODULE_DEFINITION: {
29
29
  authoringMode: "none";
30
30
  title: string;
31
31
  description: string;
32
- }[];
32
+ resources?: undefined;
33
+ } | {
34
+ key: `${string}/${string}`;
35
+ ownerModuleId: "@phis/ui/modules/threads";
36
+ kind: "table";
37
+ executionMode: "live";
38
+ authoringMode: "none";
39
+ title: string;
40
+ description: string;
41
+ resources: ({
42
+ resourceKey: "person";
43
+ title: string;
44
+ rowIdentityPath: string;
45
+ fields: ({
46
+ key: string;
47
+ title: string;
48
+ type: "number";
49
+ required: true;
50
+ } | {
51
+ key: string;
52
+ title: string;
53
+ type: "string";
54
+ required?: undefined;
55
+ })[];
56
+ summaryFields: {
57
+ key: string;
58
+ title: string;
59
+ type: "number";
60
+ }[];
61
+ query: {
62
+ search: false;
63
+ filterFields: string[];
64
+ sorting: "none";
65
+ pagination: "none";
66
+ total?: undefined;
67
+ };
68
+ rowActivation?: undefined;
69
+ } | {
70
+ resourceKey: "threads";
71
+ title: string;
72
+ rowIdentityPath: string;
73
+ rowActivation: true;
74
+ fields: ({
75
+ key: string;
76
+ title: string;
77
+ type: "number";
78
+ required: true;
79
+ options?: undefined;
80
+ } | {
81
+ key: string;
82
+ title: string;
83
+ type: "string";
84
+ required?: undefined;
85
+ options?: undefined;
86
+ } | {
87
+ key: string;
88
+ title: string;
89
+ type: "enum";
90
+ options: {
91
+ value: string;
92
+ label: string;
93
+ }[];
94
+ required?: undefined;
95
+ } | {
96
+ key: string;
97
+ title: string;
98
+ type: "datetime";
99
+ required?: undefined;
100
+ options?: undefined;
101
+ })[];
102
+ query: {
103
+ search: false;
104
+ filterFields: string[];
105
+ sorting: "none";
106
+ pagination: "offset";
107
+ total: false;
108
+ };
109
+ summaryFields?: undefined;
110
+ })[];
111
+ } | {
112
+ key: `${string}/${string}`;
113
+ ownerModuleId: "@phis/ui/modules/threads";
114
+ kind: "collection";
115
+ executionMode: "live";
116
+ authoringMode: "none";
117
+ title: string;
118
+ description: string;
119
+ resources: {
120
+ resourceKey: "addresses";
121
+ title: string;
122
+ itemIdentityPath: string;
123
+ itemRendererKey: `${string}/${string}`;
124
+ defaultForWidget: true;
125
+ query: {
126
+ search: false;
127
+ pagination: false;
128
+ };
129
+ }[];
130
+ })[];
33
131
  formProviders: {
34
132
  handlers: {
35
133
  key: `${string}/${string}`;
@@ -2,7 +2,7 @@ import { PHI_CMS_AREA_KEYS } from "../../../constants/cms-areas";
2
2
  import { buildPhiRuntimeModuleControllerDescriptor } from "../contracts";
3
3
  import { PHI_CORE_SERVER_BINDING } from "../../../types/server-capabilities";
4
4
  import { PHI_THREADS_RUNTIME_MODULE_IDENTITY } from "./ids";
5
- import { PHI_THREADS_CONTROLLER_TYPE } from "./controller/address";
5
+ import { PHI_THREADS_CONTROLLER_TYPE } from "../../../constants/threads-controller-address";
6
6
  import { PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION } from "./controller/definition";
7
7
  import { PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "./data-providers";
8
8
  import { PHI_THREADS_FORM_HANDLER_PROVIDER_DESCRIPTORS } from "./forms";
@@ -15,4 +15,8 @@ export declare const PHI_THREADS_RUNTIME_MODULE_IDENTITY: {
15
15
  */
16
16
  export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS: {
17
17
  readonly candidates: `${string}/${string}`;
18
+ /** Staff's customer file on one member, the Foundation name (`constants/customer-file.ts`). */
19
+ readonly customerFile: `${string}/${string}`;
20
+ /** The member's addresses as tiles, the Foundation name too. */
21
+ readonly customerFileAddresses: `${string}/${string}`;
18
22
  };
@@ -1,5 +1,6 @@
1
1
  import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
2
2
  import { createPhiSharedRuntimeDataProviderKey } from "../../../constants/runtime-data-provider-key";
3
+ import { PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS } from "../../../constants/customer-file";
3
4
  export const PHI_THREADS_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/threads`;
4
5
  /**
5
6
  * The Module's identity as its Label Sets inherit it (`definePhiRuntimeModuleLabelSet`): the id and,
@@ -19,4 +20,8 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS = {
19
20
  // Not a Foundation name: who this viewer may write to is what this Module's own form asks, and a
20
21
  // Module offering its own inbox asks the Core route the same way rather than borrowing this key.
21
22
  candidates: createPhiSharedRuntimeDataProviderKey("options", "thread-candidates"),
23
+ /** Staff's customer file on one member, the Foundation name (`constants/customer-file.ts`). */
24
+ customerFile: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table,
25
+ /** The member's addresses as tiles, the Foundation name too. */
26
+ customerFileAddresses: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.addresses,
22
27
  };
@@ -0,0 +1,30 @@
1
+ import type { PhiCollectionProviderData, PhiCollectionProviderQueryRequest } from "../../../../types/collection-provider";
2
+ /**
3
+ * The chosen member's addresses, read-only, as tiles (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`): from the first
4
+ * page of their file, the request the person Table, the conversations Table and the Conversations Controller
5
+ * make for the same choice -- joined, never asked again (`readPhiCustomerFile`), so one choice is still one
6
+ * entry in the access log. The member is the binding param `userId` the Controller forwards.
7
+ *
8
+ * Nobody chosen reads nothing. The reader's own file, which Core refuses, answers no addresses with the
9
+ * Page's own-file sentence as the tiles' empty sentence (`meta.emptyDescription`), as each Table says it
10
+ * where its rows would be; any other failure is the source's.
11
+ */
12
+ export declare function queryPhiCustomerFileAddresses({ resourceKey, params, signal }: PhiCollectionProviderQueryRequest): Promise<PhiCollectionProviderData>;
13
+ export declare const PHI_THREADS_CUSTOMER_FILE_ADDRESSES_PROVIDER_REGISTRATION: {
14
+ key: `${string}/${string}`;
15
+ resources: {
16
+ resourceKey: "addresses";
17
+ title: string;
18
+ itemIdentityPath: string;
19
+ itemRendererKey: `${string}/${string}`;
20
+ defaultForWidget: true;
21
+ query: {
22
+ search: false;
23
+ pagination: false;
24
+ };
25
+ }[];
26
+ query: typeof queryPhiCustomerFileAddresses;
27
+ };
28
+ export declare const PhiThreadsCustomerFileAddressesProviderClient: import("react").ComponentType<{
29
+ children: import("react").ReactNode;
30
+ }>;
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { isPhiRecord } from "../../../../helpers/is-record";
3
+ import { readPhiPositiveInteger, readPhiTableRows, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
4
+ import { createPhiCollectionProviderClient, } from "../../../../components/widgets/client/shared/phi-collection-provider";
5
+ import { toPhiSiteAddressRow } from "../../../../helpers/site-address-row";
6
+ import { PHI_CUSTOMER_FILE_MEMBER_PARAM, PHI_CUSTOMER_FILE_OWN_FILE_PARAM, PHI_CUSTOMER_FILE_RESOURCE_KEYS as RESOURCES, } from "../../../../constants/customer-file";
7
+ import { PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "../data-providers";
8
+ import { PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
9
+ import { buildPhiCustomerFileFirstPagePath, PhiCustomerFileOwnFileRefusal, readPhiCustomerFile, } from "./customer-file-read";
10
+ function answer(items, emptyDescription) {
11
+ return {
12
+ resourceKey: RESOURCES.addresses,
13
+ items,
14
+ total: items.length,
15
+ loading: false,
16
+ error: null,
17
+ ...(emptyDescription ? { meta: { emptyDescription } } : {}),
18
+ };
19
+ }
20
+ /**
21
+ * The chosen member's addresses, read-only, as tiles (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`): from the first
22
+ * page of their file, the request the person Table, the conversations Table and the Conversations Controller
23
+ * make for the same choice -- joined, never asked again (`readPhiCustomerFile`), so one choice is still one
24
+ * entry in the access log. The member is the binding param `userId` the Controller forwards.
25
+ *
26
+ * Nobody chosen reads nothing. The reader's own file, which Core refuses, answers no addresses with the
27
+ * Page's own-file sentence as the tiles' empty sentence (`meta.emptyDescription`), as each Table says it
28
+ * where its rows would be; any other failure is the source's.
29
+ */
30
+ export async function queryPhiCustomerFileAddresses({ resourceKey, params, signal }) {
31
+ if (resourceKey !== RESOURCES.addresses) {
32
+ throw new Error(`Unknown customer file addresses resource "${resourceKey}".`);
33
+ }
34
+ const userId = readPhiPositiveInteger(params?.[PHI_CUSTOMER_FILE_MEMBER_PARAM]);
35
+ if (!userId)
36
+ return answer([]);
37
+ try {
38
+ const result = await readPhiCustomerFile(buildPhiCustomerFileFirstPagePath(userId), signal);
39
+ if (!isPhiRecord(result) || !isPhiRecord(result.person)) {
40
+ throw new Error("The customer file answer is invalid.");
41
+ }
42
+ return answer(readPhiTableRows(result.person.addresses).map(toPhiSiteAddressRow));
43
+ }
44
+ catch (error) {
45
+ if (!(error instanceof PhiCustomerFileOwnFileRefusal))
46
+ throw error;
47
+ const notice = params?.[PHI_CUSTOMER_FILE_OWN_FILE_PARAM];
48
+ return answer([], typeof notice === "string" && notice.trim() ? notice : error.message);
49
+ }
50
+ }
51
+ const descriptor = PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS
52
+ .find((candidate) => candidate.key === PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses);
53
+ const resources = descriptor?.kind === "collection" ? descriptor.resources : [];
54
+ export const PHI_THREADS_CUSTOMER_FILE_ADDRESSES_PROVIDER_REGISTRATION = {
55
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses,
56
+ resources,
57
+ query: queryPhiCustomerFileAddresses,
58
+ };
59
+ export const PhiThreadsCustomerFileAddressesProviderClient = createPhiCollectionProviderClient(PHI_THREADS_CUSTOMER_FILE_ADDRESSES_PROVIDER_REGISTRATION);