@phis/ui 0.7.8 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +15 -7
  2. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  3. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  4. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  5. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  6. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  7. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  8. package/components/cms/phi-cms-root-layout.js +3 -1
  9. package/components/controls/phi-address-control.d.ts +23 -0
  10. package/components/controls/phi-address-control.js +43 -0
  11. package/components/controls/phi-color-control.d.ts +3 -1
  12. package/components/controls/phi-color-control.js +2 -2
  13. package/components/controls/phi-country-select-control.d.ts +22 -0
  14. package/components/controls/phi-country-select-control.js +16 -0
  15. package/components/controls/phi-dialog-control.d.ts +1 -1
  16. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  17. package/components/controls/phi-drawer-control-adapter.js +5 -3
  18. package/components/controls/phi-drawer-control.d.ts +7 -5
  19. package/components/controls/phi-float-button-control.d.ts +8 -1
  20. package/components/controls/phi-float-button-control.js +19 -3
  21. package/components/controls/phi-form-control.js +52 -8
  22. package/components/controls/phi-media-picker-control.d.ts +9 -0
  23. package/components/controls/phi-media-picker-control.js +1 -1
  24. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  25. package/components/controls/phi-modal-control-adapter.js +14 -37
  26. package/components/controls/phi-modal-control.d.ts +5 -5
  27. package/components/controls/phi-options-provider.d.ts +1 -0
  28. package/components/controls/phi-options-provider.js +1 -0
  29. package/components/controls/phi-overlay-control-contract.d.ts +52 -17
  30. package/components/controls/phi-overlay-control-contract.js +55 -30
  31. package/components/controls/phi-popover-control.js +4 -1
  32. package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
  33. package/components/controls/phi-reveal-once-dialog-control.js +52 -0
  34. package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
  35. package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
  36. package/components/controls/phi-table-control.d.ts +7 -1
  37. package/components/controls/phi-table-control.js +23 -8
  38. package/components/forms/flags-field.d.ts +22 -0
  39. package/components/forms/flags-field.js +58 -0
  40. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  41. package/components/forms/form-descriptor-field-check.js +41 -0
  42. package/components/forms/form-descriptor-runtime-client.js +11 -10
  43. package/components/forms/form-option-flags.d.ts +20 -0
  44. package/components/forms/form-option-flags.js +38 -0
  45. package/components/forms/form-provider-contract.d.ts +23 -0
  46. package/components/forms/form-provider-contract.js +36 -0
  47. package/components/forms/form-provider-registry.d.ts +5 -1
  48. package/components/forms/form-record-source.d.ts +38 -0
  49. package/components/forms/form-record-source.js +48 -0
  50. package/components/forms/shared-form-descriptors.d.ts +0 -34
  51. package/components/forms/shared-form-descriptors.js +0 -6
  52. package/components/forms/shared-form-ids.d.ts +1 -1
  53. package/components/forms/shared-form-ids.js +1 -1
  54. package/components/forms/shared-form-provider-registry.js +13 -0
  55. package/components/forms/structured-field-labels.d.ts +24 -0
  56. package/components/forms/structured-field-labels.js +43 -0
  57. package/components/forms/structured-form-field-controls.d.ts +12 -0
  58. package/components/forms/structured-form-field-controls.js +65 -0
  59. package/components/media/media-settings-labels.d.ts +1 -0
  60. package/components/media/media-settings-labels.js +2 -0
  61. package/components/media/phi-media-picker-binding.d.ts +41 -33
  62. package/components/media/phi-media-picker-binding.js +2 -1
  63. package/components/media/use-media-library-add-picker.d.ts +33 -32
  64. package/components/overlays/phi-overlay-container-client.js +13 -11
  65. package/components/regions/phi-cms-region-shell.js +2 -2
  66. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  67. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +13 -2
  68. package/components/regions/presets/phi-settings-page-shell-tree.js +4 -4
  69. package/components/root/phi-root-theme-resolver.js +3 -0
  70. package/components/shell/phi-antd-icon.d.ts +1 -8
  71. package/components/shell/phi-antd-icon.js +1 -227
  72. package/components/shell/phi-icon-names.d.ts +22 -0
  73. package/components/shell/phi-icon-names.js +267 -0
  74. package/components/shell/phi-icon.d.ts +4 -15
  75. package/components/shell/phi-icon.js +9 -50
  76. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  77. package/components/tables/client/phi-table-binding-params.js +39 -0
  78. package/components/tables/client/phi-table-binding.d.ts +1 -3
  79. package/components/tables/client/phi-table-binding.js +5 -9
  80. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  81. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  82. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  83. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  84. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  85. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  86. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  87. package/components/widgets/client/shared/phi-command-buttons.d.ts +29 -2
  88. package/components/widgets/client/shared/phi-command-buttons.js +19 -5
  89. package/components/widgets/client/shared/phi-rendered-value.js +27 -3
  90. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  91. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  92. package/components/widgets/config/background.d.ts +3 -2
  93. package/components/widgets/config/choice-shared.d.ts +10 -1
  94. package/components/widgets/config/choice-shared.js +8 -2
  95. package/components/widgets/label-sets/admin-locales.js +1 -1
  96. package/components/widgets/label-sets/admin-users.d.ts +3 -5
  97. package/components/widgets/label-sets/admin-users.js +6 -10
  98. package/components/widgets/label-sets/builder-modules.js +4 -0
  99. package/components/widgets/label-sets/effects.js +2 -4
  100. package/components/widgets/label-sets/profile.d.ts +13 -16
  101. package/components/widgets/label-sets/profile.js +24 -33
  102. package/components/widgets/label-sets/registration.d.ts +0 -1
  103. package/components/widgets/label-sets/registration.js +0 -2
  104. package/components/widgets/label-sets/revisions.js +2 -0
  105. package/components/widgets/label-sets/search-results.js +2 -4
  106. package/components/widgets/label-sets/signals.js +2 -0
  107. package/components/widgets/label-sets/table.js +9 -0
  108. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  109. package/components/widgets/label-types/builder-modules.js +2 -0
  110. package/components/widgets/label-types/effects.d.ts +3 -2
  111. package/components/widgets/label-types/effects.js +1 -2
  112. package/components/widgets/label-types/revisions.d.ts +2 -0
  113. package/components/widgets/label-types/revisions.js +2 -1
  114. package/components/widgets/label-types/search-results.d.ts +2 -2
  115. package/components/widgets/label-types/search-results.js +1 -2
  116. package/components/widgets/label-types/signals.d.ts +2 -0
  117. package/components/widgets/label-types/signals.js +1 -0
  118. package/components/widgets/label-types/table.d.ts +3 -0
  119. package/components/widgets/label-types/table.js +2 -0
  120. package/components/widgets/server/builder-chrome.d.ts +4 -1
  121. package/components/widgets/server/builder-chrome.js +2 -2
  122. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  123. package/components/widgets/shared/markdown-body-client.js +31 -1
  124. package/components/widgets/shared/markdown-render.d.ts +10 -2
  125. package/components/widgets/shared/markdown-render.js +35 -13
  126. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  127. package/components/widgets/shared/widget-failure-audience.js +21 -0
  128. package/components/widgets/shared/widget-failure-client.js +5 -2
  129. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  130. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  131. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  132. package/components/widgets/shared/widget-failure-notice.js +17 -0
  133. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  134. package/components/widgets/shared/widget-failure-staff.js +18 -0
  135. package/components/widgets/shared/widget-failure.d.ts +9 -6
  136. package/components/widgets/shared/widget-failure.js +0 -9
  137. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  138. package/components/widgets/shared/widget-failure.server.js +8 -3
  139. package/constants/countries.d.ts +9 -0
  140. package/constants/countries.js +28 -0
  141. package/constants/customer-file.d.ts +34 -0
  142. package/constants/customer-file.js +35 -0
  143. package/constants/record-field-kinds.d.ts +15 -0
  144. package/constants/record-field-kinds.js +13 -0
  145. package/constants/runtime-module-ownership.js +15 -2
  146. package/constants/runtime-render-client-types.d.ts +5 -0
  147. package/constants/runtime-render-client-types.js +5 -0
  148. package/constants/site-address.d.ts +9 -0
  149. package/constants/site-address.js +10 -0
  150. package/constants/table-loading.d.ts +14 -0
  151. package/constants/table-loading.js +14 -0
  152. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  153. package/constants.d.ts +2 -0
  154. package/constants.js +4 -0
  155. package/gateway/form-handler-request.d.ts +22 -0
  156. package/gateway/form-handler-request.js +40 -0
  157. package/gateway/label-set.d.ts +15 -2
  158. package/gateway/label-set.js +60 -22
  159. package/gateway/site-cms-write-validation.js +19 -3
  160. package/gateway/site-form-route.js +11 -2
  161. package/helpers/address-field.d.ts +43 -0
  162. package/helpers/address-field.js +68 -0
  163. package/helpers/announced-action.d.ts +17 -0
  164. package/helpers/announced-action.js +29 -0
  165. package/helpers/cms-dialog.d.ts +5 -20
  166. package/helpers/cms-dialog.js +8 -13
  167. package/helpers/cms-page-catalog.d.ts +10 -0
  168. package/helpers/cms-page-catalog.js +19 -0
  169. package/helpers/cms-preset-nodes.d.ts +4 -4
  170. package/helpers/cms-preset-nodes.js +1 -1
  171. package/helpers/cms-region-keys.d.ts +1 -1
  172. package/helpers/country-names.d.ts +12 -0
  173. package/helpers/country-names.js +14 -0
  174. package/helpers/phi-metadata.d.ts +25 -1
  175. package/helpers/phi-metadata.js +53 -1
  176. package/helpers/phi-site-description.d.ts +11 -0
  177. package/helpers/phi-site-description.js +13 -0
  178. package/helpers/preset-form-check.d.ts +14 -0
  179. package/helpers/preset-form-check.js +12 -0
  180. package/helpers/preset-table-check.d.ts +38 -0
  181. package/helpers/preset-table-check.js +118 -0
  182. package/helpers/preset-text-source-check.d.ts +4 -1
  183. package/helpers/preset-text-source-check.js +6 -1
  184. package/helpers/preset-tree-contract-check.d.ts +3 -2
  185. package/helpers/preset-tree-contract-check.js +30 -5
  186. package/helpers/public-route-claims.d.ts +9 -1
  187. package/helpers/public-route-claims.js +23 -3
  188. package/helpers/record-fields.d.ts +1 -5
  189. package/helpers/record-fields.js +15 -6
  190. package/helpers/record-widget-binding.d.ts +10 -0
  191. package/helpers/record-widget-binding.js +35 -0
  192. package/helpers/record-widget.d.ts +1 -10
  193. package/helpers/record-widget.js +4 -33
  194. package/helpers/route-address-check.d.ts +22 -2
  195. package/helpers/route-address-check.js +29 -8
  196. package/helpers/site-address-row.d.ts +23 -0
  197. package/helpers/site-address-row.js +36 -0
  198. package/helpers/surface-style.d.ts +8 -1
  199. package/helpers/surface-style.js +12 -2
  200. package/helpers/table-widget-binding.d.ts +12 -0
  201. package/helpers/table-widget-binding.js +296 -0
  202. package/helpers/thread-inbox-row.d.ts +20 -0
  203. package/helpers/thread-inbox-row.js +26 -0
  204. package/helpers/translation-format.d.ts +26 -0
  205. package/helpers/translation-format.js +31 -0
  206. package/helpers/tree-widget-binding.d.ts +19 -0
  207. package/helpers/tree-widget-binding.js +72 -0
  208. package/helpers/typed-confirmation.d.ts +9 -0
  209. package/helpers/typed-confirmation.js +13 -0
  210. package/helpers/widget-binding-check.d.ts +22 -0
  211. package/helpers/widget-binding-check.js +91 -0
  212. package/module-labels.d.ts +1 -1
  213. package/module-labels.js +1 -1
  214. package/module-page-check.d.ts +3 -0
  215. package/module-page-check.js +3 -0
  216. package/module-records.d.ts +2 -2
  217. package/module-records.js +1 -0
  218. package/next/area-route.js +34 -1
  219. package/next/root-route.js +4 -4
  220. package/package.json +2 -2
  221. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  222. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  223. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  224. package/plugins/runtime-modules/accounting/ids.d.ts +14 -0
  225. package/plugins/runtime-modules/accounting/ids.js +34 -0
  226. package/plugins/runtime-modules/accounting/presets.js +32 -5
  227. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +78 -0
  228. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +136 -0
  229. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  230. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +29 -0
  231. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +450 -0
  232. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  233. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  234. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  235. package/plugins/runtime-modules/app/data-providers.d.ts +43 -0
  236. package/plugins/runtime-modules/app/data-providers.js +45 -0
  237. package/plugins/runtime-modules/app/definition.d.ts +60 -1
  238. package/plugins/runtime-modules/app/definition.js +2 -0
  239. package/plugins/runtime-modules/app/forms.d.ts +33 -3
  240. package/plugins/runtime-modules/app/forms.js +166 -31
  241. package/plugins/runtime-modules/app/ids.d.ts +8 -0
  242. package/plugins/runtime-modules/app/ids.js +9 -0
  243. package/plugins/runtime-modules/app/module.d.ts +60 -1
  244. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  245. package/plugins/runtime-modules/app/services/addresses-collection.js +105 -0
  246. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +21 -0
  247. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +143 -0
  248. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +57 -0
  249. package/plugins/runtime-modules/app/trees/addresses-label-set.js +104 -0
  250. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  251. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +28 -19
  252. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -2
  253. package/plugins/runtime-modules/app/trees/profile-label-set.js +5 -14
  254. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  255. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  256. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  257. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  258. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  259. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  260. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  261. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  262. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  263. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  264. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  265. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  266. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  267. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +6 -3
  268. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  269. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  270. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  271. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  272. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  273. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  274. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  275. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
  276. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  277. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  278. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  279. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  280. package/plugins/runtime-modules/builder/persistence.js +4 -0
  281. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  282. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  283. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
  284. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +47 -7
  285. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  286. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  287. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  288. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  289. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  290. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  291. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  292. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  293. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  294. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  295. package/plugins/runtime-modules/contracts.js +31 -1
  296. package/plugins/runtime-modules/core/definition.d.ts +23 -0
  297. package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
  298. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  299. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  300. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -2
  301. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  302. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  303. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  304. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  305. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  306. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +173 -0
  307. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  308. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  309. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  310. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  311. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  312. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  313. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  314. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  315. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  316. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  317. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  318. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  319. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  320. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  321. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  322. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  323. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  324. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  325. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  326. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  327. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  328. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  329. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  330. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  331. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  332. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  333. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  334. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  335. package/plugins/runtime-modules/core/widgets/table/client.js +48 -51
  336. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  337. package/plugins/runtime-modules/core/widgets/table/config.js +9 -0
  338. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  339. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  340. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  341. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  342. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  343. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  344. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  345. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  346. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  347. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  348. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  349. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  350. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  351. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  352. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  353. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  354. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  355. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  356. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  357. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +9 -2
  358. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  359. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  360. package/plugins/runtime-modules/resolver.js +17 -0
  361. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  362. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  363. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  364. package/plugins/runtime-modules/revisions/controller/client.js +86 -60
  365. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  366. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  367. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  368. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  369. package/plugins/runtime-modules/revisions/forms.js +1 -1
  370. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  371. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  372. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  373. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  374. package/plugins/runtime-modules/revisions/services/table.js +54 -25
  375. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +79 -4
  376. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  377. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  378. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  379. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +105 -7
  380. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  381. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  382. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  383. package/plugins/runtime-modules/threads/client-data-providers.js +10 -0
  384. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  385. package/plugins/runtime-modules/threads/controller/definition.js +49 -1
  386. package/plugins/runtime-modules/threads/data-providers.d.ts +100 -2
  387. package/plugins/runtime-modules/threads/data-providers.js +96 -0
  388. package/plugins/runtime-modules/threads/definition.d.ts +100 -2
  389. package/plugins/runtime-modules/threads/definition.js +1 -1
  390. package/plugins/runtime-modules/threads/ids.d.ts +4 -0
  391. package/plugins/runtime-modules/threads/ids.js +5 -0
  392. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  393. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  394. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  395. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  396. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +126 -0
  397. package/plugins/runtime-modules/threads/services/customer-file-table.js +79 -0
  398. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  399. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  400. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  401. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  402. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  403. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  404. package/plugins/runtime-modules/user-management/ids.js +9 -0
  405. package/plugins/runtime-modules/user-management/presets.js +17 -1
  406. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  407. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  408. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +90 -0
  409. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +122 -0
  410. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  411. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +181 -0
  412. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +24 -18
  413. package/server-helpers/cms-page-record.d.ts +9 -1
  414. package/server-helpers/cms-page-record.js +11 -1
  415. package/server-helpers/cms-request.js +8 -5
  416. package/server-helpers/link-preview-image.d.ts +30 -0
  417. package/server-helpers/link-preview-image.js +57 -0
  418. package/server-helpers/runtime.js +0 -1
  419. package/server-helpers/search-text.js +3 -0
  420. package/server-helpers.d.ts +1 -1
  421. package/server-helpers.js +1 -1
  422. package/styles/controls.css +4 -2
  423. package/styles/layout.css +7 -0
  424. package/styles/shell.css +30 -6
  425. package/theme/phi-antd-token-resolver.d.ts +8 -0
  426. package/theme/phi-antd-token-resolver.js +10 -0
  427. package/theme/phi-theme-color.d.ts +19 -0
  428. package/theme/phi-theme-color.js +42 -0
  429. package/theme/phi-theme-composition.js +9 -0
  430. package/theme/phi-theme-gradients.js +4 -22
  431. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  432. package/theme/phi-theme-inverse-ground.js +103 -0
  433. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  434. package/theme/phi-theme-palette-defaults.js +103 -0
  435. package/theme/phi-theme-tokens.d.ts +2 -1
  436. package/theme/phi-theme-tokens.js +2 -0
  437. package/types/cms-module-descriptors.d.ts +14 -0
  438. package/types/cms-overlay.d.ts +13 -6
  439. package/types/cms-overlay.js +6 -22
  440. package/types/cms-plugins.d.ts +20 -3
  441. package/types/cms.d.ts +10 -0
  442. package/types/collection-provider.d.ts +27 -0
  443. package/types/collection-signal-values.d.ts +2 -0
  444. package/types/collection-signal-values.js +23 -0
  445. package/types/collection-view-widget.d.ts +9 -0
  446. package/types/core-widget-placements.d.ts +9 -3
  447. package/types/link-preview.d.ts +19 -0
  448. package/types/link-preview.js +19 -0
  449. package/types/record-provider.d.ts +22 -1
  450. package/types/signals.d.ts +2 -0
  451. package/types/signals.js +2 -0
  452. package/types/site-theme.d.ts +27 -0
  453. package/types/table-embed.d.ts +48 -0
  454. package/types/table-embed.js +1 -0
  455. package/types/table-widget.d.ts +29 -1
  456. package/types/table-widget.js +0 -282
  457. package/types/tree-widget.d.ts +0 -1
  458. package/types/tree-widget.js +0 -60
  459. package/types/widget-runtime.d.ts +3 -1
  460. package/types.d.ts +2 -1
  461. package/types.js +1 -1
  462. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -117,10 +117,14 @@ function resolveLayoutRegistryType(type) {
117
117
  * A block that cannot be drawn, said to the person who can do something about it.
118
118
  *
119
119
  * In a workspace that is the author: the diagnostic sits in the block's own place, names the type and
120
- * the Module, and the hole is visible where it has to be repaired. On a live page it is nobody: a
121
- * visitor cannot switch a Module back on and has no business reading a Module id off a page, so the
122
- * block is simply absent and the rest of the page stands. The warning is written either way, which is
123
- * where an operator finds it.
120
+ * the Module, and the hole is visible where it has to be repaired. On a live page it is Staff, who see
121
+ * the same card without the notification (`PhiCmsRenderDiagnostic` with `live`): a config that slipped
122
+ * past the checks where configs are made, a renderer that failed, a node the tree does not hold is a
123
+ * failure nobody would see otherwise (owner, 2026-11-24). A Module switched off in the Area is not one
124
+ * -- its blocks leave with it on purpose -- and stays absent for everybody. A visitor sees nothing: they
125
+ * cannot switch a Module back on and have no business reading a Module id off a page, so the block is
126
+ * simply absent and the rest of the page stands. The warning is written either way, which is where an
127
+ * operator finds it.
124
128
  */
125
129
  function renderCmsDiagnostic(issue, renderMode, error) {
126
130
  logRuntimeEvent("warn", "cms.render.block_not_renderable", {
@@ -131,7 +135,9 @@ function renderCmsDiagnostic(issue, renderMode, error) {
131
135
  error,
132
136
  meta: { code: issue.code, detail: issue.detail ?? null, renderMode },
133
137
  });
134
- return renderMode === "live" ? null : _jsx(PhiCmsRenderDiagnostic, { issue: issue });
138
+ if (renderMode !== "live")
139
+ return _jsx(PhiCmsRenderDiagnostic, { issue: issue });
140
+ return issue.code === "missing-module" ? null : _jsx(PhiCmsRenderDiagnostic, { issue: issue, live: true });
135
141
  }
136
142
  /**
137
143
  * A node whose condition reads a Module that could not be asked, said in the node's place.
@@ -551,6 +557,8 @@ function wrapPhiRenderedSlotChild(node, options) {
551
557
  if (!isRenderableNode(node)) {
552
558
  return node;
553
559
  }
560
+ // On a live page a failed block's diagnostic is Staff's alone (`PhiCmsRenderDiagnostic`).
561
+ const live = readPhiRuntimeTreeRenderMode((options.config ?? {})) === "live";
554
562
  if (isThenable(node)) {
555
563
  /*
556
564
  * A Widget that fails while rendering on the server fails alone.
@@ -562,9 +570,9 @@ function wrapPhiRenderedSlotChild(node, options) {
562
570
  * which Widget it was. Caught here, where the rejection is, it becomes the same diagnostic the
563
571
  * Client Boundary shows -- and everything else on the page still renders on the server.
564
572
  */
565
- return node.then((resolvedNode) => wrapPhiRenderedSlotChild(resolvedNode, options), (error) => wrapPhiRenderedSlotChild(_jsx(PhiCmsRenderDiagnostic, { issue: buildPhiRenderFailureIssue(error, options) }), options));
573
+ return node.then((resolvedNode) => wrapPhiRenderedSlotChild(resolvedNode, options), (error) => wrapPhiRenderedSlotChild(_jsx(PhiCmsRenderDiagnostic, { issue: buildPhiRenderFailureIssue(error, options), live: live }), options));
566
574
  }
567
- const framed = (_jsx(PhiSlotChildFrame, { kind: options.kind, slotSizePolicy: options.slotSizePolicy, surfacePolicy: options.surfacePolicy, blockId: options.blockId, config: options.config, runtime: options.signalRuntime, signalScope: options.signalScope, signalParticipant: options.signalParticipant, children: _jsx(PhiCmsRenderErrorBoundary, { kind: options.kind, blockId: options.blockId, typeKey: options.typeKey, moduleId: options.moduleId, children: node }) }, options.key));
575
+ const framed = (_jsx(PhiSlotChildFrame, { kind: options.kind, slotSizePolicy: options.slotSizePolicy, surfacePolicy: options.surfacePolicy, blockId: options.blockId, config: options.config, runtime: options.signalRuntime, signalScope: options.signalScope, signalParticipant: options.signalParticipant, children: _jsx(PhiCmsRenderErrorBoundary, { kind: options.kind, blockId: options.blockId, typeKey: options.typeKey, moduleId: options.moduleId, live: live, children: node }) }, options.key));
568
576
  /*
569
577
  * The gate goes outside the slot frame, so a node that stays away takes its frame with it. Inside it,
570
578
  * the frame would still be in the slot -- an empty box between two visible ones, which a Layout with
@@ -1,4 +1,6 @@
1
1
  import type { PhiCmsRenderIssue } from "../../types/cms-plugins";
2
- export declare function PhiCmsRenderDiagnostic({ issue }: {
2
+ /** `quiet` draws the card without the notification, for Staff reading a live page. */
3
+ export declare function PhiCmsRenderDiagnostic({ issue, quiet }: {
3
4
  issue: PhiCmsRenderIssue;
5
+ quiet?: boolean;
4
6
  }): import("react").JSX.Element;
@@ -36,7 +36,8 @@ function buildIssueDescription(issue) {
36
36
  function buildIssueKey(issue) {
37
37
  return [issue.kind, issue.type, issue.code, issue.moduleId ?? "unknown"].join(":");
38
38
  }
39
- export function PhiCmsRenderDiagnostic({ issue }) {
39
+ /** `quiet` draws the card without the notification, for Staff reading a live page. */
40
+ export function PhiCmsRenderDiagnostic({ issue, quiet = false }) {
40
41
  const { showNotification } = usePhiApplicationFeedback();
41
42
  const issueKey = buildIssueKey(issue);
42
43
  const title = buildIssueTitle(issue);
@@ -44,7 +45,7 @@ export function PhiCmsRenderDiagnostic({ issue }) {
44
45
  useEffect(() => {
45
46
  console.warn(`[phi-cms-render-diagnostic] ${title}: ${description} ` +
46
47
  `(code=${issue.code}, blockId=${issue.blockId ?? "unknown"})`);
47
- if (issue.code === "missing-module") {
48
+ if (quiet || issue.code === "missing-module") {
48
49
  return;
49
50
  }
50
51
  if (notifiedIssueKeys.has(issueKey)) {
@@ -58,7 +59,7 @@ export function PhiCmsRenderDiagnostic({ issue }) {
58
59
  placement: "bottomRight",
59
60
  durationSeconds: 6,
60
61
  });
61
- }, [description, issue.blockId, issue.code, issue.detail, issue.kind, issue.moduleId, issue.type, issueKey, showNotification, title]);
62
+ }, [description, issue.blockId, issue.code, issue.detail, issue.kind, issue.moduleId, issue.type, issueKey, quiet, showNotification, title]);
62
63
  return (_jsx("div", { "data-phi-cms-render-diagnostic": issue.kind, "data-phi-cms-render-diagnostic-code": issue.code, "data-phi-cms-render-diagnostic-type": issue.type, "data-phi-cms-render-diagnostic-block-id": issue.blockId ?? undefined, "data-phi-cms-render-diagnostic-module": issue.moduleId ?? undefined, children: _jsx(PhiAlertControl, { level: "error", showIcon: true, title: title, description: (_jsxs("div", { children: [_jsx(PhiTypographyControl, { code: true, children: issue.type }), _jsx("br", {}), _jsx(PhiTypographyControl, { children: issue.code === "missing-module"
63
64
  ? issue.moduleId
64
65
  ? `Missing module: ${issue.moduleId}`
@@ -1,4 +1,10 @@
1
1
  import type { PhiCmsRenderIssue } from "../../types/cms-plugins";
2
- export declare function PhiCmsRenderDiagnostic({ issue }: {
2
+ /**
3
+ * `live` for a block that failed on a live page: drawn for Staff only (`usePhiWidgetFailureStaff`), in
4
+ * its place and without the notification a workspace raises, and for a visitor not at all -- the chunk
5
+ * is not even fetched.
6
+ */
7
+ export declare function PhiCmsRenderDiagnostic({ issue, live }: {
3
8
  issue: PhiCmsRenderIssue;
4
- }): import("react").JSX.Element;
9
+ live?: boolean;
10
+ }): import("react").JSX.Element | null;
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { lazy, Suspense } from "react";
4
+ import { usePhiWidgetFailureStaff } from "../widgets/shared/widget-failure-audience";
4
5
  /**
5
6
  * Lazy boundary for the render diagnostic. The layout renderer references the diagnostic from
6
7
  * the server graph on every route, so a direct implementation here would put its antd surface
@@ -10,6 +11,15 @@ import { lazy, Suspense } from "react";
10
11
  const PhiCmsRenderDiagnosticImplementation = lazy(async () => ({
11
12
  default: (await import("./phi-cms-render-diagnostic-client")).PhiCmsRenderDiagnostic,
12
13
  }));
13
- export function PhiCmsRenderDiagnostic({ issue }) {
14
- return (_jsx(Suspense, { fallback: null, children: _jsx(PhiCmsRenderDiagnosticImplementation, { issue: issue }) }));
14
+ /**
15
+ * `live` for a block that failed on a live page: drawn for Staff only (`usePhiWidgetFailureStaff`), in
16
+ * its place and without the notification a workspace raises, and for a visitor not at all -- the chunk
17
+ * is not even fetched.
18
+ */
19
+ export function PhiCmsRenderDiagnostic({ issue, live = false }) {
20
+ const staff = usePhiWidgetFailureStaff();
21
+ if (live && !staff) {
22
+ return null;
23
+ }
24
+ return (_jsx(Suspense, { fallback: null, children: _jsx(PhiCmsRenderDiagnosticImplementation, { issue: issue, quiet: live }) }));
15
25
  }
@@ -14,6 +14,8 @@ export type PhiCmsRenderErrorBoundaryProps = {
14
14
  * be taken out of the tree it broke.
15
15
  */
16
16
  renderDiagnostic?: (diagnostic: ReactNode) => ReactNode;
17
+ /** The block is on a live page, where only Staff read its diagnostic (`PhiCmsRenderDiagnostic`). */
18
+ live?: boolean;
17
19
  children: ReactNode;
18
20
  };
19
21
  type PhiCmsRenderErrorBoundaryState = {
@@ -27,7 +27,7 @@ export class PhiCmsRenderErrorBoundary extends Component {
27
27
  blockId: this.props.blockId,
28
28
  moduleId: this.props.moduleId,
29
29
  detail: this.state.error.message,
30
- } });
30
+ }, live: this.props.live });
31
31
  return this.props.renderDiagnostic ? this.props.renderDiagnostic(diagnostic) : diagnostic;
32
32
  }
33
33
  return this.props.children;
@@ -19,6 +19,8 @@ import { resolvePhiUnauthenticatedLoginHref, } from "../../server-helpers/public
19
19
  import { isPhiCmsGatewayAuthError } from "../../gateway/errors";
20
20
  import { PhiRuntimeControllerServerHost } from "../runtime/runtime-controller-server-host";
21
21
  import { PhiRuntimeModuleProvider } from "../runtime/runtime-module-context";
22
+ import { PhiWidgetFailureAudienceProvider } from "../widgets/shared/widget-failure-audience";
23
+ import { canPhiViewerReadWidgetFailures } from "../widgets/shared/widget-failure-staff";
22
24
  import { PhiModuleIconsProvider } from "../shell/phi-module-icons";
23
25
  import { collectPhiModuleIconSets } from "../../helpers/module-icons";
24
26
  import { PhiRuntimeModuleDataProviderHost } from "../runtime/runtime-module-data-provider-host";
@@ -172,7 +174,7 @@ export async function PhiCmsAreaBoundary({ root, cmsBridge, children, path, page
172
174
  ...runtimeModuleScope.moduleSet.mediaSourceDescriptorsByKey.values(),
173
175
  ], videoProviderDescriptors: [
174
176
  ...runtimeModuleScope.moduleSet.videoProviderDescriptorsByKey.values(),
175
- ], children: _jsx(PhiModuleIconsProvider, { sets: collectPhiModuleIconSets(runtimeModuleScope.moduleSet.moduleDefinitionsById.values()), children: _jsxs(PhiRuntimeModuleDataProviderHost, { providerKeys: [...scope.runtimeRegistry.dataProviderDescriptorsByKey.keys()], children: [areaControllers.registeredControllerSettings && areaControllers.registeredControllerSettings.length > 0 ? (_jsx(PhiRuntimeControllerServerHost, { controllers: areaControllers.registeredControllerSettings, runtime: runtime, registry: areaControllers.controllerDefinitionsByType, controllerModuleIdsByType: runtimeModuleScope.moduleSet.ownerModuleIdByControllerType, runtimeModuleCatalog: scope.runtimeRegistry.runtimeModuleCatalog, serverCapabilities: scope.runtimeRegistry.serverCapabilities })) : null, children, filteredLayoutTree ? (_jsx(PhiCmsOverlayRenderer, { tree: filteredLayoutTree, runtime: runtime, registry: scope.runtimeRegistry, signalScope: "area", deferredOrigin: { area: runtime.area, root, path: path ?? pagePath ?? null } })) : null] }) }) }) }));
177
+ ], children: _jsx(PhiModuleIconsProvider, { sets: collectPhiModuleIconSets(runtimeModuleScope.moduleSet.moduleDefinitionsById.values()), children: _jsx(PhiWidgetFailureAudienceProvider, { staff: canPhiViewerReadWidgetFailures(runtime.viewer), children: _jsxs(PhiRuntimeModuleDataProviderHost, { providerKeys: [...scope.runtimeRegistry.dataProviderDescriptorsByKey.keys()], children: [areaControllers.registeredControllerSettings && areaControllers.registeredControllerSettings.length > 0 ? (_jsx(PhiRuntimeControllerServerHost, { controllers: areaControllers.registeredControllerSettings, runtime: runtime, registry: areaControllers.controllerDefinitionsByType, controllerModuleIdsByType: runtimeModuleScope.moduleSet.ownerModuleIdByControllerType, runtimeModuleCatalog: scope.runtimeRegistry.runtimeModuleCatalog, serverCapabilities: scope.runtimeRegistry.serverCapabilities })) : null, children, filteredLayoutTree ? (_jsx(PhiCmsOverlayRenderer, { tree: filteredLayoutTree, runtime: runtime, registry: scope.runtimeRegistry, signalScope: "area", deferredOrigin: { area: runtime.area, root, path: path ?? pagePath ?? null } })) : null] }) }) }) }) }));
176
178
  }
177
179
  /**
178
180
  * The Area-owned Regions around a Page, or nothing but the grid they share.
@@ -0,0 +1,23 @@
1
+ import type { PhisSiteAddressInput } from "@phis/contracts/users";
2
+ import { type PhiAddressPart } from "../../helpers/address-field";
3
+ export type PhiAddressControlLabels = Record<PhiAddressPart, string>;
4
+ export type PhiAddressControlProps = {
5
+ /** The id of the first part's input, so a label outside the control can name it. */
6
+ id?: string;
7
+ value: PhisSiteAddressInput;
8
+ labels: PhiAddressControlLabels;
9
+ /** A sentence per part that is wrong, shown under it. */
10
+ errors?: Partial<Record<PhiAddressPart, string>>;
11
+ disabled?: boolean;
12
+ readOnly?: boolean;
13
+ onChange?: (next: PhisSiteAddressInput) => void;
14
+ /** A part was left, so whoever validates may now say what is wrong with it. */
15
+ onPartBlur?: (part: PhiAddressPart) => void;
16
+ };
17
+ /**
18
+ * One postal address in the shape Core writes (`PhisSiteAddressInput`): name, company, two street lines,
19
+ * postal code and city, region and the country -- chosen with `PhiCountrySelectControl`. Each part has its
20
+ * label above it and its sentence under it when it is wrong; required parts carry the marker. The value is
21
+ * the whole address, an empty optional part `null`.
22
+ */
23
+ export declare function PhiAddressControl({ id, value, labels, errors, disabled, readOnly, onChange, onPartBlur, }: PhiAddressControlProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId } from "react";
4
+ import { PHI_ADDRESS_PART_MAX_LENGTHS, PHI_ADDRESS_REQUIRED_PARTS, writePhiAddressFieldPart, } from "../../helpers/address-field";
5
+ import { usePhiConfig } from "../root/phi-config-provider";
6
+ import { PhiCountrySelectControl } from "./phi-country-select-control";
7
+ import { PhiTextControl } from "./phi-text-control";
8
+ const AUTOCOMPLETE = {
9
+ name: "name",
10
+ companyName: "organization",
11
+ line1: "address-line1",
12
+ line2: "address-line2",
13
+ postalCode: "postal-code",
14
+ city: "address-level2",
15
+ region: "address-level1",
16
+ };
17
+ /* Two parts share a row where they are short: postal code beside city, region beside country. */
18
+ const ROWS = [
19
+ ["name"],
20
+ ["companyName"],
21
+ ["line1"],
22
+ ["line2"],
23
+ ["postalCode", "city"],
24
+ ["region", "country"],
25
+ ];
26
+ /**
27
+ * One postal address in the shape Core writes (`PhisSiteAddressInput`): name, company, two street lines,
28
+ * postal code and city, region and the country -- chosen with `PhiCountrySelectControl`. Each part has its
29
+ * label above it and its sentence under it when it is wrong; required parts carry the marker. The value is
30
+ * the whole address, an empty optional part `null`.
31
+ */
32
+ export function PhiAddressControl({ id, value, labels, errors, disabled, readOnly, onChange, onPartBlur, }) {
33
+ const { token } = usePhiConfig();
34
+ const ownId = useId();
35
+ const partId = (part) => (part === "name" && id ? id : `${ownId}-${part}`);
36
+ const write = (part, next) => onChange?.(writePhiAddressFieldPart(value, part, next));
37
+ const renderPart = (part) => {
38
+ const required = PHI_ADDRESS_REQUIRED_PARTS.includes(part);
39
+ const error = errors?.[part];
40
+ return (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: token.paddingXXS, minWidth: 0 }, children: [_jsxs("label", { htmlFor: partId(part), style: { color: token.colorTextHeading, fontSize: token.fontSizeSM }, children: [required ? _jsx("span", { "aria-hidden": true, style: { color: token.colorError, marginInlineEnd: "0.25em" }, children: "*" }) : null, labels[part]] }), part === "country" ? (_jsx(PhiCountrySelectControl, { id: partId(part), value: value.country, disabled: disabled, readOnly: readOnly, onBlur: () => onPartBlur?.(part), onChange: (next) => write(part, next) })) : (_jsx(PhiTextControl, { id: partId(part), value: value[part] ?? "", disabled: disabled, readOnly: readOnly, autoComplete: AUTOCOMPLETE[part], maxLength: PHI_ADDRESS_PART_MAX_LENGTHS[part], onBlur: () => onPartBlur?.(part), onChange: (next) => write(part, next) })), error ? (_jsx("span", { role: "alert", style: { color: token.colorError, fontSize: token.fontSizeSM }, children: error })) : null] }, part));
41
+ };
42
+ return (_jsx("div", { style: { display: "flex", flexDirection: "column", gap: token.paddingSM, width: "100%", minWidth: 0 }, children: ROWS.map((row) => row.length === 1 ? renderPart(row[0]) : (_jsx("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(10rem, 1fr))", gap: token.paddingSM }, children: row.map(renderPart) }, row.join("-")))) }));
43
+ }
@@ -20,6 +20,8 @@ export type PhiColorControlProps = PhiPickerTransactionCallbacks<string | null>
20
20
  defaultValue?: string;
21
21
  disabled?: boolean;
22
22
  allowClear?: boolean;
23
+ /** Offer no transparency: the alpha slider is gone and a picked colour with alpha is made opaque. */
24
+ disabledAlpha?: boolean;
23
25
  mode?: PhiColorPickerMode;
24
26
  open?: boolean;
25
27
  showText?: boolean;
@@ -33,4 +35,4 @@ export type PhiColorControlProps = PhiPickerTransactionCallbacks<string | null>
33
35
  renderPanel?: (panel: ReactNode) => ReactNode;
34
36
  onClear?: () => void;
35
37
  };
36
- export declare function PhiColorControl({ value, defaultValue, disabled, allowClear, mode, open, showText, trigger, placement, size, children, presets, getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }: PhiColorControlProps): import("react").JSX.Element;
38
+ export declare function PhiColorControl({ value, defaultValue, disabled, allowClear, disabledAlpha, mode, open, showText, trigger, placement, size, children, presets, getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }: PhiColorControlProps): import("react").JSX.Element;
@@ -56,7 +56,7 @@ function resolveCssValue(nextValue, fallbackCss) {
56
56
  function resolveAntdMode(mode) {
57
57
  return mode === "both" ? ["single", "gradient"] : mode;
58
58
  }
59
- export function PhiColorControl({ value = null, defaultValue = "#f0f0f0", disabled, allowClear, mode = "single", open, showText, trigger, placement = "auto", size, children, presets = [], getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }) {
59
+ export function PhiColorControl({ value = null, defaultValue = "#f0f0f0", disabled, allowClear, disabledAlpha, mode = "single", open, showText, trigger, placement = "auto", size, children, presets = [], getPopupContainer, popupClassName, renderPanel, onChange, onCommit, onDiscard, onOpenChange, onClear, }) {
60
60
  const { token } = theme.useToken();
61
61
  const picker = usePhiImmediatePicker({
62
62
  value,
@@ -93,7 +93,7 @@ export function PhiColorControl({ value = null, defaultValue = "#f0f0f0", disabl
93
93
  colors: [...preset.colors],
94
94
  defaultOpen: preset.defaultOpen,
95
95
  }));
96
- return (_jsx(ColorPicker, { mode: resolveAntdMode(mode), value: resolveAntdColorValue(resolvePhiColorReferences(picker.value, references), defaultValue), open: picker.open, disabled: disabled, allowClear: allowClear, trigger: trigger, placement: placement === "auto" ? undefined : placement, size: size, showText: resolvedShowText, presets: antdPresets, getPopupContainer: getPopupContainer, classNames: { popup: { root: joinPhiClassNames("phi-color-widget-popup", popupClassName) } }, styles: {
96
+ return (_jsx(ColorPicker, { mode: resolveAntdMode(mode), value: resolveAntdColorValue(resolvePhiColorReferences(picker.value, references), defaultValue), open: picker.open, disabled: disabled, allowClear: allowClear, disabledAlpha: disabledAlpha, trigger: trigger, placement: placement === "auto" ? undefined : placement, size: size, showText: resolvedShowText, presets: antdPresets, getPopupContainer: getPopupContainer, classNames: { popup: { root: joinPhiClassNames("phi-color-widget-popup", popupClassName) } }, styles: {
97
97
  root: {
98
98
  display: "inline-flex",
99
99
  alignItems: "center",
@@ -0,0 +1,22 @@
1
+ import { type CSSProperties } from "react";
2
+ import type { PhiControlSize } from "../../types/control";
3
+ export type PhiCountrySelectControlProps = {
4
+ id?: string;
5
+ /** An ISO 3166-1 alpha-2 code, uppercase; anything else shows as no choice. */
6
+ value?: string | null;
7
+ placeholder?: string;
8
+ ariaLabel?: string;
9
+ disabled?: boolean;
10
+ readOnly?: boolean;
11
+ allowClear?: boolean;
12
+ size?: PhiControlSize;
13
+ style?: CSSProperties;
14
+ onBlur?: () => void;
15
+ onChange: (code: string | null) => void;
16
+ };
17
+ /**
18
+ * A country chosen from ISO 3166-1, by name in the page's language: the Select Control with every code
19
+ * of `PHI_ISO_3166_ALPHA2_CODES` named through `Intl.DisplayNames` and sorted as the language sorts,
20
+ * searchable by name and by code. What it holds is the code.
21
+ */
22
+ export declare function PhiCountrySelectControl({ id, value, placeholder, ariaLabel, disabled, readOnly, allowClear, size, style, onBlur, onChange, }: PhiCountrySelectControlProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
+ import { listPhiCountryOptions } from "../../helpers/country-names";
5
+ import { usePhiIntlLocale } from "../root/phi-intl-locale";
6
+ import { PhiSelectControl } from "./phi-select-control";
7
+ /**
8
+ * A country chosen from ISO 3166-1, by name in the page's language: the Select Control with every code
9
+ * of `PHI_ISO_3166_ALPHA2_CODES` named through `Intl.DisplayNames` and sorted as the language sorts,
10
+ * searchable by name and by code. What it holds is the code.
11
+ */
12
+ export function PhiCountrySelectControl({ id, value, placeholder, ariaLabel, disabled, readOnly, allowClear, size, style, onBlur, onChange, }) {
13
+ const locale = usePhiIntlLocale();
14
+ const options = useMemo(() => listPhiCountryOptions(locale), [locale]);
15
+ return (_jsx(PhiSelectControl, { id: id, value: value && options.some((option) => option.value === value) ? value : undefined, placeholder: placeholder, ariaLabel: ariaLabel, disabled: disabled, readOnly: readOnly, allowClear: allowClear, size: size, options: options, style: style ?? { width: "100%" }, onBlur: onBlur, onChange: (next) => onChange(typeof next === "string" && next ? next : null) }));
16
+ }
@@ -74,7 +74,7 @@ export type PhiDialogControlProps = {
74
74
  presentation?: "modal" | "drawer";
75
75
  /** The edge a Drawer comes from. */
76
76
  placement?: PhiDrawerControlProps["placement"];
77
- /** A Drawer's width (or height, from the top or bottom). */
77
+ /** A Drawer's size, a block's pair: its `width`, or its `height` from the top or bottom. */
78
78
  size?: PhiDrawerControlProps["size"];
79
79
  onDismiss?: (source: PhiOverlayCloseSource) => void;
80
80
  afterOpenChange?: (open: boolean) => void;
@@ -1,2 +1,2 @@
1
1
  import type { PhiDrawerControlProps } from "./phi-drawer-control";
2
- export declare function PhiDrawerControlAdapter({ open, title, header, body, footer, closable, keyboard, mask, mountPolicy, placement, size, maxSize, resizable, push, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }: PhiDrawerControlProps): import("react").JSX.Element;
2
+ export declare function PhiDrawerControlAdapter({ open, title, header, body, footer, closable, keyboard, mask, mountPolicy, placement, size, minSize, maxSize, resizable, push, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }: PhiDrawerControlProps): import("react").JSX.Element;
@@ -6,21 +6,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  */
7
7
  import { Drawer } from "antd";
8
8
  import { PHI_FONT_SIZE, PHI_SPACE } from "../../theme/antd-css-var-contract";
9
- import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
9
+ import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiDrawerGeometry, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
10
10
  import { usePhiHydrated } from "../state/use-phi-hydrated";
11
11
  const PHI_DRAWER_HEADER_MIN_BLOCK_SIZE = `calc(var(--phi-control-height) + ${PHI_SPACE.xs} + ${PHI_SPACE.xs})`;
12
12
  /** Where a title starts when the close button stands before it: past the button, not beneath it. */
13
13
  const PHI_DRAWER_TITLE_AFTER_CLOSE = `calc(${PHI_SPACE.sm} + var(--phi-control-height) + ${PHI_SPACE.xs})`;
14
- export function PhiDrawerControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", placement = "right", size, maxSize, resizable = false, push = false, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
14
+ export function PhiDrawerControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", placement = "right", size, minSize, maxSize, resizable = false, push = false, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
15
15
  const hydrated = usePhiHydrated();
16
16
  const resolvedMask = resolvePhiOverlayMaskPresentation(mask);
17
+ const geometry = resolvePhiDrawerGeometry({ size, minSize, maxSize, placement });
17
18
  const closeAtInlineStart = placement === "right";
18
19
  // A drawer with nothing to say in its header draws none: no title, no header content, no close button.
19
20
  const hasHeaderContent = header != null || title != null;
20
21
  const hasHeader = hasHeaderContent || closable;
21
22
  const titleInset = closable && closeAtInlineStart ? PHI_DRAWER_TITLE_AFTER_CLOSE : PHI_SPACE.lg;
22
23
  const renderedTitle = hasHeaderContent ? (_jsxs("div", { style: { display: "grid", minBlockSize: PHI_DRAWER_HEADER_MIN_BLOCK_SIZE, minWidth: 0, position: "relative", width: "100%" }, children: [header, title == null ? null : (_jsx("div", { style: { insetInlineStart: titleInset, minWidth: 0, position: "absolute", top: "50%", transform: "translateY(-50%)", zIndex: 1 }, children: title }))] })) : null;
23
- return (_jsx(Drawer, { open: open, title: renderedTitle, closable: closable ? { placement: closeAtInlineStart ? "start" : "end" } : false, keyboard: keyboard, mask: resolvedMask.adapterMask, destroyOnHidden: mountPolicy === "remount", forceRender: hydrated && mountPolicy === "eager", placement: placement, size: size, maxSize: maxSize, resizable: resizable, push: push, zIndex: zIndex, footer: footer ?? null, focusable: { trap: true, focusTriggerAfterClose: true }, styles: {
24
+ return (_jsx(Drawer, { open: open, title: renderedTitle, closable: closable ? { placement: closeAtInlineStart ? "start" : "end" } : false, keyboard: keyboard, mask: resolvedMask.adapterMask, destroyOnHidden: mountPolicy === "remount", forceRender: hydrated && mountPolicy === "eager", placement: placement, size: geometry.size, maxSize: geometry.resizeMaxSize, resizable: resizable, push: push, zIndex: zIndex, footer: footer ?? null, focusable: { trap: true, focusTriggerAfterClose: true }, styles: {
24
25
  mask: resolvedMask.maskStyle,
25
26
  wrapper: {
26
27
  /*
@@ -31,6 +32,7 @@ export function PhiDrawerControlAdapter({ open, title, header, body, footer, clo
31
32
  */
32
33
  background: "var(--phi-color-bg-elevated)",
33
34
  ...containerStyle,
35
+ ...geometry.style,
34
36
  padding: 0,
35
37
  },
36
38
  section: {
@@ -1,9 +1,11 @@
1
- import type { PhiCmsOverlayConfig, PhiCmsOverlaySize, PhiOverlayPushBehaviour } from "../../types/cms-overlay";
2
- import type { PhiOverlayControlCommonProps } from "./phi-overlay-control-contract";
3
- export type PhiDrawerControlProps = PhiOverlayControlCommonProps & {
1
+ import type { PhiCmsOverlayConfig, PhiOverlayPushBehaviour } from "../../types/cms-overlay";
2
+ import type { PhiOverlayControlCommonProps, PhiOverlayControlGeometryProps } from "./phi-overlay-control-contract";
3
+ /**
4
+ * `size`, `minSize` and `maxSize` are the block's pairs; the Drawer draws the axis it opens along
5
+ * (`resolvePhiDrawerGeometry`).
6
+ */
7
+ export type PhiDrawerControlProps = PhiOverlayControlCommonProps & PhiOverlayControlGeometryProps & {
4
8
  placement?: PhiCmsOverlayConfig["placement"];
5
- size?: PhiCmsOverlaySize;
6
- maxSize?: number;
7
9
  resizable?: boolean;
8
10
  push?: PhiOverlayPushBehaviour;
9
11
  zIndex?: number;
@@ -1,5 +1,11 @@
1
1
  import type { PhiToolbarControlItem } from "./phi-toolbar-control";
2
2
  export type PhiFloatButtonControlPlacement = "bottom-end" | "bottom-start" | "top-end" | "top-start";
3
+ /**
4
+ * How large the buttons are. A Float Button is drawn at the large control height by Ant Design; that is
5
+ * `medium` here, and `small` steps one down the Theme's control heights. The ladder has no step above
6
+ * it, so there is no `large`.
7
+ */
8
+ export type PhiFloatButtonControlSize = "small" | "medium";
3
9
  export type PhiFloatButtonControlGroup = {
4
10
  /** How the group opens. Left out, it is always open: every button stands in the corner. */
5
11
  trigger?: "click" | "hover";
@@ -24,6 +30,7 @@ export type PhiFloatButtonControlProps = {
24
30
  * floating over the editor could neither be seen in its slot nor selected there.
25
31
  */
26
32
  inPlace?: boolean;
33
+ size?: PhiFloatButtonControlSize;
27
34
  disabled?: boolean;
28
35
  onActivate?: (key: string) => void;
29
36
  };
@@ -36,4 +43,4 @@ export type PhiFloatButtonControlProps = {
36
43
  * on a Float Button and are not imitated: `danger`, and `loading`, which disables the button instead of
37
44
  * spinning.
38
45
  */
39
- export declare function PhiFloatButtonControl({ items, placement, offset, shape, group, inPlace, disabled, onActivate, }: PhiFloatButtonControlProps): import("react").JSX.Element | null;
46
+ export declare function PhiFloatButtonControl({ items, placement, offset, shape, group, inPlace, size, disabled, onActivate, }: PhiFloatButtonControlProps): import("react").JSX.Element | null;
@@ -5,6 +5,21 @@ import { createPortal } from "react-dom";
5
5
  import { FloatButton } from "antd";
6
6
  import { PhiIcon } from "../shell/phi-icon";
7
7
  import { usePhiHydrated } from "../state/use-phi-hydrated";
8
+ import { PHI_CONTROL } from "../../theme/antd-css-var-contract";
9
+ /*
10
+ * Ant Design sizes the button by its own variable (`--ant-float-btn-size`, under the component prefix, as
11
+ * the Select's are) and opens a group's list from the trigger by the same length plus the padding.
12
+ */
13
+ function resolveSizeStyle(size) {
14
+ if (size !== "small")
15
+ return undefined;
16
+ return { "--ant-float-btn-size": PHI_CONTROL.md };
17
+ }
18
+ function resolveGroupSizeStyle(size) {
19
+ if (size !== "small")
20
+ return undefined;
21
+ return { "--ant-float-btn-list-trigger-offset": `calc(${PHI_CONTROL.md} + var(--phi-padding))` };
22
+ }
8
23
  /**
9
24
  * Where a fixed button is drawn: on `document.body`, outside every box of the page.
10
25
  *
@@ -47,7 +62,8 @@ function resolveCornerStyle(placement, offset, inPlace) {
47
62
  * on a Float Button and are not imitated: `danger`, and `loading`, which disables the button instead of
48
63
  * spinning.
49
64
  */
50
- export function PhiFloatButtonControl({ items, placement = "bottom-end", offset, shape = "circle", group, inPlace = false, disabled, onActivate, }) {
65
+ export function PhiFloatButtonControl({ items, placement = "bottom-end", offset, shape = "circle", group, inPlace = false, size, disabled, onActivate, }) {
66
+ const sizeStyle = resolveSizeStyle(size);
51
67
  const visibleItems = items.filter((item) => item.visible !== false);
52
68
  if (visibleItems.length === 0) {
53
69
  return null;
@@ -65,9 +81,9 @@ export function PhiFloatButtonControl({ items, placement = "bottom-end", offset,
65
81
  }
66
82
  : undefined,
67
83
  /* A single button carries the corner itself; inside a group, the group does. */
68
- style: visibleItems.length === 1 && index === 0 ? cornerStyle : undefined, onClick: item.readOnly || !onActivate ? undefined : () => onActivate(item.key) }, item.key));
84
+ style: visibleItems.length === 1 && index === 0 ? { ...cornerStyle, ...sizeStyle } : sizeStyle, onClick: item.readOnly || !onActivate ? undefined : () => onActivate(item.key) }, item.key));
69
85
  });
70
- const placed = buttons.length === 1 ? buttons[0] : (_jsx(FloatButton.Group, { trigger: group?.trigger, icon: group?.icon ? _jsx(PhiIcon, { name: group.icon, size: "inherit" }) : undefined, placement: group?.direction ?? (placement.startsWith("top") ? "bottom" : "top"), shape: shape, style: cornerStyle, children: buttons }));
86
+ const placed = buttons.length === 1 ? buttons[0] : (_jsx(FloatButton.Group, { trigger: group?.trigger, icon: group?.icon ? _jsx(PhiIcon, { name: group.icon, size: "inherit" }) : undefined, placement: group?.direction ?? (placement.startsWith("top") ? "bottom" : "top"), shape: shape, style: { ...cornerStyle, ...resolveGroupSizeStyle(size) }, children: buttons }));
71
87
  /* In place it stays in its slot, where the Builder's canvas can show and select it. */
72
88
  return inPlace ? placed : _jsx(PhiFloatButtonPortal, { children: placed });
73
89
  }
@@ -10,6 +10,7 @@ import { PhiDescriptionHint } from "./phi-description-tooltip-icon";
10
10
  import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_FIELD_UNAVAILABLE_DEFAULT_LABEL, PHI_FORM_FIELD_UNAVAILABLE_LABEL_KEY, PHI_FORM_VALIDATION_PROVIDER_KEYS, } from "../forms/form-provider-contract";
11
11
  import { phiFormCellOpensColumn, phiFormControlGridColumn, phiFormFieldFollowsLayoutColumns, phiFormLabelGridColumn, resolvePhiFormGridPlacement, resolvePhiFormLayout, PHI_FORM_RESPONSIVE_MODES, resolvePhiFormText, shouldPhiFormSubmitOnKeyDown, } from "../forms/form-descriptor-contract";
12
12
  import { readPhiMoneyFieldCurrencyFieldKey } from "../forms/money-field-currency-key";
13
+ import { collectFormOptionFlagFieldKeys, resolveFormChosenOptionFlags, } from "../forms/form-option-flags";
13
14
  import { PHI_SHARED_FORM_PROVIDER_REGISTRY } from "../forms/shared-form-provider-registry";
14
15
  import { resolvePhiControlOptionsDependencies, usePhiControlOptionsProvider, } from "./phi-options-provider";
15
16
  /** The id Ant Design gives a Form Item's control: the form's name and the field's key, joined by `_`. */
@@ -83,7 +84,7 @@ function pickPhiFormWatchedValues(values, keys) {
83
84
  }
84
85
  return picked;
85
86
  }
86
- function PhiResolvedFormFieldControl({ id, provider, field, label, description, labels, formConfig, placeholder, disabled, readOnly, value, checked, onChange, formContext, formValues, mediaLimits, }) {
87
+ function PhiResolvedFormFieldControl({ id, provider, field, label, description, labels, formConfig, placeholder, disabled, readOnly, value, checked, onChange, formContext, formValues, mediaLimits, onChosenOptionFlags, }) {
87
88
  const staticOptions = useMemo(() => field.options?.map((option) => ({
88
89
  ...option,
89
90
  label: resolvePhiFormText(option.label, labels, formConfig),
@@ -139,6 +140,13 @@ function PhiResolvedFormFieldControl({ id, provider, field, label, description,
139
140
  if (value != null && value !== "")
140
141
  onChange?.(undefined);
141
142
  }, [onChange, requiredDependencyKey, value]);
143
+ const chosenOptionFlags = onChosenOptionFlags
144
+ ? resolveFormChosenOptionFlags(resolvedOptions.options, value)
145
+ : undefined;
146
+ useEffect(() => {
147
+ onChosenOptionFlags?.(chosenOptionFlags);
148
+ }, [chosenOptionFlags, onChosenOptionFlags]);
149
+ useEffect(() => () => onChosenOptionFlags?.(undefined), [onChosenOptionFlags]);
142
150
  const Control = provider.Control;
143
151
  const controlLabel = field.controlLabel
144
152
  ? resolvePhiFormText(field.controlLabel, labels, formConfig)
@@ -250,8 +258,10 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
250
258
  async function submit(values) {
251
259
  const holds = [...submitHoldsRef.current];
252
260
  if (holds.length > 0) {
253
- form.setFields(holds.map(([name, reason]) => ({ name, errors: [reason] })));
254
- onValidationFailed?.({ valid: false, errors: Object.fromEntries(holds.map(([name, reason]) => [name, [reason]])) });
261
+ form.setFields(holds.flatMap(([name, { reason, onRefused }]) => onRefused ? [] : [{ name, errors: [reason] }]));
262
+ for (const [, { onRefused }] of holds)
263
+ onRefused?.();
264
+ onValidationFailed?.({ valid: false, errors: Object.fromEntries(holds.map(([name, { reason }]) => [name, [reason]])) });
255
265
  return;
256
266
  }
257
267
  setSubmitting(true);
@@ -301,20 +311,52 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
301
311
  const selectWatchedFormValues = useCallback((values) => pickPhiFormWatchedValues(values, watchedFormKeys), [watchedFormKeys]);
302
312
  const watchedFormValues = Form.useWatch(selectWatchedFormValues, { form, preserve: true });
303
313
  const formValues = useMemo(() => watchedFormValues ?? pickPhiFormWatchedValues(resolvedInitialValues, watchedFormKeys), [resolvedInitialValues, watchedFormKeys, watchedFormValues]);
314
+ /*
315
+ * What an `optionFlag` condition reads: the flags of the option chosen in each field one of them names.
316
+ * Written-out options are known here and answered during the render, the server's included; a
317
+ * Provider's are known only to the field that resolved them, which reports them once it has.
318
+ */
319
+ const optionFlagFieldKeys = useMemo(() => collectFormOptionFlagFieldKeys(descriptor.fields), [descriptor.fields]);
320
+ const [reportedOptionFlags, setReportedOptionFlags] = useState({});
321
+ const optionFlagReporters = useMemo(() => new Map([...optionFlagFieldKeys].map((key) => [
322
+ key,
323
+ (flags) => setReportedOptionFlags((current) => {
324
+ if (current[key] === flags)
325
+ return current;
326
+ const next = { ...current };
327
+ if (flags === undefined)
328
+ delete next[key];
329
+ else
330
+ next[key] = flags;
331
+ return next;
332
+ }),
333
+ ])), [optionFlagFieldKeys]);
334
+ const formOptionFlags = useMemo(() => {
335
+ const flags = {};
336
+ for (const key of optionFlagFieldKeys) {
337
+ const field = descriptor.fields.find((entry) => entry.key === key);
338
+ const chosen = field?.optionsProvider
339
+ ? reportedOptionFlags[key]
340
+ : resolveFormChosenOptionFlags(field?.options, formValues[key]);
341
+ if (chosen !== undefined)
342
+ flags[key] = chosen;
343
+ }
344
+ return flags;
345
+ }, [descriptor.fields, formValues, optionFlagFieldKeys, reportedOptionFlags]);
304
346
  const fieldFormContext = useMemo(() => ({
305
347
  getValues: () => form.getFieldsValue(true),
306
- holdSubmit: (fieldKey, reason) => {
348
+ holdSubmit: (fieldKey, reason, onRefused) => {
307
349
  const holds = submitHoldsRef.current;
308
350
  const held = holds.get(fieldKey);
309
351
  if (reason == null) {
310
352
  holds.delete(fieldKey);
311
353
  // The sentence a refused submit left on the field goes with the hold; any other error stays.
312
- if (held != null && form.getFieldError(fieldKey).includes(held)) {
354
+ if (held != null && form.getFieldError(fieldKey).includes(held.reason)) {
313
355
  form.setFields([{ name: fieldKey, errors: [] }]);
314
356
  }
315
357
  return;
316
358
  }
317
- holds.set(fieldKey, reason);
359
+ holds.set(fieldKey, onRefused ? { reason, onRefused } : { reason });
318
360
  },
319
361
  setValues: (values) => {
320
362
  form.setFields(Object.entries(values).map(([name, value]) => ({ name, value, touched: true })));
@@ -335,8 +377,9 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
335
377
  !field.visibleWhen ||
336
378
  evaluatePhiRuntimeConditionExpression(field.visibleWhen, {
337
379
  form: formValues,
380
+ formOptionFlags,
338
381
  controllers: conditionControllerStates,
339
- }) === "matched"), [activeRegistry, conditionControllerStates, descriptor.fields, formValues]);
382
+ }) === "matched"), [activeRegistry, conditionControllerStates, descriptor.fields, formOptionFlags, formValues]);
340
383
  /*
341
384
  * Where every part of every field lies, at each of the three widths, worked out before anything is
342
385
  * drawn. Labels and controls are direct children of the form's grid and name their own row and
@@ -488,6 +531,7 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
488
531
  const fieldDisabled = field.disabledWhen
489
532
  ? evaluatePhiRuntimeConditionExpression(field.disabledWhen, {
490
533
  form: formValues,
534
+ formOptionFlags,
491
535
  controllers: conditionControllerStates,
492
536
  })
493
537
  : "not-matched";
@@ -529,6 +573,6 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
529
573
  ...resolveHoneypotStyle(provider.presentation),
530
574
  }, children: _jsx(Form.Item, { name: field.key, messageVariables: { label: labelText ?? field.key }, hidden: hidden, valuePropName: provider.valuePropName, dependencies: dependencies, required: required, rules: resolvedRules.length === 0 ? undefined : resolvedRules, style: { marginBottom: 0 }, children: _jsx(PhiResolvedFormFieldControl, { provider: provider, field: field, label: providerLabel, description: providerDescription, labels: labels, formConfig: formConfig, placeholder: field.placeholder
531
575
  ? resolvePhiFormText(field.placeholder, labels, formConfig)
532
- : undefined, disabled: disabled || submitting || readOnly || field.config?.disabled === true || fieldDisabled !== "not-matched", readOnly: readOnly, formContext: fieldFormContext, formValues: formValues, mediaLimits: mediaLimits }) }) })] }, field.key));
576
+ : undefined, disabled: disabled || submitting || readOnly || field.config?.disabled === true || fieldDisabled !== "not-matched", readOnly: readOnly, formContext: fieldFormContext, formValues: formValues, mediaLimits: mediaLimits, onChosenOptionFlags: field.optionsProvider ? optionFlagReporters.get(field.key) : undefined }) }) })] }, field.key));
533
577
  }) }) }));
534
578
  });
@@ -49,6 +49,15 @@ export type PhiMediaPickerControlProps = PhiPickerTransactionCallbacks<number |
49
49
  loading?: boolean;
50
50
  disabled?: boolean;
51
51
  readOnly?: boolean;
52
+ /**
53
+ * Where the picker opens, which the host decides: it knows where the room is. A panel at the window's
54
+ * right, the Builder Inspector, says `left`, towards the canvas. Absent, it opens centred below: the
55
+ * library is wider than most panels, and opened beside a panel at the window's left it ran past the
56
+ * window's edge and the page scrolled sideways (the Theme's Link preview, 2026-11-24). Ant Design's
57
+ * overflow adjustment is on for every placement (`PhiPopoverControl`), and the width is capped to the
58
+ * window; centred below it slides sideways and upwards into the window, which a corner placement such
59
+ * as `bottomLeft` does not.
60
+ */
52
61
  placement?: PhiPickerPlacement;
53
62
  showSearchBar?: boolean;
54
63
  showFolderFilter?: boolean;