@phis/ui 0.5.2 → 0.5.3

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 (182) hide show
  1. package/README.md +1 -1
  2. package/components/controls/phi-border-control.js +1 -1
  3. package/components/controls/phi-bound-radius-control.js +9 -9
  4. package/components/controls/phi-brand-control.js +1 -1
  5. package/components/controls/phi-drawer-control-adapter.js +4 -4
  6. package/components/controls/phi-dropdown-control.js +2 -2
  7. package/components/controls/phi-form-control.js +1 -1
  8. package/components/controls/phi-image-control.js +1 -1
  9. package/components/controls/phi-mask-picker-control.js +6 -6
  10. package/components/controls/phi-select-control.js +1 -1
  11. package/components/controls/phi-theme-scope-control.js +1 -1
  12. package/components/controls/use-phi-color-control-presets.js +2 -2
  13. package/components/forms/compound-form-controls.js +2 -2
  14. package/components/forms/extended-form-field-controls.js +1 -1
  15. package/components/forms/shared-form-provider-registry.js +2 -2
  16. package/components/layouts/clients/phi-flex-layout-client.js +4 -4
  17. package/components/layouts/clients/phi-grid-layout-client.js +3 -3
  18. package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
  19. package/components/layouts/layout-definitions.d.ts +4 -4
  20. package/components/layouts/phi-page-region-layout.js +1 -1
  21. package/components/layouts/phi-structure-region-layout.js +3 -3
  22. package/components/media/phi-asset-focal-rect-widget.js +4 -4
  23. package/components/media/phi-asset-inspector-section.js +1 -1
  24. package/components/media/phi-media-kind-icon.js +2 -2
  25. package/components/media/phi-media-restricted-icon.js +1 -1
  26. package/components/overlays/phi-overlay-container-client.js +1 -1
  27. package/components/regions/presets/phi-base-page-column.js +6 -2
  28. package/components/root/phi-config-provider.js +1 -1
  29. package/components/root/phi-root-background.js +1 -1
  30. package/components/root/phi-root-theme-resolver.js +1 -1
  31. package/components/shell/phi-module-icons.js +1 -1
  32. package/components/widgets/built-in/builder-workspace-preview.js +8 -8
  33. package/components/widgets/client/bullet-list-entries-editor.js +2 -2
  34. package/components/widgets/client/external-document-editor.js +1 -1
  35. package/components/widgets/client/html-editor.js +3 -3
  36. package/components/widgets/config/background.d.ts +1 -1
  37. package/components/widgets/config/background.js +1 -1
  38. package/components/widgets/inspector-field-row.js +1 -1
  39. package/components/widgets/label-sets/inspector.js +2 -0
  40. package/components/widgets/label-types/inspector.d.ts +1 -0
  41. package/components/widgets/label-types/inspector.js +1 -0
  42. package/components/widgets/shared/card-body-client.js +1 -1
  43. package/components/widgets/shared/result-body-client.js +1 -1
  44. package/constants/media-library-provider-keys.d.ts +8 -1
  45. package/constants/media-library-provider-keys.js +8 -1
  46. package/constants/record-field-kinds.d.ts +6 -0
  47. package/constants/record-field-kinds.js +7 -0
  48. package/constants/runtime-module-ownership.js +1 -1
  49. package/helpers/border-widget-style.d.ts +2 -2
  50. package/helpers/border-widget-style.js +2 -2
  51. package/helpers/cms-dialog.d.ts +4 -4
  52. package/helpers/cms-layout-defaults.d.ts +2 -2
  53. package/helpers/cms-page-catalog.d.ts +5 -0
  54. package/helpers/cms-preset-page-tree.d.ts +4 -0
  55. package/helpers/cms-preset-page-tree.js +2 -0
  56. package/helpers/layout-style.d.ts +2 -2
  57. package/helpers/page-layout-check.d.ts +4 -1
  58. package/helpers/page-layout-check.js +26 -0
  59. package/helpers/record-fields.d.ts +9 -0
  60. package/helpers/record-fields.js +84 -0
  61. package/helpers/surface-presets.d.ts +6 -6
  62. package/helpers/surface-style.d.ts +1 -1
  63. package/helpers.d.ts +0 -1
  64. package/helpers.js +0 -2
  65. package/module-page-check.d.ts +12 -0
  66. package/module-page-check.js +12 -0
  67. package/module-records.d.ts +4 -2
  68. package/module-records.js +3 -1
  69. package/next/antd-form-context-loader.mjs +31 -0
  70. package/next/config.d.mts +2 -0
  71. package/next/config.mjs +36 -3
  72. package/package.json +10 -1
  73. package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
  74. package/plugins/runtime-modules/asset/data-providers.js +0 -40
  75. package/plugins/runtime-modules/asset/definition.d.ts +0 -60
  76. package/plugins/runtime-modules/asset/ids.d.ts +0 -1
  77. package/plugins/runtime-modules/asset/ids.js +1 -2
  78. package/plugins/runtime-modules/asset/presets.d.ts +1 -0
  79. package/plugins/runtime-modules/asset/server.js +0 -5
  80. package/plugins/runtime-modules/blog/presets.d.ts +1 -0
  81. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  82. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
  83. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  84. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
  85. package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
  86. package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
  87. package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
  88. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
  89. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  90. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  91. package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
  92. package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
  93. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  94. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
  95. package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
  96. package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
  97. package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
  98. package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
  99. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
  100. package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
  101. package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
  102. package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
  103. package/plugins/runtime-modules/contracts.d.ts +1 -1
  104. package/plugins/runtime-modules/contracts.js +41 -1
  105. package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
  106. package/plugins/runtime-modules/core/data-providers.js +41 -0
  107. package/plugins/runtime-modules/core/definition.d.ts +55 -0
  108. package/plugins/runtime-modules/core/server.js +5 -0
  109. package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
  110. package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
  111. package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
  112. package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
  113. package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
  114. package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
  115. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
  116. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
  117. package/plugins/runtime-modules/core/widgets/gallery/client.js +29 -21
  118. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +16 -0
  119. package/plugins/runtime-modules/core/widgets/gallery/config.js +16 -0
  120. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  121. package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
  122. package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
  123. package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
  124. package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
  125. package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
  126. package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
  127. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
  128. package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
  129. package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
  130. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  131. package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
  132. package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
  133. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
  134. package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
  135. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
  136. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
  137. package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
  138. package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
  139. package/plugins/runtime-modules/descriptor-compiler.js +8 -0
  140. package/plugins/runtime-modules/editor/presets.d.ts +1 -0
  141. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  142. package/plugins/runtime-modules/localization/presets.d.ts +1 -0
  143. package/plugins/runtime-modules/news/presets.d.ts +1 -0
  144. package/plugins/runtime-modules/resolver.js +2 -0
  145. package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
  146. package/plugins/runtime-modules/theme/presets.d.ts +1 -0
  147. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
  148. package/server-helpers/cms-page-record.d.ts +26 -0
  149. package/server-helpers/cms-page-record.js +42 -0
  150. package/server-helpers/cms-request.js +48 -4
  151. package/server-helpers/record-fields.d.ts +62 -0
  152. package/server-helpers/record-fields.js +87 -0
  153. package/server-helpers/record-samples.d.ts +21 -0
  154. package/server-helpers/record-samples.js +41 -0
  155. package/styles/builder-scaffold.css +19 -19
  156. package/styles/controls.css +109 -109
  157. package/styles/gradients.css +23 -23
  158. package/styles/layout-affordances.css +15 -15
  159. package/styles/layout-authoring-scaffold.css +20 -20
  160. package/styles/layout.css +9 -9
  161. package/styles/root.css +4 -4
  162. package/styles/shell.css +48 -17
  163. package/theme/antd-css-var-contract.d.ts +86 -80
  164. package/theme/antd-css-var-contract.js +92 -81
  165. package/theme/phi-control-shape.d.ts +1 -1
  166. package/theme/phi-theme-gradients.d.ts +2 -2
  167. package/theme/phi-theme-gradients.js +14 -14
  168. package/theme/phi-theme-palette.d.ts +1 -1
  169. package/theme/phi-theme-palette.js +2 -2
  170. package/theme/phi-theme-tokens.d.ts +8 -5
  171. package/theme/phi-theme-tokens.js +59 -28
  172. package/theme/phi-theme.d.ts +14 -2
  173. package/theme/phi-theme.js +14 -1
  174. package/theme/phi-tokens.d.ts +5 -0
  175. package/theme/phi-tokens.js +9 -0
  176. package/types/cms-module-descriptors.d.ts +6 -0
  177. package/types/cms-plugins.d.ts +19 -1
  178. package/types/core-widget-placements.d.ts +10 -0
  179. package/types/record-provider.d.ts +92 -0
  180. package/types/widget-runtime.d.ts +5 -0
  181. /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
  182. /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
@@ -67,7 +67,7 @@ export function PhiLayoutDeleteButtonOverlay({ onDelete, onOpenInspector, ariaLa
67
67
  "--phi-layout-scaffold-delete-background": chromeTheme.background,
68
68
  "--phi-layout-scaffold-delete-border": chromeTheme.border,
69
69
  "--phi-layout-scaffold-delete-color": chromeTheme.color,
70
- "--phi-layout-scaffold-delete-shadow": "var(--ant-box-shadow-tertiary)",
70
+ "--phi-layout-scaffold-delete-shadow": "var(--phi-box-shadow-tertiary)",
71
71
  }, children: pageModeTone.wrap(children ?? (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [leading, onOpenInspector ? (_jsx(PhiLayoutConfigButtonWidget, { onOpenInspector: onOpenInspector, ariaLabel: inspectorAriaLabel })) : null, _jsx(PhiLayoutDeleteButtonWidget, { onDelete: onDelete, ariaLabel: ariaLabel })] }))) }));
72
72
  }
73
73
  export function PhiLayoutDragButtonOverlay({ dragData, ariaLabel, nodeKind, top = "50%", left = 0, zIndex = 41, }) {
@@ -13,7 +13,7 @@ import { PhiRegionVisibilityFields } from "./region-visibility-fields";
13
13
  import { renderPhiInspectorConfigField } from "./inspector-config-field";
14
14
  import { hasPhiFlag, readPhiFlags } from "../../../../helpers/flags";
15
15
  import { PhiCmsFlags } from "../../../../constants/phi-cms";
16
- const PHI_GAP_SM = "var(--ant-padding-sm)";
16
+ const PHI_GAP_SM = "var(--phi-padding-sm)";
17
17
  const REGION_PADDING_KEYS = [
18
18
  "padding",
19
19
  "paddingTop",
@@ -11,7 +11,7 @@ import { readPhiPageReference } from "../../../../types/references";
11
11
  import { usePhiDeveloperBuilderStateValue } from "../developer-workspace-store";
12
12
  import { usePhiBuilderOfferedPageCatalog } from "../use-offered-page-catalog";
13
13
  import { renderPhiInspectorConfigField, renderPhiInspectorSettingsRow } from "./inspector-config-field";
14
- const PHI_GAP_SM = "var(--ant-padding-sm)";
14
+ const PHI_GAP_SM = "var(--phi-padding-sm)";
15
15
  /**
16
16
  * The Region config with a new Page scope and reveal. `all` and `always` are what a Region does without
17
17
  * either, so they are stored as nothing; a list mode keeps its entries even while there are none, so the
@@ -63,6 +63,6 @@ export function PhiDeveloperBuilderShellsWorkspaceWidgetClient({ serverPreviewRe
63
63
  minHeight: 0,
64
64
  height: "100%",
65
65
  padding: 0,
66
- background: "var(--ant-color-fill-secondary)",
66
+ background: "var(--phi-color-fill-secondary)",
67
67
  } }) }) }));
68
68
  }
@@ -239,12 +239,12 @@ export function PhiDeveloperBuilderStructureCanvas({ workspace = "structure", bu
239
239
  height: "100%",
240
240
  minHeight: 0,
241
241
  }, {
242
- "--phi-builder-structure-canvas-body-padding": isPagesWorkspace ? "0px" : "var(--ant-padding-xs)",
242
+ "--phi-builder-structure-canvas-body-padding": isPagesWorkspace ? "0px" : "var(--phi-padding-xs)",
243
243
  "--phi-builder-structure-canvas-outer-gap": "0px",
244
244
  }), children: _jsx(PhiFlexControl, { vertical: true, className: "phi-builder-structure-canvas__stack", style: {
245
245
  height: "100%",
246
246
  flex: "1 1 auto",
247
- padding: isPagesWorkspace ? 0 : "var(--ant-padding-xs)",
247
+ padding: isPagesWorkspace ? 0 : "var(--phi-padding-xs)",
248
248
  borderRadius: 0,
249
249
  background: token.colorFillSecondary,
250
250
  border: "none",
@@ -11,5 +11,5 @@ export function PhiWidgetEffectsToolButton({ effects, target, disabled = false,
11
11
  return;
12
12
  openPhiDeveloperBuilderEffectsEditor(effects ?? {}, target, onChange);
13
13
  };
14
- return (_jsx("div", { className: "phi-layout-affordance phi-layout-affordance--effects", onMouseDown: (event) => { event.preventDefault(); event.stopPropagation(); }, onClick: (event) => event.stopPropagation(), style: { "--phi-layout-affordance-size": "var(--ant-control-height-sm)" }, children: _jsx(PhiButtonControl, { ariaLabel: labels.openEditor, tooltip: labels.openEditor, icon: _jsx(PhiIcon, { name: "node-index", size: "inherit" }), type: "text", size: "small", disabled: disabled || !onChange, onClick: open }) }));
14
+ return (_jsx("div", { className: "phi-layout-affordance phi-layout-affordance--effects", onMouseDown: (event) => { event.preventDefault(); event.stopPropagation(); }, onClick: (event) => event.stopPropagation(), style: { "--phi-layout-affordance-size": "var(--phi-control-height-sm)" }, children: _jsx(PhiButtonControl, { ariaLabel: labels.openEditor, tooltip: labels.openEditor, icon: _jsx(PhiIcon, { name: "node-index", size: "inherit" }), type: "text", size: "small", disabled: disabled || !onChange, onClick: open }) }));
15
15
  }
@@ -13,6 +13,7 @@ import type { PhiCmsGeometryWidgetConfig } from "../../../../components/widgets/
13
13
  import type { PhiRuntimeModuleDataProviderDescriptor } from "../../../../types/cms-plugins";
14
14
  import type { PhiCalendarAdapterDescriptor } from "../../../../types/calendar";
15
15
  import type { PhiVideoProviderDescriptor } from "../../../../types/video";
16
+ import type { PhiRecordFieldDescriptor } from "../../../../types/record-provider";
16
17
  import type { PhiBuilderWidgetMeta } from "../../../../types/builder";
17
18
  import type { PhiSignalRoute } from "../../../../types/signals";
18
19
  import { type PhiInspectorWidgetReferenceOption } from "./inspector-config-field";
@@ -46,6 +47,8 @@ type PhiDeveloperBuilderWidgetInspectorWidgetClientProps = {
46
47
  dataProviderDescriptors?: readonly PhiRuntimeModuleDataProviderDescriptor[];
47
48
  calendarAdapterDescriptors?: readonly PhiCalendarAdapterDescriptor[];
48
49
  videoProviderDescriptors?: readonly PhiVideoProviderDescriptor[];
50
+ /** The declared fields of the record the edited Page is about; empty on a Page that is about none. */
51
+ pageRecordFields?: readonly PhiRecordFieldDescriptor[];
49
52
  };
50
- export declare function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode, selectedStructureNodeKey, selectedStructureNodeKind, selectedStructureNodeTitle, selectedStructureWidgetMeta, currentDraft, widgetReferenceOptions, signalRouteScope, onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, }: PhiDeveloperBuilderWidgetInspectorWidgetClientProps): import("react").JSX.Element;
53
+ export declare function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode, selectedStructureNodeKey, selectedStructureNodeKind, selectedStructureNodeTitle, selectedStructureWidgetMeta, currentDraft, widgetReferenceOptions, signalRouteScope, onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, pageRecordFields, }: PhiDeveloperBuilderWidgetInspectorWidgetClientProps): import("react").JSX.Element;
51
54
  export {};
@@ -15,8 +15,8 @@ import { buildPhiInspectorConfigPathPatch, isPhiInspectorConfigFieldVisible, rea
15
15
  import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
16
16
  import { PhiCmsFlags } from "../../../../constants/phi-cms";
17
17
  import { hasPhiFlag } from "../../../../helpers/flags";
18
- const PHI_GAP_SM = "var(--ant-padding-sm)";
19
- export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode = "editor", selectedStructureNodeKey = null, selectedStructureNodeKind = null, selectedStructureNodeTitle = null, selectedStructureWidgetMeta = null, currentDraft = null, widgetReferenceOptions = [], signalRouteScope = "widget", onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], }) {
18
+ const PHI_GAP_SM = "var(--phi-padding-sm)";
19
+ export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode = "editor", selectedStructureNodeKey = null, selectedStructureNodeKind = null, selectedStructureNodeTitle = null, selectedStructureWidgetMeta = null, currentDraft = null, widgetReferenceOptions = [], signalRouteScope = "widget", onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], pageRecordFields = [], }) {
20
20
  const isPreviewMode = builderMode === "preview";
21
21
  const isTargetKind = selectedStructureNodeKind === "widget";
22
22
  const currentWidgetConfig = resolvePhiBuilderWidgetDraftConfig(selectedStructureWidgetMeta, currentDraft?.config);
@@ -81,6 +81,7 @@ export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builde
81
81
  dataProviderDescriptors,
82
82
  calendarAdapterDescriptors,
83
83
  videoProviderDescriptors,
84
+ pageRecordFields,
84
85
  onChange: (next) => {
85
86
  const patch = buildPhiInspectorConfigPathPatch(currentWidgetSettingsConfigRecord, next);
86
87
  /*
@@ -1,6 +1,7 @@
1
1
  import "server-only";
2
2
  import type { PhiBlockRuntime } from "../../../types/widget-runtime";
3
3
  import type { PhiRuntimeModuleCatalog } from "../../../types";
4
+ import type { PhiCmsPageRecordDescriptor } from "../../../types/record-provider";
4
5
  import type { PhiDeveloperBuilderArea, PhiDeveloperBuilderRegionDraft } from "./developer-workspace-types";
5
6
  import type { PhiCmsTreeControllerSettings } from "../../../types/cms";
6
7
  export type PhiBuilderPageDraftsByScope = Partial<Record<PhiDeveloperBuilderArea, Partial<Record<string, PhiDeveloperBuilderRegionDraft | null>>>>;
@@ -29,6 +30,11 @@ export type PhiBuilderPageMeta = {
29
30
  */
30
31
  controllerSettings: PhiCmsTreeControllerSettings;
31
32
  };
33
+ /**
34
+ * The record a route preset's Page is about, for the Page the Builder is on: `null` for a Page that is no
35
+ * route preset or whose route names none.
36
+ */
37
+ export declare function resolvePhiBuilderPagePresetRecord(runtime: PhiBlockRuntime, area: PhiDeveloperBuilderArea, pageKey: string, runtimeModuleCatalog: PhiRuntimeModuleCatalog): Promise<PhiCmsPageRecordDescriptor | null>;
32
38
  export declare const buildPhiBuilderPagesDraftsByScope: (runtime: PhiBlockRuntime, runtimeModuleCatalog: PhiRuntimeModuleCatalog) => Promise<PhiBuilderPageDraftsMapByScope>;
33
39
  export declare function resolvePhiBuilderCurrentPageScope(runtime: PhiBlockRuntime, runtimeModuleCatalog: PhiRuntimeModuleCatalog): Promise<{
34
40
  area: "public" | "app" | "admin" | "builder" | "editor" | "accounting";
@@ -75,6 +75,14 @@ async function resolvePhiRegistryPresetPageBinding({ runtime, runtimeModuleCatal
75
75
  : null;
76
76
  return binding ? { binding, activeModuleKeys } : null;
77
77
  }
78
+ /**
79
+ * The record a route preset's Page is about, for the Page the Builder is on: `null` for a Page that is no
80
+ * route preset or whose route names none.
81
+ */
82
+ export async function resolvePhiBuilderPagePresetRecord(runtime, area, pageKey, runtimeModuleCatalog) {
83
+ const resolution = await resolvePhiRegistryPresetPageBinding({ runtime, runtimeModuleCatalog, area, pageKey });
84
+ return resolution?.binding.descriptor.pageRecord ?? null;
85
+ }
78
86
  /**
79
87
  * A preset Page the Site has stored nothing for, as the Builder edits it: the preset's tree with the
80
88
  * current content of every node somebody wrote content for (phis-server CONTENT.md).
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PHI_BUILDER_PREVIEW_SEARCH_PARAM } from "./preview-transport";
3
3
  import { loadPhiBuilderPreviewSnapshot } from "./preview-store";
4
- import { buildPhiBuilderPagesDraftsByScope, buildPhiBuilderPageMetaForScope, resolvePhiBuilderCurrentPageScope, } from "./page-presets.server";
4
+ import { buildPhiBuilderPagesDraftsByScope, buildPhiBuilderPageMetaForScope, resolvePhiBuilderCurrentPageScope, resolvePhiBuilderPagePresetRecord, } from "./page-presets.server";
5
5
  import { buildPhiBuilderPreviewRenderableTrees, buildPhiBuilderServerPreviewRegions, } from "./render-root-node-preview.server";
6
6
  import { PhiDeveloperBuilderPagesWorkspaceWidgetClient } from "./clients/pages-workspace";
7
+ import { resolvePhiPageRecordSampleBinding } from "../../../server-helpers/record-samples";
7
8
  import { buildPhiBuilderRuntimeModuleIdsForArea } from "./area-shell-presets.server";
8
9
  import { resolvePhiBuilderCanvasRuntimeModuleSandbox } from "./runtime-module-sandbox.server";
9
10
  import { PhiBuilderWorkspaceScopeBoundary } from "./clients/workspace-scope-boundary";
@@ -47,6 +48,15 @@ export async function PhiDeveloperBuilderPagesWorkspaceWidget({ runtime, registr
47
48
  activeModuleIds: sandbox.moduleSet.activeModuleIds,
48
49
  viewer: runtime.viewer,
49
50
  }));
51
+ /*
52
+ * A template of a route about a record is previewed with the first sample its Provider offers; the
53
+ * Editor canvas keeps showing each Widget's own content. A Provider with no samples leaves the Page
54
+ * about no record, and the template previews with its Widgets' own content as well.
55
+ */
56
+ const pageRecord = await resolvePhiBuilderPagePresetRecord(runtime, previewArea, previewPageKey, registry.runtimeModuleCatalog);
57
+ const sampleRecord = pageRecord
58
+ ? await resolvePhiPageRecordSampleBinding({ registry: sandbox.registry, runtime, pageRecord })
59
+ : null;
50
60
  const previewRuntime = {
51
61
  ...runtime,
52
62
  page: {
@@ -57,6 +67,7 @@ export async function PhiDeveloperBuilderPagesWorkspaceWidget({ runtime, registr
57
67
  descriptionMsgId: runtime.page?.descriptionMsgId ?? null,
58
68
  title: pageMeta.title ?? runtime.page?.title ?? null,
59
69
  description: pageMeta.description ?? runtime.page?.description ?? null,
70
+ ...(sampleRecord ? { record: sampleRecord } : {}),
60
71
  },
61
72
  };
62
73
  return (_jsx(PhiBuilderRuntimeModuleAuthoringBoundary, { targetArea: previewArea, catalog: authoringCatalog, pickerDataProviderKeys: resolvePhiBuilderAuthoringPickerDataProviderKeysFromCatalog(registry.runtimeModuleCatalog), children: _jsx(PhiBuilderWorkspaceScopeBoundary, { kind: "pages", targetArea: previewArea, targetPageKey: previewPageKey, children: _jsx(PhiDeveloperBuilderPagesWorkspaceWidgetClient, { pageDraftsByScope: pageDraftsByScope, pageMeta: pageMeta, pageMetaArea: previewArea, pageMetaPageKey: previewPageKey, serverPreviewRegions: buildPhiBuilderServerPreviewRegions({
@@ -209,8 +209,8 @@ function PhiEffectsPreviewButton({ config, blockKind, onRun, }) {
209
209
  transform: "translate(-50%, -50%)",
210
210
  // Its own size, for the same reason the tool bar states its width inline: it stands in a frame
211
211
  // whose children `styles/layout.css` stretches, and a stylesheet answer did not hold there.
212
- width: "var(--ant-control-height)",
213
- "--phi-layout-affordance-size": "var(--ant-control-height)",
212
+ width: "var(--phi-control-height)",
213
+ "--phi-layout-affordance-size": "var(--phi-control-height)",
214
214
  } })) }));
215
215
  }
216
216
  function PhiSignalWiringToolButton({ onOpen }) {
@@ -228,11 +228,11 @@ function PhiSignalWiringToolButton({ onOpen }) {
228
228
  function PhiViewportIntersectionDiagnostic() {
229
229
  return (_jsx("span", { "aria-label": "This block is hidden at every viewport because its visibility does not overlap its ancestors.", title: "Hidden at every viewport: this block's Compact/Medium/Wide selection has no overlap with its ancestors.", style: {
230
230
  alignItems: "center",
231
- color: "var(--ant-color-warning)",
231
+ color: "var(--phi-color-warning)",
232
232
  display: "inline-flex",
233
- height: "var(--ant-control-height-sm)",
233
+ height: "var(--phi-control-height-sm)",
234
234
  justifyContent: "center",
235
- width: "var(--ant-control-height-sm)",
235
+ width: "var(--phi-control-height-sm)",
236
236
  }, children: _jsx(PhiIcon, { name: "warning", size: "inherit" }) }));
237
237
  }
238
238
  const PHI_WIDGET_AUTHORING_TEXT_SELECTOR = [
@@ -53,8 +53,8 @@ function PhiStructureDragSnapshot({ source, }) {
53
53
  overflow: "hidden",
54
54
  pointerEvents: "none",
55
55
  opacity: 0.86,
56
- borderRadius: "var(--ant-border-radius)",
57
- boxShadow: "var(--ant-box-shadow-secondary)",
56
+ borderRadius: "var(--phi-border-radius)",
57
+ boxShadow: "var(--phi-box-shadow-secondary)",
58
58
  } }));
59
59
  }
60
60
  export function PhiStructureDndProvider({ children, }) {
@@ -13,6 +13,6 @@ export function PhiTestBlockWidget({ labels, config }) {
13
13
  alignItems: "center",
14
14
  justifyContent: "center",
15
15
  textAlign: "center",
16
- border: "1px solid var(--ant-color-primary)",
16
+ border: "1px solid var(--phi-color-primary)",
17
17
  }, children: labels.text }));
18
18
  }
@@ -100,6 +100,7 @@ export declare function definePhiContentEntryRoutes(spec: PhiContentEntryRoutesS
100
100
  activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
101
101
  params: Readonly<Record<string, string>>;
102
102
  }) => import("../../types").PhiResolvedCmsPageTree | Promise<import("../../types").PhiResolvedCmsPageTree>;
103
+ pageRecord?: import("../../types/record-provider").PhiCmsPageRecordDescriptor;
103
104
  navigation?: readonly import("../../types").PhiCmsNavigationInjectionDescriptor[];
104
105
  })[];
105
106
  export {};
@@ -5,7 +5,7 @@ export type { PhiCmsAreaShellPresetDescriptor, PhiCmsRoutePresetDescriptor, PhiC
5
5
  export declare function buildPhiRuntimeModuleDataProviderDescriptor(definition: PhiRuntimeModuleDataProviderDescriptor): {
6
6
  key: `${string}/${string}`;
7
7
  ownerModuleId: `${string}/${string}`;
8
- kind: "table" | "tree" | "options" | "collection" | "timeline" | "record";
8
+ kind: "options" | "table" | "tree" | "collection" | "timeline" | "record";
9
9
  executionMode: import("../../types").PhiRuntimeDataProviderExecutionMode;
10
10
  authoringMode: import("../../types").PhiRuntimeDataProviderAuthoringMode;
11
11
  title: string;
@@ -1,5 +1,6 @@
1
1
  import { PHI_SHARED_PACKAGE_NAME } from "../../constants/package";
2
2
  import { createPhiRuntimeModuleId } from "../../constants/module-identity";
3
+ import { PHI_RECORD_FIELD_KINDS } from "../../constants/record-field-kinds";
3
4
  import { isPhiCalendarAdapterKey } from "../../types/calendar";
4
5
  import { collectPhiVideoProviderDescriptorErrors, isPhiVideoProviderKey, } from "../../types/video";
5
6
  import { isPhiFormId, readPhiFormPackageName } from "../../types/form-id";
@@ -734,13 +735,52 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
734
735
  * and answers nothing, a function without a descriptor is never offered. Both are caught here, where the
735
736
  * catalog is built, rather than on the first page that binds them.
736
737
  */
738
+ function assertPhiRecordDeclaration(owner, declaration) {
739
+ if (declaration.audience !== "public" && declaration.audience !== "viewer") {
740
+ throw new Error(`${owner} has an invalid audience.`);
741
+ }
742
+ const keys = new Set();
743
+ for (const field of declaration.fields) {
744
+ if (!/^[a-z][A-Za-z0-9]*$/.test(field.key)) {
745
+ throw new Error(`${owner} has an invalid field key "${field.key}".`);
746
+ }
747
+ if (keys.has(field.key)) {
748
+ throw new Error(`${owner} declares field "${field.key}" twice.`);
749
+ }
750
+ keys.add(field.key);
751
+ if (!PHI_RECORD_FIELD_KINDS.includes(field.kind)) {
752
+ throw new Error(`${owner} field "${field.key}" has an invalid kind.`);
753
+ }
754
+ if (!field.label.trim()) {
755
+ throw new Error(`${owner} field "${field.key}" has no label.`);
756
+ }
757
+ }
758
+ }
737
759
  function assertPhiRuntimeModuleRecordProviders(definition, entry) {
738
- const declared = new Set((definition.dataProviders ?? []).filter((provider) => provider.kind === "record").map((provider) => provider.key));
760
+ const descriptors = (definition.dataProviders ?? []).flatMap((provider) => provider.kind === "record" ? [provider] : []);
761
+ const declared = new Set(descriptors.map((provider) => provider.key));
762
+ const withFields = new Set();
763
+ for (const descriptor of descriptors) {
764
+ if (!descriptor.record)
765
+ continue;
766
+ withFields.add(descriptor.key);
767
+ assertPhiRecordDeclaration(`${definition.moduleId}: record descriptor "${descriptor.key}"`, descriptor.record);
768
+ }
739
769
  const served = new Set();
740
770
  for (const provider of entry.recordProviders ?? []) {
741
771
  if (!declared.has(provider.key)) {
742
772
  throw new Error(`${definition.moduleId}: record provider "${provider.key}" has no record descriptor in its dataProviders.`);
743
773
  }
774
+ // Declared fields and their reader come as a pair, for the reason the descriptor and its resolver do.
775
+ if (withFields.has(provider.key) !== (provider.loadFields !== undefined)) {
776
+ throw new Error(provider.loadFields
777
+ ? `${definition.moduleId}: record provider "${provider.key}" has a field reader, but its descriptor declares no fields.`
778
+ : `${definition.moduleId}: record descriptor "${provider.key}" declares fields, but its server half has no field reader.`);
779
+ }
780
+ // A sample stands in for the record a Page is about, so it needs a record that declares fields.
781
+ if (provider.loadSamples && !withFields.has(provider.key)) {
782
+ throw new Error(`${definition.moduleId}: record provider "${provider.key}" offers samples, but its descriptor declares no fields.`);
783
+ }
744
784
  if (served.has(provider.key)) {
745
785
  throw new Error(`${definition.moduleId}: record provider "${provider.key}" is served twice.`);
746
786
  }
@@ -1,3 +1,8 @@
1
+ /** How the Folder's pictures are ordered; the words a record binding's `sort` takes. */
2
+ export declare const PHI_MEDIA_FOLDER_IMAGES_SORTS: readonly ["name_asc", "created_at_desc"];
3
+ export declare const PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT = 50;
4
+ /** What the server hands out at most (`/api/v1/site/media/folder-images`). */
5
+ export declare const PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT = 200;
1
6
  export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
2
7
  key: `${string}/${string}`;
3
8
  ownerModuleId: "@phis/ui/modules/core";
@@ -324,4 +329,59 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
324
329
  options?: undefined;
325
330
  })[];
326
331
  resources?: undefined;
332
+ } | {
333
+ key: `${string}/${string}`;
334
+ ownerModuleId: "@phis/ui/modules/core";
335
+ kind: "record";
336
+ executionMode: "live";
337
+ authoringMode: "none";
338
+ title: string;
339
+ description: string;
340
+ settingsFields: ({
341
+ key: string;
342
+ type: "choice";
343
+ heading: string;
344
+ label: string;
345
+ optionsProvider: {
346
+ providerKey: `${string}/${string}`;
347
+ };
348
+ description?: undefined;
349
+ options?: undefined;
350
+ min?: undefined;
351
+ max?: undefined;
352
+ } | {
353
+ key: string;
354
+ type: "boolean";
355
+ label: string;
356
+ description: string;
357
+ heading?: undefined;
358
+ optionsProvider?: undefined;
359
+ options?: undefined;
360
+ min?: undefined;
361
+ max?: undefined;
362
+ } | {
363
+ key: string;
364
+ type: "choice";
365
+ label: string;
366
+ options: {
367
+ value: string;
368
+ label: string;
369
+ }[];
370
+ heading?: undefined;
371
+ optionsProvider?: undefined;
372
+ description?: undefined;
373
+ min?: undefined;
374
+ max?: undefined;
375
+ } | {
376
+ key: string;
377
+ type: "number";
378
+ label: string;
379
+ min: number;
380
+ max: number;
381
+ heading?: undefined;
382
+ optionsProvider?: undefined;
383
+ description?: undefined;
384
+ options?: undefined;
385
+ })[];
386
+ resources?: undefined;
327
387
  })[];
@@ -2,6 +2,12 @@ import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-dat
2
2
  import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
3
3
  import { PHI_CORE_MESSAGING_DATA_PROVIDER_DESCRIPTORS } from "./messaging/data-providers";
4
4
  import { PHI_CONTENT_ENTRY_KINDS } from "../../../constants/content-entry-kinds";
5
+ import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS } from "../../../constants/media-library-provider-keys";
6
+ /** How the Folder's pictures are ordered; the words a record binding's `sort` takes. */
7
+ export const PHI_MEDIA_FOLDER_IMAGES_SORTS = ["name_asc", "created_at_desc"];
8
+ export const PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT = 50;
9
+ /** What the server hands out at most (`/api/v1/site/media/folder-images`). */
10
+ export const PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT = 200;
5
11
  export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
6
12
  {
7
13
  key: PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS.spacingScale,
@@ -236,4 +242,39 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
236
242
  { key: "slug", type: "string", label: "Address" },
237
243
  ],
238
244
  },
245
+ /*
246
+ * The pictures of a Folder, read on the server while the page is drawn (`types/record-provider.ts`).
247
+ * A Folder is a thing somebody keeps filling, so the page reads it rather than naming each picture:
248
+ * what is public in the branch at render time is what the Gallery shows.
249
+ */
250
+ {
251
+ key: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderImages,
252
+ ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
253
+ kind: "record",
254
+ executionMode: "live",
255
+ // The Builder draws a placeholder for a Gallery and reads nothing.
256
+ authoringMode: "none",
257
+ title: "Media folder pictures",
258
+ description: "The public pictures of one media folder, with its subfolders unless told otherwise.",
259
+ settingsFields: [
260
+ {
261
+ key: "folderId",
262
+ type: "choice",
263
+ heading: "Folder",
264
+ label: "Folder",
265
+ optionsProvider: { providerKey: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderChoices },
266
+ },
267
+ { key: "topLevelOnly", type: "boolean", label: "This folder only", description: "Leave the pictures in its subfolders out." },
268
+ {
269
+ key: "sort",
270
+ type: "choice",
271
+ label: "Order",
272
+ options: [
273
+ { value: "name_asc", label: "By file name" },
274
+ { value: "created_at_desc", label: "Newest first" },
275
+ ],
276
+ },
277
+ { key: "limit", type: "number", label: "At most", min: 1, max: PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT },
278
+ ],
279
+ },
239
280
  ];
@@ -335,6 +335,61 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
335
335
  options?: undefined;
336
336
  })[];
337
337
  resources?: undefined;
338
+ } | {
339
+ key: `${string}/${string}`;
340
+ ownerModuleId: "@phis/ui/modules/core";
341
+ kind: "record";
342
+ executionMode: "live";
343
+ authoringMode: "none";
344
+ title: string;
345
+ description: string;
346
+ settingsFields: ({
347
+ key: string;
348
+ type: "choice";
349
+ heading: string;
350
+ label: string;
351
+ optionsProvider: {
352
+ providerKey: `${string}/${string}`;
353
+ };
354
+ description?: undefined;
355
+ options?: undefined;
356
+ min?: undefined;
357
+ max?: undefined;
358
+ } | {
359
+ key: string;
360
+ type: "boolean";
361
+ label: string;
362
+ description: string;
363
+ heading?: undefined;
364
+ optionsProvider?: undefined;
365
+ options?: undefined;
366
+ min?: undefined;
367
+ max?: undefined;
368
+ } | {
369
+ key: string;
370
+ type: "choice";
371
+ label: string;
372
+ options: {
373
+ value: string;
374
+ label: string;
375
+ }[];
376
+ heading?: undefined;
377
+ optionsProvider?: undefined;
378
+ description?: undefined;
379
+ min?: undefined;
380
+ max?: undefined;
381
+ } | {
382
+ key: string;
383
+ type: "number";
384
+ label: string;
385
+ min: number;
386
+ max: number;
387
+ heading?: undefined;
388
+ optionsProvider?: undefined;
389
+ description?: undefined;
390
+ options?: undefined;
391
+ })[];
392
+ resources?: undefined;
338
393
  })[];
339
394
  formProviders: {
340
395
  readonly fieldTypes: ({
@@ -1,4 +1,5 @@
1
1
  import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-data-provider-keys";
2
+ import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS } from "../../../constants/media-library-provider-keys";
2
3
  import { PHI_CORE_RUNTIME_MODULE_THEMES } from "./themes";
3
4
  import { definePhiRuntimeModuleServerAreaContribution } from "../area-contributions";
4
5
  import { PHI_CORE_RUNTIME_MODULE_DEFINITION } from "./definition";
@@ -26,6 +27,10 @@ export function createPhiCoreRuntimeModuleServerAreaContribution() {
26
27
  recordProviders: [{
27
28
  key: PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS.contentEntry,
28
29
  load: () => import("./content-entries/record.server").then((module) => module.resolvePhiContentEntryRecord),
30
+ }, {
31
+ // Showing a Folder's public pictures needs no Media management in the Area, as an Image does not.
32
+ key: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderImages,
33
+ load: () => import("./services/media-folder-images.server").then((module) => module.resolvePhiMediaFolderImagesRecord),
29
34
  }],
30
35
  load: () => import("./module").then((module) => module.PHI_CORE_RUNTIME_MODULE),
31
36
  },
@@ -32,6 +32,10 @@ export type PhiButtonWidgetConfig = PhiCmsWidgetConfigBase & PhiControlBadgeConf
32
32
  */
33
33
  linkTarget?: PhiLinkTarget;
34
34
  danger?: boolean;
35
+ /** A text field of the page record that is the signal value instead of `value`. */
36
+ valueRecordField?: string;
37
+ /** A link field of the page record that is where the Button leads instead of `linkTarget`. */
38
+ linkRecordField?: string;
35
39
  };
36
40
  declare function parsePhiButtonWidgetConfig(config: Record<string, unknown>): PhiButtonWidgetConfig;
37
41
  export declare const PHI_BUTTON_WIDGET_DEFINITION: {
@@ -161,6 +165,7 @@ export declare const PHI_BUTTON_WIDGET_DEFINITION: {
161
165
  visibleWhen?: undefined;
162
166
  emptyValue?: undefined;
163
167
  editorPlacement?: undefined;
168
+ kinds?: undefined;
164
169
  heading?: undefined;
165
170
  } | {
166
171
  key: string;
@@ -178,6 +183,7 @@ export declare const PHI_BUTTON_WIDGET_DEFINITION: {
178
183
  };
179
184
  emptyValue?: undefined;
180
185
  editorPlacement?: undefined;
186
+ kinds?: undefined;
181
187
  heading?: undefined;
182
188
  } | {
183
189
  key: string;
@@ -189,6 +195,7 @@ export declare const PHI_BUTTON_WIDGET_DEFINITION: {
189
195
  placeholder?: undefined;
190
196
  visibleWhen?: undefined;
191
197
  editorPlacement?: undefined;
198
+ kinds?: undefined;
192
199
  heading?: undefined;
193
200
  } | {
194
201
  key: string;
@@ -200,6 +207,7 @@ export declare const PHI_BUTTON_WIDGET_DEFINITION: {
200
207
  visibleWhen?: undefined;
201
208
  emptyValue?: undefined;
202
209
  editorPlacement?: undefined;
210
+ kinds?: undefined;
203
211
  heading?: undefined;
204
212
  } | {
205
213
  key: string;
@@ -211,6 +219,19 @@ export declare const PHI_BUTTON_WIDGET_DEFINITION: {
211
219
  placeholder?: undefined;
212
220
  visibleWhen?: undefined;
213
221
  emptyValue?: undefined;
222
+ kinds?: undefined;
223
+ heading?: undefined;
224
+ } | {
225
+ key: string;
226
+ type: "record-field";
227
+ label: string;
228
+ description: string;
229
+ kinds: "text"[];
230
+ options?: undefined;
231
+ placeholder?: undefined;
232
+ visibleWhen?: undefined;
233
+ emptyValue?: undefined;
234
+ editorPlacement?: undefined;
214
235
  heading?: undefined;
215
236
  } | {
216
237
  key: string;
@@ -226,6 +247,19 @@ export declare const PHI_BUTTON_WIDGET_DEFINITION: {
226
247
  placeholder?: undefined;
227
248
  emptyValue?: undefined;
228
249
  editorPlacement?: undefined;
250
+ kinds?: undefined;
251
+ } | {
252
+ key: string;
253
+ type: "record-field";
254
+ label: string;
255
+ description: string;
256
+ kinds: "link"[];
257
+ options?: undefined;
258
+ placeholder?: undefined;
259
+ visibleWhen?: undefined;
260
+ emptyValue?: undefined;
261
+ editorPlacement?: undefined;
262
+ heading?: undefined;
229
263
  })[];
230
264
  defaultConfig: {
231
265
  key: string;
@@ -26,6 +26,8 @@ function parsePhiButtonWidgetConfig(config) {
26
26
  gradient: readPhiThemeGradientKey(config.gradient),
27
27
  linkTarget: readPhiLinkTarget(config.linkTarget) ?? undefined,
28
28
  danger: readBoolean(config.danger),
29
+ valueRecordField: readString(config.valueRecordField),
30
+ linkRecordField: readString(config.linkRecordField),
29
31
  };
30
32
  }
31
33
  const PHI_BUTTON_DEFAULT_CONFIG = {
@@ -87,6 +89,13 @@ export const PHI_BUTTON_WIDGET_DEFINITION = {
87
89
  { key: "tooltip", type: "string", label: "Tooltip" },
88
90
  { key: "icon", type: "icon", label: "Icon", editorPlacement: "toolbar" },
89
91
  { key: "value", type: "string", label: "Signal Value" },
92
+ {
93
+ key: "valueRecordField",
94
+ type: "record-field",
95
+ label: "Signal Value from record",
96
+ description: "Sends a field of the record this page is about as the signal value, instead of the value above.",
97
+ kinds: ["text"],
98
+ },
90
99
  /* Above Danger, so Danger stands with the state switches below it. */
91
100
  ...PHI_CONTROL_PRESENTATION_FIELDS,
92
101
  { key: "danger", type: "boolean", label: "Danger" },
@@ -102,6 +111,13 @@ export const PHI_BUTTON_WIDGET_DEFINITION = {
102
111
  label: "Link target",
103
112
  visibleWhen: { field: "signalRoutes.emits", equals: null },
104
113
  },
114
+ {
115
+ key: "linkRecordField",
116
+ type: "record-field",
117
+ label: "Link from record",
118
+ description: "Leads where a field of the record this page is about leads, instead of the target above.",
119
+ kinds: ["link"],
120
+ },
105
121
  ...PHI_CONTROL_BADGE_FIELDS,
106
122
  ],
107
123
  defaultConfig: PHI_BUTTON_DEFAULT_CONFIG,