@yext/visual-editor 0.0.47 → 0.0.49
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/index.d.cts +88 -71
- package/dist/index.d.ts +88 -71
- package/dist/plugin/{debugger-BwrGCC7Q-f0psYl99.cjs → debugger-DoQ3QjB9-B45j_UnR.cjs} +1 -1
- package/dist/plugin/{debugger-BwrGCC7Q-BUnnPQFL.js → debugger-DoQ3QjB9-FvvxaHPf.js} +1 -1
- package/dist/plugin/index-CTWH2090.cjs +2632 -0
- package/dist/plugin/{index-DsJ02qpe.js → index-EoSmOG9n.js} +45855 -45983
- package/dist/plugin/plugin.cjs +1 -1
- package/dist/plugin/plugin.js +1 -1
- package/dist/style.css +1 -1
- package/dist/visual-editor.cjs +86 -75
- package/dist/visual-editor.js +18367 -18336
- package/package.json +3 -2
- package/dist/plugin/index-DGoKf32S.cjs +0 -2621
package/dist/index.d.cts
CHANGED
|
@@ -45,12 +45,71 @@ type StreamFields = {
|
|
|
45
45
|
declare const usePlatformBridgeEntityFields: () => StreamFields | null;
|
|
46
46
|
declare const useEntityFields: () => StreamFields | null;
|
|
47
47
|
|
|
48
|
+
type CoreStyle = {
|
|
49
|
+
label: string;
|
|
50
|
+
type: "number";
|
|
51
|
+
default: number;
|
|
52
|
+
} | {
|
|
53
|
+
label: string;
|
|
54
|
+
type: "select";
|
|
55
|
+
default: string;
|
|
56
|
+
options: StyleSelectOption[] | (() => StyleSelectOption[]);
|
|
57
|
+
} | {
|
|
58
|
+
label: string;
|
|
59
|
+
type: "color";
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
type Style = CoreStyle & {
|
|
63
|
+
plugin: string;
|
|
64
|
+
};
|
|
65
|
+
type StyleSelectOption = {
|
|
66
|
+
label: string;
|
|
67
|
+
value: string;
|
|
68
|
+
};
|
|
69
|
+
type StyleGroup = {
|
|
70
|
+
label: string;
|
|
71
|
+
plugin: string;
|
|
72
|
+
styles: {
|
|
73
|
+
[key: string]: CoreStyle;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
type ThemeConfigSection = {
|
|
77
|
+
label: string;
|
|
78
|
+
styles: {
|
|
79
|
+
[key: string]: Style | StyleGroup;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
type ThemeConfig = {
|
|
83
|
+
[key: string]: ThemeConfigSection;
|
|
84
|
+
};
|
|
85
|
+
type TailwindConfig = {
|
|
86
|
+
[key: string]: {
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Merges the developer-specified theming and the marketer-specified theming,
|
|
92
|
+
* giving priority to the developer-specified theming.
|
|
93
|
+
*/
|
|
94
|
+
declare const themeResolver: (developerTheming: TailwindConfig, marketerTheming: ThemeConfig) => TailwindConfig;
|
|
95
|
+
|
|
96
|
+
type Document = {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
__?: {
|
|
99
|
+
layout?: string;
|
|
100
|
+
theme?: string;
|
|
101
|
+
codeTemplate?: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
declare const applyTheme: (document: Document, themeConfig: ThemeConfig, base?: string) => string;
|
|
106
|
+
|
|
48
107
|
declare const TemplatePropsContext: React$1.Context<any>;
|
|
49
108
|
declare const useTemplateProps: <T = {
|
|
50
109
|
document: Record<string, any>;
|
|
51
110
|
relativePrefixToRoot?: string;
|
|
52
111
|
}>() => T;
|
|
53
|
-
declare const useDocument: <T>() => T;
|
|
112
|
+
declare const useDocument: <T = Document>() => T;
|
|
54
113
|
|
|
55
114
|
declare const TailwindConfigContext: React$1.Context<any>;
|
|
56
115
|
declare const useTailwindConfig: <T>() => T;
|
|
@@ -88,6 +147,7 @@ type ComboboxOptionGroup = {
|
|
|
88
147
|
type BackgroundStyle = {
|
|
89
148
|
bgColor: string;
|
|
90
149
|
textColor: string;
|
|
150
|
+
isDarkBackground?: boolean;
|
|
91
151
|
};
|
|
92
152
|
type BackgroundOption = {
|
|
93
153
|
label: string;
|
|
@@ -182,71 +242,12 @@ declare const ThemeOptions: {
|
|
|
182
242
|
}[];
|
|
183
243
|
};
|
|
184
244
|
|
|
185
|
-
declare const useBackground: () => BackgroundStyle | undefined;
|
|
245
|
+
declare const useBackground: () => Required<BackgroundStyle> | undefined;
|
|
186
246
|
declare const BackgroundProvider: ({ children, value, }: {
|
|
187
247
|
children: ReactNode;
|
|
188
|
-
value: BackgroundStyle
|
|
248
|
+
value: Required<BackgroundStyle>;
|
|
189
249
|
}) => react_jsx_runtime.JSX.Element;
|
|
190
250
|
|
|
191
|
-
type CoreStyle = {
|
|
192
|
-
label: string;
|
|
193
|
-
type: "number";
|
|
194
|
-
default: number;
|
|
195
|
-
} | {
|
|
196
|
-
label: string;
|
|
197
|
-
type: "select";
|
|
198
|
-
default: string;
|
|
199
|
-
options: StyleSelectOption[] | (() => StyleSelectOption[]);
|
|
200
|
-
} | {
|
|
201
|
-
label: string;
|
|
202
|
-
type: "color";
|
|
203
|
-
default: string;
|
|
204
|
-
};
|
|
205
|
-
type Style = CoreStyle & {
|
|
206
|
-
plugin: string;
|
|
207
|
-
};
|
|
208
|
-
type StyleSelectOption = {
|
|
209
|
-
label: string;
|
|
210
|
-
value: string;
|
|
211
|
-
};
|
|
212
|
-
type StyleGroup = {
|
|
213
|
-
label: string;
|
|
214
|
-
plugin: string;
|
|
215
|
-
styles: {
|
|
216
|
-
[key: string]: CoreStyle;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
type ThemeConfigSection = {
|
|
220
|
-
label: string;
|
|
221
|
-
styles: {
|
|
222
|
-
[key: string]: Style | StyleGroup;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
type ThemeConfig = {
|
|
226
|
-
[key: string]: ThemeConfigSection;
|
|
227
|
-
};
|
|
228
|
-
type TailwindConfig = {
|
|
229
|
-
[key: string]: {
|
|
230
|
-
[key: string]: any;
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Merges the developer-specified theming and the marketer-specified theming,
|
|
235
|
-
* giving priority to the developer-specified theming.
|
|
236
|
-
*/
|
|
237
|
-
declare const themeResolver: (developerTheming: TailwindConfig, marketerTheming: ThemeConfig) => TailwindConfig;
|
|
238
|
-
|
|
239
|
-
type Document = {
|
|
240
|
-
[key: string]: any;
|
|
241
|
-
__?: {
|
|
242
|
-
layout?: string;
|
|
243
|
-
theme?: string;
|
|
244
|
-
codeTemplate?: string;
|
|
245
|
-
name?: string;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
declare const applyTheme: (document: Document, themeConfig: ThemeConfig, base?: string) => string;
|
|
249
|
-
|
|
250
251
|
type Only<T, U> = {
|
|
251
252
|
[P in keyof T]: T[P];
|
|
252
253
|
} & {
|
|
@@ -310,15 +311,16 @@ type StructSelectorProps = {
|
|
|
310
311
|
};
|
|
311
312
|
declare const YextStructFieldSelector: <U extends Record<string, any>>(props: StructSelectorProps) => CustomField<YextStructEntityField<U>>;
|
|
312
313
|
|
|
313
|
-
declare const resolveYextEntityField: <T>(document: any, entityField: YextEntityField<T
|
|
314
|
-
declare const resolveYextStructField: <T extends Record<string, any>>(document: any, entityField: YextStructEntityField<T
|
|
314
|
+
declare const resolveYextEntityField: <T>(document: any, entityField: YextEntityField<T>, locale?: string) => T | undefined;
|
|
315
|
+
declare const resolveYextStructField: <T extends Record<string, any>>(document: any, entityField: YextStructEntityField<T>, locale?: string) => T | undefined;
|
|
315
316
|
|
|
316
317
|
/**
|
|
317
318
|
* Converts a type TranslatableString to a string
|
|
318
319
|
* @param translatableString
|
|
319
320
|
* @param locale
|
|
321
|
+
* @param document
|
|
320
322
|
*/
|
|
321
|
-
declare const resolveTranslatableString: (translatableString?: TranslatableString, locale?: string) => string;
|
|
323
|
+
declare const resolveTranslatableString: (translatableString?: TranslatableString, locale?: string, document?: any) => string;
|
|
322
324
|
/**
|
|
323
325
|
* Converts a type TranslatableRichText to string or RTF Element
|
|
324
326
|
* @param translatableRichText
|
|
@@ -426,8 +428,9 @@ type RootConfig = {
|
|
|
426
428
|
};
|
|
427
429
|
declare function getPageMetadata(document: Record<string, any>): RootConfig;
|
|
428
430
|
|
|
429
|
-
declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, locale,
|
|
431
|
+
declare const fetchNearbyLocations: ({ businessId, entityId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, locale, }: {
|
|
430
432
|
businessId: string;
|
|
433
|
+
entityId: string;
|
|
431
434
|
apiKey: string;
|
|
432
435
|
contentEndpointId: string;
|
|
433
436
|
contentDeliveryAPIDomain: string;
|
|
@@ -436,7 +439,6 @@ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, co
|
|
|
436
439
|
radiusMi: number;
|
|
437
440
|
limit: number;
|
|
438
441
|
locale: string;
|
|
439
|
-
currentLocationId: string;
|
|
440
442
|
}) => Promise<Record<string, any>>;
|
|
441
443
|
|
|
442
444
|
declare const fetchLocalesToPathsForEntity: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, entityId, }: {
|
|
@@ -764,9 +766,9 @@ declare const KnowledgeGraphIcon: ({ enabled }: {
|
|
|
764
766
|
/**
|
|
765
767
|
* Generates a translatable string config
|
|
766
768
|
* @param label optional label. Takes in a value from msg.
|
|
767
|
-
* @param
|
|
769
|
+
* @param filter optional filter for the entity fields that can be embedded.
|
|
768
770
|
*/
|
|
769
|
-
declare function TranslatableStringField<T extends TranslatableString | undefined = TranslatableString>(label?: MsgString,
|
|
771
|
+
declare function TranslatableStringField<T extends TranslatableString | undefined = TranslatableString>(label?: MsgString, filter?: RenderEntityFieldFilter<any>): CustomField<T>;
|
|
770
772
|
|
|
771
773
|
/**
|
|
772
774
|
* Generates a translatableRichText field config
|
|
@@ -774,6 +776,15 @@ declare function TranslatableStringField<T extends TranslatableString | undefine
|
|
|
774
776
|
*/
|
|
775
777
|
declare function TranslatableRichTextField<T extends TranslatableRichText | undefined = TranslatableRichText>(label?: MsgString): CustomField<T>;
|
|
776
778
|
|
|
779
|
+
/**
|
|
780
|
+
* A debounced string input that allows embedding entity fields via a popover selector.
|
|
781
|
+
*/
|
|
782
|
+
declare const EmbeddedFieldStringInput: <T extends Record<string, any>>({ value, onChange, filter, }: {
|
|
783
|
+
value: string;
|
|
784
|
+
onChange: (value: string) => void;
|
|
785
|
+
filter: RenderEntityFieldFilter<T>;
|
|
786
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
787
|
+
|
|
777
788
|
declare const bodyVariants: (props?: ({
|
|
778
789
|
variant?: "sm" | "lg" | "base" | "xs" | null | undefined;
|
|
779
790
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
@@ -923,7 +934,6 @@ type AggregateRating = {
|
|
|
923
934
|
};
|
|
924
935
|
type ReviewStarsProps = {
|
|
925
936
|
averageRating: number;
|
|
926
|
-
hasDarkBackground: boolean;
|
|
927
937
|
reviewCount?: number;
|
|
928
938
|
};
|
|
929
939
|
declare const ReviewStars: (props: ReviewStarsProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -991,6 +1001,7 @@ interface CoreInfoSectionProps {
|
|
|
991
1001
|
phoneFormat: "domestic" | "international";
|
|
992
1002
|
includePhoneHyperlink: boolean;
|
|
993
1003
|
emailsListLength?: number;
|
|
1004
|
+
ctaVariant: CTAProps["variant"];
|
|
994
1005
|
};
|
|
995
1006
|
hours: {
|
|
996
1007
|
startOfWeek: keyof DayOfWeekNames | "today";
|
|
@@ -1019,6 +1030,7 @@ interface EventSectionProps {
|
|
|
1019
1030
|
cards: {
|
|
1020
1031
|
headingLevel: HeadingLevel;
|
|
1021
1032
|
backgroundColor?: BackgroundStyle;
|
|
1033
|
+
ctaVariant: CTAProps["variant"];
|
|
1022
1034
|
};
|
|
1023
1035
|
};
|
|
1024
1036
|
analytics?: {
|
|
@@ -1071,6 +1083,7 @@ interface InsightSectionProps {
|
|
|
1071
1083
|
cards: {
|
|
1072
1084
|
headingLevel: HeadingLevel;
|
|
1073
1085
|
backgroundColor?: BackgroundStyle;
|
|
1086
|
+
ctaVariant: CTAProps["variant"];
|
|
1074
1087
|
};
|
|
1075
1088
|
};
|
|
1076
1089
|
analytics?: {
|
|
@@ -1128,6 +1141,7 @@ interface ProductSectionProps {
|
|
|
1128
1141
|
cards: {
|
|
1129
1142
|
headingLevel: HeadingLevel;
|
|
1130
1143
|
backgroundColor?: BackgroundStyle;
|
|
1144
|
+
ctaVariant: CTAProps["variant"];
|
|
1131
1145
|
};
|
|
1132
1146
|
};
|
|
1133
1147
|
analytics?: {
|
|
@@ -1236,6 +1250,7 @@ interface TeamSectionProps {
|
|
|
1236
1250
|
cards: {
|
|
1237
1251
|
headingLevel: HeadingLevel;
|
|
1238
1252
|
backgroundColor?: BackgroundStyle;
|
|
1253
|
+
ctaVariant: CTAProps["variant"];
|
|
1239
1254
|
};
|
|
1240
1255
|
};
|
|
1241
1256
|
analytics?: {
|
|
@@ -1405,6 +1420,7 @@ declare const Footer: ComponentConfig<FooterProps>;
|
|
|
1405
1420
|
|
|
1406
1421
|
interface DirectoryProps {
|
|
1407
1422
|
data: {
|
|
1423
|
+
title: YextEntityField<TranslatableString>;
|
|
1408
1424
|
directoryRoot: TranslatableString;
|
|
1409
1425
|
};
|
|
1410
1426
|
styles: {
|
|
@@ -1480,6 +1496,7 @@ interface ExpandedFooterProps {
|
|
|
1480
1496
|
scope?: string;
|
|
1481
1497
|
};
|
|
1482
1498
|
}
|
|
1499
|
+
declare const ExpandedFooter: ComponentConfig<ExpandedFooterProps>;
|
|
1483
1500
|
|
|
1484
1501
|
interface PageSectionCategoryProps {
|
|
1485
1502
|
BannerSection: BannerSectionProps;
|
|
@@ -1605,4 +1622,4 @@ declare const addHeadingAlignmentMigration: Migration;
|
|
|
1605
1622
|
|
|
1606
1623
|
declare const defaultThemeConfig: ThemeConfig;
|
|
1607
1624
|
|
|
1608
|
-
export { Address, type AddressProps, type AggregateRating, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewStars, type ReviewStarsProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAggregateRating, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getLocationPath, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
|
|
1625
|
+
export { Address, type AddressProps, type AggregateRating, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EmbeddedFieldStringInput, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedFooter, type ExpandedFooterProps, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewStars, type ReviewStarsProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAggregateRating, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getLocationPath, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,12 +45,71 @@ type StreamFields = {
|
|
|
45
45
|
declare const usePlatformBridgeEntityFields: () => StreamFields | null;
|
|
46
46
|
declare const useEntityFields: () => StreamFields | null;
|
|
47
47
|
|
|
48
|
+
type CoreStyle = {
|
|
49
|
+
label: string;
|
|
50
|
+
type: "number";
|
|
51
|
+
default: number;
|
|
52
|
+
} | {
|
|
53
|
+
label: string;
|
|
54
|
+
type: "select";
|
|
55
|
+
default: string;
|
|
56
|
+
options: StyleSelectOption[] | (() => StyleSelectOption[]);
|
|
57
|
+
} | {
|
|
58
|
+
label: string;
|
|
59
|
+
type: "color";
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
type Style = CoreStyle & {
|
|
63
|
+
plugin: string;
|
|
64
|
+
};
|
|
65
|
+
type StyleSelectOption = {
|
|
66
|
+
label: string;
|
|
67
|
+
value: string;
|
|
68
|
+
};
|
|
69
|
+
type StyleGroup = {
|
|
70
|
+
label: string;
|
|
71
|
+
plugin: string;
|
|
72
|
+
styles: {
|
|
73
|
+
[key: string]: CoreStyle;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
type ThemeConfigSection = {
|
|
77
|
+
label: string;
|
|
78
|
+
styles: {
|
|
79
|
+
[key: string]: Style | StyleGroup;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
type ThemeConfig = {
|
|
83
|
+
[key: string]: ThemeConfigSection;
|
|
84
|
+
};
|
|
85
|
+
type TailwindConfig = {
|
|
86
|
+
[key: string]: {
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Merges the developer-specified theming and the marketer-specified theming,
|
|
92
|
+
* giving priority to the developer-specified theming.
|
|
93
|
+
*/
|
|
94
|
+
declare const themeResolver: (developerTheming: TailwindConfig, marketerTheming: ThemeConfig) => TailwindConfig;
|
|
95
|
+
|
|
96
|
+
type Document = {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
__?: {
|
|
99
|
+
layout?: string;
|
|
100
|
+
theme?: string;
|
|
101
|
+
codeTemplate?: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
declare const applyTheme: (document: Document, themeConfig: ThemeConfig, base?: string) => string;
|
|
106
|
+
|
|
48
107
|
declare const TemplatePropsContext: React$1.Context<any>;
|
|
49
108
|
declare const useTemplateProps: <T = {
|
|
50
109
|
document: Record<string, any>;
|
|
51
110
|
relativePrefixToRoot?: string;
|
|
52
111
|
}>() => T;
|
|
53
|
-
declare const useDocument: <T>() => T;
|
|
112
|
+
declare const useDocument: <T = Document>() => T;
|
|
54
113
|
|
|
55
114
|
declare const TailwindConfigContext: React$1.Context<any>;
|
|
56
115
|
declare const useTailwindConfig: <T>() => T;
|
|
@@ -88,6 +147,7 @@ type ComboboxOptionGroup = {
|
|
|
88
147
|
type BackgroundStyle = {
|
|
89
148
|
bgColor: string;
|
|
90
149
|
textColor: string;
|
|
150
|
+
isDarkBackground?: boolean;
|
|
91
151
|
};
|
|
92
152
|
type BackgroundOption = {
|
|
93
153
|
label: string;
|
|
@@ -182,71 +242,12 @@ declare const ThemeOptions: {
|
|
|
182
242
|
}[];
|
|
183
243
|
};
|
|
184
244
|
|
|
185
|
-
declare const useBackground: () => BackgroundStyle | undefined;
|
|
245
|
+
declare const useBackground: () => Required<BackgroundStyle> | undefined;
|
|
186
246
|
declare const BackgroundProvider: ({ children, value, }: {
|
|
187
247
|
children: ReactNode;
|
|
188
|
-
value: BackgroundStyle
|
|
248
|
+
value: Required<BackgroundStyle>;
|
|
189
249
|
}) => react_jsx_runtime.JSX.Element;
|
|
190
250
|
|
|
191
|
-
type CoreStyle = {
|
|
192
|
-
label: string;
|
|
193
|
-
type: "number";
|
|
194
|
-
default: number;
|
|
195
|
-
} | {
|
|
196
|
-
label: string;
|
|
197
|
-
type: "select";
|
|
198
|
-
default: string;
|
|
199
|
-
options: StyleSelectOption[] | (() => StyleSelectOption[]);
|
|
200
|
-
} | {
|
|
201
|
-
label: string;
|
|
202
|
-
type: "color";
|
|
203
|
-
default: string;
|
|
204
|
-
};
|
|
205
|
-
type Style = CoreStyle & {
|
|
206
|
-
plugin: string;
|
|
207
|
-
};
|
|
208
|
-
type StyleSelectOption = {
|
|
209
|
-
label: string;
|
|
210
|
-
value: string;
|
|
211
|
-
};
|
|
212
|
-
type StyleGroup = {
|
|
213
|
-
label: string;
|
|
214
|
-
plugin: string;
|
|
215
|
-
styles: {
|
|
216
|
-
[key: string]: CoreStyle;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
type ThemeConfigSection = {
|
|
220
|
-
label: string;
|
|
221
|
-
styles: {
|
|
222
|
-
[key: string]: Style | StyleGroup;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
type ThemeConfig = {
|
|
226
|
-
[key: string]: ThemeConfigSection;
|
|
227
|
-
};
|
|
228
|
-
type TailwindConfig = {
|
|
229
|
-
[key: string]: {
|
|
230
|
-
[key: string]: any;
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Merges the developer-specified theming and the marketer-specified theming,
|
|
235
|
-
* giving priority to the developer-specified theming.
|
|
236
|
-
*/
|
|
237
|
-
declare const themeResolver: (developerTheming: TailwindConfig, marketerTheming: ThemeConfig) => TailwindConfig;
|
|
238
|
-
|
|
239
|
-
type Document = {
|
|
240
|
-
[key: string]: any;
|
|
241
|
-
__?: {
|
|
242
|
-
layout?: string;
|
|
243
|
-
theme?: string;
|
|
244
|
-
codeTemplate?: string;
|
|
245
|
-
name?: string;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
declare const applyTheme: (document: Document, themeConfig: ThemeConfig, base?: string) => string;
|
|
249
|
-
|
|
250
251
|
type Only<T, U> = {
|
|
251
252
|
[P in keyof T]: T[P];
|
|
252
253
|
} & {
|
|
@@ -310,15 +311,16 @@ type StructSelectorProps = {
|
|
|
310
311
|
};
|
|
311
312
|
declare const YextStructFieldSelector: <U extends Record<string, any>>(props: StructSelectorProps) => CustomField<YextStructEntityField<U>>;
|
|
312
313
|
|
|
313
|
-
declare const resolveYextEntityField: <T>(document: any, entityField: YextEntityField<T
|
|
314
|
-
declare const resolveYextStructField: <T extends Record<string, any>>(document: any, entityField: YextStructEntityField<T
|
|
314
|
+
declare const resolveYextEntityField: <T>(document: any, entityField: YextEntityField<T>, locale?: string) => T | undefined;
|
|
315
|
+
declare const resolveYextStructField: <T extends Record<string, any>>(document: any, entityField: YextStructEntityField<T>, locale?: string) => T | undefined;
|
|
315
316
|
|
|
316
317
|
/**
|
|
317
318
|
* Converts a type TranslatableString to a string
|
|
318
319
|
* @param translatableString
|
|
319
320
|
* @param locale
|
|
321
|
+
* @param document
|
|
320
322
|
*/
|
|
321
|
-
declare const resolveTranslatableString: (translatableString?: TranslatableString, locale?: string) => string;
|
|
323
|
+
declare const resolveTranslatableString: (translatableString?: TranslatableString, locale?: string, document?: any) => string;
|
|
322
324
|
/**
|
|
323
325
|
* Converts a type TranslatableRichText to string or RTF Element
|
|
324
326
|
* @param translatableRichText
|
|
@@ -426,8 +428,9 @@ type RootConfig = {
|
|
|
426
428
|
};
|
|
427
429
|
declare function getPageMetadata(document: Record<string, any>): RootConfig;
|
|
428
430
|
|
|
429
|
-
declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, locale,
|
|
431
|
+
declare const fetchNearbyLocations: ({ businessId, entityId, apiKey, contentEndpointId, contentDeliveryAPIDomain, latitude, longitude, radiusMi, limit, locale, }: {
|
|
430
432
|
businessId: string;
|
|
433
|
+
entityId: string;
|
|
431
434
|
apiKey: string;
|
|
432
435
|
contentEndpointId: string;
|
|
433
436
|
contentDeliveryAPIDomain: string;
|
|
@@ -436,7 +439,6 @@ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, co
|
|
|
436
439
|
radiusMi: number;
|
|
437
440
|
limit: number;
|
|
438
441
|
locale: string;
|
|
439
|
-
currentLocationId: string;
|
|
440
442
|
}) => Promise<Record<string, any>>;
|
|
441
443
|
|
|
442
444
|
declare const fetchLocalesToPathsForEntity: ({ businessId, apiKey, contentEndpointId, contentDeliveryAPIDomain, entityId, }: {
|
|
@@ -764,9 +766,9 @@ declare const KnowledgeGraphIcon: ({ enabled }: {
|
|
|
764
766
|
/**
|
|
765
767
|
* Generates a translatable string config
|
|
766
768
|
* @param label optional label. Takes in a value from msg.
|
|
767
|
-
* @param
|
|
769
|
+
* @param filter optional filter for the entity fields that can be embedded.
|
|
768
770
|
*/
|
|
769
|
-
declare function TranslatableStringField<T extends TranslatableString | undefined = TranslatableString>(label?: MsgString,
|
|
771
|
+
declare function TranslatableStringField<T extends TranslatableString | undefined = TranslatableString>(label?: MsgString, filter?: RenderEntityFieldFilter<any>): CustomField<T>;
|
|
770
772
|
|
|
771
773
|
/**
|
|
772
774
|
* Generates a translatableRichText field config
|
|
@@ -774,6 +776,15 @@ declare function TranslatableStringField<T extends TranslatableString | undefine
|
|
|
774
776
|
*/
|
|
775
777
|
declare function TranslatableRichTextField<T extends TranslatableRichText | undefined = TranslatableRichText>(label?: MsgString): CustomField<T>;
|
|
776
778
|
|
|
779
|
+
/**
|
|
780
|
+
* A debounced string input that allows embedding entity fields via a popover selector.
|
|
781
|
+
*/
|
|
782
|
+
declare const EmbeddedFieldStringInput: <T extends Record<string, any>>({ value, onChange, filter, }: {
|
|
783
|
+
value: string;
|
|
784
|
+
onChange: (value: string) => void;
|
|
785
|
+
filter: RenderEntityFieldFilter<T>;
|
|
786
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
787
|
+
|
|
777
788
|
declare const bodyVariants: (props?: ({
|
|
778
789
|
variant?: "sm" | "lg" | "base" | "xs" | null | undefined;
|
|
779
790
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
@@ -923,7 +934,6 @@ type AggregateRating = {
|
|
|
923
934
|
};
|
|
924
935
|
type ReviewStarsProps = {
|
|
925
936
|
averageRating: number;
|
|
926
|
-
hasDarkBackground: boolean;
|
|
927
937
|
reviewCount?: number;
|
|
928
938
|
};
|
|
929
939
|
declare const ReviewStars: (props: ReviewStarsProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -991,6 +1001,7 @@ interface CoreInfoSectionProps {
|
|
|
991
1001
|
phoneFormat: "domestic" | "international";
|
|
992
1002
|
includePhoneHyperlink: boolean;
|
|
993
1003
|
emailsListLength?: number;
|
|
1004
|
+
ctaVariant: CTAProps["variant"];
|
|
994
1005
|
};
|
|
995
1006
|
hours: {
|
|
996
1007
|
startOfWeek: keyof DayOfWeekNames | "today";
|
|
@@ -1019,6 +1030,7 @@ interface EventSectionProps {
|
|
|
1019
1030
|
cards: {
|
|
1020
1031
|
headingLevel: HeadingLevel;
|
|
1021
1032
|
backgroundColor?: BackgroundStyle;
|
|
1033
|
+
ctaVariant: CTAProps["variant"];
|
|
1022
1034
|
};
|
|
1023
1035
|
};
|
|
1024
1036
|
analytics?: {
|
|
@@ -1071,6 +1083,7 @@ interface InsightSectionProps {
|
|
|
1071
1083
|
cards: {
|
|
1072
1084
|
headingLevel: HeadingLevel;
|
|
1073
1085
|
backgroundColor?: BackgroundStyle;
|
|
1086
|
+
ctaVariant: CTAProps["variant"];
|
|
1074
1087
|
};
|
|
1075
1088
|
};
|
|
1076
1089
|
analytics?: {
|
|
@@ -1128,6 +1141,7 @@ interface ProductSectionProps {
|
|
|
1128
1141
|
cards: {
|
|
1129
1142
|
headingLevel: HeadingLevel;
|
|
1130
1143
|
backgroundColor?: BackgroundStyle;
|
|
1144
|
+
ctaVariant: CTAProps["variant"];
|
|
1131
1145
|
};
|
|
1132
1146
|
};
|
|
1133
1147
|
analytics?: {
|
|
@@ -1236,6 +1250,7 @@ interface TeamSectionProps {
|
|
|
1236
1250
|
cards: {
|
|
1237
1251
|
headingLevel: HeadingLevel;
|
|
1238
1252
|
backgroundColor?: BackgroundStyle;
|
|
1253
|
+
ctaVariant: CTAProps["variant"];
|
|
1239
1254
|
};
|
|
1240
1255
|
};
|
|
1241
1256
|
analytics?: {
|
|
@@ -1405,6 +1420,7 @@ declare const Footer: ComponentConfig<FooterProps>;
|
|
|
1405
1420
|
|
|
1406
1421
|
interface DirectoryProps {
|
|
1407
1422
|
data: {
|
|
1423
|
+
title: YextEntityField<TranslatableString>;
|
|
1408
1424
|
directoryRoot: TranslatableString;
|
|
1409
1425
|
};
|
|
1410
1426
|
styles: {
|
|
@@ -1480,6 +1496,7 @@ interface ExpandedFooterProps {
|
|
|
1480
1496
|
scope?: string;
|
|
1481
1497
|
};
|
|
1482
1498
|
}
|
|
1499
|
+
declare const ExpandedFooter: ComponentConfig<ExpandedFooterProps>;
|
|
1483
1500
|
|
|
1484
1501
|
interface PageSectionCategoryProps {
|
|
1485
1502
|
BannerSection: BannerSectionProps;
|
|
@@ -1605,4 +1622,4 @@ declare const addHeadingAlignmentMigration: Migration;
|
|
|
1605
1622
|
|
|
1606
1623
|
declare const defaultThemeConfig: ThemeConfig;
|
|
1607
1624
|
|
|
1608
|
-
export { Address, type AddressProps, type AggregateRating, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewStars, type ReviewStarsProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAggregateRating, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getLocationPath, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
|
|
1625
|
+
export { Address, type AddressProps, type AggregateRating, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, DeprecatedCategory, DeprecatedCategoryComponents, type DeprecatedCategoryProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EmbeddedFieldStringInput, EntityField, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExpandedFooter, type ExpandedFooterProps, ExpandedHeader, type ExpandedHeaderProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, type GalleryImageType, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, HoursStatusAtom, type HoursStatusAtomProps, type HoursStatusProps, HoursTable, HoursTableAtom, type HoursTableAtomProps, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, KnowledgeGraphIcon, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, LocatorCategory, LocatorCategoryComponents, type LocatorCategoryProps, LocatorComponent, type LocatorProps, MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, MaybeRTF, type MaybeRTFProps, type Migration, type MigrationAction, type MigrationRegistry, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RenderYextEntityFieldSelectorProps, ReviewStars, type ReviewStarsProps, ReviewsSection, type ReviewsSectionProps, type RichText, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, Toggle, type TranslatableCTA, type TranslatableRichText, TranslatableRichTextField, type TranslatableString, TranslatableStringField, VisibilityWrapper, VisualEditorProvider, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, addHeadingAlignmentMigration, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchLocalesToPathsForEntity, fetchNearbyLocations, fetchReviewsForEntity, getAggregateRating, getAnalyticsScopeHash, getFontWeightOptions, getFontWeightOverrideOptions, getLocationPath, getPageMetadata, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, msg, normalizeSlug, pt, resolveTranslatableRichText, resolveTranslatableString, resolveYextEntityField, resolveYextStructField, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CTWH2090.cjs");function N(){return n.la().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.nt.jsx(j,{}),document.body))}const k=(e,a)=>{const s=e.dataset.yaAction,t=e.dataset.yaScopeoverride,o=e.dataset.yaEventname,i=t||a;return{action:s,originalEventName:i?`${i}_${o}`:o,scope:i}},S=(e,a)=>{const s=[];let t=e;for(;t!=null&&t.parentElement;)t=t.parentElement.closest(a),t&&s.push(t);return s},v={},w="YA_NO_SCOPE",y=(e,a,s,t)=>{v.hasOwnProperty(e)?v[e].events.map(o=>o.el).includes(t)||(v[e].events=[...v[e].events,{eventData:a,el:t}]):v[e]={scopeEl:s||t,events:[{eventData:a,el:t}]}};function j(){const[e,a]=n.reactExports.useState(),[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(!1),l=r=>{a(e===r?void 0:r)};return n.reactExports.useEffect(()=>{let r=null;const d=()=>{r&&r.abort(),r=new AbortController;const c=r.signal;document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((u,E)=>{const m=u.closest("[data-ya-scope]"),h=m?.dataset.yaScope,p=k(u,h);u.addEventListener("mouseenter",()=>{t([{elem:u,key:`${p.originalEventName}_${E}`,action:p.action,originalEventName:p.originalEventName,scope:p.scope}])},{signal:c}),u.addEventListener("mouseleave",()=>{t([])},{signal:c});const x=u.dataset.yaScopeoverride;x?y(x,p,m,u):[h,...S(u,"[data-ya-scope]").map(b=>b.dataset.yaScope)].forEach(b=>{y(b||w,p,m,u)})}),i(!0)};d();const g=new MutationObserver(d);return g.observe(document,{childList:!0,subtree:!0}),()=>{document.documentElement.classList.remove("xYextDebug"),g.disconnect(),r?.abort()}},[]),o?n.nt.jsxs(n.nt.Fragment,{children:[n.nt.jsxs("div",{className:"analytics-debugger",children:[n.nt.jsxs("div",{className:"analytics-debugger-toggles",children:[n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),e&&n.nt.jsx("div",{className:"analytics-debugger-tabs",children:e==="Events"?n.nt.jsx(C,{data:v,setTooltips:t}):n.nt.jsx($,{data:v,setTooltips:t})})]}),n.nt.jsx(D,{tooltips:s})]}):null}const Y=()=>{const e={};return Object.values(v).forEach(a=>{a.events.forEach(s=>{const{originalEventName:t}=s.eventData;e[t]||(e[t]=[]),!e[t].find(o=>o.el===s.el)&&e[t].push(s)})}),e};function C(e){const{setTooltips:a}=e,[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(""),l=(r,d)=>{s.forEach(c=>c.classList.remove("analytics-event-highlight"));const g=r.map(c=>(c.el.scrollIntoView({behavior:"smooth",block:"nearest"}),c.el.classList.add("analytics-event-highlight"),c.el));t(g),i(d),a(r.map((c,u)=>({elem:c.el,key:`${c.eventData.originalEventName}_${u}`,action:c.eventData.action,originalEventName:c.eventData.originalEventName,scope:c.eventData.scope})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([r,d],g)=>{const c=`${r}_${g}`;return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":c===o}),onClick:()=>l(d,c),children:r})},c)})})]})}function $(e){const{data:a,setTooltips:s}=e,[t,o]=n.reactExports.useState(""),i=l=>{const r=a[l];r.scopeEl&&(r.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),o(l),s(r.events.map((d,g)=>{const c=d.eventData;return{elem:d.el,key:`${c.originalEventName}_${g}`,action:c.action,originalEventName:c.originalEventName,scope:c.scope}})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,r)=>{if(l!==w)return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":l===t}),onClick:()=>i(l),children:l})},l+r)})})]})}function D(e){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const t=Object.values(a.current).map(o=>o.el).filter(o=>o!==s.el);O(s,t),s.el.style.visibility="visible"}},[e.tooltips]),n.nt.jsx(n.nt.Fragment,{children:e.tooltips.map(s=>n.nt.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:t=>{t?a.current[s.key]={el:t,tooltip:s}:delete a.current[s.key]},children:[n.nt.jsxs("span",{children:["Action: ",s.action]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Scope: ",s.scope]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(e,a){for(let s=0;s<9;s++){const t=I(e.tooltip.elem.getBoundingClientRect(),e.el,s);if(e.el.style.inset=`${t.top} auto auto ${t.left}`,!!B(e.el.getBoundingClientRect().left,e.el.getBoundingClientRect().top+window.scrollY,e.el.getBoundingClientRect().right,e.el.getBoundingClientRect().bottom+window.scrollY))continue;let o=!0;for(let i=0;i<a.length;i++){const l=a[i];R(e.el,l)&&(o=!1)}if(o)break}}function R(e,a){const s=e.getBoundingClientRect().top+window.scrollY,t=e.getBoundingClientRect().left,o=s+e.clientHeight,i=t+e.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,r=a.getBoundingClientRect().left,d=l+a.clientHeight,g=r+a.clientWidth,c=(u,E,m,h,p,x,b,f)=>m<=p&&p<=b&&h<=x&&x<=f||m<=u&&u<=b&&h<=E&&E<=f||m<=u&&u<=b&&h<=x&&x<=f||m<=p&&p<=b&&h<=E&&E<=f;return c(t,s,r,l,i,o,g,d)||c(r,l,t,s,g,d,i,o)}function B(e,a,s,t){return e<0||s>window.innerWidth||a<0||t>document.documentElement.scrollHeight}function I(e,a,s){const t=a.clientHeight,o=a.clientWidth;let i,l;switch(s){case 0:{l=window.scrollY+e.top-t+"px",i=e.left-o+"px";break}case 1:{l=window.scrollY+e.top-t+"px",i=e.left+"px";break}case 2:{l=window.scrollY+e.top-t+"px",i=e.right+"px";break}case 3:{l=window.scrollY+e.top-t+"px",i=e.right-o+"px";break}case 4:{l=window.scrollY+e.bottom+"px",i=e.left-o+"px";break}case 5:{l=window.scrollY+e.bottom+"px",i=e.left+"px";break}case 6:{l=window.scrollY+e.bottom+"px",i=e.right-o+"px";break}case 7:{l=window.scrollY+e.bottom+"px",i=e.right+"px";break}default:l=0,i=0}return{top:l,left:i}}exports.AnalyticsDebuggerInternal=j;exports.default=N;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as b, n as l, e as w, a as k, l as S } from "./index-
|
|
1
|
+
import { r as b, n as l, e as w, a as k, l as S } from "./index-EoSmOG9n.js";
|
|
2
2
|
function P() {
|
|
3
3
|
return S().name !== "browser" || window.hasOwnProperty("debuggerInitialized") ? null : (window.debuggerInitialized = !0, k.createPortal(/* @__PURE__ */ l.jsx($, {}), document.body));
|
|
4
4
|
}
|