@phis/ui 0.4.3 → 0.4.5

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 (282) hide show
  1. package/README.md +9 -3
  2. package/cms/plugins.d.ts +1 -0
  3. package/cms/plugins.js +2 -0
  4. package/components/cms/phi-cms-root-layout.js +30 -1
  5. package/components/controls/phi-anchor-nav-control.js +4 -1
  6. package/components/controls/phi-background-control.d.ts +6 -1
  7. package/components/controls/phi-background-control.js +30 -7
  8. package/components/controls/phi-bullet-list-control.d.ts +7 -2
  9. package/components/controls/phi-bullet-list-control.js +4 -3
  10. package/components/controls/phi-button-control.d.ts +13 -1
  11. package/components/controls/phi-button-control.js +21 -3
  12. package/components/controls/phi-color-control.js +4 -2
  13. package/components/controls/phi-drawer-control-adapter.js +3 -2
  14. package/components/controls/phi-dropdown-control.js +2 -2
  15. package/components/controls/phi-inline-text-editor.js +7 -1
  16. package/components/controls/phi-length-control.js +1 -1
  17. package/components/controls/phi-media-asset-tile-control.js +10 -10
  18. package/components/controls/phi-progress-control.d.ts +10 -2
  19. package/components/controls/phi-progress-control.js +6 -2
  20. package/components/controls/phi-ribbon-control.d.ts +16 -4
  21. package/components/controls/phi-ribbon-control.js +14 -8
  22. package/components/controls/phi-ribbon-wrap-control.d.ts +32 -0
  23. package/components/controls/phi-ribbon-wrap-control.js +31 -0
  24. package/components/controls/phi-segmented-control.d.ts +4 -1
  25. package/components/controls/phi-segmented-control.js +13 -2
  26. package/components/controls/phi-select-control.js +5 -2
  27. package/components/controls/phi-series-chart-control.d.ts +48 -0
  28. package/components/controls/phi-series-chart-control.js +82 -0
  29. package/components/controls/phi-surface-control.d.ts +2 -0
  30. package/components/controls/phi-surface-control.js +16 -1
  31. package/components/controls/phi-switch-control.d.ts +4 -1
  32. package/components/controls/phi-switch-control.js +8 -2
  33. package/components/controls/phi-tag-control.d.ts +4 -1
  34. package/components/controls/phi-tag-control.js +11 -3
  35. package/components/controls/phi-text-control.js +57 -3
  36. package/components/controls/phi-tree-control.js +1 -1
  37. package/components/controls/phi-truncated-hover-text.d.ts +15 -0
  38. package/components/controls/phi-truncated-hover-text.js +25 -0
  39. package/components/forms/link-target-form-control.d.ts +1 -1
  40. package/components/forms/link-target-form-control.js +2 -45
  41. package/components/forms/phi-form-widget-frame.js +4 -2
  42. package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
  43. package/components/layouts/phi-layout-view-model.js +10 -1
  44. package/components/navigation/phi-link.js +6 -1
  45. package/components/regions/clients/cms-region-container-client.js +16 -1
  46. package/components/regions/phi-cms-region-container.js +7 -0
  47. package/components/regions/phi-cms-region-shell.d.ts +22 -1
  48. package/components/regions/phi-cms-region-shell.js +131 -23
  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-layout.d.ts +1 -0
  54. package/components/root/phi-root-layout.js +1 -0
  55. package/components/root/phi-root-theme-resolver.js +15 -1
  56. package/components/root/phi-shell-chrome-overlay.d.ts +18 -1
  57. package/components/root/phi-shell-chrome-overlay.js +26 -4
  58. package/components/runtime/runtime-module-context.d.ts +12 -1
  59. package/components/runtime/runtime-module-context.js +6 -1
  60. package/components/shell/phi-antd-icon.d.ts +1 -0
  61. package/components/shell/phi-antd-icon.js +3 -0
  62. package/components/shell/phi-cms-shell.d.ts +7 -1
  63. package/components/shell/phi-cms-shell.js +4 -2
  64. package/components/shell/use-phi-shell-header-bands.d.ts +5 -0
  65. package/components/shell/use-phi-shell-header-bands.js +64 -0
  66. package/components/shell/use-phi-shell-sticky-bottom.d.ts +18 -0
  67. package/components/shell/use-phi-shell-sticky-bottom.js +54 -0
  68. package/components/shell/use-phi-shell-sticky-top.js +61 -16
  69. package/components/surface/phi-surface-tone.d.ts +13 -0
  70. package/components/surface/phi-surface-tone.js +21 -0
  71. package/components/tables/client/phi-table-binding.d.ts +1 -0
  72. package/components/tables/client/phi-table-binding.js +22 -3
  73. package/components/trees/client/phi-tree-binding.d.ts +1 -0
  74. package/components/trees/client/phi-tree-binding.js +11 -2
  75. package/components/widgets/client/bullet-list-entries-editor.js +7 -1
  76. package/components/widgets/client/html-editor.js +1 -1
  77. package/components/widgets/client/shared/phi-collection-provider.js +4 -3
  78. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  79. package/components/widgets/client/shared/phi-collection-view-binding.js +16 -2
  80. package/components/widgets/client/shared/phi-command-buttons.js +6 -2
  81. package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
  82. package/components/widgets/client/shared/use-page-reference-options.js +57 -0
  83. package/components/widgets/config/background.d.ts +52 -1
  84. package/components/widgets/config/background.js +85 -4
  85. package/components/widgets/config/button-variant.d.ts +22 -4
  86. package/components/widgets/config/button-variant.js +24 -5
  87. package/components/widgets/config/common-action-field.d.ts +1 -1
  88. package/components/widgets/config/parser-primitives.js +4 -2
  89. package/components/widgets/config/theme-gradient.d.ts +11 -0
  90. package/components/widgets/config/theme-gradient.js +12 -0
  91. package/components/widgets/label-sets/background.js +4 -0
  92. package/components/widgets/label-sets/geometry.js +2 -0
  93. package/components/widgets/label-sets/inspector.js +4 -0
  94. package/components/widgets/label-types/background.d.ts +2 -0
  95. package/components/widgets/label-types/background.js +2 -0
  96. package/components/widgets/label-types/common-controls.js +2 -2
  97. package/components/widgets/label-types/geometry.d.ts +1 -0
  98. package/components/widgets/label-types/geometry.js +1 -0
  99. package/components/widgets/label-types/inspector.d.ts +4 -0
  100. package/components/widgets/label-types/inspector.js +2 -0
  101. package/components/widgets/shared/bullet-list-vocabulary.d.ts +10 -0
  102. package/components/widgets/shared/bullet-list-vocabulary.js +5 -2
  103. package/components/widgets/shared/card-body-client.d.ts +16 -3
  104. package/components/widgets/shared/card-body-client.js +79 -8
  105. package/components/widgets/shared/card-vocabulary.d.ts +12 -2
  106. package/components/widgets/shared/card-vocabulary.js +7 -0
  107. package/components/widgets/shared/collection-source-failure.d.ts +26 -0
  108. package/components/widgets/shared/collection-source-failure.js +42 -0
  109. package/components/widgets/shared/markdown-body-client.js +39 -10
  110. package/components/widgets/shared/markdown-render.js +16 -3
  111. package/components/widgets/shared/widget-failure-client.d.ts +10 -0
  112. package/components/widgets/shared/widget-failure-client.js +20 -0
  113. package/components/widgets/shared/widget-failure.d.ts +31 -0
  114. package/components/widgets/shared/widget-failure.js +20 -0
  115. package/components/widgets/shared/widget-failure.server.d.ts +9 -0
  116. package/components/widgets/shared/widget-failure.server.js +12 -0
  117. package/gateway/dashboard-card-memo.d.ts +3 -0
  118. package/gateway/dashboard-card-memo.js +25 -0
  119. package/helpers/cms-container-chrome.js +6 -1
  120. package/helpers/cms-region-keys.d.ts +1 -1
  121. package/helpers/layout-style.d.ts +8 -4
  122. package/helpers/layout-style.js +3 -2
  123. package/helpers/locale.d.ts +8 -0
  124. package/helpers/locale.js +18 -0
  125. package/helpers/mode-paint.d.ts +4 -0
  126. package/helpers/mode-paint.js +47 -0
  127. package/helpers/shell-region-style.js +2 -1
  128. package/helpers/surface-style.d.ts +12 -1
  129. package/helpers/surface-style.js +60 -12
  130. package/module-dashboard-cards.d.ts +2 -1
  131. package/module-dashboard-cards.js +2 -1
  132. package/module-records.d.ts +7 -0
  133. package/module-records.js +6 -0
  134. package/package.json +1 -1
  135. package/plugins/runtime-modules/area-definitions.d.ts +0 -42
  136. package/plugins/runtime-modules/area-definitions.js +3 -8
  137. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +21 -2
  138. package/plugins/runtime-modules/builder/clients/inspector-surface-labels.js +1 -0
  139. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +10 -5
  140. package/plugins/runtime-modules/builder/clients/region-inspector.js +47 -2
  141. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
  142. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +7 -4
  143. package/plugins/runtime-modules/builder/controller/page-controller.js +7 -0
  144. package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +3 -2
  145. package/plugins/runtime-modules/builder/persistence.d.ts +3 -0
  146. package/plugins/runtime-modules/builder/persistence.js +9 -1
  147. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +25 -15
  148. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +4 -0
  149. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +15 -4
  150. package/plugins/runtime-modules/client-authoring-module.d.ts +8 -1
  151. package/plugins/runtime-modules/client-authoring-module.js +13 -3
  152. package/plugins/runtime-modules/core/content-entries/record-source.server.d.ts +3 -1
  153. package/plugins/runtime-modules/core/content-entries/record-source.server.js +7 -4
  154. package/plugins/runtime-modules/core/widgets/brand/client.d.ts +12 -3
  155. package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
  156. package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
  157. package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
  158. package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
  159. package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
  160. package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
  161. package/plugins/runtime-modules/core/widgets/button/client.js +2 -2
  162. package/plugins/runtime-modules/core/widgets/button/config.d.ts +40 -4
  163. package/plugins/runtime-modules/core/widgets/button/config.js +12 -0
  164. package/plugins/runtime-modules/core/widgets/card/config.d.ts +100 -1
  165. package/plugins/runtime-modules/core/widgets/card/config.js +57 -3
  166. package/plugins/runtime-modules/core/widgets/card/editor.js +21 -4
  167. package/plugins/runtime-modules/core/widgets/card/server.js +5 -0
  168. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.d.ts +4 -1
  169. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -3
  170. package/plugins/runtime-modules/core/widgets/collection-view/authoring.js +1 -1
  171. package/plugins/runtime-modules/core/widgets/collection-view/client.d.ts +3 -0
  172. package/plugins/runtime-modules/core/widgets/collection-view/client.js +47 -11
  173. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +4 -1
  174. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
  175. package/plugins/runtime-modules/core/widgets/collection-view/plugin.js +3 -2
  176. package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +6 -1
  177. package/plugins/runtime-modules/core/widgets/collection-view/server.js +21 -3
  178. package/plugins/runtime-modules/core/widgets/description/client.js +3 -3
  179. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -0
  180. package/plugins/runtime-modules/core/widgets/description/editor.js +3 -2
  181. package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
  182. package/plugins/runtime-modules/core/widgets/entry-detail/plugin.js +1 -1
  183. package/plugins/runtime-modules/core/widgets/entry-detail/server.d.ts +3 -1
  184. package/plugins/runtime-modules/core/widgets/entry-detail/server.js +5 -2
  185. package/plugins/runtime-modules/core/widgets/entry-header/plugin.js +1 -1
  186. package/plugins/runtime-modules/core/widgets/entry-header/server.d.ts +3 -1
  187. package/plugins/runtime-modules/core/widgets/entry-header/server.js +5 -2
  188. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -0
  189. package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -1
  190. package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +6 -3
  191. package/plugins/runtime-modules/core/widgets/entry-list/server.js +13 -6
  192. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -0
  193. package/plugins/runtime-modules/core/widgets/gallery/plugin.js +1 -1
  194. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -3
  195. package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -6
  196. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
  197. package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
  198. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
  199. package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
  200. package/plugins/runtime-modules/core/widgets/markdown/editor.js +9 -1
  201. package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
  202. package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
  203. package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
  204. package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
  205. package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
  206. package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
  207. package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
  208. package/plugins/runtime-modules/core/widgets/record/client.d.ts +4 -1
  209. package/plugins/runtime-modules/core/widgets/record/client.js +8 -3
  210. package/plugins/runtime-modules/core/widgets/record/plugin.js +3 -2
  211. package/plugins/runtime-modules/core/widgets/record/server.d.ts +3 -1
  212. package/plugins/runtime-modules/core/widgets/record/server.js +2 -2
  213. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -0
  214. package/plugins/runtime-modules/core/widgets/segmented/client.js +1 -1
  215. package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +21 -1
  216. package/plugins/runtime-modules/core/widgets/segmented/config.js +11 -1
  217. package/plugins/runtime-modules/core/widgets/sidebar-navigation/authoring.js +1 -1
  218. package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
  219. package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
  220. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -0
  221. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
  222. package/plugins/runtime-modules/core/widgets/switch/client.js +1 -1
  223. package/plugins/runtime-modules/core/widgets/switch/config.d.ts +19 -0
  224. package/plugins/runtime-modules/core/widgets/switch/config.js +11 -0
  225. package/plugins/runtime-modules/core/widgets/table/authoring.js +1 -1
  226. package/plugins/runtime-modules/core/widgets/table/client.d.ts +4 -1
  227. package/plugins/runtime-modules/core/widgets/table/client.js +16 -3
  228. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -0
  229. package/plugins/runtime-modules/core/widgets/table/plugin.js +3 -2
  230. package/plugins/runtime-modules/core/widgets/table/server.d.ts +3 -1
  231. package/plugins/runtime-modules/core/widgets/table/server.js +2 -2
  232. package/plugins/runtime-modules/core/widgets/table/static-resource-editor.js +2 -1
  233. package/plugins/runtime-modules/core/widgets/timeline/authoring.js +1 -1
  234. package/plugins/runtime-modules/core/widgets/timeline/client.d.ts +1 -3
  235. package/plugins/runtime-modules/core/widgets/timeline/client.js +14 -4
  236. package/plugins/runtime-modules/core/widgets/tree/authoring.js +1 -1
  237. package/plugins/runtime-modules/core/widgets/tree/client.d.ts +4 -1
  238. package/plugins/runtime-modules/core/widgets/tree/client.js +13 -2
  239. package/plugins/runtime-modules/core/widgets/tree/plugin.js +3 -2
  240. package/plugins/runtime-modules/core/widgets/tree/server.d.ts +3 -1
  241. package/plugins/runtime-modules/core/widgets/tree/server.js +2 -2
  242. package/plugins/runtime-modules/dashboard/card-rows.d.ts +3 -1
  243. package/plugins/runtime-modules/dashboard/card-rows.js +30 -2
  244. package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +29 -7
  245. package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
  246. package/plugins/runtime-modules/theme/presets.d.ts +9 -1
  247. package/plugins/runtime-modules/theme/tour.d.ts +9 -1
  248. package/plugins/runtime-modules/theme/tour.js +10 -1
  249. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +157 -22
  250. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +5 -9
  251. package/runtime-data-provider-client.d.ts +2 -0
  252. package/runtime-data-provider-client.js +7 -0
  253. package/server-helpers/cms-link-targets.js +6 -0
  254. package/styles/controls.css +74 -7
  255. package/styles/gradients.css +101 -0
  256. package/styles/layout.css +45 -2
  257. package/styles/root.css +18 -0
  258. package/styles/shell.css +137 -0
  259. package/theme/phi-antd-token-resolver.js +20 -1
  260. package/theme/phi-button-shadow.d.ts +6 -0
  261. package/theme/phi-theme-gradients.d.ts +96 -0
  262. package/theme/phi-theme-gradients.js +245 -0
  263. package/theme/phi-theme-presets.d.ts +3 -0
  264. package/theme/phi-theme-presets.js +3 -0
  265. package/theme/phi-theme-tokens.d.ts +6 -2
  266. package/theme/phi-theme-tokens.js +15 -0
  267. package/theme/phi-theme.d.ts +5 -0
  268. package/theme/phi-theme.js +21 -0
  269. package/theme/phi-tokens.d.ts +16 -15
  270. package/theme/phi-tokens.js +16 -15
  271. package/types/cms-plugins.d.ts +2 -0
  272. package/types/cms-presets.d.ts +7 -0
  273. package/types/core-widget-placements.d.ts +3 -0
  274. package/types/dashboard-cards.d.ts +39 -4
  275. package/types/dashboard-cards.js +6 -0
  276. package/types/layout-style.d.ts +9 -8
  277. package/types/layout-style.js +9 -8
  278. package/types/site-theme.d.ts +10 -2
  279. package/types/surface.d.ts +4 -0
  280. package/types/surface.js +4 -0
  281. package/types.d.ts +1 -1
  282. package/types.js +1 -1
@@ -7,8 +7,15 @@
7
7
  * types say what it is asked with, `fetchPhiSiteApi` asks Core with the credentials the context carries,
8
8
  * and `resolvePhiRecordSource` is how one of the package's Server Widgets reads the record its binding
9
9
  * names -- once per request, however many Widgets are bound to it.
10
+ *
11
+ * `PhiWidgetFailureServer` is what such a Widget renders when that read, or its binding, fails: the error
12
+ * card in the Builder, nothing on a live page, and the `cms.widget.unavailable` warning either way. It is
13
+ * here rather than in a shared barrel because it is Server-only; its browser twin, `PhiWidgetFailure`, is
14
+ * in `@phis/ui/runtime/data-provider-client`.
10
15
  */
11
16
  import "server-only";
12
17
  export type { PhiRuntimeModuleRecordProviderServerDefinition, PhiRuntimeRecordProviderContext, PhiRuntimeRecordProviderResolver, } from "./types/record-provider";
13
18
  export { resolvePhiRecordSource, type PhiRecordSourceResult } from "./server-helpers/record-source";
14
19
  export { fetchPhiSiteApi, type PhiSiteApiRequest } from "./gateway/site-api-request";
20
+ export { PhiWidgetFailureServer } from "./components/widgets/shared/widget-failure.server";
21
+ export type { PhiWidgetFailureProps } from "./components/widgets/shared/widget-failure";
package/module-records.js CHANGED
@@ -7,7 +7,13 @@
7
7
  * types say what it is asked with, `fetchPhiSiteApi` asks Core with the credentials the context carries,
8
8
  * and `resolvePhiRecordSource` is how one of the package's Server Widgets reads the record its binding
9
9
  * names -- once per request, however many Widgets are bound to it.
10
+ *
11
+ * `PhiWidgetFailureServer` is what such a Widget renders when that read, or its binding, fails: the error
12
+ * card in the Builder, nothing on a live page, and the `cms.widget.unavailable` warning either way. It is
13
+ * here rather than in a shared barrel because it is Server-only; its browser twin, `PhiWidgetFailure`, is
14
+ * in `@phis/ui/runtime/data-provider-client`.
10
15
  */
11
16
  import "server-only";
12
17
  export { resolvePhiRecordSource } from "./server-helpers/record-source";
13
18
  export { fetchPhiSiteApi } from "./gateway/site-api-request";
19
+ export { PhiWidgetFailureServer } from "./components/widgets/shared/widget-failure.server";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -34,20 +34,6 @@ export declare const PHI_PUBLIC_RUNTIME_AREA_DEFINITIONS: {
34
34
  readonly routePresetKey: "public-terms-page";
35
35
  }];
36
36
  readonly exportedItemKeys: readonly ["@phis/ui/modules/public/nav/terms"];
37
- }, {
38
- readonly navKey: "public:quicklinks";
39
- readonly label: {
40
- defaultMessage: string;
41
- };
42
- readonly items: readonly [{
43
- readonly itemKey: "@phis/ui/modules/public/nav/terms";
44
- readonly label: {
45
- defaultMessage: string;
46
- };
47
- readonly icon: "antd:file-text";
48
- readonly routePresetKey: "public-terms-page";
49
- }];
50
- readonly exportedItemKeys: readonly ["@phis/ui/modules/public/nav/terms"];
51
37
  }, PhiCmsNavigationSurfaceDescriptor];
52
38
  }[];
53
39
  export declare const PHI_APP_ACCOUNT_NAV_ITEM_KEY = "@phis/ui/modules/app/nav/account";
@@ -226,20 +212,6 @@ export declare const PHI_ALL_RUNTIME_AREA_DEFINITIONS: ({
226
212
  readonly routePresetKey: "public-terms-page";
227
213
  }];
228
214
  readonly exportedItemKeys: readonly ["@phis/ui/modules/public/nav/terms"];
229
- }, {
230
- readonly navKey: "public:quicklinks";
231
- readonly label: {
232
- defaultMessage: string;
233
- };
234
- readonly items: readonly [{
235
- readonly itemKey: "@phis/ui/modules/public/nav/terms";
236
- readonly label: {
237
- defaultMessage: string;
238
- };
239
- readonly icon: "antd:file-text";
240
- readonly routePresetKey: "public-terms-page";
241
- }];
242
- readonly exportedItemKeys: readonly ["@phis/ui/modules/public/nav/terms"];
243
215
  }, PhiCmsNavigationSurfaceDescriptor];
244
216
  } | {
245
217
  area: "app";
@@ -457,20 +429,6 @@ export declare function resolvePhiRuntimeAreaDefinition(area: PhiCmsAreaDefiniti
457
429
  readonly routePresetKey: "public-terms-page";
458
430
  }];
459
431
  readonly exportedItemKeys: readonly ["@phis/ui/modules/public/nav/terms"];
460
- }, {
461
- readonly navKey: "public:quicklinks";
462
- readonly label: {
463
- defaultMessage: string;
464
- };
465
- readonly items: readonly [{
466
- readonly itemKey: "@phis/ui/modules/public/nav/terms";
467
- readonly label: {
468
- defaultMessage: string;
469
- };
470
- readonly icon: "antd:file-text";
471
- readonly routePresetKey: "public-terms-page";
472
- }];
473
- readonly exportedItemKeys: readonly ["@phis/ui/modules/public/nav/terms"];
474
432
  }, PhiCmsNavigationSurfaceDescriptor];
475
433
  } | {
476
434
  area: "app";
@@ -116,8 +116,9 @@ function sidebarAnchors(settingsItemKey) {
116
116
  * The Public surfaces carry one intrinsic entry, the terms, and export it as the one anchor.
117
117
  *
118
118
  * The terms are Core's, so their entry is; the contact entry hangs after it, and a Site package's
119
- * landing places its Home entry before it. Public has no sidebar surface: the Public Shell draws a
120
- * header and a footer, and a surface nothing renders is a promise nobody can see kept.
119
+ * landing places its Home entry before it. Public has no sidebar and no quick-links surface: the Public
120
+ * Shell draws a header and a footer -- the footer's Quick Links Widget reads `public:footer` -- and a
121
+ * surface nothing renders is a promise nobody can see kept.
121
122
  */
122
123
  const publicTermsItem = {
123
124
  itemKey: "@phis/ui/modules/public/nav/terms",
@@ -138,12 +139,6 @@ const publicNavigationSurfaces = [
138
139
  items: [publicTermsItem],
139
140
  exportedItemKeys: [publicTermsItem.itemKey],
140
141
  },
141
- {
142
- navKey: "public:quicklinks",
143
- label: label("Public quick links"),
144
- items: [publicTermsItem],
145
- exportedItemKeys: [publicTermsItem.itemKey],
146
- },
147
142
  accountNavigationSurface(PHI_PUBLIC_ACCOUNT_NAV_ITEM_KEY, "public:account"),
148
143
  ];
149
144
  export const PHI_PUBLIC_RUNTIME_AREA_DEFINITIONS = [
@@ -719,7 +719,7 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
719
719
  if (field.type === "surface") {
720
720
  return renderPhiInspectorConfigFieldBlock(field, _jsx(PhiSurfaceControl, { disabled: disabled || !onChange, value: value === null ? null : readPhiSurface(value) ?? readPhiSurface(defaultValue), tone: field.tone !== false,
721
721
  // A box inside a Widget has no layer of its own to blur.
722
- backgroundFilters: ["glass", "haze"], backgroundLabels: backgroundLabels, borderLabels: borderLabels, colorPickerLabels: colorPickerLabels, renderMediaPicker: renderMediaPicker, onChange: (nextValue) => onChange?.({ [field.key]: nextValue }) }));
722
+ backgroundFilters: ["glass", "haze", "clear"], backgroundLabels: backgroundLabels, borderLabels: borderLabels, colorPickerLabels: colorPickerLabels, renderMediaPicker: renderMediaPicker, onChange: (nextValue) => onChange?.({ [field.key]: nextValue }) }));
723
723
  }
724
724
  if (field.type === "icon") {
725
725
  const iconValue = typeof value === "string"
@@ -736,7 +736,7 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
736
736
  ? String(value)
737
737
  : typeof defaultValue === "string" || typeof defaultValue === "number"
738
738
  ? String(defaultValue)
739
- : "", disabled: disabled || !onChange, inputType: field.type === "url" ? "url" : "text", style: { width: "100%" }, onChange: (nextValue) => onChange?.({
739
+ : "", disabled: disabled || !onChange, inputType: field.type === "url" ? "url" : "text", ...("placeholder" in field && field.placeholder ? { placeholder: field.placeholder } : {}), style: { width: "100%" }, onChange: (nextValue) => onChange?.({
740
740
  [field.key]: nextValue || ("emptyValue" in field ? field.emptyValue : undefined),
741
741
  }) }));
742
742
  }
@@ -755,6 +755,25 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
755
755
  }
756
756
  if (field.type === "flags") {
757
757
  const mask = typeof value === "number" ? value : typeof defaultValue === "number" ? defaultValue : 0;
758
+ /*
759
+ * One flag is a yes or no, and reads as one: the field's name with a switch behind it on its row,
760
+ * like a boolean field, rather than a group of a single checkbox under a heading. The other bits of
761
+ * the mask stay as they are.
762
+ */
763
+ const [onlyOption] = field.options.length === 1 ? field.options : [];
764
+ if (onlyOption) {
765
+ return renderPhiInspectorSwitchRow({
766
+ key: field.key,
767
+ label: renderPhiInspectorConfigFieldLabel(field),
768
+ checked: (mask & onlyOption.value) !== 0,
769
+ disabled: disabled || !onChange,
770
+ ...(onChange
771
+ ? {
772
+ onChange: (checked) => onChange({ [field.key]: checked ? mask | onlyOption.value : mask & ~onlyOption.value }),
773
+ }
774
+ : {}),
775
+ });
776
+ }
758
777
  return renderPhiInspectorConfigFieldBlock(field, _jsx(PhiCheckboxGroupControl, { vertical: true, value: field.options.filter((option) => (mask & option.value) !== 0).map((option) => option.value), options: field.options.map((option) => ({ value: option.value, label: option.label })), disabled: disabled || !onChange, onChange: (ticked) => onChange?.({ [field.key]: ticked.reduce((next, flag) => next | flag, 0) }) }));
759
778
  }
760
779
  if (field.type === "number-list") {
@@ -19,6 +19,7 @@ export function resolvePhiInspectorSurfaceLabels(labels) {
19
19
  dark: labels.tone.dark,
20
20
  inverse: labels.tone.inverse,
21
21
  },
22
+ backgroundPerMode: labels.tone.backgroundPerMode,
22
23
  },
23
24
  };
24
25
  }
@@ -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 }) }));
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { PhiSurfaceControl } from "../../../../components/controls/phi-surface-control";
4
4
  import { PhiGeometryControl } from "../../../../components/controls/phi-geometry-control";
5
5
  import { PhiViewportVisibilityControl } from "../../../../components/controls/phi-viewport-visibility-control";
@@ -10,6 +10,7 @@ import { normalizePhiPaddingWidgetConfig, } from "../../../../types/cms-config";
10
10
  import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
11
11
  import { PHI_INSPECTOR_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/inspector";
12
12
  import { PhiRegionVisibilityFields } from "./region-visibility-fields";
13
+ import { renderPhiInspectorConfigField } from "./inspector-config-field";
13
14
  const PHI_GAP_SM = "var(--ant-padding-sm)";
14
15
  const REGION_PADDING_KEYS = [
15
16
  "padding",
@@ -33,6 +34,18 @@ function patchRegionConfigPadding(regionConfig, padding) {
33
34
  export function PhiDeveloperBuilderRegionInspectorWidgetClient({ section, builderMode = "editor", selectedStructureNodeKind = null, selectedRegionKey = null, currentDraft = null, onDraftChange, geometryLabels, backgroundLabels, borderLabels, colorPickerLabels, paddingLabels, surfaceLabels, visibilityLabels = PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility, renderMediaPicker, }) {
34
35
  const isPreviewMode = builderMode === "preview";
35
36
  const effectiveDraft = currentDraft ?? (selectedRegionKey ? getDefaultRegionDraft(selectedRegionKey) : null);
37
+ /*
38
+ * Which edge the selected Region can stick to, if any. The Header bands and the Siders stick at the top;
39
+ * `footer_bottom` sticks at the bottom (`phiCmsRegionFooterSticks`); every other Region ignores the flag,
40
+ * so it is not offered there.
41
+ */
42
+ const stickyEdge = selectedRegionKey == null
43
+ ? null
44
+ : selectedRegionKey === "footer_bottom"
45
+ ? "bottom"
46
+ : selectedRegionKey.startsWith("header_") || selectedRegionKey.startsWith("sider_")
47
+ ? "top"
48
+ : null;
36
49
  function updateDraft(patch) {
37
50
  if (!selectedRegionKey || !effectiveDraft || !onDraftChange) {
38
51
  return;
@@ -43,7 +56,39 @@ export function PhiDeveloperBuilderRegionInspectorWidgetClient({ section, builde
43
56
  {
44
57
  key: "geometry",
45
58
  title: "Geometry",
46
- children: (_jsx("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: _jsx(PhiGeometryControl, { mode: "control", disabled: isPreviewMode, showViewport: false, value: effectiveDraft, onChange: (geometry) => updateDraft(geometry), labels: geometryLabels }) })),
59
+ children: (_jsxs("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: [_jsx(PhiGeometryControl, { mode: "control", disabled: isPreviewMode, showViewport: false, showSticky: stickyEdge !== null, showOffsetTop: stickyEdge === "top", value: effectiveDraft, onChange: (geometry) => updateDraft(geometry), labels: geometryLabels }), stickyEdge === "bottom" ? renderPhiInspectorConfigField({
60
+ field: { key: "offsetBottom", type: "length", label: geometryLabels?.fields.offsetBottom ?? "Offset bottom", min: 0 },
61
+ value: effectiveDraft.regionConfig?.offsetBottom,
62
+ defaultValue: undefined,
63
+ config: effectiveDraft.regionConfig ?? {},
64
+ disabled: isPreviewMode || !onDraftChange || !effectiveDraft.sticky,
65
+ onChange: (patch) => {
66
+ const next = { ...(effectiveDraft.regionConfig ?? {}) };
67
+ if (patch.offsetBottom == null || patch.offsetBottom === 0) {
68
+ delete next.offsetBottom;
69
+ }
70
+ else {
71
+ next.offsetBottom = patch.offsetBottom;
72
+ }
73
+ updateDraft({ regionConfig: next });
74
+ },
75
+ }) : null, selectedRegionKey === "content" ? renderPhiInspectorConfigField({
76
+ field: { key: "heroOverlap", type: "length", label: visibilityLabels.heroOverlap, min: 0 },
77
+ value: effectiveDraft.regionConfig?.heroOverlap,
78
+ defaultValue: undefined,
79
+ config: effectiveDraft.regionConfig ?? {},
80
+ disabled: isPreviewMode || !onDraftChange,
81
+ onChange: (patch) => {
82
+ const next = { ...(effectiveDraft.regionConfig ?? {}) };
83
+ if (patch.heroOverlap == null || patch.heroOverlap === 0) {
84
+ delete next.heroOverlap;
85
+ }
86
+ else {
87
+ next.heroOverlap = patch.heroOverlap;
88
+ }
89
+ updateDraft({ regionConfig: next });
90
+ },
91
+ }) : null] })),
47
92
  },
48
93
  {
49
94
  key: "viewport",
@@ -44,5 +44,5 @@ export function PhiBuilderRuntimeModuleAuthoringBoundary({ targetArea, catalog,
44
44
  targetArea,
45
45
  videoProviderDescriptors,
46
46
  ]);
47
- return (_jsx(PhiRuntimeModuleProvider, { moduleIds: moduleIds, widgetTypes: widgetDefinitions.map((definition) => definition.type), layoutTypes: layoutTypes, widgetDefinitions: widgetDefinitions, dataProviderDescriptors: dataProviderDescriptors, calendarAdapterDescriptors: calendarAdapterDescriptors, videoProviderDescriptors: videoProviderDescriptors, children: _jsx(PhiRuntimeModuleAuthoringDataProviderHost, { providerKeys: authoringDataProviderKeys, children: _jsx(PhiRuntimeModuleDataProviderClientHost, { providerKeys: pickerDataProviderKeys, mode: "live", children: _jsx(PhiRuntimeModuleAuthoringClientHost, { moduleIds: moduleIds, children: children }) }) }) }));
47
+ return (_jsx(PhiRuntimeModuleProvider, { moduleIds: moduleIds, widgetTypes: widgetDefinitions.map((definition) => definition.type), layoutTypes: layoutTypes, widgetDefinitions: widgetDefinitions, dataProviderDescriptors: dataProviderDescriptors, calendarAdapterDescriptors: calendarAdapterDescriptors, videoProviderDescriptors: videoProviderDescriptors, collectionItemRendererDescriptors: collectionItemRendererDescriptors, children: _jsx(PhiRuntimeModuleAuthoringDataProviderHost, { providerKeys: authoringDataProviderKeys, children: _jsx(PhiRuntimeModuleDataProviderClientHost, { providerKeys: pickerDataProviderKeys, mode: "live", children: _jsx(PhiRuntimeModuleAuthoringClientHost, { moduleIds: moduleIds, children: children }) }) }) }));
48
48
  }
@@ -269,9 +269,10 @@ export function usePhiBuilderDraftCommandController({ effectiveArea, effectiveNa
269
269
  pageKey: effectivePageKey,
270
270
  };
271
271
  /*
272
- * A preview is of the saved draft or of nothing. Opening the live page when there was none -- or when
273
- * the read failed -- let the author take what is published for their draft; the failure is the
274
- * command's error now. What the saved draft leaves out is said before it opens.
272
+ * A preview is of the saved draft, or -- when nothing is saved -- of what is published, which is then
273
+ * what the page is. A read that failed is the command's error rather than the live page: the author
274
+ * would take what is published for a draft that may exist. What the preview leaves out is said
275
+ * before it opens, and which of the two it shows.
275
276
  */
276
277
  const result = await previewPhiDeveloperBuilderDraft(state, workspaceKind, {
277
278
  pathname,
@@ -280,7 +281,9 @@ export function usePhiBuilderDraftCommandController({ effectiveArea, effectiveNa
280
281
  if (hasUnsavedChanges) {
281
282
  showMessage({
282
283
  level: "warning",
283
- content: "The preview shows the last saved draft. Save to include your latest changes.",
284
+ content: result.revisionId == null
285
+ ? "Nothing is saved yet, so the preview shows the published page. Save to include your changes."
286
+ : "The preview shows the last saved draft. Save to include your latest changes.",
284
287
  });
285
288
  }
286
289
  window.open(result.previewHref, "_blank", "noopener,noreferrer");
@@ -13,6 +13,7 @@ import { collectPhiDeveloperBuilderPageKeys, collectPhiDeveloperBuilderPageStora
13
13
  import { createPhiDeveloperBuilderInitialPageDrafts, createPhiDeveloperBuilderPageDraft, PhiBuilderPageExistsError, } from "../persistence";
14
14
  import { describePhiBuilderPageAddressConflict, findPhiBuilderSitePageAddressConflict, } from "../page-address-rule";
15
15
  import { PHI_BUILDER_AREA_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, } from "../../../../helpers/cms-scope-search-params";
16
+ import { PHI_BUILDER_PREVIEW_SEARCH_PARAM } from "../preview-transport";
16
17
  import { mergePhiDeveloperRegionDrafts, openPhiBuilderPage, setPhiBuilderPageMetaDraft, startPhiBuilderNewPageDrafts, getPhiDeveloperBuilderStateSnapshot, } from "../developer-workspace-store";
17
18
  import { getPhiBuilderRegionDraftKey } from "../region-keys";
18
19
  import { capturePhiBuilderWorkspaceHistoryState, createPhiBuilderHistoryContext, phiBuilderHistory, } from "../history";
@@ -67,6 +68,12 @@ export function usePhiBuilderPageController({ emitCapability, effectiveArea, eff
67
68
  const nextSearchParams = new URLSearchParams(searchParams.toString());
68
69
  nextSearchParams.set(PHI_BUILDER_AREA_SEARCH_PARAM, effectiveArea);
69
70
  nextSearchParams.set(PHI_BUILDER_PAGE_SEARCH_PARAM, pageKey);
71
+ /*
72
+ * Another Page opens in the Editor. The preview was of the Page that was open -- its snapshot holds
73
+ * that Page's drafts -- so carrying it over would show the new Page in a mode it was never put in,
74
+ * from a snapshot that is not its own.
75
+ */
76
+ nextSearchParams.delete(PHI_BUILDER_PREVIEW_SEARCH_PARAM);
70
77
  router.replace(`${pathname}?${nextSearchParams.toString()}`, { scroll: false });
71
78
  }
72
79
  }
@@ -1,11 +1,12 @@
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
4
  import { PhiButtonControl } from "../../../components/controls/phi-button-control";
5
5
  import { usePhiDeveloperBuilderStateValue } from "./developer-workspace-store";
6
6
  import { PhiIcon } from "../../../components/shell/phi-icon";
7
7
  export function PhiEditScaffoldDrawer({ kind, nodeId, regionKey, scaffoldLabel, className, onOpenInsert, onClick, onKeyDown, children, chrome, style, }) {
8
- const { token } = usePhiConfig();
8
+ // The editor's colours, not a tone's: a scaffold inside a toned Surface marks it in the page's mode.
9
+ const token = usePhiPageModeToken();
9
10
  const selected = usePhiDeveloperBuilderStateValue((state) => state.selectedRootRegionKey === regionKey &&
10
11
  state.nodeId === nodeId &&
11
12
  (state.nodeKind === "layout"));
@@ -142,6 +142,9 @@ export declare function previewPhiDeveloperBuilderDraft(state: Pick<PhiDeveloper
142
142
  pageKey: string;
143
143
  };
144
144
  }): Promise<{
145
+ revisionId: null;
146
+ previewHref: string;
147
+ } | {
145
148
  revisionId: number;
146
149
  previewHref: string;
147
150
  }>;
@@ -813,8 +813,16 @@ export async function previewPhiDeveloperBuilderDraft(state, workspaceKind, opti
813
813
  }
814
814
  : { path: resolvePhiBuilderCmsStoragePath(area, pageKey, pages) }),
815
815
  });
816
+ /*
817
+ * No saved draft is not a failure: what the preview has to show is then what is published, so it
818
+ * opens the live page. A read that failed still throws -- that is not knowing, which is different
819
+ * from there being nothing.
820
+ */
816
821
  if (!draft || !Number.isInteger(draft.revisionId) || draft.revisionId <= 0) {
817
- throw new Error("No saved draft found. Save first before opening live preview.");
822
+ return {
823
+ revisionId: null,
824
+ previewHref: buildPhiBuilderLiveHref(area, pageKey, pages, workspaceKind),
825
+ };
818
826
  }
819
827
  return {
820
828
  revisionId: draft.revisionId,
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cloneElement, isValidElement, Suspense, useCallback, useEffect, useRef, useState } from "react";
4
- import { usePhiConfig } from "../../../components/root/phi-config-provider";
4
+ import { usePhiPageModeToken } from "../../../components/root/phi-config-provider";
5
+ import { usePhiPageModeTone } from "../../../components/surface/phi-surface-tone";
5
6
  import { PhiEditScaffoldDrawer } from "./edit-scaffold-drawer";
6
7
  import { comparePhiCmsInstanceIds } from "../../../types/cms-instance-id";
7
8
  import { PhiSlotChildFrame } from "../../../plugins/runtime/phi-slot-child-frame";
@@ -10,7 +11,7 @@ import { PhiPlusButtonWidget, } from "./clients/layout-scaffold-buttons";
10
11
  import { usePhiStructureDroppable, } from "./structure-dnd";
11
12
  import { PhiInlineTextEditor } from "../../../components/controls/phi-inline-text-editor";
12
13
  import { PhiButtonControl } from "../../../components/controls/phi-button-control";
13
- import { usePhiAuthoringLayoutDefinition, usePhiRuntimeModuleAuthoringRegistration, } from "../../../plugins/runtime-modules/client-authoring-module";
14
+ import { usePhiAuthoringLayoutDefinitionResolver, usePhiRuntimeModuleAuthoringRegistration, } from "../../../plugins/runtime-modules/client-authoring-module";
14
15
  import { usePhiRuntimeModuleState } from "../../../components/runtime/runtime-module-context";
15
16
  import { PhiCmsRenderDiagnostic } from "../../../components/cms/phi-cms-render-diagnostic";
16
17
  import { PhiCmsRenderErrorBoundary } from "../../../components/cms/phi-cms-render-error-boundary";
@@ -116,7 +117,8 @@ function PhiAuthoringWidgetLoader({ widget, config, slotSizePolicy, demandContro
116
117
  function PhiAuthoringLayoutLoader({ type, kind, blockId, children, }) {
117
118
  const activeModules = usePhiRuntimeModuleState();
118
119
  const layoutType = resolvePhiAuthoringLayoutType(type);
119
- const definition = usePhiAuthoringLayoutDefinition(layoutType);
120
+ const resolveLayoutDefinition = usePhiAuthoringLayoutDefinitionResolver();
121
+ const definition = resolveLayoutDefinition(layoutType);
120
122
  if (!definition) {
121
123
  return _jsx(PhiCmsRenderDiagnostic, { issue: {
122
124
  code: "missing-renderer",
@@ -138,7 +140,7 @@ function PhiAuthoringLayoutLoader({ type, kind, blockId, children, }) {
138
140
  } });
139
141
  }
140
142
  const LazyAuthoringLayout = definition.component;
141
- return (_jsx(PhiCmsRenderErrorBoundary, { kind: kind, blockId: blockId, typeKey: type, moduleId: definition.ownerModuleId, children: _jsx(Suspense, { fallback: null, children: _jsx(LazyAuthoringLayout, { children: (plugin) => children(plugin, definition, activeModules.widgetDefinitionsByType) }) }) }));
143
+ return (_jsx(PhiCmsRenderErrorBoundary, { kind: kind, blockId: blockId, typeKey: type, moduleId: definition.ownerModuleId, children: _jsx(Suspense, { fallback: null, children: _jsx(LazyAuthoringLayout, { children: (plugin) => children(plugin, definition, activeModules.widgetDefinitionsByType, resolveLayoutDefinition) }) }) }));
142
144
  }
143
145
  function resolveRootNodeEditSlotAnchor(rootNode) {
144
146
  return rootNode.editSlotAnchor ?? undefined;
@@ -206,10 +208,12 @@ function resolveEffectsPreviewDurationMs(config) {
206
208
  }
207
209
  function PhiEffectsPreviewButton({ config, blockKind, onRun, }) {
208
210
  const previewLabel = formatEffectsPreviewLabel(config, blockKind);
211
+ // In the editor's mode, not a tone's: the button is the Builder's, whatever mode the Widget is drawn in.
212
+ const pageModeTone = usePhiPageModeTone();
209
213
  return (_jsx("span", { style: { display: "contents" }, onMouseDown: (event) => {
210
214
  event.preventDefault();
211
215
  event.stopPropagation();
212
- }, onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { className: "phi-layout-affordance phi-layout-affordance--effects-preview", ariaLabel: previewLabel, tooltip: previewLabel, icon: _jsx(PhiIcon, { name: "node-index", size: "inherit" }), type: "text", size: "small", onClick: onRun, style: {
216
+ }, onClick: (event) => event.stopPropagation(), children: pageModeTone.wrap(_jsx(PhiButtonControl, { className: "phi-layout-affordance phi-layout-affordance--effects-preview", ariaLabel: previewLabel, tooltip: previewLabel, icon: _jsx(PhiIcon, { name: "node-index", size: "inherit" }), type: "text", size: "small", onClick: onRun, style: {
213
217
  position: "absolute",
214
218
  top: "50%",
215
219
  left: "50%",
@@ -219,7 +223,7 @@ function PhiEffectsPreviewButton({ config, blockKind, onRun, }) {
219
223
  // whose children `styles/layout.css` stretches, and a stylesheet answer did not hold there.
220
224
  width: "var(--ant-control-height)",
221
225
  "--phi-layout-affordance-size": "var(--ant-control-height)",
222
- } }) }));
226
+ } })) }));
223
227
  }
224
228
  function PhiSignalWiringToolButton({ onOpen }) {
225
229
  return (_jsx("span", { style: { display: "contents" }, onPointerDown: (event) => {
@@ -264,7 +268,8 @@ function findPhiWidgetAuthoringTextTarget(container, clientX, clientY) {
264
268
  }) ?? null;
265
269
  }
266
270
  function PhiWidgetEffectsPreviewFrame({ kind, slotSizePolicy, surfacePolicy, blockId, regionKey, config: committedConfig, title, scaffoldLabel, editorInteraction = "inert", onSelect, dropTarget, tools, style, children, }) {
267
- const { token } = usePhiConfig();
271
+ // The editor's colours, not a tone's: a Widget inside a toned Surface is marked in the page's mode.
272
+ const token = usePhiPageModeToken();
268
273
  const selected = usePhiDeveloperBuilderStateValue((state) => blockId != null &&
269
274
  regionKey != null &&
270
275
  state.selectedRootRegionKey === regionKey &&
@@ -525,10 +530,6 @@ function PhiLayoutEffectsPreviewFrame({ kind, slotSizePolicy, blockId, config: c
525
530
  });
526
531
  } })) : null] }, hasPreviewEffects ? `layout-effects-preview-${blockId ?? "root"}-${previewRunId}` : undefined));
527
532
  }
528
- function PhiAuthoringLayoutEffectsPreviewFrame({ type, ...props }) {
529
- const definition = usePhiAuthoringLayoutDefinition(resolvePhiAuthoringLayoutType(type));
530
- return (_jsx(PhiLayoutEffectsPreviewFrame, { ...props, slotSizePolicy: definition?.slotSizePolicy }));
531
- }
532
533
  /**
533
534
  * The band under a scaffold: what this node is called, and then what it is.
534
535
  *
@@ -821,11 +822,20 @@ export function renderPhiRootNodeScaffold(rootNode, onOpenInsert, onOpenInspecto
821
822
  nodeKind: normalizedRootNode.kind,
822
823
  })
823
824
  : undefined, chrome: renderRootScaffoldToolbar(), children: wrapRootScaffoldChild(child) }));
824
- const renderChildLayoutNode = (node) => {
825
+ /*
826
+ * A nested Layout's frame states its policy on the element the parent Layout sizes its slot by.
827
+ *
828
+ * It was looked up inside that element, which is too late: the parent reads the element's props
829
+ * before it renders, found a Layout with no policy, took the Layout default -- fill both ways -- and
830
+ * let the slot grow and shrink in its column. A Grid of cards in a Flex was squeezed below its
831
+ * content on the canvas and the cards ran out of their scaffold, while the page laid it out at its
832
+ * content height, as its `fill-inline` says.
833
+ */
834
+ const renderChildLayoutNodeWith = (resolveLayoutDefinition) => function renderChildLayoutNode(node) {
825
835
  const nodeKind = "layout";
826
836
  const rootProps = resolveLayoutNodeRootProps(node);
827
837
  const rootPropsGeometry = resolvePhiRenderableBlockGeometry(normalizePhiBuilderRootNodeDraft(rootProps).rootNodeGeometry);
828
- return (_jsx(PhiAuthoringLayoutEffectsPreviewFrame, { type: node.widgetType, kind: nodeKind, blockId: node.id, config: node.config, explicitInlineSize: rootPropsGeometry.explicitInline, explicitBlockSize: rootPropsGeometry.explicitBlock, children: renderPhiRootNodeScaffold({ ...rootProps, regionKey }, (options) => onOpenInsert?.({
838
+ return (_jsx(PhiLayoutEffectsPreviewFrame, { kind: nodeKind, slotSizePolicy: resolveLayoutDefinition(resolvePhiAuthoringLayoutType(node.widgetType))?.slotSizePolicy, blockId: node.id, config: node.config, explicitInlineSize: rootPropsGeometry.explicitInline, explicitBlockSize: rootPropsGeometry.explicitBlock, children: renderPhiRootNodeScaffold({ ...rootProps, regionKey }, (options) => onOpenInsert?.({
829
839
  ...options,
830
840
  slotIndex: options?.slotIndex ?? 0,
831
841
  targetNodeId: node.id,
@@ -861,8 +871,8 @@ export function renderPhiRootNodeScaffold(rootNode, onOpenInsert, onOpenInspecto
861
871
  renderInsertPicker: options?.renderInsertPicker,
862
872
  }) }));
863
873
  };
864
- const scaffold = (_jsx(PhiAuthoringLayoutLoader, { type: normalizedRootNode.typeKey, kind: "layout", blockId: normalizedRootNode.id ?? -1, children: (plugin, definition, widgetDefinitionsByType) => {
865
- const rendered = resolvePhiRootNodeRenderedBody(normalizedRootNode, "editor", plugin, definition, widgetDefinitionsByType, regionKey, renderChildLayoutNode, onDeleteRootNode
874
+ const scaffold = (_jsx(PhiAuthoringLayoutLoader, { type: normalizedRootNode.typeKey, kind: "layout", blockId: normalizedRootNode.id ?? -1, children: (plugin, definition, widgetDefinitionsByType, resolveLayoutDefinition) => {
875
+ const rendered = resolvePhiRootNodeRenderedBody(normalizedRootNode, "editor", plugin, definition, widgetDefinitionsByType, regionKey, renderChildLayoutNodeWith(resolveLayoutDefinition), onDeleteRootNode
866
876
  ? (widget) => onDeleteRootNode({
867
877
  nodeId: widget.id,
868
878
  nodeKey: widget.widgetType,
@@ -1490,14 +1490,18 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
1490
1490
  key: "createPage",
1491
1491
  emits: [{ capabilityId: "command", value: "createPage" }],
1492
1492
  label: labels.pages.newPage,
1493
+ tooltip: labels.pages.newPage,
1493
1494
  icon: "plus",
1495
+ display: "icon",
1494
1496
  variant: "primary",
1495
1497
  },
1496
1498
  {
1497
1499
  key: "editPageMeta",
1498
1500
  emits: [{ capabilityId: "command", value: "editPageMeta" }],
1499
1501
  label: labels.pages.pageMeta,
1502
+ tooltip: labels.pages.pageMeta,
1500
1503
  icon: "edit",
1504
+ display: "icon",
1501
1505
  },
1502
1506
  {
1503
1507
  key: "deletePage",
@@ -40,6 +40,7 @@ import { PhiTypographyControl } from "../../../../../components/controls/phi-typ
40
40
  import { PhiIcon } from "../../../../../components/shell/phi-icon";
41
41
  import { PhiSurfaceTone } from "../../../../../components/surface/phi-surface-tone";
42
42
  import { resolvePhiSurfaceToneClassName } from "../../../../../types/surface";
43
+ import { PHI_SURFACE_TONE_GROUND, phiSurfaceTakesToneGround } from "../../../../../helpers/surface-style";
43
44
  /** The Region's root Layout placed into another tree, at the slot it is moved to. */
44
45
  function buildStructureRootLayoutNode(draft, parentLayoutNodeId, slotIndex) {
45
46
  if (!draft.rootNode) {
@@ -353,16 +354,26 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
353
354
  const shouldStretchAvailableHeight = shouldFillAvailableHeight || shouldStretchContentRegion;
354
355
  const hasExplicitSidebarWidth = isFullHeightRegion && draftGeometry.explicitInline;
355
356
  const regionToneClassName = resolvePhiSurfaceToneClassName(effectiveDraft?.surface?.tone);
356
- const slotBackgroundStyle = effectiveDraft?.surface?.background
357
- ? resolvePhiBackgroundWidgetStyle(effectiveDraft.surface.background)
358
- : {};
359
357
  /*
360
358
  * Whether the author gave this Region a ground. The Builder writes a Background config onto every
361
359
  * Region draft it persists, so only a config that paints something counts. An unauthored Region is
362
360
  * transparent in the live Shell, and the Canvas keeps that legible: its slot paints a half-transparent
363
361
  * container tint, so the Theme Root Background stays visible through it.
364
362
  */
365
- const hasAuthoredGround = phiBackgroundWidgetConfigPaintsGround(effectiveDraft?.surface?.background ?? null);
363
+ const paintsAuthoredGround = phiBackgroundWidgetConfigPaintsGround(effectiveDraft?.surface?.background ?? null);
364
+ /*
365
+ * A toned Region takes its tone's ground where its Background paints none, by the rule the live Region
366
+ * shell follows (`phiSurfaceTakesToneGround`). The slot carries the tone's class, so the ground resolves
367
+ * in the tone's mode; it is a ground of the Region's own, so the Canvas tint does not cover it.
368
+ */
369
+ const toneGround = phiSurfaceTakesToneGround(effectiveDraft?.surface?.tone, paintsAuthoredGround);
370
+ const hasAuthoredGround = paintsAuthoredGround || toneGround;
371
+ const slotBackgroundStyle = {
372
+ ...(effectiveDraft?.surface?.background
373
+ ? resolvePhiBackgroundWidgetStyle(effectiveDraft.surface.background)
374
+ : {}),
375
+ ...(toneGround ? { backgroundColor: PHI_SURFACE_TONE_GROUND } : {}),
376
+ };
366
377
  const slotBorderStyle = effectiveDraft?.surface?.border ? resolvePhiBorderWidgetStyle(effectiveDraft.surface.border) : {};
367
378
  const regionConfig = (effectiveDraft?.regionConfig ?? null);
368
379
  const regionPaddingStyle = resolvePhiPaddingStyle(normalizePhiPaddingWidgetConfig(effectiveDraft?.regionConfig) ?? {});
@@ -28,4 +28,11 @@ export declare function createPhiRuntimeModuleAuthoringClient({ moduleId, Widget
28
28
  layouts?: readonly PhiAuthoringLayoutModuleLoader[];
29
29
  }): ComponentType<PhiRuntimeModuleAuthoringClientProps>;
30
30
  export declare function usePhiRuntimeModuleAuthoringRegistration(moduleId: PhiRuntimeModuleId | null | undefined): PhiRuntimeModuleAuthoringRegistration | null;
31
- export declare function usePhiAuthoringLayoutDefinition(type: string): PhiAuthoringLayoutDefinition | null;
31
+ /**
32
+ * The authoring Layout definitions, as a lookup by type rather than one type's answer.
33
+ *
34
+ * A Layout names its nested Layouts only while it renders its children, and a parent Layout sizes each
35
+ * slot by the props of the element standing in it, before that element renders: a nested Layout's
36
+ * element has to carry its policy already, and a hook inside it would be too late.
37
+ */
38
+ export declare function usePhiAuthoringLayoutDefinitionResolver(): (type: string) => PhiAuthoringLayoutDefinition | null;