storefront-layouts 1.0.6 → 1.0.7
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/components/ui/route-skeleton-loader.d.ts.map +1 -1
- package/dist/components/ui/route-skeleton-loader.js +6 -1
- package/dist/editor/alignment-schemas/booking-footer-section.d.ts.map +1 -1
- package/dist/editor/alignment-schemas/booking-footer-section.js +0 -1
- package/dist/editor/alignment-schemas/clothing.d.ts.map +1 -1
- package/dist/editor/alignment-schemas/clothing.js +0 -1
- package/dist/editor/alignment-schemas/food.d.ts.map +1 -1
- package/dist/editor/alignment-schemas/food.js +0 -1
- package/dist/hooks/use-category-products.d.ts +5 -1
- package/dist/hooks/use-category-products.d.ts.map +1 -1
- package/dist/hooks/use-category-products.js +8 -5
- package/dist/hooks/use-filtered-products-fetch.d.ts +12 -0
- package/dist/hooks/use-filtered-products-fetch.d.ts.map +1 -0
- package/dist/hooks/use-filtered-products-fetch.js +58 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
- package/dist/layouts/booking/components/BookingHomePage.js +3 -1
- package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/AboutPage.js +3 -1
- package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/CategoryPage.js +3 -1
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ServicesPage.js +4 -2
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/AboutPage.js +3 -1
- package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/CategoryPage.js +3 -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/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ServicesPage.js +4 -2
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +5 -4
- package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/AboutPage.js +2 -1
- package/dist/layouts/clothing/pages/CategoriesPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/CategoriesPage.js +3 -2
- package/dist/layouts/clothing/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/CategoryPage.js +4 -3
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductDetailPage.js +3 -2
- package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductsPage.js +53 -60
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +4 -3
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/AboutPage.js +2 -1
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +3 -2
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/CategoryPage.js +4 -3
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.js +53 -60
- package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsHomePage.js +2 -1
- package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsProductsPage.js +45 -36
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -1
- package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/AboutPage.js +3 -1
- package/dist/layouts/electronics/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/CategoryPage.js +4 -3
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductsPage.js +53 -60
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +2 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.js +3 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.js +4 -3
- 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/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductsPage.js +53 -60
- package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
- package/dist/layouts/food/components/FoodHomePage.js +6 -4
- package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/AboutPage.js +2 -1
- package/dist/layouts/food/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/CategoryPage.js +5 -3
- package/dist/layouts/food/pages/MenuPage.js +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.js +2 -1
- package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductsPage.js +51 -54
- package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts.map +1 -1
- package/dist/layouts/food-modern/components/FoodHomePageModern.js +4 -2
- package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/AboutPage.js +3 -1
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/CategoryPage.js +5 -3
- package/dist/layouts/food-modern/pages/MenuPage.js +1 -1
- 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/food-modern/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductsPage.js +51 -54
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +4 -2
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/AboutPage.js +3 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +3 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.js +6 -4
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ProductsPage.js +53 -60
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +2 -1
- package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ServicesPage.js +4 -2
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +3 -2
- package/dist/layouts/shared/components/StoreFooter.d.ts.map +1 -1
- package/dist/layouts/shared/components/StoreFooter.js +3 -13
- package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/PortfolioPage.js +2 -1
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.d.ts +9 -0
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.d.ts.map +1 -0
- package/dist/layouts/shared/pages/StoreMaintenanceScreen.js +10 -0
- package/dist/layouts/shared/pages/StoreOfflinePage.d.ts +19 -0
- package/dist/layouts/shared/pages/StoreOfflinePage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/StoreOfflinePage.js +113 -0
- package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/WishlistPage.js +11 -14
- package/dist/lib/content-selectors.js +3 -3
- package/dist/lib/layout-route-utils.d.ts +1 -0
- package/dist/lib/layout-route-utils.d.ts.map +1 -1
- package/dist/lib/layout-route-utils.js +1 -1
- package/dist/lib/services/product.service.d.ts +1 -0
- package/dist/lib/services/product.service.d.ts.map +1 -1
- package/dist/lib/store-context.d.ts +1 -0
- package/dist/lib/store-context.d.ts.map +1 -1
- package/dist/lib/store-context.js +1 -0
- package/dist/lib/utils/catalog-price-bounds.d.ts +2 -0
- package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
- package/dist/lib/utils/catalog-price-bounds.js +21 -0
- package/dist/lib/utils/filtered-product-query.d.ts +22 -0
- package/dist/lib/utils/filtered-product-query.d.ts.map +1 -0
- package/dist/lib/utils/filtered-product-query.js +57 -0
- package/dist/lib/utils/filtered-products-inflight.d.ts +3 -0
- package/dist/lib/utils/filtered-products-inflight.d.ts.map +1 -0
- package/dist/lib/utils/filtered-products-inflight.js +15 -0
- package/dist/lib/utils/url-helpers.d.ts.map +1 -1
- package/dist/lib/utils/url-helpers.js +2 -11
- package/dist/styles/index.css +33 -6
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-skeleton-loader.d.ts","sourceRoot":"","sources":["../../../src/components/ui/route-skeleton-loader.tsx"],"names":[],"mappings":"AAUA,UAAU,wBAAwB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"route-skeleton-loader.d.ts","sourceRoot":"","sources":["../../../src/components/ui/route-skeleton-loader.tsx"],"names":[],"mappings":"AAUA,UAAU,wBAAwB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,wBAAwB,+BAqHlG"}
|
|
@@ -47,6 +47,11 @@ export function RouteSkeletonLoader({ className, pathname: pathnameProp }) {
|
|
|
47
47
|
return 'generic';
|
|
48
48
|
};
|
|
49
49
|
const routeType = getRouteType(pathname);
|
|
50
|
+
// Category and product list pages SSR real content quickly — a full-screen overlay
|
|
51
|
+
// only blocks the shell and makes empty categories feel stuck.
|
|
52
|
+
if (routeType === 'category-detail' || routeType === 'categories' || routeType === 'products') {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
50
55
|
const renderSkeleton = () => {
|
|
51
56
|
switch (routeType) {
|
|
52
57
|
case 'homepage':
|
|
@@ -60,7 +65,7 @@ export function RouteSkeletonLoader({ className, pathname: pathnameProp }) {
|
|
|
60
65
|
case 'categories':
|
|
61
66
|
return (_jsx("div", { className: "min-h-[calc(100vh-200px)] bg-white py-8 lg:py-12", children: _jsxs("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: [_jsx("div", { className: "mb-6 h-4 bg-gray-200 rounded w-48 animate-pulse" }), _jsx(CategoryGridSkeleton, { count: 6 })] }) }));
|
|
62
67
|
case 'category-detail':
|
|
63
|
-
return (
|
|
68
|
+
return (_jsxs("div", { className: "min-h-[calc(100vh-200px)] bg-white", children: [_jsx("div", { className: "h-[40vh] bg-gray-100 animate-pulse" }), _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8 py-12", children: _jsx("div", { className: "mb-10 h-4 w-48 bg-gray-200 rounded animate-pulse" }) })] }));
|
|
64
69
|
case 'checkout':
|
|
65
70
|
return _jsx(CheckoutSkeleton, {});
|
|
66
71
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-footer-section.d.ts","sourceRoot":"","sources":["../../../src/editor/alignment-schemas/booking-footer-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuB,MAAM,SAAS,CAAC;AAS1D,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"booking-footer-section.d.ts","sourceRoot":"","sources":["../../../src/editor/alignment-schemas/booking-footer-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuB,MAAM,SAAS,CAAC;AAS1D,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA6D3D,CAAC"}
|
|
@@ -29,7 +29,6 @@ export const bookingFooterSection = {
|
|
|
29
29
|
description: 'Optional override. Leave blank to use the store name and current year.',
|
|
30
30
|
},
|
|
31
31
|
showSocialLinks: { type: 'toggle', label: 'Show Social Icons', defaultValue: true },
|
|
32
|
-
showPaymentBadges: { type: 'toggle', label: 'Show Payment Method Badges', defaultValue: true },
|
|
33
32
|
address: {
|
|
34
33
|
type: 'multiline_text',
|
|
35
34
|
label: 'Footer Address',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clothing.d.ts","sourceRoot":"","sources":["../../../src/editor/alignment-schemas/clothing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,SAAS,CAAC;AASrE,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"clothing.d.ts","sourceRoot":"","sources":["../../../src/editor/alignment-schemas/clothing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,SAAS,CAAC;AASrE,eAAO,MAAM,cAAc,EAAE,qBAqd5B,CAAC"}
|
|
@@ -204,7 +204,6 @@ export const ClothingSchema = {
|
|
|
204
204
|
fields: {
|
|
205
205
|
show: { type: 'toggle', label: 'Display Header', defaultValue: true },
|
|
206
206
|
image: { type: 'image', label: 'Background Image', description: 'Large banner image for the products page (recommended 2000x600px).', defaultValue: 'https://images.unsplash.com/photo-1523381210434-271e8be1f52b?q=80&w=2000&auto=format&fit=crop' },
|
|
207
|
-
badge: { type: 'text', label: 'Accent Text', description: 'Small text badge above the main title.', defaultValue: 'New Arrivals 2024' },
|
|
208
207
|
title: { type: 'text', label: 'Page Headline', defaultValue: 'All Products' },
|
|
209
208
|
description: { type: 'multiline_text', label: 'Introductory Text', description: 'Brief description of what customers will find in your catalog.', defaultValue: "Don't miss out on shopping our latest collection! curated for quality and style. Experience the perfect blend of modern aesthetics and premium craftsmanship." },
|
|
210
209
|
primaryButtonText: { type: 'text', label: 'Primary Action Text', defaultValue: 'Start Shopping' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"food.d.ts","sourceRoot":"","sources":["../../../src/editor/alignment-schemas/food.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,SAAS,CAAC;AASrE,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"food.d.ts","sourceRoot":"","sources":["../../../src/editor/alignment-schemas/food.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,SAAS,CAAC;AASrE,eAAO,MAAM,UAAU,EAAE,qBAsexB,CAAC"}
|
|
@@ -284,7 +284,6 @@ export const FoodSchema = {
|
|
|
284
284
|
show: { type: 'toggle', label: 'Show Section', defaultValue: true },
|
|
285
285
|
title: { type: 'text', label: 'Page Title' },
|
|
286
286
|
description: { type: 'multiline_text', label: 'Description / Subheading' },
|
|
287
|
-
badgeText: { type: 'text', label: 'Badge Text (e.g. New Arrivals 2024)', defaultValue: 'New Arrivals 2024' },
|
|
288
287
|
backgroundImage: { type: 'image', label: 'Header Background Image' },
|
|
289
288
|
primaryButtonText: { type: 'text', label: 'Primary Button Text' },
|
|
290
289
|
secondaryButtonText: { type: 'text', label: 'Secondary Button Text' }
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { StoreProduct } from '../lib/store-types.js';
|
|
2
|
-
export
|
|
2
|
+
export type CategoryProductsSeed = {
|
|
3
|
+
products: StoreProduct[];
|
|
4
|
+
total: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function useCategoryProducts(storeId: string, categoryId?: string, seed?: CategoryProductsSeed): {
|
|
3
7
|
products: StoreProduct[];
|
|
4
8
|
isLoading: boolean;
|
|
5
9
|
hasMore: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-category-products.d.ts","sourceRoot":"","sources":["../../src/hooks/use-category-products.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,wBAAgB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"use-category-products.d.ts","sourceRoot":"","sources":["../../src/hooks/use-category-products.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,oBAAoB;;;;;EAwC5B"}
|
|
@@ -3,11 +3,12 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { productService } from '../lib/services/product.service.js';
|
|
4
4
|
import { transformProductToStoreProduct } from '../lib/store-config-utils.js';
|
|
5
5
|
const PAGE_SIZE = 12;
|
|
6
|
-
export function useCategoryProducts(storeId, categoryId) {
|
|
7
|
-
const
|
|
6
|
+
export function useCategoryProducts(storeId, categoryId, seed) {
|
|
7
|
+
const hasSeed = Boolean(seed);
|
|
8
|
+
const [products, setProducts] = useState(seed?.products ?? []);
|
|
8
9
|
const [page, setPage] = useState(1);
|
|
9
|
-
const [total, setTotal] = useState(0);
|
|
10
|
-
const [isLoading, setIsLoading] = useState(Boolean(categoryId));
|
|
10
|
+
const [total, setTotal] = useState(seed?.total ?? 0);
|
|
11
|
+
const [isLoading, setIsLoading] = useState(Boolean(categoryId) && !hasSeed);
|
|
11
12
|
const fetchPage = useCallback(async (requestedPage, append = false) => {
|
|
12
13
|
if (!categoryId)
|
|
13
14
|
return;
|
|
@@ -32,8 +33,10 @@ export function useCategoryProducts(storeId, categoryId) {
|
|
|
32
33
|
}
|
|
33
34
|
}, [categoryId, storeId]);
|
|
34
35
|
useEffect(() => {
|
|
36
|
+
if (!categoryId || hasSeed)
|
|
37
|
+
return;
|
|
35
38
|
fetchPage(1);
|
|
36
|
-
}, [fetchPage]);
|
|
39
|
+
}, [categoryId, fetchPage, hasSeed]);
|
|
37
40
|
return {
|
|
38
41
|
products,
|
|
39
42
|
isLoading,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Product, ProductListParams } from '../lib/services/product.service.js';
|
|
2
|
+
export type UseFilteredProductsFetchOptions<TItem> = {
|
|
3
|
+
bootstrapItemCount: number;
|
|
4
|
+
bootstrapTotal?: number;
|
|
5
|
+
debounceMs?: number;
|
|
6
|
+
mapResponse: (products: Product[]) => TItem[];
|
|
7
|
+
applyResults: (items: TItem[], total: number) => void;
|
|
8
|
+
setTotalProducts: (total: number) => void;
|
|
9
|
+
setLoading: (loading: boolean) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function useFilteredProductsFetch<TItem>(productQueryParams: ProductListParams, productQueryKey: string, options: UseFilteredProductsFetchOptions<TItem>): void;
|
|
12
|
+
//# sourceMappingURL=use-filtered-products-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-filtered-products-fetch.d.ts","sourceRoot":"","sources":["../../src/hooks/use-filtered-products-fetch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAIjF,MAAM,MAAM,+BAA+B,CAAC,KAAK,IAAI;IACnD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,CAAC;IAC9C,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,KAAK,EAC5C,kBAAkB,EAAE,iBAAiB,EACrC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,+BAA+B,CAAC,KAAK,CAAC,QAiEhD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { isDefaultFilteredProductQuery } from '../lib/utils/filtered-product-query.js';
|
|
4
|
+
import { runFilteredProductsFetch } from '../lib/utils/filtered-products-inflight.js';
|
|
5
|
+
export function useFilteredProductsFetch(productQueryParams, productQueryKey, options) {
|
|
6
|
+
const completedKeyRef = useRef(null);
|
|
7
|
+
const optionsRef = useRef(options);
|
|
8
|
+
const paramsRef = useRef(productQueryParams);
|
|
9
|
+
optionsRef.current = options;
|
|
10
|
+
paramsRef.current = productQueryParams;
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const productQueryParams = paramsRef.current;
|
|
13
|
+
const { bootstrapItemCount, bootstrapTotal, debounceMs = 0, mapResponse, applyResults, setTotalProducts, setLoading, } = optionsRef.current;
|
|
14
|
+
const isDefaultQuery = isDefaultFilteredProductQuery(productQueryParams);
|
|
15
|
+
if (isDefaultQuery && bootstrapItemCount > 0) {
|
|
16
|
+
setTotalProducts(bootstrapTotal ?? bootstrapItemCount);
|
|
17
|
+
completedKeyRef.current = productQueryKey;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (completedKeyRef.current === productQueryKey) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let cancelled = false;
|
|
24
|
+
let timer;
|
|
25
|
+
const run = () => {
|
|
26
|
+
setLoading(true);
|
|
27
|
+
runFilteredProductsFetch(productQueryKey, async () => {
|
|
28
|
+
const { productService } = await import('../lib/services/product.service.js');
|
|
29
|
+
return productService.getProducts({ ...productQueryParams, page: 1, limit: 12 });
|
|
30
|
+
})
|
|
31
|
+
.then((response) => {
|
|
32
|
+
if (cancelled)
|
|
33
|
+
return;
|
|
34
|
+
applyResults(mapResponse(response.data), response.meta.total);
|
|
35
|
+
completedKeyRef.current = productQueryKey;
|
|
36
|
+
})
|
|
37
|
+
.catch((error) => {
|
|
38
|
+
if (!cancelled)
|
|
39
|
+
console.error('Failed to fetch products:', error);
|
|
40
|
+
})
|
|
41
|
+
.finally(() => {
|
|
42
|
+
if (!cancelled)
|
|
43
|
+
setLoading(false);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
if (debounceMs > 0) {
|
|
47
|
+
timer = setTimeout(run, debounceMs);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
run();
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
cancelled = true;
|
|
54
|
+
if (timer)
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
};
|
|
57
|
+
}, [productQueryKey]);
|
|
58
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -105,6 +105,8 @@ export { CookiePolicyPage } from './layouts/shared/pages/CookiePolicyPage';
|
|
|
105
105
|
export { FeatureDisabledPage } from './layouts/shared/pages/FeatureDisabledPage';
|
|
106
106
|
export { HelpCenterPage } from './layouts/shared/pages/HelpCenterPage';
|
|
107
107
|
export { MaintenancePage } from './layouts/shared/pages/MaintenancePage';
|
|
108
|
+
export { StoreOfflinePage } from './layouts/shared/pages/StoreOfflinePage';
|
|
109
|
+
export { StoreMaintenanceScreen, type StoreMaintenanceReason, } from './layouts/shared/pages/StoreMaintenanceScreen';
|
|
108
110
|
export { PortfolioPage } from './layouts/shared/pages/PortfolioPage';
|
|
109
111
|
export { PrivacyPolicyPage } from './layouts/shared/pages/PrivacyPolicyPage';
|
|
110
112
|
export { ShippingReturnsPage } from './layouts/shared/pages/ShippingReturnsPage';
|
|
@@ -125,6 +127,9 @@ export { AuthProvider, useAuth, AuthContext } from './lib/auth-context';
|
|
|
125
127
|
export { setAccessToken, getAccessToken } from './lib/api';
|
|
126
128
|
export * from './lib/rich-html';
|
|
127
129
|
export { SafeRichHtml } from './components/rich-text/SafeRichHtml';
|
|
130
|
+
export { CategoryDescription } from './components/rich-text/CategoryDescription';
|
|
131
|
+
export { ProductDescription } from './components/rich-text/ProductDescription';
|
|
132
|
+
export { RichTextExcerpt } from './components/rich-text/RichTextExcerpt';
|
|
128
133
|
export type { StoreConfig, StoreProduct, StoreService, StoreCategory, StoreBranding, StoreLayoutType } from './lib/store-types';
|
|
129
134
|
export { isBookingAgendaStoreRoot } from './lib/layout-route-utils';
|
|
130
135
|
export { applyEditorCatalogOverlay, applyStoreCatalogFromApi, coalesceCatalog, syncFoodMenuItemsFromProducts, } from './lib/utils/editor-preview';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,iBAAiB,IAAI,2BAA2B,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1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,iCAAiC,EACjC,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -115,6 +115,8 @@ export { CookiePolicyPage } from './layouts/shared/pages/CookiePolicyPage';
|
|
|
115
115
|
export { FeatureDisabledPage } from './layouts/shared/pages/FeatureDisabledPage';
|
|
116
116
|
export { HelpCenterPage } from './layouts/shared/pages/HelpCenterPage';
|
|
117
117
|
export { MaintenancePage } from './layouts/shared/pages/MaintenancePage';
|
|
118
|
+
export { StoreOfflinePage } from './layouts/shared/pages/StoreOfflinePage';
|
|
119
|
+
export { StoreMaintenanceScreen, } from './layouts/shared/pages/StoreMaintenanceScreen';
|
|
118
120
|
export { PortfolioPage } from './layouts/shared/pages/PortfolioPage';
|
|
119
121
|
export { PrivacyPolicyPage } from './layouts/shared/pages/PrivacyPolicyPage';
|
|
120
122
|
export { ShippingReturnsPage } from './layouts/shared/pages/ShippingReturnsPage';
|
|
@@ -138,6 +140,9 @@ export { AuthProvider, useAuth, AuthContext } from './lib/auth-context';
|
|
|
138
140
|
export { setAccessToken, getAccessToken } from './lib/api';
|
|
139
141
|
export * from './lib/rich-html';
|
|
140
142
|
export { SafeRichHtml } from './components/rich-text/SafeRichHtml';
|
|
143
|
+
export { CategoryDescription } from './components/rich-text/CategoryDescription';
|
|
144
|
+
export { ProductDescription } from './components/rich-text/ProductDescription';
|
|
145
|
+
export { RichTextExcerpt } from './components/rich-text/RichTextExcerpt';
|
|
141
146
|
// Layout route utils (booking-agenda store root detection for preview, editor, template page, launched store)
|
|
142
147
|
export { isBookingAgendaStoreRoot } from './lib/layout-route-utils';
|
|
143
148
|
// Editor catalog helpers (store-setup / PayazaFormEditor host)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/components/BookingHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"BookingHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/components/BookingHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,UAAU,oBAAoB;IAC5B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,oBAAoB,+BAgZnF"}
|
|
@@ -3,6 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { Button } from '../../../components/ui/button.js';
|
|
4
4
|
import { Clock, Star, ArrowRight, User, Sparkles } from 'lucide-react';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
7
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
6
8
|
import Image from 'next/image';
|
|
7
9
|
import { useStore } from '../../../lib/store-context.js';
|
|
8
10
|
import { formatCurrency, filterActiveServices } from '../../../lib/utils/index.js';
|
|
@@ -33,7 +35,7 @@ export function BookingHomePage({ storeConfig: initialConfig }) {
|
|
|
33
35
|
const titleText = layoutConfig?.sections?.hero?.title || getTextContent(storeConfig, 'hero_title', 'Reveal Your\nInner Radiance.');
|
|
34
36
|
const lines = titleText.split('\n');
|
|
35
37
|
return lines.map((line, i) => (_jsx("span", { children: i === lines.length - 1 ? (_jsx("span", { className: "font-bold", children: line })) : (_jsxs(_Fragment, { children: [line, " ", _jsx("br", {})] })) }, i)));
|
|
36
|
-
})() }), _jsx(
|
|
38
|
+
})() }), _jsx(SafeRichHtml, { value: layoutConfig?.sections?.hero?.subtitle || getTextContent(storeConfig, 'hero_subtitle', storeConfig.description || "Enhance your natural beauty with our professional makeup artistry."), as: "div", className: "text-xl md:text-2xl text-gray-200 mb-10 font-light leading-relaxed max-w-lg [&_p]:mb-0" }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4", children: [_jsx(Link, { href: `/${storeConfig.slug}/book`, children: _jsx(Button, { size: "lg", className: "h-14 px-8 rounded-full text-lg font-medium bg-white text-black hover:bg-gray-100 transition-colors", children: layoutConfig?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'booking.bookAppointment', getTextContent(storeConfig, 'book_btn', 'Book Appointment')) }) }), _jsx(Link, { href: `/${storeConfig.slug}/services`, children: _jsx(Button, { size: "lg", variant: "outline", className: "h-14 px-8 rounded-full text-lg font-medium border-white/80 text-white bg-white/5 hover:bg-white/15 hover:text-white transition-colors backdrop-blur-sm shadow-lg", children: layoutConfig?.sections?.hero?.secondaryCTA || getLayoutText(storeConfig, 'booking.viewServices', getTextContent(storeConfig, 'view_services_btn', 'View Services')) }) })] })] }) })] }), _jsx("section", { "data-section": "featuredServices", className: "py-12 md:py-20 px-4 bg-gray-50/50", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "flex justify-between items-end mb-8 md:mb-12", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-3xl font-bold text-gray-900 mb-2", children: layoutConfig?.sections?.featuredServices?.title || getLayoutText(storeConfig, 'sections.featuredServices.title', getTextContent(storeConfig, 'services_section_title', 'Signature Looks')) }), _jsx("p", { className: "text-gray-500", children: layoutConfig?.sections?.featuredServices?.subtitle || getLayoutText(storeConfig, 'sections.featuredServices.subtitle', getTextContent(storeConfig, 'services_section_subtitle', 'Curated styles for every occasion')) })] }), _jsxs(Link, { href: `/${storeConfig.slug}/services`, className: "flex items-center gap-2 text-sm font-bold tracking-wide uppercase hover:underline", style: { color: primaryColor }, children: [layoutConfig?.sections?.featuredServices?.viewAllLabel || getLayoutText(storeConfig, 'sections.featuredServices.viewAll', getTextContent(storeConfig, 'services_view_all', 'View All')), ' ', _jsx(ArrowRight, { className: "w-4 h-4" })] })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: services.slice(0, 3).map((service) => (_jsxs(Link, { href: `/${storeConfig.slug}/book?service=${service.slug}`, className: "group cursor-pointer", children: [_jsxs("div", { className: "relative aspect-[4/3] overflow-hidden rounded-2xl mb-6 bg-gray-200", children: [_jsx(Image, { src: getServiceImage(service.image, storeConfig, "https://images.unsplash.com/photo-1522337660859-02fbefca4702?q=80&w=2069&auto=format&fit=crop"), alt: service.name, fill: true, className: "object-cover transition-transform duration-700 group-hover:scale-110" }), _jsx("div", { className: "absolute top-4 right-4 bg-white/90 backdrop-blur px-3 py-1 rounded-full text-sm font-bold shadow-sm", children: formatCurrency(service.price, service.currency || storeConfig.settings?.currency || 'USD') })] }), _jsx("h3", { className: "text-xl font-bold text-gray-900 mb-2 group-hover:text-gray-600 transition-colors", children: service.name }), _jsx(RichTextExcerpt, { value: service.description, as: "p", className: "text-gray-500 line-clamp-2 mb-4" }), _jsxs("div", { className: "flex items-center gap-4 text-sm text-gray-400", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Clock, { className: "w-4 h-4" }), " ", service.duration, " mins"] }), service.provider && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(User, { className: "w-4 h-4" }), " ", service.provider.name] }))] })] }, service.id))) })] }) }), _jsx("section", { "data-section": "team", className: "py-12 md:py-24 px-4 bg-white", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: (() => {
|
|
37
39
|
const teamMembers = storeConfig.layoutConfig?.pages?.team?.members || [];
|
|
38
40
|
const fallbackTeam = [
|
|
39
41
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,UAAU,cAAc;IACtB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,cAAc,+BA6OvE"}
|
|
@@ -5,6 +5,8 @@ import { Button } from '../../../components/ui/button.js';
|
|
|
5
5
|
import { DotPattern } from '../../../components/ui/background-patterns.js';
|
|
6
6
|
import { useStore } from '../../../lib/store-context.js';
|
|
7
7
|
import Image from 'next/image';
|
|
8
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
9
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
8
10
|
export function AboutPage({ storeConfig: initialConfig }) {
|
|
9
11
|
const { store } = useStore();
|
|
10
12
|
const storeConfig = store || initialConfig;
|
|
@@ -39,7 +41,7 @@ export function AboutPage({ storeConfig: initialConfig }) {
|
|
|
39
41
|
description: "We use only the best tools and products for our services."
|
|
40
42
|
}
|
|
41
43
|
];
|
|
42
|
-
return (_jsxs("div", { className: "min-h-screen bg-white pb-20 overflow-hidden", children: [_jsxs("section", { "data-section": "hero", className: "relative h-[60vh] min-h-[500px] w-full overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: heroImage, alt: "About Us", fill: true, className: "w-full h-full object-cover transform scale-105 animate-pulse-slow" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/80 via-black/50 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "max-w-3xl animate-fade-in-up", children: [_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-white text-sm font-medium mb-6", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }), "Est. 2024"] }), _jsx("h1", { className: "text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight leading-tight", children: pageTitle }), _jsx("
|
|
44
|
+
return (_jsxs("div", { className: "min-h-screen bg-white pb-20 overflow-hidden", children: [_jsxs("section", { "data-section": "hero", className: "relative h-[60vh] min-h-[500px] w-full overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: heroImage, alt: "About Us", fill: true, className: "w-full h-full object-cover transform scale-105 animate-pulse-slow" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/80 via-black/50 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "max-w-3xl animate-fade-in-up", children: [_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-white text-sm font-medium mb-6", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }), "Est. 2024"] }), _jsx("h1", { className: "text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight leading-tight", children: pageTitle }), _jsx(SafeRichHtml, { value: missionStatement || storeConfig.description, as: "div", className: "text-xl md:text-2xl text-gray-200 max-w-2xl leading-relaxed font-light [&_p]:mb-0" })] }) }) })] }), _jsxs("section", { "data-section": "story", className: "py-24 px-4 sm:px-6 lg:px-8 relative", children: [_jsx("div", { className: "absolute top-0 right-0 -mt-24 -mr-24 w-96 h-96 bg-gray-50 rounded-full blur-3xl -z-10" }), _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-16 items-center", children: [_jsxs("div", { className: "relative", children: [galleryImages && galleryImages.length > 0 ? (_jsx("div", { className: "grid grid-cols-2 gap-4", children: galleryImages.slice(0, 4).map((img, i) => (_jsx("div", { className: `relative overflow-hidden rounded-2xl shadow-lg ${i === 0 ? 'col-span-2 aspect-[16/9]' : 'aspect-square'}`, children: _jsx(Image, { src: img.image, alt: img.caption || "Gallery Image", fill: true, className: "w-full h-full object-cover hover:scale-110 transition-transform duration-500" }) }, i))) })) : (_jsxs("div", { className: "relative aspect-[4/5] rounded-[2rem] overflow-hidden shadow-2xl", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop", alt: "Our Team", fill: true, className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-60" }), _jsxs("div", { className: "absolute bottom-8 left-8 text-white", children: [_jsx("p", { className: "font-bold text-lg", children: "The Dream Team" }), _jsx("p", { className: "text-white/80 text-sm", children: "Working together to serve you better" })] })] })), _jsx("div", { className: "absolute -bottom-6 -right-6 w-24 h-24 bg-white rounded-2xl shadow-xl flex items-center justify-center p-4 animate-bounce duration-[3000ms]", children: _jsx(Heart, { className: "w-10 h-10", style: { color: primaryColor, fill: primaryColor } }) })] }), _jsxs("div", { className: "space-y-10", children: [_jsxs("div", { children: [_jsx("span", { className: "text-sm font-bold uppercase tracking-widest mb-3 block", style: { color: primaryColor }, children: "Who We Are" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 mb-6 tracking-tight", children: "Our Journey" }), _jsxs("div", { className: "prose prose-lg text-gray-600 leading-relaxed space-y-6", children: [pageContent?.split('\n').map((paragraph, idx) => (_jsx("p", { children: paragraph }, idx))), !pageContent && (_jsxs(_Fragment, { children: [_jsxs("p", { children: ["Founded with a bold vision to redefine excellence in the ", _jsx("span", { className: "font-semibold text-gray-900", children: storeConfig.type }), " industry, ", storeConfig.name, " has grown from a small passion project into a beloved brand. We believe in the power of quality, innovation, and community."] }), _jsx("p", { children: "Every day, we strive to bring you the best products, curated with care and delivered with a smile. Our team is dedicated to ensuring that your experience with us is nothing short of exceptional." })] }))] })] }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-8", children: values.map((item, idx) => (_jsxs("div", { className: "flex gap-4 group", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("div", { className: "w-14 h-14 rounded-2xl flex items-center justify-center transition-colors group-hover:bg-gray-100", style: { backgroundColor: `${primaryColor}10` }, children: _jsx(item.icon, { className: "h-7 w-7 transition-transform group-hover:scale-110", style: { color: primaryColor } }) }) }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-gray-900 mb-2 text-lg", children: item.title }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-600 text-sm leading-relaxed" })] })] }, idx))) })] })] }) })] }), _jsxs("section", { "data-section": "stats", className: "py-20 relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 opacity-10", children: _jsx(DotPattern, { color: primaryColor, cx: 2, cy: 2, cr: 2, width: 30, height: 30 }) }), _jsx("div", { className: "absolute inset-0", style: { backgroundColor: `${secondaryColor}15` } }), _jsx("div", { className: "container mx-auto px-4 relative z-10", children: _jsx("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-8 md:gap-12", children: [
|
|
43
45
|
{ label: "Bookings Completed", value: "8k+" },
|
|
44
46
|
{ label: "Expert Staff", value: "15+" },
|
|
45
47
|
{ label: "Services Offered", value: storeConfig.services?.length ? `${storeConfig.services.length}+` : "20+" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/CategoryPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CategoryPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/CategoryPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAgB5E,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,iBAAiB,+BAyI5E"}
|
|
@@ -10,6 +10,8 @@ import { useAnalytics } from '../../../hooks/use-analytics.js';
|
|
|
10
10
|
import { useEffect } from 'react';
|
|
11
11
|
import { formatCurrency, filterActiveServices } from '../../../lib/utils/index.js';
|
|
12
12
|
import Image from 'next/image';
|
|
13
|
+
import { CategoryDescription } from '../../../components/rich-text/CategoryDescription.js';
|
|
14
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
13
15
|
export function CategoryPage({ storeConfig, categorySlug }) {
|
|
14
16
|
const categories = storeConfig.categories || [];
|
|
15
17
|
const category = categories.find(c => c.slug === categorySlug);
|
|
@@ -38,5 +40,5 @@ export function CategoryPage({ storeConfig, categorySlug }) {
|
|
|
38
40
|
const isDarkTheme = storeConfig.type === 'food-modern' || storeConfig.branding.theme === 'dark';
|
|
39
41
|
const bgColor = isDarkTheme ? 'bg-[#0F0F0F]' : 'bg-gray-50';
|
|
40
42
|
const textColor = isDarkTheme ? 'text-white' : 'text-gray-900';
|
|
41
|
-
return (_jsxs("div", { className: "min-h-screen bg-white text-gray-900 transition-colors duration-300", children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-[2px]" }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }),
|
|
43
|
+
return (_jsxs("div", { className: "min-h-screen bg-white text-gray-900 transition-colors duration-300", children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-[2px]" }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }), _jsx(CategoryDescription, { description: category.description })] })] }), _jsxs("div", { className: "container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center mb-10 gap-4", children: [_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "inline-flex items-center text-sm font-medium text-gray-600 hover:text-gray-900", children: [_jsx(ArrowLeft, { className: "h-4 w-4 mr-2" }), "Back to All Categories"] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs(Button, { variant: "outline", className: "bg-white", children: [_jsx(Filter, { className: "h-4 w-4 mr-2" }), " Filter"] }) })] }), !hasItems ? (_jsxs("div", { className: "text-center py-20 border border-dashed border-gray-300 rounded-3xl", children: [_jsx("p", { className: "text-gray-500 text-lg", children: "No services found in this category." }), _jsx(Button, { className: "mt-4", onClick: () => window.history.back(), children: "Go Back" })] })) : (_jsx("div", { className: "space-y-12", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: services.map((service) => (_jsxs("div", { className: "group flex flex-col h-full bg-white rounded-2xl overflow-hidden border border-gray-100 shadow-sm hover:shadow-xl transition-all duration-500", children: [_jsxs(Link, { href: `/${storeConfig.slug}/book?service=${service.slug}`, className: "block relative aspect-[4/3] overflow-hidden", children: [_jsx(Image, { src: service.image || 'https://images.unsplash.com/photo-1629909613654-28e377c37b09?w=800&auto=format&fit=crop&q=60', alt: service.name, fill: true, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105" }), _jsx("div", { className: "absolute bottom-4 left-4 bg-white/95 backdrop-blur px-4 py-2 rounded-full text-sm font-bold shadow-sm text-gray-900", children: formatCurrency(service.price, service.currency || storeConfig.settings?.currency || 'USD') })] }), _jsxs("div", { className: "p-6 flex flex-col flex-1", children: [_jsx("h3", { className: "text-xl font-bold text-gray-900 mb-2 group-hover:text-blue-600 transition-colors", children: service.name }), _jsx(RichTextExcerpt, { value: service.description, as: "p", className: "text-gray-500 mb-6 line-clamp-2 leading-relaxed text-sm flex-1" }), _jsxs("div", { className: "flex items-center justify-between pt-4 border-t border-gray-100", children: [_jsx("div", { className: "flex items-center gap-4 text-sm text-gray-500 font-medium", children: _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(Clock, { className: "w-4 h-4 text-blue-500" }), service.duration, " mins"] }) }), _jsxs(Link, { href: `/${storeConfig.slug}/book?service=${service.slug}`, className: "inline-flex items-center gap-2 text-sm font-bold text-blue-600 group/btn", children: ["Book Now ", _jsx(ArrowRight, { className: "w-4 h-4 transition-transform group-hover/btn:translate-x-1" })] })] })] })] }, service.id))) }) }))] })] }));
|
|
42
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AA6B5F,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,+BAwiCpG"}
|
|
@@ -18,6 +18,7 @@ import { getGuestUserInfo, saveGuestUserInfo } from '../../../lib/guest-user.js'
|
|
|
18
18
|
import { ProductCard } from '../../../components/ui/product-card.js';
|
|
19
19
|
import Image from 'next/image';
|
|
20
20
|
import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
|
|
21
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
21
22
|
import { ButtonLoader } from '../../../components/ui/page-loader.js';
|
|
22
23
|
import { extractImageUrls } from '../../../lib/store-config-utils.js';
|
|
23
24
|
import { OutOfStockOverlay } from '../../../components/ui/out-of-stock-overlay.js';
|
|
@@ -506,5 +507,5 @@ export function ProductDetailPage({ storeConfig: initialConfig, productSlug }) {
|
|
|
506
507
|
: 'bg-white text-gray-700 border-gray-200 hover:border-gray-300 hover:bg-gray-50'}`, children: variant.value }, variant.id));
|
|
507
508
|
}) })] })), _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-col sm:flex-row gap-3 mt-2", children: [_jsx(Button, { "data-add-to-cart": true, size: "lg", onClick: handleAddToCart, disabled: isCartLoading || isOutOfStock, className: "flex-1 bg-white border-2 border-gray-900 text-gray-900 hover:bg-gray-50 rounded-full h-14 text-base font-bold shadow-sm transition-all disabled:opacity-50 disabled:cursor-not-allowed", children: isCartLoading ? (_jsxs(_Fragment, { children: [_jsx(ButtonLoader, { className: "mr-2" }), "Adding..."] })) : (_jsxs(_Fragment, { children: [_jsx(ShoppingCart, { className: "h-5 w-5 mr-2" }), "Add to Cart"] })) }), _jsx(Button, { size: "lg", onClick: handleBuyNow, disabled: isOutOfStock || isBuyNowLoading || isCartLoading, className: "flex-1 bg-gray-900 hover:bg-gray-800 text-white rounded-full h-14 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-2" }), "Adding..."] })) : ('Buy Now') }), storeConfig.features.wishlist && (_jsx(Button, { variant: "outline", size: "lg", onClick: handleWishlistClick, disabled: isWishlistLoading || !product, className: cn("h-14 w-14 rounded-full border-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed", product && isInWishlist(product.id)
|
|
508
509
|
? "border-red-500 bg-red-50 text-red-500 hover:bg-red-100"
|
|
509
|
-
: "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: product.price, 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" }), _jsxs("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: [_jsx(
|
|
510
|
+
: "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: product.price, 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" }), _jsxs("div", { className: "prose prose-sm max-w-none text-gray-600 leading-relaxed", children: [_jsx(SafeRichHtml, { value: product.description, fallbackPlain: "", as: "div" }), _jsxs("ul", { className: "list-disc pl-5 space-y-1 mt-2", children: [_jsx("li", { children: "Premium quality material" }), _jsx("li", { children: "Comfortable fit for all-day wear" }), _jsx("li", { children: "Durable stitching and finish" })] })] })] })), 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" }), product.reviewCount && product.reviewCount > 0 && product.rating && product.rating > 0 ? (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(StarRating, { rating: typeof product.rating === 'number' ? product.rating : Number(product.rating) || 0, size: "lg" }), _jsx("span", { className: "text-2xl font-bold text-gray-900", children: Number(product.rating).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: [product.reviewCount, " ", product.reviewCount === 1 ? 'review' : 'reviews'] })] })) : (_jsx("div", { className: "text-gray-500", children: _jsx("p", { className: "text-base", children: "Be the first to review this product" }) }))] }), _jsx(Button, { onClick: () => setIsReviewModalOpen(true), className: "rounded-full shrink-0 bg-gray-900 hover:bg-gray-800 text-white", children: product.reviewCount && product.reviewCount > 0 ? 'Write a Review' : 'Be the First to Review' })] }), ratingDistribution.some(r => r.count > 0) && (_jsxs("div", { className: "mb-10 p-6 bg-gray-50 rounded-xl border border-gray-100", children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 mb-5", children: "Rating Breakdown" }), _jsx("div", { className: "space-y-3", children: ratingDistribution.map(({ rating, count, percentage }) => (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-1.5 w-20", children: [_jsx("span", { className: "text-sm font-semibold text-gray-900", children: rating }), _jsx(Star, { className: "h-4 w-4 fill-gray-900 text-gray-900" })] }), _jsx("div", { className: "flex-1 h-2.5 bg-gray-200 rounded-full overflow-hidden", children: _jsx("div", { className: "h-full bg-gradient-to-r from-gray-700 to-gray-900 rounded-full transition-all duration-500", style: { width: `${percentage}%` } }) }), _jsx("span", { className: "text-sm font-medium text-gray-700 w-12 text-right", children: count })] }, rating))) })] })), reviews.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "space-y-6", children: displayedReviews.map((review) => (_jsx(ReviewCard, { review: review }, review.id))) }), hasMoreReviews && !showAllReviews && (_jsx("div", { className: "mt-8 text-center", children: _jsxs(Button, { variant: "outline", onClick: () => setShowAllReviews(true), className: "px-8 rounded-full h-12 border-gray-300", children: ["Show All ", reviews.length, " Reviews"] }) }))] })) : (_jsxs("div", { className: "text-center py-12 bg-gray-50 rounded-xl border border-dashed border-gray-300", children: [_jsx("div", { className: "inline-flex items-center justify-center w-12 h-12 rounded-full bg-white shadow-sm mb-4", children: _jsx(Star, { className: "h-6 w-6 text-gray-400" }) }), _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: "No Reviews Yet" }), _jsx("p", { className: "text-gray-500 max-w-sm mx-auto mb-6", children: "Be the first to review this product and help other customers make informed decisions." }), _jsx(Button, { onClick: () => setIsReviewModalOpen(true), className: "bg-gray-900 hover:bg-gray-800 text-white", children: "Write the First Review" })] }))] }) }), relatedProducts.length > 0 && (_jsxs("div", { className: "mt-20 pt-16 border-t border-gray-200", children: [_jsx("h2", { className: "text-2xl lg:text-3xl font-bold text-gray-900 mb-8", children: "You Might Also Like" }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6", children: relatedProducts.map((relatedProduct) => (_jsx("div", { className: "h-[400px]", children: _jsx(ProductCard, { product: relatedProduct, storeSlug: storeConfig.slug, onAddToCart: (p) => addToCart(p, 1), onQuickView: handleQuickView, className: "h-full" }) }, relatedProduct.id))) })] }))] }), _jsx(Modal, { isOpen: isReviewModalOpen, onClose: () => setIsReviewModalOpen(false), title: "Write a Review", children: _jsxs("form", { onSubmit: handleSubmitReview, className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Rating" }), _jsxs("div", { className: "flex items-center gap-1", children: [[1, 2, 3, 4, 5].map((star) => (_jsxs("div", { className: "relative group", children: [_jsx("button", { type: "button", onClick: () => setNewReview({ ...newReview, rating: star - 0.5 }), className: "absolute top-0 left-0 w-1/2 h-full z-20 focus:outline-none", title: `${star - 0.5} stars` }), _jsx("button", { type: "button", onClick: () => setNewReview({ ...newReview, rating: star }), className: "absolute top-0 right-0 w-1/2 h-full z-20 focus:outline-none", title: `${star} stars` }), _jsxs("div", { className: "relative pointer-events-none transition-transform group-hover:scale-110", children: [_jsx(Star, { className: "h-8 w-8 text-gray-200 fill-gray-200" }), newReview.rating >= star - 0.5 && (_jsx("div", { className: "absolute inset-0 overflow-hidden", style: { width: newReview.rating === star - 0.5 ? '50%' : '100%' }, children: _jsx(Star, { className: "h-8 w-8 text-gray-900 fill-gray-900" }) }))] })] }, star))), _jsx("span", { className: "ml-3 text-lg font-medium text-gray-900 w-12", children: newReview.rating })] })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "title", className: "block text-sm font-medium text-gray-700 mb-1", children: "Review Title" }), _jsx("input", { type: "text", id: "title", required: true, className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-black", placeholder: "Summarize your thoughts", value: newReview.title, onChange: (e) => setNewReview({ ...newReview, title: e.target.value }) })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "comment", className: "block text-sm font-medium text-gray-700 mb-1", children: "Review" }), _jsx("textarea", { id: "comment", required: true, rows: 4, className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-black", placeholder: "What did you like or dislike?", value: newReview.comment, onChange: (e) => setNewReview({ ...newReview, comment: e.target.value }) })] }), _jsxs("div", { className: "pt-4 flex justify-end gap-3", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => setIsReviewModalOpen(false), children: "Cancel" }), _jsx(Button, { type: "submit", className: "bg-black text-white hover:bg-gray-800", children: "Submit Review" })] })] }) }), _jsx(GuestCheckoutModal, { isOpen: showGuestModal, onClose: () => setShowGuestModal(false), onSubmit: handleGuestInfoSubmit, initialData: getGuestUserInfo() || undefined })] }));
|
|
510
511
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/ServicesPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ServicesPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking/pages/ServicesPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE,iBAAiB,+BAkK7G"}
|
|
@@ -3,6 +3,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { Button } from '../../../components/ui/button.js';
|
|
4
4
|
import { Clock, ArrowRight, Filter } from 'lucide-react';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
+
import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
|
|
7
|
+
import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
|
|
6
8
|
import { useState } from 'react';
|
|
7
9
|
import { cn, formatCurrency, filterActiveServices } from '../../../lib/utils/index.js';
|
|
8
10
|
import Image from 'next/image';
|
|
@@ -28,7 +30,7 @@ export function ServicesPage({ storeConfig: initialConfig, initialCategory, titl
|
|
|
28
30
|
return `/${storeConfig.slug}/book?service=${slug}`;
|
|
29
31
|
};
|
|
30
32
|
const pageTitle = titleOverride || servicesConfig?.title || (_jsxs(_Fragment, { children: ["Signature ", _jsx("span", { className: "font-bold font-sans", style: { color: primaryColor }, children: serviceLabel })] }));
|
|
31
|
-
return (_jsxs("div", { className: "min-h-screen bg-white pb-20", children: [_jsxs("div", { "data-section": "hero", className: "relative bg-gray-900 py-32 px-4 text-center overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1512496015851-a90fb38ba796?q=80&w=2070&auto=format&fit=crop", alt: "Service Menu", fill: true, className: "w-full h-full object-cover opacity-60" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-black/30" })] }), _jsxs("div", { className: "container mx-auto max-w-4xl relative z-10", children: [_jsx("span", { className: "inline-block py-1 px-3 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-xs font-bold uppercase tracking-widest text-white mb-6 shadow-sm", children: storeConfig.name }), _jsx("h1", { className: "text-5xl md:text-7xl font-serif font-light mb-6 tracking-tight text-white leading-tight", children: pageTitle }), _jsx(
|
|
33
|
+
return (_jsxs("div", { className: "min-h-screen bg-white pb-20", children: [_jsxs("div", { "data-section": "hero", className: "relative bg-gray-900 py-32 px-4 text-center overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1512496015851-a90fb38ba796?q=80&w=2070&auto=format&fit=crop", alt: "Service Menu", fill: true, className: "w-full h-full object-cover opacity-60" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-black/30" })] }), _jsxs("div", { className: "container mx-auto max-w-4xl relative z-10", children: [_jsx("span", { className: "inline-block py-1 px-3 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-xs font-bold uppercase tracking-widest text-white mb-6 shadow-sm", children: storeConfig.name }), _jsx("h1", { className: "text-5xl md:text-7xl font-serif font-light mb-6 tracking-tight text-white leading-tight", children: pageTitle }), _jsx(SafeRichHtml, { value: servicesConfig?.description || storeConfig.description || `Explore our curated selection of premium ${serviceLabel.toLowerCase()} designed for your success.`, as: "div", className: "text-gray-200 max-w-2xl mx-auto text-lg font-light leading-relaxed [&_p]:mb-0" })] })] }), _jsx("div", { className: "sticky top-16 z-30 bg-white/80 backdrop-blur-xl border-b border-gray-100 transition-all", children: _jsx("div", { className: "container mx-auto px-4", children: _jsxs("div", { className: "flex items-center gap-3 overflow-x-auto py-4 scrollbar-hide no-scrollbar", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs font-bold text-gray-400 uppercase tracking-wider px-4 border-r border-gray-100 hidden md:flex shrink-0", children: [_jsx(Filter, { className: "w-3.5 h-3.5" }), categoryLabel] }), categories.map((cat) => (_jsx("button", { onClick: () => setActiveCategory(cat.slug), className: cn("px-6 py-2.5 rounded-full text-sm font-bold whitespace-nowrap transition-all duration-300 border flex-shrink-0", activeCategory === cat.slug
|
|
32
34
|
? "text-white shadow-lg scale-105 border-transparent"
|
|
33
|
-
: "bg-white text-gray-500 border-gray-100 hover:border-gray-300 hover:text-black"), style: activeCategory === cat.slug ? { backgroundColor: primaryColor } : {}, children: cat.name }, cat.id)))] }) }) }), _jsx("div", { "data-section": "services-list", className: "container mx-auto px-4 max-w-7xl py-16", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-16", children: filteredServices.map((service) => (_jsxs("div", { className: "group flex flex-col h-full", children: [_jsxs(Link, { href: getServiceLink(service.slug), className: "block relative aspect-[4/3] rounded-3xl overflow-hidden bg-gray-100 mb-6 shadow-sm group-hover:shadow-xl transition-all duration-500", children: [_jsx(Image, { src: service.image || 'https://images.unsplash.com/photo-1629909613654-28e377c37b09?w=800&auto=format&fit=crop&q=60', alt: service.name, fill: true, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105" }), _jsx("div", { className: "absolute bottom-4 left-4 bg-white/95 backdrop-blur px-4 py-2 rounded-full text-sm font-bold shadow-sm text-gray-900", children: service.price > 0 ? formatCurrency(service.price, service.currency || storeConfig.settings?.currency || 'USD') : 'Free' }), _jsx("div", { className: "absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-full bg-white text-black hover:bg-gray-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8", children: "Book Now" }) })] }), _jsxs("div", { className: "flex flex-col flex-1", children: [_jsx("div", { className: "flex justify-between items-start mb-3", children: _jsx(Link, { href: getServiceLink(service.slug), children: _jsx("h3", { className: "text-2xl font-bold text-gray-900 group-hover:text-gray-600 transition-colors", children: service.name }) }) }), _jsx("p",
|
|
35
|
+
: "bg-white text-gray-500 border-gray-100 hover:border-gray-300 hover:text-black"), style: activeCategory === cat.slug ? { backgroundColor: primaryColor } : {}, children: cat.name }, cat.id)))] }) }) }), _jsx("div", { "data-section": "services-list", className: "container mx-auto px-4 max-w-7xl py-16", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-16", children: filteredServices.map((service) => (_jsxs("div", { className: "group flex flex-col h-full", children: [_jsxs(Link, { href: getServiceLink(service.slug), className: "block relative aspect-[4/3] rounded-3xl overflow-hidden bg-gray-100 mb-6 shadow-sm group-hover:shadow-xl transition-all duration-500", children: [_jsx(Image, { src: service.image || 'https://images.unsplash.com/photo-1629909613654-28e377c37b09?w=800&auto=format&fit=crop&q=60', alt: service.name, fill: true, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105" }), _jsx("div", { className: "absolute bottom-4 left-4 bg-white/95 backdrop-blur px-4 py-2 rounded-full text-sm font-bold shadow-sm text-gray-900", children: service.price > 0 ? formatCurrency(service.price, service.currency || storeConfig.settings?.currency || 'USD') : 'Free' }), _jsx("div", { className: "absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-full bg-white text-black hover:bg-gray-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8", children: "Book Now" }) })] }), _jsxs("div", { className: "flex flex-col flex-1", children: [_jsx("div", { className: "flex justify-between items-start mb-3", children: _jsx(Link, { href: getServiceLink(service.slug), children: _jsx("h3", { className: "text-2xl font-bold text-gray-900 group-hover:text-gray-600 transition-colors", children: service.name }) }) }), _jsx(RichTextExcerpt, { value: service.description, as: "p", className: "text-gray-500 mb-6 line-clamp-2 leading-relaxed text-base flex-1" }), _jsxs("div", { className: "flex items-center justify-between pt-4 border-t border-gray-100 text-sm font-medium text-gray-500", children: [_jsxs("div", { className: "flex items-center gap-6", children: [service.duration > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "w-4 h-4 text-gray-400" }), service.duration, " mins"] })), service.contentType && (_jsx("div", { className: "flex items-center gap-2 uppercase tracking-widest text-[10px] font-black", children: service.contentType }))] }), _jsxs(Link, { href: getServiceLink(service.slug), className: "flex items-center gap-2 text-black font-bold group/link", children: ["Book ", _jsx(ArrowRight, { className: "w-4 h-4 transition-transform group-hover/link:translate-x-1" })] })] })] })] }, service.id))) }) })] }));
|
|
34
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking-agenda/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/booking-agenda/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,UAAU,cAAc;IACtB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,cAAc,+BA6OvE"}
|