@yext/visual-editor 0.0.34 → 0.0.36
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 +193 -103
- package/dist/index.d.ts +193 -103
- package/dist/plugin/plugin.cjs +2 -11
- package/dist/plugin/plugin.js +10 -19
- package/dist/style.css +1 -1
- package/dist/visual-editor.cjs +62 -62
- package/dist/visual-editor.js +12838 -11952
- package/package.json +23 -9
package/dist/index.d.ts
CHANGED
|
@@ -2,18 +2,18 @@ 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, Fields, Config, CustomField, ComponentConfig } from '@measured/puck';
|
|
5
|
+
import { Field, Fields, Config, CustomField, ArrayField, BaseField, NumberField, ObjectField, ComponentConfig } from '@measured/puck';
|
|
6
6
|
import { ClassValue } from 'clsx';
|
|
7
7
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
8
8
|
import { VariantProps } from 'class-variance-authority';
|
|
9
9
|
import * as react_jsx_runtime_js from 'react/jsx-runtime.js';
|
|
10
|
-
import { LinkType, ImageType, AddressType, HoursType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
|
|
11
|
-
import * as class_variance_authority_dist_types_js from 'class-variance-authority/dist/types.js';
|
|
10
|
+
import { LinkType, ImageType, ComplexImageType, AddressType, HoursType, DayOfWeekNames, Coordinate } from '@yext/pages-components';
|
|
12
11
|
|
|
13
12
|
declare const usePlatformBridgeDocument: () => any;
|
|
14
13
|
|
|
15
14
|
type YextSchemaField = {
|
|
16
15
|
name: string;
|
|
16
|
+
displayName?: string;
|
|
17
17
|
definition: YextFieldDefinition;
|
|
18
18
|
children?: {
|
|
19
19
|
fields: YextSchemaField[];
|
|
@@ -27,13 +27,17 @@ type YextFieldDefinition = {
|
|
|
27
27
|
typeRegistryId?: string;
|
|
28
28
|
type: Record<string, string>;
|
|
29
29
|
};
|
|
30
|
+
type StreamFields = {
|
|
31
|
+
fields: YextSchemaField[];
|
|
32
|
+
displayNames?: Record<string, string>;
|
|
33
|
+
};
|
|
30
34
|
|
|
31
35
|
/**
|
|
32
36
|
* Under the hood we receive a Stream for a template, but we expose
|
|
33
37
|
* hooks with a more user-friendly name.
|
|
34
38
|
*/
|
|
35
|
-
declare const usePlatformBridgeEntityFields: () =>
|
|
36
|
-
declare const useEntityFields: () =>
|
|
39
|
+
declare const usePlatformBridgeEntityFields: () => StreamFields | null;
|
|
40
|
+
declare const useEntityFields: () => StreamFields | null;
|
|
37
41
|
|
|
38
42
|
declare const TemplatePropsContext: React$1.Context<any>;
|
|
39
43
|
declare const useTemplateProps: <T>() => T;
|
|
@@ -248,6 +252,7 @@ type RenderYextEntityFieldSelectorProps<T extends Record<string, any>> = {
|
|
|
248
252
|
label: string;
|
|
249
253
|
filter: RenderEntityFieldFilter<T>;
|
|
250
254
|
isCollection?: boolean;
|
|
255
|
+
disableConstantValueToggle?: boolean;
|
|
251
256
|
};
|
|
252
257
|
/**
|
|
253
258
|
* Allows the user to select an entity field from the document and set a constant value.
|
|
@@ -349,7 +354,7 @@ type UniversalProps<T> = {
|
|
|
349
354
|
children: React__default.ReactNode;
|
|
350
355
|
};
|
|
351
356
|
type EditorProps$1 = {
|
|
352
|
-
entityFields:
|
|
357
|
+
entityFields: StreamFields | null;
|
|
353
358
|
tailwindConfig: TailwindConfig;
|
|
354
359
|
};
|
|
355
360
|
type VisualEditorProviderProps<T> = UniversalProps<T> & AllOrNothing<EditorProps$1>;
|
|
@@ -427,6 +432,52 @@ type Option<T = any> = {
|
|
|
427
432
|
};
|
|
428
433
|
declare const BasicSelector: (label: string, options: Option[]) => Field;
|
|
429
434
|
|
|
435
|
+
/** Copied from Puck, do not change */
|
|
436
|
+
type FieldOption = {
|
|
437
|
+
label: string;
|
|
438
|
+
value: string | number | boolean;
|
|
439
|
+
};
|
|
440
|
+
/** Copied from Puck, do not change */
|
|
441
|
+
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
|
442
|
+
type radioOptions = "PHONE_OPTIONS" | "ALIGNMENT" | "BODY_VARIANT" | "JUSTIFY_CONTENT" | "CTA_VARIANT";
|
|
443
|
+
type selectOptions = keyof Omit<typeof ThemeOptions, radioOptions>;
|
|
444
|
+
type YextBaseField = {
|
|
445
|
+
type: string;
|
|
446
|
+
};
|
|
447
|
+
type YextArrayField<Props extends {
|
|
448
|
+
[key: string]: any;
|
|
449
|
+
} = {
|
|
450
|
+
[key: string]: any;
|
|
451
|
+
}> = YextBaseField & Omit<ArrayField<Props>, keyof BaseField>;
|
|
452
|
+
type YextNumberField = YextBaseField & Omit<NumberField, keyof BaseField>;
|
|
453
|
+
type YextObjectField<Props extends {
|
|
454
|
+
[key: string]: any;
|
|
455
|
+
} = {
|
|
456
|
+
[key: string]: any;
|
|
457
|
+
}> = YextBaseField & Omit<ObjectField<Props>, keyof BaseField>;
|
|
458
|
+
type YextRadioField = YextBaseField & {
|
|
459
|
+
type: "radio";
|
|
460
|
+
options: FieldOptions | radioOptions;
|
|
461
|
+
};
|
|
462
|
+
type YextSelectField = YextBaseField & {
|
|
463
|
+
type: "select";
|
|
464
|
+
hasSearch?: boolean;
|
|
465
|
+
options: FieldOptions | selectOptions;
|
|
466
|
+
};
|
|
467
|
+
type YextTextField = YextBaseField & {
|
|
468
|
+
type: "text";
|
|
469
|
+
isMultiline?: boolean;
|
|
470
|
+
};
|
|
471
|
+
type YextOptionalNumberField = YextBaseField & Omit<OptionalNumberFieldProps, "fieldLabel"> & {
|
|
472
|
+
type: "optionalNumber";
|
|
473
|
+
};
|
|
474
|
+
type YextEntitySelectorField<T extends Record<string, any> = Record<string, any>> = YextBaseField & Omit<RenderYextEntityFieldSelectorProps<T>, "label"> & {
|
|
475
|
+
type: "entityField";
|
|
476
|
+
};
|
|
477
|
+
type YextFieldConfig<Props = any> = YextArrayField<Props extends Record<string, any> ? Props : any> | YextObjectField<Props extends Record<string, any> ? Props : any> | YextNumberField | YextTextField | YextEntitySelectorField<Props extends Record<string, any> ? Props : any> | YextSelectField | YextRadioField | YextOptionalNumberField;
|
|
478
|
+
declare function YextField<T = any>(fieldName: string, config: YextFieldConfig<T>): Field<T>;
|
|
479
|
+
declare function YextField<T extends Record<string, any>, U = any>(fieldName: string, config: YextEntitySelectorField<T>): Field<YextEntityField<U>>;
|
|
480
|
+
|
|
430
481
|
declare const bodyVariants: (props?: ({
|
|
431
482
|
variant?: "sm" | "lg" | "base" | null | undefined;
|
|
432
483
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
@@ -452,9 +503,10 @@ interface CTAProps {
|
|
|
452
503
|
className?: string;
|
|
453
504
|
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
454
505
|
alwaysHideCaret?: boolean;
|
|
506
|
+
ariaLabel?: string;
|
|
455
507
|
}
|
|
456
508
|
declare const CTA: {
|
|
457
|
-
({ label, link, linkType, variant, eventName, className, target, alwaysHideCaret, }: CTAProps): react_jsx_runtime_js.JSX.Element;
|
|
509
|
+
({ label, link, linkType, variant, eventName, className, target, alwaysHideCaret, ariaLabel, }: CTAProps): react_jsx_runtime_js.JSX.Element;
|
|
458
510
|
displayName: string;
|
|
459
511
|
};
|
|
460
512
|
|
|
@@ -466,11 +518,12 @@ declare const headingVariants: (props?: ({
|
|
|
466
518
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
467
519
|
interface HeadingProps extends Omit<React$1.HTMLAttributes<HTMLHeadingElement>, "color">, VariantProps<typeof headingVariants> {
|
|
468
520
|
level: HeadingLevel;
|
|
521
|
+
semanticLevelOverride?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span";
|
|
469
522
|
}
|
|
470
523
|
declare const Heading: React$1.ForwardRefExoticComponent<HeadingProps & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
471
524
|
|
|
472
525
|
interface ImageProps {
|
|
473
|
-
image: ImageType;
|
|
526
|
+
image: ImageType | ComplexImageType;
|
|
474
527
|
layout: "auto" | "fixed";
|
|
475
528
|
aspectRatio?: number;
|
|
476
529
|
width?: number;
|
|
@@ -487,7 +540,7 @@ type MaybeLinkProps = {
|
|
|
487
540
|
variant?: CTAProps["variant"];
|
|
488
541
|
alwaysHideCaret?: boolean;
|
|
489
542
|
};
|
|
490
|
-
declare const MaybeLink: (props: MaybeLinkProps) =>
|
|
543
|
+
declare const MaybeLink: (props: MaybeLinkProps) => react_jsx_runtime.JSX.Element;
|
|
491
544
|
|
|
492
545
|
declare const pageSectionVariants: (props?: ({
|
|
493
546
|
verticalPadding?: "default" | "sm" | "footer" | "header" | null | undefined;
|
|
@@ -506,6 +559,7 @@ type PhoneAtomProps = {
|
|
|
506
559
|
backgroundColor?: BackgroundStyle;
|
|
507
560
|
format: "domestic" | "international" | undefined;
|
|
508
561
|
includeHyperlink: boolean;
|
|
562
|
+
includeIcon: boolean;
|
|
509
563
|
};
|
|
510
564
|
declare const PhoneAtom: (props: PhoneAtomProps) => react_jsx_runtime.JSX.Element;
|
|
511
565
|
|
|
@@ -515,91 +569,28 @@ interface BackgroundProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
515
569
|
}
|
|
516
570
|
declare const Background: React$1.ForwardRefExoticComponent<BackgroundProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
517
571
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
description: YextEntityField<string>;
|
|
524
|
-
cta: YextEntityField<CTAProps>;
|
|
525
|
-
};
|
|
526
|
-
collection?: YextCollection;
|
|
527
|
-
};
|
|
528
|
-
declare const EventCard: ComponentConfig<EventCardProps>;
|
|
529
|
-
|
|
530
|
-
type ExampleRepeatableItemProps = {
|
|
531
|
-
text?: YextEntityField<string>;
|
|
532
|
-
image?: YextEntityField<ImageType>;
|
|
533
|
-
collection?: YextCollection;
|
|
534
|
-
};
|
|
535
|
-
declare const ExampleRepeatableItemComponent: ComponentConfig<ExampleRepeatableItemProps>;
|
|
536
|
-
|
|
537
|
-
type InsightCardProps = {
|
|
538
|
-
card?: {
|
|
539
|
-
image: YextEntityField<ImageType>;
|
|
540
|
-
title: YextEntityField<string>;
|
|
541
|
-
category: YextEntityField<string>;
|
|
542
|
-
date: YextEntityField<string>;
|
|
543
|
-
description: YextEntityField<string>;
|
|
544
|
-
cta: YextEntityField<CTAProps>;
|
|
545
|
-
};
|
|
546
|
-
collection?: YextCollection;
|
|
547
|
-
};
|
|
548
|
-
declare const InsightCard: ComponentConfig<InsightCardProps>;
|
|
549
|
-
|
|
550
|
-
type ProductCardProps = {
|
|
551
|
-
card?: {
|
|
552
|
-
image?: YextEntityField<ImageType>;
|
|
553
|
-
heading?: YextEntityField<string>;
|
|
554
|
-
category?: YextEntityField<string>;
|
|
555
|
-
description?: YextEntityField<string>;
|
|
556
|
-
cta?: YextEntityField<string>;
|
|
557
|
-
};
|
|
558
|
-
styles: {
|
|
559
|
-
cardBackgroundColor?: BackgroundStyle;
|
|
560
|
-
};
|
|
561
|
-
collection?: YextCollection;
|
|
562
|
-
};
|
|
563
|
-
declare const ProductCard: ComponentConfig<ProductCardProps>;
|
|
564
|
-
|
|
565
|
-
interface PersonCardProps {
|
|
566
|
-
card?: {
|
|
567
|
-
headshot?: YextEntityField<ImageWrapperProps>;
|
|
568
|
-
name?: YextEntityField<string>;
|
|
569
|
-
title?: YextEntityField<string>;
|
|
570
|
-
phone?: YextEntityField<string>;
|
|
571
|
-
email?: YextEntityField<string>;
|
|
572
|
-
cta?: YextEntityField<CTAProps>;
|
|
573
|
-
};
|
|
574
|
-
styles: {
|
|
575
|
-
cardBackgroundColor?: BackgroundStyle;
|
|
576
|
-
};
|
|
577
|
-
collection?: YextCollection;
|
|
572
|
+
interface VisibilityWrapperProps {
|
|
573
|
+
liveVisibility: boolean;
|
|
574
|
+
isEditing: boolean;
|
|
575
|
+
iconSize?: VariantProps<typeof wrapperVariants>["size"];
|
|
576
|
+
children: React$1.ReactNode;
|
|
578
577
|
}
|
|
579
|
-
declare const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
testimonial: YextEntityField<string>;
|
|
584
|
-
authorName: YextEntityField<string>;
|
|
585
|
-
date: YextEntityField<string>;
|
|
586
|
-
};
|
|
587
|
-
styles: {
|
|
588
|
-
cardBackgroundColor?: BackgroundStyle;
|
|
589
|
-
};
|
|
590
|
-
collection?: YextCollection;
|
|
591
|
-
};
|
|
592
|
-
declare const TestimonialCard: ComponentConfig<TestimonialCardProps>;
|
|
578
|
+
declare const wrapperVariants: (props?: ({
|
|
579
|
+
size?: "md" | "lg" | null | undefined;
|
|
580
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
581
|
+
declare const VisibilityWrapper: React$1.FC<VisibilityWrapperProps>;
|
|
593
582
|
|
|
594
583
|
type BannerSectionProps = {
|
|
595
584
|
text: YextEntityField<string>;
|
|
596
585
|
textAlignment: "left" | "right" | "center";
|
|
597
586
|
backgroundColor?: BackgroundStyle;
|
|
587
|
+
liveVisibility: boolean;
|
|
598
588
|
};
|
|
599
589
|
declare const BannerSection: ComponentConfig<BannerSectionProps>;
|
|
600
590
|
|
|
601
591
|
type BreadcrumbsSectionProps = {
|
|
602
592
|
separator?: string;
|
|
593
|
+
liveVisibility: boolean;
|
|
603
594
|
};
|
|
604
595
|
declare const BreadcrumbsSection: ComponentConfig<BreadcrumbsSectionProps>;
|
|
605
596
|
|
|
@@ -636,6 +627,7 @@ interface CoreInfoSectionProps {
|
|
|
636
627
|
headingText: YextEntityField<string>;
|
|
637
628
|
servicesList: YextEntityField<string[]>;
|
|
638
629
|
};
|
|
630
|
+
liveVisibility: boolean;
|
|
639
631
|
}
|
|
640
632
|
declare const CoreInfoSection: ComponentConfig<CoreInfoSectionProps>;
|
|
641
633
|
|
|
@@ -667,6 +659,7 @@ interface HeroSectionProps {
|
|
|
667
659
|
backgroundColor?: BackgroundStyle;
|
|
668
660
|
imageOrientation: "left" | "right";
|
|
669
661
|
};
|
|
662
|
+
liveVisibility: boolean;
|
|
670
663
|
}
|
|
671
664
|
declare const HeroSection: ComponentConfig<HeroSectionProps>;
|
|
672
665
|
|
|
@@ -693,6 +686,7 @@ interface NearbyLocationsSectionProps {
|
|
|
693
686
|
coordinate: YextEntityField<Coordinate>;
|
|
694
687
|
radius: number;
|
|
695
688
|
limit: number;
|
|
689
|
+
liveVisibility: boolean;
|
|
696
690
|
}
|
|
697
691
|
declare const NearbyLocationsSection: ComponentConfig<NearbyLocationsSectionProps>;
|
|
698
692
|
|
|
@@ -715,6 +709,7 @@ interface PromoSectionProps {
|
|
|
715
709
|
backgroundColor?: BackgroundStyle;
|
|
716
710
|
orientation: "left" | "right";
|
|
717
711
|
};
|
|
712
|
+
liveVisibility: boolean;
|
|
718
713
|
}
|
|
719
714
|
declare const PromoSection: ComponentConfig<PromoSectionProps>;
|
|
720
715
|
|
|
@@ -726,7 +721,11 @@ interface PhotoGallerySectionProps {
|
|
|
726
721
|
text: YextEntityField<string>;
|
|
727
722
|
level: HeadingLevel;
|
|
728
723
|
};
|
|
729
|
-
images:
|
|
724
|
+
images: {
|
|
725
|
+
images: YextEntityField<ImageType[] | ComplexImageType[]>;
|
|
726
|
+
imageStyle: Omit<ImageWrapperProps, "image">;
|
|
727
|
+
};
|
|
728
|
+
liveVisibility: boolean;
|
|
730
729
|
}
|
|
731
730
|
declare const PhotoGallerySection: ComponentConfig<PhotoGallerySectionProps>;
|
|
732
731
|
|
|
@@ -738,11 +737,20 @@ interface FAQsSectionProps {
|
|
|
738
737
|
text: YextEntityField<string>;
|
|
739
738
|
level: HeadingProps["level"];
|
|
740
739
|
};
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
answer: string;
|
|
744
|
-
}>;
|
|
740
|
+
collection: FAQsCollection;
|
|
741
|
+
liveVisibility: boolean;
|
|
745
742
|
}
|
|
743
|
+
type FAQs = Array<{
|
|
744
|
+
question: string;
|
|
745
|
+
answer: string;
|
|
746
|
+
}>;
|
|
747
|
+
type FAQsCollection = YextCollection & {
|
|
748
|
+
subfields?: {
|
|
749
|
+
questionField: YextEntityField<string>;
|
|
750
|
+
answerField: YextEntityField<string>;
|
|
751
|
+
};
|
|
752
|
+
FAQs?: FAQs;
|
|
753
|
+
};
|
|
746
754
|
declare const FAQsSection: ComponentConfig<FAQsSectionProps>;
|
|
747
755
|
|
|
748
756
|
type SectionContainerProps = {
|
|
@@ -752,6 +760,7 @@ type SectionContainerProps = {
|
|
|
752
760
|
level: HeadingProps["level"];
|
|
753
761
|
alignment: "left" | "right" | "center";
|
|
754
762
|
};
|
|
763
|
+
liveVisibility: boolean;
|
|
755
764
|
};
|
|
756
765
|
declare const SectionContainer: ComponentConfig<SectionContainerProps>;
|
|
757
766
|
|
|
@@ -760,8 +769,8 @@ interface CollectionProps {
|
|
|
760
769
|
shouldClearDropZone?: boolean;
|
|
761
770
|
layout?: "grid" | "flex";
|
|
762
771
|
direction?: "flex-row" | "flex-col";
|
|
772
|
+
liveVisibility: boolean;
|
|
763
773
|
}
|
|
764
|
-
declare const collectionWrapperClassName = "flex flex-wrap gap-4 flex-col sm:flex-row items-center";
|
|
765
774
|
declare const Collection: ComponentConfig<CollectionProps>;
|
|
766
775
|
|
|
767
776
|
declare const layoutVariants: (props?: ({
|
|
@@ -769,23 +778,41 @@ declare const layoutVariants: (props?: ({
|
|
|
769
778
|
verticalPadding?: "0" | "1" | "2" | "3" | "4" | "default" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
|
|
770
779
|
horizontalPadding?: "0" | "1" | "2" | "3" | "4" | "none" | "6" | "8" | "12" | "16" | "24" | "14" | "20" | "0.5" | "1.5" | "2.5" | "10" | "3.5" | "5" | "7" | "9" | "11" | null | undefined;
|
|
771
780
|
columnFormatting?: "default" | "none" | "forceHorizontal" | null | undefined;
|
|
772
|
-
} &
|
|
781
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
773
782
|
interface layoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof layoutVariants> {
|
|
774
783
|
backgroundColor?: BackgroundStyle;
|
|
775
784
|
}
|
|
776
785
|
|
|
777
786
|
interface FlexProps extends layoutProps {
|
|
778
787
|
justifyContent: "start" | "center" | "end";
|
|
788
|
+
alignItems: "start" | "center" | "end";
|
|
779
789
|
direction: "flex-row" | "flex-col";
|
|
780
790
|
wrap: "wrap" | "nowrap";
|
|
791
|
+
liveVisibility: boolean;
|
|
781
792
|
}
|
|
782
793
|
declare const Flex: ComponentConfig<FlexProps>;
|
|
783
794
|
|
|
784
795
|
interface GridProps extends layoutProps {
|
|
785
796
|
columns: number;
|
|
797
|
+
liveVisibility: boolean;
|
|
786
798
|
}
|
|
787
799
|
declare const Grid: ComponentConfig<GridProps>;
|
|
788
800
|
|
|
801
|
+
type ProductCardProps = {
|
|
802
|
+
card?: {
|
|
803
|
+
image?: ImageWrapperProps;
|
|
804
|
+
heading?: YextEntityField<string>;
|
|
805
|
+
category?: YextEntityField<string>;
|
|
806
|
+
description?: YextEntityField<string>;
|
|
807
|
+
cta?: YextEntityField<CTAProps>;
|
|
808
|
+
};
|
|
809
|
+
styles: {
|
|
810
|
+
cardBackgroundColor?: BackgroundStyle;
|
|
811
|
+
};
|
|
812
|
+
collection?: YextCollection;
|
|
813
|
+
};
|
|
814
|
+
declare const ProductCard: ComponentConfig<ProductCardProps>;
|
|
815
|
+
|
|
789
816
|
type AddressProps = {
|
|
790
817
|
address: YextEntityField<AddressType>;
|
|
791
818
|
showGetDirections: boolean;
|
|
@@ -817,6 +844,11 @@ type GetDirectionsProps = {
|
|
|
817
844
|
};
|
|
818
845
|
declare const GetDirections: ComponentConfig<GetDirectionsProps>;
|
|
819
846
|
|
|
847
|
+
interface HeadingTextProps extends HeadingProps {
|
|
848
|
+
text: YextEntityField<string>;
|
|
849
|
+
}
|
|
850
|
+
declare const HeadingText: ComponentConfig<HeadingTextProps>;
|
|
851
|
+
|
|
820
852
|
type HoursTableProps = {
|
|
821
853
|
hours: YextEntityField<HoursType>;
|
|
822
854
|
startOfWeek: keyof DayOfWeekNames | "today";
|
|
@@ -836,12 +868,8 @@ interface HoursStatusProps {
|
|
|
836
868
|
}
|
|
837
869
|
declare const HoursStatus: ComponentConfig<HoursStatusProps>;
|
|
838
870
|
|
|
839
|
-
interface ImageWrapperProps {
|
|
840
|
-
image: YextEntityField<ImageType>;
|
|
841
|
-
layout: ImageProps["layout"];
|
|
842
|
-
aspectRatio?: ImageProps["aspectRatio"];
|
|
843
|
-
width?: ImageProps["width"];
|
|
844
|
-
height?: ImageProps["height"];
|
|
871
|
+
interface ImageWrapperProps extends Omit<ImageProps, "image"> {
|
|
872
|
+
image: YextEntityField<ImageType | ComplexImageType>;
|
|
845
873
|
}
|
|
846
874
|
declare const ImageWrapper: ComponentConfig<ImageWrapperProps>;
|
|
847
875
|
|
|
@@ -865,7 +893,9 @@ interface TextListProps {
|
|
|
865
893
|
}
|
|
866
894
|
declare const TextList: ComponentConfig<TextListProps>;
|
|
867
895
|
|
|
868
|
-
type HeaderProps =
|
|
896
|
+
type HeaderProps = {
|
|
897
|
+
logoWidth?: number;
|
|
898
|
+
};
|
|
869
899
|
declare const Header: ComponentConfig<HeaderProps>;
|
|
870
900
|
|
|
871
901
|
type FooterProps = {
|
|
@@ -878,6 +908,60 @@ interface DirectoryProps {
|
|
|
878
908
|
}
|
|
879
909
|
declare const Directory: ComponentConfig<DirectoryProps>;
|
|
880
910
|
|
|
911
|
+
type EventCardProps = {
|
|
912
|
+
card?: {
|
|
913
|
+
title: YextEntityField<string>;
|
|
914
|
+
image: YextEntityField<ImageType>;
|
|
915
|
+
dateTime: YextEntityField<string>;
|
|
916
|
+
description: YextEntityField<string>;
|
|
917
|
+
cta: YextEntityField<CTAProps>;
|
|
918
|
+
};
|
|
919
|
+
collection?: YextCollection;
|
|
920
|
+
};
|
|
921
|
+
declare const EventCard: ComponentConfig<EventCardProps>;
|
|
922
|
+
|
|
923
|
+
type InsightCardProps = {
|
|
924
|
+
card?: {
|
|
925
|
+
image: YextEntityField<ImageType>;
|
|
926
|
+
title: YextEntityField<string>;
|
|
927
|
+
category: YextEntityField<string>;
|
|
928
|
+
date: YextEntityField<string>;
|
|
929
|
+
description: YextEntityField<string>;
|
|
930
|
+
cta: YextEntityField<CTAProps>;
|
|
931
|
+
};
|
|
932
|
+
collection?: YextCollection;
|
|
933
|
+
};
|
|
934
|
+
declare const InsightCard: ComponentConfig<InsightCardProps>;
|
|
935
|
+
|
|
936
|
+
interface PersonCardProps {
|
|
937
|
+
card?: {
|
|
938
|
+
headshot?: YextEntityField<ImageWrapperProps>;
|
|
939
|
+
name?: YextEntityField<string>;
|
|
940
|
+
title?: YextEntityField<string>;
|
|
941
|
+
phone?: YextEntityField<string>;
|
|
942
|
+
email?: YextEntityField<string>;
|
|
943
|
+
cta?: YextEntityField<CTAProps>;
|
|
944
|
+
};
|
|
945
|
+
styles: {
|
|
946
|
+
cardBackgroundColor?: BackgroundStyle;
|
|
947
|
+
};
|
|
948
|
+
collection?: YextCollection;
|
|
949
|
+
}
|
|
950
|
+
declare const PersonCard: ComponentConfig<PersonCardProps>;
|
|
951
|
+
|
|
952
|
+
type TestimonialCardProps = {
|
|
953
|
+
card?: {
|
|
954
|
+
testimonial: YextEntityField<string>;
|
|
955
|
+
authorName: YextEntityField<string>;
|
|
956
|
+
date: YextEntityField<string>;
|
|
957
|
+
};
|
|
958
|
+
styles: {
|
|
959
|
+
cardBackgroundColor?: BackgroundStyle;
|
|
960
|
+
};
|
|
961
|
+
collection?: YextCollection;
|
|
962
|
+
};
|
|
963
|
+
declare const TestimonialCard: ComponentConfig<TestimonialCardProps>;
|
|
964
|
+
|
|
881
965
|
interface PageSectionCategoryProps {
|
|
882
966
|
BreadcrumbsSection: BreadcrumbsSectionProps;
|
|
883
967
|
HeroSection: HeroSectionProps;
|
|
@@ -933,6 +1017,7 @@ interface ContentBlockCategoryProps {
|
|
|
933
1017
|
CTAWrapper: CTAWrapperProps;
|
|
934
1018
|
Emails: EmailsProps;
|
|
935
1019
|
GetDirections: GetDirectionsProps;
|
|
1020
|
+
HeadingText: HeadingTextProps;
|
|
936
1021
|
HoursTable: HoursTableProps;
|
|
937
1022
|
HoursStatus: HoursStatusProps;
|
|
938
1023
|
ImageWrapper: ImageWrapperProps;
|
|
@@ -946,8 +1031,9 @@ declare const ContentBlockCategoryComponents: {
|
|
|
946
1031
|
CTAWrapper: _measured_puck.ComponentConfig<CTAWrapperProps>;
|
|
947
1032
|
Emails: _measured_puck.ComponentConfig<EmailsProps>;
|
|
948
1033
|
GetDirections: _measured_puck.ComponentConfig<GetDirectionsProps>;
|
|
949
|
-
|
|
1034
|
+
HeadingText: _measured_puck.ComponentConfig<HeadingTextProps>;
|
|
950
1035
|
HoursStatus: _measured_puck.ComponentConfig<HoursStatusProps>;
|
|
1036
|
+
HoursTable: _measured_puck.ComponentConfig<HoursTableProps>;
|
|
951
1037
|
ImageWrapper: _measured_puck.ComponentConfig<ImageWrapperProps>;
|
|
952
1038
|
MapboxStaticMap: _measured_puck.ComponentConfig<MapboxStaticProps>;
|
|
953
1039
|
Phone: _measured_puck.ComponentConfig<PhoneProps>;
|
|
@@ -971,9 +1057,13 @@ declare const DirectoryCategoryComponents: {
|
|
|
971
1057
|
};
|
|
972
1058
|
declare const DirectoryCategory: (keyof DirectoryCategoryProps)[];
|
|
973
1059
|
|
|
974
|
-
|
|
975
|
-
text
|
|
976
|
-
|
|
977
|
-
|
|
1060
|
+
type ExampleRepeatableItemProps = {
|
|
1061
|
+
text?: YextEntityField<string>;
|
|
1062
|
+
image?: YextEntityField<ImageType>;
|
|
1063
|
+
collection?: YextCollection;
|
|
1064
|
+
};
|
|
1065
|
+
declare const ExampleRepeatableItemComponent: ComponentConfig<ExampleRepeatableItemProps>;
|
|
1066
|
+
|
|
1067
|
+
declare const defaultThemeConfig: ThemeConfig;
|
|
978
1068
|
|
|
979
|
-
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, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventCard, type EventCardProps, ExampleRepeatableItemComponent, type ExampleRepeatableItemProps, FAQsSection, type FAQsSectionProps, 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, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightCard, type InsightCardProps, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, MapboxStaticMapComponent as MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, PersonCard, type PersonCardProps, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductCard, type ProductCardProps, PromoSection, type PromoSectionProps, type RenderYextEntityFieldSelectorProps, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TemplatePropsContext, TestimonialCard, type TestimonialCardProps, TextList, type TextListProps, type ThemeConfig, ThemeOptions, VisualEditorProvider, type YextCollection, YextCollectionSubfieldSelector, type YextEntityField, YextEntityFieldSelector, type YextFieldDefinition, type YextSchemaField, applyAnalytics, applyTheme, backgroundColors, bodyVariants, buttonVariants,
|
|
1069
|
+
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, ContentBlockCategory, ContentBlockCategoryComponents, type ContentBlockCategoryProps, CoreInfoSection, type CoreInfoSectionProps, Directory, DirectoryCategory, DirectoryCategoryComponents, type DirectoryCategoryProps, type DirectoryProps, Editor, Emails, type EmailsProps, EntityField, EventCard, type EventCardProps, ExampleRepeatableItemComponent, type ExampleRepeatableItemProps, FAQsSection, type FAQsSectionProps, 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, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableProps, Image, type ImageProps, ImageWrapper, type ImageWrapperProps, InsightCard, type InsightCardProps, LayoutBlockCategory, LayoutBlockCategoryComponents, type LayoutBlockCategoryProps, MapboxStaticMapComponent as MapboxStaticMap, type MapboxStaticProps, MaybeLink, type MaybeLinkProps, NearbyLocationsSection, type NearbyLocationsSectionProps, OptionalNumberField, type OptionalNumberFieldProps, OtherCategory, OtherCategoryComponents, type OtherCategoryProps, PageSection, PageSectionCategory, PageSectionCategoryComponents, type PageSectionCategoryProps, type PageSectionProps, PersonCard, type PersonCardProps, Phone, PhoneAtom, type PhoneAtomProps, type PhoneProps, PhotoGallerySection, type PhotoGallerySectionProps, ProductCard, type ProductCardProps, PromoSection, type PromoSectionProps, type RenderYextEntityFieldSelectorProps, SectionContainer, type SectionContainerProps, SpacingSelector, TailwindConfigContext, TemplatePropsContext, TestimonialCard, type TestimonialCardProps, TextList, type TextListProps, type ThemeConfig, ThemeOptions, VisibilityWrapper, VisualEditorProvider, type YextCollection, YextCollectionSubfieldSelector, type YextEntityField, YextEntityFieldSelector, YextField, type YextFieldDefinition, type YextSchemaField, applyAnalytics, applyTheme, backgroundColors, bodyVariants, buttonVariants, constructFontSelectOptions, defaultFonts, defaultThemeConfig, defaultThemeTailwindExtensions, fetchNearbyLocations, getFontWeightOptions, getFontWeightOverrideOptions, getPageMetadata, handleResolveFieldsForCollections, headingVariants, normalizeSlug, resolveYextEntityField, resolveYextSubfield, themeManagerCn, themeManagerTwMergeConfiguration, themeResolver, useBackground, useDocument, useEntityFields, usePlatformBridgeDocument, usePlatformBridgeEntityFields, useTailwindConfig, useTemplateProps, validateSlug };
|
package/dist/plugin/plugin.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("node:path"),i=require("fs-extra"),d=`/** THIS FILE IS AUTOGENERATED AND SHOULD NOT BE EDITED */
|
|
2
2
|
import "@yext/visual-editor/style.css";
|
|
3
3
|
import {
|
|
4
4
|
Template,
|
|
@@ -73,11 +73,6 @@ export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = ({
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export const getPath: GetPath<TemplateProps> = ({ document }) => {
|
|
76
|
-
if (!document?.__?.layout) {
|
|
77
|
-
// temporary: guard for generated repo-based static page
|
|
78
|
-
return \`static-\${Math.floor(Math.random() * (10000 - 1))}\`;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
76
|
if (document.slug) {
|
|
82
77
|
return document.slug;
|
|
83
78
|
}
|
|
@@ -92,10 +87,6 @@ export const getPath: GetPath<TemplateProps> = ({ document }) => {
|
|
|
92
87
|
|
|
93
88
|
const Location: Template<TemplateRenderProps> = (props) => {
|
|
94
89
|
const { document } = props;
|
|
95
|
-
// temporary: guard for generated repo-based static page
|
|
96
|
-
if (!document?.__?.layout) {
|
|
97
|
-
return <></>;
|
|
98
|
-
}
|
|
99
90
|
|
|
100
91
|
return (
|
|
101
92
|
<AnalyticsProvider
|
|
@@ -171,4 +162,4 @@ const Edit: () => JSX.Element = () => {
|
|
|
171
162
|
};
|
|
172
163
|
|
|
173
164
|
export default Edit;
|
|
174
|
-
`,m={"src/templates/main.tsx":
|
|
165
|
+
`,m={"src/templates/main.tsx":d,"src/templates/edit.tsx":l},p=()=>{let e=!1;const a=[],s=()=>{Object.entries(m).forEach(([n,r])=>{const o=c.join(process.cwd(),n);a.push(o),i.mkdirSync(c.dirname(o),{recursive:!0}),!i.existsSync(o)&&i.writeFileSync(o,r)})},t=()=>{a.forEach(n=>{i.rmSync(n,{force:!0})})};return process.on("SIGINT",()=>{t(),process.nextTick(()=>process.exit(0))}),process.on("SIGTERM",()=>{t(),process.nextTick(()=>process.exit(0))}),{name:"vite-plugin-yext-visual-editor",config(n,{command:r}){e=r==="build"},configureServer(n){e||(s(),n.httpServer?.on("close",()=>{t()}))},buildStart(){e&&s()},buildEnd(){e&&t()},closeBundle(){e&&t()}}};exports.yextVisualEditorPlugin=p;
|
package/dist/plugin/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import c from "node:path";
|
|
2
|
+
import i from "fs-extra";
|
|
3
|
+
const d = `/** THIS FILE IS AUTOGENERATED AND SHOULD NOT BE EDITED */
|
|
4
4
|
import "@yext/visual-editor/style.css";
|
|
5
5
|
import {
|
|
6
6
|
Template,
|
|
@@ -75,11 +75,6 @@ export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = ({
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export const getPath: GetPath<TemplateProps> = ({ document }) => {
|
|
78
|
-
if (!document?.__?.layout) {
|
|
79
|
-
// temporary: guard for generated repo-based static page
|
|
80
|
-
return \`static-\${Math.floor(Math.random() * (10000 - 1))}\`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
78
|
if (document.slug) {
|
|
84
79
|
return document.slug;
|
|
85
80
|
}
|
|
@@ -94,10 +89,6 @@ export const getPath: GetPath<TemplateProps> = ({ document }) => {
|
|
|
94
89
|
|
|
95
90
|
const Location: Template<TemplateRenderProps> = (props) => {
|
|
96
91
|
const { document } = props;
|
|
97
|
-
// temporary: guard for generated repo-based static page
|
|
98
|
-
if (!document?.__?.layout) {
|
|
99
|
-
return <></>;
|
|
100
|
-
}
|
|
101
92
|
|
|
102
93
|
return (
|
|
103
94
|
<AnalyticsProvider
|
|
@@ -174,18 +165,18 @@ const Edit: () => JSX.Element = () => {
|
|
|
174
165
|
|
|
175
166
|
export default Edit;
|
|
176
167
|
`, l = {
|
|
177
|
-
"src/templates/main.tsx":
|
|
168
|
+
"src/templates/main.tsx": d,
|
|
178
169
|
"src/templates/edit.tsx": m
|
|
179
170
|
}, f = () => {
|
|
180
171
|
let e = !1;
|
|
181
172
|
const a = [], s = () => {
|
|
182
|
-
Object.entries(l).forEach(([n,
|
|
183
|
-
const
|
|
184
|
-
a.push(
|
|
173
|
+
Object.entries(l).forEach(([n, r]) => {
|
|
174
|
+
const o = c.join(process.cwd(), n);
|
|
175
|
+
a.push(o), i.mkdirSync(c.dirname(o), { recursive: !0 }), !i.existsSync(o) && i.writeFileSync(o, r);
|
|
185
176
|
});
|
|
186
177
|
}, t = () => {
|
|
187
178
|
a.forEach((n) => {
|
|
188
|
-
|
|
179
|
+
i.rmSync(n, { force: !0 });
|
|
189
180
|
});
|
|
190
181
|
};
|
|
191
182
|
return process.on("SIGINT", () => {
|
|
@@ -194,8 +185,8 @@ export default Edit;
|
|
|
194
185
|
t(), process.nextTick(() => process.exit(0));
|
|
195
186
|
}), {
|
|
196
187
|
name: "vite-plugin-yext-visual-editor",
|
|
197
|
-
config(n, { command:
|
|
198
|
-
e =
|
|
188
|
+
config(n, { command: r }) {
|
|
189
|
+
e = r === "build";
|
|
199
190
|
},
|
|
200
191
|
configureServer(n) {
|
|
201
192
|
e || (s(), n.httpServer?.on("close", () => {
|