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,15 +1,10 @@
|
|
|
1
|
-
import { getStoreConfig } from './store-config
|
|
2
|
-
import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection
|
|
3
|
-
import { storeService } from './services/store.service
|
|
4
|
-
import { categoryService } from './services/category.service
|
|
5
|
-
import { productService } from './services/product.service
|
|
6
|
-
import { serviceService } from './services/service.service
|
|
7
|
-
import {
|
|
8
|
-
import { normalizePrice } from './utils/index.js';
|
|
9
|
-
import { extractPublishedLayoutConfig, resolveLayoutConfigWithTemplateDefaults, extractTemplateLayoutPayload } from '../lib/layout-config-hydration.js';
|
|
10
|
-
import { getTemplateLayoutConfigForLayoutType } from './store-config.js';
|
|
11
|
-
import { resolveCheckoutEnabledFromApi } from './checkout-availability.js';
|
|
12
|
-
import { normalizeBookingTestimonialItems, clampBookingTestimonialLimit, } from '../layouts/booking/components/booking-testimonial-defaults.js';
|
|
1
|
+
import { getStoreConfig } from './store-config';
|
|
2
|
+
import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection';
|
|
3
|
+
import { storeService } from './services/store.service';
|
|
4
|
+
import { categoryService } from './services/category.service';
|
|
5
|
+
import { productService } from './services/product.service';
|
|
6
|
+
import { serviceService } from './services/service.service';
|
|
7
|
+
import { normalizePrice } from './utils';
|
|
13
8
|
// Simple ID generator fallback (doesn't require uuid package)
|
|
14
9
|
function generateId() {
|
|
15
10
|
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
@@ -424,169 +419,38 @@ export function transformCategoryToStoreCategory(apiCategory) {
|
|
|
424
419
|
id: apiCategory.id,
|
|
425
420
|
name: apiCategory.name,
|
|
426
421
|
slug: apiCategory.slug,
|
|
427
|
-
description:
|
|
422
|
+
description: apiCategory.description,
|
|
428
423
|
image: imageUrl,
|
|
429
424
|
parentId: apiCategory.parentId,
|
|
430
425
|
};
|
|
431
426
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
439
|
-
function normalizeVariationAttributes(variation) {
|
|
440
|
-
const attributes = {};
|
|
441
|
-
const raw = variation.attributes || {};
|
|
442
|
-
for (const [key, value] of Object.entries(raw)) {
|
|
443
|
-
if (typeof value === 'string' && value.trim() !== '') {
|
|
444
|
-
attributes[key.toLowerCase()] = value.trim();
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
if (Object.keys(attributes).length === 0) {
|
|
448
|
-
const sku = typeof variation.sku === 'string' ? variation.sku.trim() : '';
|
|
449
|
-
if (sku) {
|
|
450
|
-
attributes.option = sku;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
return attributes;
|
|
454
|
-
}
|
|
455
|
-
function mapApiVariationsToStoreVariants(apiProduct) {
|
|
456
|
-
const variations = apiProduct.variations;
|
|
457
|
-
if (!Array.isArray(variations) || variations.length === 0) {
|
|
458
|
-
return undefined;
|
|
459
|
-
}
|
|
460
|
-
return variations
|
|
461
|
-
.filter((variation) => variation.isActive !== false)
|
|
462
|
-
.map((variation) => {
|
|
463
|
-
const attributes = normalizeVariationAttributes(variation);
|
|
464
|
-
const optionValue = attributes.option;
|
|
465
|
-
return {
|
|
466
|
-
id: variation.id,
|
|
467
|
-
attributes,
|
|
468
|
-
name: variation.name || (optionValue ? 'Option' : ''),
|
|
469
|
-
value: variation.value || optionValue || '',
|
|
470
|
-
price: variation.price
|
|
471
|
-
? typeof variation.price === 'string'
|
|
472
|
-
? parseFloat(variation.price)
|
|
473
|
-
: Number(variation.price)
|
|
474
|
-
: undefined,
|
|
475
|
-
compareAtPrice: variation.compareAtPrice
|
|
476
|
-
? typeof variation.compareAtPrice === 'string'
|
|
477
|
-
? parseFloat(variation.compareAtPrice)
|
|
478
|
-
: Number(variation.compareAtPrice)
|
|
479
|
-
: undefined,
|
|
480
|
-
sku: variation.sku,
|
|
481
|
-
stock: variation.stock != null
|
|
482
|
-
? typeof variation.stock === 'string'
|
|
483
|
-
? parseFloat(variation.stock)
|
|
484
|
-
: Number(variation.stock)
|
|
485
|
-
: undefined,
|
|
486
|
-
inStock: variation.inStock !== false,
|
|
487
|
-
isActive: variation.isActive !== false,
|
|
488
|
-
images: (() => {
|
|
489
|
-
const raw = variation.images;
|
|
490
|
-
let parsed = raw;
|
|
491
|
-
if (typeof raw === 'string') {
|
|
492
|
-
try {
|
|
493
|
-
parsed = JSON.parse(raw);
|
|
494
|
-
}
|
|
495
|
-
catch {
|
|
496
|
-
return raw.trim() ? [raw.trim()] : undefined;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
if (!Array.isArray(parsed) || parsed.length === 0)
|
|
500
|
-
return undefined;
|
|
501
|
-
const urls = parsed
|
|
502
|
-
.map((img) => {
|
|
503
|
-
if (typeof img === 'string')
|
|
504
|
-
return img.trim();
|
|
505
|
-
if (img && typeof img === 'object' && typeof img.url === 'string') {
|
|
506
|
-
return img.url.trim();
|
|
507
|
-
}
|
|
508
|
-
return '';
|
|
509
|
-
})
|
|
510
|
-
.filter(Boolean);
|
|
511
|
-
return urls.length > 0 ? urls : undefined;
|
|
512
|
-
})(),
|
|
513
|
-
};
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
export function transformProductToStoreProduct(apiProduct, options) {
|
|
517
|
-
let availableStock;
|
|
518
|
-
let lowStockThreshold;
|
|
427
|
+
/**
|
|
428
|
+
* Transforms API Product to StoreProduct format
|
|
429
|
+
* Calculates inStock based on trackInventory and inventory data
|
|
430
|
+
*/
|
|
431
|
+
export function transformProductToStoreProduct(apiProduct) {
|
|
432
|
+
// Prefer API-provided inStock (list endpoints no longer ship inventory rows).
|
|
519
433
|
let inStock = true;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
apiProduct.
|
|
525
|
-
|
|
526
|
-
if (isTracked) {
|
|
527
|
-
const explicitAvailable = typeof apiProduct.availableStock === 'number'
|
|
528
|
-
? Math.max(0, apiProduct.availableStock)
|
|
529
|
-
: undefined;
|
|
530
|
-
if (isCartLineContext && explicitAvailable != null) {
|
|
531
|
-
availableStock = explicitAvailable;
|
|
532
|
-
inStock = explicitAvailable > 0;
|
|
533
|
-
if (typeof apiProduct.lowStockThreshold === 'number') {
|
|
534
|
-
lowStockThreshold = apiProduct.lowStockThreshold;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
else if (isCartLineContext &&
|
|
538
|
-
apiProduct.inventory &&
|
|
539
|
-
Array.isArray(apiProduct.inventory) &&
|
|
540
|
-
apiProduct.inventory.length > 0) {
|
|
541
|
-
const rawAvailable = sumRawAvailableFromInventory(apiProduct.inventory);
|
|
542
|
-
availableStock = rawAvailable + (cartLineQty ?? 0);
|
|
543
|
-
const thresholds = apiProduct.inventory
|
|
544
|
-
.map((inv) => Number(inv.lowStockThreshold))
|
|
545
|
-
.filter((value) => Number.isFinite(value) && value > 0);
|
|
546
|
-
if (thresholds.length > 0) {
|
|
547
|
-
lowStockThreshold = Math.max(...thresholds);
|
|
548
|
-
}
|
|
549
|
-
inStock = availableStock > 0;
|
|
550
|
-
}
|
|
551
|
-
else if (explicitAvailable != null) {
|
|
552
|
-
availableStock = explicitAvailable;
|
|
553
|
-
inStock = explicitAvailable > 0;
|
|
554
|
-
if (typeof apiProduct.lowStockThreshold === 'number') {
|
|
555
|
-
lowStockThreshold = apiProduct.lowStockThreshold;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
else if (apiProduct.inventory && Array.isArray(apiProduct.inventory) && apiProduct.inventory.length > 0) {
|
|
559
|
-
availableStock = sumRawAvailableFromInventory(apiProduct.inventory);
|
|
560
|
-
const thresholds = apiProduct.inventory
|
|
561
|
-
.map((inv) => Number(inv.lowStockThreshold))
|
|
562
|
-
.filter((value) => Number.isFinite(value) && value > 0);
|
|
563
|
-
if (thresholds.length > 0) {
|
|
564
|
-
lowStockThreshold = Math.max(...thresholds);
|
|
565
|
-
}
|
|
566
|
-
inStock = availableStock > 0;
|
|
434
|
+
if (typeof apiProduct.inStock === 'boolean') {
|
|
435
|
+
inStock = apiProduct.inStock;
|
|
436
|
+
}
|
|
437
|
+
else if (apiProduct.trackInventory === true) {
|
|
438
|
+
if (apiProduct.inventory && Array.isArray(apiProduct.inventory)) {
|
|
439
|
+
inStock = apiProduct.inventory.some((inv) => (inv.quantity || 0) > 0);
|
|
567
440
|
}
|
|
568
441
|
else {
|
|
569
|
-
|
|
570
|
-
availableStock = fallbackStock;
|
|
571
|
-
inStock = fallbackStock > 0;
|
|
442
|
+
inStock = false;
|
|
572
443
|
}
|
|
573
444
|
}
|
|
574
445
|
else {
|
|
575
446
|
inStock = true;
|
|
576
|
-
availableStock = undefined;
|
|
577
447
|
}
|
|
578
448
|
// Convert price to number (API may return string from decimal type)
|
|
579
449
|
const price = normalizePrice(apiProduct.price);
|
|
580
|
-
// Convert compareAtPrice to number if it exists
|
|
581
|
-
const
|
|
450
|
+
// Convert compareAtPrice to number if it exists
|
|
451
|
+
const compareAtPrice = apiProduct.compareAtPrice
|
|
582
452
|
? normalizePrice(apiProduct.compareAtPrice)
|
|
583
453
|
: undefined;
|
|
584
|
-
const compareAtPrice = compareAtPriceRaw != null && compareAtPriceRaw > 0 ? compareAtPriceRaw : undefined;
|
|
585
|
-
const isLimitedTimeOffer = Boolean(apiProduct.isLimitedTimeOffer);
|
|
586
|
-
const limitedTimeOfferEndsAtRaw = apiProduct.limitedTimeOfferEndsAt;
|
|
587
|
-
const limitedTimeOfferEndsAt = limitedTimeOfferEndsAtRaw != null && String(limitedTimeOfferEndsAtRaw).trim()
|
|
588
|
-
? String(limitedTimeOfferEndsAtRaw)
|
|
589
|
-
: null;
|
|
590
454
|
// Use product-specific image extraction function
|
|
591
455
|
// Backend returns: [{url: string, isPrimary?: boolean}]
|
|
592
456
|
// Frontend needs: string[] (array of URL strings)
|
|
@@ -672,23 +536,29 @@ export function transformProductToStoreProduct(apiProduct, options) {
|
|
|
672
536
|
id: apiProduct.id,
|
|
673
537
|
name: apiProduct.name,
|
|
674
538
|
slug: apiProduct.slug,
|
|
675
|
-
description:
|
|
539
|
+
description: apiProduct.description || '',
|
|
676
540
|
price,
|
|
677
541
|
compareAtPrice,
|
|
678
|
-
isLimitedTimeOffer,
|
|
679
|
-
limitedTimeOfferEndsAt,
|
|
680
542
|
images,
|
|
681
543
|
categoryId: apiProduct.categoryId || '',
|
|
682
544
|
inStock,
|
|
683
|
-
|
|
684
|
-
availableStock,
|
|
685
|
-
lowStockThreshold,
|
|
545
|
+
brand: apiProduct.brand || undefined,
|
|
686
546
|
rating,
|
|
687
547
|
reviewCount,
|
|
688
548
|
sku: generateSKU(apiProduct),
|
|
689
549
|
currency: apiProduct.currency || 'USD',
|
|
690
|
-
variants:
|
|
691
|
-
|
|
550
|
+
variants: apiProduct.variations?.map((variation) => ({
|
|
551
|
+
id: variation.id || variation.name || '',
|
|
552
|
+
name: variation.name || '',
|
|
553
|
+
value: variation.value || '',
|
|
554
|
+
price: variation.price
|
|
555
|
+
? (typeof variation.price === 'string'
|
|
556
|
+
? parseFloat(variation.price)
|
|
557
|
+
: Number(variation.price))
|
|
558
|
+
: undefined,
|
|
559
|
+
sku: variation.sku,
|
|
560
|
+
})),
|
|
561
|
+
specifications: apiProduct.brand ? { Brand: apiProduct.brand, brand: apiProduct.brand } : undefined,
|
|
692
562
|
isActive: apiProduct.isActive,
|
|
693
563
|
status: apiProduct.status,
|
|
694
564
|
};
|
|
@@ -745,7 +615,7 @@ export function transformServiceToStoreService(apiService) {
|
|
|
745
615
|
id: apiService.id,
|
|
746
616
|
name: apiService.name,
|
|
747
617
|
slug: apiService.slug,
|
|
748
|
-
description:
|
|
618
|
+
description: apiService.description || '',
|
|
749
619
|
price,
|
|
750
620
|
currency: apiService.currency,
|
|
751
621
|
duration: apiService.duration || 0,
|
|
@@ -760,7 +630,7 @@ export function transformServiceToStoreService(apiService) {
|
|
|
760
630
|
/**
|
|
761
631
|
* Transforms API StoreResponse to StoreConfig format
|
|
762
632
|
*/
|
|
763
|
-
|
|
633
|
+
function transformStoreResponseToConfig(apiStore) {
|
|
764
634
|
const layout = mapLayoutToStoreLayoutType(apiStore.layout);
|
|
765
635
|
// Debug logging for layoutConfig
|
|
766
636
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -785,14 +655,7 @@ export function transformStoreResponseToConfig(apiStore) {
|
|
|
785
655
|
address: apiStore.address,
|
|
786
656
|
};
|
|
787
657
|
}
|
|
788
|
-
const
|
|
789
|
-
apiStore.layoutContent ??
|
|
790
|
-
apiStore.layoutcontent ??
|
|
791
|
-
undefined;
|
|
792
|
-
const transformedLayoutConfig = transformLayoutConfig(rawLayoutConfig, {
|
|
793
|
-
storeSlug: apiStore.slug,
|
|
794
|
-
storeLayout: layout,
|
|
795
|
-
});
|
|
658
|
+
const transformedLayoutConfig = transformLayoutConfig(apiStore.layoutConfig, apiStore.slug);
|
|
796
659
|
if (process.env.NODE_ENV === 'development') {
|
|
797
660
|
console.log('[transformStoreResponseToConfig] Transformed layoutConfig:', {
|
|
798
661
|
exists: !!transformedLayoutConfig,
|
|
@@ -806,7 +669,6 @@ export function transformStoreResponseToConfig(apiStore) {
|
|
|
806
669
|
slug: apiStore.slug,
|
|
807
670
|
name: apiStore.name,
|
|
808
671
|
description: apiStore.description || '',
|
|
809
|
-
checkoutEnabled: resolveCheckoutEnabledFromApi(apiStore.checkoutEnabled),
|
|
810
672
|
type: layout,
|
|
811
673
|
layout: layout,
|
|
812
674
|
branding: {
|
|
@@ -835,7 +697,6 @@ export function transformStoreResponseToConfig(apiStore) {
|
|
|
835
697
|
taxRate: apiStore.settings?.taxRate, // Deprecated: kept for backward compatibility
|
|
836
698
|
vat: apiStore.settings?.vat,
|
|
837
699
|
serviceCharge: apiStore.settings?.serviceCharge,
|
|
838
|
-
collectionFeePayer: apiStore.settings?.collectionFeePayer,
|
|
839
700
|
},
|
|
840
701
|
contactInfo: (contactInfo.email || contactInfo.phone || contactInfo.address) ? contactInfo : undefined,
|
|
841
702
|
layoutConfig: transformedLayoutConfig, // Transform layoutConfig to match frontend structure
|
|
@@ -843,61 +704,17 @@ export function transformStoreResponseToConfig(apiStore) {
|
|
|
843
704
|
puckData: apiStore.configuration?.puck_configuration?.puckData || undefined,
|
|
844
705
|
};
|
|
845
706
|
}
|
|
846
|
-
function getTemplateLayoutDefaultsForType(layoutType) {
|
|
847
|
-
if (!layoutType)
|
|
848
|
-
return null;
|
|
849
|
-
const layoutConfig = getTemplateLayoutConfigForLayoutType(layoutType);
|
|
850
|
-
if (!layoutConfig)
|
|
851
|
-
return null;
|
|
852
|
-
return extractTemplateLayoutPayload(layoutConfig);
|
|
853
|
-
}
|
|
854
707
|
/**
|
|
855
708
|
* Transforms backend layoutContent structure to frontend layoutConfig structure
|
|
856
709
|
* Backend uses assignedAssets/assignedText, frontend expects sections structure
|
|
857
710
|
*/
|
|
858
|
-
function transformLayoutConfig(layoutContent,
|
|
859
|
-
const storeSlug = options?.storeSlug;
|
|
860
|
-
const storeLayout = options?.storeLayout;
|
|
861
|
-
// Real stores: published snapshot only (defaults materialized at publish). Demo stores use template JSON.
|
|
862
|
-
const useTemplateFallback = Boolean(storeSlug && !shouldUseAPI(storeSlug));
|
|
863
|
-
const templateDefaults = useTemplateFallback
|
|
864
|
-
? getTemplateLayoutDefaultsForType(storeLayout)
|
|
865
|
-
: null;
|
|
711
|
+
function transformLayoutConfig(layoutContent, storeSlug) {
|
|
866
712
|
if (!layoutContent || typeof layoutContent !== 'object') {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
870
|
-
else {
|
|
871
|
-
console.log('[transformLayoutConfig] No layoutContent provided or invalid');
|
|
872
|
-
return undefined;
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
const dbPayload = extractPublishedLayoutConfig(layoutContent);
|
|
876
|
-
const { layoutConfig: resolved } = resolveLayoutConfigWithTemplateDefaults(dbPayload, templateDefaults);
|
|
877
|
-
if (resolved && typeof resolved === 'object') {
|
|
878
|
-
layoutContent = resolved;
|
|
879
|
-
}
|
|
880
|
-
else {
|
|
881
|
-
const editorMeta = layoutContent._editor;
|
|
882
|
-
if (editorMeta?.compiledLegacyConfigJson && typeof editorMeta.compiledLegacyConfigJson === 'object') {
|
|
883
|
-
const compiled = editorMeta.compiledLegacyConfigJson;
|
|
884
|
-
layoutContent =
|
|
885
|
-
compiled.layoutConfig && typeof compiled.layoutConfig === 'object'
|
|
886
|
-
? compiled.layoutConfig
|
|
887
|
-
: compiled.sections || compiled.pages || compiled.home
|
|
888
|
-
? compiled
|
|
889
|
-
: layoutContent;
|
|
890
|
-
}
|
|
891
|
-
else if (layoutContent.layoutConfig &&
|
|
892
|
-
typeof layoutContent.layoutConfig === 'object' &&
|
|
893
|
-
!layoutContent.sections &&
|
|
894
|
-
!layoutContent.pages &&
|
|
895
|
-
!layoutContent.home) {
|
|
896
|
-
layoutContent = layoutContent.layoutConfig;
|
|
897
|
-
}
|
|
713
|
+
console.log('[transformLayoutConfig] No layoutContent provided or invalid');
|
|
714
|
+
return undefined;
|
|
898
715
|
}
|
|
899
716
|
// If it already has the sections structure, return as-is but ensure assignedAssets/assignedText are preserved
|
|
900
|
-
if (layoutContent.sections
|
|
717
|
+
if (layoutContent.sections) {
|
|
901
718
|
console.log('[transformLayoutConfig] Sections structure found, returning as-is');
|
|
902
719
|
console.log('[transformLayoutConfig] Sections found:', {
|
|
903
720
|
hero: !!layoutContent.sections.hero,
|
|
@@ -1007,6 +824,7 @@ function transformLayoutConfig(layoutContent, options) {
|
|
|
1007
824
|
title: bannerTitle,
|
|
1008
825
|
subtitle: bannerSubtitle,
|
|
1009
826
|
buttonText: bannerButtonText,
|
|
827
|
+
// Keep bare path here; PromoBanner prefixes store slug at render time.
|
|
1010
828
|
buttonLink: bannerButtonLink,
|
|
1011
829
|
};
|
|
1012
830
|
}
|
|
@@ -1069,7 +887,7 @@ function transformLayoutConfig(layoutContent, options) {
|
|
|
1069
887
|
showCTA: layoutContent.sections.hero.showCTA !== false,
|
|
1070
888
|
showSecondaryCTA: layoutContent.sections.hero.showSecondaryCTA !== false,
|
|
1071
889
|
autoPlay: layoutContent.sections.hero.autoPlay !== false,
|
|
1072
|
-
showBadges: layoutContent.sections.hero.showBadges
|
|
890
|
+
showBadges: layoutContent.sections.hero.showBadges !== false,
|
|
1073
891
|
// Preserve sliders array exactly as stored - don't transform or modify
|
|
1074
892
|
sliders: layoutContent.sections.hero.sliders,
|
|
1075
893
|
};
|
|
@@ -1151,7 +969,7 @@ function transformLayoutConfig(layoutContent, options) {
|
|
|
1151
969
|
showCTA: true,
|
|
1152
970
|
showSecondaryCTA: true,
|
|
1153
971
|
autoPlay: true,
|
|
1154
|
-
showBadges:
|
|
972
|
+
showBadges: true,
|
|
1155
973
|
sliders: sliders,
|
|
1156
974
|
};
|
|
1157
975
|
}
|
|
@@ -1163,7 +981,7 @@ function transformLayoutConfig(layoutContent, options) {
|
|
|
1163
981
|
showCTA: true,
|
|
1164
982
|
showSecondaryCTA: true,
|
|
1165
983
|
autoPlay: false,
|
|
1166
|
-
showBadges:
|
|
984
|
+
showBadges: true,
|
|
1167
985
|
};
|
|
1168
986
|
}
|
|
1169
987
|
// Categories section - migrate from old format to structured format
|
|
@@ -1221,38 +1039,32 @@ function transformLayoutConfig(layoutContent, options) {
|
|
|
1221
1039
|
// Testimonials section - migrate from old format to structured format
|
|
1222
1040
|
if (layoutContent.sections?.testimonials) {
|
|
1223
1041
|
const testimonialsData = layoutContent.sections.testimonials;
|
|
1224
|
-
const rawItems = testimonialsData.items && Array.isArray(testimonialsData.items)
|
|
1225
|
-
? testimonialsData.items.map((item) => ({
|
|
1226
|
-
id: item.id || generateId(),
|
|
1227
|
-
name: item.name || '',
|
|
1228
|
-
role: item.role || '',
|
|
1229
|
-
image: item.image || '',
|
|
1230
|
-
quote: item.quote || item.comment || '',
|
|
1231
|
-
rating: typeof item.rating === 'number' ? item.rating : 5,
|
|
1232
|
-
order: typeof item.order === 'number' ? item.order : 0,
|
|
1233
|
-
location: item.location,
|
|
1234
|
-
date: item.date,
|
|
1235
|
-
}))
|
|
1236
|
-
: testimonialsData.quote
|
|
1237
|
-
? [
|
|
1238
|
-
{
|
|
1239
|
-
id: generateId(),
|
|
1240
|
-
name: testimonialsData.author || 'Customer',
|
|
1241
|
-
role: testimonialsData.role || 'Customer',
|
|
1242
|
-
image: '',
|
|
1243
|
-
quote: testimonialsData.quote,
|
|
1244
|
-
rating: 5,
|
|
1245
|
-
order: 0,
|
|
1246
|
-
},
|
|
1247
|
-
]
|
|
1248
|
-
: [];
|
|
1249
1042
|
sections.testimonials = {
|
|
1250
1043
|
show: testimonialsData.show !== false,
|
|
1251
1044
|
title: testimonialsData.title,
|
|
1252
1045
|
subtitle: testimonialsData.subtitle,
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1046
|
+
// Support both new items array and old single quote format
|
|
1047
|
+
items: testimonialsData.items && Array.isArray(testimonialsData.items)
|
|
1048
|
+
? testimonialsData.items.map((item) => ({
|
|
1049
|
+
id: item.id || generateId(),
|
|
1050
|
+
name: item.name || 'Customer',
|
|
1051
|
+
role: item.role || 'Customer',
|
|
1052
|
+
image: item.image || '',
|
|
1053
|
+
quote: item.quote || '',
|
|
1054
|
+
rating: typeof item.rating === 'number' ? item.rating : 5,
|
|
1055
|
+
order: typeof item.order === 'number' ? item.order : 0,
|
|
1056
|
+
})).sort((a, b) => a.order - b.order)
|
|
1057
|
+
: testimonialsData.quote
|
|
1058
|
+
? [{
|
|
1059
|
+
id: generateId(),
|
|
1060
|
+
name: testimonialsData.author || 'Customer',
|
|
1061
|
+
role: testimonialsData.role || 'Customer',
|
|
1062
|
+
image: '',
|
|
1063
|
+
quote: testimonialsData.quote,
|
|
1064
|
+
rating: 5,
|
|
1065
|
+
order: 0,
|
|
1066
|
+
}]
|
|
1067
|
+
: [],
|
|
1256
1068
|
// Keep backward compatibility with old single quote format
|
|
1257
1069
|
quote: testimonialsData.quote,
|
|
1258
1070
|
author: testimonialsData.author,
|
|
@@ -1600,7 +1412,7 @@ function transformLayoutConfig(layoutContent, options) {
|
|
|
1600
1412
|
showCTA: sections.hero.showCTA !== false,
|
|
1601
1413
|
showSecondaryCTA: sections.hero.showSecondaryCTA !== false,
|
|
1602
1414
|
autoPlay: sections.hero.autoPlay !== false,
|
|
1603
|
-
showBadges: sections.hero.showBadges
|
|
1415
|
+
showBadges: sections.hero.showBadges !== false,
|
|
1604
1416
|
sliders: sections.hero.sliders,
|
|
1605
1417
|
} : undefined;
|
|
1606
1418
|
return {
|
|
@@ -1638,9 +1450,9 @@ export async function getStoreConfigAsync(storeSlug) {
|
|
|
1638
1450
|
productService
|
|
1639
1451
|
.getProducts({
|
|
1640
1452
|
storeId: apiStore.id,
|
|
1641
|
-
limit:
|
|
1453
|
+
limit: 12,
|
|
1642
1454
|
})
|
|
1643
|
-
.then((response) => response.data.map(
|
|
1455
|
+
.then((response) => response.data.map(transformProductToStoreProduct)),
|
|
1644
1456
|
// Fetch services (backend already filters for isActive: true)
|
|
1645
1457
|
serviceService
|
|
1646
1458
|
.getServices(apiStore.id)
|
package/dist/lib/store-config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Re-export functions from mock-stores for convenience
|
|
2
2
|
// Import first, then export to ensure webpack can resolve properly
|
|
3
|
-
import { getStoreConfig, getAllStores, isValidStoreSlug, getTemplateLayoutConfigForLayoutType } from './mock-stores
|
|
3
|
+
import { getStoreConfig, getAllStores, isValidStoreSlug, getTemplateLayoutConfigForLayoutType } from './mock-stores';
|
|
4
4
|
export { getStoreConfig, getAllStores, isValidStoreSlug, getTemplateLayoutConfigForLayoutType };
|
|
@@ -10,21 +10,12 @@ export interface CartItem {
|
|
|
10
10
|
/** Currency for this line item (multi-currency grouping). */
|
|
11
11
|
currency?: string;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Options for addToCart beyond a plain variant id — consuming apps (e.g. for
|
|
15
|
-
* variant-specific pricing display) may pass this instead of a bare variantId.
|
|
16
|
-
*/
|
|
17
|
-
export type AddToCartOptions = {
|
|
18
|
-
variantId?: string;
|
|
19
|
-
variantName?: string;
|
|
20
|
-
unitPrice?: number;
|
|
21
|
-
};
|
|
22
13
|
interface StoreContextType {
|
|
23
14
|
store: StoreConfig | null;
|
|
24
15
|
isLoading: boolean;
|
|
25
16
|
error: string | null;
|
|
26
17
|
cart: CartItem[];
|
|
27
|
-
addToCart: (product: StoreProduct, quantity?: number,
|
|
18
|
+
addToCart: (product: StoreProduct, quantity?: number, variantId?: string) => Promise<void>;
|
|
28
19
|
removeFromCart: (cartItemId: string) => Promise<void>;
|
|
29
20
|
updateCartQuantity: (cartItemId: string, quantity: number) => Promise<void>;
|
|
30
21
|
removeOrderItemsFromCart?: (orderItems: {
|
|
@@ -32,24 +23,11 @@ interface StoreContextType {
|
|
|
32
23
|
variantId?: string;
|
|
33
24
|
quantity: number;
|
|
34
25
|
}[]) => Promise<void>;
|
|
35
|
-
finalizeCartAfterOrder?: (orderItems: {
|
|
36
|
-
productId: string;
|
|
37
|
-
variantId?: string;
|
|
38
|
-
quantity: number;
|
|
39
|
-
}[], options?: {
|
|
40
|
-
checkoutEntireCart?: boolean;
|
|
41
|
-
}) => Promise<void>;
|
|
42
26
|
cartTotal: number;
|
|
43
27
|
cartCount: number;
|
|
44
28
|
isCartOpen: boolean;
|
|
45
29
|
setIsCartOpen: (open: boolean) => void;
|
|
46
30
|
isCartLoading: boolean;
|
|
47
|
-
isCartHydrated: boolean;
|
|
48
|
-
isCartRefreshing?: boolean;
|
|
49
|
-
refreshCart: () => Promise<void>;
|
|
50
|
-
inventoryHoldUntil?: string | null;
|
|
51
|
-
setInventoryHoldUntil?: (value: string | null) => void;
|
|
52
|
-
handleInventoryHoldExpired?: () => void;
|
|
53
31
|
buyNowItem: CartItem | null;
|
|
54
32
|
setBuyNowItem: (item: CartItem | null) => void;
|
|
55
33
|
clearBuyNowItem: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-context.d.ts","sourceRoot":"","sources":["../../src/lib/store-context.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"store-context.d.ts","sourceRoot":"","sources":["../../src/lib/store-context.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAc/D,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxH,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,aAAa,EAAE,OAAO,CAAC;IAGvB,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,eAAe,EAAE,MAAM,IAAI,CAAC;IAG5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,2CAqBvB,CAAC;AAEH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,aAAa,EACd,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACpC,2CAgcA;AAED,eAAO,MAAM,QAAQ,wBAAiC,CAAC"}
|