@phis/ui 0.5.1 → 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.
- package/README.md +1 -1
- package/components/controls/phi-border-control.js +1 -1
- package/components/controls/phi-bound-radius-control.js +9 -9
- package/components/controls/phi-brand-control.js +1 -1
- package/components/controls/phi-drawer-control-adapter.js +4 -4
- package/components/controls/phi-dropdown-control.js +2 -2
- package/components/controls/phi-form-control.js +1 -1
- package/components/controls/phi-image-control.js +1 -1
- package/components/controls/phi-mask-picker-control.js +6 -6
- package/components/controls/phi-select-control.js +1 -1
- package/components/controls/phi-theme-scope-control.js +1 -1
- package/components/controls/use-phi-color-control-presets.js +2 -2
- package/components/forms/compound-form-controls.js +2 -2
- package/components/forms/extended-form-field-controls.js +1 -1
- package/components/forms/shared-form-provider-registry.js +2 -2
- package/components/layouts/clients/phi-flex-layout-client.js +4 -4
- package/components/layouts/clients/phi-grid-layout-client.js +3 -3
- package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
- package/components/layouts/layout-definitions.d.ts +4 -4
- package/components/layouts/phi-page-region-layout.js +1 -1
- package/components/layouts/phi-structure-region-layout.js +3 -3
- package/components/media/phi-asset-focal-rect-widget.js +4 -4
- package/components/media/phi-asset-inspector-section.js +1 -1
- package/components/media/phi-media-kind-icon.js +2 -2
- package/components/media/phi-media-restricted-icon.js +1 -1
- package/components/overlays/phi-overlay-container-client.js +1 -1
- package/components/regions/presets/phi-base-page-column.d.ts +5 -2
- package/components/regions/presets/phi-base-page-column.js +6 -2
- package/components/root/phi-config-provider.js +1 -1
- package/components/root/phi-root-background.js +1 -1
- package/components/root/phi-root-theme-resolver.js +1 -1
- package/components/shell/phi-module-icons.js +1 -1
- package/components/widgets/built-in/builder-workspace-preview.js +8 -8
- package/components/widgets/client/bullet-list-entries-editor.js +2 -2
- package/components/widgets/client/external-document-editor.js +1 -1
- package/components/widgets/client/html-editor.js +3 -3
- package/components/widgets/config/background.d.ts +1 -1
- package/components/widgets/config/background.js +1 -1
- package/components/widgets/inspector-field-row.js +1 -1
- package/components/widgets/label-sets/inspector.js +2 -0
- package/components/widgets/label-types/inspector.d.ts +1 -0
- package/components/widgets/label-types/inspector.js +1 -0
- package/components/widgets/shared/card-body-client.js +1 -1
- package/components/widgets/shared/result-body-client.js +1 -1
- package/constants/media-library-provider-keys.d.ts +8 -1
- package/constants/media-library-provider-keys.js +8 -1
- package/constants/record-field-kinds.d.ts +6 -0
- package/constants/record-field-kinds.js +7 -0
- package/constants/runtime-module-ownership.js +1 -1
- package/helpers/border-widget-style.d.ts +2 -2
- package/helpers/border-widget-style.js +2 -2
- package/helpers/cms-dialog.d.ts +4 -4
- package/helpers/cms-layout-defaults.d.ts +2 -2
- package/helpers/cms-page-catalog.d.ts +5 -0
- package/helpers/cms-preset-page-tree.d.ts +4 -0
- package/helpers/cms-preset-page-tree.js +2 -0
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/layout-style.d.ts +2 -2
- package/helpers/page-layout-check.d.ts +4 -1
- package/helpers/page-layout-check.js +26 -0
- package/helpers/record-fields.d.ts +9 -0
- package/helpers/record-fields.js +84 -0
- package/helpers/surface-presets.d.ts +6 -6
- package/helpers/surface-style.d.ts +1 -1
- package/helpers.d.ts +0 -1
- package/helpers.js +0 -2
- package/module-page-check.d.ts +12 -0
- package/module-page-check.js +12 -0
- package/module-records.d.ts +4 -2
- package/module-records.js +3 -1
- package/next/antd-form-context-loader.mjs +31 -0
- package/next/config.d.mts +2 -0
- package/next/config.mjs +36 -3
- package/package.json +10 -1
- package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
- package/plugins/runtime-modules/asset/data-providers.js +0 -40
- package/plugins/runtime-modules/asset/definition.d.ts +0 -60
- package/plugins/runtime-modules/asset/ids.d.ts +0 -1
- package/plugins/runtime-modules/asset/ids.js +1 -2
- package/plugins/runtime-modules/asset/presets.d.ts +1 -0
- package/plugins/runtime-modules/asset/server.js +0 -5
- package/plugins/runtime-modules/blog/presets.d.ts +1 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
- package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
- package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
- package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
- package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
- package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
- package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
- package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
- package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
- package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
- package/plugins/runtime-modules/contracts.d.ts +1 -1
- package/plugins/runtime-modules/contracts.js +41 -1
- package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
- package/plugins/runtime-modules/core/data-providers.js +41 -0
- package/plugins/runtime-modules/core/definition.d.ts +55 -0
- package/plugins/runtime-modules/core/server.js +5 -0
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
- package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
- package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
- package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/gallery/client.js +29 -21
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +16 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.js +16 -0
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
- package/plugins/runtime-modules/core/widgets/header-navigation/authoring.js +2 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/client.d.ts +1 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +9 -5
- package/plugins/runtime-modules/core/widgets/header-navigation/config.d.ts +1 -4
- package/plugins/runtime-modules/core/widgets/header-navigation/plugin.js +2 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/header-navigation/server.js +1 -2
- package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
- package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
- package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
- package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
- package/plugins/runtime-modules/descriptor-compiler.js +8 -0
- package/plugins/runtime-modules/editor/presets.d.ts +1 -0
- package/plugins/runtime-modules/groups/definition.d.ts +1 -1
- package/plugins/runtime-modules/localization/presets.d.ts +1 -0
- package/plugins/runtime-modules/news/presets.d.ts +1 -0
- package/plugins/runtime-modules/resolver.js +2 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
- package/plugins/runtime-modules/theme/presets.d.ts +1 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +37 -1
- package/server-helpers/cms-page-record.d.ts +26 -0
- package/server-helpers/cms-page-record.js +42 -0
- package/server-helpers/cms-request.js +48 -4
- package/server-helpers/record-fields.d.ts +62 -0
- package/server-helpers/record-fields.js +87 -0
- package/server-helpers/record-samples.d.ts +21 -0
- package/server-helpers/record-samples.js +41 -0
- package/styles/builder-scaffold.css +19 -19
- package/styles/controls.css +121 -108
- package/styles/gradients.css +23 -23
- package/styles/layout-affordances.css +15 -15
- package/styles/layout-authoring-scaffold.css +20 -20
- package/styles/layout.css +9 -9
- package/styles/root.css +4 -4
- package/styles/shell.css +48 -17
- package/theme/antd-css-var-contract.d.ts +93 -78
- package/theme/antd-css-var-contract.js +99 -79
- package/theme/phi-container-breakpoints.d.ts +4 -1
- package/theme/phi-container-breakpoints.js +4 -1
- package/theme/phi-control-shape.d.ts +1 -1
- package/theme/phi-theme-gradients.d.ts +2 -2
- package/theme/phi-theme-gradients.js +14 -14
- package/theme/phi-theme-palette.d.ts +1 -1
- package/theme/phi-theme-palette.js +2 -2
- package/theme/phi-theme-tokens.d.ts +10 -4
- package/theme/phi-theme-tokens.js +78 -23
- package/theme/phi-theme.d.ts +14 -0
- package/theme/phi-theme.js +14 -0
- package/theme/phi-tokens.d.ts +6 -1
- package/theme/phi-tokens.js +22 -2
- package/theme.d.ts +1 -1
- package/theme.js +1 -1
- package/types/cms-module-descriptors.d.ts +6 -0
- package/types/cms-plugins.d.ts +19 -1
- package/types/core-widget-placements.d.ts +10 -0
- package/types/record-provider.d.ts +92 -0
- package/types/widget-runtime.d.ts +5 -0
- /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
- /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
package/types/cms-plugins.d.ts
CHANGED
|
@@ -158,6 +158,15 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
158
158
|
* what gets stored is a provider key the render path looks up in the same registry.
|
|
159
159
|
*/
|
|
160
160
|
type: "video-provider";
|
|
161
|
+
}) | (PhiCmsConfigFieldBase & {
|
|
162
|
+
/**
|
|
163
|
+
* A field of the record the Page is about (MODULES.md, "The fields of a record, and the record a
|
|
164
|
+
* Page is about"). The Inspector offers the fields the Page's record Provider declares, of the
|
|
165
|
+
* kinds the Widget draws; on a Page that is about no record the row is not shown. What is stored
|
|
166
|
+
* is the field's key.
|
|
167
|
+
*/
|
|
168
|
+
type: "record-field";
|
|
169
|
+
kinds: readonly import("./record-provider").PhiRecordFieldKind[];
|
|
161
170
|
}) | (PhiCmsConfigFieldBase & {
|
|
162
171
|
type: "dimension";
|
|
163
172
|
widthKey?: string;
|
|
@@ -583,6 +592,10 @@ export type PhiCmsRuntimeRenderRegistry = {
|
|
|
583
592
|
* a page that binds none loads none.
|
|
584
593
|
*/
|
|
585
594
|
recordProviderLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordProviderResolver>>;
|
|
595
|
+
/** The field readers of the `record` Providers that declare fields, by key. */
|
|
596
|
+
recordFieldsLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordFieldsReader>>;
|
|
597
|
+
/** The sample readers of the `record` Providers that offer samples, by key: what the Builder previews a template with. */
|
|
598
|
+
recordSamplesLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordSamplesReader>>;
|
|
586
599
|
dataProviderDescriptorsByKey: ReadonlyMap<PhiRuntimeDataProviderKey, PhiRuntimeModuleDataProviderDescriptor>;
|
|
587
600
|
formDefinitionsById: ReadonlyMap<string, PhiRuntimeModuleFormDefinition>;
|
|
588
601
|
};
|
|
@@ -957,7 +970,12 @@ export type PhiRuntimeModuleDataProviderDescriptor = PhiRuntimeModuleDataProvide
|
|
|
957
970
|
kind: "collection";
|
|
958
971
|
resources: readonly import("./collection-provider").PhiCollectionProviderResourceDescriptor[];
|
|
959
972
|
} | {
|
|
960
|
-
kind:
|
|
973
|
+
kind: "record";
|
|
974
|
+
resources?: never;
|
|
975
|
+
/** Whose the record is and what it consists of; what a Widget binds to as a field of it. */
|
|
976
|
+
record?: import("./record-provider").PhiRecordDeclaration;
|
|
977
|
+
} | {
|
|
978
|
+
kind: Exclude<PhiRuntimeDataProviderKind, "table" | "tree" | "collection" | "record">;
|
|
961
979
|
resources?: never;
|
|
962
980
|
});
|
|
963
981
|
export type PhiRuntimeModuleDataProviderClientProps = {
|
|
@@ -53,6 +53,8 @@ export type PhiMarkdownWidgetPlacement = PhiWidgetPlacementBase & {
|
|
|
53
53
|
eyebrow?: string;
|
|
54
54
|
sourceMode?: "inline" | "url";
|
|
55
55
|
markdown?: string;
|
|
56
|
+
/** A Markdown or text field of the page record shown instead of the Widget's own text. */
|
|
57
|
+
recordField?: string;
|
|
56
58
|
sourceUrl?: string;
|
|
57
59
|
sourceLocale?: string;
|
|
58
60
|
revalidateSeconds?: number;
|
|
@@ -90,6 +92,8 @@ export type PhiSimpleTextWidgetPlacement = PhiWidgetPlacementBase & {
|
|
|
90
92
|
disabled?: boolean;
|
|
91
93
|
/** `"preset"` while the words are a Preset's (`helpers/text-source.ts`). */
|
|
92
94
|
textSource?: PhiTextSource;
|
|
95
|
+
/** A text, number or date field of the page record shown instead of the Widget's own text. */
|
|
96
|
+
recordField?: string;
|
|
93
97
|
};
|
|
94
98
|
export type PhiDescriptionWidgetPlacement = PhiWidgetPlacementBase & {
|
|
95
99
|
eyebrow?: string;
|
|
@@ -114,6 +118,10 @@ export type PhiButtonWidgetPlacement = PhiWidgetPlacementBase & PhiControlPlacem
|
|
|
114
118
|
gradient?: PhiThemeGradientKey;
|
|
115
119
|
linkTarget?: PhiLinkTarget;
|
|
116
120
|
danger?: boolean;
|
|
121
|
+
/** A text field of the page record sent as the signal value instead of `value`. */
|
|
122
|
+
valueRecordField?: string;
|
|
123
|
+
/** A link field of the page record the Button leads to instead of `linkTarget`. */
|
|
124
|
+
linkRecordField?: string;
|
|
117
125
|
};
|
|
118
126
|
export type PhiImageWidgetPreviewMode = "none" | "native" | "lightbox";
|
|
119
127
|
export type PhiImageWidgetFit = "cover" | "contain" | "fill";
|
|
@@ -131,6 +139,8 @@ export type PhiImageWidgetPlacement = PhiWidgetPlacementBase & PhiMediaImageSour
|
|
|
131
139
|
borderBottomLeftRadius?: number | string;
|
|
132
140
|
borderBottomRightRadius?: number | string;
|
|
133
141
|
mask?: PhiMaskConfig;
|
|
142
|
+
/** A picture field of the page record shown instead of the Widget's own picture. */
|
|
143
|
+
recordField?: string;
|
|
134
144
|
};
|
|
135
145
|
export type PhiIconWidgetPlacement = PhiWidgetPlacementBase & {
|
|
136
146
|
icon?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PhiRecordFieldKind } from "../constants/record-field-kinds";
|
|
1
2
|
import type { PhiRuntimeDataProviderKey } from "./runtime-data-provider";
|
|
2
3
|
import type { PhiBlockRuntime } from "./widget-runtime";
|
|
3
4
|
/** What a record Provider is asked with, besides its parameters: whose Site, in which language. */
|
|
@@ -20,4 +21,95 @@ export type PhiRuntimeRecordProviderResolver = (params: Readonly<Record<string,
|
|
|
20
21
|
export type PhiRuntimeModuleRecordProviderServerDefinition = {
|
|
21
22
|
key: PhiRuntimeDataProviderKey;
|
|
22
23
|
load: () => Promise<PhiRuntimeRecordProviderResolver>;
|
|
24
|
+
/** The reader of the fields the descriptor declares; present exactly where it declares any. */
|
|
25
|
+
loadFields?: () => Promise<PhiRuntimeRecordFieldsReader>;
|
|
26
|
+
/**
|
|
27
|
+
* A few records to show a template with while it is edited; the Builder's Preview takes the first.
|
|
28
|
+
* Optional: without one a template previews with its Widgets' own content. Only where the descriptor
|
|
29
|
+
* declares `record` (fields): a sample stands in for the record a Page is about.
|
|
30
|
+
*/
|
|
31
|
+
loadSamples?: () => Promise<PhiRuntimeRecordSamplesReader>;
|
|
23
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* One record to show a template with: what the Builder calls it, and the parameters of the Provider that
|
|
35
|
+
* name it (`{ slug: "chair" }`) -- the Provider's own, not a route's.
|
|
36
|
+
*/
|
|
37
|
+
export type PhiRecordSample = {
|
|
38
|
+
label: string;
|
|
39
|
+
params: Readonly<Record<string, string>>;
|
|
40
|
+
};
|
|
41
|
+
/** The samples a Provider offers, best first; the Builder's Preview takes the first. */
|
|
42
|
+
export type PhiRuntimeRecordSamplesReader = (context: PhiRuntimeRecordProviderContext) => Promise<readonly PhiRecordSample[]>;
|
|
43
|
+
/** A picture as a record names it: where it is served from -- Site-relative or absolute -- and what it shows. */
|
|
44
|
+
export type PhiRecordPicture = {
|
|
45
|
+
src: string;
|
|
46
|
+
alt?: string;
|
|
47
|
+
};
|
|
48
|
+
/** A short state said in a word, with the tone it is said in. */
|
|
49
|
+
export type PhiRecordTag = {
|
|
50
|
+
label: string;
|
|
51
|
+
tone?: "default" | "success" | "warning" | "error";
|
|
52
|
+
};
|
|
53
|
+
/** Somewhere a record leads: an address, Site-relative or absolute, and the words for it. */
|
|
54
|
+
export type PhiRecordLink = {
|
|
55
|
+
href: string;
|
|
56
|
+
label?: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* What a field of each kind holds. A `date` is an ISO instant and a `number` a number: Core writes both in
|
|
60
|
+
* the page's language. What a domain formats itself is a `text`.
|
|
61
|
+
*/
|
|
62
|
+
export type PhiRecordFieldValueByKind = {
|
|
63
|
+
text: string;
|
|
64
|
+
markdown: string;
|
|
65
|
+
picture: PhiRecordPicture;
|
|
66
|
+
pictures: readonly PhiRecordPicture[];
|
|
67
|
+
list: readonly string[];
|
|
68
|
+
tag: PhiRecordTag;
|
|
69
|
+
date: string;
|
|
70
|
+
number: number;
|
|
71
|
+
link: PhiRecordLink;
|
|
72
|
+
};
|
|
73
|
+
export type PhiRecordFieldDescriptor = {
|
|
74
|
+
/** The field's name in a Widget's config; unique within its Provider. */
|
|
75
|
+
key: string;
|
|
76
|
+
/** What the Builder calls it. */
|
|
77
|
+
label: string;
|
|
78
|
+
kind: PhiRecordFieldKind;
|
|
79
|
+
description?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Whose a record is: `public` is the same for everybody, so a page about it may be rendered once;
|
|
83
|
+
* `viewer` is the signed-in account's own and is read for each request.
|
|
84
|
+
*/
|
|
85
|
+
export type PhiRecordAudience = "public" | "viewer";
|
|
86
|
+
/** What a `record` descriptor declares about its record. */
|
|
87
|
+
export type PhiRecordDeclaration = {
|
|
88
|
+
audience: PhiRecordAudience;
|
|
89
|
+
fields: readonly PhiRecordFieldDescriptor[];
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* From the record a resolver answered to its declared fields' values, by field key. A field the record
|
|
93
|
+
* does not have is left out; a value that is not of its declared kind is dropped by Core and logged.
|
|
94
|
+
*/
|
|
95
|
+
export type PhiRuntimeRecordFieldsReader = (record: unknown, context: PhiRuntimeRecordProviderContext) => Readonly<Record<string, unknown>> | Promise<Readonly<Record<string, unknown>>>;
|
|
96
|
+
/** One field of a record as Core hands it to a Widget: its declared kind and a value of that kind. */
|
|
97
|
+
export type PhiRecordField = {
|
|
98
|
+
[K in PhiRecordFieldKind]: {
|
|
99
|
+
kind: K;
|
|
100
|
+
value: PhiRecordFieldValueByKind[K];
|
|
101
|
+
};
|
|
102
|
+
}[PhiRecordFieldKind];
|
|
103
|
+
/**
|
|
104
|
+
* The record a Page is about, named by a route that has a parameter.
|
|
105
|
+
*
|
|
106
|
+
* `params` maps each parameter the Provider takes to the route parameter that fills it. `titleField` and
|
|
107
|
+
* `descriptionField` name `text` fields that become the Page's title and description.
|
|
108
|
+
*/
|
|
109
|
+
export type PhiCmsPageRecordDescriptor = {
|
|
110
|
+
providerKey: PhiRuntimeDataProviderKey;
|
|
111
|
+
params: Readonly<Record<string, string>>;
|
|
112
|
+
titleField?: string;
|
|
113
|
+
descriptionField?: string;
|
|
114
|
+
};
|
|
115
|
+
export type { PhiRecordFieldKind } from "../constants/record-field-kinds";
|
|
@@ -114,6 +114,11 @@ export type PhiBlockRuntimePage = {
|
|
|
114
114
|
* a Page says, and this can only add to that, never take it back.
|
|
115
115
|
*/
|
|
116
116
|
noindex?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* The record this Page is about, as a binding: the Provider and the parameters the address filled in.
|
|
119
|
+
* Present on a route that names a `pageRecord`; a Widget reads the record's fields through it.
|
|
120
|
+
*/
|
|
121
|
+
record?: import("./runtime-data-provider").PhiRuntimeDataProviderBinding;
|
|
117
122
|
};
|
|
118
123
|
/**
|
|
119
124
|
* What a Widget knows about the request it renders in. It holds nothing only the server may know: a
|
|
File without changes
|