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,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { FoodModernHeader } from '../components/headers/FoodModernHeader
|
|
4
|
-
import { StoreFooter } from '../components/StoreFooter
|
|
5
|
-
import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper
|
|
6
|
-
import { PageContentLoader } from '../../../components/ui/page-content-loader
|
|
3
|
+
import { FoodModernHeader } from '../components/headers/FoodModernHeader';
|
|
4
|
+
import { StoreFooter } from '../components/StoreFooter';
|
|
5
|
+
import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper';
|
|
6
|
+
import { PageContentLoader } from '../../../components/ui/page-content-loader';
|
|
7
7
|
import { usePathname } from 'next/navigation';
|
|
8
|
-
import { useLoading } from '../../../lib/loading-context
|
|
9
|
-
import { AlertModalProvider } from '../../../components/ui/alert-modal
|
|
8
|
+
import { useLoading } from '../../../lib/loading-context';
|
|
9
|
+
import { AlertModalProvider } from '../../../components/ui/alert-modal';
|
|
10
10
|
export function FoodModernLayout({ children, storeConfig }) {
|
|
11
11
|
const pathname = usePathname();
|
|
12
12
|
const { isBackendLoading } = useLoading();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { StoreHeader } from '../components/StoreHeader
|
|
4
|
-
import { StoreFooter } from '../components/StoreFooter
|
|
5
|
-
import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper
|
|
6
|
-
import { PageContentLoader } from '../../../components/ui/page-content-loader
|
|
7
|
-
import { useStore } from '../../../lib/store-context
|
|
8
|
-
import { useLoading } from '../../../lib/loading-context
|
|
9
|
-
import { getThemeColor } from '../../../lib/utils/asset-helpers
|
|
10
|
-
import { AlertModalProvider } from '../../../components/ui/alert-modal
|
|
3
|
+
import { StoreHeader } from '../components/StoreHeader';
|
|
4
|
+
import { StoreFooter } from '../components/StoreFooter';
|
|
5
|
+
import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper';
|
|
6
|
+
import { PageContentLoader } from '../../../components/ui/page-content-loader';
|
|
7
|
+
import { useStore } from '../../../lib/store-context';
|
|
8
|
+
import { useLoading } from '../../../lib/loading-context';
|
|
9
|
+
import { getThemeColor } from '../../../lib/utils/asset-helpers';
|
|
10
|
+
import { AlertModalProvider } from '../../../components/ui/alert-modal';
|
|
11
11
|
import { usePathname } from 'next/navigation';
|
|
12
|
-
import { cn } from '../../../lib/utils
|
|
12
|
+
import { cn } from '../../../lib/utils';
|
|
13
13
|
export function MotivationalLayout({ children, storeConfig }) {
|
|
14
14
|
const { cartCount } = useStore();
|
|
15
15
|
const { isBackendLoading } = useLoading();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { StoreHeader } from '../components/StoreHeader
|
|
4
|
-
import { StoreFooter } from '../components/StoreFooter
|
|
5
|
-
import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper
|
|
6
|
-
import { PageContentLoader } from '../../../components/ui/page-content-loader
|
|
7
|
-
import { useStore } from '../../../lib/store-context
|
|
8
|
-
import { useLoading } from '../../../lib/loading-context
|
|
9
|
-
import { getThemeColor } from '../../../lib/utils/asset-helpers
|
|
10
|
-
import { AlertModalProvider } from '../../../components/ui/alert-modal
|
|
3
|
+
import { StoreHeader } from '../components/StoreHeader';
|
|
4
|
+
import { StoreFooter } from '../components/StoreFooter';
|
|
5
|
+
import { PageAnimateWrapper } from '../../../components/ui/page-animate-wrapper';
|
|
6
|
+
import { PageContentLoader } from '../../../components/ui/page-content-loader';
|
|
7
|
+
import { useStore } from '../../../lib/store-context';
|
|
8
|
+
import { useLoading } from '../../../lib/loading-context';
|
|
9
|
+
import { getThemeColor } from '../../../lib/utils/asset-helpers';
|
|
10
|
+
import { AlertModalProvider } from '../../../components/ui/alert-modal';
|
|
11
11
|
export function StandardLayout({ children, storeConfig }) {
|
|
12
12
|
const { cartCount } = useStore();
|
|
13
13
|
const { isBackendLoading } = useLoading();
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export declare function setAccessToken(token: string | null): void;
|
|
2
|
-
export declare function getAccessToken(): string | null;
|
|
3
1
|
export declare class ApiError extends Error {
|
|
4
2
|
message: string;
|
|
5
3
|
status?: number;
|
|
6
4
|
data?: any;
|
|
7
|
-
|
|
8
|
-
constructor(message: string, status?: number, data?: any, code?: string);
|
|
5
|
+
constructor(message: string, status?: number, data?: any);
|
|
9
6
|
}
|
|
7
|
+
export declare function setAccessToken(token: string | null): void;
|
|
8
|
+
export declare function getAccessToken(): string | null;
|
|
10
9
|
export declare const api: import("axios").AxiosInstance;
|
|
11
10
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/lib/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAS,SAAQ,KAAK;IAExB,OAAO,EAAE,MAAM;IACf,MAAM,CAAC,EAAE,MAAM;IACf,IAAI,CAAC,EAAE,GAAG;gBAFV,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,GAAG;CAKpB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAMzD;AAED,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAE9C;AA4BD,eAAO,MAAM,GAAG,+BAQd,CAAC"}
|
package/dist/lib/api.js
CHANGED
|
@@ -1,167 +1,127 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
// Customer storefront APIs (checkout, shipping, cart) live on the app backend (4002).
|
|
3
|
-
// Merchant dashboard APIs use NEXT_PUBLIC_API_URL (admin backend, 4004).
|
|
4
|
-
const API_URL = process.env.NEXT_PUBLIC_APP_BACKEND_URL ||
|
|
5
|
-
process.env.NEXT_PUBLIC_API_URL ||
|
|
6
|
-
'http://localhost:4002';
|
|
7
|
-
// In-memory access token — storefront-app stores tokens here (not localStorage).
|
|
8
|
-
// Legacy flows may still use localStorage 'token'.
|
|
9
|
-
let _accessToken = null;
|
|
10
|
-
export function setAccessToken(token) {
|
|
11
|
-
_accessToken = token;
|
|
12
|
-
}
|
|
13
|
-
export function getAccessToken() {
|
|
14
|
-
return _accessToken;
|
|
15
|
-
}
|
|
16
|
-
function resolveAuthToken() {
|
|
17
|
-
if (typeof window === 'undefined')
|
|
18
|
-
return _accessToken;
|
|
19
|
-
return _accessToken || localStorage.getItem('token');
|
|
20
|
-
}
|
|
21
2
|
export class ApiError extends Error {
|
|
22
|
-
constructor(message, status, data
|
|
3
|
+
constructor(message, status, data) {
|
|
23
4
|
super(message);
|
|
24
5
|
this.message = message;
|
|
25
6
|
this.status = status;
|
|
26
7
|
this.data = data;
|
|
27
8
|
this.name = 'ApiError';
|
|
28
|
-
this.code = code;
|
|
29
9
|
}
|
|
30
10
|
}
|
|
11
|
+
let refreshInFlight = null;
|
|
12
|
+
export function setAccessToken(token) {
|
|
13
|
+
if (typeof window === 'undefined')
|
|
14
|
+
return;
|
|
15
|
+
// Clear any legacy plaintext token leftovers; access JWT is BFF HttpOnly only.
|
|
16
|
+
localStorage.removeItem('token');
|
|
17
|
+
localStorage.removeItem('refreshToken');
|
|
18
|
+
if (!token)
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
export function getAccessToken() {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
async function refreshViaHostBff() {
|
|
25
|
+
if (typeof window === 'undefined')
|
|
26
|
+
return false;
|
|
27
|
+
if (refreshInFlight)
|
|
28
|
+
return refreshInFlight;
|
|
29
|
+
refreshInFlight = (async () => {
|
|
30
|
+
try {
|
|
31
|
+
const res = await fetch('/api/auth/refresh', {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
credentials: 'same-origin',
|
|
34
|
+
});
|
|
35
|
+
if (res.status === 401 || res.status === 403)
|
|
36
|
+
return false;
|
|
37
|
+
if (!res.ok)
|
|
38
|
+
throw new Error('refresh_unavailable');
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
refreshInFlight = null;
|
|
43
|
+
}
|
|
44
|
+
})();
|
|
45
|
+
return refreshInFlight;
|
|
46
|
+
}
|
|
47
|
+
function resolveBrowserBaseUrl() {
|
|
48
|
+
if (typeof window !== 'undefined')
|
|
49
|
+
return '/api/backend';
|
|
50
|
+
return `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4002'}/api`;
|
|
51
|
+
}
|
|
31
52
|
export const api = axios.create({
|
|
32
|
-
baseURL:
|
|
53
|
+
baseURL: resolveBrowserBaseUrl(),
|
|
54
|
+
withCredentials: true,
|
|
33
55
|
headers: {
|
|
34
56
|
'Content-Type': 'application/json',
|
|
35
|
-
// Add test mode header if in test environment
|
|
36
57
|
...(typeof window !== 'undefined' && window.__TEST_MODE__ ? { 'x-test-mode': 'true' } : {}),
|
|
37
58
|
},
|
|
38
|
-
timeout: 30000,
|
|
59
|
+
timeout: 30000,
|
|
39
60
|
});
|
|
40
|
-
// Request interceptor for auth token and session ID
|
|
41
61
|
api.interceptors.request.use((config) => {
|
|
42
62
|
if (typeof window !== 'undefined') {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
config.headers.Authorization = `Bearer ${token}`;
|
|
46
|
-
}
|
|
47
|
-
// Guest cart only: pass session via `_sid` query param. Do NOT send a
|
|
48
|
-
// custom x-session-id header — custom headers force a CORS preflight that
|
|
49
|
-
// proxies in front of the backend (e.g. nginx with a hardcoded
|
|
50
|
-
// Access-Control-Allow-Headers list) reject, breaking checkout.
|
|
63
|
+
config.baseURL = '/api/backend';
|
|
64
|
+
delete config.headers.Authorization;
|
|
51
65
|
let sessionId = sessionStorage.getItem('sessionId');
|
|
52
66
|
if (!sessionId) {
|
|
53
67
|
sessionId = `session-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
54
68
|
sessionStorage.setItem('sessionId', sessionId);
|
|
55
69
|
}
|
|
56
|
-
|
|
57
|
-
const isCartApi = urlPath === '/cart' ||
|
|
58
|
-
urlPath.startsWith('/cart/') ||
|
|
59
|
-
urlPath === 'cart' ||
|
|
60
|
-
urlPath.startsWith('cart/');
|
|
61
|
-
if (isCartApi) {
|
|
62
|
-
config.params = { _sid: sessionId, ...config.params };
|
|
63
|
-
}
|
|
64
|
-
// Add test mode header if in test environment
|
|
70
|
+
config.headers['x-session-id'] = sessionId;
|
|
65
71
|
if (window.__TEST_MODE__) {
|
|
66
72
|
config.headers['x-test-mode'] = 'true';
|
|
67
73
|
}
|
|
68
|
-
// For FormData requests, remove Content-Type header to let axios set it with boundary
|
|
69
74
|
if (config.data instanceof FormData) {
|
|
70
75
|
delete config.headers['Content-Type'];
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
return config;
|
|
74
|
-
}, (error) =>
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
// Response interceptor for error handling and token refresh
|
|
78
|
-
api.interceptors.response.use((response) => {
|
|
79
|
-
return response;
|
|
80
|
-
}, async (error) => {
|
|
79
|
+
}, (error) => Promise.reject(error));
|
|
80
|
+
api.interceptors.response.use((response) => response, async (error) => {
|
|
81
81
|
const originalRequest = error.config;
|
|
82
|
-
// Handle 429 Too Many Requests - retry with exponential backoff
|
|
83
82
|
if (error.response?.status === 429 && originalRequest) {
|
|
84
83
|
const retryCount = originalRequest._retryCount || 0;
|
|
85
84
|
const maxRetries = 3;
|
|
86
|
-
const baseDelay = 1000;
|
|
85
|
+
const baseDelay = 1000;
|
|
87
86
|
if (retryCount < maxRetries) {
|
|
88
87
|
originalRequest._retryCount = retryCount + 1;
|
|
89
|
-
originalRequest._retryDelay = baseDelay * Math.pow(2, retryCount);
|
|
90
|
-
|
|
91
|
-
await new Promise(resolve => setTimeout(resolve, originalRequest._retryDelay));
|
|
92
|
-
console.log(`[API] Retrying request after rate limit (attempt ${retryCount + 1}/${maxRetries}, delay: ${originalRequest._retryDelay}ms)`);
|
|
88
|
+
originalRequest._retryDelay = baseDelay * Math.pow(2, retryCount);
|
|
89
|
+
await new Promise((resolve) => setTimeout(resolve, originalRequest._retryDelay));
|
|
93
90
|
return api(originalRequest);
|
|
94
91
|
}
|
|
95
|
-
else {
|
|
96
|
-
console.warn('[API] Max retries reached for rate-limited request');
|
|
97
|
-
}
|
|
98
92
|
}
|
|
99
|
-
// Handle 401 Unauthorized - try to refresh token
|
|
100
93
|
if (error.response?.status === 401 && !originalRequest._retry) {
|
|
101
|
-
// Check if we're in preview mode - skip ALL auth operations to prevent session invalidation
|
|
102
94
|
const isPreview = typeof window !== 'undefined' && window.__IS_PREVIEW__;
|
|
103
95
|
if (isPreview) {
|
|
104
|
-
// In preview mode, never attempt token refresh, clear tokens, or redirect
|
|
105
|
-
// This prevents interfering with the parent window's session (storefront-admin)
|
|
106
|
-
console.warn('[API] 401 Unauthorized in preview mode - skipping all auth operations (refresh, clear, redirect)');
|
|
107
96
|
return Promise.reject(error);
|
|
108
97
|
}
|
|
109
98
|
originalRequest._retry = true;
|
|
110
99
|
try {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const refreshToken = localStorage.getItem('refreshToken');
|
|
114
|
-
if (!refreshToken && typeof window !== 'undefined') {
|
|
115
|
-
const refreshRes = await fetch('/api/auth/refresh', {
|
|
116
|
-
method: 'POST',
|
|
117
|
-
credentials: 'same-origin',
|
|
118
|
-
});
|
|
119
|
-
if (refreshRes.ok) {
|
|
120
|
-
const refreshData = await refreshRes.json();
|
|
121
|
-
newToken = refreshData.data?.token ?? null;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else if (refreshToken) {
|
|
125
|
-
const response = await axios.post(`${API_URL}/api/auth/refresh`, { refreshToken });
|
|
126
|
-
if (response.data.status === 'success' && response.data.data) {
|
|
127
|
-
newToken = response.data.data.token;
|
|
128
|
-
const newRefreshToken = response.data.data.refreshToken;
|
|
129
|
-
localStorage.setItem('token', newToken);
|
|
130
|
-
if (newRefreshToken) {
|
|
131
|
-
localStorage.setItem('refreshToken', newRefreshToken);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if (newToken) {
|
|
136
|
-
setAccessToken(newToken);
|
|
137
|
-
localStorage.setItem('token', newToken);
|
|
138
|
-
if (originalRequest.headers) {
|
|
139
|
-
originalRequest.headers.Authorization = `Bearer ${newToken}`;
|
|
140
|
-
}
|
|
100
|
+
const ok = await refreshViaHostBff();
|
|
101
|
+
if (ok) {
|
|
141
102
|
return api(originalRequest);
|
|
142
103
|
}
|
|
104
|
+
localStorage.removeItem('storefront_user');
|
|
105
|
+
localStorage.removeItem('token');
|
|
106
|
+
localStorage.removeItem('refreshToken');
|
|
107
|
+
if (typeof window !== 'undefined') {
|
|
108
|
+
window.dispatchEvent(new CustomEvent('customer-session-ended'));
|
|
109
|
+
}
|
|
110
|
+
return Promise.reject(error);
|
|
143
111
|
}
|
|
144
112
|
catch (refreshError) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
localStorage.removeItem('refreshToken');
|
|
152
|
-
localStorage.removeItem('storefront_user');
|
|
153
|
-
if (typeof window !== 'undefined') {
|
|
154
|
-
window.location.href = '/auth/login';
|
|
155
|
-
}
|
|
113
|
+
if (refreshError?.message === 'refresh_unavailable') {
|
|
114
|
+
return Promise.reject(new ApiError('Unable to refresh your session right now. Please try again.', 503));
|
|
115
|
+
}
|
|
116
|
+
localStorage.removeItem('storefront_user');
|
|
117
|
+
if (typeof window !== 'undefined') {
|
|
118
|
+
window.dispatchEvent(new CustomEvent('customer-session-ended'));
|
|
156
119
|
}
|
|
157
120
|
return Promise.reject(refreshError);
|
|
158
121
|
}
|
|
159
122
|
}
|
|
160
|
-
// Handle other errors
|
|
161
123
|
const errorMessage = error.response?.data?.message ||
|
|
162
124
|
error.message ||
|
|
163
125
|
'An error occurred';
|
|
164
|
-
|
|
165
|
-
const apiError = new ApiError(errorMessage, error.response?.status, error.response?.data?.data || error.response?.data, error.code);
|
|
166
|
-
return Promise.reject(apiError);
|
|
126
|
+
return Promise.reject(new ApiError(errorMessage, error.response?.status, error.response?.data?.data || error.response?.data));
|
|
167
127
|
});
|
package/dist/lib/auth-context.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
|
4
4
|
import { useRouter } from 'next/navigation';
|
|
5
|
-
import { authService } from './services/auth.service
|
|
6
|
-
import { customerService } from './services/customer.service
|
|
5
|
+
import { authService } from './services/auth.service';
|
|
6
|
+
import { customerService } from './services/customer.service';
|
|
7
7
|
export const AuthContext = createContext({
|
|
8
8
|
user: null,
|
|
9
9
|
isAuthenticated: false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Content selectors for different route types
|
|
3
3
|
* Used to detect when page content is ready for display
|
|
4
4
|
*/
|
|
5
|
-
export type RouteType = 'product-detail' | 'products' | 'categories' | 'category-detail' | 'generic';
|
|
5
|
+
export type RouteType = 'product-detail' | 'products' | 'categories' | 'category-detail' | 'checkout' | 'generic';
|
|
6
6
|
export interface ContentSelectorConfig {
|
|
7
7
|
selectors: string[];
|
|
8
8
|
minElements?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-selectors.d.ts","sourceRoot":"","sources":["../../src/lib/content-selectors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"content-selectors.d.ts","sourceRoot":"","sources":["../../src/lib/content-selectors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,UAAU,GACV,YAAY,GACZ,iBAAiB,GACjB,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,qBAAqB,CA8CtE,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,qBAAqB,CAE/E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CA6B3D"}
|
|
@@ -32,6 +32,11 @@ export const CONTENT_SELECTORS = {
|
|
|
32
32
|
minElements: 2, // At least 2 product cards must be visible
|
|
33
33
|
minPercentage: 50,
|
|
34
34
|
},
|
|
35
|
+
checkout: {
|
|
36
|
+
selectors: ['[data-checkout-ready]'],
|
|
37
|
+
requiredSelectors: ['[data-checkout-ready]'],
|
|
38
|
+
minElements: 1,
|
|
39
|
+
},
|
|
35
40
|
'generic': {
|
|
36
41
|
selectors: [
|
|
37
42
|
'[data-content-ready]',
|
|
@@ -70,6 +75,9 @@ export function detectRouteType(pathname) {
|
|
|
70
75
|
if (firstSegment === 'categories' && !secondSegment) {
|
|
71
76
|
return 'categories';
|
|
72
77
|
}
|
|
78
|
+
if (firstSegment === 'checkout' && !secondSegment) {
|
|
79
|
+
return 'checkout';
|
|
80
|
+
}
|
|
73
81
|
}
|
|
74
82
|
return 'generic';
|
|
75
83
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Server-safe hydration of published layout config from DB/API payloads.
|
|
3
3
|
* Merges compiledLegacyConfigJson, editorDocument section entries, and layoutConfig.sections.
|
|
4
4
|
*/
|
|
5
|
-
import { validateEditorEnvelope } from '../editor/document/validate
|
|
6
|
-
import { envelopeToStoreConfig } from '../editor/document/adapter
|
|
5
|
+
import { validateEditorEnvelope } from '../editor/document/validate';
|
|
6
|
+
import { envelopeToStoreConfig } from '../editor/document/adapter';
|
|
7
7
|
function isPlainObject(value) {
|
|
8
8
|
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-context.d.ts","sourceRoot":"","sources":["../../src/lib/loading-context.tsx"],"names":[],"mappings":"AAKA,OAAO,yBAAyB,CAAC;AAiBjC,UAAU,kBAAkB;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,gBAAgB,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,cAAc,6CAA2D,CAAC;AAEvF,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"loading-context.d.ts","sourceRoot":"","sources":["../../src/lib/loading-context.tsx"],"names":[],"mappings":"AAKA,OAAO,yBAAyB,CAAC;AAiBjC,UAAU,kBAAkB;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,gBAAgB,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,cAAc,6CAA2D,CAAC;AAEvF,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CA0M1E;AAED,wBAAgB,UAAU,uBAMzB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useState, useCallback, useEffect, useRef } from 'react';
|
|
4
|
-
import { usePathname
|
|
4
|
+
import { usePathname } from 'next/navigation';
|
|
5
5
|
import NProgress from 'nprogress';
|
|
6
6
|
import 'nprogress/nprogress.css';
|
|
7
|
-
import { PageLoader } from '../components/ui/page-loader
|
|
8
|
-
import { RouteSkeletonLoader } from '../components/ui/route-skeleton-loader
|
|
9
|
-
import { useContentReady } from '../hooks/use-content-ready
|
|
10
|
-
import { scrollToTop } from '../lib/utils/scroll-to-top.util
|
|
7
|
+
import { PageLoader } from '../components/ui/page-loader';
|
|
8
|
+
import { RouteSkeletonLoader } from '../components/ui/route-skeleton-loader';
|
|
9
|
+
import { useContentReady } from '../hooks/use-content-ready';
|
|
10
|
+
import { scrollToTop } from '../lib/utils/scroll-to-top.util';
|
|
11
11
|
// Configure NProgress
|
|
12
12
|
if (typeof window !== 'undefined') {
|
|
13
13
|
NProgress.configure({
|
|
@@ -26,15 +26,6 @@ export function LoadingProvider({ children }) {
|
|
|
26
26
|
const [targetPathname, setTargetPathname] = useState(null);
|
|
27
27
|
const [backendLoadingCount, setBackendLoadingCount] = useState(0);
|
|
28
28
|
const pathname = usePathname();
|
|
29
|
-
// Safely get searchParams - may not be available during static generation
|
|
30
|
-
let searchParams = null;
|
|
31
|
-
try {
|
|
32
|
-
searchParams = useSearchParams();
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
// useSearchParams not available (e.g., during static generation)
|
|
36
|
-
searchParams = null;
|
|
37
|
-
}
|
|
38
29
|
const loadingTimeoutRef = useRef(null);
|
|
39
30
|
const previousPathnameRef = useRef(null);
|
|
40
31
|
const skeletonTimeoutRef = useRef(null);
|
|
@@ -93,7 +84,7 @@ export function LoadingProvider({ children }) {
|
|
|
93
84
|
clearTimeout(nprogressTimeoutRef.current);
|
|
94
85
|
}
|
|
95
86
|
};
|
|
96
|
-
}, [pathname
|
|
87
|
+
}, [pathname]);
|
|
97
88
|
const setLoading = useCallback((loading) => {
|
|
98
89
|
setIsLoading(loading);
|
|
99
90
|
if (typeof window !== 'undefined') {
|
|
@@ -159,23 +150,22 @@ export function LoadingProvider({ children }) {
|
|
|
159
150
|
setBackendLoadingCount(prev => Math.max(0, prev - 1));
|
|
160
151
|
}, []);
|
|
161
152
|
const isBackendLoading = backendLoadingCount > 0;
|
|
162
|
-
// Hide skeleton when content is ready
|
|
163
|
-
//
|
|
153
|
+
// Hide skeleton when page content is ready. Do not wait for unrelated background
|
|
154
|
+
// requests (cart sync, analytics, etc.) or checkout can appear stuck on the skeleton.
|
|
164
155
|
useEffect(() => {
|
|
165
|
-
if (isPageTransitioning && isContentReady
|
|
156
|
+
if (isPageTransitioning && isContentReady) {
|
|
166
157
|
scrollToTop();
|
|
167
|
-
// Content is ready AND backend loading is complete, hide skeleton and loader together
|
|
168
158
|
if (skeletonTimeoutRef.current) {
|
|
169
159
|
clearTimeout(skeletonTimeoutRef.current);
|
|
170
160
|
}
|
|
171
161
|
setIsPageTransitioning(false);
|
|
172
|
-
setIsLoading(false);
|
|
162
|
+
setIsLoading(false);
|
|
173
163
|
setTargetPathname(null);
|
|
174
164
|
if (typeof window !== 'undefined') {
|
|
175
165
|
NProgress.done();
|
|
176
166
|
}
|
|
177
167
|
}
|
|
178
|
-
}, [isPageTransitioning, isContentReady
|
|
168
|
+
}, [isPageTransitioning, isContentReady]);
|
|
179
169
|
// Additional safety: Hide loader if page transition completes but content detection didn't trigger
|
|
180
170
|
useEffect(() => {
|
|
181
171
|
if (!isPageTransitioning && isLoading) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payaza-checkout.d.ts","sourceRoot":"","sources":["../../src/lib/payaza-checkout.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,8FAA8F;AAC9F,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,oBAAoB,CAGnF;AAED,MAAM,W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,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EAC9G,eAAe,MAAM,EACrB,WAAW,MAAM,EACjB,UAAU;IACR,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kKAAkK;IAClK,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,eAAe,CAAC,EAAE;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,KACA,oBA2GF,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Method: setup(config).showPopup()
|
|
7
7
|
*/
|
|
8
8
|
import PayazaCheckout from 'payaza-web-sdk/lib';
|
|
9
|
-
import { normalizePhoneForPayaza } from '../lib/utils/phone-format
|
|
9
|
+
import { normalizePhoneForPayaza } from '../lib/utils/phone-format';
|
|
10
10
|
/** Map backend payazaConnectionMode (or legacy environment values) to SDK connection mode. */
|
|
11
11
|
export function normalizeConnectionMode(value) {
|
|
12
12
|
if (value === 'Test' || value === 'test')
|
|
@@ -179,9 +179,7 @@ export const initiatePayazaCheckout = async (config) => {
|
|
|
179
179
|
if (!config.publicKey) {
|
|
180
180
|
throw new Error('Payment gateway not configured. Please contact support.');
|
|
181
181
|
}
|
|
182
|
-
const connectionMode = config.connectionMode
|
|
183
|
-
? normalizeConnectionMode(config.connectionMode)
|
|
184
|
-
: PayazaCheckout.LIVE_CONNECTION_MODE;
|
|
182
|
+
const connectionMode = normalizeConnectionMode(config.connectionMode);
|
|
185
183
|
console.log('[Payaza] Connection mode:', connectionMode, config.connectionMode ? '(from backend config)' : '(default Live)');
|
|
186
184
|
// Build comprehensive additional_details metadata
|
|
187
185
|
// This data will be available in Payaza webhooks and transaction responses
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CheckoutResponse } from '../lib/services/checkout.service';
|
|
2
|
+
declare const CHECKOUT_KEY_MISSING_MESSAGE = "Payment gateway not configured for this currency. Please contact support.";
|
|
3
|
+
/** Payaza public key from processCheckout — never use env/storeConfig fallback for live checkout. */
|
|
4
|
+
export declare function requireCheckoutPayazaPublicKey(checkoutResponse: Pick<CheckoutResponse, 'payazaPublicKey'>): string;
|
|
5
|
+
export { CHECKOUT_KEY_MISSING_MESSAGE };
|
|
6
|
+
//# sourceMappingURL=payaza-public-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payaza-public-key.d.ts","sourceRoot":"","sources":["../../src/lib/payaza-public-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,QAAA,MAAM,4BAA4B,8EAC2C,CAAC;AAE9E,qGAAqG;AACrG,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAC1D,MAAM,CAMR;AAED,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const CHECKOUT_KEY_MISSING_MESSAGE = 'Payment gateway not configured for this currency. Please contact support.';
|
|
2
|
+
/** Payaza public key from processCheckout — never use env/storeConfig fallback for live checkout. */
|
|
3
|
+
export function requireCheckoutPayazaPublicKey(checkoutResponse) {
|
|
4
|
+
const key = checkoutResponse.payazaPublicKey?.trim();
|
|
5
|
+
if (!key) {
|
|
6
|
+
throw new Error(CHECKOUT_KEY_MISSING_MESSAGE);
|
|
7
|
+
}
|
|
8
|
+
return key;
|
|
9
|
+
}
|
|
10
|
+
export { CHECKOUT_KEY_MISSING_MESSAGE };
|
package/dist/lib/rich-html.d.ts
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
export declare const PAYAZA_RICH_HTML_POLICY_VERSION = "1";
|
|
2
|
-
export type PayazaRichTextStored = {
|
|
3
|
-
sanitizedHtml: string;
|
|
4
|
-
policyVersion: string;
|
|
5
|
-
plainText?: string;
|
|
6
|
-
rawHtml?: string;
|
|
7
|
-
updatedAt?: string;
|
|
8
|
-
};
|
|
9
2
|
/** Normalize a typed URL before `execCommand(createLink)`. */
|
|
10
|
-
export declare function coercePayazaRichLinkHref(raw:
|
|
3
|
+
export declare function coercePayazaRichLinkHref(raw: any): any;
|
|
11
4
|
/** Allowlisted semantic markup only — no scripts, handlers, SVG, iframe, style. */
|
|
12
|
-
export declare function sanitizePayazaRichHtml(unsafe:
|
|
5
|
+
export declare function sanitizePayazaRichHtml(unsafe: any): string;
|
|
13
6
|
/** Plain text excerpt (spaces normalized). Safe for OG/search UI. */
|
|
14
|
-
export declare function plainTextFromSanitizedHtml(html:
|
|
15
|
-
export declare function wrapPlainTextAsParagraph(plain:
|
|
7
|
+
export declare function plainTextFromSanitizedHtml(html: any): string;
|
|
8
|
+
export declare function wrapPlainTextAsParagraph(plain: any): any;
|
|
16
9
|
/** Legacy string → rich object without dropping characters. */
|
|
17
|
-
export declare function migrateLegacyRichStringValue(raw:
|
|
18
|
-
|
|
10
|
+
export declare function migrateLegacyRichStringValue(raw: any): {
|
|
11
|
+
sanitizedHtml: any;
|
|
12
|
+
policyVersion: string;
|
|
13
|
+
plainText: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function normalizeStoredRichValue(val: any): any;
|
|
19
16
|
/** HTML string for storefront / preview (defense in depth). */
|
|
20
|
-
export declare function richFieldHtmlForRender(val:
|
|
17
|
+
export declare function richFieldHtmlForRender(val: any, fallbackPlain: any): any;
|
|
21
18
|
/** Commit from contenteditable innerHTML in preview (before persist). */
|
|
22
|
-
export declare function buildPayazaRichCommitFromEditorHtml(innerHtml:
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
export declare function buildPayazaRichCommitFromEditorHtml(innerHtml: any, options: any): {
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
rawHtml?: any;
|
|
22
|
+
sanitizedHtml: string;
|
|
23
|
+
policyVersion: string;
|
|
24
|
+
plainText: string;
|
|
25
|
+
};
|
|
25
26
|
/** Sidebar / textarea: user typed HTML — sanitize on blur. */
|
|
26
|
-
export declare function buildPayazaRichCommitFromSidebarInput(input:
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
export declare function buildPayazaRichCommitFromSidebarInput(input: any, options: any): {
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
rawHtml?: any;
|
|
30
|
+
sanitizedHtml: string;
|
|
31
|
+
policyVersion: string;
|
|
32
|
+
plainText: string;
|
|
33
|
+
};
|
|
29
34
|
/** Sidebar textarea seed: sanitized HTML fragment or legacy string. */
|
|
30
|
-
export declare function coerceRichSidebarEditorString(val:
|
|
31
|
-
export declare function isPayazaRichTextPayload(v:
|
|
32
|
-
export declare function richFieldHasContent(val:
|
|
33
|
-
export declare function richFieldPlainTextForDisplay(val:
|
|
35
|
+
export declare function coerceRichSidebarEditorString(val: any): any;
|
|
36
|
+
export declare function isPayazaRichTextPayload(v: any): boolean;
|
|
37
|
+
export declare function richFieldHasContent(val: any): boolean;
|
|
38
|
+
export declare function richFieldPlainTextForDisplay(val: any, fallbackPlain?: string): any;
|
|
34
39
|
/** Coerce API / legacy description values for storefront rendering. */
|
|
35
|
-
export declare function coerceRichFieldForStorefront(val:
|
|
40
|
+
export declare function coerceRichFieldForStorefront(val: any): any;
|
|
36
41
|
/** Strip rawHtml for customer-facing API responses (optional helper). */
|
|
37
|
-
export declare function toPublicRichFieldSnapshot(v:
|
|
42
|
+
export declare function toPublicRichFieldSnapshot(v: any): any;
|
|
38
43
|
//# sourceMappingURL=rich-html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-html.d.ts","sourceRoot":"","sources":["../../src/lib/rich-html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"rich-html.d.ts","sourceRoot":"","sources":["../../src/lib/rich-html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAInD,8DAA8D;AAC9D,wBAAgB,wBAAwB,CAAC,GAAG,KAAA,OAsB3C;AA6BD,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,MAAM,KAAA,UAkC5C;AACD,qEAAqE;AACrE,wBAAgB,0BAA0B,CAAC,IAAI,KAAA,UAe9C;AACD,wBAAgB,wBAAwB,CAAC,KAAK,KAAA,OAO7C;AACD,+DAA+D;AAC/D,wBAAgB,4BAA4B,CAAC,GAAG,KAAA;;;;EAgB/C;AACD,wBAAgB,wBAAwB,CAAC,GAAG,KAAA,OAkB3C;AACD,+DAA+D;AAC/D,wBAAgB,sBAAsB,CAAC,GAAG,KAAA,EAAE,aAAa,KAAA,OAKxD;AACD,yEAAyE;AACzE,wBAAgB,mCAAmC,CAAC,SAAS,KAAA,EAAE,OAAO,KAAA;;;;;;EAUrE;AACD,8DAA8D;AAC9D,wBAAgB,qCAAqC,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA;;;;;;EAEnE;AACD,uEAAuE;AACvE,wBAAgB,6BAA6B,CAAC,GAAG,KAAA,OAOhD;AACD,wBAAgB,uBAAuB,CAAC,CAAC,KAAA,WAKxC;AAmDD,wBAAgB,mBAAmB,CAAC,GAAG,KAAA,WAGtC;AACD,wBAAgB,4BAA4B,CAAC,GAAG,KAAA,EAAE,aAAa,SAAK,OAMnE;AACD,uEAAuE;AACvE,wBAAgB,4BAA4B,CAAC,GAAG,KAAA,OAO/C;AACD,yEAAyE;AACzE,wBAAgB,yBAAyB,CAAC,CAAC,KAAA,OAG1C"}
|
package/dist/lib/rich-html.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Canonical rich-text sanitization & persistence helpers (admin + storefront).
|
|
3
3
|
* Policy changes must bump PAYAZA_RICH_HTML_POLICY_VERSION for re-processing stored rows.
|
|
4
4
|
*/
|
|
5
|
+
// @ts-nocheck
|
|
5
6
|
import DOMPurify from 'isomorphic-dompurify';
|
|
6
7
|
export const PAYAZA_RICH_HTML_POLICY_VERSION = '1';
|
|
7
8
|
function escapeHtmlPlain(s) {
|