storefront-layouts 1.0.3 → 1.0.4
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/auth/LoginForm.js +2 -2
- package/dist/components/auth/LoginSheet.js +2 -2
- package/dist/components/auth/login-form-core.js +3 -3
- package/dist/components/auth/login-sheet-header.js +3 -3
- package/dist/components/auth/login-sheet-registry.js +2 -2
- package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/booking.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/clothing.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/electronics.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/food-modern.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/food.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/index.js +9 -9
- package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +1 -1
- package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts +2 -2
- package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts.map +1 -1
- package/dist/components/auth/login-sheet-themes/theme-input-baselines.js +2 -2
- package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts.map +1 -1
- package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +6 -6
- package/dist/components/auth/use-login-submit.js +3 -3
- package/dist/components/cart/InventoryHoldCountdown.js +2 -2
- package/dist/components/categories/category-masonry-grid.js +3 -3
- package/dist/components/checkout/CheckoutFeeLines.js +1 -1
- package/dist/components/checkout/ShippingOptionsPanel.js +3 -3
- package/dist/components/learning/CertificateTemplates.js +2 -2
- package/dist/components/learning/CertificateViewer.js +3 -3
- package/dist/components/learning/MentorshipProgress.d.ts.map +1 -1
- package/dist/components/learning/MentorshipProgress.js +4 -4
- package/dist/components/product/ProductVariationSelectors.js +1 -1
- package/dist/components/rich-text/CategoryDescription.js +2 -2
- package/dist/components/rich-text/ProductDescription.js +2 -2
- package/dist/components/rich-text/RichTextExcerpt.js +1 -1
- package/dist/components/rich-text/SafeRichHtml.d.ts +8 -11
- package/dist/components/rich-text/SafeRichHtml.d.ts.map +1 -1
- package/dist/components/rich-text/SafeRichHtml.js +3 -5
- package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -1
- package/dist/components/shipping/ProductDeliveryInfoSection.js +7 -4
- package/dist/components/shipping/ShippingQuoteAddressForm.js +3 -3
- package/dist/components/ui/alert-modal.js +2 -2
- package/dist/components/ui/avatar-image.js +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/breadcrumbs.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/category-tree.js +2 -2
- package/dist/components/ui/checkout-button.d.ts.map +1 -1
- package/dist/components/ui/checkout-button.js +11 -283
- package/dist/components/ui/guest-checkout-modal.js +3 -3
- package/dist/components/ui/image-skeleton.js +2 -2
- package/dist/components/ui/image-with-fallback.d.ts +3 -1
- package/dist/components/ui/image-with-fallback.d.ts.map +1 -1
- package/dist/components/ui/image-with-fallback.js +55 -139
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/limited-time-offer-badge.js +2 -2
- package/dist/components/ui/loading-skeleton-wrapper.js +1 -1
- package/dist/components/ui/modal.js +2 -2
- package/dist/components/ui/otp-input.js +1 -1
- package/dist/components/ui/out-of-stock-overlay.js +1 -1
- package/dist/components/ui/page-animate-wrapper.js +2 -2
- package/dist/components/ui/page-content-loader.js +2 -2
- package/dist/components/ui/page-loader.js +1 -1
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +17 -17
- package/dist/components/ui/product-rating.js +1 -1
- package/dist/components/ui/product-stock-badge.js +2 -2
- package/dist/components/ui/review-form.js +2 -2
- package/dist/components/ui/route-skeleton-loader.js +6 -6
- package/dist/components/ui/sheet.d.ts +2 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +4 -4
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeletons/index.js +5 -5
- package/dist/components/ui/skeletons/product-grid-skeleton.js +1 -1
- package/dist/components/ui/store-logos.d.ts.map +1 -1
- package/dist/components/ui/store-logos.js +4 -4
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/video-player.js +2 -2
- package/dist/editor/alignment-schemas/booking.js +1 -1
- package/dist/editor/alignment-schemas/clothing-minimal.js +1 -1
- package/dist/editor/alignment-schemas/index.js +20 -20
- package/dist/editor/alignment-schemas/lazy-loader.js +1 -1
- package/dist/editor/alignment-schemas/metadata.js +1 -1
- package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +3 -3
- package/dist/editor/blocks/index.js +3 -3
- package/dist/editor/blocks/migrate-clothing-minimal.js +3 -3
- package/dist/editor/blocks/nav-outline-utils.js +2 -2
- package/dist/editor/blocks/registry.js +1 -1
- package/dist/editor/document/adapter.js +4 -4
- package/dist/editor/document/block-tree.js +1 -1
- package/dist/editor/document/index.js +6 -6
- package/dist/editor/document/validate.js +1 -1
- package/dist/editor/index.js +12 -12
- package/dist/editor/layout-content-loader.js +3 -3
- package/dist/editor/payaza-form/ArrayItemManager.js +2 -2
- package/dist/editor/payaza-form/EditorCanvasPreview.js +5 -5
- package/dist/editor/payaza-form/FieldRenderer.js +17 -17
- package/dist/editor/payaza-form/IframePreviewMessageBridge.js +3 -3
- package/dist/editor/payaza-form/PayazaFormEditor.js +31 -31
- package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +2 -2
- package/dist/editor/payaza-form/SliderArrayEditor.js +3 -3
- package/dist/editor/payaza-form/components/ArrayField.js +1 -1
- package/dist/editor/payaza-form/components/BlockStylesInspector.js +1 -1
- package/dist/editor/payaza-form/components/BlocksField.js +9 -9
- package/dist/editor/payaza-form/components/ButtonField.js +3 -3
- package/dist/editor/payaza-form/components/CanvasGranularInspector.js +11 -11
- package/dist/editor/payaza-form/components/IconField.js +2 -2
- package/dist/editor/payaza-form/components/ImageField.js +1 -1
- package/dist/editor/payaza-form/components/NumberField.js +1 -1
- package/dist/editor/payaza-form/components/RichTextField.js +2 -2
- package/dist/editor/payaza-form/components/SectionField.js +1 -1
- package/dist/editor/payaza-form/components/SectionSchemaInspector.js +3 -3
- package/dist/editor/payaza-form/components/StarRatingField.js +2 -2
- package/dist/editor/payaza-form/components/TextField.js +1 -1
- package/dist/editor/payaza-form/data-merger.js +6 -6
- package/dist/editor/payaza-form/data-transformer.js +3 -3
- package/dist/editor/payaza-form/engine.js +1 -1
- package/dist/editor/payaza-form/examples/custom-widgets.example.js +1 -1
- package/dist/editor/payaza-form/index.js +8 -8
- package/dist/editor/payaza-form/layout-loader.js +2 -2
- package/dist/editor/payaza-form/preview-message-handler.js +3 -3
- package/dist/editor/payaza-form/schema-bridge.js +3 -3
- package/dist/editor/payaza-form/widget-registry.js +1 -1
- package/dist/editor/shared/BlockOutlineTree.js +2 -2
- package/dist/editor/shared/EditorHeader.js +2 -2
- package/dist/editor/shared/EditorNavigator.js +2 -2
- package/dist/editor/shared/IframePreview.js +6 -6
- package/dist/editor/shared/InlineCanvasPreview.js +8 -8
- package/dist/editor/shared/LayoutRenderer.js +1 -1
- package/dist/editor/shared/ResizableSidebar.js +1 -1
- package/dist/editor/shared/index.js +7 -7
- package/dist/hooks/use-analytics.js +3 -3
- package/dist/hooks/use-api.js +1 -1
- package/dist/hooks/use-cart-api.d.ts.map +1 -1
- package/dist/hooks/use-cart-api.js +8 -3
- package/dist/hooks/use-catalog-loader.js +3 -3
- package/dist/hooks/use-catalog-price-range.d.ts +2 -5
- package/dist/hooks/use-catalog-price-range.d.ts.map +1 -1
- package/dist/hooks/use-catalog-price-range.js +20 -5
- package/dist/hooks/use-category-products.d.ts +8 -0
- package/dist/hooks/use-category-products.d.ts.map +1 -0
- package/dist/hooks/use-category-products.js +43 -0
- package/dist/hooks/use-checkout-fees.d.ts +3 -4
- package/dist/hooks/use-checkout-fees.d.ts.map +1 -1
- package/dist/hooks/use-checkout-fees.js +1 -1
- package/dist/hooks/use-content-ready.js +1 -1
- package/dist/hooks/use-featured-products.d.ts +3 -0
- package/dist/hooks/use-featured-products.d.ts.map +1 -0
- package/dist/hooks/use-featured-products.js +25 -0
- package/dist/hooks/use-multi-store-checkout-fees.d.ts +3 -4
- package/dist/hooks/use-multi-store-checkout-fees.d.ts.map +1 -1
- package/dist/hooks/use-multi-store-checkout-fees.js +1 -1
- package/dist/hooks/use-navigation-loading.js +1 -1
- package/dist/hooks/use-payaza-checkout.d.ts +1 -1
- package/dist/hooks/use-payaza-checkout.d.ts.map +1 -1
- package/dist/hooks/use-payaza-checkout.js +9 -3
- package/dist/hooks/use-product-brands.d.ts +5 -0
- package/dist/hooks/use-product-brands.d.ts.map +1 -0
- package/dist/hooks/use-product-brands.js +25 -0
- package/dist/hooks/use-product-by-slug.d.ts +7 -0
- package/dist/hooks/use-product-by-slug.d.ts.map +1 -0
- package/dist/hooks/use-product-by-slug.js +38 -0
- package/dist/hooks/use-product-reviews.d.ts +15 -0
- package/dist/hooks/use-product-reviews.d.ts.map +1 -0
- package/dist/hooks/use-product-reviews.js +75 -0
- package/dist/hooks/use-product-variation-selection.d.ts +2 -8
- package/dist/hooks/use-product-variation-selection.d.ts.map +1 -1
- package/dist/hooks/use-product-variation-selection.js +1 -1
- package/dist/hooks/use-products-api.js +3 -3
- package/dist/hooks/use-shipping-quote.js +2 -2
- package/dist/hooks/use-store-api.js +4 -4
- package/dist/hooks/usePreviewSlideSync.js +1 -1
- package/dist/index.d.ts +62 -74
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -153
- package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
- package/dist/layouts/booking/components/BookingHomePage.js +68 -74
- package/dist/layouts/booking/components/BookingMultilineHeading.js +1 -1
- package/dist/layouts/booking/components/BookingTestimonialCard.js +2 -2
- package/dist/layouts/booking/components/BookingTestimonialsEmptyState.js +1 -1
- package/dist/layouts/booking/components/booking-footer-defaults.js +2 -2
- package/dist/layouts/booking/index.js +8 -8
- package/dist/layouts/booking/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/AboutPage.js +39 -60
- package/dist/layouts/booking/pages/BookPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/BookPage.js +16 -22
- package/dist/layouts/booking/pages/CategoriesPage.js +6 -6
- package/dist/layouts/booking/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/CategoryPage.js +17 -26
- package/dist/layouts/booking/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/booking/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ContactPage.js +5 -12
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ProductDetailPage.js +203 -150
- package/dist/layouts/booking/pages/ServicesPage.d.ts +1 -1
- package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ServicesPage.js +11 -31
- package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +21 -30
- package/dist/layouts/booking-agenda/index.js +8 -8
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/AboutPage.js +11 -14
- package/dist/layouts/booking-agenda/pages/BookPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/BookPage.js +15 -21
- package/dist/layouts/booking-agenda/pages/CategoriesPage.js +5 -5
- package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/CategoryPage.js +12 -18
- package/dist/layouts/booking-agenda/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/booking-agenda/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ContactPage.js +8 -13
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +202 -149
- package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts +1 -1
- package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ServicesPage.js +8 -23
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +199 -136
- package/dist/layouts/clothing/index.js +7 -7
- package/dist/layouts/clothing/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/AboutPage.js +19 -33
- package/dist/layouts/clothing/pages/CategoriesPage.js +8 -8
- package/dist/layouts/clothing/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/CategoryPage.js +15 -41
- package/dist/layouts/clothing/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/clothing/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ContactPage.js +5 -8
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductDetailPage.js +256 -167
- package/dist/layouts/clothing/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductsPage.js +125 -59
- package/dist/layouts/clothing/payaza-bindings.js +2 -2
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +32 -131
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +8 -8
- package/dist/layouts/clothing-minimal/index.js +7 -7
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/AboutPage.js +37 -61
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +7 -7
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/CategoryPage.js +13 -18
- package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ContactPage.js +5 -8
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +202 -143
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.js +126 -57
- package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +7 -7
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +10 -10
- package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsHomePage.js +29 -31
- package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +4 -4
- package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsProductsPage.js +81 -23
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -2
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +6 -6
- package/dist/layouts/electronics/index.js +18 -18
- package/dist/layouts/electronics/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/AboutPage.js +11 -14
- package/dist/layouts/electronics/pages/CategoriesPage.js +1 -1
- package/dist/layouts/electronics/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/CategoryPage.js +14 -20
- package/dist/layouts/electronics/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/electronics/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ContactPage.js +8 -13
- package/dist/layouts/electronics/pages/HelpCenterPage.js +1 -1
- package/dist/layouts/electronics/pages/PrivacyPolicyPage.js +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.js +201 -142
- package/dist/layouts/electronics/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductsPage.js +119 -49
- package/dist/layouts/electronics/pages/TermsPage.js +1 -1
- package/dist/layouts/electronics/pages/TrackOrderPage.js +4 -4
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +10 -10
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +75 -33
- package/dist/layouts/electronics-grid/index.js +14 -14
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/AboutPage.js +11 -14
- package/dist/layouts/electronics-grid/pages/CategoriesPage.js +1 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/CategoryPage.js +14 -20
- package/dist/layouts/electronics-grid/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/electronics-grid/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ContactPage.js +8 -13
- package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.js +6 -6
- package/dist/layouts/electronics-grid/pages/HelpCenterPage.js +1 -1
- package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.js +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +201 -142
- package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductsPage.js +121 -52
- package/dist/layouts/electronics-grid/pages/TermsPage.js +1 -1
- package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +4 -4
- package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
- package/dist/layouts/food/components/FoodHomePage.js +42 -41
- package/dist/layouts/food/index.js +8 -8
- package/dist/layouts/food/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/AboutPage.js +44 -45
- package/dist/layouts/food/pages/CategoriesPage.js +6 -6
- package/dist/layouts/food/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/CategoryPage.js +23 -21
- package/dist/layouts/food/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/food/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ContactPage.js +5 -7
- package/dist/layouts/food/pages/MenuPage.d.ts +1 -1
- package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/MenuPage.js +81 -42
- package/dist/layouts/food/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.js +209 -171
- package/dist/layouts/food/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductsPage.js +130 -45
- package/dist/layouts/food-modern/components/FoodHomePageModern.js +10 -10
- package/dist/layouts/food-modern/index.js +8 -8
- package/dist/layouts/food-modern/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/AboutPage.js +11 -14
- package/dist/layouts/food-modern/pages/CategoriesPage.js +5 -5
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/CategoryPage.js +23 -20
- package/dist/layouts/food-modern/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/food-modern/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ContactPage.js +5 -7
- package/dist/layouts/food-modern/pages/MenuPage.d.ts +1 -1
- package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/MenuPage.js +81 -46
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.js +202 -143
- package/dist/layouts/food-modern/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductsPage.js +117 -33
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +32 -23
- package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +1 -1
- package/dist/layouts/motivational-speaker/index.js +9 -9
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts +1 -1
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/AboutPage.js +6 -9
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +1 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/CategoryPage.js +18 -22
- package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts +1 -1
- package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ContactPage.js +9 -13
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts +1 -1
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ProductsPage.js +121 -52
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts +1 -1
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +15 -24
- package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts +1 -1
- package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ServicesPage.js +8 -23
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +7 -7
- package/dist/layouts/shared/components/BaseStoreLayout.js +9 -9
- package/dist/layouts/shared/components/CartLineQuantityControl.js +1 -1
- package/dist/layouts/shared/components/GenericPageWrapper.js +3 -3
- package/dist/layouts/shared/components/ProductPriceFilterSection.js +4 -4
- package/dist/layouts/shared/components/PromoBanner.d.ts +1 -4
- package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -1
- package/dist/layouts/shared/components/PromoBanner.js +12 -8
- package/dist/layouts/shared/components/StoreFooter.js +10 -10
- package/dist/layouts/shared/components/StoreHeader.js +7 -7
- package/dist/layouts/shared/components/TestimonialCard.d.ts.map +1 -1
- package/dist/layouts/shared/components/TestimonialCard.js +2 -2
- package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +2 -2
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +11 -11
- package/dist/layouts/shared/components/headers/FoodModernHeader.js +7 -7
- package/dist/layouts/shared/index.js +22 -22
- package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/AccountPage.js +101 -27
- package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/CartPage.js +39 -90
- package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/CheckoutPage.js +349 -868
- package/dist/layouts/shared/pages/CookiePolicyPage.js +1 -1
- package/dist/layouts/shared/pages/FeatureDisabledPage.js +1 -1
- package/dist/layouts/shared/pages/HelpCenterPage.js +1 -1
- package/dist/layouts/shared/pages/MaintenancePage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/MaintenancePage.js +2 -3
- package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/PortfolioPage.js +2 -2
- package/dist/layouts/shared/pages/PrivacyPolicyPage.js +1 -1
- package/dist/layouts/shared/pages/SizeGuidePage.js +1 -1
- package/dist/layouts/shared/pages/StyleGuidePage.js +3 -3
- package/dist/layouts/shared/pages/TeamPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/TeamPage.js +1 -1
- package/dist/layouts/shared/pages/TermsPage.js +1 -1
- package/dist/layouts/shared/pages/TrackOrderPage.js +4 -4
- package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/WishlistPage.js +44 -29
- package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts.map +1 -1
- package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +80 -35
- package/dist/layouts/shared/wrappers/ClothingLayout.js +8 -8
- package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +7 -7
- package/dist/layouts/shared/wrappers/ElectronicsLayout.js +5 -5
- package/dist/layouts/shared/wrappers/FoodModernLayout.js +6 -6
- package/dist/layouts/shared/wrappers/MotivationalLayout.js +9 -9
- package/dist/layouts/shared/wrappers/StandardLayout.js +8 -8
- package/dist/lib/api.d.ts +3 -4
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +69 -109
- package/dist/lib/auth-context.js +2 -2
- package/dist/lib/content-selectors.d.ts +1 -1
- package/dist/lib/content-selectors.d.ts.map +1 -1
- package/dist/lib/content-selectors.js +8 -0
- package/dist/lib/layout-config-hydration.js +2 -2
- package/dist/lib/loading-context.d.ts.map +1 -1
- package/dist/lib/loading-context.js +11 -21
- package/dist/lib/payaza-checkout.d.ts.map +1 -1
- package/dist/lib/payaza-checkout.js +2 -4
- package/dist/lib/payaza-public-key.d.ts +6 -0
- package/dist/lib/payaza-public-key.d.ts.map +1 -0
- package/dist/lib/payaza-public-key.js +10 -0
- package/dist/lib/rich-html.d.ts +31 -26
- package/dist/lib/rich-html.d.ts.map +1 -1
- package/dist/lib/rich-html.js +1 -0
- package/dist/lib/services/analytics.service.js +1 -1
- package/dist/lib/services/auth.service.js +1 -1
- package/dist/lib/services/booking.service.js +1 -1
- package/dist/lib/services/category.service.js +1 -1
- package/dist/lib/services/checkout.service.d.ts +3 -0
- package/dist/lib/services/checkout.service.d.ts.map +1 -1
- package/dist/lib/services/checkout.service.js +1 -1
- package/dist/lib/services/contact.service.js +1 -1
- package/dist/lib/services/customer.service.js +1 -1
- package/dist/lib/services/fees.service.d.ts +17 -63
- package/dist/lib/services/fees.service.d.ts.map +1 -1
- package/dist/lib/services/fees.service.js +4 -138
- package/dist/lib/services/index.js +13 -13
- package/dist/lib/services/location.service.js +1 -1
- package/dist/lib/services/order.service.js +1 -1
- package/dist/lib/services/payment.service.js +1 -1
- package/dist/lib/services/product.service.d.ts +7 -2
- package/dist/lib/services/product.service.d.ts.map +1 -1
- package/dist/lib/services/product.service.js +13 -1
- package/dist/lib/services/promo.service.js +1 -1
- package/dist/lib/services/review.service.js +1 -1
- package/dist/lib/services/service.service.js +1 -1
- package/dist/lib/services/shipping.service.js +1 -1
- package/dist/lib/services/store.service.js +1 -1
- package/dist/lib/store-config-utils.d.ts +1 -10
- package/dist/lib/store-config-utils.d.ts.map +1 -1
- package/dist/lib/store-config-utils.js +73 -261
- package/dist/lib/store-config.js +1 -1
- package/dist/lib/store-context.d.ts +1 -23
- package/dist/lib/store-context.d.ts.map +1 -1
- package/dist/lib/store-context.js +89 -111
- package/dist/lib/store-types.d.ts +9 -91
- package/dist/lib/store-types.d.ts.map +1 -1
- package/dist/lib/utils/asset-helpers.js +1 -1
- package/dist/lib/utils/catalog-price-bounds.d.ts +16 -6
- package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
- package/dist/lib/utils/catalog-price-bounds.js +58 -14
- package/dist/lib/utils/category-tree.d.ts +9 -0
- package/dist/lib/utils/category-tree.d.ts.map +1 -1
- package/dist/lib/utils/category-tree.js +26 -0
- package/dist/lib/utils/editor-preview.d.ts +5 -0
- package/dist/lib/utils/editor-preview.d.ts.map +1 -1
- package/dist/lib/utils/editor-preview.js +17 -3
- package/dist/lib/utils/fee-calculations.d.ts +5 -1
- package/dist/lib/utils/fee-calculations.d.ts.map +1 -1
- package/dist/lib/utils/fee-calculations.js +28 -31
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +4 -4
- package/dist/lib/utils/product-images.js +1 -1
- package/dist/lib/utils/product-share.js +1 -1
- package/dist/lib/utils/url-helpers.d.ts +6 -0
- package/dist/lib/utils/url-helpers.d.ts.map +1 -1
- package/dist/lib/utils/url-helpers.js +20 -4
- package/dist/preview/LayoutPreview.js +6 -6
- package/dist/preview/PreviewRouter.js +4 -4
- package/dist/preview/canvas/PreviewCanvasEnhancer.js +8 -8
- package/dist/preview/canvas/preview-flush-await.js +1 -1
- package/dist/preview/canvas/preview-isolation.js +1 -1
- package/dist/preview/canvas/preview-route.js +2 -2
- package/dist/preview/index.js +5 -5
- package/dist/styles/index.css +190 -149
- package/package.json +31 -43
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useEffect, useState, useMemo, useCallback
|
|
4
|
-
import { getStoreConfig } from './store-config
|
|
5
|
-
import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection
|
|
6
|
-
import { storeService } from './services/store.service
|
|
3
|
+
import { createContext, useContext, useEffect, useState, useMemo, useCallback } from 'react';
|
|
4
|
+
import { getStoreConfig } from './store-config';
|
|
5
|
+
import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection';
|
|
6
|
+
import { storeService } from './services/store.service';
|
|
7
7
|
// Note: cartService and wishlistService removed - using localStorage only for cart/wishlist
|
|
8
8
|
// These services are only needed for shared pages (cart, wishlist, account) which aren't editable in the editor
|
|
9
|
-
import { categoryService } from './services/category.service
|
|
10
|
-
import { productService } from './services/product.service
|
|
11
|
-
import { serviceService } from './services/service.service
|
|
12
|
-
import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService
|
|
13
|
-
import { useLoading } from './loading-context
|
|
14
|
-
import { normalizePrice
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { analyticsService } from './services/analytics.service.js';
|
|
18
|
-
import { getProductStockInfo, formatStockLimitMessage } from './inventory-utils.js';
|
|
19
|
-
import { buildCartLineProduct } from './product-variation-utils.js';
|
|
20
|
-
import { trackStorefrontEvent } from './mixpanel.js';
|
|
21
|
-
function normalizeAddToCartOptions(variantIdOrOptions) {
|
|
22
|
-
if (typeof variantIdOrOptions === 'string') {
|
|
23
|
-
return { variantId: variantIdOrOptions };
|
|
24
|
-
}
|
|
25
|
-
return variantIdOrOptions ?? {};
|
|
26
|
-
}
|
|
9
|
+
import { categoryService } from './services/category.service';
|
|
10
|
+
import { productService } from './services/product.service';
|
|
11
|
+
import { serviceService } from './services/service.service';
|
|
12
|
+
import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService } from './store-config-utils';
|
|
13
|
+
import { useLoading } from './loading-context';
|
|
14
|
+
import { normalizePrice } from './utils';
|
|
15
|
+
import { useAuth } from './auth-context';
|
|
16
|
+
import { analyticsService } from './services/analytics.service';
|
|
27
17
|
export const StoreContext = createContext({
|
|
28
18
|
store: null,
|
|
29
19
|
isLoading: true,
|
|
@@ -33,16 +23,11 @@ export const StoreContext = createContext({
|
|
|
33
23
|
removeFromCart: async () => { },
|
|
34
24
|
updateCartQuantity: async () => { },
|
|
35
25
|
removeOrderItemsFromCart: async () => { },
|
|
36
|
-
finalizeCartAfterOrder: async () => { },
|
|
37
26
|
cartTotal: 0,
|
|
38
27
|
cartCount: 0,
|
|
39
28
|
isCartOpen: false,
|
|
40
29
|
setIsCartOpen: () => { },
|
|
41
30
|
isCartLoading: false,
|
|
42
|
-
isCartHydrated: true,
|
|
43
|
-
isCartRefreshing: false,
|
|
44
|
-
refreshCart: async () => { },
|
|
45
|
-
handleInventoryHoldExpired: () => { },
|
|
46
31
|
buyNowItem: null,
|
|
47
32
|
setBuyNowItem: () => { },
|
|
48
33
|
clearBuyNowItem: () => { },
|
|
@@ -116,34 +101,14 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
116
101
|
// Wishlist State
|
|
117
102
|
const [wishlist, setWishlist] = useState([]);
|
|
118
103
|
const [isWishlistLoading, setIsWishlistLoading] = useState(false);
|
|
119
|
-
const lastSyncedInitialConfigRef = useRef(null);
|
|
120
|
-
// Track Store_viewed once per store per session (not on every re-render/config update)
|
|
121
|
-
const trackedStoreViewId = useRef(null);
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if (!store?.id || trackedStoreViewId.current === store.id)
|
|
124
|
-
return;
|
|
125
|
-
trackedStoreViewId.current = store.id;
|
|
126
|
-
trackStorefrontEvent('Store_viewed', {
|
|
127
|
-
storeId: store.id,
|
|
128
|
-
storeSlug: store.slug,
|
|
129
|
-
storeName: store.name,
|
|
130
|
-
layout: store.layout,
|
|
131
|
-
customerId: isAuthenticated ? (user?.id || null) : null,
|
|
132
|
-
});
|
|
133
|
-
}, [store?.id, store?.slug, store?.name, store?.layout, isAuthenticated, user?.id]);
|
|
134
104
|
useEffect(() => {
|
|
135
105
|
if (initialConfig) {
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
if (!prev || !isDeepEqual(prev, initialConfig)) {
|
|
140
|
-
setStore(initialConfig);
|
|
141
|
-
lastSyncedInitialConfigRef.current = initialConfig;
|
|
142
|
-
}
|
|
106
|
+
// For live preview/editor, we want to update the store state immediately
|
|
107
|
+
// when initialConfig (which is actually the dynamic config from the editor) changes
|
|
108
|
+
setStore(initialConfig);
|
|
143
109
|
setIsLoading(false);
|
|
144
110
|
return;
|
|
145
111
|
}
|
|
146
|
-
lastSyncedInitialConfigRef.current = null;
|
|
147
112
|
if (!storeSlug) {
|
|
148
113
|
setIsLoading(false);
|
|
149
114
|
return;
|
|
@@ -159,16 +124,15 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
159
124
|
const baseSlug = getBaseStoreSlug(storeSlug);
|
|
160
125
|
console.log('[StoreContext] Loading store from API (client-side):', baseSlug);
|
|
161
126
|
const { store: apiStore } = await storeService.getStoreBySlug(baseSlug);
|
|
162
|
-
const storeConfig = transformStoreResponseToConfig(apiStore);
|
|
163
127
|
// Fetch categories, products, and services in parallel
|
|
164
128
|
const [categoriesResult, productsResult, servicesResult] = await Promise.allSettled([
|
|
165
129
|
categoryService.getCategories(apiStore.id).then((apiCategories) => apiCategories.map(transformCategoryToStoreCategory)),
|
|
166
130
|
productService
|
|
167
131
|
.getProducts({
|
|
168
132
|
storeId: apiStore.id,
|
|
169
|
-
limit:
|
|
133
|
+
limit: 12,
|
|
170
134
|
})
|
|
171
|
-
.then((response) => response.data.map(
|
|
135
|
+
.then((response) => response.data.map(transformProductToStoreProduct)),
|
|
172
136
|
serviceService
|
|
173
137
|
.getServices(apiStore.id)
|
|
174
138
|
.then((apiServices) => apiServices.map(transformServiceToStoreService)),
|
|
@@ -196,23 +160,57 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
196
160
|
else {
|
|
197
161
|
console.log(`[StoreContext] Fetched ${services.length} services`);
|
|
198
162
|
}
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
inStock: product.inStock,
|
|
212
|
-
dietaryInfo: product.specifications?.dietaryInfo || [],
|
|
213
|
-
customizable: !!product.variants?.length,
|
|
214
|
-
}));
|
|
163
|
+
// Build contactInfo from various sources
|
|
164
|
+
let contactInfo = apiStore.contactInfo || {
|
|
165
|
+
email: apiStore.contactEmail,
|
|
166
|
+
phone: apiStore.contactPhone,
|
|
167
|
+
address: apiStore.address,
|
|
168
|
+
};
|
|
169
|
+
// If contactInfo exists but doesn't have an address, merge Store's address if available
|
|
170
|
+
if (contactInfo && !contactInfo.address && apiStore.address) {
|
|
171
|
+
contactInfo = {
|
|
172
|
+
...contactInfo,
|
|
173
|
+
address: apiStore.address,
|
|
174
|
+
};
|
|
215
175
|
}
|
|
176
|
+
// Transform API response to StoreConfig format
|
|
177
|
+
const storeConfig = {
|
|
178
|
+
id: apiStore.id,
|
|
179
|
+
slug: apiStore.slug,
|
|
180
|
+
name: apiStore.name,
|
|
181
|
+
description: apiStore.description || '',
|
|
182
|
+
type: 'generic',
|
|
183
|
+
layout: 'generic',
|
|
184
|
+
branding: {
|
|
185
|
+
primaryColor: apiStore.branding?.primaryColor || '#000000',
|
|
186
|
+
secondaryColor: apiStore.branding?.secondaryColor,
|
|
187
|
+
accentColor: apiStore.branding?.secondaryColor || apiStore.branding?.primaryColor || '#000000',
|
|
188
|
+
logo: apiStore.branding?.logo || apiStore.logo, // Check branding.logo first, then root logo
|
|
189
|
+
},
|
|
190
|
+
navigation: {
|
|
191
|
+
main: [],
|
|
192
|
+
footer: [],
|
|
193
|
+
},
|
|
194
|
+
features: {
|
|
195
|
+
cart: true,
|
|
196
|
+
wishlist: true,
|
|
197
|
+
reviews: true,
|
|
198
|
+
search: true,
|
|
199
|
+
filters: true,
|
|
200
|
+
booking: false,
|
|
201
|
+
delivery: true,
|
|
202
|
+
},
|
|
203
|
+
products,
|
|
204
|
+
categories,
|
|
205
|
+
services,
|
|
206
|
+
settings: {
|
|
207
|
+
currency: apiStore.settings?.currency || 'USD',
|
|
208
|
+
taxRate: apiStore.settings?.taxRate, // Deprecated: kept for backward compatibility
|
|
209
|
+
vat: apiStore.settings?.vat,
|
|
210
|
+
serviceCharge: apiStore.settings?.serviceCharge,
|
|
211
|
+
},
|
|
212
|
+
contactInfo: (contactInfo.email || contactInfo.phone || contactInfo.address) ? contactInfo : undefined,
|
|
213
|
+
};
|
|
216
214
|
setStore(storeConfig);
|
|
217
215
|
}
|
|
218
216
|
else {
|
|
@@ -288,23 +286,12 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
288
286
|
localStorage.setItem(`cart_${storeSlug}`, JSON.stringify(cart));
|
|
289
287
|
localStorage.setItem(`wishlist_${storeSlug}`, JSON.stringify(wishlist));
|
|
290
288
|
}, [cart, wishlist, storeSlug, store]);
|
|
291
|
-
const addToCart = useCallback(async (product, quantity = 1,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const resolvedVariantName = variantName ?? matchingVariant?.name ?? matchingVariant?.value;
|
|
295
|
-
const resolvedUnitPrice = unitPrice ?? matchingVariant?.price ?? product.price;
|
|
296
|
-
const stock = getProductStockInfo(product);
|
|
297
|
-
if (!stock.canPurchase) {
|
|
289
|
+
const addToCart = useCallback(async (product, quantity = 1, variantId) => {
|
|
290
|
+
// Validate product is in stock
|
|
291
|
+
if (!product.inStock) {
|
|
298
292
|
console.warn('[StoreContext] Attempted to add out-of-stock product to cart:', product.id);
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
if (product.trackInventory !== false && stock.availableStock != null) {
|
|
302
|
-
const cartItemId = variantId ? `${product.id}-${variantId}` : product.id;
|
|
303
|
-
const existingItem = cart.find((item) => item.id === cartItemId || (item.productId === product.id && item.variantId === variantId));
|
|
304
|
-
const requestedQty = (existingItem?.quantity || 0) + quantity;
|
|
305
|
-
if (requestedQty > stock.availableStock) {
|
|
306
|
-
throw new Error(formatStockLimitMessage(product.name, stock.availableStock, requestedQty));
|
|
307
|
-
}
|
|
293
|
+
// Note: Error message should be shown by the calling component
|
|
294
|
+
throw new Error('This product is currently out of stock');
|
|
308
295
|
}
|
|
309
296
|
setIsCartLoading(true);
|
|
310
297
|
try {
|
|
@@ -322,14 +309,13 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
322
309
|
productId: product.id,
|
|
323
310
|
quantity,
|
|
324
311
|
variantId,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
product: buildCartLineProduct(product, matchingVariant),
|
|
312
|
+
price: product.price,
|
|
313
|
+
product
|
|
328
314
|
}];
|
|
329
315
|
});
|
|
330
|
-
|
|
316
|
+
// Track add to cart event
|
|
331
317
|
if (store?.id) {
|
|
332
|
-
analyticsService.
|
|
318
|
+
analyticsService.trackEvent({
|
|
333
319
|
storeId: store.id,
|
|
334
320
|
eventType: 'add_to_cart',
|
|
335
321
|
userId: isAuthenticated ? (user?.id || null) : null,
|
|
@@ -338,27 +324,16 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
338
324
|
productName: product.name,
|
|
339
325
|
categoryId: product.categoryId,
|
|
340
326
|
quantity,
|
|
341
|
-
price:
|
|
327
|
+
price: product.price,
|
|
342
328
|
variantId,
|
|
343
329
|
},
|
|
344
|
-
}
|
|
345
|
-
trackStorefrontEvent('Product_added_to_cart', {
|
|
346
|
-
storeId: store.id,
|
|
347
|
-
storeSlug: store.slug,
|
|
348
|
-
productId: product.id,
|
|
349
|
-
productName: product.name,
|
|
350
|
-
categoryId: product.categoryId,
|
|
351
|
-
quantity,
|
|
352
|
-
price: product.price,
|
|
353
|
-
variantId,
|
|
354
|
-
customerId: isAuthenticated ? (user?.id || null) : null,
|
|
355
|
-
});
|
|
330
|
+
}).catch(err => console.warn('Failed to track add to cart:', err));
|
|
356
331
|
}
|
|
357
332
|
}
|
|
358
333
|
finally {
|
|
359
334
|
setIsCartLoading(false);
|
|
360
335
|
}
|
|
361
|
-
}, [store?.id,
|
|
336
|
+
}, [store?.id, isAuthenticated, user?.id]);
|
|
362
337
|
const removeFromCart = useCallback(async (cartItemId) => {
|
|
363
338
|
setIsCartLoading(true);
|
|
364
339
|
try {
|
|
@@ -366,8 +341,9 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
366
341
|
const removedItem = cart.find(item => item.id === cartItemId);
|
|
367
342
|
// Use local storage only (cartService removed)
|
|
368
343
|
setCart(prev => prev.filter(item => item.id !== cartItemId));
|
|
344
|
+
// Track remove_from_cart event
|
|
369
345
|
if (removedItem && store?.id) {
|
|
370
|
-
analyticsService.
|
|
346
|
+
analyticsService.trackEvent({
|
|
371
347
|
storeId: store.id,
|
|
372
348
|
eventType: 'remove_from_cart',
|
|
373
349
|
userId: isAuthenticated ? (user?.id || null) : null,
|
|
@@ -378,7 +354,7 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
378
354
|
price: removedItem.price,
|
|
379
355
|
variantId: removedItem.variantId,
|
|
380
356
|
},
|
|
381
|
-
}
|
|
357
|
+
}).catch(err => console.warn('Failed to track remove_from_cart:', err));
|
|
382
358
|
}
|
|
383
359
|
}
|
|
384
360
|
finally {
|
|
@@ -416,13 +392,17 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
416
392
|
}
|
|
417
393
|
return updated;
|
|
418
394
|
});
|
|
395
|
+
// Track wishlist events
|
|
419
396
|
if (store?.id) {
|
|
420
|
-
analyticsService.
|
|
397
|
+
analyticsService.trackEvent({
|
|
421
398
|
storeId: store.id,
|
|
422
399
|
eventType: wasInWishlist ? 'wishlist_remove' : 'wishlist_add',
|
|
423
400
|
userId: isAuthenticated ? (user?.id || null) : null,
|
|
424
|
-
metadata: {
|
|
425
|
-
|
|
401
|
+
metadata: {
|
|
402
|
+
productId,
|
|
403
|
+
productName,
|
|
404
|
+
},
|
|
405
|
+
}).catch(err => console.warn('Failed to track wishlist event:', err));
|
|
426
406
|
}
|
|
427
407
|
}
|
|
428
408
|
catch (error) {
|
|
@@ -449,8 +429,6 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
|
|
|
449
429
|
isCartOpen,
|
|
450
430
|
setIsCartOpen,
|
|
451
431
|
isCartLoading,
|
|
452
|
-
isCartHydrated: true,
|
|
453
|
-
refreshCart: async () => { },
|
|
454
432
|
buyNowItem,
|
|
455
433
|
setBuyNowItem,
|
|
456
434
|
clearBuyNowItem,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type StoreLayoutType = 'food' | 'food-modern' | 'clothing' | 'clothing-minimal' | 'booking' | 'booking-agenda' | 'electronics' | 'electronics-grid' | 'motivational-speaker' | 'marketplace';
|
|
1
|
+
export type StoreLayoutType = 'food' | 'food-modern' | 'clothing' | 'clothing-minimal' | 'booking' | 'booking-agenda' | 'electronics' | 'electronics-grid' | 'motivational-speaker';
|
|
3
2
|
export interface StoreBranding {
|
|
4
3
|
primaryColor: string;
|
|
5
4
|
secondaryColor?: string;
|
|
@@ -42,7 +41,7 @@ export interface StoreCategory {
|
|
|
42
41
|
id: string;
|
|
43
42
|
name: string;
|
|
44
43
|
slug: string;
|
|
45
|
-
description?: string
|
|
44
|
+
description?: string;
|
|
46
45
|
image?: string;
|
|
47
46
|
parentId?: string;
|
|
48
47
|
children?: StoreCategory[];
|
|
@@ -64,32 +63,22 @@ export interface StoreProduct {
|
|
|
64
63
|
id: string;
|
|
65
64
|
name: string;
|
|
66
65
|
slug: string;
|
|
67
|
-
description: string
|
|
66
|
+
description: string;
|
|
68
67
|
price: number;
|
|
69
68
|
compareAtPrice?: number;
|
|
70
|
-
isLimitedTimeOffer?: boolean;
|
|
71
|
-
limitedTimeOfferEndsAt?: string | null;
|
|
72
69
|
images: string[];
|
|
73
70
|
categoryId: string;
|
|
74
71
|
category?: string;
|
|
72
|
+
brand?: string;
|
|
75
73
|
inStock: boolean;
|
|
76
|
-
trackInventory?: boolean;
|
|
77
|
-
availableStock?: number;
|
|
78
|
-
lowStockThreshold?: number;
|
|
79
74
|
sku?: string;
|
|
80
75
|
currency?: string;
|
|
81
76
|
variants?: Array<{
|
|
82
77
|
id: string;
|
|
83
|
-
name
|
|
84
|
-
value
|
|
85
|
-
attributes?: Record<string, string>;
|
|
78
|
+
name: string;
|
|
79
|
+
value: string;
|
|
86
80
|
price?: number;
|
|
87
|
-
compareAtPrice?: number;
|
|
88
81
|
sku?: string;
|
|
89
|
-
stock?: number;
|
|
90
|
-
inStock?: boolean;
|
|
91
|
-
isActive?: boolean;
|
|
92
|
-
images?: string[];
|
|
93
82
|
}>;
|
|
94
83
|
specifications?: Record<string, string>;
|
|
95
84
|
rating?: number;
|
|
@@ -102,7 +91,7 @@ export interface StoreService {
|
|
|
102
91
|
id: string;
|
|
103
92
|
name: string;
|
|
104
93
|
slug: string;
|
|
105
|
-
description: string
|
|
94
|
+
description: string;
|
|
106
95
|
price: number;
|
|
107
96
|
currency?: string;
|
|
108
97
|
duration: number;
|
|
@@ -169,8 +158,6 @@ export interface TestimonialItem {
|
|
|
169
158
|
rating: number;
|
|
170
159
|
image?: string;
|
|
171
160
|
order: number;
|
|
172
|
-
location?: string;
|
|
173
|
-
date?: string;
|
|
174
161
|
}
|
|
175
162
|
export interface StorySection {
|
|
176
163
|
show: boolean;
|
|
@@ -211,14 +198,14 @@ export interface StoreConfig {
|
|
|
211
198
|
slug: string;
|
|
212
199
|
name: string;
|
|
213
200
|
description: string;
|
|
214
|
-
/** When false, customer checkout and booking payments are disabled (merchant not verified). */
|
|
215
|
-
checkoutEnabled?: boolean;
|
|
216
201
|
type: StoreLayoutType;
|
|
217
202
|
layout: StoreLayoutType;
|
|
218
203
|
branding: StoreBranding;
|
|
219
204
|
navigation: StoreNavigation;
|
|
220
205
|
categories: StoreCategory[];
|
|
221
206
|
products?: StoreProduct[];
|
|
207
|
+
/** Total active catalog size from bootstrap productsMeta (may exceed products.length). */
|
|
208
|
+
productsTotal?: number;
|
|
222
209
|
services?: StoreService[];
|
|
223
210
|
menuItems?: StoreMenuItem[];
|
|
224
211
|
domain?: StoreDomain;
|
|
@@ -245,7 +232,6 @@ export interface StoreConfig {
|
|
|
245
232
|
};
|
|
246
233
|
settings: {
|
|
247
234
|
currency: string;
|
|
248
|
-
industry?: string;
|
|
249
235
|
taxRate?: number;
|
|
250
236
|
shippingEnabled?: boolean;
|
|
251
237
|
minOrderAmount?: number;
|
|
@@ -261,8 +247,6 @@ export interface StoreConfig {
|
|
|
261
247
|
enabled: boolean;
|
|
262
248
|
applyTo: 'pos' | 'online' | 'both';
|
|
263
249
|
};
|
|
264
|
-
/** Who pays Shopaza collection fees at checkout: customer (added to total) or merchant (deducted at settlement). */
|
|
265
|
-
collectionFeePayer?: 'customer' | 'merchant';
|
|
266
250
|
};
|
|
267
251
|
payment?: {
|
|
268
252
|
payazaPublicKey?: string;
|
|
@@ -358,25 +342,12 @@ export interface StoreLayoutConfig {
|
|
|
358
342
|
showBadges?: boolean;
|
|
359
343
|
sliders?: HeroSlider[];
|
|
360
344
|
badge?: string;
|
|
361
|
-
hero_badge?: string;
|
|
362
345
|
title?: string;
|
|
363
346
|
titleHighlight?: string;
|
|
364
347
|
subtitle?: string;
|
|
365
348
|
description?: string;
|
|
366
349
|
primaryCTA?: string;
|
|
367
350
|
secondaryCTA?: string;
|
|
368
|
-
primaryButton?: {
|
|
369
|
-
text?: string;
|
|
370
|
-
link?: string;
|
|
371
|
-
};
|
|
372
|
-
secondaryButton?: {
|
|
373
|
-
text?: string;
|
|
374
|
-
link?: string;
|
|
375
|
-
};
|
|
376
|
-
showTrustIndicators?: boolean;
|
|
377
|
-
deliveryTime?: string;
|
|
378
|
-
ratingText?: string;
|
|
379
|
-
ratingIcon?: string;
|
|
380
351
|
};
|
|
381
352
|
categories?: {
|
|
382
353
|
show: boolean;
|
|
@@ -473,20 +444,15 @@ export interface StoreLayoutConfig {
|
|
|
473
444
|
description?: string;
|
|
474
445
|
items?: string[];
|
|
475
446
|
};
|
|
476
|
-
showDiscountBadge?: boolean;
|
|
477
|
-
discountSuffix?: string;
|
|
478
447
|
};
|
|
479
448
|
testimonials?: {
|
|
480
449
|
show: boolean;
|
|
481
450
|
title?: string;
|
|
482
451
|
subtitle?: string;
|
|
483
452
|
items?: TestimonialItem[];
|
|
484
|
-
showRatings?: boolean;
|
|
485
|
-
limit?: number;
|
|
486
453
|
quote?: string;
|
|
487
454
|
author?: string;
|
|
488
455
|
role?: string;
|
|
489
|
-
maxItems?: number;
|
|
490
456
|
};
|
|
491
457
|
story?: StorySection;
|
|
492
458
|
promoBanner?: PromoBannerSection;
|
|
@@ -520,14 +486,6 @@ export interface StoreLayoutConfig {
|
|
|
520
486
|
viewAllLabel?: string;
|
|
521
487
|
memberName?: string;
|
|
522
488
|
memberRole?: string;
|
|
523
|
-
memberRating?: string;
|
|
524
|
-
memberReviewCount?: string;
|
|
525
|
-
ratingIcon?: string;
|
|
526
|
-
specialist_image?: string;
|
|
527
|
-
features?: Array<{
|
|
528
|
-
text: string;
|
|
529
|
-
icon?: string;
|
|
530
|
-
}>;
|
|
531
489
|
};
|
|
532
490
|
services?: {
|
|
533
491
|
show: boolean;
|
|
@@ -566,8 +524,6 @@ export interface StoreLayoutConfig {
|
|
|
566
524
|
stat2Value?: string;
|
|
567
525
|
buttonText?: string;
|
|
568
526
|
buttonLink?: string;
|
|
569
|
-
chefBadgeTitle?: string;
|
|
570
|
-
chefBadgeSubtitle?: string;
|
|
571
527
|
};
|
|
572
528
|
trust?: {
|
|
573
529
|
show: boolean;
|
|
@@ -599,8 +555,6 @@ export interface StoreLayoutConfig {
|
|
|
599
555
|
}>;
|
|
600
556
|
hero?: any;
|
|
601
557
|
story?: any;
|
|
602
|
-
aboutHero?: any;
|
|
603
|
-
ourStory?: any;
|
|
604
558
|
stats?: any;
|
|
605
559
|
'contact-info'?: any;
|
|
606
560
|
values?: any;
|
|
@@ -608,7 +562,6 @@ export interface StoreLayoutConfig {
|
|
|
608
562
|
aboutContent?: any;
|
|
609
563
|
statsSection?: any;
|
|
610
564
|
contactSection?: any;
|
|
611
|
-
contactInfoSection?: any;
|
|
612
565
|
};
|
|
613
566
|
team?: {
|
|
614
567
|
title?: string;
|
|
@@ -639,29 +592,6 @@ export interface StoreLayoutConfig {
|
|
|
639
592
|
services?: {
|
|
640
593
|
title?: string;
|
|
641
594
|
description?: string;
|
|
642
|
-
hero?: {
|
|
643
|
-
title?: string;
|
|
644
|
-
description?: string;
|
|
645
|
-
backgroundImage?: string;
|
|
646
|
-
show?: boolean;
|
|
647
|
-
[key: string]: any;
|
|
648
|
-
};
|
|
649
|
-
servicesHeader?: {
|
|
650
|
-
title?: string;
|
|
651
|
-
showFilters?: boolean;
|
|
652
|
-
showSearch?: boolean;
|
|
653
|
-
backgroundImage?: string;
|
|
654
|
-
[key: string]: any;
|
|
655
|
-
};
|
|
656
|
-
servicesGrid?: {
|
|
657
|
-
showPagination?: boolean;
|
|
658
|
-
showBookButton?: boolean;
|
|
659
|
-
[key: string]: any;
|
|
660
|
-
};
|
|
661
|
-
'services-list'?: {
|
|
662
|
-
show?: boolean;
|
|
663
|
-
[key: string]: any;
|
|
664
|
-
};
|
|
665
595
|
};
|
|
666
596
|
faq?: {
|
|
667
597
|
title?: string;
|
|
@@ -677,12 +607,9 @@ export interface StoreLayoutConfig {
|
|
|
677
607
|
categories?: {
|
|
678
608
|
categoriesHeader?: any;
|
|
679
609
|
categoryGrid?: any;
|
|
680
|
-
categoriesGrid?: any;
|
|
681
610
|
};
|
|
682
611
|
categoryDetail?: {
|
|
683
612
|
categoryDetail?: any;
|
|
684
|
-
categoryHeader?: any;
|
|
685
|
-
productGrid?: any;
|
|
686
613
|
showServices?: boolean;
|
|
687
614
|
showProducts?: boolean;
|
|
688
615
|
showBanner?: boolean;
|
|
@@ -691,7 +618,6 @@ export interface StoreLayoutConfig {
|
|
|
691
618
|
};
|
|
692
619
|
productDetail?: {
|
|
693
620
|
productDetail?: any;
|
|
694
|
-
menuItemInfo?: any;
|
|
695
621
|
showSizeGuide?: boolean;
|
|
696
622
|
showAddToCart?: boolean;
|
|
697
623
|
showWishlist?: boolean;
|
|
@@ -704,18 +630,12 @@ export interface StoreLayoutConfig {
|
|
|
704
630
|
contactForm?: any;
|
|
705
631
|
hero?: any;
|
|
706
632
|
form?: any;
|
|
707
|
-
reservationForm?: any;
|
|
708
633
|
backgroundImage?: string;
|
|
709
634
|
title?: string;
|
|
710
635
|
subtitle?: string;
|
|
711
636
|
infoTitle?: string;
|
|
712
637
|
infoDescription?: string;
|
|
713
638
|
};
|
|
714
|
-
book?: {
|
|
715
|
-
bookingHeader?: any;
|
|
716
|
-
bookingForm?: any;
|
|
717
|
-
};
|
|
718
|
-
serviceDetail?: any;
|
|
719
639
|
menu?: {
|
|
720
640
|
menuHeader?: any;
|
|
721
641
|
menuGrid?: any;
|
|
@@ -915,7 +835,5 @@ export interface StoreLayoutConfig {
|
|
|
915
835
|
assignedText?: Record<string, string>;
|
|
916
836
|
assignedAssets?: Record<string, string>;
|
|
917
837
|
assetRequirements?: any;
|
|
918
|
-
/** Inline section styles keyed by `${pageId}::${sectionKey}` — Payaza Styles inspector. */
|
|
919
|
-
payazaSectionStyles?: Record<string, Record<string, string>>;
|
|
920
838
|
}
|
|
921
839
|
//# sourceMappingURL=store-types.d.ts.map
|