storefront-layouts 1.0.13 → 1.0.14
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/editor/blocks/defaults/clothing-minimal-home.d.ts.map +1 -1
- package/dist/editor/blocks/defaults/clothing-minimal-home.js +0 -17
- package/dist/editor/payaza-form/PayazaFormEditor.d.ts.map +1 -1
- package/dist/editor/payaza-form/PayazaFormEditor.js +0 -2
- package/dist/editor/payaza-form/data-transformer.d.ts.map +1 -1
- package/dist/editor/payaza-form/data-transformer.js +1 -8
- package/dist/editor/shared/useEditorChromeMetrics.js +1 -2
- package/dist/hooks/use-pdp-variation.d.ts +1 -13
- package/dist/hooks/use-pdp-variation.d.ts.map +1 -1
- package/dist/hooks/use-product-variation-selection.d.ts +1 -13
- package/dist/hooks/use-product-variation-selection.d.ts.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +7 -11
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductDetailPage.js +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +1 -7
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts +1 -1
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +5 -21
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +1 -1
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +2 -2
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +2 -2
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/MenuPage.js +1 -0
- package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/food-modern/components/FoodHomePageModern.js +1 -1
- package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/MenuPage.js +1 -0
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/shared/components/PromoBanner.d.ts +4 -1
- package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -1
- package/dist/layouts/shared/components/PromoBanner.js +2 -2
- package/dist/layouts/shared/components/StoreCartSheet.d.ts.map +1 -1
- package/dist/layouts/shared/components/StoreCartSheet.js +4 -2
- package/dist/layouts/shared/components/StoreFooter.js +2 -2
- package/dist/layouts/shared/components/StoreHeader.js +4 -4
- package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/CartPage.js +4 -28
- package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/CheckoutPage.js +203 -81
- package/dist/layouts/shared/pages/MaintenancePage.js +1 -1
- package/dist/layouts/shared/wrappers/ClothingLayout.js +5 -5
- package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +4 -4
- package/dist/layouts/shared/wrappers/ElectronicsLayout.js +4 -4
- package/dist/layouts/shared/wrappers/FoodModernLayout.js +4 -4
- package/dist/layouts/shared/wrappers/MotivationalLayout.js +4 -4
- package/dist/layouts/shared/wrappers/StandardLayout.js +4 -4
- package/dist/lib/cart-charge-currency.d.ts +16 -0
- package/dist/lib/cart-charge-currency.d.ts.map +1 -0
- package/dist/lib/cart-charge-currency.js +38 -0
- package/dist/lib/checkout-phone-validation.d.ts +3 -0
- package/dist/lib/checkout-phone-validation.d.ts.map +1 -0
- package/dist/lib/checkout-phone-validation.js +41 -0
- package/dist/lib/preview-data.d.ts.map +1 -1
- package/dist/lib/preview-data.js +2 -0
- package/dist/lib/rich-html.d.ts +1 -2
- package/dist/lib/rich-html.d.ts.map +1 -1
- package/dist/lib/services/fees.service.d.ts +40 -57
- package/dist/lib/services/fees.service.d.ts.map +1 -1
- package/dist/lib/services/fees.service.js +24 -120
- package/dist/lib/store-types.d.ts +27 -34
- package/dist/lib/store-types.d.ts.map +1 -1
- package/dist/lib/utils/fee-calculations.d.ts.map +1 -1
- package/dist/lib/utils/fee-calculations.js +23 -11
- package/dist/preview/LayoutPreview.d.ts.map +1 -1
- package/dist/preview/LayoutPreview.js +5 -22
- package/dist/styles/index.css +36 -0
- package/dist/utils/price-display.d.ts +3 -0
- package/dist/utils/price-display.d.ts.map +1 -0
- package/dist/utils/price-display.js +8 -0
- package/package.json +2 -1
|
@@ -11,9 +11,7 @@ import { formatCurrency, filterActiveProducts } from '../../../lib/utils';
|
|
|
11
11
|
import { countProductsInCategoryTree, getCategoriesForDisplay, } from '../../../lib/utils/category-tree';
|
|
12
12
|
import { getLayoutText, getBannerImage, resolveClothingMinimalHeroBadge } from '../../../lib/utils/asset-helpers';
|
|
13
13
|
import { PromoBanner } from '../../shared/components/PromoBanner';
|
|
14
|
-
import { DynamicIcon } from '../../../components/ui/dynamic-icon';
|
|
15
14
|
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml';
|
|
16
|
-
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt';
|
|
17
15
|
export function ClothingHomePageMinimal({ storeConfig: initialConfig }) {
|
|
18
16
|
const { store, addToCart } = useStore();
|
|
19
17
|
const storeConfig = store || initialConfig;
|
|
@@ -54,11 +52,7 @@ export function ClothingHomePageMinimal({ storeConfig: initialConfig }) {
|
|
|
54
52
|
return (_jsxs("div", { className: "min-h-screen bg-white text-black font-sans selection:bg-black selection:text-white", children: [layoutConfig?.sections?.hero?.show !== false && (_jsx("section", { "data-section": "hero", className: "lg:h-screen h-auto w-full", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 h-full", children: [_jsx("div", { className: "relative bg-[#F4F4F4] flex flex-col justify-center px-12 md:px-24 lg:order-1 order-2 py-20 lg:py-0", children: _jsxs("div", { className: "space-y-6 md:space-y-8 max-w-lg animate-fade-in-up", children: [heroBadge ? (_jsx(SafeRichHtml, { as: "span", className: "text-xs font-bold uppercase tracking-[0.2em] text-gray-500 block [&_p]:m-0", value: heroBadge, fallbackPlain: "" })) : null, _jsx("h1", { className: "text-4xl md:text-7xl font-light tracking-tight leading-[1.1]", children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.hero?.title || getLayoutText(storeConfig, 'hero.title', 'Simplicity is the ultimate sophistication.'), fallbackPlain: "Simplicity is the ultimate sophistication." }) }), _jsx("div", { className: "text-gray-600 text-lg leading-relaxed [&_p]:mb-3 [&_p:last-child]:mb-0", children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.hero?.subtitle ||
|
|
55
53
|
getLayoutText(storeConfig, 'hero.subtitle', storeConfig.description
|
|
56
54
|
? `${storeConfig.description} Discover our latest arrivals, crafted for the modern individual who values quality and timeless design.`
|
|
57
|
-
: 'Discover our latest arrivals, crafted for the modern individual who values quality and timeless design.'), fallbackPlain: "Discover our latest arrivals, crafted for the modern individual who values quality and timeless design." }) }), _jsx("div", { className: "pt-4", children: _jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsx(Button, { className: "h-14 px-10 rounded-full bg-black text-white hover:bg-gray-800 text-base transition-all hover:scale-105", children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'common.shopNow', 'Shop Collection'), fallbackPlain: "Shop Collection", className: "[&_p]:m-0" }) }) }) })] }) }),
|
|
58
|
-
{ icon: 'Truck', title: 'Global Delivery', description: 'Free on orders over $200' },
|
|
59
|
-
{ icon: 'ShieldCheck', title: 'Secure Payment', description: '100% secure checkout' },
|
|
60
|
-
{ icon: 'RefreshCw', title: 'Easy Returns', description: '30-day return policy' }
|
|
61
|
-
]).filter(Boolean).map((item, idx) => (_jsxs("div", { className: "flex items-center gap-4 group", children: [_jsx("div", { className: "w-12 h-12 rounded-full bg-gray-50 flex items-center justify-center group-hover:bg-black group-hover:text-white transition-colors duration-300", children: _jsx(DynamicIcon, { name: item.icon, className: "w-5 h-5" }) }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-bold uppercase tracking-wider", children: item.title }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-xs text-gray-500" })] })] }, idx))) }) }) })), layoutConfig?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", className: "py-16 md:py-24 px-4 md:px-8", children: _jsxs("div", { className: "container mx-auto", children: [_jsxs("div", { className: "flex justify-between items-end mb-8 md:mb-12", children: [_jsx("h2", { className: "text-3xl font-light", children: layoutConfig?.sections?.categories?.title || getLayoutText(storeConfig, 'sections.categories.title', 'Categories') }), _jsx(Link, { href: `/${storeConfig.slug}/categories`, className: "text-sm font-bold uppercase tracking-wider border-b border-black pb-1 hover:text-gray-600 hover:border-gray-600 transition-colors", children: layoutConfig?.sections?.categories?.viewAllLabel || getLayoutText(storeConfig, 'sections.categories.viewAll', 'View All') })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: categories.map((category) => {
|
|
55
|
+
: 'Discover our latest arrivals, crafted for the modern individual who values quality and timeless design.'), fallbackPlain: "Discover our latest arrivals, crafted for the modern individual who values quality and timeless design." }) }), _jsx("div", { className: "pt-4", children: _jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsx(Button, { className: "h-14 px-10 rounded-full bg-black text-white hover:bg-gray-800 text-base transition-all hover:scale-105", children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'common.shopNow', 'Shop Collection'), fallbackPlain: "Shop Collection", className: "[&_p]:m-0" }) }) }) })] }) }), _jsx("div", { className: "relative h-[60vh] lg:h-full w-full lg:order-2 order-1 overflow-hidden group", children: _jsx(ImageWithFallback, { src: getBannerImage(storeConfig, 'hero_main', 'https://images.unsplash.com/photo-1539109136881-3be0616acf4b?q=80&w=1887&auto=format&fit=crop'), alt: "Minimal Fashion", className: "absolute inset-0 w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-[2s]" }) })] }) })), layoutConfig?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", className: "py-16 md:py-24 px-4 md:px-8", children: _jsxs("div", { className: "container mx-auto", children: [_jsxs("div", { className: "flex justify-between items-end mb-8 md:mb-12", children: [_jsx("h2", { className: "text-3xl font-light", children: layoutConfig?.sections?.categories?.title || getLayoutText(storeConfig, 'sections.categories.title', 'Categories') }), _jsx(Link, { href: `/${storeConfig.slug}/categories`, className: "text-sm font-bold uppercase tracking-wider border-b border-black pb-1 hover:text-gray-600 hover:border-gray-600 transition-colors", children: layoutConfig?.sections?.categories?.viewAllLabel || getLayoutText(storeConfig, 'sections.categories.viewAll', 'View All') })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: categories.map((category) => {
|
|
62
56
|
const itemCount = countProductsInCategoryTree(category, allCategories, categoryProducts);
|
|
63
57
|
return (_jsxs(Link, { href: `/${storeConfig.slug}/categories/${category.slug}`, className: "group block cursor-pointer", children: [_jsxs("div", { className: "relative aspect-[3/4] overflow-hidden bg-[#F4F4F4] mb-4", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "3/4" }), _jsx("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-500" }), _jsx("div", { className: "absolute top-4 right-4 bg-white rounded-full p-2 opacity-0 group-hover:opacity-100 transform translate-y-2 group-hover:translate-y-0 transition-all duration-300", children: _jsx(ArrowUpRight, { className: "h-5 w-5" }) })] }), _jsx("h3", { className: "text-xl font-medium mb-1", children: category.name }), itemCount > 0 && (_jsxs("p", { className: "text-sm text-gray-500", children: [itemCount, " ", itemCount === 1 ? 'Item' : 'Items'] }))] }, category.id));
|
|
64
58
|
}) })] }) })), layoutConfig?.sections?.featuredProducts?.show !== false && (_jsx("section", { "data-section": "featuredProducts", className: "py-16 md:py-24 bg-[#FAFAFA]", children: _jsxs("div", { className: "container mx-auto px-4 md:px-8", children: [_jsxs("div", { className: "max-w-2xl mx-auto text-center mb-10 md:mb-16", children: [_jsx("h2", { className: "text-3xl md:text-4xl font-light mb-4", children: layoutConfig?.sections?.featuredProducts?.title || 'The Essentials' }), _jsx("div", { className: "text-gray-500 [&_p]:mb-2 [&_p:last-child]:mb-0", children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.featuredProducts?.subtitle || 'Timeless pieces designed to build the foundation of your wardrobe.', fallbackPlain: "Timeless pieces designed to build the foundation of your wardrobe." }) })] }), _jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-12 md:gap-8", children: products.slice(0, 4).map((product) => (_jsx("div", { className: "group", children: _jsxs(Link, { href: `/${storeConfig.slug}/products/${product.slug}`, children: [_jsxs("div", { className: "aspect-[3/4] bg-white overflow-hidden relative mb-4", children: [_jsx(ImageWithFallback, { src: product.images[0], alt: product.name, className: "w-full h-full object-cover mix-blend-multiply group-hover:scale-105 transition-transform duration-500", skeletonAspectRatio: "3/4" }), _jsx("div", { className: "hidden lg:flex absolute inset-0 bg-black/5 opacity-0 group-hover:opacity-100 transition-opacity items-end justify-center pb-6", children: _jsx("button", { onClick: (e) => {
|
|
@@ -24,7 +24,7 @@ export declare function renderHeroBlocks(section: Record<string, unknown>, ctx:
|
|
|
24
24
|
getTextContent: (c: StoreConfig, k: string, d: string) => string;
|
|
25
25
|
heroSectionStyle?: CSSProperties;
|
|
26
26
|
}): React.JSX.Element;
|
|
27
|
-
export declare function renderFeaturesBlocks(
|
|
27
|
+
export declare function renderFeaturesBlocks(_sec: Record<string, unknown>, _ctx: MinimalBlockPreviewCtx): null;
|
|
28
28
|
export declare function renderCategoriesHeaderBlocks(sec: Record<string, unknown>, ctx: MinimalBlockPreviewCtx): React.JSX.Element;
|
|
29
29
|
export declare function renderFeaturedIntroBlocks(sec: Record<string, unknown>, ctx: MinimalBlockPreviewCtx): React.JSX.Element;
|
|
30
30
|
export declare function renderShopTheLookBlocks(sec: Record<string, unknown>, ctx: MinimalBlockPreviewCtx & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clothing-minimal-block-render.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing-minimal/components/clothing-minimal-block-render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE1E,6EAA6E;AAC7E,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAQnG,wBAAgB,OAAO,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI7E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAEvF;AAOD,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA8BF,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,GAAG,EAAE,sBAAsB,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChE,cAAc,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACjE,gBAAgB,CAAC,EAAE,aAAa,CAAC;CAClC,
|
|
1
|
+
{"version":3,"file":"clothing-minimal-block-render.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing-minimal/components/clothing-minimal-block-render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE1E,6EAA6E;AAC7E,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAQnG,wBAAgB,OAAO,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI7E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAEvF;AAOD,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA8BF,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,GAAG,EAAE,sBAAsB,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChE,cAAc,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACjE,gBAAgB,CAAC,EAAE,aAAa,CAAC;CAClC,qBA6HF;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE,sBAAsB,GAC3B,IAAI,CAEN;AAED,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,sBAAsB,qBA+BrG;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,sBAAsB,qBAyBlG;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD,qBA8HF;AAED,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACnE,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAwBP"}
|
|
@@ -4,12 +4,10 @@ import Link from 'next/link';
|
|
|
4
4
|
import { Button } from '../../../components/ui/button';
|
|
5
5
|
import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
|
|
6
6
|
import { Plus } from 'lucide-react';
|
|
7
|
-
import {
|
|
8
|
-
import { encodePayazaFieldKey, payazaInlineBindingProps, payazaGroupBindingProps, payazaIconBindingProps } from '../../../preview/canvas/field-key';
|
|
7
|
+
import { encodePayazaFieldKey, payazaInlineBindingProps, payazaGroupBindingProps } from '../../../preview/canvas/field-key';
|
|
9
8
|
import { richFieldHasContent, richFieldHtmlForRender } from '../../../lib/rich-html';
|
|
10
9
|
import { resolveClothingMinimalHeroBadge } from '../../../lib/utils/asset-helpers';
|
|
11
10
|
import { formatCurrency } from '../../../lib/utils';
|
|
12
|
-
import { readItemIconName } from '../../../lib/compact-array-items';
|
|
13
11
|
import { getPayazaBlockDefinition } from '../../../editor/blocks/registry';
|
|
14
12
|
export function blkAttr(block) {
|
|
15
13
|
const a = block.attributes;
|
|
@@ -59,11 +57,8 @@ export function renderHeroBlocks(section, ctx) {
|
|
|
59
57
|
const btnB = leftInner.find((x) => x.name === 'payaza/button');
|
|
60
58
|
const li = (b) => (b ? leftInner.indexOf(b) : -1);
|
|
61
59
|
const heroImg = right?.innerBlocks?.find((x) => x.name === 'payaza/image');
|
|
62
|
-
const capGroup = right?.innerBlocks?.find((x) => x.name === 'payaza/group' && String(blkAttr(x).variant) === 'hero-caption');
|
|
63
|
-
const capLines = capGroup?.innerBlocks?.filter((x) => x.name === 'payaza/paragraph') ?? [];
|
|
64
60
|
const rightGrpIdx = right ? blocks.indexOf(right) : 1;
|
|
65
61
|
const heroImgIx = heroImg && right?.innerBlocks ? right.innerBlocks.indexOf(heroImg) : 0;
|
|
66
|
-
const capGrpIxInRight = capGroup && right?.innerBlocks ? right.innerBlocks.indexOf(capGroup) : 2;
|
|
67
62
|
return (_jsx("section", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "home", style: (ctx.heroSectionStyle || {}), className: "lg:h-screen h-auto w-full", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 h-full", children: [_jsx("div", { className: "relative bg-[#F4F4F4] flex flex-col justify-center px-12 md:px-24 lg:order-1 order-2 py-20 lg:py-0", ...payazaGroupBindingProps(ctx.isPreview ?? false, 'hero', ['blocks', String(leftIdx)]), style: {
|
|
68
63
|
...blkAttr(left ?? {}).payazaStyle,
|
|
69
64
|
...(left && blkAttr(left).show === false ? { display: 'none' } : {}),
|
|
@@ -84,24 +79,13 @@ export function renderHeroBlocks(section, ctx) {
|
|
|
84
79
|
'Discover our latest arrivals, crafted for the modern individual.')),
|
|
85
80
|
}, ...pbRich(ctx, 'hero', ['blocks', 0, 'innerBlocks', li(parB), 'attributes', 'content'], 'payaza/paragraph', 'content') })) : null, btnB ? (_jsx("div", { className: "pt-4", children: _jsx(Link, { href: hrefWithSlug(ctx.slug, blkAttr(btnB).url), children: _jsx(Button, { className: "h-14 px-10 rounded-full bg-black text-white hover:bg-gray-800 text-base transition-all hover:scale-105", children: _jsx("span", { dangerouslySetInnerHTML: {
|
|
86
81
|
__html: richFieldHtmlForRender(blkAttr(btnB).text, ctx.getLayoutText(ctx.storeConfig, 'common.shopNow', 'Shop Collection')),
|
|
87
|
-
}, ...pbRich(ctx, 'hero', ['blocks', 0, 'innerBlocks', li(btnB), 'attributes', 'text'], 'payaza/button', 'text') }) }) }) })) : null] }) }),
|
|
82
|
+
}, ...pbRich(ctx, 'hero', ['blocks', 0, 'innerBlocks', li(btnB), 'attributes', 'text'], 'payaza/button', 'text') }) }) }) })) : null] }) }), _jsx("div", { className: "relative h-[60vh] lg:h-full w-full lg:order-2 order-1 overflow-hidden group", ...payazaGroupBindingProps(ctx.isPreview ?? false, 'hero', ['blocks', String(rightGrpIdx)]), style: {
|
|
88
83
|
...blkAttr(right ?? {}).payazaStyle,
|
|
89
84
|
...(right && blkAttr(right).show === false ? { display: 'none' } : {}),
|
|
90
|
-
}, children:
|
|
91
|
-
const pix = capGroup?.innerBlocks?.indexOf(line) ?? ix;
|
|
92
|
-
return (_jsx("p", { className: ix === 0 ? 'text-xs font-bold uppercase tracking-wider mb-1' : 'text-sm text-gray-600', dangerouslySetInnerHTML: { __html: richFieldHtmlForRender(blkAttr(line).content, '') }, ...pbRich(ctx, 'hero', ['blocks', rightGrpIdx, 'innerBlocks', capGrpIxInRight, 'innerBlocks', pix, 'attributes', 'content'], 'payaza/paragraph', 'content') }, line.clientId ?? ix));
|
|
93
|
-
}) })) : null] })] }) }));
|
|
85
|
+
}, children: heroImg ? (_jsx(ImageWithFallback, { src: String(blkAttr(heroImg).url || ctx.bannerFallback), alt: String(blkAttr(heroImg).alt || 'Minimal Fashion'), className: "absolute inset-0 w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-[2s]", ...payazaImg(ctx, 'hero', ['blocks', rightGrpIdx, 'innerBlocks', heroImgIx, 'attributes', 'url']) })) : (_jsx(ImageWithFallback, { src: ctx.bannerFallback, alt: "", className: "absolute inset-0 w-full h-full object-cover object-center" })) })] }) }));
|
|
94
86
|
}
|
|
95
|
-
export function renderFeaturesBlocks(
|
|
96
|
-
|
|
97
|
-
if (!blocks?.length)
|
|
98
|
-
return null;
|
|
99
|
-
const feats = blocks.filter((b) => b?.name === 'payaza/feature-item');
|
|
100
|
-
return (_jsx("section", { "data-section": "features", "data-payaza-section-key": "features", "data-payaza-page": "home", className: "py-12 border-b border-gray-100 bg-white", children: _jsx("div", { className: "container mx-auto px-4 md:px-8", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: feats.map((fb, ix) => {
|
|
101
|
-
const ai = blkAttr(fb);
|
|
102
|
-
const r = blocks.indexOf(fb);
|
|
103
|
-
return (_jsxs("div", { className: "flex items-center gap-4 group", children: [_jsx("div", { className: "w-12 h-12 rounded-full bg-gray-50 flex items-center justify-center group-hover:bg-black group-hover:text-white transition-colors duration-300", ...payazaIconBindingProps(!!ctx?.isPreview, 'features', ['blocks', String(r), 'attributes', 'icon']), children: _jsx(DynamicIcon, { name: readItemIconName(ai, 'Circle'), className: "w-5 h-5" }) }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-bold uppercase tracking-wider", dangerouslySetInnerHTML: { __html: richFieldHtmlForRender(ai.title, 'Feature') }, ...pbRich(ctx, 'features', ['blocks', r, 'attributes', 'title'], 'payaza/feature-item', 'title') }), _jsx("p", { className: "text-xs text-gray-500", dangerouslySetInnerHTML: { __html: richFieldHtmlForRender(ai.description, '') }, ...pbRich(ctx, 'features', ['blocks', r, 'attributes', 'description'], 'payaza/feature-item', 'description') })] })] }, fb.clientId || ix));
|
|
104
|
-
}) }) }) }));
|
|
87
|
+
export function renderFeaturesBlocks(_sec, _ctx) {
|
|
88
|
+
return null;
|
|
105
89
|
}
|
|
106
90
|
export function renderCategoriesHeaderBlocks(sec, ctx) {
|
|
107
91
|
const blocks = sec.blocks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing-minimal/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,0BAA0B,CAAC;AAiCnG,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing-minimal/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,0BAA0B,CAAC;AAiCnG,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BAq5BpG"}
|
|
@@ -406,7 +406,7 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
406
406
|
return brandMatch ? brandMatch[1] : storeConfig.name;
|
|
407
407
|
})() }), _jsx("button", { onClick: handleShare, className: "text-gray-400 hover:text-gray-900 transition-colors p-2 rounded-full hover:bg-gray-100", title: "Share this product", children: _jsx(Share2, { className: "h-5 w-5" }) })] }), _jsx("h1", { "data-product-name": true, className: "text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 leading-tight tracking-tight", children: product.name }), _jsxs("p", { className: "text-sm text-gray-500 mb-6 font-mono", children: ["SKU: ", displaySKU] }), _jsx("div", { className: "mb-4 flex items-center gap-2", children: !isOutOfStock ? (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800", children: [_jsx(CheckCircle, { className: "w-3 h-3 mr-1" }), "In Stock"] })) : (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800", children: [_jsx(Info, { className: "w-3 h-3 mr-1" }), "Out of Stock"] })) }), _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "flex items-baseline gap-4", children: [_jsx("span", { "data-product-price": true, className: "text-4xl lg:text-5xl font-bold text-gray-900", children: formatCurrency(displayPrice, product.currency || 'USD') }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsx("span", { className: "text-2xl text-gray-500 line-through", children: formatCurrency(displayCompareAt, product.currency || 'USD') }))] }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsxs("span", { className: "inline-block mt-2 bg-red-100 text-red-700 text-xs font-bold px-2 py-1 rounded", children: ["SAVE ", Math.round(((displayCompareAt - displayPrice) / displayCompareAt) * 100), "%"] }))] }), _jsx(PdpVariationSelectors, { optionGroups: optionGroups, selectedAttributes: selectedAttributes, setAttribute: setAttribute, isOptionAvailable: isOptionAvailable, getOptionImage: getOptionImage, storeSlug: storeConfig.slug, showSizeGuide: productDetailConfig?.showSizeGuide !== false, onAfterClearAttribute: () => setQuantity(1) }), _jsxs("div", { className: "flex flex-col gap-4 mb-8", children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx("span", { className: "text-sm font-normal leading-5 text-[#191C1F]", children: "Quantity" }), _jsxs("div", { className: "inline-flex h-8 w-fit items-center rounded-[2px] border border-[#E4E7E9] bg-white", children: [_jsx("button", { type: "button", className: "flex h-8 w-7 items-center justify-center text-[#475156] hover:bg-gray-50 disabled:opacity-40", onClick: () => setQuantity(Math.max(1, quantity - 1)), disabled: quantity <= 1, "aria-label": "Decrease quantity", children: _jsx(Minus, { className: "h-3.5 w-3.5" }) }), _jsx("span", { className: "w-6 text-center text-sm font-medium tabular-nums text-[#191C1F]", children: quantity }), _jsx("button", { type: "button", className: "flex h-8 w-7 items-center justify-center text-[#475156] hover:bg-gray-50", onClick: () => setQuantity(quantity + 1), "aria-label": "Increase quantity", children: _jsx(Plus, { className: "h-3.5 w-3.5" }) })] })] }), _jsxs("div", { className: "flex flex-row items-stretch gap-2 sm:gap-3 mt-2 w-full", children: [productDetailConfig?.showAddToCart !== false && (_jsx(Button, { "data-add-to-cart": true, variant: "outline", size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 min-w-0 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold [&_svg]:text-gray-900 shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-4 w-4 sm:h-5 sm:w-5 mr-1.5 sm:mr-2 shrink-0 text-gray-900" }), "Add to Cart"] })) })), productDetailConfig?.showAddToCart !== false && (_jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 min-w-0 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isBuyNowLoading || isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : ('Buy Now') })), storeConfig.features.wishlist && productDetailConfig?.showWishlist !== false && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-12 w-12 sm:h-14 sm:w-14 shrink-0 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
408
408
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
409
|
-
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }),
|
|
409
|
+
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsx("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: _jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }) })] })), product.specifications && Object.keys(product.specifications).length > 0 && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Specifications" }), _jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-4", children: Object.entries(product.specifications).map(([key, value]) => (_jsxs("div", { className: "flex flex-col p-3 bg-gray-50 rounded-lg", children: [_jsx("dt", { className: "text-xs text-gray-500 font-medium uppercase tracking-wider mb-1", children: key }), _jsx("dd", { className: "text-sm font-bold text-gray-900", children: value })] }, key))) })] }))] })] }), productDetailConfig?.showReviews !== false && (_jsx("div", { className: "mt-20 pt-16 border-t border-gray-200", children: _jsxs("div", { className: "max-w-4xl", children: [_jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 mb-10", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-4", children: "Customer Reviews" }), reviewCount > 0 && averageRating > 0 && (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: averageRating, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: averageRating.toFixed(1) }), _jsx("span", { className: "text-lg text-gray-500", children: "out of 5" })] }), _jsx("span", { className: "text-gray-300", children: "|" }), _jsxs("span", { className: "text-lg text-gray-600", children: [reviewCount, " ", reviewCount === 1 ? 'review' : 'reviews'] })] }))] }), reviewCount > 0 && (_jsx(Button, { onClick: () => {
|
|
410
410
|
if (!isAuthenticated) {
|
|
411
411
|
openLogin({ onSuccess: () => setIsReviewModalOpen(true) });
|
|
412
412
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronicsGridProductCard.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsGridProductCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,UAAU,+BAA+B;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,+BAA+B,+
|
|
1
|
+
{"version":3,"file":"ElectronicsGridProductCard.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsGridProductCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,UAAU,+BAA+B;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,+BAA+B,+BA8QrH"}
|
|
@@ -35,7 +35,7 @@ export function ElectronicsGridProductCard({ product, storeSlug, onAddToCart, in
|
|
|
35
35
|
trackProductClick();
|
|
36
36
|
startPageLoading(`/${storeSlug}/products/${product.slug}`);
|
|
37
37
|
};
|
|
38
|
-
// Discount calculation
|
|
38
|
+
// Discount calculation
|
|
39
39
|
const discountPercentage = product.compareAtPrice != null && product.compareAtPrice > product.price
|
|
40
40
|
? Math.round(((product.compareAtPrice - product.price) / product.compareAtPrice) * 100)
|
|
41
41
|
: 0;
|
|
@@ -105,7 +105,7 @@ export function ElectronicsGridProductCard({ product, storeSlug, onAddToCart, in
|
|
|
105
105
|
: "text-gray-400 bg-white/95 hover:text-red-500 hover:bg-red-50/50 hover:scale-110"), title: inWishlist ? "Remove from wishlist" : "Add to wishlist", "aria-label": inWishlist ? "Remove from wishlist" : "Add to wishlist", children: isLoading ? (_jsx(ButtonLoader, { className: inWishlist ? "text-red-500" : "text-gray-400" })) : (_jsx(motion.div, { animate: {
|
|
106
106
|
scale: justAdded ? [1, 1.2, 1] : 1,
|
|
107
107
|
rotate: justAdded ? [0, 10, -10, 0] : 0
|
|
108
|
-
}, transition: { duration: 0.4, ease: "easeOut" }, children: _jsx(Heart, { className: cn("w-5 h-5 transition-all", inWishlist && "fill-current", justAdded && "text-red-500 fill-current") }) })) }), _jsx("div", { className: "absolute top-4 left-4 z-20 flex flex-col gap-2", children:
|
|
108
|
+
}, transition: { duration: 0.4, ease: "easeOut" }, children: _jsx(Heart, { className: cn("w-5 h-5 transition-all", inWishlist && "fill-current", justAdded && "text-red-500 fill-current") }) })) }), _jsx("div", { className: "absolute top-4 left-4 z-20 flex flex-col gap-2", children: product.compareAtPrice != null && product.compareAtPrice > product.price && (_jsxs("span", { className: "bg-slate-900 text-white text-[10px] font-bold px-3 py-1.5 rounded-full tracking-wide", children: ["-", discountPercentage, "%"] })) }), _jsx("div", { className: "hidden lg:block absolute inset-x-4 bottom-4 z-20 translate-y-full group-hover:translate-y-0 transition-transform duration-300 ease-out opacity-0 group-hover:opacity-100", children: _jsxs(Button, { onClick: (e) => {
|
|
109
109
|
e.preventDefault();
|
|
110
110
|
if (!isOutOfStock) {
|
|
111
111
|
onAddToCart(product);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BA24BpG"}
|
|
@@ -57,6 +57,7 @@ function ReviewCard({ review }) {
|
|
|
57
57
|
export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
58
58
|
const { store, addToCart, isCartLoading, toggleWishlist, isInWishlist, isWishlistLoading, setBuyNowItem } = useStore();
|
|
59
59
|
const storeConfig = store || initialConfig;
|
|
60
|
+
const productDetailConfig = storeConfig.layoutConfig?.pages?.productDetail;
|
|
60
61
|
const products = filterActiveProducts(storeConfig.products || []);
|
|
61
62
|
const initialProduct = resolvePdpProduct(initialConfig.products, storeConfig.products, productSlug, isEditorPreviewMode(storeConfig));
|
|
62
63
|
const { product, relatedProducts: apiRelatedProducts, isLoading: isLoadingProduct } = useProductBySlug(storeConfig.id, productSlug, initialProduct);
|
|
@@ -405,7 +406,7 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
405
406
|
return brandMatch ? brandMatch[1] : storeConfig.name;
|
|
406
407
|
})() }), _jsx("button", { onClick: handleShare, className: "text-gray-400 hover:text-gray-900 transition-colors p-2 rounded-full hover:bg-gray-100", title: "Share this product", children: _jsx(Share2, { className: "h-5 w-5" }) })] }), _jsx("h1", { "data-product-name": true, className: "text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 leading-tight tracking-tight", children: product.name }), _jsxs("p", { className: "text-sm text-gray-500 mb-6 font-mono", children: ["SKU: ", displaySKU] }), _jsx("div", { className: "mb-4 flex items-center gap-2", children: !isOutOfStock ? (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800", children: [_jsx(CheckCircle, { className: "w-3 h-3 mr-1" }), "In Stock"] })) : (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800", children: [_jsx(Info, { className: "w-3 h-3 mr-1" }), "Out of Stock"] })) }), _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "flex items-baseline gap-4", children: [_jsx("span", { "data-product-price": true, className: "text-4xl lg:text-5xl font-bold text-gray-900", children: formatCurrency(displayPrice, product.currency || 'USD') }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsx("span", { className: "text-2xl text-gray-500 line-through", children: formatCurrency(displayCompareAt, product.currency || 'USD') }))] }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsxs("span", { className: "inline-block mt-2 bg-red-100 text-red-700 text-xs font-bold px-2 py-1 rounded", children: ["SAVE ", Math.round(((displayCompareAt - displayPrice) / displayCompareAt) * 100), "%"] }))] }), _jsx(PdpVariationSelectors, { optionGroups: optionGroups, selectedAttributes: selectedAttributes, setAttribute: setAttribute, isOptionAvailable: isOptionAvailable, getOptionImage: getOptionImage, storeSlug: storeConfig.slug, showSizeGuide: productDetailConfig?.showSizeGuide !== false, onAfterClearAttribute: () => setQuantity(1) }), _jsxs("div", { className: "flex flex-col gap-4 mb-8", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: "Quantity" }), _jsxs("div", { className: "flex items-center border border-gray-300 rounded-lg", children: [_jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-l-lg disabled:opacity-50", onClick: () => setQuantity(Math.max(1, quantity - 1)), disabled: quantity <= 1, children: _jsx(Minus, { className: "h-4 w-4" }) }), _jsx("span", { className: "w-12 text-center font-semibold text-gray-900", children: quantity }), _jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-r-lg", onClick: () => setQuantity(quantity + 1), children: _jsx(Plus, { className: "h-4 w-4" }) })] })] }), _jsxs("div", { className: "flex flex-row items-stretch gap-2 sm:gap-3 mt-2 w-full", children: [_jsx(Button, { "data-add-to-cart": true, variant: "outline", size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 min-w-0 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold [&_svg]:text-gray-900 shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-4 w-4 sm:h-5 sm:w-5 mr-1.5 sm:mr-2 shrink-0 text-gray-900" }), "Add to Cart"] })) }), _jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 min-w-0 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isBuyNowLoading || isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : ('Buy Now') }), storeConfig.features.wishlist && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-12 w-12 sm:h-14 sm:w-14 shrink-0 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
407
408
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
408
|
-
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }),
|
|
409
|
+
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsx("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: _jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }) })] })), product.specifications && Object.keys(product.specifications).length > 0 && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Specifications" }), _jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-4", children: Object.entries(product.specifications).map(([key, value]) => (_jsxs("div", { className: "flex flex-col p-3 bg-gray-50 rounded-lg", children: [_jsx("dt", { className: "text-xs text-gray-500 font-medium uppercase tracking-wider mb-1", children: key }), _jsx("dd", { className: "text-sm font-bold text-gray-900", children: value })] }, key))) })] }))] })] }), _jsx("div", { className: "mt-20 pt-16 border-t border-gray-200", children: _jsxs("div", { className: "max-w-4xl", children: [_jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 mb-10", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-4", children: "Customer Reviews" }), reviewCount > 0 && averageRating > 0 && (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: averageRating, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: averageRating.toFixed(1) }), _jsx("span", { className: "text-lg text-gray-500", children: "out of 5" })] }), _jsx("span", { className: "text-gray-300", children: "|" }), _jsxs("span", { className: "text-lg text-gray-600", children: [reviewCount, " ", reviewCount === 1 ? 'review' : 'reviews'] })] }))] }), reviewCount > 0 && (_jsx(Button, { onClick: () => {
|
|
409
410
|
if (!isAuthenticated) {
|
|
410
411
|
openLogin({ onSuccess: () => setIsReviewModalOpen(true) });
|
|
411
412
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronicsGridProductCard.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/components/ElectronicsGridProductCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,UAAU,+BAA+B;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,+BAA+B,+
|
|
1
|
+
{"version":3,"file":"ElectronicsGridProductCard.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/components/ElectronicsGridProductCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,UAAU,+BAA+B;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,+BAA+B,+BA8QrH"}
|
|
@@ -35,7 +35,7 @@ export function ElectronicsGridProductCard({ product, storeSlug, onAddToCart, in
|
|
|
35
35
|
trackProductClick();
|
|
36
36
|
startPageLoading(`/${storeSlug}/products/${product.slug}`);
|
|
37
37
|
};
|
|
38
|
-
// Discount calculation
|
|
38
|
+
// Discount calculation
|
|
39
39
|
const discountPercentage = product.compareAtPrice != null && product.compareAtPrice > product.price
|
|
40
40
|
? Math.round(((product.compareAtPrice - product.price) / product.compareAtPrice) * 100)
|
|
41
41
|
: 0;
|
|
@@ -105,7 +105,7 @@ export function ElectronicsGridProductCard({ product, storeSlug, onAddToCart, in
|
|
|
105
105
|
: "text-gray-400 bg-white/95 hover:text-red-500 hover:bg-red-50/50 hover:scale-110"), title: inWishlist ? "Remove from wishlist" : "Add to wishlist", "aria-label": inWishlist ? "Remove from wishlist" : "Add to wishlist", children: isLoading ? (_jsx(ButtonLoader, { className: inWishlist ? "text-red-500" : "text-gray-400" })) : (_jsx(motion.div, { animate: {
|
|
106
106
|
scale: justAdded ? [1, 1.2, 1] : 1,
|
|
107
107
|
rotate: justAdded ? [0, 10, -10, 0] : 0
|
|
108
|
-
}, transition: { duration: 0.4, ease: "easeOut" }, children: _jsx(Heart, { className: cn("w-5 h-5 transition-all", inWishlist && "fill-current", justAdded && "text-red-500 fill-current") }) })) }), _jsx("div", { className: "absolute top-4 left-4 z-20 flex flex-col gap-2", children:
|
|
108
|
+
}, transition: { duration: 0.4, ease: "easeOut" }, children: _jsx(Heart, { className: cn("w-5 h-5 transition-all", inWishlist && "fill-current", justAdded && "text-red-500 fill-current") }) })) }), _jsx("div", { className: "absolute top-4 left-4 z-20 flex flex-col gap-2", children: product.compareAtPrice != null && product.compareAtPrice > product.price && (_jsxs("span", { className: "bg-slate-900 text-white text-[10px] font-bold px-3 py-1.5 rounded-full tracking-wide", children: ["-", discountPercentage, "%"] })) }), _jsx("div", { className: "hidden lg:block absolute inset-x-4 bottom-4 z-20 translate-y-full group-hover:translate-y-0 transition-transform duration-300 ease-out opacity-0 group-hover:opacity-100", children: _jsxs(Button, { onClick: (e) => {
|
|
109
109
|
e.preventDefault();
|
|
110
110
|
if (!isOutOfStock) {
|
|
111
111
|
onAddToCart(product);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BA24BpG"}
|
|
@@ -57,6 +57,7 @@ function ReviewCard({ review }) {
|
|
|
57
57
|
export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
58
58
|
const { store, addToCart, isCartLoading, toggleWishlist, isInWishlist, isWishlistLoading, setBuyNowItem } = useStore();
|
|
59
59
|
const storeConfig = store || initialConfig;
|
|
60
|
+
const productDetailConfig = storeConfig.layoutConfig?.pages?.productDetail;
|
|
60
61
|
const products = filterActiveProducts(storeConfig.products || []);
|
|
61
62
|
const initialProduct = resolvePdpProduct(initialConfig.products, storeConfig.products, productSlug, isEditorPreviewMode(storeConfig));
|
|
62
63
|
const { product, relatedProducts: apiRelatedProducts, isLoading: isLoadingProduct } = useProductBySlug(storeConfig.id, productSlug, initialProduct);
|
|
@@ -405,7 +406,7 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
405
406
|
return brandMatch ? brandMatch[1] : storeConfig.name;
|
|
406
407
|
})() }), _jsx("button", { onClick: handleShare, className: "text-gray-400 hover:text-gray-900 transition-colors p-2 rounded-full hover:bg-gray-100", title: "Share this product", children: _jsx(Share2, { className: "h-5 w-5" }) })] }), _jsx("h1", { "data-product-name": true, className: "text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 leading-tight tracking-tight", children: product.name }), _jsxs("p", { className: "text-sm text-gray-500 mb-6 font-mono", children: ["SKU: ", displaySKU] }), _jsx("div", { className: "mb-4 flex items-center gap-2", children: !isOutOfStock ? (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800", children: [_jsx(CheckCircle, { className: "w-3 h-3 mr-1" }), "In Stock"] })) : (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800", children: [_jsx(Info, { className: "w-3 h-3 mr-1" }), "Out of Stock"] })) }), _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "flex items-baseline gap-4", children: [_jsx("span", { "data-product-price": true, className: "text-4xl lg:text-5xl font-bold text-gray-900", children: formatCurrency(displayPrice, product.currency || 'USD') }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsx("span", { className: "text-2xl text-gray-500 line-through", children: formatCurrency(displayCompareAt, product.currency || 'USD') }))] }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsxs("span", { className: "inline-block mt-2 bg-red-100 text-red-700 text-xs font-bold px-2 py-1 rounded", children: ["SAVE ", Math.round(((displayCompareAt - displayPrice) / displayCompareAt) * 100), "%"] }))] }), _jsx(PdpVariationSelectors, { optionGroups: optionGroups, selectedAttributes: selectedAttributes, setAttribute: setAttribute, isOptionAvailable: isOptionAvailable, getOptionImage: getOptionImage, storeSlug: storeConfig.slug, showSizeGuide: productDetailConfig?.showSizeGuide !== false, onAfterClearAttribute: () => setQuantity(1) }), _jsxs("div", { className: "flex flex-col gap-4 mb-8", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: "Quantity" }), _jsxs("div", { className: "flex items-center border border-gray-300 rounded-lg", children: [_jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-l-lg disabled:opacity-50", onClick: () => setQuantity(Math.max(1, quantity - 1)), disabled: quantity <= 1, children: _jsx(Minus, { className: "h-4 w-4" }) }), _jsx("span", { className: "w-12 text-center font-semibold text-gray-900", children: quantity }), _jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-r-lg", onClick: () => setQuantity(quantity + 1), children: _jsx(Plus, { className: "h-4 w-4" }) })] })] }), _jsxs("div", { className: "flex flex-row items-stretch gap-2 sm:gap-3 mt-2 w-full", children: [_jsx(Button, { "data-add-to-cart": true, variant: "outline", size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 min-w-0 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold [&_svg]:text-gray-900 shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-4 w-4 sm:h-5 sm:w-5 mr-1.5 sm:mr-2 shrink-0 text-gray-900" }), "Add to Cart"] })) }), _jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 min-w-0 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isBuyNowLoading || isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : ('Buy Now') }), storeConfig.features.wishlist && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-12 w-12 sm:h-14 sm:w-14 shrink-0 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
407
408
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
408
|
-
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }),
|
|
409
|
+
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsx("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: _jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }) })] })), product.specifications && Object.keys(product.specifications).length > 0 && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Specifications" }), _jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-4", children: Object.entries(product.specifications).map(([key, value]) => (_jsxs("div", { className: "flex flex-col p-3 bg-gray-50 rounded-lg", children: [_jsx("dt", { className: "text-xs text-gray-500 font-medium uppercase tracking-wider mb-1", children: key }), _jsx("dd", { className: "text-sm font-bold text-gray-900", children: value })] }, key))) })] }))] })] }), _jsx("div", { className: "mt-20 pt-16 border-t border-gray-200", children: _jsxs("div", { className: "max-w-4xl", children: [_jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 mb-10", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-4", children: "Customer Reviews" }), reviewCount > 0 && averageRating > 0 && (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: averageRating, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: averageRating.toFixed(1) }), _jsx("span", { className: "text-lg text-gray-500", children: "out of 5" })] }), _jsx("span", { className: "text-gray-300", children: "|" }), _jsxs("span", { className: "text-lg text-gray-600", children: [reviewCount, " ", reviewCount === 1 ? 'review' : 'reviews'] })] }))] }), reviewCount > 0 && (_jsx(Button, { onClick: () => {
|
|
409
410
|
if (!isAuthenticated) {
|
|
410
411
|
openLogin({ onSuccess: () => setIsReviewModalOpen(true) });
|
|
411
412
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food/pages/MenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food/pages/MenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,aAAa,+BAqVnF"}
|
|
@@ -9,6 +9,7 @@ import { cn, formatCurrency } from '../../../lib/utils/index.js';
|
|
|
9
9
|
import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
|
|
10
10
|
import { productService } from '../../../lib/services/product.service.js';
|
|
11
11
|
import { transformProductToStoreProduct } from '../../../lib/store-config-utils.js';
|
|
12
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
12
13
|
export function MenuPage({ storeConfig: initialConfig, categorySlug }) {
|
|
13
14
|
const { store } = useStore();
|
|
14
15
|
const storeConfig = store || initialConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAkC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAkC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BAi6BpG"}
|
|
@@ -58,6 +58,7 @@ function ReviewCard({ review }) {
|
|
|
58
58
|
export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
59
59
|
const { store, addToCart, isCartLoading, toggleWishlist, isInWishlist, isWishlistLoading, setBuyNowItem } = useStore();
|
|
60
60
|
const storeConfig = store || initialConfig;
|
|
61
|
+
const productDetailConfig = storeConfig.layoutConfig?.pages?.productDetail;
|
|
61
62
|
const products = filterActiveProducts(storeConfig.products || []);
|
|
62
63
|
const initialProduct = resolvePdpProduct(initialConfig.products, storeConfig.products, productSlug, isEditorPreviewMode(storeConfig));
|
|
63
64
|
const { product, relatedProducts: apiRelatedProducts, isLoading: isLoadingProduct } = useProductBySlug(storeConfig.id, productSlug, initialProduct);
|
|
@@ -427,7 +428,7 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
427
428
|
? 'border-gray-900 ring-2 ring-gray-900 ring-offset-2'
|
|
428
429
|
: 'border-gray-200 hover:border-gray-300'}`, children: _jsx(ImageWithFallback, { src: image, alt: `${product.name} view ${index + 1}`, className: cn("w-full h-full object-cover", isOutOfStock && "grayscale"), skeletonAspectRatio: "square" }) }, index))), hasMoreImages && (_jsxs("div", { className: "aspect-square rounded-lg border-2 border-gray-200 bg-gray-50 flex items-center justify-center text-xs text-gray-500 font-medium", children: ["+", productImages.length - 5, " more"] }))] }))] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center justify-between mb-2", children: [_jsx("span", { className: "text-sm font-semibold text-gray-700 uppercase tracking-wide", children: directCategory?.name || storeConfig.name }), _jsx("button", { onClick: handleShare, className: "text-gray-400 hover:text-gray-900 transition-colors p-2 rounded-full hover:bg-gray-100", title: "Share this product", children: _jsx(Share2, { className: "h-5 w-5" }) })] }), _jsx("h1", { "data-product-name": true, className: "text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 leading-tight tracking-tight", children: product.name }), _jsxs("p", { className: "text-sm text-gray-500 mb-6 font-mono", children: ["SKU: ", displaySKU] }), _jsx("div", { className: "mb-4 flex items-center gap-2", children: !isOutOfStock ? (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800", children: [_jsx(CheckCircle, { className: "w-3 h-3 mr-1" }), "In Stock"] })) : (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800", children: [_jsx(Info, { className: "w-3 h-3 mr-1" }), "Out of Stock"] })) }), _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "flex items-baseline gap-4", children: [_jsx("span", { "data-product-price": true, className: "text-4xl lg:text-5xl font-bold text-gray-900", children: formatCurrency(displayPrice, product.currency || 'USD') }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsx("span", { className: "text-2xl text-gray-500 line-through", children: formatCurrency(displayCompareAt, product.currency || 'USD') }))] }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsxs("span", { className: "inline-block mt-2 bg-red-100 text-red-700 text-xs font-bold px-2 py-1 rounded", children: ["SAVE ", Math.round(((displayCompareAt - displayPrice) / displayCompareAt) * 100), "%"] }))] }), _jsx(PdpVariationSelectors, { optionGroups: optionGroups, selectedAttributes: selectedAttributes, setAttribute: setAttribute, isOptionAvailable: isOptionAvailable, getOptionImage: getOptionImage, storeSlug: storeConfig.slug, showSizeGuide: productDetailConfig?.showSizeGuide !== false, onAfterClearAttribute: () => setQuantity(1) }), _jsxs("div", { className: "flex flex-col gap-4 mb-8", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: "Quantity" }), _jsxs("div", { className: "flex items-center border border-gray-300 rounded-lg", children: [_jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-l-lg disabled:opacity-50", onClick: () => setQuantity(Math.max(1, quantity - 1)), disabled: quantity <= 1, children: _jsx(Minus, { className: "h-4 w-4" }) }), _jsx("span", { className: "w-12 text-center font-semibold text-gray-900", children: quantity }), _jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-r-lg", onClick: () => setQuantity(quantity + 1), children: _jsx(Plus, { className: "h-4 w-4" }) })] })] }), _jsxs("div", { className: "flex flex-row items-stretch gap-2 sm:gap-3 mt-2 w-full", children: [_jsx(Button, { "data-add-to-cart": true, variant: "outline", size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 min-w-0 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold [&_svg]:text-gray-900 shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-4 w-4 sm:h-5 sm:w-5 mr-1.5 sm:mr-2 shrink-0 text-gray-900" }), "Add to Cart"] })) }), _jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 min-w-0 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isBuyNowLoading || isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : ('Buy Now') }), storeConfig.features.wishlist && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-12 w-12 sm:h-14 sm:w-14 shrink-0 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
429
430
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
430
|
-
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }),
|
|
431
|
+
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsx("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: _jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }) })] })), product.specifications && Object.keys(product.specifications).length > 0 && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Specifications" }), _jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-4", children: Object.entries(product.specifications).map(([key, value]) => (_jsxs("div", { className: "flex flex-col p-3 bg-gray-50 rounded-lg", children: [_jsx("dt", { className: "text-xs text-gray-500 font-medium uppercase tracking-wider mb-1", children: key }), _jsx("dd", { className: "text-sm font-bold text-gray-900", children: value })] }, key))) })] }))] })] }), _jsx("div", { className: "mt-20 pt-16 border-t border-gray-200", children: _jsxs("div", { className: "max-w-4xl", children: [_jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 mb-10", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-4", children: "Customer Reviews" }), reviewCount > 0 && averageRating > 0 && (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: averageRating, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: averageRating.toFixed(1) }), _jsx("span", { className: "text-lg text-gray-500", children: "out of 5" })] }), _jsx("span", { className: "text-gray-300", children: "|" }), _jsxs("span", { className: "text-lg text-gray-600", children: [reviewCount, " ", reviewCount === 1 ? 'review' : 'reviews'] })] }))] }), reviewCount > 0 && (_jsx(Button, { onClick: () => {
|
|
431
432
|
if (!isAuthenticated) {
|
|
432
433
|
openLogin({ onSuccess: () => setIsReviewModalOpen(true) });
|
|
433
434
|
return;
|
|
@@ -70,7 +70,7 @@ export function FoodHomePageModern({ storeConfig: initialConfig }) {
|
|
|
70
70
|
image: t.image || fallbackTestimonials[idx]?.image || '',
|
|
71
71
|
}))
|
|
72
72
|
: (isPreview ? fallbackTestimonials : []);
|
|
73
|
-
return (_jsxs("div", { className: "bg-[#0F0F0F] text-white font-sans selection:bg-orange-500 selection:text-white", children: [layoutConfig?.sections?.hero?.show !== false && _jsxs("section", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "home", className: "relative h-screen w-full overflow-hidden flex items-center justify-center bg-[#0F0F0F]", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'hero'), children: [_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(VideoPlayer, { src: getAssetUrl(storeConfig, 'hero_video', "https://cdn.coverr.co/videos/coverr-chef-preparing-food-in-kitchen-5379/1080p.mp4"), poster: getBannerImage(storeConfig, 'hero_video_poster', "https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?q=80&w=2070&auto=format&fit=crop"), context: "background", className: "w-full h-full opacity-50 scale-105" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-[#0F0F0F] via-[#0F0F0F]/40 to-black/30" }), _jsx("div", { className: "absolute inset-0 bg-[url('https://www.transparenttextures.com/patterns/noise.png')] opacity-20 mix-blend-overlay" })] }), _jsxs("div", { className: "relative z-10 text-center px-4 max-w-5xl mx-auto space-y-10", children: [_jsxs("div", { className: "flex justify-center items-center gap-6 animate-fade-in-up", children: [_jsx("span", { className: "h-px w-16 bg-white/30" }), _jsxs("div", { className: "flex items-center gap-2 text-orange-500 uppercase tracking-[0.3em] text-xs font-bold", children: [_jsx(Star, { className: "h-3 w-3 fill-current" }), " ", getLayoutText(storeConfig, 'food.ourPhilosophy', 'Michelin Star 2024')] }), _jsx("span", { className: "h-px w-16 bg-white/30" })] }), _jsxs("h1", { className: "text-5xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-none uppercase text-white animate-fade-in-up delay-100", children: [getLayoutText(storeConfig, 'food.ourPhilosophy', 'Taste the Extraordinary'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-amber-200", children: "Extraordinary" })] }), _jsx(SafeRichHtml, { value: `${storeConfig.description || ''} Where culinary art meets exceptional atmosphere.`, as: "div", className: "text-lg md:text-xl text-gray-300 max-w-xl mx-auto font-light leading-relaxed animate-fade-in-up delay-200 tracking-wide [&_p]:mb-0" }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-6 justify-center items-center pt-8 animate-fade-in-up delay-300", children: [_jsx(Button, { onClick: () => setIsReservationOpen(true), className: "h-14 px-10 bg-orange-600 hover:bg-orange-700 text-white text-sm font-bold uppercase tracking-[0.2em] rounded-full transition-all hover:scale-105 hover:shadow-[0_0_40px_rgba(234,88,12,0.3)]", children: getLayoutText(storeConfig, 'food.reserveTable', 'Reserve Table') }), _jsx("div", { onClick: scrollToMenu, className: "w-14 h-14 rounded-full border border-white/20 flex items-center justify-center cursor-pointer hover:bg-white hover:text-black transition-all group", children: _jsx(ArrowRight, { className: "h-5 w-5 group-hover:rotate-90 transition-transform duration-300" }) })] })] }), _jsxs("div", { className: "absolute bottom-10 left-1/2 -translate-x-1/2 flex flex-col items-center gap-4 animate-pulse", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.3em] text-gray-500", children: "Scroll" }), _jsx("div", { className: "w-px h-16 bg-gradient-to-b from-orange-500 to-transparent" })] })] }), layoutConfig?.sections?.story?.show !== false && (_jsxs("section", { "data-section": "about", "data-payaza-section-key": "about", "data-payaza-page": "home", className: "py-20 px-6 relative overflow-hidden", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'about'), children: [_jsx("div", { className: "absolute top-0 right-0 w-1/3 h-full bg-white/5 skew-x-12 transform translate-x-20 pointer-events-none" }), _jsx("div", { className: "container mx-auto max-w-6xl relative z-10", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "aspect-[4/5] rounded-none overflow-hidden grayscale hover:grayscale-0 transition-all duration-700", children: _jsx(ImageWithFallback, { src: getBannerImage(storeConfig, 'about_section_image', "https://images.unsplash.com/photo-1559339352-11d035aa65de?w=1200&q=80"), alt: "Chef", className: "w-full h-full object-cover" }) }), _jsxs("div", { className: "absolute -bottom-10 -right-10 bg-[#1A1A1A] p-8 border border-white/5 max-w-xs hidden md:block", children: [_jsx("p", { className: "font-serif italic text-2xl text-white mb-4", children: "\"Cooking is an art, but patience is the key ingredient.\"" }), _jsx("p", { className: "text-orange-500 text-xs font-bold uppercase tracking-widest", children: "\u2014 Head Chef Marco" })] })] }), _jsxs("div", { className: "space-y-8", children: [_jsx("span", { className: "text-orange-500 font-bold uppercase tracking-widest text-xs", children: layoutConfig?.sections?.story?.label || getLayoutText(storeConfig, 'food.ourPhilosophy', 'Our Philosophy') }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold leading-tight", children: layoutConfig?.sections?.story?.title || getLayoutText(storeConfig, 'food.ourPhilosophy', 'Crafting Memories Through Flavor') }), _jsx("p", { className: "text-gray-400 text-lg leading-relaxed", children: layoutConfig?.sections?.story?.description || getLayoutText(storeConfig, 'food.ourPhilosophy', 'We believe that dining is more than just eating; it\'s an experience that engages all senses. Our seasonal menu is carefully curated using locally sourced ingredients to bring you the freshest flavors of the region.') }), _jsxs("div", { className: "grid grid-cols-3 gap-8 pt-8 border-t border-white/10", children: [_jsxs("div", { children: [_jsx(Flame, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Wood Fired" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Authentic taste" })] }), _jsxs("div", { children: [_jsx(Wine, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Fine Wines" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Curated selection" })] }), _jsxs("div", { children: [_jsx(Coffee, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Artisan Coffee" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Roasted in-house" })] })] })] })] }) })] })), layoutConfig?.sections?.promoBanner?.show !== false && layoutConfig?.sections?.promoBanner && (_jsx(PromoBanner, { config: layoutConfig.sections.promoBanner, layoutStyle: "food", className: "my-20" })), _jsx("section", { id: "menu-section", "data-section": "menuGrid", "data-payaza-section-key": "menuGrid", "data-payaza-page": "home", className: "py-20 bg-[#141414] border-t border-white/5", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'menuGrid'), children: _jsxs("div", { className: "container mx-auto px-6 max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12", children: [_jsx("span", { className: "text-orange-500 font-bold uppercase tracking-widest text-xs mb-4 block", children: "Discover" }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold uppercase tracking-tight mb-8", children: getLayoutText(storeConfig, 'food.menuCategories', 'Our Menu') }), _jsxs("div", { className: "flex flex-wrap justify-center gap-4", children: [_jsx("button", { onClick: () => setActiveTab('all'), className: `px-8 py-3 rounded-full text-sm font-bold uppercase tracking-wider transition-all border ${activeTab === 'all' ? 'bg-white text-black border-white' : 'bg-transparent text-gray-400 border-white/10 hover:border-white/30'}`, children: "All" }), categories.map((cat) => (_jsx("button", { onClick: () => setActiveTab(cat.id), className: `px-8 py-3 rounded-full text-sm font-bold uppercase tracking-wider transition-all border ${activeTab === cat.id ? 'bg-white text-black border-white' : 'bg-transparent text-gray-400 border-white/10 hover:border-white/30'}`, children: cat.name }, cat.id)))] })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-16", children: filteredItems.map((item) => (_jsxs("div", { className: "group cursor-pointer", children: [_jsxs("div", { className: "aspect-square overflow-hidden rounded-full mb-6 border border-white/10 relative", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110 group-hover:rotate-3", skeletonAspectRatio: "square" }), _jsx("div", { className: "hidden lg:flex absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity items-center justify-center", children: _jsx(Button, { className: "bg-orange-600 rounded-full px-6 hover:bg-orange-700", onClick: (e) => {
|
|
73
|
+
return (_jsxs("div", { className: "bg-[#0F0F0F] text-white font-sans selection:bg-orange-500 selection:text-white", children: [layoutConfig?.sections?.hero?.show !== false && _jsxs("section", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "home", className: "relative h-screen w-full overflow-hidden flex items-center justify-center bg-[#0F0F0F]", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'hero'), children: [_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(VideoPlayer, { src: getAssetUrl(storeConfig, 'hero_video', "https://cdn.coverr.co/videos/coverr-chef-preparing-food-in-kitchen-5379/1080p.mp4"), poster: getBannerImage(storeConfig, 'hero_video_poster', "https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?q=80&w=2070&auto=format&fit=crop"), context: "background", className: "w-full h-full opacity-50 scale-105" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-[#0F0F0F] via-[#0F0F0F]/40 to-black/30" }), _jsx("div", { className: "absolute inset-0 bg-[url('https://www.transparenttextures.com/patterns/noise.png')] opacity-20 mix-blend-overlay" })] }), _jsxs("div", { className: "relative z-10 text-center px-4 max-w-5xl mx-auto space-y-10", children: [_jsxs("div", { className: "flex justify-center items-center gap-6 animate-fade-in-up", children: [_jsx("span", { className: "h-px w-16 bg-white/30" }), _jsxs("div", { className: "flex items-center gap-2 text-orange-500 uppercase tracking-[0.3em] text-xs font-bold", children: [_jsx(Star, { className: "h-3 w-3 fill-current" }), " ", getLayoutText(storeConfig, 'food.ourPhilosophy', 'Michelin Star 2024')] }), _jsx("span", { className: "h-px w-16 bg-white/30" })] }), _jsxs("h1", { className: "text-5xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-none uppercase text-white animate-fade-in-up delay-100", children: [getLayoutText(storeConfig, 'food.ourPhilosophy', 'Taste the Extraordinary'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-amber-200", children: "Extraordinary" })] }), _jsx(SafeRichHtml, { value: `${storeConfig.description || ''} Where culinary art meets exceptional atmosphere.`, as: "div", className: "text-lg md:text-xl text-gray-300 max-w-xl mx-auto font-light leading-relaxed animate-fade-in-up delay-200 tracking-wide [&_p]:mb-0" }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-6 justify-center items-center pt-8 animate-fade-in-up delay-300", children: [_jsx(Button, { onClick: () => setIsReservationOpen(true), className: "h-14 px-10 bg-orange-600 hover:bg-orange-700 text-white text-sm font-bold uppercase tracking-[0.2em] rounded-full transition-all hover:scale-105 hover:shadow-[0_0_40px_rgba(234,88,12,0.3)]", children: getLayoutText(storeConfig, 'food.reserveTable', 'Reserve Table') }), _jsx("div", { onClick: scrollToMenu, className: "w-14 h-14 rounded-full border border-white/20 flex items-center justify-center cursor-pointer hover:bg-white hover:text-black transition-all group", children: _jsx(ArrowRight, { className: "h-5 w-5 group-hover:rotate-90 transition-transform duration-300" }) })] })] }), _jsxs("div", { className: "absolute bottom-10 left-1/2 -translate-x-1/2 flex flex-col items-center gap-4 animate-pulse", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.3em] text-gray-500", children: "Scroll" }), _jsx("div", { className: "w-px h-16 bg-gradient-to-b from-orange-500 to-transparent" })] })] }), layoutConfig?.sections?.story?.show !== false && (_jsxs("section", { "data-section": "about", "data-payaza-section-key": "about", "data-payaza-page": "home", className: "py-20 px-6 relative overflow-hidden", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'about'), children: [_jsx("div", { className: "absolute top-0 right-0 w-1/3 h-full bg-white/5 skew-x-12 transform translate-x-20 pointer-events-none" }), _jsx("div", { className: "container mx-auto max-w-6xl relative z-10", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "aspect-[4/5] rounded-none overflow-hidden grayscale hover:grayscale-0 transition-all duration-700", children: _jsx(ImageWithFallback, { src: getBannerImage(storeConfig, 'about_section_image', "https://images.unsplash.com/photo-1559339352-11d035aa65de?w=1200&q=80"), alt: "Chef", className: "w-full h-full object-cover" }) }), _jsxs("div", { className: "absolute -bottom-10 -right-10 bg-[#1A1A1A] p-8 border border-white/5 max-w-xs hidden md:block", children: [_jsx("p", { className: "font-serif italic text-2xl text-white mb-4", children: "\"Cooking is an art, but patience is the key ingredient.\"" }), _jsx("p", { className: "text-orange-500 text-xs font-bold uppercase tracking-widest", children: "\u2014 Head Chef Marco" })] })] }), _jsxs("div", { className: "space-y-8", children: [_jsx("span", { className: "text-orange-500 font-bold uppercase tracking-widest text-xs", children: layoutConfig?.sections?.story?.label || getLayoutText(storeConfig, 'food.ourPhilosophy', 'Our Philosophy') }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold leading-tight", children: layoutConfig?.sections?.story?.title || getLayoutText(storeConfig, 'food.ourPhilosophy', 'Crafting Memories Through Flavor') }), _jsx("p", { className: "text-gray-400 text-lg leading-relaxed", children: layoutConfig?.sections?.story?.description || getLayoutText(storeConfig, 'food.ourPhilosophy', 'We believe that dining is more than just eating; it\'s an experience that engages all senses. Our seasonal menu is carefully curated using locally sourced ingredients to bring you the freshest flavors of the region.') }), _jsxs("div", { className: "grid grid-cols-3 gap-8 pt-8 border-t border-white/10", children: [_jsxs("div", { children: [_jsx(Flame, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Wood Fired" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Authentic taste" })] }), _jsxs("div", { children: [_jsx(Wine, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Fine Wines" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Curated selection" })] }), _jsxs("div", { children: [_jsx(Coffee, { className: "h-8 w-8 text-orange-500 mb-4" }), _jsx("h4", { className: "font-bold text-lg", children: "Artisan Coffee" }), _jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Roasted in-house" })] })] })] })] }) })] })), layoutConfig?.sections?.promoBanner?.show !== false && layoutConfig?.sections?.promoBanner && (_jsx(PromoBanner, { config: layoutConfig.sections.promoBanner, storeSlug: storeConfig.slug, layoutStyle: "food", className: "my-20", sectionKey: "promoBanner", page: "home" })), _jsx("section", { id: "menu-section", "data-section": "menuGrid", "data-payaza-section-key": "menuGrid", "data-payaza-page": "home", className: "py-20 bg-[#141414] border-t border-white/5", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'menuGrid'), children: _jsxs("div", { className: "container mx-auto px-6 max-w-7xl", children: [_jsxs("div", { className: "text-center mb-12", children: [_jsx("span", { className: "text-orange-500 font-bold uppercase tracking-widest text-xs mb-4 block", children: "Discover" }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold uppercase tracking-tight mb-8", children: getLayoutText(storeConfig, 'food.menuCategories', 'Our Menu') }), _jsxs("div", { className: "flex flex-wrap justify-center gap-4", children: [_jsx("button", { onClick: () => setActiveTab('all'), className: `px-8 py-3 rounded-full text-sm font-bold uppercase tracking-wider transition-all border ${activeTab === 'all' ? 'bg-white text-black border-white' : 'bg-transparent text-gray-400 border-white/10 hover:border-white/30'}`, children: "All" }), categories.map((cat) => (_jsx("button", { onClick: () => setActiveTab(cat.id), className: `px-8 py-3 rounded-full text-sm font-bold uppercase tracking-wider transition-all border ${activeTab === cat.id ? 'bg-white text-black border-white' : 'bg-transparent text-gray-400 border-white/10 hover:border-white/30'}`, children: cat.name }, cat.id)))] })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-16", children: filteredItems.map((item) => (_jsxs("div", { className: "group cursor-pointer", children: [_jsxs("div", { className: "aspect-square overflow-hidden rounded-full mb-6 border border-white/10 relative", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110 group-hover:rotate-3", skeletonAspectRatio: "square" }), _jsx("div", { className: "hidden lg:flex absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity items-center justify-center", children: _jsx(Button, { className: "bg-orange-600 rounded-full px-6 hover:bg-orange-700", onClick: (e) => {
|
|
74
74
|
e.preventDefault();
|
|
75
75
|
e.stopPropagation();
|
|
76
76
|
// Adapt menu item to product for cart
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/MenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/MenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,aAAa,+BA4UnF"}
|
|
@@ -9,6 +9,7 @@ import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js
|
|
|
9
9
|
import { useStore } from '../../../lib/store-context.js';
|
|
10
10
|
import { productService } from '../../../lib/services/product.service.js';
|
|
11
11
|
import { transformProductToStoreProduct } from '../../../lib/store-config-utils.js';
|
|
12
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
12
13
|
export function MenuPage({ storeConfig: initialConfig, categorySlug }) {
|
|
13
14
|
const { store } = useStore();
|
|
14
15
|
const storeConfig = store || initialConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BAw4BpG"}
|
|
@@ -57,6 +57,7 @@ function ReviewCard({ review }) {
|
|
|
57
57
|
export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
58
58
|
const { store, addToCart, isCartLoading, toggleWishlist, isInWishlist, isWishlistLoading, setBuyNowItem } = useStore();
|
|
59
59
|
const storeConfig = store || initialConfig;
|
|
60
|
+
const productDetailConfig = storeConfig.layoutConfig?.pages?.productDetail;
|
|
60
61
|
const products = filterActiveProducts(storeConfig.products || []);
|
|
61
62
|
const initialProduct = resolvePdpProduct(initialConfig.products, storeConfig.products, productSlug, isEditorPreviewMode(storeConfig));
|
|
62
63
|
const { product, relatedProducts: apiRelatedProducts, isLoading: isLoadingProduct } = useProductBySlug(storeConfig.id, productSlug, initialProduct);
|
|
@@ -402,7 +403,7 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
402
403
|
? 'border-gray-900 ring-2 ring-gray-900 ring-offset-2'
|
|
403
404
|
: 'border-gray-200 hover:border-gray-300'}`, children: _jsx(ImageWithFallback, { src: image, alt: `${product.name} view ${index + 1}`, className: cn("w-full h-full object-cover", isOutOfStock && "grayscale"), skeletonAspectRatio: "square" }) }, index))), hasMoreImages && (_jsxs("div", { className: "aspect-square rounded-lg border-2 border-gray-200 bg-gray-50 flex items-center justify-center text-xs text-gray-500 font-medium", children: ["+", productImages.length - 5, " more"] }))] }))] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center justify-between mb-2", children: [_jsx("span", { className: "text-sm font-semibold text-gray-700 uppercase tracking-wide", children: directCategory?.name || storeConfig.name }), _jsx("button", { onClick: handleShare, className: "text-gray-400 hover:text-gray-900 transition-colors p-2 rounded-full hover:bg-gray-100", title: "Share this product", children: _jsx(Share2, { className: "h-5 w-5" }) })] }), _jsx("h1", { "data-product-name": true, className: "text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 leading-tight tracking-tight", children: product.name }), _jsxs("p", { className: "text-sm text-gray-500 mb-6 font-mono", children: ["SKU: ", displaySKU] }), _jsx("div", { className: "mb-4 flex items-center gap-2", children: !isOutOfStock ? (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800", children: [_jsx(CheckCircle, { className: "w-3 h-3 mr-1" }), "In Stock"] })) : (_jsxs("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800", children: [_jsx(Info, { className: "w-3 h-3 mr-1" }), "Out of Stock"] })) }), _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "flex items-baseline gap-4", children: [_jsx("span", { "data-product-price": true, className: "text-4xl lg:text-5xl font-bold text-gray-900", children: formatCurrency(displayPrice, product.currency || 'USD') }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsx("span", { className: "text-2xl text-gray-500 line-through", children: formatCurrency(displayCompareAt, product.currency || 'USD') }))] }), displayCompareAt != null && displayCompareAt > displayPrice && (_jsxs("span", { className: "inline-block mt-2 bg-red-100 text-red-700 text-xs font-bold px-2 py-1 rounded", children: ["SAVE ", Math.round(((displayCompareAt - displayPrice) / displayCompareAt) * 100), "%"] }))] }), _jsx(PdpVariationSelectors, { optionGroups: optionGroups, selectedAttributes: selectedAttributes, setAttribute: setAttribute, isOptionAvailable: isOptionAvailable, getOptionImage: getOptionImage, storeSlug: storeConfig.slug, showSizeGuide: productDetailConfig?.showSizeGuide !== false, onAfterClearAttribute: () => setQuantity(1) }), _jsxs("div", { className: "flex flex-col gap-4 mb-8", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: "Quantity" }), _jsxs("div", { className: "flex items-center border border-gray-300 rounded-lg", children: [_jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-l-lg disabled:opacity-50", onClick: () => setQuantity(Math.max(1, quantity - 1)), disabled: quantity <= 1, children: _jsx(Minus, { className: "h-4 w-4" }) }), _jsx("span", { className: "w-12 text-center font-semibold text-gray-900", children: quantity }), _jsx("button", { className: "p-3 text-gray-600 hover:bg-gray-100 rounded-r-lg", onClick: () => setQuantity(quantity + 1), children: _jsx(Plus, { className: "h-4 w-4" }) })] })] }), _jsxs("div", { className: "flex flex-row items-stretch gap-2 sm:gap-3 mt-2 w-full", children: [_jsx(Button, { "data-add-to-cart": true, variant: "outline", size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 min-w-0 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold [&_svg]:text-gray-900 shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-4 w-4 sm:h-5 sm:w-5 mr-1.5 sm:mr-2 shrink-0 text-gray-900" }), "Add to Cart"] })) }), _jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 min-w-0 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-12 sm:h-14 px-3 sm:px-6 text-sm sm:text-base font-bold shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isBuyNowLoading || isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-1.5 sm:mr-2" }), "Adding..."] })) : ('Buy Now') }), storeConfig.features.wishlist && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-12 w-12 sm:h-14 sm:w-14 shrink-0 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
404
405
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
405
|
-
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }),
|
|
406
|
+
: "border-gray-200 hover:border-gray-300 hover:bg-gray-50"), children: isWishlistLoading ? (_jsx(ButtonLoader, { className: "h-5 w-5" })) : (_jsx(Heart, { className: cn("h-5 w-5", product && isInWishlist(product.id) && "fill-current") })) }))] })] }), _jsx(ProductDeliveryInfoSection, { storeConfig: storeConfig, currency: storeConfig.settings?.currency || 'USD', productCurrency: product.currency, productPrice: displayPrice, quantity: quantity, shippingAddress: shippingAddress, updateShippingAddress: (patch) => setShippingAddress((prev) => ({ ...prev, ...patch })), shippingMethods: shippingMethods, isCalculatingShipping: isCalculatingShipping, shippingError: shippingError, freeShippingEligible: freeShippingEligible, freeShippingThreshold: freeShippingThreshold, onToast: addToast }), product.description && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Description" }), _jsx("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: _jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }) })] })), product.specifications && Object.keys(product.specifications).length > 0 && (_jsxs("div", { className: "mb-8", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Specifications" }), _jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-4", children: Object.entries(product.specifications).map(([key, value]) => (_jsxs("div", { className: "flex flex-col p-3 bg-gray-50 rounded-lg", children: [_jsx("dt", { className: "text-xs text-gray-500 font-medium uppercase tracking-wider mb-1", children: key }), _jsx("dd", { className: "text-sm font-bold text-gray-900", children: value })] }, key))) })] }))] })] }), _jsx("div", { className: "mt-20 pt-16 border-t border-gray-200", children: _jsxs("div", { className: "max-w-4xl", children: [_jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 mb-10", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-4", children: "Customer Reviews" }), reviewCount > 0 && averageRating > 0 && (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: averageRating, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: averageRating.toFixed(1) }), _jsx("span", { className: "text-lg text-gray-500", children: "out of 5" })] }), _jsx("span", { className: "text-gray-300", children: "|" }), _jsxs("span", { className: "text-lg text-gray-600", children: [reviewCount, " ", reviewCount === 1 ? 'review' : 'reviews'] })] }))] }), reviewCount > 0 && (_jsx(Button, { onClick: () => {
|
|
406
407
|
if (!isAuthenticated) {
|
|
407
408
|
openLogin({ onSuccess: () => setIsReviewModalOpen(true) });
|
|
408
409
|
return;
|
|
@@ -4,7 +4,10 @@ interface PromoBannerProps {
|
|
|
4
4
|
config: PromoBannerSection | null | undefined;
|
|
5
5
|
layoutStyle?: 'food' | 'electronics' | 'clothing' | 'default';
|
|
6
6
|
className?: string;
|
|
7
|
+
storeSlug?: string;
|
|
8
|
+
sectionKey?: string;
|
|
9
|
+
page?: string;
|
|
7
10
|
}
|
|
8
|
-
export declare function PromoBanner({ config, layoutStyle, className }: PromoBannerProps): React.JSX.Element;
|
|
11
|
+
export declare function PromoBanner({ config, layoutStyle, className, storeSlug: storeSlugProp }: PromoBannerProps): React.JSX.Element;
|
|
9
12
|
export {};
|
|
10
13
|
//# sourceMappingURL=PromoBanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromoBanner.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/components/PromoBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAM9D,UAAU,gBAAgB;IACxB,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PromoBanner.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/components/PromoBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAM9D,UAAU,gBAAgB;IACxB,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,WAAuB,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,gBAAgB,qBA+DrH"}
|