medusa-storefront-data 2.3.0 → 2.5.1
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/HOMEPAGE_CONFIG.md +133 -0
- package/dist/segment-data/default-page-input.json +191 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/cookies.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/index.d.ts +103 -0
- package/dist/src/dynamic-config-schema/index.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/index.js +172 -0
- package/dist/src/dynamic-config-schema/sections/about-brand.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/about-brand.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/about-brand.js +30 -0
- package/dist/src/dynamic-config-schema/sections/baptism-picks.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/baptism-picks.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/baptism-picks.js +17 -0
- package/dist/src/dynamic-config-schema/sections/baptism.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/baptism.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/baptism.js +4 -0
- package/dist/src/dynamic-config-schema/sections/blog-posts.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/blog-posts.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/blog-posts.js +31 -0
- package/dist/src/dynamic-config-schema/sections/brand-marquee.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/brand-marquee.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/brand-marquee.js +9 -0
- package/dist/src/dynamic-config-schema/sections/brand-pillars.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/brand-pillars.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/brand-pillars.js +29 -0
- package/dist/src/dynamic-config-schema/sections/category-pills.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/category-pills.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/category-pills.js +4 -0
- package/dist/src/dynamic-config-schema/sections/celebrity-trust.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/celebrity-trust.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/celebrity-trust.js +4 -0
- package/dist/src/dynamic-config-schema/sections/features.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/features.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/features.js +12 -0
- package/dist/src/dynamic-config-schema/sections/hero.d.ts +6 -0
- package/dist/src/dynamic-config-schema/sections/hero.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/hero.js +9 -0
- package/dist/src/dynamic-config-schema/sections/index.d.ts +24 -0
- package/dist/src/dynamic-config-schema/sections/index.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/index.js +23 -0
- package/dist/src/dynamic-config-schema/sections/instagram-posts.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/instagram-posts.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/instagram-posts.js +30 -0
- package/dist/src/dynamic-config-schema/sections/loved-by-moms.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/loved-by-moms.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/loved-by-moms.js +4 -0
- package/dist/src/dynamic-config-schema/sections/luxe-favourites.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/luxe-favourites.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/luxe-favourites.js +4 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals-classic.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals-classic.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals-classic.js +12 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals.js +12 -0
- package/dist/src/dynamic-config-schema/sections/promo-announcements.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/promo-announcements.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/promo-announcements.js +16 -0
- package/dist/src/dynamic-config-schema/sections/promo-countdown.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/promo-countdown.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/promo-countdown.js +16 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-age.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-age.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-age.js +4 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-category.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-category.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-category.js +4 -0
- package/dist/src/dynamic-config-schema/sections/testimonials.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/testimonials.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/testimonials.js +9 -0
- package/dist/src/dynamic-config-schema/sections/theme-dresses.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/theme-dresses.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/theme-dresses.js +4 -0
- package/dist/src/dynamic-config-schema/sections/video-stories.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/video-stories.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/video-stories.js +24 -0
- package/dist/src/dynamic-config-schema/sections/why-choose-us.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/why-choose-us.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/why-choose-us.js +9 -0
- package/dist/src/dynamic-config-schema/shared.d.ts +35 -0
- package/dist/src/dynamic-config-schema/shared.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/shared.js +99 -0
- package/dist/src/dynamic-config-schema/site-configs.d.ts +11 -0
- package/dist/src/dynamic-config-schema/site-configs.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/site-configs.js +70 -0
- package/dist/src/edge.d.ts.map +1 -0
- package/dist/src/middleware.d.ts.map +1 -0
- package/dist/src/server/brand-pillars-from-categories.d.ts +8 -0
- package/dist/src/server/brand-pillars-from-categories.d.ts.map +1 -0
- package/dist/src/server/brand-pillars-from-categories.js +92 -0
- package/dist/src/server/cart.d.ts.map +1 -0
- package/dist/{server → src/server}/cart.js +20 -20
- package/dist/src/server/categories.d.ts.map +1 -0
- package/dist/src/server/collections.d.ts.map +1 -0
- package/dist/src/server/config-merge.d.ts +3 -0
- package/dist/src/server/config-merge.d.ts.map +1 -0
- package/dist/src/server/config-merge.js +31 -0
- package/dist/src/server/contact.d.ts.map +1 -0
- package/dist/src/server/customer-registration.d.ts.map +1 -0
- package/dist/src/server/customer.d.ts.map +1 -0
- package/dist/{server → src/server}/customer.js +11 -11
- package/dist/src/server/dynamic-config-api.d.ts +11 -0
- package/dist/src/server/dynamic-config-api.d.ts.map +1 -0
- package/dist/src/server/dynamic-config-api.js +46 -0
- package/dist/src/server/dynamic-config.d.ts +157 -0
- package/dist/src/server/dynamic-config.d.ts.map +1 -0
- package/dist/src/server/dynamic-config.js +573 -0
- package/dist/src/server/fulfillment.d.ts.map +1 -0
- package/dist/{server → src/server}/fulfillment.js +3 -3
- package/dist/src/server/guest.d.ts.map +1 -0
- package/dist/src/server/home-sections/about-brand.d.ts +9 -0
- package/dist/src/server/home-sections/about-brand.d.ts.map +1 -0
- package/dist/src/server/home-sections/about-brand.js +9 -0
- package/dist/src/server/home-sections/baptism-picks.d.ts +10 -0
- package/dist/src/server/home-sections/baptism-picks.d.ts.map +1 -0
- package/dist/src/server/home-sections/baptism-picks.js +27 -0
- package/dist/src/server/home-sections/baptism.d.ts +13 -0
- package/dist/src/server/home-sections/baptism.d.ts.map +1 -0
- package/dist/src/server/home-sections/baptism.js +43 -0
- package/dist/src/server/home-sections/blog-posts.d.ts +9 -0
- package/dist/src/server/home-sections/blog-posts.d.ts.map +1 -0
- package/dist/src/server/home-sections/blog-posts.js +9 -0
- package/dist/src/server/home-sections/brand-marquee.d.ts +8 -0
- package/dist/src/server/home-sections/brand-marquee.d.ts.map +1 -0
- package/dist/src/server/home-sections/brand-marquee.js +7 -0
- package/dist/src/server/home-sections/brand-pillars.d.ts +9 -0
- package/dist/src/server/home-sections/brand-pillars.d.ts.map +1 -0
- package/dist/src/server/home-sections/brand-pillars.js +9 -0
- package/dist/src/server/home-sections/category-pills.d.ts +9 -0
- package/dist/src/server/home-sections/category-pills.d.ts.map +1 -0
- package/dist/src/server/home-sections/category-pills.js +19 -0
- package/dist/src/server/home-sections/celebrity-trust.d.ts +12 -0
- package/dist/src/server/home-sections/celebrity-trust.d.ts.map +1 -0
- package/dist/src/server/home-sections/celebrity-trust.js +27 -0
- package/dist/src/server/home-sections/features.d.ts +9 -0
- package/dist/src/server/home-sections/features.d.ts.map +1 -0
- package/dist/src/server/home-sections/features.js +9 -0
- package/dist/src/server/home-sections/hero.d.ts +9 -0
- package/dist/src/server/home-sections/hero.d.ts.map +1 -0
- package/dist/src/server/home-sections/hero.js +9 -0
- package/dist/src/server/home-sections/instagram-posts.d.ts +9 -0
- package/dist/src/server/home-sections/instagram-posts.d.ts.map +1 -0
- package/dist/src/server/home-sections/instagram-posts.js +9 -0
- package/dist/src/server/home-sections/loved-by-moms.d.ts +12 -0
- package/dist/src/server/home-sections/loved-by-moms.d.ts.map +1 -0
- package/dist/src/server/home-sections/loved-by-moms.js +20 -0
- package/dist/src/server/home-sections/luxe-favourites.d.ts +11 -0
- package/dist/src/server/home-sections/luxe-favourites.d.ts.map +1 -0
- package/dist/src/server/home-sections/luxe-favourites.js +19 -0
- package/dist/src/server/home-sections/new-arrivals-classic.d.ts +8 -0
- package/dist/src/server/home-sections/new-arrivals-classic.d.ts.map +1 -0
- package/dist/src/server/home-sections/new-arrivals-classic.js +10 -0
- package/dist/src/server/home-sections/new-arrivals.d.ts +12 -0
- package/dist/src/server/home-sections/new-arrivals.d.ts.map +1 -0
- package/dist/src/server/home-sections/new-arrivals.js +28 -0
- package/dist/src/server/home-sections/promo-announcements.d.ts +7 -0
- package/dist/src/server/home-sections/promo-announcements.d.ts.map +1 -0
- package/dist/src/server/home-sections/promo-announcements.js +7 -0
- package/dist/src/server/home-sections/promo-countdown.d.ts +6 -0
- package/dist/src/server/home-sections/promo-countdown.d.ts.map +1 -0
- package/dist/src/server/home-sections/promo-countdown.js +5 -0
- package/dist/src/server/home-sections/shared.d.ts +10 -0
- package/dist/src/server/home-sections/shared.d.ts.map +1 -0
- package/dist/src/server/home-sections/shared.js +29 -0
- package/dist/src/server/home-sections/shop-by-age.d.ts +9 -0
- package/dist/src/server/home-sections/shop-by-age.d.ts.map +1 -0
- package/dist/src/server/home-sections/shop-by-age.js +17 -0
- package/dist/src/server/home-sections/shop-by-category.d.ts +10 -0
- package/dist/src/server/home-sections/shop-by-category.d.ts.map +1 -0
- package/dist/src/server/home-sections/shop-by-category.js +17 -0
- package/dist/src/server/home-sections/testimonials.d.ts +9 -0
- package/dist/src/server/home-sections/testimonials.d.ts.map +1 -0
- package/dist/src/server/home-sections/testimonials.js +9 -0
- package/dist/src/server/home-sections/theme-dresses.d.ts +12 -0
- package/dist/src/server/home-sections/theme-dresses.d.ts.map +1 -0
- package/dist/src/server/home-sections/theme-dresses.js +27 -0
- package/dist/src/server/home-sections/video-stories.d.ts +9 -0
- package/dist/src/server/home-sections/video-stories.d.ts.map +1 -0
- package/dist/src/server/home-sections/video-stories.js +9 -0
- package/dist/src/server/home-sections/why-choose-us.d.ts +9 -0
- package/dist/src/server/home-sections/why-choose-us.d.ts.map +1 -0
- package/dist/src/server/home-sections/why-choose-us.js +9 -0
- package/dist/{server → src/server}/home.d.ts +18 -9
- package/dist/src/server/home.d.ts.map +1 -0
- package/dist/src/server/home.js +1 -0
- package/dist/src/server/homepage-config.types.d.ts +274 -0
- package/dist/src/server/homepage-config.types.d.ts.map +1 -0
- package/dist/src/server/homepage-config.types.js +33 -0
- package/dist/{server → src/server}/homepage-section-defaults.d.ts +35 -2
- package/dist/src/server/homepage-section-defaults.d.ts.map +1 -0
- package/dist/{server → src/server}/homepage-section-defaults.js +41 -2
- package/dist/{server → src/server}/index.d.ts +2 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/{server → src/server}/index.js +2 -0
- package/dist/src/server/locale-actions.d.ts.map +1 -0
- package/dist/src/server/locales.d.ts.map +1 -0
- package/dist/src/server/normalize-homepage-config.d.ts +7 -0
- package/dist/src/server/normalize-homepage-config.d.ts.map +1 -0
- package/dist/src/server/normalize-homepage-config.js +213 -0
- package/dist/src/server/notifications.d.ts.map +1 -0
- package/dist/src/server/onboarding.d.ts.map +1 -0
- package/dist/src/server/orders.d.ts.map +1 -0
- package/dist/{server → src/server}/orders.js +6 -6
- package/dist/src/server/page-input.d.ts +19 -0
- package/dist/src/server/page-input.d.ts.map +1 -0
- package/dist/src/server/page-input.js +42 -0
- package/dist/src/server/payment-details.d.ts.map +1 -0
- package/dist/{server → src/server}/payment-details.js +5 -5
- package/dist/src/server/payment.d.ts.map +1 -0
- package/dist/{server → src/server}/payment.js +2 -2
- package/dist/src/server/pincode.d.ts.map +1 -0
- package/dist/src/server/products.d.ts.map +1 -0
- package/dist/src/server/regions.d.ts.map +1 -0
- package/dist/{server → src/server}/regions.js +2 -2
- package/dist/src/server/resolve-home-segment-data.d.ts +25 -0
- package/dist/src/server/resolve-home-segment-data.d.ts.map +1 -0
- package/dist/src/server/resolve-home-segment-data.js +20 -0
- package/dist/src/server/returns.d.ts.map +1 -0
- package/dist/src/server/shoppable-looks.d.ts +17 -0
- package/dist/src/server/shoppable-looks.d.ts.map +1 -0
- package/dist/src/server/shoppable-looks.js +136 -0
- package/dist/src/server/swaps.d.ts.map +1 -0
- package/dist/src/server/variants.d.ts.map +1 -0
- package/dist/src/server/wishlist.d.ts.map +1 -0
- package/dist/src/util/get-locale-header.d.ts.map +1 -0
- package/dist/src/util/medusa-error.d.ts.map +1 -0
- package/dist/src/util/revalidate-cart.d.ts.map +1 -0
- package/dist/src/util/sort-products.d.ts.map +1 -0
- package/dist/{util → src/util}/store-client.d.ts +0 -2
- package/dist/src/util/store-client.d.ts.map +1 -0
- package/dist/{util → src/util}/store-client.js +0 -2
- package/homepage-config.example.json +209 -0
- package/homepage-sections.example.json +55 -0
- package/package.json +120 -156
- package/segment-data/default-page-input.json +191 -0
- package/src/server/brand-pillars-from-categories.ts +156 -0
- package/src/server/cart.ts +20 -20
- package/src/server/config-merge.ts +31 -0
- package/src/server/customer.ts +11 -11
- package/src/server/dynamic-config.ts +507 -566
- package/src/server/fulfillment.ts +3 -3
- package/src/server/home-sections/about-brand.ts +24 -0
- package/src/server/home-sections/baptism-picks.ts +46 -0
- package/src/server/home-sections/baptism.ts +64 -0
- package/src/server/home-sections/blog-posts.ts +23 -0
- package/src/server/home-sections/brand-marquee.ts +17 -0
- package/src/server/home-sections/brand-pillars.ts +23 -0
- package/src/server/home-sections/category-pills.ts +32 -0
- package/src/server/home-sections/celebrity-trust.ts +42 -0
- package/src/server/home-sections/features.ts +23 -0
- package/src/server/home-sections/hero.ts +24 -0
- package/src/server/home-sections/instagram-posts.ts +23 -0
- package/src/server/home-sections/loved-by-moms.ts +34 -0
- package/src/server/home-sections/luxe-favourites.ts +30 -0
- package/src/server/home-sections/new-arrivals-classic.ts +21 -0
- package/src/server/home-sections/new-arrivals.ts +47 -0
- package/src/server/home-sections/promo-announcements.ts +17 -0
- package/src/server/home-sections/promo-countdown.ts +15 -0
- package/src/server/home-sections/shared.ts +44 -0
- package/src/server/home-sections/shop-by-age.ts +26 -0
- package/src/server/home-sections/shop-by-category.ts +28 -0
- package/src/server/home-sections/testimonials.ts +23 -0
- package/src/server/home-sections/theme-dresses.ts +49 -0
- package/src/server/home-sections/video-stories.ts +23 -0
- package/src/server/home-sections/why-choose-us.ts +23 -0
- package/src/server/home.ts +46 -207
- package/src/server/homepage-config.types.ts +335 -0
- package/src/server/homepage-section-defaults.ts +41 -2
- package/src/server/index.ts +2 -0
- package/src/server/normalize-homepage-config.ts +240 -0
- package/src/server/orders.ts +6 -6
- package/src/server/page-input.ts +66 -0
- package/src/server/payment-details.ts +5 -5
- package/src/server/payment.ts +2 -2
- package/src/server/regions.ts +2 -2
- package/src/server/resolve-home-segment-data.ts +63 -0
- package/src/server/shoppable-looks.ts +178 -0
- package/src/util/store-client.ts +0 -3
- package/dist/config.d.ts.map +0 -1
- package/dist/cookies.d.ts.map +0 -1
- package/dist/edge.d.ts.map +0 -1
- package/dist/middleware.d.ts.map +0 -1
- package/dist/server/cart.d.ts.map +0 -1
- package/dist/server/categories.d.ts.map +0 -1
- package/dist/server/collections.d.ts.map +0 -1
- package/dist/server/contact.d.ts.map +0 -1
- package/dist/server/customer-registration.d.ts.map +0 -1
- package/dist/server/customer.d.ts.map +0 -1
- package/dist/server/dynamic-config.d.ts +0 -202
- package/dist/server/dynamic-config.d.ts.map +0 -1
- package/dist/server/dynamic-config.js +0 -675
- package/dist/server/fulfillment.d.ts.map +0 -1
- package/dist/server/guest.d.ts.map +0 -1
- package/dist/server/home.d.ts.map +0 -1
- package/dist/server/home.js +0 -124
- package/dist/server/homepage-section-defaults.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/locale-actions.d.ts.map +0 -1
- package/dist/server/locales.d.ts.map +0 -1
- package/dist/server/notifications.d.ts.map +0 -1
- package/dist/server/onboarding.d.ts.map +0 -1
- package/dist/server/orders.d.ts.map +0 -1
- package/dist/server/payment-details.d.ts.map +0 -1
- package/dist/server/payment.d.ts.map +0 -1
- package/dist/server/pincode.d.ts.map +0 -1
- package/dist/server/products.d.ts.map +0 -1
- package/dist/server/regions.d.ts.map +0 -1
- package/dist/server/returns.d.ts.map +0 -1
- package/dist/server/swaps.d.ts.map +0 -1
- package/dist/server/variants.d.ts.map +0 -1
- package/dist/server/wishlist.d.ts.map +0 -1
- package/dist/util/get-locale-header.d.ts.map +0 -1
- package/dist/util/medusa-error.d.ts.map +0 -1
- package/dist/util/revalidate-cart.d.ts.map +0 -1
- package/dist/util/sort-products.d.ts.map +0 -1
- package/dist/util/store-client.d.ts.map +0 -1
- /package/dist/{config.d.ts → src/config.d.ts} +0 -0
- /package/dist/{config.js → src/config.js} +0 -0
- /package/dist/{cookies.d.ts → src/cookies.d.ts} +0 -0
- /package/dist/{cookies.js → src/cookies.js} +0 -0
- /package/dist/{edge.d.ts → src/edge.d.ts} +0 -0
- /package/dist/{edge.js → src/edge.js} +0 -0
- /package/dist/{middleware.d.ts → src/middleware.d.ts} +0 -0
- /package/dist/{middleware.js → src/middleware.js} +0 -0
- /package/dist/{server → src/server}/cart.d.ts +0 -0
- /package/dist/{server → src/server}/categories.d.ts +0 -0
- /package/dist/{server → src/server}/categories.js +0 -0
- /package/dist/{server → src/server}/collections.d.ts +0 -0
- /package/dist/{server → src/server}/collections.js +0 -0
- /package/dist/{server → src/server}/contact.d.ts +0 -0
- /package/dist/{server → src/server}/contact.js +0 -0
- /package/dist/{server → src/server}/customer-registration.d.ts +0 -0
- /package/dist/{server → src/server}/customer-registration.js +0 -0
- /package/dist/{server → src/server}/customer.d.ts +0 -0
- /package/dist/{server → src/server}/fulfillment.d.ts +0 -0
- /package/dist/{server → src/server}/guest.d.ts +0 -0
- /package/dist/{server → src/server}/guest.js +0 -0
- /package/dist/{server → src/server}/locale-actions.d.ts +0 -0
- /package/dist/{server → src/server}/locale-actions.js +0 -0
- /package/dist/{server → src/server}/locales.d.ts +0 -0
- /package/dist/{server → src/server}/locales.js +0 -0
- /package/dist/{server → src/server}/notifications.d.ts +0 -0
- /package/dist/{server → src/server}/notifications.js +0 -0
- /package/dist/{server → src/server}/onboarding.d.ts +0 -0
- /package/dist/{server → src/server}/onboarding.js +0 -0
- /package/dist/{server → src/server}/orders.d.ts +0 -0
- /package/dist/{server → src/server}/payment-details.d.ts +0 -0
- /package/dist/{server → src/server}/payment.d.ts +0 -0
- /package/dist/{server → src/server}/pincode.d.ts +0 -0
- /package/dist/{server → src/server}/pincode.js +0 -0
- /package/dist/{server → src/server}/products.d.ts +0 -0
- /package/dist/{server → src/server}/products.js +0 -0
- /package/dist/{server → src/server}/regions.d.ts +0 -0
- /package/dist/{server → src/server}/returns.d.ts +0 -0
- /package/dist/{server → src/server}/returns.js +0 -0
- /package/dist/{server → src/server}/swaps.d.ts +0 -0
- /package/dist/{server → src/server}/swaps.js +0 -0
- /package/dist/{server → src/server}/variants.d.ts +0 -0
- /package/dist/{server → src/server}/variants.js +0 -0
- /package/dist/{server → src/server}/wishlist.d.ts +0 -0
- /package/dist/{server → src/server}/wishlist.js +0 -0
- /package/dist/{util → src/util}/get-locale-header.d.ts +0 -0
- /package/dist/{util → src/util}/get-locale-header.js +0 -0
- /package/dist/{util → src/util}/medusa-error.d.ts +0 -0
- /package/dist/{util → src/util}/medusa-error.js +0 -0
- /package/dist/{util → src/util}/revalidate-cart.d.ts +0 -0
- /package/dist/{util → src/util}/revalidate-cart.js +0 -0
- /package/dist/{util → src/util}/sort-products.d.ts +0 -0
- /package/dist/{util → src/util}/sort-products.js +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import "server-only"
|
|
2
|
+
|
|
3
|
+
import { HttpTypes } from "@medusajs/types"
|
|
4
|
+
import { fetchRatings } from "medusa-reviews-logic/server"
|
|
5
|
+
import { getHomeSectionsCopyFromPageInput } from "../dynamic-config"
|
|
6
|
+
import { listCategories } from "../categories"
|
|
7
|
+
import { getProductsByTag } from "../products"
|
|
8
|
+
import {
|
|
9
|
+
categoryIdsMatching,
|
|
10
|
+
productsForCategoryIds,
|
|
11
|
+
requireRegion,
|
|
12
|
+
type SectionLoaderOptions,
|
|
13
|
+
} from "./shared"
|
|
14
|
+
|
|
15
|
+
export type ThemeDressesSectionData = {
|
|
16
|
+
region: NonNullable<Awaited<ReturnType<typeof requireRegion>>>
|
|
17
|
+
themeProducts: HttpTypes.StoreProduct[]
|
|
18
|
+
ratings: unknown[]
|
|
19
|
+
copy: ReturnType<typeof getHomeSectionsCopyFromPageInput>["themeDresses"]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function loadThemeDressesSectionData(
|
|
23
|
+
countryCode: string,
|
|
24
|
+
options?: SectionLoaderOptions
|
|
25
|
+
): Promise<ThemeDressesSectionData | null> {
|
|
26
|
+
const region = await requireRegion(countryCode)
|
|
27
|
+
if (!region) return null
|
|
28
|
+
const pageInput = options?.pageInput ?? null
|
|
29
|
+
const [themeByTag, categoriesResult, ratings] = await Promise.all([
|
|
30
|
+
getProductsByTag({ tagValue: "theme", limit: 8, countryCode }).catch(() => []),
|
|
31
|
+
listCategories({ limit: 100 }).catch(() => []),
|
|
32
|
+
fetchRatings(),
|
|
33
|
+
])
|
|
34
|
+
const categories = (categoriesResult ?? []) as HttpTypes.StoreProductCategory[]
|
|
35
|
+
const themeProducts =
|
|
36
|
+
themeByTag.length > 0
|
|
37
|
+
? themeByTag
|
|
38
|
+
: await productsForCategoryIds(
|
|
39
|
+
countryCode,
|
|
40
|
+
categoryIdsMatching(categories, /theme/),
|
|
41
|
+
8
|
|
42
|
+
)
|
|
43
|
+
return {
|
|
44
|
+
region,
|
|
45
|
+
themeProducts,
|
|
46
|
+
ratings: ratings ?? [],
|
|
47
|
+
copy: getHomeSectionsCopyFromPageInput(pageInput).themeDresses,
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "server-only"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
getHomeSectionsCopyFromPageInput,
|
|
5
|
+
getVideoStoriesFromPageInput,
|
|
6
|
+
} from "../dynamic-config"
|
|
7
|
+
import type { SectionLoaderOptions } from "./shared"
|
|
8
|
+
|
|
9
|
+
export type VideoStoriesSectionData = {
|
|
10
|
+
videoStories: ReturnType<typeof getVideoStoriesFromPageInput>
|
|
11
|
+
copy: ReturnType<typeof getHomeSectionsCopyFromPageInput>["videoStories"]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function loadVideoStoriesSectionData(
|
|
15
|
+
_countryCode: string,
|
|
16
|
+
options?: SectionLoaderOptions
|
|
17
|
+
): Promise<VideoStoriesSectionData> {
|
|
18
|
+
const pageInput = options?.pageInput ?? null
|
|
19
|
+
return {
|
|
20
|
+
videoStories: getVideoStoriesFromPageInput(pageInput),
|
|
21
|
+
copy: getHomeSectionsCopyFromPageInput(pageInput).videoStories,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "server-only"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
getFeaturesFromPageInput,
|
|
5
|
+
getHomeSectionsCopyFromPageInput,
|
|
6
|
+
} from "../dynamic-config"
|
|
7
|
+
import type { SectionLoaderOptions } from "./shared"
|
|
8
|
+
|
|
9
|
+
export type WhyChooseUsSectionData = {
|
|
10
|
+
whyChooseUsFeatures: ReturnType<typeof getFeaturesFromPageInput>
|
|
11
|
+
copy: ReturnType<typeof getHomeSectionsCopyFromPageInput>["whyChooseUs"]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function loadWhyChooseUsSectionData(
|
|
15
|
+
_countryCode: string,
|
|
16
|
+
options?: SectionLoaderOptions
|
|
17
|
+
): Promise<WhyChooseUsSectionData> {
|
|
18
|
+
const pageInput = options?.pageInput ?? null
|
|
19
|
+
return {
|
|
20
|
+
whyChooseUsFeatures: getFeaturesFromPageInput(pageInput),
|
|
21
|
+
copy: getHomeSectionsCopyFromPageInput(pageInput).whyChooseUs,
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/server/home.ts
CHANGED
|
@@ -1,211 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
getBlogPostsFromConfig,
|
|
15
|
-
getPromoCountdownFromConfig,
|
|
16
|
-
getHomeSectionsCopyFromConfig,
|
|
17
|
-
getTrustFeaturesFromConfig,
|
|
18
|
-
type AboutBrandConfig,
|
|
19
|
-
type BrandPillarConfig,
|
|
20
|
-
type BlogPostConfig,
|
|
21
|
-
type HomeSectionsCopy,
|
|
22
|
-
type TrustFeaturesConfig,
|
|
23
|
-
} from "./dynamic-config";
|
|
24
|
-
import { fetchRatings } from "medusa-reviews-logic/server";
|
|
25
|
-
|
|
26
|
-
async function productsForCategoryIds(
|
|
27
|
-
countryCode: string,
|
|
28
|
-
categoryIds: string[],
|
|
29
|
-
limit: number
|
|
30
|
-
): Promise<HttpTypes.StoreProduct[]> {
|
|
31
|
-
if (!categoryIds.length) return [];
|
|
32
|
-
try {
|
|
33
|
-
const { response } = await listProducts({
|
|
34
|
-
countryCode,
|
|
35
|
-
queryParams: {
|
|
36
|
-
category_id: categoryIds,
|
|
37
|
-
limit,
|
|
38
|
-
} as HttpTypes.FindParams & HttpTypes.StoreProductListParams,
|
|
39
|
-
});
|
|
40
|
-
return response.products ?? [];
|
|
41
|
-
} catch {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function categoryIdsMatching(
|
|
47
|
-
categories: HttpTypes.StoreProductCategory[],
|
|
48
|
-
pattern: RegExp
|
|
49
|
-
): string[] {
|
|
50
|
-
return categories
|
|
51
|
-
.filter((c) => pattern.test((c.name || c.handle || "").toLowerCase()))
|
|
52
|
-
.map((c) => c.id)
|
|
53
|
-
.filter(Boolean) as string[];
|
|
54
|
-
}
|
|
55
|
-
|
|
1
|
+
import type { HttpTypes } from "@medusajs/types"
|
|
2
|
+
import type {
|
|
3
|
+
InstagramPostsData,
|
|
4
|
+
AboutBrandConfig,
|
|
5
|
+
BrandPillarConfig,
|
|
6
|
+
BlogPostConfig,
|
|
7
|
+
HomeSectionsCopy,
|
|
8
|
+
TrustFeaturesConfig,
|
|
9
|
+
HomepageBanner,
|
|
10
|
+
} from "./dynamic-config"
|
|
11
|
+
import type { ShoppableLook } from "./shoppable-looks"
|
|
12
|
+
|
|
13
|
+
/** Shape returned by the legacy `loadHomePageData` loader (removed — use per-section loaders). */
|
|
56
14
|
export type HomePageData = {
|
|
57
|
-
region:
|
|
58
|
-
collections: Array<Record<string, unknown
|
|
59
|
-
categories: HttpTypes.StoreProductCategory[]
|
|
60
|
-
newArrivals: HttpTypes.StoreProduct[]
|
|
61
|
-
bestsellers: HttpTypes.StoreProduct[]
|
|
62
|
-
testimonials: unknown | null
|
|
63
|
-
ratings: unknown[]
|
|
64
|
-
videoStories: { title: string; videoUrls: string[] } | null
|
|
65
|
-
announcementMessages: string[]
|
|
15
|
+
region: HttpTypes.StoreRegion | null
|
|
16
|
+
collections: Array<Record<string, unknown>>
|
|
17
|
+
categories: HttpTypes.StoreProductCategory[]
|
|
18
|
+
newArrivals: HttpTypes.StoreProduct[]
|
|
19
|
+
bestsellers: HttpTypes.StoreProduct[]
|
|
20
|
+
testimonials: unknown | null
|
|
21
|
+
ratings: unknown[]
|
|
22
|
+
videoStories: { title: string; videoUrls: string[] } | null
|
|
23
|
+
announcementMessages: string[]
|
|
66
24
|
promoCountdown: {
|
|
67
|
-
code: string | null
|
|
68
|
-
message: string | null
|
|
69
|
-
endAt: string | null
|
|
70
|
-
active: boolean
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const [
|
|
93
|
-
collectionsResult,
|
|
94
|
-
categoriesResult,
|
|
95
|
-
newArrivalsResult,
|
|
96
|
-
bestsellersResult,
|
|
97
|
-
testimonialsData,
|
|
98
|
-
allRatings,
|
|
99
|
-
videoStoriesData,
|
|
100
|
-
announcementMessages,
|
|
101
|
-
promoCountdown,
|
|
102
|
-
aboutBrand,
|
|
103
|
-
brandPillars,
|
|
104
|
-
blogPosts,
|
|
105
|
-
themeByTag,
|
|
106
|
-
baptismByTag,
|
|
107
|
-
sectionsCopy,
|
|
108
|
-
trustFeatures,
|
|
109
|
-
] = await Promise.all([
|
|
110
|
-
listCollections({ fields: "id, handle, title, metadata" }).catch(() => ({
|
|
111
|
-
collections: [],
|
|
112
|
-
})),
|
|
113
|
-
listCategories({ limit: 100 }).catch(() => []),
|
|
114
|
-
listProductsWithSort({
|
|
115
|
-
page: 1,
|
|
116
|
-
queryParams: { limit: 12 },
|
|
117
|
-
sortBy: "created_at",
|
|
118
|
-
countryCode,
|
|
119
|
-
}).catch(() => ({ response: { products: [] } })),
|
|
120
|
-
getProductsByTag({
|
|
121
|
-
tagValue: "bestseller",
|
|
122
|
-
limit: 10,
|
|
123
|
-
countryCode,
|
|
124
|
-
}).catch(() => []),
|
|
125
|
-
getTestimonialsFromConfig().catch(() => ({
|
|
126
|
-
title: "",
|
|
127
|
-
testimonials: [],
|
|
128
|
-
})),
|
|
129
|
-
fetchRatings(),
|
|
130
|
-
getVideoStoriesFromConfig().catch(() => ({
|
|
131
|
-
title: "",
|
|
132
|
-
videoUrls: [],
|
|
133
|
-
})),
|
|
134
|
-
getAnnouncementMessagesFromConfig(),
|
|
135
|
-
getPromoCountdownFromConfig(),
|
|
136
|
-
getAboutBrandFromConfig(),
|
|
137
|
-
getBrandPillarsFromConfig(),
|
|
138
|
-
getBlogPostsFromConfig(),
|
|
139
|
-
getProductsByTag({ tagValue: "theme", limit: 8, countryCode }).catch(() => []),
|
|
140
|
-
getProductsByTag({ tagValue: "baptism", limit: 12, countryCode }).catch(() => []),
|
|
141
|
-
getHomeSectionsCopyFromConfig(),
|
|
142
|
-
getTrustFeaturesFromConfig(),
|
|
143
|
-
]);
|
|
144
|
-
|
|
145
|
-
const categories = (categoriesResult ?? []) as HttpTypes.StoreProductCategory[];
|
|
146
|
-
const collections =
|
|
147
|
-
(collectionsResult as { collections?: unknown[] }).collections ?? [];
|
|
148
|
-
const newArrivals =
|
|
149
|
-
(newArrivalsResult as { response?: { products?: HttpTypes.StoreProduct[] } })
|
|
150
|
-
.response?.products ?? [];
|
|
151
|
-
const bestsellers = (bestsellersResult ?? []) as HttpTypes.StoreProduct[];
|
|
152
|
-
|
|
153
|
-
const girlIds = categoryIdsMatching(categories, /baptism.*girl|girl.*baptism|^girl$/);
|
|
154
|
-
const boyIds = categoryIdsMatching(categories, /baptism.*boy|boy.*baptism|^boy$/);
|
|
155
|
-
const baptismIds = categoryIdsMatching(categories, /baptism/);
|
|
156
|
-
|
|
157
|
-
const [baptismGirl, baptismBoy] = await Promise.all([
|
|
158
|
-
girlIds.length
|
|
159
|
-
? productsForCategoryIds(countryCode, girlIds, 8)
|
|
160
|
-
: baptismByTag.filter((p) => /girl/i.test(p.title || "")).slice(0, 8),
|
|
161
|
-
boyIds.length
|
|
162
|
-
? productsForCategoryIds(countryCode, boyIds, 8)
|
|
163
|
-
: baptismByTag.filter((p) => /boy/i.test(p.title || "")).slice(0, 8),
|
|
164
|
-
]);
|
|
165
|
-
|
|
166
|
-
let baptismFallback: HttpTypes.StoreProduct[] = [];
|
|
167
|
-
if (baptismGirl.length === 0 && baptismBoy.length === 0) {
|
|
168
|
-
baptismFallback =
|
|
169
|
-
baptismIds.length > 0
|
|
170
|
-
? await productsForCategoryIds(countryCode, baptismIds, 12)
|
|
171
|
-
: baptismByTag;
|
|
25
|
+
code: string | null
|
|
26
|
+
message: string | null
|
|
27
|
+
endAt: string | null
|
|
28
|
+
active: boolean
|
|
29
|
+
ctaLabel: string | null
|
|
30
|
+
ctaHref: string | null
|
|
31
|
+
}
|
|
32
|
+
luxeFavourites: HttpTypes.StoreProduct[]
|
|
33
|
+
celebrityProduct: HttpTypes.StoreProduct | null
|
|
34
|
+
baptismGirl: HttpTypes.StoreProduct[]
|
|
35
|
+
baptismBoy: HttpTypes.StoreProduct[]
|
|
36
|
+
baptismPicks: ShoppableLook[]
|
|
37
|
+
themeProducts: HttpTypes.StoreProduct[]
|
|
38
|
+
aboutBrand: AboutBrandConfig
|
|
39
|
+
brandPillars: { sectionTitle: string; pillars: BrandPillarConfig[] }
|
|
40
|
+
blogPosts: BlogPostConfig[]
|
|
41
|
+
instagramPosts: InstagramPostsData
|
|
42
|
+
sectionsCopy: HomeSectionsCopy
|
|
43
|
+
trustFeatures: TrustFeaturesConfig
|
|
44
|
+
homeBanners: HomepageBanner[] | null
|
|
45
|
+
appBanners: HomepageBanner[] | null
|
|
46
|
+
whyChooseUsFeatures: {
|
|
47
|
+
title: string
|
|
48
|
+
features: Array<{ name: string; icon: string }>
|
|
172
49
|
}
|
|
173
|
-
|
|
174
|
-
const resolvedBaptismGirl =
|
|
175
|
-
baptismGirl.length > 0 ? baptismGirl : baptismFallback.slice(0, 8);
|
|
176
|
-
const resolvedBaptismBoy =
|
|
177
|
-
baptismBoy.length > 0 ? baptismBoy : baptismFallback.slice(0, 8);
|
|
178
|
-
|
|
179
|
-
const themeProducts =
|
|
180
|
-
themeByTag.length > 0
|
|
181
|
-
? themeByTag
|
|
182
|
-
: await productsForCategoryIds(
|
|
183
|
-
countryCode,
|
|
184
|
-
categoryIdsMatching(categories, /theme/),
|
|
185
|
-
8
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
region,
|
|
190
|
-
collections: collections as Array<Record<string, unknown>>,
|
|
191
|
-
categories,
|
|
192
|
-
newArrivals,
|
|
193
|
-
bestsellers,
|
|
194
|
-
testimonials: testimonialsData,
|
|
195
|
-
ratings: allRatings ?? [],
|
|
196
|
-
videoStories: videoStoriesData,
|
|
197
|
-
announcementMessages,
|
|
198
|
-
promoCountdown,
|
|
199
|
-
luxeFavourites: bestsellers.slice(0, 4),
|
|
200
|
-
celebrityProduct: bestsellers[0] ?? newArrivals[0] ?? null,
|
|
201
|
-
baptismGirl: resolvedBaptismGirl,
|
|
202
|
-
baptismBoy: resolvedBaptismBoy,
|
|
203
|
-
baptismPicks: (baptismByTag.length ? baptismByTag : baptismFallback).slice(0, 5),
|
|
204
|
-
themeProducts,
|
|
205
|
-
aboutBrand,
|
|
206
|
-
brandPillars,
|
|
207
|
-
blogPosts,
|
|
208
|
-
sectionsCopy,
|
|
209
|
-
trustFeatures,
|
|
210
|
-
};
|
|
211
50
|
}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medusa `GET /store/dynamic-config` → `homepage-config` shape.
|
|
3
|
+
* Used by the storefront and as the reference for backend admin JSON.
|
|
4
|
+
*
|
|
5
|
+
* Section keys: camelCase (preferred) or kebab-case (`new-arrivals` → `newArrivals`).
|
|
6
|
+
* Only fields you set override package defaults in `homepage-section-defaults.ts`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Shared copy fields merged into every section block. */
|
|
10
|
+
export type HomepageSectionCopyFields = {
|
|
11
|
+
title?: string
|
|
12
|
+
name?: string
|
|
13
|
+
subtitle?: string
|
|
14
|
+
text?: string
|
|
15
|
+
description?: string
|
|
16
|
+
eyebrow?: string
|
|
17
|
+
/** Layout variant, e.g. new arrivals: `grid` | `classic` */
|
|
18
|
+
variant?: string
|
|
19
|
+
layout?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type HomepagePromoAnnouncementsSection = HomepageSectionCopyFields & {
|
|
23
|
+
messages?: string[]
|
|
24
|
+
items?: Array<string | { message?: string; text?: string }>
|
|
25
|
+
"announcement-messages"?: string[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type HomepagePromoCountdownSection = HomepageSectionCopyFields & {
|
|
29
|
+
code?: string
|
|
30
|
+
"coupon-code"?: string
|
|
31
|
+
text?: string
|
|
32
|
+
message?: string
|
|
33
|
+
"promo-text"?: string
|
|
34
|
+
"end-at"?: string
|
|
35
|
+
endAt?: string
|
|
36
|
+
active?: boolean
|
|
37
|
+
"promo-active"?: boolean
|
|
38
|
+
"cta-label"?: string
|
|
39
|
+
"cta-href"?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type HomepageNewArrivalsSection = HomepageSectionCopyFields & {
|
|
43
|
+
/** `grid` (ProductCardView) or `classic` (ProductPreview + pink background) */
|
|
44
|
+
variant?: "grid" | "classic" | "legacy" | "preview"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type HomepageTestimonialItem = {
|
|
48
|
+
text?: string
|
|
49
|
+
name?: string
|
|
50
|
+
rating?: number
|
|
51
|
+
avatar?: string
|
|
52
|
+
id?: string
|
|
53
|
+
testimonial?: HomepageTestimonialItem
|
|
54
|
+
review?: HomepageTestimonialItem
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type HomepageTestimonialsSection = HomepageSectionCopyFields & {
|
|
58
|
+
items?: HomepageTestimonialItem[]
|
|
59
|
+
testimonials?: HomepageTestimonialItem[]
|
|
60
|
+
reviews?: HomepageTestimonialItem[]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type HomepageRatingItem = HomepageTestimonialItem
|
|
64
|
+
|
|
65
|
+
export type HomepageShoppableLook = {
|
|
66
|
+
image?: string
|
|
67
|
+
"look-image"?: string
|
|
68
|
+
"product-ids"?: string[]
|
|
69
|
+
productIds?: string[]
|
|
70
|
+
"product-handles"?: string[]
|
|
71
|
+
productHandles?: string[]
|
|
72
|
+
look?: HomepageShoppableLook
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type HomepageBaptismPicksSection = HomepageSectionCopyFields & {
|
|
76
|
+
looks?: HomepageShoppableLook[]
|
|
77
|
+
"shop-looks"?: HomepageShoppableLook[]
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type HomepageAboutBrandStat = {
|
|
81
|
+
label?: string
|
|
82
|
+
name?: string
|
|
83
|
+
value?: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type HomepageAboutBrandSection = HomepageSectionCopyFields & {
|
|
87
|
+
readMoreHref?: string
|
|
88
|
+
"read-more-link"?: string
|
|
89
|
+
stats?: HomepageAboutBrandStat[]
|
|
90
|
+
"about-stats"?: HomepageAboutBrandStat[]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type HomepageBrandPillar = {
|
|
94
|
+
title?: string
|
|
95
|
+
name?: string
|
|
96
|
+
description?: string
|
|
97
|
+
text?: string
|
|
98
|
+
image?: string
|
|
99
|
+
icon?: string
|
|
100
|
+
pillar?: HomepageBrandPillar
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type HomepageBrandPillarsSection = HomepageSectionCopyFields & {
|
|
104
|
+
pillars?: HomepageBrandPillar[]
|
|
105
|
+
"brand-pillars"?: HomepageBrandPillar[]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type HomepageFeatureItem = {
|
|
109
|
+
name?: string
|
|
110
|
+
icon?: string
|
|
111
|
+
"feature-name"?: string
|
|
112
|
+
"feature-icon"?: string
|
|
113
|
+
feature?: HomepageFeatureItem
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type HomepageFeaturesSection = HomepageSectionCopyFields & {
|
|
117
|
+
features?: HomepageFeatureItem[]
|
|
118
|
+
items?: HomepageFeatureItem[]
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type HomepageBlogPost = {
|
|
122
|
+
title?: string
|
|
123
|
+
href?: string
|
|
124
|
+
link?: string
|
|
125
|
+
url?: string
|
|
126
|
+
excerpt?: string
|
|
127
|
+
description?: string
|
|
128
|
+
category?: string
|
|
129
|
+
tag?: string
|
|
130
|
+
date?: string
|
|
131
|
+
image?: string
|
|
132
|
+
thumbnail?: string
|
|
133
|
+
blog?: HomepageBlogPost
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type HomepageBlogPostsSection = HomepageSectionCopyFields & {
|
|
137
|
+
posts?: HomepageBlogPost[]
|
|
138
|
+
"blog-posts"?: HomepageBlogPost[]
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type HomepageInstagramPost = {
|
|
142
|
+
id?: string
|
|
143
|
+
image?: string
|
|
144
|
+
"post-image"?: string
|
|
145
|
+
url?: string
|
|
146
|
+
link?: string
|
|
147
|
+
post?: HomepageInstagramPost
|
|
148
|
+
instagram?: HomepageInstagramPost
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export type HomepageInstagramPostsSection = HomepageSectionCopyFields & {
|
|
152
|
+
handle?: string
|
|
153
|
+
username?: string
|
|
154
|
+
"instagram-handle"?: string
|
|
155
|
+
"profile-url"?: string
|
|
156
|
+
profileUrl?: string
|
|
157
|
+
"profile-image"?: string
|
|
158
|
+
profileImage?: string
|
|
159
|
+
posts?: HomepageInstagramPost[]
|
|
160
|
+
items?: HomepageInstagramPost[]
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type HomepageVideoStoryEntry =
|
|
164
|
+
| string
|
|
165
|
+
| {
|
|
166
|
+
"video-url"?: string
|
|
167
|
+
video_url?: string
|
|
168
|
+
url?: string
|
|
169
|
+
src?: string
|
|
170
|
+
video?: string
|
|
171
|
+
"video-story"?: Record<string, unknown>
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type HomepageVideoStoriesSection = HomepageSectionCopyFields & {
|
|
175
|
+
"video-urls"?: HomepageVideoStoryEntry[]
|
|
176
|
+
videoUrls?: HomepageVideoStoryEntry[]
|
|
177
|
+
videos?: HomepageVideoStoryEntry[]
|
|
178
|
+
"video-stories"?: HomepageVideoStoryEntry[]
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Per-section blocks under `homepage-config.sections`. */
|
|
182
|
+
export type HomepageSectionsConfig = {
|
|
183
|
+
promoAnnouncements?: HomepagePromoAnnouncementsSection
|
|
184
|
+
hero?: HomepageSectionCopyFields
|
|
185
|
+
categoryPills?: HomepageSectionCopyFields
|
|
186
|
+
newArrivals?: HomepageNewArrivalsSection
|
|
187
|
+
newArrivalsClassic?: HomepageNewArrivalsSection
|
|
188
|
+
promoCountdown?: HomepagePromoCountdownSection
|
|
189
|
+
celebrityTrust?: HomepageSectionCopyFields
|
|
190
|
+
luxeFavourites?: HomepageSectionCopyFields
|
|
191
|
+
shopByCategory?: HomepageSectionCopyFields
|
|
192
|
+
baptism?: HomepageSectionCopyFields
|
|
193
|
+
baptismPicks?: HomepageBaptismPicksSection
|
|
194
|
+
themeDresses?: HomepageSectionCopyFields
|
|
195
|
+
brandMarquee?: HomepageSectionCopyFields
|
|
196
|
+
aboutBrand?: HomepageAboutBrandSection
|
|
197
|
+
testimonials?: HomepageTestimonialsSection
|
|
198
|
+
brandPillars?: HomepageBrandPillarsSection
|
|
199
|
+
instagramPosts?: HomepageInstagramPostsSection
|
|
200
|
+
features?: HomepageFeaturesSection
|
|
201
|
+
shopByAge?: HomepageSectionCopyFields
|
|
202
|
+
whyChooseUs?: HomepageFeaturesSection
|
|
203
|
+
lovedByMoms?: HomepageSectionCopyFields
|
|
204
|
+
videoStories?: HomepageVideoStoriesSection
|
|
205
|
+
blogPosts?: HomepageBlogPostsSection
|
|
206
|
+
/** Allow kebab-case keys from legacy CMS */
|
|
207
|
+
[sectionKey: string]: HomepageSectionCopyFields | undefined
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type HomepageBanner = {
|
|
211
|
+
"homepage-banner-image"?: string
|
|
212
|
+
"homepage-banner-title"?: string
|
|
213
|
+
"homepage-banner-subtitle"?: string
|
|
214
|
+
"homepage-banner-description"?: string
|
|
215
|
+
"homepage-banner-button-name"?: string
|
|
216
|
+
"homepage-banner-button-link"?: string
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export type HomepageBannerEntry = {
|
|
220
|
+
"homepage-banner"?: HomepageBanner
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export type HomepageAppBanner = {
|
|
224
|
+
"app-banner-image"?: string
|
|
225
|
+
"app-banner-title"?: string
|
|
226
|
+
"app-banner-subtitle"?: string
|
|
227
|
+
"app-banner-description"?: string
|
|
228
|
+
"app-banner-button-name"?: string
|
|
229
|
+
"app-banner-button-link"?: string
|
|
230
|
+
"app-banner-link"?: string
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export type HomepageAppBannerEntry = {
|
|
234
|
+
"app-banner"?: HomepageAppBanner
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export type HomepageContactConfig = {
|
|
238
|
+
"contact-phone"?: string
|
|
239
|
+
"contact-email"?: string
|
|
240
|
+
"contact-address"?: string
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export type HomepageSocialLink = {
|
|
244
|
+
"social-platform-name"?: string
|
|
245
|
+
"social-platform-icon"?: string
|
|
246
|
+
"social-platform-url"?: string
|
|
247
|
+
"social-link"?: HomepageSocialLink
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export type HomepagePromoBarConfig = {
|
|
251
|
+
"promo-text"?: string
|
|
252
|
+
"promo-code"?: string
|
|
253
|
+
"promo-value"?: string
|
|
254
|
+
"promo-active"?: boolean
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export type HomepageFaqEntry = {
|
|
258
|
+
"faq-category"?: string
|
|
259
|
+
"faq-question"?: string
|
|
260
|
+
"faq-answer"?: string
|
|
261
|
+
faq?: HomepageFaqEntry
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Root `homepage-config` object stored in Medusa dynamic config.
|
|
266
|
+
*/
|
|
267
|
+
export type HomepageConfig = {
|
|
268
|
+
logo?: string
|
|
269
|
+
"website-description"?: string
|
|
270
|
+
website_description?: string
|
|
271
|
+
|
|
272
|
+
/** Hero carousel — used by `hero` section (not `sections.hero`). */
|
|
273
|
+
"homepage-banner-array"?: HomepageBannerEntry[]
|
|
274
|
+
|
|
275
|
+
"app-banner-array"?: HomepageAppBannerEntry[]
|
|
276
|
+
|
|
277
|
+
/** Option 1 — central section copy + structured data (preferred). */
|
|
278
|
+
sections?: HomepageSectionsConfig
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Product reviews for testimonials carousel.
|
|
282
|
+
* Fallback when `sections.testimonials.items` is empty.
|
|
283
|
+
*/
|
|
284
|
+
ratings?: HomepageRatingItem[]
|
|
285
|
+
|
|
286
|
+
/** Legacy top-level keys (still read; prefer `sections.*`). */
|
|
287
|
+
"promo-bar"?: HomepagePromoBarConfig
|
|
288
|
+
"contact-us"?: HomepageContactConfig
|
|
289
|
+
"social-links"?: HomepageSocialLink[]
|
|
290
|
+
"faq-array"?: HomepageFaqEntry[]
|
|
291
|
+
"why-choose-us-title"?: string
|
|
292
|
+
"why-choose-us-features"?: HomepageFeatureItem[]
|
|
293
|
+
"about-brand"?: HomepageAboutBrandSection
|
|
294
|
+
"who-we-are"?: HomepageAboutBrandSection
|
|
295
|
+
"video-stories"?: HomepageVideoStoryEntry[]
|
|
296
|
+
"video-stories-array"?: HomepageVideoStoryEntry[]
|
|
297
|
+
video_stories?: HomepageVideoStoryEntry[]
|
|
298
|
+
"announcement-messages"?: string[]
|
|
299
|
+
"announcement-bar"?: string[]
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** Full dynamic config API response. */
|
|
303
|
+
export type DynamicConfigResponse = {
|
|
304
|
+
"homepage-config"?: HomepageConfig
|
|
305
|
+
[key: string]: unknown
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** All section ids with package defaults. */
|
|
309
|
+
export const HOMEPAGE_SECTION_IDS = [
|
|
310
|
+
"promoAnnouncements",
|
|
311
|
+
"hero",
|
|
312
|
+
"categoryPills",
|
|
313
|
+
"newArrivals",
|
|
314
|
+
"newArrivalsClassic",
|
|
315
|
+
"promoCountdown",
|
|
316
|
+
"celebrityTrust",
|
|
317
|
+
"luxeFavourites",
|
|
318
|
+
"shopByCategory",
|
|
319
|
+
"baptism",
|
|
320
|
+
"baptismPicks",
|
|
321
|
+
"themeDresses",
|
|
322
|
+
"brandMarquee",
|
|
323
|
+
"aboutBrand",
|
|
324
|
+
"testimonials",
|
|
325
|
+
"brandPillars",
|
|
326
|
+
"instagramPosts",
|
|
327
|
+
"features",
|
|
328
|
+
"shopByAge",
|
|
329
|
+
"whyChooseUs",
|
|
330
|
+
"lovedByMoms",
|
|
331
|
+
"videoStories",
|
|
332
|
+
"blogPosts",
|
|
333
|
+
] as const
|
|
334
|
+
|
|
335
|
+
export type HomepageSectionId = (typeof HOMEPAGE_SECTION_IDS)[number]
|