@phis/ui 0.7.8 → 0.8.0

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 (311) hide show
  1. package/components/controls/phi-address-control.d.ts +23 -0
  2. package/components/controls/phi-address-control.js +43 -0
  3. package/components/controls/phi-color-control.d.ts +3 -1
  4. package/components/controls/phi-color-control.js +2 -2
  5. package/components/controls/phi-country-select-control.d.ts +22 -0
  6. package/components/controls/phi-country-select-control.js +16 -0
  7. package/components/controls/phi-dialog-control.d.ts +1 -1
  8. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  9. package/components/controls/phi-drawer-control-adapter.js +5 -3
  10. package/components/controls/phi-drawer-control.d.ts +7 -5
  11. package/components/controls/phi-float-button-control.d.ts +8 -1
  12. package/components/controls/phi-float-button-control.js +19 -3
  13. package/components/controls/phi-form-control.js +52 -8
  14. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  15. package/components/controls/phi-modal-control-adapter.js +14 -37
  16. package/components/controls/phi-modal-control.d.ts +5 -5
  17. package/components/controls/phi-options-provider.d.ts +1 -0
  18. package/components/controls/phi-options-provider.js +1 -0
  19. package/components/controls/phi-overlay-control-contract.d.ts +52 -17
  20. package/components/controls/phi-overlay-control-contract.js +55 -30
  21. package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
  22. package/components/controls/phi-reveal-once-dialog-control.js +52 -0
  23. package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
  24. package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
  25. package/components/forms/flags-field.d.ts +22 -0
  26. package/components/forms/flags-field.js +58 -0
  27. package/components/forms/form-option-flags.d.ts +20 -0
  28. package/components/forms/form-option-flags.js +38 -0
  29. package/components/forms/form-provider-contract.d.ts +23 -0
  30. package/components/forms/form-provider-contract.js +36 -0
  31. package/components/forms/form-provider-registry.d.ts +5 -1
  32. package/components/forms/shared-form-provider-registry.js +13 -0
  33. package/components/forms/structured-field-labels.d.ts +24 -0
  34. package/components/forms/structured-field-labels.js +43 -0
  35. package/components/forms/structured-form-field-controls.d.ts +12 -0
  36. package/components/forms/structured-form-field-controls.js +65 -0
  37. package/components/overlays/phi-overlay-container-client.js +2 -2
  38. package/components/regions/phi-cms-region-shell.js +2 -2
  39. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  40. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
  41. package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
  42. package/components/root/phi-root-theme-resolver.js +3 -0
  43. package/components/shell/phi-antd-icon.d.ts +1 -8
  44. package/components/shell/phi-antd-icon.js +1 -227
  45. package/components/shell/phi-icon-names.d.ts +19 -0
  46. package/components/shell/phi-icon-names.js +264 -0
  47. package/components/shell/phi-icon.d.ts +2 -11
  48. package/components/shell/phi-icon.js +4 -32
  49. package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
  50. package/components/widgets/client/shared/phi-command-buttons.js +10 -4
  51. package/components/widgets/client/shared/phi-rendered-value.js +27 -3
  52. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  53. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  54. package/components/widgets/config/background.d.ts +3 -2
  55. package/components/widgets/config/choice-shared.d.ts +10 -1
  56. package/components/widgets/config/choice-shared.js +8 -2
  57. package/components/widgets/label-sets/admin-locales.js +1 -1
  58. package/components/widgets/label-sets/admin-users.d.ts +2 -5
  59. package/components/widgets/label-sets/admin-users.js +4 -10
  60. package/components/widgets/label-sets/effects.js +2 -4
  61. package/components/widgets/label-sets/profile.d.ts +13 -0
  62. package/components/widgets/label-sets/profile.js +28 -0
  63. package/components/widgets/label-sets/search-results.js +2 -4
  64. package/components/widgets/label-sets/table.js +9 -0
  65. package/components/widgets/label-types/effects.d.ts +3 -2
  66. package/components/widgets/label-types/effects.js +1 -2
  67. package/components/widgets/label-types/search-results.d.ts +2 -2
  68. package/components/widgets/label-types/search-results.js +1 -2
  69. package/components/widgets/label-types/table.d.ts +3 -0
  70. package/components/widgets/label-types/table.js +2 -0
  71. package/components/widgets/server/builder-chrome.d.ts +4 -1
  72. package/components/widgets/server/builder-chrome.js +2 -2
  73. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  74. package/components/widgets/shared/markdown-body-client.js +31 -1
  75. package/components/widgets/shared/markdown-render.d.ts +10 -2
  76. package/components/widgets/shared/markdown-render.js +35 -13
  77. package/constants/countries.d.ts +9 -0
  78. package/constants/countries.js +28 -0
  79. package/constants/customer-file.d.ts +25 -0
  80. package/constants/customer-file.js +26 -0
  81. package/constants/record-field-kinds.d.ts +15 -0
  82. package/constants/record-field-kinds.js +13 -0
  83. package/constants/runtime-module-ownership.js +12 -0
  84. package/constants/runtime-render-client-types.d.ts +5 -0
  85. package/constants/runtime-render-client-types.js +5 -0
  86. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  87. package/constants.d.ts +1 -0
  88. package/constants.js +2 -0
  89. package/gateway/form-handler-request.d.ts +22 -0
  90. package/gateway/form-handler-request.js +40 -0
  91. package/gateway/label-set.d.ts +15 -2
  92. package/gateway/label-set.js +60 -22
  93. package/gateway/site-form-route.js +11 -2
  94. package/helpers/address-field.d.ts +43 -0
  95. package/helpers/address-field.js +68 -0
  96. package/helpers/cms-dialog.d.ts +5 -20
  97. package/helpers/cms-dialog.js +8 -13
  98. package/helpers/cms-page-catalog.d.ts +10 -0
  99. package/helpers/cms-page-catalog.js +19 -0
  100. package/helpers/cms-preset-nodes.d.ts +4 -4
  101. package/helpers/cms-preset-nodes.js +1 -1
  102. package/helpers/cms-region-keys.d.ts +1 -1
  103. package/helpers/country-names.d.ts +12 -0
  104. package/helpers/country-names.js +14 -0
  105. package/helpers/phi-metadata.d.ts +33 -1
  106. package/helpers/phi-metadata.js +62 -1
  107. package/helpers/preset-table-check.d.ts +34 -0
  108. package/helpers/preset-table-check.js +124 -0
  109. package/helpers/preset-text-source-check.d.ts +4 -1
  110. package/helpers/preset-text-source-check.js +6 -1
  111. package/helpers/preset-tree-contract-check.d.ts +3 -2
  112. package/helpers/preset-tree-contract-check.js +30 -5
  113. package/helpers/public-route-claims.d.ts +9 -1
  114. package/helpers/public-route-claims.js +23 -3
  115. package/helpers/record-fields.d.ts +1 -5
  116. package/helpers/record-fields.js +15 -6
  117. package/helpers/route-address-check.d.ts +22 -2
  118. package/helpers/route-address-check.js +29 -8
  119. package/helpers/site-address-row.d.ts +23 -0
  120. package/helpers/site-address-row.js +36 -0
  121. package/helpers/surface-style.d.ts +8 -1
  122. package/helpers/surface-style.js +12 -2
  123. package/helpers/thread-inbox-row.d.ts +20 -0
  124. package/helpers/thread-inbox-row.js +26 -0
  125. package/helpers/translation-format.d.ts +26 -0
  126. package/helpers/translation-format.js +31 -0
  127. package/module-labels.d.ts +1 -1
  128. package/module-labels.js +1 -1
  129. package/module-page-check.d.ts +1 -0
  130. package/module-page-check.js +1 -0
  131. package/module-records.d.ts +2 -2
  132. package/module-records.js +1 -0
  133. package/next/area-route.js +34 -1
  134. package/next/root-route.js +4 -5
  135. package/package.json +2 -2
  136. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  137. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  138. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  139. package/plugins/runtime-modules/accounting/ids.d.ts +11 -0
  140. package/plugins/runtime-modules/accounting/ids.js +23 -0
  141. package/plugins/runtime-modules/accounting/presets.js +32 -5
  142. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
  143. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -0
  144. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  145. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +26 -0
  146. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -0
  147. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  148. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  149. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  150. package/plugins/runtime-modules/app/data-providers.d.ts +98 -0
  151. package/plugins/runtime-modules/app/data-providers.js +80 -0
  152. package/plugins/runtime-modules/app/definition.d.ts +131 -0
  153. package/plugins/runtime-modules/app/definition.js +2 -0
  154. package/plugins/runtime-modules/app/forms.d.ts +46 -1
  155. package/plugins/runtime-modules/app/forms.js +195 -1
  156. package/plugins/runtime-modules/app/ids.d.ts +7 -0
  157. package/plugins/runtime-modules/app/ids.js +8 -0
  158. package/plugins/runtime-modules/app/module.d.ts +131 -0
  159. package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
  160. package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
  161. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
  162. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
  163. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
  164. package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
  165. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
  166. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
  167. package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
  168. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  169. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  170. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  171. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  172. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  173. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  174. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  175. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  176. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  177. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  178. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  179. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
  180. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  181. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  182. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  183. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  184. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  185. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  186. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
  187. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  188. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  189. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  190. package/plugins/runtime-modules/builder/persistence.js +4 -0
  191. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  192. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
  193. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
  194. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  195. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  196. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  197. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  198. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  199. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  200. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  201. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  202. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  203. package/plugins/runtime-modules/contracts.js +31 -1
  204. package/plugins/runtime-modules/core/definition.d.ts +23 -0
  205. package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
  206. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  207. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  208. package/plugins/runtime-modules/core/widgets/card/config.d.ts +0 -1
  209. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  210. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  211. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  212. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  213. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  214. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  215. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  216. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  217. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  218. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  219. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  220. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  221. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  222. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  223. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  224. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  225. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  226. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  227. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  228. package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
  229. package/plugins/runtime-modules/core/widgets/table/config.js +6 -0
  230. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  231. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  232. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  233. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  234. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  235. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  236. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  237. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  238. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  239. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  240. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  241. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -2
  242. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  243. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  244. package/plugins/runtime-modules/resolver.js +17 -0
  245. package/plugins/runtime-modules/revisions/controller/client.js +13 -11
  246. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  247. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  248. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  249. package/plugins/runtime-modules/revisions/services/table.js +13 -4
  250. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
  251. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  252. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  253. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
  254. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  255. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  256. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  257. package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
  258. package/plugins/runtime-modules/threads/controller/definition.js +1 -1
  259. package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
  260. package/plugins/runtime-modules/threads/data-providers.js +85 -0
  261. package/plugins/runtime-modules/threads/definition.d.ts +115 -2
  262. package/plugins/runtime-modules/threads/definition.js +1 -1
  263. package/plugins/runtime-modules/threads/ids.d.ts +2 -0
  264. package/plugins/runtime-modules/threads/ids.js +3 -0
  265. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
  266. package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -0
  267. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  268. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  269. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  270. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  271. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  272. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  273. package/plugins/runtime-modules/user-management/ids.js +9 -0
  274. package/plugins/runtime-modules/user-management/presets.js +17 -1
  275. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  276. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  277. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +86 -0
  278. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -0
  279. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  280. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +166 -0
  281. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -18
  282. package/server-helpers/cms-page-record.d.ts +9 -1
  283. package/server-helpers/cms-page-record.js +11 -1
  284. package/server-helpers/cms-request.js +8 -5
  285. package/server-helpers/link-preview-image.d.ts +30 -0
  286. package/server-helpers/link-preview-image.js +57 -0
  287. package/server-helpers/search-text.js +3 -0
  288. package/server-helpers.d.ts +1 -1
  289. package/server-helpers.js +1 -1
  290. package/styles/shell.css +30 -6
  291. package/theme/phi-theme-composition.js +9 -0
  292. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  293. package/theme/phi-theme-inverse-ground.js +103 -0
  294. package/theme/phi-theme-tokens.d.ts +2 -1
  295. package/theme/phi-theme-tokens.js +2 -0
  296. package/types/cms-module-descriptors.d.ts +14 -0
  297. package/types/cms-overlay.d.ts +13 -6
  298. package/types/cms-overlay.js +6 -22
  299. package/types/cms-plugins.d.ts +14 -2
  300. package/types/cms.d.ts +10 -0
  301. package/types/core-widget-placements.d.ts +3 -3
  302. package/types/link-preview.d.ts +19 -0
  303. package/types/link-preview.js +19 -0
  304. package/types/record-provider.d.ts +22 -1
  305. package/types/site-theme.d.ts +27 -0
  306. package/types/table-embed.d.ts +48 -0
  307. package/types/table-embed.js +1 -0
  308. package/types/table-widget.d.ts +14 -0
  309. package/types/widget-runtime.d.ts +3 -0
  310. package/types.d.ts +1 -0
  311. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -0,0 +1,108 @@
1
+ import "server-only";
2
+ import { PHI_TR_CTX_WEB_UI_LABEL } from "../../../../gateway/tr";
3
+ import { definePhiMessageLabel, definePhiRuntimeModuleLabelSet, getPhiLabelSet } from "../../../../gateway/label-set";
4
+ import { PHI_APP_RUNTIME_MODULE_IDENTITY } from "../ids";
5
+ /**
6
+ * What the account's addresses say: the panel, the Table's columns and acts, and the two dialogs that add
7
+ * an address and change one. One set for all of it, because the Forms and the Table name the same parts.
8
+ */
9
+ const PHI_APP_ADDRESSES_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_APP_RUNTIME_MODULE_IDENTITY, {
10
+ key: "preset:account-addresses",
11
+ ctx: PHI_TR_CTX_WEB_UI_LABEL,
12
+ labels: {
13
+ panel_title: "Addresses",
14
+ panel_description: definePhiMessageLabel("Where invoices are made out to and orders are sent on this site."),
15
+ table_label: "addresses",
16
+ column_name: "Name",
17
+ column_address: "Address",
18
+ column_purposes: "Used for",
19
+ purpose_billing: "Billing",
20
+ purpose_shipping: "Shipping",
21
+ purpose_default_billing: "Default billing",
22
+ purpose_default_shipping: "Default shipping",
23
+ empty_title: definePhiMessageLabel("No address yet."),
24
+ empty_text: definePhiMessageLabel("Add one for invoices or deliveries; it is kept for this site only."),
25
+ action_add: "Add address",
26
+ action_edit: "Change",
27
+ action_default_billing: "Use for billing by default",
28
+ action_default_shipping: "Use for shipping by default",
29
+ action_remove: "Remove",
30
+ remove_title: "Remove this address?",
31
+ remove_text: definePhiMessageLabel("It is gone from your account. An order or invoice made out to it keeps it."),
32
+ confirm_ok: "Remove",
33
+ cancel: "Cancel",
34
+ save: "Save",
35
+ add_title: "Add address",
36
+ edit_title: "Change address",
37
+ field_name: "Name",
38
+ field_name_required: "Enter the name the address is made out to.",
39
+ field_company: "Company",
40
+ field_line1: "Street and number",
41
+ field_line1_required: "Enter the street and number.",
42
+ field_line2: "Address line 2",
43
+ field_postal_code: "Postal code",
44
+ field_city: "City",
45
+ field_city_required: "Enter the city.",
46
+ field_region: "Region",
47
+ field_country: "Country",
48
+ field_country_required: "Choose the country.",
49
+ field_too_long: definePhiMessageLabel("%1 takes at most %2 characters."),
50
+ field_purposes: "Used for",
51
+ field_billing: "Billing address",
52
+ field_shipping: "Shipping address",
53
+ field_default_billing: "Default for billing",
54
+ field_default_shipping: "Default for shipping",
55
+ success_title: "Address saved",
56
+ success_text: definePhiMessageLabel("Your address has been saved."),
57
+ },
58
+ });
59
+ export async function getPhiAppAddressesLabels(options) {
60
+ const labels = await getPhiLabelSet(options, PHI_APP_ADDRESSES_LABEL_SET);
61
+ return {
62
+ panel: { title: labels.panel_title, description: labels.panel_description },
63
+ tableLabel: labels.table_label,
64
+ columns: { name: labels.column_name, address: labels.column_address, purposes: labels.column_purposes },
65
+ purposes: {
66
+ billing: labels.purpose_billing,
67
+ shipping: labels.purpose_shipping,
68
+ defaultBilling: labels.purpose_default_billing,
69
+ defaultShipping: labels.purpose_default_shipping,
70
+ },
71
+ empty: { title: labels.empty_title, text: labels.empty_text },
72
+ actions: {
73
+ add: labels.action_add,
74
+ edit: labels.action_edit,
75
+ defaultBilling: labels.action_default_billing,
76
+ defaultShipping: labels.action_default_shipping,
77
+ remove: labels.action_remove,
78
+ },
79
+ remove: { title: labels.remove_title, text: labels.remove_text, ok: labels.confirm_ok },
80
+ cancel: labels.cancel,
81
+ save: labels.save,
82
+ addTitle: labels.add_title,
83
+ editTitle: labels.edit_title,
84
+ // The address field's words under its own keys (PHI_FORM_ADDRESS_LABEL_KEYS), the purposes' beside them.
85
+ form: {
86
+ addressName: labels.field_name,
87
+ addressNameRequired: labels.field_name_required,
88
+ addressCompanyName: labels.field_company,
89
+ addressLine1: labels.field_line1,
90
+ addressLine1Required: labels.field_line1_required,
91
+ addressLine2: labels.field_line2,
92
+ addressPostalCode: labels.field_postal_code,
93
+ addressCity: labels.field_city,
94
+ addressCityRequired: labels.field_city_required,
95
+ addressRegion: labels.field_region,
96
+ addressCountry: labels.field_country,
97
+ addressCountryRequired: labels.field_country_required,
98
+ addressTooLong: labels.field_too_long,
99
+ purposes: labels.field_purposes,
100
+ billing: labels.field_billing,
101
+ shipping: labels.field_shipping,
102
+ defaultBilling: labels.field_default_billing,
103
+ defaultShipping: labels.field_default_shipping,
104
+ successTitle: labels.success_title,
105
+ successText: labels.success_text,
106
+ },
107
+ };
108
+ }
@@ -2,11 +2,14 @@ import { PHI_APP_RUNTIME_MODULE_ID } from "../ids";
2
2
  import { PHI_APP_FORM_IDS } from "../forms";
3
3
  import { buildPhiSettingsPageShellTree } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
4
4
  import { getPhiProfilePageLabels } from "./profile-label-set";
5
+ import { getPhiAppAddressesLabels } from "./addresses-label-set";
6
+ import { buildPhiAccountAddressesPanel } from "./account-addresses-panel";
5
7
  import { getPhiProfileLocaleWidgetLabels, getPhiProfileThemeWidgetLabels, } from "../../../../components/widgets/label-sets/profile";
6
8
  import { PHI_SITE_LOCALES_CONFIG_KEY } from "../../../../components/forms/site-locales-config";
7
9
  import { createPhiCoreRuntimeControllerAddress } from "../../../../components/runtime/core-runtime-controller-address";
8
10
  import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
9
11
  const REGION_CONTENT_ID = -286;
12
+ const PROFILE_PRESET_KEY = "app-profile-page";
10
13
  /**
11
14
  * What the account says about itself, as Settings panels rather than as a page of Widgets.
12
15
  *
@@ -25,11 +28,13 @@ const REGION_CONTENT_ID = -286;
25
28
  */
26
29
  export async function buildPhiDefaultAppProfilePageTree({ page, runtime, }) {
27
30
  const labelOptions = buildPhiWidgetLabelTranslatorOptions(runtime);
28
- const [labels, localeLabels, themeLabels] = await Promise.all([
31
+ const [labels, localeLabels, themeLabels, addressLabels] = await Promise.all([
29
32
  getPhiProfilePageLabels(labelOptions),
30
33
  getPhiProfileLocaleWidgetLabels(labelOptions),
31
34
  getPhiProfileThemeWidgetLabels(labelOptions),
35
+ getPhiAppAddressesLabels(labelOptions),
32
36
  ]);
37
+ const addresses = buildPhiAccountAddressesPanel(addressLabels, PROFILE_PRESET_KEY);
33
38
  const availableLocales = runtime.site.availableLocales.map((option) => ({ code: option.code, label: option.label }));
34
39
  /*
35
40
  * What the account reads in today: its own preference where it has one, and otherwise the language
@@ -39,7 +44,7 @@ export async function buildPhiDefaultAppProfilePageTree({ page, runtime, }) {
39
44
  const tree = buildPhiSettingsPageShellTree({
40
45
  page,
41
46
  ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
42
- presetKey: "app-profile-page",
47
+ presetKey: PROFILE_PRESET_KEY,
43
48
  regionId: REGION_CONTENT_ID,
44
49
  label: labels.page,
45
50
  panels: [
@@ -62,8 +67,27 @@ export async function buildPhiDefaultAppProfilePageTree({ page, runtime, }) {
62
67
  displayName: runtime.viewer.profile?.displayName ?? "",
63
68
  companyName: runtime.viewer.profile?.companyName ?? "",
64
69
  },
70
+ }, {
71
+ /*
72
+ * The numbers beside the name, as their own Form because Core writes them on their own route.
73
+ * Both start as strings, never absent: the route takes both at once, and an empty one is
74
+ * cleared rather than left out.
75
+ */
76
+ kind: "form",
77
+ nodeKey: "widgetPhone",
78
+ formId: PHI_APP_FORM_IDS.profilePhone,
79
+ label: labels.phone,
80
+ initialValues: {
81
+ phone: runtime.viewer.profile?.phone ?? "",
82
+ mobile: runtime.viewer.profile?.mobile ?? "",
83
+ },
65
84
  }],
66
85
  },
86
+ /*
87
+ * The account's addresses on this Site, after the name and numbers they are made out to: the
88
+ * address book is the Site's, so another Site lists its own.
89
+ */
90
+ addresses.panel,
67
91
  {
68
92
  nodeKey: "panelLanguage",
69
93
  title: labels.language,
@@ -161,6 +185,7 @@ export async function buildPhiDefaultAppProfilePageTree({ page, runtime, }) {
161
185
  }],
162
186
  },
163
187
  ],
188
+ overlays: addresses.overlays,
164
189
  });
165
190
  return {
166
191
  ...tree,
@@ -3,6 +3,7 @@ import { type PhiGlobalTranslatorOptions } from "../../../../gateway/tr";
3
3
  export declare function getPhiProfilePageLabels(options: PhiGlobalTranslatorOptions): Promise<{
4
4
  page: string;
5
5
  name: string;
6
+ phone: string;
6
7
  language: string;
7
8
  appearance: string;
8
9
  subscriptions: string;
@@ -8,6 +8,8 @@ const PHI_PROFILE_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_APP_RUNTIM
8
8
  labels: {
9
9
  page: "Profile",
10
10
  name: "Name",
11
+ /** The authoring name of the Form beside the name that holds the two telephone numbers. */
12
+ phone: "Telephone numbers",
11
13
  language: "Language",
12
14
  appearance: "Appearance",
13
15
  /*
@@ -32,6 +34,7 @@ export async function getPhiProfilePageLabels(options) {
32
34
  return {
33
35
  page: labels.page,
34
36
  name: labels.name,
37
+ phone: labels.phone,
35
38
  language: labels.language,
36
39
  appearance: labels.appearance,
37
40
  subscriptions: labels.subscriptions,
@@ -45,6 +45,10 @@ export declare const PHI_ASSET_RUNTIME_MODULE_ROUTES: (PhiCmsRoutePresetDescript
45
45
  path: string;
46
46
  landingPage?: true;
47
47
  title: string;
48
+ description?: string;
49
+ shareImage?: {
50
+ asset: string;
51
+ };
48
52
  defaultPageFlags?: number;
49
53
  loadTree: (context: import("../../../types").PhiCmsDescriptorBuildContext & {
50
54
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
@@ -133,7 +133,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
133
133
  config: {
134
134
  title: assetLabels.inspector.inspectorTitle ?? "Asset inspector",
135
135
  placement: "right",
136
- size: 377,
136
+ size: { width: 377 },
137
137
  mountPolicy: "lazy-keep",
138
138
  // A clear pane: the Canvas shows through, frosted.
139
139
  surface: { background: { base: { kind: "color", color: "transparent" }, filter: "glass" } },
@@ -212,7 +212,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
212
212
  config: {
213
213
  title: assetLabels.editor.createFolderTitle ?? "Create folder",
214
214
  controlSize: "medium",
215
- width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
215
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
216
216
  flags: PhiCmsFlags.Centered,
217
217
  mountPolicy: "remount",
218
218
  closeMode: "immediate",
@@ -397,6 +397,8 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
397
397
  id: PHI_ASSET_MEDIA_PAGE_WIDGET_IDS.widgetMediaPreview,
398
398
  parentLayoutNodeId: PHI_ASSET_MEDIA_PAGE_LAYOUT_IDS.layoutContent,
399
399
  slotIndex: 0,
400
+ // The Media label set's words, translated already.
401
+ flags: PhiCmsFlags.NoTranslate,
400
402
  label: "dev media preview",
401
403
  config: {
402
404
  presentation: {
@@ -67,9 +67,11 @@ export async function buildPhiAuthAreaLoginOverlayTree({ page, runtime, area, })
67
67
  * A login asks for two short lines and is not a page. The width has a floor rather than a
68
68
  * preference, though: the form inside decides its own columns from its own measured width, and
69
69
  * under 360px it puts every label back above its input. What is left over for chrome is about
70
- * a dozen pixels, so 400 keeps the two columns with room to spare.
70
+ * a dozen pixels, so 400 keeps the two columns with room to spare -- the floor is `minSize`,
71
+ * and the Modal still gives way to a phone narrower than it (OVERLAYS.md, "Presentation config").
71
72
  */
72
- width: { compact: "calc(100vw - 32px)", medium: 400, wide: 420 },
73
+ size: { width: 420 },
74
+ minSize: { width: 400 },
73
75
  mountPolicy: "lazy-keep",
74
76
  closeMode: "request",
75
77
  signalRoutes: {
@@ -273,7 +273,7 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
273
273
  title: labels.installations.createTitle,
274
274
  openActionKey: "create",
275
275
  formId: PHI_AUTH_ADMIN_SETTINGS_FORM_IDS.installationCreate,
276
- width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
276
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
277
277
  label: labels.installations.createTitle,
278
278
  submitLabel: labels.submitLabel,
279
279
  cancelLabel: labels.installations.confirmCancel,
@@ -298,7 +298,7 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
298
298
  title: labels.installations.editTitle,
299
299
  openActionKey: "edit",
300
300
  formId: PHI_AUTH_ADMIN_SETTINGS_FORM_IDS.installationEdit,
301
- width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
301
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
302
302
  label: labels.installations.editTitle,
303
303
  submitLabel: labels.submitLabel,
304
304
  cancelLabel: labels.installations.confirmCancel,
@@ -1,6 +1,6 @@
1
1
  import type { PhiBlockRuntime, PhiClientBlockBaseProps } from "../../../../../types";
2
2
  import type { PhiAuthLogoutWidgetLabels } from "../../../../../components/widgets/label-types/logout";
3
- export declare function PhiAuthLogoutWidgetClient({ runtime, labels, }: PhiClientBlockBaseProps<PhiAuthLogoutWidgetLabels, {
3
+ export declare function PhiAuthLogoutWidgetClient({ runtime, labels, config, }: PhiClientBlockBaseProps<PhiAuthLogoutWidgetLabels, {
4
4
  padding?: number | string;
5
5
  }, Pick<PhiBlockRuntime, "site" | "locale">> & {
6
6
  runtime: Pick<PhiBlockRuntime, "site" | "locale">;
@@ -8,7 +8,7 @@ import { localizePath } from "../../../../../helpers/locale";
8
8
  import { PhiFlexControl } from "../../../../../components/controls/phi-flex-control";
9
9
  import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
10
10
  import { PhiSpinControl } from "../../../../../components/controls/phi-spin-control";
11
- export function PhiAuthLogoutWidgetClient({ runtime, labels, }) {
11
+ export function PhiAuthLogoutWidgetClient({ runtime, labels, config, }) {
12
12
  const [error, setError] = useState(null);
13
13
  const locale = runtime.locale.current;
14
14
  const siteKey = runtime.site.key;
@@ -33,5 +33,5 @@ export function PhiAuthLogoutWidgetClient({ runtime, labels, }) {
33
33
  void logout();
34
34
  return () => controller.abort();
35
35
  }, [failedLabel, locale, siteKey]);
36
- return (_jsx(PhiFlexControl, { vertical: true, align: "center", gap: "middle", children: error ? (_jsxs(_Fragment, { children: [_jsx(PhiAlertControl, { level: "error", showIcon: true, title: error }), _jsx(PhiButtonControl, { onClick: () => window.location.reload(), label: labels.retry })] })) : (_jsxs(_Fragment, { children: [_jsx(PhiSpinControl, {}), _jsx(PhiTypographyControl, { type: "secondary", children: labels.signingOut })] })) }));
36
+ return (_jsx(PhiFlexControl, { vertical: true, align: "center", gap: "middle", style: { padding: config?.padding }, children: error ? (_jsxs(_Fragment, { children: [_jsx(PhiAlertControl, { level: "error", showIcon: true, title: error }), _jsx(PhiButtonControl, { onClick: () => window.location.reload(), label: labels.retry })] })) : (_jsxs(_Fragment, { children: [_jsx(PhiSpinControl, {}), _jsx(PhiTypographyControl, { type: "secondary", children: labels.signingOut })] })) }));
37
37
  }
@@ -1,8 +1,12 @@
1
1
  import type { PhiBlockRuntime } from "../../../../../types";
2
2
  import type { PhiAuthWorkflowBodyLabels } from "../../../../../components/widgets/label-types/auth-workflow";
3
3
  import { type PhiAuthSecurityWidgetLabels } from "../../../../../components/widgets/label-types/security";
4
- export declare function PhiAuthSecurityWidgetClient({ apiPath, runtime, labels, workflowLabels, }: {
4
+ export declare function PhiAuthSecurityWidgetClient({ apiPath, runtime, labels, workflowLabels, config, }: {
5
5
  apiPath?: string;
6
+ /** The Widget's padding, as the account avatar applies it, around every state it draws. */
7
+ config?: {
8
+ padding?: number | string;
9
+ };
6
10
  /** The page's locale, which dates are written in; the browser's own language is not the Site's. */
7
11
  runtime: Pick<PhiBlockRuntime, "locale">;
8
12
  labels: PhiAuthSecurityWidgetLabels;
@@ -15,7 +15,7 @@ import { formatPhiAuthSecurityWidgetLabel, } from "../../../../../components/wid
15
15
  import { usePhiPathname } from "../../../../../components/runtime/use-phi-pathname";
16
16
  const PhiAuthWorkflowBody = lazy(() => import("../../../../../components/widgets/client/auth-workflow-body")
17
17
  .then((module) => ({ default: module.PhiAuthWorkflowBody })));
18
- export function PhiAuthSecurityWidgetClient({ apiPath = "/api/auth/account/security", runtime, labels, workflowLabels, }) {
18
+ export function PhiAuthSecurityWidgetClient({ apiPath = "/api/auth/account/security", runtime, labels, workflowLabels, config, }) {
19
19
  const [payload, setPayload] = useState(null);
20
20
  const [loading, setLoading] = useState(true);
21
21
  const [error, setError] = useState(null);
@@ -76,17 +76,19 @@ export function PhiAuthSecurityWidgetClient({ apiPath = "/api/auth/account/secur
76
76
  function revokeSession(sessionId) {
77
77
  return removeAndReload(`/api/auth/account/sessions/${encodeURIComponent(sessionId)}`, labels.errors.sessionRevokeFailed);
78
78
  }
79
+ const padding = config?.padding;
79
80
  if (enrolling) {
80
- return (_jsx(Suspense, { fallback: _jsx(PhiSkeletonControl, { lines: 4 }), children: _jsx(PhiAuthWorkflowBody, { mode: "enroll", next: pathname, labels: workflowLabels, onComplete: async () => {
81
- setEnrolling(false);
82
- await load();
83
- } }) }));
81
+ return (_jsx(PhiFlexControl, { vertical: true, style: { padding }, children: _jsx(Suspense, { fallback: _jsx(PhiSkeletonControl, { lines: 4 }), children: _jsx(PhiAuthWorkflowBody, { mode: "enroll", next: pathname, labels: workflowLabels, onComplete: async () => {
82
+ setEnrolling(false);
83
+ await load();
84
+ } }) }) }));
84
85
  }
85
- if (loading)
86
- return _jsx(PhiSkeletonControl, { lines: 8, withTitle: true });
87
- if (!payload)
88
- return _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error ?? labels.errors.unavailable });
89
- return (_jsxs(PhiFlexControl, { vertical: true, gap: "large", children: [_jsx(PhiTypographyControl, { presentation: "paragraph", type: "secondary", children: labels.intro }), error ? _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error, dismissible: true, onDismiss: () => setError(null) }) : null, _jsx(PhiCardControl, { title: labels.authenticators.title, toolbar: _jsx(PhiButtonControl, { type: "primary", onClick: () => setEnrolling(true), label: labels.authenticators.add }), children: _jsx(PhiEntryListControl, { emptyDescription: labels.authenticators.empty, entries: payload.factors
86
+ if (loading || !payload) {
87
+ return (_jsx(PhiFlexControl, { vertical: true, style: { padding }, children: loading
88
+ ? _jsx(PhiSkeletonControl, { lines: 8, withTitle: true })
89
+ : _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error ?? labels.errors.unavailable }) }));
90
+ }
91
+ return (_jsxs(PhiFlexControl, { vertical: true, gap: "large", style: { padding }, children: [_jsx(PhiTypographyControl, { presentation: "paragraph", type: "secondary", children: labels.intro }), error ? _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error, dismissible: true, onDismiss: () => setError(null) }) : null, _jsx(PhiCardControl, { title: labels.authenticators.title, toolbar: _jsx(PhiButtonControl, { type: "primary", onClick: () => setEnrolling(true), label: labels.authenticators.add }), children: _jsx(PhiEntryListControl, { emptyDescription: labels.authenticators.empty, entries: payload.factors
90
92
  .filter((factor) => factor.type === 2 && factor.confirmedAt)
91
93
  .map((factor) => ({
92
94
  key: String(factor.id),
@@ -29,7 +29,7 @@ export async function buildPhiAvatarAreaPickerOverlayTree({ page, runtime, }) {
29
29
  config: {
30
30
  title: labels.overlayTitle,
31
31
  controlSize: "medium",
32
- width: { compact: "calc(100vw - 32px)", medium: 480, wide: 520 },
32
+ size: { width: 520 },
33
33
  /*
34
34
  * `immediate`, not `request`. Request mode keeps the Overlay open and emits a `closeRequest`
35
35
  * for a Controller to answer -- and this Module has no Controller, so the X and the mask were
@@ -44,6 +44,10 @@ export declare const PHI_BLOG_RUNTIME_MODULE_ROUTES: ({
44
44
  path: string;
45
45
  landingPage?: true;
46
46
  title: string;
47
+ description?: string;
48
+ shareImage?: {
49
+ asset: string;
50
+ };
47
51
  defaultPageFlags?: number;
48
52
  loadTree: (context: import("../../../types").PhiCmsDescriptorBuildContext & {
49
53
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
@@ -4,7 +4,8 @@
4
4
  * Background control uses; this adds only what a picture placed on its own also needs.
5
5
  *
6
6
  * It writes the keys every image source is read from (`readPhiMediaImageSourceConfig`) -- `sourceKind`,
7
- * `assetId`, `variantKey`, `variantVersion`, `sourceUrl` -- and `alt`. An Asset is picked from the media
7
+ * `assetId`, `variantKey`, `sourceUrl` -- and `alt`. No `variantVersion`: the Card draws the resolved
8
+ * Asset's own, so a stored one only went stale; choosing a picture clears one an older field wrote. An Asset is picked from the media
8
9
  * library; without one, an address stands for a picture from elsewhere. Removing the picture clears both,
9
10
  * so nothing of the old one is left to come back.
10
11
  */
@@ -17,7 +17,8 @@ const PHI_IMAGE_FIELD_ORIGINAL_VARIANT = "__original__";
17
17
  * Background control uses; this adds only what a picture placed on its own also needs.
18
18
  *
19
19
  * It writes the keys every image source is read from (`readPhiMediaImageSourceConfig`) -- `sourceKind`,
20
- * `assetId`, `variantKey`, `variantVersion`, `sourceUrl` -- and `alt`. An Asset is picked from the media
20
+ * `assetId`, `variantKey`, `sourceUrl` -- and `alt`. No `variantVersion`: the Card draws the resolved
21
+ * Asset's own, so a stored one only went stale; choosing a picture clears one an older field wrote. An Asset is picked from the media
21
22
  * library; without one, an address stands for a picture from elsewhere. Removing the picture clears both,
22
23
  * so nothing of the old one is left to come back.
23
24
  */
@@ -39,7 +40,7 @@ export function PhiInspectorImageFieldControl({ config, disabled, onChange, }) {
39
40
  sourceKind: "asset",
40
41
  assetId: picked.id,
41
42
  variantKey: PhiImageAssetVariantKey.Card,
42
- variantVersion: picked.variantVersion ?? null,
43
+ variantVersion: undefined,
43
44
  sourceUrl: undefined,
44
45
  })
45
46
  : undefined, onAssetClear: editable
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from "react";
2
+ import { type PhiTableProviderRegistration } from "../../../../components/widgets/client/shared/phi-table-provider";
3
+ import type { PhiRuntimeModuleDataProviderDescriptor } from "../../../../types/cms-plugins";
4
+ import type { PhiRuntimeDataProviderKey } from "../../../../types/runtime-data-provider";
5
+ /**
6
+ * What the canvas has of a Table Provider the Builder may not read: its declaration, and no rows.
7
+ *
8
+ * `authoringMode: "none"` exposes metadata and binding fields only (TABLES.md), so the edited Area's
9
+ * Module never hands the canvas a Client for it. A Table bound to one -- the conversations inbox, the
10
+ * groups, the customer file -- found no Provider at all and drew "not available from the active runtime
11
+ * modules", which reads as a Module that is switched off when it is the Builder keeping its hands off a
12
+ * person's data. Standing in with the declared resources and an empty answer lets the Table draw its
13
+ * columns, tools and binding fields as an author arranges them, and asks the Site nothing.
14
+ */
15
+ export declare function createPhiMetadataTableProviderRegistration(descriptor: Extract<PhiRuntimeModuleDataProviderDescriptor, {
16
+ kind: "table";
17
+ }>): PhiTableProviderRegistration;
18
+ export declare function PhiBuilderMetadataTableProviders({ descriptors, mountedProviderKeys, children, }: {
19
+ descriptors: readonly PhiRuntimeModuleDataProviderDescriptor[];
20
+ /** Providers the canvas mounts for real (the Builder's own pickers), which need no stand-in. */
21
+ mountedProviderKeys: readonly PhiRuntimeDataProviderKey[];
22
+ children: ReactNode;
23
+ }): ReactNode;
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
+ import { PhiTableProviderClient } from "../../../../components/widgets/client/shared/phi-table-provider";
5
+ import { PhiTableProviderError } from "../../../../types/table-widget";
6
+ /**
7
+ * What the canvas has of a Table Provider the Builder may not read: its declaration, and no rows.
8
+ *
9
+ * `authoringMode: "none"` exposes metadata and binding fields only (TABLES.md), so the edited Area's
10
+ * Module never hands the canvas a Client for it. A Table bound to one -- the conversations inbox, the
11
+ * groups, the customer file -- found no Provider at all and drew "not available from the active runtime
12
+ * modules", which reads as a Module that is switched off when it is the Builder keeping its hands off a
13
+ * person's data. Standing in with the declared resources and an empty answer lets the Table draw its
14
+ * columns, tools and binding fields as an author arranges them, and asks the Site nothing.
15
+ */
16
+ export function createPhiMetadataTableProviderRegistration(descriptor) {
17
+ return {
18
+ key: descriptor.key,
19
+ resources: descriptor.resources,
20
+ query: async () => ({ rows: [], total: 0 }),
21
+ ...(descriptor.resources.some((resource) => resource.recordRead === true)
22
+ ? {
23
+ readRecord: async () => {
24
+ throw new PhiTableProviderError("authoring-not-supported", `The Builder does not read records of "${descriptor.key}".`);
25
+ },
26
+ }
27
+ : {}),
28
+ };
29
+ }
30
+ export function PhiBuilderMetadataTableProviders({ descriptors, mountedProviderKeys, children, }) {
31
+ const registrations = useMemo(() => {
32
+ const mounted = new Set(mountedProviderKeys);
33
+ return descriptors.flatMap((descriptor) => descriptor.kind === "table" && descriptor.authoringMode === "none" && !mounted.has(descriptor.key)
34
+ ? [createPhiMetadataTableProviderRegistration(descriptor)]
35
+ : []);
36
+ }, [descriptors, mountedProviderKeys]);
37
+ return registrations.reduceRight((nested, registration) => (_jsx(PhiTableProviderClient, { registration: registration, children: nested }, registration.key)), children);
38
+ }
@@ -1,5 +1,8 @@
1
1
  import { type PhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-types/builder-chrome";
2
- export declare function PhiBuilderModeSwitchWidgetClient({ disabled, labels, }: {
2
+ import type { PhiSignalRouteSet } from "../../../../types/signals";
3
+ export declare function PhiBuilderModeSwitchWidgetClient({ disabled, labels, signalRoutes, }: {
3
4
  disabled?: boolean;
4
5
  labels?: PhiBuilderChromeWidgetLabels;
6
+ /** The routes its tree writes for `change`: to the Builder Controller, which enters the mode. */
7
+ signalRoutes?: PhiSignalRouteSet | null;
5
8
  }): import("react").JSX.Element;
@@ -6,26 +6,13 @@ import { PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS, } from "../../../../component
6
6
  import { usePhiControlSignalController } from "../../../../components/widgets/client/shared/phi-control-signals";
7
7
  import { usePhiConfig } from "../../../../components/root/phi-config-provider";
8
8
  import { PhiFlexControl } from "../../../../components/controls/phi-flex-control";
9
- export function PhiBuilderModeSwitchWidgetClient({ disabled = false, labels = PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS, }) {
9
+ export function PhiBuilderModeSwitchWidgetClient({ disabled = false, labels = PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS, signalRoutes = null, }) {
10
10
  const { token } = usePhiConfig();
11
11
  const builderMode = usePhiDeveloperBuilderStateValue((state) => state.builderMode);
12
12
  const isDisabled = disabled;
13
13
  const controlSignals = usePhiControlSignalController({
14
14
  key: "builderMode",
15
- // The Widget's own address: the Builder Controller does not answer what was sent under its own.
16
- signalRoutes: {
17
- emits: [
18
- {
19
- routeKey: "builder-mode-change",
20
- capabilityId: "change",
21
- scope: "area",
22
- channel: "builderMode",
23
- action: "change",
24
- valueType: "string",
25
- receiver: "broadcast",
26
- },
27
- ],
28
- },
15
+ signalRoutes,
29
16
  typeKey: "segmented",
30
17
  initialDisabled: isDisabled,
31
18
  clearValue: builderMode,
@@ -17,6 +17,7 @@ export function PhiDeveloperBuilderPagesWorkspaceWidgetClient({ pageDraftsByScop
17
17
  title: pageMeta?.title ?? null,
18
18
  description: pageMeta?.description ?? null,
19
19
  index: pageMeta?.index ?? true,
20
+ shareImage: pageMeta?.shareImage ?? null,
20
21
  },
21
22
  });
22
23
  mergePhiDeveloperDeletedPageDrafts(pageMetaArea, {
@@ -26,6 +27,7 @@ export function PhiDeveloperBuilderPagesWorkspaceWidgetClient({ pageDraftsByScop
26
27
  pageMeta?.description,
27
28
  pageMeta?.index,
28
29
  pageMeta?.isDeleted,
30
+ pageMeta?.shareImage,
29
31
  pageMeta?.title,
30
32
  pageMetaArea,
31
33
  pageMetaPageKey,
@@ -8,6 +8,7 @@ import { PhiRuntimeModuleProvider } from "../../../../components/runtime/runtime
8
8
  import { setPhiBuilderModuleMetas } from "../plugin-meta-store";
9
9
  import { usePhiDeveloperBuilderStateValue } from "../developer-workspace-store";
10
10
  import { PhiModuleIconsProvider } from "../../../../components/shell/phi-module-icons";
11
+ import { PhiBuilderMetadataTableProviders } from "./metadata-table-provider-stand-ins";
11
12
  export function PhiBuilderRuntimeModuleAuthoringBoundary({ targetArea, catalog, pickerDataProviderKeys, children, }) {
12
13
  const selectedModuleIds = usePhiDeveloperBuilderStateValue((state) => state.runtimeModuleIdsByArea[targetArea]);
13
14
  const activeEntries = useMemo(() => {
@@ -48,5 +49,5 @@ export function PhiBuilderRuntimeModuleAuthoringBoundary({ targetArea, catalog,
48
49
  targetArea,
49
50
  videoProviderDescriptors,
50
51
  ]);
51
- return (_jsx(PhiRuntimeModuleProvider, { moduleIds: moduleIds, widgetTypes: widgetDefinitions.map((definition) => definition.type), layoutTypes: layoutTypes, widgetDefinitions: widgetDefinitions, dataProviderDescriptors: dataProviderDescriptors, calendarAdapterDescriptors: calendarAdapterDescriptors, videoProviderDescriptors: videoProviderDescriptors, collectionItemRendererDescriptors: collectionItemRendererDescriptors, children: _jsx(PhiRuntimeModuleAuthoringDataProviderHost, { providerKeys: authoringDataProviderKeys, children: _jsx(PhiRuntimeModuleDataProviderClientHost, { providerKeys: pickerDataProviderKeys, mode: "live", children: _jsx(PhiRuntimeModuleAuthoringClientHost, { moduleIds: moduleIds, children: _jsx(PhiModuleIconsProvider, { sets: iconSets, flagUnavailable: true, children: children }) }) }) }) }));
52
+ return (_jsx(PhiRuntimeModuleProvider, { moduleIds: moduleIds, widgetTypes: widgetDefinitions.map((definition) => definition.type), layoutTypes: layoutTypes, widgetDefinitions: widgetDefinitions, dataProviderDescriptors: dataProviderDescriptors, calendarAdapterDescriptors: calendarAdapterDescriptors, videoProviderDescriptors: videoProviderDescriptors, collectionItemRendererDescriptors: collectionItemRendererDescriptors, children: _jsx(PhiRuntimeModuleAuthoringDataProviderHost, { providerKeys: authoringDataProviderKeys, children: _jsx(PhiRuntimeModuleDataProviderClientHost, { providerKeys: pickerDataProviderKeys, mode: "live", children: _jsx(PhiBuilderMetadataTableProviders, { descriptors: dataProviderDescriptors, mountedProviderKeys: pickerDataProviderKeys, children: _jsx(PhiRuntimeModuleAuthoringClientHost, { moduleIds: moduleIds, children: _jsx(PhiModuleIconsProvider, { sets: iconSets, flagUnavailable: true, children: children }) }) }) }) }) }));
52
53
  }
@@ -5,12 +5,15 @@ import { readPhiDraftStatusSignalValue } from "../../../../types/draft-status";
5
5
  import { isPhiBuilderAreaKey } from "../../../../constants/cms-areas";
6
6
  import { isPhiRecord } from "../../../../helpers/is-record";
7
7
  import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../components/runtime/runtime-signal-bus";
8
+ import { usePhiApplicationFeedback } from "../../../../components/runtime/use-phi-application-feedback";
8
9
  import { resolvePhiBuilderCmsStoragePath } from "../../../../helpers/cms-paths";
9
- import { resolvePhiBuilderActivePageCatalog, resolvePhiBuilderPagePresetSource, } from "../../../../helpers/cms-page-catalog";
10
+ import { findPhiPageNodePath, resolvePhiBuilderActivePageCatalog, resolvePhiBuilderPagePresetSource, } from "../../../../helpers/cms-page-catalog";
10
11
  import { createPhiBuilderControllerAddress } from "../controller/address";
11
12
  import { createPhiBuilderHistoryContext, phiBuilderHistory } from "../history";
12
13
  import { clearPhiBuilderDraftAllocation, getPhiBuilderDraftContextGeneration, invalidatePhiBuilderDraftContext, } from "../developer-workspace-store";
13
14
  import { createPhiBuilderDraftAllocationKey } from "../draft-allocation-key";
15
+ import { loadPhiBuilderPersistedPageCatalog } from "../page-catalog-client";
16
+ import { storePhiWorkspacePersistedPages } from "../workspace-catalog-actions";
14
17
  const PHI_BUILDER_NO_DRAFT_HISTORY_CONTEXT = "draft-status:none";
15
18
  function resolveTarget(workspace, area, pageKey, navKey, state) {
16
19
  if (workspace === "navigation") {
@@ -25,6 +28,16 @@ function resolveTarget(workspace, area, pageKey, navKey, state) {
25
28
  return null;
26
29
  }
27
30
  const pages = resolvePhiBuilderActivePageCatalog(area, state.modulePresetPagesByArea, state.customPages, state.persistedPageCatalogByArea);
31
+ /*
32
+ * A Page key the Area's catalog does not hold yet is a moment, like the catalog not being hydrated:
33
+ * opened as `/builder/phis/ui/pages?phiBuilderArea=app`, the server stands on the Area's root, which
34
+ * the client's catalog leaves out while it forwards, and the workspace moves to an offered Page right
35
+ * after. Asking the catalog for the storage path of that key threw during render and took the whole
36
+ * Builder down with a 500.
37
+ */
38
+ if (!findPhiPageNodePath(pages, pageKey)) {
39
+ return null;
40
+ }
28
41
  const storagePath = resolvePhiBuilderCmsStoragePath(area, pageKey, pages);
29
42
  /*
30
43
  * Addressed the way a save addresses it: a Module Page by its preset identity, which survives a
@@ -88,6 +101,7 @@ function resolveTarget(workspace, area, pageKey, navKey, state) {
88
101
  */
89
102
  export function usePhiBuilderDraftStatusController({ commandWorkspace, effectiveArea, effectiveNavKey, effectivePageKey, state, }) {
90
103
  const dispatchSignal = usePhiSignalDispatcher();
104
+ const { showMessage } = usePhiApplicationFeedback();
91
105
  const target = resolveTarget(commandWorkspace, effectiveArea, effectivePageKey, effectiveNavKey, state);
92
106
  const targetUrl = target?.url ?? null;
93
107
  const subject = target?.subject ?? null;
@@ -190,6 +204,19 @@ export function usePhiBuilderDraftStatusController({ commandWorkspace, effective
190
204
  }
191
205
  else if (typeof pageKey === "string") {
192
206
  invalidatePhiBuilderDraftContext({ workspace: "pages", area, pageKey });
207
+ /*
208
+ * The Page's entry in the Area's catalog -- its scope id, pointers, deletion and pending path --
209
+ * is the server's as well: a reset deletes the scope, a restore moves its working draft. The
210
+ * catalog is read once per Area, so it is read again here, or Pages keeps the replaced entry.
211
+ */
212
+ void loadPhiBuilderPersistedPageCatalog(area, { refresh: true })
213
+ .then((pages) => storePhiWorkspacePersistedPages(area, pages))
214
+ .catch((error) => {
215
+ showMessage({
216
+ level: "error",
217
+ content: error instanceof Error ? error.message : "Failed to load page catalog.",
218
+ });
219
+ });
193
220
  }
194
221
  else {
195
222
  invalidatePhiBuilderDraftContext({ workspace: "structure", area });