@phis/ui 0.4.2 → 0.4.4

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 (335) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +4 -3
  2. package/components/cms/phi-cms-page-render-scope.d.ts +4 -5
  3. package/components/cms/phi-cms-page-render-scope.js +43 -22
  4. package/components/cms/phi-cms-render-diagnostic-client.js +7 -3
  5. package/components/cms/phi-cms-render-error-boundary.js +2 -1
  6. package/components/controls/phi-anchor-nav-control.js +4 -1
  7. package/components/controls/phi-background-control.js +21 -6
  8. package/components/controls/phi-bullet-list-control.d.ts +7 -2
  9. package/components/controls/phi-bullet-list-control.js +35 -5
  10. package/components/controls/phi-color-control.js +4 -2
  11. package/components/controls/phi-drawer-control-adapter.js +3 -2
  12. package/components/controls/phi-inline-text-editor.js +7 -1
  13. package/components/controls/phi-length-control.js +1 -1
  14. package/components/controls/phi-ribbon-control.d.ts +38 -0
  15. package/components/controls/phi-ribbon-control.js +57 -0
  16. package/components/controls/phi-ribbon-wrap-control.d.ts +26 -0
  17. package/components/controls/phi-ribbon-wrap-control.js +25 -0
  18. package/components/controls/phi-select-control.js +5 -2
  19. package/components/controls/phi-series-chart-control.d.ts +48 -0
  20. package/components/controls/phi-series-chart-control.js +82 -0
  21. package/components/controls/phi-table-control.d.ts +3 -0
  22. package/components/controls/phi-table-control.js +13 -1
  23. package/components/controls/phi-text-control.js +57 -3
  24. package/components/controls/phi-tree-control.js +4 -4
  25. package/components/controls/phi-truncated-hover-text.d.ts +15 -0
  26. package/components/controls/phi-truncated-hover-text.js +25 -0
  27. package/components/forms/link-target-form-control.d.ts +1 -1
  28. package/components/forms/link-target-form-control.js +2 -45
  29. package/components/forms/phi-form-widget-frame.js +4 -2
  30. package/components/forms/shared-form-provider-registry.js +1 -4
  31. package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
  32. package/components/media/asset-collection-runtime.js +6 -16
  33. package/components/media/media-font-metrics.d.ts +3 -0
  34. package/components/media/media-font-metrics.js +43 -0
  35. package/components/media/phi-area-upload-widget.js +53 -97
  36. package/components/media/phi-image-preview-data.d.ts +13 -0
  37. package/components/media/phi-image-preview-data.js +184 -9
  38. package/components/media/phi-media-picker-binding.js +16 -13
  39. package/components/media/phi-media-upload.d.ts +15 -8
  40. package/components/media/phi-media-upload.js +18 -9
  41. package/components/media/phi-site-font-assets.js +7 -8
  42. package/components/navigation/phi-link.js +6 -1
  43. package/components/overlays/phi-overlay-container-client.js +16 -1
  44. package/components/regions/clients/cms-region-container-client.js +6 -1
  45. package/components/regions/phi-cms-region-container.js +3 -0
  46. package/components/regions/phi-cms-region-shell.d.ts +12 -1
  47. package/components/regions/phi-cms-region-shell.js +81 -19
  48. package/components/regions/presets/phi-settings-page-shell-tree.js +48 -1
  49. package/components/root/phi-config-provider.d.ts +13 -0
  50. package/components/root/phi-config-provider.js +12 -1
  51. package/components/root/phi-root-background.d.ts +7 -0
  52. package/components/root/phi-root-background.js +20 -1
  53. package/components/root/phi-root-theme-resolver.js +3 -0
  54. package/components/root/phi-shell-chrome-overlay.d.ts +12 -1
  55. package/components/root/phi-shell-chrome-overlay.js +19 -3
  56. package/components/runtime/runtime-controller-materialization.js +12 -1
  57. package/components/shell/phi-antd-icon.d.ts +1 -0
  58. package/components/shell/phi-antd-icon.js +3 -0
  59. package/components/shell/use-phi-shell-sticky-top.js +61 -16
  60. package/components/state/scoped-state-store.js +20 -3
  61. package/components/surface/phi-surface-tone.d.ts +13 -0
  62. package/components/surface/phi-surface-tone.js +21 -0
  63. package/components/tables/client/phi-table-binding.d.ts +2 -1
  64. package/components/tables/client/phi-table-binding.js +45 -21
  65. package/components/trees/client/phi-tree-binding.js +19 -11
  66. package/components/widgets/client/bullet-list-entries-editor.d.ts +26 -0
  67. package/components/widgets/client/bullet-list-entries-editor.js +109 -0
  68. package/components/widgets/client/html-editor.js +1 -1
  69. package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
  70. package/components/widgets/client/shared/use-page-reference-options.js +57 -0
  71. package/components/widgets/config/background.d.ts +32 -1
  72. package/components/widgets/config/background.js +41 -2
  73. package/components/widgets/config/choice-shared.js +12 -13
  74. package/components/widgets/config/command-buttons.d.ts +5 -1
  75. package/components/widgets/config/command-buttons.js +38 -81
  76. package/components/widgets/config/control-signal-config.d.ts +3 -1
  77. package/components/widgets/config/control-signal-config.js +19 -17
  78. package/components/widgets/config/image-source-parser.d.ts +1 -0
  79. package/components/widgets/config/image-source-parser.js +7 -8
  80. package/components/widgets/config/mask.d.ts +6 -1
  81. package/components/widgets/config/mask.js +24 -1
  82. package/components/widgets/config/parser-primitives.js +72 -0
  83. package/components/widgets/config/stack-tabs.d.ts +1 -1
  84. package/components/widgets/config/stack-tabs.js +2 -3
  85. package/components/widgets/config/strict-config-reader.d.ts +40 -0
  86. package/components/widgets/config/strict-config-reader.js +174 -0
  87. package/components/widgets/label-sets/background.js +2 -0
  88. package/components/widgets/label-sets/effects.js +2 -0
  89. package/components/widgets/label-types/background.d.ts +1 -0
  90. package/components/widgets/label-types/background.js +1 -0
  91. package/components/widgets/label-types/effects.d.ts +1 -0
  92. package/components/widgets/label-types/effects.js +1 -0
  93. package/components/widgets/navigation-descriptor-resolver.server.js +20 -8
  94. package/components/widgets/shared/bullet-list-vocabulary.d.ts +27 -1
  95. package/components/widgets/shared/bullet-list-vocabulary.js +24 -4
  96. package/components/widgets/shared/card-body-client.d.ts +18 -4
  97. package/components/widgets/shared/card-body-client.js +126 -26
  98. package/components/widgets/shared/card-vocabulary.d.ts +31 -4
  99. package/components/widgets/shared/card-vocabulary.js +35 -2
  100. package/components/widgets/shared/markdown-body-client.js +39 -10
  101. package/components/widgets/signals/control-signal-capabilities.d.ts +0 -18
  102. package/components/widgets/signals/control-signal-capabilities.js +10 -22
  103. package/components/workspace/catalog-store.d.ts +4 -3
  104. package/components/workspace/catalog-store.js +6 -5
  105. package/gateway/dashboard-cards-route.js +1 -0
  106. package/gateway/internal-references.d.ts +6 -1
  107. package/gateway/internal-references.js +48 -23
  108. package/gateway/site-cms-write-validation.d.ts +9 -0
  109. package/gateway/site-cms-write-validation.js +78 -0
  110. package/gateway/site-proxy.js +19 -3
  111. package/helpers/cms-container-chrome.js +6 -1
  112. package/helpers/locale.d.ts +8 -0
  113. package/helpers/locale.js +18 -0
  114. package/helpers/renderable-block-serialization.js +1 -1
  115. package/helpers/shell-region-style.js +2 -1
  116. package/helpers/surface-style.d.ts +12 -1
  117. package/helpers/surface-style.js +28 -2
  118. package/module-dashboard-cards.d.ts +1 -1
  119. package/module-dashboard-cards.js +1 -1
  120. package/next/config.d.mts +3 -0
  121. package/next/config.mjs +28 -1
  122. package/package.json +2 -2
  123. package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +5 -1
  124. package/plugins/runtime-modules/accounting/presets.d.ts +9 -0
  125. package/plugins/runtime-modules/accounting/presets.js +37 -0
  126. package/plugins/runtime-modules/accounting/server.d.ts +1 -4
  127. package/plugins/runtime-modules/accounting/server.js +4 -7
  128. package/plugins/runtime-modules/app/presets.d.ts +18 -0
  129. package/plugins/runtime-modules/app/presets.js +67 -0
  130. package/plugins/runtime-modules/app/server.d.ts +1 -4
  131. package/plugins/runtime-modules/app/server.js +4 -7
  132. package/plugins/runtime-modules/area-definitions.d.ts +0 -42
  133. package/plugins/runtime-modules/area-definitions.js +3 -8
  134. package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
  135. package/plugins/runtime-modules/asset/services/collection.js +9 -1
  136. package/plugins/runtime-modules/asset/services/options.js +2 -2
  137. package/plugins/runtime-modules/builder/area-settings-answer.js +2 -1
  138. package/plugins/runtime-modules/builder/authoring-canvas.js +6 -6
  139. package/plugins/runtime-modules/builder/cards.js +3 -5
  140. package/plugins/runtime-modules/builder/clients/builder-region-overrides.js +3 -3
  141. package/plugins/runtime-modules/builder/clients/canvas-widget.js +15 -54
  142. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  143. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +25 -35
  144. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  145. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +8 -8
  146. package/plugins/runtime-modules/builder/clients/inspector-title.js +6 -6
  147. package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
  148. package/plugins/runtime-modules/builder/clients/layout-inspector.js +11 -25
  149. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +10 -5
  150. package/plugins/runtime-modules/builder/clients/mode-switch.js +1 -1
  151. package/plugins/runtime-modules/builder/clients/pages-header.js +11 -11
  152. package/plugins/runtime-modules/builder/clients/pages-workspace.js +1 -1
  153. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  154. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
  155. package/plugins/runtime-modules/builder/clients/shells-workspace.js +15 -31
  156. package/plugins/runtime-modules/builder/clients/structure-canvas.js +1 -1
  157. package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.d.ts +26 -0
  158. package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.js +36 -0
  159. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  160. package/plugins/runtime-modules/builder/clients/widget-inspector.js +1 -0
  161. package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +2 -2
  162. package/plugins/runtime-modules/builder/cms-instance-allocator.js +8 -28
  163. package/plugins/runtime-modules/builder/controller/client.d.ts +0 -15
  164. package/plugins/runtime-modules/builder/controller/definition.d.ts +0 -15
  165. package/plugins/runtime-modules/builder/controller/definition.js +0 -8
  166. package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +1 -2
  167. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +11 -30
  168. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +15 -2
  169. package/plugins/runtime-modules/builder/controller/inspector-controller.d.ts +1 -2
  170. package/plugins/runtime-modules/builder/controller/inspector-controller.js +4 -7
  171. package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -2
  172. package/plugins/runtime-modules/builder/controller/page-controller.js +16 -68
  173. package/plugins/runtime-modules/builder/controller/server-definition.d.ts +0 -15
  174. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.d.ts +2 -5
  175. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +6 -50
  176. package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +2 -3
  177. package/plugins/runtime-modules/builder/controller/workspace-controller.js +89 -153
  178. package/plugins/runtime-modules/builder/data-providers.d.ts +1 -0
  179. package/plugins/runtime-modules/builder/data-providers.js +1 -0
  180. package/plugins/runtime-modules/builder/definition.d.ts +1 -0
  181. package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +64 -30
  182. package/plugins/runtime-modules/builder/developer-workspace-store.js +255 -61
  183. package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +4 -3
  184. package/plugins/runtime-modules/builder/history.d.ts +3 -1
  185. package/plugins/runtime-modules/builder/options-providers.js +3 -2
  186. package/plugins/runtime-modules/builder/page-catalog-client.js +19 -7
  187. package/plugins/runtime-modules/builder/page-meta-form.js +1 -0
  188. package/plugins/runtime-modules/builder/page-references-provider.js +1 -1
  189. package/plugins/runtime-modules/builder/persistence.js +33 -69
  190. package/plugins/runtime-modules/builder/public-route-collisions.d.ts +2 -2
  191. package/plugins/runtime-modules/builder/public-route-collisions.js +6 -19
  192. package/plugins/runtime-modules/builder/render-root-node-preview.server.js +20 -3
  193. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +28 -18
  194. package/plugins/runtime-modules/builder/runtime-module-selection.d.ts +2 -12
  195. package/plugins/runtime-modules/builder/runtime-module-selection.js +16 -42
  196. package/plugins/runtime-modules/builder/services/navigation-table.js +9 -15
  197. package/plugins/runtime-modules/builder/services/page-source-tree.js +8 -8
  198. package/plugins/runtime-modules/builder/services/runtime-modules-table.js +10 -10
  199. package/plugins/runtime-modules/builder/services/signal-routes-table.js +3 -3
  200. package/plugins/runtime-modules/builder/signal-route-selection.d.ts +1 -2
  201. package/plugins/runtime-modules/builder/signal-route-selection.js +2 -2
  202. package/plugins/runtime-modules/builder/signal-wiring-options.js +3 -2
  203. package/plugins/runtime-modules/builder/structure-dnd.js +8 -61
  204. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +17 -10
  205. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +27 -22
  206. package/plugins/runtime-modules/builder/workspace-catalog-actions.d.ts +55 -0
  207. package/plugins/runtime-modules/builder/workspace-catalog-actions.js +142 -0
  208. package/plugins/runtime-modules/client-authoring-module.d.ts +8 -1
  209. package/plugins/runtime-modules/client-authoring-module.js +13 -3
  210. package/plugins/runtime-modules/client-manifests/common.js +1 -1
  211. package/plugins/runtime-modules/{runtime-calendar-adapters.js → core/calendar-adapters.js} +2 -2
  212. package/plugins/runtime-modules/{client-calendar-adapters/core.js → core/client-calendar-adapters.js} +1 -1
  213. package/plugins/runtime-modules/core/content-entries/table.js +1 -1
  214. package/plugins/runtime-modules/core/data-providers.d.ts +3 -0
  215. package/plugins/runtime-modules/core/data-providers.js +2 -1
  216. package/plugins/runtime-modules/core/definition.d.ts +3 -0
  217. package/plugins/runtime-modules/core/definition.js +1 -1
  218. package/plugins/runtime-modules/core/messaging/data-providers.d.ts +1 -0
  219. package/plugins/runtime-modules/core/messaging/data-providers.js +1 -0
  220. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +1 -1
  221. package/plugins/runtime-modules/core/server.js +1 -1
  222. package/plugins/runtime-modules/core/themes.d.ts +44 -0
  223. package/plugins/runtime-modules/core/themes.js +12 -0
  224. package/plugins/runtime-modules/core/widgets/brand/client.d.ts +12 -3
  225. package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
  226. package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
  227. package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
  228. package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
  229. package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
  230. package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
  231. package/plugins/runtime-modules/core/widgets/card/collection-view-binding.js +25 -9
  232. package/plugins/runtime-modules/core/widgets/card/config.d.ts +301 -254
  233. package/plugins/runtime-modules/core/widgets/card/config.js +68 -3
  234. package/plugins/runtime-modules/core/widgets/card/editor.js +41 -4
  235. package/plugins/runtime-modules/core/widgets/card/server.d.ts +3 -0
  236. package/plugins/runtime-modules/core/widgets/card/server.js +32 -3
  237. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +7 -6
  238. package/plugins/runtime-modules/core/widgets/collection-view/config.js +9 -2
  239. package/plugins/runtime-modules/core/widgets/description/client.js +3 -3
  240. package/plugins/runtime-modules/core/widgets/description/config.d.ts +2 -25
  241. package/plugins/runtime-modules/core/widgets/description/editor.js +7 -63
  242. package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
  243. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +2 -25
  244. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +2 -25
  245. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
  246. package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
  247. package/plugins/runtime-modules/core/widgets/image/config.js +2 -2
  248. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
  249. package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
  250. package/plugins/runtime-modules/core/widgets/markdown/editor.js +11 -4
  251. package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
  252. package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
  253. package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
  254. package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
  255. package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
  256. package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
  257. package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
  258. package/plugins/runtime-modules/core/widgets/result/config.d.ts +5 -25
  259. package/plugins/runtime-modules/core/widgets/result/config.js +2 -0
  260. package/plugins/runtime-modules/core/widgets/result/server.js +25 -19
  261. package/plugins/runtime-modules/core/widgets/sidebar-navigation/authoring.js +1 -1
  262. package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
  263. package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
  264. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +2 -25
  265. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
  266. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +11 -2
  267. package/plugins/runtime-modules/core/widgets/table/client.js +8 -4
  268. package/plugins/runtime-modules/core/widgets/table/config.d.ts +6 -83
  269. package/plugins/runtime-modules/core/widgets/table/config.js +302 -452
  270. package/plugins/runtime-modules/core/widgets/tree/config.js +5 -2
  271. package/plugins/runtime-modules/dashboard/card-rows.d.ts +7 -0
  272. package/plugins/runtime-modules/dashboard/card-rows.js +87 -0
  273. package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +32 -12
  274. package/plugins/runtime-modules/dashboard/services/collection.js +17 -7
  275. package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
  276. package/plugins/runtime-modules/groups/data-providers.d.ts +2 -0
  277. package/plugins/runtime-modules/groups/data-providers.js +3 -3
  278. package/plugins/runtime-modules/groups/definition.d.ts +2 -0
  279. package/plugins/runtime-modules/localization/data-providers.d.ts +3 -0
  280. package/plugins/runtime-modules/localization/data-providers.js +2 -0
  281. package/plugins/runtime-modules/localization/definition.d.ts +3 -0
  282. package/plugins/runtime-modules/localization/services/table.js +3 -7
  283. package/plugins/runtime-modules/observability/data-providers.d.ts +1 -0
  284. package/plugins/runtime-modules/observability/data-providers.js +1 -0
  285. package/plugins/runtime-modules/observability/definition.d.ts +1 -0
  286. package/plugins/runtime-modules/observability/module.d.ts +1 -0
  287. package/plugins/runtime-modules/observability/services/table.js +1 -1
  288. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +2 -105
  289. package/plugins/runtime-modules/public/presets.d.ts +115 -0
  290. package/plugins/runtime-modules/{area-base-presets.js → public/presets.js} +19 -119
  291. package/plugins/runtime-modules/public/server.d.ts +1 -4
  292. package/plugins/runtime-modules/public/server.js +4 -7
  293. package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +7 -8
  294. package/plugins/runtime-modules/public-base-page-references.d.ts +1 -1
  295. package/plugins/runtime-modules/public-base-page-references.js +1 -1
  296. package/plugins/runtime-modules/revisions/controller/client.js +11 -11
  297. package/plugins/runtime-modules/revisions/services/table.js +3 -3
  298. package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +22 -0
  299. package/plugins/runtime-modules/theme/widgets/brand-controls/client.d.ts +2 -1
  300. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +111 -72
  301. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +2 -1
  302. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +28 -31
  303. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +1 -1
  304. package/plugins/runtime-modules/theme-descriptors.js +1 -1
  305. package/plugins/runtime-modules/user-management/data-providers.d.ts +2 -0
  306. package/plugins/runtime-modules/user-management/data-providers.js +1 -0
  307. package/plugins/runtime-modules/user-management/definition.d.ts +2 -0
  308. package/server-helpers/cms-link-targets.js +6 -0
  309. package/styles/control-shape.css +11 -11
  310. package/styles/controls.css +67 -5
  311. package/styles/layout.css +61 -9
  312. package/styles/shell.css +73 -0
  313. package/theme/phi-antd-token-resolver.js +20 -1
  314. package/theme/phi-theme-tokens.d.ts +1 -1
  315. package/theme/phi-theme-tokens.js +1 -0
  316. package/theme/phi-theme.d.ts +5 -0
  317. package/theme/phi-theme.js +21 -0
  318. package/theme/phi-tokens.d.ts +16 -15
  319. package/theme/phi-tokens.js +16 -15
  320. package/types/cms-config.js +142 -185
  321. package/types/cms-plugins.d.ts +6 -11
  322. package/types/core-widget-placements.d.ts +14 -3
  323. package/types/dashboard-cards.d.ts +48 -4
  324. package/types/dashboard-cards.js +6 -0
  325. package/types/media.d.ts +0 -3
  326. package/types/renderable-block.d.ts +6 -1
  327. package/types/site-theme.d.ts +10 -2
  328. package/types/table-widget.d.ts +9 -0
  329. package/types/table-widget.js +20 -0
  330. package/types.d.ts +1 -1
  331. package/widget-config.d.ts +2 -0
  332. package/widget-config.js +6 -0
  333. package/plugins/runtime-modules/area-base-presets.d.ts +0 -139
  334. /package/plugins/runtime-modules/{runtime-calendar-adapters.d.ts → core/calendar-adapters.d.ts} +0 -0
  335. /package/plugins/runtime-modules/{client-calendar-adapters/core.d.ts → core/client-calendar-adapters.d.ts} +0 -0
@@ -8,12 +8,12 @@ import { findPhiBuilderLayoutNodeById, findPhiBuilderWidgetNodeByIdInLayouts, }
8
8
  import { resolveRegionDraftKey } from "../developer-region-drafts";
9
9
  import { usePhiDeveloperBuilderStateValue, usePhiDeveloperRegionDrafts, } from "../developer-workspace-store";
10
10
  export function PhiBuilderInspectorTitleWidgetClient({ inspectorLabels, regionLabels, }) {
11
- const area = usePhiDeveloperBuilderStateValue("public", (state) => state.area);
12
- const pageKey = usePhiDeveloperBuilderStateValue("public", (state) => state.pageKey);
13
- const nodeId = usePhiDeveloperBuilderStateValue("public", (state) => state.nodeId);
14
- const nodeKey = usePhiDeveloperBuilderStateValue("public", (state) => state.nodeKey);
15
- const nodeKind = usePhiDeveloperBuilderStateValue("public", (state) => state.nodeKind);
16
- const selectedRootRegionKey = usePhiDeveloperBuilderStateValue("public", (state) => state.selectedRootRegionKey);
11
+ const area = usePhiDeveloperBuilderStateValue((state) => state.area);
12
+ const pageKey = usePhiDeveloperBuilderStateValue((state) => state.pageKey);
13
+ const nodeId = usePhiDeveloperBuilderStateValue((state) => state.nodeId);
14
+ const nodeKey = usePhiDeveloperBuilderStateValue((state) => state.nodeKey);
15
+ const nodeKind = usePhiDeveloperBuilderStateValue((state) => state.nodeKind);
16
+ const selectedRootRegionKey = usePhiDeveloperBuilderStateValue((state) => state.selectedRootRegionKey);
17
17
  const regionDrafts = usePhiDeveloperRegionDrafts();
18
18
  const plugins = usePhiBuilderModuleMetas(area).plugins;
19
19
  const title = useMemo(() => {
@@ -1,4 +1,4 @@
1
- import { type PhiBackgroundControlProps } from "../../../../components/controls/phi-background-control";
1
+ import type { PhiBackgroundControlProps } from "../../../../components/controls/phi-background-control";
2
2
  import type { PhiInspectorSurfaceLabels } from "./inspector-surface-labels";
3
3
  import type { PhiInspectorWidgetLabels } from "../../../../components/widgets/label-types/inspector";
4
4
  import type { PhiBackgroundWidgetLabels } from "../../../../components/widgets/label-types/background";
@@ -2,30 +2,22 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect } from "react";
4
4
  import { usePhiBaseLayoutOwnSlotController } from "../../../../components/layouts/phi-layout-slot-state";
5
- import { PhiBackgroundControl } from "../../../../components/controls/phi-background-control";
6
- import { PhiBorderControl } from "../../../../components/controls/phi-border-control";
7
5
  import { PhiSurfaceControl } from "../../../../components/controls/phi-surface-control";
8
- import { PhiShadowControl } from "../../../../components/controls/phi-shadow-control";
9
6
  import { PhiViewportVisibilityControl } from "../../../../components/controls/phi-viewport-visibility-control";
10
7
  import { PhiPlacementMatrixControl } from "../../../../components/controls/phi-placement-matrix-control";
11
8
  import { PhiInspectorSectionContent } from "./inspector-section-content";
12
9
  import { PhiGridPlacementSettings } from "./grid-placement-settings";
13
10
  import { resolvePhiLayoutSignalEndpoints, resolvePhiSignalEndpointCapabilities, } from "../../../../components/widgets/signals/signal-endpoints";
14
- import { readPhiShadow } from "../../../../types/layout-style";
15
11
  import { normalizePhiPaddingWidgetConfig } from "../../../../types/cms-config";
16
12
  import {} from "../developer-workspace-types";
17
13
  import { isPhiInspectorConfigFieldVisible, renderPhiInspectorPaddingConfigControl, renderPhiInspectorConfigField, renderPhiInspectorSlotTextsField, renderPhiInspectorSwitchRow, } from "./inspector-config-field";
18
14
  import { hasPhiFlag } from "../../../../helpers/flags";
19
15
  import { PhiCmsFlags } from "../../../../constants/phi-cms";
20
16
  import { PhiInspectorSignalSection, } from "./inspector-signal-section";
21
- import { PhiFlexControl } from "../../../../components/controls/phi-flex-control";
22
17
  import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
23
18
  const PHI_GAP_SM = "var(--ant-padding-sm)";
24
19
  function isPhiCmsChromeConfigField(field) {
25
20
  return (field.type === "padding"
26
- || field.type === "background"
27
- || field.type === "border"
28
- || field.type === "shadow"
29
21
  || field.type === "grid-placement"
30
22
  || field.type === "column-count");
31
23
  }
@@ -70,7 +62,7 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
70
62
  const chromeFields = declaredFields
71
63
  .filter(isPhiCmsChromeConfigField)
72
64
  .filter((field) => isPhiInspectorConfigFieldVisible(field, currentLayoutConfigRecord))
73
- .filter((field) => field.type !== "grid-placement" && field.type !== "column-count");
65
+ .filter((field) => field.type === "padding");
74
66
  const gridPlacementField = declaredFields
75
67
  .filter(isPhiCmsChromeConfigField)
76
68
  .filter((field) => isPhiInspectorConfigFieldVisible(field, currentLayoutConfigRecord))
@@ -89,8 +81,7 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
89
81
  const settingsHasContent = !settingsAnswerIsKnown || !isTargetKind || section !== "settings"
90
82
  || settingsFields.length > 0 || gridPlacementField != null
91
83
  || (slotTextsFields.length > 0 && textSlots.length > 0)
92
- || selectedStructurePlugin?.translatesOwnText === true
93
- || chromeFields.some((field) => field.type !== "padding");
84
+ || selectedStructurePlugin?.translatesOwnText === true;
94
85
  const ownSlot = usePhiBaseLayoutOwnSlotController();
95
86
  useEffect(() => {
96
87
  if (!ownSlot)
@@ -118,16 +109,13 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
118
109
  routeScope: signalRouteScope,
119
110
  });
120
111
  const signalCapabilities = resolvePhiSignalEndpointCapabilities(signalEndpoints);
121
- /*
122
- * The chrome fields a layout declares itself: its own padding, which has the Drawer's Paddings panel,
123
- * and anything else -- Split Card's two cards -- which lives in Settings with the layout's other fields.
124
- */
112
+ // The padding fields a layout declares itself, each with its own panel in the Drawer.
125
113
  const declaredChromeSections = chromeFields.map((field) => ({
126
114
  field,
127
115
  section: {
128
116
  key: field.section ?? field.key,
129
117
  title: field.label,
130
- children: (_jsx("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: field.type === "padding" ? (renderPhiInspectorPaddingConfigControl({
118
+ children: (_jsx("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: renderPhiInspectorPaddingConfigControl({
131
119
  field,
132
120
  disabled: isPreviewMode || (!onPaddingChange && !onConfigPatch),
133
121
  config: isCanonicalPaddingField(field)
@@ -144,14 +132,11 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
144
132
  }
145
133
  onConfigPatch?.(Object.fromEntries(Object.entries(patch).map(([key, value]) => [key, value ?? null])));
146
134
  },
147
- })) : field.type === "background" ? (_jsx(PhiBackgroundControl, { mode: "control", disabled: isPreviewMode || !onConfigPatch, value: currentDraftRecord?.[field.key] ?? null, config: layoutDefaultConfigRecord?.[field.key] ?? null, onChange: (background) => onConfigPatch?.({ [field.key]: background }), labels: backgroundLabels, colorPickerLabels: colorPickerLabels, colorPickerPlacement: "left", renderMediaPicker: renderMediaPicker })) : field.type === "border" ? (_jsx(PhiBorderControl, { mode: "control", disabled: isPreviewMode || !onConfigPatch, value: currentDraftRecord?.[field.key] ?? null, config: layoutDefaultConfigRecord?.[field.key] ?? null, onChange: (border) => onConfigPatch?.({ [field.key]: border }), labels: borderLabels, colorPickerLabels: colorPickerLabels, colorPickerPlacement: "left" })) : (_jsx(PhiShadowControl, { mode: "control", disabled: isPreviewMode || !onConfigPatch, value: readPhiShadow(currentDraftRecord?.[field.key]) ??
148
- readPhiShadow(layoutDefaultConfigRecord?.[field.key]) ??
149
- null, onChange: (shadow) => onConfigPatch?.({ [field.key]: shadow }) })) })),
135
+ }) })),
150
136
  },
151
137
  }));
152
- const declaredCardSections = declaredChromeSections.filter((entry) => entry.field.type !== "padding");
153
138
  return (_jsx("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: !isTargetKind ? (_jsx(PhiTypographyControl, { type: "secondary", children: "Select a layout to edit its geometry." })) : (_jsx("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: _jsx(PhiInspectorSectionContent, { sectionKey: section ?? "settings", sections: [
154
- ...(settingsFields.length > 0 || gridPlacementField || declaredCardSections.length > 0 ||
139
+ ...(settingsFields.length > 0 || gridPlacementField ||
155
140
  selectedStructurePlugin?.translatesOwnText || (slotTextsFields.length > 0 && textSlots.length > 0)
156
141
  ? [
157
142
  {
@@ -164,6 +149,9 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
164
149
  config: currentDraftRecord ?? {},
165
150
  defaultConfig: layoutDefaultConfigRecord,
166
151
  disabled: isPreviewMode,
152
+ backgroundLabels,
153
+ borderLabels,
154
+ renderMediaPicker,
167
155
  colorPickerLabels,
168
156
  iconPickerLabels,
169
157
  fieldLabels,
@@ -185,7 +173,7 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
185
173
  disabled: isPreviewMode,
186
174
  ...(onTranslateChange ? { onChange: onTranslateChange } : {}),
187
175
  })
188
- : null, gridPlacementField ? (_jsx(PhiGridPlacementSettings, { config: currentDraftRecord ?? {}, defaultConfig: layoutDefaultConfigRecord, occupiedSlotIndices: gridOccupiedSlotIndices, labels: gridLabels, withDistribution: gridPlacementField.type === "grid-placement", disabled: isPreviewMode, onConfigChange: onConfigPatch ? (key, value) => onConfigPatch({ [key]: value }) : undefined })) : null, declaredCardSections.map((entry) => (_jsxs(PhiFlexControl, { vertical: true, gap: 8, style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTypographyControl, { children: entry.section.title }), entry.section.children] }, entry.section.key)))] })),
176
+ : null, gridPlacementField ? (_jsx(PhiGridPlacementSettings, { config: currentDraftRecord ?? {}, defaultConfig: layoutDefaultConfigRecord, occupiedSlotIndices: gridOccupiedSlotIndices, labels: gridLabels, withDistribution: gridPlacementField.type === "grid-placement", disabled: isPreviewMode, onConfigChange: onConfigPatch ? (key, value) => onConfigPatch({ [key]: value }) : undefined })) : null] })),
189
177
  },
190
178
  ]
191
179
  : []),
@@ -207,9 +195,7 @@ export function PhiDeveloperBuilderLayoutInspectorWidgetClient({ section, builde
207
195
  title: surfaceLabels?.section ?? "Surface",
208
196
  children: (_jsx(PhiSurfaceControl, { disabled: isPreviewMode, value: currentDraft?.surface ?? null, onChange: (surface) => onSurfaceChange?.(surface), labels: surfaceLabels?.parts, backgroundLabels: backgroundLabels, borderLabels: borderLabels, colorPickerLabels: colorPickerLabels, renderMediaPicker: renderMediaPicker })),
209
197
  },
210
- ...declaredChromeSections
211
- .filter((entry) => entry.field.type === "padding")
212
- .map((entry) => entry.section),
198
+ ...declaredChromeSections.map((entry) => entry.section),
213
199
  ],
214
200
  {
215
201
  key: "signals",
@@ -1,14 +1,19 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { usePhiConfig } from "../../../../components/root/phi-config-provider";
3
+ import { usePhiPageModeToken } from "../../../../components/root/phi-config-provider";
4
+ import { usePhiPageModeTone } from "../../../../components/surface/phi-surface-tone";
4
5
  import {} from "../node-kind-theme";
5
6
  import { PhiLayoutAnchoredOverlay } from "../../../../components/layouts/clients/phi-layout-anchored-overlay";
6
7
  import { PhiLayoutConfigButtonWidget, PhiLayoutDeleteButtonWidget, PhiLayoutDragButtonWidget, PhiPlusButtonWidget, } from "./layout-scaffold-buttons";
7
8
  export function PhiLayoutPlusButtonOverlay({ slotIndex, label, onInsert, anchor, slotRole, inset, ariaLabel, dropTarget, children, }) {
8
- return (_jsx(PhiLayoutAnchoredOverlay, { anchor: anchor, slotRole: slotRole, inset: inset, children: children ?? (_jsx(PhiPlusButtonWidget, { slotIndex: slotIndex, label: label, ariaLabel: ariaLabel, onInsert: onInsert, dropTarget: dropTarget })) }));
9
+ // In the editor's mode, not a tone's: the insert button stays the Builder's inside a toned Surface.
10
+ const pageModeTone = usePhiPageModeTone();
11
+ return (_jsx(PhiLayoutAnchoredOverlay, { anchor: anchor, slotRole: slotRole, inset: inset, children: pageModeTone.wrap(children ?? (_jsx(PhiPlusButtonWidget, { slotIndex: slotIndex, label: label, ariaLabel: ariaLabel, onInsert: onInsert, dropTarget: dropTarget }))) }));
9
12
  }
10
13
  export function PhiLayoutDeleteButtonOverlay({ onDelete, onOpenInspector, ariaLabel, inspectorAriaLabel, top, right, bottom, left, placement, transform, zIndex = 10, nodeKind, leading, children, }) {
11
- const { token } = usePhiConfig();
14
+ // The editor's colours, not a tone's: a toolbar inside a toned Surface stays in the page's mode.
15
+ const token = usePhiPageModeToken();
16
+ const pageModeTone = usePhiPageModeTone();
12
17
  const resolvedTop = top ?? (placement ? "auto" : -10);
13
18
  const resolvedRight = right ?? (placement === "bottom-left" ? "auto" : 0);
14
19
  const resolvedBottom = bottom ?? (placement ? -10 : "auto");
@@ -42,7 +47,7 @@ export function PhiLayoutDeleteButtonOverlay({ onDelete, onOpenInspector, ariaLa
42
47
  color: "inherit",
43
48
  };
44
49
  })();
45
- return (_jsx("div", { className: "phi-layout-scaffold-delete", "data-phi-builder-scaffold-action": "true", "data-phi-builder-node-kind": nodeKind ?? undefined, onClick: (event) => event.stopPropagation(), onMouseDown: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), style: {
50
+ return (_jsx("div", { className: pageModeTone.className ? `phi-layout-scaffold-delete ${pageModeTone.className}` : "phi-layout-scaffold-delete", "data-phi-builder-scaffold-action": "true", "data-phi-builder-node-kind": nodeKind ?? undefined, onClick: (event) => event.stopPropagation(), onMouseDown: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), style: {
46
51
  /*
47
52
  * The bar is as wide as its buttons, and it says so itself.
48
53
  *
@@ -63,7 +68,7 @@ export function PhiLayoutDeleteButtonOverlay({ onDelete, onOpenInspector, ariaLa
63
68
  "--phi-layout-scaffold-delete-border": chromeTheme.border,
64
69
  "--phi-layout-scaffold-delete-color": chromeTheme.color,
65
70
  "--phi-layout-scaffold-delete-shadow": "var(--ant-box-shadow-tertiary)",
66
- }, children: children ?? (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [leading, onOpenInspector ? (_jsx(PhiLayoutConfigButtonWidget, { onOpenInspector: onOpenInspector, ariaLabel: inspectorAriaLabel })) : null, _jsx(PhiLayoutDeleteButtonWidget, { onDelete: onDelete, ariaLabel: ariaLabel })] })) }));
71
+ }, children: pageModeTone.wrap(children ?? (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [leading, onOpenInspector ? (_jsx(PhiLayoutConfigButtonWidget, { onOpenInspector: onOpenInspector, ariaLabel: inspectorAriaLabel })) : null, _jsx(PhiLayoutDeleteButtonWidget, { onDelete: onDelete, ariaLabel: ariaLabel })] }))) }));
67
72
  }
68
73
  export function PhiLayoutDragButtonOverlay({ dragData, ariaLabel, nodeKind, top = "50%", left = 0, zIndex = 41, }) {
69
74
  return (_jsx(PhiLayoutDeleteButtonOverlay, { onDelete: () => undefined, top: top, right: "auto", bottom: "auto", left: left, transform: "translate(-50%, -50%)", zIndex: zIndex, nodeKind: nodeKind, children: _jsx(PhiLayoutDragButtonWidget, { ariaLabel: ariaLabel, dragData: dragData }) }));
@@ -8,7 +8,7 @@ import { usePhiConfig } from "../../../../components/root/phi-config-provider";
8
8
  import { PhiFlexControl } from "../../../../components/controls/phi-flex-control";
9
9
  export function PhiBuilderModeSwitchWidgetClient({ disabled = false, labels = PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS, }) {
10
10
  const { token } = usePhiConfig();
11
- const builderMode = usePhiDeveloperBuilderStateValue("public", (state) => state.builderMode);
11
+ const builderMode = usePhiDeveloperBuilderStateValue((state) => state.builderMode);
12
12
  const isDisabled = disabled;
13
13
  const controlSignals = usePhiControlSignalController({
14
14
  key: "builderMode",
@@ -35,22 +35,22 @@ function PhiDeveloperBuilderPagesHeaderTitleField({ area, path, disabled, initia
35
35
  }
36
36
  export function PhiDeveloperBuilderPagesHeaderSection({ mode, pageTitle, disabled = false, labels = PHI_PAGE_TITLE_WIDGET_DEFAULT_LABELS, }) {
37
37
  const searchParams = useSearchParams();
38
- const currentArea = usePhiDeveloperBuilderStateValue("public", (state) => state.area);
39
- const currentPageKey = usePhiDeveloperBuilderStateValue("public", (state) => state.pageKey);
40
- const builderMode = usePhiDeveloperBuilderStateValue("public", (state) => state.builderMode);
41
- const customPages = usePhiDeveloperBuilderStateValue("public", (state) => state.customPages);
42
- const modulePresetPagesByArea = usePhiDeveloperBuilderStateValue("public", (state) => state.modulePresetPagesByArea);
43
- const catalogHydrated = usePhiDeveloperBuilderStateValue("public", (state) => state.catalogHydrated);
44
- const persistedPageCatalogByArea = usePhiDeveloperBuilderStateValue("public", (state) => state.persistedPageCatalogByArea);
38
+ const currentArea = usePhiDeveloperBuilderStateValue((state) => state.area);
39
+ const currentPageKey = usePhiDeveloperBuilderStateValue((state) => state.pageKey);
40
+ const builderMode = usePhiDeveloperBuilderStateValue((state) => state.builderMode);
41
+ const customPages = usePhiDeveloperBuilderStateValue((state) => state.customPages);
42
+ const modulePresetPagesByArea = usePhiDeveloperBuilderStateValue((state) => state.modulePresetPagesByArea);
43
+ const catalogHydrated = usePhiDeveloperBuilderStateValue((state) => state.catalogHydrated);
44
+ const persistedPageCatalogByArea = usePhiDeveloperBuilderStateValue((state) => state.persistedPageCatalogByArea);
45
45
  /*
46
46
  * What the Select is allowed to name, which is narrower than what is installed: the Pages the Area
47
47
  * answers with. The three fields below are what that narrowing is read from -- which Modules are
48
48
  * switched on, and what the Area said about its root.
49
49
  */
50
- const navigationSurfacesByArea = usePhiDeveloperBuilderStateValue("public", (state) => state.navigationSurfacesByArea);
51
- const runtimeModuleIdsByArea = usePhiDeveloperBuilderStateValue("public", (state) => state.runtimeModuleIdsByArea);
52
- const areaRootRoutes = usePhiDeveloperBuilderStateValue("public", (state) => state.areaRootRoutes);
53
- const pageCatalogHydratedByArea = usePhiDeveloperBuilderStateValue("public", (state) => state.pageCatalogHydratedByArea);
50
+ const navigationSurfacesByArea = usePhiDeveloperBuilderStateValue((state) => state.navigationSurfacesByArea);
51
+ const runtimeModuleIdsByArea = usePhiDeveloperBuilderStateValue((state) => state.runtimeModuleIdsByArea);
52
+ const areaRootRoutes = usePhiDeveloperBuilderStateValue((state) => state.areaRootRoutes);
53
+ const pageCatalogHydratedByArea = usePhiDeveloperBuilderStateValue((state) => state.pageCatalogHydratedByArea);
54
54
  const resolvedCustomPages = customPages ?? {};
55
55
  const titleModeEnabled = mode === "full" || mode === "title";
56
56
  const searchArea = normalizePhiBuilderAreaSearchParam(searchParams.get(PHI_BUILDER_AREA_SEARCH_PARAM));
@@ -19,7 +19,7 @@ export function PhiDeveloperBuilderPagesWorkspaceWidgetClient({ pageDraftsByScop
19
19
  * Empty drafts rather than no drafts, because the merge below is a merge: leaving the keys out would
20
20
  * let the Preset's regions stand from before the Builder answered.
21
21
  */
22
- const constructedRoot = usePhiDeveloperBuilderStateValue("public", (state) => isPhiBuilderConstructedRootPage(state, pageMetaArea, pageMetaPageKey));
22
+ const constructedRoot = usePhiDeveloperBuilderStateValue((state) => isPhiBuilderConstructedRootPage(state, pageMetaArea, pageMetaPageKey));
23
23
  const emptyPresetDrafts = useMemo(() => buildPhiDeveloperBuilderRegionDraftsFromTree({ regions: [], layoutNodes: [], contentWidgets: [] }, pageMetaArea, pageMetaPageKey, PHI_BUILDER_PAGE_REGION_KEYS), [pageMetaArea, pageMetaPageKey]);
24
24
  useEffect(() => {
25
25
  mergePhiDeveloperPagePresetDrafts(constructedRoot ? emptyPresetDrafts : pagePresetDrafts);
@@ -67,7 +67,7 @@ function collectNodesWithChildren(nodes, into = new Set()) {
67
67
  * field is, offered from the Pages the Area actually answers.
68
68
  */
69
69
  export function PhiRegionVisibilityFields({ regionKey, regionConfig, disabled, labels, onChange, }) {
70
- const state = usePhiDeveloperBuilderStateValue("public", (current) => current);
70
+ const state = usePhiDeveloperBuilderStateValue((current) => current);
71
71
  const pages = usePhiBuilderOfferedPageCatalog(state, state.area);
72
72
  const tree = useMemo(() => buildPhiBuilderPageScopeTree(state.area, pages, pages, { landing: labels.landing }), [labels.landing, pages, state.area]);
73
73
  const subtreeValues = useMemo(() => collectNodesWithChildren(tree), [tree]);
@@ -8,7 +8,7 @@ import { PhiRuntimeModuleProvider } from "../../../../components/runtime/runtime
8
8
  import { setPhiBuilderModuleMetas } from "../plugin-meta-store";
9
9
  import { usePhiDeveloperBuilderStateValue } from "../developer-workspace-store";
10
10
  export function PhiBuilderRuntimeModuleAuthoringBoundary({ targetArea, catalog, pickerDataProviderKeys, children, }) {
11
- const selectedModuleIds = usePhiDeveloperBuilderStateValue("public", (state) => state.runtimeModuleIdsByArea[targetArea]);
11
+ const selectedModuleIds = usePhiDeveloperBuilderStateValue((state) => state.runtimeModuleIdsByArea[targetArea]);
12
12
  const activeEntries = useMemo(() => {
13
13
  if (selectedModuleIds == null) {
14
14
  return catalog;
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useEffect, useMemo, useRef } from "react";
3
+ import { useCallback, useMemo } from "react";
4
4
  import { PhiStructureRegionLayout } from "../../../../components/layouts/phi-structure-region-layout";
5
5
  import { hasPhiConfigFlag } from "../../../../helpers/flags";
6
6
  import { PhiCmsFlags } from "../../../../constants/phi-cms";
7
- import { mergePhiDeveloperRegionDrafts, usePhiDeveloperBuilderStateValue, usePhiDeveloperRegionDrafts, } from "../developer-workspace-store";
7
+ import { usePhiDeveloperBuilderStateValue, usePhiDeveloperRegionDraftsValue, } from "../developer-workspace-store";
8
+ import { usePhiBuilderRegionDraftHydration } from "./use-region-draft-hydration";
8
9
  import { getPhiBuilderRegionDraftKey, PHI_BUILDER_SHELL_REGION_KEYS, } from "../region-keys";
9
10
  import { usePhiBuilderModuleMetas } from "../plugin-meta-store";
10
11
  import { buildPhiStructureRegionPickItems } from "../structure-region-pick-items";
@@ -16,36 +17,18 @@ export function PhiDeveloperBuilderShellsWorkspaceWidgetClient({ serverPreviewRe
16
17
  void _pageDraftsByScope;
17
18
  void _shellTheme;
18
19
  void _disabled;
19
- const area = usePhiDeveloperBuilderStateValue("public", (state) => state.area);
20
- const pageKey = usePhiDeveloperBuilderStateValue("public", (state) => state.pageKey);
21
- const builderMode = usePhiDeveloperBuilderStateValue("public", (state) => state.builderMode);
22
- const regionDrafts = usePhiDeveloperRegionDrafts();
20
+ const area = usePhiDeveloperBuilderStateValue((state) => state.area);
21
+ const pageKey = usePhiDeveloperBuilderStateValue((state) => state.pageKey);
22
+ const builderMode = usePhiDeveloperBuilderStateValue((state) => state.builderMode);
23
23
  const builderModuleMetas = usePhiBuilderModuleMetas(targetArea);
24
24
  const pickItems = useMemo(() => buildPhiStructureRegionPickItems(builderModuleMetas.plugins), [builderModuleMetas.plugins]);
25
- const hydratedAreaRef = useRef(null);
26
- useEffect(() => {
27
- if (builderMode === "preview" && previewRegionDrafts && Object.keys(previewRegionDrafts).length > 0) {
28
- mergePhiDeveloperRegionDrafts(previewRegionDrafts);
29
- }
30
- if (hydratedAreaRef.current !== area) {
31
- hydratedAreaRef.current = area;
32
- const nextAreaShellDrafts = structureShellDrafts ?? {};
33
- if (Object.keys(nextAreaShellDrafts).length > 0) {
34
- mergePhiDeveloperRegionDrafts(nextAreaShellDrafts);
35
- return;
36
- }
37
- }
38
- const shellDraftKeys = PHI_BUILDER_SHELL_REGION_KEYS.map((regionKey) => getPhiBuilderRegionDraftKey(area, regionKey, pageKey));
39
- const needsShellHydration = shellDraftKeys.some((draftKey) => regionDrafts[draftKey] == null);
40
- if (!needsShellHydration) {
41
- return;
42
- }
43
- const nextShellDrafts = structureShellDrafts ?? {};
44
- const missingShellDrafts = Object.fromEntries(Object.entries(nextShellDrafts).filter(([draftKey]) => regionDrafts[draftKey] == null));
45
- if (Object.keys(missingShellDrafts).length > 0) {
46
- mergePhiDeveloperRegionDrafts(missingShellDrafts);
47
- }
48
- }, [area, builderMode, pageKey, previewRegionDrafts, regionDrafts, structureShellDrafts]);
25
+ const shellDraftKeys = useMemo(() => PHI_BUILDER_SHELL_REGION_KEYS.map((regionKey) => getPhiBuilderRegionDraftKey(area, regionKey, pageKey)), [area, pageKey]);
26
+ usePhiBuilderRegionDraftHydration({
27
+ draftKeys: shellDraftKeys,
28
+ serverDrafts: structureShellDrafts,
29
+ builderMode,
30
+ previewRegionDrafts,
31
+ });
49
32
  /*
50
33
  * What the left Sider is doing, read the same way the controller reads it.
51
34
  *
@@ -55,7 +38,8 @@ export function PhiDeveloperBuilderShellsWorkspaceWidgetClient({ serverPreviewRe
55
38
  * state.
56
39
  */
57
40
  const siderLeftDraftKey = getPhiBuilderRegionDraftKey(area, "sider_left", pageKey);
58
- const siderLeftFullHeight = hasPhiConfigFlag((regionDrafts[siderLeftDraftKey] ?? structureShellDrafts?.[siderLeftDraftKey])?.regionConfig, PhiCmsFlags.FullHeight);
41
+ const siderLeftDraft = usePhiDeveloperRegionDraftsValue(useCallback((drafts) => drafts[siderLeftDraftKey] ?? null, [siderLeftDraftKey]));
42
+ const siderLeftFullHeight = hasPhiConfigFlag((siderLeftDraft ?? structureShellDrafts?.[siderLeftDraftKey])?.regionConfig, PhiCmsFlags.FullHeight);
59
43
  const renderStructureRegion = (regionKey, title, subtitle) => {
60
44
  const fallbackDraft = structureShellDrafts?.[getPhiBuilderRegionDraftKey(area, regionKey, pageKey)] ?? null;
61
45
  return (_jsx(PhiStructureRegionScaffold, { config: {
@@ -155,7 +155,7 @@ function PhiDeveloperBuilderCanvasRegion({ node, area, pageKey, isPagesWorkspace
155
155
  }
156
156
  export function PhiDeveloperBuilderStructureCanvas({ workspace = "structure", builderMode, area, pageKey, pageDraftsByScope, serverPreviewRegions, pickItems, regionLabels = PHI_REGION_WIDGET_DEFAULT_LABELS, pickerLabels = PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker, }) {
157
157
  const { token } = usePhiConfig();
158
- const debugScaffold = usePhiDeveloperBuilderStateValue("public", (state) => state.debugScaffold);
158
+ const debugScaffold = usePhiDeveloperBuilderStateValue((state) => state.debugScaffold);
159
159
  const isPreviewMode = builderMode === "preview";
160
160
  const isPagesWorkspace = workspace === "pages";
161
161
  const workspaceSpec = isPagesWorkspace ? PHI_PAGES_WORKSPACE_SPEC : PHI_STRUCTURE_WORKSPACE_SPEC;
@@ -0,0 +1,26 @@
1
+ import type { PhiDeveloperBuilderRegionDraft } from "../developer-workspace-types";
2
+ import type { PhiBuilderPreviewRegionDraft } from "../preview-transport";
3
+ /**
4
+ * Brings the server's Region drafts into the Builder store -- only the ones the store does not hold yet.
5
+ *
6
+ * The Shells and the Pages workspace each did this for themselves, and differently. The Shells workspace
7
+ * merged every server draft of an Area whenever the Area changed, over whatever the store held: an
8
+ * unsaved edit to the Public shell was gone after a look at the Admin shell and back, while the Undo
9
+ * button still offered to take it back. A draft in the store is the author's; the server's answer only
10
+ * fills what is missing.
11
+ *
12
+ * It renders again only when the set of missing drafts changes. Subscribing to the whole draft map for
13
+ * that question re-rendered the workspace, and every Region scaffold below it, on every write to any
14
+ * draft.
15
+ *
16
+ * A preview snapshot is the exception: in preview mode the drafts it carries are what is being looked at,
17
+ * so they are merged as they are.
18
+ */
19
+ export declare function usePhiBuilderRegionDraftHydration({ draftKeys, serverDrafts, builderMode, previewRegionDrafts, }: {
20
+ /** The drafts this workspace shows. */
21
+ draftKeys: readonly string[];
22
+ /** What the server answered for them, keyed like the store. */
23
+ serverDrafts: Readonly<Record<string, PhiDeveloperBuilderRegionDraft | null | undefined>> | null | undefined;
24
+ builderMode: string;
25
+ previewRegionDrafts: Record<string, PhiBuilderPreviewRegionDraft> | null | undefined;
26
+ }): void;
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { useCallback, useEffect } from "react";
3
+ import { getPhiDeveloperRegionDraftsSnapshot, mergePhiDeveloperRegionDrafts, usePhiDeveloperRegionDraftsValue, } from "../developer-workspace-store";
4
+ /**
5
+ * Brings the server's Region drafts into the Builder store -- only the ones the store does not hold yet.
6
+ *
7
+ * The Shells and the Pages workspace each did this for themselves, and differently. The Shells workspace
8
+ * merged every server draft of an Area whenever the Area changed, over whatever the store held: an
9
+ * unsaved edit to the Public shell was gone after a look at the Admin shell and back, while the Undo
10
+ * button still offered to take it back. A draft in the store is the author's; the server's answer only
11
+ * fills what is missing.
12
+ *
13
+ * It renders again only when the set of missing drafts changes. Subscribing to the whole draft map for
14
+ * that question re-rendered the workspace, and every Region scaffold below it, on every write to any
15
+ * draft.
16
+ *
17
+ * A preview snapshot is the exception: in preview mode the drafts it carries are what is being looked at,
18
+ * so they are merged as they are.
19
+ */
20
+ export function usePhiBuilderRegionDraftHydration({ draftKeys, serverDrafts, builderMode, previewRegionDrafts, }) {
21
+ const missingDraftKeys = usePhiDeveloperRegionDraftsValue(useCallback((drafts) => draftKeys.filter((draftKey) => drafts[draftKey] == null).join("\u0000"), [draftKeys]));
22
+ useEffect(() => {
23
+ if (builderMode === "preview" && previewRegionDrafts && Object.keys(previewRegionDrafts).length > 0) {
24
+ mergePhiDeveloperRegionDrafts(previewRegionDrafts);
25
+ }
26
+ if (!missingDraftKeys || !serverDrafts) {
27
+ return;
28
+ }
29
+ // `missingDraftKeys` is the reason to run again; the snapshot is what is read.
30
+ const regionDrafts = getPhiDeveloperRegionDraftsSnapshot();
31
+ const missingDrafts = Object.fromEntries(Object.entries(serverDrafts).filter((entry) => entry[1] != null && regionDrafts[entry[0]] == null));
32
+ if (Object.keys(missingDrafts).length > 0) {
33
+ mergePhiDeveloperRegionDrafts(missingDrafts);
34
+ }
35
+ }, [builderMode, missingDraftKeys, previewRegionDrafts, serverDrafts]);
36
+ }
@@ -9,7 +9,7 @@ export function PhiWidgetEffectsToolButton({ effects, target, disabled = false,
9
9
  const open = () => {
10
10
  if (disabled || !onChange)
11
11
  return;
12
- openPhiDeveloperBuilderEffectsEditor("public", effects ?? {}, target, onChange);
12
+ openPhiDeveloperBuilderEffectsEditor(effects ?? {}, target, onChange);
13
13
  };
14
14
  return (_jsx("div", { className: "phi-layout-affordance phi-layout-affordance--effects", onMouseDown: (event) => { event.preventDefault(); event.stopPropagation(); }, onClick: (event) => event.stopPropagation(), style: { "--phi-layout-affordance-size": "var(--ant-control-height-sm)" }, children: _jsx(PhiButtonControl, { ariaLabel: labels.openEditor, tooltip: labels.openEditor, icon: _jsx(PhiIcon, { name: "node-index", size: "inherit" }), type: "text", size: "small", disabled: disabled || !onChange, onClick: open }) }));
15
15
  }
@@ -74,6 +74,7 @@ export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builde
74
74
  widgetReferenceOptions,
75
75
  backgroundLabels,
76
76
  borderLabels,
77
+ renderMediaPicker,
77
78
  colorPickerLabels,
78
79
  iconPickerLabels,
79
80
  fieldLabels,
@@ -8,8 +8,8 @@ import { usePhiSignalIdentity } from "../../../../components/runtime/runtime-sig
8
8
  import { usePhiVisualAnchorParts } from "../../../../components/runtime/runtime-visual-anchors";
9
9
  import { PHI_BUILDER_PAGE_REGION_KEYS, PHI_BUILDER_SHELL_REGION_KEYS } from "../region-keys";
10
10
  export function PhiBuilderWorkspaceScopeBoundary({ kind, targetArea, targetPageKey, children, }) {
11
- const activeArea = usePhiDeveloperBuilderStateValue("public", (state) => state.area);
12
- const activePageKey = usePhiDeveloperBuilderStateValue("public", (state) => state.pageKey);
11
+ const activeArea = usePhiDeveloperBuilderStateValue((state) => state.area);
12
+ const activePageKey = usePhiDeveloperBuilderStateValue((state) => state.pageKey);
13
13
  const scopeMatches = activeArea === targetArea &&
14
14
  (targetPageKey == null || activePageKey === targetPageKey);
15
15
  /*
@@ -2,7 +2,7 @@
2
2
  import { createPhiDraftCmsInstanceId } from "../../../types/cms-instance-id";
3
3
  import { isPhiBuilderPageScopedRegion } from "./region-keys";
4
4
  import { getPhiDeveloperBuilderDraftAllocation, savePhiDeveloperBuilderDraft, } from "./persistence";
5
- import { builderWorkspaceStore, getPhiDeveloperBuilderStateSnapshot, getPhiDeveloperRegionDraftsSnapshot, } from "./developer-workspace-store";
5
+ import { takePhiBuilderDraftNodeSequence, getPhiDeveloperBuilderStateSnapshot, getPhiDeveloperRegionDraftsSnapshot, } from "./developer-workspace-store";
6
6
  import { createPhiBuilderDraftAllocationKey } from "./draft-allocation-key";
7
7
  import { resolvePhiBuilderActivePageCatalog } from "../../../helpers/cms-page-catalog";
8
8
  const pendingDraftCreations = new Map();
@@ -11,13 +11,13 @@ function getPhiBuilderDraftAllocationKey(area, pageKey, regionKey) {
11
11
  }
12
12
  async function ensurePhiBuilderDraftAllocation(input) {
13
13
  const allocationKey = getPhiBuilderDraftAllocationKey(input.area, input.pageKey, input.regionKey);
14
- if (getPhiDeveloperBuilderStateSnapshot("public").draftAllocations[allocationKey]) {
14
+ if (getPhiDeveloperBuilderStateSnapshot().draftAllocations[allocationKey]) {
15
15
  return;
16
16
  }
17
17
  let pending = pendingDraftCreations.get(allocationKey);
18
18
  if (!pending) {
19
19
  pending = (async () => {
20
- const state = getPhiDeveloperBuilderStateSnapshot("public");
20
+ const state = getPhiDeveloperBuilderStateSnapshot();
21
21
  const workspaceKind = isPhiBuilderPageScopedRegion(input.regionKey) ? "pages" : "structure";
22
22
  const existing = await getPhiDeveloperBuilderDraftAllocation({
23
23
  area: input.area,
@@ -44,30 +44,10 @@ async function ensurePhiBuilderDraftAllocation(input) {
44
44
  export async function allocatePhiBuilderCmsInstanceId(input) {
45
45
  await ensurePhiBuilderDraftAllocation(input);
46
46
  const allocationKey = getPhiBuilderDraftAllocationKey(input.area, input.pageKey, input.regionKey);
47
- let allocated = null;
48
- builderWorkspaceStore.patch("public", (current) => {
49
- const allocation = current.draftAllocations[allocationKey];
50
- if (!allocation) {
51
- throw new Error(`Missing Draft allocation state for "${allocationKey}".`);
52
- }
53
- allocated = createPhiDraftCmsInstanceId({
54
- domain: isPhiBuilderPageScopedRegion(input.regionKey) ? "page" : "area",
55
- draftRevisionId: allocation.revisionId,
56
- sequence: allocation.nextNodeSequence,
57
- });
58
- return {
59
- ...current,
60
- draftAllocations: {
61
- ...current.draftAllocations,
62
- [allocationKey]: {
63
- ...allocation,
64
- nextNodeSequence: allocation.nextNodeSequence + 1,
65
- },
66
- },
67
- };
47
+ const allocation = takePhiBuilderDraftNodeSequence(allocationKey);
48
+ return createPhiDraftCmsInstanceId({
49
+ domain: isPhiBuilderPageScopedRegion(input.regionKey) ? "page" : "area",
50
+ draftRevisionId: allocation.revisionId,
51
+ sequence: allocation.nextNodeSequence,
68
52
  });
69
- if (!allocated) {
70
- throw new Error(`Failed to allocate a CMS instance id for "${allocationKey}".`);
71
- }
72
- return allocated;
73
53
  }
@@ -11,20 +11,10 @@ export declare const PHI_BUILDER_RUNTIME_CONTROLLER_PLUGIN: {
11
11
  allowedMountScopes: "area"[];
12
12
  runtimeSignals: {
13
13
  emits: ({
14
- id: string;
15
- action: "start";
16
- valueType: "json";
17
- valueSchema: `${string}/signals/${string}`;
18
- } | {
19
14
  id: string;
20
15
  action: "change";
21
16
  valueType: "json";
22
17
  valueSchema: `${string}/signals/${string}`;
23
- } | {
24
- id: string;
25
- action: "stop";
26
- valueType: "json";
27
- valueSchema: `${string}/signals/${string}`;
28
18
  } | {
29
19
  id: string;
30
20
  action: "activate";
@@ -48,11 +38,6 @@ export declare const PHI_BUILDER_RUNTIME_CONTROLLER_PLUGIN: {
48
38
  action: "change";
49
39
  valueType: "boolean";
50
40
  valueSchema?: undefined;
51
- } | {
52
- id: string;
53
- action: "drop";
54
- valueType: "json";
55
- valueSchema: `${string}/signals/${string}`;
56
41
  })[];
57
42
  listens: ({
58
43
  id: string;
@@ -60,20 +60,10 @@ export declare const PHI_BUILDER_RUNTIME_CONTROLLER_DEFINITION: {
60
60
  allowedMountScopes: "area"[];
61
61
  runtimeSignals: {
62
62
  emits: ({
63
- id: string;
64
- action: "start";
65
- valueType: "json";
66
- valueSchema: `${string}/signals/${string}`;
67
- } | {
68
63
  id: string;
69
64
  action: "change";
70
65
  valueType: "json";
71
66
  valueSchema: `${string}/signals/${string}`;
72
- } | {
73
- id: string;
74
- action: "stop";
75
- valueType: "json";
76
- valueSchema: `${string}/signals/${string}`;
77
67
  } | {
78
68
  id: string;
79
69
  action: "activate";
@@ -97,11 +87,6 @@ export declare const PHI_BUILDER_RUNTIME_CONTROLLER_DEFINITION: {
97
87
  action: "change";
98
88
  valueType: "boolean";
99
89
  valueSchema?: undefined;
100
- } | {
101
- id: string;
102
- action: "drop";
103
- valueType: "json";
104
- valueSchema: `${string}/signals/${string}`;
105
90
  })[];
106
91
  listens: ({
107
92
  id: string;
@@ -1,6 +1,5 @@
1
1
  import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet, } from "../../../../types/signals";
2
2
  import { PHI_BUILDER_CONTROLLER_KEY, PHI_BUILDER_CONTROLLER_PLUGIN_KEY } from "./address";
3
- import { PHI_DRAG_SOURCE_CONTROL_SIGNALS } from "../../../../components/widgets/signals/control-signal-capabilities";
4
3
  import { PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/builder-chrome";
5
4
  /** The three Effects Forms, each with its own values, submit and reset. */
6
5
  export const PHI_BUILDER_EFFECTS_CAPABILITY_SECTIONS = ["appearance", "transitions", "viewport"];
@@ -136,13 +135,6 @@ export const PHI_BUILDER_RUNTIME_CONTROLLER_DEFINITION = {
136
135
  ...dialogEmits("publicRoutes"),
137
136
  { id: "publicRoutesReload", action: "activate", valueType: "none" },
138
137
  { id: "modulesTableReload", action: "activate", valueType: "none" },
139
- ...PHI_DRAG_SOURCE_CONTROL_SIGNALS.emits,
140
- {
141
- id: "drop",
142
- action: "drop",
143
- valueType: "json",
144
- valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.dragDrop,
145
- },
146
138
  ],
147
139
  listens: [
148
140
  {
@@ -2,8 +2,7 @@ import { type PhiHistoryLabels } from "../../../../components/widgets/label-type
2
2
  import type { PhiBuilderSavedHistoryHead } from "./draft-status-controller";
3
3
  import type { PhiDeveloperBuilderArea, PhiDeveloperBuilderRegionDraft, PhiDeveloperBuilderWorkspaceState } from "../developer-workspace-types";
4
4
  export type PhiDeveloperBuilderToolbarCommand = "save" | "preview" | "publish" | "undo" | "redo" | "reset";
5
- export declare function usePhiBuilderDraftCommandController({ defaultArea, effectiveArea, effectiveNavKey, effectivePageKey, pathname, captureHistoryHead, reportSaved, hasUnsavedChanges, shellPresetDraftsByArea, state, historyLabels, }: {
6
- defaultArea: PhiDeveloperBuilderArea;
5
+ export declare function usePhiBuilderDraftCommandController({ effectiveArea, effectiveNavKey, effectivePageKey, pathname, captureHistoryHead, reportSaved, hasUnsavedChanges, shellPresetDraftsByArea, state, historyLabels, }: {
7
6
  effectiveArea: PhiDeveloperBuilderArea;
8
7
  effectiveNavKey: string;
9
8
  effectivePageKey: string;