@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
@@ -0,0 +1,48 @@
1
+ import type { PhiCollectionProviderResourceDescriptor } from "../../../../../types/collection-provider";
2
+ /**
3
+ * What an address tile reads of an item and offers on it (COLLECTIONS.md, "The address renderer"), apart
4
+ * from drawing it. Pure and React-free, so the rules are tested as rules.
5
+ */
6
+ /** The four marks a tile shows as tags, in this order: what the address is for, then what it is the default for. */
7
+ export declare const PHI_SITE_ADDRESS_PURPOSES: readonly ["billing", "shipping", "defaultBilling", "defaultShipping"];
8
+ export type PhiSiteAddressPurpose = (typeof PHI_SITE_ADDRESS_PURPOSES)[number];
9
+ /**
10
+ * The item actions the renderer has a control for, in the order a tile draws them. `edit` is announced
11
+ * on the Widget's `actionActivate` (`{ actionKey: "edit", itemKey }`) for the dialog that changes the
12
+ * address; the other three are the Provider's own actions, run through the Binding (`itemKey` the
13
+ * address id), whose answer is the collection as it now stands. `delete` asks first.
14
+ */
15
+ export declare const PHI_SITE_ADDRESS_ITEM_ACTIONS: readonly ["edit", "makeDefaultBilling", "makeDefaultShipping", "delete"];
16
+ export type PhiSiteAddressItemAction = (typeof PHI_SITE_ADDRESS_ITEM_ACTIONS)[number];
17
+ export type PhiSiteAddressTile = {
18
+ id: number;
19
+ /** The company where there is one, else the name: what the address is made out to. */
20
+ title: string;
21
+ /** The name under a company, then the parts after it, one per line; empty parts left out. */
22
+ lines: string[];
23
+ purposes: PhiSiteAddressPurpose[];
24
+ defaultBilling: boolean;
25
+ defaultShipping: boolean;
26
+ };
27
+ /**
28
+ * One item as a tile, from the shape `toPhiSiteAddressRow` answers (`helpers/site-address-row.ts`), or
29
+ * null for one that is no address (no positive whole id): an item the renderer cannot name is not drawn
30
+ * as a tile it could act on. `countryName` names a country code in the reader's language.
31
+ */
32
+ export declare function readPhiSiteAddressTile(item: Readonly<Record<string, unknown>>, countryName: (code: string) => string): PhiSiteAddressTile | null;
33
+ /**
34
+ * The item actions a tile offers: those the resource declares at item scope, in the renderer's order,
35
+ * and of the two defaults only the one the address does not already hold. A resource that declares none
36
+ * -- the customer file's -- is read-only, and its tiles offer nothing.
37
+ */
38
+ export declare function resolvePhiSiteAddressTileActions(resource: Pick<PhiCollectionProviderResourceDescriptor, "actions"> | null | undefined, tile: Pick<PhiSiteAddressTile, "defaultBilling" | "defaultShipping">): PhiSiteAddressItemAction[];
39
+ /**
40
+ * Why the placement asks for a tool the resource does not offer, or null: a toolbar action the resource
41
+ * does not declare at resource scope, or a selection the resource announces under no schema. Said as the
42
+ * Widget's failure rather than drawn as a control that does nothing.
43
+ */
44
+ export declare function readPhiSiteAddressToolFailure({ toolbarKeys, selection, resource, }: {
45
+ toolbarKeys: readonly string[];
46
+ selection: boolean;
47
+ resource: Pick<PhiCollectionProviderResourceDescriptor, "actions" | "resourceKey" | "selectionValueSchema"> | null | undefined;
48
+ }): string | null;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * What an address tile reads of an item and offers on it (COLLECTIONS.md, "The address renderer"), apart
3
+ * from drawing it. Pure and React-free, so the rules are tested as rules.
4
+ */
5
+ /** The four marks a tile shows as tags, in this order: what the address is for, then what it is the default for. */
6
+ export const PHI_SITE_ADDRESS_PURPOSES = ["billing", "shipping", "defaultBilling", "defaultShipping"];
7
+ /**
8
+ * The item actions the renderer has a control for, in the order a tile draws them. `edit` is announced
9
+ * on the Widget's `actionActivate` (`{ actionKey: "edit", itemKey }`) for the dialog that changes the
10
+ * address; the other three are the Provider's own actions, run through the Binding (`itemKey` the
11
+ * address id), whose answer is the collection as it now stands. `delete` asks first.
12
+ */
13
+ export const PHI_SITE_ADDRESS_ITEM_ACTIONS = ["edit", "makeDefaultBilling", "makeDefaultShipping", "delete"];
14
+ function text(value) {
15
+ return typeof value === "string" ? value.trim() : "";
16
+ }
17
+ /**
18
+ * One item as a tile, from the shape `toPhiSiteAddressRow` answers (`helpers/site-address-row.ts`), or
19
+ * null for one that is no address (no positive whole id): an item the renderer cannot name is not drawn
20
+ * as a tile it could act on. `countryName` names a country code in the reader's language.
21
+ */
22
+ export function readPhiSiteAddressTile(item, countryName) {
23
+ const id = item.id;
24
+ if (typeof id !== "number" || !Number.isSafeInteger(id) || id <= 0)
25
+ return null;
26
+ const company = text(item.companyName);
27
+ const name = text(item.name);
28
+ const place = [text(item.postalCode), text(item.city)].filter(Boolean).join(" ");
29
+ const country = text(item.country);
30
+ const marks = Array.isArray(item.purposes) ? item.purposes : [];
31
+ return {
32
+ id,
33
+ title: company || name,
34
+ lines: [company ? name : "", text(item.line1), text(item.line2), place, text(item.region), country ? countryName(country) : ""]
35
+ .filter(Boolean),
36
+ purposes: PHI_SITE_ADDRESS_PURPOSES.filter((purpose) => marks.includes(purpose)),
37
+ defaultBilling: item.defaultBilling === true,
38
+ defaultShipping: item.defaultShipping === true,
39
+ };
40
+ }
41
+ /**
42
+ * The item actions a tile offers: those the resource declares at item scope, in the renderer's order,
43
+ * and of the two defaults only the one the address does not already hold. A resource that declares none
44
+ * -- the customer file's -- is read-only, and its tiles offer nothing.
45
+ */
46
+ export function resolvePhiSiteAddressTileActions(resource, tile) {
47
+ const declared = new Set((resource?.actions ?? []).filter((action) => action.scope === "item").map((action) => action.key));
48
+ return PHI_SITE_ADDRESS_ITEM_ACTIONS.filter((key) => declared.has(key) &&
49
+ !(key === "makeDefaultBilling" && tile.defaultBilling) &&
50
+ !(key === "makeDefaultShipping" && tile.defaultShipping));
51
+ }
52
+ /**
53
+ * Why the placement asks for a tool the resource does not offer, or null: a toolbar action the resource
54
+ * does not declare at resource scope, or a selection the resource announces under no schema. Said as the
55
+ * Widget's failure rather than drawn as a control that does nothing.
56
+ */
57
+ export function readPhiSiteAddressToolFailure({ toolbarKeys, selection, resource, }) {
58
+ const declared = new Set((resource?.actions ?? []).filter((action) => action.scope === "resource").map((action) => action.key));
59
+ const missing = toolbarKeys.find((key) => !declared.has(key));
60
+ if (missing) {
61
+ return `The address tiles name the toolbar action "${missing}", which resource "${resource?.resourceKey ?? "unknown"}" does not declare.`;
62
+ }
63
+ if (selection && !resource?.selectionValueSchema) {
64
+ return `The address tiles offer a choice, and resource "${resource?.resourceKey ?? "unknown"}" announces no selection schema.`;
65
+ }
66
+ return null;
67
+ }
@@ -116,7 +116,7 @@ export declare const PHI_COMMAND_TOOLBAR_WIDGET_DEFINITION: {
116
116
  heading?: string;
117
117
  } & {
118
118
  type: "data-provider";
119
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
119
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
120
120
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
121
121
  }) | ({
122
122
  key: string;
@@ -72,7 +72,7 @@ export declare const PHI_DESCRIPTION_WIDGET_DEFINITION: {
72
72
  heading?: string;
73
73
  } & {
74
74
  type: "data-provider";
75
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
75
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
76
76
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
77
77
  }) | ({
78
78
  key: string;
@@ -115,7 +115,7 @@ export declare const PHI_ENTRY_LIST_WIDGET_DEFINITION: {
115
115
  heading?: string;
116
116
  } & {
117
117
  type: "data-provider";
118
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
118
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
119
119
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
120
120
  }) | ({
121
121
  key: string;
@@ -129,7 +129,7 @@ export declare const PHI_FLOAT_BUTTON_WIDGET_DEFINITION: {
129
129
  heading?: string;
130
130
  } & {
131
131
  type: "data-provider";
132
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
132
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
133
133
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
134
134
  }) | ({
135
135
  key: string;
@@ -170,7 +170,7 @@ export declare const PHI_FORM_WIDGET_DEFINITION: {
170
170
  } | {
171
171
  key: string;
172
172
  type: "data-provider";
173
- providerKind: "table";
173
+ providerKind: ("table" | "collection")[];
174
174
  label: string;
175
175
  required?: undefined;
176
176
  optionsProvider?: undefined;
@@ -97,6 +97,18 @@ export const PHI_FORM_WIDGET_DEFINITION = {
97
97
  valueType: "json",
98
98
  valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
99
99
  },
100
+ /*
101
+ * The same open from a Collection View's item action (`{ actionKey, itemKey }`), the item's key the
102
+ * record's: one capability, two announcers, told apart by the schema the route carries (SIGNALS.md,
103
+ * inputs are unique by channel, action, value type and schema).
104
+ */
105
+ {
106
+ id: "recordOpen",
107
+ channel: "action",
108
+ action: "activate",
109
+ valueType: "json",
110
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.collectionAction,
111
+ },
100
112
  { id: "close", channel: "dialog", action: "close", valueType: "none" },
101
113
  { id: "reload", channel: "reload", action: "activate", valueType: "none" },
102
114
  /*
@@ -164,7 +176,8 @@ export const PHI_FORM_WIDGET_DEFINITION = {
164
176
  {
165
177
  key: "source",
166
178
  type: "data-provider",
167
- providerKind: "table",
179
+ // A Table's rows or a Collection's items, whichever resource declares `recordRead`.
180
+ providerKind: ["table", "collection"],
168
181
  label: "Record source",
169
182
  },
170
183
  { key: "openActionKey", type: "string", label: "Open action key" },
@@ -86,7 +86,7 @@ export declare const PHI_GALLERY_WIDGET_DEFINITION: {
86
86
  heading?: string;
87
87
  } & {
88
88
  type: "data-provider";
89
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
89
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
90
90
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
91
91
  }) | ({
92
92
  key: string;
@@ -137,7 +137,7 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
137
137
  heading?: string;
138
138
  } & {
139
139
  type: "data-provider";
140
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
140
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
141
141
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
142
142
  }) | ({
143
143
  key: string;
@@ -18,7 +18,6 @@ import { PHI_RECORD_WIDGET_DEFAULT_LABELS, formatPhiRecordWidgetLabel, } from ".
18
18
  import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
19
19
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
20
20
  import { fillPhiRecordTitle } from "../../../../../helpers/record-title";
21
- import { validatePhiRecordWidgetBinding } from "../../../../../helpers/record-widget";
22
21
  import { readPhiTableActionSignalValue } from "../../../../../types/table-signal-values";
23
22
  import { usePhiRecordWidgetActions } from "./actions";
24
23
  export function PhiRecordWidgetClient({ config, labels = PHI_RECORD_WIDGET_DEFAULT_LABELS, renderMode, }) {
@@ -43,8 +42,6 @@ export function PhiRecordWidgetClient({ config, labels = PHI_RECORD_WIDGET_DEFAU
43
42
  const emitCapability = useCallback((capabilityId, value, correlationId) => emitPhiSignalCapability(emitSignal, emitRoutes, capabilityId, value, correlationId), [emitRoutes, emitSignal]);
44
43
  const { showMessage } = usePhiApplicationFeedback();
45
44
  const { provider, resource, bindingError } = usePhiTableProvider(config.source);
46
- // The actions measured against the resource, said where the record would stand (Table: contractError).
47
- const contractError = useMemo(() => resource ? validatePhiRecordWidgetBinding(config, resource)[0] ?? null : null, [config, resource]);
48
45
  // Sent with the read and part of what makes one new: an open record is read again after a switch.
49
46
  const locale = usePhiIntlLocale();
50
47
  const timeZone = usePhiIntlTimeZone();
@@ -190,9 +187,8 @@ export function PhiRecordWidgetClient({ config, labels = PHI_RECORD_WIDGET_DEFAU
190
187
  * Every error here is the source's -- no binding, a resource that reads no single records, a read that
191
188
  * failed -- and none of them is the reader's to fix, so it goes the way of every such failure.
192
189
  */
193
- const failure = contractError ?? error;
194
- if (failure) {
195
- return _jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Record, title: failure });
190
+ if (error) {
191
+ return _jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Record, title: error });
196
192
  }
197
193
  if (!record) {
198
194
  return _jsx(PhiEmptyControl, { description: labels.empty });
@@ -80,7 +80,7 @@ export declare const PHI_RESULT_WIDGET_DEFINITION: {
80
80
  heading?: string;
81
81
  } & {
82
82
  type: "data-provider";
83
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
83
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
84
84
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
85
85
  }) | ({
86
86
  key: string;
@@ -96,7 +96,7 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
96
96
  heading?: string;
97
97
  } & {
98
98
  type: "data-provider";
99
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
99
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
100
100
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
101
101
  }) | ({
102
102
  key: string;
@@ -34,13 +34,14 @@ import { emitPhiSignalCapability, usePhiSignalEmitter, usePhiSignalIdentity } fr
34
34
  import { usePhiVisualAnchorParts } from "../../../../../components/runtime/runtime-visual-anchors";
35
35
  import { usePhiApplicationFeedback } from "../../../../../components/runtime/use-phi-application-feedback";
36
36
  import { usePhiTableBinding } from "../../../../../components/tables/client/phi-table-binding";
37
+ import { usePhiTableBindingParams } from "../../../../../components/tables/client/phi-table-binding-params";
37
38
  import { PhiTableBindingControl } from "../../../../../components/tables/client/phi-table-binding-control";
38
39
  import { usePhiTableFilterOptions } from "../../../../../components/tables/client/phi-table-filter-options";
39
40
  import { isTableQueryNarrowedByReader } from "./reader-query";
40
41
  import { clearPhiDataDragPayload, readPhiDataDragPayload } from "../../../../../components/runtime/client/phi-data-dnd";
41
42
  import { renderPhiValueContent, renderPhiValueWithLead, } from "../../../../../components/widgets/client/shared/phi-rendered-value";
42
43
  import { formatPhiTranslation } from "../../../../../helpers/translation-format";
43
- import { readPhiTableFilters, readPhiTableQuery, readPhiTableRowOptions, validatePhiTableWidgetBinding, } from "../../../../../types/table-widget";
44
+ import { readPhiTableFilters, readPhiTableQuery, readPhiTableRowOptions, } from "../../../../../types/table-widget";
44
45
  import { readPhiTableColumnOrderSignalValue, readPhiTableBindingParamsSignalValue, readPhiTableExpansionSignalValue, readPhiTableActionSignalValue, isPhiTableQueryValue, } from "../../../../../types/table-signal-values";
45
46
  import { collectPhiRuntimeValueConditions, combinePhiRuntimeConditionExpressions, evaluatePhiRuntimeConditionExpression, readPhiRuntimeConditionStateSignalValue, } from "../../../../../types/runtime-condition";
46
47
  import { isPhiControllerSignalAddress, } from "../../../../../types/signals";
@@ -227,17 +228,13 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
227
228
  const config = useMemo(() => JSON.parse(configKey), [configKey]);
228
229
  const { presentation, features, source } = config;
229
230
  /*
230
- * What the reader set, tagged with the configuration it was set against. A Builder edit of the
231
- * configured params or columns is a new starting point; the reader's earlier choice belonged to the old
232
- * one and would otherwise outlive it -- an order missing the new column, which every reorder then
233
- * refused.
231
+ * What the reader set, tagged with the configuration it was set against (`usePhiTableBindingParams`).
232
+ * A Builder edit of the configured params or columns is a new starting point; the reader's earlier
233
+ * choice belonged to the old one and would otherwise outlive it -- an order missing the new column,
234
+ * which every reorder then refused.
234
235
  */
235
236
  const configuredBindingParams = useMemo(() => isPhiRecord(source?.params) ? source.params : {}, [source]);
236
- const bindingParamsSeed = JSON.stringify(configuredBindingParams);
237
- const [chosenBindingParams, setChosenBindingParams] = useState(null);
238
- const bindingParams = chosenBindingParams?.seed === bindingParamsSeed
239
- ? chosenBindingParams.params
240
- : configuredBindingParams;
237
+ const { bindingParams, changeBindingParams } = usePhiTableBindingParams(configuredBindingParams);
241
238
  const resolvedSource = useMemo(() => source ? { ...source, params: bindingParams } : null, [bindingParams, source]);
242
239
  const resolvedControlSize = presentation.controlSize ??
243
240
  (features.tools?.mode !== "external" ? "small" : undefined);
@@ -274,22 +271,6 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
274
271
  * signal it received, absent when the operator drove it from the Table itself, which begins one.
275
272
  */
276
273
  const emitCapability = useCallback((capabilityId, value, correlationId) => emitPhiSignalCapability(emitSignal, emitRoutes, capabilityId, value, correlationId), [emitRoutes, emitSignal]);
277
- const validateResource = useCallback((candidate) => {
278
- const contractError = validatePhiTableWidgetBinding(config, candidate)[0];
279
- if (contractError)
280
- return contractError;
281
- const iconAction = [
282
- ...(config.features.actions?.toolbar ?? []),
283
- ...(config.features.actions?.row ?? []),
284
- ...(config.features.actions?.bulk ?? []),
285
- ].find((action) => action.display !== "label" && action.icon && !resolvePhiButtonIcon(action.icon));
286
- if (iconAction)
287
- return `Table action "${iconAction.key}" references an unavailable icon.`;
288
- const iconBindingTool = config.features.tools?.bindingFields?.find((tool) => tool.create?.display !== "label" && tool.create?.icon && !resolvePhiButtonIcon(tool.create.icon));
289
- return iconBindingTool
290
- ? `Table binding field "${iconBindingTool.key}" create tool references an unavailable icon.`
291
- : null;
292
- }, [config]);
293
274
  const binding = usePhiTableBinding({
294
275
  source: resolvedSource,
295
276
  initialQuery: { ...initialQuery, sorts: defaultSorts, filters: initialFilters },
@@ -323,9 +304,8 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
323
304
  const { revealValue: _shownOnce, ...announced } = result;
324
305
  emitCapability("mutationChange", announced);
325
306
  },
326
- validateResource,
327
307
  });
328
- const { resource, bindingError, contractError, rows, total, hasMore, summary, loading, error, queryError, query, resolvedQuery, setQuery, changePage, selectedRowIdentities, setSelectedRowIdentities, expandedRowIdentities, setExpandedRowIdentities, reload, executeAction, commitField, commitRow, isFieldMutationPending, moveRow, drop, } = binding;
308
+ const { resource, bindingError, rows, total, hasMore, summary, loading, error, queryError, query, resolvedQuery, setQuery, changePage, selectedRowIdentities, setSelectedRowIdentities, expandedRowIdentities, setExpandedRowIdentities, reload, executeAction, commitField, commitRow, isFieldMutationPending, moveRow, drop, } = binding;
329
309
  const toolbarActions = useMemo(() => resolveTableActions(features.actions?.toolbar, resource?.actions), [features.actions?.toolbar, resource?.actions]);
330
310
  const rowActions = useMemo(() => resolveTableActions(features.actions?.row, resource?.actions), [features.actions?.row, resource?.actions]);
331
311
  const bulkActions = useMemo(() => resolveTableActions(features.actions?.bulk, resource?.actions), [features.actions?.bulk, resource?.actions]);
@@ -348,7 +328,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
348
328
  .flatMap((condition) => condition.source === "controller" && condition.controllerAddress
349
329
  ? [condition.controllerAddress]
350
330
  : [])), [bulkActions, features.editing?.disabledWhen, features.rowSelection?.disabledWhen, presentation.columns, presentation.row?.mutedWhen, resource?.fields, rowActions, toolbarActions]);
351
- const effectiveLoading = loading && !bindingError && !contractError;
331
+ const effectiveLoading = loading && !bindingError;
352
332
  useEffect(() => {
353
333
  if (features.search?.enabled !== true || query.search === searchDraft)
354
334
  return undefined;
@@ -421,8 +401,11 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
421
401
  return;
422
402
  emitSelection(selectedRowIdentities);
423
403
  }, [emitFields, emitSelection, readSelectedRows, selectedRowIdentities]);
424
- const updateBindingParams = useCallback((next, correlationId) => {
425
- setChosenBindingParams({ seed: bindingParamsSeed, params: next });
404
+ /* A change to the params; the same params again change nothing and hand nothing on. */
405
+ const updateBindingParams = useCallback((patch, correlationId) => {
406
+ const next = changeBindingParams(patch);
407
+ if (!next)
408
+ return;
426
409
  setQuery((current) => ({ ...current, page: 1, cursor: null }));
427
410
  setSelectedRowIdentities([]);
428
411
  setExpandedRowIdentities([]);
@@ -436,24 +419,22 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
436
419
  : [];
437
420
  })),
438
421
  }, correlationId);
439
- }, [bindingParamsSeed, configuredBindingFields, emitCapability, setExpandedRowIdentities, setQuery, setSelectedRowIdentities]);
422
+ }, [changeBindingParams, configuredBindingFields, emitCapability, setExpandedRowIdentities, setQuery, setSelectedRowIdentities]);
440
423
  useEffect(() => {
441
424
  if (!resource?.bindingFields?.length)
442
425
  return;
443
- const next = { ...bindingParams };
444
- let changed = false;
426
+ const defaults = {};
445
427
  for (const field of resource.bindingFields) {
446
- if (next[field.key] === undefined && field.defaultValue !== undefined) {
447
- next[field.key] = field.defaultValue;
448
- changed = true;
428
+ if (bindingParams[field.key] === undefined && field.defaultValue !== undefined) {
429
+ defaults[field.key] = field.defaultValue;
449
430
  }
450
431
  }
451
- if (!changed)
432
+ if (Object.keys(defaults).length === 0)
452
433
  return;
453
434
  let cancelled = false;
454
435
  queueMicrotask(() => {
455
436
  if (!cancelled)
456
- updateBindingParams(next);
437
+ updateBindingParams(defaults);
457
438
  });
458
439
  return () => { cancelled = true; };
459
440
  }, [bindingParams, resource?.bindingFields, updateBindingParams]);
@@ -520,7 +501,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
520
501
  else if (route.capabilityId === "bindingParamsChange") {
521
502
  const next = readPhiTableBindingParamsSignalValue(signal.value);
522
503
  if (next)
523
- updateBindingParams({ ...bindingParams, ...next.params }, signal.correlationId);
504
+ updateBindingParams(next.params, signal.correlationId);
524
505
  }
525
506
  else if (route.capabilityId === "reload") {
526
507
  reload();
@@ -576,7 +557,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
576
557
  setConditionControllerStates((current) => ({ ...current, [signal.sender]: next.state }));
577
558
  }
578
559
  }
579
- }, [activateAction, bindingParams, bulkActions, conditionControllerAddresses, confirm, listenRoutes, reload, resource, rowActions, rows, setQuery, signalIdentity.receiver, toolbarActions, updateBindingParams, updateColumnOrder, updateExpandedRows, updateSelection]), useMemo(() => resolvePhiSignalListenFilter(listenRoutes), [listenRoutes]), signalIdentity.receiver);
560
+ }, [activateAction, bulkActions, conditionControllerAddresses, confirm, listenRoutes, reload, resource, rowActions, rows, setQuery, signalIdentity.receiver, toolbarActions, updateBindingParams, updateColumnOrder, updateExpandedRows, updateSelection]), useMemo(() => resolvePhiSignalListenFilter(listenRoutes), [listenRoutes]), signalIdentity.receiver);
580
561
  useEffect(() => {
581
562
  if (conditionControllerAddresses.size > 0) {
582
563
  emitCapability("conditionStateRequest", null);
@@ -704,17 +685,19 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
704
685
  return pageSize > 0 ? Math.ceil(total / pageSize) : 0;
705
686
  }, [resolvedQuery.page, resolvedQuery.pageSize, rows.length, selectedRowIdentities.length, summary, total]);
706
687
  const footer = useMemo(() => {
707
- if (!presentation.footer)
688
+ if (presentation.header === false || presentation.footerOmitted)
708
689
  return undefined;
690
+ if (!presentation.footer)
691
+ return { content: "" };
709
692
  // The first variant whose value holds says the line instead; see `PhiTableFooterVariant`.
710
693
  const variant = presentation.footer.variants?.find(({ when }) => {
711
694
  const held = Boolean(resolveSummaryValue({ key: "when", value: when.value }));
712
695
  return when.operator === "truthy" ? held : !held;
713
696
  });
714
697
  const template = variant?.template ?? presentation.footer.template;
715
- // A variant with an empty template takes the footer away rather than drawing an empty bar.
698
+ // An empty line keeps the Table's closing bar; only footerOmitted removes it.
716
699
  if (!template.trim())
717
- return undefined;
700
+ return { align: presentation.footer.align, content: "" };
718
701
  const values = variant ? variant.values ?? [] : presentation.footer.values;
719
702
  return {
720
703
  align: presentation.footer.align,
@@ -723,7 +706,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
723
706
  return typeof value === "number" ? value : value == null ? "—" : String(value);
724
707
  })),
725
708
  };
726
- }, [presentation.footer, resolveSummaryValue]);
709
+ }, [presentation.footer, presentation.footerOmitted, presentation.header, resolveSummaryValue]);
727
710
  const tableSummary = useMemo(() => presentation.summary ? {
728
711
  ...presentation.summary,
729
712
  rows: presentation.summary.rows.map((row) => ({
@@ -760,7 +743,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
760
743
  filters: initialFilters,
761
744
  }));
762
745
  };
763
- const collectionFilters = hasSelfContainedTools && (configuredBindingFields.length > 0 || hasQueryTools) ? (_jsxs(PhiFlexControl, { align: "end", gap: token.paddingSM, wrap: true, children: [configuredBindingFields.map(({ field, tool }) => (_jsx(TableBindingTool, { field: field, tool: tool, sourceConfig: bindingParams, value: bindingParams[field.key], size: resolvedControlSize, onChange: (value) => updateBindingParams({ ...bindingParams, [field.key]: value }), onCreate: field.create && tool.create ? async (value) => {
746
+ const collectionFilters = hasSelfContainedTools && (configuredBindingFields.length > 0 || hasQueryTools) ? (_jsxs(PhiFlexControl, { align: "end", gap: token.paddingSM, wrap: true, children: [configuredBindingFields.map(({ field, tool }) => (_jsx(TableBindingTool, { field: field, tool: tool, sourceConfig: bindingParams, value: bindingParams[field.key], size: resolvedControlSize, onChange: (value) => updateBindingParams({ [field.key]: value }), onCreate: field.create && tool.create ? async (value) => {
764
747
  const result = await executeAction({
765
748
  kind: "action",
766
749
  actionKey: field.create.actionKey,
@@ -772,7 +755,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
772
755
  (typeof result.canonicalValue !== "string" && typeof result.canonicalValue !== "number")) {
773
756
  return null;
774
757
  }
775
- updateBindingParams({ ...bindingParams, [field.key]: result.canonicalValue });
758
+ updateBindingParams({ [field.key]: result.canonicalValue });
776
759
  return result.canonicalValue;
777
760
  } : undefined }, field.key))), features.filters?.map((filter) => {
778
761
  const control = (_jsx(TableFilter, { filter: filter, field: resource?.fields.find((field) => field.key === filter.key), sourceConfig: bindingParams, value: readTableFilterValue(filter, resolvedQuery.filters), labels: labels, size: resolvedControlSize, onChange: (value) => {
@@ -808,12 +791,13 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
808
791
  return _jsx(TableAction, { action: action, size: resolvedControlSize, disabled: selectedRowIdentities.length === 0 || Boolean(disabled), disabledReason: disabled && "reason" in disabled ? disabled.reason : undefined, templateValue: selectedRowIdentities.length, onActivate: () => activateAction(action, undefined, selectedRowIdentities) }, action.key);
809
792
  }), hasQueryTools && features.tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "rollback-outlined", size: "inherit" }), ariaLabel: labels.reset, tooltip: labels.reset, size: resolvedControlSize, onClick: resetQuery })) : null, features.tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: resolvedControlSize, onClick: reload })) : null] })) : null;
810
793
  /*
811
- * The source's failures end the Table here: a binding that does not hold, a resource the
812
- * configuration does not fit, a read that failed. A refused edit is not one of them -- it stays in
813
- * `error` alone and is said above the rows to the person who made it.
794
+ * The source's failures end the Table here: a Provider the Area does not offer, a read that failed.
795
+ * A refused edit is not one of them -- it stays in `error` alone and is said above the rows to the
796
+ * person who made it. Whether the configuration fits the resource is not asked here: that is checked
797
+ * where the config is made (`checkPhiPresetTables`, the Builder's save), and a live Table trusts it.
814
798
  */
815
799
  const refusal = isPhiTableProviderRefusal(queryError) ? queryError : null;
816
- const sourceFailure = bindingError ?? contractError ?? (refusal ? null : queryError?.message) ?? null;
800
+ const sourceFailure = bindingError ?? (refusal ? null : queryError?.message) ?? null;
817
801
  if (sourceFailure) {
818
802
  return (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Table, title: sourceFailure, error: queryError }));
819
803
  }
@@ -960,7 +944,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
960
944
  afterRowIdentity: null,
961
945
  }).catch(() => undefined).finally(clearPhiDataDragPayload);
962
946
  }
963
- : undefined, loading: effectiveLoading, bordered: presentation.borders, striped: presentation.row?.striped, showHeader: presentation.header, stickyHeader: presentation.stickyHeader !== false, size: resolvedControlSize, emptyText: (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { strong: true, children: refusal?.message ?? presentation.emptyState?.title ?? labels.emptyTitle }), emptyDescription && !refusal ? _jsx(PhiTypographyControl, { type: "secondary", children: emptyDescription }) : null] })), layout: presentation.layout, footer: footer, summary: tableSummary })] }));
947
+ : undefined, loading: effectiveLoading, loadingRows: presentation.loadingRows, bordered: presentation.borders, striped: presentation.row?.striped, showHeader: presentation.header, stickyHeader: presentation.stickyHeader !== false, size: resolvedControlSize, emptyText: (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { strong: true, children: refusal?.message ?? presentation.emptyState?.title ?? labels.emptyTitle }), emptyDescription && !refusal ? _jsx(PhiTypographyControl, { type: "secondary", children: emptyDescription }) : null] })), layout: presentation.layout, footer: footer, summary: tableSummary })] }));
964
948
  }
965
949
  function TableAction({ action, disabled = false, disabledReason, templateValue, size, onActivate }) {
966
950
  const icon = action.icon ? resolvePhiButtonIcon(action.icon) : null;
@@ -106,7 +106,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
106
106
  heading?: string;
107
107
  } & {
108
108
  type: "data-provider";
109
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
109
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
110
110
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
111
111
  }) | ({
112
112
  key: string;
@@ -435,7 +435,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
435
435
  editorPlacement?: "inspector" | "geometry" | "toolbar";
436
436
  heading?: string;
437
437
  type: "data-provider";
438
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
438
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
439
439
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
440
440
  } | {
441
441
  visibleWhen: {
@@ -827,7 +827,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
827
827
  editorPlacement?: "inspector" | "geometry" | "toolbar";
828
828
  heading?: string;
829
829
  type: "data-provider";
830
- providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
830
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
831
831
  providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
832
832
  } | {
833
833
  visibleWhen: {
@@ -1,4 +1,5 @@
1
1
  import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
2
+ import { PHI_TABLE_LOADING_ROWS_MAX } from "../../../../../constants/table-loading";
2
3
  import { readPhiProviderResourceSource } from "../../../../../types/runtime-data-provider";
3
4
  import { PHI_TABLE_TAG_COLORS, PHI_TABLE_TAG_VARIANTS, readPhiTableQuery, } from "../../../../../types/table-widget";
4
5
  import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet } from "../../../../../types/signals";
@@ -473,6 +474,8 @@ export function parsePhiTableWidgetConfig(config) {
473
474
  header: presentation.boolean("header"),
474
475
  stickyHeader: presentation.boolean("stickyHeader"),
475
476
  footer: presentation.object("footer", readTableFooter),
477
+ footerOmitted: presentation.string("footerOmitted"),
478
+ loadingRows: presentation.value("loadingRows", `a whole number from 1 to ${PHI_TABLE_LOADING_ROWS_MAX}`, (value) => typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= PHI_TABLE_LOADING_ROWS_MAX ? value : undefined),
476
479
  summary: presentation.object("summary", readTableSummary),
477
480
  row: {
478
481
  striped: row.boolean("striped"),
@@ -450,7 +450,7 @@ export function PhiThreadConversationWidgetClient({ runtime, labels, config, })
450
450
  * the frame instead -- a box around a box, and the sign that the Card was missing the prop.
451
451
  */
452
452
  if (threadId == null) {
453
- return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiTypographyControl, { type: "secondary", children: labels.noThreadText }) }));
453
+ return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiTypographyControl, { type: "secondary", children: config?.emptyDescription ?? labels.noThreadText }) }));
454
454
  }
455
455
  if (error && !detail) {
456
456
  return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error }) }));
@@ -460,7 +460,7 @@ export function PhiThreadConversationWidgetClient({ runtime, labels, config, })
460
460
  }
461
461
  const archived = detail.thread.status === PhisThreadStatus.Archived;
462
462
  const locked = isPhiThreadLocked(detail);
463
- return (_jsx(_Fragment, { children: _jsx(PhiCardControl, { padding: config?.padding, toolbar: config?.reply && !archived && !locked ? (_jsx(PhiButtonControl, { label: labels.replyLabel, icon: _jsx(PhiIcon, { name: "antd:message-outlined", size: "inherit" }), size: "small", onClick: reply })) : undefined, title: _jsxs(PhiFlexControl, { align: "center", gap: "small", wrap: true, children: [readThreadTitle(detail, labels), archived ? (_jsx(PhiTagControl, { children: labels.archivedLabel })) : null, locked ? (_jsxs(PhiTagControl, { color: "warning", children: [_jsx(PhiIcon, { name: "antd:lock", size: "inherit" }), " ", labels.lockedLabel] })) : null] }), children: _jsxs(PhiFlexControl, { vertical: true, gap: "middle", children: [detail.thread.subject?.trim() && detail.participants.length > 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: `${labels.participantsLabel}: ${readParticipantNames(detail, labels).join(", ")}` })) : null, config?.reply && locked && !archived ? (_jsx(PhiAlertControl, { level: "info", showIcon: true, title: labels.lockedText })) : null, error ? (_jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error })) : null, detail.hasMoreMessages ? (_jsx(PhiButtonControl, { label: labels.olderLabel, type: "link", loading: loadingOlder, onClick: () => void loadOlder() })) : null, detail.messages.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.emptyText })) : (detail.messages.map((message, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiThreadMessageRow, { message: message, labels: labels, formatTime: formatTime, formatLanguage: formatLanguage, translation: translations[message.id] ?? null, canTranslate: translationTarget != null, onTranslate: translate })] }, message.id))))] }) }) }));
463
+ return (_jsx(_Fragment, { children: _jsx(PhiCardControl, { padding: config?.padding, toolbar: config?.reply && !archived && !locked ? (_jsx(PhiButtonControl, { label: config?.replyLabel ?? labels.replyLabel, icon: _jsx(PhiIcon, { name: "antd:message-outlined", size: "inherit" }), size: "small", onClick: reply })) : undefined, title: _jsxs(PhiFlexControl, { align: "center", gap: "small", wrap: true, children: [config?.title ?? readThreadTitle(detail, labels), archived ? (_jsx(PhiTagControl, { children: labels.archivedLabel })) : null, locked ? (_jsxs(PhiTagControl, { color: "warning", children: [_jsx(PhiIcon, { name: "antd:lock", size: "inherit" }), " ", labels.lockedLabel] })) : null] }), children: _jsxs(PhiFlexControl, { vertical: true, gap: "middle", children: [detail.thread.subject?.trim() && detail.participants.length > 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: `${labels.participantsLabel}: ${readParticipantNames(detail, labels).join(", ")}` })) : null, config?.reply && locked && !archived ? (_jsx(PhiAlertControl, { level: "info", showIcon: true, title: labels.lockedText })) : null, error ? (_jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error })) : null, detail.hasMoreMessages ? (_jsx(PhiButtonControl, { label: labels.olderLabel, type: "link", loading: loadingOlder, onClick: () => void loadOlder() })) : null, detail.messages.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.emptyText })) : (detail.messages.map((message, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiThreadMessageRow, { message: message, labels: labels, formatTime: formatTime, formatLanguage: formatLanguage, translation: translations[message.id] ?? null, canTranslate: translationTarget != null, onTranslate: translate })] }, message.id))))] }) }) }));
464
464
  }
465
465
  /** Whether Core takes new messages into this conversation; `PhisThreadFlag.Locked` says it does not. */
466
466
  export function isPhiThreadLocked(detail) {
@@ -46,10 +46,14 @@ export declare const PHI_THREAD_CONVERSATION_WIDGET_DEFINITION: {
46
46
  valueSchema: `${string}/signals/${string}`;
47
47
  })[];
48
48
  };
49
- fields: {
49
+ fields: ({
50
50
  key: string;
51
51
  type: "boolean";
52
52
  label: string;
53
- }[];
53
+ } | {
54
+ key: string;
55
+ type: "string";
56
+ label: string;
57
+ })[];
54
58
  parseConfig: typeof parsePhiThreadWidgetConfig;
55
59
  };
@@ -60,6 +60,11 @@ export const PHI_THREAD_CONVERSATION_WIDGET_DEFINITION = {
60
60
  { id: "reply", action: "activate", valueType: "json", valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction },
61
61
  ],
62
62
  },
63
- fields: [{ key: "reply", type: "boolean", label: "Offer a reply" }],
63
+ fields: [
64
+ { key: "reply", type: "boolean", label: "Offer a reply" },
65
+ { key: "replyLabel", type: "string", label: "Reply label" },
66
+ { key: "title", type: "string", label: "Heading" },
67
+ { key: "emptyDescription", type: "string", label: "Text without a conversation" },
68
+ ],
64
69
  parseConfig: parsePhiThreadWidgetConfig,
65
70
  };
@@ -19,6 +19,16 @@ export type PhiThreadWidgetConfig = {
19
19
  * conversation, which takes no new messages.
20
20
  */
21
21
  reply?: boolean;
22
+ /**
23
+ * The heading in place of the conversation's own subject, for a placement that always shows one kind of
24
+ * conversation and names it -- a customer file's File, which Core opens without a subject. Already in the
25
+ * reader's language.
26
+ */
27
+ title?: string;
28
+ /** What the Reply says, where the placement offers it as something else -- "Add note" in a file. */
29
+ replyLabel?: string;
30
+ /** The sentence where no conversation is chosen yet, in place of the Widget's own. */
31
+ emptyDescription?: string;
22
32
  signalRoutes?: PhiSignalRouteSet | null;
23
33
  };
24
34
  export declare function parsePhiThreadWidgetConfig(rawConfig: Record<string, unknown> | null | undefined): PhiThreadWidgetConfig;