@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,33 @@
1
+ import { isPhiBuilderAreaKey } from "../../../../constants/cms-areas";
2
+ import { findPhiBuilderPageKeyFromPresetSource, findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageCatalog, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
3
+ import { isPhiRecord } from "../../../../helpers/is-record";
4
+ /**
5
+ * Which cached Builder context a restore or a Page reset replaced, read off the scope the Revisions
6
+ * Table acted on.
7
+ *
8
+ * A Page scope names its Page by storage path when it is the Site's own, and by preset identity when it
9
+ * is a Module's -- then its `path` is null. A Page scope that names no Page of the catalog has no target:
10
+ * the Area alone means its Shell, and discarding the Shell's edits for a Page's revision lost them while
11
+ * the Page kept showing what was replaced.
12
+ */
13
+ export function resolvePhiRevisionsDraftContextTarget(scope, areaModules, catalog) {
14
+ const area = scope?.area;
15
+ if (!isPhiBuilderAreaKey(area)) {
16
+ return null;
17
+ }
18
+ if (scope?.kind === "area") {
19
+ return areaModules ? { area, areaModules: true } : { area };
20
+ }
21
+ if (scope?.kind !== "page") {
22
+ return null;
23
+ }
24
+ const pages = resolvePhiBuilderActivePageCatalog(area, catalog.modulePresetPagesByArea, catalog.customPages, catalog.persistedPageCatalogByArea);
25
+ const source = isPhiRecord(scope.sourcePreset) ? scope.sourcePreset : null;
26
+ const pageKey = typeof scope.path === "string"
27
+ ? findPhiBuilderPageKeyFromStoragePath(area, scope.path, pages)
28
+ ?? resolvePhiBuilderPageKeyFromCatalogPath(area, scope.path, pages)
29
+ : typeof source?.ownerModuleId === "string" && typeof source.presetKey === "string"
30
+ ? findPhiBuilderPageKeyFromPresetSource({ ownerModuleId: source.ownerModuleId, presetKey: source.presetKey }, pages)
31
+ : null;
32
+ return pageKey === null ? null : { area, pageKey };
33
+ }
@@ -44,6 +44,10 @@ export declare const PHI_REVISIONS_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>;
@@ -8,7 +8,7 @@ import { PhiTableProviderError, } from "../../../../types/table-widget";
8
8
  import { createPhiTableProviderClient } from "../../../../components/widgets/client/shared/phi-table-provider";
9
9
  import { PHI_REVISIONS_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "../../../../plugins/runtime-modules/revisions/data-providers";
10
10
  import { getPhiWorkspaceCatalogSnapshot, } from "../../../../components/workspace/catalog-store";
11
- import { resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
11
+ import { resolvePhiBuilderActivePageCatalog, findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
12
12
  import { PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM, PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM, PHI_BUILDER_THEME_KEY_SEARCH_PARAM, normalizePhiBuilderRevisionsKindSearchParam, } from "../../../../helpers/cms-scope-search-params";
13
13
  import { resolvePhiBuilderRevisionPagePath, resolvePhiBuilderRevisionScope, } from "../types";
14
14
  import { resolvePhiBuilderRevisionNavScopeKey } from "../../../../helpers/cms-navigation-scope-key";
@@ -73,8 +73,16 @@ function readParams(value) {
73
73
  * moment rather than a fault. A page scope without a page asks for nothing and shows nothing, and
74
74
  * fills in as soon as there is one.
75
75
  */
76
+ /*
77
+ * The Page a page scope names, by the address it answers on: the Page Select, the Controller and the
78
+ * `revisionScope` search parameter all hand the storage path, package namespace included. Matched
79
+ * against the path the Builder shows instead, a Module Page (`/phis/ui/dashboard`, shown as
80
+ * `/dashboard`) was found nowhere, read as a Site Page of that path and asked for by a path its row
81
+ * does not have -- so its history was empty and "Reset to preset" had no preset to name.
82
+ */
76
83
  const pageKey = kind === "page" && configuredScopeKey.startsWith("/")
77
- ? resolvePhiBuilderPageKeyFromCatalogPath(scopeArea, configuredScopeKey, pages)
84
+ ? findPhiBuilderPageKeyFromStoragePath(scopeArea, configuredScopeKey, pages)
85
+ ?? resolvePhiBuilderPageKeyFromCatalogPath(scopeArea, configuredScopeKey, pages)
78
86
  : activePageKey ?? "";
79
87
  const navScopeKey = kind === "navigation" && configuredScopeKey
80
88
  ? resolvePhiBuilderRevisionNavScopeKey(scopeArea, configuredScopeKey)
@@ -148,12 +156,13 @@ async function loadRevisionHistory(scope, signal) {
148
156
  * Nothing is being asked about yet.
149
157
  *
150
158
  * Both cases are the same moment: a panel opened before the workspace catalog arrived. A page scope
151
- * has no page and an Area scope has no preset source -- and the Area scope is refused by the server
159
+ * has no page -- neither a Site Page's path nor a Module Page's preset -- and an Area scope has no
160
+ * preset source -- and the Area scope is refused by the server
152
161
  * rather than the client, because a revision belongs to a preset and an Area without one names
153
162
  * nothing. Asking anyway answers a surface that is waiting with an error; the scope key carries the
154
163
  * preset, so the question is asked again by itself once there is one.
155
164
  */
156
- if ((scope.kind === "page" && !scope.path) ||
165
+ if ((scope.kind === "page" && !scope.path && !scope.sourcePreset) ||
157
166
  (scope.kind === "area" && !scope.sourcePreset)) {
158
167
  return {
159
168
  kind: scope.kind,
@@ -95,7 +95,7 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
95
95
  label: "Builder delete area",
96
96
  config: {
97
97
  title: revisionsLabels.deleteArea.title,
98
- width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
98
+ size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
99
99
  /*
100
100
  * `remount` rather than `lazy-keep`: the field is the confirmation, and a dialog that kept a
101
101
  * half-typed Area key from the last time it was opened would carry an answer across to a
@@ -396,6 +396,8 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
396
396
  id: PHI_REVISIONS_TABLE_WIDGET_ID,
397
397
  parentLayoutNodeId: PHI_REVISIONS_PAGE_LAYOUT_IDS.layoutContent,
398
398
  slotIndex: 0,
399
+ // The Module's Label Set, translated already.
400
+ flags: PhiCmsFlags.NoTranslate,
399
401
  label: "dev revisions table",
400
402
  config: {
401
403
  source: {
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { PhiEmptyControl } from "../../../../../components/controls/phi-empty-control";
4
4
  import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
5
5
  import { PhiLink } from "../../../../../components/navigation/phi-link";
6
- import { formatPhiTranslation } from "../../../../../helpers/translation-format";
6
+ import { usePhiIntlLocale } from "../../../../../components/root/phi-intl-locale";
7
+ import { formatPhiCountLabel, formatPhiTranslation } from "../../../../../helpers/translation-format";
7
8
  import { PHI_SPACE } from "../../../../../theme/antd-css-var-contract";
8
9
  function PhiSearchSnippet({ segments }) {
9
10
  if (segments.length === 0)
@@ -18,6 +19,7 @@ function PhiSearchSnippet({ segments }) {
18
19
  * answered, so a reader who arrived by a pasted link knows what they are looking at.
19
20
  */
20
21
  export function PhiSearchResultsWidgetClient({ labels, config }) {
22
+ const locale = usePhiIntlLocale();
21
23
  if (!config)
22
24
  return null;
23
25
  if (config.state === "idle") {
@@ -27,6 +29,6 @@ export function PhiSearchResultsWidgetClient({ labels, config }) {
27
29
  return (_jsx(PhiTypographyControl, { type: "secondary", children: formatPhiTranslation(labels.short, [String(config.minLength)]) }));
28
30
  }
29
31
  const heading = config.title ?? formatPhiTranslation(labels.heading, [config.query]);
30
- const count = config.total === 1 ? labels.countOne : formatPhiTranslation(labels.count, [String(config.total)]);
32
+ const count = formatPhiCountLabel(labels.count, config.total, locale);
31
33
  return (_jsxs("section", { "aria-label": labels.region, style: { display: "flex", flexDirection: "column", gap: PHI_SPACE.sm }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: PHI_SPACE.xxs }, children: [_jsx(PhiTypographyControl, { presentation: "title", level: 2, style: { marginTop: 0, marginBottom: 0 }, children: heading }), config.hits.length > 0 ? _jsx(PhiTypographyControl, { type: "secondary", children: count }) : null] }), config.hits.length === 0 ? (_jsx(PhiEmptyControl, { description: formatPhiTranslation(labels.empty, [config.query]) })) : (_jsx("ol", { style: { listStyle: "none", margin: 0, padding: 0, display: "flex", flexDirection: "column", gap: PHI_SPACE.base }, children: config.hits.map((hit) => (_jsxs("li", { style: { display: "flex", flexDirection: "column", gap: PHI_SPACE.xxs }, children: [_jsx(PhiTypographyControl, { presentation: "title", level: 3, style: { marginTop: 0, marginBottom: 0 }, children: _jsx(PhiLink, { href: hit.href, children: hit.title }) }), _jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: "0.85em" }, children: hit.href }), hit.description ? (_jsx(PhiTypographyControl, { presentation: "paragraph", style: { marginBottom: 0 }, children: hit.description })) : null, _jsx(PhiSearchSnippet, { segments: hit.snippet })] }, hit.href))) }))] }));
32
34
  }
@@ -75,6 +75,10 @@ export declare const PHI_THEME_RUNTIME_MODULE_ROUTES: {
75
75
  path: string;
76
76
  landingPage?: true;
77
77
  title: string;
78
+ description?: string;
79
+ shareImage?: {
80
+ asset: string;
81
+ };
78
82
  defaultPageFlags?: number;
79
83
  loadTree: (context: import("../../../types").PhiCmsDescriptorBuildContext & {
80
84
  activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
@@ -22,6 +22,7 @@ import { usePhiSiteFontAssets } from "../../../../../components/media/phi-site-f
22
22
  import { buildPhiFontFaceCss, buildPhiFontFamilyStack } from "../../../../../theme/phi-font-face";
23
23
  import { PHI_THEME_HEADING_FONT_VARIABLE, readPhiThemeHeadingFont, resolvePhiThemeHeadingFontFamily, } from "../../../../../theme/phi-theme-typography";
24
24
  import { resolvePhiThemeRuntimePayload } from "../../../../../theme/phi-theme-runtime";
25
+ import { buildPhiThemeInverseGroundTokens } from "../../../../../theme/phi-theme-inverse-ground";
25
26
  import { resolvePhiAntdAliasTokens } from "../../../../../theme/phi-antd-token-resolver";
26
27
  import { buildPhiThemeStructuralTokens } from "../../../../../theme/phi-theme";
27
28
  import { PHI_CONTROL_HEIGHTS, PHI_LAYOUT, PHI_PADDING, PHI_RADII, } from "../../../../../theme/phi-tokens";
@@ -41,7 +42,8 @@ import { normalizePhiBackgroundWidgetConfig } from "../../../../../components/wi
41
42
  import { PhiMediaPickerBinding } from "../../../../../components/media/phi-media-picker-binding";
42
43
  import { usePhiMediaPickerLabels } from "../../../../../components/media/phi-media-picker-labels";
43
44
  import { PHI_SEARCH_WIDGET_DEFAULT_LABELS } from "../../../../../components/widgets/label-types/search";
44
- import { buildPhiMediaAssetContentDeliveryUrl, PhiMediaAssetFlags, PhiMediaKind, } from "../../../../../constants/media";
45
+ import { buildPhiMediaAssetContentDeliveryUrl, isPhiMediaAssetPublic, PhiMediaAssetFlags, PhiMediaKind, } from "../../../../../constants/media";
46
+ import { readPhiXAccount } from "../../../../../types/link-preview";
45
47
  import { PhiPresetSizeControl } from "../../../../../components/controls/phi-preset-size-control";
46
48
  import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
47
49
  import { PhiCheckboxControl } from "../../../../../components/controls/phi-checkbox-control";
@@ -79,9 +81,9 @@ const PHI_THEME_CHROME_SHADOW_EDGES = [
79
81
  const BRAND_THEME_COLOR_COLLAPSE_STORAGE_KEY = "phi.builder.brand.theme.colorCollapse.activeKey";
80
82
  const BRAND_THEME_STYLE_COLLAPSE_STORAGE_KEY = "phi.builder.brand.theme.styleCollapse.activeKey";
81
83
  const BRAND_THEME_BACKGROUND_COLLAPSE_STORAGE_KEY = "phi.builder.brand.theme.backgroundCollapse.activeKey";
82
- const BRAND_THEME_BACKGROUND_SECTION_KEYS = ["root", "chrome", "shadow"];
84
+ const BRAND_THEME_BACKGROUND_SECTION_KEYS = ["root", "chrome", "inverse", "shadow"];
83
85
  const BRAND_THEME_IDENTITY_COLLAPSE_STORAGE_KEY = "phi.builder.brand.theme.identityCollapse.activeKey";
84
- const BRAND_THEME_IDENTITY_SECTION_KEYS = ["logo", "wordmark", "lines"];
86
+ const BRAND_THEME_IDENTITY_SECTION_KEYS = ["logo", "wordmark", "lines", "share"];
85
87
  const BRAND_THEME_STYLE_SECTION_KEYS = [
86
88
  "shapes",
87
89
  "buttonShadow",
@@ -487,6 +489,7 @@ function resolveBrandDraftAliasTokens(resolvedTheme, preset, mode, fonts = {}) {
487
489
  }),
488
490
  ...buildPhiThemeLinkTokens(resolvedTheme.links),
489
491
  ...buildPhiSurfaceShadowTokens(resolvedTheme.shadows, mode),
492
+ ...buildPhiThemeInverseGroundTokens(resolvedTheme.root?.inverse, mode, aliasTokens),
490
493
  };
491
494
  }
492
495
  function readEffectiveTokenNumber(token, key, fallback) {
@@ -543,6 +546,22 @@ function mergeThemeRootSurface(theme, surface, mode, value) {
543
546
  },
544
547
  };
545
548
  }
549
+ /**
550
+ * One mode's Inverse Ground set, the other mode's kept. Opaque by construction: the picker offers no
551
+ * alpha, and the Theme's reader refuses a colour with any.
552
+ */
553
+ function mergeThemeInverseGround(theme, mode, value) {
554
+ return {
555
+ ...theme,
556
+ root: {
557
+ ...(theme.root ?? {}),
558
+ inverse: {
559
+ ...(theme.root?.inverse ?? {}),
560
+ [mode]: value,
561
+ },
562
+ },
563
+ };
564
+ }
546
565
  function mergeThemeChromeShadow(theme, family, value) {
547
566
  return {
548
567
  ...theme,
@@ -1475,6 +1494,9 @@ function clearThemeRootSurface(theme, surface, mode) {
1475
1494
  if (surface === "background") {
1476
1495
  return { ...theme, root: { ...root, background: without(root.background, mode) } };
1477
1496
  }
1497
+ if (surface === "inverse") {
1498
+ return { ...theme, root: { ...root, inverse: without(root.inverse, mode) } };
1499
+ }
1478
1500
  return {
1479
1501
  ...theme,
1480
1502
  root: { ...root, chrome: without(root.chrome, surface === "shadow" ? "shadow" : mode) },
@@ -1741,6 +1763,31 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
1741
1763
  "--phi-labeled-control-width": "100%",
1742
1764
  }, children: [_jsx(PhiBrandLineFields, { label: "Slogan", placeholder: "What the Site says about itself", fallbackIcon: "antd:star", line: brand.slogan, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, { slogan: next })) }), _jsx(PhiBrandLineFields, { label: "Location", placeholder: "Where the Site says it is", fallbackIcon: "antd:location", line: brand.location, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, { location: next })) })] })),
1743
1765
  },
1766
+ {
1767
+ /*
1768
+ * What a link to the Site shows in a messenger or a feed where the Page says nothing of its
1769
+ * own (NEXT_INTEGRATION.md, "Link previews"). Only a picture every visitor is served can be
1770
+ * shown there, so the picker offers the Site Space and greys out the rest.
1771
+ */
1772
+ key: "share",
1773
+ label: _jsx(PhiTypographyControl, { strong: true, children: "Link preview" }),
1774
+ children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, style: {
1775
+ "--phi-labeled-control-label-width": "33.333333%",
1776
+ "--phi-labeled-control-width": "100%",
1777
+ }, children: [_jsx(PhiTypographyControl, { type: "secondary", children: "The picture a shared link shows where its Page states none, cut to 1200 x 630 around its focus. Only a publicly delivered picture can be chosen." }), _jsx(PhiMediaPickerBinding, { config: {
1778
+ mediaType: PhiMediaKind.Image,
1779
+ pageSize: 12,
1780
+ showPagination: true,
1781
+ showGroupFilter: true,
1782
+ showSearchBar: true,
1783
+ }, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, siteSpaceOnly: true, isAssetSelectable: (asset) => isPhiMediaAssetPublic(asset.deliveryPolicy, asset.lifecycleStatus), value: brand.shareImage?.assetId ?? null, onAssetSelect: (asset) => publishDraft(mergeThemeBrand(state.draft, {
1784
+ shareImage: { assetId: asset.id, ...(brand.shareImage?.alt ? { alt: brand.shareImage.alt } : {}) },
1785
+ })), onAssetClear: () => publishDraft(mergeThemeBrand(state.draft, { shareImage: null })) }), _jsx(PhiLabeledControl, { label: "Alt", fill: true, children: _jsx(PhiTextControl, { value: brand.shareImage?.alt ?? "", placeholder: "Alt text", ariaLabel: "Link preview alt text", allowClear: false, disabled: !brand.shareImage, onChange: (next) => brand.shareImage && publishDraft(mergeThemeBrand(state.draft, {
1786
+ shareImage: next?.trim()
1787
+ ? { assetId: brand.shareImage.assetId, alt: next }
1788
+ : { assetId: brand.shareImage.assetId },
1789
+ })) }) }), _jsx(PhiLabeledControl, { label: "X account", fill: true, children: _jsx(PhiTextControl, { value: brand.xAccount ?? "", placeholder: "@account", ariaLabel: "X account", allowClear: false, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, { xAccount: next?.trim() ?? "" })) }) }), brand.xAccount && !readPhiXAccount(brand.xAccount) ? (_jsx(PhiTypographyControl, { type: "danger", children: "An X account is @ and up to 15 letters, digits or underscores. This one is not stated." })) : null] })),
1790
+ },
1744
1791
  ] }) }) }));
1745
1792
  }
1746
1793
  /**
@@ -1751,12 +1798,29 @@ function isSamePhiBackgroundConfig(left, right) {
1751
1798
  return JSON.stringify(left) === JSON.stringify(right);
1752
1799
  }
1753
1800
  export function PhiBuilderBrandBackgroundControlsWidgetClient({ runtime, config, }) {
1754
- const { token: clientToken } = usePhiConfig();
1801
+ const { presets: themePresets, token: clientToken } = usePhiConfig();
1755
1802
  const themeBlocks = usePhiThemeBlockCatalog();
1756
1803
  const themeKey = resolveThemeKey(config);
1757
1804
  const { state, publishDraft, editTransaction } = usePhiBrandThemeDraft(runtime, themeKey);
1758
1805
  const mode = usePhiBrandPreviewMode(resolveThemePayloadMode(state.draft), config?.signalRoutes);
1759
1806
  const composition = resolvePhiThemeComposition(state.draft, themeBlocks);
1807
+ /*
1808
+ * The Inverse Ground the mode being authored paints, as the live render resolves it: the stated colour,
1809
+ * else the mode's own container ground. The control shows that, so an author sees what an inverse box
1810
+ * stands on before anybody stated one.
1811
+ */
1812
+ const inverseGround = useMemo(() => {
1813
+ const resolvedDraft = resolvePhiThemeRuntimePayload(state.draft, themeBlocks).theme;
1814
+ return String(resolveBrandDraftAliasTokens(resolvedDraft, resolveThemePayloadPreset(resolvedDraft, themePresets), mode).inverseGround);
1815
+ }, [mode, state.draft, themeBlocks, themePresets]);
1816
+ const inverseGroundCustomColors = useMemo(() => {
1817
+ const palette = resolveThemeCustomPalette(state.draft, resolveThemePayloadPreset(state.draft, themePresets), mode);
1818
+ return PHI_THEME_CUSTOM_COLOR_KEYS.map((key, index) => ({ key, label: `Custom ${index + 1}`, value: palette[key] }));
1819
+ }, [mode, state.draft, themePresets]);
1820
+ const inverseGroundPresets = usePhiColorControlPresets({
1821
+ customColors: inverseGroundCustomColors,
1822
+ presets: PHI_COLOR_PICKER_PRESETS,
1823
+ });
1760
1824
  const [activeBackgroundSection, changeActiveBackgroundSection] = usePhiBrandAccordionSection(BRAND_THEME_BACKGROUND_COLLAPSE_STORAGE_KEY, BRAND_THEME_BACKGROUND_SECTION_KEYS);
1761
1825
  const modeLabel = mode === "dark" ? "Dark mode" : "Light mode";
1762
1826
  const otherMode = mode === "dark" ? "light" : "dark";
@@ -1785,6 +1849,14 @@ export function PhiBuilderBrandBackgroundControlsWidgetClient({ runtime, config,
1785
1849
  label: _jsx(PhiTypographyControl, { strong: true, children: "Chrome Overlay" }),
1786
1850
  children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". Shared by the Header, Sider and Footer Regions. Content and Hero never take it, and a Region that authors its own Background or Effect paints over it."] }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: state.draft.root?.chrome?.[mode] == null, blockTitle: composition.ground.title, onReset: () => publishDraft(clearThemeRootSurface(state.draft, "chrome", mode)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: isSamePhiBackgroundConfig(chromeOverlay, otherChromeOverlay), onCopy: () => publishDraft(mergeThemeRootSurface(state.draft, "chrome", otherMode, chromeOverlay)) })] })] }), _jsx(PhiBackgroundControl, { value: chromeOverlay, motionModes: PHI_SHELL_CHROME_OVERLAY_MOTION_MODES, filters: PHI_SHELL_CHROME_OVERLAY_FILTERS, baseKinds: PHI_SHELL_CHROME_OVERLAY_BASE_KINDS, imageSourceKinds: PHI_SHELL_CHROME_OVERLAY_IMAGE_SOURCE_KINDS, renderMediaPicker: renderPhiThemeRootBackgroundMediaPicker, editTransaction: editTransaction, onChange: (value) => publishDraft(mergeThemeRootSurface(state.draft, "chrome", mode, value)) }, `chrome-${mode}`)] })),
1787
1851
  },
1852
+ {
1853
+ key: "inverse",
1854
+ label: _jsx(PhiTypographyControl, { strong: true, children: "Inverse Ground" }),
1855
+ children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". What a Surface toned Inverse stands on when it is drawn in this mode, on a page in the other one. Always opaque; unset, it is this mode's container colour."] }), _jsx(PhiBrandBlockResetButton, { disabled: state.draft.root?.inverse?.[mode] == null, blockTitle: composition.ground.title, onReset: () => publishDraft(clearThemeRootSurface(state.draft, "inverse", mode)) })] }), _jsx(PhiColorControl, { mode: "single", disabledAlpha: true, value: inverseGround, presets: inverseGroundPresets, onChange: (next) => {
1856
+ if (next)
1857
+ publishDraft(mergeThemeInverseGround(state.draft, mode, next));
1858
+ } }, `inverse-${mode}`)] })),
1859
+ },
1788
1860
  {
1789
1861
  key: "shadow",
1790
1862
  label: _jsx(PhiTypographyControl, { strong: true, children: "Chrome Shadow" }),
@@ -1,6 +1,7 @@
1
1
  import type { PhiCmsWidgetPlugin } from "../../../../../types";
2
- import { type PhiControlSignalConfig } from "../../../../../components/widgets/config/control-signal-config";
3
- export type PhiBuilderBrandWidgetConfig = Pick<PhiControlSignalConfig, "key" | "signalRoutes"> & {
2
+ import type { PhiControlSignalConfig } from "../../../../../components/widgets/config/control-signal-config";
3
+ /** Routes only: a panel listens and never emits, so it has no signal identity of its own. */
4
+ export type PhiBuilderBrandWidgetConfig = Pick<PhiControlSignalConfig, "signalRoutes"> & {
4
5
  themeKey?: string;
5
6
  };
6
7
  type PhiBuilderBrandWidgetDefinition = Pick<PhiCmsWidgetPlugin<PhiBuilderBrandWidgetConfig>, "kind" | "pluginKey" | "typeKey" | "title" | "description" | "category" | "iconFamily" | "runtimeSignals" | "requiredDataProviders" | "slotSizePolicy" | "fields" | "parseConfig">;
@@ -2,7 +2,7 @@ import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS } from "../../../../../constants/m
2
2
  import { PHI_THEME_SIGNAL_CHANNELS } from "../../../../../plugins/runtime-modules/theme/controller/signals";
3
3
  import { createPhiCmsWidgetDefinition } from "../../../../../components/widgets/config/helpers";
4
4
  import { readString } from "../../../../../components/widgets/config/parser-primitives";
5
- import { parsePhiControlSignalConfig, } from "../../../../../components/widgets/config/control-signal-config";
5
+ import { readPhiSignalRouteSet } from "../../../../../types/signals";
6
6
  function parseBuilderBrandWidgetConfig(config) {
7
7
  return {
8
8
  /*
@@ -10,7 +10,7 @@ function parseBuilderBrandWidgetConfig(config) {
10
10
  * wrote, so a route an author adds in the Builder works as well. The parser dropped them once and
11
11
  * the panels listened to a hard-coded broadcast, which left the declared input decoration.
12
12
  */
13
- ...parsePhiControlSignalConfig(config, { key: "brandPreviewThemeMode" }),
13
+ signalRoutes: readPhiSignalRouteSet(config.signalRoutes),
14
14
  themeKey: readString(config.themeKey),
15
15
  };
16
16
  }
@@ -1,30 +1,42 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
3
- import { PhiBuilderBrandBackgroundControlsWidgetClient, PhiBuilderBrandIdentityControlsWidgetClient, PhiBuilderBrandStyleControlsWidgetClient, PhiBuilderBrandThemeControlsWidgetClient, PhiBuilderBrandThemePreviewWidgetClient, } from "./client";
4
3
  import { PHI_BUILDER_BRAND_BACKGROUND_CONTROLS_WIDGET_DEFINITION, PHI_BUILDER_BRAND_IDENTITY_CONTROLS_WIDGET_DEFINITION, PHI_BUILDER_BRAND_STYLE_CONTROLS_WIDGET_DEFINITION, PHI_BUILDER_BRAND_THEME_CONTROLS_WIDGET_DEFINITION, PHI_BUILDER_BRAND_THEME_PREVIEW_WIDGET_DEFINITION, } from "./config";
5
4
  import { getPhiColorPickerLabels } from "../../../../../components/widgets/label-sets/color-picker";
6
5
  import { getPhiMediaWidgetLabels } from "../../../../../components/media/label-sets/media";
7
6
  import { PhiMediaPickerLabelsProvider } from "../../../../../components/media/phi-media-picker-labels";
7
+ import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
8
+ import { PhiRuntimeRenderClientType } from "../../../../../constants/runtime-render-client-types";
9
+ /*
10
+ * The five panels of the Theme workspace are Render Clients the Builder's Client manifest loads when one is
11
+ * drawn (`client-manifests/builder.tsx`), not Client components this server half imports: an import here
12
+ * put the whole workspace (`./client`, some 180 kB of source with what it reaches) into every Builder
13
+ * route's client graph, the dashboard's included, because a server-side `import()` defers nothing for the
14
+ * browser (TODOS.md, "The Builder got heavier").
15
+ */
8
16
  export const PHI_BUILDER_BRAND_THEME_CONTROLS_WIDGET_PLUGIN = {
9
17
  ...PHI_BUILDER_BRAND_THEME_CONTROLS_WIDGET_DEFINITION,
10
- render: async ({ runtime, config }) => (_jsx(PhiBuilderBrandThemeControlsWidgetClient, { runtime: runtime, config: config, colorPickerLabels: await getPhiColorPickerLabels(buildPhiWidgetLabelTranslatorOptions(runtime)) })),
18
+ render: async ({ runtime, config }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderBrandThemeControls, componentProps: {
19
+ runtime,
20
+ config,
21
+ colorPickerLabels: await getPhiColorPickerLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
22
+ } })),
11
23
  };
12
24
  export const PHI_BUILDER_BRAND_THEME_PREVIEW_WIDGET_PLUGIN = {
13
25
  ...PHI_BUILDER_BRAND_THEME_PREVIEW_WIDGET_DEFINITION,
14
- render: ({ runtime, config }) => _jsx(PhiBuilderBrandThemePreviewWidgetClient, { runtime: runtime, config: config }),
15
- renderPreview: ({ runtime }) => _jsx(PhiBuilderBrandThemePreviewWidgetClient, { runtime: runtime }),
26
+ render: ({ runtime, config }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderBrandThemePreview, componentProps: { runtime, config } })),
27
+ renderPreview: ({ runtime }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderBrandThemePreview, componentProps: { runtime } })),
16
28
  };
17
29
  export const PHI_BUILDER_BRAND_STYLE_CONTROLS_WIDGET_PLUGIN = {
18
30
  ...PHI_BUILDER_BRAND_STYLE_CONTROLS_WIDGET_DEFINITION,
19
- render: ({ runtime, config }) => _jsx(PhiBuilderBrandStyleControlsWidgetClient, { runtime: runtime, config: config }),
31
+ render: ({ runtime, config }) => (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderBrandStyleControls, componentProps: { runtime, config } })),
20
32
  };
21
33
  export const PHI_BUILDER_BRAND_BACKGROUND_CONTROLS_WIDGET_PLUGIN = {
22
34
  ...PHI_BUILDER_BRAND_BACKGROUND_CONTROLS_WIDGET_DEFINITION,
23
35
  // The picker the Background Control opens says its words in the reader's language.
24
- render: async ({ runtime, config }) => (_jsx(PhiMediaPickerLabelsProvider, { labels: await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)), children: _jsx(PhiBuilderBrandBackgroundControlsWidgetClient, { runtime: runtime, config: config }) })),
36
+ render: async ({ runtime, config }) => (_jsx(PhiMediaPickerLabelsProvider, { labels: await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)), children: _jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderBrandBackgroundControls, componentProps: { runtime, config } }) })),
25
37
  };
26
38
  export const PHI_BUILDER_BRAND_IDENTITY_CONTROLS_WIDGET_PLUGIN = {
27
39
  ...PHI_BUILDER_BRAND_IDENTITY_CONTROLS_WIDGET_DEFINITION,
28
40
  // The picker the Logo field opens says its words in the reader's language.
29
- render: async ({ runtime, config }) => (_jsx(PhiMediaPickerLabelsProvider, { labels: await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)), children: _jsx(PhiBuilderBrandIdentityControlsWidgetClient, { runtime: runtime, config: config }) })),
41
+ render: async ({ runtime, config }) => (_jsx(PhiMediaPickerLabelsProvider, { labels: await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime)), children: _jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderBrandIdentityControls, componentProps: { runtime, config } }) })),
30
42
  };
@@ -6,4 +6,9 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
6
6
  ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
7
7
  loadLive: async () => (await import("./services/options")).PhiThreadCandidatesOptionsProviderClient,
8
8
  },
9
+ {
10
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFile,
11
+ ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
12
+ loadLive: async () => (await import("./services/customer-file-table")).PhiThreadsCustomerFileTableProviderClient,
13
+ },
9
14
  ];
@@ -1,5 +1,5 @@
1
1
  import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet, } from "../../../../types/signals";
2
- import { PHI_THREADS_CONTROLLER_KEY, PHI_THREADS_CONTROLLER_PLUGIN_KEY, } from "./address";
2
+ import { PHI_THREADS_CONTROLLER_KEY, PHI_THREADS_CONTROLLER_PLUGIN_KEY, } from "../../../../constants/threads-controller-address";
3
3
  /**
4
4
  * Turns "a row is selected" into "that conversation", and runs the dialog that opens a new one.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /** Who this viewer may write to, for this Module's own Form that opens a conversation. */
2
- export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
2
+ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
3
3
  key: `${string}/${string}`;
4
4
  ownerModuleId: "@phis/ui/modules/threads";
5
5
  kind: "options";
@@ -7,4 +7,117 @@ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
7
7
  authoringMode: "none";
8
8
  title: string;
9
9
  description: string;
10
- }[];
10
+ resources?: undefined;
11
+ } | {
12
+ key: `${string}/${string}`;
13
+ ownerModuleId: "@phis/ui/modules/threads";
14
+ kind: "table";
15
+ executionMode: "live";
16
+ authoringMode: "none";
17
+ title: string;
18
+ description: string;
19
+ resources: ({
20
+ resourceKey: "person";
21
+ title: string;
22
+ rowIdentityPath: string;
23
+ fields: ({
24
+ key: string;
25
+ title: string;
26
+ type: "number";
27
+ required: true;
28
+ } | {
29
+ key: string;
30
+ title: string;
31
+ type: "string";
32
+ required?: undefined;
33
+ })[];
34
+ query: {
35
+ search: false;
36
+ filterFields: string[];
37
+ sorting: "none";
38
+ pagination: "none";
39
+ total?: undefined;
40
+ };
41
+ rowActivation?: undefined;
42
+ } | {
43
+ resourceKey: "addresses";
44
+ title: string;
45
+ rowIdentityPath: string;
46
+ fields: ({
47
+ key: string;
48
+ title: string;
49
+ type: "number";
50
+ required: true;
51
+ options?: undefined;
52
+ } | {
53
+ key: string;
54
+ title: string;
55
+ type: "string";
56
+ required?: undefined;
57
+ options?: undefined;
58
+ } | {
59
+ key: string;
60
+ title: string;
61
+ type: "enum[]";
62
+ options: {
63
+ value: string;
64
+ label: string;
65
+ }[];
66
+ required?: undefined;
67
+ } | {
68
+ key: string;
69
+ title: string;
70
+ type: "datetime";
71
+ required?: undefined;
72
+ options?: undefined;
73
+ })[];
74
+ query: {
75
+ search: false;
76
+ filterFields: string[];
77
+ sorting: "none";
78
+ pagination: "none";
79
+ total?: undefined;
80
+ };
81
+ rowActivation?: undefined;
82
+ } | {
83
+ resourceKey: "threads";
84
+ title: string;
85
+ rowIdentityPath: string;
86
+ rowActivation: true;
87
+ fields: ({
88
+ key: string;
89
+ title: string;
90
+ type: "number";
91
+ required: true;
92
+ options?: undefined;
93
+ } | {
94
+ key: string;
95
+ title: string;
96
+ type: "string";
97
+ required?: undefined;
98
+ options?: undefined;
99
+ } | {
100
+ key: string;
101
+ title: string;
102
+ type: "enum";
103
+ options: {
104
+ value: string;
105
+ label: string;
106
+ }[];
107
+ required?: undefined;
108
+ } | {
109
+ key: string;
110
+ title: string;
111
+ type: "datetime";
112
+ required?: undefined;
113
+ options?: undefined;
114
+ })[];
115
+ query: {
116
+ search: false;
117
+ filterFields: string[];
118
+ sorting: "none";
119
+ pagination: "offset";
120
+ total: false;
121
+ };
122
+ })[];
123
+ })[];
@@ -1,4 +1,6 @@
1
1
  import { PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS, PHI_THREADS_RUNTIME_MODULE_ID, } from "./ids";
2
+ import { PhisThreadKind, PhisThreadStatus } from "../../../constants/threads";
3
+ import { PHI_CUSTOMER_FILE_RESOURCE_KEYS } from "../../../constants/customer-file";
2
4
  /** Who this viewer may write to, for this Module's own Form that opens a conversation. */
3
5
  export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
4
6
  {
@@ -10,4 +12,87 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
10
12
  title: "People you can write to",
11
13
  description: "Whoever shares a group with this viewer, for naming them in a new conversation.",
12
14
  },
15
+ /*
16
+ * Staff's customer file on one member of the Site (`GET /api/site/members/{userId}/file`, for the
17
+ * holders of `accounting` or `support`): the person as the staff road of `users:v1` answers them, their
18
+ * current addresses where the actor may read them, and the threads -- the person's file first, then
19
+ * every conversation they take part in that the actor sees. Three resources because a Table lists one
20
+ * kind of row; each reads the same route for the member its `userId` filter names, and none reads
21
+ * anything without one. Core writes every read to the Site's access log.
22
+ */
23
+ {
24
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFile,
25
+ ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
26
+ kind: "table",
27
+ executionMode: "live",
28
+ authoringMode: "none",
29
+ title: "Customer file",
30
+ description: "One member as staff may read them: contact details, addresses, their file and their conversations.",
31
+ resources: [
32
+ {
33
+ resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.person,
34
+ title: "Person",
35
+ rowIdentityPath: "userId",
36
+ fields: [
37
+ { key: "userId", title: "User", type: "number", required: true },
38
+ { key: "displayName", title: "Shown as", type: "string" },
39
+ { key: "fullName", title: "Name", type: "string" },
40
+ { key: "companyName", title: "Company", type: "string" },
41
+ { key: "email", title: "E-mail", type: "string" },
42
+ { key: "phone", title: "Business phone", type: "string" },
43
+ { key: "mobile", title: "Mobile", type: "string" },
44
+ ],
45
+ query: { search: false, filterFields: ["userId"], sorting: "none", pagination: "none" },
46
+ },
47
+ {
48
+ resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.addresses,
49
+ title: "Addresses",
50
+ rowIdentityPath: "id",
51
+ fields: [
52
+ { key: "id", title: "ID", type: "number", required: true },
53
+ { key: "name", title: "Name", type: "string" },
54
+ { key: "lines", title: "Address", type: "string" },
55
+ {
56
+ key: "purposes",
57
+ title: "Purposes",
58
+ type: "enum[]",
59
+ options: ["billing", "shipping", "defaultBilling", "defaultShipping"].map((value) => ({ value, label: value })),
60
+ },
61
+ { key: "createdAt", title: "Added", type: "datetime" },
62
+ ],
63
+ query: { search: false, filterFields: ["userId"], sorting: "none", pagination: "none" },
64
+ },
65
+ {
66
+ resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.threads,
67
+ title: "Threads",
68
+ rowIdentityPath: "id",
69
+ // Choosing one opens it in the conversation beside the list, as the inbox does.
70
+ rowActivation: true,
71
+ fields: [
72
+ { key: "id", title: "ID", type: "number", required: true },
73
+ { key: "subject", title: "Subject", type: "string" },
74
+ { key: "kind", title: "Kind", type: "enum", options: [
75
+ { value: String(PhisThreadKind.Direct), label: "Direct" },
76
+ { value: String(PhisThreadKind.Group), label: "Group" },
77
+ { value: String(PhisThreadKind.CrossGroup), label: "Between groups" },
78
+ { value: String(PhisThreadKind.Support), label: "Support" },
79
+ { value: String(PhisThreadKind.File), label: "File" },
80
+ ] },
81
+ { key: "status", title: "Status", type: "enum", options: [
82
+ { value: String(PhisThreadStatus.Open), label: "Open" },
83
+ { value: String(PhisThreadStatus.Archived), label: "Archived" },
84
+ ] },
85
+ { key: "state", title: "State", type: "enum", options: [
86
+ { value: "unread", label: "New" },
87
+ { value: "open", label: "Open" },
88
+ { value: "archived", label: "Archived" },
89
+ { value: "locked", label: "Locked" },
90
+ ] },
91
+ { key: "latestMessageAt", title: "Last activity", type: "datetime" },
92
+ ],
93
+ // Paged by Core without a count, so the list turns back and forth rather than to a page number.
94
+ query: { search: false, filterFields: ["userId"], sorting: "none", pagination: "offset", total: false },
95
+ },
96
+ ],
97
+ },
13
98
  ];