@phis/ui 0.8.0 → 0.8.2

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 (304) hide show
  1. package/README.md +9 -2
  2. package/components/cms/phi-cms-layout-renderer.js +15 -7
  3. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  4. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  5. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  6. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  7. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  8. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  9. package/components/cms/phi-cms-root-layout.js +3 -1
  10. package/components/controls/phi-media-picker-control.d.ts +9 -0
  11. package/components/controls/phi-media-picker-control.js +1 -1
  12. package/components/controls/phi-popover-control.js +4 -1
  13. package/components/controls/phi-table-control.d.ts +7 -1
  14. package/components/controls/phi-table-control.js +26 -11
  15. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  16. package/components/forms/form-descriptor-field-check.js +41 -0
  17. package/components/forms/form-descriptor-runtime-client.js +11 -10
  18. package/components/forms/form-record-source.d.ts +38 -0
  19. package/components/forms/form-record-source.js +48 -0
  20. package/components/forms/shared-form-descriptors.d.ts +0 -34
  21. package/components/forms/shared-form-descriptors.js +0 -6
  22. package/components/forms/shared-form-ids.d.ts +1 -1
  23. package/components/forms/shared-form-ids.js +1 -1
  24. package/components/media/media-settings-labels.d.ts +1 -0
  25. package/components/media/media-settings-labels.js +2 -0
  26. package/components/media/media-upload-flow.d.ts +62 -5
  27. package/components/media/media-upload-flow.js +62 -24
  28. package/components/media/phi-area-upload-widget.d.ts +44 -1
  29. package/components/media/phi-area-upload-widget.js +32 -7
  30. package/components/media/phi-media-picker-binding.d.ts +41 -33
  31. package/components/media/phi-media-picker-binding.js +2 -1
  32. package/components/media/phi-media-upload.d.ts +10 -3
  33. package/components/media/phi-media-upload.js +11 -8
  34. package/components/media/use-media-library-add-picker.d.ts +33 -32
  35. package/components/overlays/phi-overlay-container-client.js +11 -9
  36. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +7 -0
  37. package/components/regions/presets/phi-settings-page-shell-tree.js +3 -3
  38. package/components/shell/phi-icon-names.d.ts +3 -0
  39. package/components/shell/phi-icon-names.js +3 -0
  40. package/components/shell/phi-icon.d.ts +5 -7
  41. package/components/shell/phi-icon.js +8 -21
  42. package/components/shell/phi-widget-icon.js +1 -0
  43. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  44. package/components/tables/client/phi-table-binding-params.js +39 -0
  45. package/components/tables/client/phi-table-binding.d.ts +1 -3
  46. package/components/tables/client/phi-table-binding.js +5 -9
  47. package/components/widgets/client/html-editor-link-node.d.ts +12 -0
  48. package/components/widgets/client/html-editor-link-node.js +60 -0
  49. package/components/widgets/client/html-editor.js +10 -6
  50. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  51. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  52. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  53. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  54. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  55. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  56. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  57. package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
  58. package/components/widgets/client/shared/phi-command-buttons.d.ts +16 -0
  59. package/components/widgets/client/shared/phi-command-buttons.js +9 -1
  60. package/components/widgets/label-sets/admin-users.d.ts +1 -0
  61. package/components/widgets/label-sets/admin-users.js +2 -0
  62. package/components/widgets/label-sets/builder-modules.js +4 -0
  63. package/components/widgets/label-sets/profile.d.ts +0 -16
  64. package/components/widgets/label-sets/profile.js +0 -37
  65. package/components/widgets/label-sets/registration.d.ts +0 -1
  66. package/components/widgets/label-sets/registration.js +0 -2
  67. package/components/widgets/label-sets/revisions.js +2 -0
  68. package/components/widgets/label-sets/signals.js +2 -0
  69. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  70. package/components/widgets/label-types/builder-modules.js +2 -0
  71. package/components/widgets/label-types/revisions.d.ts +2 -0
  72. package/components/widgets/label-types/revisions.js +2 -1
  73. package/components/widgets/label-types/signals.d.ts +2 -0
  74. package/components/widgets/label-types/signals.js +1 -0
  75. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  76. package/components/widgets/shared/widget-failure-audience.js +21 -0
  77. package/components/widgets/shared/widget-failure-client.js +5 -2
  78. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  79. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  80. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  81. package/components/widgets/shared/widget-failure-notice.js +17 -0
  82. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  83. package/components/widgets/shared/widget-failure-staff.js +18 -0
  84. package/components/widgets/shared/widget-failure.d.ts +9 -6
  85. package/components/widgets/shared/widget-failure.js +0 -9
  86. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  87. package/components/widgets/shared/widget-failure.server.js +8 -3
  88. package/constants/cms-widget-types.d.ts +1 -0
  89. package/constants/cms-widget-types.js +3 -0
  90. package/constants/customer-file.d.ts +12 -3
  91. package/constants/customer-file.js +12 -3
  92. package/constants/runtime-module-ownership.js +5 -3
  93. package/constants/site-address.d.ts +9 -0
  94. package/constants/site-address.js +10 -0
  95. package/constants/table-loading.d.ts +14 -0
  96. package/constants/table-loading.js +14 -0
  97. package/constants.d.ts +2 -1
  98. package/constants.js +3 -1
  99. package/gateway/site-cms-write-validation.js +19 -3
  100. package/gateway/site-proxy.d.ts +12 -0
  101. package/gateway/site-proxy.js +20 -0
  102. package/helpers/announced-action.d.ts +17 -0
  103. package/helpers/announced-action.js +29 -0
  104. package/helpers/phi-metadata.d.ts +0 -8
  105. package/helpers/phi-metadata.js +1 -10
  106. package/helpers/phi-site-description.d.ts +11 -0
  107. package/helpers/phi-site-description.js +13 -0
  108. package/helpers/preset-form-check.d.ts +14 -0
  109. package/helpers/preset-form-check.js +12 -0
  110. package/helpers/preset-table-check.d.ts +19 -15
  111. package/helpers/preset-table-check.js +33 -39
  112. package/helpers/record-widget-binding.d.ts +10 -0
  113. package/helpers/record-widget-binding.js +35 -0
  114. package/helpers/record-widget.d.ts +1 -10
  115. package/helpers/record-widget.js +4 -33
  116. package/helpers/table-widget-binding.d.ts +12 -0
  117. package/helpers/table-widget-binding.js +296 -0
  118. package/helpers/tree-widget-binding.d.ts +19 -0
  119. package/helpers/tree-widget-binding.js +72 -0
  120. package/helpers/typed-confirmation.d.ts +9 -0
  121. package/helpers/typed-confirmation.js +13 -0
  122. package/helpers/widget-binding-check.d.ts +22 -0
  123. package/helpers/widget-binding-check.js +91 -0
  124. package/module-page-check.d.ts +2 -0
  125. package/module-page-check.js +2 -0
  126. package/net/phi-next-proxy.d.ts +7 -0
  127. package/net/phi-next-proxy.js +1 -1
  128. package/next/root-route.js +2 -1
  129. package/package.json +27 -14
  130. package/plugins/runtime-modules/accounting/ids.d.ts +7 -4
  131. package/plugins/runtime-modules/accounting/ids.js +14 -3
  132. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +21 -9
  133. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +29 -15
  134. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +11 -8
  135. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +206 -137
  136. package/plugins/runtime-modules/app/client-data-providers.js +1 -1
  137. package/plugins/runtime-modules/app/data-providers.d.ts +14 -69
  138. package/plugins/runtime-modules/app/data-providers.js +19 -54
  139. package/plugins/runtime-modules/app/definition.d.ts +8 -80
  140. package/plugins/runtime-modules/app/forms.d.ts +1 -16
  141. package/plugins/runtime-modules/app/forms.js +0 -59
  142. package/plugins/runtime-modules/app/ids.d.ts +2 -1
  143. package/plugins/runtime-modules/app/ids.js +3 -2
  144. package/plugins/runtime-modules/app/module.d.ts +8 -80
  145. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  146. package/plugins/runtime-modules/app/services/{addresses-table.js → addresses-collection.js} +23 -19
  147. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +10 -6
  148. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +37 -73
  149. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +0 -5
  150. package/plugins/runtime-modules/app/trees/addresses-label-set.js +2 -6
  151. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  152. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +1 -17
  153. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +0 -2
  154. package/plugins/runtime-modules/app/trees/profile-label-set.js +2 -14
  155. package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
  156. package/plugins/runtime-modules/area-contributions/admin.js +2 -0
  157. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  158. package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
  159. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  160. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -1
  161. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  162. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  163. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  164. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +5 -0
  165. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +14 -1
  166. package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
  167. package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
  168. package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
  169. package/plugins/runtime-modules/cdn/authoring.js +8 -0
  170. package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
  171. package/plugins/runtime-modules/cdn/bytes.js +17 -0
  172. package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
  173. package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
  174. package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
  175. package/plugins/runtime-modules/cdn/data-providers.js +117 -0
  176. package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
  177. package/plugins/runtime-modules/cdn/definition.js +23 -0
  178. package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
  179. package/plugins/runtime-modules/cdn/ids.js +20 -0
  180. package/plugins/runtime-modules/cdn/module.d.ts +131 -0
  181. package/plugins/runtime-modules/cdn/module.js +4 -0
  182. package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
  183. package/plugins/runtime-modules/cdn/platform.js +73 -0
  184. package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
  185. package/plugins/runtime-modules/cdn/presets.js +20 -0
  186. package/plugins/runtime-modules/cdn/server.d.ts +1 -0
  187. package/plugins/runtime-modules/cdn/server.js +14 -0
  188. package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
  189. package/plugins/runtime-modules/cdn/services/table.js +296 -0
  190. package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
  191. package/plugins/runtime-modules/cdn/services/upload.js +146 -0
  192. package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
  193. package/plugins/runtime-modules/cdn/table-params.js +10 -0
  194. package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
  195. package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
  196. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
  197. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +479 -0
  198. package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
  199. package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
  200. package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
  201. package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
  202. package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
  203. package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
  204. package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
  205. package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
  206. package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
  207. package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
  208. package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
  209. package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
  210. package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
  211. package/plugins/runtime-modules/cdn/widgets.js +13 -0
  212. package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
  213. package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
  214. package/plugins/runtime-modules/client-manifests/admin.js +11 -1
  215. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  216. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -1
  217. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  218. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  219. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  220. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  221. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +175 -0
  222. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  223. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  224. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +1 -1
  225. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  226. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  227. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +1 -1
  228. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  229. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  230. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  231. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  232. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  233. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  234. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  235. package/plugins/runtime-modules/core/widgets/table/client.js +36 -52
  236. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  237. package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
  238. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  239. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  240. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  241. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  242. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  243. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  244. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  245. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  246. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +5 -0
  247. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  248. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  249. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  250. package/plugins/runtime-modules/revisions/controller/client.js +74 -50
  251. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  252. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  253. package/plugins/runtime-modules/revisions/forms.js +1 -1
  254. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  255. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  256. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  257. package/plugins/runtime-modules/revisions/services/table.js +41 -21
  258. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +76 -3
  259. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  260. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +39 -13
  261. package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
  262. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  263. package/plugins/runtime-modules/threads/controller/definition.js +48 -0
  264. package/plugins/runtime-modules/threads/data-providers.d.ts +22 -37
  265. package/plugins/runtime-modules/threads/data-providers.js +35 -24
  266. package/plugins/runtime-modules/threads/definition.d.ts +22 -37
  267. package/plugins/runtime-modules/threads/ids.d.ts +2 -0
  268. package/plugins/runtime-modules/threads/ids.js +2 -0
  269. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  270. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  271. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  272. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  273. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +14 -80
  274. package/plugins/runtime-modules/threads/services/customer-file-table.js +27 -112
  275. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +4 -0
  276. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +4 -0
  277. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +15 -0
  278. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -0
  279. package/server-helpers/runtime.js +0 -1
  280. package/styles/controls.css +4 -2
  281. package/styles/layout.css +7 -0
  282. package/theme/phi-antd-token-resolver.d.ts +8 -0
  283. package/theme/phi-antd-token-resolver.js +10 -0
  284. package/theme/phi-theme-color.d.ts +19 -0
  285. package/theme/phi-theme-color.js +42 -0
  286. package/theme/phi-theme-gradients.js +4 -22
  287. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  288. package/theme/phi-theme-palette-defaults.js +103 -0
  289. package/types/cms-plugins.d.ts +6 -1
  290. package/types/collection-provider.d.ts +27 -0
  291. package/types/collection-signal-values.d.ts +2 -0
  292. package/types/collection-signal-values.js +23 -0
  293. package/types/collection-view-widget.d.ts +9 -0
  294. package/types/core-widget-placements.d.ts +6 -0
  295. package/types/signals.d.ts +2 -0
  296. package/types/signals.js +2 -0
  297. package/types/table-widget.d.ts +17 -3
  298. package/types/table-widget.js +0 -282
  299. package/types/tree-widget.d.ts +0 -1
  300. package/types/tree-widget.js +0 -60
  301. package/types/widget-runtime.d.ts +0 -1
  302. package/types.d.ts +1 -1
  303. package/types.js +1 -1
  304. package/plugins/runtime-modules/app/services/addresses-table.d.ts +0 -135
@@ -2,14 +2,15 @@
2
2
  import { PHI_REVISIONS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
3
3
  import { deleteCmsDraft } from "../../../../helpers/cms-draft-delete";
4
4
  import { readNumber } from "../../../../components/widgets/config/parser-primitives";
5
- import { isPhiBuilderAreaKey, isPhiCmsAreaKey } from "../../../../constants/cms-areas";
5
+ import { isPhiCmsAreaKey } from "../../../../constants/cms-areas";
6
6
  import { hasPhiCmsPresetUpdate } from "../../../../plugins/runtime-modules/preset-version";
7
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
11
  import { resolvePhiBuilderActivePageCatalog, findPhiBuilderPageKeyFromStoragePath, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../../helpers/cms-page-catalog";
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";
12
+ import { PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_THEME_KEY_SEARCH_PARAM, } from "../../../../helpers/cms-scope-search-params";
13
+ import { readPhiRevisionsTableBinding } from "../controller/binding";
13
14
  import { resolvePhiBuilderRevisionPagePath, resolvePhiBuilderRevisionScope, } from "../types";
14
15
  import { resolvePhiBuilderRevisionNavScopeKey } from "../../../../helpers/cms-navigation-scope-key";
15
16
  import { isPhiRecord } from "../../../../helpers/is-record";
@@ -40,6 +41,15 @@ function readRevisionScope(value) {
40
41
  sourcePreset,
41
42
  };
42
43
  }
44
+ /**
45
+ * What a request asks about, or null while it asks about nothing yet.
46
+ *
47
+ * The Table mounts with its labels alone; the scope is the Revisions Controller's to hand, once the
48
+ * workspace catalog stands for the address (`resolvePhiRevisionsControllerBinding`). This read used to
49
+ * make one up meanwhile, from the address and whatever the catalog held -- the default Area's, before
50
+ * the Builder had read the address -- and the Table asked for that history, then for the one handed a
51
+ * moment later: two reads on every open, and a Module Page of the App asked for as a Public Page.
52
+ */
43
53
  function readParams(value) {
44
54
  if (!isPhiRecord(value) || !isPhiRecord(value.labels) || typeof value.locale !== "string"
45
55
  || typeof value.timeZone !== "string") {
@@ -47,20 +57,14 @@ function readParams(value) {
47
57
  }
48
58
  const locale = value.locale;
49
59
  const timeZone = value.timeZone;
50
- if (!isPhiRecord(value.scope) && typeof window !== "undefined") {
60
+ if (!isPhiRecord(value.scope)) {
61
+ const binding = readPhiRevisionsTableBinding(value);
62
+ if (!binding || typeof window === "undefined")
63
+ return null;
64
+ const { kind, scopeKey: configuredScopeKey } = binding;
51
65
  const state = getPhiWorkspaceCatalogSnapshot();
52
66
  const search = new URLSearchParams(window.location.search);
53
- const kind = normalizePhiBuilderRevisionsKindSearchParam(value.kind) ??
54
- normalizePhiBuilderRevisionsKindSearchParam(search.get(PHI_BUILDER_REVISIONS_KIND_SEARCH_PARAM)) ??
55
- "area";
56
- const configuredScopeKey = typeof value.scopeKey === "string" && value.scopeKey.trim()
57
- ? value.scopeKey.trim()
58
- : search.get(PHI_BUILDER_REVISIONS_SCOPE_SEARCH_PARAM)?.trim() ?? "";
59
- const scopeArea = kind === "area"
60
- ? isPhiBuilderAreaKey(configuredScopeKey)
61
- ? configuredScopeKey
62
- : state.area
63
- : state.area;
67
+ const scopeArea = kind === "area" ? configuredScopeKey : binding.area;
64
68
  const pages = resolvePhiBuilderActivePageCatalog(scopeArea, state.modulePresetPagesByArea, state.customPages, state.persistedPageCatalogByArea);
65
69
  const activePageKey = resolvePhiBuilderActivePageKey(scopeArea === state.area ? state.pageKey : null, pages);
66
70
  /*
@@ -68,10 +72,8 @@ function readParams(value) {
68
72
  *
69
73
  * Three of them never read one: `resolvePhiBuilderRevisionScope` takes the area, the nav key or the
70
74
  * theme key and leaves the page alone, so demanding one made an Area whose pages all come from
71
- * Modules unable to show the revisions it does have. And the fourth reaches this before anything is
72
- * loaded: opening `/builder/revisions` directly means the page catalog is still empty, which is a
73
- * moment rather than a fault. A page scope without a page asks for nothing and shows nothing, and
74
- * fills in as soon as there is one.
75
+ * Modules unable to show the revisions it does have. A page scope whose Page the catalog does not
76
+ * hold asks for nothing and shows nothing.
75
77
  */
76
78
  /*
77
79
  * The Page a page scope names, by the address it answers on: the Page Select, the Controller and the
@@ -80,14 +82,14 @@ function readParams(value) {
80
82
  * `/dashboard`) was found nowhere, read as a Site Page of that path and asked for by a path its row
81
83
  * does not have -- so its history was empty and "Reset to preset" had no preset to name.
82
84
  */
83
- const pageKey = kind === "page" && configuredScopeKey.startsWith("/")
85
+ const pageKey = kind === "page"
84
86
  ? findPhiBuilderPageKeyFromStoragePath(scopeArea, configuredScopeKey, pages)
85
87
  ?? resolvePhiBuilderPageKeyFromCatalogPath(scopeArea, configuredScopeKey, pages)
86
88
  : activePageKey ?? "";
87
- const navScopeKey = kind === "navigation" && configuredScopeKey
89
+ const navScopeKey = kind === "navigation"
88
90
  ? resolvePhiBuilderRevisionNavScopeKey(scopeArea, configuredScopeKey)
89
91
  : resolvePhiBuilderRevisionNavScopeKey(scopeArea, search.get(PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM));
90
- const themeKey = kind === "theme" && configuredScopeKey
92
+ const themeKey = kind === "theme"
91
93
  ? configuredScopeKey
92
94
  : search.get(PHI_BUILDER_THEME_KEY_SEARCH_PARAM) ?? "default";
93
95
  const scope = resolvePhiBuilderRevisionScope(kind, scopeArea, pageKey, pages, navScopeKey, themeKey, state.areaPresetSourcesByArea[scopeArea] ?? null);
@@ -398,11 +400,26 @@ function buildTableData(params, result) {
398
400
  },
399
401
  };
400
402
  }
403
+ /**
404
+ * Answers once there is a question: a request without a scope stays open, the Table showing that it
405
+ * loads, until the scope handed to it replaces the request -- which aborts it. Answered empty instead,
406
+ * the Table drew "no revisions" between its skeleton and the history.
407
+ */
408
+ function untilAborted(signal) {
409
+ return new Promise((_, reject) => {
410
+ if (signal.aborted)
411
+ reject(signal.reason);
412
+ else
413
+ signal.addEventListener("abort", () => reject(signal.reason), { once: true });
414
+ });
415
+ }
401
416
  async function queryRevisions(request) {
402
417
  if (request.resourceKey !== "history") {
403
418
  throw new PhiTableProviderError("resource-not-found", `Unknown Revisions resource "${request.resourceKey}".`);
404
419
  }
405
420
  const params = readParams(request.params);
421
+ if (!params)
422
+ return untilAborted(request.signal);
406
423
  return buildTableData(params, await loadRevisionHistory(params.scope, request.signal));
407
424
  }
408
425
  function readRevisionId(value) {
@@ -420,6 +437,9 @@ async function mutateRevision(request) {
420
437
  throw new PhiTableProviderError("resource-not-found", `Unknown Revisions resource "${request.resourceKey}".`);
421
438
  }
422
439
  const params = readParams(request.params);
440
+ if (!params) {
441
+ throw new Error("Choose what to show the history of first.");
442
+ }
423
443
  if (request.actionKey === "resetPage") {
424
444
  /*
425
445
  * Not a revision act: the override these revisions belong to goes as a whole, and the Module's preset
@@ -4,7 +4,7 @@ import { PhiCmsFlags, PhiCmsRegionType, PhiCmsStatus } from "../../../../constan
4
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
5
5
  import { resolvePhiShellHeaderHeight } from "../../../../helpers/shell-region-style";
6
6
  import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
7
- import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress, } from "../../../../types";
7
+ import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress, createPhiSignalSubcontrolAddress, } from "../../../../types";
8
8
  import { PHI_SPACE } from "../../../../theme/antd-css-var-contract";
9
9
  import { getPhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-sets/builder-chrome";
10
10
  import { getPhiBuilderRevisionsWidgetLabels } from "../../../../components/widgets/label-sets/revisions";
@@ -40,6 +40,8 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
40
40
  getPhiBuilderRevisionsWidgetLabels(credentials),
41
41
  ]);
42
42
  const deleteAreaOverlay = createPhiSignalAddress("cms", PHI_REVISIONS_DELETE_AREA_OVERLAY_IDS.overlayDeleteArea);
43
+ // The dialog's confirm button, which stays greyed out until the Area key is typed.
44
+ const deleteAreaConfirm = createPhiSignalSubcontrolAddress("cms", PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaCommands, "confirm");
43
45
  return {
44
46
  page: nodes.page(),
45
47
  pageMeta: {
@@ -77,6 +79,24 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
77
79
  valueType: "string",
78
80
  receiver: createPhiSignalAddress("cms", PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaWarning),
79
81
  },
82
+ {
83
+ routeKey: "builder-revisions-controller-delete-area-key",
84
+ capabilityId: "deleteAreaKey",
85
+ scope: "area",
86
+ channel: "text",
87
+ action: "change",
88
+ valueType: "string",
89
+ receiver: createPhiSignalAddress("cms", PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaKey),
90
+ },
91
+ {
92
+ routeKey: "builder-revisions-controller-delete-area-confirm-enabled",
93
+ capabilityId: "deleteAreaConfirmEnabled",
94
+ scope: "page",
95
+ channel: "enabled",
96
+ action: "change",
97
+ valueType: "boolean",
98
+ receiver: deleteAreaConfirm,
99
+ },
80
100
  { routeKey: "builder-revisions-controller-delete-area-open", capabilityId: "deleteAreaOpen", scope: "area", channel: "dialog", action: "activate", valueType: "none", receiver: deleteAreaOverlay },
81
101
  { routeKey: "builder-revisions-controller-delete-area-close", capabilityId: "deleteAreaClose", scope: "area", channel: "dialog", action: "close", valueType: "none", receiver: deleteAreaOverlay },
82
102
  { routeKey: "builder-revisions-controller-history-reload", capabilityId: "historyReload", scope: "page", channel: "reload", action: "activate", valueType: "none", receiver: createPhiSignalAddress("cms", PHI_REVISIONS_TABLE_WIDGET_ID) },
@@ -294,12 +314,41 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
294
314
  tone: "secondary",
295
315
  },
296
316
  }),
317
+ /*
318
+ * The exact word to type, shown rather than described: asked for "the Area key", nobody knew its
319
+ * spelling or its case. The key stands on a line of its own in code type, where it is read at a
320
+ * glance and selected with one double click; the Controller writes it in as the dialog opens, as
321
+ * it does the warning, and the comparison takes it in any case (`matchesPhiTypedConfirmation`).
322
+ */
297
323
  nodes.widget({
298
- typeKey: "form",
299
- id: PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaForm,
324
+ typeKey: "simple-text",
325
+ /* Label set text, translated already; a second pass would hand the translator a non-source text. */
326
+ flags: PhiCmsFlags.NoTranslate,
327
+ id: PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaTypeToConfirm,
300
328
  parentLayoutNodeId: PHI_REVISIONS_DELETE_AREA_LAYOUT_IDS.deleteAreaBody,
301
329
  slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[2].slotIndex,
302
330
  sortOrder: 2,
331
+ label: "Builder delete area type to confirm",
332
+ config: { text: revisionsLabels.deleteArea.typeToConfirm },
333
+ }),
334
+ nodes.widget({
335
+ typeKey: "simple-text",
336
+ // A key, never words to translate.
337
+ flags: PhiCmsFlags.NoTranslate,
338
+ id: PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaKey,
339
+ parentLayoutNodeId: PHI_REVISIONS_DELETE_AREA_LAYOUT_IDS.deleteAreaBody,
340
+ slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[3].slotIndex,
341
+ sortOrder: 3,
342
+ label: "Builder delete area key",
343
+ // Never empty, for the same reason as the warning; the Controller's key replaces it.
344
+ config: { text: "area", marks: ["bold", "code"], fontSize: "lg" },
345
+ }),
346
+ nodes.widget({
347
+ typeKey: "form",
348
+ id: PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaForm,
349
+ parentLayoutNodeId: PHI_REVISIONS_DELETE_AREA_LAYOUT_IDS.deleteAreaBody,
350
+ slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[4].slotIndex,
351
+ sortOrder: 4,
303
352
  label: "Builder delete area form",
304
353
  config: {
305
354
  formId: PHI_REVISIONS_FORM_IDS.deleteArea,
@@ -321,6 +370,17 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
321
370
  valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.formValues,
322
371
  receiver: createPhiRevisionsControllerAddress(),
323
372
  },
373
+ // The key while it is typed, so the confirm button wakes the moment it matches.
374
+ {
375
+ routeKey: "builder-delete-area-typed",
376
+ capabilityId: "valuesChange",
377
+ scope: "area",
378
+ channel: "deleteAreaTyped",
379
+ action: "change",
380
+ valueType: "json",
381
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.formValues,
382
+ receiver: createPhiRevisionsControllerAddress(),
383
+ },
324
384
  ],
325
385
  /*
326
386
  * The footer's confirm button sends `submit` here. A route on the sender alone delivers
@@ -365,6 +425,8 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
365
425
  emits: [{ capabilityId: "submit", value: null }],
366
426
  label: revisionsLabels.deleteArea.confirm,
367
427
  danger: true,
428
+ // Until the Area key is typed; the Controller switches it on (`deleteAreaConfirmEnabled`).
429
+ disabled: true,
368
430
  },
369
431
  ],
370
432
  signalRoutes: {
@@ -388,6 +450,17 @@ export async function buildPhiDefaultBuilderRevisionsPageTree({ page, runtime, }
388
450
  receiver: createPhiSignalAddress("cms", PHI_REVISIONS_DELETE_AREA_WIDGET_IDS.deleteAreaForm),
389
451
  },
390
452
  ],
453
+ listens: [
454
+ {
455
+ routeKey: "builder-delete-area-confirm-enabled",
456
+ capabilityId: "enabled",
457
+ scope: "page",
458
+ channel: "enabled",
459
+ action: "change",
460
+ valueType: "boolean",
461
+ receiver: deleteAreaConfirm,
462
+ },
463
+ ],
391
464
  },
392
465
  },
393
466
  }),
@@ -13,7 +13,19 @@ import { materializePhiThemeBrandLogo, materializePhiThemeBrandSignet, materiali
13
13
  import { buildPhiSiteThemeSelectOptions, createPhiSiteThemeSelectionValue, createPhiThemeDerivation, ensurePhiThemeDerivation, readPhiSiteThemeSelectionState, resolvePhiThemeSelectionValue, } from "../../../../theme/phi-theme-selection";
14
14
  import { dispatchPhiSignalCapability } from "../../../../components/runtime/runtime-signal-identity";
15
15
  import { formatPhiHistoryMoveMessage, formatPhiHistoryTooltip, } from "../../../../components/widgets/label-types/history";
16
- import { phiThemeHistory, resolvePhiThemeHistoryAction, DEFAULT_THEME_KEY, resolveThemeKey, normalizeTheme, resolveInitialTheme, resolveThemePayloadPreset, applyThemePreset, resetThemeToPreset, buildThemeReviewHref, createInitialBrandThemeState, isSameThemePayload, mergeThemeSetChoice, } from "../brand-theme-model";
16
+ import { phiThemeHistory, resolvePhiThemeHistoryAction, DEFAULT_THEME_KEY, resolveThemeKey, normalizeTheme, resolveInitialTheme, resolveThemePayloadPreset, applyThemePreset, resetThemeToPreset, buildThemeReviewHref, createInitialBrandThemeState, isSameThemePayload, mergeThemeSetChoice, omitThemeFields, } from "../brand-theme-model";
17
+ import { omitPhiThemePaletteDefaults } from "../../../../theme/phi-theme-palette-defaults";
18
+ /*
19
+ * The colours a draft states as the Theme gives them anyway are not stored: they are no decision, and
20
+ * kept they would read as one wherever the record is read. Dropped ahead of the save's takeover of
21
+ * Module blocks, which copies a Module's palette in whole again; a core palette is then simply followed.
22
+ */
23
+ function omitThemePaletteDefaults(theme, presets) {
24
+ if (!theme.palette)
25
+ return theme;
26
+ const palette = omitPhiThemePaletteDefaults(resolveThemePayloadPreset(theme, presets), theme.palette, theme.style?.token ?? {});
27
+ return Object.keys(palette).length > 0 ? { ...theme, palette } : omitThemeFields(theme, "palette");
28
+ }
17
29
  /*
18
30
  * `correlationId` is the exchange this state belongs to: the command that saved, published or reset,
19
31
  * or the draft another Widget asked the Controller to take. It is absent only where the Controller
@@ -323,7 +335,7 @@ export function PhiThemeControllerRuntime({ runtime, config, setOptions, history
323
335
  themeKey,
324
336
  ]);
325
337
  async function saveTheme(draftTheme = stateRef.current.draft, options) {
326
- let nextTheme = ensurePhiThemeDerivation(draftTheme);
338
+ let nextTheme = omitThemePaletteDefaults(ensurePhiThemeDerivation(draftTheme), themePresets);
327
339
  setSaving(true);
328
340
  try {
329
341
  const current = stateRef.current;
@@ -42,7 +42,12 @@ import { normalizePhiBackgroundWidgetConfig } from "../../../../../components/wi
42
42
  import { PhiMediaPickerBinding } from "../../../../../components/media/phi-media-picker-binding";
43
43
  import { usePhiMediaPickerLabels } from "../../../../../components/media/phi-media-picker-labels";
44
44
  import { PHI_SEARCH_WIDGET_DEFAULT_LABELS } from "../../../../../components/widgets/label-types/search";
45
- import { buildPhiMediaAssetContentDeliveryUrl, isPhiMediaAssetPublic, PhiMediaAssetFlags, PhiMediaKind, } from "../../../../../constants/media";
45
+ import { buildPhiMediaAssetContentDeliveryUrl, isPhiMediaAssetPublic, PhiImageAssetVariantKey, PhiMediaAssetFlags, PhiMediaKind, } from "../../../../../constants/media";
46
+ import { resolvePhiImagePresentation } from "../../../../../components/media/image-presentation";
47
+ import { usePhiAuthoringAssetDetails } from "../../../../../components/media/use-authoring-asset-details";
48
+ import { PhiImageControl } from "../../../../../components/controls/phi-image-control";
49
+ import { resolvePhiSiteDescription } from "../../../../../helpers/phi-site-description";
50
+ import { omitPhiThemePaletteDefaults } from "../../../../../theme/phi-theme-palette-defaults";
46
51
  import { readPhiXAccount } from "../../../../../types/link-preview";
47
52
  import { PhiPresetSizeControl } from "../../../../../components/controls/phi-preset-size-control";
48
53
  import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
@@ -1042,11 +1047,17 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
1042
1047
  const selectedPreset = resolveThemePayloadPreset(state.draft, themePresets);
1043
1048
  /*
1044
1049
  * What the tab shows is what the Site renders: the palette block with the draft's palette on top,
1045
- * resolved for the mode being edited. The seeds the author owns are the ones present in the draft's
1046
- * palette, shared or under this mode; the derived overrides live under this mode alone.
1050
+ * resolved for the mode being edited. The seeds the author owns are the ones the draft's palette
1051
+ * states, shared or under this mode, other than the Theme gives them; the derived overrides live
1052
+ * under this mode alone.
1047
1053
  */
1048
1054
  const colorToken = resolvePhiThemeColorTokens(selectedPreset, state.draft.palette, previewMode);
1049
- const ownPalette = state.draft.palette ?? {};
1055
+ /*
1056
+ * What the author owns is what changes something: a colour the draft states exactly as the Theme
1057
+ * gives it -- a Module palette taken over on save, a picker put back on the Theme's value -- is no
1058
+ * decision of theirs, offers no reset, and is not stored on the next save.
1059
+ */
1060
+ const ownPalette = omitPhiThemePaletteDefaults(selectedPreset, state.draft.palette, buildPhiEffectiveNonColorThemeTokens(state.draft));
1050
1061
  const ownOverrides = ownPalette.modes?.[previewMode]?.overrides ?? {};
1051
1062
  /*
1052
1063
  * The same colour without the author's derived overrides: what a derived control falls back to, and
@@ -1605,6 +1616,21 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
1605
1616
  });
1606
1617
  const [activeIdentitySection, changeActiveIdentitySection] = usePhiBrandAccordionSection(BRAND_THEME_IDENTITY_COLLAPSE_STORAGE_KEY, BRAND_THEME_IDENTITY_SECTION_KEYS);
1607
1618
  const brand = state.draft.brand ?? {};
1619
+ /*
1620
+ * The link preview's picture as a shared link shows it: the Asset's share variant (1200 x 630, cut
1621
+ * around its focus), drawn the way every picture of the house is drawn. The Asset's facts give the
1622
+ * variant's version and the alt text the head falls back to.
1623
+ */
1624
+ const shareImageId = brand.shareImage?.assetId ?? null;
1625
+ const shareAsset = usePhiAuthoringAssetDetails(shareImageId);
1626
+ const shareImagePresentation = shareImageId == null ? null : resolvePhiImagePresentation({
1627
+ sourceKind: "asset",
1628
+ assetId: shareImageId,
1629
+ variantKey: PhiImageAssetVariantKey.Share,
1630
+ variantVersion: shareAsset?.variantVersion ?? null,
1631
+ deliveryRevision: shareAsset?.deliveryRevision ?? null,
1632
+ originalUrl: shareAsset?.deliveryUrl?.trim() || buildPhiMediaAssetContentDeliveryUrl(shareImageId),
1633
+ });
1608
1634
  /*
1609
1635
  * The Logo shows what the Site draws, which is the Set's wherever the record says nothing about the
1610
1636
  * mode. Picking one takes the mode over; the reset hands it back to the Set.
@@ -1774,15 +1800,15 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
1774
1800
  children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, style: {
1775
1801
  "--phi-labeled-control-label-width": "33.333333%",
1776
1802
  "--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, {
1803
+ }, 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." }), shareImagePresentation?.url ? (_jsx(PhiCardControl, { size: "small", padding: clientToken.paddingXS, cover: (_jsx(PhiImageControl, { presentation: shareImagePresentation, source: "asset", alt: brand.shareImage?.alt || shareAsset?.altText || "Link preview picture", width: 1200, height: 630, blurDataUrl: shareAsset?.blurDataUrl ?? null, sizes: "400px" })), children: _jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXXS, style: { minWidth: 0 }, children: [runtime.site.hostname ? (_jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: clientToken.fontSizeSM }, children: runtime.site.hostname })) : null, _jsx(PhiTypographyControl, { strong: true, children: runtime.site.name || "Page title" }), _jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: clientToken.fontSizeSM }, children: resolvePhiSiteDescription(brand.slogan?.label) })] }) })) : null, _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingXS, style: { minWidth: 0 }, children: [_jsx("div", { style: { flex: "1 1 auto", minWidth: 0 }, children: _jsx(PhiMediaPickerBinding, { config: {
1804
+ mediaType: PhiMediaKind.Image,
1805
+ pageSize: 12,
1806
+ showPagination: true,
1807
+ showGroupFilter: true,
1808
+ showSearchBar: true,
1809
+ }, 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, {
1810
+ shareImage: { assetId: asset.id, ...(brand.shareImage?.alt ? { alt: brand.shareImage.alt } : {}) },
1811
+ })), onAssetClear: () => publishDraft(mergeThemeBrand(state.draft, { shareImage: null })) }) }), brand.shareImage ? (_jsx(PhiButtonControl, { size: "small", type: "link", style: { flexShrink: 0, paddingInline: 0 }, onClick: () => publishDraft(mergeThemeBrand(state.draft, { shareImage: null })), label: "Remove" })) : null] }), _jsx(PhiLabeledControl, { label: "Alt", fill: true, children: _jsx(PhiTextControl, { value: brand.shareImage?.alt ?? "", placeholder: shareAsset?.altText || "Alt text", ariaLabel: "Link preview alt text", allowClear: false, disabled: !brand.shareImage, onChange: (next) => brand.shareImage && publishDraft(mergeThemeBrand(state.draft, {
1786
1812
  shareImage: next?.trim()
1787
1813
  ? { assetId: brand.shareImage.assetId, alt: next }
1788
1814
  : { assetId: brand.shareImage.assetId },
@@ -11,4 +11,9 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
11
11
  ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
12
12
  loadLive: async () => (await import("./services/customer-file-table")).PhiThreadsCustomerFileTableProviderClient,
13
13
  },
14
+ {
15
+ key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses,
16
+ ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
17
+ loadLive: async () => (await import("./services/customer-file-addresses")).PhiThreadsCustomerFileAddressesProviderClient,
18
+ },
14
19
  ];
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useCallback, useMemo, useState } from "react";
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
4
  import { findPhiSignalRoutesByCapabilityId, } from "../../../../types/signals";
5
5
  import { readPhiTableActionSignalValue, readPhiTableSelectionSignalValue, } from "../../../../types/table-signal-values";
6
6
  import { readPhiOverlayCloseRequest } from "../../../../types/cms-overlay";
@@ -10,6 +10,10 @@ import { usePhiRuntimeConditionStateResponder } from "../../../../components/run
10
10
  import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../components/runtime/runtime-signal-bus";
11
11
  import { dispatchPhiSignalCapability } from "../../../../components/runtime/runtime-signal-identity";
12
12
  import { PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION, } from "./definition";
13
+ import { isPhiRecord } from "../../../../helpers/is-record";
14
+ import { readPhiPositiveInteger } from "../../../../components/widgets/client/shared/phi-table-provider-request";
15
+ import { readPhiCustomerFileThreadId } from "../services/customer-file-read";
16
+ import { PHI_CUSTOMER_FILE_MEMBER_PARAM } from "../../../../constants/customer-file";
13
17
  /**
14
18
  * A row key is a conversation id, and this is the only code allowed to know it.
15
19
  *
@@ -31,6 +35,11 @@ function readSelectedThreadId(value) {
31
35
  * what came back. Reading `{ thread: { thread: { id } } }` out of it is a statement about the Core
32
36
  * route's answer, which is exactly the kind of knowledge that belongs in the Module and nowhere else.
33
37
  */
38
+ /** The member a customer file Page's person Table chose, from its query (`filters.userId`). */
39
+ function readChosenMemberId(value) {
40
+ const filters = isPhiRecord(value) && isPhiRecord(value.filters) ? value.filters : null;
41
+ return filters ? readPhiPositiveInteger(filters.userId) : null;
42
+ }
34
43
  function readCreatedThreadId(value) {
35
44
  const payload = value?.payload;
36
45
  const threadId = payload?.thread?.thread?.id;
@@ -48,6 +57,14 @@ function PhiThreadsControllerView({ address, config, }) {
48
57
  * it cannot merely pass through.
49
58
  */
50
59
  const [openThreadId, setOpenThreadId] = useState(null);
60
+ /*
61
+ * A customer file Page's two readers apart: the member's file, and the conversation a Reply was last
62
+ * pressed in -- the file's or the listing's -- so the note that lands is read again where it was written.
63
+ */
64
+ const [fileThreadId, setFileThreadId] = useState(null);
65
+ const [replyThreadId, setReplyThreadId] = useState(null);
66
+ const memberRead = useRef({ userId: null, controller: null });
67
+ useEffect(() => () => memberRead.current.controller?.abort(), []);
51
68
  const emitRoutes = useMemo(() => config.signalRoutes?.emits ?? [], [config.signalRoutes?.emits]);
52
69
  /*
53
70
  * One declared output, delivered through every route that names it.
@@ -87,6 +104,32 @@ function PhiThreadsControllerView({ address, config, }) {
87
104
  */
88
105
  emitCapability("conditionStateChange", { state: { ready: true, threadOpen: threadId != null } }, correlationId);
89
106
  }, [emitCapability]);
107
+ /*
108
+ * Another member chosen: their file, read from the request the Page's Tables make for the same choice
109
+ * (it joins that one, so a choice stays one entry in the access log), handed to the file panel. Nobody
110
+ * chosen, the reader's own file and a failed read all close the panel; the Tables say why. The member
111
+ * also goes to whatever shows something of theirs by binding params -- the addresses tiles.
112
+ */
113
+ const openMemberFile = useCallback((userId, correlationId) => {
114
+ if (memberRead.current.userId === userId)
115
+ return;
116
+ memberRead.current.controller?.abort();
117
+ const controller = userId == null ? null : new AbortController();
118
+ memberRead.current = { userId, controller };
119
+ setFileThreadId(null);
120
+ // The addresses ask in their next render, while the read below is under way, and join it.
121
+ emitCapability("memberParamsChange", { params: { [PHI_CUSTOMER_FILE_MEMBER_PARAM]: userId } }, correlationId);
122
+ emitCapability("fileThreadChange", { threadId: null }, correlationId);
123
+ if (userId == null || !controller)
124
+ return;
125
+ readPhiCustomerFileThreadId(userId, controller.signal).then((threadId) => {
126
+ if (controller.signal.aborted)
127
+ return;
128
+ setFileThreadId(threadId);
129
+ if (threadId != null)
130
+ emitCapability("fileThreadChange", { threadId }, correlationId);
131
+ }, () => undefined);
132
+ }, [emitCapability]);
90
133
  const reloadInbox = useCallback((correlationId) => emitCapability("reload", null, correlationId), [emitCapability]);
91
134
  const closeDialog = useCallback((correlationId) => emitCapability("dialogClose", null, correlationId), [emitCapability]);
92
135
  const resetForm = useCallback((correlationId) => emitCapability("formReset", null, correlationId), [emitCapability]);
@@ -106,7 +149,12 @@ function PhiThreadsControllerView({ address, config, }) {
106
149
  return;
107
150
  // The toolbar's `+`. A Table says which action was run and on which row; what that means is here.
108
151
  if (signal.channel === "action" && signal.action === "activate") {
109
- if (readPhiTableActionSignalValue(signal.value)?.actionKey !== "newConversation")
152
+ const tableAction = readPhiTableActionSignalValue(signal.value);
153
+ if (tableAction?.actionKey === "reply") {
154
+ setReplyThreadId(readPhiPositiveInteger(tableAction.rowIdentity));
155
+ return;
156
+ }
157
+ if (tableAction?.actionKey !== "newConversation")
110
158
  return;
111
159
  setSubmitting(false);
112
160
  emitCapability("dialogOpen", null, signal.correlationId);
@@ -157,6 +205,11 @@ function PhiThreadsControllerView({ address, config, }) {
157
205
  * A message landed in the open conversation, from the Reply dialog. The reader is asked to catch
158
206
  * up rather than to switch, and the listing is stale because its order is by last activity.
159
207
  */
208
+ // A note in the member's file: the file panel catches up, and the listing, which leaves it out, is as it was.
209
+ if (fileThreadId != null && replyThreadId === fileThreadId) {
210
+ emitCapability("fileThreadReload", { threadId: fileThreadId }, signal.correlationId);
211
+ return;
212
+ }
160
213
  reloadInbox(signal.correlationId);
161
214
  emitCapability("threadReload", { threadId: openThreadId }, signal.correlationId);
162
215
  return;
@@ -174,6 +227,10 @@ function PhiThreadsControllerView({ address, config, }) {
174
227
  sendThread(readSelectedThreadId(signal.value), signal.correlationId);
175
228
  return;
176
229
  }
230
+ if (signal.channel === "member" && signal.action === "change") {
231
+ openMemberFile(readChosenMemberId(signal.value), signal.correlationId);
232
+ return;
233
+ }
177
234
  if (signal.channel === "opened" && signal.action === "change") {
178
235
  const opened = readPhiThreadSignalValue(signal.value)?.threadId ?? null;
179
236
  if (opened != null)
@@ -184,8 +241,11 @@ function PhiThreadsControllerView({ address, config, }) {
184
241
  closeDialog,
185
242
  dialogFormAddresses,
186
243
  emitCapability,
244
+ fileThreadId,
245
+ openMemberFile,
187
246
  openThreadId,
188
247
  reloadInbox,
248
+ replyThreadId,
189
249
  resetForm,
190
250
  sendThread,
191
251
  submitting,
@@ -53,6 +53,36 @@ export const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION = {
53
53
  valueType: "json",
54
54
  valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.threadSelection,
55
55
  },
56
+ /*
57
+ * The member's file, on a customer file Page (THREADS.md, section 10): the file panel's conversation,
58
+ * apart from the one chosen in the listing, so the two readers never show each other's. Change when
59
+ * another member is chosen -- `{ threadId: null }` for nobody, or for the reader's own file, which
60
+ * Core refuses -- and reload after a note landed in it.
61
+ */
62
+ {
63
+ id: "fileThreadChange",
64
+ action: "change",
65
+ valueType: "json",
66
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.threadSelection,
67
+ },
68
+ {
69
+ id: "fileThreadReload",
70
+ action: "reload",
71
+ valueType: "json",
72
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.threadSelection,
73
+ },
74
+ /*
75
+ * The member a customer file Page chose, as binding params (`{ params: { userId } }`, `null` for
76
+ * nobody), for a Collection View that shows something of theirs -- the addresses tiles: the choice
77
+ * forwarded to the View's `bindingParamsChange` (COLLECTIONS.md, "Filtered by another Widget's
78
+ * choice"), once per member chosen.
79
+ */
80
+ {
81
+ id: "memberParamsChange",
82
+ action: "change",
83
+ valueType: "json",
84
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableBindingParams,
85
+ },
56
86
  { id: "dialogOpen", action: "activate", valueType: "none" },
57
87
  { id: "dialogClose", action: "close", valueType: "none" },
58
88
  { id: "formSubmit", action: "activate", valueType: "none" },
@@ -84,6 +114,24 @@ export const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION = {
84
114
  valueType: "json",
85
115
  valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableSelection,
86
116
  },
117
+ /*
118
+ * The member a customer file Page chose: its person Table's query, `filters.userId`. The file's id
119
+ * comes from the same read the Page's Tables make for that choice, joined rather than asked again
120
+ * (`readPhiCustomerFileThreadId`), and goes out as `fileThreadChange`; the member goes out as
121
+ * `memberParamsChange`.
122
+ */
123
+ {
124
+ id: "memberChange",
125
+ channel: "member",
126
+ action: "change",
127
+ valueType: "json",
128
+ valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableQuery,
129
+ },
130
+ /*
131
+ * A Table's action, and a conversation's Reply, which a conversation says as a row action with the
132
+ * thread as its row: routed here too, the reply that lands is known to be the file's or the open
133
+ * conversation's, and only that one is read again.
134
+ */
87
135
  {
88
136
  id: "actionActivate",
89
137
  channel: "action",