@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
@@ -1,6 +1,7 @@
1
1
  import type { PhiNoLabels, PhiServerBlockBaseProps } from "../../../../../types";
2
2
  import type { PhiCmsRuntimeRenderRegistry } from "../../../../../types/cms-plugins";
3
3
  import type { PhiResolvedLinkTargets } from "../../../../../types/references";
4
+ import type { PhiCmsInstanceId } from "../../../../../types/cms-instance-id";
4
5
  import { type PhiEntryListWidgetConfig } from "./config";
5
6
  export type PhiEntryListWidgetProps = PhiServerBlockBaseProps<PhiNoLabels, PhiEntryListWidgetConfig> & {
6
7
  /** Where the record binding is answered; absent outside a page render, where nothing is bound. */
@@ -8,6 +9,7 @@ export type PhiEntryListWidgetProps = PhiServerBlockBaseProps<PhiNoLabels, PhiEn
8
9
  links?: PhiResolvedLinkTargets | null;
9
10
  /** Whether the heading is translated: the node's `NoTranslate` flag, read by the plugin. */
10
11
  translate?: boolean;
12
+ widgetId?: PhiCmsInstanceId | null;
11
13
  };
12
14
  /**
13
15
  * One kind's published entries, read while the page is drawn (`CONTENT_ENTRIES.md`).
@@ -16,12 +18,13 @@ export type PhiEntryListWidgetProps = PhiServerBlockBaseProps<PhiNoLabels, PhiEn
16
18
  * the render rather than in a request the browser makes afterwards. On a Public page that is also the only
17
19
  * way an expired entry can be absent instead of appearing and then disappearing.
18
20
  *
19
- * A failed read says so. The alternative is a page with a heading and nothing under it, which a visitor
20
- * reads as "this Site has published nothing" and an operator cannot tell from the real thing.
21
+ * A failed read is not drawn as a heading with nothing under it, which a visitor reads as "this Site has
22
+ * published nothing". It goes through `PhiWidgetFailureServer`: the author reads why in the Builder, an
23
+ * operator finds it in the log, and the live page goes on without the list.
21
24
  *
22
25
  * A `related` list is the exception twice over. It reads through its record binding, the one the header
23
26
  * and text are bound to, so it costs Core nothing the Page did not already ask, and it is cut to as many
24
27
  * as that record carries. And with nothing related -- or nothing to be related to -- it draws
25
28
  * nothing at all: a "more like this" heading over an empty space says something false.
26
29
  */
27
- export declare function PhiEntryListWidget({ config, runtime, registry, links, translate }: PhiEntryListWidgetProps): Promise<import("react").JSX.Element | null>;
30
+ export declare function PhiEntryListWidget({ config, runtime, registry, links, translate, widgetId, }: PhiEntryListWidgetProps): Promise<import("react").JSX.Element | null>;
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
3
2
  import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
4
3
  import { getPhiContentEntryReaderLabels } from "../../../../../components/widgets/label-sets/content-entries";
4
+ import { PhiWidgetFailureServer } from "../../../../../components/widgets/shared/widget-failure.server";
5
5
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
6
6
  import { fetchPhiSiteContentEntries } from "../../../../../gateway/content-entries";
7
7
  import { phiRuntime } from "../../../../../server-helpers/phi-runtime";
8
8
  import { trBulkForLocale } from "../../../../../server-helpers/translate";
9
+ import { readPhiRuntimeTreeRenderMode } from "../../../render-mode";
9
10
  import { readPhiBoundContentEntry } from "../../content-entries/record-source.server";
10
11
  import { buildPhiEntryViews } from "./view.server";
11
12
  import { normalizePhiEntryListWidgetConfig } from "./config";
@@ -17,16 +18,18 @@ import { pickPhiSequenceSettings } from "../../../../../components/widgets/confi
17
18
  * the render rather than in a request the browser makes afterwards. On a Public page that is also the only
18
19
  * way an expired entry can be absent instead of appearing and then disappearing.
19
20
  *
20
- * A failed read says so. The alternative is a page with a heading and nothing under it, which a visitor
21
- * reads as "this Site has published nothing" and an operator cannot tell from the real thing.
21
+ * A failed read is not drawn as a heading with nothing under it, which a visitor reads as "this Site has
22
+ * published nothing". It goes through `PhiWidgetFailureServer`: the author reads why in the Builder, an
23
+ * operator finds it in the log, and the live page goes on without the list.
22
24
  *
23
25
  * A `related` list is the exception twice over. It reads through its record binding, the one the header
24
26
  * and text are bound to, so it costs Core nothing the Page did not already ask, and it is cut to as many
25
27
  * as that record carries. And with nothing related -- or nothing to be related to -- it draws
26
28
  * nothing at all: a "more like this" heading over an empty space says something false.
27
29
  */
28
- export async function PhiEntryListWidget({ config, runtime, registry, links, translate = true }) {
30
+ export async function PhiEntryListWidget({ config, runtime, registry, links, translate = true, widgetId, }) {
29
31
  const settings = normalizePhiEntryListWidgetConfig(config);
32
+ const renderMode = readPhiRuntimeTreeRenderMode(config ?? {});
30
33
  const rt = phiRuntime(runtime);
31
34
  const locale = runtime.locale.current;
32
35
  const labels = await getPhiContentEntryReaderLabels({
@@ -41,6 +44,10 @@ export async function PhiEntryListWidget({ config, runtime, registry, links, tra
41
44
  const bound = settings.relatedTo
42
45
  ? await readPhiBoundContentEntry({ registry, runtime, binding: settings.relatedTo })
43
46
  : null;
47
+ // A source that cannot answer is a failure; one that answers nothing is only nothing related.
48
+ if (bound?.status === "unavailable") {
49
+ return (_jsx(PhiWidgetFailureServer, { renderMode: renderMode, widgetType: PhiCmsWidgetType.EntryList, widgetId: widgetId, title: labels.unavailable, description: bound.reason }));
50
+ }
44
51
  if (bound?.status !== "ok") {
45
52
  return null;
46
53
  }
@@ -59,8 +66,8 @@ export async function PhiEntryListWidget({ config, runtime, registry, links, tra
59
66
  categories: settings.categories,
60
67
  });
61
68
  }
62
- catch {
63
- return _jsx(PhiAlertControl, { level: "warning", showIcon: true, title: labels.unavailable });
69
+ catch (error) {
70
+ return (_jsx(PhiWidgetFailureServer, { renderMode: renderMode, widgetType: PhiCmsWidgetType.EntryList, widgetId: widgetId, title: labels.unavailable, description: error instanceof Error ? error.message : String(error), error: error }));
64
71
  }
65
72
  }
66
73
  const views = await buildPhiEntryViews({
@@ -45,6 +45,7 @@ export declare const PHI_GALLERY_WIDGET_DEFINITION: {
45
45
  } & {
46
46
  type: "string" | "url" | "icon";
47
47
  emptyValue?: "";
48
+ placeholder?: string;
48
49
  }) | ({
49
50
  key: string;
50
51
  label: string;
@@ -4,5 +4,5 @@ import { PHI_GALLERY_WIDGET_DEFINITION, } from "./config";
4
4
  import { PhiGalleryWidgetServer } from "./server";
5
5
  export const PHI_GALLERY_WIDGET_PLUGIN = {
6
6
  ...PHI_GALLERY_WIDGET_DEFINITION,
7
- ...definePhiPassiveWidgetRenderers(({ widget, runtime, registry, config }) => (_jsx(PhiGalleryWidgetServer, { runtime: runtime, registry: registry, config: config }, `widget-${widget.id}`))),
7
+ ...definePhiPassiveWidgetRenderers(({ widget, runtime, registry, config }) => (_jsx(PhiGalleryWidgetServer, { runtime: runtime, registry: registry, config: config, widgetId: widget.id }, `widget-${widget.id}`))),
8
8
  };
@@ -1,17 +1,19 @@
1
1
  import "server-only";
2
2
  import type { PhiBlockRuntime } from "../../../../../types";
3
3
  import type { PhiCmsRuntimeRenderRegistry } from "../../../../../types/cms-plugins";
4
+ import type { PhiCmsInstanceId } from "../../../../../types/cms-instance-id";
4
5
  import type { PhiCmsGalleryWidgetConfig } from "./config";
5
6
  export type PhiGalleryWidgetServerProps = {
6
7
  runtime: PhiBlockRuntime;
7
8
  /** Where the record binding is answered; absent outside a page render, where nothing is bound. */
8
9
  registry?: Pick<PhiCmsRuntimeRenderRegistry, "recordProviderLoadersByKey">;
9
10
  config: PhiCmsGalleryWidgetConfig;
11
+ widgetId?: PhiCmsInstanceId | null;
10
12
  };
11
13
  /**
12
14
  * The pictures come from the record the binding names -- a Folder, read while the page is drawn -- so
13
15
  * they are in the HTML and the window knows what to load before anything is on screen. A record of
14
- * another shape is somebody else's Provider bound here by mistake, and is said as unavailable rather
15
- * than drawn as an empty gallery.
16
+ * another shape is somebody else's Provider bound here by mistake. Either failure is the author's to
17
+ * read and is nothing on a live page, rather than an empty gallery anywhere.
16
18
  */
17
- export declare function PhiGalleryWidgetServer({ runtime, registry, config }: PhiGalleryWidgetServerProps): Promise<import("react").JSX.Element | null>;
19
+ export declare function PhiGalleryWidgetServer({ runtime, registry, config, widgetId }: PhiGalleryWidgetServerProps): Promise<import("react").JSX.Element | null>;
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "server-only";
3
- import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
4
3
  import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
5
4
  import { getPhiGalleryWidgetLabels } from "../../../../../components/widgets/label-sets/gallery";
5
+ import { PhiWidgetFailureServer } from "../../../../../components/widgets/shared/widget-failure.server";
6
6
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
7
7
  import { readPhiServerApiCredentials } from "../../../../../helpers/phis-server-credentials";
8
8
  import { resolvePhiRecordSource } from "../../../../../server-helpers/record-source";
9
+ import { readPhiRuntimeTreeRenderMode } from "../../../render-mode";
9
10
  function isPublicAssetReference(value) {
10
11
  return typeof value === "object" && value !== null &&
11
12
  typeof value.id === "number" &&
@@ -14,26 +15,27 @@ function isPublicAssetReference(value) {
14
15
  /**
15
16
  * The pictures come from the record the binding names -- a Folder, read while the page is drawn -- so
16
17
  * they are in the HTML and the window knows what to load before anything is on screen. A record of
17
- * another shape is somebody else's Provider bound here by mistake, and is said as unavailable rather
18
- * than drawn as an empty gallery.
18
+ * another shape is somebody else's Provider bound here by mistake. Either failure is the author's to
19
+ * read and is nothing on a live page, rather than an empty gallery anywhere.
19
20
  */
20
- export async function PhiGalleryWidgetServer({ runtime, registry, config }) {
21
+ export async function PhiGalleryWidgetServer({ runtime, registry, config, widgetId }) {
21
22
  const labels = await getPhiGalleryWidgetLabels({
22
23
  apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
23
24
  internalToken: readPhiServerApiCredentials().internalToken,
24
25
  locale: runtime.locale.current,
25
26
  });
27
+ const renderMode = readPhiRuntimeTreeRenderMode(config);
26
28
  const result = registry && config.source
27
29
  ? await resolvePhiRecordSource({ registry, runtime, binding: config.source })
28
30
  : { status: "missing" };
29
31
  if (result.status === "unavailable") {
30
- return _jsx(PhiAlertControl, { level: "error", showIcon: true, title: labels.unavailable, description: result.reason });
32
+ return (_jsx(PhiWidgetFailureServer, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Gallery, widgetId: widgetId, title: labels.unavailable, description: result.reason }));
31
33
  }
32
34
  const images = result.status === "ok" && Array.isArray(result.record)
33
35
  ? result.record.filter(isPublicAssetReference)
34
36
  : null;
35
37
  if (result.status === "ok" && images == null) {
36
- return _jsx(PhiAlertControl, { level: "error", showIcon: true, title: labels.unavailable });
38
+ return (_jsx(PhiWidgetFailureServer, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Gallery, widgetId: widgetId, title: labels.unavailable, description: `The record bound from "${config.source?.providerKey ?? ""}" is not a list of images.` }));
37
39
  }
38
40
  if (!images || images.length === 0) {
39
41
  return null;
@@ -28,7 +28,7 @@ export function PhiHeaderNavigationWidgetClient({ runtime, items, menuTheme, hei
28
28
  minHeight: 0,
29
29
  overflow: "hidden",
30
30
  whiteSpace: "nowrap",
31
- fontSize: token.fontSizeLG,
31
+ fontSize: token.fontSize,
32
32
  }, children: items.map((item) => (_jsx("span", { style: {
33
33
  display: "inline-flex",
34
34
  alignItems: "center",
@@ -46,7 +46,7 @@ export function PhiHeaderNavigationWidgetClient({ runtime, items, menuTheme, hei
46
46
  minHeight: 0,
47
47
  flex: 1,
48
48
  justifyContent: align === "center" ? "center" : "flex-start",
49
- }, children: _jsx(PhiMenuControl, { mode: "horizontal", menuTheme: menuTheme, selectedKeys: selectedKeys, items: menuItems, fontSize: token.fontSizeLG, style: {
49
+ }, children: _jsx(PhiMenuControl, { mode: "horizontal", menuTheme: menuTheme, selectedKeys: selectedKeys, items: menuItems, fontSize: token.fontSize, style: {
50
50
  display: "flex",
51
51
  alignItems: "center",
52
52
  justifyContent: align === "center" ? "center" : "flex-start",
@@ -11,7 +11,7 @@ export function PhiHtmlWidgetClient({ blockId, config, }) {
11
11
  const [fontSizeOverride, setFontSizeOverride] = useState(null);
12
12
  const html = typeof config?.html === "string" ? config.html.trim() : "";
13
13
  const resolvedFontFamily = resolvePhiWidgetFontFamily(fontFamilyOverride ?? config?.fontFamily, fonts, token);
14
- const resolvedFontSize = resolvePhiWidgetFontSize(fontSizeOverride ?? config?.fontSize, token, "lg");
14
+ const resolvedFontSize = resolvePhiWidgetFontSize(fontSizeOverride ?? config?.fontSize, token, "base");
15
15
  const receiver = createPhiRenderableBlockReceiver("widget", blockId);
16
16
  usePhiRenderableBlockSignalListener(receiver, (signal) => {
17
17
  if (signal.channel === "fontFamily" && signal.action === "change") {
@@ -44,8 +44,15 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
44
44
  textAlign: "start";
45
45
  textBlockSpacingBefore: "none";
46
46
  textBlockSpacingAfter: "sm";
47
- headingBlockSpacingBefore: "none";
47
+ headingBlockSpacingBefore: "sm";
48
48
  headingBlockSpacingAfter: "sm";
49
+ headingOffset: number;
50
+ list: {
51
+ level1: "dot";
52
+ level2: "circle";
53
+ level3: "dash";
54
+ gap: "xs";
55
+ };
49
56
  };
50
57
  contentBinding: {
51
58
  storage: "markdown";
@@ -57,7 +64,318 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
57
64
  value: string;
58
65
  };
59
66
  };
60
- fields: import("../../../../../types").PhiCmsConfigField[];
67
+ fields: (({
68
+ key: string;
69
+ label: string;
70
+ description?: string;
71
+ required?: boolean;
72
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
73
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
74
+ heading?: string;
75
+ } & {
76
+ type: "string" | "url" | "icon";
77
+ emptyValue?: "";
78
+ placeholder?: string;
79
+ }) | ({
80
+ key: string;
81
+ label: string;
82
+ description?: string;
83
+ required?: boolean;
84
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
85
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
86
+ heading?: string;
87
+ } & {
88
+ type: "link-target";
89
+ clearsWhenEmpty?: readonly string[];
90
+ }) | ({
91
+ key: string;
92
+ label: string;
93
+ description?: string;
94
+ required?: boolean;
95
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
96
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
97
+ heading?: string;
98
+ } & {
99
+ type: "readonly";
100
+ }) | ({
101
+ key: string;
102
+ label: string;
103
+ description?: string;
104
+ required?: boolean;
105
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
106
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
107
+ heading?: string;
108
+ } & {
109
+ type: "data-provider";
110
+ providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
111
+ providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
112
+ }) | ({
113
+ key: string;
114
+ label: string;
115
+ description?: string;
116
+ required?: boolean;
117
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
118
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
119
+ heading?: string;
120
+ } & {
121
+ type: "calendar-adapter";
122
+ }) | ({
123
+ key: string;
124
+ label: string;
125
+ description?: string;
126
+ required?: boolean;
127
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
128
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
129
+ heading?: string;
130
+ } & {
131
+ type: "video-provider";
132
+ }) | ({
133
+ key: string;
134
+ label: string;
135
+ description?: string;
136
+ required?: boolean;
137
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
138
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
139
+ heading?: string;
140
+ } & {
141
+ type: "dimension";
142
+ widthKey?: string;
143
+ heightKey?: string;
144
+ widthPlaceholder?: string;
145
+ heightPlaceholder?: string;
146
+ patchOnChange?: Record<string, unknown>;
147
+ }) | ({
148
+ key: string;
149
+ label: string;
150
+ description?: string;
151
+ required?: boolean;
152
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
153
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
154
+ heading?: string;
155
+ } & {
156
+ type: "length";
157
+ min?: number;
158
+ max?: number;
159
+ step?: number;
160
+ precision?: number;
161
+ }) | ({
162
+ key: string;
163
+ label: string;
164
+ description?: string;
165
+ required?: boolean;
166
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
167
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
168
+ heading?: string;
169
+ } & {
170
+ type: "radius";
171
+ topLeftKey: string;
172
+ topRightKey: string;
173
+ bottomLeftKey: string;
174
+ bottomRightKey: string;
175
+ }) | ({
176
+ key: string;
177
+ label: string;
178
+ description?: string;
179
+ required?: boolean;
180
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
181
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
182
+ heading?: string;
183
+ } & {
184
+ type: "padding";
185
+ paddingKey?: string;
186
+ gapKey?: string;
187
+ paddingTopKey?: string;
188
+ paddingRightKey?: string;
189
+ paddingBottomKey?: string;
190
+ paddingLeftKey?: string;
191
+ section?: string;
192
+ }) | ({
193
+ key: string;
194
+ label: string;
195
+ description?: string;
196
+ required?: boolean;
197
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
198
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
199
+ heading?: string;
200
+ } & {
201
+ type: "color";
202
+ mode?: import("../../../../../types").PhiCmsConfigFieldColorMode;
203
+ defaultToken?: import("../../../../../theme/phi-theme-tokens").PhiThemeTokenKey;
204
+ section?: string;
205
+ }) | ({
206
+ key: string;
207
+ label: string;
208
+ description?: string;
209
+ required?: boolean;
210
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
211
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
212
+ heading?: string;
213
+ } & {
214
+ type: "boolean";
215
+ }) | ({
216
+ key: string;
217
+ label: string;
218
+ description?: string;
219
+ required?: boolean;
220
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
221
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
222
+ heading?: string;
223
+ } & {
224
+ type: "image";
225
+ }) | ({
226
+ key: string;
227
+ label: string;
228
+ description?: string;
229
+ required?: boolean;
230
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
231
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
232
+ heading?: string;
233
+ } & {
234
+ type: "slot-texts";
235
+ }) | ({
236
+ key: string;
237
+ label: string;
238
+ description?: string;
239
+ required?: boolean;
240
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
241
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
242
+ heading?: string;
243
+ } & {
244
+ type: "number-list";
245
+ min?: number;
246
+ }) | ({
247
+ key: string;
248
+ label: string;
249
+ description?: string;
250
+ required?: boolean;
251
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
252
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
253
+ heading?: string;
254
+ } & {
255
+ type: "flags";
256
+ options: readonly {
257
+ value: number;
258
+ label: string;
259
+ }[];
260
+ }) | ({
261
+ key: string;
262
+ label: string;
263
+ description?: string;
264
+ required?: boolean;
265
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
266
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
267
+ heading?: string;
268
+ } & {
269
+ type: "number";
270
+ min?: number;
271
+ max?: number;
272
+ step?: number;
273
+ precision?: number;
274
+ prefix?: string;
275
+ presentation?: "slider";
276
+ suffix?: string;
277
+ }) | ({
278
+ key: string;
279
+ label: string;
280
+ description?: string;
281
+ required?: boolean;
282
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
283
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
284
+ heading?: string;
285
+ } & {
286
+ type: "choice";
287
+ valueType: "number";
288
+ options: import("@phis/contracts/controls").PhiControlOption<number>[];
289
+ emptyOption?: import("@phis/contracts/controls").PhiControlOption;
290
+ emptyValue?: null | undefined;
291
+ placeholder?: string;
292
+ mode?: never;
293
+ presentation?: never;
294
+ optionsProvider?: never;
295
+ allowCustom?: never;
296
+ createBehavior?: never;
297
+ filter?: never;
298
+ patchOnChange?: never;
299
+ optionPresets?: never;
300
+ }) | ({
301
+ key: string;
302
+ label: string;
303
+ description?: string;
304
+ required?: boolean;
305
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
306
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
307
+ heading?: string;
308
+ } & {
309
+ type: "choice";
310
+ mode?: import("../../../../../types").PhiCmsConfigFieldChoiceMode;
311
+ valueType?: Exclude<import("../../../../../types").PhiCmsConfigFieldChoiceValueType, "number">;
312
+ presentation?: import("../../../../../types").PhiCmsConfigFieldChoicePresentation;
313
+ options?: import("@phis/contracts/controls").PhiControlOption[];
314
+ optionsProvider?: import("@phis/contracts/controls").PhiControlOptionsProviderConfig;
315
+ allowCustom?: boolean;
316
+ createBehavior?: import("../../../../../types").PhiCmsConfigFieldChoiceCreateBehavior;
317
+ placeholder?: string;
318
+ filter?: import("../../../../../types").PhiCmsConfigFieldChoiceFilter;
319
+ emptyOption?: import("@phis/contracts/controls").PhiControlOption;
320
+ emptyValue?: null | undefined;
321
+ patchOnChange?: Record<string, unknown>;
322
+ optionPresets?: import("../../../../../types/cms-plugins").PhiCmsConfigFieldOptionPresets;
323
+ }) | ({
324
+ key: string;
325
+ label: string;
326
+ description?: string;
327
+ required?: boolean;
328
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
329
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
330
+ heading?: string;
331
+ } & {
332
+ type: "collection";
333
+ itemKeyField: string;
334
+ itemLabelField?: string;
335
+ itemFields: import("../../../../../types").PhiCmsConfigField[];
336
+ defaultItem?: Record<string, unknown>;
337
+ addLabel?: string;
338
+ emptyLabel?: string;
339
+ minItems?: number;
340
+ maxItems?: number;
341
+ reorderable?: boolean;
342
+ presentation?: import("../../../../../types").PhiCmsConfigFieldCollectionPresentation;
343
+ editLabel?: string;
344
+ }) | ({
345
+ key: string;
346
+ label: string;
347
+ description?: string;
348
+ required?: boolean;
349
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
350
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
351
+ heading?: string;
352
+ } & {
353
+ type: "surface";
354
+ tone?: false;
355
+ }) | ({
356
+ key: string;
357
+ label: string;
358
+ description?: string;
359
+ required?: boolean;
360
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
361
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
362
+ heading?: string;
363
+ } & {
364
+ type: "grid-placement" | "column-count";
365
+ section?: string;
366
+ }) | {
367
+ key: string;
368
+ type: "choice";
369
+ label: string;
370
+ emptyOption: {
371
+ value: string;
372
+ label: string;
373
+ };
374
+ options: {
375
+ value: PhiMarkdownImageFloat;
376
+ label: string;
377
+ }[];
378
+ })[];
61
379
  parseConfig: typeof parsePhiCmsMarkdownWidgetConfig;
62
380
  };
63
381
  export declare const PHI_MARKDOWN_WIDGET_PLUGIN_TYPE: string;
@@ -1,7 +1,7 @@
1
1
  import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
2
2
  import { PHI_SPACING_SCALE_KEYS } from "../../../../../components/widgets/config/spacing-options";
3
3
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
4
- import { buildPhiBulletListFields, readPhiBulletListStyle, } from "../../../../../components/widgets/shared/bullet-list-vocabulary";
4
+ import { buildPhiBulletListFields, PHI_BULLET_LIST_DEFAULT_STYLE, readPhiBulletListStyle, } from "../../../../../components/widgets/shared/bullet-list-vocabulary";
5
5
  import { readNumber, readRenderableBlockConfig, readString, } from "../../../../../components/widgets/config/parser-primitives";
6
6
  const PHI_MARKDOWN_TEXT_ALIGN_OPTIONS = [
7
7
  { value: "start", label: "Start" },
@@ -81,8 +81,11 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
81
81
  textAlign: "start",
82
82
  textBlockSpacingBefore: "none",
83
83
  textBlockSpacingAfter: "sm",
84
- headingBlockSpacingBefore: "none",
84
+ headingBlockSpacingBefore: "sm",
85
85
  headingBlockSpacingAfter: "sm",
86
+ headingOffset: 0,
87
+ // What the list draws with when nothing is set, so the Inspector shows it rather than empty fields.
88
+ list: { ...PHI_BULLET_LIST_DEFAULT_STYLE },
86
89
  },
87
90
  contentBinding: {
88
91
  storage: "markdown",
@@ -127,6 +130,8 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
127
130
  key: "imageFloat",
128
131
  type: "choice",
129
132
  label: "Image Float",
133
+ // No float is the default and stores nothing; the line says so instead of an empty picker.
134
+ emptyOption: { value: "none", label: "None" },
130
135
  options: PHI_MARKDOWN_IMAGE_FLOAT_OPTIONS,
131
136
  },
132
137
  {
@@ -157,12 +162,21 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
157
162
  key: "headingOffset",
158
163
  type: "number",
159
164
  label: "Heading Offset",
165
+ description: "Moves every heading of the text down by this many levels: at 1, a # heading is drawn as H2, ## as H3, and so on. For a text that stands under a page title of its own, so its first heading does not compete with it.",
160
166
  min: 0,
161
167
  max: PHI_MARKDOWN_HEADING_OFFSET_MAX,
162
168
  precision: 0,
163
169
  },
164
- { key: "tocKey", type: "string", label: "TOC Key" },
165
- ...buildPhiBulletListFields("list", "Lists"),
170
+ {
171
+ key: "tocKey",
172
+ type: "string",
173
+ label: "TOC Key",
174
+ // Empty is no key, and a TOC on "Auto" connects to the text all the same.
175
+ placeholder: "Auto",
176
+ description: "A name for this text's table of contents. A Markdown TOC widget set to Binding Mode \"Target\" with the same TOC Key lists this text's headings and no other's. Leave it empty while the page has one Markdown text: a TOC on \"Auto\" finds it by itself.",
177
+ },
178
+ // The markers are an unordered list's: a `1.` list counts, whatever its level's marker says.
179
+ ...buildPhiBulletListFields("list", "Unordered Lists"),
166
180
  ],
167
181
  parseConfig: parsePhiCmsMarkdownWidgetConfig,
168
182
  };
@@ -69,7 +69,15 @@ export function PhiMarkdownWidgetEditor({ blockId, config, onChange, onSourceLoc
69
69
  * On the field's own text, not on `style`: `style` places the control as a whole, and with a clear
70
70
  * button the control is a wrapper around the textarea, which is where the text is.
71
71
  */
72
- inputStyle: config?.textAlign ? { textAlign: config.textAlign } : undefined, style: {
72
+ inputStyle: {
73
+ ...(config?.textAlign ? { textAlign: config.textAlign } : {}),
74
+ /*
75
+ * The text's own padding, stated, as a single-line field's would be: half of what the first line
76
+ * leaves of a control's height. Stated, the clear button finds the first line by it, as it does in
77
+ * every field that states one; left to Ant Design it hung at its own offset, half a line above.
78
+ */
79
+ paddingBlock: "calc((var(--ant-control-height) - 1lh) / 2)",
80
+ }, style: {
73
81
  /*
74
82
  * As wide as the slot: the Widget fills its inline axis (`fill-inline`), so the frame decides the
75
83
  * width and the editor takes it. A fixed 520px here dated from when the Widget was intrinsic and
@@ -6,11 +6,16 @@ import { usePhiConfig } from "../../../../../components/root/phi-config-provider
6
6
  import { PhiAnchorNavControl } from "../../../../../components/controls/phi-anchor-nav-control";
7
7
  import { PhiEmptyControl } from "../../../../../components/controls/phi-empty-control";
8
8
  import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
9
+ /*
10
+ * Indented by depth below the shallowest heading listed, not below `h1`: a contents that starts at `h3`
11
+ * (a document whose headings moved down under a page title) would otherwise stand two steps off its line.
12
+ */
9
13
  function buildAnchorItems(headings, indent) {
14
+ const topLevel = headings.reduce((lowest, heading) => Math.min(lowest, heading.level), Infinity);
10
15
  return headings.map((heading) => ({
11
16
  key: heading.id,
12
17
  href: `#${heading.id}`,
13
- title: (_jsx("span", { style: { display: "block", paddingInlineStart: (heading.level - 1) * indent }, children: heading.text })),
18
+ title: (_jsx("span", { style: { display: "block", paddingInlineStart: (heading.level - topLevel) * indent, minWidth: 0 }, children: _jsx(PhiTypographyControl, { ellipsis: { tooltip: heading.text }, style: { display: "block", color: "inherit", fontSize: "inherit", lineHeight: "inherit" }, children: heading.text }) })),
14
19
  }));
15
20
  }
16
21
  function filterHeadings(headings, config) {