@phis/ui 0.7.8 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +15 -7
  2. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  3. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  4. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  5. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  6. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  7. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  8. package/components/cms/phi-cms-root-layout.js +3 -1
  9. package/components/controls/phi-address-control.d.ts +23 -0
  10. package/components/controls/phi-address-control.js +43 -0
  11. package/components/controls/phi-color-control.d.ts +3 -1
  12. package/components/controls/phi-color-control.js +2 -2
  13. package/components/controls/phi-country-select-control.d.ts +22 -0
  14. package/components/controls/phi-country-select-control.js +16 -0
  15. package/components/controls/phi-dialog-control.d.ts +1 -1
  16. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  17. package/components/controls/phi-drawer-control-adapter.js +5 -3
  18. package/components/controls/phi-drawer-control.d.ts +7 -5
  19. package/components/controls/phi-float-button-control.d.ts +8 -1
  20. package/components/controls/phi-float-button-control.js +19 -3
  21. package/components/controls/phi-form-control.js +52 -8
  22. package/components/controls/phi-media-picker-control.d.ts +9 -0
  23. package/components/controls/phi-media-picker-control.js +1 -1
  24. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  25. package/components/controls/phi-modal-control-adapter.js +14 -37
  26. package/components/controls/phi-modal-control.d.ts +5 -5
  27. package/components/controls/phi-options-provider.d.ts +1 -0
  28. package/components/controls/phi-options-provider.js +1 -0
  29. package/components/controls/phi-overlay-control-contract.d.ts +52 -17
  30. package/components/controls/phi-overlay-control-contract.js +55 -30
  31. package/components/controls/phi-popover-control.js +4 -1
  32. package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
  33. package/components/controls/phi-reveal-once-dialog-control.js +52 -0
  34. package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
  35. package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
  36. package/components/controls/phi-table-control.d.ts +7 -1
  37. package/components/controls/phi-table-control.js +23 -8
  38. package/components/forms/flags-field.d.ts +22 -0
  39. package/components/forms/flags-field.js +58 -0
  40. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  41. package/components/forms/form-descriptor-field-check.js +41 -0
  42. package/components/forms/form-descriptor-runtime-client.js +11 -10
  43. package/components/forms/form-option-flags.d.ts +20 -0
  44. package/components/forms/form-option-flags.js +38 -0
  45. package/components/forms/form-provider-contract.d.ts +23 -0
  46. package/components/forms/form-provider-contract.js +36 -0
  47. package/components/forms/form-provider-registry.d.ts +5 -1
  48. package/components/forms/form-record-source.d.ts +38 -0
  49. package/components/forms/form-record-source.js +48 -0
  50. package/components/forms/shared-form-descriptors.d.ts +0 -34
  51. package/components/forms/shared-form-descriptors.js +0 -6
  52. package/components/forms/shared-form-ids.d.ts +1 -1
  53. package/components/forms/shared-form-ids.js +1 -1
  54. package/components/forms/shared-form-provider-registry.js +13 -0
  55. package/components/forms/structured-field-labels.d.ts +24 -0
  56. package/components/forms/structured-field-labels.js +43 -0
  57. package/components/forms/structured-form-field-controls.d.ts +12 -0
  58. package/components/forms/structured-form-field-controls.js +65 -0
  59. package/components/media/media-settings-labels.d.ts +1 -0
  60. package/components/media/media-settings-labels.js +2 -0
  61. package/components/media/phi-media-picker-binding.d.ts +41 -33
  62. package/components/media/phi-media-picker-binding.js +2 -1
  63. package/components/media/use-media-library-add-picker.d.ts +33 -32
  64. package/components/overlays/phi-overlay-container-client.js +13 -11
  65. package/components/regions/phi-cms-region-shell.js +2 -2
  66. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  67. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +13 -2
  68. package/components/regions/presets/phi-settings-page-shell-tree.js +4 -4
  69. package/components/root/phi-root-theme-resolver.js +3 -0
  70. package/components/shell/phi-antd-icon.d.ts +1 -8
  71. package/components/shell/phi-antd-icon.js +1 -227
  72. package/components/shell/phi-icon-names.d.ts +22 -0
  73. package/components/shell/phi-icon-names.js +267 -0
  74. package/components/shell/phi-icon.d.ts +4 -15
  75. package/components/shell/phi-icon.js +9 -50
  76. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  77. package/components/tables/client/phi-table-binding-params.js +39 -0
  78. package/components/tables/client/phi-table-binding.d.ts +1 -3
  79. package/components/tables/client/phi-table-binding.js +5 -9
  80. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  81. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  82. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  83. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  84. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  85. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  86. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  87. package/components/widgets/client/shared/phi-command-buttons.d.ts +29 -2
  88. package/components/widgets/client/shared/phi-command-buttons.js +19 -5
  89. package/components/widgets/client/shared/phi-rendered-value.js +27 -3
  90. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  91. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  92. package/components/widgets/config/background.d.ts +3 -2
  93. package/components/widgets/config/choice-shared.d.ts +10 -1
  94. package/components/widgets/config/choice-shared.js +8 -2
  95. package/components/widgets/label-sets/admin-locales.js +1 -1
  96. package/components/widgets/label-sets/admin-users.d.ts +3 -5
  97. package/components/widgets/label-sets/admin-users.js +6 -10
  98. package/components/widgets/label-sets/builder-modules.js +4 -0
  99. package/components/widgets/label-sets/effects.js +2 -4
  100. package/components/widgets/label-sets/profile.d.ts +13 -16
  101. package/components/widgets/label-sets/profile.js +24 -33
  102. package/components/widgets/label-sets/registration.d.ts +0 -1
  103. package/components/widgets/label-sets/registration.js +0 -2
  104. package/components/widgets/label-sets/revisions.js +2 -0
  105. package/components/widgets/label-sets/search-results.js +2 -4
  106. package/components/widgets/label-sets/signals.js +2 -0
  107. package/components/widgets/label-sets/table.js +9 -0
  108. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  109. package/components/widgets/label-types/builder-modules.js +2 -0
  110. package/components/widgets/label-types/effects.d.ts +3 -2
  111. package/components/widgets/label-types/effects.js +1 -2
  112. package/components/widgets/label-types/revisions.d.ts +2 -0
  113. package/components/widgets/label-types/revisions.js +2 -1
  114. package/components/widgets/label-types/search-results.d.ts +2 -2
  115. package/components/widgets/label-types/search-results.js +1 -2
  116. package/components/widgets/label-types/signals.d.ts +2 -0
  117. package/components/widgets/label-types/signals.js +1 -0
  118. package/components/widgets/label-types/table.d.ts +3 -0
  119. package/components/widgets/label-types/table.js +2 -0
  120. package/components/widgets/server/builder-chrome.d.ts +4 -1
  121. package/components/widgets/server/builder-chrome.js +2 -2
  122. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  123. package/components/widgets/shared/markdown-body-client.js +31 -1
  124. package/components/widgets/shared/markdown-render.d.ts +10 -2
  125. package/components/widgets/shared/markdown-render.js +35 -13
  126. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  127. package/components/widgets/shared/widget-failure-audience.js +21 -0
  128. package/components/widgets/shared/widget-failure-client.js +5 -2
  129. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  130. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  131. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  132. package/components/widgets/shared/widget-failure-notice.js +17 -0
  133. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  134. package/components/widgets/shared/widget-failure-staff.js +18 -0
  135. package/components/widgets/shared/widget-failure.d.ts +9 -6
  136. package/components/widgets/shared/widget-failure.js +0 -9
  137. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  138. package/components/widgets/shared/widget-failure.server.js +8 -3
  139. package/constants/countries.d.ts +9 -0
  140. package/constants/countries.js +28 -0
  141. package/constants/customer-file.d.ts +34 -0
  142. package/constants/customer-file.js +35 -0
  143. package/constants/record-field-kinds.d.ts +15 -0
  144. package/constants/record-field-kinds.js +13 -0
  145. package/constants/runtime-module-ownership.js +15 -2
  146. package/constants/runtime-render-client-types.d.ts +5 -0
  147. package/constants/runtime-render-client-types.js +5 -0
  148. package/constants/site-address.d.ts +9 -0
  149. package/constants/site-address.js +10 -0
  150. package/constants/table-loading.d.ts +14 -0
  151. package/constants/table-loading.js +14 -0
  152. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  153. package/constants.d.ts +2 -0
  154. package/constants.js +4 -0
  155. package/gateway/form-handler-request.d.ts +22 -0
  156. package/gateway/form-handler-request.js +40 -0
  157. package/gateway/label-set.d.ts +15 -2
  158. package/gateway/label-set.js +60 -22
  159. package/gateway/site-cms-write-validation.js +19 -3
  160. package/gateway/site-form-route.js +11 -2
  161. package/helpers/address-field.d.ts +43 -0
  162. package/helpers/address-field.js +68 -0
  163. package/helpers/announced-action.d.ts +17 -0
  164. package/helpers/announced-action.js +29 -0
  165. package/helpers/cms-dialog.d.ts +5 -20
  166. package/helpers/cms-dialog.js +8 -13
  167. package/helpers/cms-page-catalog.d.ts +10 -0
  168. package/helpers/cms-page-catalog.js +19 -0
  169. package/helpers/cms-preset-nodes.d.ts +4 -4
  170. package/helpers/cms-preset-nodes.js +1 -1
  171. package/helpers/cms-region-keys.d.ts +1 -1
  172. package/helpers/country-names.d.ts +12 -0
  173. package/helpers/country-names.js +14 -0
  174. package/helpers/phi-metadata.d.ts +25 -1
  175. package/helpers/phi-metadata.js +53 -1
  176. package/helpers/phi-site-description.d.ts +11 -0
  177. package/helpers/phi-site-description.js +13 -0
  178. package/helpers/preset-form-check.d.ts +14 -0
  179. package/helpers/preset-form-check.js +12 -0
  180. package/helpers/preset-table-check.d.ts +38 -0
  181. package/helpers/preset-table-check.js +118 -0
  182. package/helpers/preset-text-source-check.d.ts +4 -1
  183. package/helpers/preset-text-source-check.js +6 -1
  184. package/helpers/preset-tree-contract-check.d.ts +3 -2
  185. package/helpers/preset-tree-contract-check.js +30 -5
  186. package/helpers/public-route-claims.d.ts +9 -1
  187. package/helpers/public-route-claims.js +23 -3
  188. package/helpers/record-fields.d.ts +1 -5
  189. package/helpers/record-fields.js +15 -6
  190. package/helpers/record-widget-binding.d.ts +10 -0
  191. package/helpers/record-widget-binding.js +35 -0
  192. package/helpers/record-widget.d.ts +1 -10
  193. package/helpers/record-widget.js +4 -33
  194. package/helpers/route-address-check.d.ts +22 -2
  195. package/helpers/route-address-check.js +29 -8
  196. package/helpers/site-address-row.d.ts +23 -0
  197. package/helpers/site-address-row.js +36 -0
  198. package/helpers/surface-style.d.ts +8 -1
  199. package/helpers/surface-style.js +12 -2
  200. package/helpers/table-widget-binding.d.ts +12 -0
  201. package/helpers/table-widget-binding.js +296 -0
  202. package/helpers/thread-inbox-row.d.ts +20 -0
  203. package/helpers/thread-inbox-row.js +26 -0
  204. package/helpers/translation-format.d.ts +26 -0
  205. package/helpers/translation-format.js +31 -0
  206. package/helpers/tree-widget-binding.d.ts +19 -0
  207. package/helpers/tree-widget-binding.js +72 -0
  208. package/helpers/typed-confirmation.d.ts +9 -0
  209. package/helpers/typed-confirmation.js +13 -0
  210. package/helpers/widget-binding-check.d.ts +22 -0
  211. package/helpers/widget-binding-check.js +91 -0
  212. package/module-labels.d.ts +1 -1
  213. package/module-labels.js +1 -1
  214. package/module-page-check.d.ts +3 -0
  215. package/module-page-check.js +3 -0
  216. package/module-records.d.ts +2 -2
  217. package/module-records.js +1 -0
  218. package/next/area-route.js +34 -1
  219. package/next/root-route.js +4 -4
  220. package/package.json +2 -2
  221. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  222. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  223. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  224. package/plugins/runtime-modules/accounting/ids.d.ts +14 -0
  225. package/plugins/runtime-modules/accounting/ids.js +34 -0
  226. package/plugins/runtime-modules/accounting/presets.js +32 -5
  227. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +78 -0
  228. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +136 -0
  229. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  230. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +29 -0
  231. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +450 -0
  232. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  233. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  234. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  235. package/plugins/runtime-modules/app/data-providers.d.ts +43 -0
  236. package/plugins/runtime-modules/app/data-providers.js +45 -0
  237. package/plugins/runtime-modules/app/definition.d.ts +60 -1
  238. package/plugins/runtime-modules/app/definition.js +2 -0
  239. package/plugins/runtime-modules/app/forms.d.ts +33 -3
  240. package/plugins/runtime-modules/app/forms.js +166 -31
  241. package/plugins/runtime-modules/app/ids.d.ts +8 -0
  242. package/plugins/runtime-modules/app/ids.js +9 -0
  243. package/plugins/runtime-modules/app/module.d.ts +60 -1
  244. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  245. package/plugins/runtime-modules/app/services/addresses-collection.js +105 -0
  246. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +21 -0
  247. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +143 -0
  248. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +57 -0
  249. package/plugins/runtime-modules/app/trees/addresses-label-set.js +104 -0
  250. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  251. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +28 -19
  252. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -2
  253. package/plugins/runtime-modules/app/trees/profile-label-set.js +5 -14
  254. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  255. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  256. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  257. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  258. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  259. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  260. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  261. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  262. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  263. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  264. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  265. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  266. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  267. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +6 -3
  268. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  269. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  270. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  271. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  272. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  273. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  274. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  275. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
  276. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  277. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  278. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  279. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  280. package/plugins/runtime-modules/builder/persistence.js +4 -0
  281. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  282. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  283. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
  284. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +47 -7
  285. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  286. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  287. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  288. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  289. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  290. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  291. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  292. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  293. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  294. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  295. package/plugins/runtime-modules/contracts.js +31 -1
  296. package/plugins/runtime-modules/core/definition.d.ts +23 -0
  297. package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
  298. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  299. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  300. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -2
  301. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  302. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  303. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  304. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  305. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  306. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +173 -0
  307. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  308. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  309. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  310. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  311. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  312. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  313. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  314. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  315. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  316. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  317. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  318. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  319. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  320. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  321. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  322. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  323. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  324. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  325. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  326. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  327. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  328. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  329. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  330. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  331. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  332. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  333. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  334. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  335. package/plugins/runtime-modules/core/widgets/table/client.js +48 -51
  336. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  337. package/plugins/runtime-modules/core/widgets/table/config.js +9 -0
  338. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  339. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  340. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  341. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  342. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  343. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  344. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  345. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  346. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  347. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  348. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  349. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  350. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  351. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  352. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  353. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  354. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  355. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  356. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  357. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +9 -2
  358. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  359. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  360. package/plugins/runtime-modules/resolver.js +17 -0
  361. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  362. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  363. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  364. package/plugins/runtime-modules/revisions/controller/client.js +86 -60
  365. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  366. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  367. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  368. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  369. package/plugins/runtime-modules/revisions/forms.js +1 -1
  370. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  371. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  372. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  373. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  374. package/plugins/runtime-modules/revisions/services/table.js +54 -25
  375. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +79 -4
  376. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  377. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  378. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  379. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +105 -7
  380. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  381. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  382. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  383. package/plugins/runtime-modules/threads/client-data-providers.js +10 -0
  384. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  385. package/plugins/runtime-modules/threads/controller/definition.js +49 -1
  386. package/plugins/runtime-modules/threads/data-providers.d.ts +100 -2
  387. package/plugins/runtime-modules/threads/data-providers.js +96 -0
  388. package/plugins/runtime-modules/threads/definition.d.ts +100 -2
  389. package/plugins/runtime-modules/threads/definition.js +1 -1
  390. package/plugins/runtime-modules/threads/ids.d.ts +4 -0
  391. package/plugins/runtime-modules/threads/ids.js +5 -0
  392. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  393. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  394. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  395. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  396. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +126 -0
  397. package/plugins/runtime-modules/threads/services/customer-file-table.js +79 -0
  398. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  399. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  400. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  401. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  402. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  403. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  404. package/plugins/runtime-modules/user-management/ids.js +9 -0
  405. package/plugins/runtime-modules/user-management/presets.js +17 -1
  406. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  407. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  408. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +90 -0
  409. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +122 -0
  410. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  411. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +181 -0
  412. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +24 -18
  413. package/server-helpers/cms-page-record.d.ts +9 -1
  414. package/server-helpers/cms-page-record.js +11 -1
  415. package/server-helpers/cms-request.js +8 -5
  416. package/server-helpers/link-preview-image.d.ts +30 -0
  417. package/server-helpers/link-preview-image.js +57 -0
  418. package/server-helpers/runtime.js +0 -1
  419. package/server-helpers/search-text.js +3 -0
  420. package/server-helpers.d.ts +1 -1
  421. package/server-helpers.js +1 -1
  422. package/styles/controls.css +4 -2
  423. package/styles/layout.css +7 -0
  424. package/styles/shell.css +30 -6
  425. package/theme/phi-antd-token-resolver.d.ts +8 -0
  426. package/theme/phi-antd-token-resolver.js +10 -0
  427. package/theme/phi-theme-color.d.ts +19 -0
  428. package/theme/phi-theme-color.js +42 -0
  429. package/theme/phi-theme-composition.js +9 -0
  430. package/theme/phi-theme-gradients.js +4 -22
  431. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  432. package/theme/phi-theme-inverse-ground.js +103 -0
  433. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  434. package/theme/phi-theme-palette-defaults.js +103 -0
  435. package/theme/phi-theme-tokens.d.ts +2 -1
  436. package/theme/phi-theme-tokens.js +2 -0
  437. package/types/cms-module-descriptors.d.ts +14 -0
  438. package/types/cms-overlay.d.ts +13 -6
  439. package/types/cms-overlay.js +6 -22
  440. package/types/cms-plugins.d.ts +20 -3
  441. package/types/cms.d.ts +10 -0
  442. package/types/collection-provider.d.ts +27 -0
  443. package/types/collection-signal-values.d.ts +2 -0
  444. package/types/collection-signal-values.js +23 -0
  445. package/types/collection-view-widget.d.ts +9 -0
  446. package/types/core-widget-placements.d.ts +9 -3
  447. package/types/link-preview.d.ts +19 -0
  448. package/types/link-preview.js +19 -0
  449. package/types/record-provider.d.ts +22 -1
  450. package/types/signals.d.ts +2 -0
  451. package/types/signals.js +2 -0
  452. package/types/site-theme.d.ts +27 -0
  453. package/types/table-embed.d.ts +48 -0
  454. package/types/table-embed.js +1 -0
  455. package/types/table-widget.d.ts +29 -1
  456. package/types/table-widget.js +0 -282
  457. package/types/tree-widget.d.ts +0 -1
  458. package/types/tree-widget.js +0 -60
  459. package/types/widget-runtime.d.ts +3 -1
  460. package/types.d.ts +2 -1
  461. package/types.js +1 -1
  462. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -1,4 +1,6 @@
1
1
  import { formatPhisMoney } from "@phis/contracts/payments";
2
+ import { PHI_RECORD_MARKDOWN_KNOWN_FLAGS } from "../constants/record-field-kinds";
3
+ import { isPhiRuntimeModuleSourceLocale } from "../types/runtime-module-locale";
2
4
  import { formatPhiDate } from "./format-date-time";
3
5
  import { isPhiMinorAmount, readPhiCurrencyExponent } from "./money-amount";
4
6
  /*
@@ -43,6 +45,17 @@ function readLink(value) {
43
45
  return undefined;
44
46
  return typeof value.label === "string" && value.label ? { href, label: value.label } : { href };
45
47
  }
48
+ /** A text, the locale key it is written in, and flags of no other bits than `PhiRecordMarkdownFlag` names. */
49
+ function readMarkdown(value) {
50
+ if (!isRecord(value) || typeof value.text !== "string" || !isPhiRuntimeModuleSourceLocale(value.sourceLocale)) {
51
+ return undefined;
52
+ }
53
+ const { flags } = value;
54
+ if (typeof flags !== "number" || !Number.isInteger(flags) || flags < 0 || (flags & ~PHI_RECORD_MARKDOWN_KNOWN_FLAGS) !== 0) {
55
+ return undefined;
56
+ }
57
+ return { text: value.text, sourceLocale: value.sourceLocale.trim(), flags };
58
+ }
46
59
  /** The contract's money exactly: a currency a payment accepts and `minor` as an integer string. */
47
60
  function readMoney(value) {
48
61
  if (!isRecord(value) || typeof value.currency !== "string" || readPhiCurrencyExponent(value.currency) === undefined) {
@@ -59,8 +72,9 @@ function readAll(value, read) {
59
72
  export function readPhiRecordFieldValue(kind, value) {
60
73
  switch (kind) {
61
74
  case "text":
62
- case "markdown":
63
75
  return typeof value === "string" ? value : undefined;
76
+ case "markdown":
77
+ return readMarkdown(value);
64
78
  case "picture":
65
79
  return readPicture(value);
66
80
  case "pictures":
@@ -79,11 +93,6 @@ export function readPhiRecordFieldValue(kind, value) {
79
93
  return readLink(value);
80
94
  }
81
95
  }
82
- /**
83
- * The kinds a line of text can show: a text as it is, a number, a date and an amount of money in the
84
- * page's language.
85
- */
86
- export const PHI_RECORD_TEXT_FIELD_KINDS = ["text", "number", "date", "money"];
87
96
  /**
88
97
  * A text, number, date or money field as the words a page shows, written for `locale`; a date on the
89
98
  * calendar of the Site's `timeZone`, as every other date the page shows (`formatPhiDate`).
@@ -0,0 +1,10 @@
1
+ import type { PhiRecordWidgetConfig } from "../types/record-widget";
2
+ import type { PhiTableProviderResourceDescriptor } from "../types/table-widget";
3
+ /**
4
+ * What the record Widget's actions ask of its resource, as findings --
5
+ * the Table's binding check (`validatePhiTableWidgetBinding`) for the one scope a record has. Each action
6
+ * is the resource's, of scope `row`, named once, and drawn as the danger a destructive one is. A
7
+ * confirmation the resource requires is not asked for here: the record on screen, named in the dialog's
8
+ * title, and the press beside it are that confirmation, and a `confirm` would ask a second time.
9
+ */
10
+ export declare function validatePhiRecordWidgetBinding(config: Partial<Pick<PhiRecordWidgetConfig, "actions">>, resource: Pick<PhiTableProviderResourceDescriptor, "resourceKey" | "actions">): string[];
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Checked where a config is made, as the Table's binding is (`helpers/table-widget-binding.ts`): a
3
+ * package's preset tests (`checkPhiPresetTables`), `pnpm verify` and the Builder's save, never in the
4
+ * browser, so the record Widget's live Client trusts its actions.
5
+ */
6
+ /**
7
+ * What the record Widget's actions ask of its resource, as findings --
8
+ * the Table's binding check (`validatePhiTableWidgetBinding`) for the one scope a record has. Each action
9
+ * is the resource's, of scope `row`, named once, and drawn as the danger a destructive one is. A
10
+ * confirmation the resource requires is not asked for here: the record on screen, named in the dialog's
11
+ * title, and the press beside it are that confirmation, and a `confirm` would ask a second time.
12
+ */
13
+ export function validatePhiRecordWidgetBinding(config, resource) {
14
+ const errors = [];
15
+ const declared = new Map(resource.actions?.map((action) => [action.key, action]) ?? []);
16
+ const seen = new Set();
17
+ for (const action of config.actions ?? []) {
18
+ if (seen.has(action.key)) {
19
+ errors.push(`Record action "${action.key}" is configured more than once.`);
20
+ continue;
21
+ }
22
+ seen.add(action.key);
23
+ const capability = declared.get(action.key);
24
+ if (!capability) {
25
+ errors.push(`Record action "${action.key}" is not declared by resource "${resource.resourceKey}".`);
26
+ }
27
+ else if (capability.scope !== "row") {
28
+ errors.push(`Record action "${action.key}" cannot run on a record: its scope is "${capability.scope}".`);
29
+ }
30
+ else if (capability.intent === "destructive" && action.mode !== "danger") {
31
+ errors.push(`Destructive Record action "${action.key}" requires danger presentation.`);
32
+ }
33
+ }
34
+ return errors;
35
+ }
@@ -1,15 +1,6 @@
1
- import type { PhiRecordWidgetConfig, PhiRecordWidgetTitleFromRecord } from "../types/record-widget";
2
- import type { PhiTableProviderResourceDescriptor } from "../types/table-widget";
1
+ import type { PhiRecordWidgetTitleFromRecord } from "../types/record-widget";
3
2
  /**
4
3
  * The placement's `titleFromRecord`, or null where it states none. Strict, as the Form's: no field, or a
5
4
  * sentence without exactly one `%1`, is refused rather than read as no title.
6
5
  */
7
6
  export declare function readPhiRecordWidgetTitleFromRecord(value: unknown): PhiRecordWidgetTitleFromRecord | null;
8
- /**
9
- * What the record Widget's actions ask of its resource, as the errors it shows instead of the record --
10
- * the Table's binding check (`validatePhiTableWidgetBinding`) for the one scope a record has. Each action
11
- * is the resource's, of scope `row`, named once, and drawn as the danger a destructive one is. A
12
- * confirmation the resource requires is not asked for here: the record on screen, named in the dialog's
13
- * title, and the press beside it are that confirmation, and a `confirm` would ask a second time.
14
- */
15
- export declare function validatePhiRecordWidgetBinding(config: Pick<PhiRecordWidgetConfig, "actions">, resource: Pick<PhiTableProviderResourceDescriptor, "resourceKey" | "actions">): string[];
@@ -1,9 +1,10 @@
1
1
  import { isPhiRecord } from "./is-record";
2
2
  import { checkPhiRecordTitleTemplate } from "./record-title";
3
3
  /*
4
- * The record Widget's two readers that the descriptor compiler and the Widget share: its title from the
5
- * record and its actions against the resource (TABLES.md, "The record Widget"). Apart from
6
- * `types/record-widget.ts`, so the type stays a type for everything that only names it.
4
+ * The record Widget's reader that the descriptor compiler and the Widget share: its title from the
5
+ * record (TABLES.md, "The record Widget"). Apart from `types/record-widget.ts`, so the type stays a type
6
+ * for everything that only names it. Its actions against the resource are checked where a config is
7
+ * made (`helpers/record-widget-binding.ts`), not here.
7
8
  */
8
9
  /**
9
10
  * The placement's `titleFromRecord`, or null where it states none. Strict, as the Form's: no field, or a
@@ -25,33 +26,3 @@ export function readPhiRecordWidgetTitleFromRecord(value) {
25
26
  throw new Error(`Record titleFromRecord.template ${templateError}`);
26
27
  return { template, field };
27
28
  }
28
- /**
29
- * What the record Widget's actions ask of its resource, as the errors it shows instead of the record --
30
- * the Table's binding check (`validatePhiTableWidgetBinding`) for the one scope a record has. Each action
31
- * is the resource's, of scope `row`, named once, and drawn as the danger a destructive one is. A
32
- * confirmation the resource requires is not asked for here: the record on screen, named in the dialog's
33
- * title, and the press beside it are that confirmation, and a `confirm` would ask a second time.
34
- */
35
- export function validatePhiRecordWidgetBinding(config, resource) {
36
- const errors = [];
37
- const declared = new Map(resource.actions?.map((action) => [action.key, action]) ?? []);
38
- const seen = new Set();
39
- for (const action of config.actions) {
40
- if (seen.has(action.key)) {
41
- errors.push(`Record action "${action.key}" is configured more than once.`);
42
- continue;
43
- }
44
- seen.add(action.key);
45
- const capability = declared.get(action.key);
46
- if (!capability) {
47
- errors.push(`Record action "${action.key}" is not declared by resource "${resource.resourceKey}".`);
48
- }
49
- else if (capability.scope !== "row") {
50
- errors.push(`Record action "${action.key}" cannot run on a record: its scope is "${capability.scope}".`);
51
- }
52
- else if (capability.intent === "destructive" && action.mode !== "danger") {
53
- errors.push(`Destructive Record action "${action.key}" requires danger presentation.`);
54
- }
55
- }
56
- return errors;
57
- }
@@ -17,8 +17,12 @@ import type { PhiCmsAreaKey } from "../constants/cms-areas";
17
17
  * Compared by segment, a parameter by its name like any other segment: `/shop/:slug` and `/shop/cart`
18
18
  * are siblings. `/` is the Area's root slot and no folder.
19
19
  *
20
- * Verify-time only, from `@phis/ui/module/page-check`: a package runs it over its own routes, and
21
- * phis-ui over the first-party ones. The Site's own Pages are refused by phis-server when written.
20
+ * From `@phis/ui/module/page-check`: a package runs it over its own routes, and phis-ui over the
21
+ * first-party ones. `refusePhiCatalogRouteAddresses` is the same rule over a compiled catalog, every
22
+ * installed package's routes together: the descriptor compiler refuses a catalog that breaks it, so an
23
+ * installed package that does is refused. The addresses a Site assigns on
24
+ * Public are held to it in the Builder (`findPhiPublicRoutePathCollisions`). The Site's own Pages are
25
+ * refused by phis-server when written.
22
26
  */
23
27
  export type PhiRouteAddressSubject = {
24
28
  area: PhiCmsAreaKey;
@@ -32,4 +36,20 @@ export type PhiRouteAddressFinding = {
32
36
  above: string;
33
37
  message: string;
34
38
  };
39
+ /**
40
+ * Whether `lowerPath` lies beneath `upperPath` so that the upper one would be a Page and a folder at once:
41
+ * by segment, `/` never above anything, a list's entries -- one parameter directly beneath -- excepted.
42
+ */
43
+ export declare function isPhiRouteAddressBeneath(upperPath: string, lowerPath: string): boolean;
35
44
  export declare function checkPhiRouteAddresses(routes: readonly PhiRouteAddressSubject[]): PhiRouteAddressFinding[];
45
+ /** Every route of a compiled catalog as the rule reads it, Area by Area. */
46
+ export declare function listPhiCatalogRouteAddressSubjects(routesByArea: ReadonlyMap<PhiCmsAreaKey, readonly {
47
+ descriptor: PhiRouteAddressSubject;
48
+ }[]>): PhiRouteAddressSubject[];
49
+ /**
50
+ * The rule over a compiled catalog, as compiling it would refuse it: throws naming every route that lies
51
+ * beneath another of its Area, whichever packages the two come from.
52
+ */
53
+ export declare function refusePhiCatalogRouteAddresses(routesByArea: ReadonlyMap<PhiCmsAreaKey, readonly {
54
+ descriptor: PhiRouteAddressSubject;
55
+ }[]>): void;
@@ -1,20 +1,27 @@
1
1
  function segments(path) {
2
2
  return path.split("/").filter(Boolean);
3
3
  }
4
+ /**
5
+ * Whether `lowerPath` lies beneath `upperPath` so that the upper one would be a Page and a folder at once:
6
+ * by segment, `/` never above anything, a list's entries -- one parameter directly beneath -- excepted.
7
+ */
8
+ export function isPhiRouteAddressBeneath(upperPath, lowerPath) {
9
+ const upper = segments(upperPath);
10
+ const own = segments(lowerPath);
11
+ if (upper.length === 0 || upper.length >= own.length)
12
+ return false;
13
+ if (!upper.every((segment, index) => segment === own[index]))
14
+ return false;
15
+ // A list's entries, one parameter directly beneath it.
16
+ return !(own.length === upper.length + 1 && own[own.length - 1].startsWith(":"));
17
+ }
4
18
  export function checkPhiRouteAddresses(routes) {
5
19
  const findings = [];
6
20
  for (const route of routes) {
7
- const own = segments(route.path);
8
21
  for (const other of routes) {
9
22
  if (other === route || other.area !== route.area)
10
23
  continue;
11
- const upper = segments(other.path);
12
- if (upper.length === 0 || upper.length >= own.length)
13
- continue;
14
- if (!upper.every((segment, index) => segment === own[index]))
15
- continue;
16
- // A list's entries, one parameter directly beneath it.
17
- if (own.length === upper.length + 1 && own[own.length - 1].startsWith(":"))
24
+ if (!isPhiRouteAddressBeneath(other.path, route.path))
18
25
  continue;
19
26
  findings.push({
20
27
  route: route.presetKey,
@@ -26,3 +33,17 @@ export function checkPhiRouteAddresses(routes) {
26
33
  }
27
34
  return findings;
28
35
  }
36
+ /** Every route of a compiled catalog as the rule reads it, Area by Area. */
37
+ export function listPhiCatalogRouteAddressSubjects(routesByArea) {
38
+ return [...routesByArea.values()].flatMap((routes) => routes.map(({ descriptor }) => ({ area: descriptor.area, path: descriptor.path, presetKey: descriptor.presetKey })));
39
+ }
40
+ /**
41
+ * The rule over a compiled catalog, as compiling it would refuse it: throws naming every route that lies
42
+ * beneath another of its Area, whichever packages the two come from.
43
+ */
44
+ export function refusePhiCatalogRouteAddresses(routesByArea) {
45
+ const findings = checkPhiRouteAddresses(listPhiCatalogRouteAddressSubjects(routesByArea));
46
+ if (findings.length > 0) {
47
+ throw new Error(`Module routes break the address rule:\n- ${findings.map((finding) => finding.message).join("\n- ")}`);
48
+ }
49
+ }
@@ -0,0 +1,23 @@
1
+ /** The parts of an address a person writes (`PhisSiteAddressInput`), in the order a form asks them. */
2
+ export declare const PHI_SITE_ADDRESS_TEXT_KEYS: readonly ["companyName", "name", "line1", "line2", "postalCode", "city", "region", "country"];
3
+ /**
4
+ * One address of a Site's book (`PhisSiteAddress`) as a Table and an edit Form read it: its parts, one by
5
+ * one and as the `address` field's value, the flags as four marks, as tags and as the number, and the parts
6
+ * after the name on one line. Only the purposes and
7
+ * defaults are read off the flags; Core lists no `Superseded` or `Removed` address to an account or a
8
+ * customer file. Shared by the account's own addresses and staff's customer file.
9
+ */
10
+ export declare function toPhiSiteAddressRow(address: Record<string, unknown>): {
11
+ createdAt: {} | null;
12
+ flags: number;
13
+ billing: boolean;
14
+ shipping: boolean;
15
+ defaultBilling: boolean;
16
+ defaultShipping: boolean;
17
+ address: {
18
+ [k: string]: string | null;
19
+ };
20
+ lines: string;
21
+ purposes: ("billing" | "shipping" | "defaultBilling" | "defaultShipping")[];
22
+ id: unknown;
23
+ };
@@ -0,0 +1,36 @@
1
+ import { PhisSiteAddressFlags } from "@phis/contracts/users";
2
+ /** The parts of an address a person writes (`PhisSiteAddressInput`), in the order a form asks them. */
3
+ export const PHI_SITE_ADDRESS_TEXT_KEYS = ["companyName", "name", "line1", "line2", "postalCode", "city", "region", "country"];
4
+ function text(value) {
5
+ return typeof value === "string" && value.trim() ? value.trim() : null;
6
+ }
7
+ /**
8
+ * One address of a Site's book (`PhisSiteAddress`) as a Table and an edit Form read it: its parts, one by
9
+ * one and as the `address` field's value, the flags as four marks, as tags and as the number, and the parts
10
+ * after the name on one line. Only the purposes and
11
+ * defaults are read off the flags; Core lists no `Superseded` or `Removed` address to an account or a
12
+ * customer file. Shared by the account's own addresses and staff's customer file.
13
+ */
14
+ export function toPhiSiteAddressRow(address) {
15
+ const flags = typeof address.flags === "number" ? address.flags : 0;
16
+ const has = (bit) => (flags & bit) !== 0;
17
+ const marks = {
18
+ billing: has(PhisSiteAddressFlags.Billing),
19
+ shipping: has(PhisSiteAddressFlags.Shipping),
20
+ defaultBilling: has(PhisSiteAddressFlags.DefaultBilling),
21
+ defaultShipping: has(PhisSiteAddressFlags.DefaultShipping),
22
+ };
23
+ const place = [text(address.postalCode), text(address.city)].filter(Boolean).join(" ");
24
+ return {
25
+ id: address.id,
26
+ ...Object.fromEntries(PHI_SITE_ADDRESS_TEXT_KEYS.map((key) => [key, text(address[key]) ?? ""])),
27
+ // The parts as one value, as the `address` Form field holds them: an edit Form opens on it.
28
+ address: Object.fromEntries(PHI_SITE_ADDRESS_TEXT_KEYS.map((key) => [key, text(address[key])])),
29
+ lines: [text(address.companyName), text(address.line1), text(address.line2), place || null, text(address.region), text(address.country)]
30
+ .filter(Boolean).join(", "),
31
+ purposes: Object.keys(marks).filter((key) => marks[key]),
32
+ ...marks,
33
+ createdAt: address.createdAt ?? null,
34
+ flags,
35
+ };
36
+ }
@@ -50,8 +50,15 @@ export type PhiSurfaceStyleOptions = {
50
50
  */
51
51
  groundLayer?: boolean;
52
52
  };
53
- /** The ground a toned Surface paints where it states none: the container ground of the tone's mode. */
53
+ /** The ground a `light` or `dark` Surface paints where it states none: the container ground of the tone's mode. */
54
54
  export declare const PHI_SURFACE_TONE_GROUND = "var(--phi-color-bg-container)";
55
+ /**
56
+ * The ground a toned Surface paints where it states none (`phiSurfaceTakesToneGround`): an `inverse` one
57
+ * stands on the Theme's Inverse Ground (THEME.md "Ground"), which is that mode's container ground unless
58
+ * the Theme states another; `light` and `dark` on their mode's container ground. Both resolve under the
59
+ * tone's class the box carries.
60
+ */
61
+ export declare function resolvePhiSurfaceToneGround(tone: PhiSurface["tone"] | null | undefined): string;
55
62
  /**
56
63
  * Whether a Surface takes its tone's ground (`PHI_SURFACE_TONE_GROUND`): it asks for a mode of its own and
57
64
  * its Background paints nothing. A stated ground wins, and the Theme's Overlay (`base.kind: "theme"`) is
@@ -1,11 +1,21 @@
1
1
  import { PHI_BACKGROUND_CONTAINER_GROUND, normalizePhiBackgroundWidgetConfig, phiBackgroundWidgetConfigPaintsGround, resolvePhiBackgroundGroundFilter, resolvePhiBackgroundMotion, resolvePhiBackgroundMotionHostStyle, resolvePhiBackgroundWidgetStyle, } from "../components/widgets/config/background";
2
+ import { PHI_INVERSE_GROUND } from "../theme/phi-theme-inverse-ground";
2
3
  import { resolvePhiCmsBorderSource } from "../types/cms-border-source";
3
4
  import { resolvePhiSurfaceToneClassName } from "../types/surface";
4
5
  import { resolvePhiSourcedBorderStyle } from "./border-widget-style";
5
6
  import { composePhiModePaint, resolvePhiModeValue } from "./mode-paint";
6
7
  import { combinePhiBoxShadows, resolvePhiShadow } from "./layout-style";
7
- /** The ground a toned Surface paints where it states none: the container ground of the tone's mode. */
8
+ /** The ground a `light` or `dark` Surface paints where it states none: the container ground of the tone's mode. */
8
9
  export const PHI_SURFACE_TONE_GROUND = PHI_BACKGROUND_CONTAINER_GROUND;
10
+ /**
11
+ * The ground a toned Surface paints where it states none (`phiSurfaceTakesToneGround`): an `inverse` one
12
+ * stands on the Theme's Inverse Ground (THEME.md "Ground"), which is that mode's container ground unless
13
+ * the Theme states another; `light` and `dark` on their mode's container ground. Both resolve under the
14
+ * tone's class the box carries.
15
+ */
16
+ export function resolvePhiSurfaceToneGround(tone) {
17
+ return tone === "inverse" ? PHI_INVERSE_GROUND : PHI_SURFACE_TONE_GROUND;
18
+ }
9
19
  /**
10
20
  * Whether a Surface takes its tone's ground (`PHI_SURFACE_TONE_GROUND`): it asks for a mode of its own and
11
21
  * its Background paints nothing. A stated ground wins, and the Theme's Overlay (`base.kind: "theme"`) is
@@ -93,7 +103,7 @@ export function resolvePhiSurfaceStyle(surface, options = {}) {
93
103
  return {
94
104
  style: {
95
105
  ...hostPaint,
96
- ...(toneGround ? { backgroundColor: PHI_SURFACE_TONE_GROUND } : {}),
106
+ ...(toneGround ? { backgroundColor: resolvePhiSurfaceToneGround(surface.tone) } : {}),
97
107
  ...(line == null ? {} : { border: line }),
98
108
  ...resolvePhiSurfaceCorners(options.cornerFallback, configuredCorners),
99
109
  ...(boxShadow == null ? {} : { boxShadow }),
@@ -0,0 +1,12 @@
1
+ import type { PhiTableProviderResourceDescriptor, PhiTableWidgetConfig } from "../types/table-widget";
2
+ /**
3
+ * A Table's config against the resource its Provider declares: columns, filters, sorting, the counted
4
+ * footer, every Provider action in its scope with the confirmation and danger the resource asks for
5
+ * (TABLES.md, "Checked where it is made").
6
+ *
7
+ * Checked where a config is made -- a package's preset tests (`checkPhiPresetTables`), `pnpm verify`, the
8
+ * Builder's save (`gateway/site-cms-write-validation.ts`) -- and never in the browser or the render of a
9
+ * request: a live Table trusts the config it is handed, and this file is kept out of every live Client
10
+ * graph for that reason.
11
+ */
12
+ export declare function validatePhiTableWidgetBinding(config: PhiTableWidgetConfig, resource: PhiTableProviderResourceDescriptor): string[];