storefront-layouts-staging 1.0.0-staging.0
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/README.md +539 -0
- package/dist/components/auth/LoginForm.d.ts +9 -0
- package/dist/components/auth/LoginForm.d.ts.map +1 -0
- package/dist/components/auth/LoginForm.js +21 -0
- package/dist/components/auth/LoginSheet.d.ts +7 -0
- package/dist/components/auth/LoginSheet.d.ts.map +1 -0
- package/dist/components/auth/LoginSheet.js +8 -0
- package/dist/components/auth/login-form-core.d.ts +11 -0
- package/dist/components/auth/login-form-core.d.ts.map +1 -0
- package/dist/components/auth/login-form-core.js +19 -0
- package/dist/components/auth/login-sheet-header.d.ts +10 -0
- package/dist/components/auth/login-sheet-header.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-header.js +10 -0
- package/dist/components/auth/login-sheet-registry.d.ts +11 -0
- package/dist/components/auth/login-sheet-registry.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-registry.js +9 -0
- package/dist/components/auth/login-sheet-theme.types.d.ts +29 -0
- package/dist/components/auth/login-sheet-theme.types.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-theme.types.js +1 -0
- package/dist/components/auth/login-sheet-themes/booking-agenda.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/booking-agenda.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +21 -0
- package/dist/components/auth/login-sheet-themes/booking.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/booking.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/booking.theme.js +20 -0
- package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +20 -0
- package/dist/components/auth/login-sheet-themes/clothing.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/clothing.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/clothing.theme.js +21 -0
- package/dist/components/auth/login-sheet-themes/electronics-grid.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/electronics-grid.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +20 -0
- package/dist/components/auth/login-sheet-themes/electronics.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/electronics.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/electronics.theme.js +20 -0
- package/dist/components/auth/login-sheet-themes/food-modern.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/food-modern.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/food-modern.theme.js +22 -0
- package/dist/components/auth/login-sheet-themes/food.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/food.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/food.theme.js +22 -0
- package/dist/components/auth/login-sheet-themes/index.d.ts +14 -0
- package/dist/components/auth/login-sheet-themes/index.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/index.js +29 -0
- package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.d.ts +3 -0
- package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +20 -0
- package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts +24 -0
- package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts.map +1 -0
- package/dist/components/auth/login-sheet-themes/theme-input-baselines.js +23 -0
- package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts +13 -0
- package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts.map +1 -0
- package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +14 -0
- package/dist/components/auth/use-login-submit.d.ts +22 -0
- package/dist/components/auth/use-login-submit.d.ts.map +1 -0
- package/dist/components/auth/use-login-submit.js +99 -0
- package/dist/components/cart/InventoryHoldCountdown.d.ts +8 -0
- package/dist/components/cart/InventoryHoldCountdown.d.ts.map +1 -0
- package/dist/components/cart/InventoryHoldCountdown.js +73 -0
- package/dist/components/categories/category-masonry-grid.d.ts +18 -0
- package/dist/components/categories/category-masonry-grid.d.ts.map +1 -0
- package/dist/components/categories/category-masonry-grid.js +50 -0
- package/dist/components/categories/category-masonry-utils.d.ts +9 -0
- package/dist/components/categories/category-masonry-utils.d.ts.map +1 -0
- package/dist/components/categories/category-masonry-utils.js +67 -0
- package/dist/components/checkout/CheckoutFeeLines.d.ts +12 -0
- package/dist/components/checkout/CheckoutFeeLines.d.ts.map +1 -0
- package/dist/components/checkout/CheckoutFeeLines.js +9 -0
- package/dist/components/checkout/ShippingOptionsPanel.d.ts +54 -0
- package/dist/components/checkout/ShippingOptionsPanel.d.ts.map +1 -0
- package/dist/components/checkout/ShippingOptionsPanel.js +115 -0
- package/dist/components/learning/CertificateTemplates.d.ts +25 -0
- package/dist/components/learning/CertificateTemplates.d.ts.map +1 -0
- package/dist/components/learning/CertificateTemplates.js +31 -0
- package/dist/components/learning/CertificateViewer.d.ts +11 -0
- package/dist/components/learning/CertificateViewer.d.ts.map +1 -0
- package/dist/components/learning/CertificateViewer.js +114 -0
- package/dist/components/learning/MentorshipProgress.d.ts +18 -0
- package/dist/components/learning/MentorshipProgress.d.ts.map +1 -0
- package/dist/components/learning/MentorshipProgress.js +20 -0
- package/dist/components/product/ProductVariationSelectors.d.ts +10 -0
- package/dist/components/product/ProductVariationSelectors.d.ts.map +1 -0
- package/dist/components/product/ProductVariationSelectors.js +27 -0
- package/dist/components/rich-text/CategoryDescription.d.ts +7 -0
- package/dist/components/rich-text/CategoryDescription.d.ts.map +1 -0
- package/dist/components/rich-text/CategoryDescription.js +11 -0
- package/dist/components/rich-text/ProductDescription.d.ts +9 -0
- package/dist/components/rich-text/ProductDescription.d.ts.map +1 -0
- package/dist/components/rich-text/ProductDescription.js +10 -0
- package/dist/components/rich-text/RichTextExcerpt.d.ts +10 -0
- package/dist/components/rich-text/RichTextExcerpt.d.ts.map +1 -0
- package/dist/components/rich-text/RichTextExcerpt.js +12 -0
- package/dist/components/rich-text/SafeRichHtml.d.ts +14 -0
- package/dist/components/rich-text/SafeRichHtml.d.ts.map +1 -0
- package/dist/components/rich-text/SafeRichHtml.js +15 -0
- package/dist/components/shipping/MerchantHandledDeliveryNotice.d.ts +7 -0
- package/dist/components/shipping/MerchantHandledDeliveryNotice.d.ts.map +1 -0
- package/dist/components/shipping/MerchantHandledDeliveryNotice.js +7 -0
- package/dist/components/shipping/ProductDeliveryInfoSection.d.ts +21 -0
- package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -0
- package/dist/components/shipping/ProductDeliveryInfoSection.js +22 -0
- package/dist/components/shipping/ShippingQuoteAddressForm.d.ts +11 -0
- package/dist/components/shipping/ShippingQuoteAddressForm.d.ts.map +1 -0
- package/dist/components/shipping/ShippingQuoteAddressForm.js +66 -0
- package/dist/components/ui/address-selector.d.ts +11 -0
- package/dist/components/ui/address-selector.d.ts.map +1 -0
- package/dist/components/ui/address-selector.js +21 -0
- package/dist/components/ui/alert-modal.d.ts +21 -0
- package/dist/components/ui/alert-modal.d.ts.map +1 -0
- package/dist/components/ui/alert-modal.js +59 -0
- package/dist/components/ui/avatar-image.d.ts +11 -0
- package/dist/components/ui/avatar-image.d.ts.map +1 -0
- package/dist/components/ui/avatar-image.js +39 -0
- package/dist/components/ui/background-patterns.d.ts +27 -0
- package/dist/components/ui/background-patterns.d.ts.map +1 -0
- package/dist/components/ui/background-patterns.js +5 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +20 -0
- package/dist/components/ui/breadcrumbs.d.ts +12 -0
- package/dist/components/ui/breadcrumbs.d.ts.map +1 -0
- package/dist/components/ui/breadcrumbs.js +12 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +34 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +24 -0
- package/dist/components/ui/category-tree.d.ts +16 -0
- package/dist/components/ui/category-tree.d.ts.map +1 -0
- package/dist/components/ui/category-tree.js +74 -0
- package/dist/components/ui/checkout-button.d.ts +11 -0
- package/dist/components/ui/checkout-button.d.ts.map +1 -0
- package/dist/components/ui/checkout-button.js +298 -0
- package/dist/components/ui/dynamic-icon.d.ts +11 -0
- package/dist/components/ui/dynamic-icon.d.ts.map +1 -0
- package/dist/components/ui/dynamic-icon.js +77 -0
- package/dist/components/ui/guest-checkout-modal.d.ts +19 -0
- package/dist/components/ui/guest-checkout-modal.d.ts.map +1 -0
- package/dist/components/ui/guest-checkout-modal.js +95 -0
- package/dist/components/ui/image-skeleton.d.ts +7 -0
- package/dist/components/ui/image-skeleton.d.ts.map +1 -0
- package/dist/components/ui/image-skeleton.js +15 -0
- package/dist/components/ui/image-with-fallback.d.ts +10 -0
- package/dist/components/ui/image-with-fallback.d.ts.map +1 -0
- package/dist/components/ui/image-with-fallback.js +165 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +8 -0
- package/dist/components/ui/limited-time-offer-badge.d.ts +12 -0
- package/dist/components/ui/limited-time-offer-badge.d.ts.map +1 -0
- package/dist/components/ui/limited-time-offer-badge.js +13 -0
- package/dist/components/ui/loading-skeleton-wrapper.d.ts +6 -0
- package/dist/components/ui/loading-skeleton-wrapper.d.ts.map +1 -0
- package/dist/components/ui/loading-skeleton-wrapper.js +10 -0
- package/dist/components/ui/modal.d.ts +11 -0
- package/dist/components/ui/modal.d.ts.map +1 -0
- package/dist/components/ui/modal.js +26 -0
- package/dist/components/ui/otp-input.d.ts +10 -0
- package/dist/components/ui/otp-input.d.ts.map +1 -0
- package/dist/components/ui/otp-input.js +57 -0
- package/dist/components/ui/out-of-stock-overlay.d.ts +8 -0
- package/dist/components/ui/out-of-stock-overlay.d.ts.map +1 -0
- package/dist/components/ui/out-of-stock-overlay.js +12 -0
- package/dist/components/ui/page-animate-wrapper.d.ts +7 -0
- package/dist/components/ui/page-animate-wrapper.d.ts.map +1 -0
- package/dist/components/ui/page-animate-wrapper.js +13 -0
- package/dist/components/ui/page-content-loader.d.ts +13 -0
- package/dist/components/ui/page-content-loader.d.ts.map +1 -0
- package/dist/components/ui/page-content-loader.js +12 -0
- package/dist/components/ui/page-loader.d.ts +20 -0
- package/dist/components/ui/page-loader.d.ts.map +1 -0
- package/dist/components/ui/page-loader.js +31 -0
- package/dist/components/ui/product-card.d.ts +11 -0
- package/dist/components/ui/product-card.d.ts.map +1 -0
- package/dist/components/ui/product-card.js +124 -0
- package/dist/components/ui/product-rating.d.ts +17 -0
- package/dist/components/ui/product-rating.d.ts.map +1 -0
- package/dist/components/ui/product-rating.js +54 -0
- package/dist/components/ui/product-stock-badge.d.ts +9 -0
- package/dist/components/ui/product-stock-badge.d.ts.map +1 -0
- package/dist/components/ui/product-stock-badge.js +20 -0
- package/dist/components/ui/review-form.d.ts +9 -0
- package/dist/components/ui/review-form.d.ts.map +1 -0
- package/dist/components/ui/review-form.js +28 -0
- package/dist/components/ui/route-skeleton-loader.d.ts +7 -0
- package/dist/components/ui/route-skeleton-loader.d.ts.map +1 -0
- package/dist/components/ui/route-skeleton-loader.js +75 -0
- package/dist/components/ui/sheet.d.ts +29 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +45 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +6 -0
- package/dist/components/ui/skeletons/category-grid-skeleton.d.ts +6 -0
- package/dist/components/ui/skeletons/category-grid-skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeletons/category-grid-skeleton.js +9 -0
- package/dist/components/ui/skeletons/checkout-skeleton.d.ts +2 -0
- package/dist/components/ui/skeletons/checkout-skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeletons/checkout-skeleton.js +4 -0
- package/dist/components/ui/skeletons/index.d.ts +6 -0
- package/dist/components/ui/skeletons/index.d.ts.map +1 -0
- package/dist/components/ui/skeletons/index.js +5 -0
- package/dist/components/ui/skeletons/page-skeleton.d.ts +2 -0
- package/dist/components/ui/skeletons/page-skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeletons/page-skeleton.js +4 -0
- package/dist/components/ui/skeletons/product-card-skeleton.d.ts +2 -0
- package/dist/components/ui/skeletons/product-card-skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeletons/product-card-skeleton.js +4 -0
- package/dist/components/ui/skeletons/product-detail-skeleton.d.ts +2 -0
- package/dist/components/ui/skeletons/product-detail-skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeletons/product-detail-skeleton.js +4 -0
- package/dist/components/ui/skeletons/product-grid-skeleton.d.ts +7 -0
- package/dist/components/ui/skeletons/product-grid-skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeletons/product-grid-skeleton.js +12 -0
- package/dist/components/ui/store-logos.d.ts +43 -0
- package/dist/components/ui/store-logos.d.ts.map +1 -0
- package/dist/components/ui/store-logos.js +83 -0
- package/dist/components/ui/toast.d.ts +20 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +33 -0
- package/dist/components/ui/video-player.d.ts +48 -0
- package/dist/components/ui/video-player.d.ts.map +1 -0
- package/dist/components/ui/video-player.js +101 -0
- package/dist/editor/alignment-schemas/booking-agenda.d.ts +3 -0
- package/dist/editor/alignment-schemas/booking-agenda.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/booking-agenda.js +145 -0
- package/dist/editor/alignment-schemas/booking-footer-section.d.ts +4 -0
- package/dist/editor/alignment-schemas/booking-footer-section.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/booking-footer-section.js +69 -0
- package/dist/editor/alignment-schemas/booking.d.ts +3 -0
- package/dist/editor/alignment-schemas/booking.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/booking.js +476 -0
- package/dist/editor/alignment-schemas/clothing-minimal.d.ts +3 -0
- package/dist/editor/alignment-schemas/clothing-minimal.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/clothing-minimal.js +363 -0
- package/dist/editor/alignment-schemas/clothing.d.ts +3 -0
- package/dist/editor/alignment-schemas/clothing.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/clothing.js +477 -0
- package/dist/editor/alignment-schemas/electronics-grid.d.ts +3 -0
- package/dist/editor/alignment-schemas/electronics-grid.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/electronics-grid.js +97 -0
- package/dist/editor/alignment-schemas/electronics.d.ts +3 -0
- package/dist/editor/alignment-schemas/electronics.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/electronics.js +145 -0
- package/dist/editor/alignment-schemas/food-modern.d.ts +3 -0
- package/dist/editor/alignment-schemas/food-modern.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/food-modern.js +237 -0
- package/dist/editor/alignment-schemas/food.d.ts +3 -0
- package/dist/editor/alignment-schemas/food.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/food.js +494 -0
- package/dist/editor/alignment-schemas/index.d.ts +15 -0
- package/dist/editor/alignment-schemas/index.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/index.js +50 -0
- package/dist/editor/alignment-schemas/lazy-loader.d.ts +14 -0
- package/dist/editor/alignment-schemas/lazy-loader.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/lazy-loader.js +80 -0
- package/dist/editor/alignment-schemas/metadata.d.ts +25 -0
- package/dist/editor/alignment-schemas/metadata.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/metadata.js +225 -0
- package/dist/editor/alignment-schemas/motivational-speaker.d.ts +3 -0
- package/dist/editor/alignment-schemas/motivational-speaker.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/motivational-speaker.js +185 -0
- package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.d.ts +18 -0
- package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +166 -0
- package/dist/editor/alignment-schemas/resolve-field.d.ts +9 -0
- package/dist/editor/alignment-schemas/resolve-field.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/resolve-field.js +56 -0
- package/dist/editor/alignment-schemas/types.d.ts +53 -0
- package/dist/editor/alignment-schemas/types.d.ts.map +1 -0
- package/dist/editor/alignment-schemas/types.js +1 -0
- package/dist/editor/blocks/defaults/clothing-minimal-home.d.ts +9 -0
- package/dist/editor/blocks/defaults/clothing-minimal-home.d.ts.map +1 -0
- package/dist/editor/blocks/defaults/clothing-minimal-home.js +207 -0
- package/dist/editor/blocks/index.d.ts +4 -0
- package/dist/editor/blocks/index.d.ts.map +1 -0
- package/dist/editor/blocks/index.js +3 -0
- package/dist/editor/blocks/migrate-clothing-minimal.d.ts +5 -0
- package/dist/editor/blocks/migrate-clothing-minimal.d.ts.map +1 -0
- package/dist/editor/blocks/migrate-clothing-minimal.js +140 -0
- package/dist/editor/blocks/nav-outline-utils.d.ts +47 -0
- package/dist/editor/blocks/nav-outline-utils.d.ts.map +1 -0
- package/dist/editor/blocks/nav-outline-utils.js +201 -0
- package/dist/editor/blocks/registry.d.ts +19 -0
- package/dist/editor/blocks/registry.d.ts.map +1 -0
- package/dist/editor/blocks/registry.js +118 -0
- package/dist/editor/blocks/types.d.ts +14 -0
- package/dist/editor/blocks/types.d.ts.map +1 -0
- package/dist/editor/blocks/types.js +14 -0
- package/dist/editor/document/adapter.d.ts +44 -0
- package/dist/editor/document/adapter.d.ts.map +1 -0
- package/dist/editor/document/adapter.js +159 -0
- package/dist/editor/document/block-tree.d.ts +46 -0
- package/dist/editor/document/block-tree.d.ts.map +1 -0
- package/dist/editor/document/block-tree.js +345 -0
- package/dist/editor/document/constants.d.ts +6 -0
- package/dist/editor/document/constants.d.ts.map +1 -0
- package/dist/editor/document/constants.js +14 -0
- package/dist/editor/document/index.d.ts +7 -0
- package/dist/editor/document/index.d.ts.map +1 -0
- package/dist/editor/document/index.js +6 -0
- package/dist/editor/document/layout-id.d.ts +3 -0
- package/dist/editor/document/layout-id.d.ts.map +1 -0
- package/dist/editor/document/layout-id.js +17 -0
- package/dist/editor/document/types.d.ts +91 -0
- package/dist/editor/document/types.d.ts.map +1 -0
- package/dist/editor/document/types.js +1 -0
- package/dist/editor/document/validate.d.ts +11 -0
- package/dist/editor/document/validate.d.ts.map +1 -0
- package/dist/editor/document/validate.js +92 -0
- package/dist/editor/feature-flags.d.ts +11 -0
- package/dist/editor/feature-flags.d.ts.map +1 -0
- package/dist/editor/feature-flags.js +19 -0
- package/dist/editor/index.d.ts +28 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +72 -0
- package/dist/editor/layout-content-loader.d.ts +13 -0
- package/dist/editor/layout-content-loader.d.ts.map +1 -0
- package/dist/editor/layout-content-loader.js +222 -0
- package/dist/editor/payaza-form/ActiveArrayFocusContext.d.ts +20 -0
- package/dist/editor/payaza-form/ActiveArrayFocusContext.d.ts.map +1 -0
- package/dist/editor/payaza-form/ActiveArrayFocusContext.js +31 -0
- package/dist/editor/payaza-form/ArrayItemManager.d.ts +19 -0
- package/dist/editor/payaza-form/ArrayItemManager.d.ts.map +1 -0
- package/dist/editor/payaza-form/ArrayItemManager.js +62 -0
- package/dist/editor/payaza-form/AssetSelectionContext.d.ts +17 -0
- package/dist/editor/payaza-form/AssetSelectionContext.d.ts.map +1 -0
- package/dist/editor/payaza-form/AssetSelectionContext.js +81 -0
- package/dist/editor/payaza-form/EditorCanvasPreview.d.ts +41 -0
- package/dist/editor/payaza-form/EditorCanvasPreview.d.ts.map +1 -0
- package/dist/editor/payaza-form/EditorCanvasPreview.js +56 -0
- package/dist/editor/payaza-form/EditorLayoutContext.d.ts +8 -0
- package/dist/editor/payaza-form/EditorLayoutContext.d.ts.map +1 -0
- package/dist/editor/payaza-form/EditorLayoutContext.js +6 -0
- package/dist/editor/payaza-form/FieldRenderer.d.ts +16 -0
- package/dist/editor/payaza-form/FieldRenderer.d.ts.map +1 -0
- package/dist/editor/payaza-form/FieldRenderer.js +192 -0
- package/dist/editor/payaza-form/IframePreviewMessageBridge.d.ts +29 -0
- package/dist/editor/payaza-form/IframePreviewMessageBridge.d.ts.map +1 -0
- package/dist/editor/payaza-form/IframePreviewMessageBridge.js +46 -0
- package/dist/editor/payaza-form/PayazaFormEditor.d.ts +12 -0
- package/dist/editor/payaza-form/PayazaFormEditor.d.ts.map +1 -0
- package/dist/editor/payaza-form/PayazaFormEditor.js +1226 -0
- package/dist/editor/payaza-form/PayazaFormEditorFullPage.d.ts +9 -0
- package/dist/editor/payaza-form/PayazaFormEditorFullPage.d.ts.map +1 -0
- package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +6 -0
- package/dist/editor/payaza-form/SliderArrayEditor.d.ts +17 -0
- package/dist/editor/payaza-form/SliderArrayEditor.d.ts.map +1 -0
- package/dist/editor/payaza-form/SliderArrayEditor.js +96 -0
- package/dist/editor/payaza-form/components/ArrayField.d.ts +21 -0
- package/dist/editor/payaza-form/components/ArrayField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/ArrayField.js +18 -0
- package/dist/editor/payaza-form/components/BlockStylesInspector.d.ts +9 -0
- package/dist/editor/payaza-form/components/BlockStylesInspector.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/BlockStylesInspector.js +150 -0
- package/dist/editor/payaza-form/components/BlocksField.d.ts +17 -0
- package/dist/editor/payaza-form/components/BlocksField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/BlocksField.js +108 -0
- package/dist/editor/payaza-form/components/ButtonField.d.ts +15 -0
- package/dist/editor/payaza-form/components/ButtonField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/ButtonField.js +17 -0
- package/dist/editor/payaza-form/components/CanvasGranularInspector.d.ts +16 -0
- package/dist/editor/payaza-form/components/CanvasGranularInspector.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/CanvasGranularInspector.js +32 -0
- package/dist/editor/payaza-form/components/FieldDensityContext.d.ts +10 -0
- package/dist/editor/payaza-form/components/FieldDensityContext.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/FieldDensityContext.js +13 -0
- package/dist/editor/payaza-form/components/IconField.d.ts +12 -0
- package/dist/editor/payaza-form/components/IconField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/IconField.js +42 -0
- package/dist/editor/payaza-form/components/ImageField.d.ts +10 -0
- package/dist/editor/payaza-form/components/ImageField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/ImageField.js +30 -0
- package/dist/editor/payaza-form/components/NumberField.d.ts +14 -0
- package/dist/editor/payaza-form/components/NumberField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/NumberField.js +23 -0
- package/dist/editor/payaza-form/components/ObjectField.d.ts +11 -0
- package/dist/editor/payaza-form/components/ObjectField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/ObjectField.js +7 -0
- package/dist/editor/payaza-form/components/RichTextField.d.ts +15 -0
- package/dist/editor/payaza-form/components/RichTextField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/RichTextField.js +88 -0
- package/dist/editor/payaza-form/components/SectionField.d.ts +14 -0
- package/dist/editor/payaza-form/components/SectionField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/SectionField.js +8 -0
- package/dist/editor/payaza-form/components/SectionSchemaInspector.d.ts +18 -0
- package/dist/editor/payaza-form/components/SectionSchemaInspector.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/SectionSchemaInspector.js +64 -0
- package/dist/editor/payaza-form/components/SegmentedControlField.d.ts +13 -0
- package/dist/editor/payaza-form/components/SegmentedControlField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/SegmentedControlField.js +7 -0
- package/dist/editor/payaza-form/components/StarRatingField.d.ts +13 -0
- package/dist/editor/payaza-form/components/StarRatingField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/StarRatingField.js +16 -0
- package/dist/editor/payaza-form/components/TextField.d.ts +13 -0
- package/dist/editor/payaza-form/components/TextField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/TextField.js +12 -0
- package/dist/editor/payaza-form/components/TextareaField.d.ts +11 -0
- package/dist/editor/payaza-form/components/TextareaField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/TextareaField.js +6 -0
- package/dist/editor/payaza-form/components/ToggleField.d.ts +12 -0
- package/dist/editor/payaza-form/components/ToggleField.d.ts.map +1 -0
- package/dist/editor/payaza-form/components/ToggleField.js +15 -0
- package/dist/editor/payaza-form/data-merger.d.ts +28 -0
- package/dist/editor/payaza-form/data-merger.d.ts.map +1 -0
- package/dist/editor/payaza-form/data-merger.js +878 -0
- package/dist/editor/payaza-form/data-transformer.d.ts +28 -0
- package/dist/editor/payaza-form/data-transformer.d.ts.map +1 -0
- package/dist/editor/payaza-form/data-transformer.js +304 -0
- package/dist/editor/payaza-form/engine.d.ts +72 -0
- package/dist/editor/payaza-form/engine.d.ts.map +1 -0
- package/dist/editor/payaza-form/engine.js +140 -0
- package/dist/editor/payaza-form/examples/custom-widgets.example.d.ts +8 -0
- package/dist/editor/payaza-form/examples/custom-widgets.example.d.ts.map +1 -0
- package/dist/editor/payaza-form/examples/custom-widgets.example.js +51 -0
- package/dist/editor/payaza-form/field-renderer-ref.d.ts +4 -0
- package/dist/editor/payaza-form/field-renderer-ref.d.ts.map +1 -0
- package/dist/editor/payaza-form/field-renderer-ref.js +16 -0
- package/dist/editor/payaza-form/index.d.ts +11 -0
- package/dist/editor/payaza-form/index.d.ts.map +1 -0
- package/dist/editor/payaza-form/index.js +8 -0
- package/dist/editor/payaza-form/layout-loader.d.ts +12 -0
- package/dist/editor/payaza-form/layout-loader.d.ts.map +1 -0
- package/dist/editor/payaza-form/layout-loader.js +43 -0
- package/dist/editor/payaza-form/payaza-style-sanitize.d.ts +14 -0
- package/dist/editor/payaza-form/payaza-style-sanitize.d.ts.map +1 -0
- package/dist/editor/payaza-form/payaza-style-sanitize.js +76 -0
- package/dist/editor/payaza-form/preview-message-handler.d.ts +18 -0
- package/dist/editor/payaza-form/preview-message-handler.d.ts.map +1 -0
- package/dist/editor/payaza-form/preview-message-handler.js +89 -0
- package/dist/editor/payaza-form/schema-bridge.d.ts +12 -0
- package/dist/editor/payaza-form/schema-bridge.d.ts.map +1 -0
- package/dist/editor/payaza-form/schema-bridge.js +90 -0
- package/dist/editor/payaza-form/widget-registry.d.ts +94 -0
- package/dist/editor/payaza-form/widget-registry.d.ts.map +1 -0
- package/dist/editor/payaza-form/widget-registry.js +107 -0
- package/dist/editor/shared/AIGenerateModal.d.ts +17 -0
- package/dist/editor/shared/AIGenerateModal.d.ts.map +1 -0
- package/dist/editor/shared/AIGenerateModal.js +59 -0
- package/dist/editor/shared/BlockOutlineTree.d.ts +14 -0
- package/dist/editor/shared/BlockOutlineTree.d.ts.map +1 -0
- package/dist/editor/shared/BlockOutlineTree.js +47 -0
- package/dist/editor/shared/EditorHeader.d.ts +61 -0
- package/dist/editor/shared/EditorHeader.d.ts.map +1 -0
- package/dist/editor/shared/EditorHeader.js +181 -0
- package/dist/editor/shared/EditorNavigator.d.ts +42 -0
- package/dist/editor/shared/EditorNavigator.d.ts.map +1 -0
- package/dist/editor/shared/EditorNavigator.js +44 -0
- package/dist/editor/shared/IframePreview.d.ts +36 -0
- package/dist/editor/shared/IframePreview.d.ts.map +1 -0
- package/dist/editor/shared/IframePreview.js +217 -0
- package/dist/editor/shared/InlineCanvasPreview.d.ts +36 -0
- package/dist/editor/shared/InlineCanvasPreview.d.ts.map +1 -0
- package/dist/editor/shared/InlineCanvasPreview.js +174 -0
- package/dist/editor/shared/LayoutRenderer.d.ts +11 -0
- package/dist/editor/shared/LayoutRenderer.d.ts.map +1 -0
- package/dist/editor/shared/LayoutRenderer.js +7 -0
- package/dist/editor/shared/PageTabs.d.ts +13 -0
- package/dist/editor/shared/PageTabs.d.ts.map +1 -0
- package/dist/editor/shared/PageTabs.js +6 -0
- package/dist/editor/shared/ResizableSidebar.d.ts +14 -0
- package/dist/editor/shared/ResizableSidebar.d.ts.map +1 -0
- package/dist/editor/shared/ResizableSidebar.js +45 -0
- package/dist/editor/shared/index.d.ts +8 -0
- package/dist/editor/shared/index.d.ts.map +1 -0
- package/dist/editor/shared/index.js +7 -0
- package/dist/editor/shared/preview-viewport.d.ts +9 -0
- package/dist/editor/shared/preview-viewport.d.ts.map +1 -0
- package/dist/editor/shared/preview-viewport.js +17 -0
- package/dist/editor/shared/useEditorChromeMetrics.d.ts +15 -0
- package/dist/editor/shared/useEditorChromeMetrics.d.ts.map +1 -0
- package/dist/editor/shared/useEditorChromeMetrics.js +52 -0
- package/dist/editor/types.d.ts +162 -0
- package/dist/editor/types.d.ts.map +1 -0
- package/dist/editor/types.js +1 -0
- package/dist/hooks/use-analytics.d.ts +15 -0
- package/dist/hooks/use-analytics.d.ts.map +1 -0
- package/dist/hooks/use-analytics.js +62 -0
- package/dist/hooks/use-api.d.ts +17 -0
- package/dist/hooks/use-api.d.ts.map +1 -0
- package/dist/hooks/use-api.js +53 -0
- package/dist/hooks/use-cart-api.d.ts +28 -0
- package/dist/hooks/use-cart-api.d.ts.map +1 -0
- package/dist/hooks/use-cart-api.js +116 -0
- package/dist/hooks/use-catalog-loader.d.ts +19 -0
- package/dist/hooks/use-catalog-loader.d.ts.map +1 -0
- package/dist/hooks/use-catalog-loader.js +107 -0
- package/dist/hooks/use-catalog-price-range.d.ts +17 -0
- package/dist/hooks/use-catalog-price-range.d.ts.map +1 -0
- package/dist/hooks/use-catalog-price-range.js +26 -0
- package/dist/hooks/use-checkout-fees.d.ts +16 -0
- package/dist/hooks/use-checkout-fees.d.ts.map +1 -0
- package/dist/hooks/use-checkout-fees.js +105 -0
- package/dist/hooks/use-content-ready.d.ts +17 -0
- package/dist/hooks/use-content-ready.d.ts.map +1 -0
- package/dist/hooks/use-content-ready.js +197 -0
- package/dist/hooks/use-debounce.d.ts +6 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-debounce.js +17 -0
- package/dist/hooks/use-multi-store-checkout-fees.d.ts +25 -0
- package/dist/hooks/use-multi-store-checkout-fees.d.ts.map +1 -0
- package/dist/hooks/use-multi-store-checkout-fees.js +116 -0
- package/dist/hooks/use-navigation-loading.d.ts +4 -0
- package/dist/hooks/use-navigation-loading.d.ts.map +1 -0
- package/dist/hooks/use-navigation-loading.js +14 -0
- package/dist/hooks/use-payaza-checkout.d.ts +15 -0
- package/dist/hooks/use-payaza-checkout.d.ts.map +1 -0
- package/dist/hooks/use-payaza-checkout.js +123 -0
- package/dist/hooks/use-product-variation-selection.d.ts +26 -0
- package/dist/hooks/use-product-variation-selection.d.ts.map +1 -0
- package/dist/hooks/use-product-variation-selection.js +26 -0
- package/dist/hooks/use-products-api.d.ts +19 -0
- package/dist/hooks/use-products-api.d.ts.map +1 -0
- package/dist/hooks/use-products-api.js +84 -0
- package/dist/hooks/use-shipping-quote.d.ts +25 -0
- package/dist/hooks/use-shipping-quote.d.ts.map +1 -0
- package/dist/hooks/use-shipping-quote.js +80 -0
- package/dist/hooks/use-store-api.d.ts +12 -0
- package/dist/hooks/use-store-api.d.ts.map +1 -0
- package/dist/hooks/use-store-api.js +73 -0
- package/dist/hooks/usePreviewSlideSync.d.ts +5 -0
- package/dist/hooks/usePreviewSlideSync.d.ts.map +1 -0
- package/dist/hooks/usePreviewSlideSync.js +28 -0
- package/dist/index.d.ts +150 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +164 -0
- package/dist/json/booking-agenda.json +166 -0
- package/dist/json/booking.json +224 -0
- package/dist/json/clothing-minimal.json +203 -0
- package/dist/json/clothing.json +418 -0
- package/dist/json/electronics-grid.json +246 -0
- package/dist/json/electronics.json +303 -0
- package/dist/json/food-modern.json +191 -0
- package/dist/json/food.json +283 -0
- package/dist/json/json-map.d.ts +7 -0
- package/dist/json/json-map.d.ts.map +1 -0
- package/dist/json/json-map.js +36 -0
- package/dist/json/motivational-speaker.json +361 -0
- package/dist/layouts/booking/components/BookingHomePage.d.ts +7 -0
- package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -0
- package/dist/layouts/booking/components/BookingHomePage.js +107 -0
- package/dist/layouts/booking/components/BookingMultilineHeading.d.ts +20 -0
- package/dist/layouts/booking/components/BookingMultilineHeading.d.ts.map +1 -0
- package/dist/layouts/booking/components/BookingMultilineHeading.js +32 -0
- package/dist/layouts/booking/components/BookingTestimonialCard.d.ts +10 -0
- package/dist/layouts/booking/components/BookingTestimonialCard.d.ts.map +1 -0
- package/dist/layouts/booking/components/BookingTestimonialCard.js +11 -0
- package/dist/layouts/booking/components/BookingTestimonialsEmptyState.d.ts +9 -0
- package/dist/layouts/booking/components/BookingTestimonialsEmptyState.d.ts.map +1 -0
- package/dist/layouts/booking/components/BookingTestimonialsEmptyState.js +19 -0
- package/dist/layouts/booking/components/booking-about-defaults.d.ts +26 -0
- package/dist/layouts/booking/components/booking-about-defaults.d.ts.map +1 -0
- package/dist/layouts/booking/components/booking-about-defaults.js +99 -0
- package/dist/layouts/booking/components/booking-footer-defaults.d.ts +19 -0
- package/dist/layouts/booking/components/booking-footer-defaults.d.ts.map +1 -0
- package/dist/layouts/booking/components/booking-footer-defaults.js +52 -0
- package/dist/layouts/booking/components/booking-testimonial-defaults.d.ts +21 -0
- package/dist/layouts/booking/components/booking-testimonial-defaults.d.ts.map +1 -0
- package/dist/layouts/booking/components/booking-testimonial-defaults.js +112 -0
- package/dist/layouts/booking/index.d.ts +9 -0
- package/dist/layouts/booking/index.d.ts.map +1 -0
- package/dist/layouts/booking/index.js +9 -0
- package/dist/layouts/booking/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/AboutPage.js +69 -0
- package/dist/layouts/booking/pages/BookPage.d.ts +8 -0
- package/dist/layouts/booking/pages/BookPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/BookPage.js +482 -0
- package/dist/layouts/booking/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/booking/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/CategoriesPage.js +30 -0
- package/dist/layouts/booking/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/CategoryPage.js +51 -0
- package/dist/layouts/booking/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/booking/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/ContactPage.js +59 -0
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/ProductDetailPage.js +433 -0
- package/dist/layouts/booking/pages/ServicesPage.d.ts +9 -0
- package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -0
- package/dist/layouts/booking/pages/ServicesPage.js +54 -0
- package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts +7 -0
- package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +283 -0
- package/dist/layouts/booking-agenda/index.d.ts +9 -0
- package/dist/layouts/booking-agenda/index.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/index.js +9 -0
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/AboutPage.js +51 -0
- package/dist/layouts/booking-agenda/pages/BookPage.d.ts +8 -0
- package/dist/layouts/booking-agenda/pages/BookPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/BookPage.js +468 -0
- package/dist/layouts/booking-agenda/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/booking-agenda/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/CategoriesPage.js +23 -0
- package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/CategoryPage.js +48 -0
- package/dist/layouts/booking-agenda/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/booking-agenda/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/ContactPage.js +57 -0
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +433 -0
- package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts +9 -0
- package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -0
- package/dist/layouts/booking-agenda/pages/ServicesPage.js +46 -0
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts +7 -0
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -0
- package/dist/layouts/clothing/components/ClothingHomePage.js +260 -0
- package/dist/layouts/clothing/index.d.ts +8 -0
- package/dist/layouts/clothing/index.d.ts.map +1 -0
- package/dist/layouts/clothing/index.js +8 -0
- package/dist/layouts/clothing/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/clothing/pages/AboutPage.js +55 -0
- package/dist/layouts/clothing/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/clothing/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/clothing/pages/CategoriesPage.js +34 -0
- package/dist/layouts/clothing/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/clothing/pages/CategoryPage.js +77 -0
- package/dist/layouts/clothing/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/clothing/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/clothing/pages/ContactPage.js +58 -0
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/clothing/pages/ProductDetailPage.js +393 -0
- package/dist/layouts/clothing/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/clothing/pages/ProductsPage.js +268 -0
- package/dist/layouts/clothing/payaza-bindings.d.ts +23 -0
- package/dist/layouts/clothing/payaza-bindings.d.ts.map +1 -0
- package/dist/layouts/clothing/payaza-bindings.js +17 -0
- package/dist/layouts/clothing/styles/clothing.css +80 -0
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts +7 -0
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +163 -0
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts +40 -0
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +180 -0
- package/dist/layouts/clothing-minimal/index.d.ts +8 -0
- package/dist/layouts/clothing-minimal/index.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/index.js +8 -0
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/pages/AboutPage.js +71 -0
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +35 -0
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/pages/CategoryPage.js +56 -0
- package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/pages/ContactPage.js +53 -0
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +432 -0
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/clothing-minimal/pages/ProductsPage.js +274 -0
- package/dist/layouts/electronics/components/ElectronicsCategoriesPage.d.ts +7 -0
- package/dist/layouts/electronics/components/ElectronicsCategoriesPage.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +40 -0
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts +10 -0
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +107 -0
- package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts +7 -0
- package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsHomePage.js +96 -0
- package/dist/layouts/electronics/components/ElectronicsPageWrapper.d.ts +8 -0
- package/dist/layouts/electronics/components/ElectronicsPageWrapper.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +10 -0
- package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts +7 -0
- package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsProductsPage.js +99 -0
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts +7 -0
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +11 -0
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.d.ts +7 -0
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.d.ts.map +1 -0
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +39 -0
- package/dist/layouts/electronics/index.d.ts +19 -0
- package/dist/layouts/electronics/index.d.ts.map +1 -0
- package/dist/layouts/electronics/index.js +19 -0
- package/dist/layouts/electronics/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/AboutPage.js +51 -0
- package/dist/layouts/electronics/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/CategoriesPage.js +6 -0
- package/dist/layouts/electronics/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/CategoryPage.js +55 -0
- package/dist/layouts/electronics/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/ContactPage.js +57 -0
- package/dist/layouts/electronics/pages/HelpCenterPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/HelpCenterPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/HelpCenterPage.js +55 -0
- package/dist/layouts/electronics/pages/PrivacyPolicyPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/PrivacyPolicyPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/PrivacyPolicyPage.js +9 -0
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/ProductDetailPage.js +430 -0
- package/dist/layouts/electronics/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/ProductsPage.js +273 -0
- package/dist/layouts/electronics/pages/ShippingReturnsPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/ShippingReturnsPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/ShippingReturnsPage.js +7 -0
- package/dist/layouts/electronics/pages/TermsPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/TermsPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/TermsPage.js +9 -0
- package/dist/layouts/electronics/pages/TrackOrderPage.d.ts +7 -0
- package/dist/layouts/electronics/pages/TrackOrderPage.d.ts.map +1 -0
- package/dist/layouts/electronics/pages/TrackOrderPage.js +376 -0
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts +10 -0
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +107 -0
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts +7 -0
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +111 -0
- package/dist/layouts/electronics-grid/index.d.ts +15 -0
- package/dist/layouts/electronics-grid/index.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/index.js +15 -0
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/AboutPage.js +51 -0
- package/dist/layouts/electronics-grid/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/CategoriesPage.js +6 -0
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/CategoryPage.js +55 -0
- package/dist/layouts/electronics-grid/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/ContactPage.js +57 -0
- package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.js +26 -0
- package/dist/layouts/electronics-grid/pages/HelpCenterPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/HelpCenterPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/HelpCenterPage.js +55 -0
- package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.js +9 -0
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +430 -0
- package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/ProductsPage.js +273 -0
- package/dist/layouts/electronics-grid/pages/ShippingReturnsPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/ShippingReturnsPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/ShippingReturnsPage.js +7 -0
- package/dist/layouts/electronics-grid/pages/TermsPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/TermsPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/TermsPage.js +9 -0
- package/dist/layouts/electronics-grid/pages/TrackOrderPage.d.ts +7 -0
- package/dist/layouts/electronics-grid/pages/TrackOrderPage.d.ts.map +1 -0
- package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +376 -0
- package/dist/layouts/food/components/FoodHomePage.d.ts +7 -0
- package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -0
- package/dist/layouts/food/components/FoodHomePage.js +387 -0
- package/dist/layouts/food/index.d.ts +9 -0
- package/dist/layouts/food/index.d.ts.map +1 -0
- package/dist/layouts/food/index.js +9 -0
- package/dist/layouts/food/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/AboutPage.js +67 -0
- package/dist/layouts/food/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/food/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/CategoriesPage.js +26 -0
- package/dist/layouts/food/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/CategoryPage.js +65 -0
- package/dist/layouts/food/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/food/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/ContactPage.js +55 -0
- package/dist/layouts/food/pages/MenuPage.d.ts +8 -0
- package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/MenuPage.js +107 -0
- package/dist/layouts/food/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/ProductDetailPage.js +485 -0
- package/dist/layouts/food/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/food/pages/ProductsPage.js +174 -0
- package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts +7 -0
- package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts.map +1 -0
- package/dist/layouts/food-modern/components/FoodHomePageModern.js +101 -0
- package/dist/layouts/food-modern/index.d.ts +9 -0
- package/dist/layouts/food-modern/index.d.ts.map +1 -0
- package/dist/layouts/food-modern/index.js +9 -0
- package/dist/layouts/food-modern/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/AboutPage.js +52 -0
- package/dist/layouts/food-modern/pages/CategoriesPage.d.ts +7 -0
- package/dist/layouts/food-modern/pages/CategoriesPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/CategoriesPage.js +23 -0
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/CategoryPage.js +64 -0
- package/dist/layouts/food-modern/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/food-modern/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/ContactPage.js +55 -0
- package/dist/layouts/food-modern/pages/MenuPage.d.ts +8 -0
- package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/MenuPage.js +110 -0
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts +8 -0
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/ProductDetailPage.js +427 -0
- package/dist/layouts/food-modern/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/food-modern/pages/ProductsPage.js +175 -0
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts +7 -0
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +131 -0
- package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.d.ts +3 -0
- package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +7 -0
- package/dist/layouts/motivational-speaker/index.d.ts +10 -0
- package/dist/layouts/motivational-speaker/index.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/index.js +10 -0
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts +7 -0
- package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/AboutPage.js +51 -0
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +8 -0
- package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/CategoryPage.js +72 -0
- package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts +7 -0
- package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/ContactPage.js +57 -0
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts +7 -0
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/ProductsPage.js +273 -0
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts +8 -0
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +153 -0
- package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts +9 -0
- package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/ServicesPage.js +46 -0
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts +7 -0
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts.map +1 -0
- package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +137 -0
- package/dist/layouts/shared/components/BaseStoreLayout.d.ts +8 -0
- package/dist/layouts/shared/components/BaseStoreLayout.d.ts.map +1 -0
- package/dist/layouts/shared/components/BaseStoreLayout.js +49 -0
- package/dist/layouts/shared/components/CartLineQuantityControl.d.ts +12 -0
- package/dist/layouts/shared/components/CartLineQuantityControl.d.ts.map +1 -0
- package/dist/layouts/shared/components/CartLineQuantityControl.js +99 -0
- package/dist/layouts/shared/components/GenericPageWrapper.d.ts +8 -0
- package/dist/layouts/shared/components/GenericPageWrapper.d.ts.map +1 -0
- package/dist/layouts/shared/components/GenericPageWrapper.js +24 -0
- package/dist/layouts/shared/components/PromoBanner.d.ts +12 -0
- package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -0
- package/dist/layouts/shared/components/PromoBanner.js +17 -0
- package/dist/layouts/shared/components/StoreFooter.d.ts +7 -0
- package/dist/layouts/shared/components/StoreFooter.d.ts.map +1 -0
- package/dist/layouts/shared/components/StoreFooter.js +156 -0
- package/dist/layouts/shared/components/StoreHeader.d.ts +8 -0
- package/dist/layouts/shared/components/StoreHeader.d.ts.map +1 -0
- package/dist/layouts/shared/components/StoreHeader.js +111 -0
- package/dist/layouts/shared/components/TestimonialCard.d.ts +8 -0
- package/dist/layouts/shared/components/TestimonialCard.d.ts.map +1 -0
- package/dist/layouts/shared/components/TestimonialCard.js +10 -0
- package/dist/layouts/shared/components/headers/BookingAgendaSidebar.d.ts +8 -0
- package/dist/layouts/shared/components/headers/BookingAgendaSidebar.d.ts.map +1 -0
- package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +16 -0
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.d.ts +7 -0
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.d.ts.map +1 -0
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +38 -0
- package/dist/layouts/shared/components/headers/FoodModernHeader.d.ts +7 -0
- package/dist/layouts/shared/components/headers/FoodModernHeader.d.ts.map +1 -0
- package/dist/layouts/shared/components/headers/FoodModernHeader.js +61 -0
- package/dist/layouts/shared/index.d.ts +23 -0
- package/dist/layouts/shared/index.d.ts.map +1 -0
- package/dist/layouts/shared/index.js +23 -0
- package/dist/layouts/shared/pages/AccountPage.d.ts +7 -0
- package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/AccountPage.js +549 -0
- package/dist/layouts/shared/pages/CartPage.d.ts +7 -0
- package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/CartPage.js +121 -0
- package/dist/layouts/shared/pages/CheckoutPage.d.ts +7 -0
- package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/CheckoutPage.js +1430 -0
- package/dist/layouts/shared/pages/CookiePolicyPage.d.ts +7 -0
- package/dist/layouts/shared/pages/CookiePolicyPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/CookiePolicyPage.js +9 -0
- package/dist/layouts/shared/pages/FeatureDisabledPage.d.ts +9 -0
- package/dist/layouts/shared/pages/FeatureDisabledPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/FeatureDisabledPage.js +8 -0
- package/dist/layouts/shared/pages/HelpCenterPage.d.ts +7 -0
- package/dist/layouts/shared/pages/HelpCenterPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/HelpCenterPage.js +55 -0
- package/dist/layouts/shared/pages/MaintenancePage.d.ts +7 -0
- package/dist/layouts/shared/pages/MaintenancePage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/MaintenancePage.js +10 -0
- package/dist/layouts/shared/pages/PortfolioPage.d.ts +7 -0
- package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/PortfolioPage.js +130 -0
- package/dist/layouts/shared/pages/PrivacyPolicyPage.d.ts +7 -0
- package/dist/layouts/shared/pages/PrivacyPolicyPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/PrivacyPolicyPage.js +9 -0
- package/dist/layouts/shared/pages/ShippingReturnsPage.d.ts +7 -0
- package/dist/layouts/shared/pages/ShippingReturnsPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/ShippingReturnsPage.js +7 -0
- package/dist/layouts/shared/pages/SizeGuidePage.d.ts +7 -0
- package/dist/layouts/shared/pages/SizeGuidePage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/SizeGuidePage.js +10 -0
- package/dist/layouts/shared/pages/StyleGuidePage.d.ts +7 -0
- package/dist/layouts/shared/pages/StyleGuidePage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/StyleGuidePage.js +126 -0
- package/dist/layouts/shared/pages/TeamPage.d.ts +7 -0
- package/dist/layouts/shared/pages/TeamPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/TeamPage.js +39 -0
- package/dist/layouts/shared/pages/TermsPage.d.ts +7 -0
- package/dist/layouts/shared/pages/TermsPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/TermsPage.js +9 -0
- package/dist/layouts/shared/pages/TrackOrderPage.d.ts +7 -0
- package/dist/layouts/shared/pages/TrackOrderPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/TrackOrderPage.js +379 -0
- package/dist/layouts/shared/pages/WishlistPage.d.ts +7 -0
- package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -0
- package/dist/layouts/shared/pages/WishlistPage.js +144 -0
- package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts +14 -0
- package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +152 -0
- package/dist/layouts/shared/wrappers/ClothingLayout.d.ts +10 -0
- package/dist/layouts/shared/wrappers/ClothingLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/ClothingLayout.js +44 -0
- package/dist/layouts/shared/wrappers/ClothingMinimalLayout.d.ts +8 -0
- package/dist/layouts/shared/wrappers/ClothingMinimalLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +48 -0
- package/dist/layouts/shared/wrappers/ElectronicsLayout.d.ts +8 -0
- package/dist/layouts/shared/wrappers/ElectronicsLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/ElectronicsLayout.js +40 -0
- package/dist/layouts/shared/wrappers/FoodModernLayout.d.ts +8 -0
- package/dist/layouts/shared/wrappers/FoodModernLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/FoodModernLayout.js +48 -0
- package/dist/layouts/shared/wrappers/MotivationalLayout.d.ts +8 -0
- package/dist/layouts/shared/wrappers/MotivationalLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/MotivationalLayout.js +51 -0
- package/dist/layouts/shared/wrappers/StandardLayout.d.ts +8 -0
- package/dist/layouts/shared/wrappers/StandardLayout.d.ts.map +1 -0
- package/dist/layouts/shared/wrappers/StandardLayout.js +45 -0
- package/dist/lib/alignment-schemas.d.ts +51 -0
- package/dist/lib/alignment-schemas.d.ts.map +1 -0
- package/dist/lib/alignment-schemas.js +637 -0
- package/dist/lib/api.d.ts +11 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +167 -0
- package/dist/lib/auth-context.d.ts +49 -0
- package/dist/lib/auth-context.d.ts.map +1 -0
- package/dist/lib/auth-context.js +296 -0
- package/dist/lib/checkout-availability.d.ts +10 -0
- package/dist/lib/checkout-availability.d.ts.map +1 -0
- package/dist/lib/checkout-availability.js +16 -0
- package/dist/lib/compact-array-items.d.ts +7 -0
- package/dist/lib/compact-array-items.d.ts.map +1 -0
- package/dist/lib/compact-array-items.js +13 -0
- package/dist/lib/content-selectors.d.ts +21 -0
- package/dist/lib/content-selectors.d.ts.map +1 -0
- package/dist/lib/content-selectors.js +75 -0
- package/dist/lib/countries.d.ts +13 -0
- package/dist/lib/countries.d.ts.map +1 -0
- package/dist/lib/countries.js +292 -0
- package/dist/lib/currency-symbols.d.ts +36 -0
- package/dist/lib/currency-symbols.d.ts.map +1 -0
- package/dist/lib/currency-symbols.js +153 -0
- package/dist/lib/guest-user.d.ts +27 -0
- package/dist/lib/guest-user.d.ts.map +1 -0
- package/dist/lib/guest-user.js +71 -0
- package/dist/lib/inventory-utils.d.ts +41 -0
- package/dist/lib/inventory-utils.d.ts.map +1 -0
- package/dist/lib/inventory-utils.js +180 -0
- package/dist/lib/layout-badges.d.ts +4 -0
- package/dist/lib/layout-badges.d.ts.map +1 -0
- package/dist/lib/layout-badges.js +5 -0
- package/dist/lib/layout-config-hydration.d.ts +25 -0
- package/dist/lib/layout-config-hydration.d.ts.map +1 -0
- package/dist/lib/layout-config-hydration.js +264 -0
- package/dist/lib/layout-field-normalize.d.ts +18 -0
- package/dist/lib/layout-field-normalize.d.ts.map +1 -0
- package/dist/lib/layout-field-normalize.js +190 -0
- package/dist/lib/layout-route-utils.d.ts +30 -0
- package/dist/lib/layout-route-utils.d.ts.map +1 -0
- package/dist/lib/layout-route-utils.js +79 -0
- package/dist/lib/limited-time-offer.d.ts +6 -0
- package/dist/lib/limited-time-offer.d.ts.map +1 -0
- package/dist/lib/limited-time-offer.js +24 -0
- package/dist/lib/loading-context.d.ts +20 -0
- package/dist/lib/loading-context.d.ts.map +1 -0
- package/dist/lib/loading-context.js +212 -0
- package/dist/lib/mock-stores.d.ts +24 -0
- package/dist/lib/mock-stores.d.ts.map +1 -0
- package/dist/lib/mock-stores.js +2106 -0
- package/dist/lib/order-success-cart.d.ts +5 -0
- package/dist/lib/order-success-cart.d.ts.map +1 -0
- package/dist/lib/order-success-cart.js +50 -0
- package/dist/lib/payaza-checkout.d.ts +147 -0
- package/dist/lib/payaza-checkout.d.ts.map +1 -0
- package/dist/lib/payaza-checkout.js +717 -0
- package/dist/lib/payaza-section-styles.d.ts +16 -0
- package/dist/lib/payaza-section-styles.d.ts.map +1 -0
- package/dist/lib/payaza-section-styles.js +93 -0
- package/dist/lib/preview-data.d.ts +58 -0
- package/dist/lib/preview-data.d.ts.map +1 -0
- package/dist/lib/preview-data.js +2576 -0
- package/dist/lib/product-variation-utils.d.ts +8 -0
- package/dist/lib/product-variation-utils.d.ts.map +1 -0
- package/dist/lib/product-variation-utils.js +101 -0
- package/dist/lib/rich-html.d.ts +38 -0
- package/dist/lib/rich-html.d.ts.map +1 -0
- package/dist/lib/rich-html.js +272 -0
- package/dist/lib/services/analytics.service.d.ts +59 -0
- package/dist/lib/services/analytics.service.d.ts.map +1 -0
- package/dist/lib/services/analytics.service.js +382 -0
- package/dist/lib/services/auth.service.d.ts +63 -0
- package/dist/lib/services/auth.service.d.ts.map +1 -0
- package/dist/lib/services/auth.service.js +101 -0
- package/dist/lib/services/booking.service.d.ts +53 -0
- package/dist/lib/services/booking.service.d.ts.map +1 -0
- package/dist/lib/services/booking.service.js +52 -0
- package/dist/lib/services/category.service.d.ts +21 -0
- package/dist/lib/services/category.service.d.ts.map +1 -0
- package/dist/lib/services/category.service.js +41 -0
- package/dist/lib/services/checkout.service.d.ts +168 -0
- package/dist/lib/services/checkout.service.d.ts.map +1 -0
- package/dist/lib/services/checkout.service.js +48 -0
- package/dist/lib/services/contact.service.d.ts +26 -0
- package/dist/lib/services/contact.service.d.ts.map +1 -0
- package/dist/lib/services/contact.service.js +23 -0
- package/dist/lib/services/customer.service.d.ts +54 -0
- package/dist/lib/services/customer.service.d.ts.map +1 -0
- package/dist/lib/services/customer.service.js +64 -0
- package/dist/lib/services/fees.service.d.ts +85 -0
- package/dist/lib/services/fees.service.d.ts.map +1 -0
- package/dist/lib/services/fees.service.js +147 -0
- package/dist/lib/services/index.d.ts +19 -0
- package/dist/lib/services/index.d.ts.map +1 -0
- package/dist/lib/services/index.js +18 -0
- package/dist/lib/services/location.service.d.ts +31 -0
- package/dist/lib/services/location.service.d.ts.map +1 -0
- package/dist/lib/services/location.service.js +25 -0
- package/dist/lib/services/order.service.d.ts +5 -0
- package/dist/lib/services/order.service.d.ts.map +1 -0
- package/dist/lib/services/order.service.js +12 -0
- package/dist/lib/services/payment.service.d.ts +56 -0
- package/dist/lib/services/payment.service.d.ts.map +1 -0
- package/dist/lib/services/payment.service.js +122 -0
- package/dist/lib/services/product.service.d.ts +92 -0
- package/dist/lib/services/product.service.d.ts.map +1 -0
- package/dist/lib/services/product.service.js +86 -0
- package/dist/lib/services/promo.service.d.ts +31 -0
- package/dist/lib/services/promo.service.d.ts.map +1 -0
- package/dist/lib/services/promo.service.js +29 -0
- package/dist/lib/services/review.service.d.ts +47 -0
- package/dist/lib/services/review.service.d.ts.map +1 -0
- package/dist/lib/services/review.service.js +54 -0
- package/dist/lib/services/service.service.d.ts +55 -0
- package/dist/lib/services/service.service.d.ts.map +1 -0
- package/dist/lib/services/service.service.js +37 -0
- package/dist/lib/services/shipping.service.d.ts +62 -0
- package/dist/lib/services/shipping.service.d.ts.map +1 -0
- package/dist/lib/services/shipping.service.js +39 -0
- package/dist/lib/services/store.service.d.ts +89 -0
- package/dist/lib/services/store.service.d.ts.map +1 -0
- package/dist/lib/services/store.service.js +41 -0
- package/dist/lib/shipping-address.util.d.ts +76 -0
- package/dist/lib/shipping-address.util.d.ts.map +1 -0
- package/dist/lib/shipping-address.util.js +149 -0
- package/dist/lib/shipping-settings.util.d.ts +4 -0
- package/dist/lib/shipping-settings.util.d.ts.map +1 -0
- package/dist/lib/shipping-settings.util.js +6 -0
- package/dist/lib/store-config-utils.d.ts +50 -0
- package/dist/lib/store-config-utils.d.ts.map +1 -0
- package/dist/lib/store-config-utils.js +1713 -0
- package/dist/lib/store-config.d.ts +4 -0
- package/dist/lib/store-config.d.ts.map +1 -0
- package/dist/lib/store-config.js +4 -0
- package/dist/lib/store-context.d.ts +69 -0
- package/dist/lib/store-context.d.ts.map +1 -0
- package/dist/lib/store-context.js +456 -0
- package/dist/lib/store-types.d.ts +921 -0
- package/dist/lib/store-types.d.ts.map +1 -0
- package/dist/lib/store-types.js +1 -0
- package/dist/lib/template-pages.d.ts +8 -0
- package/dist/lib/template-pages.d.ts.map +1 -0
- package/dist/lib/template-pages.js +62 -0
- package/dist/lib/utils/asset-helpers.d.ts +111 -0
- package/dist/lib/utils/asset-helpers.d.ts.map +1 -0
- package/dist/lib/utils/asset-helpers.js +462 -0
- package/dist/lib/utils/catalog-price-bounds.d.ts +13 -0
- package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -0
- package/dist/lib/utils/catalog-price-bounds.js +24 -0
- package/dist/lib/utils/category-tree.d.ts +25 -0
- package/dist/lib/utils/category-tree.d.ts.map +1 -0
- package/dist/lib/utils/category-tree.js +85 -0
- package/dist/lib/utils/demo-detection.d.ts +23 -0
- package/dist/lib/utils/demo-detection.d.ts.map +1 -0
- package/dist/lib/utils/demo-detection.js +36 -0
- package/dist/lib/utils/editor-preview.d.ts +42 -0
- package/dist/lib/utils/editor-preview.d.ts.map +1 -0
- package/dist/lib/utils/editor-preview.js +214 -0
- package/dist/lib/utils/fee-calculations.d.ts +35 -0
- package/dist/lib/utils/fee-calculations.d.ts.map +1 -0
- package/dist/lib/utils/fee-calculations.js +81 -0
- package/dist/lib/utils/footer-nav-defaults.d.ts +11 -0
- package/dist/lib/utils/footer-nav-defaults.d.ts.map +1 -0
- package/dist/lib/utils/footer-nav-defaults.js +67 -0
- package/dist/lib/utils/idempotency-key.d.ts +15 -0
- package/dist/lib/utils/idempotency-key.d.ts.map +1 -0
- package/dist/lib/utils/idempotency-key.js +22 -0
- package/dist/lib/utils/index.d.ts +45 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/index.js +197 -0
- package/dist/lib/utils/mobile-editor.d.ts +13 -0
- package/dist/lib/utils/mobile-editor.d.ts.map +1 -0
- package/dist/lib/utils/mobile-editor.js +34 -0
- package/dist/lib/utils/phone-format.d.ts +6 -0
- package/dist/lib/utils/phone-format.d.ts.map +1 -0
- package/dist/lib/utils/phone-format.js +17 -0
- package/dist/lib/utils/product-catalog.d.ts +11 -0
- package/dist/lib/utils/product-catalog.d.ts.map +1 -0
- package/dist/lib/utils/product-catalog.js +40 -0
- package/dist/lib/utils/product-images.d.ts +20 -0
- package/dist/lib/utils/product-images.d.ts.map +1 -0
- package/dist/lib/utils/product-images.js +31 -0
- package/dist/lib/utils/product-share.d.ts +17 -0
- package/dist/lib/utils/product-share.d.ts.map +1 -0
- package/dist/lib/utils/product-share.js +48 -0
- package/dist/lib/utils/scroll-to-top.util.d.ts +9 -0
- package/dist/lib/utils/scroll-to-top.util.d.ts.map +1 -0
- package/dist/lib/utils/scroll-to-top.util.js +18 -0
- package/dist/lib/utils/url-helpers.d.ts +30 -0
- package/dist/lib/utils/url-helpers.d.ts.map +1 -0
- package/dist/lib/utils/url-helpers.js +61 -0
- package/dist/lib/utils/video-helpers.d.ts +32 -0
- package/dist/lib/utils/video-helpers.d.ts.map +1 -0
- package/dist/lib/utils/video-helpers.js +210 -0
- package/dist/preview/LayoutPreview.d.ts +14 -0
- package/dist/preview/LayoutPreview.d.ts.map +1 -0
- package/dist/preview/LayoutPreview.js +122 -0
- package/dist/preview/PreviewRouter.d.ts +9 -0
- package/dist/preview/PreviewRouter.d.ts.map +1 -0
- package/dist/preview/PreviewRouter.js +332 -0
- package/dist/preview/ShadowDOMWrapper.d.ts +18 -0
- package/dist/preview/ShadowDOMWrapper.d.ts.map +1 -0
- package/dist/preview/ShadowDOMWrapper.js +80 -0
- package/dist/preview/canvas/PreviewBlockToolbar.d.ts +23 -0
- package/dist/preview/canvas/PreviewBlockToolbar.d.ts.map +1 -0
- package/dist/preview/canvas/PreviewBlockToolbar.js +113 -0
- package/dist/preview/canvas/PreviewCanvasEnhancer.d.ts +17 -0
- package/dist/preview/canvas/PreviewCanvasEnhancer.d.ts.map +1 -0
- package/dist/preview/canvas/PreviewCanvasEnhancer.js +741 -0
- package/dist/preview/canvas/PreviewCanvasStyles.d.ts +4 -0
- package/dist/preview/canvas/PreviewCanvasStyles.d.ts.map +1 -0
- package/dist/preview/canvas/PreviewCanvasStyles.js +51 -0
- package/dist/preview/canvas/extract-editable-plain-text.d.ts +11 -0
- package/dist/preview/canvas/extract-editable-plain-text.d.ts.map +1 -0
- package/dist/preview/canvas/extract-editable-plain-text.js +65 -0
- package/dist/preview/canvas/field-key.d.ts +34 -0
- package/dist/preview/canvas/field-key.d.ts.map +1 -0
- package/dist/preview/canvas/field-key.js +62 -0
- package/dist/preview/canvas/preview-editable-commit.util.d.ts +3 -0
- package/dist/preview/canvas/preview-editable-commit.util.d.ts.map +1 -0
- package/dist/preview/canvas/preview-editable-commit.util.js +11 -0
- package/dist/preview/canvas/preview-flush-await.d.ts +6 -0
- package/dist/preview/canvas/preview-flush-await.d.ts.map +1 -0
- package/dist/preview/canvas/preview-flush-await.js +23 -0
- package/dist/preview/canvas/preview-flush-handle.d.ts +13 -0
- package/dist/preview/canvas/preview-flush-handle.d.ts.map +1 -0
- package/dist/preview/canvas/preview-flush-handle.js +3 -0
- package/dist/preview/canvas/preview-isolation.d.ts +9 -0
- package/dist/preview/canvas/preview-isolation.d.ts.map +1 -0
- package/dist/preview/canvas/preview-isolation.js +10 -0
- package/dist/preview/canvas/preview-messages.d.ts +65 -0
- package/dist/preview/canvas/preview-messages.d.ts.map +1 -0
- package/dist/preview/canvas/preview-messages.js +17 -0
- package/dist/preview/canvas/preview-route.d.ts +4 -0
- package/dist/preview/canvas/preview-route.d.ts.map +1 -0
- package/dist/preview/canvas/preview-route.js +76 -0
- package/dist/preview/index.d.ts +13 -0
- package/dist/preview/index.d.ts.map +1 -0
- package/dist/preview/index.js +12 -0
- package/dist/preview/route-audit.d.ts +17 -0
- package/dist/preview/route-audit.d.ts.map +1 -0
- package/dist/preview/route-audit.js +54 -0
- package/dist/styles/index.css +10598 -0
- package/dist/utils/date.d.ts +20 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +47 -0
- package/package.json +192 -0
|
@@ -0,0 +1,1713 @@
|
|
|
1
|
+
import { getStoreConfig } from './store-config.js';
|
|
2
|
+
import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection.js';
|
|
3
|
+
import { storeService } from './services/store.service.js';
|
|
4
|
+
import { categoryService } from './services/category.service.js';
|
|
5
|
+
import { productService } from './services/product.service.js';
|
|
6
|
+
import { serviceService } from './services/service.service.js';
|
|
7
|
+
import { coerceRichFieldForStorefront } from './rich-html.js';
|
|
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';
|
|
13
|
+
// Simple ID generator fallback (doesn't require uuid package)
|
|
14
|
+
function generateId() {
|
|
15
|
+
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
16
|
+
return crypto.randomUUID();
|
|
17
|
+
}
|
|
18
|
+
// Fallback for environments without crypto.randomUUID
|
|
19
|
+
return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Comprehensive function to extract and validate image URLs from any format
|
|
23
|
+
* Handles: strings, objects, arrays, JSON-encoded, comma-separated, fragmented JSON
|
|
24
|
+
* @param input - Can be string, object, array, or any combination
|
|
25
|
+
* @returns Array of valid absolute image URLs
|
|
26
|
+
*/
|
|
27
|
+
export function extractImageUrls(input) {
|
|
28
|
+
if (!input) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
// Handle arrays
|
|
32
|
+
if (Array.isArray(input)) {
|
|
33
|
+
if (input.length === 0) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
// Check if array contains objects with url property
|
|
37
|
+
const firstItem = input[0];
|
|
38
|
+
if (firstItem && typeof firstItem === 'object' && firstItem !== null && 'url' in firstItem) {
|
|
39
|
+
// Array of objects: [{url: "...", isPrimary: true}, ...]
|
|
40
|
+
return input
|
|
41
|
+
.map((item) => extractImageUrls(item)) // Recursively extract from each object
|
|
42
|
+
.flat()
|
|
43
|
+
.filter((url) => url.length > 0);
|
|
44
|
+
}
|
|
45
|
+
// Check if array contains fragmented JSON strings (TypeORM simple-array issue)
|
|
46
|
+
if (typeof firstItem === 'string' && firstItem.trim().startsWith('[') && firstItem.includes('"url"')) {
|
|
47
|
+
try {
|
|
48
|
+
// Reconstruct fragmented JSON
|
|
49
|
+
const reconstructedJson = input.join('');
|
|
50
|
+
const parsed = JSON.parse(reconstructedJson);
|
|
51
|
+
return extractImageUrls(parsed); // Recursively process parsed result
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// If reconstruction fails, treat as string array
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Array of strings: ["url1", "url2", ...]
|
|
58
|
+
return input
|
|
59
|
+
.map((item) => extractImageUrls(item)) // Recursively extract from each item
|
|
60
|
+
.flat()
|
|
61
|
+
.filter((url) => url.length > 0);
|
|
62
|
+
}
|
|
63
|
+
// Handle objects
|
|
64
|
+
if (typeof input === 'object' && input !== null) {
|
|
65
|
+
// Object with url property: {url: "...", isPrimary: true}
|
|
66
|
+
if ('url' in input && typeof input.url === 'string') {
|
|
67
|
+
const url = validateAndConvertUrl(input.url);
|
|
68
|
+
return url ? [url] : [];
|
|
69
|
+
}
|
|
70
|
+
// Stringified object: '{"url":"..."}'
|
|
71
|
+
if (typeof input === 'object' && Object.keys(input).length === 0) {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
// Try to find url in nested structure
|
|
75
|
+
for (const key of ['url', 'image', 'src', 'imageUrl', 'image_url']) {
|
|
76
|
+
if (key in input && typeof input[key] === 'string') {
|
|
77
|
+
const url = validateAndConvertUrl(input[key]);
|
|
78
|
+
if (url)
|
|
79
|
+
return [url];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
// Handle strings
|
|
85
|
+
if (typeof input === 'string') {
|
|
86
|
+
const trimmed = input.trim();
|
|
87
|
+
if (trimmed.length === 0) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
// Check if it's JSON-encoded
|
|
91
|
+
if ((trimmed.startsWith('[') || trimmed.startsWith('{')) && (trimmed.includes('"url"') || trimmed.includes('"image"'))) {
|
|
92
|
+
try {
|
|
93
|
+
const parsed = JSON.parse(trimmed);
|
|
94
|
+
return extractImageUrls(parsed); // Recursively process parsed result
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Not valid JSON, continue as string
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Check if it's comma-separated URLs
|
|
101
|
+
if (trimmed.includes(',') && (trimmed.includes('http://') || trimmed.includes('https://') || trimmed.includes('r2.dev'))) {
|
|
102
|
+
return trimmed
|
|
103
|
+
.split(',')
|
|
104
|
+
.map((s) => s.trim())
|
|
105
|
+
.map((url) => validateAndConvertUrl(url))
|
|
106
|
+
.filter((url) => url.length > 0);
|
|
107
|
+
}
|
|
108
|
+
// Single URL string
|
|
109
|
+
const url = validateAndConvertUrl(trimmed);
|
|
110
|
+
return url ? [url] : [];
|
|
111
|
+
}
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validates a URL string (CDN URLs from Cloudflare Object Storage are used as-is)
|
|
116
|
+
* @param url - URL string to validate
|
|
117
|
+
* @returns Valid URL string or empty string
|
|
118
|
+
*/
|
|
119
|
+
function validateAndConvertUrl(url) {
|
|
120
|
+
if (!url || typeof url !== 'string') {
|
|
121
|
+
return '';
|
|
122
|
+
}
|
|
123
|
+
const trimmed = url.trim();
|
|
124
|
+
if (trimmed.length === 0) {
|
|
125
|
+
return '';
|
|
126
|
+
}
|
|
127
|
+
// URLs from Cloudflare Object Storage (CDN) are already absolute - use as-is
|
|
128
|
+
// Only validate that it's a non-empty string
|
|
129
|
+
return trimmed;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Validates a single image URL string
|
|
133
|
+
* @param url - URL to validate
|
|
134
|
+
* @returns Valid URL string or empty string
|
|
135
|
+
*/
|
|
136
|
+
function validateImageUrl(url) {
|
|
137
|
+
if (!url) {
|
|
138
|
+
return '';
|
|
139
|
+
}
|
|
140
|
+
// Handle string URLs
|
|
141
|
+
if (typeof url === 'string') {
|
|
142
|
+
const trimmed = url.trim();
|
|
143
|
+
return trimmed.length > 0 ? trimmed : '';
|
|
144
|
+
}
|
|
145
|
+
// Handle number (convert to string)
|
|
146
|
+
if (typeof url === 'number') {
|
|
147
|
+
return String(url).trim();
|
|
148
|
+
}
|
|
149
|
+
// Handle object with url property (nested structures)
|
|
150
|
+
if (typeof url === 'object' && url !== null) {
|
|
151
|
+
// Try common URL property names
|
|
152
|
+
for (const key of ['url', 'src', 'image', 'imageUrl', 'image_url', 'value']) {
|
|
153
|
+
if (key in url && url[key]) {
|
|
154
|
+
const extracted = validateImageUrl(url[key]);
|
|
155
|
+
if (extracted)
|
|
156
|
+
return extracted;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return '';
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Product-specific image extraction function
|
|
164
|
+
* Comprehensive function that handles all image storage formats
|
|
165
|
+
* URLs are used as-is from CDN (Cloudflare Object Storage)
|
|
166
|
+
* @param images - Can be:
|
|
167
|
+
* - Array of objects: [{url: string}, ...] or [{url: {url: string}}, ...]
|
|
168
|
+
* - Array of strings: ["url1", "url2"]
|
|
169
|
+
* - Single object: {url: string}
|
|
170
|
+
* - Single string: "url"
|
|
171
|
+
* - JSON string: '{"url":"..."}' or '[{"url":"..."}]'
|
|
172
|
+
* - null/undefined
|
|
173
|
+
* @returns Array of valid URL strings
|
|
174
|
+
*/
|
|
175
|
+
function extractProductImageUrls(images) {
|
|
176
|
+
// Handle null/undefined
|
|
177
|
+
if (!images) {
|
|
178
|
+
return [];
|
|
179
|
+
}
|
|
180
|
+
// Handle JSON strings (parsed or unparsed)
|
|
181
|
+
if (typeof images === 'string') {
|
|
182
|
+
const trimmed = images.trim();
|
|
183
|
+
if (trimmed.length === 0) {
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
// Try to parse as JSON (handles both single and double-stringified)
|
|
187
|
+
if ((trimmed.startsWith('[') || trimmed.startsWith('{') || trimmed.startsWith('"')) && (trimmed.includes('"url"') || trimmed.includes('"image"'))) {
|
|
188
|
+
try {
|
|
189
|
+
let parsed = JSON.parse(trimmed);
|
|
190
|
+
// Check if result is still a string (double-stringified)
|
|
191
|
+
if (typeof parsed === 'string') {
|
|
192
|
+
try {
|
|
193
|
+
parsed = JSON.parse(parsed);
|
|
194
|
+
}
|
|
195
|
+
catch (e) {
|
|
196
|
+
// Not double-stringified, continue as string URL
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// Recursively process the parsed result
|
|
200
|
+
return extractProductImageUrls(parsed);
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
// Not valid JSON, continue as string URL
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// Check if it's comma-separated URLs
|
|
207
|
+
if (trimmed.includes(',') && (trimmed.includes('http://') || trimmed.includes('https://') || trimmed.includes('r2.dev') || trimmed.includes('pub-'))) {
|
|
208
|
+
return trimmed
|
|
209
|
+
.split(',')
|
|
210
|
+
.map((url) => validateImageUrl(url))
|
|
211
|
+
.filter((url) => url.length > 0);
|
|
212
|
+
}
|
|
213
|
+
// Single URL string
|
|
214
|
+
const url = validateImageUrl(trimmed);
|
|
215
|
+
return url ? [url] : [];
|
|
216
|
+
}
|
|
217
|
+
// Handle arrays - this is the most common case
|
|
218
|
+
if (Array.isArray(images)) {
|
|
219
|
+
if (images.length === 0) {
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
const firstItem = images[0];
|
|
223
|
+
// Case 1: Array of objects with url property: [{url: "...", isPrimary: true}, ...]
|
|
224
|
+
// This is what backend normalizeProductImages returns
|
|
225
|
+
// Also handles nested: [{url: {url: "..."}}]
|
|
226
|
+
if (firstItem && typeof firstItem === 'object' && firstItem !== null) {
|
|
227
|
+
const result = [];
|
|
228
|
+
for (const item of images) {
|
|
229
|
+
if (!item)
|
|
230
|
+
continue;
|
|
231
|
+
// Handle object items
|
|
232
|
+
if (typeof item === 'object' && item !== null) {
|
|
233
|
+
// Check for direct url property
|
|
234
|
+
if ('url' in item) {
|
|
235
|
+
const url = validateImageUrl(item.url);
|
|
236
|
+
if (url) {
|
|
237
|
+
result.push(url);
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Check for other common property names
|
|
242
|
+
for (const key of ['src', 'image', 'imageUrl', 'image_url', 'value']) {
|
|
243
|
+
if (key in item) {
|
|
244
|
+
const url = validateImageUrl(item[key]);
|
|
245
|
+
if (url) {
|
|
246
|
+
result.push(url);
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// Handle string items in mixed arrays
|
|
253
|
+
else if (typeof item === 'string') {
|
|
254
|
+
const url = validateImageUrl(item);
|
|
255
|
+
if (url) {
|
|
256
|
+
result.push(url);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (result.length > 0) {
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// Case 2: Array of string URLs: ["url1", "url2", ...]
|
|
265
|
+
if (typeof firstItem === 'string') {
|
|
266
|
+
return images
|
|
267
|
+
.map((item) => validateImageUrl(item))
|
|
268
|
+
.filter((url) => url.length > 0);
|
|
269
|
+
}
|
|
270
|
+
// Case 3: Array of mixed types - try to extract from each
|
|
271
|
+
const result = [];
|
|
272
|
+
for (const item of images) {
|
|
273
|
+
const url = validateImageUrl(item);
|
|
274
|
+
if (url) {
|
|
275
|
+
result.push(url);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return result;
|
|
279
|
+
}
|
|
280
|
+
// Handle single object with url property
|
|
281
|
+
if (typeof images === 'object' && images !== null && !Array.isArray(images)) {
|
|
282
|
+
// Check for direct url property
|
|
283
|
+
if ('url' in images) {
|
|
284
|
+
const url = validateImageUrl(images.url);
|
|
285
|
+
if (url) {
|
|
286
|
+
return [url];
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// Check for other common property names
|
|
290
|
+
for (const key of ['src', 'image', 'imageUrl', 'image_url', 'value']) {
|
|
291
|
+
if (key in images) {
|
|
292
|
+
const url = validateImageUrl(images[key]);
|
|
293
|
+
if (url) {
|
|
294
|
+
return [url];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return [];
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Converts a relative URL to an absolute URL using the API base URL
|
|
303
|
+
* @param url - The URL to convert (can be relative like /uploads/... or already absolute)
|
|
304
|
+
* @returns Absolute URL string
|
|
305
|
+
* @deprecated Use validateAndConvertUrl instead for better validation
|
|
306
|
+
*/
|
|
307
|
+
function convertToAbsoluteUrl(url) {
|
|
308
|
+
return validateAndConvertUrl(url);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Valid StoreLayoutType values
|
|
312
|
+
*/
|
|
313
|
+
const VALID_LAYOUTS = [
|
|
314
|
+
'food',
|
|
315
|
+
'food-modern',
|
|
316
|
+
'clothing',
|
|
317
|
+
'clothing-minimal',
|
|
318
|
+
'booking',
|
|
319
|
+
'booking-agenda',
|
|
320
|
+
'electronics',
|
|
321
|
+
'electronics-grid',
|
|
322
|
+
];
|
|
323
|
+
/**
|
|
324
|
+
* Maps API layout string to StoreLayoutType
|
|
325
|
+
* Falls back to 'food' if layout is invalid or missing
|
|
326
|
+
*/
|
|
327
|
+
function mapLayoutToStoreLayoutType(layout) {
|
|
328
|
+
if (!layout) {
|
|
329
|
+
return 'food'; // Default fallback
|
|
330
|
+
}
|
|
331
|
+
// Check if layout is a valid StoreLayoutType
|
|
332
|
+
if (VALID_LAYOUTS.includes(layout)) {
|
|
333
|
+
return layout;
|
|
334
|
+
}
|
|
335
|
+
// Try to match by prefix for flexibility
|
|
336
|
+
const normalizedLayout = layout.toLowerCase();
|
|
337
|
+
for (const validLayout of VALID_LAYOUTS) {
|
|
338
|
+
if (normalizedLayout.startsWith(validLayout) || validLayout.startsWith(normalizedLayout)) {
|
|
339
|
+
return validLayout;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
// Default fallback
|
|
343
|
+
return 'food';
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Category-specific image extraction function
|
|
347
|
+
* Handles all category image storage formats independently
|
|
348
|
+
* @param image - Can be:
|
|
349
|
+
* - String URL: "https://..."
|
|
350
|
+
* - Object: {url: "https://..."}
|
|
351
|
+
* - Array: ["https://..."] or [{url: "https://..."}]
|
|
352
|
+
* - JSON string: '{"url":"..."}' or '"https://..."'
|
|
353
|
+
* - null/undefined
|
|
354
|
+
* @returns Single valid URL string or undefined
|
|
355
|
+
*/
|
|
356
|
+
function extractCategoryImageUrl(image) {
|
|
357
|
+
if (!image) {
|
|
358
|
+
return undefined;
|
|
359
|
+
}
|
|
360
|
+
// Handle string URLs
|
|
361
|
+
if (typeof image === 'string') {
|
|
362
|
+
const trimmed = image.trim();
|
|
363
|
+
if (trimmed.length === 0) {
|
|
364
|
+
return undefined;
|
|
365
|
+
}
|
|
366
|
+
// Try to parse as JSON
|
|
367
|
+
if ((trimmed.startsWith('[') || trimmed.startsWith('{')) && (trimmed.includes('"url"') || trimmed.includes('"image"'))) {
|
|
368
|
+
try {
|
|
369
|
+
const parsed = JSON.parse(trimmed);
|
|
370
|
+
return extractCategoryImageUrl(parsed);
|
|
371
|
+
}
|
|
372
|
+
catch {
|
|
373
|
+
// Not valid JSON, continue as string URL
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
// Validate and return single URL string
|
|
377
|
+
const url = validateImageUrl(trimmed);
|
|
378
|
+
return url || undefined;
|
|
379
|
+
}
|
|
380
|
+
// Handle arrays - take first valid URL
|
|
381
|
+
if (Array.isArray(image)) {
|
|
382
|
+
if (image.length === 0) {
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
// Try to extract from first item
|
|
386
|
+
for (const item of image) {
|
|
387
|
+
const url = extractCategoryImageUrl(item);
|
|
388
|
+
if (url) {
|
|
389
|
+
return url;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return undefined;
|
|
393
|
+
}
|
|
394
|
+
// Handle objects
|
|
395
|
+
if (typeof image === 'object' && image !== null) {
|
|
396
|
+
// Check for direct url property
|
|
397
|
+
if ('url' in image) {
|
|
398
|
+
const url = validateImageUrl(image.url);
|
|
399
|
+
if (url) {
|
|
400
|
+
return url;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
// Check for other common property names
|
|
404
|
+
for (const key of ['src', 'image', 'imageUrl', 'image_url', 'value']) {
|
|
405
|
+
if (key in image) {
|
|
406
|
+
const url = validateImageUrl(image[key]);
|
|
407
|
+
if (url) {
|
|
408
|
+
return url;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Transforms API Category to StoreCategory format
|
|
417
|
+
* Uses dedicated category image extraction function for independent validation
|
|
418
|
+
*/
|
|
419
|
+
export function transformCategoryToStoreCategory(apiCategory) {
|
|
420
|
+
// Use category-specific image extraction function
|
|
421
|
+
// This ensures independent validation for category images
|
|
422
|
+
const imageUrl = extractCategoryImageUrl(apiCategory.image);
|
|
423
|
+
return {
|
|
424
|
+
id: apiCategory.id,
|
|
425
|
+
name: apiCategory.name,
|
|
426
|
+
slug: apiCategory.slug,
|
|
427
|
+
description: coerceRichFieldForStorefront(apiCategory.description),
|
|
428
|
+
image: imageUrl,
|
|
429
|
+
parentId: apiCategory.parentId,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
function sumRawAvailableFromInventory(inventory) {
|
|
433
|
+
return inventory.reduce((sum, inv) => {
|
|
434
|
+
const qty = Number(inv.quantity) || 0;
|
|
435
|
+
const reserved = Math.max(0, Math.min(Number(inv.reservedQuantity) || 0, qty));
|
|
436
|
+
return sum + Math.max(0, qty - reserved);
|
|
437
|
+
}, 0);
|
|
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: Array.isArray(variation.images) ? variation.images : undefined,
|
|
489
|
+
};
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
export function transformProductToStoreProduct(apiProduct, options) {
|
|
493
|
+
let availableStock;
|
|
494
|
+
let lowStockThreshold;
|
|
495
|
+
let inStock = true;
|
|
496
|
+
const cartLineQty = options?.cartLineQty != null ? Math.max(0, Math.floor(options.cartLineQty)) : undefined;
|
|
497
|
+
const isCartLineContext = cartLineQty != null && cartLineQty > 0 || apiProduct.stockSource === 'cart-line';
|
|
498
|
+
// All products track inventory by default unless explicitly opted out.
|
|
499
|
+
const isTracked = apiProduct.trackInventory !== false &&
|
|
500
|
+
apiProduct.trackInventory !== 0 &&
|
|
501
|
+
apiProduct.trackInventory !== 'false';
|
|
502
|
+
if (isTracked) {
|
|
503
|
+
const explicitAvailable = typeof apiProduct.availableStock === 'number'
|
|
504
|
+
? Math.max(0, apiProduct.availableStock)
|
|
505
|
+
: undefined;
|
|
506
|
+
if (isCartLineContext && explicitAvailable != null) {
|
|
507
|
+
availableStock = explicitAvailable;
|
|
508
|
+
inStock = explicitAvailable > 0;
|
|
509
|
+
if (typeof apiProduct.lowStockThreshold === 'number') {
|
|
510
|
+
lowStockThreshold = apiProduct.lowStockThreshold;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
else if (isCartLineContext &&
|
|
514
|
+
apiProduct.inventory &&
|
|
515
|
+
Array.isArray(apiProduct.inventory) &&
|
|
516
|
+
apiProduct.inventory.length > 0) {
|
|
517
|
+
const rawAvailable = sumRawAvailableFromInventory(apiProduct.inventory);
|
|
518
|
+
availableStock = rawAvailable + (cartLineQty ?? 0);
|
|
519
|
+
const thresholds = apiProduct.inventory
|
|
520
|
+
.map((inv) => Number(inv.lowStockThreshold))
|
|
521
|
+
.filter((value) => Number.isFinite(value) && value > 0);
|
|
522
|
+
if (thresholds.length > 0) {
|
|
523
|
+
lowStockThreshold = Math.max(...thresholds);
|
|
524
|
+
}
|
|
525
|
+
inStock = availableStock > 0;
|
|
526
|
+
}
|
|
527
|
+
else if (explicitAvailable != null) {
|
|
528
|
+
availableStock = explicitAvailable;
|
|
529
|
+
inStock = explicitAvailable > 0;
|
|
530
|
+
if (typeof apiProduct.lowStockThreshold === 'number') {
|
|
531
|
+
lowStockThreshold = apiProduct.lowStockThreshold;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
else if (apiProduct.inventory && Array.isArray(apiProduct.inventory) && apiProduct.inventory.length > 0) {
|
|
535
|
+
availableStock = sumRawAvailableFromInventory(apiProduct.inventory);
|
|
536
|
+
const thresholds = apiProduct.inventory
|
|
537
|
+
.map((inv) => Number(inv.lowStockThreshold))
|
|
538
|
+
.filter((value) => Number.isFinite(value) && value > 0);
|
|
539
|
+
if (thresholds.length > 0) {
|
|
540
|
+
lowStockThreshold = Math.max(...thresholds);
|
|
541
|
+
}
|
|
542
|
+
inStock = availableStock > 0;
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
const fallbackStock = Math.max(0, Number(apiProduct.stock) || 0);
|
|
546
|
+
availableStock = fallbackStock;
|
|
547
|
+
inStock = fallbackStock > 0;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
else {
|
|
551
|
+
inStock = true;
|
|
552
|
+
availableStock = undefined;
|
|
553
|
+
}
|
|
554
|
+
// Convert price to number (API may return string from decimal type)
|
|
555
|
+
const price = normalizePrice(apiProduct.price);
|
|
556
|
+
// Convert compareAtPrice to number if it exists and is meaningful
|
|
557
|
+
const compareAtPriceRaw = apiProduct.compareAtPrice != null
|
|
558
|
+
? normalizePrice(apiProduct.compareAtPrice)
|
|
559
|
+
: undefined;
|
|
560
|
+
const compareAtPrice = compareAtPriceRaw != null && compareAtPriceRaw > 0 ? compareAtPriceRaw : undefined;
|
|
561
|
+
const isLimitedTimeOffer = Boolean(apiProduct.isLimitedTimeOffer);
|
|
562
|
+
const limitedTimeOfferEndsAtRaw = apiProduct.limitedTimeOfferEndsAt;
|
|
563
|
+
const limitedTimeOfferEndsAt = limitedTimeOfferEndsAtRaw != null && String(limitedTimeOfferEndsAtRaw).trim()
|
|
564
|
+
? String(limitedTimeOfferEndsAtRaw)
|
|
565
|
+
: null;
|
|
566
|
+
// Use product-specific image extraction function
|
|
567
|
+
// Backend returns: [{url: string, isPrimary?: boolean}]
|
|
568
|
+
// Frontend needs: string[] (array of URL strings)
|
|
569
|
+
let images = extractProductImageUrls(apiProduct.images);
|
|
570
|
+
// Ensure all extracted URLs are valid (non-empty strings)
|
|
571
|
+
images = images.filter((url) => url && typeof url === 'string' && url.trim().length > 0);
|
|
572
|
+
// Enhanced logging for debugging image extraction issues
|
|
573
|
+
if (images.length === 0 && apiProduct.images) {
|
|
574
|
+
console.warn('[transformProductToStoreProduct] WARNING: No images extracted!', {
|
|
575
|
+
productId: apiProduct.id,
|
|
576
|
+
productName: apiProduct.name,
|
|
577
|
+
inputImages: apiProduct.images,
|
|
578
|
+
inputType: typeof apiProduct.images,
|
|
579
|
+
inputIsArray: Array.isArray(apiProduct.images),
|
|
580
|
+
inputLength: Array.isArray(apiProduct.images) ? apiProduct.images.length : 'N/A',
|
|
581
|
+
inputStringified: typeof apiProduct.images === 'string' ? apiProduct.images.substring(0, 200) : JSON.stringify(apiProduct.images || []).substring(0, 200)
|
|
582
|
+
});
|
|
583
|
+
// Try fallback extraction using the general extractImageUrls function
|
|
584
|
+
const fallbackImages = extractImageUrls(apiProduct.images);
|
|
585
|
+
if (fallbackImages.length > 0) {
|
|
586
|
+
console.log('[transformProductToStoreProduct] Fallback extraction succeeded:', {
|
|
587
|
+
productId: apiProduct.id,
|
|
588
|
+
extractedCount: fallbackImages.length
|
|
589
|
+
});
|
|
590
|
+
images = fallbackImages.filter((url) => url && typeof url === 'string' && url.trim().length > 0);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
else if (images.length > 0) {
|
|
594
|
+
// Log successful extraction in development
|
|
595
|
+
if (process.env.NODE_ENV === 'development') {
|
|
596
|
+
console.log('[transformProductToStoreProduct] Successfully extracted images:', {
|
|
597
|
+
productId: apiProduct.id,
|
|
598
|
+
productName: apiProduct.name,
|
|
599
|
+
imageCount: images.length,
|
|
600
|
+
firstImage: images[0]?.substring(0, 100)
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
// Convert rating to number, handling undefined, null, or string values
|
|
605
|
+
let rating;
|
|
606
|
+
if (apiProduct.rating !== undefined && apiProduct.rating !== null) {
|
|
607
|
+
if (typeof apiProduct.rating === 'number') {
|
|
608
|
+
rating = apiProduct.rating;
|
|
609
|
+
}
|
|
610
|
+
else if (typeof apiProduct.rating === 'string') {
|
|
611
|
+
const parsed = parseFloat(apiProduct.rating);
|
|
612
|
+
rating = isNaN(parsed) ? undefined : parsed;
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
rating = undefined;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
// Generate SKU from slug or name if not provided
|
|
619
|
+
const generateSKU = (product) => {
|
|
620
|
+
// Try to get SKU from metadata first
|
|
621
|
+
if (product.metadata?.sku) {
|
|
622
|
+
return String(product.metadata.sku);
|
|
623
|
+
}
|
|
624
|
+
// Check if any variation has a SKU (use the first one found)
|
|
625
|
+
if (product.variations && product.variations.length > 0) {
|
|
626
|
+
const variationWithSKU = product.variations.find((v) => v.sku);
|
|
627
|
+
if (variationWithSKU?.sku) {
|
|
628
|
+
return String(variationWithSKU.sku);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
// Generate SKU from slug (uppercase, remove hyphens, take first 8-12 chars)
|
|
632
|
+
if (product.slug) {
|
|
633
|
+
const slugSKU = product.slug.toUpperCase().replace(/[^A-Z0-9]/g, '').substring(0, 12);
|
|
634
|
+
return slugSKU.length >= 6 ? slugSKU : slugSKU.padEnd(8, 'X');
|
|
635
|
+
}
|
|
636
|
+
// Fallback: generate from name (uppercase, alphanumeric only, first 8-12 chars)
|
|
637
|
+
const nameSKU = product.name
|
|
638
|
+
.toUpperCase()
|
|
639
|
+
.replace(/[^A-Z0-9]/g, '')
|
|
640
|
+
.substring(0, 12);
|
|
641
|
+
return nameSKU.length >= 6 ? nameSKU : nameSKU.padEnd(8, 'X');
|
|
642
|
+
};
|
|
643
|
+
// Extract reviewCount from API product (added by backend)
|
|
644
|
+
const reviewCount = apiProduct.reviewCount !== undefined
|
|
645
|
+
? Number(apiProduct.reviewCount)
|
|
646
|
+
: undefined;
|
|
647
|
+
return {
|
|
648
|
+
id: apiProduct.id,
|
|
649
|
+
name: apiProduct.name,
|
|
650
|
+
slug: apiProduct.slug,
|
|
651
|
+
description: coerceRichFieldForStorefront(apiProduct.description),
|
|
652
|
+
price,
|
|
653
|
+
compareAtPrice,
|
|
654
|
+
isLimitedTimeOffer,
|
|
655
|
+
limitedTimeOfferEndsAt,
|
|
656
|
+
images,
|
|
657
|
+
categoryId: apiProduct.categoryId || '',
|
|
658
|
+
inStock,
|
|
659
|
+
trackInventory: isTracked,
|
|
660
|
+
availableStock,
|
|
661
|
+
lowStockThreshold,
|
|
662
|
+
rating,
|
|
663
|
+
reviewCount,
|
|
664
|
+
sku: generateSKU(apiProduct),
|
|
665
|
+
currency: apiProduct.currency || 'USD',
|
|
666
|
+
variants: mapApiVariationsToStoreVariants(apiProduct),
|
|
667
|
+
specifications: apiProduct.brand ? { brand: apiProduct.brand } : undefined,
|
|
668
|
+
isActive: apiProduct.isActive,
|
|
669
|
+
status: apiProduct.status,
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Transforms API Service to StoreService format
|
|
674
|
+
*/
|
|
675
|
+
export function transformServiceToStoreService(apiService) {
|
|
676
|
+
// Convert price to number (API may return string from decimal type)
|
|
677
|
+
const price = normalizePrice(apiService.price);
|
|
678
|
+
// Extract image from images array or use image field
|
|
679
|
+
let image;
|
|
680
|
+
if (apiService.image) {
|
|
681
|
+
image = apiService.image;
|
|
682
|
+
}
|
|
683
|
+
else if (apiService.images) {
|
|
684
|
+
const imageUrls = extractImageUrls(apiService.images);
|
|
685
|
+
image = imageUrls.length > 0 ? imageUrls[0] : undefined;
|
|
686
|
+
}
|
|
687
|
+
// Convert availability to StoreService format
|
|
688
|
+
let availability;
|
|
689
|
+
if (apiService.availability) {
|
|
690
|
+
if (Array.isArray(apiService.availability)) {
|
|
691
|
+
availability = apiService.availability.map((avail) => ({
|
|
692
|
+
day: avail.day || '',
|
|
693
|
+
slots: avail.slots || [],
|
|
694
|
+
}));
|
|
695
|
+
}
|
|
696
|
+
else if (typeof apiService.availability === 'object') {
|
|
697
|
+
// Handle object format - convert to array format
|
|
698
|
+
const availObj = apiService.availability;
|
|
699
|
+
if (availObj.days && Array.isArray(availObj.days)) {
|
|
700
|
+
availability = availObj.days.map((day) => ({
|
|
701
|
+
day,
|
|
702
|
+
slots: availObj.timeSlots || [],
|
|
703
|
+
}));
|
|
704
|
+
}
|
|
705
|
+
else if (availObj.day) {
|
|
706
|
+
availability = [{
|
|
707
|
+
day: availObj.day,
|
|
708
|
+
slots: availObj.slots || [],
|
|
709
|
+
}];
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
// Extract provider info if available (providerId exists but provider relation may not be loaded)
|
|
714
|
+
const provider = apiService.providerId ? {
|
|
715
|
+
id: apiService.providerId,
|
|
716
|
+
name: apiService.provider?.name || 'Service Provider',
|
|
717
|
+
avatar: apiService.provider?.avatar,
|
|
718
|
+
rating: apiService.provider?.rating,
|
|
719
|
+
} : undefined;
|
|
720
|
+
return {
|
|
721
|
+
id: apiService.id,
|
|
722
|
+
name: apiService.name,
|
|
723
|
+
slug: apiService.slug,
|
|
724
|
+
description: coerceRichFieldForStorefront(apiService.description) || '',
|
|
725
|
+
price,
|
|
726
|
+
currency: apiService.currency,
|
|
727
|
+
duration: apiService.duration || 0,
|
|
728
|
+
categoryId: apiService.categoryId || '',
|
|
729
|
+
image,
|
|
730
|
+
provider,
|
|
731
|
+
availability,
|
|
732
|
+
isActive: apiService.isActive,
|
|
733
|
+
status: apiService.status,
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Transforms API StoreResponse to StoreConfig format
|
|
738
|
+
*/
|
|
739
|
+
export function transformStoreResponseToConfig(apiStore) {
|
|
740
|
+
const layout = mapLayoutToStoreLayoutType(apiStore.layout);
|
|
741
|
+
// Debug logging for layoutConfig
|
|
742
|
+
if (process.env.NODE_ENV === 'development') {
|
|
743
|
+
console.log('[transformStoreResponseToConfig] Received apiStore.layoutConfig:', {
|
|
744
|
+
exists: !!apiStore.layoutConfig,
|
|
745
|
+
type: typeof apiStore.layoutConfig,
|
|
746
|
+
hasSections: !!apiStore.layoutConfig?.sections,
|
|
747
|
+
hasHeroSliders: !!apiStore.layoutConfig?.sections?.hero?.sliders,
|
|
748
|
+
sliderCount: apiStore.layoutConfig?.sections?.hero?.sliders?.length || 0,
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
// Build contactInfo from various sources
|
|
752
|
+
let contactInfo = apiStore.contactInfo || {
|
|
753
|
+
email: apiStore.contactEmail,
|
|
754
|
+
phone: apiStore.contactPhone,
|
|
755
|
+
address: apiStore.address,
|
|
756
|
+
};
|
|
757
|
+
// If contactInfo exists but doesn't have an address, merge Store's address if available
|
|
758
|
+
if (contactInfo && !contactInfo.address && apiStore.address) {
|
|
759
|
+
contactInfo = {
|
|
760
|
+
...contactInfo,
|
|
761
|
+
address: apiStore.address,
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
const rawLayoutConfig = apiStore.layoutConfig ??
|
|
765
|
+
apiStore.layoutContent ??
|
|
766
|
+
apiStore.layoutcontent ??
|
|
767
|
+
undefined;
|
|
768
|
+
const transformedLayoutConfig = transformLayoutConfig(rawLayoutConfig, {
|
|
769
|
+
storeSlug: apiStore.slug,
|
|
770
|
+
storeLayout: layout,
|
|
771
|
+
});
|
|
772
|
+
if (process.env.NODE_ENV === 'development') {
|
|
773
|
+
console.log('[transformStoreResponseToConfig] Transformed layoutConfig:', {
|
|
774
|
+
exists: !!transformedLayoutConfig,
|
|
775
|
+
hasSections: !!transformedLayoutConfig?.sections,
|
|
776
|
+
hasHeroSliders: !!transformedLayoutConfig?.sections?.hero?.sliders,
|
|
777
|
+
sliderCount: transformedLayoutConfig?.sections?.hero?.sliders?.length || 0,
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
return {
|
|
781
|
+
id: apiStore.id,
|
|
782
|
+
slug: apiStore.slug,
|
|
783
|
+
name: apiStore.name,
|
|
784
|
+
description: apiStore.description || '',
|
|
785
|
+
checkoutEnabled: resolveCheckoutEnabledFromApi(apiStore.checkoutEnabled),
|
|
786
|
+
type: layout,
|
|
787
|
+
layout: layout,
|
|
788
|
+
branding: {
|
|
789
|
+
primaryColor: apiStore.branding?.primaryColor || '#000000',
|
|
790
|
+
secondaryColor: apiStore.branding?.secondaryColor,
|
|
791
|
+
accentColor: apiStore.branding?.secondaryColor || apiStore.branding?.primaryColor || '#000000',
|
|
792
|
+
logo: (apiStore.branding?.logo || apiStore.logo) ? convertToAbsoluteUrl(apiStore.branding?.logo || apiStore.logo || '') : undefined,
|
|
793
|
+
},
|
|
794
|
+
navigation: {
|
|
795
|
+
main: [],
|
|
796
|
+
footer: [],
|
|
797
|
+
},
|
|
798
|
+
features: {
|
|
799
|
+
cart: true,
|
|
800
|
+
wishlist: true,
|
|
801
|
+
reviews: true,
|
|
802
|
+
search: true,
|
|
803
|
+
filters: true,
|
|
804
|
+
booking: layout.startsWith('booking'),
|
|
805
|
+
delivery: true,
|
|
806
|
+
},
|
|
807
|
+
products: [],
|
|
808
|
+
categories: [],
|
|
809
|
+
settings: {
|
|
810
|
+
currency: apiStore.settings?.currency || 'USD',
|
|
811
|
+
taxRate: apiStore.settings?.taxRate, // Deprecated: kept for backward compatibility
|
|
812
|
+
vat: apiStore.settings?.vat,
|
|
813
|
+
serviceCharge: apiStore.settings?.serviceCharge,
|
|
814
|
+
collectionFeePayer: apiStore.settings?.collectionFeePayer,
|
|
815
|
+
},
|
|
816
|
+
contactInfo: (contactInfo.email || contactInfo.phone || contactInfo.address) ? contactInfo : undefined,
|
|
817
|
+
layoutConfig: transformedLayoutConfig, // Transform layoutConfig to match frontend structure
|
|
818
|
+
// Extract puckData from configuration if it exists
|
|
819
|
+
puckData: apiStore.configuration?.puck_configuration?.puckData || undefined,
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
function getTemplateLayoutDefaultsForType(layoutType) {
|
|
823
|
+
if (!layoutType)
|
|
824
|
+
return null;
|
|
825
|
+
const layoutConfig = getTemplateLayoutConfigForLayoutType(layoutType);
|
|
826
|
+
if (!layoutConfig)
|
|
827
|
+
return null;
|
|
828
|
+
return extractTemplateLayoutPayload(layoutConfig);
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Transforms backend layoutContent structure to frontend layoutConfig structure
|
|
832
|
+
* Backend uses assignedAssets/assignedText, frontend expects sections structure
|
|
833
|
+
*/
|
|
834
|
+
function transformLayoutConfig(layoutContent, options) {
|
|
835
|
+
const storeSlug = options?.storeSlug;
|
|
836
|
+
const storeLayout = options?.storeLayout;
|
|
837
|
+
// Real stores: published snapshot only (defaults materialized at publish). Demo stores use template JSON.
|
|
838
|
+
const useTemplateFallback = Boolean(storeSlug && !shouldUseAPI(storeSlug));
|
|
839
|
+
const templateDefaults = useTemplateFallback
|
|
840
|
+
? getTemplateLayoutDefaultsForType(storeLayout)
|
|
841
|
+
: null;
|
|
842
|
+
if (!layoutContent || typeof layoutContent !== 'object') {
|
|
843
|
+
if (templateDefaults) {
|
|
844
|
+
layoutContent = templateDefaults;
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
console.log('[transformLayoutConfig] No layoutContent provided or invalid');
|
|
848
|
+
return undefined;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
const dbPayload = extractPublishedLayoutConfig(layoutContent);
|
|
852
|
+
const { layoutConfig: resolved } = resolveLayoutConfigWithTemplateDefaults(dbPayload, templateDefaults);
|
|
853
|
+
if (resolved && typeof resolved === 'object') {
|
|
854
|
+
layoutContent = resolved;
|
|
855
|
+
}
|
|
856
|
+
else {
|
|
857
|
+
const editorMeta = layoutContent._editor;
|
|
858
|
+
if (editorMeta?.compiledLegacyConfigJson && typeof editorMeta.compiledLegacyConfigJson === 'object') {
|
|
859
|
+
const compiled = editorMeta.compiledLegacyConfigJson;
|
|
860
|
+
layoutContent =
|
|
861
|
+
compiled.layoutConfig && typeof compiled.layoutConfig === 'object'
|
|
862
|
+
? compiled.layoutConfig
|
|
863
|
+
: compiled.sections || compiled.pages || compiled.home
|
|
864
|
+
? compiled
|
|
865
|
+
: layoutContent;
|
|
866
|
+
}
|
|
867
|
+
else if (layoutContent.layoutConfig &&
|
|
868
|
+
typeof layoutContent.layoutConfig === 'object' &&
|
|
869
|
+
!layoutContent.sections &&
|
|
870
|
+
!layoutContent.pages &&
|
|
871
|
+
!layoutContent.home) {
|
|
872
|
+
layoutContent = layoutContent.layoutConfig;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
// If it already has the sections structure, return as-is but ensure assignedAssets/assignedText are preserved
|
|
876
|
+
if (layoutContent.sections || layoutContent.home || layoutContent.pages) {
|
|
877
|
+
console.log('[transformLayoutConfig] Sections structure found, returning as-is');
|
|
878
|
+
console.log('[transformLayoutConfig] Sections found:', {
|
|
879
|
+
hero: !!layoutContent.sections.hero,
|
|
880
|
+
heroSliders: layoutContent.sections?.hero?.sliders?.length || 0,
|
|
881
|
+
categories: !!layoutContent.sections.categories,
|
|
882
|
+
featuredProducts: !!layoutContent.sections.featuredProducts,
|
|
883
|
+
marketing: !!layoutContent.sections.marketing,
|
|
884
|
+
marketingEditorial: !!layoutContent.sections.marketing?.editorial,
|
|
885
|
+
marketingPromoBanner: !!layoutContent.sections.marketing?.promoBanner,
|
|
886
|
+
marketingNewsletter: !!layoutContent.sections.marketing?.newsletter,
|
|
887
|
+
hasAssignedAssets: !!layoutContent.assignedAssets,
|
|
888
|
+
hasAssignedText: !!layoutContent.assignedText,
|
|
889
|
+
});
|
|
890
|
+
// Return the entire structure as-is - all sections are already in the correct format
|
|
891
|
+
// Ensure assignedAssets and assignedText are preserved for backward compatibility
|
|
892
|
+
return {
|
|
893
|
+
...layoutContent,
|
|
894
|
+
assignedAssets: layoutContent.assignedAssets || {},
|
|
895
|
+
assignedText: layoutContent.assignedText || {},
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
// Transform from assignedAssets/assignedText structure to sections structure
|
|
899
|
+
const assignedAssets = layoutContent.assignedAssets || {};
|
|
900
|
+
const assignedText = layoutContent.assignedText || {};
|
|
901
|
+
// Build sections structure
|
|
902
|
+
const sections = {};
|
|
903
|
+
// Marketing section - migrate from old format to structured format
|
|
904
|
+
if (layoutContent.sections?.marketing) {
|
|
905
|
+
// New structure already exists - preserve it exactly as-is from database
|
|
906
|
+
console.log('[transformLayoutConfig] Found sections.marketing, preserving structure');
|
|
907
|
+
console.log('[transformLayoutConfig] Marketing sections:', {
|
|
908
|
+
hasEditorial: !!layoutContent.sections.marketing.editorial,
|
|
909
|
+
hasPromoBanner: !!layoutContent.sections.marketing.promoBanner,
|
|
910
|
+
hasNewsletter: !!layoutContent.sections.marketing.newsletter,
|
|
911
|
+
});
|
|
912
|
+
sections.marketing = {
|
|
913
|
+
show: layoutContent.sections.marketing.show !== false,
|
|
914
|
+
showNewsletter: layoutContent.sections.marketing.showNewsletter !== false,
|
|
915
|
+
showPromoBanner: layoutContent.sections.marketing.showPromoBanner === true,
|
|
916
|
+
// Preserve all marketing subsections exactly as stored
|
|
917
|
+
editorial: layoutContent.sections.marketing.editorial,
|
|
918
|
+
promoBanner: layoutContent.sections.marketing.promoBanner,
|
|
919
|
+
newsletter: layoutContent.sections.marketing.newsletter,
|
|
920
|
+
shopTheLook: layoutContent.sections.marketing.shopTheLook,
|
|
921
|
+
chefRecommendations: layoutContent.sections.marketing.chefRecommendations,
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
// Migrate from old format
|
|
926
|
+
const marketing = {
|
|
927
|
+
show: true,
|
|
928
|
+
showNewsletter: false,
|
|
929
|
+
showPromoBanner: false,
|
|
930
|
+
};
|
|
931
|
+
// Editorial section (lookbook)
|
|
932
|
+
if (assignedAssets.lookbook_main || assignedText['lookbook_main:section_header']) {
|
|
933
|
+
marketing.editorial = {
|
|
934
|
+
show: true,
|
|
935
|
+
label: assignedText['lookbook_main:section_header'] || 'EDITORIAL',
|
|
936
|
+
title: (assignedText['lookbook_main:main_caption'] && assignedText['lookbook_main:main_caption'].length < 50)
|
|
937
|
+
? assignedText['lookbook_main:main_caption']
|
|
938
|
+
: 'Redefining Modern\nElegance',
|
|
939
|
+
description: assignedText['lookbook_main:main_caption']?.length >= 50
|
|
940
|
+
? assignedText['lookbook_main:main_caption']
|
|
941
|
+
: assignedText['lookbook_detail:detail_caption'] || assignedText['lookbook_main:main_caption'] || 'Explore our latest editorial featuring timeless pieces crafted for the contemporary wardrobe. From essential basics to statement outwear, find your signature look.',
|
|
942
|
+
image: assignedAssets.lookbook_main,
|
|
943
|
+
detailImage: assignedAssets.lookbook_detail,
|
|
944
|
+
primaryButtonText: 'View Lookbook',
|
|
945
|
+
primaryButtonLink: '/style-guide',
|
|
946
|
+
secondaryButtonText: 'Read Our Story',
|
|
947
|
+
secondaryButtonLink: '/about',
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
// Promo banner
|
|
951
|
+
// Check for sale_banner (electronics-grid), promo_banner_image, seasonal_promo_banner, or promo_title text
|
|
952
|
+
const hasPromoBanner = assignedAssets.sale_banner ||
|
|
953
|
+
assignedAssets.promo_banner_image ||
|
|
954
|
+
assignedAssets.seasonal_promo_banner ||
|
|
955
|
+
assignedText['promo_banner_title'] ||
|
|
956
|
+
assignedText['promo_title'] ||
|
|
957
|
+
assignedText['sale_banner:banner_title'];
|
|
958
|
+
if (hasPromoBanner) {
|
|
959
|
+
// Get banner image - prioritize sale_banner for electronics-grid
|
|
960
|
+
const bannerImage = assignedAssets.sale_banner ||
|
|
961
|
+
assignedAssets.promo_banner_image ||
|
|
962
|
+
assignedAssets.seasonal_promo_banner;
|
|
963
|
+
// Get banner text - check sale_banner textElements first, then other sources
|
|
964
|
+
const bannerTitle = assignedText['sale_banner:banner_title'] ||
|
|
965
|
+
assignedText['promo_banner_title'] ||
|
|
966
|
+
assignedText['promo_title'] ||
|
|
967
|
+
assignedText['promo_headline'];
|
|
968
|
+
const bannerSubtitle = assignedText['sale_banner:banner_subtitle'] ||
|
|
969
|
+
assignedText['promo_banner_subtitle'] ||
|
|
970
|
+
assignedText['promo_subtext'] ||
|
|
971
|
+
assignedText['promo_subhead'];
|
|
972
|
+
const bannerButtonText = assignedText['sale_banner:cta_button'] ||
|
|
973
|
+
assignedText['promo_banner_button'] ||
|
|
974
|
+
assignedText['promo_cta'] ||
|
|
975
|
+
assignedText['cta_text'];
|
|
976
|
+
const bannerButtonLink = assignedText['promo_banner_link'] ||
|
|
977
|
+
assignedText['sale_banner:button_link'] ||
|
|
978
|
+
'/products';
|
|
979
|
+
marketing.showPromoBanner = false; // Disable by default
|
|
980
|
+
marketing.promoBanner = {
|
|
981
|
+
show: false, // Disable by default
|
|
982
|
+
image: bannerImage,
|
|
983
|
+
title: bannerTitle,
|
|
984
|
+
subtitle: bannerSubtitle,
|
|
985
|
+
buttonText: bannerButtonText,
|
|
986
|
+
buttonLink: bannerButtonLink,
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
// Newsletter
|
|
990
|
+
if (assignedText['newsletter_title'] || assignedText['footer_newsletter_title']) {
|
|
991
|
+
marketing.showNewsletter = true;
|
|
992
|
+
marketing.newsletter = {
|
|
993
|
+
show: true,
|
|
994
|
+
title: assignedText['newsletter_title'] || assignedText['footer_newsletter_title'],
|
|
995
|
+
subtitle: assignedText['newsletter_subtitle'] || assignedText['footer_newsletter_subtitle'],
|
|
996
|
+
button: assignedText['newsletter_button'] || assignedText['footer_newsletter_button'],
|
|
997
|
+
placeholder: assignedText['newsletter_placeholder'],
|
|
998
|
+
disclaimer: assignedText['newsletter_disclaimer'],
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
// Shop the look (clothing-minimal)
|
|
1002
|
+
if (assignedAssets.shop_the_look_image || assignedText['shop_the_look:section_title']) {
|
|
1003
|
+
marketing.shopTheLook = {
|
|
1004
|
+
show: true,
|
|
1005
|
+
image: assignedAssets.shop_the_look_image,
|
|
1006
|
+
title: assignedText['shop_the_look:section_title'] || assignedText['section_title'],
|
|
1007
|
+
description: assignedText['shop_the_look:look_desc'] || assignedText['look_desc'],
|
|
1008
|
+
products: [], // Will be populated from product data
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
// Chef recommendations (food layout)
|
|
1012
|
+
if (assignedText['chef_recommendations_title'] || assignedAssets.chef_image) {
|
|
1013
|
+
marketing.chefRecommendations = {
|
|
1014
|
+
show: true,
|
|
1015
|
+
title: assignedText['chef_recommendations_title'] || 'Chef\'s Recommendations',
|
|
1016
|
+
description: assignedText['chef_recommendations_description'],
|
|
1017
|
+
items: [], // Will be populated from menu item data
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
if (Object.keys(marketing).length > 3) { // More than just show, showNewsletter, showPromoBanner
|
|
1021
|
+
sections.marketing = marketing;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
// Hero section - migrate old format to new slider structure
|
|
1025
|
+
if (layoutContent.sections?.hero?.sliders && Array.isArray(layoutContent.sections.hero.sliders)) {
|
|
1026
|
+
// New structure already exists - preserve it exactly as-is from database
|
|
1027
|
+
// This ensures the slider structure with images, text, and buttons is not modified
|
|
1028
|
+
console.log('[transformLayoutConfig] Found sections.hero.sliders, preserving structure');
|
|
1029
|
+
console.log('[transformLayoutConfig] Sliders count:', layoutContent.sections.hero.sliders.length);
|
|
1030
|
+
// Log each slider for debugging
|
|
1031
|
+
layoutContent.sections.hero.sliders.forEach((slider, index) => {
|
|
1032
|
+
console.log(`[transformLayoutConfig] Slider ${index + 1}:`, {
|
|
1033
|
+
id: slider.id,
|
|
1034
|
+
hasImage: !!slider.image,
|
|
1035
|
+
imageUrl: slider.image ? (slider.image.substring(0, 50) + '...') : 'missing',
|
|
1036
|
+
hasTitle: !!slider.title,
|
|
1037
|
+
title: slider.title || 'missing',
|
|
1038
|
+
primaryButtonText: slider.primaryButton?.text || 'empty',
|
|
1039
|
+
secondaryButtonText: slider.secondaryButton?.text || 'empty',
|
|
1040
|
+
});
|
|
1041
|
+
});
|
|
1042
|
+
sections.hero = {
|
|
1043
|
+
...layoutContent.sections.hero,
|
|
1044
|
+
show: layoutContent.sections.hero.show !== false,
|
|
1045
|
+
showCTA: layoutContent.sections.hero.showCTA !== false,
|
|
1046
|
+
showSecondaryCTA: layoutContent.sections.hero.showSecondaryCTA !== false,
|
|
1047
|
+
autoPlay: layoutContent.sections.hero.autoPlay !== false,
|
|
1048
|
+
showBadges: layoutContent.sections.hero.showBadges === true,
|
|
1049
|
+
// Preserve sliders array exactly as stored - don't transform or modify
|
|
1050
|
+
sliders: layoutContent.sections.hero.sliders,
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
else if (assignedAssets.hero_slide_1 || assignedAssets.hero_slide_2 || assignedAssets.hero_slide_3) {
|
|
1054
|
+
// Old format detected - migrate to new structure
|
|
1055
|
+
const sliders = [];
|
|
1056
|
+
// Build sliders array from old format (support up to 10 slides for future growth)
|
|
1057
|
+
for (let i = 1; i <= 10; i++) {
|
|
1058
|
+
const slideKey = `hero_slide_${i}`;
|
|
1059
|
+
const imageUrl = assignedAssets[slideKey];
|
|
1060
|
+
if (imageUrl) {
|
|
1061
|
+
// Determine store slug for default links (use passed parameter or fallback)
|
|
1062
|
+
const defaultProductsLink = storeSlug ? `/${storeSlug}/products` : '/products';
|
|
1063
|
+
const defaultCategoriesLink = storeSlug ? `/${storeSlug}/categories` : '/categories';
|
|
1064
|
+
const slider = {
|
|
1065
|
+
id: slideKey,
|
|
1066
|
+
image: imageUrl,
|
|
1067
|
+
order: i,
|
|
1068
|
+
};
|
|
1069
|
+
// Map old text keys to new structure
|
|
1070
|
+
// Support multiple key variations for backward compatibility
|
|
1071
|
+
const badgeKey = `${slideKey}:badge`;
|
|
1072
|
+
const headingKey = `${slideKey}:heading`;
|
|
1073
|
+
const titleKey = `${slideKey}:title`;
|
|
1074
|
+
const subheadingKey = `${slideKey}:subheading`;
|
|
1075
|
+
const descriptionKey = `${slideKey}:description`;
|
|
1076
|
+
const btnLabelKey = `${slideKey}:btn_label`;
|
|
1077
|
+
const primaryButtonKey = `${slideKey}:primaryButton`;
|
|
1078
|
+
const secondaryBtnKey = `${slideKey}:secondary_btn`;
|
|
1079
|
+
const secondaryButtonKey = `${slideKey}:secondaryButton`;
|
|
1080
|
+
const highlightKey = `${slideKey}:highlight`; // Food layout specific
|
|
1081
|
+
if (assignedText[badgeKey]) {
|
|
1082
|
+
slider.badge = assignedText[badgeKey];
|
|
1083
|
+
}
|
|
1084
|
+
slider.title = assignedText[headingKey] || assignedText[titleKey] || '';
|
|
1085
|
+
if (assignedText[subheadingKey] || assignedText[descriptionKey]) {
|
|
1086
|
+
slider.description = assignedText[subheadingKey] || assignedText[descriptionKey];
|
|
1087
|
+
}
|
|
1088
|
+
// Food layout specific: highlight field
|
|
1089
|
+
if (assignedText[highlightKey]) {
|
|
1090
|
+
slider.highlight = assignedText[highlightKey];
|
|
1091
|
+
}
|
|
1092
|
+
// Primary button - handle both string and object formats
|
|
1093
|
+
const primaryButtonText = assignedText[btnLabelKey] || assignedText[primaryButtonKey];
|
|
1094
|
+
if (primaryButtonText) {
|
|
1095
|
+
// Check if it's already an object (from new format migration)
|
|
1096
|
+
if (typeof primaryButtonText === 'object' && primaryButtonText !== null) {
|
|
1097
|
+
slider.primaryButton = primaryButtonText;
|
|
1098
|
+
}
|
|
1099
|
+
else {
|
|
1100
|
+
slider.primaryButton = {
|
|
1101
|
+
text: String(primaryButtonText),
|
|
1102
|
+
link: defaultProductsLink,
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
// Secondary button - handle both string and object formats
|
|
1107
|
+
const secondaryButtonText = assignedText[secondaryBtnKey] || assignedText[secondaryButtonKey];
|
|
1108
|
+
if (secondaryButtonText) {
|
|
1109
|
+
// Check if it's already an object (from new format migration)
|
|
1110
|
+
if (typeof secondaryButtonText === 'object' && secondaryButtonText !== null) {
|
|
1111
|
+
slider.secondaryButton = secondaryButtonText;
|
|
1112
|
+
}
|
|
1113
|
+
else {
|
|
1114
|
+
slider.secondaryButton = {
|
|
1115
|
+
text: String(secondaryButtonText),
|
|
1116
|
+
link: defaultCategoriesLink,
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
sliders.push(slider);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
// Only create hero section if we have at least one slider
|
|
1124
|
+
if (sliders.length > 0) {
|
|
1125
|
+
sections.hero = {
|
|
1126
|
+
show: true,
|
|
1127
|
+
showCTA: true,
|
|
1128
|
+
showSecondaryCTA: true,
|
|
1129
|
+
autoPlay: true,
|
|
1130
|
+
showBadges: false,
|
|
1131
|
+
sliders: sliders,
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
else if (assignedAssets.hero_bg || assignedAssets.hero_image || assignedAssets.hero_split_image || assignedAssets.hero_video) {
|
|
1136
|
+
// Single image/video hero (non-slider layouts)
|
|
1137
|
+
sections.hero = {
|
|
1138
|
+
show: true,
|
|
1139
|
+
showCTA: true,
|
|
1140
|
+
showSecondaryCTA: true,
|
|
1141
|
+
autoPlay: false,
|
|
1142
|
+
showBadges: false,
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
// Categories section - migrate from old format to structured format
|
|
1146
|
+
if (layoutContent.sections?.categories) {
|
|
1147
|
+
// New structure already exists - use it
|
|
1148
|
+
sections.categories = {
|
|
1149
|
+
show: layoutContent.sections.categories.show !== false,
|
|
1150
|
+
showViewAll: layoutContent.sections.categories.showViewAll !== false,
|
|
1151
|
+
limit: layoutContent.sections.categories.limit || 4,
|
|
1152
|
+
title: layoutContent.sections.categories.title,
|
|
1153
|
+
subtitle: layoutContent.sections.categories.subtitle,
|
|
1154
|
+
viewAll: layoutContent.sections.categories.viewAll,
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
else {
|
|
1158
|
+
// Migrate from old format
|
|
1159
|
+
sections.categories = {
|
|
1160
|
+
show: true,
|
|
1161
|
+
showViewAll: true,
|
|
1162
|
+
limit: 4,
|
|
1163
|
+
title: assignedText['categories_title'] || assignedText['sections.categories.title'],
|
|
1164
|
+
subtitle: assignedText['categories_subtitle'] || assignedText['sections.categories.subtitle'],
|
|
1165
|
+
viewAll: assignedText['categories_view_all'] || assignedText['sections.categories.viewAll'] || 'View All Categories',
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
// Featured products section - migrate from old format to structured format
|
|
1169
|
+
if (layoutContent.sections?.featuredProducts) {
|
|
1170
|
+
// New structure already exists - use it
|
|
1171
|
+
sections.featuredProducts = {
|
|
1172
|
+
show: layoutContent.sections.featuredProducts.show !== false,
|
|
1173
|
+
title: layoutContent.sections.featuredProducts.title,
|
|
1174
|
+
subtitle: layoutContent.sections.featuredProducts.subtitle,
|
|
1175
|
+
showViewAll: layoutContent.sections.featuredProducts.showViewAll !== false,
|
|
1176
|
+
viewAll: layoutContent.sections.featuredProducts.viewAll,
|
|
1177
|
+
showAddToCart: layoutContent.sections.featuredProducts.showAddToCart !== false,
|
|
1178
|
+
showWishlist: layoutContent.sections.featuredProducts.showWishlist !== false,
|
|
1179
|
+
showRatings: layoutContent.sections.featuredProducts.showRatings !== false,
|
|
1180
|
+
emptyState: layoutContent.sections.featuredProducts.emptyState,
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
else {
|
|
1184
|
+
// Migrate from old format
|
|
1185
|
+
sections.featuredProducts = {
|
|
1186
|
+
show: true,
|
|
1187
|
+
title: assignedText['featured_products_title'] || assignedText['trending_title'] || assignedText['sections.featuredProducts.title'] || 'Trending Now',
|
|
1188
|
+
subtitle: assignedText['featured_products_subtitle'] || assignedText['sections.featuredProducts.subtitle'],
|
|
1189
|
+
showViewAll: true,
|
|
1190
|
+
viewAll: assignedText['featured_products_view_all'] || assignedText['sections.featuredProducts.viewAll'] || 'View All Products',
|
|
1191
|
+
showAddToCart: true,
|
|
1192
|
+
showWishlist: true,
|
|
1193
|
+
showRatings: true,
|
|
1194
|
+
emptyState: assignedText['featured_products_empty'] || assignedText['sections.featuredProducts.emptyState'],
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
// Testimonials section - migrate from old format to structured format
|
|
1198
|
+
if (layoutContent.sections?.testimonials) {
|
|
1199
|
+
const testimonialsData = layoutContent.sections.testimonials;
|
|
1200
|
+
const rawItems = testimonialsData.items && Array.isArray(testimonialsData.items)
|
|
1201
|
+
? testimonialsData.items.map((item) => ({
|
|
1202
|
+
id: item.id || generateId(),
|
|
1203
|
+
name: item.name || '',
|
|
1204
|
+
role: item.role || '',
|
|
1205
|
+
image: item.image || '',
|
|
1206
|
+
quote: item.quote || item.comment || '',
|
|
1207
|
+
rating: typeof item.rating === 'number' ? item.rating : 5,
|
|
1208
|
+
order: typeof item.order === 'number' ? item.order : 0,
|
|
1209
|
+
location: item.location,
|
|
1210
|
+
date: item.date,
|
|
1211
|
+
}))
|
|
1212
|
+
: testimonialsData.quote
|
|
1213
|
+
? [
|
|
1214
|
+
{
|
|
1215
|
+
id: generateId(),
|
|
1216
|
+
name: testimonialsData.author || 'Customer',
|
|
1217
|
+
role: testimonialsData.role || 'Customer',
|
|
1218
|
+
image: '',
|
|
1219
|
+
quote: testimonialsData.quote,
|
|
1220
|
+
rating: 5,
|
|
1221
|
+
order: 0,
|
|
1222
|
+
},
|
|
1223
|
+
]
|
|
1224
|
+
: [];
|
|
1225
|
+
sections.testimonials = {
|
|
1226
|
+
show: testimonialsData.show !== false,
|
|
1227
|
+
title: testimonialsData.title,
|
|
1228
|
+
subtitle: testimonialsData.subtitle,
|
|
1229
|
+
showRatings: testimonialsData.showRatings !== false,
|
|
1230
|
+
limit: clampBookingTestimonialLimit(testimonialsData.limit),
|
|
1231
|
+
items: normalizeBookingTestimonialItems(rawItems),
|
|
1232
|
+
// Keep backward compatibility with old single quote format
|
|
1233
|
+
quote: testimonialsData.quote,
|
|
1234
|
+
author: testimonialsData.author,
|
|
1235
|
+
role: testimonialsData.role,
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
else if (assignedText['testimonial_quote'] || assignedText['testimonials_title']) {
|
|
1239
|
+
sections.testimonials = {
|
|
1240
|
+
show: true,
|
|
1241
|
+
title: assignedText['testimonials_title'] || assignedText['sections.testimonials.title'],
|
|
1242
|
+
subtitle: assignedText['testimonials_subtitle'] || assignedText['sections.testimonials.subtitle'],
|
|
1243
|
+
items: assignedText['testimonial_quote'] ? [{
|
|
1244
|
+
id: generateId(),
|
|
1245
|
+
name: assignedText['testimonial_author'] || 'Customer',
|
|
1246
|
+
role: assignedText['testimonial_role'] || 'Customer',
|
|
1247
|
+
image: '',
|
|
1248
|
+
quote: assignedText['testimonial_quote'],
|
|
1249
|
+
rating: 5,
|
|
1250
|
+
order: 0,
|
|
1251
|
+
}] : [],
|
|
1252
|
+
// Keep backward compatibility
|
|
1253
|
+
quote: assignedText['testimonial_quote'],
|
|
1254
|
+
author: assignedText['testimonial_author'],
|
|
1255
|
+
role: assignedText['testimonial_role'],
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
// Story section - new structured format
|
|
1259
|
+
if (layoutContent.sections?.story) {
|
|
1260
|
+
sections.story = {
|
|
1261
|
+
show: layoutContent.sections.story.show !== false,
|
|
1262
|
+
label: layoutContent.sections.story.label,
|
|
1263
|
+
title: layoutContent.sections.story.title || '',
|
|
1264
|
+
description: layoutContent.sections.story.description || '',
|
|
1265
|
+
image: layoutContent.sections.story.image,
|
|
1266
|
+
signature: layoutContent.sections.story.signature,
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
// PromoBanner section - new structured format (directly in sections, not just in marketing)
|
|
1270
|
+
if (layoutContent.sections?.promoBanner) {
|
|
1271
|
+
sections.promoBanner = {
|
|
1272
|
+
show: layoutContent.sections.promoBanner.show === true,
|
|
1273
|
+
image: layoutContent.sections.promoBanner.image,
|
|
1274
|
+
title: layoutContent.sections.promoBanner.title || '',
|
|
1275
|
+
subtitle: layoutContent.sections.promoBanner.subtitle,
|
|
1276
|
+
buttonText: layoutContent.sections.promoBanner.buttonText,
|
|
1277
|
+
buttonLink: layoutContent.sections.promoBanner.buttonLink,
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
// Team section - migrate from old format to structured format
|
|
1281
|
+
if (layoutContent.sections?.team) {
|
|
1282
|
+
sections.team = {
|
|
1283
|
+
show: layoutContent.sections.team.show !== false,
|
|
1284
|
+
title: layoutContent.sections.team.title,
|
|
1285
|
+
description: layoutContent.sections.team.description,
|
|
1286
|
+
showViewAll: layoutContent.sections.team.showViewAll !== false,
|
|
1287
|
+
viewAll: layoutContent.sections.team.viewAll,
|
|
1288
|
+
items: layoutContent.sections.team.items && Array.isArray(layoutContent.sections.team.items)
|
|
1289
|
+
? layoutContent.sections.team.items.map((item) => ({
|
|
1290
|
+
id: item.id || generateId(),
|
|
1291
|
+
name: item.name || 'Team Member',
|
|
1292
|
+
role: item.role || 'Specialist',
|
|
1293
|
+
image: item.image || item.photo || '',
|
|
1294
|
+
rating: item.rating,
|
|
1295
|
+
reviews: item.reviews,
|
|
1296
|
+
}))
|
|
1297
|
+
: [],
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
else if (assignedText['team_section_title'] || assignedText['team_title']) {
|
|
1301
|
+
sections.team = {
|
|
1302
|
+
show: true,
|
|
1303
|
+
title: assignedText['team_section_title'] || assignedText['team_title'] || assignedText['sections.team.title'],
|
|
1304
|
+
description: assignedText['team_section_subtitle'] || assignedText['team_description'] || assignedText['team_desc'] || assignedText['sections.team.description'],
|
|
1305
|
+
showViewAll: true,
|
|
1306
|
+
viewAll: assignedText['team_view_all'] || assignedText['sections.team.viewAll'] || 'View All Team',
|
|
1307
|
+
items: [],
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
// Services section - migrate from old format to structured format (for booking layouts)
|
|
1311
|
+
if (layoutContent.sections?.services) {
|
|
1312
|
+
sections.services = {
|
|
1313
|
+
show: layoutContent.sections.services.show !== false,
|
|
1314
|
+
title: layoutContent.sections.services.title,
|
|
1315
|
+
subtitle: layoutContent.sections.services.subtitle,
|
|
1316
|
+
showViewAll: layoutContent.sections.services.showViewAll !== false,
|
|
1317
|
+
viewAll: layoutContent.sections.services.viewAll,
|
|
1318
|
+
limit: layoutContent.sections.services.limit,
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
else if (assignedText['services_section_title'] || assignedText['services_title']) {
|
|
1322
|
+
sections.services = {
|
|
1323
|
+
show: true,
|
|
1324
|
+
title: assignedText['services_section_title'] || assignedText['services_title'] || assignedText['sections.services.title'],
|
|
1325
|
+
subtitle: assignedText['services_section_subtitle'] || assignedText['services_subtitle'] || assignedText['sections.services.subtitle'],
|
|
1326
|
+
showViewAll: true,
|
|
1327
|
+
viewAll: assignedText['services_view_all'] || assignedText['sections.services.viewAll'] || 'View All Services',
|
|
1328
|
+
limit: 5,
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
// Process section - migrate from old format to structured format (for booking layouts)
|
|
1332
|
+
if (layoutContent.sections?.process) {
|
|
1333
|
+
sections.process = {
|
|
1334
|
+
show: layoutContent.sections.process.show !== false,
|
|
1335
|
+
title: layoutContent.sections.process.title,
|
|
1336
|
+
subtitle: layoutContent.sections.process.subtitle,
|
|
1337
|
+
steps: layoutContent.sections.process.steps,
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
else if (assignedText['process_title'] || assignedText['how_it_works_title']) {
|
|
1341
|
+
sections.process = {
|
|
1342
|
+
show: true,
|
|
1343
|
+
title: assignedText['process_title'] || assignedText['how_it_works_title'] || assignedText['sections.process.title'] || 'How it Works',
|
|
1344
|
+
subtitle: assignedText['process_subtitle'] || assignedText['how_it_works_subtitle'] || assignedText['sections.process.subtitle'],
|
|
1345
|
+
steps: [], // Will be populated from layout-specific process steps if available
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
// Transform assignedText to structured text config
|
|
1349
|
+
const textConfig = {
|
|
1350
|
+
hero: {
|
|
1351
|
+
badge: assignedText['hero_badge'],
|
|
1352
|
+
title: assignedText['hero_title'],
|
|
1353
|
+
subtitle: assignedText['hero_subtitle'],
|
|
1354
|
+
primaryButton: assignedText['hero_primary_button'] || assignedText['hero_btn_label'] || assignedText['book_btn'],
|
|
1355
|
+
secondaryButton: assignedText['hero_secondary_button'] || assignedText['view_services_btn'],
|
|
1356
|
+
// Support multi-slide heroes
|
|
1357
|
+
slides: assignedText['hero_slide_1:heading'] ? [
|
|
1358
|
+
{
|
|
1359
|
+
badge: assignedText['hero_slide_1:badge'] || assignedText['hero_badge'],
|
|
1360
|
+
title: assignedText['hero_slide_1:heading'] || assignedText['hero_title'],
|
|
1361
|
+
description: assignedText['hero_slide_1:subheading'] || assignedText['hero_subtitle'],
|
|
1362
|
+
primaryButton: assignedText['hero_slide_1:btn_label'] || assignedText['hero_primary_button'],
|
|
1363
|
+
secondaryButton: assignedText['hero_slide_1:secondary_btn'] || assignedText['hero_secondary_button'],
|
|
1364
|
+
},
|
|
1365
|
+
assignedText['hero_slide_2:heading'] ? {
|
|
1366
|
+
badge: assignedText['hero_slide_2:badge'],
|
|
1367
|
+
title: assignedText['hero_slide_2:heading'],
|
|
1368
|
+
description: assignedText['hero_slide_2:subheading'],
|
|
1369
|
+
primaryButton: assignedText['hero_slide_2:btn_label'],
|
|
1370
|
+
secondaryButton: assignedText['hero_slide_2:secondary_btn'],
|
|
1371
|
+
} : undefined,
|
|
1372
|
+
assignedText['hero_slide_3:heading'] ? {
|
|
1373
|
+
badge: assignedText['hero_slide_3:badge'],
|
|
1374
|
+
title: assignedText['hero_slide_3:heading'],
|
|
1375
|
+
description: assignedText['hero_slide_3:subheading'],
|
|
1376
|
+
primaryButton: assignedText['hero_slide_3:btn_label'],
|
|
1377
|
+
secondaryButton: assignedText['hero_slide_3:secondary_btn'],
|
|
1378
|
+
} : undefined,
|
|
1379
|
+
].filter(Boolean) : undefined,
|
|
1380
|
+
},
|
|
1381
|
+
sections: {
|
|
1382
|
+
categories: {
|
|
1383
|
+
title: assignedText['categories_title'],
|
|
1384
|
+
subtitle: assignedText['categories_subtitle'],
|
|
1385
|
+
viewAll: assignedText['categories_view_all'],
|
|
1386
|
+
},
|
|
1387
|
+
services: {
|
|
1388
|
+
title: assignedText['services_section_title'],
|
|
1389
|
+
subtitle: assignedText['services_section_subtitle'],
|
|
1390
|
+
listTitle: assignedText['services_list_title'],
|
|
1391
|
+
listCount: assignedText['services_list_count'],
|
|
1392
|
+
},
|
|
1393
|
+
testimonials: {
|
|
1394
|
+
quote: assignedText['testimonial_quote'],
|
|
1395
|
+
author: assignedText['testimonial_author'],
|
|
1396
|
+
role: assignedText['testimonial_role'],
|
|
1397
|
+
title: assignedText['testimonials_title'],
|
|
1398
|
+
subtitle: assignedText['testimonials_subtitle'],
|
|
1399
|
+
},
|
|
1400
|
+
cta: {
|
|
1401
|
+
title: assignedText['cta_title'],
|
|
1402
|
+
description: assignedText['cta_description'],
|
|
1403
|
+
},
|
|
1404
|
+
promo: {
|
|
1405
|
+
badge: assignedText['promo_badge'],
|
|
1406
|
+
title: assignedText['promo_title'],
|
|
1407
|
+
description: assignedText['promo_desc'],
|
|
1408
|
+
},
|
|
1409
|
+
experts: {
|
|
1410
|
+
title: assignedText['experts_section_title'],
|
|
1411
|
+
viewAll: assignedText['experts_view_all'],
|
|
1412
|
+
},
|
|
1413
|
+
featuredProducts: {
|
|
1414
|
+
title: assignedText['featured_products_title'] || assignedText['trending_title'] || assignedText['hero_slide_2:heading'],
|
|
1415
|
+
subtitle: assignedText['featured_products_subtitle'],
|
|
1416
|
+
viewAll: assignedText['featured_products_view_all'],
|
|
1417
|
+
emptyState: assignedText['featured_products_empty'],
|
|
1418
|
+
},
|
|
1419
|
+
marketing: {
|
|
1420
|
+
newsletter: {
|
|
1421
|
+
title: assignedText['newsletter_title'] || assignedText['footer_newsletter_title'],
|
|
1422
|
+
subtitle: assignedText['newsletter_subtitle'] || assignedText['footer_newsletter_subtitle'],
|
|
1423
|
+
button: assignedText['newsletter_button'] || assignedText['footer_newsletter_button'],
|
|
1424
|
+
placeholder: assignedText['newsletter_placeholder'],
|
|
1425
|
+
disclaimer: assignedText['newsletter_disclaimer'],
|
|
1426
|
+
},
|
|
1427
|
+
promoBanner: {
|
|
1428
|
+
title: assignedText['promo_banner_title'] || assignedText['promo_title'],
|
|
1429
|
+
subtitle: assignedText['promo_banner_subtitle'] || assignedText['promo_subtext'],
|
|
1430
|
+
button: assignedText['promo_banner_button'] || assignedText['promo_cta'],
|
|
1431
|
+
},
|
|
1432
|
+
},
|
|
1433
|
+
team: {
|
|
1434
|
+
title: assignedText['team_section_title'] || assignedText['team_title'],
|
|
1435
|
+
subtitle: assignedText['team_section_subtitle'] || assignedText['team_description'] || assignedText['team_desc'],
|
|
1436
|
+
viewAll: assignedText['team_view_all'],
|
|
1437
|
+
},
|
|
1438
|
+
process: {
|
|
1439
|
+
title: assignedText['process_title'],
|
|
1440
|
+
subtitle: assignedText['process_subtitle'],
|
|
1441
|
+
},
|
|
1442
|
+
},
|
|
1443
|
+
common: {
|
|
1444
|
+
shopNow: assignedText['common_shop_now'],
|
|
1445
|
+
viewAll: assignedText['common_view_all'],
|
|
1446
|
+
addToCart: assignedText['common_add_to_cart'],
|
|
1447
|
+
buyNow: assignedText['common_buy_now'],
|
|
1448
|
+
learnMore: assignedText['common_learn_more'],
|
|
1449
|
+
readMore: assignedText['common_read_more'],
|
|
1450
|
+
seeMore: assignedText['common_see_more'],
|
|
1451
|
+
discover: assignedText['common_discover'],
|
|
1452
|
+
explore: assignedText['common_explore'],
|
|
1453
|
+
new: assignedText['common_new'],
|
|
1454
|
+
trending: assignedText['common_trending'],
|
|
1455
|
+
limited: assignedText['common_limited'],
|
|
1456
|
+
sale: assignedText['common_sale'],
|
|
1457
|
+
outOfStock: assignedText['common_out_of_stock'],
|
|
1458
|
+
inStock: assignedText['common_in_stock'],
|
|
1459
|
+
selectSize: assignedText['common_select_size'],
|
|
1460
|
+
selectColor: assignedText['common_select_color'],
|
|
1461
|
+
quantity: assignedText['common_quantity'],
|
|
1462
|
+
reviews: assignedText['common_reviews'],
|
|
1463
|
+
writeReview: assignedText['common_write_review'],
|
|
1464
|
+
customerReviews: assignedText['common_customer_reviews'],
|
|
1465
|
+
noReviews: assignedText['common_no_reviews'],
|
|
1466
|
+
search: assignedText['common_search'],
|
|
1467
|
+
searchPlaceholder: assignedText['common_search_placeholder'],
|
|
1468
|
+
cart: assignedText['common_cart'],
|
|
1469
|
+
wishlist: assignedText['common_wishlist'],
|
|
1470
|
+
account: assignedText['common_account'],
|
|
1471
|
+
login: assignedText['common_login'],
|
|
1472
|
+
logout: assignedText['common_logout'],
|
|
1473
|
+
signup: assignedText['common_signup'],
|
|
1474
|
+
checkout: assignedText['common_checkout'],
|
|
1475
|
+
continueShopping: assignedText['common_continue_shopping'],
|
|
1476
|
+
proceedToCheckout: assignedText['common_proceed_to_checkout'],
|
|
1477
|
+
},
|
|
1478
|
+
footer: {
|
|
1479
|
+
newsletter: {
|
|
1480
|
+
title: assignedText['footer_newsletter_title'],
|
|
1481
|
+
subtitle: assignedText['footer_newsletter_subtitle'],
|
|
1482
|
+
button: assignedText['footer_newsletter_button'],
|
|
1483
|
+
placeholder: assignedText['footer_newsletter_placeholder'],
|
|
1484
|
+
disclaimer: assignedText['footer_newsletter_disclaimer'],
|
|
1485
|
+
},
|
|
1486
|
+
copyright: assignedText['footer_copyright'],
|
|
1487
|
+
links: {
|
|
1488
|
+
about: assignedText['footer_link_about'],
|
|
1489
|
+
contact: assignedText['footer_link_contact'],
|
|
1490
|
+
privacy: assignedText['footer_link_privacy'],
|
|
1491
|
+
terms: assignedText['footer_link_terms'],
|
|
1492
|
+
shipping: assignedText['footer_link_shipping'],
|
|
1493
|
+
faq: assignedText['footer_link_faq'],
|
|
1494
|
+
},
|
|
1495
|
+
},
|
|
1496
|
+
header: {
|
|
1497
|
+
searchPlaceholder: assignedText['header_search_placeholder'],
|
|
1498
|
+
cartEmpty: assignedText['header_cart_empty'],
|
|
1499
|
+
wishlistEmpty: assignedText['header_wishlist_empty'],
|
|
1500
|
+
accountMenu: {
|
|
1501
|
+
profile: assignedText['header_account_profile'],
|
|
1502
|
+
orders: assignedText['header_account_orders'],
|
|
1503
|
+
wishlist: assignedText['header_account_wishlist'],
|
|
1504
|
+
logout: assignedText['header_account_logout'],
|
|
1505
|
+
},
|
|
1506
|
+
},
|
|
1507
|
+
booking: {
|
|
1508
|
+
pageTitle: assignedText['booking_page_title'],
|
|
1509
|
+
pageSubtitle: assignedText['booking_page_subtitle'],
|
|
1510
|
+
bookAppointment: assignedText['booking_book_appointment'] || assignedText['book_btn'],
|
|
1511
|
+
viewServices: assignedText['booking_view_services'] || assignedText['view_services_btn'],
|
|
1512
|
+
selectDate: assignedText['booking_select_date'],
|
|
1513
|
+
selectService: assignedText['booking_select_service'],
|
|
1514
|
+
selectTime: assignedText['booking_select_time'],
|
|
1515
|
+
confirmBooking: assignedText['booking_confirm'],
|
|
1516
|
+
completePayment: assignedText['booking_complete_payment'],
|
|
1517
|
+
bookingConfirmed: assignedText['booking_confirmed'],
|
|
1518
|
+
limitedAvailability: assignedText['booking_limited_availability'],
|
|
1519
|
+
availableServices: assignedText['booking_available_services'] || assignedText['services_list_title'],
|
|
1520
|
+
showingResults: assignedText['booking_showing_results'] || assignedText['services_list_count'],
|
|
1521
|
+
filters: assignedText['booking_filters'],
|
|
1522
|
+
providers: assignedText['booking_providers'],
|
|
1523
|
+
},
|
|
1524
|
+
food: {
|
|
1525
|
+
reserveTable: assignedText['food_reserveTable'] || assignedText['food_reserve_table'],
|
|
1526
|
+
viewMenu: assignedText['food_viewMenu'] || assignedText['food_view_menu'],
|
|
1527
|
+
chefRecommendations: assignedText['food_chefRecommendations'] || assignedText['food_chef_recommendations'],
|
|
1528
|
+
ourPhilosophy: assignedText['food_ourPhilosophy'] || assignedText['food_our_philosophy'],
|
|
1529
|
+
meetChef: assignedText['food_meetChef'] || assignedText['food_meet_chef'],
|
|
1530
|
+
menuCategories: assignedText['food_menuCategories'] || assignedText['food_menu_categories'],
|
|
1531
|
+
},
|
|
1532
|
+
electronics: {
|
|
1533
|
+
newArrivals: assignedText['electronics_new_arrivals'],
|
|
1534
|
+
techSpecs: assignedText['electronics_tech_specs'],
|
|
1535
|
+
compare: assignedText['electronics_compare'],
|
|
1536
|
+
addToCompare: assignedText['electronics_add_to_compare'],
|
|
1537
|
+
removeFromCompare: assignedText['electronics_remove_from_compare'],
|
|
1538
|
+
brands: assignedText['electronics_brands'],
|
|
1539
|
+
},
|
|
1540
|
+
};
|
|
1541
|
+
// Remove undefined values to keep the config clean
|
|
1542
|
+
const cleanConfig = (obj) => {
|
|
1543
|
+
if (obj === null || typeof obj !== 'object')
|
|
1544
|
+
return obj;
|
|
1545
|
+
if (Array.isArray(obj))
|
|
1546
|
+
return obj.map(cleanConfig).filter(v => v !== undefined);
|
|
1547
|
+
const newObj = {};
|
|
1548
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
1549
|
+
const cleaned = cleanConfig(value);
|
|
1550
|
+
if (cleaned !== undefined && !(typeof cleaned === 'object' && cleaned !== null && Object.keys(cleaned).length === 0)) {
|
|
1551
|
+
newObj[key] = cleaned;
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
return Object.keys(newObj).length > 0 ? newObj : undefined;
|
|
1555
|
+
};
|
|
1556
|
+
const cleanTextConfig = cleanConfig(textConfig);
|
|
1557
|
+
// Transform theme colors if provided
|
|
1558
|
+
let themeColors;
|
|
1559
|
+
if (layoutContent.themeColors && typeof layoutContent.themeColors === 'object') {
|
|
1560
|
+
themeColors = {
|
|
1561
|
+
background: layoutContent.themeColors.background || undefined,
|
|
1562
|
+
text: layoutContent.themeColors.text || undefined,
|
|
1563
|
+
border: layoutContent.themeColors.border || undefined,
|
|
1564
|
+
gradient: layoutContent.themeColors.gradient || undefined,
|
|
1565
|
+
accent: layoutContent.themeColors.accent || undefined,
|
|
1566
|
+
layoutSpecific: layoutContent.themeColors.layoutSpecific || undefined,
|
|
1567
|
+
};
|
|
1568
|
+
// Remove undefined categories
|
|
1569
|
+
if (Object.values(themeColors).every(v => v === undefined)) {
|
|
1570
|
+
themeColors = undefined;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
// Also set hero at top level for backward compatibility (if sections.hero exists)
|
|
1574
|
+
const hero = sections?.hero ? {
|
|
1575
|
+
show: sections.hero.show !== false,
|
|
1576
|
+
showCTA: sections.hero.showCTA !== false,
|
|
1577
|
+
showSecondaryCTA: sections.hero.showSecondaryCTA !== false,
|
|
1578
|
+
autoPlay: sections.hero.autoPlay !== false,
|
|
1579
|
+
showBadges: sections.hero.showBadges === true,
|
|
1580
|
+
sliders: sections.hero.sliders,
|
|
1581
|
+
} : undefined;
|
|
1582
|
+
return {
|
|
1583
|
+
hero, // Top-level hero for backward compatibility
|
|
1584
|
+
sections,
|
|
1585
|
+
assignedAssets,
|
|
1586
|
+
assignedText, // Preserve assignedText for direct access via getTextContent()
|
|
1587
|
+
assetRequirements: layoutContent.assetRequirements,
|
|
1588
|
+
text: Object.keys(cleanTextConfig).length > 0 ? cleanTextConfig : undefined,
|
|
1589
|
+
themeColors,
|
|
1590
|
+
version: layoutContent.version, // Preserve version for layout version checking
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Async function to get store configuration
|
|
1595
|
+
* - For demo stores: uses mock data from mock-stores
|
|
1596
|
+
* - For real stores: fetches from API and transforms to StoreConfig
|
|
1597
|
+
* - Returns null storeConfig if store not found (for 404 handling)
|
|
1598
|
+
* - Returns maintenanceMode flag when store exists but is not published/active
|
|
1599
|
+
*/
|
|
1600
|
+
export async function getStoreConfigAsync(storeSlug) {
|
|
1601
|
+
try {
|
|
1602
|
+
console.log(`[StoreConfig] Loading store config for slug: ${storeSlug}`);
|
|
1603
|
+
if (shouldUseAPI(storeSlug)) {
|
|
1604
|
+
// Use API for non-demo stores
|
|
1605
|
+
const baseSlug = getBaseStoreSlug(storeSlug);
|
|
1606
|
+
const { store: apiStore, maintenanceMode } = await storeService.getStoreBySlug(baseSlug);
|
|
1607
|
+
console.log(`[StoreConfig] Store loaded from API: ${apiStore.name} (ID: ${apiStore.id})`);
|
|
1608
|
+
const storeConfig = transformStoreResponseToConfig(apiStore);
|
|
1609
|
+
// Fetch categories, products, and services in parallel
|
|
1610
|
+
const [categoriesResult, productsResult, servicesResult] = await Promise.allSettled([
|
|
1611
|
+
// Fetch categories (backend Category entity doesn't have isActive field, so include all)
|
|
1612
|
+
categoryService.getCategories(apiStore.id).then((apiCategories) => apiCategories.map(transformCategoryToStoreCategory)),
|
|
1613
|
+
// Fetch products (backend already filters for isActive: true)
|
|
1614
|
+
productService
|
|
1615
|
+
.getProducts({
|
|
1616
|
+
storeId: apiStore.id,
|
|
1617
|
+
limit: 1000, // Fetch a large number to get all products for the store config
|
|
1618
|
+
})
|
|
1619
|
+
.then((response) => response.data.map((product) => transformProductToStoreProduct(product))),
|
|
1620
|
+
// Fetch services (backend already filters for isActive: true)
|
|
1621
|
+
serviceService
|
|
1622
|
+
.getServices(apiStore.id)
|
|
1623
|
+
.then((apiServices) => apiServices.map(transformServiceToStoreService)),
|
|
1624
|
+
]);
|
|
1625
|
+
// Extract results with graceful degradation
|
|
1626
|
+
const categories = categoriesResult.status === 'fulfilled' ? categoriesResult.value : [];
|
|
1627
|
+
const products = productsResult.status === 'fulfilled' ? productsResult.value : [];
|
|
1628
|
+
const services = servicesResult.status === 'fulfilled' ? servicesResult.value : [];
|
|
1629
|
+
// Log errors if any occurred
|
|
1630
|
+
if (categoriesResult.status === 'rejected') {
|
|
1631
|
+
console.error('[StoreConfig] Failed to fetch categories:', categoriesResult.reason);
|
|
1632
|
+
console.error('[StoreConfig] Category error details:', {
|
|
1633
|
+
message: categoriesResult.reason?.message,
|
|
1634
|
+
status: categoriesResult.reason?.status,
|
|
1635
|
+
response: categoriesResult.reason?.response?.data,
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
else {
|
|
1639
|
+
console.log(`[StoreConfig] Successfully fetched ${categories.length} categories for store ${apiStore.id} (${apiStore.slug})`);
|
|
1640
|
+
if (categories.length === 0) {
|
|
1641
|
+
console.warn(`[StoreConfig] WARNING: No categories found for store ${apiStore.id}. This may indicate missing data in the database.`);
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
if (productsResult.status === 'rejected') {
|
|
1645
|
+
console.error('[StoreConfig] Failed to fetch products:', productsResult.reason);
|
|
1646
|
+
console.error('[StoreConfig] Product error details:', {
|
|
1647
|
+
message: productsResult.reason?.message,
|
|
1648
|
+
status: productsResult.reason?.status,
|
|
1649
|
+
response: productsResult.reason?.response?.data,
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
else {
|
|
1653
|
+
console.log(`[StoreConfig] Successfully fetched ${products.length} products for store ${apiStore.id} (${apiStore.slug})`);
|
|
1654
|
+
if (products.length === 0) {
|
|
1655
|
+
console.warn(`[StoreConfig] WARNING: No products found for store ${apiStore.id}. This may indicate missing data in the database.`);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
if (servicesResult.status === 'rejected') {
|
|
1659
|
+
console.error('[StoreConfig] Failed to fetch services:', servicesResult.reason);
|
|
1660
|
+
console.error('[StoreConfig] Service error details:', {
|
|
1661
|
+
message: servicesResult.reason?.message,
|
|
1662
|
+
status: servicesResult.reason?.status,
|
|
1663
|
+
response: servicesResult.reason?.response?.data,
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
else {
|
|
1667
|
+
console.log(`[StoreConfig] Successfully fetched ${services.length} services for store ${apiStore.id} (${apiStore.slug})`);
|
|
1668
|
+
if (services.length === 0) {
|
|
1669
|
+
console.warn(`[StoreConfig] WARNING: No services found for store ${apiStore.id}. This may indicate missing data in the database.`);
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
// Populate categories, products, and services in storeConfig
|
|
1673
|
+
storeConfig.categories = categories;
|
|
1674
|
+
storeConfig.products = products;
|
|
1675
|
+
storeConfig.services = services;
|
|
1676
|
+
console.log(`[StoreConfig] Final storeConfig populated with ${categories.length} categories, ${products.length} products, and ${services.length} services`);
|
|
1677
|
+
return {
|
|
1678
|
+
storeConfig,
|
|
1679
|
+
maintenanceMode: maintenanceMode || false,
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
else {
|
|
1683
|
+
// Use mock data for demo stores (always active and published)
|
|
1684
|
+
const baseSlug = getBaseStoreSlug(storeSlug);
|
|
1685
|
+
console.log(`[StoreConfig] Using mock data for demo store. Base slug: ${baseSlug}`);
|
|
1686
|
+
const storeConfig = getStoreConfig(baseSlug);
|
|
1687
|
+
if (storeConfig) {
|
|
1688
|
+
console.log(`[StoreConfig] Mock store loaded: ${storeConfig.name} with ${storeConfig.categories?.length || 0} categories and ${storeConfig.products?.length || 0} products`);
|
|
1689
|
+
}
|
|
1690
|
+
return {
|
|
1691
|
+
storeConfig,
|
|
1692
|
+
maintenanceMode: false, // Demo stores are always available
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
catch (error) {
|
|
1697
|
+
// Check if it's a 404 (store not found) vs other error
|
|
1698
|
+
const isNotFound = error?.status === 404 || error?.response?.status === 404;
|
|
1699
|
+
if (isNotFound) {
|
|
1700
|
+
// Store truly doesn't exist
|
|
1701
|
+
return {
|
|
1702
|
+
storeConfig: null,
|
|
1703
|
+
maintenanceMode: false,
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
// Other API errors - log and return null
|
|
1707
|
+
console.error('Failed to fetch store config:', error);
|
|
1708
|
+
return {
|
|
1709
|
+
storeConfig: null,
|
|
1710
|
+
maintenanceMode: false,
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
}
|