@yext/visual-editor 1.4.14 → 2.0.0-beta.10
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-DN65KSX7.js +119824 -0
- package/dist/SectionLibraryVisualEditorProvider.css +1 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/Address.tsx +251 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HeadingText.tsx +147 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursStatus.tsx +157 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursTable.tsx +164 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/MapboxStaticMap.tsx +205 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/Phone.tsx +155 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/EmptyImageState.tsx +168 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/Image.tsx +275 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/styling.ts +66 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/index.ts +13 -0
- package/dist/cli/assets/directory-locator-source/components/sections/Breadcrumbs.tsx +298 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.test.tsx +872 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx +298 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryCard.tsx +507 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx +499 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.test.tsx +226 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.tsx +98 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.test.tsx +147 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.tsx +691 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.test.tsx +1551 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.tsx +541 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorFields.test.ts +43 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorResultCard.tsx +1594 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorWrapper.tsx +1157 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Map.tsx +304 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/MapPinIcon.tsx +160 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Results.tsx +267 -0
- package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +277 -0
- package/dist/cli/yextve.js +16992 -0
- package/dist/createYextFieldTransforms-CrIkiJ_X.d.ts +2157 -0
- package/dist/index.d.ts +534 -6352
- package/dist/locales/page/cs/visual-editor.json +85 -0
- package/dist/locales/page/da/visual-editor.json +73 -0
- package/dist/locales/page/de/visual-editor.json +73 -0
- package/dist/locales/page/en/visual-editor.json +73 -0
- package/dist/locales/page/en-GB/visual-editor.json +73 -0
- package/dist/locales/page/es/visual-editor.json +79 -0
- package/dist/locales/page/et/visual-editor.json +73 -0
- package/dist/locales/page/fi/visual-editor.json +73 -0
- package/dist/locales/page/fr/visual-editor.json +79 -0
- package/dist/locales/page/hr/visual-editor.json +79 -0
- package/dist/locales/page/hu/visual-editor.json +73 -0
- package/dist/locales/page/it/visual-editor.json +79 -0
- package/dist/locales/page/ja/visual-editor.json +73 -0
- package/dist/locales/page/lt/visual-editor.json +85 -0
- package/dist/locales/page/lv/visual-editor.json +77 -0
- package/dist/locales/page/nb/visual-editor.json +73 -0
- package/dist/locales/page/nl/visual-editor.json +73 -0
- package/dist/locales/page/pl/visual-editor.json +85 -0
- package/dist/locales/page/pt/visual-editor.json +79 -0
- package/dist/locales/page/ro/visual-editor.json +79 -0
- package/dist/locales/page/sk/visual-editor.json +85 -0
- package/dist/locales/page/sv/visual-editor.json +73 -0
- package/dist/locales/page/tr/visual-editor.json +73 -0
- package/dist/locales/page/zh/visual-editor.json +73 -0
- package/dist/locales/page/zh-TW/visual-editor.json +73 -0
- package/dist/locales/platform/cs/visual-editor.json +651 -0
- package/dist/locales/platform/da/visual-editor.json +625 -0
- package/dist/locales/platform/de/visual-editor.json +625 -0
- package/dist/locales/platform/en/visual-editor.json +625 -0
- package/dist/locales/platform/en-GB/visual-editor.json +625 -0
- package/dist/locales/platform/es/visual-editor.json +638 -0
- package/dist/locales/platform/et/visual-editor.json +625 -0
- package/dist/locales/platform/fi/visual-editor.json +625 -0
- package/dist/locales/platform/fr/visual-editor.json +638 -0
- package/dist/locales/platform/hr/visual-editor.json +638 -0
- package/dist/locales/platform/hu/visual-editor.json +625 -0
- package/dist/locales/platform/it/visual-editor.json +638 -0
- package/dist/locales/platform/ja/visual-editor.json +625 -0
- package/dist/locales/platform/lt/visual-editor.json +651 -0
- package/dist/locales/platform/lv/visual-editor.json +633 -0
- package/dist/locales/platform/nb/visual-editor.json +625 -0
- package/dist/locales/platform/nl/visual-editor.json +625 -0
- package/dist/locales/platform/pl/visual-editor.json +651 -0
- package/dist/locales/platform/pt/visual-editor.json +638 -0
- package/dist/locales/platform/ro/visual-editor.json +638 -0
- package/dist/locales/platform/sk/visual-editor.json +651 -0
- package/dist/locales/platform/sv/visual-editor.json +625 -0
- package/dist/locales/platform/tr/visual-editor.json +625 -0
- package/dist/locales/platform/zh/visual-editor.json +625 -0
- package/dist/locales/platform/zh-TW/visual-editor.json +625 -0
- package/dist/plugin/internal/layoutGeneration/limits.d.ts +28 -0
- package/dist/plugin/internal/sectionLibraryValidation/builtInTranslationResources.d.ts +3 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/api/api.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/api/libraryMetadata.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/importRules.d.ts +13 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/validateCode.d.ts +10 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/xssRules.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/structure/structure.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/types.d.ts +48 -0
- package/dist/plugin/internal/sectionLibraryValidation/validateSectionLibrary.d.ts +8 -0
- package/dist/plugin/internal/sectionLibraryValidation/validationError.d.ts +6 -0
- package/dist/plugin/plugin.js +7013 -5873
- package/dist/plugin/types/entityFields.d.ts +21 -0
- package/dist/plugin/types/generationPrompts.d.ts +19 -0
- package/dist/plugin/types/generationSettings.d.ts +12 -0
- package/dist/plugin/types/images.d.ts +62 -0
- package/dist/plugin/types/sectionLibrary.d.ts +101 -0
- package/dist/plugin/types/types.d.ts +204 -0
- package/dist/plugin/types/videos.d.ts +24 -0
- package/dist/plugin/utils/i18n/locales.d.ts +5 -0
- package/dist/plugin/utils/i18n/translationResources.d.ts +41 -0
- package/dist/plugin/utils/normalizeLocale.d.ts +8 -0
- package/dist/plugin/utils/plainText.d.ts +6 -0
- package/dist/plugin/vite-plugin/index.d.ts +2 -0
- 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 +20 -0
- package/dist/plugin/vite-plugin/local-editor/config.d.ts +11 -0
- package/dist/plugin/vite-plugin/local-editor/data.d.ts +12 -0
- package/dist/plugin/vite-plugin/local-editor/entityFields.d.ts +13 -0
- package/dist/plugin/vite-plugin/local-editor/fixtureData.d.ts +12 -0
- package/dist/plugin/vite-plugin/local-editor/generatedFiles.d.ts +33 -0
- package/dist/plugin/vite-plugin/local-editor/server.d.ts +34 -0
- package/dist/plugin/vite-plugin/local-editor/types.d.ts +125 -0
- package/dist/plugin/vite-plugin/local-editor/utils.d.ts +16 -0
- package/dist/plugin/vite-plugin/plugin.d.ts +8 -0
- package/dist/plugin/vite-plugin/section-library/migrationRegistry.d.ts +6 -0
- package/dist/plugin/vite-plugin/section-library/sectionFrontmatter.d.ts +3 -0
- package/dist/plugin/vite-plugin/section-library/sectionLibraryGenerator.d.ts +21 -0
- package/dist/plugin/vite-plugin/section-library/sharedComponentRegistry.d.ts +16 -0
- package/dist/section-library-support.js +178 -0
- package/dist/sectionLibrarySupport.d.ts +703 -0
- 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-BXYlpe7B.js +145 -0
- package/dist/visual-editor-BruRrJYN.js +804 -0
- package/dist/visual-editor-Bs3wAslG.js +804 -0
- package/dist/visual-editor-Bxy81Ezy.js +145 -0
- package/dist/visual-editor-C0vq2BRM.js +145 -0
- package/dist/visual-editor-C9TLeAzP.js +804 -0
- package/dist/visual-editor-CCgmYV5S.js +169 -0
- package/dist/visual-editor-CERViyTJ.js +145 -0
- package/dist/visual-editor-CHWtMtlu.js +823 -0
- package/dist/visual-editor-CcfUKpnd.js +804 -0
- package/dist/visual-editor-CjORnP1D.js +169 -0
- package/dist/visual-editor-ClC6hoz3.js +804 -0
- package/dist/visual-editor-CmomGJB8.js +157 -0
- package/dist/visual-editor-CtQwadxQ.js +842 -0
- package/dist/visual-editor-Cymg8ID2.js +169 -0
- package/dist/visual-editor-D2Hk1nhM.js +145 -0
- package/dist/visual-editor-D7VeTRK_.js +816 -0
- package/dist/visual-editor-D8MRFn5x.js +157 -0
- package/dist/visual-editor-DOXtCqRv.js +145 -0
- package/dist/visual-editor-DQEd3xwY.js +145 -0
- package/dist/visual-editor-DTE5kxrA.js +804 -0
- package/dist/visual-editor-DUngIOnE.js +157 -0
- package/dist/visual-editor-DeZVZYfd.js +169 -0
- package/dist/visual-editor-DfJMZpiP.js +145 -0
- package/dist/visual-editor-DgAsQK9D.js +145 -0
- package/dist/visual-editor-Dhi__-7_.js +145 -0
- package/dist/visual-editor-DjTEbi-1.js +842 -0
- package/dist/visual-editor-DjdqpJU-.js +145 -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-DvuH3jyL.js +157 -0
- package/dist/visual-editor-LXMNWXry.js +823 -0
- package/dist/visual-editor-QpGupjY5.js +823 -0
- package/dist/visual-editor-TfVDfO5_.js +145 -0
- package/dist/visual-editor-W_ZDmMFn.js +145 -0
- package/dist/visual-editor-_TatCCAS.js +804 -0
- package/dist/visual-editor-b7ALusk8.js +145 -0
- package/dist/visual-editor-erGXf3kS.js +157 -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-xnDHZFuO.js +153 -0
- package/dist/visual-editor-yiWZqIH0.js +157 -0
- package/dist/visual-editor-zKhC7_0C.js +823 -0
- package/dist/visual-editor.css +1 -0
- package/dist/visual-editor.js +18578 -137536
- package/package.json +50 -26
- package/dist/editor.css +0 -1
- package/dist/visual-editor-6pnSx-yp.js +0 -223
- package/dist/visual-editor-9ZW3nq5u.js +0 -247
- package/dist/visual-editor-B1RXDqNi.js +0 -1063
- package/dist/visual-editor-BAahiZ1l.js +0 -223
- package/dist/visual-editor-BC2LjdoF.js +0 -223
- package/dist/visual-editor-BPnfBfk1.js +0 -1051
- package/dist/visual-editor-BQiE5eVW.js +0 -1051
- package/dist/visual-editor-BTv-6Pnk.js +0 -1051
- package/dist/visual-editor-BUWp03gX.js +0 -235
- package/dist/visual-editor-Bb3c6iGV.js +0 -223
- package/dist/visual-editor-BipczqTj.js +0 -1075
- package/dist/visual-editor-BlIUd_n_.js +0 -1051
- package/dist/visual-editor-BoPLXEu2.js +0 -223
- package/dist/visual-editor-Bzmpi_9a.js +0 -1063
- package/dist/visual-editor-C38IiBTR.js +0 -235
- package/dist/visual-editor-C9tacnim.js +0 -247
- package/dist/visual-editor-CVa3iu5h.js +0 -1051
- package/dist/visual-editor-CXTL8Ik0.js +0 -1051
- package/dist/visual-editor-CYeahjFX.js +0 -231
- package/dist/visual-editor-CZ2SM6Jc.js +0 -1063
- package/dist/visual-editor-CZDmQI-A.js +0 -1063
- package/dist/visual-editor-C_cHJ6BN.js +0 -1051
- package/dist/visual-editor-Cf3nFbw3.js +0 -235
- package/dist/visual-editor-CiR0metz.js +0 -1051
- package/dist/visual-editor-CoX_NnS-.js +0 -223
- package/dist/visual-editor-Cu8II23Y.js +0 -223
- package/dist/visual-editor-CvXFxocc.js +0 -1063
- package/dist/visual-editor-Cxu6nkib.js +0 -1051
- package/dist/visual-editor-D-3VVfjR.js +0 -223
- package/dist/visual-editor-D-ktbg7q.js +0 -223
- package/dist/visual-editor-D9G5eAAU.js +0 -1051
- package/dist/visual-editor-D9MrqEya.js +0 -223
- package/dist/visual-editor-DAKXBbjV.js +0 -1075
- package/dist/visual-editor-DBmJk7ZR.js +0 -235
- package/dist/visual-editor-DG-c2LU9.js +0 -1051
- package/dist/visual-editor-DI_Vk989.js +0 -1051
- package/dist/visual-editor-DOOYgnjP.js +0 -235
- package/dist/visual-editor-DRx3Ax_O.js +0 -1075
- package/dist/visual-editor-DZ66sria.js +0 -1051
- package/dist/visual-editor-DZTPhYcr.js +0 -247
- package/dist/visual-editor-DcH7WJVI.js +0 -223
- package/dist/visual-editor-DdYXgEbR.js +0 -1059
- package/dist/visual-editor-DeWzgcue.js +0 -1063
- package/dist/visual-editor-Dm5ZNn8C.js +0 -223
- package/dist/visual-editor-DqLCIWPQ.js +0 -1051
- package/dist/visual-editor-NoU28r5Y.js +0 -223
- package/dist/visual-editor-WjrJ9nPc.js +0 -235
- package/dist/visual-editor-_h-sdbID.js +0 -223
- package/dist/visual-editor-r4gSQqFM.js +0 -1075
- package/dist/visual-editor-ujQ29mao.js +0 -247
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type YextSchemaField = {
|
|
2
|
+
name: string;
|
|
3
|
+
displayName?: string;
|
|
4
|
+
definition: YextSchemaFieldDefinition;
|
|
5
|
+
children?: {
|
|
6
|
+
fields: YextSchemaField[];
|
|
7
|
+
};
|
|
8
|
+
optionFormat?: "OPTION_FORMAT_EXPANDED";
|
|
9
|
+
};
|
|
10
|
+
export type YextSchemaFieldDefinition = {
|
|
11
|
+
name: string;
|
|
12
|
+
isList?: boolean;
|
|
13
|
+
registryId?: string;
|
|
14
|
+
typeName?: string;
|
|
15
|
+
typeRegistryId?: string;
|
|
16
|
+
type: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
export type StreamFields = {
|
|
19
|
+
fields: YextSchemaField[];
|
|
20
|
+
displayNames?: Record<string, string>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Contract version changes when keys or substitutions change. */
|
|
3
|
+
export declare const generationPromptBundleSchema: z.ZodObject<{
|
|
4
|
+
contractVersion: z.ZodLiteral<1>;
|
|
5
|
+
prompts: z.ZodObject<{
|
|
6
|
+
prepare: z.ZodString;
|
|
7
|
+
create: z.ZodString;
|
|
8
|
+
fullPageUpdate: z.ZodString;
|
|
9
|
+
plan: z.ZodString;
|
|
10
|
+
section: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
context: z.ZodObject<{
|
|
13
|
+
createLists: z.ZodString;
|
|
14
|
+
fullPageUpdateLists: z.ZodString;
|
|
15
|
+
createRecommendations: z.ZodString;
|
|
16
|
+
fullPageUpdateRecommendations: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type GenerationPromptBundle = z.infer<typeof generationPromptBundleSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Generation limits supplied by ALPHA, independently of prompt wording. */
|
|
3
|
+
export declare const generationSettingsSchema: z.ZodObject<{
|
|
4
|
+
attemptTimeoutMs: z.ZodNumber;
|
|
5
|
+
maxOutputTokens: z.ZodObject<{
|
|
6
|
+
page: z.ZodNumber;
|
|
7
|
+
prepare: z.ZodNumber;
|
|
8
|
+
plan: z.ZodNumber;
|
|
9
|
+
section: z.ZodNumber;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type GenerationSettings = z.infer<typeof generationSettingsSchema>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ImageType } from "@yext/pages-components";
|
|
2
|
+
import { TranslatableString } from "./types.ts";
|
|
3
|
+
/** Describes the possible image fill types. */
|
|
4
|
+
export type ImageFillType = "fill" | "fit";
|
|
5
|
+
/** Describes an image's aspect ratio. */
|
|
6
|
+
type ImageAspectRatio = {
|
|
7
|
+
horizontalFactor: number;
|
|
8
|
+
verticalFactor: number;
|
|
9
|
+
};
|
|
10
|
+
/** Describes the dimensions of an image. */
|
|
11
|
+
type ImageDimension = {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
/** Describes the data corresponding to a single image. */
|
|
16
|
+
type ImageData = {
|
|
17
|
+
url: string;
|
|
18
|
+
dimension?: ImageDimension;
|
|
19
|
+
exifMetadata?: {
|
|
20
|
+
rotate: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** Describes the data corresponding to an image rotation. */
|
|
24
|
+
type ImageRotation = {
|
|
25
|
+
degree: number;
|
|
26
|
+
};
|
|
27
|
+
/** Describes the crop boundary box data */
|
|
28
|
+
type ImageCrop = {
|
|
29
|
+
left: number;
|
|
30
|
+
top: number;
|
|
31
|
+
height: number;
|
|
32
|
+
width: number;
|
|
33
|
+
aspectRatio?: ImageAspectRatio;
|
|
34
|
+
};
|
|
35
|
+
type TransformKind = "CROP" | "ROTATION";
|
|
36
|
+
/** Outlines the possible image transformations. */
|
|
37
|
+
type ImageTransformation = ImageRotation | ImageCrop;
|
|
38
|
+
type ImageTransformations = Partial<Record<TransformKind, ImageTransformation>>;
|
|
39
|
+
/** Describes the data corresponding to a piece of image content. */
|
|
40
|
+
export type ImageContentData = {
|
|
41
|
+
name?: string;
|
|
42
|
+
transformedImage?: ImageData;
|
|
43
|
+
originalImage?: ImageData;
|
|
44
|
+
childImages?: ImageData[];
|
|
45
|
+
transformations?: ImageTransformations;
|
|
46
|
+
sourceUrl?: string;
|
|
47
|
+
altText?: string;
|
|
48
|
+
};
|
|
49
|
+
export type AssetImageType = Omit<ImageType, "alternateText"> & {
|
|
50
|
+
alternateText?: TranslatableString;
|
|
51
|
+
assetImage?: ImageContentData;
|
|
52
|
+
};
|
|
53
|
+
export type LocalizedAssetImage = {
|
|
54
|
+
hasLocalizedValue?: "true";
|
|
55
|
+
defaultValue?: AssetImageType;
|
|
56
|
+
} & {
|
|
57
|
+
[locale: string]: AssetImageType | undefined;
|
|
58
|
+
};
|
|
59
|
+
export type TranslatableAssetImage = AssetImageType | LocalizedAssetImage;
|
|
60
|
+
export declare const isLocalizedAssetImage: (value: unknown) => value is LocalizedAssetImage;
|
|
61
|
+
export declare const resolveLocalizedAssetImage: (value: TranslatableAssetImage | ImageType | undefined, locale: string) => AssetImageType | undefined;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export declare const supportedPageSetTypes: readonly ["ENTITY", "DIRECTORY", "LOCATOR"];
|
|
2
|
+
export type PageSetType = (typeof supportedPageSetTypes)[number];
|
|
3
|
+
/** A hidden internal Puck component that can appear in saved slot layout data. */
|
|
4
|
+
export type SharedHiddenPuckComponent = {
|
|
5
|
+
/** Stable Puck component ID stored in the layout data. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Page-set types that can render this hidden internal component. */
|
|
8
|
+
pageSetTypes: PageSetType[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Static metadata from a Section Library shared registry.
|
|
12
|
+
*
|
|
13
|
+
* The generator uses this metadata to validate saved component IDs, register
|
|
14
|
+
* their Puck configs, and omit them from editor add-component menus.
|
|
15
|
+
*/
|
|
16
|
+
export type SharedHiddenPuckComponentRegistry = {
|
|
17
|
+
/** Hidden internal components that can appear in saved layout data. */
|
|
18
|
+
components: SharedHiddenPuckComponent[];
|
|
19
|
+
/** Page-set types that need the shared root config, even without components. */
|
|
20
|
+
rootPageSetTypes: PageSetType[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Metadata describing a Section.
|
|
24
|
+
* A section is a horizontal slice of a page that is
|
|
25
|
+
* available for configuration in the Visual Layout Editor.
|
|
26
|
+
*/
|
|
27
|
+
export type SectionConfig = {
|
|
28
|
+
/** The internal id of the section. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** The user-facing display name of the section. */
|
|
31
|
+
displayName: string;
|
|
32
|
+
/** The description of the section's purpose. */
|
|
33
|
+
description: string;
|
|
34
|
+
/** The page set types in which the section can be used. */
|
|
35
|
+
pageSetTypes: PageSetType[];
|
|
36
|
+
/** The category in the left sidebar in which the section will be listed. */
|
|
37
|
+
category?: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Metadata describing a Library.
|
|
41
|
+
* A library is a collection of Sections and Layouts.
|
|
42
|
+
*/
|
|
43
|
+
export type LibraryMetadata = {
|
|
44
|
+
/** The version of the library.json metadata schema used in this repo. */
|
|
45
|
+
schemaVersion: 1;
|
|
46
|
+
/** The internal id of the library. */
|
|
47
|
+
id: string;
|
|
48
|
+
/** The user-facing display name of the library. */
|
|
49
|
+
displayName: string;
|
|
50
|
+
/** The user-facing description of the library. */
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
export declare const verticals: readonly ["HEALTHCARE", "FINANCIAL_SERVICES", "FOOD_AND_DINING", "RETAIL", "HOSPITALITY", "PROFESSIONAL_SERVICES"];
|
|
54
|
+
type Vertical = (typeof verticals)[number];
|
|
55
|
+
export declare const purposes: readonly ["LOCATION", "CITATION"];
|
|
56
|
+
type Purpose = (typeof purposes)[number];
|
|
57
|
+
/** A layout for use with entity page sets. */
|
|
58
|
+
export type EntityLayoutMetadata = {
|
|
59
|
+
/** Recommended starting sections for generation; adapt to the requested intent. */
|
|
60
|
+
defaultGenerationSectionIds?: string[];
|
|
61
|
+
/** The internal id of the entity layout. */
|
|
62
|
+
id: string;
|
|
63
|
+
/** The user-facing display name of the layout. */
|
|
64
|
+
displayName: string;
|
|
65
|
+
/** The entity categories/industries recommended for use with this layout. */
|
|
66
|
+
vertical?: Vertical[];
|
|
67
|
+
/** Whether this layout is intended as the primary location landing page, as an alternate citation page, or both. */
|
|
68
|
+
purpose?: Purpose[];
|
|
69
|
+
pageSetType: "ENTITY";
|
|
70
|
+
};
|
|
71
|
+
/** A layout for use with directory page sets. */
|
|
72
|
+
type DirectoryLayoutMetadata = {
|
|
73
|
+
/** Recommended starting sections for generation; adapt to the requested intent. */
|
|
74
|
+
defaultGenerationSectionIds?: string[];
|
|
75
|
+
/** The internal id of the directory layout. */
|
|
76
|
+
id: string;
|
|
77
|
+
/** The user-facing display name of the layout. */
|
|
78
|
+
displayName: string;
|
|
79
|
+
pageSetType: "DIRECTORY";
|
|
80
|
+
};
|
|
81
|
+
/** A layout for use with locator page sets. */
|
|
82
|
+
type LocatorLayoutMetadata = {
|
|
83
|
+
/** Recommended starting sections for generation; adapt to the requested intent. */
|
|
84
|
+
defaultGenerationSectionIds?: string[];
|
|
85
|
+
/** The internal id of the locator layout. */
|
|
86
|
+
id: string;
|
|
87
|
+
/** The user-facing display name of the layout. */
|
|
88
|
+
displayName: string;
|
|
89
|
+
pageSetType: "LOCATOR";
|
|
90
|
+
};
|
|
91
|
+
export type LayoutMetadata = EntityLayoutMetadata | DirectoryLayoutMetadata | LocatorLayoutMetadata;
|
|
92
|
+
/**
|
|
93
|
+
* A Section Library Layout is a starting point for a page set.
|
|
94
|
+
* It appears in the Section Library Gallery and sets the page set's initial layout configuration.
|
|
95
|
+
*/
|
|
96
|
+
export type SectionLibraryLayout = {
|
|
97
|
+
metadata: LayoutMetadata;
|
|
98
|
+
/** Puck Layout JSON */
|
|
99
|
+
defaultLayout: Record<string, any>;
|
|
100
|
+
};
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { ImageType, CTA as CTAType } from "@yext/pages-components";
|
|
2
|
+
import { AssetImageType } from "./images.ts";
|
|
3
|
+
import { AssetVideo } from "./videos.ts";
|
|
4
|
+
/**
|
|
5
|
+
* A pages-components CTA with a translatable label and link
|
|
6
|
+
*/
|
|
7
|
+
export type TranslatableCTA = Omit<CTAType, "label" | "link"> & {
|
|
8
|
+
/** The text to display in the CTA */
|
|
9
|
+
label: TranslatableString;
|
|
10
|
+
/** The link the for the CTA */
|
|
11
|
+
link: TranslatableString;
|
|
12
|
+
/** Whether the link should be normalized before rendering */
|
|
13
|
+
normalizeLink?: boolean;
|
|
14
|
+
openInNewTab?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** Enhanced CTA options */
|
|
17
|
+
export type EnhancedTranslatableCTA = TranslatableCTA & {
|
|
18
|
+
/**
|
|
19
|
+
* The type of CTA button to display.
|
|
20
|
+
* textAndLink is a standard button
|
|
21
|
+
* getDirections is a button that opens a map based on the coordinate field
|
|
22
|
+
* presetImage uses a preset image such as app store or food delivery logos for the button
|
|
23
|
+
* @defaultValue "textAndLink"
|
|
24
|
+
*/
|
|
25
|
+
ctaType?: "textAndLink" | "getDirections" | "presetImage";
|
|
26
|
+
};
|
|
27
|
+
/** Preset delivery logo options */
|
|
28
|
+
export declare const FOOD_DELIVERY_SERVICES: readonly ["deliveroo", "doordash", "grubhub", "skip-the-dishes", "postmates", "uber-eats", "ezcater"];
|
|
29
|
+
export type FoodDeliveryServiceType = (typeof FOOD_DELIVERY_SERVICES)[number];
|
|
30
|
+
/** Preset image types for CTA buttons - app store or food delivery logos */
|
|
31
|
+
export type PresetImageType = "app-store" | "google-play" | "galaxy-store" | "app-gallery" | FoodDeliveryServiceType;
|
|
32
|
+
/** Data for the HeroSection */
|
|
33
|
+
export type HeroSectionType = {
|
|
34
|
+
/**
|
|
35
|
+
* The image to show in the hero section
|
|
36
|
+
*/
|
|
37
|
+
image?: ImageType | AssetImageType;
|
|
38
|
+
/** The first CTA button for the hero section */
|
|
39
|
+
primaryCta?: EnhancedTranslatableCTA;
|
|
40
|
+
/** The second CTA button for the hero section */
|
|
41
|
+
secondaryCta?: EnhancedTranslatableCTA;
|
|
42
|
+
};
|
|
43
|
+
/** Data for the PromoSection */
|
|
44
|
+
export type PromoSectionType = {
|
|
45
|
+
/**
|
|
46
|
+
* The image or video to show in the promo
|
|
47
|
+
*/
|
|
48
|
+
image?: ImageType | AssetImageType | AssetVideo;
|
|
49
|
+
/** The main text to display in the promo */
|
|
50
|
+
title?: TranslatableString;
|
|
51
|
+
/** The sub text to display in the promo */
|
|
52
|
+
description?: TranslatableRichText;
|
|
53
|
+
/** The CTA button for the promo */
|
|
54
|
+
cta: EnhancedTranslatableCTA;
|
|
55
|
+
};
|
|
56
|
+
/** Data for the ProductSection */
|
|
57
|
+
export type ProductSectionType = {
|
|
58
|
+
products: Array<ProductStruct>;
|
|
59
|
+
};
|
|
60
|
+
/** A structured product price with an amount and ISO currency code. */
|
|
61
|
+
export type ProductPrice = {
|
|
62
|
+
/** The numeric price value. */
|
|
63
|
+
value?: number | string;
|
|
64
|
+
/** The ISO 4217 currency code, for example USD or GBP. */
|
|
65
|
+
currencyCode?: string;
|
|
66
|
+
};
|
|
67
|
+
/** An individual product in the ProductSection */
|
|
68
|
+
export type ProductStruct = {
|
|
69
|
+
/**
|
|
70
|
+
* The product's image
|
|
71
|
+
*/
|
|
72
|
+
image?: ImageType | AssetImageType;
|
|
73
|
+
/**
|
|
74
|
+
* The product's brow text above the title/name
|
|
75
|
+
*/
|
|
76
|
+
brow?: TranslatableString | TranslatableRichText;
|
|
77
|
+
/** The product's name */
|
|
78
|
+
name?: TranslatableString;
|
|
79
|
+
/**
|
|
80
|
+
* The product's price
|
|
81
|
+
*/
|
|
82
|
+
price?: ProductPrice;
|
|
83
|
+
/** The product's description */
|
|
84
|
+
description?: TranslatableRichText;
|
|
85
|
+
/**
|
|
86
|
+
* The product's category
|
|
87
|
+
*/
|
|
88
|
+
category?: TranslatableString | TranslatableRichText;
|
|
89
|
+
/** The product's CTA */
|
|
90
|
+
cta: EnhancedTranslatableCTA;
|
|
91
|
+
};
|
|
92
|
+
/** Data for the EventSection */
|
|
93
|
+
export type EventSectionType = {
|
|
94
|
+
events: Array<EventStruct>;
|
|
95
|
+
};
|
|
96
|
+
/** An individual event in the EventsSection */
|
|
97
|
+
export type EventStruct = {
|
|
98
|
+
/**
|
|
99
|
+
* An image representing the event
|
|
100
|
+
*/
|
|
101
|
+
image?: ImageType | AssetImageType;
|
|
102
|
+
/** The event's title */
|
|
103
|
+
title?: TranslatableString;
|
|
104
|
+
/** A UTC string for event's date and time (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ) */
|
|
105
|
+
dateTime?: string;
|
|
106
|
+
/** The event's description */
|
|
107
|
+
description?: TranslatableRichText;
|
|
108
|
+
/** The event's CTA */
|
|
109
|
+
cta: EnhancedTranslatableCTA;
|
|
110
|
+
};
|
|
111
|
+
/** Data for the FAQSection */
|
|
112
|
+
export type FAQSectionType = {
|
|
113
|
+
faqs: Array<FAQStruct>;
|
|
114
|
+
};
|
|
115
|
+
/** An individual FAQ */
|
|
116
|
+
export type FAQStruct = {
|
|
117
|
+
/** The question (always visible on the page) */
|
|
118
|
+
question: TranslatableString | TranslatableRichText;
|
|
119
|
+
/** The answer (visible when the question is clicked) */
|
|
120
|
+
answer: TranslatableRichText;
|
|
121
|
+
};
|
|
122
|
+
/** Data for the TestimonialSection */
|
|
123
|
+
export type TestimonialSectionType = {
|
|
124
|
+
testimonials: Array<TestimonialStruct>;
|
|
125
|
+
};
|
|
126
|
+
/** An individual testimonial for the TestimonialSection */
|
|
127
|
+
export type TestimonialStruct = {
|
|
128
|
+
/** The testimonial text */
|
|
129
|
+
description?: TranslatableRichText;
|
|
130
|
+
/** The name of the person who contributed the testimonial */
|
|
131
|
+
contributorName?: TranslatableString;
|
|
132
|
+
/** A UTC string for the contribution's date and time (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ) */
|
|
133
|
+
contributionDate?: string;
|
|
134
|
+
};
|
|
135
|
+
/** An individual insight for the InsightSection */
|
|
136
|
+
export type InsightStruct = {
|
|
137
|
+
/**
|
|
138
|
+
* An image representing the insight
|
|
139
|
+
*/
|
|
140
|
+
image?: ImageType | AssetImageType;
|
|
141
|
+
/** The insight's title */
|
|
142
|
+
name?: TranslatableString;
|
|
143
|
+
/**
|
|
144
|
+
* The insight's category
|
|
145
|
+
*/
|
|
146
|
+
category?: TranslatableString | TranslatableRichText;
|
|
147
|
+
/** A UTC string for the insight's publish time (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ) */
|
|
148
|
+
publishTime?: string;
|
|
149
|
+
/** The insight's description */
|
|
150
|
+
description?: TranslatableRichText;
|
|
151
|
+
/** The insight's CTA */
|
|
152
|
+
cta: EnhancedTranslatableCTA;
|
|
153
|
+
};
|
|
154
|
+
/** Data for the InsightSection */
|
|
155
|
+
export type InsightSectionType = {
|
|
156
|
+
insights: Array<InsightStruct>;
|
|
157
|
+
};
|
|
158
|
+
/** Data for the TeamSection */
|
|
159
|
+
export type TeamSectionType = {
|
|
160
|
+
people: Array<PersonStruct>;
|
|
161
|
+
};
|
|
162
|
+
/** An individual person in the TeamSection */
|
|
163
|
+
export type PersonStruct = {
|
|
164
|
+
/**
|
|
165
|
+
* The person's headshot image
|
|
166
|
+
*/
|
|
167
|
+
headshot?: ImageType | AssetImageType;
|
|
168
|
+
/** The person's name */
|
|
169
|
+
name?: TranslatableString;
|
|
170
|
+
/** The person's job title */
|
|
171
|
+
title?: TranslatableString | TranslatableRichText;
|
|
172
|
+
/** The person's phone number. Format: +1234567890 */
|
|
173
|
+
phoneNumber?: string;
|
|
174
|
+
/** The person's email address */
|
|
175
|
+
email?: string;
|
|
176
|
+
/** A call to action for the person */
|
|
177
|
+
cta: EnhancedTranslatableCTA;
|
|
178
|
+
};
|
|
179
|
+
/** Represents a translatable string. The key is the locale (en, es, fr), and the value is the localized string. */
|
|
180
|
+
type LocalizedValues = {
|
|
181
|
+
hasLocalizedValue?: "true";
|
|
182
|
+
defaultValue?: string;
|
|
183
|
+
} & Record<string, string | undefined>;
|
|
184
|
+
/**
|
|
185
|
+
* A string that can be translated for different locales.
|
|
186
|
+
*/
|
|
187
|
+
export type TranslatableString = string | LocalizedValues;
|
|
188
|
+
/**
|
|
189
|
+
* Rich text that can be translated for different locales.
|
|
190
|
+
*/
|
|
191
|
+
export type TranslatableRichText = (string | RichText) | ({
|
|
192
|
+
hasLocalizedValue?: "true";
|
|
193
|
+
defaultValue?: string | RichText;
|
|
194
|
+
} & Record<string, string | RichText | undefined>);
|
|
195
|
+
/**
|
|
196
|
+
* A rich text object with HTML and JSON (LexicalRichText) representations.
|
|
197
|
+
* The HTML representation is used on the live page.
|
|
198
|
+
* The JSON representation is used in the editor for rich text editing.
|
|
199
|
+
*/
|
|
200
|
+
export type RichText = {
|
|
201
|
+
html?: string;
|
|
202
|
+
json?: string;
|
|
203
|
+
};
|
|
204
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Video = {
|
|
2
|
+
/** The YouTube video URL */
|
|
3
|
+
url: string;
|
|
4
|
+
/** The YouTube video ID */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The YouTube video title */
|
|
7
|
+
title: string;
|
|
8
|
+
/** The YouTube video thumbnail URL */
|
|
9
|
+
thumbnail: string;
|
|
10
|
+
/** The YouTube video duration */
|
|
11
|
+
duration: string;
|
|
12
|
+
/** The embedded YouTube video URL (https://youtube.com/embed/<video_id>) */
|
|
13
|
+
embeddedUrl: string;
|
|
14
|
+
};
|
|
15
|
+
export type AssetVideo = {
|
|
16
|
+
video: Video;
|
|
17
|
+
/** Asset video description field */
|
|
18
|
+
videoDescription?: string;
|
|
19
|
+
/** Asset name (unique) */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Asset internal id */
|
|
22
|
+
id: string;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** An object mapping translation keys to the translated values. Allows sub-objects. */
|
|
2
|
+
export type TranslationDictionary = {
|
|
3
|
+
[key: string]: string | TranslationDictionary;
|
|
4
|
+
};
|
|
5
|
+
/** A function that loads one complete locale dictionary on request. */
|
|
6
|
+
export type TranslationLoader = () => Promise<TranslationDictionary>;
|
|
7
|
+
/** Maps normalized locales to complete, ready-to-install dictionaries. */
|
|
8
|
+
export type TranslationLoaders = Partial<Record<string, TranslationLoader>>;
|
|
9
|
+
/** The complete translation loaders used by a Section Library runtime. */
|
|
10
|
+
export type SectionLibraryTranslationLoaders = {
|
|
11
|
+
platform: TranslationLoaders;
|
|
12
|
+
page: TranslationLoaders;
|
|
13
|
+
};
|
|
14
|
+
export declare const normalizeTranslationLocale: (locale: string) => string;
|
|
15
|
+
/** Loads a complete generated translation dictionary, falling back to English. */
|
|
16
|
+
export declare const loadTranslationDictionary: (locale: string, loaders: TranslationLoaders) => Promise<TranslationDictionary>;
|
|
17
|
+
/** Represents a collision between the built-in (visual-editor) translations and repo (section library) translations. */
|
|
18
|
+
export type TranslationShapeCollision = {
|
|
19
|
+
/** The translation key that has a conflict */
|
|
20
|
+
path: string;
|
|
21
|
+
/** The type of the built-in (visual-editor) value at this path. */
|
|
22
|
+
builtInType: "object" | "string";
|
|
23
|
+
/** The type of the repo (section library) value at this path. */
|
|
24
|
+
repoType: "object" | "string";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* mergeTranslationDictionaries combines the built-in (visual-editor) translations
|
|
28
|
+
* and repo (section library) translations using a deep merge.
|
|
29
|
+
* If a value is provided in both places, the repo value takes precedence.
|
|
30
|
+
* If there is a type conflict for a key (one source has an object and the other has a string),
|
|
31
|
+
* then the repo value still takes precedence but onShapeCollision is invoked.
|
|
32
|
+
*/
|
|
33
|
+
export declare const mergeTranslationDictionaries: (
|
|
34
|
+
/** The TranslationDictionary from the visual-editor library. */
|
|
35
|
+
builtIn: TranslationDictionary,
|
|
36
|
+
/** The TranslationDictionary from the section library repo. */
|
|
37
|
+
repo: TranslationDictionary,
|
|
38
|
+
/** A callback for when there is a type collision. */
|
|
39
|
+
onShapeCollision?: (collision: TranslationShapeCollision) => void,
|
|
40
|
+
/** Used for recursive merging. */
|
|
41
|
+
parentPath?: string) => TranslationDictionary;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforms a locale into BCP-47 language format, e.g., "zh-Hans-HK"
|
|
3
|
+
*/
|
|
4
|
+
export declare const normalizeLocale: (locale: string) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Safely transforms all "locale" and "locales" fields in an object to BCP-47 format.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeLocalesInObject(obj: any): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RichText, TranslatableRichText, TranslatableString } from "../types/types.ts";
|
|
2
|
+
export declare const isRichText: (value: unknown) => value is RichText;
|
|
3
|
+
export declare const richTextHtmlToPlainText: (html?: string) => string;
|
|
4
|
+
export declare const richTextToPlainText: (value: string | RichText | undefined) => string;
|
|
5
|
+
export declare const translatableToPlainText: (value: TranslatableString | TranslatableRichText | undefined) => TranslatableString | undefined;
|
|
6
|
+
export declare const getLocalizedPlainText: (value: TranslatableString | TranslatableRichText | string | RichText | undefined, locale: string) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
/** Browser resolution can fail after the server accepts a generated result. */
|
|
3
|
+
export declare const handleGenerationErrorReport: (request: IncomingMessage & {
|
|
4
|
+
body?: unknown;
|
|
5
|
+
}, response: ServerResponse, log: ((message: string, details: object) => void) & {
|
|
6
|
+
flush: () => Promise<void>;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
/** Keep browser commit and resolution snapshots alongside model requests. */
|
|
9
|
+
export declare const handleGenerationDiagnostics: (request: IncomingMessage & {
|
|
10
|
+
body?: unknown;
|
|
11
|
+
}, response: ServerResponse, log: ((message: string, details: object) => void) & {
|
|
12
|
+
flush: () => Promise<void>;
|
|
13
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GenerationSettings } from "../../types/generationSettings.ts";
|
|
2
|
+
import type { GenerationPromptBundle } from "../../types/generationPrompts.ts";
|
|
3
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
4
|
+
import type { SectionLibraryLayout } from "../../types/sectionLibrary.ts";
|
|
5
|
+
import type { createGenerationLogger } from "./generationLogger.ts";
|
|
6
|
+
/** Local generation routes fall through to the rest of the Vite middleware stack. */
|
|
7
|
+
export declare const createGenerationMiddleware: ({ rootDir, getLayouts, getModel, prompts, generationSettings, logGeneration, }: {
|
|
8
|
+
rootDir: string;
|
|
9
|
+
getLayouts: () => SectionLibraryLayout[];
|
|
10
|
+
getModel: () => string;
|
|
11
|
+
prompts: GenerationPromptBundle | null;
|
|
12
|
+
generationSettings: GenerationSettings | null;
|
|
13
|
+
logGeneration: ReturnType<typeof createGenerationLogger>;
|
|
14
|
+
}) => (request: IncomingMessage, response: ServerResponse, next: () => void) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
export declare const GENERATION_GATEWAY_URL = "http://modelgateway.service.us3dev.consul:8008/openai/responses";
|
|
3
|
+
/** Development transport only: forward prepared requests and raw response bytes. */
|
|
4
|
+
export declare const handleLocalEditorModelRequest: (request: IncomingMessage & {
|
|
5
|
+
body?: unknown;
|
|
6
|
+
}, response: ServerResponse, { model, log, }: {
|
|
7
|
+
model: string;
|
|
8
|
+
log: (message: string, details: object) => void;
|
|
9
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Read once at server startup. The local harness deliberately has no refresh/cache machinery. */
|
|
2
|
+
export declare const loadLocalGenerationPrompts: (rootDir: string, filePath?: string) => Promise<{
|
|
3
|
+
contractVersion: 1;
|
|
4
|
+
prompts: {
|
|
5
|
+
prepare: string;
|
|
6
|
+
create: string;
|
|
7
|
+
fullPageUpdate: string;
|
|
8
|
+
plan: string;
|
|
9
|
+
section: string;
|
|
10
|
+
};
|
|
11
|
+
context: {
|
|
12
|
+
createLists: string;
|
|
13
|
+
fullPageUpdateLists: string;
|
|
14
|
+
createRecommendations: string;
|
|
15
|
+
fullPageUpdateRecommendations: string;
|
|
16
|
+
};
|
|
17
|
+
} | null>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type GenerationSettings } from "../../types/generationSettings.ts";
|
|
2
|
+
import type { LocalEditorOptions } from "../local-editor/types.ts";
|
|
3
|
+
export declare const resolveLocalGenerationSettings: (overrides?: LocalEditorOptions["generationSettings"]) => GenerationSettings | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SectionLibraryLayout } from "../../types/sectionLibrary.ts";
|
|
2
|
+
import type { ResolvedLocalEditorLayoutConfig } from "./types.ts";
|
|
3
|
+
type CreateLocalEditorArtifactsManagerOptions = {
|
|
4
|
+
localEditorTemplateSource: string;
|
|
5
|
+
localEditorDataTemplateSource: string;
|
|
6
|
+
layoutGenerationEnabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Creates and removes the generated Local Editor Pages templates.
|
|
10
|
+
*
|
|
11
|
+
* 1. Write the Local Editor shell with one config import for each layout.
|
|
12
|
+
* 2. Write data templates for Entity and Directory layouts.
|
|
13
|
+
* 3. Remove only files that this feature generated.
|
|
14
|
+
*/
|
|
15
|
+
export declare const createLocalEditorArtifactsManager: ({ localEditorTemplateSource, localEditorDataTemplateSource, layoutGenerationEnabled, }: CreateLocalEditorArtifactsManagerOptions) => {
|
|
16
|
+
cleanupGeneratedLocalEditorArtifacts: (rootDir?: string) => void;
|
|
17
|
+
syncLocalEditorDataTemplates: (layouts: SectionLibraryLayout[], rootDir?: string, resolvedLayouts?: ResolvedLocalEditorLayoutConfig[]) => void;
|
|
18
|
+
syncLocalEditorTemplate: (layouts: SectionLibraryLayout[], rootDir?: string) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SectionLibraryLayout } from "../../types/sectionLibrary.ts";
|
|
2
|
+
import type { LocalEditorConfig, ResolvedLocalEditorConfig } from "./types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the Local Editor stream settings for the Section Library layouts.
|
|
5
|
+
*
|
|
6
|
+
* 1. Load the root `stream.config.ts` file with tsx.
|
|
7
|
+
* 2. Merge global, page set, and layout settings.
|
|
8
|
+
* 3. Return diagnostics when the file is missing or invalid.
|
|
9
|
+
*/
|
|
10
|
+
export declare const readResolvedLayoutConfigs: (rootDir: string, layouts: SectionLibraryLayout[], diagnostics: string[]) => Promise<ResolvedLocalEditorConfig>;
|
|
11
|
+
export declare const resolveLocalEditorConfigs: (libraryLayouts: SectionLibraryLayout[], streamConfig: LocalEditorConfig) => ResolvedLocalEditorConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SectionLibraryLayout } from "../../types/sectionLibrary.ts";
|
|
2
|
+
import type { LocalEditorDocumentResponse, LocalEditorManifestResponse } from "./types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the manifest payload consumed by the `/local-editor` shell.
|
|
5
|
+
*
|
|
6
|
+
* The manifest exposes the available layouts, their entity options, and the
|
|
7
|
+
* effective default selection from layout defaults and snapshot data.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getLocalEditorManifest: (rootDir: string, libraryLayouts: SectionLibraryLayout[]) => Promise<LocalEditorManifestResponse>;
|
|
10
|
+
/** Locale keys for generation are scoped to the selected layout, not UI translations. */
|
|
11
|
+
export declare const getLocalEditorGenerationLocales: (rootDir: string, libraryLayouts: SectionLibraryLayout[], layoutId: string) => Promise<string[]>;
|
|
12
|
+
export declare const getLocalEditorDocument: (rootDir: string, libraryLayouts: SectionLibraryLayout[], layoutId?: string, entityId?: string, locale?: string, directoryChildCount?: number) => Promise<LocalEditorDocumentResponse>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { YextSchemaField } from "../../types/entityFields.ts";
|
|
2
|
+
import type { LocalEditorStreamDefinition } from "./types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Infers stream-field schema data from a local-editor snapshot document.
|
|
5
|
+
*
|
|
6
|
+
* This gives the local-editor shell enough entity-field metadata to power
|
|
7
|
+
* field selectors and embedded-field pickers without platform stream schema
|
|
8
|
+
* data.
|
|
9
|
+
*/
|
|
10
|
+
export declare const inferEntityFields: (document: Record<string, unknown> | Record<string, unknown>[], stream?: LocalEditorStreamDefinition) => {
|
|
11
|
+
fields: YextSchemaField[];
|
|
12
|
+
displayNames: Record<string, string>;
|
|
13
|
+
};
|