@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,2157 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
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, FieldTransformFn } from '@puckeditor/core';
|
|
6
|
+
import * as _yext_search_headless_react from '@yext/search-headless-react';
|
|
7
|
+
import { SearchAnalyticsConfig } from '@yext/search-ui-react';
|
|
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';
|
|
12
|
+
import * as react_i18next from 'react-i18next';
|
|
13
|
+
import { TOptions } from 'i18next';
|
|
14
|
+
|
|
15
|
+
type YextSchemaField = {
|
|
16
|
+
name: string;
|
|
17
|
+
displayName?: string;
|
|
18
|
+
definition: YextSchemaFieldDefinition;
|
|
19
|
+
children?: {
|
|
20
|
+
fields: YextSchemaField[];
|
|
21
|
+
};
|
|
22
|
+
optionFormat?: "OPTION_FORMAT_EXPANDED";
|
|
23
|
+
};
|
|
24
|
+
type YextSchemaFieldDefinition = {
|
|
25
|
+
name: string;
|
|
26
|
+
isList?: boolean;
|
|
27
|
+
registryId?: string;
|
|
28
|
+
typeName?: string;
|
|
29
|
+
typeRegistryId?: string;
|
|
30
|
+
type: Record<string, string>;
|
|
31
|
+
};
|
|
32
|
+
type StreamFields = {
|
|
33
|
+
fields: YextSchemaField[];
|
|
34
|
+
displayNames?: Record<string, string>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type StreamDocument = {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
locale?: string;
|
|
40
|
+
meta?: {
|
|
41
|
+
locale?: string;
|
|
42
|
+
entityType?: {
|
|
43
|
+
id?: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
__certified_facts?: any;
|
|
47
|
+
_pageset?: string;
|
|
48
|
+
__?: {
|
|
49
|
+
pathInfo?: PathInfoShape;
|
|
50
|
+
layout?: string;
|
|
51
|
+
theme?: string;
|
|
52
|
+
codeTemplate?: string;
|
|
53
|
+
name?: string;
|
|
54
|
+
visualEditorConfig?: string;
|
|
55
|
+
isPrimaryLocale?: boolean;
|
|
56
|
+
entityPageSetUrlTemplates?: string;
|
|
57
|
+
locatorSourcePageSets?: string;
|
|
58
|
+
categoryRootAncestorId?: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
type PathInfoShape = {
|
|
62
|
+
primaryLocale?: string;
|
|
63
|
+
includeLocalePrefixForPrimaryLocale?: boolean;
|
|
64
|
+
template?: string;
|
|
65
|
+
breadcrumbPrefix?: string;
|
|
66
|
+
sourceEntityPageSetTemplate?: string;
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
};
|
|
69
|
+
type LocatorConfig = {
|
|
70
|
+
source?: string;
|
|
71
|
+
experienceKey?: string;
|
|
72
|
+
entityType?: string;
|
|
73
|
+
savedFilter?: string;
|
|
74
|
+
entityTypeScope?: EntityTypeScope[];
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
};
|
|
77
|
+
type EntityTypeScope = {
|
|
78
|
+
entityType?: string;
|
|
79
|
+
savedFilter?: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare const TemplatePropsContext: React.Context<any>;
|
|
83
|
+
declare const useTemplateProps: <T = {
|
|
84
|
+
document: Record<string, any>;
|
|
85
|
+
relativePrefixToRoot?: string;
|
|
86
|
+
}>() => T;
|
|
87
|
+
declare const useDocument: <T = StreamDocument>() => T;
|
|
88
|
+
|
|
89
|
+
declare const usePlatformTranslation: () => react_i18next.UseTranslationResponse<"visual-editor", undefined>;
|
|
90
|
+
type MsgString = string & {
|
|
91
|
+
__brand: "i18nPlatform";
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* msg marks strings for translation in config JSON such
|
|
95
|
+
* as Puck fields or the theme config. The TOptions are
|
|
96
|
+
* stringified in the config and dynamically replaced
|
|
97
|
+
* upon render.
|
|
98
|
+
*/
|
|
99
|
+
declare const msg: (key: string, defaultValue: string, options?: TOptions) => MsgString;
|
|
100
|
+
/**
|
|
101
|
+
* pt translates strings based on the platform i18n. It can
|
|
102
|
+
* operate as a normal TFunction or handle configurations that
|
|
103
|
+
* have been stringified by msg.
|
|
104
|
+
*/
|
|
105
|
+
declare const pt: (keyOrEncodedValue: string | MsgString, optionsOrDefault?: string | TOptions, options?: TOptions) => string;
|
|
106
|
+
|
|
107
|
+
type ComboboxOption = {
|
|
108
|
+
label: string;
|
|
109
|
+
value: any;
|
|
110
|
+
color?: string;
|
|
111
|
+
colorStyle?: React__default.CSSProperties;
|
|
112
|
+
icon?: string;
|
|
113
|
+
};
|
|
114
|
+
type ComboboxOptionGroup = {
|
|
115
|
+
title?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
options: ComboboxOption[];
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** Describes the possible image fill types. */
|
|
121
|
+
type ImageFillType = "fill" | "fit";
|
|
122
|
+
/** Describes an image's aspect ratio. */
|
|
123
|
+
type ImageAspectRatio = {
|
|
124
|
+
horizontalFactor: number;
|
|
125
|
+
verticalFactor: number;
|
|
126
|
+
};
|
|
127
|
+
/** Describes the dimensions of an image. */
|
|
128
|
+
type ImageDimension = {
|
|
129
|
+
width: number;
|
|
130
|
+
height: number;
|
|
131
|
+
};
|
|
132
|
+
/** Describes the data corresponding to a single image. */
|
|
133
|
+
type ImageData = {
|
|
134
|
+
url: string;
|
|
135
|
+
dimension?: ImageDimension;
|
|
136
|
+
exifMetadata?: {
|
|
137
|
+
rotate: number;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/** Describes the data corresponding to an image rotation. */
|
|
141
|
+
type ImageRotation = {
|
|
142
|
+
degree: number;
|
|
143
|
+
};
|
|
144
|
+
/** Describes the crop boundary box data */
|
|
145
|
+
type ImageCrop = {
|
|
146
|
+
left: number;
|
|
147
|
+
top: number;
|
|
148
|
+
height: number;
|
|
149
|
+
width: number;
|
|
150
|
+
aspectRatio?: ImageAspectRatio;
|
|
151
|
+
};
|
|
152
|
+
type TransformKind = "CROP" | "ROTATION";
|
|
153
|
+
/** Outlines the possible image transformations. */
|
|
154
|
+
type ImageTransformation = ImageRotation | ImageCrop;
|
|
155
|
+
type ImageTransformations = Partial<Record<TransformKind, ImageTransformation>>;
|
|
156
|
+
/** Describes the data corresponding to a piece of image content. */
|
|
157
|
+
type ImageContentData = {
|
|
158
|
+
name?: string;
|
|
159
|
+
transformedImage?: ImageData;
|
|
160
|
+
originalImage?: ImageData;
|
|
161
|
+
childImages?: ImageData[];
|
|
162
|
+
transformations?: ImageTransformations;
|
|
163
|
+
sourceUrl?: string;
|
|
164
|
+
altText?: string;
|
|
165
|
+
};
|
|
166
|
+
type AssetImageType = Omit<ImageType, "alternateText"> & {
|
|
167
|
+
alternateText?: TranslatableString;
|
|
168
|
+
assetImage?: ImageContentData;
|
|
169
|
+
};
|
|
170
|
+
type LocalizedAssetImage = {
|
|
171
|
+
hasLocalizedValue?: "true";
|
|
172
|
+
defaultValue?: AssetImageType;
|
|
173
|
+
} & {
|
|
174
|
+
[locale: string]: AssetImageType | undefined;
|
|
175
|
+
};
|
|
176
|
+
type TranslatableAssetImage = AssetImageType | LocalizedAssetImage;
|
|
177
|
+
declare const isLocalizedAssetImage: (value: unknown) => value is LocalizedAssetImage;
|
|
178
|
+
declare const resolveLocalizedAssetImage: (value: TranslatableAssetImage | ImageType | undefined, locale: string) => AssetImageType | undefined;
|
|
179
|
+
|
|
180
|
+
type Video = {
|
|
181
|
+
/** The YouTube video URL */
|
|
182
|
+
url: string;
|
|
183
|
+
/** The YouTube video ID */
|
|
184
|
+
id: string;
|
|
185
|
+
/** The YouTube video title */
|
|
186
|
+
title: string;
|
|
187
|
+
/** The YouTube video thumbnail URL */
|
|
188
|
+
thumbnail: string;
|
|
189
|
+
/** The YouTube video duration */
|
|
190
|
+
duration: string;
|
|
191
|
+
/** The embedded YouTube video URL (https://youtube.com/embed/<video_id>) */
|
|
192
|
+
embeddedUrl: string;
|
|
193
|
+
};
|
|
194
|
+
type AssetVideo = {
|
|
195
|
+
video: Video;
|
|
196
|
+
/** Asset video description field */
|
|
197
|
+
videoDescription?: string;
|
|
198
|
+
/** Asset name (unique) */
|
|
199
|
+
name: string;
|
|
200
|
+
/** Asset internal id */
|
|
201
|
+
id: string;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* A pages-components CTA with a translatable label and link
|
|
206
|
+
*/
|
|
207
|
+
type TranslatableCTA = Omit<CTA$1, "label" | "link"> & {
|
|
208
|
+
/** The text to display in the CTA */
|
|
209
|
+
label: TranslatableString;
|
|
210
|
+
/** The link the for the CTA */
|
|
211
|
+
link: TranslatableString;
|
|
212
|
+
/** Whether the link should be normalized before rendering */
|
|
213
|
+
normalizeLink?: boolean;
|
|
214
|
+
openInNewTab?: boolean;
|
|
215
|
+
};
|
|
216
|
+
/** Enhanced CTA options */
|
|
217
|
+
type EnhancedTranslatableCTA = TranslatableCTA & {
|
|
218
|
+
/**
|
|
219
|
+
* The type of CTA button to display.
|
|
220
|
+
* textAndLink is a standard button
|
|
221
|
+
* getDirections is a button that opens a map based on the coordinate field
|
|
222
|
+
* presetImage uses a preset image such as app store or food delivery logos for the button
|
|
223
|
+
* @defaultValue "textAndLink"
|
|
224
|
+
*/
|
|
225
|
+
ctaType?: "textAndLink" | "getDirections" | "presetImage";
|
|
226
|
+
};
|
|
227
|
+
/** Preset delivery logo options */
|
|
228
|
+
declare const FOOD_DELIVERY_SERVICES: readonly ["deliveroo", "doordash", "grubhub", "skip-the-dishes", "postmates", "uber-eats", "ezcater"];
|
|
229
|
+
type FoodDeliveryServiceType = (typeof FOOD_DELIVERY_SERVICES)[number];
|
|
230
|
+
/** Preset image types for CTA buttons - app store or food delivery logos */
|
|
231
|
+
type PresetImageType = "app-store" | "google-play" | "galaxy-store" | "app-gallery" | FoodDeliveryServiceType;
|
|
232
|
+
/** Data for the HeroSection */
|
|
233
|
+
type HeroSectionType = {
|
|
234
|
+
/**
|
|
235
|
+
* The image to show in the hero section
|
|
236
|
+
*/
|
|
237
|
+
image?: ImageType | AssetImageType;
|
|
238
|
+
/** The first CTA button for the hero section */
|
|
239
|
+
primaryCta?: EnhancedTranslatableCTA;
|
|
240
|
+
/** The second CTA button for the hero section */
|
|
241
|
+
secondaryCta?: EnhancedTranslatableCTA;
|
|
242
|
+
};
|
|
243
|
+
/** Data for the PromoSection */
|
|
244
|
+
type PromoSectionType = {
|
|
245
|
+
/**
|
|
246
|
+
* The image or video to show in the promo
|
|
247
|
+
*/
|
|
248
|
+
image?: ImageType | AssetImageType | AssetVideo;
|
|
249
|
+
/** The main text to display in the promo */
|
|
250
|
+
title?: TranslatableString;
|
|
251
|
+
/** The sub text to display in the promo */
|
|
252
|
+
description?: TranslatableRichText;
|
|
253
|
+
/** The CTA button for the promo */
|
|
254
|
+
cta: EnhancedTranslatableCTA;
|
|
255
|
+
};
|
|
256
|
+
/** Data for the ProductSection */
|
|
257
|
+
type ProductSectionType = {
|
|
258
|
+
products: Array<ProductStruct>;
|
|
259
|
+
};
|
|
260
|
+
/** A structured product price with an amount and ISO currency code. */
|
|
261
|
+
type ProductPrice = {
|
|
262
|
+
/** The numeric price value. */
|
|
263
|
+
value?: number | string;
|
|
264
|
+
/** The ISO 4217 currency code, for example USD or GBP. */
|
|
265
|
+
currencyCode?: string;
|
|
266
|
+
};
|
|
267
|
+
/** An individual product in the ProductSection */
|
|
268
|
+
type ProductStruct = {
|
|
269
|
+
/**
|
|
270
|
+
* The product's image
|
|
271
|
+
*/
|
|
272
|
+
image?: ImageType | AssetImageType;
|
|
273
|
+
/**
|
|
274
|
+
* The product's brow text above the title/name
|
|
275
|
+
*/
|
|
276
|
+
brow?: TranslatableString | TranslatableRichText;
|
|
277
|
+
/** The product's name */
|
|
278
|
+
name?: TranslatableString;
|
|
279
|
+
/**
|
|
280
|
+
* The product's price
|
|
281
|
+
*/
|
|
282
|
+
price?: ProductPrice;
|
|
283
|
+
/** The product's description */
|
|
284
|
+
description?: TranslatableRichText;
|
|
285
|
+
/**
|
|
286
|
+
* The product's category
|
|
287
|
+
*/
|
|
288
|
+
category?: TranslatableString | TranslatableRichText;
|
|
289
|
+
/** The product's CTA */
|
|
290
|
+
cta: EnhancedTranslatableCTA;
|
|
291
|
+
};
|
|
292
|
+
/** Data for the EventSection */
|
|
293
|
+
type EventSectionType = {
|
|
294
|
+
events: Array<EventStruct>;
|
|
295
|
+
};
|
|
296
|
+
/** An individual event in the EventsSection */
|
|
297
|
+
type EventStruct = {
|
|
298
|
+
/**
|
|
299
|
+
* An image representing the event
|
|
300
|
+
*/
|
|
301
|
+
image?: ImageType | AssetImageType;
|
|
302
|
+
/** The event's title */
|
|
303
|
+
title?: TranslatableString;
|
|
304
|
+
/** A UTC string for event's date and time (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ) */
|
|
305
|
+
dateTime?: string;
|
|
306
|
+
/** The event's description */
|
|
307
|
+
description?: TranslatableRichText;
|
|
308
|
+
/** The event's CTA */
|
|
309
|
+
cta: EnhancedTranslatableCTA;
|
|
310
|
+
};
|
|
311
|
+
/** Data for the FAQSection */
|
|
312
|
+
type FAQSectionType = {
|
|
313
|
+
faqs: Array<FAQStruct>;
|
|
314
|
+
};
|
|
315
|
+
/** An individual FAQ */
|
|
316
|
+
type FAQStruct = {
|
|
317
|
+
/** The question (always visible on the page) */
|
|
318
|
+
question: TranslatableString | TranslatableRichText;
|
|
319
|
+
/** The answer (visible when the question is clicked) */
|
|
320
|
+
answer: TranslatableRichText;
|
|
321
|
+
};
|
|
322
|
+
/** Data for the TestimonialSection */
|
|
323
|
+
type TestimonialSectionType = {
|
|
324
|
+
testimonials: Array<TestimonialStruct>;
|
|
325
|
+
};
|
|
326
|
+
/** An individual testimonial for the TestimonialSection */
|
|
327
|
+
type TestimonialStruct = {
|
|
328
|
+
/** The testimonial text */
|
|
329
|
+
description?: TranslatableRichText;
|
|
330
|
+
/** The name of the person who contributed the testimonial */
|
|
331
|
+
contributorName?: TranslatableString;
|
|
332
|
+
/** A UTC string for the contribution's date and time (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ) */
|
|
333
|
+
contributionDate?: string;
|
|
334
|
+
};
|
|
335
|
+
/** An individual insight for the InsightSection */
|
|
336
|
+
type InsightStruct = {
|
|
337
|
+
/**
|
|
338
|
+
* An image representing the insight
|
|
339
|
+
*/
|
|
340
|
+
image?: ImageType | AssetImageType;
|
|
341
|
+
/** The insight's title */
|
|
342
|
+
name?: TranslatableString;
|
|
343
|
+
/**
|
|
344
|
+
* The insight's category
|
|
345
|
+
*/
|
|
346
|
+
category?: TranslatableString | TranslatableRichText;
|
|
347
|
+
/** A UTC string for the insight's publish time (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ) */
|
|
348
|
+
publishTime?: string;
|
|
349
|
+
/** The insight's description */
|
|
350
|
+
description?: TranslatableRichText;
|
|
351
|
+
/** The insight's CTA */
|
|
352
|
+
cta: EnhancedTranslatableCTA;
|
|
353
|
+
};
|
|
354
|
+
/** Data for the InsightSection */
|
|
355
|
+
type InsightSectionType = {
|
|
356
|
+
insights: Array<InsightStruct>;
|
|
357
|
+
};
|
|
358
|
+
/** Data for the TeamSection */
|
|
359
|
+
type TeamSectionType = {
|
|
360
|
+
people: Array<PersonStruct>;
|
|
361
|
+
};
|
|
362
|
+
/** An individual person in the TeamSection */
|
|
363
|
+
type PersonStruct = {
|
|
364
|
+
/**
|
|
365
|
+
* The person's headshot image
|
|
366
|
+
*/
|
|
367
|
+
headshot?: ImageType | AssetImageType;
|
|
368
|
+
/** The person's name */
|
|
369
|
+
name?: TranslatableString;
|
|
370
|
+
/** The person's job title */
|
|
371
|
+
title?: TranslatableString | TranslatableRichText;
|
|
372
|
+
/** The person's phone number. Format: +1234567890 */
|
|
373
|
+
phoneNumber?: string;
|
|
374
|
+
/** The person's email address */
|
|
375
|
+
email?: string;
|
|
376
|
+
/** A call to action for the person */
|
|
377
|
+
cta: EnhancedTranslatableCTA;
|
|
378
|
+
};
|
|
379
|
+
/** Represents a translatable string. The key is the locale (en, es, fr), and the value is the localized string. */
|
|
380
|
+
type LocalizedValues = {
|
|
381
|
+
hasLocalizedValue?: "true";
|
|
382
|
+
defaultValue?: string;
|
|
383
|
+
} & Record<string, string | undefined>;
|
|
384
|
+
/**
|
|
385
|
+
* A string that can be translated for different locales.
|
|
386
|
+
*/
|
|
387
|
+
type TranslatableString = string | LocalizedValues;
|
|
388
|
+
/**
|
|
389
|
+
* Rich text that can be translated for different locales.
|
|
390
|
+
*/
|
|
391
|
+
type TranslatableRichText = (string | RichText) | ({
|
|
392
|
+
hasLocalizedValue?: "true";
|
|
393
|
+
defaultValue?: string | RichText;
|
|
394
|
+
} & Record<string, string | RichText | undefined>);
|
|
395
|
+
/**
|
|
396
|
+
* A rich text object with HTML and JSON (LexicalRichText) representations.
|
|
397
|
+
* The HTML representation is used on the live page.
|
|
398
|
+
* The JSON representation is used in the editor for rich text editing.
|
|
399
|
+
*/
|
|
400
|
+
type RichText = {
|
|
401
|
+
html?: string;
|
|
402
|
+
json?: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* An object representing a color based on the theme specified by the user.
|
|
407
|
+
*/
|
|
408
|
+
type ThemeColor = {
|
|
409
|
+
/** The theme color token selected by the user. */
|
|
410
|
+
selectedColor: string;
|
|
411
|
+
/** The theme color token that contrasts with the selectedColor. */
|
|
412
|
+
contrastingColor: string;
|
|
413
|
+
/**
|
|
414
|
+
* Whether the user-selected color is dark.
|
|
415
|
+
*/
|
|
416
|
+
isDarkColor?: boolean;
|
|
417
|
+
};
|
|
418
|
+
declare const backgroundColors: Record<string, {
|
|
419
|
+
label: string;
|
|
420
|
+
value: ThemeColor;
|
|
421
|
+
}>;
|
|
422
|
+
/** Corresponds to the different semantic heading levels */
|
|
423
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
424
|
+
declare const defaultThemeTailwindExtensions: {
|
|
425
|
+
colors: {
|
|
426
|
+
"palette-primary-light": string;
|
|
427
|
+
"palette-secondary-light": string;
|
|
428
|
+
"palette-tertiary-light": string;
|
|
429
|
+
"palette-quaternary-light": string;
|
|
430
|
+
"palette-primary-dark": string;
|
|
431
|
+
"palette-secondary-dark": string;
|
|
432
|
+
"palette-primary-contrast": string;
|
|
433
|
+
"palette-secondary-contrast": string;
|
|
434
|
+
"palette-tertiary-contrast": string;
|
|
435
|
+
"palette-quaternary-contrast": string;
|
|
436
|
+
gray: {
|
|
437
|
+
100: string;
|
|
438
|
+
200: string;
|
|
439
|
+
300: string;
|
|
440
|
+
400: string;
|
|
441
|
+
500: string;
|
|
442
|
+
600: string;
|
|
443
|
+
800: string;
|
|
444
|
+
900: string;
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
fontSize: {
|
|
448
|
+
"body-xs-fontSize": string;
|
|
449
|
+
"body-sm-fontSize": string;
|
|
450
|
+
"body-lg-fontSize": string;
|
|
451
|
+
"link-xs-fontSize": string;
|
|
452
|
+
"link-sm-fontSize": string;
|
|
453
|
+
"3xl": string;
|
|
454
|
+
"4xl": string;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
type BorderRadiusOption = {
|
|
458
|
+
label: string;
|
|
459
|
+
value: string;
|
|
460
|
+
};
|
|
461
|
+
declare const imageBorderRadiusOptions: {
|
|
462
|
+
label: string;
|
|
463
|
+
value: string;
|
|
464
|
+
}[];
|
|
465
|
+
type ImageBorderRadius = (typeof imageBorderRadiusOptions)[number]["value"];
|
|
466
|
+
declare const ThemeOptions: {
|
|
467
|
+
HEADING_LEVEL: {
|
|
468
|
+
label: string;
|
|
469
|
+
value: HeadingLevel;
|
|
470
|
+
}[];
|
|
471
|
+
TEXT_TRANSFORM: {
|
|
472
|
+
label: MsgString;
|
|
473
|
+
value: string;
|
|
474
|
+
}[];
|
|
475
|
+
FONT_STYLE: {
|
|
476
|
+
label: MsgString;
|
|
477
|
+
value: string;
|
|
478
|
+
}[];
|
|
479
|
+
LETTER_SPACING: {
|
|
480
|
+
label: string;
|
|
481
|
+
value: string;
|
|
482
|
+
}[];
|
|
483
|
+
BACKGROUND_COLOR: ComboboxOptionGroup[];
|
|
484
|
+
SITE_COLOR: ComboboxOptionGroup[];
|
|
485
|
+
CTA_VARIANT: {
|
|
486
|
+
label: MsgString;
|
|
487
|
+
value: string;
|
|
488
|
+
}[];
|
|
489
|
+
PRESET_IMAGE: {
|
|
490
|
+
label: string;
|
|
491
|
+
value: PresetImageType;
|
|
492
|
+
}[];
|
|
493
|
+
ALIGNMENT: {
|
|
494
|
+
label: MsgString;
|
|
495
|
+
value: string;
|
|
496
|
+
}[];
|
|
497
|
+
VERTICAL_POSITION: {
|
|
498
|
+
label: MsgString;
|
|
499
|
+
value: string;
|
|
500
|
+
}[];
|
|
501
|
+
JUSTIFY_CONTENT: {
|
|
502
|
+
label: MsgString;
|
|
503
|
+
value: string;
|
|
504
|
+
}[];
|
|
505
|
+
BODY_VARIANT: {
|
|
506
|
+
label: MsgString;
|
|
507
|
+
value: string;
|
|
508
|
+
}[];
|
|
509
|
+
BUTTON_BORDER_RADIUS: BorderRadiusOption[];
|
|
510
|
+
IMAGE_BORDER_RADIUS: {
|
|
511
|
+
label: string;
|
|
512
|
+
value: string;
|
|
513
|
+
}[];
|
|
514
|
+
SPACING: () => {
|
|
515
|
+
label: string;
|
|
516
|
+
value: string;
|
|
517
|
+
}[];
|
|
518
|
+
FONT_SIZE: (includeLargeSizes?: boolean) => {
|
|
519
|
+
label: string;
|
|
520
|
+
value: string;
|
|
521
|
+
}[];
|
|
522
|
+
HOURS_OPTIONS: {
|
|
523
|
+
label: MsgString;
|
|
524
|
+
value: string;
|
|
525
|
+
}[];
|
|
526
|
+
PHONE_OPTIONS: {
|
|
527
|
+
label: MsgString;
|
|
528
|
+
value: string;
|
|
529
|
+
}[];
|
|
530
|
+
MAX_WIDTH: {
|
|
531
|
+
label: MsgString;
|
|
532
|
+
value: string;
|
|
533
|
+
}[];
|
|
534
|
+
SHOW_HIDE: {
|
|
535
|
+
label: MsgString;
|
|
536
|
+
value: boolean;
|
|
537
|
+
}[];
|
|
538
|
+
};
|
|
539
|
+
declare const VisualEditorThemeClassSafelist: string[];
|
|
540
|
+
declare const VisualEditorComponentsContentPath = "node_modules/@yext/visual-editor/dist/**/*.js";
|
|
541
|
+
|
|
542
|
+
declare const useBackground: () => Required<ThemeColor> | undefined;
|
|
543
|
+
declare const BackgroundProvider: ({ children, value, }: {
|
|
544
|
+
children: ReactNode;
|
|
545
|
+
value: Required<ThemeColor>;
|
|
546
|
+
}) => React__default.JSX.Element;
|
|
547
|
+
|
|
548
|
+
/** An object mapping translation keys to the translated values. Allows sub-objects. */
|
|
549
|
+
type TranslationDictionary = {
|
|
550
|
+
[key: string]: string | TranslationDictionary;
|
|
551
|
+
};
|
|
552
|
+
/** A function that loads one complete locale dictionary on request. */
|
|
553
|
+
type TranslationLoader = () => Promise<TranslationDictionary>;
|
|
554
|
+
/** Maps normalized locales to complete, ready-to-install dictionaries. */
|
|
555
|
+
type TranslationLoaders = Partial<Record<string, TranslationLoader>>;
|
|
556
|
+
/** The complete translation loaders used by a Section Library runtime. */
|
|
557
|
+
type SectionLibraryTranslationLoaders = {
|
|
558
|
+
platform: TranslationLoaders;
|
|
559
|
+
page: TranslationLoaders;
|
|
560
|
+
};
|
|
561
|
+
/** Loads a complete generated translation dictionary, falling back to English. */
|
|
562
|
+
declare const loadTranslationDictionary: (locale: string, loaders: TranslationLoaders) => Promise<TranslationDictionary>;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Returns the preferred distance unit for a given locale.
|
|
566
|
+
*/
|
|
567
|
+
declare const getPreferredDistanceUnit: (locale: string) => "mile" | "kilometer";
|
|
568
|
+
/**
|
|
569
|
+
* Converts miles to kilometers.
|
|
570
|
+
*/
|
|
571
|
+
declare const toKilometers: (miles: number) => number;
|
|
572
|
+
declare const toMiles: (kilometers: number) => number;
|
|
573
|
+
declare const toMeters: (distance: number, unit: "mile" | "kilometer") => number;
|
|
574
|
+
declare const fromMeters: (meters: number, unit: "mile" | "kilometer") => number;
|
|
575
|
+
declare const formatDistance: (distance: number, locale: string, minDigits?: number, maxDigits?: number) => string;
|
|
576
|
+
|
|
577
|
+
declare const fetchLocalesToPathsForEntity: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, entityId, streamDocument, }: {
|
|
578
|
+
businessId: string;
|
|
579
|
+
apiKey: string;
|
|
580
|
+
contentEndpointId: string;
|
|
581
|
+
contentDeliveryAPIDomain: string;
|
|
582
|
+
entityId: string;
|
|
583
|
+
streamDocument: StreamDocument;
|
|
584
|
+
}) => Promise<Record<string, string>>;
|
|
585
|
+
|
|
586
|
+
type CoreStyle = {
|
|
587
|
+
label: string;
|
|
588
|
+
type: "number";
|
|
589
|
+
default: number;
|
|
590
|
+
} | {
|
|
591
|
+
label: string;
|
|
592
|
+
type: "select";
|
|
593
|
+
default: string;
|
|
594
|
+
options: StyleSelectOption[] | (() => StyleSelectOption[]);
|
|
595
|
+
} | {
|
|
596
|
+
label: string;
|
|
597
|
+
type: "color";
|
|
598
|
+
default: string;
|
|
599
|
+
};
|
|
600
|
+
type Style = CoreStyle & {
|
|
601
|
+
plugin: string;
|
|
602
|
+
};
|
|
603
|
+
type StyleSelectOption = {
|
|
604
|
+
label: string;
|
|
605
|
+
value: string;
|
|
606
|
+
};
|
|
607
|
+
type StyleGroup = {
|
|
608
|
+
label: string;
|
|
609
|
+
plugin: string;
|
|
610
|
+
styles: {
|
|
611
|
+
[key: string]: CoreStyle;
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
type ThemeConfigSection = {
|
|
615
|
+
label: string;
|
|
616
|
+
styles: {
|
|
617
|
+
[key: string]: Style | StyleGroup;
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
type ThemeConfig = {
|
|
621
|
+
[key: string]: ThemeConfigSection;
|
|
622
|
+
};
|
|
623
|
+
type TailwindConfig = {
|
|
624
|
+
[key: string]: {
|
|
625
|
+
[key: string]: any;
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
type PlainObject = Record<string, any>;
|
|
629
|
+
/**
|
|
630
|
+
* Merges two objects deeply, giving priority to properties from the first object.
|
|
631
|
+
*/
|
|
632
|
+
declare const deepMerge: <T extends PlainObject, U extends PlainObject>(obj1: T, obj2: U) => T & U;
|
|
633
|
+
/**
|
|
634
|
+
* Merges the developer-specified theming and the marketer-specified theming,
|
|
635
|
+
* giving priority to the developer-specified theming.
|
|
636
|
+
*/
|
|
637
|
+
declare const themeResolver: (developerTheming: TailwindConfig, marketerTheming: ThemeConfig) => TailwindConfig;
|
|
638
|
+
|
|
639
|
+
type FontWeightSupport = {
|
|
640
|
+
weights: number[];
|
|
641
|
+
} | {
|
|
642
|
+
minWeight: number;
|
|
643
|
+
maxWeight: number;
|
|
644
|
+
};
|
|
645
|
+
type FontVariant = {
|
|
646
|
+
style: "normal" | "italic";
|
|
647
|
+
filePath: string;
|
|
648
|
+
} & FontWeightSupport;
|
|
649
|
+
type Font = {
|
|
650
|
+
fallback: "sans-serif" | "serif" | "monospace" | "cursive";
|
|
651
|
+
italics: boolean;
|
|
652
|
+
facePath?: string;
|
|
653
|
+
variants?: FontVariant[];
|
|
654
|
+
} & FontWeightSupport;
|
|
655
|
+
type FontRegistry = Record<string, Font>;
|
|
656
|
+
declare const defaultFonts: FontRegistry;
|
|
657
|
+
/**
|
|
658
|
+
* Builds font-family select options from a font registry. The label and CSS
|
|
659
|
+
* font-family value are both derived from the font family name so theme data
|
|
660
|
+
* remains human-readable.
|
|
661
|
+
*/
|
|
662
|
+
declare const constructFontSelectOptions: (fonts: FontRegistry) => {
|
|
663
|
+
label: string;
|
|
664
|
+
value: string;
|
|
665
|
+
}[];
|
|
666
|
+
type getFontWeightParams = {
|
|
667
|
+
fontCssVariable?: string;
|
|
668
|
+
weightOptions?: StyleSelectOption[];
|
|
669
|
+
fontList?: FontRegistry;
|
|
670
|
+
};
|
|
671
|
+
declare const getFontWeightOptions: (options: getFontWeightParams) => StyleSelectOption[];
|
|
672
|
+
declare const getFontWeightOverrideOptions: (options: getFontWeightParams) => Promise<StyleSelectOption[]>;
|
|
673
|
+
|
|
674
|
+
declare const themeManagerTwMergeConfiguration: {
|
|
675
|
+
extend: {
|
|
676
|
+
classGroups: {
|
|
677
|
+
"font-family": {
|
|
678
|
+
font: ((value: string) => boolean)[];
|
|
679
|
+
}[];
|
|
680
|
+
"font-weight": {
|
|
681
|
+
font: ((value: string) => boolean)[];
|
|
682
|
+
}[];
|
|
683
|
+
"font-size": {
|
|
684
|
+
text: ((value: string) => boolean)[];
|
|
685
|
+
}[];
|
|
686
|
+
"text-color": {
|
|
687
|
+
text: ((value: string) => boolean)[];
|
|
688
|
+
}[];
|
|
689
|
+
gap: {
|
|
690
|
+
gap: ((value: string) => boolean)[];
|
|
691
|
+
}[];
|
|
692
|
+
py: {
|
|
693
|
+
py: ((value: string) => boolean)[];
|
|
694
|
+
}[];
|
|
695
|
+
px: {
|
|
696
|
+
px: ((value: string) => boolean)[];
|
|
697
|
+
}[];
|
|
698
|
+
"max-w": {
|
|
699
|
+
"max-w": ((value: string) => boolean)[];
|
|
700
|
+
}[];
|
|
701
|
+
"bg-color": {
|
|
702
|
+
"bg-color": ((value: string) => boolean)[];
|
|
703
|
+
}[];
|
|
704
|
+
rounded: {
|
|
705
|
+
rounded: ((value: string) => boolean)[];
|
|
706
|
+
}[];
|
|
707
|
+
"text-transform": ((value: string) => boolean)[];
|
|
708
|
+
tracking: ((value: string) => boolean)[];
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
declare function themeManagerCn(...inputs: ClassValue[]): string;
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Binds parent data into the first child of each named slot.
|
|
716
|
+
*
|
|
717
|
+
* 1. Looks up the first child in each named slot.
|
|
718
|
+
* 2. Detects whether that child supports shorthand binding through
|
|
719
|
+
* `slotChildTypeToParentDataKey`.
|
|
720
|
+
* 3. Normalizes raw values like `title` or `image` into the child component's
|
|
721
|
+
* expected `parentData` shape.
|
|
722
|
+
* 4. Detects linked mode from `props.field` and clears missing shorthand
|
|
723
|
+
* values so authored fallback constants do not bleed through.
|
|
724
|
+
* 5. Writes the resulting `parentData` back onto the slot child.
|
|
725
|
+
*
|
|
726
|
+
* Pass a full parent-data object when a slot needs custom shape like
|
|
727
|
+
* `{ field, text }`. For common slot child types, raw values can be passed and
|
|
728
|
+
* this helper will wrap them automatically.
|
|
729
|
+
*
|
|
730
|
+
* In linked mode, a missing value still writes an empty parent-data object for
|
|
731
|
+
* supported slot child types so authored fallback constants do not bleed
|
|
732
|
+
* through. In manual/default mode, missing values clear any stale
|
|
733
|
+
* `parentData`, so authored slot content stays visible and cards unlock when
|
|
734
|
+
* switching back from linked mode.
|
|
735
|
+
*
|
|
736
|
+
* Example:
|
|
737
|
+
* ```ts
|
|
738
|
+
* bindSlots(data, {
|
|
739
|
+
* TitleSlot: data.props.title,
|
|
740
|
+
* DescriptionSlot: data.props.description,
|
|
741
|
+
* ImageSlot: data.props.image,
|
|
742
|
+
* CTASlot: data.props.cta,
|
|
743
|
+
* })
|
|
744
|
+
* ```
|
|
745
|
+
*
|
|
746
|
+
* If the first child types are `HeadingTextSlot`, `BodyTextSlot`, `ImageSlot`,
|
|
747
|
+
* and `CTASlot`, that example resolves to parent-data payloads like:
|
|
748
|
+
* ```ts
|
|
749
|
+
* {
|
|
750
|
+
* TitleSlot: { text: data.props.title },
|
|
751
|
+
* DescriptionSlot: { richText: data.props.description },
|
|
752
|
+
* ImageSlot: { image: data.props.image },
|
|
753
|
+
* CTASlot: { cta: data.props.cta },
|
|
754
|
+
* }
|
|
755
|
+
* ```
|
|
756
|
+
*/
|
|
757
|
+
declare const bindSlots: <TData extends {
|
|
758
|
+
props: {
|
|
759
|
+
field?: string;
|
|
760
|
+
slots?: Record<string, Array<{
|
|
761
|
+
props?: Record<string, unknown>;
|
|
762
|
+
type?: string;
|
|
763
|
+
}>>;
|
|
764
|
+
};
|
|
765
|
+
}>(data: TData, slotBindings: Record<string, unknown>) => TData;
|
|
766
|
+
|
|
767
|
+
type RootConfig = {
|
|
768
|
+
title?: string;
|
|
769
|
+
description?: string;
|
|
770
|
+
[key: string]: any;
|
|
771
|
+
};
|
|
772
|
+
declare function getPageMetadata(document: Record<string, any>): RootConfig;
|
|
773
|
+
/**
|
|
774
|
+
* resolveDirectoryRootProps scans the meta title and description fields
|
|
775
|
+
* and replaces PLACEHOLDER with an appropriate value based on the entityType
|
|
776
|
+
*/
|
|
777
|
+
declare const resolveDirectoryRootProps: (props: Record<string, any>, streamDocument: StreamDocument) => {
|
|
778
|
+
[x: string]: any;
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
declare const isNonNormalizableLinkType: (linkType?: LinkType | string | null) => boolean;
|
|
782
|
+
/**
|
|
783
|
+
* Normalizes the provided content by converting upper-case ones to lower case,
|
|
784
|
+
* replacing white spaces with a "-" and stripping all other illegal characters.
|
|
785
|
+
* Does not normalize links for EMAIL and PHONE link types.
|
|
786
|
+
*/
|
|
787
|
+
declare const normalizeLink: (content?: string, linkType?: LinkType) => string;
|
|
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
|
+
};
|
|
794
|
+
/**
|
|
795
|
+
* hexToRGB converts a hex color to rgb
|
|
796
|
+
* @param H hex string beginning with '#'
|
|
797
|
+
* @returns {number[] | undefined} [r, g, b] if conversion succeeds
|
|
798
|
+
*/
|
|
799
|
+
declare const hexToRGB: (H: string) => number[] | undefined;
|
|
800
|
+
/**
|
|
801
|
+
* isColorContrastWcagCompliant checks color contrast based on WCAG 2.1 SC 1.4.3 (Level AA)
|
|
802
|
+
* The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for
|
|
803
|
+
* large-scale text and images of large-scale text have a contrast ratio of at least 3:1.
|
|
804
|
+
* Large-scale text means with at least 18 point or 14 point bold.
|
|
805
|
+
* @param rgb1 [r, g, b]
|
|
806
|
+
* @param rgb2 [r, g, b]
|
|
807
|
+
* @param fontSizePt the font size in points
|
|
808
|
+
* @param fontWeight the numerical font weight (100-900)
|
|
809
|
+
* @returns {boolean} Whether the colors pass the contrast check. False if color conversion fails
|
|
810
|
+
*/
|
|
811
|
+
declare const isColorContrastWcagCompliant: (rgb1: number[], rgb2: number[], fontSizePt: number, fontWeight: number) => boolean;
|
|
812
|
+
/**
|
|
813
|
+
* Resolves a ThemeColor token to a concrete CSS color value.
|
|
814
|
+
* Supports base palette/contrast tokens, derived dark/light palette tokens,
|
|
815
|
+
* literal white/black, and bracketed custom colors.
|
|
816
|
+
*/
|
|
817
|
+
declare const getThemeColorCssValue: (colorToken?: ThemeColor | string) => string | undefined;
|
|
818
|
+
declare const normalizeThemeColorToken: (color?: ThemeColor | string) => string | undefined;
|
|
819
|
+
/**
|
|
820
|
+
* Resolves a ThemeColor token to a concrete hex color value in both browser and SSR contexts.
|
|
821
|
+
*/
|
|
822
|
+
declare const getThemeColorHexValue: (colorToken?: ThemeColor | string, streamDocument?: StreamDocument | Record<string, any>) => string | undefined;
|
|
823
|
+
/** Returns true when the color needs a white foreground for readable text. */
|
|
824
|
+
declare const isDarkColor: (color?: ThemeColor | string, streamDocument?: StreamDocument | Record<string, any>) => boolean;
|
|
825
|
+
/** Returns a readable foreground color for a themed surface. */
|
|
826
|
+
declare const getDefaultForegroundColor: (surfaceColor?: ThemeColor | string, streamDocument?: StreamDocument | Record<string, any>) => ThemeColor | undefined;
|
|
827
|
+
/** Returns inline background and foreground colors for a themed surface. */
|
|
828
|
+
declare const getSurfaceColorStyle: (surfaceColor?: ThemeColor | string, streamDocument?: StreamDocument | Record<string, any>, options?: {
|
|
829
|
+
fallbackBackgroundColor?: string;
|
|
830
|
+
fallbackTextColor?: string;
|
|
831
|
+
}) => {
|
|
832
|
+
backgroundColor?: string;
|
|
833
|
+
color?: string;
|
|
834
|
+
} | undefined;
|
|
835
|
+
/**
|
|
836
|
+
* Resolves ThemeColor classes for background contexts.
|
|
837
|
+
* @param color a ThemeColor object
|
|
838
|
+
* @returns a class string containing the selected background class and contrasting text class.
|
|
839
|
+
*/
|
|
840
|
+
declare const getBackgroundColorClasses: (color?: ThemeColor) => string;
|
|
841
|
+
/**
|
|
842
|
+
* Resolves inline styles for resolved colors and bracketed custom colors in background contexts.
|
|
843
|
+
* @param color a ThemeColor or ResolvedThemeColor object
|
|
844
|
+
* @returns inline background/text color styles, e.g. `{ backgroundColor: "#FF6D66" }`
|
|
845
|
+
*/
|
|
846
|
+
declare const getBackgroundColorStyle: (color?: ThemeColor | ResolvedThemeColor) => {
|
|
847
|
+
backgroundColor?: string;
|
|
848
|
+
color?: string;
|
|
849
|
+
} | undefined;
|
|
850
|
+
/**
|
|
851
|
+
* Resolves ThemeColor class for text contexts.
|
|
852
|
+
* @param color a ThemeColor object
|
|
853
|
+
* @returns the selected text color class, if present.
|
|
854
|
+
*/
|
|
855
|
+
declare const getTextColorClass: (color?: ThemeColor) => string | undefined;
|
|
856
|
+
/**
|
|
857
|
+
* Resolves inline styles for bracketed custom colors in text contexts.
|
|
858
|
+
* @param color a ThemeColor object
|
|
859
|
+
* @returns inline text color styles, e.g. `{ color: "#FF6D66" }`
|
|
860
|
+
*/
|
|
861
|
+
declare const getTextColorStyle: (color?: ThemeColor) => {
|
|
862
|
+
color?: string;
|
|
863
|
+
} | undefined;
|
|
864
|
+
|
|
865
|
+
declare const bodyVariants: (props?: ({
|
|
866
|
+
variant?: "xs" | "sm" | "base" | "lg" | null | undefined;
|
|
867
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
868
|
+
interface BodyProps extends Omit<React.HTMLAttributes<HTMLParagraphElement>, "color">, VariantProps<typeof bodyVariants> {
|
|
869
|
+
color?: ThemeColor;
|
|
870
|
+
}
|
|
871
|
+
declare const Body: React.ForwardRefExoticComponent<BodyProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
872
|
+
|
|
873
|
+
type Only<T, U> = {
|
|
874
|
+
[P in keyof T]: T[P];
|
|
875
|
+
} & {
|
|
876
|
+
[P in keyof U]?: never;
|
|
877
|
+
};
|
|
878
|
+
type Neither<T, U> = {
|
|
879
|
+
[P in keyof T]?: never;
|
|
880
|
+
} & {
|
|
881
|
+
[P in keyof U]?: never;
|
|
882
|
+
};
|
|
883
|
+
type Either<T, U> = Only<T, U> | Only<U, T>;
|
|
884
|
+
type EitherOrNeither<T, U> = Either<T, U> | Neither<T, U>;
|
|
885
|
+
type ConfigFields<T extends Record<string, any>> = T["stream"]["fields"];
|
|
886
|
+
type AllowList<T extends Record<string, any>> = {
|
|
887
|
+
allowList: ConfigFields<T>[number][];
|
|
888
|
+
};
|
|
889
|
+
type DisallowList<T extends Record<string, any>> = {
|
|
890
|
+
disallowList: ConfigFields<T>[number][];
|
|
891
|
+
};
|
|
892
|
+
type EntityFieldTypesFilter = {
|
|
893
|
+
types?: EntityFieldTypes[];
|
|
894
|
+
includeListsOnly?: boolean;
|
|
895
|
+
directChildrenOf?: string;
|
|
896
|
+
descendantsOf?: string;
|
|
897
|
+
subdocumentField?: string;
|
|
898
|
+
};
|
|
899
|
+
type RenderEntityFieldFilter<T extends Record<string, any>> = EntityFieldTypesFilter & EitherOrNeither<AllowList<T>, DisallowList<T>>;
|
|
900
|
+
type EntityFieldTypes = "type.string" | "type.decimal" | "type.float" | "type.integer" | "type.image" | "type.hours" | "type.address" | "type.phone" | "type.coordinate" | "type.cta" | "type.boolean" | "type.option" | "type.datetime" | "type.price" | "type.faq_section" | "type.testimonials_section" | "type.products_section" | "type.insights_section" | "type.rich_text_v2" | "type.team_section" | "type.events_section" | "type.promo_section" | `c_${string}`;
|
|
901
|
+
|
|
902
|
+
type MappedSourceFieldFilter<T extends Record<string, any>> = RenderEntityFieldFilter<T> & {
|
|
903
|
+
/** Higher-priority repeated-source constraints used by itemSource pickers. */
|
|
904
|
+
itemSourceTypes?: EntityFieldTypes[][];
|
|
905
|
+
/** Used only when itemSourceTypes is not provided. */
|
|
906
|
+
mappedSourceTypes?: EntityFieldTypes[][];
|
|
907
|
+
};
|
|
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
|
+
|
|
943
|
+
type ThemeOptionKey = keyof typeof ThemeOptions;
|
|
944
|
+
type BasicSelectorOptions = ComboboxOption[] | (() => ComboboxOption[]) | ThemeOptionKey;
|
|
945
|
+
/**
|
|
946
|
+
Example usage:
|
|
947
|
+
|
|
948
|
+
import type { PuckComponent } from "@puckeditor/core";
|
|
949
|
+
import { msg } from "../utils/i18n/platform.ts";
|
|
950
|
+
import { YextComponentConfig, YextFields } from "./fields.ts";
|
|
951
|
+
|
|
952
|
+
export type MyComponentProps = {
|
|
953
|
+
foo: string;
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
const myComponentFields: YextFields<MyComponentProps> = {
|
|
957
|
+
foo: {
|
|
958
|
+
type: "basicSelector",
|
|
959
|
+
label: msg("tone", "Tone"),
|
|
960
|
+
options: [
|
|
961
|
+
{ label: msg("foo.options.neutral", "Neutral"), value: "neutral" },
|
|
962
|
+
{ label: msg("foo.options.bold", "Bold"), value: "bold" },
|
|
963
|
+
],
|
|
964
|
+
disableSearch: false,
|
|
965
|
+
},
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
const MyComponentWrapper: PuckComponent<MyComponentProps> = ({ foo }) => {
|
|
969
|
+
return <div>{foo}</div>;
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
export const MyComponent: YextComponentConfig<MyComponentProps> = {
|
|
973
|
+
label: msg("components.myComponent", "My Component"),
|
|
974
|
+
fields: myComponentFields,
|
|
975
|
+
// resolveData: (data) => {...},
|
|
976
|
+
render: (props) => <MyComponentWrapper {...props} />,
|
|
977
|
+
};
|
|
978
|
+
*/
|
|
979
|
+
type BasicSelectorFieldBase = BaseField & {
|
|
980
|
+
type: "basicSelector";
|
|
981
|
+
label?: string | MsgString;
|
|
982
|
+
visible?: boolean;
|
|
983
|
+
translateOptions?: boolean;
|
|
984
|
+
noOptionsPlaceholder?: string | MsgString;
|
|
985
|
+
noOptionsMessage?: string | MsgString;
|
|
986
|
+
disableSearch?: boolean;
|
|
987
|
+
};
|
|
988
|
+
type BasicSelectorFieldWithOptions = BasicSelectorFieldBase & {
|
|
989
|
+
options: BasicSelectorOptions;
|
|
990
|
+
optionGroups?: never;
|
|
991
|
+
};
|
|
992
|
+
type BasicSelectorFieldWithGroups = BasicSelectorFieldBase & {
|
|
993
|
+
options?: never;
|
|
994
|
+
optionGroups: ComboboxOptionGroup[];
|
|
995
|
+
};
|
|
996
|
+
type BasicSelectorField = BasicSelectorFieldWithOptions | BasicSelectorFieldWithGroups;
|
|
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;
|
|
1014
|
+
|
|
1015
|
+
type CodeLanguageOptions = "html" | "css" | "json" | "shell" | "java" | "javascript" | "jsx" | "markdown" | "typescript";
|
|
1016
|
+
type CodeField = BaseField & {
|
|
1017
|
+
/** Processes HTML templates and JavaScript embedded fields; other code stays authored. */
|
|
1018
|
+
type: "code";
|
|
1019
|
+
label?: string | MsgString;
|
|
1020
|
+
visible?: boolean;
|
|
1021
|
+
codeLanguage: CodeLanguageOptions;
|
|
1022
|
+
};
|
|
1023
|
+
type CodeFieldOverrideProps = FieldProps<CodeField> & {
|
|
1024
|
+
children: React__default.ReactNode;
|
|
1025
|
+
};
|
|
1026
|
+
declare const CodeFieldOverride: ({ field, value, onChange, }: CodeFieldOverrideProps) => React__default.JSX.Element;
|
|
1027
|
+
|
|
1028
|
+
type DateTimeSelectorField = BaseField & {
|
|
1029
|
+
type: "dateTimeSelector";
|
|
1030
|
+
label?: string | MsgString;
|
|
1031
|
+
visible?: boolean;
|
|
1032
|
+
};
|
|
1033
|
+
type DateTimeSelectorFieldProps = FieldProps<DateTimeSelectorField>;
|
|
1034
|
+
declare const DateTimeSelectorFieldOverride: ({ field, value, onChange, }: DateTimeSelectorFieldProps) => React__default.JSX.Element;
|
|
1035
|
+
|
|
1036
|
+
type FontSizeSelectorField = BaseField & {
|
|
1037
|
+
type: "fontSizeSelector";
|
|
1038
|
+
label?: string | MsgString;
|
|
1039
|
+
visible?: boolean;
|
|
1040
|
+
includeLargeSizes?: boolean;
|
|
1041
|
+
};
|
|
1042
|
+
type FontSizeSelectorFieldProps = FieldProps<FontSizeSelectorField>;
|
|
1043
|
+
declare const FontSizeSelectorFieldOverride: ({ field, value, onChange, }: FontSizeSelectorFieldProps) => React__default.JSX.Element;
|
|
1044
|
+
|
|
1045
|
+
/** Represents data that can either be from the Yext Knowledge Graph or statically defined */
|
|
1046
|
+
type YextEntityField<TValue, TMappings = never> = {
|
|
1047
|
+
/** The api name of the Yext field */
|
|
1048
|
+
field: string;
|
|
1049
|
+
/** The static value of the field */
|
|
1050
|
+
constantValue: TValue;
|
|
1051
|
+
/** Whether to use the Yext field or the constant value */
|
|
1052
|
+
constantValueEnabled?: boolean;
|
|
1053
|
+
/** Whether the field can be translated or not. */
|
|
1054
|
+
disallowTranslation?: boolean;
|
|
1055
|
+
/** Nested mappings used by repeated linked-item sources. */
|
|
1056
|
+
mappings?: TMappings;
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
declare const CTA_SELECTION_TYPES: readonly ["textAndLink", "getDirections", "presetImage"];
|
|
1060
|
+
type CTASelectionType = (typeof CTA_SELECTION_TYPES)[number];
|
|
1061
|
+
type CTAFieldLike = {
|
|
1062
|
+
constantValueEnabled?: boolean;
|
|
1063
|
+
constantValue?: {
|
|
1064
|
+
ctaType?: CTASelectionType;
|
|
1065
|
+
};
|
|
1066
|
+
selectedType?: CTASelectionType;
|
|
1067
|
+
};
|
|
1068
|
+
/**
|
|
1069
|
+
* Determines the CTA type for either static or Knowledge Graph CTA values.
|
|
1070
|
+
*/
|
|
1071
|
+
declare const getCTAType: (entityField?: CTAFieldLike | null) => {
|
|
1072
|
+
ctaType: "textAndLink" | "getDirections" | "presetImage" | undefined;
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
type YextCTAField = YextEntityField<EnhancedTranslatableCTA> & {
|
|
1076
|
+
selectedType?: CTASelectionType;
|
|
1077
|
+
};
|
|
1078
|
+
type CTASelectorField = BaseField & {
|
|
1079
|
+
type: "ctaSelector";
|
|
1080
|
+
/** Resolves the CTA source, localized text, and directions URL before rendering. */
|
|
1081
|
+
transform?: boolean;
|
|
1082
|
+
label?: string | MsgString;
|
|
1083
|
+
visible?: boolean;
|
|
1084
|
+
disableConstantValueToggle?: boolean;
|
|
1085
|
+
};
|
|
1086
|
+
type CTASelectorFieldProps = FieldProps<CTASelectorField>;
|
|
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;
|
|
1092
|
+
|
|
1093
|
+
type MultiSelectorOptionValue = string | number | boolean;
|
|
1094
|
+
type MultiSelectorOptionSelection<T extends MultiSelectorOptionValue> = {
|
|
1095
|
+
value: T | undefined;
|
|
1096
|
+
};
|
|
1097
|
+
interface MultiSelectorValue<T extends MultiSelectorOptionValue> {
|
|
1098
|
+
selections: MultiSelectorOptionSelection<T>[];
|
|
1099
|
+
}
|
|
1100
|
+
interface MultiSelectorOption<T extends MultiSelectorOptionValue> {
|
|
1101
|
+
label: string;
|
|
1102
|
+
value: T | undefined;
|
|
1103
|
+
}
|
|
1104
|
+
type MultiSelectorOptions<T extends MultiSelectorOptionValue> = MultiSelectorOption<T>[] | (() => MultiSelectorOption<T>[]);
|
|
1105
|
+
/**
|
|
1106
|
+
* A field type for selecting multiple values from a static or dynamic list of
|
|
1107
|
+
* options.
|
|
1108
|
+
*
|
|
1109
|
+
* Example:
|
|
1110
|
+
*
|
|
1111
|
+
* ```tsx
|
|
1112
|
+
* const fields: YextFields<MyComponentProps> = {
|
|
1113
|
+
* filters: {
|
|
1114
|
+
* type: "multiSelector",
|
|
1115
|
+
* label: msg("fields.filters", "Filters"),
|
|
1116
|
+
* dropdownLabel: msg("fields.field", "Field"),
|
|
1117
|
+
* options: [
|
|
1118
|
+
* { label: msg("fields.city", "City"), value: "address.city" },
|
|
1119
|
+
* { label: msg("fields.region", "Region"), value: "address.region" },
|
|
1120
|
+
* ],
|
|
1121
|
+
* placeholderOptionLabel: msg("fields.selectAField", "Select a field"),
|
|
1122
|
+
* },
|
|
1123
|
+
* };
|
|
1124
|
+
* ```
|
|
1125
|
+
*
|
|
1126
|
+
* The saved value shape is:
|
|
1127
|
+
*
|
|
1128
|
+
* ```ts
|
|
1129
|
+
* { selections: [{ value: "address.city" }] }
|
|
1130
|
+
* ```
|
|
1131
|
+
*/
|
|
1132
|
+
type MultiSelectorField<T extends MultiSelectorOptionValue = any> = BaseField & {
|
|
1133
|
+
type: "multiSelector";
|
|
1134
|
+
/** Returns the selected values as an array before rendering. */
|
|
1135
|
+
transform?: boolean;
|
|
1136
|
+
label: string | MsgString;
|
|
1137
|
+
dropdownLabel: string | MsgString;
|
|
1138
|
+
options: MultiSelectorOptions<T>;
|
|
1139
|
+
placeholderOptionLabel?: string | MsgString;
|
|
1140
|
+
};
|
|
1141
|
+
type MultiSelectorFieldProps<T extends MultiSelectorOptionValue> = FieldProps<MultiSelectorField<T>, MultiSelectorValue<T> | undefined>;
|
|
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;
|
|
1147
|
+
|
|
1148
|
+
type OptionalNumberValue = number | string | null | undefined;
|
|
1149
|
+
type OptionalNumberField = BaseField & {
|
|
1150
|
+
type: "optionalNumber";
|
|
1151
|
+
/** Returns a number or undefined before rendering. */
|
|
1152
|
+
transform?: boolean;
|
|
1153
|
+
label?: string | MsgString;
|
|
1154
|
+
hideNumberFieldRadioLabel: string | MsgString;
|
|
1155
|
+
showNumberFieldRadioLabel: string | MsgString;
|
|
1156
|
+
defaultCustomValue: number;
|
|
1157
|
+
};
|
|
1158
|
+
type OptionalNumberFieldProps = FieldProps<OptionalNumberField, OptionalNumberValue>;
|
|
1159
|
+
declare const OptionalNumberFieldOverride: ({ field, value, onChange, }: OptionalNumberFieldProps) => React__default.JSX.Element;
|
|
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
|
+
|
|
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
|
+
};
|
|
1205
|
+
type TemplateMetadata = {
|
|
1206
|
+
aiPageGeneration?: AiPageGeneration;
|
|
1207
|
+
siteId: number;
|
|
1208
|
+
templateId: string;
|
|
1209
|
+
layoutId?: string;
|
|
1210
|
+
entityId?: number;
|
|
1211
|
+
themeEntityId?: number;
|
|
1212
|
+
assignment: "ALL" | "ENTITY";
|
|
1213
|
+
isDevMode: boolean;
|
|
1214
|
+
devOverride: boolean;
|
|
1215
|
+
isxYextDebug: boolean;
|
|
1216
|
+
isThemeMode: boolean;
|
|
1217
|
+
entityCount: number;
|
|
1218
|
+
totalEntityCount: number;
|
|
1219
|
+
entityTypeDisplayName: string;
|
|
1220
|
+
platformLocale?: string;
|
|
1221
|
+
locales: string[];
|
|
1222
|
+
layoutTaskApprovals: boolean;
|
|
1223
|
+
locatorDisplayFields?: Record<string, FieldTypeData>;
|
|
1224
|
+
customFonts?: FontRegistry;
|
|
1225
|
+
headDeployStatus: HeadDeployStatus;
|
|
1226
|
+
};
|
|
1227
|
+
type FieldTypeData = {
|
|
1228
|
+
field_id: string;
|
|
1229
|
+
field_name: string;
|
|
1230
|
+
field_type: object;
|
|
1231
|
+
field_type_id: string;
|
|
1232
|
+
};
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* A rendered combobox group of entity field options.
|
|
1236
|
+
*/
|
|
1237
|
+
type EntityFieldOptionGroup<TOption> = {
|
|
1238
|
+
title?: string;
|
|
1239
|
+
options: TOption[];
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
type EmbeddedStringOption = {
|
|
1243
|
+
label: string;
|
|
1244
|
+
value: string;
|
|
1245
|
+
};
|
|
1246
|
+
/**
|
|
1247
|
+
* A debounced string input that allows embedding entity fields via a popover selector.
|
|
1248
|
+
*/
|
|
1249
|
+
declare const EmbeddedFieldStringInputFromEntity: <T extends Record<string, any>>({ value, onChange, filter, showFieldSelector, sourceFieldPath, sourceField: sourceFieldFromInputProps, }: {
|
|
1250
|
+
value: string;
|
|
1251
|
+
onChange: (value: string) => void;
|
|
1252
|
+
filter: RenderEntityFieldFilter<T>;
|
|
1253
|
+
showFieldSelector: boolean;
|
|
1254
|
+
sourceFieldPath?: string;
|
|
1255
|
+
sourceField?: string;
|
|
1256
|
+
}) => React__default.JSX.Element;
|
|
1257
|
+
declare const EmbeddedFieldStringInputFromOptions: ({ value, onChange, optionGroups, showFieldSelector, useOptionValueSublabel, sourceField, onFieldSelect, }: {
|
|
1258
|
+
value: string;
|
|
1259
|
+
onChange: (value: string) => void;
|
|
1260
|
+
optionGroups: EntityFieldOptionGroup<{
|
|
1261
|
+
label: string;
|
|
1262
|
+
value: string;
|
|
1263
|
+
}>[];
|
|
1264
|
+
showFieldSelector: boolean;
|
|
1265
|
+
useOptionValueSublabel?: boolean;
|
|
1266
|
+
sourceField?: string;
|
|
1267
|
+
onFieldSelect?: (fieldPath: string, resolutionFieldPath?: string, resolutionDocument?: Record<string, unknown>) => void;
|
|
1268
|
+
}) => React__default.JSX.Element;
|
|
1269
|
+
|
|
1270
|
+
type ImagePayload = {
|
|
1271
|
+
id: string;
|
|
1272
|
+
value: ImageContentData;
|
|
1273
|
+
locale: string;
|
|
1274
|
+
};
|
|
1275
|
+
type ImageField = BaseField & {
|
|
1276
|
+
type: "image";
|
|
1277
|
+
/** Localizes the asset image and resolves its alt text before rendering. */
|
|
1278
|
+
transform?: boolean;
|
|
1279
|
+
label?: string | MsgString;
|
|
1280
|
+
visible?: boolean;
|
|
1281
|
+
hideAltTextField?: boolean;
|
|
1282
|
+
maxFileSizeBytes?: number;
|
|
1283
|
+
getAltTextOptions?: (templateMetadata: TemplateMetadata) => EmbeddedStringOption[];
|
|
1284
|
+
};
|
|
1285
|
+
type ImageFieldOverrideProps = FieldProps<ImageField>;
|
|
1286
|
+
declare const buildLocatorDisplayOptions: (locatorDisplayFields?: Record<string, FieldTypeData>) => EmbeddedStringOption[];
|
|
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;
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* Defines the core typography styling properties shared across text-based components.
|
|
1295
|
+
*/
|
|
1296
|
+
type BaseTextStyles = {
|
|
1297
|
+
fontFamily: string;
|
|
1298
|
+
fontSize: string;
|
|
1299
|
+
fontWeight: string;
|
|
1300
|
+
fontStyle: "normal" | "italic" | "default";
|
|
1301
|
+
textTransform: "none" | "uppercase" | "lowercase" | "capitalize" | "default";
|
|
1302
|
+
};
|
|
1303
|
+
|
|
1304
|
+
type StyledButtonValue = BaseTextStyles & {
|
|
1305
|
+
borderRadius: string;
|
|
1306
|
+
letterSpacing: string;
|
|
1307
|
+
};
|
|
1308
|
+
type StyledButtonField = BaseField & {
|
|
1309
|
+
type: "styledButton";
|
|
1310
|
+
/** Converts authored button typography into CSS styles. */
|
|
1311
|
+
transform?: boolean;
|
|
1312
|
+
label?: string | MsgString;
|
|
1313
|
+
visible?: boolean;
|
|
1314
|
+
};
|
|
1315
|
+
type StyledButtonFieldProps = FieldProps<StyledButtonField, StyledButtonValue>;
|
|
1316
|
+
declare const StyledButtonFieldOverride: ({ field, value, onChange, }: StyledButtonFieldProps) => React__default.JSX.Element;
|
|
1317
|
+
|
|
1318
|
+
type StyledImageValue = {
|
|
1319
|
+
borderRadius: ImageBorderRadius | "default";
|
|
1320
|
+
};
|
|
1321
|
+
type StyledImageField = BaseField & {
|
|
1322
|
+
type: "styledImage";
|
|
1323
|
+
/** Converts the authored border radius into CSS styles. */
|
|
1324
|
+
transform?: boolean;
|
|
1325
|
+
label?: string | MsgString;
|
|
1326
|
+
visible?: boolean;
|
|
1327
|
+
};
|
|
1328
|
+
type StyledImageFieldProps = FieldProps<StyledImageField, StyledImageValue>;
|
|
1329
|
+
declare const StyledImageFieldOverride: ({ field, value, onChange, }: StyledImageFieldProps) => React__default.JSX.Element;
|
|
1330
|
+
|
|
1331
|
+
type StyledLinkValue = BaseTextStyles & {
|
|
1332
|
+
letterSpacing: string;
|
|
1333
|
+
includeCaret: string;
|
|
1334
|
+
};
|
|
1335
|
+
type StyledLinkField = BaseField & {
|
|
1336
|
+
type: "styledLink";
|
|
1337
|
+
/** Converts authored link typography and caret choice into CSS styles. */
|
|
1338
|
+
transform?: boolean;
|
|
1339
|
+
label?: string | MsgString;
|
|
1340
|
+
visible?: boolean;
|
|
1341
|
+
showIncludeCaretField?: boolean;
|
|
1342
|
+
};
|
|
1343
|
+
type StyledLinkFieldProps = FieldProps<StyledLinkField, StyledLinkValue>;
|
|
1344
|
+
/**
|
|
1345
|
+
* A custom field override for configuring link typography, letter spacing,
|
|
1346
|
+
* and an optional caret indicator.
|
|
1347
|
+
*/
|
|
1348
|
+
declare const StyledLinkFieldOverride: ({ field, value, onChange, }: StyledLinkFieldProps) => React__default.JSX.Element;
|
|
1349
|
+
|
|
1350
|
+
type StyledPageSectionValue = {
|
|
1351
|
+
contentWidth: ContentWidthValue;
|
|
1352
|
+
verticalPadding: VerticalPaddingValue;
|
|
1353
|
+
};
|
|
1354
|
+
type ContentWidthValue = "default" | "768px" | "960px" | "1024px" | "1280px" | "1440px";
|
|
1355
|
+
type VerticalPaddingValue = "default" | "0px" | "2px" | "4px" | "6px" | "8px" | "10px" | "12px" | "14px" | "16px" | "20px" | "24px" | "28px" | "32px" | "36px" | "40px" | "44px" | "48px" | "56px" | "64px" | "80px" | "96px";
|
|
1356
|
+
type StyledPageSectionField = BaseField & {
|
|
1357
|
+
type: "styledPageSection";
|
|
1358
|
+
/** Converts authored width and padding choices into CSS styles. */
|
|
1359
|
+
transform?: boolean;
|
|
1360
|
+
label?: string | MsgString;
|
|
1361
|
+
visible?: boolean;
|
|
1362
|
+
};
|
|
1363
|
+
type StyledPageSectionFieldProps = FieldProps<StyledPageSectionField, StyledPageSectionValue>;
|
|
1364
|
+
declare const StyledPageSectionFieldOverride: ({ field, value, onChange, }: StyledPageSectionFieldProps) => React.JSX.Element;
|
|
1365
|
+
|
|
1366
|
+
type StyledTextValue = BaseTextStyles & {
|
|
1367
|
+
color?: ThemeColor;
|
|
1368
|
+
};
|
|
1369
|
+
type StyledTextField = BaseField & {
|
|
1370
|
+
type: "styledText";
|
|
1371
|
+
/** Converts authored typography and color choices into CSS styles. */
|
|
1372
|
+
transform?: boolean;
|
|
1373
|
+
label?: string | MsgString;
|
|
1374
|
+
visible?: boolean;
|
|
1375
|
+
includeColor?: boolean;
|
|
1376
|
+
colorLabel?: string | MsgString;
|
|
1377
|
+
};
|
|
1378
|
+
type StyledTextFieldProps = FieldProps<StyledTextField, StyledTextValue>;
|
|
1379
|
+
declare const StyledTextFieldOverride: ({ field, value, onChange, }: StyledTextFieldProps) => React__default.JSX.Element;
|
|
1380
|
+
|
|
1381
|
+
type TranslatableStringField = BaseField & {
|
|
1382
|
+
type: "translatableString";
|
|
1383
|
+
/** Localizes and interpolates this field before rendering. */
|
|
1384
|
+
transform?: boolean;
|
|
1385
|
+
label?: string | MsgString;
|
|
1386
|
+
visible?: boolean;
|
|
1387
|
+
filter?: RenderEntityFieldFilter<any>;
|
|
1388
|
+
showApplyAllOption?: boolean;
|
|
1389
|
+
showFieldSelector?: boolean;
|
|
1390
|
+
getOptions?: () => EmbeddedStringOption[];
|
|
1391
|
+
sourceField?: string;
|
|
1392
|
+
sourceFieldPath?: string;
|
|
1393
|
+
};
|
|
1394
|
+
type TranslatableStringFieldProps = FieldProps<TranslatableStringField, TranslatableString | undefined>;
|
|
1395
|
+
declare const TranslatableStringFieldOverride: ({ field, onChange, value, }: TranslatableStringFieldProps) => React__default.JSX.Element;
|
|
1396
|
+
|
|
1397
|
+
type VideoField = BaseField & {
|
|
1398
|
+
type: "video";
|
|
1399
|
+
/** Resolves embedded fields in the video asset before rendering. */
|
|
1400
|
+
transform?: boolean;
|
|
1401
|
+
label?: string | MsgString;
|
|
1402
|
+
visible?: boolean;
|
|
1403
|
+
};
|
|
1404
|
+
type VideoFieldProps = FieldProps<VideoField, AssetVideo | undefined>;
|
|
1405
|
+
declare const VideoFieldOverride: ({ field, onChange, value, }: VideoFieldProps) => React.JSX.Element;
|
|
1406
|
+
|
|
1407
|
+
declare const buttonVariants: (props?: ({
|
|
1408
|
+
variant?: "link" | "primary" | "secondary" | "directoryLink" | "headerFooterMainLink" | "headerFooterSecondaryLink" | null | undefined;
|
|
1409
|
+
hasDarkBackground?: boolean | null | undefined;
|
|
1410
|
+
linkPadding?: "none" | "yOnly" | null | undefined;
|
|
1411
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1412
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
1413
|
+
asChild?: boolean;
|
|
1414
|
+
}
|
|
1415
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1416
|
+
|
|
1417
|
+
type CTAProps = {
|
|
1418
|
+
label: React.ReactNode;
|
|
1419
|
+
ctaType?: "textAndLink" | "getDirections" | "presetImage";
|
|
1420
|
+
actionType?: "link" | "button";
|
|
1421
|
+
link?: string;
|
|
1422
|
+
linkType?: LinkType;
|
|
1423
|
+
normalizeLink: boolean;
|
|
1424
|
+
presetImageType?: PresetImageType;
|
|
1425
|
+
id?: string;
|
|
1426
|
+
dataAttributes?: Record<`data-${string}`, string>;
|
|
1427
|
+
variant?: ButtonProps["variant"];
|
|
1428
|
+
className?: string;
|
|
1429
|
+
style?: React.CSSProperties;
|
|
1430
|
+
eventName?: string;
|
|
1431
|
+
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
1432
|
+
alwaysHideCaret?: boolean;
|
|
1433
|
+
ariaLabel?: string;
|
|
1434
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void;
|
|
1435
|
+
disabled?: boolean;
|
|
1436
|
+
color?: ThemeColor;
|
|
1437
|
+
openInNewTab?: boolean;
|
|
1438
|
+
/**
|
|
1439
|
+
* When true and variant is "link", applies vertical padding (py-3) to the CTA.
|
|
1440
|
+
* @defaultValue false
|
|
1441
|
+
*/
|
|
1442
|
+
setPadding?: boolean;
|
|
1443
|
+
};
|
|
1444
|
+
/**
|
|
1445
|
+
* The different visual variants for CTA buttons.
|
|
1446
|
+
* "primary": the default button style. A button filled with the primary theme color.
|
|
1447
|
+
* "secondary": an outlined button style. A button with a border in the primary theme color and transparent background.
|
|
1448
|
+
* "link": a text link style. A button with no border or background, just a hyperlink in the link theme color.
|
|
1449
|
+
* "directoryLink": a text link style optimized for directory listings.
|
|
1450
|
+
* "headerFooterMainLink": a text link style optimized for main links in the header and footer.
|
|
1451
|
+
* "headerFooterSecondaryLink": a text link style optimized for secondary links in the header and footer.
|
|
1452
|
+
*/
|
|
1453
|
+
type CTAVariant = ButtonProps["variant"];
|
|
1454
|
+
/** Returns whether a CTA variant supports user-configurable color overrides. */
|
|
1455
|
+
declare const isCtaVariantWithColor: (variant?: CTAVariant) => boolean;
|
|
1456
|
+
declare const CTA: (props: CTAProps) => React.JSX.Element | null;
|
|
1457
|
+
|
|
1458
|
+
type ComprehensiveCTAValue = {
|
|
1459
|
+
data: {
|
|
1460
|
+
/**
|
|
1461
|
+
* Whether to render the <a> or <button> tag under the hood.
|
|
1462
|
+
* Normal CTAs are "link".
|
|
1463
|
+
* Custom implementations can use "button" to integrate with custom JS.
|
|
1464
|
+
*/
|
|
1465
|
+
actionType: "link" | "button";
|
|
1466
|
+
/** The data source for the CTA. */
|
|
1467
|
+
cta: YextCTAField;
|
|
1468
|
+
/** Whether to open the link in a new tab for actionType: "link". */
|
|
1469
|
+
openInNewTab: boolean;
|
|
1470
|
+
/** The label for actionType: "button". */
|
|
1471
|
+
buttonText?: TranslatableString;
|
|
1472
|
+
/** The id for actionType: "button". */
|
|
1473
|
+
customId?: string;
|
|
1474
|
+
/** The class names for actionType: "button". */
|
|
1475
|
+
customClass?: string;
|
|
1476
|
+
/** The data attributes for actionType: "button". */
|
|
1477
|
+
dataAttributes?: Array<{
|
|
1478
|
+
key: string;
|
|
1479
|
+
value: string;
|
|
1480
|
+
}>;
|
|
1481
|
+
/** The aria label for actionType: "button". */
|
|
1482
|
+
ariaLabel?: TranslatableString;
|
|
1483
|
+
};
|
|
1484
|
+
styles: {
|
|
1485
|
+
/** The visual variant of the CTA. */
|
|
1486
|
+
variant: CTAVariant;
|
|
1487
|
+
/** The preset image to use when cta.selectedType is "presetImage". */
|
|
1488
|
+
presetImage?: PresetImageType;
|
|
1489
|
+
/** The color of the button or link when cta.selectedType is not "presetImage". */
|
|
1490
|
+
color?: ThemeColor;
|
|
1491
|
+
/** The theme styling when the variant is "primary" or "secondary" */
|
|
1492
|
+
button?: StyledButtonValue;
|
|
1493
|
+
/** The theme styling when the variant is "link". */
|
|
1494
|
+
link?: StyledLinkValue;
|
|
1495
|
+
};
|
|
1496
|
+
/** @internal Additional class names to pass to the underlying component. */
|
|
1497
|
+
className?: string;
|
|
1498
|
+
/** @internal Additional styles to pass to the underlying component. */
|
|
1499
|
+
sx?: React__default.CSSProperties;
|
|
1500
|
+
/** @internal The event name to use for Yext Analytics. */
|
|
1501
|
+
eventName?: string;
|
|
1502
|
+
};
|
|
1503
|
+
type ComprehensiveCTAField = BaseField & {
|
|
1504
|
+
type: "comprehensiveCTA";
|
|
1505
|
+
/** Resolves CTA bindings and translated text before rendering. */
|
|
1506
|
+
transform?: boolean;
|
|
1507
|
+
label?: string | MsgString;
|
|
1508
|
+
visible?: boolean;
|
|
1509
|
+
disableConstantValueToggle?: boolean;
|
|
1510
|
+
};
|
|
1511
|
+
type ComprehensiveCTAFieldProps = FieldProps<ComprehensiveCTAField, ComprehensiveCTAValue>;
|
|
1512
|
+
/**
|
|
1513
|
+
* ComprehensiveCTAField imports YextAutoField, which uses the field override registry.
|
|
1514
|
+
* A function declaration lets the registry reference this override during module initialization.
|
|
1515
|
+
*/
|
|
1516
|
+
declare function ComprehensiveCTAFieldOverride({ field, value, onChange, }: ComprehensiveCTAFieldProps): React__default.JSX.Element;
|
|
1517
|
+
|
|
1518
|
+
type FieldTransformContext = {
|
|
1519
|
+
streamDocument: StreamDocument;
|
|
1520
|
+
locale: string;
|
|
1521
|
+
/** The complete linked item, including primitive list items. */
|
|
1522
|
+
itemDocument?: unknown;
|
|
1523
|
+
};
|
|
1524
|
+
|
|
1525
|
+
declare const alwaysTransformedFieldTypes: readonly ["code", "themeColor"];
|
|
1526
|
+
|
|
1527
|
+
/** Maps explicit entity-field formats to their render-value conversion. */
|
|
1528
|
+
declare const entityFieldFormatters: {
|
|
1529
|
+
price: (value: ProductPrice | undefined, context: FieldTransformContext) => string | undefined;
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
type LocalizedRenderValue<Value> = Value extends readonly (infer Item)[] ? LocalizedRenderValue<Item>[] : Value extends object ? "defaultValue" extends keyof Value ? LocalizedRenderValue<Value["defaultValue"]> : {
|
|
1533
|
+
[Key in keyof Value]: LocalizedRenderValue<Value[Key]>;
|
|
1534
|
+
} : Value;
|
|
1535
|
+
/** CTA data after localized text and links are resolved for rendering. */
|
|
1536
|
+
type ResolvedCTAValue = {
|
|
1537
|
+
link: string;
|
|
1538
|
+
label?: string;
|
|
1539
|
+
linkType?: LinkType;
|
|
1540
|
+
normalizeLink?: boolean;
|
|
1541
|
+
openInNewTab?: boolean;
|
|
1542
|
+
ctaType?: "textAndLink" | "getDirections" | "presetImage";
|
|
1543
|
+
};
|
|
1544
|
+
/** The presentation component consumes this data contract without resolving authored bindings. */
|
|
1545
|
+
type ResolvedComprehensiveCTAValue = Omit<ComprehensiveCTAValue, "data"> & {
|
|
1546
|
+
data: Omit<ComprehensiveCTAValue["data"], "cta" | "buttonText" | "ariaLabel"> & {
|
|
1547
|
+
cta: ResolvedCTAValue | undefined;
|
|
1548
|
+
buttonText?: string;
|
|
1549
|
+
ariaLabel?: string;
|
|
1550
|
+
};
|
|
1551
|
+
};
|
|
1552
|
+
/** Retains value-based inference for item sources with widened field definitions. */
|
|
1553
|
+
type ResolvedRepeatedValue<Value> = Value extends {
|
|
1554
|
+
constantValue: infer Constant;
|
|
1555
|
+
} ? LocalizedRenderValue<Constant> | undefined : Value extends ComprehensiveCTAValue ? ResolvedComprehensiveCTAValue : Value extends {
|
|
1556
|
+
selections: {
|
|
1557
|
+
value: infer Selection;
|
|
1558
|
+
}[];
|
|
1559
|
+
} ? Exclude<Selection, undefined>[] : Value extends readonly (infer Item)[] ? ResolvedRepeatedValue<Item>[] : Value extends object ? {
|
|
1560
|
+
[Key in keyof Value]: ResolvedRepeatedValue<Value[Key]>;
|
|
1561
|
+
} : Value;
|
|
1562
|
+
/** Repeated sources transform all mapped fields, even without a child opt-in. */
|
|
1563
|
+
type ResolvedRepeatedItem<Value, Definitions> = Value extends readonly (infer Item)[] ? ResolvedRepeatedItem<Item, Definitions>[] : {
|
|
1564
|
+
[Key in keyof Value]: Key extends keyof Definitions ? ResolvedRepeatedFieldValue<Value[Key], Definitions[Key]> : LocalizedRenderValue<Value[Key]>;
|
|
1565
|
+
};
|
|
1566
|
+
type ResolvedRepeatedFieldValue<Value, Definition> = YextFieldDefinition["type"] extends (Definition extends {
|
|
1567
|
+
type: infer FieldType;
|
|
1568
|
+
} ? FieldType : never) ? ResolvedRepeatedValue<Value> : Definition extends {
|
|
1569
|
+
type: "object";
|
|
1570
|
+
objectFields: infer Fields;
|
|
1571
|
+
} ? ResolvedRepeatedItem<Value, Fields> : Definition extends {
|
|
1572
|
+
type: "array";
|
|
1573
|
+
arrayFields: infer Fields;
|
|
1574
|
+
} ? ResolvedRepeatedItem<Value, Fields> : Definition extends {
|
|
1575
|
+
type: infer FieldType;
|
|
1576
|
+
} ? FieldType extends keyof TransformedFieldValues<Value, Definition> ? TransformedFieldValues<Value, Definition>[FieldType] : LocalizedRenderValue<Value> : LocalizedRenderValue<Value>;
|
|
1577
|
+
type TransformedFieldValues<Value, Definition> = {
|
|
1578
|
+
themeColor: ResolvedThemeColor | undefined;
|
|
1579
|
+
code: string;
|
|
1580
|
+
styledText: CSSProperties;
|
|
1581
|
+
styledButton: CSSProperties;
|
|
1582
|
+
styledLink: CSSProperties;
|
|
1583
|
+
styledImage: CSSProperties;
|
|
1584
|
+
styledPageSection: CSSProperties;
|
|
1585
|
+
translatableString: string;
|
|
1586
|
+
image: LocalizedRenderValue<Value>;
|
|
1587
|
+
video: LocalizedRenderValue<Value>;
|
|
1588
|
+
comprehensiveCTA: ResolvedComprehensiveCTAValue;
|
|
1589
|
+
multiSelector: Value extends {
|
|
1590
|
+
selections: {
|
|
1591
|
+
value: infer Selection;
|
|
1592
|
+
}[];
|
|
1593
|
+
} ? Exclude<Selection, undefined>[] : never;
|
|
1594
|
+
optionalNumber: number | undefined;
|
|
1595
|
+
ctaSelector: LocalizedRenderValue<EnhancedTranslatableCTA> | undefined;
|
|
1596
|
+
entityField: Definition extends {
|
|
1597
|
+
format: infer Format;
|
|
1598
|
+
} ? Format extends keyof typeof entityFieldFormatters ? ReturnType<(typeof entityFieldFormatters)[Format]> : never : Definition extends {
|
|
1599
|
+
repeated: {
|
|
1600
|
+
mappingFields: infer Fields;
|
|
1601
|
+
};
|
|
1602
|
+
} ? Value extends {
|
|
1603
|
+
constantValue: infer Constant;
|
|
1604
|
+
} ? ResolvedRepeatedItem<Constant, Fields> : never : Value extends {
|
|
1605
|
+
constantValue: infer Constant;
|
|
1606
|
+
} ? LocalizedRenderValue<Constant> | undefined : never;
|
|
1607
|
+
};
|
|
1608
|
+
/** Derives render prop types for nested object fields and array items; leaves other values unchanged. */
|
|
1609
|
+
type NestedFieldValue<Value, Definition> = Definition extends {
|
|
1610
|
+
type: "object";
|
|
1611
|
+
objectFields: object;
|
|
1612
|
+
} ? YextTransformedProps<Value, Definition["objectFields"]> : Definition extends {
|
|
1613
|
+
type: "array";
|
|
1614
|
+
arrayFields: object;
|
|
1615
|
+
} ? Value extends unknown[] ? YextTransformedProps<Value[number], Definition["arrayFields"]>[] : Value : Value;
|
|
1616
|
+
type TransformedFieldValue<Value, Definition> = Definition extends {
|
|
1617
|
+
transform: true;
|
|
1618
|
+
} | {
|
|
1619
|
+
type: (typeof alwaysTransformedFieldTypes)[number];
|
|
1620
|
+
} ? Definition extends {
|
|
1621
|
+
type: infer FieldType;
|
|
1622
|
+
} ? FieldType extends keyof TransformedFieldValues<Value, Definition> ? TransformedFieldValues<Value, Definition>[FieldType] : Value : Value : NestedFieldValue<Value, Definition>;
|
|
1623
|
+
/** Derives render values from authored props and supported field definitions. */
|
|
1624
|
+
type YextTransformedProps<Props, Definitions> = {
|
|
1625
|
+
[Key in keyof Props]: Key extends keyof Definitions ? TransformedFieldValue<Props[Key], Definitions[Key]> : Props[Key];
|
|
1626
|
+
};
|
|
1627
|
+
type YextPuckFields = {
|
|
1628
|
+
basicSelector: BasicSelectorField;
|
|
1629
|
+
themeColor: ThemeColorField;
|
|
1630
|
+
ctaSelector: CTASelectorField;
|
|
1631
|
+
code: CodeField;
|
|
1632
|
+
comprehensiveCTA: ComprehensiveCTAField;
|
|
1633
|
+
dateTimeSelector: DateTimeSelectorField;
|
|
1634
|
+
entityField: EntityFieldSelectorField;
|
|
1635
|
+
multiSelector: MultiSelectorField;
|
|
1636
|
+
fontSizeSelector: FontSizeSelectorField;
|
|
1637
|
+
image: ImageField;
|
|
1638
|
+
optionalNumber: OptionalNumberField;
|
|
1639
|
+
styledButton: StyledButtonField;
|
|
1640
|
+
styledImage: StyledImageField;
|
|
1641
|
+
styledLink: StyledLinkField;
|
|
1642
|
+
styledPageSection: StyledPageSectionField;
|
|
1643
|
+
styledText: StyledTextField;
|
|
1644
|
+
translatableString: TranslatableStringField;
|
|
1645
|
+
video: VideoField;
|
|
1646
|
+
};
|
|
1647
|
+
type YextPuckField = YextPuckFields[keyof YextPuckFields];
|
|
1648
|
+
type YextArrayField<Props extends {
|
|
1649
|
+
[key: string]: any;
|
|
1650
|
+
}[] = {
|
|
1651
|
+
[key: string]: any;
|
|
1652
|
+
}[]> = Omit<ArrayField<Props, YextPuckField>, "arrayFields"> & {
|
|
1653
|
+
arrayFields: YextFieldMap<Props[0]>;
|
|
1654
|
+
};
|
|
1655
|
+
type YextObjectField<Props extends {
|
|
1656
|
+
[key: string]: any;
|
|
1657
|
+
} = {
|
|
1658
|
+
[key: string]: any;
|
|
1659
|
+
}> = Omit<ObjectField<Props, YextPuckField>, "objectFields"> & {
|
|
1660
|
+
objectFields: YextFieldMap<Props>;
|
|
1661
|
+
};
|
|
1662
|
+
type YextCustomFieldRenderProps<ValueType> = Parameters<CustomField<ValueType>["render"]>[0];
|
|
1663
|
+
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);
|
|
1664
|
+
type YextComponentConfig<Props extends DefaultComponentProps = DefaultComponentProps, TransformFields = {}> = Omit<ComponentConfig<{
|
|
1665
|
+
props: Props;
|
|
1666
|
+
fields: YextPuckFields;
|
|
1667
|
+
}>, "fields" | "resolveFields" | "render"> & {
|
|
1668
|
+
render: ComponentConfig<{
|
|
1669
|
+
props: YextTransformedProps<Props, TransformFields>;
|
|
1670
|
+
fields: YextPuckFields;
|
|
1671
|
+
}>["render"];
|
|
1672
|
+
fields?: YextFields<Props>;
|
|
1673
|
+
layoutGenerationMetadata?: LayoutGenerationMetadata;
|
|
1674
|
+
resolveFields?: ComponentConfig<{
|
|
1675
|
+
props: Props;
|
|
1676
|
+
fields: YextPuckFields;
|
|
1677
|
+
}>["resolveFields"];
|
|
1678
|
+
};
|
|
1679
|
+
type YextFields<T extends DefaultComponentProps = DefaultComponentProps> = YextFieldsInternal<T> & YextFieldMap<T>;
|
|
1680
|
+
type YextFieldsInternal<T extends DefaultComponentProps = DefaultComponentProps> = Fields<T, any>;
|
|
1681
|
+
type YextFieldMap<T extends DefaultComponentProps = DefaultComponentProps> = {
|
|
1682
|
+
[PropName in keyof Omit<T, "editMode">]: YextFieldDefinition<T[PropName]>;
|
|
1683
|
+
};
|
|
1684
|
+
/**
|
|
1685
|
+
* Converts Yext field definitions into a runtime `Fields` object that Puck can
|
|
1686
|
+
* render safely.
|
|
1687
|
+
*
|
|
1688
|
+
* Yext field types are registered as Puck overrides, but Puck still asks its
|
|
1689
|
+
* internal default field registry to render child fields inside native `object`
|
|
1690
|
+
* and `array` fields. Since field types like `basicSelector` do not exist in
|
|
1691
|
+
* that registry, this wraps each Yext-specific field as a Puck `custom` field
|
|
1692
|
+
* rendered by `YextAutoField`, including nested `objectFields` and
|
|
1693
|
+
* `arrayFields`. Normal Puck field types are left unchanged.
|
|
1694
|
+
*/
|
|
1695
|
+
declare const toPuckFields: <Props extends DefaultComponentProps = DefaultComponentProps>(fields: Fields<Props, any>) => Fields<Props>;
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Public item-source types.
|
|
1699
|
+
*
|
|
1700
|
+
* 1. Define the authored configuration accepted by `createItemSource(...)`.
|
|
1701
|
+
* 2. Define the repeated entity-field value shape returned to consumers.
|
|
1702
|
+
* 3. Define the resolved item shape returned by `resolveItems(...)`.
|
|
1703
|
+
*/
|
|
1704
|
+
type CreateItemSourceOptions<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = {
|
|
1705
|
+
/** Label shown above the item source controls. */
|
|
1706
|
+
label: string;
|
|
1707
|
+
/**
|
|
1708
|
+
* Fields for each item. These define both the manual item inputs and the
|
|
1709
|
+
* mappings to fields within each object in a selected entity list.
|
|
1710
|
+
* A list can be selected when its item type or a child field matches any
|
|
1711
|
+
* mapping field filter.
|
|
1712
|
+
*/
|
|
1713
|
+
mappingFields: MappingFields;
|
|
1714
|
+
/** Initial manual items. The first item is also the template for new items. */
|
|
1715
|
+
defaultValues?: TItemProps[];
|
|
1716
|
+
};
|
|
1717
|
+
type RepeatedEntityFieldValue<TItemProps extends Record<string, unknown>> = YextEntityField<TItemProps[], TItemProps>;
|
|
1718
|
+
type RepeatedEntityFieldMetadata<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = {
|
|
1719
|
+
mappingFields: MappingFields;
|
|
1720
|
+
manualItemFields: YextFieldMap<TItemProps>;
|
|
1721
|
+
defaultItemValue: TItemProps;
|
|
1722
|
+
defaultMappings: TItemProps;
|
|
1723
|
+
manualItemSummary?: (item: unknown, index?: number) => string;
|
|
1724
|
+
};
|
|
1725
|
+
type RepeatedEntityFieldDefinition<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = EntityFieldSelectorField<RepeatedEntityFieldValue<TItemProps>> & {
|
|
1726
|
+
repeated: RepeatedEntityFieldMetadata<TItemProps, MappingFields>;
|
|
1727
|
+
};
|
|
1728
|
+
/**
|
|
1729
|
+
* Resolves authored item fields into the render-ready value shape returned
|
|
1730
|
+
* from `ItemSourceInstance.resolveItems(...)`.
|
|
1731
|
+
*/
|
|
1732
|
+
type ResolvedItemField<TValue> = TValue extends YextEntityField<infer TResolved, any> ? TResolved | undefined : TValue extends Array<infer TItem> ? ResolvedItemField<TItem>[] : TValue extends Record<string, unknown> ? {
|
|
1733
|
+
[TKey in keyof TValue]: ResolvedItemField<TValue[TKey]>;
|
|
1734
|
+
} : TValue;
|
|
1735
|
+
/**
|
|
1736
|
+
* Public contract returned by `createItemSource(...)`.
|
|
1737
|
+
*/
|
|
1738
|
+
type ItemSourceInstance<TItemProps extends Record<string, unknown>, MappingFields extends YextFieldMap<TItemProps> = YextFieldMap<TItemProps>> = {
|
|
1739
|
+
field: RepeatedEntityFieldDefinition<TItemProps, MappingFields>;
|
|
1740
|
+
defaultValue: RepeatedEntityFieldValue<TItemProps>;
|
|
1741
|
+
value: RepeatedEntityFieldValue<TItemProps>;
|
|
1742
|
+
resolveItems: (value: RepeatedEntityFieldValue<TItemProps> | undefined, streamDocument: StreamDocument) => ResolvedItemField<TItemProps>[];
|
|
1743
|
+
};
|
|
1744
|
+
type SlotMappedCardsData<TMappings extends Record<string, unknown>> = YextEntityField<Array<{
|
|
1745
|
+
id?: string;
|
|
1746
|
+
}>, TMappings>;
|
|
1747
|
+
type CreateSlottedItemSourceOptions<TMappings extends Record<string, unknown>, TCardProps extends Record<string, unknown> = Record<string, unknown>> = {
|
|
1748
|
+
label: string;
|
|
1749
|
+
mappingFields: YextFieldMap<TMappings>;
|
|
1750
|
+
itemLabel: string;
|
|
1751
|
+
cardName?: string;
|
|
1752
|
+
defaultItemProps?: TCardProps | (() => TCardProps);
|
|
1753
|
+
defaultItems?: number;
|
|
1754
|
+
};
|
|
1755
|
+
/** Opt-in generation ownership for the helper's fixed data and CardSlot locations. */
|
|
1756
|
+
type SlottedItemSourceGenerationMetadata = {
|
|
1757
|
+
cardType: string;
|
|
1758
|
+
defaultItemProps?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
1759
|
+
};
|
|
1760
|
+
type SlottedItemSourceInstance<TMappings extends Record<string, unknown>> = {
|
|
1761
|
+
field: YextFieldDefinition<SlotMappedCardsData<TMappings>>;
|
|
1762
|
+
generationMetadata: SlottedItemSourceGenerationMetadata;
|
|
1763
|
+
defaultValue: SlotMappedCardsData<TMappings>;
|
|
1764
|
+
defaultWrapperProps: {
|
|
1765
|
+
data: SlotMappedCardsData<TMappings>;
|
|
1766
|
+
slots: {
|
|
1767
|
+
CardSlot: [];
|
|
1768
|
+
};
|
|
1769
|
+
manualSlots: {
|
|
1770
|
+
CardSlot: [];
|
|
1771
|
+
};
|
|
1772
|
+
};
|
|
1773
|
+
value: SlotMappedCardsData<TMappings>;
|
|
1774
|
+
resolveItems: (value: SlotMappedCardsData<TMappings> | undefined, streamDocument: StreamDocument) => ResolvedItemField<TMappings>[];
|
|
1775
|
+
populateSlots: <TData extends {
|
|
1776
|
+
props: {
|
|
1777
|
+
data: SlotMappedCardsData<TMappings>;
|
|
1778
|
+
slots: {
|
|
1779
|
+
CardSlot: unknown;
|
|
1780
|
+
};
|
|
1781
|
+
manualSlots?: {
|
|
1782
|
+
CardSlot: unknown;
|
|
1783
|
+
};
|
|
1784
|
+
};
|
|
1785
|
+
}>(data: TData, streamDocument: StreamDocument | undefined) => TData;
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
type EntityFieldSelectorField<T extends Record<string, any> = Record<string, any>> = BaseField & {
|
|
1789
|
+
type: "entityField";
|
|
1790
|
+
/** Resolves this field before rendering. Repeated sources are not supported. */
|
|
1791
|
+
transform?: boolean;
|
|
1792
|
+
/** Formats a resolved structured price as localized currency when transformed. */
|
|
1793
|
+
format?: "price";
|
|
1794
|
+
label?: string | MsgString;
|
|
1795
|
+
visible?: boolean;
|
|
1796
|
+
filter: MappedSourceFieldFilter<T>;
|
|
1797
|
+
constantValueFilter?: RenderEntityFieldFilter<T>;
|
|
1798
|
+
/** Hides the Knowledge Graph/static-content toggle when enabled. */
|
|
1799
|
+
disableConstantValueToggle?: boolean;
|
|
1800
|
+
/** Whether the field can be translated or not. */
|
|
1801
|
+
disallowTranslation?: boolean;
|
|
1802
|
+
/** Shows the "Apply to all locales" control for translatable static values. */
|
|
1803
|
+
showApplyAllOption?: boolean;
|
|
1804
|
+
/** A dotted path to the linked source field on the active Puck item. Used for directories. */
|
|
1805
|
+
sourceFieldPath?: string;
|
|
1806
|
+
/** Uses this linked source field and hides the repeated-source selector. Used for directories. */
|
|
1807
|
+
fixedRepeatedField?: string;
|
|
1808
|
+
/** Hides the parent-field requirements tooltip for repeated sources. */
|
|
1809
|
+
hideRequirementsTooltip?: boolean;
|
|
1810
|
+
/** Configures repeated linked-item and manual-item editing. */
|
|
1811
|
+
repeated?: RepeatedEntityFieldMetadata<any>;
|
|
1812
|
+
};
|
|
1813
|
+
type EntityFieldSelectorFieldProps = FieldProps<EntityFieldSelectorField>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Renders entity field controls. Its declaration is available when the field
|
|
1816
|
+
* registry initializes.
|
|
1817
|
+
*/
|
|
1818
|
+
declare function EntityFieldSelectorFieldOverride({ field, value, onChange, }: EntityFieldSelectorFieldProps): React__default.JSX.Element;
|
|
1819
|
+
declare const ConstantValueModeToggler: ({ fieldTypeFilter, constantValueEnabled, toggleConstantValueEnabled, disableConstantValue, label, showLocale, infoTooltipRequirements, }: {
|
|
1820
|
+
fieldTypeFilter: EntityFieldTypes[];
|
|
1821
|
+
constantValueEnabled: boolean;
|
|
1822
|
+
toggleConstantValueEnabled: (constantValueEnabled: boolean) => void;
|
|
1823
|
+
disableConstantValue?: boolean;
|
|
1824
|
+
label: string;
|
|
1825
|
+
showLocale?: boolean;
|
|
1826
|
+
infoTooltipRequirements?: string[];
|
|
1827
|
+
}) => React__default.JSX.Element;
|
|
1828
|
+
|
|
1829
|
+
type RenderYextEntityFieldSelectorProps<T extends Record<string, any>> = Omit<EntityFieldSelectorField<T>, "type" | "label"> & {
|
|
1830
|
+
label: string;
|
|
1831
|
+
};
|
|
1832
|
+
/**
|
|
1833
|
+
* @deprecated Prefer authoring `{ type: "entityField", ... }` directly in
|
|
1834
|
+
* `YextFields`. This wrapper remains for backwards compatibility.
|
|
1835
|
+
*/
|
|
1836
|
+
declare const YextEntityFieldSelector: <T extends Record<string, any>, TValue, TMappings = never>(props: RenderYextEntityFieldSelectorProps<T>) => Field<YextEntityField<TValue, TMappings>>;
|
|
1837
|
+
|
|
1838
|
+
type ResolveComponentDataOptions = {
|
|
1839
|
+
variant?: BodyProps["variant"];
|
|
1840
|
+
isDarkBackground?: boolean;
|
|
1841
|
+
className?: string;
|
|
1842
|
+
color?: ThemeColor;
|
|
1843
|
+
output?: "render" | "plainText";
|
|
1844
|
+
};
|
|
1845
|
+
/**
|
|
1846
|
+
* The primary function for resolving all component data. It handles entity
|
|
1847
|
+
* fields, constant values, embedded fields, and translatable types.
|
|
1848
|
+
*
|
|
1849
|
+
* @param data The field configuration object from component props OR a direct translatable value.
|
|
1850
|
+
* @param locale The current language locale (e.g., "en").
|
|
1851
|
+
* @param streamDocument The entity document. If not provided, embedded fields will not be resolved.
|
|
1852
|
+
* @returns The fully resolved data for the component.
|
|
1853
|
+
*/
|
|
1854
|
+
declare function resolveComponentData(data: TranslatableString | YextEntityField<TranslatableString>, locale: string, streamDocument?: any): string;
|
|
1855
|
+
declare function resolveComponentData(data: TranslatableRichText | YextEntityField<TranslatableRichText>, locale: string, streamDocument?: Record<string, any>, options?: Omit<ResolveComponentDataOptions, "output"> & {
|
|
1856
|
+
output?: "render";
|
|
1857
|
+
}): string | React__default.ReactElement;
|
|
1858
|
+
declare function resolveComponentData(data: TranslatableString | TranslatableRichText | YextEntityField<TranslatableString | TranslatableRichText> | undefined, locale: string, streamDocument: Record<string, any> | undefined, options: {
|
|
1859
|
+
output: "plainText";
|
|
1860
|
+
}): string;
|
|
1861
|
+
declare function resolveComponentData<T>(data: YextEntityField<T>, locale: string, streamDocument?: Record<string, any>): T | undefined;
|
|
1862
|
+
declare function resolveComponentData(data: TranslatableAssetImage | YextEntityField<TranslatableAssetImage>, locale: string, streamDocument?: Record<string, any>): TranslatableAssetImage | undefined;
|
|
1863
|
+
/**
|
|
1864
|
+
* Takes a TranslatableString or TranslatableRichText and a locale and returns the value as a string
|
|
1865
|
+
* @param translatableText a TranslatableRichText
|
|
1866
|
+
* @param locale "en" or other locale value
|
|
1867
|
+
* @return string to be displayed in the editor input
|
|
1868
|
+
*/
|
|
1869
|
+
declare function getDisplayValue(translatableText: TranslatableString | TranslatableRichText, locale?: string): string;
|
|
1870
|
+
|
|
1871
|
+
type FieldResolution<T> = {
|
|
1872
|
+
value: T | undefined;
|
|
1873
|
+
traversedMultiValueReference: boolean;
|
|
1874
|
+
multiValueReferenceField?: string;
|
|
1875
|
+
};
|
|
1876
|
+
/**
|
|
1877
|
+
* Resolves a Yext entity field from either a selected field path or a constant
|
|
1878
|
+
* value, including embedded field interpolation inside constants.
|
|
1879
|
+
*/
|
|
1880
|
+
declare const resolveYextEntityField: <T>(streamDocument: StreamDocument | undefined, entityField: YextEntityField<T>, locale?: string) => T | undefined;
|
|
1881
|
+
declare const findField: <T>(streamDocument: StreamDocument, fieldName: string) => T | undefined;
|
|
1882
|
+
declare const resolveField: <T>(streamDocument: StreamDocument, fieldName: string) => FieldResolution<T>;
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* Creates the helper API for one slot-backed repeated-item wrapper.
|
|
1886
|
+
*/
|
|
1887
|
+
declare function createSlottedItemSource<TMappings extends Record<string, unknown>, TCardProps extends Record<string, unknown> = Record<string, unknown>>({ label, mappingFields, itemLabel, cardName, defaultItemProps, defaultItems, }: CreateSlottedItemSourceOptions<TMappings, TCardProps>): SlottedItemSourceInstance<TMappings>;
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Builds the search headless config for the template. Returns undefined if the config is not valid.
|
|
1891
|
+
* @param document the entity document
|
|
1892
|
+
* @param experienceKeyEnvVar override the default locator experience env var
|
|
1893
|
+
*/
|
|
1894
|
+
declare const createSearchHeadlessConfig: (document: any, experienceKeyEnvVar?: string) => (_yext_search_headless_react.SearchConfigWithApiKey & {
|
|
1895
|
+
headlessId?: string;
|
|
1896
|
+
verticalKey?: string;
|
|
1897
|
+
}) | undefined;
|
|
1898
|
+
/**
|
|
1899
|
+
* Builds the search analytics config for the template. Returns undefined if the config is not valid.
|
|
1900
|
+
* @param document the entity document
|
|
1901
|
+
*/
|
|
1902
|
+
declare const createSearchAnalyticsConfig: (document: any) => SearchAnalyticsConfig | undefined;
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* Normalizes the provided content by converting upper-case ones to lower case,
|
|
1906
|
+
* replacing white spaces, '?', and '#', with a "-" and stripping all other illegal characters.
|
|
1907
|
+
*
|
|
1908
|
+
* @param content The content to normalize
|
|
1909
|
+
* @return The normalized result
|
|
1910
|
+
*/
|
|
1911
|
+
declare const normalizeSlug: (content: string) => string;
|
|
1912
|
+
|
|
1913
|
+
declare const resolveUrlTemplate: (streamDocument: StreamDocument, relativePrefixToRoot: string) => string;
|
|
1914
|
+
declare const resolveUrlTemplateOfChild: (profile: any, streamDocument: StreamDocument, relativePrefixToRoot?: string) => string;
|
|
1915
|
+
declare const mergeMeta: (profile: any, streamDocument: StreamDocument) => StreamDocument;
|
|
1916
|
+
|
|
1917
|
+
type BreadcrumbLink = {
|
|
1918
|
+
/** The display name of the DM parent. */
|
|
1919
|
+
name: string;
|
|
1920
|
+
/** The relative url path to the DM parent. */
|
|
1921
|
+
slug: string;
|
|
1922
|
+
};
|
|
1923
|
+
/**
|
|
1924
|
+
* Reads the first valid dm_directoryParents field from the stream document.
|
|
1925
|
+
* Extracts the parents' display name and resolves the url path based on pathInfo (with dm slug fallback).
|
|
1926
|
+
*/
|
|
1927
|
+
declare const resolveBreadcrumbs: (streamDocument: StreamDocument) => BreadcrumbLink[];
|
|
1928
|
+
|
|
1929
|
+
type ComponentRegistry = Record<string, Config<any> | (() => Promise<Config<any>>)>;
|
|
1930
|
+
declare const useTemplateMetadata: () => TemplateMetadata;
|
|
1931
|
+
|
|
1932
|
+
type EntityFieldProps = {
|
|
1933
|
+
displayName?: string;
|
|
1934
|
+
fieldId?: string;
|
|
1935
|
+
constantValueEnabled?: boolean;
|
|
1936
|
+
children: React__default.ReactNode;
|
|
1937
|
+
fullHeight?: boolean;
|
|
1938
|
+
className?: string;
|
|
1939
|
+
};
|
|
1940
|
+
declare const EntityField: React__default.ForwardRefExoticComponent<EntityFieldProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
1941
|
+
type EntityTooltipsContext = {
|
|
1942
|
+
tooltipsVisible: boolean;
|
|
1943
|
+
toggleTooltips: () => void;
|
|
1944
|
+
};
|
|
1945
|
+
declare const EntityTooltipsContext: React__default.Context<EntityTooltipsContext | undefined>;
|
|
1946
|
+
declare const EntityTooltipsProvider: ({ children, }: {
|
|
1947
|
+
children: React__default.ReactNode;
|
|
1948
|
+
}) => React__default.JSX.Element;
|
|
1949
|
+
declare const useEntityTooltips: () => EntityTooltipsContext | undefined;
|
|
1950
|
+
|
|
1951
|
+
type YextAutoFieldProps<ValueType = any> = Omit<FieldProps<any, ValueType>, "field"> & {
|
|
1952
|
+
field: YextFieldDefinition<ValueType>;
|
|
1953
|
+
value: ValueType;
|
|
1954
|
+
};
|
|
1955
|
+
declare const YextAutoField: <ValueType>({ field, ...props }: YextAutoFieldProps<ValueType>) => React__default.JSX.Element;
|
|
1956
|
+
|
|
1957
|
+
declare const resolveDataFromParent: <T extends DefaultComponentProps>(fields: YextFields<T> | YextFieldMap<T>, data: Omit<ComponentData<T, string, Record<string, DefaultComponentProps>>, "type">) => Fields<T>;
|
|
1958
|
+
|
|
1959
|
+
declare const Accordion: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
|
|
1960
|
+
declare const AccordionItem: React__default.ForwardRefExoticComponent<React__default.DetailsHTMLAttributes<HTMLDetailsElement> & React__default.RefAttributes<HTMLDetailsElement>>;
|
|
1961
|
+
declare const AccordionTrigger: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLElement> & React__default.RefAttributes<HTMLElement>>;
|
|
1962
|
+
declare const AccordionContent: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
|
|
1963
|
+
|
|
1964
|
+
interface BackgroundProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1965
|
+
background?: ThemeColor | ResolvedThemeColor;
|
|
1966
|
+
as?: "div" | "section" | "nav" | "header" | "footer" | "main" | "aside";
|
|
1967
|
+
}
|
|
1968
|
+
declare const Background: React.ForwardRefExoticComponent<BackgroundProps & React.RefAttributes<HTMLDivElement>>;
|
|
1969
|
+
|
|
1970
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
1971
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
1972
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
1973
|
+
declare function DropdownMenuItem({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
1974
|
+
inset?: boolean;
|
|
1975
|
+
}): React.JSX.Element;
|
|
1976
|
+
|
|
1977
|
+
declare const headingVariants: (props?: ({
|
|
1978
|
+
level?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
|
|
1979
|
+
fontSize?: "default" | "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null | undefined;
|
|
1980
|
+
weight?: "default" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | null | undefined;
|
|
1981
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1982
|
+
interface HeadingProps extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">, VariantProps<typeof headingVariants> {
|
|
1983
|
+
level: HeadingLevel;
|
|
1984
|
+
semanticLevelOverride?: HeadingLevel | "span";
|
|
1985
|
+
color?: ThemeColor;
|
|
1986
|
+
}
|
|
1987
|
+
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
1988
|
+
|
|
1989
|
+
interface HoursStatusAtomProps {
|
|
1990
|
+
hours: HoursType;
|
|
1991
|
+
className?: string;
|
|
1992
|
+
comingSoon?: boolean;
|
|
1993
|
+
showCurrentStatus?: boolean;
|
|
1994
|
+
showDayNames?: boolean;
|
|
1995
|
+
timeFormat?: "12h" | "24h";
|
|
1996
|
+
dayOfWeekFormat?: "short" | "long";
|
|
1997
|
+
timezone?: string;
|
|
1998
|
+
boldCurrentStatus?: boolean;
|
|
1999
|
+
bodyVariant?: "lg" | "base" | "sm";
|
|
2000
|
+
}
|
|
2001
|
+
declare const HoursStatusAtom: React.MemoExoticComponent<({ hours, className, comingSoon, showCurrentStatus, showDayNames, timeFormat, dayOfWeekFormat, timezone, boldCurrentStatus, bodyVariant, }: HoursStatusAtomProps) => any>;
|
|
2002
|
+
|
|
2003
|
+
interface HoursTableAtomProps extends Omit<HoursTableProps, "dayOfWeekNames" | "intervalStringsBuilderFn" | "intervalTranslations"> {
|
|
2004
|
+
className?: string;
|
|
2005
|
+
}
|
|
2006
|
+
declare const HoursTableAtom: (props: HoursTableAtomProps) => React.JSX.Element;
|
|
2007
|
+
|
|
2008
|
+
interface ImageProps {
|
|
2009
|
+
image: ImageType | ComplexImageType | TranslatableAssetImage;
|
|
2010
|
+
aspectRatio?: number;
|
|
2011
|
+
width?: number;
|
|
2012
|
+
imageFillType?: ImageFillType;
|
|
2013
|
+
className?: string;
|
|
2014
|
+
/** sizes attribute of the underlying img tag */
|
|
2015
|
+
sizes?: string;
|
|
2016
|
+
loading?: "lazy" | "eager";
|
|
2017
|
+
/**
|
|
2018
|
+
* Entity data used to resolve embedded fields.
|
|
2019
|
+
* Defaults to the stream document if not provided.
|
|
2020
|
+
*/
|
|
2021
|
+
streamDocumentOverride?: Record<string, any>;
|
|
2022
|
+
style?: React.CSSProperties;
|
|
2023
|
+
}
|
|
2024
|
+
declare const getImageAltText: (image: ImageType | ComplexImageType | AssetImageType | undefined, locale: string, streamDocument: StreamDocument | Record<string, any>) => string | undefined;
|
|
2025
|
+
declare const Image: React.FC<ImageProps>;
|
|
2026
|
+
type ImgSizesByBreakpoint = {
|
|
2027
|
+
base: string;
|
|
2028
|
+
sm?: string;
|
|
2029
|
+
md?: string;
|
|
2030
|
+
lg?: string;
|
|
2031
|
+
xl?: string;
|
|
2032
|
+
"2xl"?: string;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* Creates an img sizes attribute based on the default Tailwind breakpoints.
|
|
2036
|
+
* Replaces `maxWidth` with the current page section max width from the theme.
|
|
2037
|
+
* Replaces `width` with the width parameter.
|
|
2038
|
+
* @param sizes - the width of the image at different breakpoints
|
|
2039
|
+
* @param width - the current width prop of the image
|
|
2040
|
+
* @returns a string for the sizes attribute of an img tag
|
|
2041
|
+
*/
|
|
2042
|
+
declare const imgSizesHelper: (sizes: ImgSizesByBreakpoint, width?: string) => string;
|
|
2043
|
+
|
|
2044
|
+
type MaybeLinkProps = {
|
|
2045
|
+
href?: string;
|
|
2046
|
+
children?: React.ReactNode;
|
|
2047
|
+
className?: string;
|
|
2048
|
+
eventName?: string;
|
|
2049
|
+
variant?: CTAVariant;
|
|
2050
|
+
color?: ThemeColor;
|
|
2051
|
+
alwaysHideCaret?: boolean;
|
|
2052
|
+
ariaLabel?: string;
|
|
2053
|
+
disabled?: boolean;
|
|
2054
|
+
};
|
|
2055
|
+
declare const MaybeLink: (props: MaybeLinkProps) => React.JSX.Element;
|
|
2056
|
+
|
|
2057
|
+
declare const pageSectionVariants: (props?: ({
|
|
2058
|
+
verticalPadding?: "default" | "none" | "sm" | "footer" | "header" | "footerSecondary" | null | undefined;
|
|
2059
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2060
|
+
declare const maxWidthVariants: (props?: ({
|
|
2061
|
+
maxWidth?: "768px" | "960px" | "1024px" | "1280px" | "1440px" | "theme" | "fullWidth" | null | undefined;
|
|
2062
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2063
|
+
interface PageSectionProps extends VariantProps<typeof maxWidthVariants>, React.HTMLAttributes<HTMLDivElement> {
|
|
2064
|
+
background?: ThemeColor | ResolvedThemeColor;
|
|
2065
|
+
verticalPadding?: VariantProps<typeof pageSectionVariants>["verticalPadding"];
|
|
2066
|
+
as?: "div" | "section" | "nav" | "header" | "footer" | "main" | "aside";
|
|
2067
|
+
outerClassName?: string;
|
|
2068
|
+
outerStyle?: React.CSSProperties;
|
|
2069
|
+
}
|
|
2070
|
+
declare const PageSection: React.ForwardRefExoticComponent<PageSectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
2071
|
+
|
|
2072
|
+
type PhoneAtomProps = {
|
|
2073
|
+
phoneNumber: string;
|
|
2074
|
+
label?: string;
|
|
2075
|
+
eventName?: string;
|
|
2076
|
+
backgroundColor?: ThemeColor;
|
|
2077
|
+
format: "domestic" | "international" | undefined;
|
|
2078
|
+
includeHyperlink: boolean;
|
|
2079
|
+
includeIcon: boolean;
|
|
2080
|
+
linkColor?: ThemeColor;
|
|
2081
|
+
onClick?: () => void;
|
|
2082
|
+
};
|
|
2083
|
+
declare const PhoneAtom: (props: PhoneAtomProps) => React.JSX.Element;
|
|
2084
|
+
declare const formatPhoneNumber: (phoneNumberString: string, format?: string) => string;
|
|
2085
|
+
|
|
2086
|
+
declare enum TimestampOption {
|
|
2087
|
+
DATE = "DATE",
|
|
2088
|
+
DATE_TIME = "DATE_TIME",
|
|
2089
|
+
DATE_RANGE = "DATE_RANGE",
|
|
2090
|
+
DATE_TIME_RANGE = "DATE_TIME_RANGE"
|
|
2091
|
+
}
|
|
2092
|
+
type TimestampAtomProps = {
|
|
2093
|
+
date: string;
|
|
2094
|
+
option?: TimestampOption;
|
|
2095
|
+
endDate?: string;
|
|
2096
|
+
timeZone?: string;
|
|
2097
|
+
hideTimeZone?: boolean;
|
|
2098
|
+
locale?: string;
|
|
2099
|
+
dateFormatOverride?: Omit<Intl.DateTimeFormatOptions, "timeZone">;
|
|
2100
|
+
dateTimeFormatOverride?: Omit<Intl.DateTimeFormatOptions, "timeZone">;
|
|
2101
|
+
};
|
|
2102
|
+
declare const TimestampAtom: ({ date, option, endDate, timeZone, hideTimeZone, locale, dateFormatOverride, dateTimeFormatOverride, }: TimestampAtomProps) => JSX.Element;
|
|
2103
|
+
|
|
2104
|
+
type VideoAtomProps = {
|
|
2105
|
+
youTubeEmbedUrl: string;
|
|
2106
|
+
title: string;
|
|
2107
|
+
className?: string;
|
|
2108
|
+
};
|
|
2109
|
+
declare const VideoAtom: (props: VideoAtomProps) => React.JSX.Element;
|
|
2110
|
+
|
|
2111
|
+
interface VisibilityWrapperProps {
|
|
2112
|
+
liveVisibility: boolean;
|
|
2113
|
+
isEditing: boolean;
|
|
2114
|
+
iconSize?: VariantProps<typeof wrapperVariants>["size"];
|
|
2115
|
+
children: React.ReactNode;
|
|
2116
|
+
}
|
|
2117
|
+
declare const wrapperVariants: (props?: ({
|
|
2118
|
+
size?: "lg" | "md" | null | undefined;
|
|
2119
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2120
|
+
declare const VisibilityWrapper: React.FC<VisibilityWrapperProps>;
|
|
2121
|
+
|
|
2122
|
+
declare const LOCATOR_ENTITY_TYPES: readonly ["location", "healthcareProfessional", "healthcareFacility", "event", "atm", "restaurant", "hotel", "providerFacility", "financialProfessional"];
|
|
2123
|
+
type LocatorEntityType = (typeof LOCATOR_ENTITY_TYPES)[number];
|
|
2124
|
+
declare const DEFAULT_ENTITY_TYPE: LocatorEntityType;
|
|
2125
|
+
declare function isLocatorEntityType(value: string): value is LocatorEntityType;
|
|
2126
|
+
declare const getLocatorEntityTypeSourceMap: (streamDocument?: StreamDocument) => Partial<Record<LocatorEntityType, string | undefined>>;
|
|
2127
|
+
declare const getEntityTypeLabel: (entityType: LocatorEntityType) => string;
|
|
2128
|
+
|
|
2129
|
+
type RichTextStyleOverrides = Partial<BaseTextStyles> & {
|
|
2130
|
+
color?: ThemeColor | string;
|
|
2131
|
+
};
|
|
2132
|
+
interface MaybeRTFProps extends Record<string, any> {
|
|
2133
|
+
data: RichText | string | undefined;
|
|
2134
|
+
bodyVariant?: BodyProps["variant"];
|
|
2135
|
+
/** Override the theme's styling */
|
|
2136
|
+
richTextStyleOverrides?: RichTextStyleOverrides;
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Renders plain strings through the shared `Body` component and rich text HTML
|
|
2140
|
+
* through the standard `rtf-wrapper` container while applying shared rich-text
|
|
2141
|
+
* typography and color overrides.
|
|
2142
|
+
*/
|
|
2143
|
+
declare const MaybeRTF: ({ data, bodyVariant, richTextStyleOverrides, style, className, ...props }: MaybeRTFProps) => React.JSX.Element;
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* Creates render transforms for one page and locale.
|
|
2147
|
+
*
|
|
2148
|
+
* 1. Identify always-transformed and opted-in authored fields, including fields adapted to `custom`.
|
|
2149
|
+
* 2. Dispatch source resolution to the field handler, sharing localization and interpolation.
|
|
2150
|
+
* 3. Register handlers with Puck while preserving resolved data shapes for their renderers.
|
|
2151
|
+
* Authored values are never mutated or replaced in saved Puck data.
|
|
2152
|
+
*/
|
|
2153
|
+
declare function createYextFieldTransforms(streamDocument: StreamDocument, locale: string): Record<string, FieldTransformFn<BaseField & {
|
|
2154
|
+
type: string;
|
|
2155
|
+
}>>;
|
|
2156
|
+
|
|
2157
|
+
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 };
|