@yext/visual-editor 0.0.40 → 0.0.41

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 CHANGED
@@ -2,10 +2,12 @@ import * as React$1 from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as _measured_puck from '@measured/puck';
5
- import { Field, CustomField, Fields, Data, DefaultComponentProps, Config, DefaultRootProps, ArrayField, BaseField, NumberField, ObjectField, ComponentConfig } from '@measured/puck';
5
+ import { Field, CustomField, Fields, Data, DefaultComponentProps, Config, DefaultRootProps, ComponentConfig, ArrayField, BaseField, NumberField, ObjectField } from '@measured/puck';
6
6
  import { ClassValue } from 'clsx';
7
7
  import * as _yext_search_headless_react from '@yext/search-headless-react';
8
- import { ImageType, CTA as CTA$1, LinkType, ComplexImageType, AddressType, HoursType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
8
+ import * as i18next from 'i18next';
9
+ import * as react_i18next from 'react-i18next';
10
+ import { ImageType, CTA as CTA$1, LinkType, HoursTableProps as HoursTableProps$1, ComplexImageType, HoursType, AddressType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
9
11
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
10
12
  import { VariantProps } from 'class-variance-authority';
11
13
  import * as react_jsx_runtime_js from 'react/jsx-runtime.js';
@@ -353,11 +355,14 @@ declare function themeManagerCn(...inputs: ClassValue[]): string;
353
355
 
354
356
  type FontRegistry = Record<string, FontSpecification>;
355
357
  type FontSpecification = {
356
- minWeight: number;
357
- maxWeight: number;
358
358
  italics: boolean;
359
359
  fallback: "sans-serif" | "serif" | "monospace" | "cursive";
360
- };
360
+ } & ({
361
+ minWeight: number;
362
+ maxWeight: number;
363
+ } | {
364
+ weights: number[];
365
+ });
361
366
  declare const defaultFonts: FontRegistry;
362
367
  declare const constructFontSelectOptions: (fonts: FontRegistry) => StyleSelectOption[];
363
368
  type getFontWeightParams = {
@@ -378,7 +383,7 @@ type EditorProps$1 = {
378
383
  tailwindConfig: TailwindConfig;
379
384
  };
380
385
  type VisualEditorProviderProps<T> = UniversalProps<T> & AllOrNothing<EditorProps$1>;
381
- declare const VisualEditorProvider: <T>({ templateProps, entityFields, tailwindConfig, children, }: VisualEditorProviderProps<T>) => react_jsx_runtime.JSX.Element;
386
+ declare const VisualEditorProvider: <T extends Record<string, any>>({ templateProps, entityFields, tailwindConfig, children, }: VisualEditorProviderProps<T>) => react_jsx_runtime.JSX.Element;
382
387
 
383
388
  /**
384
389
  * Check that the string is a valid slug.
@@ -421,16 +426,18 @@ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, co
421
426
  /**
422
427
  * Builds the search headless config for the template. Returns undefined if the config is not valid.
423
428
  * @param document the entity document
429
+ * @param experienceKeyEnvVar can be provided via withPropOverrides for a hybrid developer
424
430
  */
425
- declare const createSearchHeadlessConfig: (document: any) => (_yext_search_headless_react.SearchConfigWithApiKey & {
431
+ declare const createSearchHeadlessConfig: (document: any, experienceKeyEnvVar?: string) => (_yext_search_headless_react.SearchConfigWithApiKey & {
426
432
  headlessId?: string;
427
433
  verticalKey?: string;
428
434
  }) | undefined;
429
435
  /**
430
436
  * Builds the search analytics config for the template. Returns undefined if the config is not valid.
431
437
  * @param document the entity document
438
+ * @param experienceKeyEnvVar can be provided via withPropOverrides for a hybrid developer
432
439
  */
433
- declare const createSearchAnalyticsConfig: (document: any) => {
440
+ declare const createSearchAnalyticsConfig: (document: any, experienceKeyEnvVar?: string) => {
434
441
  businessId: any;
435
442
  experienceKey: any;
436
443
  experienceVersion: string;
@@ -456,6 +463,13 @@ interface RootProps extends DefaultRootProps {
456
463
  }
457
464
  declare const migrate: (data: Data<DefaultComponentProps, RootProps>, migrationRegistry?: MigrationRegistry, config?: Config) => Data;
458
465
 
466
+ declare function withPropOverrides<P extends DefaultComponentProps>(base: ComponentConfig<P>, overrides: Partial<P>): ComponentConfig<P>;
467
+
468
+ declare const i18nComponentsInstance: i18next.i18n;
469
+
470
+ declare const i18nPlatformInstance: i18next.i18n;
471
+ declare const usePlatformTranslation: () => react_i18next.UseTranslationResponse<"visual-editor", undefined>;
472
+
459
473
  type HeroSectionType = {
460
474
  image?: ImageType;
461
475
  primaryCta?: CTA$1;
@@ -679,6 +693,10 @@ type YextFieldConfig<Props = any> = YextArrayField<Props extends Record<string,
679
693
  declare function YextField<T = any>(fieldName: string, config: YextFieldConfig<T>): Field<T>;
680
694
  declare function YextField<T extends Record<string, any>, U = any>(fieldName: string, config: YextEntitySelectorField<T>): Field<YextEntityField<U>>;
681
695
 
696
+ declare const KnowledgeGraphIcon: ({ enabled }: {
697
+ enabled: boolean;
698
+ }) => react_jsx_runtime.JSX.Element;
699
+
682
700
  declare const bodyVariants: (props?: ({
683
701
  variant?: "sm" | "lg" | "base" | null | undefined;
684
702
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
@@ -723,6 +741,11 @@ interface HeadingProps extends Omit<React$1.HTMLAttributes<HTMLHeadingElement>,
723
741
  }
724
742
  declare const Heading: React$1.ForwardRefExoticComponent<HeadingProps & React$1.RefAttributes<HTMLHeadingElement>>;
725
743
 
744
+ interface HoursTableAtomProps extends Omit<HoursTableProps$1, "dayOfWeekNames" | "intervalStringsBuilderFn"> {
745
+ className?: string;
746
+ }
747
+ declare const HoursTableAtom: (props: HoursTableAtomProps) => react_jsx_runtime.JSX.Element;
748
+
726
749
  interface ImageProps {
727
750
  image: ImageType | ComplexImageType;
728
751
  layout: "auto" | "fixed";
@@ -745,8 +768,9 @@ declare const MaybeLink: (props: MaybeLinkProps) => react_jsx_runtime.JSX.Elemen
745
768
 
746
769
  interface MaybeRTFProps extends Record<string, any> {
747
770
  data: RTF2 | string | undefined;
771
+ bodyVariant?: BodyProps["variant"];
748
772
  }
749
- declare const MaybeRTF: ({ data, ...props }: MaybeRTFProps) => react_jsx_runtime.JSX.Element | undefined;
773
+ declare const MaybeRTF: ({ data, bodyVariant, ...props }: MaybeRTFProps) => react_jsx_runtime.JSX.Element | undefined;
750
774
 
751
775
  declare const pageSectionVariants: (props?: ({
752
776
  verticalPadding?: "default" | "sm" | "footer" | "header" | null | undefined;
@@ -762,6 +786,7 @@ declare const PageSection: React$1.ForwardRefExoticComponent<PageSectionProps &
762
786
  type PhoneAtomProps = {
763
787
  phoneNumber: string;
764
788
  label?: string;
789
+ eventName?: string;
765
790
  backgroundColor?: BackgroundStyle;
766
791
  format: "domestic" | "international" | undefined;
767
792
  includeHyperlink: boolean;
@@ -786,6 +811,17 @@ declare const wrapperVariants: (props?: ({
786
811
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
787
812
  declare const VisibilityWrapper: React$1.FC<VisibilityWrapperProps>;
788
813
 
814
+ interface HoursStatusAtomProps {
815
+ hours: HoursType;
816
+ className?: string;
817
+ showCurrentStatus?: boolean;
818
+ showDayNames?: boolean;
819
+ timeFormat?: "12h" | "24h";
820
+ dayOfWeekFormat?: "short" | "long";
821
+ timezone?: string;
822
+ }
823
+ declare const HoursStatusAtom: ({ hours, className, showCurrentStatus, showDayNames, timeFormat, dayOfWeekFormat, timezone, }: HoursStatusAtomProps) => any;
824
+
789
825
  declare enum TimestampOption {
790
826
  DATE = "DATE",
791
827
  DATE_TIME = "DATE_TIME",
@@ -814,7 +850,9 @@ type BannerSectionProps = {
814
850
  declare const BannerSection: ComponentConfig<BannerSectionProps>;
815
851
 
816
852
  type BreadcrumbsSectionProps = {
817
- separator?: string;
853
+ analytics?: {
854
+ scope?: string;
855
+ };
818
856
  liveVisibility: boolean;
819
857
  };
820
858
  declare const BreadcrumbsSection: ComponentConfig<BreadcrumbsSectionProps>;
@@ -846,7 +884,7 @@ interface CoreInfoSectionProps {
846
884
  showGetDirectionsLink: boolean;
847
885
  phoneFormat: "domestic" | "international";
848
886
  includePhoneHyperlink: boolean;
849
- emailsListLength: number;
887
+ emailsListLength?: number;
850
888
  };
851
889
  hours: {
852
890
  startOfWeek: keyof DayOfWeekNames | "today";
@@ -854,6 +892,9 @@ interface CoreInfoSectionProps {
854
892
  showAdditionalHoursText: boolean;
855
893
  };
856
894
  };
895
+ analytics?: {
896
+ scope?: string;
897
+ };
857
898
  liveVisibility: boolean;
858
899
  }
859
900
  declare const CoreInfoSection: ComponentConfig<CoreInfoSectionProps>;
@@ -868,6 +909,9 @@ interface EventSectionProps {
868
909
  cardBackgroundColor?: BackgroundStyle;
869
910
  headingLevel: HeadingLevel;
870
911
  };
912
+ analytics?: {
913
+ scope?: string;
914
+ };
871
915
  liveVisibility: boolean;
872
916
  }
873
917
  declare const EventSection: ComponentConfig<EventSectionProps>;
@@ -887,6 +931,9 @@ interface HeroSectionProps {
887
931
  primaryCTA: CTAProps["variant"];
888
932
  secondaryCTA: CTAProps["variant"];
889
933
  };
934
+ analytics?: {
935
+ scope?: string;
936
+ };
890
937
  liveVisibility: boolean;
891
938
  }
892
939
  declare const HeroSection: ComponentConfig<HeroSectionProps>;
@@ -901,6 +948,9 @@ interface InsightSectionProps {
901
948
  cardBackgroundColor?: BackgroundStyle;
902
949
  headingLevel: HeadingLevel;
903
950
  };
951
+ analytics?: {
952
+ scope?: string;
953
+ };
904
954
  liveVisibility: boolean;
905
955
  }
906
956
  declare const InsightSection: ComponentConfig<InsightSectionProps>;
@@ -926,7 +976,11 @@ interface NearbyLocationsSectionProps {
926
976
  showDayNames?: boolean;
927
977
  };
928
978
  };
979
+ analytics?: {
980
+ scope?: string;
981
+ };
929
982
  liveVisibility: boolean;
983
+ contentEndpointIdEnvVar?: string;
930
984
  }
931
985
  declare const NearbyLocationsSection: ComponentConfig<NearbyLocationsSectionProps>;
932
986
 
@@ -940,6 +994,9 @@ interface ProductSectionProps {
940
994
  cardBackgroundColor?: BackgroundStyle;
941
995
  headingLevel: HeadingLevel;
942
996
  };
997
+ analytics?: {
998
+ scope?: string;
999
+ };
943
1000
  liveVisibility: boolean;
944
1001
  }
945
1002
  declare const ProductSection: ComponentConfig<ProductSectionProps>;
@@ -953,6 +1010,9 @@ interface PromoSectionProps {
953
1010
  orientation: "left" | "right";
954
1011
  ctaVariant: CTAProps["variant"];
955
1012
  };
1013
+ analytics?: {
1014
+ scope?: string;
1015
+ };
956
1016
  liveVisibility: boolean;
957
1017
  }
958
1018
  declare const PromoSection: ComponentConfig<PromoSectionProps>;
@@ -1008,6 +1068,9 @@ interface TeamSectionProps {
1008
1068
  heading: YextEntityField<string>;
1009
1069
  people: YextEntityField<TeamSectionType>;
1010
1070
  };
1071
+ analytics?: {
1072
+ scope?: string;
1073
+ };
1011
1074
  liveVisibility: boolean;
1012
1075
  }
1013
1076
  declare const TeamSection: ComponentConfig<TeamSectionProps>;
@@ -1067,7 +1130,7 @@ declare const CTAWrapper: ComponentConfig<CTAWrapperProps>;
1067
1130
 
1068
1131
  interface EmailsProps {
1069
1132
  list: YextEntityField<string[]>;
1070
- listLength: number;
1133
+ listLength?: number;
1071
1134
  includeHyperlink: boolean;
1072
1135
  }
1073
1136
  declare const Emails: ComponentConfig<EmailsProps>;
@@ -1129,21 +1192,31 @@ declare const TextList: ComponentConfig<TextListProps>;
1129
1192
 
1130
1193
  type HeaderProps = {
1131
1194
  logoWidth?: number;
1195
+ analytics?: {
1196
+ scope?: string;
1197
+ };
1132
1198
  };
1133
1199
  declare const Header: ComponentConfig<HeaderProps>;
1134
1200
 
1135
1201
  type FooterProps = {
1136
1202
  backgroundColor?: BackgroundStyle;
1203
+ analytics?: {
1204
+ scope?: string;
1205
+ };
1137
1206
  };
1138
1207
  declare const Footer: ComponentConfig<FooterProps>;
1139
1208
 
1140
1209
  interface DirectoryProps {
1141
- separator?: string;
1210
+ analytics?: {
1211
+ scope?: string;
1212
+ };
1142
1213
  }
1143
1214
  declare const Directory: ComponentConfig<DirectoryProps>;
1144
1215
 
1145
1216
  type LocatorProps = {
1146
1217
  mapStyle?: string;
1218
+ entityTypeEnvVar?: string;
1219
+ experienceKeyEnvVar?: string;
1147
1220
  };
1148
1221
  declare const LocatorComponent: ComponentConfig<LocatorProps>;
1149
1222
 
@@ -1358,4 +1431,4 @@ declare const migrationRegistry: MigrationRegistry;
1358
1431
 
1359
1432
  declare const defaultThemeConfig: ThemeConfig;
1360
1433
 
1361
- export { Address, type AddressProps, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BorderRadiusSelector, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, CardCategory, CardCategoryComponents, type CardCategoryProps, Collection, type CollectionProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventCard, type EventCardProps, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExampleRepeatableItemComponent, type ExampleRepeatableItemProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightCard, type InsightCardProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, 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, PersonCard, type PersonCardProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductCard, type ProductCardProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RTF2, type RenderYextEntityFieldSelectorProps, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialCard, type TestimonialCardProps, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, VisibilityWrapper, VisualEditorProvider, type YextCollection, YextCollectionSubfieldSelector, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchNearbyLocations, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, handleResolveFieldsForCollections, headingVariants, migrate, migrationRegistry, normalizeSlug, resolveYextEntityField, resolveYextStructField, resolveYextSubfield, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, useTailwindConfig, useTemplateProps, validateSlug };
1434
+ export { Address, type AddressProps, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BorderRadiusSelector, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, CardCategory, CardCategoryComponents, type CardCategoryProps, Collection, type CollectionProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventCard, type EventCardProps, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExampleRepeatableItemComponent, type ExampleRepeatableItemProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, 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, InsightCard, type InsightCardProps, 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, PersonCard, type PersonCardProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductCard, type ProductCardProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RTF2, type RenderYextEntityFieldSelectorProps, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialCard, type TestimonialCardProps, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, VisibilityWrapper, VisualEditorProvider, type YextCollection, YextCollectionSubfieldSelector, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchNearbyLocations, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, handleResolveFieldsForCollections, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, normalizeSlug, resolveYextEntityField, resolveYextStructField, resolveYextSubfield, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, usePlatformTranslation, useTailwindConfig, useTemplateProps, validateSlug, withPropOverrides };
package/dist/index.d.ts CHANGED
@@ -2,10 +2,12 @@ import * as React$1 from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as _measured_puck from '@measured/puck';
5
- import { Field, CustomField, Fields, Data, DefaultComponentProps, Config, DefaultRootProps, ArrayField, BaseField, NumberField, ObjectField, ComponentConfig } from '@measured/puck';
5
+ import { Field, CustomField, Fields, Data, DefaultComponentProps, Config, DefaultRootProps, ComponentConfig, ArrayField, BaseField, NumberField, ObjectField } from '@measured/puck';
6
6
  import { ClassValue } from 'clsx';
7
7
  import * as _yext_search_headless_react from '@yext/search-headless-react';
8
- import { ImageType, CTA as CTA$1, LinkType, ComplexImageType, AddressType, HoursType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
8
+ import * as i18next from 'i18next';
9
+ import * as react_i18next from 'react-i18next';
10
+ import { ImageType, CTA as CTA$1, LinkType, HoursTableProps as HoursTableProps$1, ComplexImageType, HoursType, AddressType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
9
11
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
10
12
  import { VariantProps } from 'class-variance-authority';
11
13
  import * as react_jsx_runtime_js from 'react/jsx-runtime.js';
@@ -353,11 +355,14 @@ declare function themeManagerCn(...inputs: ClassValue[]): string;
353
355
 
354
356
  type FontRegistry = Record<string, FontSpecification>;
355
357
  type FontSpecification = {
356
- minWeight: number;
357
- maxWeight: number;
358
358
  italics: boolean;
359
359
  fallback: "sans-serif" | "serif" | "monospace" | "cursive";
360
- };
360
+ } & ({
361
+ minWeight: number;
362
+ maxWeight: number;
363
+ } | {
364
+ weights: number[];
365
+ });
361
366
  declare const defaultFonts: FontRegistry;
362
367
  declare const constructFontSelectOptions: (fonts: FontRegistry) => StyleSelectOption[];
363
368
  type getFontWeightParams = {
@@ -378,7 +383,7 @@ type EditorProps$1 = {
378
383
  tailwindConfig: TailwindConfig;
379
384
  };
380
385
  type VisualEditorProviderProps<T> = UniversalProps<T> & AllOrNothing<EditorProps$1>;
381
- declare const VisualEditorProvider: <T>({ templateProps, entityFields, tailwindConfig, children, }: VisualEditorProviderProps<T>) => react_jsx_runtime.JSX.Element;
386
+ declare const VisualEditorProvider: <T extends Record<string, any>>({ templateProps, entityFields, tailwindConfig, children, }: VisualEditorProviderProps<T>) => react_jsx_runtime.JSX.Element;
382
387
 
383
388
  /**
384
389
  * Check that the string is a valid slug.
@@ -421,16 +426,18 @@ declare const fetchNearbyLocations: ({ businessId, apiKey, contentEndpointId, co
421
426
  /**
422
427
  * Builds the search headless config for the template. Returns undefined if the config is not valid.
423
428
  * @param document the entity document
429
+ * @param experienceKeyEnvVar can be provided via withPropOverrides for a hybrid developer
424
430
  */
425
- declare const createSearchHeadlessConfig: (document: any) => (_yext_search_headless_react.SearchConfigWithApiKey & {
431
+ declare const createSearchHeadlessConfig: (document: any, experienceKeyEnvVar?: string) => (_yext_search_headless_react.SearchConfigWithApiKey & {
426
432
  headlessId?: string;
427
433
  verticalKey?: string;
428
434
  }) | undefined;
429
435
  /**
430
436
  * Builds the search analytics config for the template. Returns undefined if the config is not valid.
431
437
  * @param document the entity document
438
+ * @param experienceKeyEnvVar can be provided via withPropOverrides for a hybrid developer
432
439
  */
433
- declare const createSearchAnalyticsConfig: (document: any) => {
440
+ declare const createSearchAnalyticsConfig: (document: any, experienceKeyEnvVar?: string) => {
434
441
  businessId: any;
435
442
  experienceKey: any;
436
443
  experienceVersion: string;
@@ -456,6 +463,13 @@ interface RootProps extends DefaultRootProps {
456
463
  }
457
464
  declare const migrate: (data: Data<DefaultComponentProps, RootProps>, migrationRegistry?: MigrationRegistry, config?: Config) => Data;
458
465
 
466
+ declare function withPropOverrides<P extends DefaultComponentProps>(base: ComponentConfig<P>, overrides: Partial<P>): ComponentConfig<P>;
467
+
468
+ declare const i18nComponentsInstance: i18next.i18n;
469
+
470
+ declare const i18nPlatformInstance: i18next.i18n;
471
+ declare const usePlatformTranslation: () => react_i18next.UseTranslationResponse<"visual-editor", undefined>;
472
+
459
473
  type HeroSectionType = {
460
474
  image?: ImageType;
461
475
  primaryCta?: CTA$1;
@@ -679,6 +693,10 @@ type YextFieldConfig<Props = any> = YextArrayField<Props extends Record<string,
679
693
  declare function YextField<T = any>(fieldName: string, config: YextFieldConfig<T>): Field<T>;
680
694
  declare function YextField<T extends Record<string, any>, U = any>(fieldName: string, config: YextEntitySelectorField<T>): Field<YextEntityField<U>>;
681
695
 
696
+ declare const KnowledgeGraphIcon: ({ enabled }: {
697
+ enabled: boolean;
698
+ }) => react_jsx_runtime.JSX.Element;
699
+
682
700
  declare const bodyVariants: (props?: ({
683
701
  variant?: "sm" | "lg" | "base" | null | undefined;
684
702
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
@@ -723,6 +741,11 @@ interface HeadingProps extends Omit<React$1.HTMLAttributes<HTMLHeadingElement>,
723
741
  }
724
742
  declare const Heading: React$1.ForwardRefExoticComponent<HeadingProps & React$1.RefAttributes<HTMLHeadingElement>>;
725
743
 
744
+ interface HoursTableAtomProps extends Omit<HoursTableProps$1, "dayOfWeekNames" | "intervalStringsBuilderFn"> {
745
+ className?: string;
746
+ }
747
+ declare const HoursTableAtom: (props: HoursTableAtomProps) => react_jsx_runtime.JSX.Element;
748
+
726
749
  interface ImageProps {
727
750
  image: ImageType | ComplexImageType;
728
751
  layout: "auto" | "fixed";
@@ -745,8 +768,9 @@ declare const MaybeLink: (props: MaybeLinkProps) => react_jsx_runtime.JSX.Elemen
745
768
 
746
769
  interface MaybeRTFProps extends Record<string, any> {
747
770
  data: RTF2 | string | undefined;
771
+ bodyVariant?: BodyProps["variant"];
748
772
  }
749
- declare const MaybeRTF: ({ data, ...props }: MaybeRTFProps) => react_jsx_runtime.JSX.Element | undefined;
773
+ declare const MaybeRTF: ({ data, bodyVariant, ...props }: MaybeRTFProps) => react_jsx_runtime.JSX.Element | undefined;
750
774
 
751
775
  declare const pageSectionVariants: (props?: ({
752
776
  verticalPadding?: "default" | "sm" | "footer" | "header" | null | undefined;
@@ -762,6 +786,7 @@ declare const PageSection: React$1.ForwardRefExoticComponent<PageSectionProps &
762
786
  type PhoneAtomProps = {
763
787
  phoneNumber: string;
764
788
  label?: string;
789
+ eventName?: string;
765
790
  backgroundColor?: BackgroundStyle;
766
791
  format: "domestic" | "international" | undefined;
767
792
  includeHyperlink: boolean;
@@ -786,6 +811,17 @@ declare const wrapperVariants: (props?: ({
786
811
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
787
812
  declare const VisibilityWrapper: React$1.FC<VisibilityWrapperProps>;
788
813
 
814
+ interface HoursStatusAtomProps {
815
+ hours: HoursType;
816
+ className?: string;
817
+ showCurrentStatus?: boolean;
818
+ showDayNames?: boolean;
819
+ timeFormat?: "12h" | "24h";
820
+ dayOfWeekFormat?: "short" | "long";
821
+ timezone?: string;
822
+ }
823
+ declare const HoursStatusAtom: ({ hours, className, showCurrentStatus, showDayNames, timeFormat, dayOfWeekFormat, timezone, }: HoursStatusAtomProps) => any;
824
+
789
825
  declare enum TimestampOption {
790
826
  DATE = "DATE",
791
827
  DATE_TIME = "DATE_TIME",
@@ -814,7 +850,9 @@ type BannerSectionProps = {
814
850
  declare const BannerSection: ComponentConfig<BannerSectionProps>;
815
851
 
816
852
  type BreadcrumbsSectionProps = {
817
- separator?: string;
853
+ analytics?: {
854
+ scope?: string;
855
+ };
818
856
  liveVisibility: boolean;
819
857
  };
820
858
  declare const BreadcrumbsSection: ComponentConfig<BreadcrumbsSectionProps>;
@@ -846,7 +884,7 @@ interface CoreInfoSectionProps {
846
884
  showGetDirectionsLink: boolean;
847
885
  phoneFormat: "domestic" | "international";
848
886
  includePhoneHyperlink: boolean;
849
- emailsListLength: number;
887
+ emailsListLength?: number;
850
888
  };
851
889
  hours: {
852
890
  startOfWeek: keyof DayOfWeekNames | "today";
@@ -854,6 +892,9 @@ interface CoreInfoSectionProps {
854
892
  showAdditionalHoursText: boolean;
855
893
  };
856
894
  };
895
+ analytics?: {
896
+ scope?: string;
897
+ };
857
898
  liveVisibility: boolean;
858
899
  }
859
900
  declare const CoreInfoSection: ComponentConfig<CoreInfoSectionProps>;
@@ -868,6 +909,9 @@ interface EventSectionProps {
868
909
  cardBackgroundColor?: BackgroundStyle;
869
910
  headingLevel: HeadingLevel;
870
911
  };
912
+ analytics?: {
913
+ scope?: string;
914
+ };
871
915
  liveVisibility: boolean;
872
916
  }
873
917
  declare const EventSection: ComponentConfig<EventSectionProps>;
@@ -887,6 +931,9 @@ interface HeroSectionProps {
887
931
  primaryCTA: CTAProps["variant"];
888
932
  secondaryCTA: CTAProps["variant"];
889
933
  };
934
+ analytics?: {
935
+ scope?: string;
936
+ };
890
937
  liveVisibility: boolean;
891
938
  }
892
939
  declare const HeroSection: ComponentConfig<HeroSectionProps>;
@@ -901,6 +948,9 @@ interface InsightSectionProps {
901
948
  cardBackgroundColor?: BackgroundStyle;
902
949
  headingLevel: HeadingLevel;
903
950
  };
951
+ analytics?: {
952
+ scope?: string;
953
+ };
904
954
  liveVisibility: boolean;
905
955
  }
906
956
  declare const InsightSection: ComponentConfig<InsightSectionProps>;
@@ -926,7 +976,11 @@ interface NearbyLocationsSectionProps {
926
976
  showDayNames?: boolean;
927
977
  };
928
978
  };
979
+ analytics?: {
980
+ scope?: string;
981
+ };
929
982
  liveVisibility: boolean;
983
+ contentEndpointIdEnvVar?: string;
930
984
  }
931
985
  declare const NearbyLocationsSection: ComponentConfig<NearbyLocationsSectionProps>;
932
986
 
@@ -940,6 +994,9 @@ interface ProductSectionProps {
940
994
  cardBackgroundColor?: BackgroundStyle;
941
995
  headingLevel: HeadingLevel;
942
996
  };
997
+ analytics?: {
998
+ scope?: string;
999
+ };
943
1000
  liveVisibility: boolean;
944
1001
  }
945
1002
  declare const ProductSection: ComponentConfig<ProductSectionProps>;
@@ -953,6 +1010,9 @@ interface PromoSectionProps {
953
1010
  orientation: "left" | "right";
954
1011
  ctaVariant: CTAProps["variant"];
955
1012
  };
1013
+ analytics?: {
1014
+ scope?: string;
1015
+ };
956
1016
  liveVisibility: boolean;
957
1017
  }
958
1018
  declare const PromoSection: ComponentConfig<PromoSectionProps>;
@@ -1008,6 +1068,9 @@ interface TeamSectionProps {
1008
1068
  heading: YextEntityField<string>;
1009
1069
  people: YextEntityField<TeamSectionType>;
1010
1070
  };
1071
+ analytics?: {
1072
+ scope?: string;
1073
+ };
1011
1074
  liveVisibility: boolean;
1012
1075
  }
1013
1076
  declare const TeamSection: ComponentConfig<TeamSectionProps>;
@@ -1067,7 +1130,7 @@ declare const CTAWrapper: ComponentConfig<CTAWrapperProps>;
1067
1130
 
1068
1131
  interface EmailsProps {
1069
1132
  list: YextEntityField<string[]>;
1070
- listLength: number;
1133
+ listLength?: number;
1071
1134
  includeHyperlink: boolean;
1072
1135
  }
1073
1136
  declare const Emails: ComponentConfig<EmailsProps>;
@@ -1129,21 +1192,31 @@ declare const TextList: ComponentConfig<TextListProps>;
1129
1192
 
1130
1193
  type HeaderProps = {
1131
1194
  logoWidth?: number;
1195
+ analytics?: {
1196
+ scope?: string;
1197
+ };
1132
1198
  };
1133
1199
  declare const Header: ComponentConfig<HeaderProps>;
1134
1200
 
1135
1201
  type FooterProps = {
1136
1202
  backgroundColor?: BackgroundStyle;
1203
+ analytics?: {
1204
+ scope?: string;
1205
+ };
1137
1206
  };
1138
1207
  declare const Footer: ComponentConfig<FooterProps>;
1139
1208
 
1140
1209
  interface DirectoryProps {
1141
- separator?: string;
1210
+ analytics?: {
1211
+ scope?: string;
1212
+ };
1142
1213
  }
1143
1214
  declare const Directory: ComponentConfig<DirectoryProps>;
1144
1215
 
1145
1216
  type LocatorProps = {
1146
1217
  mapStyle?: string;
1218
+ entityTypeEnvVar?: string;
1219
+ experienceKeyEnvVar?: string;
1147
1220
  };
1148
1221
  declare const LocatorComponent: ComponentConfig<LocatorProps>;
1149
1222
 
@@ -1358,4 +1431,4 @@ declare const migrationRegistry: MigrationRegistry;
1358
1431
 
1359
1432
  declare const defaultThemeConfig: ThemeConfig;
1360
1433
 
1361
- export { Address, type AddressProps, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BorderRadiusSelector, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, CardCategory, CardCategoryComponents, type CardCategoryProps, Collection, type CollectionProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventCard, type EventCardProps, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExampleRepeatableItemComponent, type ExampleRepeatableItemProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, GetDirections, type GetDirectionsProps, Grid, type GridProps, Header, type HeaderProps, Heading, type HeadingLevel, type HeadingProps, HeadingText, type HeadingTextProps, HeroSection, type HeroSectionProps, type HeroSectionType, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightCard, type InsightCardProps, InsightSection, type InsightSectionProps, type InsightSectionType, type InsightStruct, 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, PersonCard, type PersonCardProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductCard, type ProductCardProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RTF2, type RenderYextEntityFieldSelectorProps, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialCard, type TestimonialCardProps, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, VisibilityWrapper, VisualEditorProvider, type YextCollection, YextCollectionSubfieldSelector, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchNearbyLocations, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, handleResolveFieldsForCollections, headingVariants, migrate, migrationRegistry, normalizeSlug, resolveYextEntityField, resolveYextStructField, resolveYextSubfield, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, useTailwindConfig, useTemplateProps, validateSlug };
1434
+ export { Address, type AddressProps, Background, type BackgroundProps, BackgroundProvider, type BackgroundStyle, BannerSection, type BannerSectionProps, BasicSelector, Body, type BodyProps, BodyText, type BodyTextProps, BorderRadiusSelector, BreadcrumbsSection, type BreadcrumbsSectionProps, Button, type ButtonProps, CTA, type CTAProps, CTAWrapper, type CTAWrapperProps, CardCategory, CardCategoryComponents, type CardCategoryProps, Collection, type CollectionProps, type ComponentField, ComponentFields, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventCard, type EventCardProps, EventSection, type EventSectionProps, type EventSectionType, type EventStruct, ExampleRepeatableItemComponent, type ExampleRepeatableItemProps, FAQSection, type FAQSectionProps, type FAQSectionType, type FAQStruct, Flex, type FlexProps, type FontRegistry, FontSizeSelector, Footer, type FooterProps, 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, InsightCard, type InsightCardProps, 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, PersonCard, type PersonCardProps, type PersonStruct, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductCard, type ProductCardProps, ProductSection, type ProductSectionProps, type ProductSectionType, type ProductStruct, PromoSection, type PromoSectionProps, type PromoSectionType, type RTF2, type RenderYextEntityFieldSelectorProps, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TeamSection, type TeamSectionProps, type TeamSectionType, TemplatePropsContext, TestimonialCard, type TestimonialCardProps, TestimonialSection, type TestimonialSectionProps, type TestimonialSectionType, type TestimonialStruct, TextList, type TextListProps, type ThemeConfig, ThemeOptions, Timestamp, TimestampOption, type TimestampProps, VisibilityWrapper, VisualEditorProvider, type YextCollection, YextCollectionSubfieldSelector, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, type YextStructEntityField, YextStructFieldSelector, applyAnalytics, applyHeaderScript, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, createSearchAnalyticsConfig, createSearchHeadlessConfig, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchNearbyLocations, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, handleResolveFieldsForCollections, headingVariants, i18nComponentsInstance, i18nPlatformInstance, migrate, migrationRegistry, normalizeSlug, resolveYextEntityField, resolveYextStructField, resolveYextSubfield, 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-BBlk-mUB.cjs");function N(){return n.sa().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.ft.jsx(w,{}),document.body))}const k=(t,a)=>{const s=t.dataset.yaAction,e=t.dataset.yaScopeoverride,i=t.dataset.yaEventname,c=e||a;return{action:s,originalEventName:c?`${c}_${i}`:i,scope:c}},S=(t,a)=>{const s=[];let e=t;for(;e!=null&&e.parentElement;)e=e.parentElement.closest(a),e&&s.push(e);return s},m={},j="YA_NO_SCOPE",y=(t,a,s,e)=>{m.hasOwnProperty(t)?m[t].events.map(i=>i.el).includes(e)||(m[t].events=[...m[t].events,{eventData:a,el:e}]):m[t]={scopeEl:s||e,events:[{eventData:a,el:e}]}};function w(){const[t,a]=n.reactExports.useState(),[s,e]=n.reactExports.useState([]),[i,c]=n.reactExports.useState(!1),l=o=>{a(t===o?void 0:o)};return n.reactExports.useEffect(()=>(document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((o,g)=>{const d=o.closest("[data-ya-scope]"),r=d?.dataset.yaScope,u=k(o,r);o.addEventListener("mouseenter",()=>{e([{elem:o,key:`${u.originalEventName}_${g}`,action:u.action,originalEventName:u.originalEventName,scope:u.scope}])}),o.addEventListener("mouseleave",()=>{e([])});const f=o.dataset.yaScopeoverride;f?y(f,u,d,o):[r,...S(o,"[data-ya-scope]").map(p=>p.dataset.yaScope)].forEach(p=>{y(p||j,u,d,o)})}),c(!0),()=>{document.documentElement.classList.remove("xYextDebug")}),[]),i?n.ft.jsxs(n.ft.Fragment,{children:[n.ft.jsxs("div",{className:"analytics-debugger",children:[n.ft.jsxs("div",{className:"analytics-debugger-toggles",children:[n.ft.jsx("button",{className:n.oa("analytics-debugger-toggle",{"is-active":t==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.ft.jsx("button",{className:n.oa("analytics-debugger-toggle",{"is-active":t==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),t&&n.ft.jsx("div",{className:"analytics-debugger-tabs",children:t==="Events"?n.ft.jsx(C,{data:m,setTooltips:e}):n.ft.jsx(D,{data:m,setTooltips:e})})]}),n.ft.jsx($,{tooltips:s})]}):null}const Y=()=>{const t={};return Object.values(m).forEach(a=>{a.events.forEach(s=>{const{originalEventName:e}=s.eventData;t[e]||(t[e]=[]),!t[e].find(i=>i.el===s.el)&&t[e].push(s)})}),t};function C(t){const{setTooltips:a}=t,[s,e]=n.reactExports.useState([]),[i,c]=n.reactExports.useState(""),l=(o,g)=>{s.forEach(r=>r.classList.remove("analytics-event-highlight"));const d=o.map(r=>(r.el.scrollIntoView({behavior:"smooth",block:"nearest"}),r.el.classList.add("analytics-event-highlight"),r.el));e(d),c(g),a(o.map((r,u)=>({elem:r.el,key:`${r.eventData.originalEventName}_${u}`,action:r.eventData.action,originalEventName:r.eventData.originalEventName,scope:r.eventData.scope})))};return n.ft.jsxs("div",{className:"analytics-debugger-tab",children:[n.ft.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.ft.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([o,g],d)=>{const r=`${o}_${d}`;return n.ft.jsx("li",{className:"analytics-debugger-listItem",children:n.ft.jsx("button",{className:n.oa("analytics-debugger-button",{"is-active":r===i}),onClick:()=>l(g,r),children:o})},r)})})]})}function D(t){const{data:a,setTooltips:s}=t,[e,i]=n.reactExports.useState(""),c=l=>{const o=a[l];o.scopeEl&&(o.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),i(l),s(o.events.map((g,d)=>{const r=g.eventData;return{elem:g.el,key:`${r.originalEventName}_${d}`,action:r.action,originalEventName:r.originalEventName,scope:r.scope}})))};return n.ft.jsxs("div",{className:"analytics-debugger-tab",children:[n.ft.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.ft.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,o)=>{if(l!==j)return n.ft.jsx("li",{className:"analytics-debugger-listItem",children:n.ft.jsx("button",{className:n.oa("analytics-debugger-button",{"is-active":l===e}),onClick:()=>c(l),children:l})},l+o)})})]})}function $(t){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const e=Object.values(a.current).map(i=>i.el).filter(i=>i!==s.el);O(s,e),s.el.style.visibility="visible"}},[t.tooltips]),n.ft.jsx(n.ft.Fragment,{children:t.tooltips.map(s=>n.ft.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:e=>{e?a.current[s.key]={el:e,tooltip:s}:delete a.current[s.key]},children:[n.ft.jsxs("span",{children:["Action: ",s.action]}),n.ft.jsx("br",{}),n.ft.jsxs("span",{children:["Scope: ",s.scope]}),n.ft.jsx("br",{}),n.ft.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(t,a){for(let s=0;s<9;s++){const e=I(t.tooltip.elem.getBoundingClientRect(),t.el,s);if(t.el.style.inset=`${e.top} auto auto ${e.left}`,!!B(t.el.getBoundingClientRect().left,t.el.getBoundingClientRect().top+window.scrollY,t.el.getBoundingClientRect().right,t.el.getBoundingClientRect().bottom+window.scrollY))continue;let i=!0;for(let c=0;c<a.length;c++){const l=a[c];R(t.el,l)&&(i=!1)}if(i)break}}function R(t,a){const s=t.getBoundingClientRect().top+window.scrollY,e=t.getBoundingClientRect().left,i=s+t.clientHeight,c=e+t.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,o=a.getBoundingClientRect().left,g=l+a.clientHeight,d=o+a.clientWidth,r=(u,f,p,b,v,h,x,E)=>p<=v&&v<=x&&b<=h&&h<=E||p<=u&&u<=x&&b<=f&&f<=E||p<=u&&u<=x&&b<=h&&h<=E||p<=v&&v<=x&&b<=f&&f<=E;return r(e,s,o,l,c,i,d,g)||r(o,l,e,s,d,g,c,i)}function B(t,a,s,e){return t<0||s>window.innerWidth||a<0||e>document.documentElement.scrollHeight}function I(t,a,s){const e=a.clientHeight,i=a.clientWidth;let c,l;switch(s){case 0:{l=window.scrollY+t.top-e+"px",c=t.left-i+"px";break}case 1:{l=window.scrollY+t.top-e+"px",c=t.left+"px";break}case 2:{l=window.scrollY+t.top-e+"px",c=t.right+"px";break}case 3:{l=window.scrollY+t.top-e+"px",c=t.right-i+"px";break}case 4:{l=window.scrollY+t.bottom+"px",c=t.left-i+"px";break}case 5:{l=window.scrollY+t.bottom+"px",c=t.left+"px";break}case 6:{l=window.scrollY+t.bottom+"px",c=t.right-i+"px";break}case 7:{l=window.scrollY+t.bottom+"px",c=t.right+"px";break}default:l=0,c=0}return{top:l,left:c}}exports.AnalyticsDebuggerInternal=w;exports.default=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-DEZOlM5o.cjs");function N(){return n.sa().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.ft.jsx(w,{}),document.body))}const k=(t,a)=>{const s=t.dataset.yaAction,e=t.dataset.yaScopeoverride,i=t.dataset.yaEventname,c=e||a;return{action:s,originalEventName:c?`${c}_${i}`:i,scope:c}},S=(t,a)=>{const s=[];let e=t;for(;e!=null&&e.parentElement;)e=e.parentElement.closest(a),e&&s.push(e);return s},m={},j="YA_NO_SCOPE",y=(t,a,s,e)=>{m.hasOwnProperty(t)?m[t].events.map(i=>i.el).includes(e)||(m[t].events=[...m[t].events,{eventData:a,el:e}]):m[t]={scopeEl:s||e,events:[{eventData:a,el:e}]}};function w(){const[t,a]=n.reactExports.useState(),[s,e]=n.reactExports.useState([]),[i,c]=n.reactExports.useState(!1),l=o=>{a(t===o?void 0:o)};return n.reactExports.useEffect(()=>(document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((o,g)=>{const d=o.closest("[data-ya-scope]"),r=d?.dataset.yaScope,u=k(o,r);o.addEventListener("mouseenter",()=>{e([{elem:o,key:`${u.originalEventName}_${g}`,action:u.action,originalEventName:u.originalEventName,scope:u.scope}])}),o.addEventListener("mouseleave",()=>{e([])});const f=o.dataset.yaScopeoverride;f?y(f,u,d,o):[r,...S(o,"[data-ya-scope]").map(p=>p.dataset.yaScope)].forEach(p=>{y(p||j,u,d,o)})}),c(!0),()=>{document.documentElement.classList.remove("xYextDebug")}),[]),i?n.ft.jsxs(n.ft.Fragment,{children:[n.ft.jsxs("div",{className:"analytics-debugger",children:[n.ft.jsxs("div",{className:"analytics-debugger-toggles",children:[n.ft.jsx("button",{className:n.oa("analytics-debugger-toggle",{"is-active":t==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.ft.jsx("button",{className:n.oa("analytics-debugger-toggle",{"is-active":t==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),t&&n.ft.jsx("div",{className:"analytics-debugger-tabs",children:t==="Events"?n.ft.jsx(C,{data:m,setTooltips:e}):n.ft.jsx(D,{data:m,setTooltips:e})})]}),n.ft.jsx($,{tooltips:s})]}):null}const Y=()=>{const t={};return Object.values(m).forEach(a=>{a.events.forEach(s=>{const{originalEventName:e}=s.eventData;t[e]||(t[e]=[]),!t[e].find(i=>i.el===s.el)&&t[e].push(s)})}),t};function C(t){const{setTooltips:a}=t,[s,e]=n.reactExports.useState([]),[i,c]=n.reactExports.useState(""),l=(o,g)=>{s.forEach(r=>r.classList.remove("analytics-event-highlight"));const d=o.map(r=>(r.el.scrollIntoView({behavior:"smooth",block:"nearest"}),r.el.classList.add("analytics-event-highlight"),r.el));e(d),c(g),a(o.map((r,u)=>({elem:r.el,key:`${r.eventData.originalEventName}_${u}`,action:r.eventData.action,originalEventName:r.eventData.originalEventName,scope:r.eventData.scope})))};return n.ft.jsxs("div",{className:"analytics-debugger-tab",children:[n.ft.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.ft.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([o,g],d)=>{const r=`${o}_${d}`;return n.ft.jsx("li",{className:"analytics-debugger-listItem",children:n.ft.jsx("button",{className:n.oa("analytics-debugger-button",{"is-active":r===i}),onClick:()=>l(g,r),children:o})},r)})})]})}function D(t){const{data:a,setTooltips:s}=t,[e,i]=n.reactExports.useState(""),c=l=>{const o=a[l];o.scopeEl&&(o.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),i(l),s(o.events.map((g,d)=>{const r=g.eventData;return{elem:g.el,key:`${r.originalEventName}_${d}`,action:r.action,originalEventName:r.originalEventName,scope:r.scope}})))};return n.ft.jsxs("div",{className:"analytics-debugger-tab",children:[n.ft.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.ft.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,o)=>{if(l!==j)return n.ft.jsx("li",{className:"analytics-debugger-listItem",children:n.ft.jsx("button",{className:n.oa("analytics-debugger-button",{"is-active":l===e}),onClick:()=>c(l),children:l})},l+o)})})]})}function $(t){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const e=Object.values(a.current).map(i=>i.el).filter(i=>i!==s.el);O(s,e),s.el.style.visibility="visible"}},[t.tooltips]),n.ft.jsx(n.ft.Fragment,{children:t.tooltips.map(s=>n.ft.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:e=>{e?a.current[s.key]={el:e,tooltip:s}:delete a.current[s.key]},children:[n.ft.jsxs("span",{children:["Action: ",s.action]}),n.ft.jsx("br",{}),n.ft.jsxs("span",{children:["Scope: ",s.scope]}),n.ft.jsx("br",{}),n.ft.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(t,a){for(let s=0;s<9;s++){const e=I(t.tooltip.elem.getBoundingClientRect(),t.el,s);if(t.el.style.inset=`${e.top} auto auto ${e.left}`,!!B(t.el.getBoundingClientRect().left,t.el.getBoundingClientRect().top+window.scrollY,t.el.getBoundingClientRect().right,t.el.getBoundingClientRect().bottom+window.scrollY))continue;let i=!0;for(let c=0;c<a.length;c++){const l=a[c];R(t.el,l)&&(i=!1)}if(i)break}}function R(t,a){const s=t.getBoundingClientRect().top+window.scrollY,e=t.getBoundingClientRect().left,i=s+t.clientHeight,c=e+t.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,o=a.getBoundingClientRect().left,g=l+a.clientHeight,d=o+a.clientWidth,r=(u,f,p,b,v,h,x,E)=>p<=v&&v<=x&&b<=h&&h<=E||p<=u&&u<=x&&b<=f&&f<=E||p<=u&&u<=x&&b<=h&&h<=E||p<=v&&v<=x&&b<=f&&f<=E;return r(e,s,o,l,c,i,d,g)||r(o,l,e,s,d,g,c,i)}function B(t,a,s,e){return t<0||s>window.innerWidth||a<0||e>document.documentElement.scrollHeight}function I(t,a,s){const e=a.clientHeight,i=a.clientWidth;let c,l;switch(s){case 0:{l=window.scrollY+t.top-e+"px",c=t.left-i+"px";break}case 1:{l=window.scrollY+t.top-e+"px",c=t.left+"px";break}case 2:{l=window.scrollY+t.top-e+"px",c=t.right+"px";break}case 3:{l=window.scrollY+t.top-e+"px",c=t.right-i+"px";break}case 4:{l=window.scrollY+t.bottom+"px",c=t.left-i+"px";break}case 5:{l=window.scrollY+t.bottom+"px",c=t.left+"px";break}case 6:{l=window.scrollY+t.bottom+"px",c=t.right-i+"px";break}case 7:{l=window.scrollY+t.bottom+"px",c=t.right+"px";break}default:l=0,c=0}return{top:l,left:c}}exports.AnalyticsDebuggerInternal=w;exports.default=N;
@@ -1,4 +1,4 @@
1
- import { s as k, r as S, f as l, a as p, o as w } from "./index-C2zkTc1a.js";
1
+ import { s as k, r as S, f as l, a as p, o as w } from "./index-BZpbAcAA.js";
2
2
  function T() {
3
3
  return k().name !== "browser" || window.hasOwnProperty("debuggerInitialized") ? null : (window.debuggerInitialized = !0, S.createPortal(/* @__PURE__ */ l.jsx(D, {}), document.body));
4
4
  }