@salla.sa/twilight-theme-engine 1.0.84 → 1.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddToCartForm-JUMFLSKN.js → AddToCartForm-5X2WZDWR.js} +3 -3
- package/dist/{AddToCartForm-JUMFLSKN.js.map → AddToCartForm-5X2WZDWR.js.map} +1 -1
- package/dist/{BlogAuthorPage-LFAUMKC7.js → BlogAuthorPage-LO7FSSJR.js} +12 -10
- package/dist/BlogAuthorPage-LO7FSSJR.js.map +1 -0
- package/dist/{BlogCategoryPage-NWYFFPCD.js → BlogCategoryPage-KKFQ3PGR.js} +12 -10
- package/dist/BlogCategoryPage-KKFQ3PGR.js.map +1 -0
- package/dist/{BlogPage-BOHXFV7E.js → BlogPage-VLF3NSGE.js} +11 -9
- package/dist/BlogPage-VLF3NSGE.js.map +1 -0
- package/dist/{BlogSinglePage-FYEXQPMB.js → BlogSinglePage-AVK535IW.js} +11 -9
- package/dist/BlogSinglePage-AVK535IW.js.map +1 -0
- package/dist/{BlogTagPage-DAM3RNVA.js → BlogTagPage-F3T4D7RH.js} +12 -10
- package/dist/BlogTagPage-F3T4D7RH.js.map +1 -0
- package/dist/{BrandsPage-GAKQCE6O.js → BrandsPage-LVSBZSVC.js} +11 -9
- package/dist/BrandsPage-LVSBZSVC.js.map +1 -0
- package/dist/{Breadcrumb-NAYSZNRV.js → Breadcrumb-VLFTXRFC.js} +11 -9
- package/dist/Breadcrumb-VLFTXRFC.js.map +1 -0
- package/dist/{CartItem-ZRVLIZT3.js → CartItem-G3H34GW6.js} +11 -9
- package/dist/CartItem-G3H34GW6.js.map +1 -0
- package/dist/{CartSummary-U2TVLG35.js → CartSummary-VH37RPUI.js} +11 -9
- package/dist/CartSummary-VH37RPUI.js.map +1 -0
- package/dist/{Copyright-2LSBADZD.js → Copyright-HE5ZWINZ.js} +3 -3
- package/dist/{Copyright-2LSBADZD.js.map → Copyright-HE5ZWINZ.js.map} +1 -1
- package/dist/{CustomerLayout-WSKXWI7D.js → CustomerLayout-LKBLOAVW.js} +11 -9
- package/dist/CustomerLayout-LKBLOAVW.js.map +1 -0
- package/dist/{Footer-ONNRJU4G.js → Footer-HHXAST72.js} +5 -5
- package/dist/{Footer-ONNRJU4G.js.map → Footer-HHXAST72.js.map} +1 -1
- package/dist/{Header-C6VXLLUC.js → Header-GEVZM2YG.js} +8 -6
- package/dist/{Header-C6VXLLUC.js.map → Header-GEVZM2YG.js.map} +1 -1
- package/dist/{LoyaltyPage-IG5KSYNO.js → LoyaltyPage-M5CT3CFD.js} +11 -9
- package/dist/LoyaltyPage-M5CT3CFD.js.map +1 -0
- package/dist/{LoyaltyPointsPage-RKO56ZER.js → LoyaltyPointsPage-SDJB52U6.js} +10 -3
- package/dist/LoyaltyPointsPage-SDJB52U6.js.map +1 -0
- package/dist/{MainMenu-USOYTKPU.js → MainMenu-I7EYS752.js} +3 -3
- package/dist/{MainMenu-USOYTKPU.js.map → MainMenu-I7EYS752.js.map} +1 -1
- package/dist/{MasterLayout-2W24ACEK.js → MasterLayout-QDK4T3NE.js} +11 -9
- package/dist/{MasterLayout-2W24ACEK.js.map → MasterLayout-QDK4T3NE.js.map} +1 -1
- package/dist/{MobileMenu-E4X2GOZ3.js → MobileMenu-7VTCWAVJ.js} +11 -9
- package/dist/MobileMenu-7VTCWAVJ.js.map +1 -0
- package/dist/{NotificationsPage-BJ5XVWEG.js → NotificationsPage-QCABE6QD.js} +11 -9
- package/dist/NotificationsPage-QCABE6QD.js.map +1 -0
- package/dist/{OrderSinglePage-544E36FJ.js → OrderSinglePage-2HVBKBG4.js} +11 -9
- package/dist/OrderSinglePage-2HVBKBG4.js.map +1 -0
- package/dist/{OrdersPage-AFBWVTZU.js → OrdersPage-5MNCPCM3.js} +11 -9
- package/dist/OrdersPage-5MNCPCM3.js.map +1 -0
- package/dist/{PageSingle-H2EJIL74.js → PageSingle-EN5XIM2B.js} +3 -3
- package/dist/{PageSingle-H2EJIL74.js.map → PageSingle-EN5XIM2B.js.map} +1 -1
- package/dist/{ProductDetails-SDZHALU6.js → ProductDetails-UEWQPPDZ.js} +13 -6
- package/dist/ProductDetails-UEWQPPDZ.js.map +1 -0
- package/dist/{ProfilePage-V5KV6GQK.js → ProfilePage-TZSU3GHZ.js} +11 -9
- package/dist/ProfilePage-TZSU3GHZ.js.map +1 -0
- package/dist/{ReviewsPage-CXKJABXP.js → ReviewsPage-WYZ6CHF2.js} +3 -3
- package/dist/{ReviewsPage-CXKJABXP.js.map → ReviewsPage-WYZ6CHF2.js.map} +1 -1
- package/dist/{SeoCartWidget-JAV6M3X5.js → SeoCartWidget-5JR5RXQM.js} +11 -9
- package/dist/SeoCartWidget-5JR5RXQM.js.map +1 -0
- package/dist/{SettingsPage-43SUCLQR.js → SettingsPage-DIDRQXMM.js} +11 -9
- package/dist/SettingsPage-DIDRQXMM.js.map +1 -0
- package/dist/{StoreClosedNotification-MINBJOGZ.js → StoreClosedNotification-C2G32E34.js} +12 -10
- package/dist/{StoreClosedNotification-MINBJOGZ.js.map → StoreClosedNotification-C2G32E34.js.map} +1 -1
- package/dist/{TestimonialsPage-RLLIDLOA.js → TestimonialsPage-XPHFRBZ7.js} +3 -3
- package/dist/{TestimonialsPage-RLLIDLOA.js.map → TestimonialsPage-XPHFRBZ7.js.map} +1 -1
- package/dist/{ThankYouPage-52SSZ7FV.js → ThankYouPage-UA6YYFB2.js} +11 -9
- package/dist/ThankYouPage-UA6YYFB2.js.map +1 -0
- package/dist/{WalletPage-4AN4UJ52.js → WalletPage-AJVV7LVL.js} +11 -9
- package/dist/WalletPage-AJVV7LVL.js.map +1 -0
- package/dist/{WishlistPage-L6IYJUJZ.js → WishlistPage-UW6LJLSW.js} +11 -9
- package/dist/WishlistPage-UW6LJLSW.js.map +1 -0
- package/dist/api/advertisement.d.ts +33 -0
- package/dist/api/advertisement.d.ts.map +1 -0
- package/dist/api/advertisement.js +8 -0
- package/dist/api/advertisement.js.map +1 -0
- package/dist/boot/critical-style.d.ts +3 -0
- package/dist/boot/critical-style.d.ts.map +1 -0
- package/dist/boot/index.d.ts +15 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/boot.d.ts +1 -0
- package/dist/boot.js +69 -0
- package/dist/boot.js.map +1 -0
- package/dist/{chunk-R5BQDCDK.js → chunk-2HCCIHU7.js} +4 -4
- package/dist/{chunk-R5BQDCDK.js.map → chunk-2HCCIHU7.js.map} +1 -1
- package/dist/chunk-4FJGZQD3.js +6 -0
- package/dist/chunk-4FJGZQD3.js.map +1 -0
- package/dist/{chunk-UNEZZMQA.js → chunk-4WVJJ7SN.js} +20 -4
- package/dist/chunk-4WVJJ7SN.js.map +1 -0
- package/dist/{chunk-FFWSQJLV.js → chunk-BAYGWTNM.js} +3 -3
- package/dist/{chunk-FFWSQJLV.js.map → chunk-BAYGWTNM.js.map} +1 -1
- package/dist/{chunk-WSRVPR7V.js → chunk-CLBFF2CY.js} +3 -3
- package/dist/{chunk-WSRVPR7V.js.map → chunk-CLBFF2CY.js.map} +1 -1
- package/dist/chunk-DBW7XXNE.js +103 -0
- package/dist/chunk-DBW7XXNE.js.map +1 -0
- package/dist/{chunk-CCUE2FMU.js → chunk-DBXH3EMJ.js} +3 -3
- package/dist/{chunk-CCUE2FMU.js.map → chunk-DBXH3EMJ.js.map} +1 -1
- package/dist/{chunk-MECSOKS7.js → chunk-E26YG3AO.js} +4 -4
- package/dist/{chunk-MECSOKS7.js.map → chunk-E26YG3AO.js.map} +1 -1
- package/dist/{chunk-22SH7OVF.js → chunk-E7WWO3V3.js} +3 -3
- package/dist/{chunk-22SH7OVF.js.map → chunk-E7WWO3V3.js.map} +1 -1
- package/dist/{chunk-IC6XW3PD.js → chunk-HQ7WA37L.js} +7 -7
- package/dist/{chunk-IC6XW3PD.js.map → chunk-HQ7WA37L.js.map} +1 -1
- package/dist/chunk-IVBOLREE.js +29 -0
- package/dist/chunk-IVBOLREE.js.map +1 -0
- package/dist/{chunk-RRGEASAL.js → chunk-KP3VYG4F.js} +6 -6
- package/dist/{chunk-RRGEASAL.js.map → chunk-KP3VYG4F.js.map} +1 -1
- package/dist/{chunk-EFF2WO6W.js → chunk-PWTXR4RR.js} +10 -10
- package/dist/{chunk-EFF2WO6W.js.map → chunk-PWTXR4RR.js.map} +1 -1
- package/dist/chunk-QJYUTRAQ.js +14 -0
- package/dist/{chunk-4EA56R6I.js.map → chunk-QJYUTRAQ.js.map} +1 -1
- package/dist/{chunk-YFQUSAET.js → chunk-U55ZJC2X.js} +4 -4
- package/dist/{chunk-YFQUSAET.js.map → chunk-U55ZJC2X.js.map} +1 -1
- package/dist/{chunk-R54GSKJS.js → chunk-WSDG4ZRI.js} +30 -16
- package/dist/chunk-WSDG4ZRI.js.map +1 -0
- package/dist/{chunk-3PWARKZX.js → chunk-X54QP332.js} +8 -8
- package/dist/chunk-X54QP332.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +9 -7
- package/dist/components/home/HomePageRenderer.d.ts +6 -0
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/index.js +11 -9
- package/dist/components/layout/PageAdvertisements.d.ts +7 -0
- package/dist/components/layout/PageAdvertisements.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +8 -1
- package/dist/components/product/index.js +10 -8
- package/dist/components/store/index.js +11 -9
- package/dist/components/store/index.js.map +1 -1
- package/dist/{document-class-SD6BUMZN.js → document-class-7AXAAWGZ.js} +6 -5
- package/dist/{document-class-SD6BUMZN.js.map → document-class-7AXAAWGZ.js.map} +1 -1
- package/dist/hooks/index.js +9 -7
- package/dist/hooks/useGtm.js +9 -7
- package/dist/hooks/useMoney.js +9 -7
- package/dist/hooks/useStore.js +9 -7
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/{not-found-TUU7WQLL.js → not-found-3EEMQZMU.js} +11 -9
- package/dist/not-found-3EEMQZMU.js.map +1 -0
- package/dist/providers/index.js +9 -7
- package/dist/routes/account/orders.js +1 -1
- package/dist/routes/account.js +6 -6
- package/dist/routes/blog.js +5 -5
- package/dist/routes/brands.js +1 -1
- package/dist/routes/cart.js +13 -11
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +12 -10
- package/dist/routes/loyalty.js +2 -2
- package/dist/routes/page.js +1 -1
- package/dist/routes/product-listing.js +11 -9
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +11 -9
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/root/beforeLoad.d.ts +2 -2
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/root/head.d.ts.map +1 -1
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +1 -1
- package/dist/skeleton.js +12 -10
- package/dist/tanstack/document-class.d.ts.map +1 -1
- package/dist/tanstack/index.d.ts +1 -0
- package/dist/tanstack/index.d.ts.map +1 -1
- package/dist/tanstack/stylesheet.d.ts +15 -0
- package/dist/tanstack/stylesheet.d.ts.map +1 -0
- package/dist/tanstack.js +34 -5
- package/dist/tanstack.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +12 -3
- package/tailwind/components/Component.tsx.txt +21 -0
- package/tailwind/components/ComponentRegistry.ts.txt +66 -0
- package/tailwind/components/cart/CartItem.tsx.txt +211 -0
- package/tailwind/components/cart/CartSummary.tsx.txt +269 -0
- package/tailwind/components/cart/PreOrderNotification.tsx.txt +16 -0
- package/tailwind/components/cart/PriceQuoteButton.tsx.txt +21 -0
- package/tailwind/components/cart/SeoCartWidget.tsx.txt +99 -0
- package/tailwind/components/cart/index.ts.txt +11 -0
- package/tailwind/components/cart/lazy.ts.txt +15 -0
- package/tailwind/components/collapse/Collapse.tsx.txt +95 -0
- package/tailwind/components/collapse/index.ts.txt +41 -0
- package/tailwind/components/common/Breadcrumb.tsx.txt +27 -0
- package/tailwind/components/common/BreadcrumbJsonLd.tsx.txt +40 -0
- package/tailwind/components/common/BreadcrumbTrail.tsx.txt +97 -0
- package/tailwind/components/common/CurrencySymbol.tsx.txt +8 -0
- package/tailwind/components/common/DeferredData.tsx.txt +122 -0
- package/tailwind/components/common/ErrorPage.tsx.txt +69 -0
- package/tailwind/components/common/Image.tsx.txt +119 -0
- package/tailwind/components/common/Link.tsx.txt +36 -0
- package/tailwind/components/common/Link.types.ts.txt +85 -0
- package/tailwind/components/common/NoContent.tsx.txt +27 -0
- package/tailwind/components/common/RenderWhenVisible.tsx.txt +92 -0
- package/tailwind/components/common/index.ts.txt +42 -0
- package/tailwind/components/common/lazy.ts.txt +28 -0
- package/tailwind/components/defineComponent.ts.txt +32 -0
- package/tailwind/components/drawer/Drawer.tsx.txt +219 -0
- package/tailwind/components/drawer/index.ts.txt +38 -0
- package/tailwind/components/dropdown/Dropdown.tsx.txt +166 -0
- package/tailwind/components/dropdown/index.ts.txt +40 -0
- package/tailwind/components/home/BundleComponent.tsx.txt +35 -0
- package/tailwind/components/home/ComponentErrorBoundary.tsx.txt +98 -0
- package/tailwind/components/home/FeaturedProductsStyle1.tsx.txt +125 -0
- package/tailwind/components/home/FeaturedProductsStyle2.tsx.txt +127 -0
- package/tailwind/components/home/FeaturedProductsStyle3.tsx.txt +71 -0
- package/tailwind/components/home/FixedBanner.tsx.txt +68 -0
- package/tailwind/components/home/FixedProducts.tsx.txt +72 -0
- package/tailwind/components/home/HomePageRenderer.tsx.txt +284 -0
- package/tailwind/components/home/PageBlocks.tsx.txt +24 -0
- package/tailwind/components/home/ParallaxBackground.tsx.txt +50 -0
- package/tailwind/components/home/PhotosSlider.tsx.txt +61 -0
- package/tailwind/components/home/ProductsSlider.tsx.txt +87 -0
- package/tailwind/components/home/ReorderProducts.tsx.txt +38 -0
- package/tailwind/components/home/SquarePhotos.tsx.txt +68 -0
- package/tailwind/components/home/StoreFeatures.tsx.txt +34 -0
- package/tailwind/components/home/Testimonials.tsx.txt +36 -0
- package/tailwind/components/home/Youtube.tsx.txt +48 -0
- package/tailwind/components/home/index.ts.txt +50 -0
- package/tailwind/components/home/lazy.ts.txt +17 -0
- package/tailwind/components/home/register.ts.txt +44 -0
- package/tailwind/components/home/reorder-hooks.ts.txt +52 -0
- package/tailwind/components/home/types.ts.txt +4 -0
- package/tailwind/components/layout/Copyright.tsx.txt +23 -0
- package/tailwind/components/layout/CustomerLayout.tsx.txt +91 -0
- package/tailwind/components/layout/Footer.tsx.txt +343 -0
- package/tailwind/components/layout/Header.tsx.txt +154 -0
- package/tailwind/components/layout/MasterLayout.tsx.txt +63 -0
- package/tailwind/components/layout/PageAdvertisements.tsx.txt +131 -0
- package/tailwind/components/layout/WidgetHead.tsx.txt +53 -0
- package/tailwind/components/layout/index.ts.txt +27 -0
- package/tailwind/components/layout/lazy.ts.txt +25 -0
- package/tailwind/components/layout/types.ts.txt +11 -0
- package/tailwind/components/modal/ImageModal.tsx.txt +70 -0
- package/tailwind/components/modal/Modal.tsx.txt +245 -0
- package/tailwind/components/modal/index.ts.txt +39 -0
- package/tailwind/components/modal/lazy.ts.txt +10 -0
- package/tailwind/components/navigation/MainMenu.tsx.txt +94 -0
- package/tailwind/components/navigation/MobileMenu.tsx.txt +160 -0
- package/tailwind/components/navigation/index.ts.txt +4 -0
- package/tailwind/components/navigation/lazy.ts.txt +11 -0
- package/tailwind/components/product/AddToCartForm.tsx.txt +365 -0
- package/tailwind/components/product/ProductCard.tsx.txt +305 -0
- package/tailwind/components/product/ProductDetails.tsx.txt +267 -0
- package/tailwind/components/product/ProductGallery.tsx.txt +234 -0
- package/tailwind/components/product/index.ts.txt +15 -0
- package/tailwind/components/product/lazy.ts.txt +9 -0
- package/tailwind/components/snippets/AppsSnippets.tsx.txt +225 -0
- package/tailwind/components/snippets/SallaSdkScripts.tsx.txt +14 -0
- package/tailwind/components/snippets/index.ts.txt +4 -0
- package/tailwind/components/store/StoreClosedNotification.tsx.txt +73 -0
- package/tailwind/components/store/index.ts.txt +8 -0
- package/tailwind/components/store/lazy.ts.txt +8 -0
- package/tailwind/components/toast/Toaster.tsx.txt +177 -0
- package/tailwind/components/toast/index.ts.txt +10 -0
- package/tailwind/components/toast/types.ts.txt +38 -0
- package/tailwind/components/toast/useToast.ts.txt +61 -0
- package/tailwind/components/tracking/GoogleTag.tsx.txt +77 -0
- package/tailwind/components/tracking/SiftSnippet.tsx.txt +49 -0
- package/tailwind/components/tracking/TwilightBundles.tsx.txt +67 -0
- package/tailwind/components/tracking/index.ts.txt +11 -0
- package/tailwind/components/tracking/lazy.ts.txt +11 -0
- package/tailwind/components/useComponent.ts.txt +12 -0
- package/tailwind/routes/account/index.tsx.txt +16 -0
- package/tailwind/routes/account/notifications/NotificationsPage.tsx.txt +54 -0
- package/tailwind/routes/account/notifications/index.tsx.txt +39 -0
- package/tailwind/routes/account/notifications/loader.ts.txt +22 -0
- package/tailwind/routes/account/notifications/types.ts.txt +18 -0
- package/tailwind/routes/account/orders/OrderSinglePage.tsx.txt +181 -0
- package/tailwind/routes/account/orders/OrdersPage.tsx.txt +28 -0
- package/tailwind/routes/account/orders/index.tsx.txt +86 -0
- package/tailwind/routes/account/orders/loader.ts.txt +66 -0
- package/tailwind/routes/account/orders/single/OrderActions.tsx.txt +197 -0
- package/tailwind/routes/account/orders/single/OrderHeader.tsx.txt +143 -0
- package/tailwind/routes/account/orders/single/OrderItemRow.tsx.txt +209 -0
- package/tailwind/routes/account/orders/single/OrderSections.tsx.txt +215 -0
- package/tailwind/routes/account/orders/single/types.ts.txt +38 -0
- package/tailwind/routes/account/orders/types.ts.txt +29 -0
- package/tailwind/routes/account/profile/ProfilePage.tsx.txt +30 -0
- package/tailwind/routes/account/profile/index.tsx.txt +39 -0
- package/tailwind/routes/account/profile/loader.ts.txt +16 -0
- package/tailwind/routes/account/profile/types.ts.txt +5 -0
- package/tailwind/routes/account/settings/SettingsPage.tsx.txt +13 -0
- package/tailwind/routes/account/settings/index.tsx.txt +39 -0
- package/tailwind/routes/account/settings/loader.ts.txt +13 -0
- package/tailwind/routes/account/settings/types.ts.txt +5 -0
- package/tailwind/routes/account/types.ts.txt +320 -0
- package/tailwind/routes/account/wallet/WalletPage.tsx.txt +195 -0
- package/tailwind/routes/account/wallet/index.tsx.txt +38 -0
- package/tailwind/routes/account/wallet/loader.ts.txt +27 -0
- package/tailwind/routes/account/wallet/types.ts.txt +11 -0
- package/tailwind/routes/account/wishlist/WishlistPage.tsx.txt +314 -0
- package/tailwind/routes/account/wishlist/WishlistShare.tsx.txt +248 -0
- package/tailwind/routes/account/wishlist/index.tsx.txt +40 -0
- package/tailwind/routes/account/wishlist/loader.ts.txt +26 -0
- package/tailwind/routes/account/wishlist/types.ts.txt +9 -0
- package/tailwind/routes/blog/BlogAuthorPage.tsx.txt +82 -0
- package/tailwind/routes/blog/BlogCategoryPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogPage.tsx.txt +191 -0
- package/tailwind/routes/blog/BlogSinglePage.tsx.txt +168 -0
- package/tailwind/routes/blog/BlogTagPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogTags.tsx.txt +54 -0
- package/tailwind/routes/blog/components.tsx.txt +87 -0
- package/tailwind/routes/blog/index.tsx.txt +238 -0
- package/tailwind/routes/blog/loader.ts.txt +173 -0
- package/tailwind/routes/blog/types.ts.txt +106 -0
- package/tailwind/routes/brands/BrandsPage.tsx.txt +179 -0
- package/tailwind/routes/brands/index.tsx.txt +47 -0
- package/tailwind/routes/brands/loader.ts.txt +14 -0
- package/tailwind/routes/brands/types.ts.txt +53 -0
- package/tailwind/routes/cart/CartPage.tsx.txt +112 -0
- package/tailwind/routes/cart/index.tsx.txt +39 -0
- package/tailwind/routes/cart/loader.ts.txt +15 -0
- package/tailwind/routes/cart/types.ts.txt +6 -0
- package/tailwind/routes/home/HomePage.tsx.txt +53 -0
- package/tailwind/routes/home/index.tsx.txt +56 -0
- package/tailwind/routes/home/loader.ts.txt +24 -0
- package/tailwind/routes/home/types.ts.txt +11 -0
- package/tailwind/routes/index.ts.txt +94 -0
- package/tailwind/routes/lazy.ts.txt +105 -0
- package/tailwind/routes/loyalty/LoyaltyPage.tsx.txt +17 -0
- package/tailwind/routes/loyalty/LoyaltyPointsPage.tsx.txt +11 -0
- package/tailwind/routes/loyalty/index.tsx.txt +81 -0
- package/tailwind/routes/loyalty/loader.ts.txt +53 -0
- package/tailwind/routes/loyalty/types.ts.txt +109 -0
- package/tailwind/routes/not-found.tsx.txt +50 -0
- package/tailwind/routes/page/PageSingle.tsx.txt +34 -0
- package/tailwind/routes/page/index.tsx.txt +60 -0
- package/tailwind/routes/page/loader.ts.txt +19 -0
- package/tailwind/routes/page/types.ts.txt +34 -0
- package/tailwind/routes/product/ProductPage.tsx.txt +77 -0
- package/tailwind/routes/product/index.tsx.txt +157 -0
- package/tailwind/routes/product/loader.ts.txt +35 -0
- package/tailwind/routes/product/types.ts.txt +6 -0
- package/tailwind/routes/product-listing/ProductListPage.tsx.txt +321 -0
- package/tailwind/routes/product-listing/index.tsx.txt +95 -0
- package/tailwind/routes/product-listing/loader.ts.txt +323 -0
- package/tailwind/routes/product-listing/types.ts.txt +96 -0
- package/tailwind/routes/product-listing/useAppliedFilters.ts.txt +130 -0
- package/tailwind/routes/product-short-link.ts.txt +104 -0
- package/tailwind/routes/root/beforeLoad.ts.txt +354 -0
- package/tailwind/routes/root/head.ts.txt +424 -0
- package/tailwind/routes/root/index.ts.txt +2 -0
- package/tailwind/routes/seo-redirects.ts.txt +82 -0
- package/tailwind/routes/testimonials/ReviewsPage.tsx.txt +12 -0
- package/tailwind/routes/testimonials/TestimonialsPage.tsx.txt +80 -0
- package/tailwind/routes/testimonials/index.tsx.txt +80 -0
- package/tailwind/routes/testimonials/loader.ts.txt +29 -0
- package/tailwind/routes/testimonials/types.ts.txt +9 -0
- package/tailwind/routes/thank-you/ThankYouPage.tsx.txt +241 -0
- package/tailwind/routes/thank-you/index.tsx.txt +49 -0
- package/tailwind/routes/thank-you/loader.ts.txt +40 -0
- package/tailwind/routes/thank-you/types.ts.txt +16 -0
- package/tailwind/routes/types.ts.txt +41 -0
- package/dist/BlogAuthorPage-LFAUMKC7.js.map +0 -1
- package/dist/BlogCategoryPage-NWYFFPCD.js.map +0 -1
- package/dist/BlogPage-BOHXFV7E.js.map +0 -1
- package/dist/BlogSinglePage-FYEXQPMB.js.map +0 -1
- package/dist/BlogTagPage-DAM3RNVA.js.map +0 -1
- package/dist/BrandsPage-GAKQCE6O.js.map +0 -1
- package/dist/Breadcrumb-NAYSZNRV.js.map +0 -1
- package/dist/CartItem-ZRVLIZT3.js.map +0 -1
- package/dist/CartSummary-U2TVLG35.js.map +0 -1
- package/dist/CustomerLayout-WSKXWI7D.js.map +0 -1
- package/dist/LoyaltyPage-IG5KSYNO.js.map +0 -1
- package/dist/LoyaltyPointsPage-RKO56ZER.js.map +0 -1
- package/dist/MobileMenu-E4X2GOZ3.js.map +0 -1
- package/dist/NotificationsPage-BJ5XVWEG.js.map +0 -1
- package/dist/OrderSinglePage-544E36FJ.js.map +0 -1
- package/dist/OrdersPage-AFBWVTZU.js.map +0 -1
- package/dist/ProductDetails-SDZHALU6.js.map +0 -1
- package/dist/ProfilePage-V5KV6GQK.js.map +0 -1
- package/dist/SeoCartWidget-JAV6M3X5.js.map +0 -1
- package/dist/SettingsPage-43SUCLQR.js.map +0 -1
- package/dist/ThankYouPage-52SSZ7FV.js.map +0 -1
- package/dist/WalletPage-4AN4UJ52.js.map +0 -1
- package/dist/WishlistPage-L6IYJUJZ.js.map +0 -1
- package/dist/chunk-3PWARKZX.js.map +0 -1
- package/dist/chunk-4EA56R6I.js +0 -14
- package/dist/chunk-R54GSKJS.js.map +0 -1
- package/dist/chunk-UNEZZMQA.js.map +0 -1
- package/dist/not-found-TUU7WQLL.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { registry } from './ComponentRegistry';
|
|
3
|
+
|
|
4
|
+
export interface ComponentProps {
|
|
5
|
+
name: string;
|
|
6
|
+
fallback?: React.ReactNode;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Component({ name, fallback = null, ...props }: ComponentProps): React.ReactNode {
|
|
11
|
+
const ResolvedComponent = registry.resolve(name);
|
|
12
|
+
|
|
13
|
+
if (!ResolvedComponent) {
|
|
14
|
+
if (process.env.NODE_ENV === 'development') {
|
|
15
|
+
window.salla?.logger?.warn(`Component::"${name}" not found in registry`);
|
|
16
|
+
}
|
|
17
|
+
return fallback;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return <ResolvedComponent {...props} />;
|
|
21
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ComponentType, ComponentDefinition } from '../types';
|
|
2
|
+
|
|
3
|
+
class ComponentRegistry {
|
|
4
|
+
private components = new Map<string, ComponentDefinition>();
|
|
5
|
+
|
|
6
|
+
register<P = Record<string, unknown>>(name: string, component: ComponentType<P>): void {
|
|
7
|
+
this.components.set(name, {
|
|
8
|
+
component: component as ComponentType,
|
|
9
|
+
displayName: name,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override<P = Record<string, unknown>>(name: string, component: ComponentType<P>): void {
|
|
14
|
+
const existing = this.components.get(name);
|
|
15
|
+
if (existing) {
|
|
16
|
+
this.components.set(name, {
|
|
17
|
+
component: component as ComponentType,
|
|
18
|
+
displayName: name,
|
|
19
|
+
original: existing,
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
this.register(name, component);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
resolve<P = Record<string, unknown>>(name: string): ComponentType<P> | null {
|
|
27
|
+
const definition = this.components.get(name);
|
|
28
|
+
return (definition?.component as ComponentType<P>) ?? null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getOriginal<P = Record<string, unknown>>(name: string): ComponentType<P> | null {
|
|
32
|
+
const definition = this.components.get(name);
|
|
33
|
+
return (definition?.original?.component as ComponentType<P>) ?? null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
has(name: string): boolean {
|
|
37
|
+
return this.components.has(name);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
list(): string[] {
|
|
41
|
+
return Array.from(this.components.keys());
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
listByPrefix(prefix: string): string[] {
|
|
45
|
+
return this.list().filter((name) => name.startsWith(prefix));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
clear(): void {
|
|
49
|
+
this.components.clear();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
remove(name: string): boolean {
|
|
53
|
+
return this.components.delete(name);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const registry = new ComponentRegistry();
|
|
58
|
+
|
|
59
|
+
export { ComponentRegistry };
|
|
60
|
+
|
|
61
|
+
export const COMPONENT_KEYS = {
|
|
62
|
+
PRODUCT_CARD: 'product:card',
|
|
63
|
+
PRODUCT_GALLERY: 'product:gallery',
|
|
64
|
+
PRODUCT_LIST_PAGE: 'product:list-page',
|
|
65
|
+
PRODUCT_LIST_SKELETON: 'product:list-skeleton',
|
|
66
|
+
} as const;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import type { Money, CartItem as CartItemType } from '../../types';
|
|
2
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
3
|
+
import { useMoney } from '../../hooks/useMoney';
|
|
4
|
+
import { Link, Image } from '../common';
|
|
5
|
+
import { SallaCartItemOffers } from '@salla.sa/twilight-components-react/cart-item-offers';
|
|
6
|
+
import { SallaQuantityInput } from '@salla.sa/twilight-components-react/quantity-input';
|
|
7
|
+
import { SallaButton } from '@salla.sa/twilight-components-react/button';
|
|
8
|
+
import { SallaProductOptions } from '@salla.sa/twilight-components-react/product-options';
|
|
9
|
+
import { useHostAttributes } from '@salla.sa/twilight-theme-engine/hooks/useHostAttributes';
|
|
10
|
+
|
|
11
|
+
interface CartItemProps {
|
|
12
|
+
item: CartItemType;
|
|
13
|
+
isFirst?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function toNumber(value: number | Money | undefined): number | undefined {
|
|
17
|
+
if (value === undefined) return undefined;
|
|
18
|
+
if (typeof value === 'number') return value;
|
|
19
|
+
return value.amount;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function moneyCurrency(value: number | Money | undefined): string | undefined {
|
|
23
|
+
if (typeof value !== 'object') return undefined;
|
|
24
|
+
return value.currency;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function CartItemPrices({ item }: { item: CartItemType }) {
|
|
28
|
+
const { format } = useMoney();
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex items-center gap-2 flex-wrap">
|
|
31
|
+
{item.offer && (
|
|
32
|
+
<span className="text-sm text-gray-500 line-through item-regular-price">
|
|
33
|
+
{format(toNumber(item.product_price), {
|
|
34
|
+
currency: moneyCurrency(item.product_price),
|
|
35
|
+
})}
|
|
36
|
+
</span>
|
|
37
|
+
)}
|
|
38
|
+
|
|
39
|
+
{item.is_on_sale && (
|
|
40
|
+
<span className="inline-flex gap-1 leading-4 text-sm text-gray-500 line-through item-original-price">
|
|
41
|
+
{format(toNumber(item.original_price), {
|
|
42
|
+
currency: moneyCurrency(item.original_price),
|
|
43
|
+
})}
|
|
44
|
+
</span>
|
|
45
|
+
)}
|
|
46
|
+
|
|
47
|
+
<span
|
|
48
|
+
className={`inline-flex gap-1 leading-4 item-price ${item.has_discount ? 'text-red-800' : 'text-sm text-gray-500'}`}
|
|
49
|
+
>
|
|
50
|
+
{format(toNumber(item.price), { currency: moneyCurrency(item.price) })}
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function CartItemQuantity({ item }: { item: CartItemType }) {
|
|
57
|
+
const { t } = useTranslation();
|
|
58
|
+
const quantityRef = useHostAttributes({
|
|
59
|
+
max: item.max_quantity,
|
|
60
|
+
value: item.quantity,
|
|
61
|
+
name: 'quantity',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (item.type === 'donating') return <span></span>;
|
|
65
|
+
|
|
66
|
+
if (item.is_hidden_quantity) {
|
|
67
|
+
return (
|
|
68
|
+
<>
|
|
69
|
+
<input
|
|
70
|
+
type="hidden"
|
|
71
|
+
value={item.quantity}
|
|
72
|
+
name="quantity"
|
|
73
|
+
aria-label={t('pages.products.quantity')}
|
|
74
|
+
/>
|
|
75
|
+
<span className="w-10 text-center">{item.quantity}</span>
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<SallaQuantityInput
|
|
82
|
+
// The loaded component reads `value` only once, so remount when the quantity changes.
|
|
83
|
+
key={`${item.id}-${item.quantity}`}
|
|
84
|
+
ref={quantityRef}
|
|
85
|
+
cartItemId={item.id}
|
|
86
|
+
max={item.max_quantity ?? undefined}
|
|
87
|
+
className="transition transition-color duration-300"
|
|
88
|
+
aria-label={t('pages.products.quantity')}
|
|
89
|
+
value={item.quantity}
|
|
90
|
+
name="quantity"
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function CartItemTotal({ item }: { item: CartItemType }) {
|
|
96
|
+
const { t } = useTranslation();
|
|
97
|
+
const { format } = useMoney();
|
|
98
|
+
const total = item.detailed_offers?.length ? item.total_special_price : item.total;
|
|
99
|
+
return (
|
|
100
|
+
<p className="text-primary flex-none font-bold text-sm rtl:md:pl-12 ltr:md:pr-12">
|
|
101
|
+
<span>{t('pages.cart.total')}:</span>
|
|
102
|
+
<span className="inline-block item-total">
|
|
103
|
+
{item.is_available
|
|
104
|
+
? format(toNumber(total), { currency: moneyCurrency(total) })
|
|
105
|
+
: t('pages.products.out_of_stock')}
|
|
106
|
+
</span>
|
|
107
|
+
</p>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const handleChange = (e: React.ChangeEvent<HTMLFormElement>) => {
|
|
112
|
+
window.salla?.form.onChange('cart.updateItem', e);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export function CartItem({ item, isFirst = false }: CartItemProps) {
|
|
116
|
+
const { t } = useTranslation();
|
|
117
|
+
|
|
118
|
+
const handleDelete = async () => {
|
|
119
|
+
await window.salla?.cart.deleteItem(item.id);
|
|
120
|
+
document.querySelector(`#item-${item.id}`)?.remove();
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const isFreeProduct = toNumber(item.price) === 0 && item.has_discount;
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<form onChange={handleChange} id={`item-${item.id}`}>
|
|
127
|
+
<section className="cart-item bg-white p-5 xs:p-7 rounded-md mb-5 relative">
|
|
128
|
+
<input type="hidden" name="id" value={item.id} />
|
|
129
|
+
|
|
130
|
+
<div className="md:flex rtl:space-x-reverse md:space-x-12 items-start justify-between mb-8 last:mb-0">
|
|
131
|
+
<div className="flex flex-1 rtl:space-x-reverse space-x-4">
|
|
132
|
+
<Link to={item.url} className="relative overflow-hidden shrink-0">
|
|
133
|
+
<Image
|
|
134
|
+
src={item.product_image}
|
|
135
|
+
alt={item.product_name}
|
|
136
|
+
className="flex-none w-24 h-20 border border-gray-200 bg-gray-100 rounded-md object-center object-cover"
|
|
137
|
+
aspectRatio="6/5"
|
|
138
|
+
priority={isFirst}
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
{isFreeProduct && (
|
|
142
|
+
<div className="free-ribbon absolute top-[11px] right-[-38px] w-32 bg-red-600 text-white text-xs font-bold text-center py-1 rotate-45 shadow-md">
|
|
143
|
+
{/* Twig: trans('pages.loyalty_program.free_product') */}
|
|
144
|
+
{t('pages.loyalty_program.free_product')}
|
|
145
|
+
</div>
|
|
146
|
+
)}
|
|
147
|
+
</Link>
|
|
148
|
+
|
|
149
|
+
<div className="space-y-1">
|
|
150
|
+
<div className="text-gray-900 leading-6 text-lg font-bold">
|
|
151
|
+
<Link to={item.url} className="text-base">
|
|
152
|
+
{item.product_name}
|
|
153
|
+
</Link>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<CartItemPrices item={item} />
|
|
157
|
+
|
|
158
|
+
{item.weight_label && (
|
|
159
|
+
<p className="text-sm text-gray-500">
|
|
160
|
+
{t('pages.products.weight')}: <span>{item.weight_label}</span>
|
|
161
|
+
</p>
|
|
162
|
+
)}
|
|
163
|
+
|
|
164
|
+
{/* Twig: class="{{ item.detailed_offers ? 'hidden' : '' }}": hide old offer when detailed_offers present */}
|
|
165
|
+
{item.offer && !item.detailed_offers?.length && (
|
|
166
|
+
<span className="old-offers flex items-center gap-1 mx-1.5">
|
|
167
|
+
<i className="sicon-discount-calculator text-gray-500 offer-icon"></i>
|
|
168
|
+
<span className="text-sm text-gray-500 offer-name">{item.offer.names}</span>
|
|
169
|
+
</span>
|
|
170
|
+
)}
|
|
171
|
+
|
|
172
|
+
{item.detailed_offers && item.detailed_offers.length > 0 && (
|
|
173
|
+
<SallaCartItemOffers
|
|
174
|
+
quantity={item.quantity}
|
|
175
|
+
itemId={String(item.id) as any}
|
|
176
|
+
productPrice={toNumber(item.product_price) ?? 0}
|
|
177
|
+
offers={JSON.stringify(item.detailed_offers)}
|
|
178
|
+
/>
|
|
179
|
+
)}
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div className="border-t border-b border-gray-200 py-3 md:p-0 md:border-none mt-5 md:mt-0 flex gap-8 justify-between items-center md:items-start">
|
|
184
|
+
<CartItemQuantity item={item} />
|
|
185
|
+
|
|
186
|
+
<CartItemTotal item={item} />
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
{/* Twig: {% include 'pages.partials.product.options' with {product:item} %} */}
|
|
191
|
+
{item.options && item.options.length > 0 && (
|
|
192
|
+
<SallaProductOptions options={JSON.stringify(item.options)} productId={item.product_id} />
|
|
193
|
+
)}
|
|
194
|
+
|
|
195
|
+
<span className="absolute top-1.5 rtl:left-1.5 ltr:right-1.5 rtl:xs:left-5 ltr:xs:right-5 xs:top-5">
|
|
196
|
+
<SallaButton
|
|
197
|
+
type="button"
|
|
198
|
+
shape="icon"
|
|
199
|
+
size="small"
|
|
200
|
+
color="danger"
|
|
201
|
+
className="btn--delete"
|
|
202
|
+
ariaLabel={t('common.elements.remove')}
|
|
203
|
+
onClick={handleDelete}
|
|
204
|
+
>
|
|
205
|
+
<i className="sicon-cancel"></i>
|
|
206
|
+
</SallaButton>
|
|
207
|
+
</span>
|
|
208
|
+
</section>
|
|
209
|
+
</form>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { HookSlot } from '../../hooks/HookSlot';
|
|
3
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
4
|
+
import { useCoupon } from '../../hooks/useCoupon';
|
|
5
|
+
import { useMoney } from '../../hooks/useMoney';
|
|
6
|
+
import { stripUnsafeHtml } from '../../utils/sanitize';
|
|
7
|
+
import { SallaLoyalty } from '@salla.sa/twilight-components-react/loyalty';
|
|
8
|
+
import { SallaGifting } from '@salla.sa/twilight-components-react/gifting';
|
|
9
|
+
import { SallaButton } from '@salla.sa/twilight-components-react/button';
|
|
10
|
+
import { SallaTieredOffer } from '@salla.sa/twilight-components-react/tiered-offer';
|
|
11
|
+
import type { Cart } from '../../types';
|
|
12
|
+
|
|
13
|
+
interface CartSummaryProps {
|
|
14
|
+
cart: Cart;
|
|
15
|
+
applyCouponEnabled?: boolean;
|
|
16
|
+
taxAmount?: number;
|
|
17
|
+
loyalty?: Cart['loyalty'];
|
|
18
|
+
gift?: Cart['gift'];
|
|
19
|
+
loyaltyPoints?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function CartSummary({
|
|
23
|
+
cart,
|
|
24
|
+
applyCouponEnabled = true,
|
|
25
|
+
taxAmount,
|
|
26
|
+
loyalty,
|
|
27
|
+
gift,
|
|
28
|
+
loyaltyPoints,
|
|
29
|
+
}: CartSummaryProps) {
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
const { format } = useMoney();
|
|
32
|
+
|
|
33
|
+
const handleCartSubmit = useCallback(async () => {
|
|
34
|
+
// Twig's cart.js: a submit with an empty required option fails and the SDK resets the cart.
|
|
35
|
+
const forms = document.querySelectorAll<HTMLFormElement>('form[id^="item-"]');
|
|
36
|
+
if (![...forms].every((form) => form.reportValidity())) {
|
|
37
|
+
window.salla?.notify.error(window.salla.lang.get('common.messages.required_fields'));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
await window.salla?.cart.submit();
|
|
42
|
+
} catch {
|
|
43
|
+
// Error handling
|
|
44
|
+
}
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="sticky top-24 w-full lg:w-96 rtl:lg:mr-8 ltr:lg:ml-8">
|
|
49
|
+
<HookSlot name="cart:summary.start" />
|
|
50
|
+
{cart.free_shipping_bar && <FreeShippingBar freeShippingBar={cart.free_shipping_bar} />}
|
|
51
|
+
|
|
52
|
+
{/* Twig: {% if loyalty and user.loyalty_points %} — top-level page vars rendered inside sidebar */}
|
|
53
|
+
{loyalty && loyaltyPoints && (
|
|
54
|
+
<div className="shadow-default mb-5 rounded-md p-3 xs:p-7 bg-white">
|
|
55
|
+
<SallaLoyalty
|
|
56
|
+
customerPoints={loyaltyPoints}
|
|
57
|
+
prizePoints={loyalty.prize.points}
|
|
58
|
+
prizeTitle={loyalty.prize.title}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
{/* Twig: {{gift.enabled ? '' : 'hidden'}} — top-level page var rendered inside sidebar */}
|
|
64
|
+
{gift?.enabled && (
|
|
65
|
+
<div id="cart-gifting" className="shadow-default bg-white xs:p-2 rounded-md mb-5 relative">
|
|
66
|
+
<SallaGifting
|
|
67
|
+
id="salla-gifting"
|
|
68
|
+
className="mt-5"
|
|
69
|
+
widgetTitle={t('pages.cart.gift_widget_title', 'Send as a gift')}
|
|
70
|
+
widgetSubtitle={gift.text}
|
|
71
|
+
{...(gift.type ? { [gift.type + 'Products']: true } : {})}
|
|
72
|
+
vertical
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
|
|
77
|
+
<div className="shadow-default bg-white p-5 xs:p-7 rounded-md mb-5 relative transition-height duration-1000">
|
|
78
|
+
<h2 className="font-bold text-sm mb-5">{t('pages.cart.summary', 'Order Summary')}</h2>
|
|
79
|
+
|
|
80
|
+
<div className="flex justify-between text-sm mb-5">
|
|
81
|
+
<span className="text-gray-500">
|
|
82
|
+
{taxAmount
|
|
83
|
+
? t('pages.cart.items_total_without_tax', 'Items total (excl. tax)')
|
|
84
|
+
: t('pages.cart.items_total', 'Items total')}
|
|
85
|
+
</span>
|
|
86
|
+
<b id="sub-total">{format(cart.sub_total)}</b>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
{cart.options?.length > 0 && (
|
|
90
|
+
<div className="flex justify-between text-sm mb-5">
|
|
91
|
+
<span className="text-gray-500">
|
|
92
|
+
{t('pages.cart.order_options_total', 'Options total')}
|
|
93
|
+
</span>
|
|
94
|
+
<b id="cart-options-total">{format(cart.options_total ?? undefined)}</b>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
|
|
98
|
+
{cart.has_shipping && (
|
|
99
|
+
<div id="shipping-cost" className="flex justify-between text-sm mb-5">
|
|
100
|
+
<span className="text-gray-500">{t('pages.cart.shipping_cost', 'Shipping cost')}</span>
|
|
101
|
+
<b>{format(cart.real_shipping_cost)}</b>
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
|
|
105
|
+
{applyCouponEnabled && <CouponInput initialCoupon={cart.coupon ?? undefined} />}
|
|
106
|
+
|
|
107
|
+
{!!cart.total_discount && (
|
|
108
|
+
<div id="total-discount" className="flex justify-between text-sm">
|
|
109
|
+
<span className="text-gray-500 block h-10">{t('pages.cart.discount', 'Discount')}</span>
|
|
110
|
+
<b>- {format(cart.total_discount)}</b>
|
|
111
|
+
</div>
|
|
112
|
+
)}
|
|
113
|
+
|
|
114
|
+
{!!taxAmount && (
|
|
115
|
+
<div className="flex justify-between text-sm mb-5">
|
|
116
|
+
<span className="text-gray-500">
|
|
117
|
+
{t('pages.cart.VAT_tax_amount', 'VAT Tax Amount')}
|
|
118
|
+
</span>
|
|
119
|
+
<b id="tax-amount">{format(taxAmount)}</b>
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
|
|
123
|
+
<div className="flex justify-between text-lg mb-5">
|
|
124
|
+
<span className="text-gray-500">{t('pages.cart.final_total', 'Total')}</span>
|
|
125
|
+
<b data-cart-total>{format(cart.total)}</b>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div className="cart-submit-wrap">
|
|
129
|
+
<HookSlot name="cart:submit.start" />
|
|
130
|
+
<SallaButton
|
|
131
|
+
id="cart-submit"
|
|
132
|
+
loaderPosition="center"
|
|
133
|
+
width="wide"
|
|
134
|
+
onClick={handleCartSubmit}
|
|
135
|
+
>
|
|
136
|
+
{t('pages.cart.complete_order', 'Complete Order')}
|
|
137
|
+
</SallaButton>
|
|
138
|
+
<HookSlot name="cart:submit.end" />
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<HookSlot name="cart:summary.end" />
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<SallaTieredOffer />
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function FreeShippingBar({
|
|
150
|
+
freeShippingBar,
|
|
151
|
+
}: {
|
|
152
|
+
freeShippingBar: NonNullable<Cart['free_shipping_bar']>;
|
|
153
|
+
}) {
|
|
154
|
+
const isFree = freeShippingBar.has_free_shipping;
|
|
155
|
+
const { t } = useTranslation();
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<div className="shadow-default bg-white p-5 xs:p-7 rounded-md mb-5 relative" id="free-shipping">
|
|
159
|
+
<div className="flex rtl:space-x-reverse space-x-3 items-center">
|
|
160
|
+
<i className="bg-primary text-white rounded-icon sicon-shipping-fast"></i>
|
|
161
|
+
<div className="flex-1">
|
|
162
|
+
<h4 className="shipping-item font-bold text-sm mb-1.5">
|
|
163
|
+
{t('pages.cart.free_shipping', 'Free Shipping')}
|
|
164
|
+
</h4>
|
|
165
|
+
<p className="shipping-item text-sm text-gray-500">
|
|
166
|
+
{isFree ? (
|
|
167
|
+
<>
|
|
168
|
+
<span
|
|
169
|
+
id="free-shipping-msg"
|
|
170
|
+
dangerouslySetInnerHTML={{
|
|
171
|
+
__html: stripUnsafeHtml(
|
|
172
|
+
t('pages.cart.has_free_shipping', 'You have free shipping!')
|
|
173
|
+
),
|
|
174
|
+
}}
|
|
175
|
+
/>
|
|
176
|
+
<span className="emoji" id="free-shipping-applied">
|
|
177
|
+
🎉
|
|
178
|
+
</span>
|
|
179
|
+
</>
|
|
180
|
+
) : (
|
|
181
|
+
<span
|
|
182
|
+
id="free-shipping-msg"
|
|
183
|
+
dangerouslySetInnerHTML={{
|
|
184
|
+
__html: stripUnsafeHtml(
|
|
185
|
+
t(
|
|
186
|
+
'pages.cart.free_shipping_alert',
|
|
187
|
+
'Get free shipping when you add :amount more'
|
|
188
|
+
).replace(':amount', String(freeShippingBar.remaining))
|
|
189
|
+
),
|
|
190
|
+
}}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
193
|
+
</p>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
{!isFree && (
|
|
197
|
+
<div className="mt-8 bg-border-color rounded-full" id="free-shipping-bar">
|
|
198
|
+
<div
|
|
199
|
+
className="progress-bg transition-all duration-500 h-2.5 bg-primary relative rounded-full flex justify-end"
|
|
200
|
+
style={{ width: `${freeShippingBar.percent}%` }}
|
|
201
|
+
>
|
|
202
|
+
<i className="inline-block sicon-shipping-fast absolute -top-5 rtl:left-0 ltr:right-0"></i>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function CouponInput({ initialCoupon }: { initialCoupon?: string }) {
|
|
211
|
+
const { t } = useTranslation();
|
|
212
|
+
const { value, error, apply, remove } = useCoupon();
|
|
213
|
+
|
|
214
|
+
// Use initial coupon from cart if available
|
|
215
|
+
const appliedCoupon = value ?? initialCoupon;
|
|
216
|
+
|
|
217
|
+
const handleApplyCoupon = useCallback(
|
|
218
|
+
async (event: React.FormEvent<HTMLFormElement>) => {
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
const formData = new FormData(event.currentTarget);
|
|
221
|
+
const code = formData.get('coupon') as string;
|
|
222
|
+
if (code?.trim()) {
|
|
223
|
+
await apply(code.trim());
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
[apply]
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
const handleRemoveCoupon = useCallback(async () => {
|
|
230
|
+
await remove();
|
|
231
|
+
}, [remove]);
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<form className="border-t border-gray-200 border-b py-5 mb-5" onSubmit={handleApplyCoupon}>
|
|
235
|
+
<label htmlFor="coupon-input" className="block text-sm">
|
|
236
|
+
{t('pages.cart.have_coupon', 'Have a coupon?')}
|
|
237
|
+
</label>
|
|
238
|
+
<div className="mt-2.5 relative">
|
|
239
|
+
<input
|
|
240
|
+
placeholder={t('pages.cart.coupon_placeholder', 'Enter coupon code')}
|
|
241
|
+
disabled={!!appliedCoupon}
|
|
242
|
+
className="rtl:pl-24 ltr:pr-24 form-input"
|
|
243
|
+
defaultValue={appliedCoupon}
|
|
244
|
+
id="coupon-input"
|
|
245
|
+
name="coupon"
|
|
246
|
+
aria-label={t('pages.cart.apply_coupon', 'Apply coupon')}
|
|
247
|
+
type="text"
|
|
248
|
+
/>
|
|
249
|
+
|
|
250
|
+
<SallaButton
|
|
251
|
+
type="submit"
|
|
252
|
+
className={`btn--coupon ${appliedCoupon ? 'has-coupon btn--danger' : 'has-not-coupon btn--default'}`}
|
|
253
|
+
loaderPosition="center"
|
|
254
|
+
onClick={appliedCoupon ? handleRemoveCoupon : undefined}
|
|
255
|
+
>
|
|
256
|
+
<span className="coupon-text">
|
|
257
|
+
{appliedCoupon ? '' : t('pages.cart.apply_coupon_btn', 'Apply')}
|
|
258
|
+
</span>
|
|
259
|
+
{appliedCoupon && <i className="sicon-cancel icon text-xl w-8"></i>}
|
|
260
|
+
</SallaButton>
|
|
261
|
+
</div>
|
|
262
|
+
{error && (
|
|
263
|
+
<span className="text-xs text-red-700" id="coupon-error">
|
|
264
|
+
{error}
|
|
265
|
+
</span>
|
|
266
|
+
)}
|
|
267
|
+
</form>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
2
|
+
|
|
3
|
+
export function PreOrderNotification() {
|
|
4
|
+
const { t } = useTranslation();
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<salla-alert
|
|
8
|
+
className="mb-5"
|
|
9
|
+
message={t(
|
|
10
|
+
'pages.cart.pre_order_shipping',
|
|
11
|
+
'Your order will be shipped when the pre-order product becomes available in the store.'
|
|
12
|
+
)}
|
|
13
|
+
variant="info"
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SallaButton } from '@salla.sa/twilight-components-react/button';
|
|
2
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
3
|
+
|
|
4
|
+
const handlePriceQuote = async () => {
|
|
5
|
+
await window.salla?.cart.api.priceQuote?.();
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function PriceQuoteButton() {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<SallaButton
|
|
13
|
+
id="request-price-quote-btn"
|
|
14
|
+
className="btn--oval btn--md"
|
|
15
|
+
fill="outline"
|
|
16
|
+
onClick={handlePriceQuote}
|
|
17
|
+
>
|
|
18
|
+
{t('pages.cart.request_price_quote', 'Request for Quotation')}
|
|
19
|
+
</SallaButton>
|
|
20
|
+
);
|
|
21
|
+
}
|