@phis/ui 0.8.0 → 0.8.2

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 (304) hide show
  1. package/README.md +9 -2
  2. package/components/cms/phi-cms-layout-renderer.js +15 -7
  3. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  4. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  5. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  6. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  7. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  8. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  9. package/components/cms/phi-cms-root-layout.js +3 -1
  10. package/components/controls/phi-media-picker-control.d.ts +9 -0
  11. package/components/controls/phi-media-picker-control.js +1 -1
  12. package/components/controls/phi-popover-control.js +4 -1
  13. package/components/controls/phi-table-control.d.ts +7 -1
  14. package/components/controls/phi-table-control.js +26 -11
  15. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  16. package/components/forms/form-descriptor-field-check.js +41 -0
  17. package/components/forms/form-descriptor-runtime-client.js +11 -10
  18. package/components/forms/form-record-source.d.ts +38 -0
  19. package/components/forms/form-record-source.js +48 -0
  20. package/components/forms/shared-form-descriptors.d.ts +0 -34
  21. package/components/forms/shared-form-descriptors.js +0 -6
  22. package/components/forms/shared-form-ids.d.ts +1 -1
  23. package/components/forms/shared-form-ids.js +1 -1
  24. package/components/media/media-settings-labels.d.ts +1 -0
  25. package/components/media/media-settings-labels.js +2 -0
  26. package/components/media/media-upload-flow.d.ts +62 -5
  27. package/components/media/media-upload-flow.js +62 -24
  28. package/components/media/phi-area-upload-widget.d.ts +44 -1
  29. package/components/media/phi-area-upload-widget.js +32 -7
  30. package/components/media/phi-media-picker-binding.d.ts +41 -33
  31. package/components/media/phi-media-picker-binding.js +2 -1
  32. package/components/media/phi-media-upload.d.ts +10 -3
  33. package/components/media/phi-media-upload.js +11 -8
  34. package/components/media/use-media-library-add-picker.d.ts +33 -32
  35. package/components/overlays/phi-overlay-container-client.js +11 -9
  36. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +7 -0
  37. package/components/regions/presets/phi-settings-page-shell-tree.js +3 -3
  38. package/components/shell/phi-icon-names.d.ts +3 -0
  39. package/components/shell/phi-icon-names.js +3 -0
  40. package/components/shell/phi-icon.d.ts +5 -7
  41. package/components/shell/phi-icon.js +8 -21
  42. package/components/shell/phi-widget-icon.js +1 -0
  43. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  44. package/components/tables/client/phi-table-binding-params.js +39 -0
  45. package/components/tables/client/phi-table-binding.d.ts +1 -3
  46. package/components/tables/client/phi-table-binding.js +5 -9
  47. package/components/widgets/client/html-editor-link-node.d.ts +12 -0
  48. package/components/widgets/client/html-editor-link-node.js +60 -0
  49. package/components/widgets/client/html-editor.js +10 -6
  50. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  51. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  52. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  53. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  54. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  55. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  56. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  57. package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
  58. package/components/widgets/client/shared/phi-command-buttons.d.ts +16 -0
  59. package/components/widgets/client/shared/phi-command-buttons.js +9 -1
  60. package/components/widgets/label-sets/admin-users.d.ts +1 -0
  61. package/components/widgets/label-sets/admin-users.js +2 -0
  62. package/components/widgets/label-sets/builder-modules.js +4 -0
  63. package/components/widgets/label-sets/profile.d.ts +0 -16
  64. package/components/widgets/label-sets/profile.js +0 -37
  65. package/components/widgets/label-sets/registration.d.ts +0 -1
  66. package/components/widgets/label-sets/registration.js +0 -2
  67. package/components/widgets/label-sets/revisions.js +2 -0
  68. package/components/widgets/label-sets/signals.js +2 -0
  69. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  70. package/components/widgets/label-types/builder-modules.js +2 -0
  71. package/components/widgets/label-types/revisions.d.ts +2 -0
  72. package/components/widgets/label-types/revisions.js +2 -1
  73. package/components/widgets/label-types/signals.d.ts +2 -0
  74. package/components/widgets/label-types/signals.js +1 -0
  75. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  76. package/components/widgets/shared/widget-failure-audience.js +21 -0
  77. package/components/widgets/shared/widget-failure-client.js +5 -2
  78. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  79. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  80. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  81. package/components/widgets/shared/widget-failure-notice.js +17 -0
  82. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  83. package/components/widgets/shared/widget-failure-staff.js +18 -0
  84. package/components/widgets/shared/widget-failure.d.ts +9 -6
  85. package/components/widgets/shared/widget-failure.js +0 -9
  86. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  87. package/components/widgets/shared/widget-failure.server.js +8 -3
  88. package/constants/cms-widget-types.d.ts +1 -0
  89. package/constants/cms-widget-types.js +3 -0
  90. package/constants/customer-file.d.ts +12 -3
  91. package/constants/customer-file.js +12 -3
  92. package/constants/runtime-module-ownership.js +5 -3
  93. package/constants/site-address.d.ts +9 -0
  94. package/constants/site-address.js +10 -0
  95. package/constants/table-loading.d.ts +14 -0
  96. package/constants/table-loading.js +14 -0
  97. package/constants.d.ts +2 -1
  98. package/constants.js +3 -1
  99. package/gateway/site-cms-write-validation.js +19 -3
  100. package/gateway/site-proxy.d.ts +12 -0
  101. package/gateway/site-proxy.js +20 -0
  102. package/helpers/announced-action.d.ts +17 -0
  103. package/helpers/announced-action.js +29 -0
  104. package/helpers/phi-metadata.d.ts +0 -8
  105. package/helpers/phi-metadata.js +1 -10
  106. package/helpers/phi-site-description.d.ts +11 -0
  107. package/helpers/phi-site-description.js +13 -0
  108. package/helpers/preset-form-check.d.ts +14 -0
  109. package/helpers/preset-form-check.js +12 -0
  110. package/helpers/preset-table-check.d.ts +19 -15
  111. package/helpers/preset-table-check.js +33 -39
  112. package/helpers/record-widget-binding.d.ts +10 -0
  113. package/helpers/record-widget-binding.js +35 -0
  114. package/helpers/record-widget.d.ts +1 -10
  115. package/helpers/record-widget.js +4 -33
  116. package/helpers/table-widget-binding.d.ts +12 -0
  117. package/helpers/table-widget-binding.js +296 -0
  118. package/helpers/tree-widget-binding.d.ts +19 -0
  119. package/helpers/tree-widget-binding.js +72 -0
  120. package/helpers/typed-confirmation.d.ts +9 -0
  121. package/helpers/typed-confirmation.js +13 -0
  122. package/helpers/widget-binding-check.d.ts +22 -0
  123. package/helpers/widget-binding-check.js +91 -0
  124. package/module-page-check.d.ts +2 -0
  125. package/module-page-check.js +2 -0
  126. package/net/phi-next-proxy.d.ts +7 -0
  127. package/net/phi-next-proxy.js +1 -1
  128. package/next/root-route.js +2 -1
  129. package/package.json +27 -14
  130. package/plugins/runtime-modules/accounting/ids.d.ts +7 -4
  131. package/plugins/runtime-modules/accounting/ids.js +14 -3
  132. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +21 -9
  133. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +29 -15
  134. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +11 -8
  135. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +206 -137
  136. package/plugins/runtime-modules/app/client-data-providers.js +1 -1
  137. package/plugins/runtime-modules/app/data-providers.d.ts +14 -69
  138. package/plugins/runtime-modules/app/data-providers.js +19 -54
  139. package/plugins/runtime-modules/app/definition.d.ts +8 -80
  140. package/plugins/runtime-modules/app/forms.d.ts +1 -16
  141. package/plugins/runtime-modules/app/forms.js +0 -59
  142. package/plugins/runtime-modules/app/ids.d.ts +2 -1
  143. package/plugins/runtime-modules/app/ids.js +3 -2
  144. package/plugins/runtime-modules/app/module.d.ts +8 -80
  145. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  146. package/plugins/runtime-modules/app/services/{addresses-table.js → addresses-collection.js} +23 -19
  147. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +10 -6
  148. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +37 -73
  149. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +0 -5
  150. package/plugins/runtime-modules/app/trees/addresses-label-set.js +2 -6
  151. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  152. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +1 -17
  153. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +0 -2
  154. package/plugins/runtime-modules/app/trees/profile-label-set.js +2 -14
  155. package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
  156. package/plugins/runtime-modules/area-contributions/admin.js +2 -0
  157. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  158. package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
  159. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  160. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -1
  161. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  162. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  163. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  164. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +5 -0
  165. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +14 -1
  166. package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
  167. package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
  168. package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
  169. package/plugins/runtime-modules/cdn/authoring.js +8 -0
  170. package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
  171. package/plugins/runtime-modules/cdn/bytes.js +17 -0
  172. package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
  173. package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
  174. package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
  175. package/plugins/runtime-modules/cdn/data-providers.js +117 -0
  176. package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
  177. package/plugins/runtime-modules/cdn/definition.js +23 -0
  178. package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
  179. package/plugins/runtime-modules/cdn/ids.js +20 -0
  180. package/plugins/runtime-modules/cdn/module.d.ts +131 -0
  181. package/plugins/runtime-modules/cdn/module.js +4 -0
  182. package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
  183. package/plugins/runtime-modules/cdn/platform.js +73 -0
  184. package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
  185. package/plugins/runtime-modules/cdn/presets.js +20 -0
  186. package/plugins/runtime-modules/cdn/server.d.ts +1 -0
  187. package/plugins/runtime-modules/cdn/server.js +14 -0
  188. package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
  189. package/plugins/runtime-modules/cdn/services/table.js +296 -0
  190. package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
  191. package/plugins/runtime-modules/cdn/services/upload.js +146 -0
  192. package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
  193. package/plugins/runtime-modules/cdn/table-params.js +10 -0
  194. package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
  195. package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
  196. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
  197. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +479 -0
  198. package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
  199. package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
  200. package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
  201. package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
  202. package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
  203. package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
  204. package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
  205. package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
  206. package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
  207. package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
  208. package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
  209. package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
  210. package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
  211. package/plugins/runtime-modules/cdn/widgets.js +13 -0
  212. package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
  213. package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
  214. package/plugins/runtime-modules/client-manifests/admin.js +11 -1
  215. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  216. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -1
  217. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  218. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  219. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  220. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  221. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +175 -0
  222. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  223. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  224. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +1 -1
  225. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  226. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  227. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +1 -1
  228. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  229. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  230. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  231. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  232. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  233. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  234. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  235. package/plugins/runtime-modules/core/widgets/table/client.js +36 -52
  236. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  237. package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
  238. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  239. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  240. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  241. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  242. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  243. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  244. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  245. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  246. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +5 -0
  247. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  248. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  249. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  250. package/plugins/runtime-modules/revisions/controller/client.js +74 -50
  251. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  252. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  253. package/plugins/runtime-modules/revisions/forms.js +1 -1
  254. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  255. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  256. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  257. package/plugins/runtime-modules/revisions/services/table.js +41 -21
  258. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +76 -3
  259. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  260. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +39 -13
  261. package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
  262. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  263. package/plugins/runtime-modules/threads/controller/definition.js +48 -0
  264. package/plugins/runtime-modules/threads/data-providers.d.ts +22 -37
  265. package/plugins/runtime-modules/threads/data-providers.js +35 -24
  266. package/plugins/runtime-modules/threads/definition.d.ts +22 -37
  267. package/plugins/runtime-modules/threads/ids.d.ts +2 -0
  268. package/plugins/runtime-modules/threads/ids.js +2 -0
  269. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  270. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  271. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  272. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  273. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +14 -80
  274. package/plugins/runtime-modules/threads/services/customer-file-table.js +27 -112
  275. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +4 -0
  276. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +4 -0
  277. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +15 -0
  278. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -0
  279. package/server-helpers/runtime.js +0 -1
  280. package/styles/controls.css +4 -2
  281. package/styles/layout.css +7 -0
  282. package/theme/phi-antd-token-resolver.d.ts +8 -0
  283. package/theme/phi-antd-token-resolver.js +10 -0
  284. package/theme/phi-theme-color.d.ts +19 -0
  285. package/theme/phi-theme-color.js +42 -0
  286. package/theme/phi-theme-gradients.js +4 -22
  287. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  288. package/theme/phi-theme-palette-defaults.js +103 -0
  289. package/types/cms-plugins.d.ts +6 -1
  290. package/types/collection-provider.d.ts +27 -0
  291. package/types/collection-signal-values.d.ts +2 -0
  292. package/types/collection-signal-values.js +23 -0
  293. package/types/collection-view-widget.d.ts +9 -0
  294. package/types/core-widget-placements.d.ts +6 -0
  295. package/types/signals.d.ts +2 -0
  296. package/types/signals.js +2 -0
  297. package/types/table-widget.d.ts +17 -3
  298. package/types/table-widget.js +0 -282
  299. package/types/tree-widget.d.ts +0 -1
  300. package/types/tree-widget.js +0 -60
  301. package/types/widget-runtime.d.ts +0 -1
  302. package/types.d.ts +1 -1
  303. package/types.js +1 -1
  304. package/plugins/runtime-modules/app/services/addresses-table.d.ts +0 -135
@@ -11,7 +11,7 @@ import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from ".
11
11
  import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
12
12
  import { PHI_DIALOG_WIDTH_SINGLE_COLUMN } from "../../../../helpers/cms-dialog";
13
13
  import { createPhiThreadsControllerAddress, PHI_THREADS_CONTROLLER_INSTANCE_KEY, PHI_THREADS_CONTROLLER_TYPE, } from "../../../../constants/threads-controller-address";
14
- import { PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS, PHI_CUSTOMER_FILE_RESOURCE_KEYS as RESOURCES, PHI_CUSTOMER_FILE_OWN_FILE_PARAM, PHI_CUSTOMER_FILE_SUBJECT_PARAM, } from "../../../../constants/customer-file";
14
+ import { PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS, PHI_CUSTOMER_FILE_RESOURCE_KEYS as RESOURCES, PHI_CUSTOMER_FILE_OWN_FILE_PARAM, } from "../../../../constants/customer-file";
15
15
  import { PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_IDS } from "../ids";
16
16
  import { PHI_ACCOUNTING_CUSTOMER_FILE_ACCESS } from "../customer-file-access";
17
17
  import { getPhiAccountingCustomerFilePageLabels } from "./accounting-customer-file-label-set";
@@ -23,15 +23,18 @@ const SYNTHETIC_CUSTOMER_FILE_REGION_ID = -459;
23
23
  *
24
24
  * A Page of the Accounting Module, beside the product directory, built from what the conversations Page
25
25
  * already is and bound by Foundation names only (`constants/customer-file.ts`,
26
- * `constants/threads-controller-address.ts`): the Table Provider and the Conversations Controller are the
27
- * conversations Module's, which is active in the Accounting Area by default and has to be for this Page
28
- * to read anything. The person Table's filter is Core's member picker
26
+ * `constants/threads-controller-address.ts`): the Table and Collection Providers and the Conversations
27
+ * Controller are the conversations Module's, which is active in the Accounting Area by default and has to
28
+ * be for this Page to read anything. The person Table's filter is Core's member picker
29
29
  * (the `site-members` options with Core's search, which matches names, e-mail addresses and telephone
30
- * numbers); its query goes to the addresses and the threads Tables, so one choice fills all three. The
31
- * threads Table lists the person's file first, and choosing a row is the conversations Page's choreography
32
- * unchanged: the Conversations Controller makes the selection a thread, the conversation reads it, and its
33
- * Reply opens Core's Reply Form in a dialog -- with the internal note offered, which is every message of a
34
- * file anyway.
30
+ * numbers); its query goes to the conversations Table and to the Conversations Controller, so one choice
31
+ * fills the Page with one request: the Controller hands the member to the addresses tiles as binding params
32
+ * (Core's address renderer, read-only), joins the Tables' read for the file's id and hands it to the file
33
+ * panel, a conversation reader whose "Add note" opens Core's Reply Form
34
+ * in a dialog of its own (every message of a file is internal). The conversations Table lists the person's
35
+ * conversations, the file not among them, and choosing a row is the conversations Page's choreography
36
+ * unchanged: the Controller makes the selection a thread, the conversation reader below reads it, and its
37
+ * Reply opens the Reply dialog with the internal note offered.
35
38
  *
36
39
  * The Page is for the holders of `accounting` (`PHI_ACCOUNTING_CUSTOMER_FILE_ACCESS`), who read every
37
40
  * field, the addresses included. A viewer the Area admits without it is told so in the Page and nothing is
@@ -77,8 +80,11 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
77
80
  }
78
81
  const controllerAddress = createPhiThreadsControllerAddress();
79
82
  const addressesAddress = createPhiSignalAddress("cms", widgetIds.widgetAddresses);
83
+ const fileAddress = createPhiSignalAddress("cms", widgetIds.widgetFile);
80
84
  const threadsAddress = createPhiSignalAddress("cms", widgetIds.widgetThreads);
81
85
  const conversationAddress = createPhiSignalAddress("cms", widgetIds.widgetConversation);
86
+ const noteOverlayAddress = createPhiSignalAddress("cms", overlayIds.overlayNote);
87
+ const noteFormAddress = createPhiSignalAddress("cms", widgetIds.widgetNoteForm);
82
88
  const replyOverlayAddress = createPhiSignalAddress("cms", overlayIds.overlayReply);
83
89
  const replyFormAddress = createPhiSignalAddress("cms", widgetIds.widgetReplyForm);
84
90
  const route = (routeKey, capabilityId, channel, action, receiver, valueType = "none", valueSchema) => ({
@@ -91,76 +97,135 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
91
97
  ...(valueSchema ? { valueSchema } : {}),
92
98
  receiver,
93
99
  });
94
- // The member chosen above, handed on as the query the two lists below read it from.
95
- const personQueryTo = (routeKey, receiver) => route(routeKey, "queryChange", "query", "change", receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableQuery);
96
100
  const queryInput = (routeKey, receiver) => route(routeKey, "queryChange", "query", "change", receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableQuery);
97
101
  const tableAction = (routeKey, capabilityId, receiver) => route(routeKey, capabilityId, "action", "activate", receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableAction);
98
102
  const threadRoute = (routeKey, capabilityId, action, receiver) => route(routeKey, capabilityId, "thread", action, receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.threadSelection);
99
103
  const prefix = "accounting-customer-file";
100
104
  // What each Table says where its rows would be when the reader chooses themselves (Core refuses that file).
101
105
  const ownFile = { [PHI_CUSTOMER_FILE_OWN_FILE_PARAM]: labels.ownFile };
102
- const replyDialog = nodes.dialog({
103
- id: overlayIds.overlayReply,
104
- bodyLayoutNodeId: layoutIds.layoutReply,
105
- sortOrder: 0,
106
- label: `${prefix}-reply-modal`,
107
- config: {
108
- title: labels.noteLabel,
109
- size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
110
- mountPolicy: "remount",
111
- closeMode: "immediate",
112
- openActionKey: "reply",
113
- signalRoutes: {
114
- listens: [
115
- tableAction(`${prefix}-reply-open`, "open", replyOverlayAddress),
116
- route(`${prefix}-reply-close`, "close", "dialog", "close", replyOverlayAddress),
117
- ],
106
+ /*
107
+ * Core's Reply Form in a dialog, once for a note in the file and once for a reply in the conversation:
108
+ * each opens on its own reader's Reply and reads its thread from the row that Reply named. Every message
109
+ * of a file is internal (Core), so the note offers no audience; the reply offers the internal note.
110
+ */
111
+ const writeDialog = (kind) => {
112
+ const note = kind === "note";
113
+ const overlayAddress = note ? noteOverlayAddress : replyOverlayAddress;
114
+ const formAddress = note ? noteFormAddress : replyFormAddress;
115
+ const title = note ? labels.note.title : labels.reply.title;
116
+ const dialog = nodes.dialog({
117
+ id: note ? overlayIds.overlayNote : overlayIds.overlayReply,
118
+ bodyLayoutNodeId: note ? layoutIds.layoutNote : layoutIds.layoutReply,
119
+ sortOrder: note ? 0 : 1,
120
+ label: `${prefix}-${kind}-modal`,
121
+ config: {
122
+ title,
123
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
124
+ mountPolicy: "remount",
125
+ closeMode: "immediate",
126
+ openActionKey: "reply",
127
+ signalRoutes: {
128
+ listens: [
129
+ tableAction(`${prefix}-${kind}-open`, "open", overlayAddress),
130
+ route(`${prefix}-${kind}-close`, "close", "dialog", "close", overlayAddress),
131
+ ],
132
+ },
118
133
  },
119
- },
120
- commands: {
121
- footerLayoutNodeId: layoutIds.layoutReplyFooter,
122
- widgetId: widgetIds.widgetReplyCommands,
123
- label: labels.noteLabel,
134
+ commands: {
135
+ footerLayoutNodeId: note ? layoutIds.layoutNoteFooter : layoutIds.layoutReplyFooter,
136
+ widgetId: note ? widgetIds.widgetNoteCommands : widgetIds.widgetReplyCommands,
137
+ label: title,
138
+ flags: PhiCmsFlags.NoTranslate,
139
+ config: {
140
+ key: `${prefix}-${kind}-commands`,
141
+ buttons: [
142
+ { key: "cancel", emits: [{ capabilityId: "close", value: null }], action: "cancel", icon: "close" },
143
+ {
144
+ key: "submit",
145
+ emits: [{ capabilityId: "submit", value: null }],
146
+ label: note ? labels.note.save : labels.reply.send,
147
+ variant: "primary",
148
+ icon: note ? "save" : "antd:send-outlined",
149
+ },
150
+ ],
151
+ signalRoutes: {
152
+ emits: [
153
+ route(`${prefix}-${kind}-cancel`, "close", "dialog", "close", overlayAddress),
154
+ route(`${prefix}-${kind}-commands-submit`, "submit", "submit", "activate", formAddress),
155
+ ],
156
+ },
157
+ },
158
+ },
159
+ });
160
+ const form = nodes.widget({
161
+ id: formAddress === noteFormAddress ? widgetIds.widgetNoteForm : widgetIds.widgetReplyForm,
162
+ parentLayoutNodeId: note ? layoutIds.layoutNote : layoutIds.layoutReply,
163
+ typeKey: "form",
164
+ slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
165
+ label: title,
124
166
  flags: PhiCmsFlags.NoTranslate,
125
167
  config: {
126
- key: `${prefix}-reply-commands`,
127
- buttons: [
128
- { key: "cancel", emits: [{ capabilityId: "close", value: null }], action: "cancel", icon: "close" },
129
- {
130
- key: "submit",
131
- emits: [{ capabilityId: "submit", value: null }],
132
- label: labels.replySendLabel,
133
- variant: "primary",
134
- icon: "antd:send-outlined",
135
- },
136
- ],
168
+ formId: PHI_SHARED_FORM_IDS.threadReply,
169
+ // A reply may be an internal note; in the file every message is one (Core), so there is nothing to choose.
170
+ ...(note ? {} : { formConfig: { initialValues: { internalAllowed: true } } }),
171
+ execution: { mode: "handler" },
172
+ source: { providerKey: PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS.table, resourceKey: "inbox" },
173
+ openActionKey: "reply",
174
+ feedback: { mode: "message" },
137
175
  signalRoutes: {
138
176
  emits: [
139
- route(`${prefix}-reply-cancel`, "close", "dialog", "close", replyOverlayAddress),
140
- route(`${prefix}-reply-commands-submit`, "submit", "submit", "activate", replyFormAddress),
177
+ route(`${prefix}-${kind}-success`, "submitSuccess", "submit", "activate", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.formResult),
178
+ route(`${prefix}-${kind}-success-close`, "submitSuccess", "dialog", "close", overlayAddress),
179
+ ],
180
+ listens: [
181
+ route(`${prefix}-${kind}-submit`, "submit", "submit", "activate", formAddress),
182
+ tableAction(`${prefix}-${kind}-record-open`, "recordOpen", formAddress),
141
183
  ],
142
184
  },
143
185
  },
144
- },
145
- });
146
- const addressColumns = [
147
- { key: "name", fieldKey: "name", title: labels.addresses.columns.name, sizing: { mode: "content" } },
148
- { key: "lines", fieldKey: "lines", title: labels.addresses.columns.address, sizing: { mode: "fill" } },
149
- {
150
- key: "purposes",
151
- fieldKey: "purposes",
152
- title: labels.addresses.columns.purposes,
153
- renderer: "tags",
154
- sizing: { mode: "content" },
155
- valueMap: labels.addresses.purposes,
156
- tagColorMap: { billing: "default", shipping: "default", defaultBilling: "processing", defaultShipping: "processing" },
157
- },
158
- ];
186
+ });
187
+ return { dialog, form };
188
+ };
189
+ const noteDialog = writeDialog("note");
190
+ const replyDialog = writeDialog("reply");
191
+ /*
192
+ * A conversation reader: the file's, which the Controller hands the member's file, and the listing's,
193
+ * which it hands the chosen conversation. Each Reply opens its own dialog and reads its own Form, and
194
+ * reaches the Controller too, which then knows where the message landed.
195
+ */
196
+ const reader = (kind) => {
197
+ const file = kind === "file";
198
+ const address = file ? fileAddress : conversationAddress;
199
+ const overlayAddress = file ? noteOverlayAddress : replyOverlayAddress;
200
+ const formAddress = file ? noteFormAddress : replyFormAddress;
201
+ return {
202
+ reply: true,
203
+ ...(file ? { title: labels.file.title, replyLabel: labels.file.add, emptyDescription: labels.file.empty } : { emptyDescription: labels.conversation.empty }),
204
+ signalRoutes: {
205
+ emits: [
206
+ ...(file ? [] : [
207
+ // A conversation opened from `?thread=` reaches the Controller, which knows it is open.
208
+ route(`${prefix}-conversation-opened`, "opened", "opened", "change", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.threadSelection),
209
+ ]),
210
+ tableAction(`${prefix}-${kind}-reply`, "reply", overlayAddress),
211
+ tableAction(`${prefix}-${kind}-reply-record`, "reply", formAddress),
212
+ tableAction(`${prefix}-${kind}-reply-controller`, "reply", controllerAddress),
213
+ ],
214
+ listens: [
215
+ threadRoute(`${prefix}-${kind}-select`, "select", "change", address),
216
+ threadRoute(`${prefix}-${kind}-reload`, "reload", "reload", address),
217
+ ],
218
+ },
219
+ };
220
+ };
159
221
  return {
160
222
  page: nodes.page({ pageType: PhiCmsPageType.Standard }),
161
223
  pageMeta,
162
- // The Conversations Controller, configured as on the conversations Page: the thread to the reader, and
163
- // the list read again after a note landed.
224
+ /*
225
+ * The Conversations Controller, configured as on the conversations Page -- the chosen conversation to
226
+ * its reader, the listing read again after a reply -- and with this Page's part: the member's file to
227
+ * the file panel when the person Table chooses one, read again after a note.
228
+ */
164
229
  controllerSettings: [{
165
230
  type: PHI_THREADS_CONTROLLER_TYPE,
166
231
  instanceKey: PHI_THREADS_CONTROLLER_INSTANCE_KEY,
@@ -170,14 +235,18 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
170
235
  emits: [
171
236
  threadRoute(`${prefix}-controller-thread`, "threadChange", "change", conversationAddress),
172
237
  threadRoute(`${prefix}-controller-thread-reload`, "threadReload", "reload", conversationAddress),
238
+ threadRoute(`${prefix}-controller-file`, "fileThreadChange", "change", fileAddress),
239
+ threadRoute(`${prefix}-controller-file-reload`, "fileThreadReload", "reload", fileAddress),
173
240
  route(`${prefix}-controller-reload-threads`, "reload", "reload", "activate", threadsAddress),
241
+ // The member chosen, as the addresses tiles' binding params.
242
+ route(`${prefix}-controller-addresses`, "memberParamsChange", "bindingParams", "change", addressesAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableBindingParams),
174
243
  ],
175
244
  },
176
245
  },
177
246
  }],
178
- overlays: [replyDialog.overlay],
247
+ overlays: [noteDialog.dialog.overlay, replyDialog.dialog.overlay],
179
248
  regions: [scaffold.region],
180
- layoutNodes: [scaffold.layoutNode, ...replyDialog.layouts],
249
+ layoutNodes: [scaffold.layoutNode, ...noteDialog.dialog.layouts, ...replyDialog.dialog.layouts],
181
250
  contentWidgets: [
182
251
  nodes.widget({
183
252
  id: widgetIds.widgetPerson,
@@ -195,17 +264,26 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
195
264
  controlSize: "small",
196
265
  layout: { mode: "auto", overflowX: "auto" },
197
266
  columns: [
198
- { key: "displayName", fieldKey: "displayName", title: labels.person.columns.displayName, sizing: { mode: "content" } },
199
- { key: "fullName", fieldKey: "fullName", title: labels.person.columns.name, sizing: { mode: "content" } },
200
- { key: "companyName", fieldKey: "companyName", title: labels.person.columns.company, sizing: { mode: "content" } },
201
- { key: "email", fieldKey: "email", title: labels.person.columns.email, renderer: "email", sizing: { mode: "fill" } },
202
- { key: "phone", fieldKey: "phone", title: labels.person.columns.phone, sizing: { mode: "content" } },
203
- { key: "mobile", fieldKey: "mobile", title: labels.person.columns.mobile, sizing: { mode: "content" } },
267
+ { key: "displayName", fieldKey: "displayName", title: labels.person.columns.displayName, sizing: { mode: "content", minWidth: 120 } },
268
+ { key: "fullName", fieldKey: "fullName", title: labels.person.columns.name, sizing: { mode: "content", minWidth: 120 } },
269
+ { key: "companyName", fieldKey: "companyName", title: labels.person.columns.company, sizing: { mode: "content", minWidth: 120 } },
270
+ { key: "email", fieldKey: "email", title: labels.person.columns.email, renderer: "email", sizing: { mode: "fill", minWidth: 200 } },
271
+ { key: "phone", fieldKey: "phone", title: labels.person.columns.phone, sizing: { mode: "content", minWidth: 120 } },
272
+ { key: "mobile", fieldKey: "mobile", title: labels.person.columns.mobile, sizing: { mode: "content", minWidth: 120 } },
204
273
  ],
205
274
  emptyState: { title: labels.person.empty },
275
+ footer: {
276
+ template: labels.person.footer,
277
+ values: [{ key: "member", value: { source: "provider", fieldKey: "userId" } }],
278
+ // Nobody chosen: nothing to say under the picker.
279
+ variants: [{ when: { value: { source: "provider", fieldKey: "userId" }, operator: "falsy" }, template: "" }],
280
+ align: "start",
281
+ },
282
+ // One row, the member chosen.
283
+ loadingRows: 1,
206
284
  },
207
285
  features: {
208
- // The two lists below take this query, so it pages as they do.
286
+ // The other readers take this query, so it pages as they do.
209
287
  pagination: { enabled: false, pageSize: 25 },
210
288
  sorting: { mode: "none" },
211
289
  search: { enabled: false },
@@ -223,55 +301,76 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
223
301
  }],
224
302
  },
225
303
  signalRoutes: {
304
+ // The member chosen, handed on as the query the conversations read it from, and to the
305
+ // Controller, which opens their file and hands the member to the addresses.
226
306
  emits: [
227
- personQueryTo(`${prefix}-person-to-addresses`, addressesAddress),
228
- personQueryTo(`${prefix}-person-to-threads`, threadsAddress),
307
+ route(`${prefix}-person-to-threads`, "queryChange", "query", "change", threadsAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableQuery),
308
+ route(`${prefix}-person-to-file`, "queryChange", "member", "change", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableQuery),
229
309
  ],
230
310
  },
231
311
  },
232
312
  }),
313
+ /*
314
+ * The member's addresses as Core's address tiles, read-only: the resource declares no action. The
315
+ * member arrives from the Controller as the binding param `userId`, and the read is the one the
316
+ * Tables and the Controller make for the choice, joined.
317
+ */
233
318
  nodes.widget({
234
319
  id: widgetIds.widgetAddresses,
235
320
  parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
236
- typeKey: "table",
321
+ typeKey: "collection-view",
237
322
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 1,
238
323
  sortOrder: 1,
239
324
  // The Module's Label Set, translated already.
240
325
  flags: PhiCmsFlags.NoTranslate,
241
326
  label: labels.addresses.label,
242
327
  config: {
243
- source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table, resourceKey: RESOURCES.addresses, params: ownFile },
328
+ source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.addresses, resourceKey: RESOURCES.addresses, params: ownFile },
244
329
  presentation: {
245
330
  title: labels.addresses.title,
331
+ mode: "grid",
246
332
  controlSize: "small",
247
- layout: { mode: "auto", overflowX: "auto" },
248
- columns: addressColumns,
249
- emptyState: { title: labels.addresses.empty },
333
+ emptyDescription: labels.addresses.empty,
334
+ labels: { purposes: labels.addresses.purposes },
250
335
  },
251
336
  features: {
252
- pagination: { enabled: false },
253
- sorting: { mode: "none" },
254
- search: { enabled: false },
255
337
  tools: { mode: "self-contained", reset: false, reload: false },
338
+ pagination: { enabled: false },
339
+ },
340
+ signalRoutes: {
341
+ listens: [
342
+ route(`${prefix}-addresses-member`, "bindingParamsChange", "bindingParams", "change", addressesAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableBindingParams),
343
+ ],
256
344
  },
257
- signalRoutes: { listens: [queryInput(`${prefix}-addresses-query`, addressesAddress)] },
258
345
  },
259
346
  }),
347
+ // The member's file: its entries, internal notes and what Add-ons wrote with their links, and "Add note".
260
348
  nodes.widget({
261
- id: widgetIds.widgetThreads,
349
+ id: widgetIds.widgetFile,
262
350
  parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
263
- typeKey: "table",
351
+ typeKey: "thread-conversation",
264
352
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 2,
265
353
  sortOrder: 2,
266
354
  // The Module's Label Set, translated already.
267
355
  flags: PhiCmsFlags.NoTranslate,
356
+ label: labels.file.label,
357
+ config: reader("file"),
358
+ }),
359
+ nodes.widget({
360
+ id: widgetIds.widgetThreads,
361
+ parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
362
+ typeKey: "table",
363
+ slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 3,
364
+ sortOrder: 3,
365
+ // The Module's Label Set, translated already.
366
+ flags: PhiCmsFlags.NoTranslate,
268
367
  label: labels.threads.label,
269
368
  config: {
270
- // The file's own subject, which Core does not answer: in the reader's language, from this Page.
271
- source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table, resourceKey: RESOURCES.threads, params: { ...ownFile, [PHI_CUSTOMER_FILE_SUBJECT_PARAM]: labels.fileSubject } },
369
+ source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table, resourceKey: RESOURCES.threads, params: ownFile },
272
370
  presentation: {
273
371
  title: labels.threads.title,
274
372
  controlSize: "small",
373
+ // Fixed, as on the conversations Page: the subject is the one column worth cutting short.
275
374
  layout: { mode: "fixed", overflowX: "auto" },
276
375
  columns: [
277
376
  { key: "subject", fieldKey: "subject", title: labels.threads.columns.subject, ellipsis: true, sizing: { mode: "fill", minWidth: 200 } },
@@ -285,7 +384,6 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
285
384
  [String(PhisThreadKind.Group)]: labels.threads.kinds.group,
286
385
  [String(PhisThreadKind.CrossGroup)]: labels.threads.kinds.crossGroup,
287
386
  [String(PhisThreadKind.Support)]: labels.threads.kinds.support,
288
- [String(PhisThreadKind.File)]: labels.threads.kinds.file,
289
387
  },
290
388
  },
291
389
  {
@@ -299,9 +397,20 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
299
397
  },
300
398
  { key: "latestMessageAt", fieldKey: "latestMessageAt", title: labels.threads.columns.activity, renderer: "datetime", sizing: { mode: "fixed", width: 180 } },
301
399
  ],
302
- emptyState: { title: labels.threads.empty },
400
+ emptyState: { title: labels.threads.empty, description: labels.threads.emptyHint },
401
+ footer: {
402
+ template: labels.threads.footer,
403
+ values: [
404
+ { key: "threads", value: { source: "core", fieldKey: "pageRows" } },
405
+ { key: "page", value: { source: "core", fieldKey: "page" } },
406
+ ],
407
+ // Nothing on the page: the empty state says it.
408
+ variants: [{ when: { value: { source: "core", fieldKey: "pageRows" }, operator: "falsy" }, template: "" }],
409
+ align: "start",
410
+ },
303
411
  },
304
412
  features: {
413
+ // Choosing one opens it below, as on the conversations Page.
305
414
  rowSelection: { mode: "single", preserveSelectedRowIdentities: true },
306
415
  pagination: { enabled: true, pageSize: 25 },
307
416
  sorting: { mode: "none" },
@@ -325,57 +434,17 @@ export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runt
325
434
  id: widgetIds.widgetConversation,
326
435
  parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
327
436
  typeKey: "thread-conversation",
328
- slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 3,
329
- sortOrder: 3,
330
- label: labels.title,
331
- config: {
332
- reply: true,
333
- signalRoutes: {
334
- emits: [
335
- // A conversation opened from `?thread=` reaches the Controller, which knows it is open.
336
- route(`${prefix}-conversation-opened`, "opened", "opened", "change", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.threadSelection),
337
- // Reply: one announcement, two listeners -- the dialog opens on it, the Form reads its row.
338
- tableAction(`${prefix}-conversation-reply`, "reply", replyOverlayAddress),
339
- tableAction(`${prefix}-conversation-reply-record`, "reply", replyFormAddress),
340
- ],
341
- listens: [
342
- threadRoute(`${prefix}-conversation-select`, "select", "change", conversationAddress),
343
- threadRoute(`${prefix}-conversation-reload`, "reload", "reload", conversationAddress),
344
- ],
345
- },
346
- },
347
- }),
348
- /*
349
- * Core's Reply Form, reading its thread from the row the conversation's Reply named, as on the
350
- * conversations Page. Staff may mark a note internal; in the file every message is internal anyway.
351
- */
352
- nodes.widget({
353
- id: widgetIds.widgetReplyForm,
354
- parentLayoutNodeId: layoutIds.layoutReply,
355
- typeKey: "form",
356
- slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
357
- label: labels.noteLabel,
437
+ slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 4,
438
+ sortOrder: 4,
439
+ // The Module's Label Set, translated already.
358
440
  flags: PhiCmsFlags.NoTranslate,
359
- config: {
360
- formId: PHI_SHARED_FORM_IDS.threadReply,
361
- formConfig: { initialValues: { internalAllowed: true } },
362
- execution: { mode: "handler" },
363
- source: { providerKey: PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS.table, resourceKey: "inbox" },
364
- openActionKey: "reply",
365
- feedback: { mode: "message" },
366
- signalRoutes: {
367
- emits: [
368
- route(`${prefix}-reply-success`, "submitSuccess", "submit", "activate", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.formResult),
369
- route(`${prefix}-reply-success-close`, "submitSuccess", "dialog", "close", replyOverlayAddress),
370
- ],
371
- listens: [
372
- route(`${prefix}-reply-submit`, "submit", "submit", "activate", replyFormAddress),
373
- tableAction(`${prefix}-reply-record-open`, "recordOpen", replyFormAddress),
374
- ],
375
- },
376
- },
441
+ label: labels.conversation.label,
442
+ config: reader("conversation"),
377
443
  }),
378
- ...replyDialog.widgets,
444
+ noteDialog.form,
445
+ replyDialog.form,
446
+ ...noteDialog.dialog.widgets,
447
+ ...replyDialog.dialog.widgets,
379
448
  ],
380
449
  };
381
450
  }
@@ -4,6 +4,6 @@ export const PHI_APP_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
4
4
  {
5
5
  key: PHI_APP_ADDRESSES_DATA_PROVIDER_KEY,
6
6
  ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
7
- loadLive: async () => (await import("./services/addresses-table")).PhiAppAddressesTableProviderClient,
7
+ loadLive: async () => (await import("./services/addresses-collection")).PhiAppAddressesCollectionProviderClient,
8
8
  },
9
9
  ];
@@ -1,16 +1,19 @@
1
1
  /**
2
2
  * The account's own address book on this Site (`users:v1`, phis-server SERVER_ADDONS.md): the current
3
- * addresses only, never a `Superseded` or `Removed` one.
3
+ * addresses only, never a `Superseded` or `Removed` one, as Core's address tiles draw them
4
+ * (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`, COLLECTIONS.md "The address renderer").
4
5
  *
5
6
  * `live` and `authoringMode: "none"`: they are the signed-in person's, and nobody composing a Page has any
6
7
  * business reading them. An address never changes in Core -- a change is a new version that replaces it --
7
- * so the row's id moves with every edit, which is why every write reads the view again. Adding and editing
8
- * are the Module's two Forms; the Table runs removal and the two defaults itself.
8
+ * so the item's id moves with every edit, which is why every write answers the list read again. Adding and
9
+ * changing are the Module's two Forms, opened by the toolbar's `create` and a tile's `edit` (the change
10
+ * Form reads the address through `readRecord`); removing and the two defaults are the Provider's actions.
11
+ * A chosen address is `{ addressId }` (`selectionValueSchema`), prepared for the Shop's checkout.
9
12
  */
10
13
  export declare const PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
11
14
  key: `${string}/${string}`;
12
15
  ownerModuleId: "@phis/ui/modules/app";
13
- kind: "table";
16
+ kind: "collection";
14
17
  executionMode: "live";
15
18
  authoringMode: "none";
16
19
  title: string;
@@ -18,81 +21,23 @@ export declare const PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
18
21
  resources: {
19
22
  resourceKey: string;
20
23
  title: string;
21
- rowIdentityPath: string;
24
+ itemIdentityPath: string;
25
+ itemRendererKey: `${string}/${string}`;
26
+ selectionValueSchema: `${string}/signals/${string}`;
22
27
  recordRead: true;
23
- fields: ({
24
- key: string;
25
- title: string;
26
- type: "number";
27
- required: true;
28
- options?: undefined;
29
- } | {
30
- key: string;
31
- title: string;
32
- type: "string";
33
- required?: undefined;
34
- options?: undefined;
35
- } | {
36
- key: string;
37
- title: string;
38
- type: "enum[]";
39
- options: {
40
- value: "billing" | "shipping" | "defaultBilling" | "defaultShipping";
41
- label: "billing" | "shipping" | "defaultBilling" | "defaultShipping";
42
- }[];
43
- required?: undefined;
44
- } | {
45
- key: string;
46
- title: string;
47
- type: "boolean";
48
- required?: undefined;
49
- options?: undefined;
50
- } | {
51
- key: string;
52
- title: string;
53
- type: "datetime";
54
- required?: undefined;
55
- options?: undefined;
56
- } | {
57
- key: string;
58
- title: string;
59
- type: "json";
60
- required?: undefined;
61
- options?: undefined;
62
- } | {
63
- key: string;
64
- title: string;
65
- type: "number";
66
- required?: undefined;
67
- options?: undefined;
68
- })[];
28
+ defaultForWidget: true;
69
29
  query: {
70
30
  search: false;
71
- filterFields: never[];
72
- sorting: "none";
73
- pagination: "none";
31
+ pagination: false;
74
32
  };
75
33
  actions: ({
76
34
  key: string;
77
35
  title: string;
78
- scope: "row";
79
- intent: "write";
80
- disabledWhen: {
81
- match: "any";
82
- conditions: {
83
- source: "row";
84
- valuePath: string;
85
- operator: "truthy";
86
- }[];
87
- };
88
- confirmation?: undefined;
36
+ scope: "resource";
89
37
  } | {
90
38
  key: string;
91
39
  title: string;
92
- scope: "row";
93
- intent: "destructive";
94
- confirmation: "required";
95
- disabledWhen?: undefined;
40
+ scope: "item";
96
41
  })[];
97
42
  }[];
98
43
  }[];