x
This commit is contained in:
1 parent
406cad801b
commit
a2da091b15
21 files changed
+2454
-63
No files matched your search
+47
-4
@@ -410,6 +410,43 @@ export const EditorialTileSectionPayloadSchema = z.object({
|
||||
});
|
||||
export type EditorialTileSectionPayload = z.infer<typeof EditorialTileSectionPayloadSchema>;
|
||||
|
||||
export const FeaturedTilesSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema.optional(),
|
||||
subtitle: LocalizedStringSchema.optional(),
|
||||
columns: z.number().optional().default(2),
|
||||
backgroundColor: z.string().optional(),
|
||||
textColor: z.string().optional(),
|
||||
tiles: z.array(z.object({
|
||||
title: LocalizedStringSchema,
|
||||
description: LocalizedStringSchema.optional(),
|
||||
imageUrl: z.string().min(1),
|
||||
imageAspectRatio: z.enum(['square', 'portrait', 'tall', 'auto']).optional(),
|
||||
buttonText: LocalizedStringSchema.optional(),
|
||||
buttonLink: z.string().optional(),
|
||||
})).min(1)
|
||||
});
|
||||
export type FeaturedTilesSectionPayload = z.infer<typeof FeaturedTilesSectionPayloadSchema>;
|
||||
|
||||
export const HeroVideoSectionPayloadSchema = z.object({
|
||||
tagline: LocalizedStringSchema.optional(),
|
||||
title: LocalizedStringSchema.optional(),
|
||||
description: LocalizedStringSchema.optional(),
|
||||
videoUrl: z.string().min(1),
|
||||
posterImageUrl: z.string().optional(),
|
||||
buttonText: LocalizedStringSchema.optional(),
|
||||
buttonLink: z.string().optional(),
|
||||
secondaryButtonText: LocalizedStringSchema.optional(),
|
||||
secondaryButtonLink: z.string().optional(),
|
||||
overlayOpacity: z.number().optional().default(40),
|
||||
height: z.enum(['full', 'large', 'medium']).optional().default('large'),
|
||||
muted: z.boolean().optional().default(true),
|
||||
autoplay: z.boolean().optional().default(true),
|
||||
loop: z.boolean().optional().default(true),
|
||||
backgroundColor: z.string().optional(),
|
||||
textColor: z.string().optional(),
|
||||
});
|
||||
export type HeroVideoSectionPayload = z.infer<typeof HeroVideoSectionPayloadSchema>;
|
||||
|
||||
export const EditorialCarouselSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
backgroundColor: z.string().optional(),
|
||||
@@ -765,22 +802,25 @@ export const CustomSectionPayloadSchema = z.object({
|
||||
export type CustomSectionPayload = z.infer<typeof CustomSectionPayloadSchema>;
|
||||
|
||||
export const PAGE_SECTION_TYPES = [
|
||||
'HERO', 'ANNOUNCEMENT_BAR', 'NEWSLETTER', 'EDITORIAL_TILE',
|
||||
'HERO', 'HERO_V2', 'HERO_VIDEO', 'ANNOUNCEMENT_BAR', 'NEWSLETTER', 'EDITORIAL_TILE', 'FEATURED_TILES',
|
||||
'EDITORIAL_CAROUSEL', 'PRODUCTS', 'CATEGORIES', 'TEXT', 'BANNER',
|
||||
'HERO_ARTICLE', 'RICH_TEXT', 'ARTICLE_HEADER', 'ARTICLE_MEDIA', 'ARTICLE_GALLERY',
|
||||
'ARTICLE_FACTS', 'ARTICLE_VIDEO', 'ARTICLE_REFERENCES', 'ARTICLE_TABLE', 'ARTICLE_DOWNLOAD',
|
||||
'ARTICLE_CTA', 'SCENT_NOTES_BREAKDOWN', 'QUOTE_CALLOUT',
|
||||
'PRODUCT_CAROUSEL', 'ACCORDION', 'CONTACT_INFO', 'CONTACT_FORM',
|
||||
'HERO_V2', 'USP_BAR', 'PRODUCT_MAIN', 'PRODUCT_DETAILS', 'PRODUCT_SPECS',
|
||||
'USP_BAR', 'PRODUCT_MAIN', 'PRODUCT_DETAILS', 'PRODUCT_SPECS',
|
||||
'PRODUCT_REVIEWS', 'RELATED_PRODUCTS', 'CUSTOM'
|
||||
] as const;
|
||||
export type SectionType = typeof PAGE_SECTION_TYPES[number];
|
||||
|
||||
export const PAGE_SECTION_LOCALIZED_PATHS: Record<SectionType, readonly string[]> = {
|
||||
HERO: ['tagline', 'title', 'description', 'buttonText'],
|
||||
HERO_V2: ['tagline', 'title', 'description', 'primaryButtonText', 'secondaryButtonText'],
|
||||
HERO_VIDEO: ['tagline', 'title', 'description', 'buttonText', 'secondaryButtonText'],
|
||||
ANNOUNCEMENT_BAR: ['slides[]'],
|
||||
NEWSLETTER: ['title', 'description', 'buttonText', 'placeholderText', 'privacyText'],
|
||||
EDITORIAL_TILE: ['title', 'description', 'buttonText'],
|
||||
FEATURED_TILES: ['title', 'subtitle', 'tiles[].title', 'tiles[].description', 'tiles[].buttonText'],
|
||||
EDITORIAL_CAROUSEL: ['title', 'slides[].category', 'slides[].title', 'slides[].description', 'slides[].buttonText'],
|
||||
PRODUCTS: ['title', 'subtitle'],
|
||||
CATEGORIES: ['title', 'subtitle'],
|
||||
@@ -803,7 +843,6 @@ export const PAGE_SECTION_LOCALIZED_PATHS: Record<SectionType, readonly string[]
|
||||
ACCORDION: ['title', 'categories[].name', 'categories[].questions[].q', 'categories[].questions[].a'],
|
||||
CONTACT_INFO: ['title', 'address', 'hours'],
|
||||
CONTACT_FORM: ['title', 'subtitle'],
|
||||
HERO_V2: ['tagline', 'title', 'description', 'primaryButtonText', 'secondaryButtonText'],
|
||||
USP_BAR: ['items[].title', 'items[].subtitle'],
|
||||
PRODUCT_MAIN: ['title', 'subtitle'],
|
||||
PRODUCT_DETAILS: ['title', 'subtitle'],
|
||||
@@ -815,9 +854,12 @@ export const PAGE_SECTION_LOCALIZED_PATHS: Record<SectionType, readonly string[]
|
||||
|
||||
export const PAGE_SECTION_PAYLOAD_SCHEMAS: Record<SectionType, z.ZodType> = {
|
||||
HERO: HeroSectionPayloadSchema,
|
||||
HERO_V2: HeroV2SectionPayloadSchema,
|
||||
HERO_VIDEO: HeroVideoSectionPayloadSchema,
|
||||
ANNOUNCEMENT_BAR: AnnouncementBarSectionPayloadSchema,
|
||||
NEWSLETTER: NewsletterSectionPayloadSchema,
|
||||
EDITORIAL_TILE: EditorialTileSectionPayloadSchema,
|
||||
FEATURED_TILES: FeaturedTilesSectionPayloadSchema,
|
||||
EDITORIAL_CAROUSEL: EditorialCarouselSectionPayloadSchema,
|
||||
PRODUCTS: ProductsSectionPayloadSchema,
|
||||
CATEGORIES: CategoriesSectionPayloadSchema,
|
||||
@@ -840,7 +882,6 @@ export const PAGE_SECTION_PAYLOAD_SCHEMAS: Record<SectionType, z.ZodType> = {
|
||||
ACCORDION: AccordionSectionPayloadSchema,
|
||||
CONTACT_INFO: ContactInfoSectionPayloadSchema,
|
||||
CONTACT_FORM: ContactFormSectionPayloadSchema,
|
||||
HERO_V2: HeroV2SectionPayloadSchema,
|
||||
USP_BAR: UspBarSectionPayloadSchema,
|
||||
PRODUCT_MAIN: ProductLayoutSectionPayloadSchema,
|
||||
PRODUCT_DETAILS: ProductLayoutSectionPayloadSchema,
|
||||
@@ -854,6 +895,7 @@ export const PRODUCT_DETAIL_SECTION_TYPES = [
|
||||
'PRODUCT_MAIN',
|
||||
'HERO',
|
||||
'HERO_V2',
|
||||
'HERO_VIDEO',
|
||||
'PRODUCT_DETAILS',
|
||||
'PRODUCT_SPECS',
|
||||
'PRODUCT_REVIEWS',
|
||||
@@ -863,6 +905,7 @@ export const PRODUCT_DETAIL_SECTION_TYPES = [
|
||||
'BANNER',
|
||||
'PRODUCT_CAROUSEL',
|
||||
'EDITORIAL_TILE',
|
||||
'FEATURED_TILES',
|
||||
'QUOTE_CALLOUT',
|
||||
'CUSTOM',
|
||||
] as const;
|
||||
|
||||
Reference in new issue
Block a user