@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,17 +1,18 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { definePhiPassiveWidgetRenderers } from "../../../../../plugins/factories/widget-renderers";
3
3
  import { phiRuntime } from "../../../../../server-helpers/phi-runtime";
4
+ import { readPhiRuntimeTreeRenderMode } from "../../../render-mode";
4
5
  import { PHI_TABLE_WIDGET_DEFINITION } from "./config";
5
6
  import { PhiTableWidget } from "./server";
6
7
  import { getPhiTableWidgetLabels } from "../../../../../components/widgets/label-sets/table";
7
- async function PhiTableWidgetPluginServer({ config, runtime, }) {
8
+ async function PhiTableWidgetPluginServer({ widget, config, runtime, }) {
8
9
  const rt = phiRuntime(runtime);
9
10
  const labels = await getPhiTableWidgetLabels({
10
11
  apiBaseUrl: rt.apiBaseUrl,
11
12
  internalToken: rt.internalToken,
12
13
  locale: runtime.locale.current,
13
14
  });
14
- return _jsx(PhiTableWidget, { config: config, labels: labels });
15
+ return _jsx(PhiTableWidget, { config: config, labels: labels, renderMode: readPhiRuntimeTreeRenderMode(widget.config) });
15
16
  }
16
17
  export const PHI_TABLE_WIDGET_PLUGIN = {
17
18
  ...PHI_TABLE_WIDGET_DEFINITION,
@@ -1,7 +1,9 @@
1
1
  import type { PhiTableWidgetConfig } from "../../../../../types";
2
2
  import type { PhiTableWidgetLabels } from "../../../../../components/widgets/label-types/table";
3
+ import type { PhiRenderableBlockRenderMode } from "../../../../../types/renderable-block";
3
4
  export type PhiTableWidgetProps = {
4
5
  config: PhiTableWidgetConfig;
5
6
  labels: PhiTableWidgetLabels;
7
+ renderMode: PhiRenderableBlockRenderMode;
6
8
  };
7
- export declare function PhiTableWidget({ config, labels }: PhiTableWidgetProps): import("react").JSX.Element;
9
+ export declare function PhiTableWidget({ config, labels, renderMode }: PhiTableWidgetProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
3
3
  import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
4
- export function PhiTableWidget({ config, labels }) {
5
- return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Table, componentProps: { config, labels } }));
4
+ export function PhiTableWidget({ config, labels, renderMode }) {
5
+ return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Table, componentProps: { config, labels, renderMode } }));
6
6
  }
@@ -6,5 +6,6 @@ export function PhiStaticTableResourceEditor({ config, labels = PHI_TABLE_WIDGET
6
6
  if (!config.source) {
7
7
  throw new Error("Static Table resource authoring requires a Provider resource binding.");
8
8
  }
9
- return _jsx(PhiTableWidgetClient, { config: config, labels: labels });
9
+ // An authoring surface: what does not hold is the author's to read.
10
+ return _jsx(PhiTableWidgetClient, { config: config, renderMode: "editor", labels: labels });
10
11
  }
@@ -5,7 +5,7 @@ import { PHI_TIMELINE_WIDGET_DEFINITION } from "./config";
5
5
  import { PhiStaticTimelineToolButton } from "../../../../../components/widgets/builder/phi-static-timeline-picker";
6
6
  export const PHI_TIMELINE_WIDGET_BUILDER_PLUGIN = {
7
7
  ...PHI_TIMELINE_WIDGET_DEFINITION,
8
- renderEditor: ({ widget, config, runtime }) => (_jsx(PhiTimelineWidget, { blockId: widget.id, config: config, locale: runtime.locale.current, showProviderErrors: true })),
8
+ renderEditor: ({ widget, config, runtime }) => (_jsx(PhiTimelineWidget, { blockId: widget.id, config: config, locale: runtime.locale.current })),
9
9
  /* The Widget's own entries, only while no Provider answers in their place. */
10
10
  renderEditorTools: ({ config, authoring }) => authoring?.updateConfig && !config.entriesProvider ? (_jsx(PhiStaticTimelineToolButton, { entries: config.entries, onApply: (entries) => authoring.updateConfig?.({ entries }) })) : null,
11
11
  };
@@ -1,10 +1,8 @@
1
1
  import type { PhiTimelineWidgetConfig } from "./config";
2
2
  import type { PhiCmsInstanceId } from "../../../../../types/cms-instance-id";
3
- export declare function PhiTimelineWidget({ config, blockId, locale, showProviderErrors, }: {
3
+ export declare function PhiTimelineWidget({ config, blockId, locale, }: {
4
4
  config?: PhiTimelineWidgetConfig | null;
5
5
  blockId?: PhiCmsInstanceId | null;
6
6
  /** The page's locale, which a date is formatted in; never the browser's. */
7
7
  locale?: string;
8
- /** In the Builder an author sees why a Provider answers nothing; a reader sees an empty Timeline. */
9
- showProviderErrors?: boolean;
10
8
  }): import("react").JSX.Element;
@@ -1,13 +1,15 @@
1
1
  "use client";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo, useState } from "react";
4
4
  import { createPhiSignalAddress } from "../../../../../types/signals";
5
5
  import { isPhiRecord } from "../../../../../helpers/is-record";
6
6
  import { formatPhiDate, formatPhiDateTime, formatPhiRelativeTime } from "../../../../../helpers/format-date-time";
7
- import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
8
7
  import { PhiTimelineControl } from "../../../../../components/controls/phi-timeline-control";
9
8
  import { usePhiControlSignalController } from "../../../../../components/widgets/client/shared/phi-control-signals";
10
9
  import { usePhiTimelineProviderEntries } from "../../../../../components/widgets/client/shared/phi-timeline-provider";
10
+ import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
11
+ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
12
+ import { readPhiRuntimeTreeRenderMode } from "../../../render-mode";
11
13
  function formatEntryTime(entry, format, locale) {
12
14
  /* Words the entry states are shown as written; a date is formatted for the reader. */
13
15
  if (entry.time)
@@ -18,7 +20,7 @@ function formatEntryTime(entry, format, locale) {
18
20
  return formatPhiRelativeTime(entry.at, locale);
19
21
  return format === "datetime" ? formatPhiDateTime(entry.at, locale) : formatPhiDate(entry.at, locale);
20
22
  }
21
- export function PhiTimelineWidget({ config, blockId, locale = "en", showProviderErrors = false, }) {
23
+ export function PhiTimelineWidget({ config, blockId, locale = "en", }) {
22
24
  /*
23
25
  * Params a signal chose, over the stored ones. Kept with the binding they were chosen for, so a
24
26
  * Provider changed in the Inspector starts from its own stored params again.
@@ -71,5 +73,13 @@ export function PhiTimelineWidget({ config, blockId, locale = "en", showProvider
71
73
  tone: entry.tone,
72
74
  pending: entry.pending,
73
75
  }));
74
- return (_jsxs(_Fragment, { children: [showProviderErrors && provided.error ? _jsx(PhiAlertControl, { level: "warning", showIcon: true, title: provided.error }) : null, _jsx(PhiTimelineControl, { items: items, placement: config?.placement })] }));
76
+ /*
77
+ * A Provider that is not there or did not answer leaves nothing to draw, and an empty Timeline would
78
+ * say there was nothing to tell. The config carries where it draws, so the author reads why and a
79
+ * reader is shown nothing.
80
+ */
81
+ if (provided.error) {
82
+ return (_jsx(PhiWidgetFailure, { renderMode: readPhiRuntimeTreeRenderMode(config ?? {}), widgetType: PhiCmsWidgetType.Timeline, widgetId: blockId, title: provided.error }));
83
+ }
84
+ return _jsx(PhiTimelineControl, { items: items, placement: config?.placement });
75
85
  }
@@ -4,4 +4,4 @@ import { createPhiCmsBuilderWidgetPlugin } from "../../../../../plugins/factorie
4
4
  import { PHI_TREE_WIDGET_DEFINITION } from "./config";
5
5
  import { PhiTreeWidgetClient } from "./client";
6
6
  import { PHI_TREE_WIDGET_DEFAULT_LABELS } from "../../../../../components/widgets/label-types/tree";
7
- export const PHI_TREE_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_TREE_WIDGET_DEFINITION, ({ config }) => _jsx(PhiTreeWidgetClient, { config: config, labels: PHI_TREE_WIDGET_DEFAULT_LABELS }));
7
+ export const PHI_TREE_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_TREE_WIDGET_DEFINITION, ({ config }) => _jsx(PhiTreeWidgetClient, { config: config, renderMode: "editor", labels: PHI_TREE_WIDGET_DEFAULT_LABELS }));
@@ -1,6 +1,9 @@
1
1
  import type { PhiTreeWidgetLabels } from "../../../../../components/widgets/label-types/tree";
2
2
  import type { PhiTreeWidgetConfig } from "../../../../../types/tree-widget";
3
- export declare function PhiTreeWidgetClient({ config, labels }: {
3
+ import type { PhiRenderableBlockRenderMode } from "../../../../../types/renderable-block";
4
+ export declare function PhiTreeWidgetClient({ config, labels, renderMode }: {
4
5
  config: PhiTreeWidgetConfig;
5
6
  labels: PhiTreeWidgetLabels;
7
+ /** Where this draws, which decides who reads a failure of the source: the author, or only the log. */
8
+ renderMode: PhiRenderableBlockRenderMode;
6
9
  }): import("react").JSX.Element;
@@ -11,6 +11,8 @@ import { PhiButtonControl } from "../../../../../components/controls/phi-button-
11
11
  import { PhiCollectionHeaderControl } from "../../../../../components/controls/phi-collection-header-control";
12
12
  import { PhiToolbarControl } from "../../../../../components/controls/phi-toolbar-control";
13
13
  import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
14
+ import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
15
+ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
14
16
  import { usePhiControlOptionsProvider } from "../../../../../components/controls/phi-options-provider";
15
17
  import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
16
18
  import { clearPhiDataDragPayload, readPhiDataDragPayload, startPhiDataDragAutoScroll, writePhiDataDragPayload, } from "../../../../../components/runtime/client/phi-data-dnd";
@@ -31,7 +33,7 @@ function TreeBindingTool({ field, label, placeholder, presentation, width, sourc
31
33
  });
32
34
  return (_jsx(PhiSelectControl, { label: label, placeholder: placeholder, presentation: presentation, value: typeof value === "string" || typeof value === "number" ? value : undefined, options: options.options, disabled: Boolean(options.warning), size: controlSize, onChange: onChange, style: { width: width ?? 180, minWidth: 0 } }));
33
35
  }
34
- export function PhiTreeWidgetClient({ config, labels }) {
36
+ export function PhiTreeWidgetClient({ config, labels, renderMode }) {
35
37
  const { token } = usePhiConfig();
36
38
  /*
37
39
  * What the reader set, tagged with the configured params it was set against: a Builder edit of those
@@ -183,6 +185,15 @@ export function PhiTreeWidgetClient({ config, labels }) {
183
185
  (config.features.actions?.toolbar?.length ?? 0) > 0 ||
184
186
  hasResettableQuery && tools?.reset !== false ||
185
187
  tools?.reload === true) ? (_jsxs(PhiToolbarControl, { size: controlSize, compact: true, children: [(config.features.actions?.toolbar ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, onActivate: () => activate(action) }, action.key))), (config.features.actions?.selection ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, disabled: binding.selectedNodeIdentities.length === 0, onActivate: () => activate(action) }, action.key))), hasResettableQuery && tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "undo", size: "inherit" }), ariaLabel: labels.reset, size: controlSize, onClick: resetTools })) : null, tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: controlSize, onClick: binding.reload })) : null] })) : null;
188
+ /*
189
+ * The source's failures end the Tree here: a binding that does not hold, a resource the configuration
190
+ * does not fit, a read that failed. A refused change stays in `binding.error` alone, said above the
191
+ * nodes to the person who made it.
192
+ */
193
+ const sourceFailure = binding.bindingError ?? contractError ?? binding.queryError?.message ?? null;
194
+ if (sourceFailure) {
195
+ return (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Tree, title: sourceFailure, error: binding.queryError }));
196
+ }
186
197
  return (_jsxs("div", { style: {
187
198
  display: "flex",
188
199
  flexDirection: "column",
@@ -190,7 +201,7 @@ export function PhiTreeWidgetClient({ config, labels }) {
190
201
  width: config.presentation.width ?? "100%",
191
202
  minWidth: config.presentation.minWidth,
192
203
  maxWidth: config.presentation.maxWidth,
193
- }, children: [_jsx(PhiCollectionHeaderControl, { title: config.presentation.title, description: config.presentation.description, filters: queryControls, toolbar: toolbar }), binding.bindingError || binding.error || contractError ? (_jsx(PhiAlertControl, { level: "error", title: binding.bindingError ?? binding.error?.message ?? contractError ?? undefined })) : null, !binding.loading && !binding.bindingError && !binding.error && !contractError && binding.nodes.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.empty })) : null, _jsx(PhiTreeControl, { nodes: binding.nodes, nodeIdentityPath: binding.resource?.nodeIdentityPath ?? "id", parentNodeIdentityPath: binding.resource?.parentNodeIdentityPath ?? "parentId", presentation: config.presentation, loading: binding.loading, controlSize: controlSize, selectionMode: config.features.selection?.mode, selectedNodeIdentities: binding.selectedNodeIdentities, checkedNodeIdentities: binding.checkedNodeIdentities, checking: config.features.checking?.enabled, checkStrictly: config.features.checking?.strict, expandedNodeIdentities: binding.expandedNodeIdentities, editing: config.features.editing?.enabled, nodeActions: config.features.actions?.node, draggable: canSourceDrag || canReorder, onSelectionChange: (identities) => {
204
+ }, children: [_jsx(PhiCollectionHeaderControl, { title: config.presentation.title, description: config.presentation.description, filters: queryControls, toolbar: toolbar }), binding.error ? _jsx(PhiAlertControl, { level: "error", title: binding.error.message }) : null, !binding.loading && !binding.error && binding.nodes.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.empty })) : null, _jsx(PhiTreeControl, { nodes: binding.nodes, nodeIdentityPath: binding.resource?.nodeIdentityPath ?? "id", parentNodeIdentityPath: binding.resource?.parentNodeIdentityPath ?? "parentId", presentation: config.presentation, loading: binding.loading, controlSize: controlSize, selectionMode: config.features.selection?.mode, selectedNodeIdentities: binding.selectedNodeIdentities, checkedNodeIdentities: binding.checkedNodeIdentities, checking: config.features.checking?.enabled, checkStrictly: config.features.checking?.strict, expandedNodeIdentities: binding.expandedNodeIdentities, editing: config.features.editing?.enabled, nodeActions: config.features.actions?.node, draggable: canSourceDrag || canReorder, onSelectionChange: (identities) => {
194
205
  binding.setSelectedNodeIdentities(identities);
195
206
  emitCapability("selectionChange", identities.map(String));
196
207
  }, onCheckingChange: (identities) => {
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { definePhiPassiveWidgetRenderers } from "../../../../../plugins/factories/widget-renderers";
3
3
  import { phiRuntime } from "../../../../../server-helpers/phi-runtime";
4
+ import { readPhiRuntimeTreeRenderMode } from "../../../render-mode";
4
5
  import { PHI_TREE_WIDGET_DEFINITION } from "./config";
5
6
  import { PhiTreeWidget } from "./server";
6
7
  import { getPhiTreeWidgetLabels } from "../../../../../components/widgets/label-sets/tree";
7
- async function PhiTreeWidgetPluginServer({ config, runtime }) {
8
+ async function PhiTreeWidgetPluginServer({ widget, config, runtime }) {
8
9
  const rt = phiRuntime(runtime);
9
10
  const labels = await getPhiTreeWidgetLabels({ apiBaseUrl: rt.apiBaseUrl, internalToken: rt.internalToken, locale: runtime.locale.current });
10
- return _jsx(PhiTreeWidget, { config: config, labels: labels });
11
+ return _jsx(PhiTreeWidget, { config: config, labels: labels, renderMode: readPhiRuntimeTreeRenderMode(widget.config) });
11
12
  }
12
13
  export const PHI_TREE_WIDGET_PLUGIN = {
13
14
  ...PHI_TREE_WIDGET_DEFINITION,
@@ -1,6 +1,8 @@
1
1
  import type { PhiTreeWidgetConfig } from "../../../../../types";
2
2
  import type { PhiTreeWidgetLabels } from "../../../../../components/widgets/label-types/tree";
3
- export declare function PhiTreeWidget({ config, labels }: {
3
+ import type { PhiRenderableBlockRenderMode } from "../../../../../types/renderable-block";
4
+ export declare function PhiTreeWidget({ config, labels, renderMode }: {
4
5
  config: PhiTreeWidgetConfig;
5
6
  labels: PhiTreeWidgetLabels;
7
+ renderMode: PhiRenderableBlockRenderMode;
6
8
  }): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
3
3
  import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
4
- export function PhiTreeWidget({ config, labels }) {
5
- return _jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Tree, componentProps: { config, labels } });
4
+ export function PhiTreeWidget({ config, labels, renderMode }) {
5
+ return _jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Tree, componentProps: { config, labels, renderMode } });
6
6
  }
@@ -1,5 +1,7 @@
1
- import { type PhiDashboardCardPayload, type PhiDashboardCardRow } from "../../../types/dashboard-cards";
1
+ import { type PhiDashboardCardPayload, type PhiDashboardCardSeries, type PhiDashboardCardRow } from "../../../types/dashboard-cards";
2
2
  /** The card rows a list answer carries, or a Collection holds. */
3
3
  export declare function readPhiDashboardCardRows(value: unknown, source?: string): PhiDashboardCardRow[];
4
4
  /** One card's refreshed payload. */
5
5
  export declare function readPhiDashboardCardPayload(value: unknown): PhiDashboardCardPayload;
6
+ /** The latest figure of the first series: the headline of a `series` card whose provider states none. */
7
+ export declare function readPhiDashboardSeriesHeadline(series: PhiDashboardCardSeries, locale: string): string | undefined;
@@ -9,16 +9,38 @@ import { createPhiResponseReader, requirePhiField, } from "../../../components/w
9
9
  * shape rendered as an empty card. Read field by field now, a wrong answer is an error naming the field,
10
10
  * which the Collection shows as the card list's error.
11
11
  */
12
- const PHI_DASHBOARD_CARD_FORMS = ["stat", "list"];
12
+ const PHI_DASHBOARD_CARD_FORMS = ["stat", "list", "series"];
13
13
  function readCardId(reader) {
14
14
  return requirePhiField(reader, "cardId", "a Dashboard card id", (key) => reader.value(key, "a Dashboard card id", (value) => (isPhiDashboardCardId(value) ? value : undefined)));
15
15
  }
16
16
  function readTimelineEntry(reader, index) {
17
17
  return readPhiTimelineEntry(reader.record) ?? reader.fail(String(index), "a timeline entry with a key", reader.record);
18
18
  }
19
+ /*
20
+ * A series is read whole: a point with one value too few would draw a line that drops to nothing on the
21
+ * day it lost, which looks like data. So each point states a finite number for every label, or the payload
22
+ * is an error naming the point.
23
+ */
24
+ function readSeries(reader) {
25
+ const labels = requirePhiField(reader, "labels", "a list of series labels", reader.stringList);
26
+ if (labels.length === 0) {
27
+ reader.fail("labels", "at least one series label", labels);
28
+ }
29
+ const points = requirePhiField(reader, "points", "a list of points", (key) => reader.list(key, (point) => ({
30
+ at: requirePhiField(point, "at", "an ISO date or instant", point.string),
31
+ values: requirePhiField(point, "values", `${labels.length} finite numbers, one per label`, (valuesKey) => point.value(valuesKey, `${labels.length} finite numbers, one per label`, (value) => Array.isArray(value)
32
+ && value.length === labels.length
33
+ && value.every((entry) => typeof entry === "number" && Number.isFinite(entry))
34
+ ? value
35
+ : undefined)),
36
+ })));
37
+ const unit = reader.string("unit");
38
+ return { labels, points, ...(unit === undefined ? {} : { unit }) };
39
+ }
19
40
  function readPayloadFields(reader) {
20
41
  const value = reader.string("value");
21
42
  const entries = reader.list("entries", readTimelineEntry);
43
+ const series = reader.object("series", readSeries);
22
44
  const description = reader.string("description");
23
45
  const meta = reader.string("meta");
24
46
  const error = reader.string("error");
@@ -26,6 +48,7 @@ function readPayloadFields(reader) {
26
48
  cardId: readCardId(reader),
27
49
  ...(value === undefined ? {} : { value }),
28
50
  ...(entries === undefined ? {} : { entries }),
51
+ ...(series === undefined ? {} : { series }),
29
52
  ...(description === undefined ? {} : { description }),
30
53
  ...(meta === undefined ? {} : { meta }),
31
54
  ...(error === undefined ? {} : { error }),
@@ -40,7 +63,7 @@ function readRowFields(reader) {
40
63
  const payload = reader.object("payload", readPayloadFields);
41
64
  return {
42
65
  cardId: readCardId(reader),
43
- form: requirePhiField(reader, "form", '"stat" or "list"', (key) => reader.oneOf(key, PHI_DASHBOARD_CARD_FORMS)),
66
+ form: requirePhiField(reader, "form", '"stat", "list" or "series"', (key) => reader.oneOf(key, PHI_DASHBOARD_CARD_FORMS)),
44
67
  title: requirePhiField(reader, "title", "a text", reader.string),
45
68
  ...(eyebrow === undefined ? {} : { eyebrow }),
46
69
  ...(description === undefined ? {} : { description }),
@@ -57,3 +80,8 @@ export function readPhiDashboardCardRows(value, source = "The Dashboard card lis
57
80
  export function readPhiDashboardCardPayload(value) {
58
81
  return readPayloadFields(createPhiResponseReader(value, "The Dashboard card"));
59
82
  }
83
+ /** The latest figure of the first series: the headline of a `series` card whose provider states none. */
84
+ export function readPhiDashboardSeriesHeadline(series, locale) {
85
+ const latest = series.points[series.points.length - 1]?.values[0];
86
+ return latest === undefined ? undefined : new Intl.NumberFormat(locale).format(latest);
87
+ }
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useEffect, useMemo, useState } from "react";
4
4
  import { readPhiTimelineEntries } from "@phis/contracts/timeline";
5
- import { PHI_DASHBOARD_CARD_LIST_LIMIT, } from "../../../../types/dashboard-cards";
5
+ import { PHI_DASHBOARD_CARD_LIST_LIMIT, PHI_DASHBOARD_CARD_SERIES_LIMIT, } from "../../../../types/dashboard-cards";
6
6
  import { PhiCardWidgetClient } from "../../../../components/widgets/shared/card-body-client";
7
7
  import {} from "../../../../components/widgets/shared/card-vocabulary";
8
8
  import { PHI_SURFACE_CARD } from "../../../../helpers/surface-presets";
@@ -10,10 +10,11 @@ import { PhiCollectionViewControl } from "../../../../components/controls/phi-co
10
10
  import { PhiAlertControl } from "../../../../components/controls/phi-alert-control";
11
11
  import { PhiEmptyControl } from "../../../../components/controls/phi-empty-control";
12
12
  import { usePhiPathname } from "../../../../components/runtime/use-phi-pathname";
13
- import { readPhiDashboardCardPayload, readPhiDashboardCardRows } from "../card-rows";
13
+ import { readPhiDashboardCardPayload, readPhiDashboardCardRows, readPhiDashboardSeriesHeadline, } from "../card-rows";
14
14
  import { PhiTimelineControl } from "../../../../components/controls/phi-timeline-control";
15
+ import { PhiSeriesChartControl } from "../../../../components/controls/phi-series-chart-control";
15
16
  import { usePhiIntlLocale } from "../../../../components/root/phi-intl-locale";
16
- import { formatPhiRelativeTime } from "../../../../helpers/format-date-time";
17
+ import { formatPhiDate, formatPhiRelativeTime } from "../../../../helpers/format-date-time";
17
18
  /**
18
19
  * A Dashboard, drawn.
19
20
  *
@@ -33,8 +34,7 @@ const CARD_MIN_COLUMN_WIDTH = 260;
33
34
  * A Module's form, and the Core body that draws it.
34
35
  *
35
36
  * Two vocabularies that agree today, and deliberately not one type. `form` is what a Module
36
- * declares about its contribution; `body` is what Core draws. They agree now and are allowed to stop:
37
- * a `series` form would reasonably draw in whatever body Core has for a graphic, under another name.
37
+ * declares about its contribution; `body` is what Core draws. They agree now and are allowed to stop.
38
38
  *
39
39
  * A total map rather than a condition, so a form that joins the vocabulary stops this file compiling
40
40
  * instead of quietly falling back to a heading.
@@ -42,6 +42,7 @@ const CARD_MIN_COLUMN_WIDTH = 260;
42
42
  const CARD_BODY_BY_FORM = {
43
43
  stat: "stat",
44
44
  list: "list",
45
+ series: "series",
45
46
  };
46
47
  /**
47
48
  * A `list` card's entries as the Timeline draws them: the first few, each time in the page's locale.
@@ -62,6 +63,24 @@ function PhiDashboardCardList({ entries }) {
62
63
  ...(entry.pending ? { pending: true } : {}),
63
64
  })) }));
64
65
  }
66
+ /*
67
+ * A point's day as the calendar day it names. An ISO date read by `Date` is midnight in UTC, which is
68
+ * the day before west of Greenwich; an instant is formatted where the reader is.
69
+ */
70
+ function formatSeriesKey(at, locale) {
71
+ return /^\d{4}-\d{2}-\d{2}$/.test(at)
72
+ ? new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeZone: "UTC" }).format(new Date(`${at}T00:00:00Z`))
73
+ : formatPhiDate(at, locale);
74
+ }
75
+ /**
76
+ * A `series` card's chart: its first few series over every point, each day in the page's locale. Drawn
77
+ * here and handed to the card, as a list is, so a Card on a Public page never loads the chart Control.
78
+ */
79
+ function PhiDashboardCardSeriesChart({ series, title }) {
80
+ const locale = usePhiIntlLocale();
81
+ const labels = series.labels.slice(0, PHI_DASHBOARD_CARD_SERIES_LIMIT);
82
+ return (_jsx(PhiSeriesChartControl, { locale: locale, title: title, keys: series.points.map((point) => formatSeriesKey(point.at, locale)), series: labels.map((label, index) => ({ label, values: series.points.map((point) => point.values[index]) })), ...(series.unit ? { unit: series.unit } : {}) }));
83
+ }
65
84
  function readRows(binding) {
66
85
  // A Collection holds items of no particular type; the rows are read again, not cast.
67
86
  return readPhiDashboardCardRows(binding.data?.items ?? [], "The Dashboard Collection");
@@ -84,6 +103,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
84
103
  * says the same thing by comparison: an answer to a question no longer being asked is simply not this
85
104
  * card's answer.
86
105
  */
106
+ const locale = usePhiIntlLocale();
87
107
  const requestKey = `${area}\u0000${pathname}\u0000${row.cardId}`;
88
108
  const delivered = row.payload ?? null;
89
109
  const [resolved, setResolved] = useState(null);
@@ -125,6 +145,8 @@ function PhiDashboardCard({ row, area, pathname, }) {
125
145
  const payload = current?.payload ?? null;
126
146
  const error = current?.failure ?? payload?.error ?? null;
127
147
  const entries = row.form === "list" ? readPhiTimelineEntries(payload?.entries) : [];
148
+ const series = row.form === "series" ? payload?.series ?? null : null;
149
+ const value = payload?.value ?? (series ? readPhiDashboardSeriesHeadline(series, locale) : undefined);
128
150
  return (_jsx(PhiCardWidgetClient, { labels: {
129
151
  ...(row.eyebrow ? { eyebrow: row.eyebrow } : {}),
130
152
  /*
@@ -135,7 +157,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
135
157
  * screen together and the card reads the same before and after it resolves.
136
158
  */
137
159
  title: row.title,
138
- ...(payload?.value ? { value: payload.value } : {}),
160
+ ...(value ? { value } : {}),
139
161
  ...(payload?.description ?? row.description
140
162
  ? { description: payload?.description ?? row.description }
141
163
  : {}),
@@ -152,7 +174,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
152
174
  * this; that this file still does is what will move to a Controller when the Dashboard gets a
153
175
  * clock (DASHBOARD.md section 4).
154
176
  */
155
- binding: { loading: current === null, error }, listContent: entries.length > 0 ? _jsx(PhiDashboardCardList, { entries: entries }) : null }));
177
+ binding: { loading: current === null, error }, listContent: series ? (_jsx(PhiDashboardCardSeriesChart, { series: series, title: row.title })) : entries.length > 0 ? _jsx(PhiDashboardCardList, { entries: entries }) : null }));
156
178
  }
157
179
  export function PhiDashboardCardCollectionViewBinding({ config, binding, widgetId, }) {
158
180
  void widgetId;
@@ -1,25 +1,19 @@
1
1
  import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-id";
2
2
  import { PHI_DASHBOARD_RUNTIME_MODULE_ID } from "../ids";
3
- import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
4
- import { PhiCmsFlags, PhiCmsPageType, PhiCmsRegionType } from "../../../../constants/phi-cms";
3
+ import { PhiCmsPageType } from "../../../../constants/phi-cms";
5
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
6
- import { resolvePhiShellHeaderHeight } from "../../../../helpers/shell-region-style";
7
5
  import { buildPhiBasePageContentScaffold } from "../../../../components/regions/presets/phi-base-page-layout";
8
6
  import { getPhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-sets/builder-chrome";
9
7
  import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
10
8
  import { buildPhiDashboardCardsWidget } from "./dashboard-cards-page-tree";
11
9
  import { getPhiDashboardCardsEmptyDescription } from "./area-dashboard-label-set";
10
+ /*
11
+ * No Header bottom band: the Dashboard has no commands -- nothing to save, preview or publish -- and the
12
+ * band stood empty under the title.
13
+ */
12
14
  const SYNTHETIC_BUILDER_DASHBOARD_REGION_IDS = {
13
- regionHeaderBottom: -580,
14
15
  regionContent: -581,
15
16
  };
16
- const SYNTHETIC_BUILDER_DASHBOARD_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap({
17
- domain: "page",
18
- ownerModuleId: PHI_DASHBOARD_RUNTIME_MODULE_ID,
19
- presetKey: "builder-dashboard-page",
20
- }, [
21
- "layoutHeaderBottom",
22
- ]);
23
17
  const SYNTHETIC_BUILDER_DASHBOARD_WIDGET_IDS = createPhiPresetCmsInstanceIdMap({
24
18
  domain: "page",
25
19
  ownerModuleId: PHI_DASHBOARD_RUNTIME_MODULE_ID,
@@ -56,38 +50,9 @@ export async function buildPhiDefaultBuilderDashboardPageTree({ page, runtime, }
56
50
  },
57
51
  overlays: [],
58
52
  regions: [
59
- nodes.region({
60
- id: SYNTHETIC_BUILDER_DASHBOARD_REGION_IDS.regionHeaderBottom,
61
- regionType: PhiCmsRegionType.HeaderBottom,
62
- rootLayoutNodeId: SYNTHETIC_BUILDER_DASHBOARD_LAYOUT_IDS.layoutHeaderBottom,
63
- sortOrder: 25,
64
- config: {
65
- flags: PhiCmsFlags.Sticky,
66
- /*
67
- * No Effect or Shadow of its own, like every other Builder Header. A `glass` authored here
68
- * frosts this one Region against the Site's Shell Chrome Overlay, so the Dashboard's Header
69
- * stopped matching the Sider and Footer beside it. What the frame looks like belongs to the Theme.
70
- */
71
- size: { height: `${resolvePhiShellHeaderHeight(runtime.site.theme?.shell, "bottom")}px` },
72
- offsetTop: resolvePhiShellHeaderHeight(runtime.site.theme?.shell, "main"),
73
- },
74
- }),
75
53
  scaffold.region,
76
54
  ],
77
55
  layoutNodes: [
78
- nodes.layout({
79
- creationPreset: { layoutKind: "threecol", preset: "panel" },
80
- typeKey: "three-column",
81
- id: SYNTHETIC_BUILDER_DASHBOARD_LAYOUT_IDS.layoutHeaderBottom,
82
- parentLayoutNodeId: null,
83
- slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
84
- sortOrder: 0,
85
- label: "builder dashboard header bottom",
86
- config: {
87
- balancedSides: true,
88
- contentAlign: "center",
89
- },
90
- }),
91
56
  scaffold.layoutNode,
92
57
  ],
93
58
  contentWidgets: [
@@ -1,7 +1,7 @@
1
1
  export declare const PHI_THEME_RUNTIME_MODULE_ROUTES: {
2
2
  tour: {
3
3
  readonly id: "@phis/ui/modules/theme/workspace";
4
- readonly version: 1;
4
+ readonly version: 2;
5
5
  readonly steps: readonly [{
6
6
  readonly key: "theme-choice";
7
7
  readonly target: `cms:${import("@phis/contracts/cms").PhiCmsInstanceId}`;
@@ -22,6 +22,14 @@ export declare const PHI_THEME_RUNTIME_MODULE_ROUTES: {
22
22
  readonly placement: "right";
23
23
  readonly prepare: readonly [import("../../../types").PhiTourStepSignal];
24
24
  readonly release: readonly [import("../../../types").PhiTourStepSignal];
25
+ }, {
26
+ readonly key: "gradients";
27
+ readonly target: `cms:${import("@phis/contracts/cms").PhiCmsInstanceId}:gradients`;
28
+ readonly title: "Three gradients";
29
+ readonly description: "Below the colours, three runs that Buttons, badges, ribbons, tags and switches can be filled with: the brand, an accent and one for the chrome. Each starts from the palette's colours and follows them until you set its stops and direction yourself, separately for light and dark. Its labels take the theme's light or dark text, whichever reads better unless you choose; the preview shows a Button, its hover and a badge, and a note says where a label would read poorly.";
30
+ readonly placement: "right";
31
+ readonly prepare: readonly [import("../../../types").PhiTourStepSignal];
32
+ readonly release: readonly [import("../../../types").PhiTourStepSignal];
25
33
  }, {
26
34
  readonly key: string;
27
35
  readonly target: `cms:${import("@phis/contracts/cms").PhiCmsInstanceId}`;
@@ -9,7 +9,7 @@ import type { PhiTourStepSignal } from "../../../types/tours";
9
9
  */
10
10
  export declare const PHI_THEME_WORKSPACE_TOUR: {
11
11
  readonly id: "@phis/ui/modules/theme/workspace";
12
- readonly version: 1;
12
+ readonly version: 2;
13
13
  readonly steps: readonly [{
14
14
  readonly key: "theme-choice";
15
15
  readonly target: `cms:${PhiCmsInstanceId}`;
@@ -30,6 +30,14 @@ export declare const PHI_THEME_WORKSPACE_TOUR: {
30
30
  readonly placement: "right";
31
31
  readonly prepare: readonly [PhiTourStepSignal];
32
32
  readonly release: readonly [PhiTourStepSignal];
33
+ }, {
34
+ readonly key: "gradients";
35
+ readonly target: `cms:${PhiCmsInstanceId}:gradients`;
36
+ readonly title: "Three gradients";
37
+ readonly description: "Below the colours, three runs that Buttons, badges, ribbons, tags and switches can be filled with: the brand, an accent and one for the chrome. Each starts from the palette's colours and follows them until you set its stops and direction yourself, separately for light and dark. Its labels take the theme's light or dark text, whichever reads better unless you choose; the preview shows a Button, its hover and a badge, and a note says where a label would read poorly.";
38
+ readonly placement: "right";
39
+ readonly prepare: readonly [PhiTourStepSignal];
40
+ readonly release: readonly [PhiTourStepSignal];
33
41
  }, {
34
42
  readonly key: string;
35
43
  readonly target: `cms:${PhiCmsInstanceId}`;
@@ -36,7 +36,7 @@ function panelStep(key, slot, controls, title, description) {
36
36
  */
37
37
  export const PHI_THEME_WORKSPACE_TOUR = {
38
38
  id: `${PHI_THEME_RUNTIME_MODULE_ID}/workspace`,
39
- version: 1,
39
+ version: 2,
40
40
  steps: [
41
41
  {
42
42
  key: "theme-choice",
@@ -53,6 +53,15 @@ export const PHI_THEME_WORKSPACE_TOUR = {
53
53
  placement: "bottom",
54
54
  },
55
55
  panelStep("color", 0, PHI_THEME_PAGE_WIDGET_IDS.widgetBrandThemeControls, "Colour from a few seeds", "A palette is picked whole, or each colour is set on its own. Every colour is a seed: Primary, Info, Success, Warning, Error, Link, the text and the background each grow into the shades for hover, borders and backgrounds, and Custom grows into ten steps of its own."),
56
+ {
57
+ key: "gradients",
58
+ target: `cms:${PHI_THEME_PAGE_WIDGET_IDS.widgetBrandThemeControls}:gradients`,
59
+ title: "Three gradients",
60
+ description: "Below the colours, three runs that Buttons, badges, ribbons, tags and switches can be filled with: the brand, an accent and one for the chrome. Each starts from the palette's colours and follows them until you set its stops and direction yourself, separately for light and dark. Its labels take the theme's light or dark text, whichever reads better unless you choose; the preview shows a Button, its hover and a badge, and a note says where a label would read poorly.",
61
+ placement: "right",
62
+ prepare: [showPanel(0)],
63
+ release: [showPanel(0)],
64
+ },
56
65
  panelStep("style", 1, PHI_THEME_PAGE_WIDGET_IDS.widgetBrandStyleControls, "Buttons and corners", "A shape sets the corners at once -- square, subtle, rounded or pill -- for buttons and fields alike. Below it the details: the buttons' shadows, the corner radius in three sizes, how tall controls are, and the fonts and their size."),
57
66
  panelStep("background", 2, PHI_THEME_PAGE_WIDGET_IDS.widgetBrandBackgroundControls, "Behind everything", "The root background is one layer behind the whole Site: a colour, a gradient or an image, still or in parallax, with an overlay of colour, pattern or noise on top. The chrome overlay is a second ground the header, the sider and the footer share, and the chrome shadow sets how they cast onto the Page. Each is set for light and dark."),
58
67
  panelStep("brand", 3, PHI_THEME_PAGE_WIDGET_IDS.widgetBrandIdentityControls, "The Site's own marks", "The logo, one per mode, and where a click on it leads; the wordmark, the Site's name in type; and the two short lines the Brand shows beside them."),