@phis/ui 0.7.7 → 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 (344) 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 +64 -9
  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/extended-form-field-controls.d.ts +1 -1
  26. package/components/forms/extended-form-field-controls.js +23 -7
  27. package/components/forms/flags-field.d.ts +22 -0
  28. package/components/forms/flags-field.js +58 -0
  29. package/components/forms/form-option-flags.d.ts +20 -0
  30. package/components/forms/form-option-flags.js +38 -0
  31. package/components/forms/form-provider-contract.d.ts +28 -0
  32. package/components/forms/form-provider-contract.js +45 -2
  33. package/components/forms/form-provider-registry.d.ts +11 -1
  34. package/components/forms/money-field-currency-key.d.ts +6 -0
  35. package/components/forms/money-field-currency-key.js +14 -0
  36. package/components/forms/money-field.d.ts +26 -3
  37. package/components/forms/money-field.js +54 -4
  38. package/components/forms/shared-form-provider-registry.js +13 -0
  39. package/components/forms/structured-field-labels.d.ts +24 -0
  40. package/components/forms/structured-field-labels.js +43 -0
  41. package/components/forms/structured-form-field-controls.d.ts +12 -0
  42. package/components/forms/structured-form-field-controls.js +65 -0
  43. package/components/overlays/phi-overlay-container-client.js +2 -2
  44. package/components/regions/phi-cms-region-shell.js +2 -2
  45. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  46. package/components/regions/presets/navigation-redirect.d.ts +4 -1
  47. package/components/regions/presets/navigation-redirect.js +6 -3
  48. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
  49. package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
  50. package/components/root/phi-root-theme-resolver.js +3 -0
  51. package/components/shell/phi-antd-icon.d.ts +1 -8
  52. package/components/shell/phi-antd-icon.js +1 -227
  53. package/components/shell/phi-icon-names.d.ts +19 -0
  54. package/components/shell/phi-icon-names.js +264 -0
  55. package/components/shell/phi-icon.d.ts +2 -11
  56. package/components/shell/phi-icon.js +4 -32
  57. package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
  58. package/components/widgets/client/shared/phi-command-buttons.js +10 -4
  59. package/components/widgets/client/shared/phi-rendered-value.js +32 -6
  60. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  61. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  62. package/components/widgets/config/background.d.ts +3 -2
  63. package/components/widgets/config/choice-shared.d.ts +10 -1
  64. package/components/widgets/config/choice-shared.js +8 -2
  65. package/components/widgets/label-sets/admin-locales.js +1 -1
  66. package/components/widgets/label-sets/admin-users.d.ts +2 -5
  67. package/components/widgets/label-sets/admin-users.js +4 -10
  68. package/components/widgets/label-sets/effects.js +2 -4
  69. package/components/widgets/label-sets/profile.d.ts +13 -0
  70. package/components/widgets/label-sets/profile.js +28 -0
  71. package/components/widgets/label-sets/search-results.js +2 -4
  72. package/components/widgets/label-sets/table.js +9 -0
  73. package/components/widgets/label-types/effects.d.ts +3 -2
  74. package/components/widgets/label-types/effects.js +1 -2
  75. package/components/widgets/label-types/search-results.d.ts +2 -2
  76. package/components/widgets/label-types/search-results.js +1 -2
  77. package/components/widgets/label-types/table.d.ts +3 -0
  78. package/components/widgets/label-types/table.js +2 -0
  79. package/components/widgets/server/builder-chrome.d.ts +4 -1
  80. package/components/widgets/server/builder-chrome.js +2 -2
  81. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  82. package/components/widgets/shared/markdown-body-client.js +31 -1
  83. package/components/widgets/shared/markdown-render.d.ts +10 -2
  84. package/components/widgets/shared/markdown-render.js +35 -13
  85. package/constants/countries.d.ts +9 -0
  86. package/constants/countries.js +28 -0
  87. package/constants/customer-file.d.ts +25 -0
  88. package/constants/customer-file.js +26 -0
  89. package/constants/record-field-kinds.d.ts +15 -0
  90. package/constants/record-field-kinds.js +13 -0
  91. package/constants/runtime-module-ownership.js +12 -0
  92. package/constants/runtime-render-client-types.d.ts +5 -0
  93. package/constants/runtime-render-client-types.js +5 -0
  94. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  95. package/constants.d.ts +1 -0
  96. package/constants.js +2 -0
  97. package/gateway/form-handler-request.d.ts +22 -0
  98. package/gateway/form-handler-request.js +40 -0
  99. package/gateway/label-set.d.ts +15 -2
  100. package/gateway/label-set.js +60 -22
  101. package/gateway/site-form-route.js +11 -2
  102. package/helpers/address-field.d.ts +43 -0
  103. package/helpers/address-field.js +68 -0
  104. package/helpers/cms-dialog.d.ts +5 -20
  105. package/helpers/cms-dialog.js +8 -13
  106. package/helpers/cms-page-catalog.d.ts +10 -0
  107. package/helpers/cms-page-catalog.js +19 -0
  108. package/helpers/cms-preset-nodes.d.ts +4 -4
  109. package/helpers/cms-preset-nodes.js +1 -1
  110. package/helpers/cms-region-keys.d.ts +1 -1
  111. package/helpers/country-names.d.ts +12 -0
  112. package/helpers/country-names.js +14 -0
  113. package/helpers/money-amount.d.ts +7 -0
  114. package/helpers/money-amount.js +15 -0
  115. package/helpers/phi-metadata.d.ts +33 -1
  116. package/helpers/phi-metadata.js +62 -1
  117. package/helpers/preset-table-check.d.ts +34 -0
  118. package/helpers/preset-table-check.js +124 -0
  119. package/helpers/preset-text-source-check.d.ts +4 -1
  120. package/helpers/preset-text-source-check.js +6 -1
  121. package/helpers/preset-tree-contract-check.d.ts +3 -2
  122. package/helpers/preset-tree-contract-check.js +30 -5
  123. package/helpers/public-route-claims.d.ts +9 -1
  124. package/helpers/public-route-claims.js +23 -3
  125. package/helpers/record-fields.d.ts +1 -5
  126. package/helpers/record-fields.js +15 -6
  127. package/helpers/route-address-check.d.ts +22 -2
  128. package/helpers/route-address-check.js +29 -8
  129. package/helpers/site-address-row.d.ts +23 -0
  130. package/helpers/site-address-row.js +36 -0
  131. package/helpers/surface-style.d.ts +8 -1
  132. package/helpers/surface-style.js +12 -2
  133. package/helpers/thread-inbox-row.d.ts +20 -0
  134. package/helpers/thread-inbox-row.js +26 -0
  135. package/helpers/translation-format.d.ts +26 -0
  136. package/helpers/translation-format.js +31 -0
  137. package/module-labels.d.ts +1 -1
  138. package/module-labels.js +1 -1
  139. package/module-page-check.d.ts +1 -0
  140. package/module-page-check.js +1 -0
  141. package/module-records.d.ts +2 -2
  142. package/module-records.js +1 -0
  143. package/next/area-route.js +34 -1
  144. package/next/root-route.js +4 -5
  145. package/package.json +2 -2
  146. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  147. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  148. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  149. package/plugins/runtime-modules/accounting/ids.d.ts +11 -0
  150. package/plugins/runtime-modules/accounting/ids.js +23 -0
  151. package/plugins/runtime-modules/accounting/presets.js +32 -5
  152. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
  153. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -0
  154. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  155. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +26 -0
  156. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -0
  157. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  158. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  159. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  160. package/plugins/runtime-modules/app/data-providers.d.ts +98 -0
  161. package/plugins/runtime-modules/app/data-providers.js +80 -0
  162. package/plugins/runtime-modules/app/definition.d.ts +131 -0
  163. package/plugins/runtime-modules/app/definition.js +2 -0
  164. package/plugins/runtime-modules/app/forms.d.ts +46 -1
  165. package/plugins/runtime-modules/app/forms.js +195 -1
  166. package/plugins/runtime-modules/app/ids.d.ts +7 -0
  167. package/plugins/runtime-modules/app/ids.js +8 -0
  168. package/plugins/runtime-modules/app/module.d.ts +131 -0
  169. package/plugins/runtime-modules/app/presets.js +3 -6
  170. package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
  171. package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
  172. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
  173. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
  174. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
  175. package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
  176. package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.d.ts +3 -6
  177. package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.js +4 -7
  178. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
  179. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
  180. package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
  181. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  182. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  183. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  184. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  185. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  186. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  187. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  188. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  189. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  190. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  191. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  192. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
  193. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  194. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  195. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  196. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  197. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  198. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  199. package/plugins/runtime-modules/builder/controller/client.d.ts +5 -5
  200. package/plugins/runtime-modules/builder/controller/client.js +2 -1
  201. package/plugins/runtime-modules/builder/controller/definition.d.ts +4 -4
  202. package/plugins/runtime-modules/builder/controller/definition.js +7 -0
  203. package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +3 -1
  204. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +2 -1
  205. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +72 -18
  206. package/plugins/runtime-modules/builder/controller/server-definition.d.ts +4 -4
  207. package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +3 -1
  208. package/plugins/runtime-modules/builder/controller/workspace-controller.js +8 -10
  209. package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +10 -0
  210. package/plugins/runtime-modules/builder/developer-workspace-store.js +35 -1
  211. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  212. package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +6 -0
  213. package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -6
  214. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  215. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  216. package/plugins/runtime-modules/builder/persistence.d.ts +4 -1
  217. package/plugins/runtime-modules/builder/persistence.js +14 -3
  218. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  219. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
  220. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
  221. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  222. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  223. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  224. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  225. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  226. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  227. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  228. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  229. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  230. package/plugins/runtime-modules/contracts.js +31 -1
  231. package/plugins/runtime-modules/core/definition.d.ts +28 -0
  232. package/plugins/runtime-modules/core/form-providers.d.ts +28 -0
  233. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  234. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  235. package/plugins/runtime-modules/core/widgets/card/config.d.ts +0 -1
  236. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  237. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  238. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  239. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  240. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  241. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  242. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  243. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  244. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  245. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  246. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  247. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  248. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  249. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  250. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  251. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  252. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  253. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  254. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  255. package/plugins/runtime-modules/core/widgets/spacer/client.js +3 -3
  256. package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
  257. package/plugins/runtime-modules/core/widgets/table/config.js +6 -0
  258. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  259. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  260. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  261. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  262. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  263. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  264. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  265. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  266. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  267. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  268. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  269. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -2
  270. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  271. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  272. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +46 -39
  273. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  274. package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
  275. package/plugins/runtime-modules/resolver.js +17 -0
  276. package/plugins/runtime-modules/revisions/controller/client.js +50 -46
  277. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  278. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  279. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  280. package/plugins/runtime-modules/revisions/services/table.js +16 -5
  281. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
  282. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  283. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  284. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
  285. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  286. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  287. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  288. package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
  289. package/plugins/runtime-modules/threads/controller/definition.js +1 -1
  290. package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
  291. package/plugins/runtime-modules/threads/data-providers.js +85 -0
  292. package/plugins/runtime-modules/threads/definition.d.ts +115 -2
  293. package/plugins/runtime-modules/threads/definition.js +1 -1
  294. package/plugins/runtime-modules/threads/ids.d.ts +2 -0
  295. package/plugins/runtime-modules/threads/ids.js +3 -0
  296. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
  297. package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -0
  298. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  299. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  300. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  301. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  302. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  303. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  304. package/plugins/runtime-modules/user-management/ids.js +9 -0
  305. package/plugins/runtime-modules/user-management/presets.js +17 -1
  306. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  307. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  308. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +86 -0
  309. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -0
  310. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  311. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +166 -0
  312. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -18
  313. package/server-helpers/cms-page-record.d.ts +9 -1
  314. package/server-helpers/cms-page-record.js +11 -1
  315. package/server-helpers/cms-request.js +8 -5
  316. package/server-helpers/link-preview-image.d.ts +30 -0
  317. package/server-helpers/link-preview-image.js +57 -0
  318. package/server-helpers/search-text.js +3 -0
  319. package/server-helpers.d.ts +1 -1
  320. package/server-helpers.js +1 -1
  321. package/styles/builder-scaffold.css +7 -1
  322. package/styles/layout-authoring-scaffold.css +27 -0
  323. package/styles/shell.css +30 -6
  324. package/theme/phi-theme-composition.js +9 -0
  325. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  326. package/theme/phi-theme-inverse-ground.js +103 -0
  327. package/theme/phi-theme-tokens.d.ts +2 -1
  328. package/theme/phi-theme-tokens.js +2 -0
  329. package/types/cms-module-descriptors.d.ts +14 -0
  330. package/types/cms-overlay.d.ts +13 -6
  331. package/types/cms-overlay.js +6 -22
  332. package/types/cms-plugins.d.ts +14 -2
  333. package/types/cms.d.ts +10 -0
  334. package/types/core-widget-placements.d.ts +3 -3
  335. package/types/link-preview.d.ts +19 -0
  336. package/types/link-preview.js +19 -0
  337. package/types/record-provider.d.ts +22 -1
  338. package/types/site-theme.d.ts +27 -0
  339. package/types/table-embed.d.ts +48 -0
  340. package/types/table-embed.js +1 -0
  341. package/types/table-widget.d.ts +14 -0
  342. package/types/widget-runtime.d.ts +3 -0
  343. package/types.d.ts +1 -0
  344. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -0,0 +1,118 @@
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_USER_MANAGEMENT_RUNTIME_MODULE_IDENTITY } from "../ids";
5
+ /**
6
+ * What Admin -> Settings -> People data says: which Add-ons read people with nobody acting and what the
7
+ * Site granted them, how long the access log is kept, and the log.
8
+ */
9
+ const PHI_ADMIN_USERS_ACCESS_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_USER_MANAGEMENT_RUNTIME_MODULE_IDENTITY, {
10
+ key: "preset:admin-users-access-page",
11
+ ctx: PHI_TR_CTX_WEB_UI_LABEL,
12
+ labels: {
13
+ page_title: "People data",
14
+ page_description: definePhiMessageLabel("Which Add-ons read people's data in the background, and every time anybody's was read."),
15
+ panel_background: "Background access",
16
+ panel_background_description: definePhiMessageLabel("An Add-on reads people with nobody acting -- in a job or an event -- only the fields granted here, and only while its manifest still asks for them."),
17
+ panel_retention: "Retention",
18
+ panel_retention_description: definePhiMessageLabel("How long the access log keeps an entry before it is forgotten."),
19
+ panel_log: "Access log",
20
+ panel_log_description: definePhiMessageLabel("Every answer that carried personal data: who asked, through which Add-on, and what it carried."),
21
+ addons_label: "Add-ons reading people",
22
+ retention_label: "access log retention",
23
+ log_label: "access log",
24
+ column_addon: "Add-on",
25
+ column_fields: "Reads",
26
+ column_background: "Asks in the background",
27
+ column_granted: "Granted",
28
+ column_awaiting: "Awaiting",
29
+ column_granted_at: "Granted on",
30
+ column_days: "Kept for",
31
+ days_unit: "days",
32
+ column_at: "When",
33
+ column_actor: "Acting",
34
+ column_road: "Road",
35
+ column_operation: "Operation",
36
+ column_subjects: "People",
37
+ column_log_fields: "Fields",
38
+ field_name: "Name",
39
+ field_email: "E-mail",
40
+ field_phone: "Telephone",
41
+ field_address: "Addresses",
42
+ road_staff: "Staff",
43
+ road_self: "Self",
44
+ road_background: "Background",
45
+ road_checkout: "Checkout",
46
+ operation_describe: "Described",
47
+ operation_addresses: "Addresses read",
48
+ operation_create_address: "Address written",
49
+ operation_file_of: "File opened",
50
+ operation_customer_file: "Customer file",
51
+ nobody: "Nobody",
52
+ action_grant: "Grant what is asked",
53
+ action_revoke: "Withdraw",
54
+ grant_title: "Grant %1 background access?",
55
+ grant_text: definePhiMessageLabel("It reads the fields it asks for with nobody acting, until the grant is withdrawn."),
56
+ revoke_title: "Withdraw the grant of %1?",
57
+ revoke_text: definePhiMessageLabel("It reads nobody in the background from now on; what it reads for somebody acting is unchanged."),
58
+ confirm_grant: "Grant",
59
+ confirm_revoke: "Withdraw",
60
+ cancel: "Cancel",
61
+ addons_empty: definePhiMessageLabel("No installed Add-on reads people."),
62
+ log_empty: definePhiMessageLabel("Nothing was read, or the filters leave nothing."),
63
+ filter_subject: "Person",
64
+ filter_subject_placeholder: "Subject",
65
+ filter_addon: "Add-on",
66
+ filter_addon_placeholder: "@scope/name",
67
+ },
68
+ });
69
+ export async function getPhiAdminUsersAccessLabels(options) {
70
+ const labels = await getPhiLabelSet(options, PHI_ADMIN_USERS_ACCESS_LABEL_SET);
71
+ return {
72
+ pageTitle: labels.page_title,
73
+ pageDescription: labels.page_description,
74
+ panels: {
75
+ background: { title: labels.panel_background, description: labels.panel_background_description },
76
+ retention: { title: labels.panel_retention, description: labels.panel_retention_description },
77
+ log: { title: labels.panel_log, description: labels.panel_log_description },
78
+ },
79
+ widgets: { addons: labels.addons_label, retention: labels.retention_label, log: labels.log_label },
80
+ columns: {
81
+ addon: labels.column_addon,
82
+ fields: labels.column_fields,
83
+ background: labels.column_background,
84
+ granted: labels.column_granted,
85
+ awaiting: labels.column_awaiting,
86
+ grantedAt: labels.column_granted_at,
87
+ days: labels.column_days,
88
+ at: labels.column_at,
89
+ actor: labels.column_actor,
90
+ road: labels.column_road,
91
+ operation: labels.column_operation,
92
+ subjects: labels.column_subjects,
93
+ logFields: labels.column_log_fields,
94
+ },
95
+ daysUnit: labels.days_unit,
96
+ fields: { name: labels.field_name, email: labels.field_email, phone: labels.field_phone, address: labels.field_address },
97
+ roads: { staff: labels.road_staff, self: labels.road_self, background: labels.road_background, checkout: labels.road_checkout },
98
+ operations: {
99
+ describe: labels.operation_describe,
100
+ addresses: labels.operation_addresses,
101
+ createAddress: labels.operation_create_address,
102
+ fileOf: labels.operation_file_of,
103
+ customerFile: labels.operation_customer_file,
104
+ },
105
+ nobody: labels.nobody,
106
+ actions: { grant: labels.action_grant, revoke: labels.action_revoke },
107
+ grant: { title: labels.grant_title, text: labels.grant_text, ok: labels.confirm_grant },
108
+ revoke: { title: labels.revoke_title, text: labels.revoke_text, ok: labels.confirm_revoke },
109
+ cancel: labels.cancel,
110
+ empty: { addons: labels.addons_empty, log: labels.log_empty },
111
+ filters: {
112
+ subject: labels.filter_subject,
113
+ subjectPlaceholder: labels.filter_subject_placeholder,
114
+ addon: labels.filter_addon,
115
+ addonPlaceholder: labels.filter_addon_placeholder,
116
+ },
117
+ };
118
+ }
@@ -0,0 +1,20 @@
1
+ import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "../../../../types/cms";
2
+ import type { PhiBlockRuntime } from "../../../../types";
3
+ /**
4
+ * Admin -> Settings -> People data: what the Site lets Add-ons read of people (`users:v1`), phis-server
5
+ * `/api/site/admin/users-access`. A Settings page like the others, three panels in the one shell:
6
+ *
7
+ * - **Background access**, one row per installed Add-on that reads people: what its manifest reads, what it
8
+ * asks to read with nobody acting, what the Site granted and what still awaits a grant. Granting gives it
9
+ * what it asks; withdrawing ends it. A manifest asking for more later keeps the old grant until granted
10
+ * again, which is what `Awaiting` shows.
11
+ * - **Retention**, the days the log keeps an entry, edited in its cell.
12
+ * - **Access log**, newest first, narrowed by a person's subject and an Add-on.
13
+ *
14
+ * Core answers these routes to a Site Admin only, and the Settings entry is offered to them alone; a
15
+ * Maintainer who opens the address is refused by the routes, and the Tables say so.
16
+ */
17
+ export declare function buildPhiDefaultAdminUsersAccessPageTree({ page, runtime, }: {
18
+ page: PhiCmsPageNode;
19
+ runtime: PhiBlockRuntime;
20
+ }): Promise<PhiResolvedCmsPageTree>;
@@ -0,0 +1,166 @@
1
+ import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS, PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID, PHI_USER_MANAGEMENT_USERS_ACCESS_PAGE_PRESET_KEY, PHI_USER_MANAGEMENT_USERS_ACCESS_RESOURCE_KEYS as RESOURCES, } from "../ids";
2
+ import { buildPhiSettingsPageShellTree } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
3
+ import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
4
+ import { getPhiAdminUsersAccessLabels } from "./admin-users-access-label-set";
5
+ const REGION_CONTENT_ID = -487;
6
+ /**
7
+ * Admin -> Settings -> People data: what the Site lets Add-ons read of people (`users:v1`), phis-server
8
+ * `/api/site/admin/users-access`. A Settings page like the others, three panels in the one shell:
9
+ *
10
+ * - **Background access**, one row per installed Add-on that reads people: what its manifest reads, what it
11
+ * asks to read with nobody acting, what the Site granted and what still awaits a grant. Granting gives it
12
+ * what it asks; withdrawing ends it. A manifest asking for more later keeps the old grant until granted
13
+ * again, which is what `Awaiting` shows.
14
+ * - **Retention**, the days the log keeps an entry, edited in its cell.
15
+ * - **Access log**, newest first, narrowed by a person's subject and an Add-on.
16
+ *
17
+ * Core answers these routes to a Site Admin only, and the Settings entry is offered to them alone; a
18
+ * Maintainer who opens the address is refused by the routes, and the Tables say so.
19
+ */
20
+ export async function buildPhiDefaultAdminUsersAccessPageTree({ page, runtime, }) {
21
+ const labels = await getPhiAdminUsersAccessLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
22
+ const fieldTags = {
23
+ renderer: "tags",
24
+ sizing: { mode: "content" },
25
+ valueMap: labels.fields,
26
+ };
27
+ const tree = buildPhiSettingsPageShellTree({
28
+ page,
29
+ ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
30
+ presetKey: PHI_USER_MANAGEMENT_USERS_ACCESS_PAGE_PRESET_KEY,
31
+ regionId: REGION_CONTENT_ID,
32
+ label: labels.pageTitle,
33
+ panels: [
34
+ {
35
+ nodeKey: "panelBackground",
36
+ title: labels.panels.background.title,
37
+ description: labels.panels.background.description,
38
+ sections: [{
39
+ nodeKey: "widgetAddons",
40
+ typeKey: "table",
41
+ label: labels.widgets.addons,
42
+ config: {
43
+ source: { providerKey: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.usersAccess, resourceKey: RESOURCES.addons },
44
+ presentation: {
45
+ controlSize: "small",
46
+ layout: { mode: "auto", overflowX: "auto" },
47
+ columns: [
48
+ { key: "addonId", fieldKey: "addonId", title: labels.columns.addon, renderer: "code", sizing: { mode: "content" }, sticky: "left" },
49
+ { key: "fields", fieldKey: "fields", title: labels.columns.fields, ...fieldTags },
50
+ { key: "background", fieldKey: "background", title: labels.columns.background, ...fieldTags },
51
+ { key: "granted", fieldKey: "granted", title: labels.columns.granted, ...fieldTags, tagColorMap: { name: "success", email: "success", phone: "success", address: "success" } },
52
+ { key: "awaiting", fieldKey: "awaiting", title: labels.columns.awaiting, ...fieldTags, tagColorMap: { name: "warning", email: "warning", phone: "warning", address: "warning" } },
53
+ { key: "grantedAt", fieldKey: "grantedAt", title: labels.columns.grantedAt, renderer: "datetime", sizing: { mode: "content" } },
54
+ ],
55
+ emptyState: { title: labels.empty.addons },
56
+ },
57
+ features: {
58
+ pagination: { enabled: false },
59
+ sorting: { mode: "none" },
60
+ tools: { mode: "self-contained", reset: false, reload: true },
61
+ actions: {
62
+ rowLayout: "compact",
63
+ row: [
64
+ {
65
+ key: "grant",
66
+ label: labels.actions.grant,
67
+ icon: "antd:safety-certificate",
68
+ display: "icon",
69
+ mode: "primary",
70
+ execution: "provider",
71
+ confirm: { title: labels.grant.title, description: labels.grant.text, okText: labels.grant.ok, cancelText: labels.cancel },
72
+ },
73
+ {
74
+ key: "revoke",
75
+ label: labels.actions.revoke,
76
+ icon: "antd:stop",
77
+ display: "icon",
78
+ mode: "danger",
79
+ execution: "provider",
80
+ confirm: { title: labels.revoke.title, description: labels.revoke.text, okText: labels.revoke.ok, cancelText: labels.cancel },
81
+ },
82
+ ],
83
+ },
84
+ },
85
+ },
86
+ }],
87
+ },
88
+ {
89
+ nodeKey: "panelRetention",
90
+ title: labels.panels.retention.title,
91
+ description: labels.panels.retention.description,
92
+ sections: [{
93
+ nodeKey: "widgetRetention",
94
+ typeKey: "table",
95
+ label: labels.widgets.retention,
96
+ config: {
97
+ source: { providerKey: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.usersAccess, resourceKey: RESOURCES.retention },
98
+ presentation: {
99
+ controlSize: "small",
100
+ layout: { mode: "auto", overflowX: "auto" },
101
+ columns: [{
102
+ key: "days",
103
+ fieldKey: "days",
104
+ title: labels.columns.days,
105
+ // The unit belongs to the value, not to the heading (TABLES.md, cell editors).
106
+ editor: { prefix: labels.daysUnit },
107
+ sizing: { mode: "content" },
108
+ align: "right",
109
+ }],
110
+ },
111
+ features: {
112
+ pagination: { enabled: false },
113
+ sorting: { mode: "none" },
114
+ editing: { mode: "cell" },
115
+ tools: { mode: "self-contained", reset: false, reload: false },
116
+ },
117
+ },
118
+ }],
119
+ },
120
+ {
121
+ nodeKey: "panelLog",
122
+ title: labels.panels.log.title,
123
+ description: labels.panels.log.description,
124
+ sections: [{
125
+ nodeKey: "widgetLog",
126
+ typeKey: "table",
127
+ label: labels.widgets.log,
128
+ config: {
129
+ source: { providerKey: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.usersAccess, resourceKey: RESOURCES.log },
130
+ presentation: {
131
+ controlSize: "small",
132
+ layout: { mode: "auto", overflowX: "auto" },
133
+ columns: [
134
+ { key: "at", fieldKey: "at", title: labels.columns.at, renderer: "datetime", sizing: { mode: "content" } },
135
+ { key: "addonId", fieldKey: "addonId", title: labels.columns.addon, renderer: "code", sizing: { mode: "content" } },
136
+ { key: "actor", fieldKey: "actor", title: labels.columns.actor, valueMap: { "": labels.nobody }, sizing: { mode: "content" } },
137
+ { key: "road", fieldKey: "road", title: labels.columns.road, renderer: "badge", valueMap: labels.roads, sizing: { mode: "content" } },
138
+ { key: "operation", fieldKey: "operation", title: labels.columns.operation, valueMap: labels.operations, sizing: { mode: "content" } },
139
+ { key: "subjects", fieldKey: "subjects", title: labels.columns.subjects, renderer: "tags", sizing: { mode: "fill", minWidth: 160 } },
140
+ { key: "fields", fieldKey: "fields", title: labels.columns.logFields, ...fieldTags },
141
+ ],
142
+ emptyState: { title: labels.empty.log },
143
+ },
144
+ features: {
145
+ pagination: { enabled: true, pageSize: 25, pageSizes: [25, 50, 100] },
146
+ sorting: { mode: "none" },
147
+ search: { enabled: false },
148
+ tools: { mode: "self-contained", reset: true, reload: true },
149
+ filters: [
150
+ { key: "subject", type: "text", label: labels.filters.subject, placeholder: labels.filters.subjectPlaceholder },
151
+ { key: "addonId", type: "text", label: labels.filters.addon, placeholder: labels.filters.addonPlaceholder },
152
+ ],
153
+ },
154
+ },
155
+ }],
156
+ },
157
+ ],
158
+ });
159
+ return {
160
+ ...tree,
161
+ pageMeta: {
162
+ title: { msgId: 0, source: "People data", value: labels.pageTitle },
163
+ description: { msgId: 0, source: "Which Add-ons read people's data in the background, and every time anybody's was read.", value: labels.pageDescription },
164
+ },
165
+ };
166
+ }
@@ -1,6 +1,6 @@
1
1
  import { PHI_TEXT_SOURCE_PRESET } from "../../../../helpers/text-source";
2
2
  import { PHI_CMS_DEFAULT_SLOT_INDEX, } from "../../../../constants/cms-layout-types";
3
- import { PhiCmsPageType } from "../../../../constants/phi-cms";
3
+ import { PhiCmsFlags, PhiCmsPageType } from "../../../../constants/phi-cms";
4
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
5
5
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
6
6
  import { getPhiAdminUsersPageLabels } from "./admin-users-label-set";
@@ -48,7 +48,7 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
48
48
  reason: "User Management is still loading.",
49
49
  };
50
50
  const nodes = createPhiCmsPresetNodes(page);
51
- const overlay = (id, rootLayoutNodeId, title, width, key, formMode) => nodes.overlay({
51
+ const overlay = (id, rootLayoutNodeId, title, geometry, key, formMode) => nodes.overlay({
52
52
  id,
53
53
  overlayType: "modal",
54
54
  bodyLayoutNodeId: rootLayoutNodeId,
@@ -70,7 +70,7 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
70
70
  label: key,
71
71
  config: {
72
72
  title,
73
- width,
73
+ ...geometry,
74
74
  mountPolicy: "remount",
75
75
  closeMode: formMode ? "request" : "immediate",
76
76
  signalRoutes: {
@@ -202,9 +202,11 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
202
202
  },
203
203
  }],
204
204
  overlays: [
205
- overlay(PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS.overlayCreate, PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS.layoutCreate, widgetLabels.editor.addTitle, PHI_DIALOG_WIDTH_SINGLE_COLUMN, "admin-users-create-modal", "create"),
206
- overlay(PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS.overlayEdit, PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS.layoutEdit, widgetLabels.editor.editTitle, PHI_DIALOG_WIDTH_SINGLE_COLUMN, "admin-users-edit-modal", "edit"),
207
- overlay(PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS.overlayHistory, PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS.layoutHistory, widgetLabels.history.title, { compact: "calc(100vw - 32px)", medium: "90vw", wide: 980 }, "admin-users-history-modal"),
205
+ overlay(PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS.overlayCreate, PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS.layoutCreate, widgetLabels.editor.addTitle, { size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN } }, "admin-users-create-modal", "create"),
206
+ overlay(PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS.overlayEdit, PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS.layoutEdit, widgetLabels.editor.editTitle, { size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN } }, "admin-users-edit-modal", "edit"),
207
+ overlay(PHI_USER_MANAGEMENT_PAGE_OVERLAY_IDS.overlayHistory, PHI_USER_MANAGEMENT_PAGE_LAYOUT_IDS.layoutHistory, widgetLabels.history.title,
208
+ // A log of changes reads across: wide where the window is, and never more of it than nine tenths.
209
+ { size: { width: 980 }, maxSize: { width: "90vw" } }, "admin-users-history-modal"),
208
210
  ],
209
211
  regions: [scaffold.region],
210
212
  layoutNodes: [
@@ -247,6 +249,8 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
247
249
  typeKey: "table",
248
250
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
249
251
  sortOrder: 0,
252
+ // The Module's Label Set, translated already.
253
+ flags: PhiCmsFlags.NoTranslate,
250
254
  label: labels.tableLabel,
251
255
  config: {
252
256
  source: {
@@ -270,11 +274,10 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
270
274
  renderer: "badge",
271
275
  sizing: { mode: "content" },
272
276
  valueMap: {
273
- customer: widgetLabels.accountTypes.external,
274
- roles: widgetLabels.accountTypes.roles,
275
- auth: widgetLabels.accountTypes.auth,
277
+ staff: widgetLabels.accountTypes.staff,
278
+ customer: widgetLabels.accountTypes.customer,
276
279
  },
277
- tagColorMap: { customer: "processing", roles: "error", auth: "warning" },
280
+ tagColorMap: { staff: "error", customer: "warning" },
278
281
  },
279
282
  {
280
283
  key: "roleTags",
@@ -325,11 +328,10 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
325
328
  key: "accountType",
326
329
  type: "select",
327
330
  label: widgetLabels.columns.account,
328
- defaultValue: "roles",
331
+ defaultValue: "staff",
329
332
  options: [
330
- { value: "customer", label: widgetLabels.accountTypes.external },
331
- { value: "roles", label: widgetLabels.accountTypes.roles },
332
- { value: "auth", label: widgetLabels.accountTypes.auth },
333
+ { value: "staff", label: widgetLabels.accountTypes.staff },
334
+ { value: "customer", label: widgetLabels.accountTypes.customer },
333
335
  ],
334
336
  },
335
337
  {
@@ -378,10 +380,7 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
378
380
  icon: "edit",
379
381
  display: "icon",
380
382
  execution: "signal",
381
- disabledWhen: { match: "any", conditions: [
382
- readOnlyCondition,
383
- { source: "row", valuePath: "medusaCustomerId", operator: "truthy", reason: widgetLabels.actions.editDisabled },
384
- ] },
383
+ disabledWhen: readOnlyCondition,
385
384
  },
386
385
  {
387
386
  key: "delete",
@@ -601,6 +600,8 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
601
600
  typeKey: "table",
602
601
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
603
602
  sortOrder: 0,
603
+ // The Module's Label Set, translated already.
604
+ flags: PhiCmsFlags.NoTranslate,
604
605
  label: "admin users login history table",
605
606
  config: {
606
607
  source: {
@@ -2,7 +2,7 @@ import "server-only";
2
2
  import type { PhiBlockRuntime } from "../types";
3
3
  import type { PhiCmsRoutePresetBinding } from "../types/cms-module-descriptors";
4
4
  import type { PhiRuntimeModuleCatalog, PhiRuntimeModuleId } from "../types/cms-plugins";
5
- import type { PhiPageRecordBinding } from "../types/record-provider";
5
+ import type { PhiPageRecordBinding, PhiRecordPicture } from "../types/record-provider";
6
6
  /**
7
7
  * The record a route's Page is about, read before anything is drawn (MODULES.md, "The fields of a record,
8
8
  * and the record a Page is about").
@@ -17,6 +17,14 @@ export type PhiCmsPageRecord = {
17
17
  binding: PhiPageRecordBinding;
18
18
  title: string | null;
19
19
  description: string | null;
20
+ /** What a link to the Page shows of the record, from the fields its Provider marks (`record.share`). */
21
+ preview: PhiCmsPageRecordPreview;
22
+ };
23
+ /** The record's own answer for a link preview; each `null` where the Provider marks no field or the record lacks it. */
24
+ export type PhiCmsPageRecordPreview = {
25
+ title: string | null;
26
+ description: string | null;
27
+ image: PhiRecordPicture | null;
20
28
  };
21
29
  export declare function resolvePhiCmsPageRecord({ binding, runtime, runtimeModuleCatalog, activeModuleIds }: {
22
30
  binding: PhiCmsRoutePresetBinding;
@@ -48,5 +48,15 @@ export async function resolvePhiCmsPageRecord({ binding, runtime, runtimeModuleC
48
48
  ...(declaration.titleField ? { titleField: declaration.titleField } : {}),
49
49
  ...(declaration.descriptionField ? { descriptionField: declaration.descriptionField } : {}),
50
50
  };
51
- return { status: "ok", binding: pageBinding, title: text(declaration.titleField), description: text(declaration.descriptionField) };
51
+ return {
52
+ status: "ok",
53
+ binding: pageBinding,
54
+ title: text(declaration.titleField),
55
+ description: text(declaration.descriptionField),
56
+ preview: {
57
+ title: text(declared.share?.titleField),
58
+ description: text(declared.share?.descriptionField),
59
+ image: readPhiPageRecordField(fields, declared.share?.imageField, ["picture"])?.value ?? null,
60
+ },
61
+ };
52
62
  }
@@ -45,8 +45,8 @@ async function instantiatePhiRoutePresetPage({ binding, requestedPath, areaMask,
45
45
  path: requestedPath,
46
46
  runtime,
47
47
  loadModuleMedia: createPhiModuleMediaLoader(runtime.site.key),
48
- // The route's title is the owning Module's text, written in that Module's language.
49
- resolveMissingPageTitle: (sourceTitle) => trForLocale(runtime.locale.current, sourceTitle, 0, 0, "text", catalog.sourceLocaleByModuleId.get(binding.descriptor.ownerModuleId)),
48
+ // The route's title and description are the owning Module's text, written in that Module's language.
49
+ translateRouteText: (source) => trForLocale(runtime.locale.current, source, 0, 0, "text", catalog.sourceLocaleByModuleId.get(binding.descriptor.ownerModuleId)),
50
50
  }), { runtimeModuleCatalog, siteKey: runtime.site.key, locale: runtime.locale.current }),
51
51
  };
52
52
  }
@@ -209,11 +209,13 @@ function mapResolvedPageToRequestedContext(pagePayload, areaMask, path) {
209
209
  }
210
210
  /** The record's own title and description on the Page; `msgId: 0`, because they are no Site message. */
211
211
  function applyPhiPageRecordMeta(pagePayload, record) {
212
- if (!record.title && !record.description) {
213
- return pagePayload;
214
- }
215
212
  const field = (value) => ({ msgId: 0, source: value, value });
216
213
  const pageMeta = pagePayload.page.pageMeta;
214
+ const { preview } = record;
215
+ const hasPreview = preview.title !== null || preview.description !== null || preview.image !== null;
216
+ if (!record.title && !record.description && !hasPreview) {
217
+ return pagePayload;
218
+ }
217
219
  return {
218
220
  ...pagePayload,
219
221
  page: {
@@ -221,6 +223,7 @@ function applyPhiPageRecordMeta(pagePayload, record) {
221
223
  pageMeta: {
222
224
  title: record.title ? field(record.title) : pageMeta?.title ?? null,
223
225
  description: record.description ? field(record.description) : pageMeta?.description ?? null,
226
+ ...(hasPreview ? { preview } : {}),
224
227
  },
225
228
  },
226
229
  };
@@ -0,0 +1,30 @@
1
+ import "server-only";
2
+ import type { PhiLinkPreviewImage } from "../helpers/phi-metadata";
3
+ import type { PhiShareImage } from "../types/link-preview";
4
+ /**
5
+ * The Asset a record picture's address delivers, or `null` where it is no Media address of this Site.
6
+ *
7
+ * A record names its picture by address (`PhiRecordPicture.src`), Site-relative or absolute; a preview
8
+ * picture has to be an Asset, because only an Asset has a share variant and a delivery policy to ask.
9
+ * An absolute address counts only on the Site's own public base.
10
+ */
11
+ export declare function readPhiMediaDeliveryAssetId(src: string, publicBase: string | null): number | null;
12
+ /**
13
+ * The picture a link preview shows: the first candidate that is a publicly delivered image of the Site
14
+ * Space, as its share variant (1200 x 630, `PhiImageAssetVariantKey.Share`).
15
+ *
16
+ * The candidates come in the order the Page answers -- the record's picture, the Page's own setting, the
17
+ * Theme's -- and are asked about in one request, the reference projection every render resolves Assets
18
+ * through, which answers only what a visitor may be served: an Asset that is not public, not ready, of
19
+ * another Space or no image is not there, and the next candidate stands. None is no picture, and so is a
20
+ * Site without a public base, which cannot name an absolute address.
21
+ */
22
+ export declare function resolvePhiLinkPreviewImage({ apiBaseUrl, internalToken, siteKey, publicBase, candidates, fallbackAlt, }: {
23
+ apiBaseUrl: string;
24
+ internalToken: string;
25
+ siteKey: string;
26
+ publicBase: string | null;
27
+ candidates: readonly (PhiShareImage | null)[];
28
+ /** What the picture says where neither the candidate nor the Asset says anything: the preview's title. */
29
+ fallbackAlt: string;
30
+ }): Promise<PhiLinkPreviewImage | null>;
@@ -0,0 +1,57 @@
1
+ import "server-only";
2
+ import { PhiImageAssetVariantKey, PhiMediaKind, buildPhiImageAssetVariantDeliveryUrl, resolvePhiImageAssetVariantSpec, } from "../constants/media";
3
+ import { resolveSiteInternalReferences } from "../gateway/internal-references";
4
+ /** A Media delivery address of the Site: `/api/site/media/<id>/content` or one of its variants. */
5
+ const PHI_MEDIA_DELIVERY_PATH = /^\/api\/site\/media\/(\d+)\/(?:content|variants\/\d+)(?:[?#].*)?$/u;
6
+ /**
7
+ * The Asset a record picture's address delivers, or `null` where it is no Media address of this Site.
8
+ *
9
+ * A record names its picture by address (`PhiRecordPicture.src`), Site-relative or absolute; a preview
10
+ * picture has to be an Asset, because only an Asset has a share variant and a delivery policy to ask.
11
+ * An absolute address counts only on the Site's own public base.
12
+ */
13
+ export function readPhiMediaDeliveryAssetId(src, publicBase) {
14
+ const trimmed = src.trim();
15
+ const path = publicBase && trimmed.startsWith(`${publicBase}/`) ? trimmed.slice(publicBase.length) : trimmed;
16
+ const match = PHI_MEDIA_DELIVERY_PATH.exec(path);
17
+ const id = match ? Number(match[1]) : NaN;
18
+ return Number.isSafeInteger(id) && id > 0 ? id : null;
19
+ }
20
+ /**
21
+ * The picture a link preview shows: the first candidate that is a publicly delivered image of the Site
22
+ * Space, as its share variant (1200 x 630, `PhiImageAssetVariantKey.Share`).
23
+ *
24
+ * The candidates come in the order the Page answers -- the record's picture, the Page's own setting, the
25
+ * Theme's -- and are asked about in one request, the reference projection every render resolves Assets
26
+ * through, which answers only what a visitor may be served: an Asset that is not public, not ready, of
27
+ * another Space or no image is not there, and the next candidate stands. None is no picture, and so is a
28
+ * Site without a public base, which cannot name an absolute address.
29
+ */
30
+ export async function resolvePhiLinkPreviewImage({ apiBaseUrl, internalToken, siteKey, publicBase, candidates, fallbackAlt, }) {
31
+ const stated = candidates.filter((candidate) => candidate !== null);
32
+ const spec = resolvePhiImageAssetVariantSpec(PhiImageAssetVariantKey.Share);
33
+ if (!publicBase || stated.length === 0 || !spec)
34
+ return null;
35
+ const { assets } = await resolveSiteInternalReferences({
36
+ apiBaseUrl,
37
+ internalToken,
38
+ siteKey,
39
+ assetIds: stated.map((candidate) => candidate.assetId),
40
+ });
41
+ for (const candidate of stated) {
42
+ const asset = assets.get(candidate.assetId);
43
+ if (!asset || asset.kind !== PhiMediaKind.Image)
44
+ continue;
45
+ const path = buildPhiImageAssetVariantDeliveryUrl(asset.id, PhiImageAssetVariantKey.Share, asset.variantVersion, asset.deliveryRevision);
46
+ if (!path)
47
+ continue;
48
+ return {
49
+ url: `${publicBase}${path}`,
50
+ width: spec.width,
51
+ height: spec.height,
52
+ alt: candidate.alt?.trim() || asset.altText?.trim() || asset.title?.trim() || fallbackAlt,
53
+ type: spec.format === "jpeg" ? "image/jpeg" : "image/webp",
54
+ };
55
+ }
56
+ return null;
57
+ }
@@ -100,6 +100,9 @@ export function readPhiMarkdownSearchText(blocks) {
100
100
  case "image":
101
101
  push(block.image.alt);
102
102
  break;
103
+ case "table_embed":
104
+ push(block.caption);
105
+ break;
103
106
  case "divider":
104
107
  break;
105
108
  }
@@ -1,6 +1,6 @@
1
1
  export { tr, trGlobal, trForLocale, trGlobalForLocale, trBulk, trBulkForLocale, trGlobalBulk, trGlobalBulkForLocale, PHI_TR_CTX_WEB_UI_LABEL, } from "./server-helpers/translate";
2
2
  export { phiRuntime } from "./server-helpers/phi-runtime";
3
- export { definePhiLabelSet, definePhiMessageLabel, definePhiRuntimeModuleLabelSet, getPhiLabelSet, type PhiLabelSetDefinition, type PhiLabelSetEntry, type PhiLabelSetLabels, type PhiLabelSetTexts, } from "./gateway/label-set";
3
+ export { definePhiCountLabel, definePhiLabelSet, definePhiMessageLabel, definePhiRuntimeModuleLabelSet, getPhiLabelSet, type PhiLabelSetCountEntry, type PhiLabelSetDefinition, type PhiLabelSetEntry, type PhiLabelSetLabels, type PhiLabelSetTexts, } from "./gateway/label-set";
4
4
  export type { PhiGlobalTranslatorOptions } from "./gateway/tr";
5
5
  export { readPhiServerApiCredentials } from "./helpers/phis-server-credentials";
6
6
  export type { PhiServerApiCredentials } from "./helpers/phis-server-credentials";
package/server-helpers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { tr, trGlobal, trForLocale, trGlobalForLocale, trBulk, trBulkForLocale, trGlobalBulk, trGlobalBulkForLocale, PHI_TR_CTX_WEB_UI_LABEL, } from "./server-helpers/translate";
2
2
  export { phiRuntime } from "./server-helpers/phi-runtime";
3
- export { definePhiLabelSet, definePhiMessageLabel, definePhiRuntimeModuleLabelSet, getPhiLabelSet, } from "./gateway/label-set";
3
+ export { definePhiCountLabel, definePhiLabelSet, definePhiMessageLabel, definePhiRuntimeModuleLabelSet, getPhiLabelSet, } from "./gateway/label-set";
4
4
  /*
5
5
  * The Site's own address for this server, for code that runs outside a request.
6
6
  *
@@ -270,6 +270,11 @@
270
270
  gap: var(--phi-builder-content-body-gap);
271
271
  }
272
272
 
273
+ :where(.phi-builder-spacer-box) {
274
+ min-width: 0;
275
+ min-height: 0;
276
+ }
277
+
273
278
  :where(.phi-builder-spacer) {
274
279
  position: absolute;
275
280
  inset: 0;
@@ -280,7 +285,8 @@
280
285
  gap: 8px;
281
286
  min-width: 0;
282
287
  min-height: 0;
283
- padding: var(--phi-padding-sm);
288
+ padding-block: var(--phi-builder-spacer-padding-block, var(--phi-padding-sm));
289
+ padding-inline: var(--phi-builder-spacer-padding-inline, var(--phi-padding-sm));
284
290
  box-sizing: border-box;
285
291
  pointer-events: none;
286
292
  }