@yext/visual-editor 2.0.0-beta.1 → 2.0.0-beta.11
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/dist/{SectionLibraryVisualEditorProvider-67ng4X9e.js → SectionLibraryVisualEditorProvider-DJMXab-H.js} +36147 -24876
- package/dist/SectionLibraryVisualEditorProvider.css +1 -1
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/styling.ts +22 -19
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx +39 -1
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx +13 -5
- package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +32 -0
- package/dist/cli/yextve.js +322 -218
- package/dist/{locatorEntityTypes-s4dmT9l5.d.ts → createYextFieldTransforms-B7vqqb3m.d.ts} +346 -27
- package/dist/index.d.ts +42 -68
- package/dist/locales/platform/cs/visual-editor.json +124 -4
- package/dist/locales/platform/da/visual-editor.json +110 -4
- package/dist/locales/platform/de/visual-editor.json +110 -4
- package/dist/locales/platform/en/visual-editor.json +110 -4
- package/dist/locales/platform/en-GB/visual-editor.json +110 -4
- package/dist/locales/platform/es/visual-editor.json +117 -4
- package/dist/locales/platform/et/visual-editor.json +110 -4
- package/dist/locales/platform/fi/visual-editor.json +110 -4
- package/dist/locales/platform/fr/visual-editor.json +117 -4
- package/dist/locales/platform/hr/visual-editor.json +117 -4
- package/dist/locales/platform/hu/visual-editor.json +110 -4
- package/dist/locales/platform/it/visual-editor.json +117 -4
- package/dist/locales/platform/ja/visual-editor.json +110 -4
- package/dist/locales/platform/lt/visual-editor.json +124 -4
- package/dist/locales/platform/lv/visual-editor.json +114 -4
- package/dist/locales/platform/nb/visual-editor.json +110 -4
- package/dist/locales/platform/nl/visual-editor.json +110 -4
- package/dist/locales/platform/pl/visual-editor.json +124 -4
- package/dist/locales/platform/pt/visual-editor.json +117 -4
- package/dist/locales/platform/ro/visual-editor.json +117 -4
- package/dist/locales/platform/sk/visual-editor.json +124 -4
- package/dist/locales/platform/sv/visual-editor.json +110 -4
- package/dist/locales/platform/tr/visual-editor.json +109 -3
- package/dist/locales/platform/zh/visual-editor.json +110 -4
- package/dist/locales/platform/zh-TW/visual-editor.json +110 -4
- package/dist/plugin/internal/layoutGeneration/limits.d.ts +28 -0
- package/dist/plugin/plugin.js +7025 -2259
- package/dist/plugin/types/generationPrompts.d.ts +19 -0
- package/dist/plugin/types/generationSettings.d.ts +12 -0
- package/dist/plugin/types/sectionLibrary.d.ts +11 -4
- package/dist/plugin/vite-plugin/layout-generation/generationLogger.d.ts +5 -0
- package/dist/plugin/vite-plugin/layout-generation/generationReports.d.ts +13 -0
- package/dist/plugin/vite-plugin/layout-generation/middleware.d.ts +14 -0
- package/dist/plugin/vite-plugin/layout-generation/modelProxy.d.ts +9 -0
- package/dist/plugin/vite-plugin/layout-generation/prompts.d.ts +17 -0
- package/dist/plugin/vite-plugin/layout-generation/settings.d.ts +3 -0
- package/dist/plugin/vite-plugin/local-editor/artifacts.d.ts +4 -2
- package/dist/plugin/vite-plugin/local-editor/data.d.ts +2 -0
- package/dist/plugin/vite-plugin/local-editor/generatedFiles.d.ts +2 -3
- package/dist/plugin/vite-plugin/local-editor/server.d.ts +17 -1
- package/dist/plugin/vite-plugin/local-editor/types.d.ts +18 -2
- package/dist/plugin/vite-plugin/plugin.d.ts +1 -1
- package/dist/section-library-support.js +157 -137
- package/dist/sectionLibrarySupport.d.ts +425 -4
- package/dist/style.css +1 -1
- package/dist/visual-editor-6mKs9VUe.js +842 -0
- package/dist/visual-editor-BK6fTU7k.js +804 -0
- package/dist/visual-editor-BruRrJYN.js +804 -0
- package/dist/visual-editor-Bs3wAslG.js +804 -0
- package/dist/visual-editor-C9TLeAzP.js +804 -0
- package/dist/visual-editor-CHWtMtlu.js +823 -0
- package/dist/visual-editor-CcfUKpnd.js +804 -0
- package/dist/visual-editor-ClC6hoz3.js +804 -0
- package/dist/visual-editor-CtQwadxQ.js +842 -0
- package/dist/visual-editor-D7VeTRK_.js +816 -0
- package/dist/visual-editor-DTE5kxrA.js +804 -0
- package/dist/visual-editor-DjTEbi-1.js +842 -0
- package/dist/visual-editor-DkHhrFsX.js +804 -0
- package/dist/visual-editor-DtL-Zuv_.js +804 -0
- package/dist/visual-editor-Duishbsa.js +842 -0
- package/dist/visual-editor-LXMNWXry.js +823 -0
- package/dist/visual-editor-QpGupjY5.js +823 -0
- package/dist/visual-editor-_TatCCAS.js +804 -0
- package/dist/visual-editor-gEaWoNRu.js +804 -0
- package/dist/visual-editor-gjpr-NAN.js +804 -0
- package/dist/visual-editor-qJW0uCiQ.js +804 -0
- package/dist/visual-editor-sOPDMkOR.js +823 -0
- package/dist/visual-editor-tPb7n5l8.js +823 -0
- package/dist/visual-editor-vomNdlNO.js +804 -0
- package/dist/visual-editor-zKhC7_0C.js +823 -0
- package/dist/visual-editor.css +1 -1
- package/dist/visual-editor.js +14647 -11016
- package/package.json +7 -4
- package/dist/visual-editor-9bLkRo2X.js +0 -702
- package/dist/visual-editor-B5f3AZF6.js +0 -706
- package/dist/visual-editor-BGZbJkMp.js +0 -694
- package/dist/visual-editor-BPVqHHz5.js +0 -706
- package/dist/visual-editor-BPvDMSb8.js +0 -706
- package/dist/visual-editor-BTT9n9b6.js +0 -718
- package/dist/visual-editor-BXSlgf31.js +0 -694
- package/dist/visual-editor-Bez9GftS.js +0 -694
- package/dist/visual-editor-Bk5QJccl.js +0 -718
- package/dist/visual-editor-BqtG2m0y.js +0 -694
- package/dist/visual-editor-C00efXqJ.js +0 -706
- package/dist/visual-editor-CZdmgAn0.js +0 -706
- package/dist/visual-editor-CcOCcCUQ.js +0 -694
- package/dist/visual-editor-D2_8u6ZI.js +0 -694
- package/dist/visual-editor-D4vaqoBN.js +0 -694
- package/dist/visual-editor-D6n8EP_O.js +0 -694
- package/dist/visual-editor-DKG_E7X4.js +0 -694
- package/dist/visual-editor-DQq0_rUn.js +0 -706
- package/dist/visual-editor-DRXezaoB.js +0 -694
- package/dist/visual-editor-DbgFzBNV.js +0 -718
- package/dist/visual-editor-DiLdoISr.js +0 -718
- package/dist/visual-editor-DnTPMRV4.js +0 -694
- package/dist/visual-editor-E0hASBXn.js +0 -694
- package/dist/visual-editor-W1OHU94y.js +0 -694
- package/dist/visual-editor-bauJ9beX.js +0 -694
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import { ImageType, CTA as CTA$1, LinkType, HoursType, HoursTableProps, ComplexImageType } from '@yext/pages-components';
|
|
5
|
-
import { BaseField, FieldProps, DefaultComponentProps, ComponentConfig, Field, ArrayField, ObjectField, Fields, CustomField, Config, ComponentData } from '@puckeditor/core';
|
|
6
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
7
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { BaseField, FieldProps, DefaultComponentProps, ComponentConfig, Field, ArrayField, ObjectField, Fields, CustomField, Config, ComponentData, FieldTransformFn } from '@puckeditor/core';
|
|
8
6
|
import * as _yext_search_headless_react from '@yext/search-headless-react';
|
|
9
7
|
import { SearchAnalyticsConfig } from '@yext/search-ui-react';
|
|
10
8
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
9
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
10
|
+
import { VariantProps } from 'class-variance-authority';
|
|
11
|
+
import { z } from 'zod';
|
|
11
12
|
import * as react_i18next from 'react-i18next';
|
|
12
13
|
import { TOptions } from 'i18next';
|
|
13
14
|
|
|
@@ -785,6 +786,11 @@ declare const isNonNormalizableLinkType: (linkType?: LinkType | string | null) =
|
|
|
785
786
|
*/
|
|
786
787
|
declare const normalizeLink: (content?: string, linkType?: LinkType) => string;
|
|
787
788
|
|
|
789
|
+
/** An authored theme color with render-ready CSS for both selected and contrasting colors. */
|
|
790
|
+
type ResolvedThemeColor = ThemeColor & {
|
|
791
|
+
selectedColorCss: string;
|
|
792
|
+
contrastingColorCss: string;
|
|
793
|
+
};
|
|
788
794
|
/**
|
|
789
795
|
* hexToRGB converts a hex color to rgb
|
|
790
796
|
* @param H hex string beginning with '#'
|
|
@@ -833,11 +839,11 @@ declare const getSurfaceColorStyle: (surfaceColor?: ThemeColor | string, streamD
|
|
|
833
839
|
*/
|
|
834
840
|
declare const getBackgroundColorClasses: (color?: ThemeColor) => string;
|
|
835
841
|
/**
|
|
836
|
-
* Resolves inline styles for bracketed custom colors in background contexts.
|
|
837
|
-
* @param color a ThemeColor object
|
|
842
|
+
* Resolves inline styles for resolved colors and bracketed custom colors in background contexts.
|
|
843
|
+
* @param color a ThemeColor or ResolvedThemeColor object
|
|
838
844
|
* @returns inline background/text color styles, e.g. `{ backgroundColor: "#FF6D66" }`
|
|
839
845
|
*/
|
|
840
|
-
declare const getBackgroundColorStyle: (color?: ThemeColor) => {
|
|
846
|
+
declare const getBackgroundColorStyle: (color?: ThemeColor | ResolvedThemeColor) => {
|
|
841
847
|
backgroundColor?: string;
|
|
842
848
|
color?: string;
|
|
843
849
|
} | undefined;
|
|
@@ -900,6 +906,40 @@ type MappedSourceFieldFilter<T extends Record<string, any>> = RenderEntityFieldF
|
|
|
900
906
|
mappedSourceTypes?: EntityFieldTypes[][];
|
|
901
907
|
};
|
|
902
908
|
|
|
909
|
+
/** Generation controls shared by native Puck and Yext field definitions. */
|
|
910
|
+
type FieldGenerationMetadata = {
|
|
911
|
+
/** Exclude this field from AI generation. The default value will be used. */
|
|
912
|
+
exclude?: boolean;
|
|
913
|
+
/** Overrides the requiredness of this field */
|
|
914
|
+
required?: boolean;
|
|
915
|
+
/** Require integer values for inferred number fields. Does not change editor step. */
|
|
916
|
+
integer?: boolean;
|
|
917
|
+
/** Allow null (for example, an inherited selector value) during inference only. */
|
|
918
|
+
nullable?: boolean;
|
|
919
|
+
/** Plain text instructions to pass to the model. */
|
|
920
|
+
instructions?: string;
|
|
921
|
+
/** Require exactly one slot child. False or omitted keeps variable-length arrays. */
|
|
922
|
+
singleChild?: boolean;
|
|
923
|
+
/** Explicit schemas own optionality; callbacks receive the inferred schema. */
|
|
924
|
+
schema?: z.ZodType | ((inferred: z.ZodType) => z.ZodType);
|
|
925
|
+
};
|
|
926
|
+
type LayoutGenerationMetadata = {
|
|
927
|
+
/** Exclude this from layout generation. Components are included by default. */
|
|
928
|
+
exclude?: boolean;
|
|
929
|
+
/** Plain text instructions to pass to the model. */
|
|
930
|
+
instructions?: string;
|
|
931
|
+
/** Complete override of the layout generation props inferred from fields. */
|
|
932
|
+
props?: z.ZodObject;
|
|
933
|
+
/** JSON Pointer paths whose resolved values survive chat edit preservation. */
|
|
934
|
+
resolvedProps?: string[];
|
|
935
|
+
slottedItemSource?: SlottedItemSourceGenerationMetadata;
|
|
936
|
+
};
|
|
937
|
+
declare module "@puckeditor/core" {
|
|
938
|
+
interface BaseField {
|
|
939
|
+
generation?: FieldGenerationMetadata;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
903
943
|
type ThemeOptionKey = keyof typeof ThemeOptions;
|
|
904
944
|
type BasicSelectorOptions = ComboboxOption[] | (() => ComboboxOption[]) | ThemeOptionKey;
|
|
905
945
|
/**
|
|
@@ -954,11 +994,27 @@ type BasicSelectorFieldWithGroups = BasicSelectorFieldBase & {
|
|
|
954
994
|
optionGroups: ComboboxOptionGroup[];
|
|
955
995
|
};
|
|
956
996
|
type BasicSelectorField = BasicSelectorFieldWithOptions | BasicSelectorFieldWithGroups;
|
|
957
|
-
|
|
958
|
-
declare const BasicSelectorFieldOverride: (
|
|
997
|
+
/** Keeps shipped color selectors editable while new configs use themeColor. */
|
|
998
|
+
declare const BasicSelectorFieldOverride: (props: FieldProps<BasicSelectorField>) => React__default.JSX.Element;
|
|
999
|
+
|
|
1000
|
+
/** Theme colors always retain authored tokens and resolve both CSS colors. */
|
|
1001
|
+
type ThemeColorField = BaseField & {
|
|
1002
|
+
type: "themeColor";
|
|
1003
|
+
/** Selects site or background palette choices. */
|
|
1004
|
+
options: "SITE_COLOR" | "BACKGROUND_COLOR";
|
|
1005
|
+
label?: string | MsgString;
|
|
1006
|
+
visible?: boolean;
|
|
1007
|
+
translateOptions?: boolean;
|
|
1008
|
+
noOptionsPlaceholder?: string | MsgString;
|
|
1009
|
+
noOptionsMessage?: string | MsgString;
|
|
1010
|
+
disableSearch?: boolean;
|
|
1011
|
+
};
|
|
1012
|
+
/** Edits palette and custom ThemeColor values without changing their authored shape. */
|
|
1013
|
+
declare const ThemeColorFieldOverride: ({ field, value, onChange, }: FieldProps<ThemeColorField, ThemeColor | undefined>) => React__default.JSX.Element;
|
|
959
1014
|
|
|
960
1015
|
type CodeLanguageOptions = "html" | "css" | "json" | "shell" | "java" | "javascript" | "jsx" | "markdown" | "typescript";
|
|
961
1016
|
type CodeField = BaseField & {
|
|
1017
|
+
/** Processes HTML templates and JavaScript embedded fields; other code stays authored. */
|
|
962
1018
|
type: "code";
|
|
963
1019
|
label?: string | MsgString;
|
|
964
1020
|
visible?: boolean;
|
|
@@ -1021,12 +1077,18 @@ type YextCTAField = YextEntityField<EnhancedTranslatableCTA> & {
|
|
|
1021
1077
|
};
|
|
1022
1078
|
type CTASelectorField = BaseField & {
|
|
1023
1079
|
type: "ctaSelector";
|
|
1080
|
+
/** Resolves the CTA source, localized text, and directions URL before rendering. */
|
|
1081
|
+
transform?: boolean;
|
|
1024
1082
|
label?: string | MsgString;
|
|
1025
1083
|
visible?: boolean;
|
|
1026
1084
|
disableConstantValueToggle?: boolean;
|
|
1027
1085
|
};
|
|
1028
1086
|
type CTASelectorFieldProps = FieldProps<CTASelectorField>;
|
|
1029
|
-
|
|
1087
|
+
/**
|
|
1088
|
+
* Renders CTA source controls. Its declaration is available when the field
|
|
1089
|
+
* registry initializes.
|
|
1090
|
+
*/
|
|
1091
|
+
declare function CTASelectorFieldOverride({ field, value, onChange, }: CTASelectorFieldProps): React__default.JSX.Element;
|
|
1030
1092
|
|
|
1031
1093
|
type MultiSelectorOptionValue = string | number | boolean;
|
|
1032
1094
|
type MultiSelectorOptionSelection<T extends MultiSelectorOptionValue> = {
|
|
@@ -1069,18 +1131,25 @@ type MultiSelectorOptions<T extends MultiSelectorOptionValue> = MultiSelectorOpt
|
|
|
1069
1131
|
*/
|
|
1070
1132
|
type MultiSelectorField<T extends MultiSelectorOptionValue = any> = BaseField & {
|
|
1071
1133
|
type: "multiSelector";
|
|
1134
|
+
/** Returns the selected values as an array before rendering. */
|
|
1135
|
+
transform?: boolean;
|
|
1072
1136
|
label: string | MsgString;
|
|
1073
1137
|
dropdownLabel: string | MsgString;
|
|
1074
1138
|
options: MultiSelectorOptions<T>;
|
|
1075
1139
|
placeholderOptionLabel?: string | MsgString;
|
|
1076
1140
|
};
|
|
1077
1141
|
type MultiSelectorFieldProps<T extends MultiSelectorOptionValue> = FieldProps<MultiSelectorField<T>, MultiSelectorValue<T> | undefined>;
|
|
1078
|
-
/**
|
|
1079
|
-
|
|
1142
|
+
/**
|
|
1143
|
+
* A multi-select field whose options may be static or loaded from a function.
|
|
1144
|
+
* Its declaration is available when the field registry initializes.
|
|
1145
|
+
*/
|
|
1146
|
+
declare function MultiSelectorFieldOverride<T extends MultiSelectorOptionValue>({ field, value, onChange, id, readOnly, }: MultiSelectorFieldProps<T>): React.JSX.Element;
|
|
1080
1147
|
|
|
1081
1148
|
type OptionalNumberValue = number | string | null | undefined;
|
|
1082
1149
|
type OptionalNumberField = BaseField & {
|
|
1083
1150
|
type: "optionalNumber";
|
|
1151
|
+
/** Returns a number or undefined before rendering. */
|
|
1152
|
+
transform?: boolean;
|
|
1084
1153
|
label?: string | MsgString;
|
|
1085
1154
|
hideNumberFieldRadioLabel: string | MsgString;
|
|
1086
1155
|
showNumberFieldRadioLabel: string | MsgString;
|
|
@@ -1089,11 +1158,55 @@ type OptionalNumberField = BaseField & {
|
|
|
1089
1158
|
type OptionalNumberFieldProps = FieldProps<OptionalNumberField, OptionalNumberValue>;
|
|
1090
1159
|
declare const OptionalNumberFieldOverride: ({ field, value, onChange, }: OptionalNumberFieldProps) => React__default.JSX.Element;
|
|
1091
1160
|
|
|
1161
|
+
/** Generation limits supplied by ALPHA, independently of prompt wording. */
|
|
1162
|
+
declare const generationSettingsSchema: z.ZodObject<{
|
|
1163
|
+
attemptTimeoutMs: z.ZodNumber;
|
|
1164
|
+
maxOutputTokens: z.ZodObject<{
|
|
1165
|
+
page: z.ZodNumber;
|
|
1166
|
+
prepare: z.ZodNumber;
|
|
1167
|
+
plan: z.ZodNumber;
|
|
1168
|
+
section: z.ZodNumber;
|
|
1169
|
+
}, z.core.$strict>;
|
|
1170
|
+
}, z.core.$strict>;
|
|
1171
|
+
type GenerationSettings = z.infer<typeof generationSettingsSchema>;
|
|
1172
|
+
|
|
1173
|
+
/** Contract version changes when keys or substitutions change. */
|
|
1174
|
+
declare const generationPromptBundleSchema: z.ZodObject<{
|
|
1175
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1176
|
+
prompts: z.ZodObject<{
|
|
1177
|
+
prepare: z.ZodString;
|
|
1178
|
+
create: z.ZodString;
|
|
1179
|
+
fullPageUpdate: z.ZodString;
|
|
1180
|
+
plan: z.ZodString;
|
|
1181
|
+
section: z.ZodString;
|
|
1182
|
+
}, z.core.$strict>;
|
|
1183
|
+
context: z.ZodObject<{
|
|
1184
|
+
createLists: z.ZodString;
|
|
1185
|
+
fullPageUpdateLists: z.ZodString;
|
|
1186
|
+
createRecommendations: z.ZodString;
|
|
1187
|
+
fullPageUpdateRecommendations: z.ZodString;
|
|
1188
|
+
}, z.core.$strict>;
|
|
1189
|
+
}, z.core.$strict>;
|
|
1190
|
+
type GenerationPromptBundle = z.infer<typeof generationPromptBundleSchema>;
|
|
1191
|
+
|
|
1092
1192
|
type HeadDeployStatus = "RUNNING" | "INACTIVE" | "FAILED" | "ACTIVE";
|
|
1193
|
+
type IntentPageGeneration = {
|
|
1194
|
+
prompt?: string;
|
|
1195
|
+
status?: "PENDING" | "RUNNING" | "FAILED" | "COMPLETED";
|
|
1196
|
+
attemptId?: string;
|
|
1197
|
+
};
|
|
1198
|
+
type AiPageGeneration = {
|
|
1199
|
+
prompts?: GenerationPromptBundle;
|
|
1200
|
+
generationSettings?: GenerationSettings;
|
|
1201
|
+
intentPageGeneration?: IntentPageGeneration;
|
|
1202
|
+
layoutGenerationEnabled: boolean;
|
|
1203
|
+
model: string;
|
|
1204
|
+
};
|
|
1093
1205
|
type TemplateMetadata = {
|
|
1206
|
+
aiPageGeneration?: AiPageGeneration;
|
|
1094
1207
|
siteId: number;
|
|
1095
1208
|
templateId: string;
|
|
1096
|
-
layoutId?:
|
|
1209
|
+
layoutId?: string;
|
|
1097
1210
|
entityId?: number;
|
|
1098
1211
|
themeEntityId?: number;
|
|
1099
1212
|
assignment: "ALL" | "ENTITY";
|
|
@@ -1161,6 +1274,8 @@ type ImagePayload = {
|
|
|
1161
1274
|
};
|
|
1162
1275
|
type ImageField = BaseField & {
|
|
1163
1276
|
type: "image";
|
|
1277
|
+
/** Localizes the asset image and resolves its alt text before rendering. */
|
|
1278
|
+
transform?: boolean;
|
|
1164
1279
|
label?: string | MsgString;
|
|
1165
1280
|
visible?: boolean;
|
|
1166
1281
|
hideAltTextField?: boolean;
|
|
@@ -1169,7 +1284,11 @@ type ImageField = BaseField & {
|
|
|
1169
1284
|
};
|
|
1170
1285
|
type ImageFieldOverrideProps = FieldProps<ImageField>;
|
|
1171
1286
|
declare const buildLocatorDisplayOptions: (locatorDisplayFields?: Record<string, FieldTypeData>) => EmbeddedStringOption[];
|
|
1172
|
-
|
|
1287
|
+
/**
|
|
1288
|
+
* Renders image field controls. Its declaration is available when the field
|
|
1289
|
+
* registry initializes.
|
|
1290
|
+
*/
|
|
1291
|
+
declare function ImageFieldOverride({ field, onChange, value, }: ImageFieldOverrideProps): React__default.JSX.Element;
|
|
1173
1292
|
|
|
1174
1293
|
/**
|
|
1175
1294
|
* Defines the core typography styling properties shared across text-based components.
|
|
@@ -1188,6 +1307,8 @@ type StyledButtonValue = BaseTextStyles & {
|
|
|
1188
1307
|
};
|
|
1189
1308
|
type StyledButtonField = BaseField & {
|
|
1190
1309
|
type: "styledButton";
|
|
1310
|
+
/** Converts authored button typography into CSS styles. */
|
|
1311
|
+
transform?: boolean;
|
|
1191
1312
|
label?: string | MsgString;
|
|
1192
1313
|
visible?: boolean;
|
|
1193
1314
|
};
|
|
@@ -1196,11 +1317,17 @@ declare const StyledButtonFieldOverride: ({ field, value, onChange, }: StyledBut
|
|
|
1196
1317
|
|
|
1197
1318
|
type StyledImageValue = {
|
|
1198
1319
|
borderRadius: ImageBorderRadius | "default";
|
|
1320
|
+
/** A positive ratio, or "default" to inherit the component's sizing. */
|
|
1321
|
+
aspectRatio?: number | "default";
|
|
1199
1322
|
};
|
|
1200
1323
|
type StyledImageField = BaseField & {
|
|
1201
1324
|
type: "styledImage";
|
|
1325
|
+
/** Converts the authored border radius and aspect ratio into CSS styles. */
|
|
1326
|
+
transform?: boolean;
|
|
1202
1327
|
label?: string | MsgString;
|
|
1203
1328
|
visible?: boolean;
|
|
1329
|
+
/** Shows the aspect-ratio control. Defaults to false. */
|
|
1330
|
+
includeAspectRatio?: boolean;
|
|
1204
1331
|
};
|
|
1205
1332
|
type StyledImageFieldProps = FieldProps<StyledImageField, StyledImageValue>;
|
|
1206
1333
|
declare const StyledImageFieldOverride: ({ field, value, onChange, }: StyledImageFieldProps) => React__default.JSX.Element;
|
|
@@ -1211,6 +1338,8 @@ type StyledLinkValue = BaseTextStyles & {
|
|
|
1211
1338
|
};
|
|
1212
1339
|
type StyledLinkField = BaseField & {
|
|
1213
1340
|
type: "styledLink";
|
|
1341
|
+
/** Converts authored link typography and caret choice into CSS styles. */
|
|
1342
|
+
transform?: boolean;
|
|
1214
1343
|
label?: string | MsgString;
|
|
1215
1344
|
visible?: boolean;
|
|
1216
1345
|
showIncludeCaretField?: boolean;
|
|
@@ -1230,6 +1359,8 @@ type ContentWidthValue = "default" | "768px" | "960px" | "1024px" | "1280px" | "
|
|
|
1230
1359
|
type VerticalPaddingValue = "default" | "0px" | "2px" | "4px" | "6px" | "8px" | "10px" | "12px" | "14px" | "16px" | "20px" | "24px" | "28px" | "32px" | "36px" | "40px" | "44px" | "48px" | "56px" | "64px" | "80px" | "96px";
|
|
1231
1360
|
type StyledPageSectionField = BaseField & {
|
|
1232
1361
|
type: "styledPageSection";
|
|
1362
|
+
/** Converts authored width and padding choices into CSS styles. */
|
|
1363
|
+
transform?: boolean;
|
|
1233
1364
|
label?: string | MsgString;
|
|
1234
1365
|
visible?: boolean;
|
|
1235
1366
|
};
|
|
@@ -1241,6 +1372,8 @@ type StyledTextValue = BaseTextStyles & {
|
|
|
1241
1372
|
};
|
|
1242
1373
|
type StyledTextField = BaseField & {
|
|
1243
1374
|
type: "styledText";
|
|
1375
|
+
/** Converts authored typography and color choices into CSS styles. */
|
|
1376
|
+
transform?: boolean;
|
|
1244
1377
|
label?: string | MsgString;
|
|
1245
1378
|
visible?: boolean;
|
|
1246
1379
|
includeColor?: boolean;
|
|
@@ -1251,6 +1384,8 @@ declare const StyledTextFieldOverride: ({ field, value, onChange, }: StyledTextF
|
|
|
1251
1384
|
|
|
1252
1385
|
type TranslatableStringField = BaseField & {
|
|
1253
1386
|
type: "translatableString";
|
|
1387
|
+
/** Localizes and interpolates this field before rendering. */
|
|
1388
|
+
transform?: boolean;
|
|
1254
1389
|
label?: string | MsgString;
|
|
1255
1390
|
visible?: boolean;
|
|
1256
1391
|
filter?: RenderEntityFieldFilter<any>;
|
|
@@ -1265,6 +1400,8 @@ declare const TranslatableStringFieldOverride: ({ field, onChange, value, }: Tra
|
|
|
1265
1400
|
|
|
1266
1401
|
type VideoField = BaseField & {
|
|
1267
1402
|
type: "video";
|
|
1403
|
+
/** Resolves embedded fields in the video asset before rendering. */
|
|
1404
|
+
transform?: boolean;
|
|
1268
1405
|
label?: string | MsgString;
|
|
1269
1406
|
visible?: boolean;
|
|
1270
1407
|
};
|
|
@@ -1369,15 +1506,131 @@ type ComprehensiveCTAValue = {
|
|
|
1369
1506
|
};
|
|
1370
1507
|
type ComprehensiveCTAField = BaseField & {
|
|
1371
1508
|
type: "comprehensiveCTA";
|
|
1509
|
+
/** Resolves CTA bindings and translated text before rendering. */
|
|
1510
|
+
transform?: boolean;
|
|
1372
1511
|
label?: string | MsgString;
|
|
1373
1512
|
visible?: boolean;
|
|
1374
1513
|
disableConstantValueToggle?: boolean;
|
|
1375
1514
|
};
|
|
1376
1515
|
type ComprehensiveCTAFieldProps = FieldProps<ComprehensiveCTAField, ComprehensiveCTAValue>;
|
|
1377
|
-
|
|
1516
|
+
/**
|
|
1517
|
+
* ComprehensiveCTAField imports YextAutoField, which uses the field override registry.
|
|
1518
|
+
* A function declaration lets the registry reference this override during module initialization.
|
|
1519
|
+
*/
|
|
1520
|
+
declare function ComprehensiveCTAFieldOverride({ field, value, onChange, }: ComprehensiveCTAFieldProps): React__default.JSX.Element;
|
|
1521
|
+
|
|
1522
|
+
type FieldTransformContext = {
|
|
1523
|
+
streamDocument: StreamDocument;
|
|
1524
|
+
locale: string;
|
|
1525
|
+
/** The complete linked item, including primitive list items. */
|
|
1526
|
+
itemDocument?: unknown;
|
|
1527
|
+
};
|
|
1528
|
+
|
|
1529
|
+
declare const alwaysTransformedFieldTypes: readonly ["code", "themeColor"];
|
|
1530
|
+
|
|
1531
|
+
/** Maps explicit entity-field formats to their render-value conversion. */
|
|
1532
|
+
declare const entityFieldFormatters: {
|
|
1533
|
+
price: (value: ProductPrice | undefined, context: FieldTransformContext) => string | undefined;
|
|
1534
|
+
};
|
|
1378
1535
|
|
|
1536
|
+
type LocalizedRenderValue<Value> = Value extends readonly (infer Item)[] ? LocalizedRenderValue<Item>[] : Value extends object ? "defaultValue" extends keyof Value ? LocalizedRenderValue<Value["defaultValue"]> : {
|
|
1537
|
+
[Key in keyof Value]: LocalizedRenderValue<Value[Key]>;
|
|
1538
|
+
} : Value;
|
|
1539
|
+
/** CTA data after localized text and links are resolved for rendering. */
|
|
1540
|
+
type ResolvedCTAValue = {
|
|
1541
|
+
link: string;
|
|
1542
|
+
label?: string;
|
|
1543
|
+
linkType?: LinkType;
|
|
1544
|
+
normalizeLink?: boolean;
|
|
1545
|
+
openInNewTab?: boolean;
|
|
1546
|
+
ctaType?: "textAndLink" | "getDirections" | "presetImage";
|
|
1547
|
+
};
|
|
1548
|
+
/** The presentation component consumes this data contract without resolving authored bindings. */
|
|
1549
|
+
type ResolvedComprehensiveCTAValue = Omit<ComprehensiveCTAValue, "data"> & {
|
|
1550
|
+
data: Omit<ComprehensiveCTAValue["data"], "cta" | "buttonText" | "ariaLabel"> & {
|
|
1551
|
+
cta: ResolvedCTAValue | undefined;
|
|
1552
|
+
buttonText?: string;
|
|
1553
|
+
ariaLabel?: string;
|
|
1554
|
+
};
|
|
1555
|
+
};
|
|
1556
|
+
/** Retains value-based inference for item sources with widened field definitions. */
|
|
1557
|
+
type ResolvedRepeatedValue<Value> = Value extends {
|
|
1558
|
+
constantValue: infer Constant;
|
|
1559
|
+
} ? LocalizedRenderValue<Constant> | undefined : Value extends ComprehensiveCTAValue ? ResolvedComprehensiveCTAValue : Value extends {
|
|
1560
|
+
selections: {
|
|
1561
|
+
value: infer Selection;
|
|
1562
|
+
}[];
|
|
1563
|
+
} ? Exclude<Selection, undefined>[] : Value extends readonly (infer Item)[] ? ResolvedRepeatedValue<Item>[] : Value extends object ? {
|
|
1564
|
+
[Key in keyof Value]: ResolvedRepeatedValue<Value[Key]>;
|
|
1565
|
+
} : Value;
|
|
1566
|
+
/** Repeated sources transform all mapped fields, even without a child opt-in. */
|
|
1567
|
+
type ResolvedRepeatedItem<Value, Definitions> = Value extends readonly (infer Item)[] ? ResolvedRepeatedItem<Item, Definitions>[] : {
|
|
1568
|
+
[Key in keyof Value]: Key extends keyof Definitions ? ResolvedRepeatedFieldValue<Value[Key], Definitions[Key]> : LocalizedRenderValue<Value[Key]>;
|
|
1569
|
+
};
|
|
1570
|
+
type ResolvedRepeatedFieldValue<Value, Definition> = YextFieldDefinition["type"] extends (Definition extends {
|
|
1571
|
+
type: infer FieldType;
|
|
1572
|
+
} ? FieldType : never) ? ResolvedRepeatedValue<Value> : Definition extends {
|
|
1573
|
+
type: "object";
|
|
1574
|
+
objectFields: infer Fields;
|
|
1575
|
+
} ? ResolvedRepeatedItem<Value, Fields> : Definition extends {
|
|
1576
|
+
type: "array";
|
|
1577
|
+
arrayFields: infer Fields;
|
|
1578
|
+
} ? ResolvedRepeatedItem<Value, Fields> : Definition extends {
|
|
1579
|
+
type: infer FieldType;
|
|
1580
|
+
} ? FieldType extends keyof TransformedFieldValues<Value, Definition> ? TransformedFieldValues<Value, Definition>[FieldType] : LocalizedRenderValue<Value> : LocalizedRenderValue<Value>;
|
|
1581
|
+
type TransformedFieldValues<Value, Definition> = {
|
|
1582
|
+
themeColor: ResolvedThemeColor | undefined;
|
|
1583
|
+
code: string;
|
|
1584
|
+
styledText: CSSProperties;
|
|
1585
|
+
styledButton: CSSProperties;
|
|
1586
|
+
styledLink: CSSProperties;
|
|
1587
|
+
styledImage: CSSProperties;
|
|
1588
|
+
styledPageSection: CSSProperties;
|
|
1589
|
+
translatableString: string;
|
|
1590
|
+
image: LocalizedRenderValue<Value>;
|
|
1591
|
+
video: LocalizedRenderValue<Value>;
|
|
1592
|
+
comprehensiveCTA: ResolvedComprehensiveCTAValue;
|
|
1593
|
+
multiSelector: Value extends {
|
|
1594
|
+
selections: {
|
|
1595
|
+
value: infer Selection;
|
|
1596
|
+
}[];
|
|
1597
|
+
} ? Exclude<Selection, undefined>[] : never;
|
|
1598
|
+
optionalNumber: number | undefined;
|
|
1599
|
+
ctaSelector: LocalizedRenderValue<EnhancedTranslatableCTA> | undefined;
|
|
1600
|
+
entityField: Definition extends {
|
|
1601
|
+
format: infer Format;
|
|
1602
|
+
} ? Format extends keyof typeof entityFieldFormatters ? ReturnType<(typeof entityFieldFormatters)[Format]> : never : Definition extends {
|
|
1603
|
+
repeated: {
|
|
1604
|
+
mappingFields: infer Fields;
|
|
1605
|
+
};
|
|
1606
|
+
} ? Value extends {
|
|
1607
|
+
constantValue: infer Constant;
|
|
1608
|
+
} ? ResolvedRepeatedItem<Constant, Fields> : never : Value extends {
|
|
1609
|
+
constantValue: infer Constant;
|
|
1610
|
+
} ? LocalizedRenderValue<Constant> | undefined : never;
|
|
1611
|
+
};
|
|
1612
|
+
/** Derives render prop types for nested object fields and array items; leaves other values unchanged. */
|
|
1613
|
+
type NestedFieldValue<Value, Definition> = Definition extends {
|
|
1614
|
+
type: "object";
|
|
1615
|
+
objectFields: object;
|
|
1616
|
+
} ? YextTransformedProps<Value, Definition["objectFields"]> : Definition extends {
|
|
1617
|
+
type: "array";
|
|
1618
|
+
arrayFields: object;
|
|
1619
|
+
} ? Value extends unknown[] ? YextTransformedProps<Value[number], Definition["arrayFields"]>[] : Value : Value;
|
|
1620
|
+
type TransformedFieldValue<Value, Definition> = Definition extends {
|
|
1621
|
+
transform: true;
|
|
1622
|
+
} | {
|
|
1623
|
+
type: (typeof alwaysTransformedFieldTypes)[number];
|
|
1624
|
+
} ? Definition extends {
|
|
1625
|
+
type: infer FieldType;
|
|
1626
|
+
} ? FieldType extends keyof TransformedFieldValues<Value, Definition> ? TransformedFieldValues<Value, Definition>[FieldType] : Value : Value : NestedFieldValue<Value, Definition>;
|
|
1627
|
+
/** Derives render values from authored props and supported field definitions. */
|
|
1628
|
+
type YextTransformedProps<Props, Definitions> = {
|
|
1629
|
+
[Key in keyof Props]: Key extends keyof Definitions ? TransformedFieldValue<Props[Key], Definitions[Key]> : Props[Key];
|
|
1630
|
+
};
|
|
1379
1631
|
type YextPuckFields = {
|
|
1380
1632
|
basicSelector: BasicSelectorField;
|
|
1633
|
+
themeColor: ThemeColorField;
|
|
1381
1634
|
ctaSelector: CTASelectorField;
|
|
1382
1635
|
code: CodeField;
|
|
1383
1636
|
comprehensiveCTA: ComprehensiveCTAField;
|
|
@@ -1412,11 +1665,24 @@ type YextObjectField<Props extends {
|
|
|
1412
1665
|
};
|
|
1413
1666
|
type YextCustomFieldRenderProps<ValueType> = Parameters<CustomField<ValueType>["render"]>[0];
|
|
1414
1667
|
type YextFieldDefinition<ValueType = any> = Field<ValueType, YextPuckField> | Field<NonNullable<ValueType>, YextPuckField> | YextPuckField | (ValueType extends Record<string, any>[] ? YextArrayField<ValueType> : never) | (ValueType extends Record<string, any> ? YextObjectField<ValueType> : never);
|
|
1415
|
-
|
|
1668
|
+
/**
|
|
1669
|
+
* Puck 0.24's deep slot mapper expands intersections such as CSS's `string & {}`
|
|
1670
|
+
* into string-method objects. Normalize broad primitives before Puck traverses
|
|
1671
|
+
* them, while retaining literal unions, brands, and Puck's built-in leaf types.
|
|
1672
|
+
*/
|
|
1673
|
+
type NormalizePuckPrimitives<Value> = Value extends string ? string extends Value ? string : Value : Value extends number ? number extends Value ? number : Value : Value extends Date | RegExp | Error | Function ? Value : Value extends object ? {
|
|
1674
|
+
[Key in keyof Value]: NormalizePuckPrimitives<Value[Key]>;
|
|
1675
|
+
} : Value;
|
|
1676
|
+
type YextComponentConfig<Props extends DefaultComponentProps = DefaultComponentProps, TransformFields = {}> = Omit<ComponentConfig<{
|
|
1416
1677
|
props: Props;
|
|
1417
1678
|
fields: YextPuckFields;
|
|
1418
|
-
}>, "fields" | "resolveFields"> & {
|
|
1679
|
+
}>, "fields" | "resolveFields" | "render"> & {
|
|
1680
|
+
render: ComponentConfig<{
|
|
1681
|
+
props: NormalizePuckPrimitives<YextTransformedProps<Props, TransformFields>>;
|
|
1682
|
+
fields: YextPuckFields;
|
|
1683
|
+
}>["render"];
|
|
1419
1684
|
fields?: YextFields<Props>;
|
|
1685
|
+
layoutGenerationMetadata?: LayoutGenerationMetadata;
|
|
1420
1686
|
resolveFields?: ComponentConfig<{
|
|
1421
1687
|
props: Props;
|
|
1422
1688
|
fields: YextPuckFields;
|
|
@@ -1447,19 +1713,30 @@ declare const toPuckFields: <Props extends DefaultComponentProps = DefaultCompon
|
|
|
1447
1713
|
* 2. Define the repeated entity-field value shape returned to consumers.
|
|
1448
1714
|
* 3. Define the resolved item shape returned by `resolveItems(...)`.
|
|
1449
1715
|
*/
|
|
1450
|
-
type CreateItemSourceOptions<TItemProps extends Record<string, unknown>> = {
|
|
1716
|
+
type CreateItemSourceOptions<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = {
|
|
1717
|
+
/** Label shown above the item source controls. */
|
|
1451
1718
|
label: string;
|
|
1452
|
-
|
|
1719
|
+
/**
|
|
1720
|
+
* Fields for each item. These define both the manual item inputs and the
|
|
1721
|
+
* mappings to fields within each object in a selected entity list.
|
|
1722
|
+
* A list can be selected when its item type or a child field matches any
|
|
1723
|
+
* mapping field filter.
|
|
1724
|
+
*/
|
|
1725
|
+
mappingFields: MappingFields;
|
|
1726
|
+
/** Initial manual items. The first item is also the template for new items. */
|
|
1453
1727
|
defaultValues?: TItemProps[];
|
|
1454
1728
|
};
|
|
1455
1729
|
type RepeatedEntityFieldValue<TItemProps extends Record<string, unknown>> = YextEntityField<TItemProps[], TItemProps>;
|
|
1456
|
-
type RepeatedEntityFieldMetadata<TItemProps extends Record<string, unknown>> = {
|
|
1457
|
-
mappingFields:
|
|
1730
|
+
type RepeatedEntityFieldMetadata<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = {
|
|
1731
|
+
mappingFields: MappingFields;
|
|
1458
1732
|
manualItemFields: YextFieldMap<TItemProps>;
|
|
1459
1733
|
defaultItemValue: TItemProps;
|
|
1460
1734
|
defaultMappings: TItemProps;
|
|
1461
1735
|
manualItemSummary?: (item: unknown, index?: number) => string;
|
|
1462
1736
|
};
|
|
1737
|
+
type RepeatedEntityFieldDefinition<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = EntityFieldSelectorField<RepeatedEntityFieldValue<TItemProps>> & {
|
|
1738
|
+
repeated: RepeatedEntityFieldMetadata<TItemProps, MappingFields>;
|
|
1739
|
+
};
|
|
1463
1740
|
/**
|
|
1464
1741
|
* Resolves authored item fields into the render-ready value shape returned
|
|
1465
1742
|
* from `ItemSourceInstance.resolveItems(...)`.
|
|
@@ -1470,8 +1747,8 @@ type ResolvedItemField<TValue> = TValue extends YextEntityField<infer TResolved,
|
|
|
1470
1747
|
/**
|
|
1471
1748
|
* Public contract returned by `createItemSource(...)`.
|
|
1472
1749
|
*/
|
|
1473
|
-
type ItemSourceInstance<TItemProps extends Record<string, unknown>> = {
|
|
1474
|
-
field:
|
|
1750
|
+
type ItemSourceInstance<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = {
|
|
1751
|
+
field: RepeatedEntityFieldDefinition<TItemProps, MappingFields>;
|
|
1475
1752
|
defaultValue: RepeatedEntityFieldValue<TItemProps>;
|
|
1476
1753
|
value: RepeatedEntityFieldValue<TItemProps>;
|
|
1477
1754
|
resolveItems: (value: RepeatedEntityFieldValue<TItemProps> | undefined, streamDocument: StreamDocument) => ResolvedItemField<TItemProps>[];
|
|
@@ -1487,8 +1764,14 @@ type CreateSlottedItemSourceOptions<TMappings extends Record<string, unknown>, T
|
|
|
1487
1764
|
defaultItemProps?: TCardProps | (() => TCardProps);
|
|
1488
1765
|
defaultItems?: number;
|
|
1489
1766
|
};
|
|
1767
|
+
/** Opt-in generation ownership for the helper's fixed data and CardSlot locations. */
|
|
1768
|
+
type SlottedItemSourceGenerationMetadata = {
|
|
1769
|
+
cardType: string;
|
|
1770
|
+
defaultItemProps?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
1771
|
+
};
|
|
1490
1772
|
type SlottedItemSourceInstance<TMappings extends Record<string, unknown>> = {
|
|
1491
1773
|
field: YextFieldDefinition<SlotMappedCardsData<TMappings>>;
|
|
1774
|
+
generationMetadata: SlottedItemSourceGenerationMetadata;
|
|
1492
1775
|
defaultValue: SlotMappedCardsData<TMappings>;
|
|
1493
1776
|
defaultWrapperProps: {
|
|
1494
1777
|
data: SlotMappedCardsData<TMappings>;
|
|
@@ -1516,6 +1799,10 @@ type SlottedItemSourceInstance<TMappings extends Record<string, unknown>> = {
|
|
|
1516
1799
|
|
|
1517
1800
|
type EntityFieldSelectorField<T extends Record<string, any> = Record<string, any>> = BaseField & {
|
|
1518
1801
|
type: "entityField";
|
|
1802
|
+
/** Resolves this field before rendering. Repeated sources are not supported. */
|
|
1803
|
+
transform?: boolean;
|
|
1804
|
+
/** Formats a resolved structured price as localized currency when transformed. */
|
|
1805
|
+
format?: "price";
|
|
1519
1806
|
label?: string | MsgString;
|
|
1520
1807
|
visible?: boolean;
|
|
1521
1808
|
filter: MappedSourceFieldFilter<T>;
|
|
@@ -1536,7 +1823,11 @@ type EntityFieldSelectorField<T extends Record<string, any> = Record<string, any
|
|
|
1536
1823
|
repeated?: RepeatedEntityFieldMetadata<any>;
|
|
1537
1824
|
};
|
|
1538
1825
|
type EntityFieldSelectorFieldProps = FieldProps<EntityFieldSelectorField>;
|
|
1539
|
-
|
|
1826
|
+
/**
|
|
1827
|
+
* Renders entity field controls. Its declaration is available when the field
|
|
1828
|
+
* registry initializes.
|
|
1829
|
+
*/
|
|
1830
|
+
declare function EntityFieldSelectorFieldOverride({ field, value, onChange, }: EntityFieldSelectorFieldProps): React__default.JSX.Element;
|
|
1540
1831
|
declare const ConstantValueModeToggler: ({ fieldTypeFilter, constantValueEnabled, toggleConstantValueEnabled, disableConstantValue, label, showLocale, infoTooltipRequirements, }: {
|
|
1541
1832
|
fieldTypeFilter: EntityFieldTypes[];
|
|
1542
1833
|
constantValueEnabled: boolean;
|
|
@@ -1683,7 +1974,7 @@ declare const AccordionTrigger: React__default.ForwardRefExoticComponent<React__
|
|
|
1683
1974
|
declare const AccordionContent: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
|
|
1684
1975
|
|
|
1685
1976
|
interface BackgroundProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1686
|
-
background?: ThemeColor;
|
|
1977
|
+
background?: ThemeColor | ResolvedThemeColor;
|
|
1687
1978
|
as?: "div" | "section" | "nav" | "header" | "footer" | "main" | "aside";
|
|
1688
1979
|
}
|
|
1689
1980
|
declare const Background: React.ForwardRefExoticComponent<BackgroundProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1782,7 +2073,7 @@ declare const maxWidthVariants: (props?: ({
|
|
|
1782
2073
|
maxWidth?: "768px" | "960px" | "1024px" | "1280px" | "1440px" | "theme" | "fullWidth" | null | undefined;
|
|
1783
2074
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1784
2075
|
interface PageSectionProps extends VariantProps<typeof maxWidthVariants>, React.HTMLAttributes<HTMLDivElement> {
|
|
1785
|
-
background?: ThemeColor;
|
|
2076
|
+
background?: ThemeColor | ResolvedThemeColor;
|
|
1786
2077
|
verticalPadding?: VariantProps<typeof pageSectionVariants>["verticalPadding"];
|
|
1787
2078
|
as?: "div" | "section" | "nav" | "header" | "footer" | "main" | "aside";
|
|
1788
2079
|
outerClassName?: string;
|
|
@@ -1847,4 +2138,32 @@ declare function isLocatorEntityType(value: string): value is LocatorEntityType;
|
|
|
1847
2138
|
declare const getLocatorEntityTypeSourceMap: (streamDocument?: StreamDocument) => Partial<Record<LocatorEntityType, string | undefined>>;
|
|
1848
2139
|
declare const getEntityTypeLabel: (entityType: LocatorEntityType) => string;
|
|
1849
2140
|
|
|
1850
|
-
|
|
2141
|
+
type RichTextStyleOverrides = Partial<BaseTextStyles> & {
|
|
2142
|
+
color?: ThemeColor | string;
|
|
2143
|
+
};
|
|
2144
|
+
interface MaybeRTFProps extends Record<string, any> {
|
|
2145
|
+
data: RichText | string | undefined;
|
|
2146
|
+
bodyVariant?: BodyProps["variant"];
|
|
2147
|
+
/** Override the theme's styling */
|
|
2148
|
+
richTextStyleOverrides?: RichTextStyleOverrides;
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Renders plain strings through the shared `Body` component and rich text HTML
|
|
2152
|
+
* through the standard `rtf-wrapper` container while applying shared rich-text
|
|
2153
|
+
* typography and color overrides.
|
|
2154
|
+
*/
|
|
2155
|
+
declare const MaybeRTF: ({ data, bodyVariant, richTextStyleOverrides, style, className, ...props }: MaybeRTFProps) => React.JSX.Element;
|
|
2156
|
+
|
|
2157
|
+
/**
|
|
2158
|
+
* Creates render transforms for one page and locale.
|
|
2159
|
+
*
|
|
2160
|
+
* 1. Identify always-transformed and opted-in authored fields, including fields adapted to `custom`.
|
|
2161
|
+
* 2. Dispatch source resolution to the field handler, sharing localization and interpolation.
|
|
2162
|
+
* 3. Register handlers with Puck while preserving resolved data shapes for their renderers.
|
|
2163
|
+
* Authored values are never mutated or replaced in saved Puck data.
|
|
2164
|
+
*/
|
|
2165
|
+
declare function createYextFieldTransforms(streamDocument: StreamDocument, locale: string): Record<string, FieldTransformFn<BaseField & {
|
|
2166
|
+
type: string;
|
|
2167
|
+
}>>;
|
|
2168
|
+
|
|
2169
|
+
export { type StyledPageSectionValue as $, type AiPageGeneration as A, type BasicSelectorField as B, type CreateItemSourceOptions as C, type DateTimeSelectorField as D, type EntityFieldTypes as E, type FontRegistry as F, EntityFieldSelectorFieldOverride as G, type HeadingProps as H, type ItemSourceInstance as I, MultiSelectorFieldOverride as J, type FontSizeSelectorField as K, type LocatorEntityType as L, type MsgString as M, ImageFieldOverride as N, type OptionalNumberField as O, type ProductPrice as P, type StyledButtonField as Q, type RichText as R, type StreamFields as S, type TranslationDictionary as T, type StyledButtonValue as U, type StyledImageField as V, type StyledImageValue as W, type StyledLinkField as X, type YextFieldMap as Y, type StyledLinkValue as Z, type StyledPageSectionField as _, type StreamDocument as a, type MultiSelectorOption as a$, type StyledTextField as a0, type TranslatableStringField as a1, type VideoField as a2, type AssetVideo as a3, type SectionLibraryTranslationLoaders as a4, Accordion as a5, AccordionContent as a6, AccordionItem as a7, AccordionTrigger as a8, type AssetImageType as a9, type FAQStruct as aA, FOOD_DELIVERY_SERVICES as aB, type FieldGenerationMetadata as aC, type Font as aD, FontSizeSelectorFieldOverride as aE, type FoodDeliveryServiceType as aF, type GenerationPromptBundle as aG, type GenerationSettings as aH, Heading as aI, type HeroSectionType as aJ, HoursStatusAtom as aK, type HoursStatusAtomProps as aL, HoursTableAtom as aM, type HoursTableAtomProps as aN, Image as aO, type ImageContentData as aP, type ImageField as aQ, type ImageProps as aR, type InsightSectionType as aS, type InsightStruct as aT, type LayoutGenerationMetadata as aU, type LocalizedAssetImage as aV, MaybeLink as aW, type MaybeLinkProps as aX, MaybeRTF as aY, type MaybeRTFProps as aZ, type MultiSelectorField as a_, Background as aa, type BackgroundProps as ab, BackgroundProvider as ac, BasicSelectorFieldOverride as ad, Body as ae, type BreadcrumbLink as af, Button as ag, type ButtonProps as ah, CTA as ai, type CTASelectorField as aj, CodeFieldOverride as ak, type ComprehensiveCTAField as al, type CreateSlottedItemSourceOptions as am, DateTimeSelectorFieldOverride as an, DropdownMenu as ao, DropdownMenuContent as ap, DropdownMenuItem as aq, DropdownMenuTrigger as ar, EmbeddedFieldStringInputFromEntity as as, EmbeddedFieldStringInputFromOptions as at, type EnhancedTranslatableCTA as au, EntityField as av, type EntityFieldSelectorField as aw, type EventSectionType as ax, type EventStruct as ay, type FAQSectionType as az, type ThemeConfig as b, fetchLocalesToPathsForEntity as b$, type MultiSelectorOptionValue as b0, type MultiSelectorOptions as b1, OptionalNumberFieldOverride as b2, PageSection as b3, type PageSectionProps as b4, type PersonStruct as b5, PhoneAtom as b6, type PhoneAtomProps as b7, type PresetImageType as b8, type ProductSectionType as b9, VisibilityWrapper as bA, VisualEditorComponentsContentPath as bB, VisualEditorThemeClassSafelist as bC, type YextArrayField as bD, YextAutoField as bE, type YextCTAField as bF, type YextCustomFieldRenderProps as bG, YextEntityFieldSelector as bH, type YextFieldDefinition as bI, type YextFields as bJ, type YextObjectField as bK, type YextPuckField as bL, type YextSchemaField as bM, type YextSchemaFieldDefinition as bN, type YextTransformedProps as bO, backgroundColors as bP, bindSlots as bQ, bodyVariants as bR, buttonVariants as bS, constructFontSelectOptions as bT, createSearchAnalyticsConfig as bU, createSearchHeadlessConfig as bV, createSlottedItemSource as bW, createYextFieldTransforms as bX, deepMerge as bY, defaultFonts as bZ, defaultThemeTailwindExtensions as b_, type ProductStruct as ba, type PromoSectionType as bb, type RenderYextEntityFieldSelectorProps as bc, type ResolvedThemeColor as bd, type RichTextStyleOverrides as be, type SlottedItemSourceGenerationMetadata as bf, StyledButtonFieldOverride as bg, StyledImageFieldOverride as bh, StyledLinkFieldOverride as bi, StyledPageSectionFieldOverride as bj, StyledTextFieldOverride as bk, type TeamSectionType as bl, TemplatePropsContext as bm, type TestimonialSectionType as bn, type TestimonialStruct as bo, ThemeColorFieldOverride as bp, TimestampAtom as bq, type TimestampAtomProps as br, TimestampOption as bs, type TranslatableCTA as bt, TranslatableStringFieldOverride as bu, type TranslationLoader as bv, type TranslationLoaders as bw, VideoAtom as bx, type VideoAtomProps as by, VideoFieldOverride as bz, type TailwindConfig as c, isColorContrastWcagCompliant as c$, generationPromptBundleSchema as c0, generationSettingsSchema as c1, getDefaultForegroundColor as c2, getFontWeightOptions as c3, getFontWeightOverrideOptions as c4, getPageMetadata as c5, getPreferredDistanceUnit as c6, getSurfaceColorStyle as c7, getThemeColorCssValue as c8, getThemeColorHexValue as c9, type SlotMappedCardsData as cA, type ComboboxOptionGroup as cB, ConstantValueModeToggler as cC, DEFAULT_ENTITY_TYPE as cD, type EmbeddedStringOption as cE, EntityTooltipsProvider as cF, type FieldResolution as cG, type FieldTypeData as cH, type ImagePayload as cI, LOCATOR_ENTITY_TYPES as cJ, type LocatorConfig as cK, type RootConfig as cL, buildLocatorDisplayOptions as cM, findField as cN, formatDistance as cO, formatPhoneNumber as cP, fromMeters as cQ, getBackgroundColorClasses as cR, getBackgroundColorStyle as cS, getCTAType as cT, getDisplayValue as cU, getEntityTypeLabel as cV, getImageAltText as cW, getLocatorEntityTypeSourceMap as cX, getTextColorClass as cY, getTextColorStyle as cZ, hexToRGB as c_, headingVariants as ca, imgSizesHelper as cb, isDarkColor as cc, isLocalizedAssetImage as cd, mergeMeta as ce, msg as cf, normalizeLink as cg, normalizeSlug as ch, normalizeThemeColorToken as ci, pt as cj, resolveBreadcrumbs as ck, resolveComponentData as cl, resolveDataFromParent as cm, resolveLocalizedAssetImage as cn, resolveUrlTemplate as co, resolveUrlTemplateOfChild as cp, resolveYextEntityField as cq, themeManagerCn as cr, themeManagerTwMergeConfiguration as cs, themeResolver as ct, toKilometers as cu, toPuckFields as cv, useBackground as cw, useDocument as cx, usePlatformTranslation as cy, useTemplateProps as cz, type ComponentRegistry as d, isCtaVariantWithColor as d0, isLocatorEntityType as d1, isNonNormalizableLinkType as d2, loadTranslationDictionary as d3, resolveDirectoryRootProps as d4, resolveField as d5, toMeters as d6, toMiles as d7, useEntityTooltips as d8, useTemplateMetadata as d9, type TranslatableRichText as e, ThemeOptions as f, type ThemeColor as g, type YextComponentConfig as h, type YextEntityField as i, type CTAVariant as j, type TranslatableString as k, type HeadingLevel as l, type ImageFillType as m, type TranslatableAssetImage as n, type ImgSizesByBreakpoint as o, type SlottedItemSourceInstance as p, type BodyProps as q, type MultiSelectorValue as r, type StyledTextValue as s, type ComprehensiveCTAValue as t, type ResolvedComprehensiveCTAValue as u, type CTAProps as v, type ThemeColorField as w, CTASelectorFieldOverride as x, type CodeField as y, ComprehensiveCTAFieldOverride as z };
|