payaza-storefront-layouts 1.0.49 → 1.0.51
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/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +1 -1
- package/dist/layouts/food/components/FoodHomePage.js +1 -1
- package/dist/preview/LayoutPreview.d.ts.map +1 -1
- package/dist/preview/LayoutPreview.js +12 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClothingHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing/components/ClothingHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAevD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAaD,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ClothingHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing/components/ClothingHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAevD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAaD,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,qBAAqB,2CAquBrF"}
|
|
@@ -263,7 +263,7 @@ export function ClothingHomePage({ storeConfig: initialConfig }) {
|
|
|
263
263
|
};
|
|
264
264
|
const categoryImage = extractCategoryImage(category.image);
|
|
265
265
|
return (_jsxs(Link, { href: `/${storeConfig.slug}/categories/${category.slug}`, className: `group relative overflow-hidden rounded-2xl aspect-[3/4]`, children: [_jsxs("div", { className: "absolute inset-0 bg-gray-200", children: [_jsx(ImageWithFallback, { src: categoryImage, alt: category.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "auto" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent opacity-80 group-hover:opacity-70 transition-opacity" })] }), _jsxs("div", { className: "absolute inset-0 flex flex-col justify-end p-8", children: [_jsx("h3", { className: "text-2xl font-bold text-white mb-2 transform translate-y-0 transition-transform duration-300", children: category.name }), _jsx("div", { className: "h-0.5 w-12 bg-white/0 group-hover:bg-white/100 transition-all duration-500 mb-4" }), _jsxs("span", { className: "inline-flex items-center text-white text-sm font-medium opacity-0 group-hover:opacity-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300", children: [getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-4 w-4" })] })] })] }, category.id));
|
|
266
|
-
}) })] }) })), layoutConfig?.sections?.marketing?.editorial?.show !== false && (_jsx("section", { "data-section": "editorial", className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-stone-50", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "aspect-[4/5] rounded-lg overflow-hidden relative", children: _jsx(ImageWithFallback, { src: layoutConfig?.sections?.marketing?.editorial?.image || 'https://images.unsplash.com/photo-1490481651871-ab68de25d43d?q=80&w=2000&auto=format&fit=crop', alt: "Editorial Lookbook", className: "w-full h-full object-cover", skeletonAspectRatio: "4/5" }) }), (layoutConfig?.sections?.marketing?.editorial?.detailImage) && (_jsx("div", { className: "absolute
|
|
266
|
+
}) })] }) })), layoutConfig?.sections?.marketing?.editorial?.show !== false && (_jsx("section", { "data-section": "editorial", className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-stone-50", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "aspect-[4/5] rounded-lg overflow-hidden relative", children: _jsx(ImageWithFallback, { src: layoutConfig?.sections?.marketing?.editorial?.image || 'https://images.unsplash.com/photo-1490481651871-ab68de25d43d?q=80&w=2000&auto=format&fit=crop', alt: "Editorial Lookbook", className: "w-full h-full object-cover", skeletonAspectRatio: "4/5" }) }), (layoutConfig?.sections?.marketing?.editorial?.detailImage) && (_jsx("div", { className: "absolute w-48 h-48 bg-white p-4 shadow-xl rounded-lg hidden md:block z-20 animate-fade-in-up", style: { bottom: '-2rem', right: '-2rem', animationDelay: '0.2s' }, children: _jsx("div", { className: "w-full h-full relative", children: _jsx(ImageWithFallback, { src: layoutConfig.sections.marketing.editorial.detailImage, alt: "Detail Shot", className: "w-full h-full object-cover rounded", skeletonAspectRatio: "square" }) }) }))] }), _jsxs("div", { className: "space-y-8", children: [_jsx("div", { className: "flex flex-col gap-2", children: _jsx("span", { className: "text-sm font-bold tracking-widest text-gray-500 uppercase", children: layoutConfig?.sections?.marketing?.editorial?.badgeText || "Lookbook" }) }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold tracking-tight leading-tight text-gray-900", children: layoutConfig?.sections?.marketing?.editorial?.title ? (layoutConfig.sections.marketing.editorial.title.split('\n').map((line, idx, arr) => (_jsxs("span", { children: [line, idx < arr.length - 1 && _jsx("br", {})] }, idx)))) : (_jsxs(_Fragment, { children: ["Redefining Modern ", _jsx("br", {}), _jsx("span", { className: "italic font-serif", children: "Elegance" })] })) }), _jsx("p", { className: "text-lg text-gray-600 leading-relaxed", children: layoutConfig?.sections?.marketing?.editorial?.description || "Explore our latest editorial featuring timeless pieces crafted for the contemporary wardrobe. From essential basics to statement outwear, find your signature look." }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 pt-4", children: [layoutConfig?.sections?.marketing?.editorial?.primaryButton?.text && (_jsx(Link, { href: layoutConfig.sections.marketing.editorial.primaryButton.link?.startsWith('/')
|
|
267
267
|
? `/${storeConfig.slug}${layoutConfig.sections.marketing.editorial.primaryButton.link}`
|
|
268
268
|
: (layoutConfig.sections.marketing.editorial.primaryButton.link || `/${storeConfig.slug}/style-guide`), children: _jsx(Button, { className: "rounded-full px-8 py-6 bg-gray-900 hover:bg-black text-white transition-all", children: layoutConfig.sections.marketing.editorial.primaryButton.text }) })), layoutConfig?.sections?.marketing?.editorial?.secondaryButton?.text && (_jsx(Link, { href: layoutConfig.sections.marketing.editorial.secondaryButton.link?.startsWith('/')
|
|
269
269
|
? `/${storeConfig.slug}${layoutConfig.sections.marketing.editorial.secondaryButton.link}`
|
|
@@ -86,7 +86,7 @@ export function FoodHomePage({ storeConfig: initialConfig }) {
|
|
|
86
86
|
console.log('[FoodHomePage] Sliders found:', layoutConfig?.sections?.hero?.sliders?.length || 0);
|
|
87
87
|
}
|
|
88
88
|
// Try new structure first (sections.hero.sliders)
|
|
89
|
-
let heroSlides = [];
|
|
89
|
+
let heroSlides = [{ image: 'https://images.unsplash.com/photo-1546069901-ba9599a7e63c?q=80&w=2000&auto=format&fit=crop', title: 'Taste the', highlight: 'Extraordinary', description: 'Experience culinary excellence delivered straight to your doorstep.', primaryBtn: 'Order Now', primaryBtnLink: '/menu', secondaryBtn: 'View Menu', secondaryBtnLink: '/menu' }];
|
|
90
90
|
if (layoutConfig?.sections?.hero?.sliders && Array.isArray(layoutConfig.sections.hero.sliders) && layoutConfig.sections.hero.sliders.length > 0) {
|
|
91
91
|
if (process.env.NODE_ENV === 'development') {
|
|
92
92
|
console.log('[FoodHomePage] Using sections.hero.sliders structure');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutPreview.d.ts","sourceRoot":"","sources":["../../src/preview/LayoutPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAUjE,UAAU,kBAAkB;IAC1B,MAAM,EAAE,eAAe,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"LayoutPreview.d.ts","sourceRoot":"","sources":["../../src/preview/LayoutPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAUjE,UAAU,kBAAkB;IAC1B,MAAM,EAAE,eAAe,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAuID,eAAO,MAAM,aAAa,gDAExB,CAAC"}
|
|
@@ -50,6 +50,18 @@ function LayoutPreviewWithRouter({ layout, className, initialRoute, onRouteChang
|
|
|
50
50
|
setCurrentRoute(initialRoute.startsWith('/') ? initialRoute : `/${initialRoute}`);
|
|
51
51
|
}
|
|
52
52
|
}, []);
|
|
53
|
+
// CRITICAL: Update route when initialRoute prop changes (e.g., from UPDATE_ROUTE message)
|
|
54
|
+
// This ensures the preview updates when the editor switches pages
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!isClient)
|
|
57
|
+
return;
|
|
58
|
+
if (initialRoute) {
|
|
59
|
+
const normalizedRoute = initialRoute.startsWith('/') ? initialRoute : `/${initialRoute}`;
|
|
60
|
+
if (currentRoute !== normalizedRoute) {
|
|
61
|
+
setCurrentRoute(normalizedRoute);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, [initialRoute, isClient, currentRoute]);
|
|
53
65
|
// Single source of truth for URL changes
|
|
54
66
|
useEffect(() => {
|
|
55
67
|
if (!isClient)
|