@phis/ui 0.7.8 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +15 -7
  2. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  3. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  4. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  5. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  6. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  7. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  8. package/components/cms/phi-cms-root-layout.js +3 -1
  9. package/components/controls/phi-address-control.d.ts +23 -0
  10. package/components/controls/phi-address-control.js +43 -0
  11. package/components/controls/phi-color-control.d.ts +3 -1
  12. package/components/controls/phi-color-control.js +2 -2
  13. package/components/controls/phi-country-select-control.d.ts +22 -0
  14. package/components/controls/phi-country-select-control.js +16 -0
  15. package/components/controls/phi-dialog-control.d.ts +1 -1
  16. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  17. package/components/controls/phi-drawer-control-adapter.js +5 -3
  18. package/components/controls/phi-drawer-control.d.ts +7 -5
  19. package/components/controls/phi-float-button-control.d.ts +8 -1
  20. package/components/controls/phi-float-button-control.js +19 -3
  21. package/components/controls/phi-form-control.js +52 -8
  22. package/components/controls/phi-media-picker-control.d.ts +9 -0
  23. package/components/controls/phi-media-picker-control.js +1 -1
  24. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  25. package/components/controls/phi-modal-control-adapter.js +14 -37
  26. package/components/controls/phi-modal-control.d.ts +5 -5
  27. package/components/controls/phi-options-provider.d.ts +1 -0
  28. package/components/controls/phi-options-provider.js +1 -0
  29. package/components/controls/phi-overlay-control-contract.d.ts +52 -17
  30. package/components/controls/phi-overlay-control-contract.js +55 -30
  31. package/components/controls/phi-popover-control.js +4 -1
  32. package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
  33. package/components/controls/phi-reveal-once-dialog-control.js +52 -0
  34. package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
  35. package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
  36. package/components/controls/phi-table-control.d.ts +7 -1
  37. package/components/controls/phi-table-control.js +23 -8
  38. package/components/forms/flags-field.d.ts +22 -0
  39. package/components/forms/flags-field.js +58 -0
  40. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  41. package/components/forms/form-descriptor-field-check.js +41 -0
  42. package/components/forms/form-descriptor-runtime-client.js +11 -10
  43. package/components/forms/form-option-flags.d.ts +20 -0
  44. package/components/forms/form-option-flags.js +38 -0
  45. package/components/forms/form-provider-contract.d.ts +23 -0
  46. package/components/forms/form-provider-contract.js +36 -0
  47. package/components/forms/form-provider-registry.d.ts +5 -1
  48. package/components/forms/form-record-source.d.ts +38 -0
  49. package/components/forms/form-record-source.js +48 -0
  50. package/components/forms/shared-form-descriptors.d.ts +0 -34
  51. package/components/forms/shared-form-descriptors.js +0 -6
  52. package/components/forms/shared-form-ids.d.ts +1 -1
  53. package/components/forms/shared-form-ids.js +1 -1
  54. package/components/forms/shared-form-provider-registry.js +13 -0
  55. package/components/forms/structured-field-labels.d.ts +24 -0
  56. package/components/forms/structured-field-labels.js +43 -0
  57. package/components/forms/structured-form-field-controls.d.ts +12 -0
  58. package/components/forms/structured-form-field-controls.js +65 -0
  59. package/components/media/media-settings-labels.d.ts +1 -0
  60. package/components/media/media-settings-labels.js +2 -0
  61. package/components/media/phi-media-picker-binding.d.ts +41 -33
  62. package/components/media/phi-media-picker-binding.js +2 -1
  63. package/components/media/use-media-library-add-picker.d.ts +33 -32
  64. package/components/overlays/phi-overlay-container-client.js +13 -11
  65. package/components/regions/phi-cms-region-shell.js +2 -2
  66. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  67. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +13 -2
  68. package/components/regions/presets/phi-settings-page-shell-tree.js +4 -4
  69. package/components/root/phi-root-theme-resolver.js +3 -0
  70. package/components/shell/phi-antd-icon.d.ts +1 -8
  71. package/components/shell/phi-antd-icon.js +1 -227
  72. package/components/shell/phi-icon-names.d.ts +22 -0
  73. package/components/shell/phi-icon-names.js +267 -0
  74. package/components/shell/phi-icon.d.ts +4 -15
  75. package/components/shell/phi-icon.js +9 -50
  76. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  77. package/components/tables/client/phi-table-binding-params.js +39 -0
  78. package/components/tables/client/phi-table-binding.d.ts +1 -3
  79. package/components/tables/client/phi-table-binding.js +5 -9
  80. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  81. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  82. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  83. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  84. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  85. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  86. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  87. package/components/widgets/client/shared/phi-command-buttons.d.ts +29 -2
  88. package/components/widgets/client/shared/phi-command-buttons.js +19 -5
  89. package/components/widgets/client/shared/phi-rendered-value.js +27 -3
  90. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  91. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  92. package/components/widgets/config/background.d.ts +3 -2
  93. package/components/widgets/config/choice-shared.d.ts +10 -1
  94. package/components/widgets/config/choice-shared.js +8 -2
  95. package/components/widgets/label-sets/admin-locales.js +1 -1
  96. package/components/widgets/label-sets/admin-users.d.ts +3 -5
  97. package/components/widgets/label-sets/admin-users.js +6 -10
  98. package/components/widgets/label-sets/builder-modules.js +4 -0
  99. package/components/widgets/label-sets/effects.js +2 -4
  100. package/components/widgets/label-sets/profile.d.ts +13 -16
  101. package/components/widgets/label-sets/profile.js +24 -33
  102. package/components/widgets/label-sets/registration.d.ts +0 -1
  103. package/components/widgets/label-sets/registration.js +0 -2
  104. package/components/widgets/label-sets/revisions.js +2 -0
  105. package/components/widgets/label-sets/search-results.js +2 -4
  106. package/components/widgets/label-sets/signals.js +2 -0
  107. package/components/widgets/label-sets/table.js +9 -0
  108. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  109. package/components/widgets/label-types/builder-modules.js +2 -0
  110. package/components/widgets/label-types/effects.d.ts +3 -2
  111. package/components/widgets/label-types/effects.js +1 -2
  112. package/components/widgets/label-types/revisions.d.ts +2 -0
  113. package/components/widgets/label-types/revisions.js +2 -1
  114. package/components/widgets/label-types/search-results.d.ts +2 -2
  115. package/components/widgets/label-types/search-results.js +1 -2
  116. package/components/widgets/label-types/signals.d.ts +2 -0
  117. package/components/widgets/label-types/signals.js +1 -0
  118. package/components/widgets/label-types/table.d.ts +3 -0
  119. package/components/widgets/label-types/table.js +2 -0
  120. package/components/widgets/server/builder-chrome.d.ts +4 -1
  121. package/components/widgets/server/builder-chrome.js +2 -2
  122. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  123. package/components/widgets/shared/markdown-body-client.js +31 -1
  124. package/components/widgets/shared/markdown-render.d.ts +10 -2
  125. package/components/widgets/shared/markdown-render.js +35 -13
  126. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  127. package/components/widgets/shared/widget-failure-audience.js +21 -0
  128. package/components/widgets/shared/widget-failure-client.js +5 -2
  129. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  130. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  131. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  132. package/components/widgets/shared/widget-failure-notice.js +17 -0
  133. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  134. package/components/widgets/shared/widget-failure-staff.js +18 -0
  135. package/components/widgets/shared/widget-failure.d.ts +9 -6
  136. package/components/widgets/shared/widget-failure.js +0 -9
  137. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  138. package/components/widgets/shared/widget-failure.server.js +8 -3
  139. package/constants/countries.d.ts +9 -0
  140. package/constants/countries.js +28 -0
  141. package/constants/customer-file.d.ts +34 -0
  142. package/constants/customer-file.js +35 -0
  143. package/constants/record-field-kinds.d.ts +15 -0
  144. package/constants/record-field-kinds.js +13 -0
  145. package/constants/runtime-module-ownership.js +15 -2
  146. package/constants/runtime-render-client-types.d.ts +5 -0
  147. package/constants/runtime-render-client-types.js +5 -0
  148. package/constants/site-address.d.ts +9 -0
  149. package/constants/site-address.js +10 -0
  150. package/constants/table-loading.d.ts +14 -0
  151. package/constants/table-loading.js +14 -0
  152. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  153. package/constants.d.ts +2 -0
  154. package/constants.js +4 -0
  155. package/gateway/form-handler-request.d.ts +22 -0
  156. package/gateway/form-handler-request.js +40 -0
  157. package/gateway/label-set.d.ts +15 -2
  158. package/gateway/label-set.js +60 -22
  159. package/gateway/site-cms-write-validation.js +19 -3
  160. package/gateway/site-form-route.js +11 -2
  161. package/helpers/address-field.d.ts +43 -0
  162. package/helpers/address-field.js +68 -0
  163. package/helpers/announced-action.d.ts +17 -0
  164. package/helpers/announced-action.js +29 -0
  165. package/helpers/cms-dialog.d.ts +5 -20
  166. package/helpers/cms-dialog.js +8 -13
  167. package/helpers/cms-page-catalog.d.ts +10 -0
  168. package/helpers/cms-page-catalog.js +19 -0
  169. package/helpers/cms-preset-nodes.d.ts +4 -4
  170. package/helpers/cms-preset-nodes.js +1 -1
  171. package/helpers/cms-region-keys.d.ts +1 -1
  172. package/helpers/country-names.d.ts +12 -0
  173. package/helpers/country-names.js +14 -0
  174. package/helpers/phi-metadata.d.ts +25 -1
  175. package/helpers/phi-metadata.js +53 -1
  176. package/helpers/phi-site-description.d.ts +11 -0
  177. package/helpers/phi-site-description.js +13 -0
  178. package/helpers/preset-form-check.d.ts +14 -0
  179. package/helpers/preset-form-check.js +12 -0
  180. package/helpers/preset-table-check.d.ts +38 -0
  181. package/helpers/preset-table-check.js +118 -0
  182. package/helpers/preset-text-source-check.d.ts +4 -1
  183. package/helpers/preset-text-source-check.js +6 -1
  184. package/helpers/preset-tree-contract-check.d.ts +3 -2
  185. package/helpers/preset-tree-contract-check.js +30 -5
  186. package/helpers/public-route-claims.d.ts +9 -1
  187. package/helpers/public-route-claims.js +23 -3
  188. package/helpers/record-fields.d.ts +1 -5
  189. package/helpers/record-fields.js +15 -6
  190. package/helpers/record-widget-binding.d.ts +10 -0
  191. package/helpers/record-widget-binding.js +35 -0
  192. package/helpers/record-widget.d.ts +1 -10
  193. package/helpers/record-widget.js +4 -33
  194. package/helpers/route-address-check.d.ts +22 -2
  195. package/helpers/route-address-check.js +29 -8
  196. package/helpers/site-address-row.d.ts +23 -0
  197. package/helpers/site-address-row.js +36 -0
  198. package/helpers/surface-style.d.ts +8 -1
  199. package/helpers/surface-style.js +12 -2
  200. package/helpers/table-widget-binding.d.ts +12 -0
  201. package/helpers/table-widget-binding.js +296 -0
  202. package/helpers/thread-inbox-row.d.ts +20 -0
  203. package/helpers/thread-inbox-row.js +26 -0
  204. package/helpers/translation-format.d.ts +26 -0
  205. package/helpers/translation-format.js +31 -0
  206. package/helpers/tree-widget-binding.d.ts +19 -0
  207. package/helpers/tree-widget-binding.js +72 -0
  208. package/helpers/typed-confirmation.d.ts +9 -0
  209. package/helpers/typed-confirmation.js +13 -0
  210. package/helpers/widget-binding-check.d.ts +22 -0
  211. package/helpers/widget-binding-check.js +91 -0
  212. package/module-labels.d.ts +1 -1
  213. package/module-labels.js +1 -1
  214. package/module-page-check.d.ts +3 -0
  215. package/module-page-check.js +3 -0
  216. package/module-records.d.ts +2 -2
  217. package/module-records.js +1 -0
  218. package/next/area-route.js +34 -1
  219. package/next/root-route.js +4 -4
  220. package/package.json +2 -2
  221. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  222. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  223. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  224. package/plugins/runtime-modules/accounting/ids.d.ts +14 -0
  225. package/plugins/runtime-modules/accounting/ids.js +34 -0
  226. package/plugins/runtime-modules/accounting/presets.js +32 -5
  227. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +78 -0
  228. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +136 -0
  229. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  230. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +29 -0
  231. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +450 -0
  232. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  233. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  234. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  235. package/plugins/runtime-modules/app/data-providers.d.ts +43 -0
  236. package/plugins/runtime-modules/app/data-providers.js +45 -0
  237. package/plugins/runtime-modules/app/definition.d.ts +60 -1
  238. package/plugins/runtime-modules/app/definition.js +2 -0
  239. package/plugins/runtime-modules/app/forms.d.ts +33 -3
  240. package/plugins/runtime-modules/app/forms.js +166 -31
  241. package/plugins/runtime-modules/app/ids.d.ts +8 -0
  242. package/plugins/runtime-modules/app/ids.js +9 -0
  243. package/plugins/runtime-modules/app/module.d.ts +60 -1
  244. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  245. package/plugins/runtime-modules/app/services/addresses-collection.js +105 -0
  246. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +21 -0
  247. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +143 -0
  248. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +57 -0
  249. package/plugins/runtime-modules/app/trees/addresses-label-set.js +104 -0
  250. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  251. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +28 -19
  252. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -2
  253. package/plugins/runtime-modules/app/trees/profile-label-set.js +5 -14
  254. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  255. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  256. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  257. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  258. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  259. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  260. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  261. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  262. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  263. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  264. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  265. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  266. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  267. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +6 -3
  268. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  269. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  270. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  271. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  272. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  273. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  274. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  275. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
  276. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  277. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  278. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  279. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  280. package/plugins/runtime-modules/builder/persistence.js +4 -0
  281. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  282. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  283. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
  284. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +47 -7
  285. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  286. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  287. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  288. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  289. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  290. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  291. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  292. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  293. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  294. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  295. package/plugins/runtime-modules/contracts.js +31 -1
  296. package/plugins/runtime-modules/core/definition.d.ts +23 -0
  297. package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
  298. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  299. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  300. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -2
  301. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  302. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  303. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  304. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  305. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  306. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +173 -0
  307. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  308. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  309. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  310. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  311. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  312. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  313. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  314. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  315. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  316. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  317. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  318. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  319. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  320. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  321. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  322. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  323. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  324. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  325. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  326. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  327. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  328. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  329. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  330. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  331. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  332. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  333. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  334. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  335. package/plugins/runtime-modules/core/widgets/table/client.js +48 -51
  336. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  337. package/plugins/runtime-modules/core/widgets/table/config.js +9 -0
  338. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  339. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  340. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  341. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  342. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  343. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  344. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  345. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  346. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  347. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  348. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  349. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  350. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  351. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  352. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  353. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  354. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  355. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  356. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  357. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +9 -2
  358. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  359. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  360. package/plugins/runtime-modules/resolver.js +17 -0
  361. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  362. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  363. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  364. package/plugins/runtime-modules/revisions/controller/client.js +86 -60
  365. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  366. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  367. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  368. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  369. package/plugins/runtime-modules/revisions/forms.js +1 -1
  370. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  371. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  372. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  373. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  374. package/plugins/runtime-modules/revisions/services/table.js +54 -25
  375. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +79 -4
  376. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  377. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  378. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  379. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +105 -7
  380. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  381. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  382. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  383. package/plugins/runtime-modules/threads/client-data-providers.js +10 -0
  384. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  385. package/plugins/runtime-modules/threads/controller/definition.js +49 -1
  386. package/plugins/runtime-modules/threads/data-providers.d.ts +100 -2
  387. package/plugins/runtime-modules/threads/data-providers.js +96 -0
  388. package/plugins/runtime-modules/threads/definition.d.ts +100 -2
  389. package/plugins/runtime-modules/threads/definition.js +1 -1
  390. package/plugins/runtime-modules/threads/ids.d.ts +4 -0
  391. package/plugins/runtime-modules/threads/ids.js +5 -0
  392. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  393. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  394. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  395. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  396. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +126 -0
  397. package/plugins/runtime-modules/threads/services/customer-file-table.js +79 -0
  398. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  399. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  400. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  401. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  402. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  403. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  404. package/plugins/runtime-modules/user-management/ids.js +9 -0
  405. package/plugins/runtime-modules/user-management/presets.js +17 -1
  406. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  407. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  408. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +90 -0
  409. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +122 -0
  410. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  411. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +181 -0
  412. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +24 -18
  413. package/server-helpers/cms-page-record.d.ts +9 -1
  414. package/server-helpers/cms-page-record.js +11 -1
  415. package/server-helpers/cms-request.js +8 -5
  416. package/server-helpers/link-preview-image.d.ts +30 -0
  417. package/server-helpers/link-preview-image.js +57 -0
  418. package/server-helpers/runtime.js +0 -1
  419. package/server-helpers/search-text.js +3 -0
  420. package/server-helpers.d.ts +1 -1
  421. package/server-helpers.js +1 -1
  422. package/styles/controls.css +4 -2
  423. package/styles/layout.css +7 -0
  424. package/styles/shell.css +30 -6
  425. package/theme/phi-antd-token-resolver.d.ts +8 -0
  426. package/theme/phi-antd-token-resolver.js +10 -0
  427. package/theme/phi-theme-color.d.ts +19 -0
  428. package/theme/phi-theme-color.js +42 -0
  429. package/theme/phi-theme-composition.js +9 -0
  430. package/theme/phi-theme-gradients.js +4 -22
  431. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  432. package/theme/phi-theme-inverse-ground.js +103 -0
  433. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  434. package/theme/phi-theme-palette-defaults.js +103 -0
  435. package/theme/phi-theme-tokens.d.ts +2 -1
  436. package/theme/phi-theme-tokens.js +2 -0
  437. package/types/cms-module-descriptors.d.ts +14 -0
  438. package/types/cms-overlay.d.ts +13 -6
  439. package/types/cms-overlay.js +6 -22
  440. package/types/cms-plugins.d.ts +20 -3
  441. package/types/cms.d.ts +10 -0
  442. package/types/collection-provider.d.ts +27 -0
  443. package/types/collection-signal-values.d.ts +2 -0
  444. package/types/collection-signal-values.js +23 -0
  445. package/types/collection-view-widget.d.ts +9 -0
  446. package/types/core-widget-placements.d.ts +9 -3
  447. package/types/link-preview.d.ts +19 -0
  448. package/types/link-preview.js +19 -0
  449. package/types/record-provider.d.ts +22 -1
  450. package/types/signals.d.ts +2 -0
  451. package/types/signals.js +2 -0
  452. package/types/site-theme.d.ts +27 -0
  453. package/types/table-embed.d.ts +48 -0
  454. package/types/table-embed.js +1 -0
  455. package/types/table-widget.d.ts +29 -1
  456. package/types/table-widget.js +0 -282
  457. package/types/tree-widget.d.ts +0 -1
  458. package/types/tree-widget.js +0 -60
  459. package/types/widget-runtime.d.ts +3 -1
  460. package/types.d.ts +2 -1
  461. package/types.js +1 -1
  462. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -0,0 +1,22 @@
1
+ /** The page size the customer file is read at; the Page's conversations Table names the same, Core takes up to 100. */
2
+ export declare const PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE = 25;
3
+ /** The member's file, a page of the conversations they take part in included. */
4
+ export declare function buildPhiCustomerFilePath(userId: number, page: URLSearchParams | null): string;
5
+ /**
6
+ * The first page, as every reader of one choice asks for it: the person, their addresses, the file panel
7
+ * and the conversations Table on a new choice all name this path, so they share one request.
8
+ */
9
+ export declare function buildPhiCustomerFileFirstPagePath(userId: number): string;
10
+ export declare class PhiCustomerFileOwnFileRefusal extends Error {
11
+ }
12
+ /**
13
+ * The route's answer for this caller. A caller that aborts leaves the request to the others; the request
14
+ * itself is aborted only when the last of them has gone, and is then no longer joined.
15
+ */
16
+ export declare function readPhiCustomerFile(path: string, signal: AbortSignal | undefined): Promise<Record<string, unknown> | null>;
17
+ /**
18
+ * The id of the member's file, from the same first-page read the Page's Tables make for the choice, or
19
+ * null where there is none to show: Core refused the reader's own file, or answered no file. Anything
20
+ * else that goes wrong is thrown, as the Tables are told.
21
+ */
22
+ export declare function readPhiCustomerFileThreadId(userId: number, signal: AbortSignal | undefined): Promise<number | null>;
@@ -0,0 +1,101 @@
1
+ "use client";
2
+ import { readPhiJsonError, readPhiJsonPayload } from "../../../../helpers/client-json-request";
3
+ import { buildPhiTablePageParams, createPhiTableProviderRequestInit, readPhiPositiveInteger, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
4
+ import { readPhiTableProviderResponse, } from "../../../../components/widgets/client/shared/phi-table-provider-response";
5
+ import { isPhiRecord } from "../../../../helpers/is-record";
6
+ const RESPONSE_OPTIONS = { subject: "Customer file" };
7
+ /** The page size the customer file is read at; the Page's conversations Table names the same, Core takes up to 100. */
8
+ export const PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE = 25;
9
+ /** The member's file, a page of the conversations they take part in included. */
10
+ export function buildPhiCustomerFilePath(userId, page) {
11
+ const path = `/api/site/members/${userId}/file`;
12
+ return page ? `${path}?${page}` : path;
13
+ }
14
+ /**
15
+ * The first page, as every reader of one choice asks for it: the person, their addresses, the file panel
16
+ * and the conversations Table on a new choice all name this path, so they share one request.
17
+ */
18
+ export function buildPhiCustomerFileFirstPagePath(userId) {
19
+ return buildPhiCustomerFilePath(userId, buildPhiTablePageParams({}, PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE));
20
+ }
21
+ /*
22
+ * Core's refusal of the reader's own file (`403`): the route answers that and nothing else to someone who
23
+ * may open files at all, and nobody else reaches this Page or its member picker.
24
+ */
25
+ export class PhiCustomerFileOwnFileRefusal extends Error {
26
+ }
27
+ /*
28
+ * The reads of one route in flight, by its path. The Page's Tables and the Conversations Controller, which
29
+ * opens the file, ask for the same member at the same time -- the person Table's choice reaches all of them
30
+ * at once -- and one request answers them all, so one choice is one entry in the access log. Nothing
31
+ * outlives the request: once it settles its entry is gone, and the next read, a reload or another member
32
+ * asks again.
33
+ */
34
+ const customerFileReads = new Map();
35
+ function abortReason(signal) {
36
+ return signal.reason ?? new DOMException("The read was aborted.", "AbortError");
37
+ }
38
+ /**
39
+ * The route's answer for this caller. A caller that aborts leaves the request to the others; the request
40
+ * itself is aborted only when the last of them has gone, and is then no longer joined.
41
+ */
42
+ export function readPhiCustomerFile(path, signal) {
43
+ if (signal?.aborted)
44
+ return Promise.reject(abortReason(signal));
45
+ let read = customerFileReads.get(path);
46
+ if (!read) {
47
+ const controller = new AbortController();
48
+ const entry = {
49
+ controller,
50
+ waiters: 0,
51
+ promise: (async () => {
52
+ const response = await fetch(path, createPhiTableProviderRequestInit(controller.signal));
53
+ if (response.status === 403) {
54
+ const refused = await readPhiJsonPayload(response);
55
+ throw new PhiCustomerFileOwnFileRefusal(readPhiJsonError(refused, "Nobody reaches their own file."));
56
+ }
57
+ return readPhiTableProviderResponse(response, RESPONSE_OPTIONS);
58
+ })().finally(() => {
59
+ if (customerFileReads.get(path) === entry)
60
+ customerFileReads.delete(path);
61
+ }),
62
+ };
63
+ // A request every caller left rejects with nobody listening.
64
+ entry.promise.catch(() => undefined);
65
+ customerFileReads.set(path, entry);
66
+ read = entry;
67
+ }
68
+ const shared = read;
69
+ shared.waiters += 1;
70
+ if (!signal)
71
+ return shared.promise;
72
+ return new Promise((resolve, reject) => {
73
+ const leave = () => {
74
+ shared.waiters -= 1;
75
+ reject(abortReason(signal));
76
+ if (shared.waiters > 0)
77
+ return;
78
+ if (customerFileReads.get(path) === shared)
79
+ customerFileReads.delete(path);
80
+ shared.controller.abort(abortReason(signal));
81
+ };
82
+ signal.addEventListener("abort", leave, { once: true });
83
+ shared.promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", leave));
84
+ });
85
+ }
86
+ /**
87
+ * The id of the member's file, from the same first-page read the Page's Tables make for the choice, or
88
+ * null where there is none to show: Core refused the reader's own file, or answered no file. Anything
89
+ * else that goes wrong is thrown, as the Tables are told.
90
+ */
91
+ export async function readPhiCustomerFileThreadId(userId, signal) {
92
+ try {
93
+ const result = await readPhiCustomerFile(buildPhiCustomerFileFirstPagePath(userId), signal);
94
+ return isPhiRecord(result) ? readPhiPositiveInteger(result.fileThreadId) ?? null : null;
95
+ }
96
+ catch (error) {
97
+ if (error instanceof PhiCustomerFileOwnFileRefusal)
98
+ return null;
99
+ throw error;
100
+ }
101
+ }
@@ -0,0 +1,126 @@
1
+ import { type PhiTableProviderQueryRequest } from "../../../../types/table-widget";
2
+ export { buildPhiCustomerFilePath } from "./customer-file-read";
3
+ /** The person as Core answered them, one row; a field the actor may not read stays empty. */
4
+ export declare function toPhiCustomerFilePersonRow(person: Record<string, unknown>): {
5
+ userId: unknown;
6
+ displayName: string;
7
+ fullName: string;
8
+ companyName: string;
9
+ email: string;
10
+ phone: string;
11
+ mobile: string;
12
+ };
13
+ /**
14
+ * The person's conversations as the listing shows them, read as the inbox reads its rows. Their file is
15
+ * not one of them: Core answers its id beside the list, and the Page reads the file in a panel of its own
16
+ * (THREADS.md, section 10), so a row of it that the list carries is left out.
17
+ */
18
+ export declare function toPhiCustomerFileThreadRows(result: Record<string, unknown>): {
19
+ kind: string;
20
+ status: string;
21
+ archived: boolean;
22
+ locked: boolean;
23
+ state: string;
24
+ }[];
25
+ declare function queryCustomerFile({ resourceKey, query, params, signal }: PhiTableProviderQueryRequest): Promise<{
26
+ rows: {
27
+ userId: unknown;
28
+ displayName: string;
29
+ fullName: string;
30
+ companyName: string;
31
+ email: string;
32
+ phone: string;
33
+ mobile: string;
34
+ }[];
35
+ total: number;
36
+ summary: {
37
+ userId: number | null;
38
+ };
39
+ } | {
40
+ rows: {
41
+ kind: string;
42
+ status: string;
43
+ archived: boolean;
44
+ locked: boolean;
45
+ state: string;
46
+ }[];
47
+ total?: undefined;
48
+ summary?: undefined;
49
+ }>;
50
+ export declare const PHI_THREADS_CUSTOMER_FILE_TABLE_PROVIDER_REGISTRATION: {
51
+ key: `${string}/${string}`;
52
+ resources: ({
53
+ resourceKey: "person";
54
+ title: string;
55
+ rowIdentityPath: string;
56
+ fields: ({
57
+ key: string;
58
+ title: string;
59
+ type: "number";
60
+ required: true;
61
+ } | {
62
+ key: string;
63
+ title: string;
64
+ type: "string";
65
+ required?: undefined;
66
+ })[];
67
+ summaryFields: {
68
+ key: string;
69
+ title: string;
70
+ type: "number";
71
+ }[];
72
+ query: {
73
+ search: false;
74
+ filterFields: string[];
75
+ sorting: "none";
76
+ pagination: "none";
77
+ total?: undefined;
78
+ };
79
+ rowActivation?: undefined;
80
+ } | {
81
+ resourceKey: "threads";
82
+ title: string;
83
+ rowIdentityPath: string;
84
+ rowActivation: true;
85
+ fields: ({
86
+ key: string;
87
+ title: string;
88
+ type: "number";
89
+ required: true;
90
+ options?: undefined;
91
+ } | {
92
+ key: string;
93
+ title: string;
94
+ type: "string";
95
+ required?: undefined;
96
+ options?: undefined;
97
+ } | {
98
+ key: string;
99
+ title: string;
100
+ type: "enum";
101
+ options: {
102
+ value: string;
103
+ label: string;
104
+ }[];
105
+ required?: undefined;
106
+ } | {
107
+ key: string;
108
+ title: string;
109
+ type: "datetime";
110
+ required?: undefined;
111
+ options?: undefined;
112
+ })[];
113
+ query: {
114
+ search: false;
115
+ filterFields: string[];
116
+ sorting: "none";
117
+ pagination: "offset";
118
+ total: false;
119
+ };
120
+ summaryFields?: undefined;
121
+ })[];
122
+ query: typeof queryCustomerFile;
123
+ };
124
+ export declare const PhiThreadsCustomerFileTableProviderClient: import("react").ComponentType<{
125
+ children: import("react").ReactNode;
126
+ }>;
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { isPhiRecord } from "../../../../helpers/is-record";
3
+ import { buildPhiTablePageParams, readPhiPositiveInteger, readPhiTableRows, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
4
+ import { createPhiTableProviderClient, } from "../../../../components/widgets/client/shared/phi-table-provider";
5
+ import { PhiTableProviderError } from "../../../../types/table-widget";
6
+ import { readPhiThreadInboxRow } from "../../../../helpers/thread-inbox-row";
7
+ import { PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "../data-providers";
8
+ import { PHI_CUSTOMER_FILE_OWN_FILE_PARAM, PHI_CUSTOMER_FILE_RESOURCE_KEYS as RESOURCES, } from "../../../../constants/customer-file";
9
+ import { PHI_TABLE_PROVIDER_REFUSED_CODE } from "../../../../components/widgets/client/shared/phi-table-provider-refusal";
10
+ import { PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
11
+ import { buildPhiCustomerFilePath, PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE, PhiCustomerFileOwnFileRefusal, readPhiCustomerFile, } from "./customer-file-read";
12
+ export { buildPhiCustomerFilePath } from "./customer-file-read";
13
+ function text(value) {
14
+ return typeof value === "string" ? value.trim() : "";
15
+ }
16
+ /** The person as Core answered them, one row; a field the actor may not read stays empty. */
17
+ export function toPhiCustomerFilePersonRow(person) {
18
+ const name = isPhiRecord(person.name) ? person.name : null;
19
+ const phone = isPhiRecord(person.phone) ? person.phone : null;
20
+ return {
21
+ userId: person.userId,
22
+ displayName: text(person.displayName),
23
+ fullName: name ? [text(name.firstName), text(name.lastName)].filter(Boolean).join(" ") : "",
24
+ companyName: name ? text(name.companyName) : "",
25
+ email: text(person.email),
26
+ phone: phone ? text(phone.phone) : "",
27
+ mobile: phone ? text(phone.mobile) : "",
28
+ };
29
+ }
30
+ /**
31
+ * The person's conversations as the listing shows them, read as the inbox reads its rows. Their file is
32
+ * not one of them: Core answers its id beside the list, and the Page reads the file in a panel of its own
33
+ * (THREADS.md, section 10), so a row of it that the list carries is left out.
34
+ */
35
+ export function toPhiCustomerFileThreadRows(result) {
36
+ const fileThreadId = readPhiPositiveInteger(result.fileThreadId);
37
+ return readPhiTableRows(result.threads)
38
+ .map(readPhiThreadInboxRow)
39
+ .filter((row) => row.id !== fileThreadId);
40
+ }
41
+ async function queryCustomerFile({ resourceKey, query, params, signal }) {
42
+ if (resourceKey !== RESOURCES.person && resourceKey !== RESOURCES.threads) {
43
+ throw new PhiTableProviderError("resource-not-found", `Unknown customer file resource "${resourceKey}".`);
44
+ }
45
+ // Nobody chosen yet: nothing is asked for, so nothing is written to the access log.
46
+ const userId = readPhiPositiveInteger(query.filters?.userId);
47
+ if (!userId) {
48
+ if (resourceKey === RESOURCES.threads)
49
+ return { rows: [] };
50
+ return { rows: [], total: 0, summary: { userId: null } };
51
+ }
52
+ // The person is the same on every page; it asks for the first, as the conversations Table, the
53
+ // addresses Collection and the Controller opening the file do on a choice, so the reads are one route.
54
+ const paged = buildPhiTablePageParams(resourceKey === RESOURCES.threads ? query : {}, PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE);
55
+ const result = await readPhiCustomerFile(buildPhiCustomerFilePath(userId, paged), signal).catch((error) => {
56
+ if (!(error instanceof PhiCustomerFileOwnFileRefusal))
57
+ throw error;
58
+ // Said where the rows would be, in the Page's words where it gave them, and the picker stays.
59
+ const notice = params?.[PHI_CUSTOMER_FILE_OWN_FILE_PARAM];
60
+ throw new PhiTableProviderError(PHI_TABLE_PROVIDER_REFUSED_CODE, typeof notice === "string" && notice.trim() ? notice : error.message);
61
+ });
62
+ if (!isPhiRecord(result) || !isPhiRecord(result.person)) {
63
+ throw new PhiTableProviderError("invalid-response", "The customer file answer is invalid.");
64
+ }
65
+ if (resourceKey === RESOURCES.person) {
66
+ const row = toPhiCustomerFilePersonRow(result.person);
67
+ return { rows: [row], total: 1, summary: { userId: typeof row.userId === "number" ? row.userId : null } };
68
+ }
69
+ return { rows: toPhiCustomerFileThreadRows(result) };
70
+ }
71
+ const descriptor = PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS
72
+ .find((candidate) => candidate.key === PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFile);
73
+ const resources = descriptor?.kind === "table" ? descriptor.resources : [];
74
+ export const PHI_THREADS_CUSTOMER_FILE_TABLE_PROVIDER_REGISTRATION = {
75
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFile,
76
+ resources,
77
+ query: queryCustomerFile,
78
+ };
79
+ export const PhiThreadsCustomerFileTableProviderClient = createPhiTableProviderClient(PHI_THREADS_CUSTOMER_FILE_TABLE_PROVIDER_REGISTRATION);
@@ -5,7 +5,7 @@ import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
5
5
  import { createPhiSignalAddress, createPhiSignalSubcontrolAddress, PHI_SIGNAL_VALUE_SCHEMAS, } from "../../../../types/signals";
6
6
  import { PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS } from "../../../../constants/thread-library-provider-keys";
7
7
  import { PhisThreadKind, PhisThreadStatus } from "../../../../constants/threads";
8
- import { createPhiThreadsControllerAddress, PHI_THREADS_CONTROLLER_INSTANCE_KEY, PHI_THREADS_CONTROLLER_TYPE, } from "../controller/address";
8
+ import { createPhiThreadsControllerAddress, PHI_THREADS_CONTROLLER_INSTANCE_KEY, PHI_THREADS_CONTROLLER_TYPE, } from "../../../../constants/threads-controller-address";
9
9
  import { createPhiThreadsPageIds } from "../addresses";
10
10
  import { PHI_THREADS_FORM_IDS } from "../forms";
11
11
  import { PHI_SHARED_FORM_IDS } from "../../../../components/forms/shared-form-ids";
@@ -74,7 +74,7 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
74
74
  config: {
75
75
  title: labels.composerLabel,
76
76
  // Core's Reply Form is one column, and not this Module's to hand to `dialog` (`body.form`).
77
- width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
77
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
78
78
  mountPolicy: "remount",
79
79
  closeMode: "immediate",
80
80
  openActionKey: "reply",
@@ -266,7 +266,7 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
266
266
  label: "app-threads-new-modal",
267
267
  config: {
268
268
  title: labels.newConversationLabel,
269
- width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
269
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
270
270
  mountPolicy: "remount",
271
271
  closeMode: "request",
272
272
  signalRoutes: {
@@ -351,6 +351,8 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
351
351
  */
352
352
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
353
353
  sortOrder: 0,
354
+ // The Module's Label Set, translated already.
355
+ flags: PhiCmsFlags.NoTranslate,
354
356
  label: labels.inboxTitle,
355
357
  config: {
356
358
  source: {
@@ -20,4 +20,9 @@ export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
20
20
  loadLive: async () => (await import("../../../plugins/runtime-modules/user-management/services/table"))
21
21
  .PhiUserManagementTableProviderClient,
22
22
  },
23
+ {
24
+ key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.usersAccess,
25
+ ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
26
+ loadLive: async () => (await import("./services/users-access-table")).PhiUserManagementUsersAccessTableProviderClient,
27
+ },
23
28
  ];
@@ -165,4 +165,163 @@ export declare const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
165
165
  summaryFields?: undefined;
166
166
  actions?: undefined;
167
167
  })[];
168
+ } | {
169
+ key: `${string}/${string}`;
170
+ ownerModuleId: "@phis/ui/modules/user-management";
171
+ kind: "table";
172
+ executionMode: "live";
173
+ authoringMode: "none";
174
+ title: string;
175
+ description: string;
176
+ resources: ({
177
+ resourceKey: "addons";
178
+ title: string;
179
+ rowIdentityPath: string;
180
+ fields: ({
181
+ key: "fields" | "background" | "granted" | "effective" | "awaiting";
182
+ title: "fields" | "background" | "granted" | "effective" | "awaiting";
183
+ type: "enum[]";
184
+ options: {
185
+ value: "name" | "email" | "address" | "phone";
186
+ label: "name" | "email" | "address" | "phone";
187
+ }[];
188
+ } | {
189
+ key: string;
190
+ title: string;
191
+ type: "string";
192
+ required: true;
193
+ } | {
194
+ key: string;
195
+ title: string;
196
+ type: "datetime";
197
+ required?: undefined;
198
+ } | {
199
+ key: string;
200
+ title: string;
201
+ type: "number";
202
+ required?: undefined;
203
+ } | {
204
+ key: string;
205
+ title: string;
206
+ type: "boolean";
207
+ required?: undefined;
208
+ })[];
209
+ query: {
210
+ search: false;
211
+ filterFields: never[];
212
+ sorting: "none";
213
+ pagination: "none";
214
+ total?: undefined;
215
+ };
216
+ actions: ({
217
+ key: string;
218
+ title: string;
219
+ scope: "row";
220
+ intent: "write";
221
+ confirmation: "required";
222
+ disabledWhen: {
223
+ source: "row";
224
+ valuePath: string;
225
+ operator: "falsy";
226
+ };
227
+ } | {
228
+ key: string;
229
+ title: string;
230
+ scope: "row";
231
+ intent: "destructive";
232
+ confirmation: "required";
233
+ disabledWhen: {
234
+ source: "row";
235
+ valuePath: string;
236
+ operator: "falsy";
237
+ };
238
+ })[];
239
+ } | {
240
+ resourceKey: "retention";
241
+ title: string;
242
+ rowIdentityPath: string;
243
+ fields: ({
244
+ key: string;
245
+ title: string;
246
+ type: "string";
247
+ required: true;
248
+ mutable?: undefined;
249
+ constraints?: undefined;
250
+ } | {
251
+ key: string;
252
+ title: string;
253
+ type: "number";
254
+ mutable: true;
255
+ constraints: {
256
+ min: number;
257
+ max: number;
258
+ step: number;
259
+ precision: number;
260
+ };
261
+ required?: undefined;
262
+ })[];
263
+ query: {
264
+ search: false;
265
+ filterFields: never[];
266
+ sorting: "none";
267
+ pagination: "none";
268
+ total?: undefined;
269
+ };
270
+ actions?: undefined;
271
+ } | {
272
+ resourceKey: "log";
273
+ title: string;
274
+ rowIdentityPath: string;
275
+ fields: ({
276
+ key: string;
277
+ title: string;
278
+ type: "string";
279
+ required: true;
280
+ options?: undefined;
281
+ } | {
282
+ key: string;
283
+ title: string;
284
+ type: "datetime";
285
+ required?: undefined;
286
+ options?: undefined;
287
+ } | {
288
+ key: string;
289
+ title: string;
290
+ type: "string";
291
+ required?: undefined;
292
+ options?: undefined;
293
+ } | {
294
+ key: string;
295
+ title: string;
296
+ type: "enum";
297
+ options: {
298
+ value: string;
299
+ label: string;
300
+ }[];
301
+ required?: undefined;
302
+ } | {
303
+ key: string;
304
+ title: string;
305
+ type: "json";
306
+ required?: undefined;
307
+ options?: undefined;
308
+ } | {
309
+ key: string;
310
+ title: string;
311
+ type: "enum[]";
312
+ options: {
313
+ value: "name" | "email" | "address" | "phone";
314
+ label: "name" | "email" | "address" | "phone";
315
+ }[];
316
+ required?: undefined;
317
+ })[];
318
+ query: {
319
+ search: false;
320
+ filterFields: string[];
321
+ sorting: "none";
322
+ pagination: "offset";
323
+ total: false;
324
+ };
325
+ actions?: undefined;
326
+ })[];
168
327
  })[];
@@ -1,4 +1,5 @@
1
- import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS } from "./ids";
1
+ import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS, PHI_USER_MANAGEMENT_USERS_ACCESS_RESOURCE_KEYS } from "./ids";
2
+ import { PHIS_USER_FIELDS } from "@phis/contracts/users";
2
3
  import { PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID } from "./ids";
3
4
  import { createPhiUserManagementControllerAddress } from "../../../plugins/runtime-modules/user-management/controller/address";
4
5
  export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
@@ -61,7 +62,6 @@ export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
61
62
  { key: "lastLoginAt", title: "Last login", type: "datetime" },
62
63
  { key: "createdAt", title: "Created", type: "datetime" },
63
64
  { key: "self", title: "Current user", type: "boolean" },
64
- { key: "medusaCustomerId", title: "Medusa customer", type: "string" },
65
65
  ],
66
66
  query: {
67
67
  search: true,
@@ -76,7 +76,6 @@ export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
76
76
  disabledWhen: { match: "any", conditions: [
77
77
  { source: "controller", controllerAddress: createPhiUserManagementControllerAddress(), valuePath: "permissions.readOnly", operator: "truthy" },
78
78
  { source: "row", valuePath: "self", operator: "truthy" },
79
- { source: "row", valuePath: "medusaCustomerId", operator: "truthy" },
80
79
  ] },
81
80
  intent: "destructive",
82
81
  confirmation: "required",
@@ -103,4 +102,103 @@ export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
103
102
  },
104
103
  ],
105
104
  },
105
+ /*
106
+ * What this Site lets Add-ons read of people with nobody acting (`users:v1` background access), how
107
+ * long it keeps the access log, and the log itself (phis-server `/api/site/admin/users-access`, Site
108
+ * Admin only; Core refuses everybody else whatever a Table offers). A grant is the Admin's decision per
109
+ * Add-on and Site, so the Table grants what the manifest asks, or withdraws it; it never widens it.
110
+ */
111
+ {
112
+ key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.usersAccess,
113
+ ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
114
+ kind: "table",
115
+ executionMode: "live",
116
+ authoringMode: "none",
117
+ title: "People data access",
118
+ description: "Which Add-ons read people in the background, the access log and how long it is kept.",
119
+ resources: [
120
+ {
121
+ resourceKey: PHI_USER_MANAGEMENT_USERS_ACCESS_RESOURCE_KEYS.addons,
122
+ title: "Add-ons reading people",
123
+ rowIdentityPath: "addonId",
124
+ fields: [
125
+ { key: "addonId", title: "Add-on", type: "string", required: true },
126
+ ...["fields", "background", "granted", "effective", "awaiting"].map((key) => ({
127
+ key,
128
+ title: key,
129
+ type: "enum[]",
130
+ options: PHIS_USER_FIELDS.map((value) => ({ value, label: value })),
131
+ })),
132
+ { key: "grantedAt", title: "Granted", type: "datetime" },
133
+ { key: "grantedByUserId", title: "Granted by", type: "number" },
134
+ // What the two acts apply to: something asked and not granted, and a grant to withdraw.
135
+ { key: "hasAwaiting", title: "Fields awaiting a grant", type: "boolean" },
136
+ { key: "hasGrant", title: "Granted", type: "boolean" },
137
+ ],
138
+ query: { search: false, filterFields: [], sorting: "none", pagination: "none" },
139
+ actions: [
140
+ {
141
+ key: "grant",
142
+ title: "Grant what is asked",
143
+ scope: "row",
144
+ intent: "write",
145
+ confirmation: "required",
146
+ disabledWhen: { source: "row", valuePath: "hasAwaiting", operator: "falsy" },
147
+ },
148
+ {
149
+ key: "revoke",
150
+ title: "Withdraw",
151
+ scope: "row",
152
+ intent: "destructive",
153
+ confirmation: "required",
154
+ disabledWhen: { source: "row", valuePath: "hasGrant", operator: "falsy" },
155
+ },
156
+ ],
157
+ },
158
+ {
159
+ // One row, so the number is edited where it is read, as a quota is on the Media settings.
160
+ resourceKey: PHI_USER_MANAGEMENT_USERS_ACCESS_RESOURCE_KEYS.retention,
161
+ title: "Access log retention",
162
+ rowIdentityPath: "id",
163
+ fields: [
164
+ { key: "id", title: "ID", type: "string", required: true },
165
+ { key: "days", title: "Days kept", type: "number", mutable: true, constraints: { min: 1, max: 3650, step: 1, precision: 0 } },
166
+ ],
167
+ query: { search: false, filterFields: [], sorting: "none", pagination: "none" },
168
+ },
169
+ {
170
+ resourceKey: PHI_USER_MANAGEMENT_USERS_ACCESS_RESOURCE_KEYS.log,
171
+ title: "Access log",
172
+ rowIdentityPath: "key",
173
+ fields: [
174
+ { key: "key", title: "Entry", type: "string", required: true },
175
+ { key: "at", title: "At", type: "datetime" },
176
+ { key: "addonId", title: "Add-on", type: "string" },
177
+ { key: "actor", title: "Acting", type: "string" },
178
+ {
179
+ key: "road",
180
+ title: "Road",
181
+ type: "enum",
182
+ options: ["staff", "self", "background", "checkout"].map((value) => ({ value, label: value })),
183
+ },
184
+ {
185
+ key: "operation",
186
+ title: "Operation",
187
+ type: "enum",
188
+ options: ["describe", "addresses", "createAddress", "fileOf", "customerFile"].map((value) => ({ value, label: value })),
189
+ },
190
+ { key: "subjects", title: "Subjects", type: "json" },
191
+ { key: "addressIds", title: "Addresses", type: "json" },
192
+ {
193
+ key: "fields",
194
+ title: "Fields",
195
+ type: "enum[]",
196
+ options: PHIS_USER_FIELDS.map((value) => ({ value, label: value })),
197
+ },
198
+ ],
199
+ // Newest first and no count: Core pages the log and says nothing of how long it is.
200
+ query: { search: false, filterFields: ["subject", "addonId"], sorting: "none", pagination: "offset", total: false },
201
+ },
202
+ ],
203
+ },
106
204
  ];