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,5 +1,7 @@
|
|
|
1
1
|
import { useState, useCallback } from 'react';
|
|
2
|
-
import { useStore } from '../lib/store-context
|
|
2
|
+
import { useStore } from '../lib/store-context';
|
|
3
|
+
import { productService } from '../lib/services/product.service';
|
|
4
|
+
import { transformProductToStoreProduct } from '../lib/store-config-utils';
|
|
3
5
|
/**
|
|
4
6
|
* Hook to manage cart - uses StoreContext only (localStorage-based)
|
|
5
7
|
* Note: cartService removed - all cart operations use StoreContext
|
|
@@ -29,8 +31,11 @@ export function useCartApi(storeConfig) {
|
|
|
29
31
|
try {
|
|
30
32
|
setLoading(true);
|
|
31
33
|
setError(null);
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
+
// Bootstrap contains only a catalog page; resolve products outside it by ID.
|
|
35
|
+
let product = storeConfig.products?.find(p => p.id === productId);
|
|
36
|
+
if (!product) {
|
|
37
|
+
product = transformProductToStoreProduct(await productService.getProductById(productId));
|
|
38
|
+
}
|
|
34
39
|
if (!product) {
|
|
35
40
|
throw new Error('Product not found');
|
|
36
41
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService, } from '../lib/store-config-utils
|
|
4
|
-
import { syncFoodMenuItemsFromProducts } from '../lib/utils/editor-preview
|
|
5
|
-
import { useLoading } from '../lib/loading-context
|
|
3
|
+
import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService, } from '../lib/store-config-utils';
|
|
4
|
+
import { syncFoodMenuItemsFromProducts } from '../lib/utils/editor-preview';
|
|
5
|
+
import { useLoading } from '../lib/loading-context';
|
|
6
6
|
/**
|
|
7
7
|
* Hydrates catalog arrays from API when storeConfig has empty products/categories/services.
|
|
8
8
|
* Used on non-home pages for editor preview (before Phase 2 overlay) and live storefront edge cases.
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { type PriceableItem } from '../lib/utils/catalog-price-bounds';
|
|
2
2
|
export type UseCatalogPriceRangeOptions = {
|
|
3
|
-
/** Used when the catalog is empty (e.g.
|
|
3
|
+
/** Used when the catalog is empty (e.g. food menus). */
|
|
4
4
|
fallbackMax?: number;
|
|
5
5
|
};
|
|
6
6
|
export declare function useCatalogPriceRange(items: PriceableItem[], options?: UseCatalogPriceRangeOptions): {
|
|
7
7
|
priceRange: [number, number];
|
|
8
8
|
setPriceRange: import("react").Dispatch<import("react").SetStateAction<[number, number]>>;
|
|
9
|
-
catalogBounds:
|
|
10
|
-
min: number;
|
|
11
|
-
max: number;
|
|
12
|
-
};
|
|
9
|
+
catalogBounds: import("../lib/utils/catalog-price-bounds").CatalogPriceBounds;
|
|
13
10
|
sliderMax: number;
|
|
14
11
|
resetPriceRange: () => void;
|
|
15
12
|
hasActivePriceFilter: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-catalog-price-range.d.ts","sourceRoot":"","sources":["../../src/hooks/use-catalog-price-range.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-catalog-price-range.d.ts","sourceRoot":"","sources":["../../src/hooks/use-catalog-price-range.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,MAAM,2BAA2B,GAAG;IACxC,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAYF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EAAE,EACtB,OAAO,GAAE,2BAAgC;;;;;;;EA6C1C"}
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { getCatalogPriceBounds, } from '../lib/utils/catalog-price-bounds
|
|
3
|
+
import { getCatalogPriceBounds, isLegacyDefaultPriceRange, isPriceFilterActive, } from '../lib/utils/catalog-price-bounds';
|
|
4
|
+
function clampPriceRange(range, bounds) {
|
|
5
|
+
return [
|
|
6
|
+
Math.max(bounds.min, Math.min(range[0], bounds.max)),
|
|
7
|
+
Math.min(bounds.max, Math.max(range[1], bounds.min)),
|
|
8
|
+
];
|
|
9
|
+
}
|
|
4
10
|
export function useCatalogPriceRange(items, options = {}) {
|
|
5
|
-
const fallbackMax = options.fallbackMax
|
|
6
|
-
const catalogBounds = useMemo(() =>
|
|
11
|
+
const fallbackMax = options.fallbackMax;
|
|
12
|
+
const catalogBounds = useMemo(() => fallbackMax != null
|
|
13
|
+
? getCatalogPriceBounds(items, fallbackMax)
|
|
14
|
+
: getCatalogPriceBounds(items), [items, fallbackMax]);
|
|
7
15
|
const [priceRange, setPriceRange] = useState(() => [
|
|
8
16
|
catalogBounds.min,
|
|
9
17
|
catalogBounds.max,
|
|
10
18
|
]);
|
|
11
19
|
useEffect(() => {
|
|
12
|
-
setPriceRange(
|
|
20
|
+
setPriceRange((prev) => {
|
|
21
|
+
const wasLegacyDefault = isLegacyDefaultPriceRange(prev);
|
|
22
|
+
const wasFullCatalogRange = prev[0] <= catalogBounds.min && prev[1] >= catalogBounds.max;
|
|
23
|
+
if (wasLegacyDefault || wasFullCatalogRange) {
|
|
24
|
+
return [catalogBounds.min, catalogBounds.max];
|
|
25
|
+
}
|
|
26
|
+
return clampPriceRange(prev, catalogBounds);
|
|
27
|
+
});
|
|
13
28
|
}, [catalogBounds.min, catalogBounds.max]);
|
|
14
29
|
const resetPriceRange = useCallback(() => {
|
|
15
30
|
setPriceRange([catalogBounds.min, catalogBounds.max]);
|
|
16
31
|
}, [catalogBounds.min, catalogBounds.max]);
|
|
17
|
-
const hasActivePriceFilter = priceRange
|
|
32
|
+
const hasActivePriceFilter = isPriceFilterActive(priceRange, catalogBounds);
|
|
18
33
|
return {
|
|
19
34
|
priceRange,
|
|
20
35
|
setPriceRange,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoreProduct } from '../lib/store-types';
|
|
2
|
+
export declare function useCategoryProducts(storeId: string, categoryId?: string): {
|
|
3
|
+
products: StoreProduct[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
hasMore: boolean;
|
|
6
|
+
loadMore: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=use-category-products.d.ts.map
|
|
@@ -0,0 +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,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;;;;;EAqCvE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { productService } from '../lib/services/product.service';
|
|
4
|
+
import { transformProductToStoreProduct } from '../lib/store-config-utils';
|
|
5
|
+
const PAGE_SIZE = 12;
|
|
6
|
+
export function useCategoryProducts(storeId, categoryId) {
|
|
7
|
+
const [products, setProducts] = useState([]);
|
|
8
|
+
const [page, setPage] = useState(1);
|
|
9
|
+
const [total, setTotal] = useState(0);
|
|
10
|
+
const [isLoading, setIsLoading] = useState(Boolean(categoryId));
|
|
11
|
+
const fetchPage = useCallback(async (requestedPage, append = false) => {
|
|
12
|
+
if (!categoryId)
|
|
13
|
+
return;
|
|
14
|
+
setIsLoading(true);
|
|
15
|
+
try {
|
|
16
|
+
const response = await productService.getProducts({
|
|
17
|
+
storeId,
|
|
18
|
+
categoryId,
|
|
19
|
+
page: requestedPage,
|
|
20
|
+
limit: PAGE_SIZE,
|
|
21
|
+
});
|
|
22
|
+
const nextProducts = response.data.map(transformProductToStoreProduct);
|
|
23
|
+
setProducts((current) => append ? [...current, ...nextProducts] : nextProducts);
|
|
24
|
+
setPage(requestedPage);
|
|
25
|
+
setTotal(response.meta.total);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Failed to fetch category products:', error);
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
setIsLoading(false);
|
|
32
|
+
}
|
|
33
|
+
}, [categoryId, storeId]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
fetchPage(1);
|
|
36
|
+
}, [fetchPage]);
|
|
37
|
+
return {
|
|
38
|
+
products,
|
|
39
|
+
isLoading,
|
|
40
|
+
hasMore: page * PAGE_SIZE < total,
|
|
41
|
+
loadMore: () => fetchPage(page + 1, true),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CheckoutFeeBreakdown } from '../lib/services/fees.service';
|
|
2
1
|
export interface UseCheckoutFeesOptions {
|
|
3
2
|
storeId?: string;
|
|
4
3
|
subtotal: number;
|
|
@@ -8,9 +7,9 @@ export interface UseCheckoutFeesOptions {
|
|
|
8
7
|
onError?: (message: string) => void;
|
|
9
8
|
}
|
|
10
9
|
export declare function useCheckoutFees({ storeId, subtotal, currency, shippingCost, debounceMs, onError, }: UseCheckoutFeesOptions): {
|
|
11
|
-
feeBreakdown:
|
|
10
|
+
feeBreakdown: any;
|
|
12
11
|
loading: boolean;
|
|
13
|
-
totalPayable:
|
|
14
|
-
displayLines:
|
|
12
|
+
totalPayable: any;
|
|
13
|
+
displayLines: any;
|
|
15
14
|
};
|
|
16
15
|
//# sourceMappingURL=use-checkout-fees.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkout-fees.d.ts","sourceRoot":"","sources":["../../src/hooks/use-checkout-fees.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-checkout-fees.d.ts","sourceRoot":"","sources":["../../src/hooks/use-checkout-fees.ts"],"names":[],"mappings":"AAyCA,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAgB,EAChB,UAAgB,EAChB,OAAO,GACR,EAAE,sBAAsB;;;;;EAqFxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { EMPTY_CHECKOUT_FEE_BREAKDOWN, feesService, normalizeCheckoutFeeBreakdown, } from '../lib/services/fees.service
|
|
3
|
+
import { EMPTY_CHECKOUT_FEE_BREAKDOWN, feesService, normalizeCheckoutFeeBreakdown, } from '../lib/services/fees.service';
|
|
4
4
|
const STORAGE_PREFIX = 'checkoutFees:';
|
|
5
5
|
function readStoredBreakdown(storeId) {
|
|
6
6
|
if (typeof window === 'undefined')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
|
-
import { getContentSelectors, detectRouteType } from '../lib/content-selectors
|
|
3
|
+
import { getContentSelectors, detectRouteType } from '../lib/content-selectors';
|
|
4
4
|
/**
|
|
5
5
|
* Hook to detect when page content is ready for display
|
|
6
6
|
* Uses DOM observation to verify key content elements are present
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-featured-products.d.ts","sourceRoot":"","sources":["../../src/hooks/use-featured-products.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,YAAY,EAAE,EAC/B,OAAO,UAAO,kBAwBf"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { productService } from '../lib/services/product.service';
|
|
4
|
+
import { transformProductToStoreProduct } from '../lib/store-config-utils';
|
|
5
|
+
export function useFeaturedProducts(storeId, initialProducts, enabled = true) {
|
|
6
|
+
const [products, setProducts] = useState(initialProducts);
|
|
7
|
+
const hasInitialProducts = initialProducts.length > 0;
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!enabled || hasInitialProducts)
|
|
10
|
+
return;
|
|
11
|
+
let cancelled = false;
|
|
12
|
+
productService
|
|
13
|
+
.getFeaturedProducts(storeId, 12)
|
|
14
|
+
.then((apiProducts) => {
|
|
15
|
+
if (!cancelled && apiProducts.length > 0) {
|
|
16
|
+
setProducts(apiProducts.map(transformProductToStoreProduct));
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
.catch((error) => console.error('Failed to load featured products:', error));
|
|
20
|
+
return () => {
|
|
21
|
+
cancelled = true;
|
|
22
|
+
};
|
|
23
|
+
}, [enabled, hasInitialProducts, storeId]);
|
|
24
|
+
return products;
|
|
25
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CheckoutFeeBreakdown, type CheckoutFeeLine } from '../lib/services/fees.service';
|
|
2
1
|
export interface MultiStoreSubtotal {
|
|
3
2
|
storeId: string;
|
|
4
3
|
subtotal: number;
|
|
@@ -17,9 +16,9 @@ export interface UseMultiStoreCheckoutFeesOptions {
|
|
|
17
16
|
* backend computes fees per-store during process-marketplace.
|
|
18
17
|
*/
|
|
19
18
|
export declare function useMultiStoreCheckoutFees({ stores, currency, debounceMs, onError, }: UseMultiStoreCheckoutFeesOptions): {
|
|
20
|
-
feeBreakdown:
|
|
19
|
+
feeBreakdown: any;
|
|
21
20
|
loading: boolean;
|
|
22
|
-
totalPayable:
|
|
23
|
-
displayLines:
|
|
21
|
+
totalPayable: any;
|
|
22
|
+
displayLines: any;
|
|
24
23
|
};
|
|
25
24
|
//# sourceMappingURL=use-multi-store-checkout-fees.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-multi-store-checkout-fees.d.ts","sourceRoot":"","sources":["../../src/hooks/use-multi-store-checkout-fees.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-multi-store-checkout-fees.d.ts","sourceRoot":"","sources":["../../src/hooks/use-multi-store-checkout-fees.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAqDD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,QAAQ,EACR,UAAgB,EAChB,OAAO,GACR,EAAE,gCAAgC;;;;;EAwElC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { EMPTY_CHECKOUT_FEE_BREAKDOWN, feesService, } from '../lib/services/fees.service
|
|
3
|
+
import { EMPTY_CHECKOUT_FEE_BREAKDOWN, feesService, } from '../lib/services/fees.service';
|
|
4
4
|
function sumFeeBreakdowns(breakdowns) {
|
|
5
5
|
if (breakdowns.length === 0)
|
|
6
6
|
return EMPTY_CHECKOUT_FEE_BREAKDOWN;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { useRouter } from 'next/navigation';
|
|
4
|
-
import { useLoading } from '../lib/loading-context
|
|
4
|
+
import { useLoading } from '../lib/loading-context';
|
|
5
5
|
export function useNavigationLoading() {
|
|
6
6
|
const router = useRouter();
|
|
7
7
|
const { startPageLoading, stopPageLoading } = useLoading();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PayazaCheckoutConfig, PayazaCheckoutResponse } from '../lib/payaza-checkout';
|
|
2
2
|
interface UsePayazaCheckoutOptions {
|
|
3
|
-
/**
|
|
3
|
+
/** Deprecated — pass `publicKey` on each checkout call (backend currency-resolved key). */
|
|
4
4
|
publicKey?: string;
|
|
5
5
|
onSuccess?: (response: PayazaCheckoutResponse) => void;
|
|
6
6
|
onError?: (error: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-payaza-checkout.d.ts","sourceRoot":"","sources":["../../src/hooks/use-payaza-checkout.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,oBAAoB,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAGxI,UAAU,wBAAwB;IAChC,
|
|
1
|
+
{"version":3,"file":"use-payaza-checkout.d.ts","sourceRoot":"","sources":["../../src/hooks/use-payaza-checkout.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,oBAAoB,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAGxI,UAAU,wBAAwB;IAChC,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,SAAc,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,wBAAwB;uBAiBzE,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;;;EAoHhG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import { initiatePayazaCheckout, teardownPayazaCheckoutDom } from '../lib/payaza-checkout
|
|
4
|
-
import { orderService } from '../lib/services/order.service
|
|
3
|
+
import { initiatePayazaCheckout, teardownPayazaCheckoutDom } from '../lib/payaza-checkout';
|
|
4
|
+
import { orderService } from '../lib/services/order.service';
|
|
5
5
|
export function usePayazaCheckout({ publicKey = '', onSuccess, onError, onClose }) {
|
|
6
6
|
const [isLoading, setIsLoading] = useState(false);
|
|
7
7
|
const [error, setError] = useState(null);
|
|
@@ -18,7 +18,13 @@ export function usePayazaCheckout({ publicKey = '', onSuccess, onError, onClose
|
|
|
18
18
|
};
|
|
19
19
|
}, []);
|
|
20
20
|
const checkout = async (config) => {
|
|
21
|
-
const resolvedPublicKey = config.publicKey || publicKey;
|
|
21
|
+
const resolvedPublicKey = (config.publicKey || publicKey)?.trim();
|
|
22
|
+
if (!resolvedPublicKey) {
|
|
23
|
+
const message = 'Payment gateway not configured for this currency. Please contact support.';
|
|
24
|
+
setError(message);
|
|
25
|
+
onError?.(message);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
22
28
|
setIsLoading(true);
|
|
23
29
|
setError(null);
|
|
24
30
|
let callbackFired = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-product-brands.d.ts","sourceRoot":"","sources":["../../src/hooks/use-product-brands.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO,YAkBxE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { productService } from '../lib/services/product.service';
|
|
4
|
+
/**
|
|
5
|
+
* Full-catalog brand list for filter sidebars (not derived from the current page only).
|
|
6
|
+
*/
|
|
7
|
+
export function useProductBrands(storeId, fallback = []) {
|
|
8
|
+
const [brands, setBrands] = useState(fallback);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!storeId)
|
|
11
|
+
return;
|
|
12
|
+
let cancelled = false;
|
|
13
|
+
productService
|
|
14
|
+
.getProductBrands(storeId)
|
|
15
|
+
.then((next) => {
|
|
16
|
+
if (!cancelled && next.length > 0)
|
|
17
|
+
setBrands(next);
|
|
18
|
+
})
|
|
19
|
+
.catch((error) => console.error('Failed to load product brands:', error));
|
|
20
|
+
return () => {
|
|
21
|
+
cancelled = true;
|
|
22
|
+
};
|
|
23
|
+
}, [storeId]);
|
|
24
|
+
return brands;
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StoreProduct } from '../lib/store-types';
|
|
2
|
+
export declare function useProductBySlug(storeId: string, slug: string, initialProduct?: StoreProduct): {
|
|
3
|
+
product: StoreProduct;
|
|
4
|
+
relatedProducts: StoreProduct[];
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=use-product-by-slug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-product-by-slug.d.ts","sourceRoot":"","sources":["../../src/hooks/use-product-by-slug.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,YAAY;;;;EAoC9B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { productService } from '../lib/services/product.service';
|
|
4
|
+
import { transformProductToStoreProduct } from '../lib/store-config-utils';
|
|
5
|
+
export function useProductBySlug(storeId, slug, initialProduct) {
|
|
6
|
+
const [product, setProduct] = useState(initialProduct);
|
|
7
|
+
const [relatedProducts, setRelatedProducts] = useState([]);
|
|
8
|
+
const [isLoading, setIsLoading] = useState(!initialProduct);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (initialProduct) {
|
|
11
|
+
setProduct(initialProduct);
|
|
12
|
+
setIsLoading(false);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
let cancelled = false;
|
|
16
|
+
setIsLoading(true);
|
|
17
|
+
productService
|
|
18
|
+
.getProductBySlug(slug, storeId)
|
|
19
|
+
.then(({ product: apiProduct, relatedProducts: apiRelatedProducts }) => {
|
|
20
|
+
if (cancelled)
|
|
21
|
+
return;
|
|
22
|
+
setProduct(transformProductToStoreProduct(apiProduct));
|
|
23
|
+
setRelatedProducts(apiRelatedProducts.map(transformProductToStoreProduct));
|
|
24
|
+
})
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
if (!cancelled)
|
|
27
|
+
console.error('Failed to load product:', error);
|
|
28
|
+
})
|
|
29
|
+
.finally(() => {
|
|
30
|
+
if (!cancelled)
|
|
31
|
+
setIsLoading(false);
|
|
32
|
+
});
|
|
33
|
+
return () => {
|
|
34
|
+
cancelled = true;
|
|
35
|
+
};
|
|
36
|
+
}, [initialProduct, slug, storeId]);
|
|
37
|
+
return { product, relatedProducts, isLoading };
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ProductReview } from '../lib/store-types';
|
|
2
|
+
import { type Review } from '../lib/services/review.service';
|
|
3
|
+
export declare function mapApiReviewToProductReview(review: Review): ProductReview;
|
|
4
|
+
export declare function useProductReviews(productId?: string | null): {
|
|
5
|
+
reviews: ProductReview[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
isSubmitting: boolean;
|
|
8
|
+
refresh: () => Promise<void>;
|
|
9
|
+
submitReview: (input: {
|
|
10
|
+
rating: number;
|
|
11
|
+
title?: string;
|
|
12
|
+
comment?: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=use-product-reviews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-product-reviews.d.ts","sourceRoot":"","sources":["../../src/hooks/use-product-reviews.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAc5E,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAezE;AAED,wBAAgB,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;;;;;0BA0BzC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;EAkBrE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { reviewService } from '../lib/services/review.service';
|
|
4
|
+
function customerDisplayName(customer) {
|
|
5
|
+
if (!customer || typeof customer !== 'object')
|
|
6
|
+
return 'Customer';
|
|
7
|
+
const first = typeof customer.firstName === 'string' ? customer.firstName.trim() : '';
|
|
8
|
+
const last = typeof customer.lastName === 'string' ? customer.lastName.trim() : '';
|
|
9
|
+
if (first && last)
|
|
10
|
+
return `${first} ${last.charAt(0)}.`;
|
|
11
|
+
if (first)
|
|
12
|
+
return first;
|
|
13
|
+
if (typeof customer.email === 'string' && customer.email.includes('@')) {
|
|
14
|
+
return customer.email.split('@')[0] || 'Customer';
|
|
15
|
+
}
|
|
16
|
+
return 'Customer';
|
|
17
|
+
}
|
|
18
|
+
export function mapApiReviewToProductReview(review) {
|
|
19
|
+
const rawComment = typeof review.comment === 'string' ? review.comment.trim() : '';
|
|
20
|
+
const [maybeTitle, ...rest] = rawComment.split(/\n\n+/);
|
|
21
|
+
const hasSplitTitle = rest.length > 0 && maybeTitle.length > 0 && maybeTitle.length <= 120;
|
|
22
|
+
return {
|
|
23
|
+
id: review.id,
|
|
24
|
+
userId: review.customerId,
|
|
25
|
+
userName: customerDisplayName(review.customer),
|
|
26
|
+
userAvatar: typeof review.customer?.avatar === 'string' ? review.customer.avatar : undefined,
|
|
27
|
+
rating: Number(review.rating) || 0,
|
|
28
|
+
title: hasSplitTitle ? maybeTitle : undefined,
|
|
29
|
+
comment: hasSplitTitle ? rest.join('\n\n') : rawComment,
|
|
30
|
+
date: review.createdAt,
|
|
31
|
+
verified: Boolean(review.isVerified),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function useProductReviews(productId) {
|
|
35
|
+
const [reviews, setReviews] = useState([]);
|
|
36
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
37
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
38
|
+
const refresh = useCallback(async () => {
|
|
39
|
+
if (!productId) {
|
|
40
|
+
setReviews([]);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
setIsLoading(true);
|
|
44
|
+
try {
|
|
45
|
+
const page = await reviewService.getProductReviews(productId, 1, 50);
|
|
46
|
+
setReviews((page.data || []).map(mapApiReviewToProductReview));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
setReviews([]);
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
setIsLoading(false);
|
|
53
|
+
}
|
|
54
|
+
}, [productId]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
void refresh();
|
|
57
|
+
}, [refresh]);
|
|
58
|
+
const submitReview = useCallback(async (input) => {
|
|
59
|
+
if (!productId)
|
|
60
|
+
throw new Error('Product is required');
|
|
61
|
+
setIsSubmitting(true);
|
|
62
|
+
try {
|
|
63
|
+
await reviewService.createReview(productId, {
|
|
64
|
+
rating: Math.round(input.rating),
|
|
65
|
+
title: input.title,
|
|
66
|
+
comment: input.comment,
|
|
67
|
+
});
|
|
68
|
+
await refresh();
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
setIsSubmitting(false);
|
|
72
|
+
}
|
|
73
|
+
}, [productId, refresh]);
|
|
74
|
+
return { reviews, isLoading, isSubmitting, refresh, submitReview };
|
|
75
|
+
}
|
|
@@ -9,16 +9,10 @@ export declare function useProductVariationSelection(variants?: StoreProductVari
|
|
|
9
9
|
setSelectedSize: (value: string) => void;
|
|
10
10
|
matchingVariation: {
|
|
11
11
|
id: string;
|
|
12
|
-
name
|
|
13
|
-
value
|
|
14
|
-
attributes?: Record<string, string>;
|
|
12
|
+
name: string;
|
|
13
|
+
value: string;
|
|
15
14
|
price?: number;
|
|
16
|
-
compareAtPrice?: number;
|
|
17
15
|
sku?: string;
|
|
18
|
-
stock?: number;
|
|
19
|
-
inStock?: boolean;
|
|
20
|
-
isActive?: boolean;
|
|
21
|
-
images?: string[];
|
|
22
16
|
};
|
|
23
17
|
hasVariations: boolean;
|
|
24
18
|
/** True when the shopper picked at least one option; empty → use main product. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-product-variation-selection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-product-variation-selection.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,wBAAgB,4BAA4B,CAAC,QAAQ,CAAC,EAAE,mBAAmB,EAAE;;;wBAYpC,MAAM,SAAS,MAAM;;;8BA8ChC,MAAM;6BACP,MAAM
|
|
1
|
+
{"version":3,"file":"use-product-variation-selection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-product-variation-selection.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,wBAAgB,4BAA4B,CAAC,QAAQ,CAAC,EAAE,mBAAmB,EAAE;;;wBAYpC,MAAM,SAAS,MAAM;;;8BA8ChC,MAAM;6BACP,MAAM;;;;;;;;;IAG/B,kFAAkF;;;EAIrF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { getVariationOptionGroups, } from '../lib/product-variation-utils
|
|
3
|
+
import { getVariationOptionGroups, } from '../lib/product-variation-utils';
|
|
4
4
|
export function useProductVariationSelection(variants) {
|
|
5
5
|
const optionGroups = useMemo(() => getVariationOptionGroups(variants), [variants]);
|
|
6
6
|
const [selectedAttributes, setSelectedAttributes] = useState({});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { productService } from '../lib/services/product.service
|
|
3
|
-
import { shouldUseAPI } from '../lib/utils/demo-detection
|
|
4
|
-
import { useLoading } from '../lib/loading-context
|
|
2
|
+
import { productService } from '../lib/services/product.service';
|
|
3
|
+
import { shouldUseAPI } from '../lib/utils/demo-detection';
|
|
4
|
+
import { useLoading } from '../lib/loading-context';
|
|
5
5
|
/**
|
|
6
6
|
* Hook to fetch products from API or use mock data for demo stores
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
-
import { shippingService } from '../lib/services/shipping.service
|
|
4
|
-
import { EMPTY_SHIPPING_QUOTE_ADDRESS, canRequestShippingQuote, buildShippingCalculatePayload, } from '../lib/shipping-address.util
|
|
3
|
+
import { shippingService } from '../lib/services/shipping.service';
|
|
4
|
+
import { EMPTY_SHIPPING_QUOTE_ADDRESS, canRequestShippingQuote, buildShippingCalculatePayload, } from '../lib/shipping-address.util';
|
|
5
5
|
export function useShippingQuote({ storeId, productId, productPrice, currency, quantity, enabled = true, customerInfo, initialAddress, }) {
|
|
6
6
|
const [address, setAddress] = useState({
|
|
7
7
|
...EMPTY_SHIPPING_QUOTE_ADDRESS,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { storeService } from '../lib/services/store.service
|
|
3
|
-
import { shouldUseAPI, getBaseStoreSlug } from '../lib/utils/demo-detection
|
|
4
|
-
import { getStoreConfig } from '../lib/store-config
|
|
5
|
-
import { useLoading } from '../lib/loading-context
|
|
2
|
+
import { storeService } from '../lib/services/store.service';
|
|
3
|
+
import { shouldUseAPI, getBaseStoreSlug } from '../lib/utils/demo-detection';
|
|
4
|
+
import { getStoreConfig } from '../lib/store-config';
|
|
5
|
+
import { useLoading } from '../lib/loading-context';
|
|
6
6
|
/**
|
|
7
7
|
* Hook to fetch store data from API or use mock data for demo stores
|
|
8
8
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
|
-
import { PREVIEW_MSG } from '../preview/canvas/preview-messages
|
|
3
|
+
import { PREVIEW_MSG } from '../preview/canvas/preview-messages';
|
|
4
4
|
/**
|
|
5
5
|
* Syncs hero carousel index when the template editor selects a slide in the inspector.
|
|
6
6
|
*/
|