@phis/ui 0.4.4 → 0.4.6

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 (238) 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 +31 -2
  5. package/components/controls/phi-background-control.d.ts +6 -1
  6. package/components/controls/phi-background-control.js +12 -4
  7. package/components/controls/phi-button-control.d.ts +15 -1
  8. package/components/controls/phi-button-control.js +21 -3
  9. package/components/controls/phi-collapse-control.d.ts +6 -2
  10. package/components/controls/phi-collapse-control.js +2 -2
  11. package/components/controls/phi-dialog-control.d.ts +11 -5
  12. package/components/controls/phi-dialog-control.js +19 -13
  13. package/components/controls/phi-dropdown-control.js +2 -2
  14. package/components/controls/phi-media-asset-tile-control.js +10 -10
  15. package/components/controls/phi-menu-control-vocabulary.d.ts +7 -0
  16. package/components/controls/phi-menu-control-vocabulary.js +10 -0
  17. package/components/controls/phi-menu-control.d.ts +4 -1
  18. package/components/controls/phi-menu-control.js +6 -1
  19. package/components/controls/phi-progress-control.d.ts +10 -2
  20. package/components/controls/phi-progress-control.js +6 -2
  21. package/components/controls/phi-ribbon-control.d.ts +4 -1
  22. package/components/controls/phi-ribbon-control.js +5 -3
  23. package/components/controls/phi-ribbon-wrap-control.d.ts +7 -1
  24. package/components/controls/phi-ribbon-wrap-control.js +8 -2
  25. package/components/controls/phi-segmented-control.d.ts +4 -1
  26. package/components/controls/phi-segmented-control.js +13 -2
  27. package/components/controls/phi-surface-control.d.ts +2 -0
  28. package/components/controls/phi-surface-control.js +16 -1
  29. package/components/controls/phi-switch-control.d.ts +4 -1
  30. package/components/controls/phi-switch-control.js +8 -2
  31. package/components/controls/phi-tag-control.d.ts +4 -1
  32. package/components/controls/phi-tag-control.js +11 -3
  33. package/components/layouts/clients/phi-split-card-layout-client.js +13 -5
  34. package/components/layouts/clients/phi-three-column-layout-client.js +9 -3
  35. package/components/layouts/phi-layout-view-model.js +10 -1
  36. package/components/layouts/split-card-geometry.js +6 -2
  37. package/components/media/aspect-ratios.d.ts +2 -2
  38. package/components/menus/phi-account-menu.js +3 -1
  39. package/components/navigation/phi-link.js +7 -2
  40. package/components/navigation/use-phi-protected-mail.d.ts +11 -0
  41. package/components/navigation/use-phi-protected-mail.js +29 -0
  42. package/components/regions/clients/cms-region-container-client.js +16 -2
  43. package/components/regions/phi-cms-region-container.js +5 -1
  44. package/components/regions/phi-cms-region-shell.d.ts +11 -0
  45. package/components/regions/phi-cms-region-shell.js +64 -7
  46. package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -1
  47. package/components/root/phi-config-provider.js +16 -0
  48. package/components/root/phi-root-layout.d.ts +1 -0
  49. package/components/root/phi-root-layout.js +1 -0
  50. package/components/root/phi-root-theme-resolver.js +12 -1
  51. package/components/root/phi-shell-chrome-overlay.d.ts +6 -0
  52. package/components/root/phi-shell-chrome-overlay.js +7 -1
  53. package/components/runtime/runtime-module-context.d.ts +12 -1
  54. package/components/runtime/runtime-module-context.js +6 -1
  55. package/components/shell/phi-cms-shell.d.ts +9 -1
  56. package/components/shell/phi-cms-shell.js +10 -4
  57. package/components/shell/phi-nav-link.js +7 -2
  58. package/components/shell/phi-shell-sider-drawer.d.ts +17 -0
  59. package/components/shell/phi-shell-sider-drawer.js +88 -0
  60. package/components/shell/use-phi-shell-header-bands.d.ts +5 -0
  61. package/components/shell/use-phi-shell-header-bands.js +64 -0
  62. package/components/shell/use-phi-shell-sticky-bottom.d.ts +18 -0
  63. package/components/shell/use-phi-shell-sticky-bottom.js +54 -0
  64. package/components/tables/client/phi-table-binding.d.ts +1 -0
  65. package/components/tables/client/phi-table-binding.js +22 -3
  66. package/components/trees/client/phi-tree-binding.d.ts +1 -0
  67. package/components/trees/client/phi-tree-binding.js +11 -2
  68. package/components/widgets/client/shared/phi-collection-provider.js +4 -3
  69. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  70. package/components/widgets/client/shared/phi-collection-view-binding.js +16 -2
  71. package/components/widgets/client/shared/phi-command-buttons.js +6 -2
  72. package/components/widgets/config/background.d.ts +20 -0
  73. package/components/widgets/config/background.js +44 -2
  74. package/components/widgets/config/button-variant.d.ts +22 -4
  75. package/components/widgets/config/button-variant.js +24 -5
  76. package/components/widgets/config/common-action-field.d.ts +1 -1
  77. package/components/widgets/config/parser-primitives.js +4 -2
  78. package/components/widgets/config/theme-gradient.d.ts +11 -0
  79. package/components/widgets/config/theme-gradient.js +12 -0
  80. package/components/widgets/helpers/internal-reference-resolver.server.d.ts +1 -0
  81. package/components/widgets/helpers/internal-reference-resolver.server.js +4 -1
  82. package/components/widgets/label-sets/background.js +2 -0
  83. package/components/widgets/label-sets/geometry.js +2 -0
  84. package/components/widgets/label-sets/inspector.js +6 -0
  85. package/components/widgets/label-types/background.d.ts +1 -0
  86. package/components/widgets/label-types/background.js +1 -0
  87. package/components/widgets/label-types/common-controls.js +2 -2
  88. package/components/widgets/label-types/geometry.d.ts +1 -0
  89. package/components/widgets/label-types/geometry.js +1 -0
  90. package/components/widgets/label-types/inspector.d.ts +6 -0
  91. package/components/widgets/label-types/inspector.js +3 -0
  92. package/components/widgets/server/navigation-request.js +13 -1
  93. package/components/widgets/shared/card-body-client.d.ts +13 -0
  94. package/components/widgets/shared/card-body-client.js +40 -11
  95. package/components/widgets/shared/card-vocabulary.d.ts +36 -0
  96. package/components/widgets/shared/card-vocabulary.js +52 -0
  97. package/components/widgets/shared/collection-source-failure.d.ts +26 -0
  98. package/components/widgets/shared/collection-source-failure.js +42 -0
  99. package/components/widgets/shared/markdown-body-client.d.ts +29 -0
  100. package/components/widgets/shared/markdown-body-client.js +60 -5
  101. package/components/widgets/shared/markdown-image-vocabulary.d.ts +31 -0
  102. package/components/widgets/shared/markdown-image-vocabulary.js +68 -0
  103. package/components/widgets/shared/markdown-render.d.ts +5 -0
  104. package/components/widgets/shared/markdown-render.js +139 -11
  105. package/components/widgets/shared/markdown-sections.d.ts +40 -0
  106. package/components/widgets/shared/markdown-sections.js +111 -0
  107. package/components/widgets/shared/widget-failure-client.d.ts +10 -0
  108. package/components/widgets/shared/widget-failure-client.js +20 -0
  109. package/components/widgets/shared/widget-failure.d.ts +31 -0
  110. package/components/widgets/shared/widget-failure.js +20 -0
  111. package/components/widgets/shared/widget-failure.server.d.ts +9 -0
  112. package/components/widgets/shared/widget-failure.server.js +12 -0
  113. package/gateway/dashboard-card-memo.d.ts +3 -0
  114. package/gateway/dashboard-card-memo.js +25 -0
  115. package/helpers/cms-region-keys.d.ts +1 -1
  116. package/helpers/external-href.js +1 -1
  117. package/helpers/layout-style.d.ts +8 -4
  118. package/helpers/layout-style.js +3 -2
  119. package/helpers/mode-paint.d.ts +4 -0
  120. package/helpers/mode-paint.js +47 -0
  121. package/helpers/protected-mail.d.ts +16 -0
  122. package/helpers/protected-mail.js +81 -0
  123. package/helpers/surface-style.js +33 -11
  124. package/module-dashboard-cards.d.ts +1 -0
  125. package/module-dashboard-cards.js +1 -0
  126. package/module-records.d.ts +7 -0
  127. package/module-records.js +6 -0
  128. package/package.json +2 -2
  129. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +1 -1
  130. package/plugins/runtime-modules/builder/clients/inspector-surface-labels.js +1 -0
  131. package/plugins/runtime-modules/builder/clients/region-inspector.js +67 -3
  132. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
  133. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +7 -4
  134. package/plugins/runtime-modules/builder/controller/page-controller.js +7 -0
  135. package/plugins/runtime-modules/builder/persistence.d.ts +3 -0
  136. package/plugins/runtime-modules/builder/persistence.js +9 -1
  137. package/plugins/runtime-modules/core/content-entries/record-source.server.d.ts +3 -1
  138. package/plugins/runtime-modules/core/content-entries/record-source.server.js +7 -4
  139. package/plugins/runtime-modules/core/widgets/button/client.js +2 -2
  140. package/plugins/runtime-modules/core/widgets/button/config.d.ts +40 -4
  141. package/plugins/runtime-modules/core/widgets/button/config.js +12 -0
  142. package/plugins/runtime-modules/core/widgets/card/config.d.ts +102 -1
  143. package/plugins/runtime-modules/core/widgets/card/config.js +60 -1
  144. package/plugins/runtime-modules/core/widgets/card/editor.js +17 -2
  145. package/plugins/runtime-modules/core/widgets/card/server.js +13 -1
  146. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.d.ts +4 -1
  147. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -3
  148. package/plugins/runtime-modules/core/widgets/collection-view/authoring.js +1 -1
  149. package/plugins/runtime-modules/core/widgets/collection-view/client.d.ts +3 -0
  150. package/plugins/runtime-modules/core/widgets/collection-view/client.js +47 -11
  151. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +4 -1
  152. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
  153. package/plugins/runtime-modules/core/widgets/collection-view/plugin.js +3 -2
  154. package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +6 -1
  155. package/plugins/runtime-modules/core/widgets/collection-view/server.js +21 -3
  156. package/plugins/runtime-modules/core/widgets/entry-detail/plugin.js +1 -1
  157. package/plugins/runtime-modules/core/widgets/entry-detail/server.d.ts +3 -1
  158. package/plugins/runtime-modules/core/widgets/entry-detail/server.js +5 -2
  159. package/plugins/runtime-modules/core/widgets/entry-header/plugin.js +1 -1
  160. package/plugins/runtime-modules/core/widgets/entry-header/server.d.ts +3 -1
  161. package/plugins/runtime-modules/core/widgets/entry-header/server.js +5 -2
  162. package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -1
  163. package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +6 -3
  164. package/plugins/runtime-modules/core/widgets/entry-list/server.js +13 -6
  165. package/plugins/runtime-modules/core/widgets/entry-list/view.server.js +2 -1
  166. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +3 -3
  167. package/plugins/runtime-modules/core/widgets/gallery/plugin.js +1 -1
  168. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -3
  169. package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -6
  170. package/plugins/runtime-modules/core/widgets/header-navigation/client.d.ts +6 -1
  171. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +40 -13
  172. package/plugins/runtime-modules/core/widgets/header-navigation/config.d.ts +26 -1
  173. package/plugins/runtime-modules/core/widgets/header-navigation/config.js +27 -0
  174. package/plugins/runtime-modules/core/widgets/header-navigation/plugin.js +1 -1
  175. package/plugins/runtime-modules/core/widgets/header-navigation/server.d.ts +2 -2
  176. package/plugins/runtime-modules/core/widgets/header-navigation/server.js +3 -1
  177. package/plugins/runtime-modules/core/widgets/image/client.js +11 -7
  178. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +16 -0
  179. package/plugins/runtime-modules/core/widgets/markdown/config.js +46 -1
  180. package/plugins/runtime-modules/core/widgets/markdown/server.js +22 -8
  181. package/plugins/runtime-modules/core/widgets/record/client.d.ts +4 -1
  182. package/plugins/runtime-modules/core/widgets/record/client.js +8 -3
  183. package/plugins/runtime-modules/core/widgets/record/plugin.js +3 -2
  184. package/plugins/runtime-modules/core/widgets/record/server.d.ts +3 -1
  185. package/plugins/runtime-modules/core/widgets/record/server.js +2 -2
  186. package/plugins/runtime-modules/core/widgets/segmented/client.js +1 -1
  187. package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +21 -1
  188. package/plugins/runtime-modules/core/widgets/segmented/config.js +11 -1
  189. package/plugins/runtime-modules/core/widgets/simple-text/server.js +11 -1
  190. package/plugins/runtime-modules/core/widgets/switch/client.js +1 -1
  191. package/plugins/runtime-modules/core/widgets/switch/config.d.ts +19 -0
  192. package/plugins/runtime-modules/core/widgets/switch/config.js +11 -0
  193. package/plugins/runtime-modules/core/widgets/table/authoring.js +1 -1
  194. package/plugins/runtime-modules/core/widgets/table/client.d.ts +4 -1
  195. package/plugins/runtime-modules/core/widgets/table/client.js +16 -3
  196. package/plugins/runtime-modules/core/widgets/table/plugin.js +3 -2
  197. package/plugins/runtime-modules/core/widgets/table/server.d.ts +3 -1
  198. package/plugins/runtime-modules/core/widgets/table/server.js +2 -2
  199. package/plugins/runtime-modules/core/widgets/table/static-resource-editor.js +2 -1
  200. package/plugins/runtime-modules/core/widgets/timeline/authoring.js +1 -1
  201. package/plugins/runtime-modules/core/widgets/timeline/client.d.ts +1 -3
  202. package/plugins/runtime-modules/core/widgets/timeline/client.js +14 -4
  203. package/plugins/runtime-modules/core/widgets/tree/authoring.js +1 -1
  204. package/plugins/runtime-modules/core/widgets/tree/client.d.ts +4 -1
  205. package/plugins/runtime-modules/core/widgets/tree/client.js +13 -2
  206. package/plugins/runtime-modules/core/widgets/tree/plugin.js +3 -2
  207. package/plugins/runtime-modules/core/widgets/tree/server.d.ts +3 -1
  208. package/plugins/runtime-modules/core/widgets/tree/server.js +2 -2
  209. package/plugins/runtime-modules/theme/presets.d.ts +9 -1
  210. package/plugins/runtime-modules/theme/tour.d.ts +9 -1
  211. package/plugins/runtime-modules/theme/tour.js +10 -1
  212. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +138 -7
  213. package/runtime-data-provider-client.d.ts +2 -0
  214. package/runtime-data-provider-client.js +7 -0
  215. package/styles/controls.css +118 -15
  216. package/styles/gradients.css +101 -0
  217. package/styles/layout.css +35 -0
  218. package/styles/root.css +18 -0
  219. package/styles/shell.css +206 -0
  220. package/theme/phi-button-shadow.d.ts +6 -0
  221. package/theme/phi-theme-gradients.d.ts +96 -0
  222. package/theme/phi-theme-gradients.js +245 -0
  223. package/theme/phi-theme-presets.d.ts +3 -0
  224. package/theme/phi-theme-presets.js +3 -0
  225. package/theme/phi-theme-tokens.d.ts +5 -1
  226. package/theme/phi-theme-tokens.js +14 -0
  227. package/theme/phi-tokens.d.ts +6 -0
  228. package/theme/phi-tokens.js +6 -0
  229. package/theme.d.ts +1 -0
  230. package/theme.js +6 -0
  231. package/types/cms-presets.d.ts +7 -0
  232. package/types/core-widget-placements.d.ts +8 -0
  233. package/types/layout-style.d.ts +9 -8
  234. package/types/layout-style.js +9 -8
  235. package/types/surface.d.ts +4 -0
  236. package/types/surface.js +4 -0
  237. package/types.d.ts +1 -1
  238. package/types.js +1 -1
@@ -1,3 +1,4 @@
1
+ import { type PhiThemeGradientKey } from "../../../../../theme/phi-theme-gradients";
1
2
  import { type PhiControlConfig } from "../../../../../components/widgets/config/control-signal-config";
2
3
  type PhiSwitchControlSize = "small" | "medium";
3
4
  export type PhiSwitchWidgetConfig = PhiControlConfig<PhiSwitchControlSize> & {
@@ -5,6 +6,8 @@ export type PhiSwitchWidgetConfig = PhiControlConfig<PhiSwitchControlSize> & {
5
6
  defaultChecked?: boolean;
6
7
  checkedLabel?: string;
7
8
  uncheckedLabel?: string;
9
+ /** A Theme gradient slot the switch is filled with while on; absent, the primary colour. */
10
+ gradient?: PhiThemeGradientKey;
8
11
  };
9
12
  declare function parsePhiSwitchWidgetConfig(config: Record<string, unknown>): PhiSwitchWidgetConfig;
10
13
  export declare const PHI_SWITCH_WIDGET_DEFINITION: {
@@ -50,6 +53,22 @@ export declare const PHI_SWITCH_WIDGET_DEFINITION: {
50
53
  key: string;
51
54
  type: "string";
52
55
  label: string;
56
+ description?: undefined;
57
+ options?: undefined;
58
+ emptyOption?: undefined;
59
+ } | {
60
+ key: string;
61
+ type: "choice";
62
+ label: string;
63
+ description: string;
64
+ options: {
65
+ value: "gradient1" | "gradient2" | "gradient3";
66
+ label: string;
67
+ }[];
68
+ emptyOption: {
69
+ value: string;
70
+ label: string;
71
+ };
53
72
  })[];
54
73
  defaultConfig: {
55
74
  defaultChecked: false;
@@ -1,3 +1,5 @@
1
+ import { readPhiThemeGradientKey } from "../../../../../theme/phi-theme-gradients";
2
+ import { PHI_THEME_GRADIENT_FIELD_OPTIONS } from "../../../../../components/widgets/config/theme-gradient";
1
3
  import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
2
4
  import { readBoolean, readString } from "../../../../../components/widgets/config/parser-primitives";
3
5
  import { PHI_BOOLEAN_CONTROL_SIGNALS } from "../../../../../components/widgets/signals/control-signal-capabilities";
@@ -10,6 +12,7 @@ function parsePhiSwitchWidgetConfig(config) {
10
12
  defaultChecked: readBoolean(config.defaultChecked) ?? false,
11
13
  checkedLabel: readString(config.checkedLabel),
12
14
  uncheckedLabel: readString(config.uncheckedLabel),
15
+ gradient: readPhiThemeGradientKey(config.gradient),
13
16
  };
14
17
  }
15
18
  export const PHI_SWITCH_WIDGET_DEFINITION = {
@@ -37,6 +40,14 @@ export const PHI_SWITCH_WIDGET_DEFINITION = {
37
40
  { key: "checkedLabel", type: "string", label: "Checked Text" },
38
41
  { key: "uncheckedLabel", type: "string", label: "Unchecked Text" },
39
42
  ...PHI_COMPACT_CONTROL_PRESENTATION_FIELDS,
43
+ {
44
+ key: "gradient",
45
+ type: "choice",
46
+ label: "Gradient",
47
+ description: "Fills the switch with one of the Theme's gradients while it is on.",
48
+ options: [...PHI_THEME_GRADIENT_FIELD_OPTIONS],
49
+ emptyOption: { value: "", label: "None" },
50
+ },
40
51
  ...PHI_CONTROL_STATE_FIELDS,
41
52
  ],
42
53
  defaultConfig: {
@@ -4,4 +4,4 @@ import { createPhiCmsBuilderWidgetPlugin } from "../../../../../plugins/factorie
4
4
  import { PHI_TABLE_WIDGET_DEFINITION } from "./config";
5
5
  import { PhiTableWidgetClient } from "./client";
6
6
  import { PHI_TABLE_WIDGET_DEFAULT_LABELS } from "../../../../../components/widgets/label-types/table";
7
- export const PHI_TABLE_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_TABLE_WIDGET_DEFINITION, ({ config }) => _jsx(PhiTableWidgetClient, { config: config, labels: PHI_TABLE_WIDGET_DEFAULT_LABELS }));
7
+ export const PHI_TABLE_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_TABLE_WIDGET_DEFINITION, ({ config }) => _jsx(PhiTableWidgetClient, { config: config, renderMode: "editor", labels: PHI_TABLE_WIDGET_DEFAULT_LABELS }));
@@ -1,8 +1,11 @@
1
1
  import type { PhiTableWidgetLabels } from "../../../../../components/widgets/label-types/table";
2
+ import type { PhiRenderableBlockRenderMode } from "../../../../../types/renderable-block";
2
3
  import { type PhiTableActionDefinition, type PhiTableProviderMutationResult, type PhiTableProviderQueryResult, type PhiTableQuery, type PhiTableRowIdentity, type PhiTableWidgetConfig, type PhiTableWidgetState } from "../../../../../types/table-widget";
3
4
  type TableRow = Record<string, unknown>;
4
5
  export type PhiTableWidgetClientProps = {
5
6
  config: PhiTableWidgetConfig;
7
+ /** Where this draws, which decides who reads a failure of the source: the author, or only the log. */
8
+ renderMode: PhiRenderableBlockRenderMode;
6
9
  externalSearch?: string;
7
10
  externalQuery?: PhiTableQuery;
8
11
  refreshKey?: string | number;
@@ -17,5 +20,5 @@ export type PhiTableWidgetClientProps = {
17
20
  selectedRowIdentities?: readonly PhiTableRowIdentity[];
18
21
  }) => boolean | void;
19
22
  };
20
- export declare function PhiTableWidgetClient({ config: inputConfig, externalSearch, externalQuery, refreshKey, onData, onMutation, onStateChange, labels, onAction, }: PhiTableWidgetClientProps): import("react").JSX.Element;
23
+ export declare function PhiTableWidgetClient({ config: inputConfig, renderMode, externalSearch, externalQuery, refreshKey, onData, onMutation, onStateChange, labels, onAction, }: PhiTableWidgetClientProps): import("react").JSX.Element;
21
24
  export {};
@@ -7,6 +7,8 @@ import { PhiDescriptionHint } from "../../../../../components/controls/phi-descr
7
7
  import { Fragment, useCallback, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
8
8
  import { PhiMultiSelectControl } from "../../../../../components/controls/phi-multi-select-control";
9
9
  import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
10
+ import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
11
+ import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
10
12
  import { usePhiConfirmDialog } from "../../../../../components/controls/phi-confirm-dialog";
11
13
  import { PhiCascaderControl } from "../../../../../components/controls/phi-cascader-control";
12
14
  import { PhiCollectionHeaderControl } from "../../../../../components/controls/phi-collection-header-control";
@@ -198,7 +200,7 @@ function resolveTableActions(definitions, capabilities) {
198
200
  }
199
201
  return result;
200
202
  }
201
- export function PhiTableWidgetClient({ config: inputConfig, externalSearch, externalQuery, refreshKey, onData, onMutation, onStateChange, labels = PHI_TABLE_WIDGET_DEFAULT_LABELS, onAction, }) {
203
+ export function PhiTableWidgetClient({ config: inputConfig, renderMode, externalSearch, externalQuery, refreshKey, onData, onMutation, onStateChange, labels = PHI_TABLE_WIDGET_DEFAULT_LABELS, onAction, }) {
202
204
  const { token } = usePhiConfig();
203
205
  const { showMessage } = usePhiApplicationFeedback();
204
206
  /*
@@ -306,7 +308,7 @@ export function PhiTableWidgetClient({ config: inputConfig, externalSearch, exte
306
308
  },
307
309
  validateResource,
308
310
  });
309
- const { resource, bindingError, contractError, rows, total, hasMore, summary, loading, error, query, resolvedQuery, setQuery, selectedRowIdentities, setSelectedRowIdentities, expandedRowIdentities, setExpandedRowIdentities, reload, executeAction, commitField, commitRow, isFieldMutationPending, moveRow, drop, } = binding;
311
+ const { resource, bindingError, contractError, rows, total, hasMore, summary, loading, error, queryError, query, resolvedQuery, setQuery, selectedRowIdentities, setSelectedRowIdentities, expandedRowIdentities, setExpandedRowIdentities, reload, executeAction, commitField, commitRow, isFieldMutationPending, moveRow, drop, } = binding;
310
312
  const toolbarActions = useMemo(() => resolveTableActions(features.actions?.toolbar, resource?.actions), [features.actions?.toolbar, resource?.actions]);
311
313
  const rowActions = useMemo(() => resolveTableActions(features.actions?.row, resource?.actions), [features.actions?.row, resource?.actions]);
312
314
  const bulkActions = useMemo(() => resolveTableActions(features.actions?.bulk, resource?.actions), [features.actions?.bulk, resource?.actions]);
@@ -780,12 +782,23 @@ export function PhiTableWidgetClient({ config: inputConfig, externalSearch, exte
780
782
  const disabled = findMatchingCondition(null, action.disabledWhen, conditionSources);
781
783
  return _jsx(TableAction, { action: action, size: resolvedControlSize, disabled: selectedRowIdentities.length === 0 || Boolean(disabled), disabledReason: disabled && "reason" in disabled ? disabled.reason : undefined, templateValue: selectedRowIdentities.length, onActivate: () => activateAction(action, undefined, selectedRowIdentities) }, action.key);
782
784
  }), hasQueryTools && features.tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "undo", size: "inherit" }), ariaLabel: labels.reset, size: resolvedControlSize, onClick: resetQuery })) : null, features.tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: resolvedControlSize, onClick: reload })) : null] })) : null;
785
+ /*
786
+ * The source's failures end the Table here: a binding that does not hold, a resource the
787
+ * configuration does not fit, a read that failed. A refused edit is not one of them -- it stays in
788
+ * `error` alone and is said above the rows to the person who made it.
789
+ */
790
+ const sourceFailure = bindingError ?? contractError ?? queryError?.message ?? null;
791
+ if (sourceFailure) {
792
+ return (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Table, title: sourceFailure, error: queryError }));
793
+ }
783
794
  return (_jsxs(PhiFlexControl, { vertical: true, gap: selfContainedTools ? token.paddingSM : token.padding, style: { minWidth: 0, width: "100%" }, children: [confirmDialog, _jsx(PhiCollectionHeaderControl, { title: presentation.title, description: presentation.description, filters: collectionFilters, toolbar: collectionToolbar }), !selfContainedTools && bulkActions.length && selectedRowIdentities.length > 0 ? (_jsx(PhiAlertControl, { level: "info", title: (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: "small", wrap: true, children: [_jsx("span", { children: formatPhiTableWidgetLabel(labels.selected, selectedRowIdentities.length) }), _jsx(PhiFlexControl, { align: "center", gap: "small", children: bulkActions.map((action) => {
784
795
  if (!matchesAllConditions(null, action.visibleWhen, conditionSources))
785
796
  return null;
786
797
  const disabled = findMatchingCondition(null, action.disabledWhen, conditionSources);
787
798
  return _jsx(TableAction, { action: action, size: resolvedControlSize, disabled: Boolean(disabled), disabledReason: disabled && "reason" in disabled ? disabled.reason : undefined, onActivate: () => activateAction(action, undefined, selectedRowIdentities) }, action.key);
788
- }) })] })) })) : null, bindingError || contractError || error ? (_jsx(PhiAlertControl, { level: "error", showIcon: true, title: bindingError ?? contractError ?? error?.message })) : null, _jsx(PhiTableBindingControl, { rows: rows, fields: resource?.fields ?? [], sourceConfig: bindingParams, renderDiagnostics: (warnings) => warnings.map((warning) => _jsx(PhiAlertControl, { level: "error", showIcon: true, title: warning }, warning)), rowIdentityPath: resource?.rowIdentityPath ?? "id", columns: columns, columnOrder: columnOrder, sortingMode: features.sorting?.mode ?? "none", sorts: resolvedQuery.sorts ?? [], onSortsChange: (sorts) => setQuery((current) => ({ ...current, page: 1, cursor: null, sorts })), columnReordering: features.columnReordering?.enabled === true, onColumnOrderChange: updateColumnOrder, rowSelection: features.rowSelection?.mode && features.rowSelection.mode !== "none" ? {
799
+ }) })] })) })) : null, error ? _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error.message }) : null, _jsx(PhiTableBindingControl, { rows: rows, fields: resource?.fields ?? [], sourceConfig: bindingParams,
800
+ /* Options an editor could not be given: the rows still stand, the author reads why. */
801
+ renderDiagnostics: (warnings) => warnings.map((warning) => (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Table, title: warning }, warning))), rowIdentityPath: resource?.rowIdentityPath ?? "id", columns: columns, columnOrder: columnOrder, sortingMode: features.sorting?.mode ?? "none", sorts: resolvedQuery.sorts ?? [], onSortsChange: (sorts) => setQuery((current) => ({ ...current, page: 1, cursor: null, sorts })), columnReordering: features.columnReordering?.enabled === true, onColumnOrderChange: updateColumnOrder, rowSelection: features.rowSelection?.mode && features.rowSelection.mode !== "none" ? {
789
802
  mode: features.rowSelection.mode,
790
803
  selectedRowIdentities,
791
804
  preserveSelectedRowIdentities: features.rowSelection.preserveSelectedRowIdentities,
@@ -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,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."),