@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,94 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// Routes barrel — LIGHTWEIGHT exports only.
|
|
3
|
+
//
|
|
4
|
+
// Route modules (Home, Cart, Blog …), loaders, and lazy page components
|
|
5
|
+
// are intentionally NOT re-exported here. Import them from granular paths:
|
|
6
|
+
// import { Cart } from '@salla.sa/twilight-theme-engine/routes/cart';
|
|
7
|
+
// import { Blog } from '@salla.sa/twilight-theme-engine/routes/blog';
|
|
8
|
+
//
|
|
9
|
+
// This prevents importing one route from accidentally pulling in every
|
|
10
|
+
// route module and breaking code-splitting.
|
|
11
|
+
// ============================================
|
|
12
|
+
|
|
13
|
+
// Locale utilities
|
|
14
|
+
export {
|
|
15
|
+
FALLBACK_LOCALE,
|
|
16
|
+
getLanguageInfo,
|
|
17
|
+
isLocale,
|
|
18
|
+
SUPPORTED_LOCALES,
|
|
19
|
+
} from '../providers/I18nProvider';
|
|
20
|
+
export type { Locale } from '../providers/I18nProvider';
|
|
21
|
+
|
|
22
|
+
// SEO slug redirect loader — standalone, no heavy deps
|
|
23
|
+
export { slugBrandRedirectLoader } from './seo-redirects';
|
|
24
|
+
export type { SlugBrandParams } from './seo-redirects';
|
|
25
|
+
|
|
26
|
+
// ============================================
|
|
27
|
+
// Types — zero runtime cost, safe to barrel
|
|
28
|
+
// ============================================
|
|
29
|
+
|
|
30
|
+
export type { HeadDescriptor } from '../utils/head';
|
|
31
|
+
export type {
|
|
32
|
+
RouteModule,
|
|
33
|
+
IdParams,
|
|
34
|
+
SlugIdParams,
|
|
35
|
+
PageQuery,
|
|
36
|
+
LoaderContext,
|
|
37
|
+
RoutePagination,
|
|
38
|
+
} from './types';
|
|
39
|
+
export type { NotFoundPageProps } from './not-found';
|
|
40
|
+
|
|
41
|
+
export type { HomeComponentsProps, AnyHomeComponent, HomeLoaderData, HomePageProps } from './home';
|
|
42
|
+
export type { CartPageProps } from './cart';
|
|
43
|
+
export type { ProductPageProps } from './product';
|
|
44
|
+
export type {
|
|
45
|
+
CategoryPageProps,
|
|
46
|
+
// Unified types
|
|
47
|
+
ProductListLoaderData,
|
|
48
|
+
ProductListLoaderParams,
|
|
49
|
+
ProductListLoaderContext,
|
|
50
|
+
ProductListSource,
|
|
51
|
+
ProductListTag,
|
|
52
|
+
ProductListEntity,
|
|
53
|
+
ProductListPageMeta,
|
|
54
|
+
ProductListSourceConfig,
|
|
55
|
+
ProductListQuery,
|
|
56
|
+
} from './product-listing';
|
|
57
|
+
export type {
|
|
58
|
+
BlogAuthorLoaderData,
|
|
59
|
+
BlogCategoryLoaderData,
|
|
60
|
+
BlogTagLoaderData,
|
|
61
|
+
BlogPageProps,
|
|
62
|
+
BlogSinglePageProps,
|
|
63
|
+
ArticleSummary,
|
|
64
|
+
ArticleDetail,
|
|
65
|
+
ArticleStats,
|
|
66
|
+
ArticleMeta,
|
|
67
|
+
BlogAuthorType,
|
|
68
|
+
BlogTagType,
|
|
69
|
+
BlogCategoryType,
|
|
70
|
+
CategoryMeta,
|
|
71
|
+
} from './blog';
|
|
72
|
+
export type { BrandsPageProps, Brand, BrandsGroup } from './brands';
|
|
73
|
+
export type {
|
|
74
|
+
ProfilePageProps,
|
|
75
|
+
WishlistPageProps,
|
|
76
|
+
WalletPageProps,
|
|
77
|
+
NotificationsPageProps,
|
|
78
|
+
Order,
|
|
79
|
+
OrderItem,
|
|
80
|
+
OrderListItem,
|
|
81
|
+
OrdersPageProps,
|
|
82
|
+
OrderSinglePageProps,
|
|
83
|
+
} from './account';
|
|
84
|
+
export type {
|
|
85
|
+
LoyaltyPageProps,
|
|
86
|
+
LoyaltyPointsPageProps,
|
|
87
|
+
LoyaltyPoint,
|
|
88
|
+
LoyaltyPrize,
|
|
89
|
+
LoyaltyPrizeItem,
|
|
90
|
+
} from './loyalty';
|
|
91
|
+
export type { PageSingleProps, StaticPage } from './page';
|
|
92
|
+
export type { ReviewsPageProps, TestimonialsPageProps } from './testimonials';
|
|
93
|
+
export type { ThankYouLoaderParams, ThankYouPageProps } from './thank-you';
|
|
94
|
+
export type { OrdersSearchParams, OrdersQuery } from './account/orders';
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
|
|
3
|
+
// Home
|
|
4
|
+
export const LazyHomePage = lazy(() =>
|
|
5
|
+
import('./home/HomePage').then((m) => ({ default: m.HomePage }))
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
// Cart
|
|
9
|
+
export const LazyCartPage = lazy(() =>
|
|
10
|
+
import('./cart/CartPage').then((m) => ({ default: m.CartPage }))
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
// Product
|
|
14
|
+
export const LazyProductPage = lazy(() =>
|
|
15
|
+
import('./product/ProductPage').then((m) => ({ default: m.ProductPage }))
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
// Product Listing (unified for all product list pages: category, search, tag, latest, most-sales, offers)
|
|
19
|
+
export const LazyProductListingPage = lazy(() =>
|
|
20
|
+
import('./product-listing/ProductListPage').then((m) => ({ default: m.ProductListPage }))
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
// Blog
|
|
24
|
+
export const LazyBlogPage = lazy(() =>
|
|
25
|
+
import('./blog/BlogPage').then((m) => ({ default: m.BlogPage }))
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const LazyBlogSinglePage = lazy(() =>
|
|
29
|
+
import('./blog/BlogSinglePage').then((m) => ({ default: m.BlogSinglePage }))
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const LazyBlogAuthorPage = lazy(() =>
|
|
33
|
+
import('./blog/BlogAuthorPage').then((m) => ({ default: m.BlogAuthorPage }))
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const LazyBlogCategoryPage = lazy(() =>
|
|
37
|
+
import('./blog/BlogCategoryPage').then((m) => ({ default: m.BlogCategoryPage }))
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const LazyBlogTagPage = lazy(() =>
|
|
41
|
+
import('./blog/BlogTagPage').then((m) => ({ default: m.BlogTagPage }))
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// Brands
|
|
45
|
+
export const LazyBrandsPage = lazy(() =>
|
|
46
|
+
import('./brands/BrandsPage').then((m) => ({ default: m.BrandsPage }))
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// BrandSingle uses ProductListing module via tanstack.adapter.ts - no lazy export needed
|
|
50
|
+
|
|
51
|
+
// Customer
|
|
52
|
+
export const LazyProfilePage = lazy(() =>
|
|
53
|
+
import('./account/profile/ProfilePage').then((m) => ({ default: m.ProfilePage }))
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
export const LazyWishlistPage = lazy(() =>
|
|
57
|
+
import('./account/wishlist/WishlistPage').then((m) => ({ default: m.WishlistPage }))
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const LazyWalletPage = lazy(() =>
|
|
61
|
+
import('./account/wallet/WalletPage').then((m) => ({ default: m.WalletPage }))
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export const LazyNotificationsPage = lazy(() =>
|
|
65
|
+
import('./account/notifications/NotificationsPage').then((m) => ({
|
|
66
|
+
default: m.NotificationsPage,
|
|
67
|
+
}))
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export const LazySettingsPage = lazy(() =>
|
|
71
|
+
import('./account/settings/SettingsPage').then((m) => ({ default: m.SettingsPage }))
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const LazyOrdersPage = lazy(() =>
|
|
75
|
+
import('./account/orders/OrdersPage').then((m) => ({ default: m.OrdersPage }))
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
export const LazyOrderSinglePage = lazy(() =>
|
|
79
|
+
import('./account/orders/OrderSinglePage').then((m) => ({ default: m.OrderSinglePage }))
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// Loyalty
|
|
83
|
+
export const LazyLoyaltyPage = lazy(() =>
|
|
84
|
+
import('./loyalty/LoyaltyPage').then((m) => ({ default: m.LoyaltyPage }))
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// Page (static)
|
|
88
|
+
export const LazyPageSingle = lazy(() =>
|
|
89
|
+
import('./page/PageSingle').then((m) => ({ default: m.PageSingle }))
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Testimonials
|
|
93
|
+
export const LazyTestimonialsPage = lazy(() =>
|
|
94
|
+
import('./testimonials/TestimonialsPage').then((m) => ({ default: m.TestimonialsPage }))
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// Thank You
|
|
98
|
+
export const LazyThankYouPage = lazy(() =>
|
|
99
|
+
import('./thank-you/ThankYouPage').then((m) => ({ default: m.ThankYouPage }))
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// Not Found
|
|
103
|
+
export const LazyNotFoundPage = lazy(() =>
|
|
104
|
+
import('./not-found').then((m) => ({ default: m.NotFoundPage }))
|
|
105
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SallaLoyaltyProgram } from '@salla.sa/twilight-components-react/loyalty-program';
|
|
2
|
+
import type { LoyaltyPageProps } from './types';
|
|
3
|
+
import { Breadcrumb } from '../../components/common';
|
|
4
|
+
import { HookSlot } from '../../hooks';
|
|
5
|
+
|
|
6
|
+
export function LoyaltyPage({ page }: LoyaltyPageProps) {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<HookSlot name="loyalty:start" />
|
|
10
|
+
<div className="container mb-20">
|
|
11
|
+
<Breadcrumb page={page} />
|
|
12
|
+
<SallaLoyaltyProgram />
|
|
13
|
+
</div>
|
|
14
|
+
<HookSlot name="loyalty:end" />
|
|
15
|
+
</>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SallaLoyaltyPointsHistory } from '@salla.sa/twilight-components-react/loyalty-points-history';
|
|
2
|
+
import type { LoyaltyPointsPageProps } from './types';
|
|
3
|
+
import { CustomerLayout } from '../../components/layout';
|
|
4
|
+
|
|
5
|
+
export function LoyaltyPointsPage({ page }: LoyaltyPointsPageProps) {
|
|
6
|
+
return (
|
|
7
|
+
<CustomerLayout page={page}>
|
|
8
|
+
<SallaLoyaltyPointsHistory />
|
|
9
|
+
</CustomerLayout>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { HeadDescriptor } from '../../utils/head';
|
|
2
|
+
import { buildHreflangAlternates } from '../../utils/baseHead';
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
import { loyaltyLoader, loyaltyPointsLoader } from './loader';
|
|
5
|
+
import type { LoyaltyPageProps, LoyaltyPointsPageProps } from './types';
|
|
6
|
+
import type { TwilightContext } from '../../twilight/context';
|
|
7
|
+
import { RouteId } from '../../router/route-ids';
|
|
8
|
+
|
|
9
|
+
// Lazy-load component for code-splitting
|
|
10
|
+
const LazyLoyaltyPage = lazy(() =>
|
|
11
|
+
import('./LoyaltyPage').then((m) => ({ default: m.LoyaltyPage }))
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const LazyLoyaltyPointsPage = lazy(() =>
|
|
15
|
+
import('./LoyaltyPointsPage').then((m) => ({ default: m.LoyaltyPointsPage }))
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const LoyaltyPage = LazyLoyaltyPage;
|
|
19
|
+
export const LoyaltyPointsPage = LazyLoyaltyPointsPage;
|
|
20
|
+
export { loyaltyLoader, loyaltyPointsLoader } from './loader';
|
|
21
|
+
export type {
|
|
22
|
+
LoyaltyPageProps,
|
|
23
|
+
LoyaltyPointsPageProps,
|
|
24
|
+
LoyaltyPoint,
|
|
25
|
+
LoyaltyPrize,
|
|
26
|
+
LoyaltyPrizeItem,
|
|
27
|
+
} from './types';
|
|
28
|
+
|
|
29
|
+
async function loader(
|
|
30
|
+
ctx?: { locale?: string },
|
|
31
|
+
extend?: (
|
|
32
|
+
data: LoyaltyPageProps,
|
|
33
|
+
ctx: { params: Record<string, never> }
|
|
34
|
+
) => Promise<Record<string, unknown>> | Record<string, unknown>
|
|
35
|
+
): Promise<LoyaltyPageProps> {
|
|
36
|
+
const data = await loyaltyLoader(ctx?.locale);
|
|
37
|
+
|
|
38
|
+
if (extend) {
|
|
39
|
+
const extra = await extend(data, { params: {} });
|
|
40
|
+
return { ...data, ...extra } as LoyaltyPageProps;
|
|
41
|
+
}
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function head(ctx: TwilightContext, data: LoyaltyPageProps): HeadDescriptor {
|
|
46
|
+
const base: HeadDescriptor = {
|
|
47
|
+
title: data.page.title,
|
|
48
|
+
description: data.page.description,
|
|
49
|
+
alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return base;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const Loyalty = { id: RouteId.LOYALTY, loader, head, Component: LazyLoyaltyPage } as const;
|
|
56
|
+
|
|
57
|
+
async function pointsLoader(
|
|
58
|
+
ctx?: { locale?: string },
|
|
59
|
+
extend?: (
|
|
60
|
+
data: LoyaltyPointsPageProps,
|
|
61
|
+
ctx: { params: Record<string, never> }
|
|
62
|
+
) => Promise<Record<string, unknown>> | Record<string, unknown>
|
|
63
|
+
): Promise<LoyaltyPointsPageProps> {
|
|
64
|
+
const data = await loyaltyPointsLoader(ctx?.locale);
|
|
65
|
+
|
|
66
|
+
if (extend) {
|
|
67
|
+
const extra = await extend(data, { params: {} });
|
|
68
|
+
return { ...data, ...extra } as LoyaltyPointsPageProps;
|
|
69
|
+
}
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const LoyaltyPoints = {
|
|
74
|
+
id: RouteId.CUSTOMER_LOYALTY_POINTS,
|
|
75
|
+
loader: pointsLoader,
|
|
76
|
+
head: (ctx: TwilightContext, data: LoyaltyPointsPageProps): HeadDescriptor => ({
|
|
77
|
+
title: data.page.title,
|
|
78
|
+
alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),
|
|
79
|
+
}),
|
|
80
|
+
Component: LazyLoyaltyPointsPage,
|
|
81
|
+
} as const;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { loyalty } from '../../api/loyalty';
|
|
2
|
+
import type { Loyalty, LoyaltyPageProps, LoyaltyPointsPageProps } from './types';
|
|
3
|
+
import { RouteId } from '../../router/route-ids';
|
|
4
|
+
import { orUnauthorized, redirect, unauthorized } from '../../providers/NavigationProvider';
|
|
5
|
+
import { FALLBACK_LOCALE } from '../../providers/locale-constants';
|
|
6
|
+
import { getTwilightContext } from '../../twilight/context';
|
|
7
|
+
import { getAuthToken } from '../../api/client';
|
|
8
|
+
|
|
9
|
+
async function getProgramOrGoHome(locale?: string): Promise<Loyalty> {
|
|
10
|
+
try {
|
|
11
|
+
return await loyalty.get();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
// The API answers 400 when the store's loyalty program is off; like the Twig storefront, go home.
|
|
14
|
+
if ((error as { response?: { status?: number } })?.response?.status === 400) {
|
|
15
|
+
throw redirect(`/${locale || FALLBACK_LOCALE}`);
|
|
16
|
+
}
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function loyaltyLoader(locale?: string): Promise<LoyaltyPageProps> {
|
|
22
|
+
const data = await getProgramOrGoHome(locale);
|
|
23
|
+
const { i18n } = getTwilightContext();
|
|
24
|
+
return {
|
|
25
|
+
page: {
|
|
26
|
+
slug: RouteId.LOYALTY,
|
|
27
|
+
title: data.name,
|
|
28
|
+
breadcrumbs: [
|
|
29
|
+
{ name: i18n.t('common.titles.home'), url: '/' },
|
|
30
|
+
{ name: i18n.t('common.titles.loyalty_program'), url: '/loyalty' },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
loyalty: data,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function loyaltyPointsLoader(locale?: string): Promise<LoyaltyPointsPageProps> {
|
|
38
|
+
if (!getAuthToken()) throw unauthorized();
|
|
39
|
+
await orUnauthorized(getProgramOrGoHome(locale));
|
|
40
|
+
const { i18n } = getTwilightContext();
|
|
41
|
+
const title = i18n.t('pages.loyalty_program.loyalty_points');
|
|
42
|
+
return {
|
|
43
|
+
page: {
|
|
44
|
+
slug: RouteId.CUSTOMER_LOYALTY_POINTS,
|
|
45
|
+
title,
|
|
46
|
+
breadcrumbs: [
|
|
47
|
+
{ name: i18n.t('common.titles.home'), url: '/' },
|
|
48
|
+
{ name: i18n.t('common.titles.profile'), url: '/account/profile' },
|
|
49
|
+
{ name: title, url: '/loyalty_points' },
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Page } from '../../types';
|
|
2
|
+
import type { RoutePagination } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface LoyaltyCustomer {
|
|
5
|
+
id: number;
|
|
6
|
+
first_name: string;
|
|
7
|
+
last_name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
loyalty_program_points: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface LoyaltyCondition {
|
|
13
|
+
name: string;
|
|
14
|
+
key: string;
|
|
15
|
+
points: number;
|
|
16
|
+
condition: string | null;
|
|
17
|
+
value: string | null;
|
|
18
|
+
op: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface LoyaltyPoint {
|
|
22
|
+
type: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
points: number;
|
|
26
|
+
icon: string;
|
|
27
|
+
color: string;
|
|
28
|
+
url: string;
|
|
29
|
+
id: number;
|
|
30
|
+
key: string;
|
|
31
|
+
status: boolean;
|
|
32
|
+
is_completed: boolean;
|
|
33
|
+
target_url: string;
|
|
34
|
+
share_store_url: string;
|
|
35
|
+
steps: Record<string, string | number | boolean>[];
|
|
36
|
+
branches: Record<string, string | number | boolean>[];
|
|
37
|
+
conditions: LoyaltyCondition[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface LoyaltyPrizeItem {
|
|
41
|
+
id: number;
|
|
42
|
+
key?: string;
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
image?: string;
|
|
46
|
+
url?: string;
|
|
47
|
+
prize_url?: string;
|
|
48
|
+
cost_points: number;
|
|
49
|
+
coupon_type?: string;
|
|
50
|
+
coupon_amount?: number;
|
|
51
|
+
status?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface LoyaltyPrize {
|
|
55
|
+
type: 'coupon_discount' | 'free_product' | 'free_shipping' | string;
|
|
56
|
+
title: string;
|
|
57
|
+
items: LoyaltyPrizeItem[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface Loyalty {
|
|
61
|
+
loyalty_program_id: number;
|
|
62
|
+
id: number;
|
|
63
|
+
name: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
image?: string;
|
|
66
|
+
customer: LoyaltyCustomer | null;
|
|
67
|
+
points: LoyaltyPoint[];
|
|
68
|
+
prizes: LoyaltyPrize[];
|
|
69
|
+
promotion_title?: string;
|
|
70
|
+
promotion_description?: string;
|
|
71
|
+
prize_promotion_title?: string;
|
|
72
|
+
prize_promotion_description?: string;
|
|
73
|
+
prize_promotion_logo?: string;
|
|
74
|
+
points_validity_by?: string | null;
|
|
75
|
+
points_validity_value?: number | null;
|
|
76
|
+
status?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface LoyaltyPageProps {
|
|
80
|
+
page: Page;
|
|
81
|
+
loyalty: Loyalty;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface LoyaltyPointsPageProps {
|
|
85
|
+
page: Page;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface PointBalanceItem {
|
|
89
|
+
key: string;
|
|
90
|
+
expires_at: number;
|
|
91
|
+
type: string;
|
|
92
|
+
amount: number;
|
|
93
|
+
order_id: number;
|
|
94
|
+
redeemed_at: number | null;
|
|
95
|
+
status: string;
|
|
96
|
+
created_at: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface PointBalanceCursor extends RoutePagination {
|
|
100
|
+
count: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface PointBalanceResponse {
|
|
104
|
+
status: number;
|
|
105
|
+
success: boolean;
|
|
106
|
+
data: PointBalanceItem[];
|
|
107
|
+
balance: number;
|
|
108
|
+
cursor: PointBalanceCursor;
|
|
109
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { HookSlot } from '../hooks';
|
|
3
|
+
import { useTranslation } from '../providers/I18nProvider';
|
|
4
|
+
import { ErrorPage } from '../components/common';
|
|
5
|
+
import { useProductShortLink } from './product-short-link';
|
|
6
|
+
|
|
7
|
+
export interface NotFoundPageProps {
|
|
8
|
+
title?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
showHomeLink?: boolean;
|
|
11
|
+
homeLinkText?: string;
|
|
12
|
+
LinkComponent?: ComponentType<{
|
|
13
|
+
to: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function NotFoundPage(props: NotFoundPageProps = {}) {
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
// A product short link (`/ar/lvXvzln`) or "new URLs" link (`/ar/1213asa-name`) matches no route; resolve it instead of 404ing.
|
|
23
|
+
const resolvingShortLink = useProductShortLink();
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
title = t('common.errors.404') || 'Page Not Found',
|
|
27
|
+
message = t('common.errors.error_occurred') ||
|
|
28
|
+
'The page you are looking for does not exist or has been moved.',
|
|
29
|
+
showHomeLink = true,
|
|
30
|
+
homeLinkText = t('common.elements.back_home') || 'Back to Home',
|
|
31
|
+
LinkComponent,
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
if (resolvingShortLink) return null;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<ErrorPage
|
|
38
|
+
code={404}
|
|
39
|
+
title={title}
|
|
40
|
+
message={message}
|
|
41
|
+
showAction={showHomeLink}
|
|
42
|
+
actionText={homeLinkText}
|
|
43
|
+
LinkComponent={LinkComponent}
|
|
44
|
+
>
|
|
45
|
+
<HookSlot name="notfound:start" />
|
|
46
|
+
<HookSlot name="notfound:content" />
|
|
47
|
+
<HookSlot name="notfound:end" />
|
|
48
|
+
</ErrorPage>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { SallaComments } from '@salla.sa/twilight-components-react/comments';
|
|
3
|
+
import type { PageSingleProps } from './types';
|
|
4
|
+
import { Breadcrumb } from '../../components/common';
|
|
5
|
+
import { useComments } from '../../hooks/useComments';
|
|
6
|
+
|
|
7
|
+
export function PageSingle({ page }: PageSingleProps) {
|
|
8
|
+
const { commentsKey } = useComments();
|
|
9
|
+
|
|
10
|
+
// Clean content articles - matches app.js commonThings()
|
|
11
|
+
const cleanContent = useMemo(() => {
|
|
12
|
+
if (!page.content) return '';
|
|
13
|
+
// Replace entities with regular spaces
|
|
14
|
+
return page.content.replace(/ /g, ' ');
|
|
15
|
+
}, [page.content]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div key={page.slug} className="container">
|
|
19
|
+
<Breadcrumb page={page} />
|
|
20
|
+
|
|
21
|
+
<div className="flex justify-center">
|
|
22
|
+
<div className="content content--single-page w-full lg:w-10/12 bg-white rounded p-6 lg:p-8 mt-4 lg:mt-12">
|
|
23
|
+
<h1 className="font-bold text-2xl mb-6">{page.title}</h1>
|
|
24
|
+
{cleanContent && (
|
|
25
|
+
<div className="content-entry" dangerouslySetInnerHTML={{ __html: cleanContent }} />
|
|
26
|
+
)}
|
|
27
|
+
{page.id && (
|
|
28
|
+
<SallaComments key={commentsKey} itemId={Number(page.id)} type={'page' as any} />
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { HeadDescriptor } from '../../utils/head';
|
|
2
|
+
import { buildHreflangAlternates } from '../../utils/baseHead';
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
import { pageSingleLoader } from './loader';
|
|
5
|
+
import type { PageSingleProps } from './types';
|
|
6
|
+
import type { IdParams } from '../types';
|
|
7
|
+
import type { TwilightContext } from '../../twilight/context';
|
|
8
|
+
import { RouteId } from '../../router/route-ids';
|
|
9
|
+
|
|
10
|
+
// Lazy-load component for code-splitting
|
|
11
|
+
const LazyPageSingle = lazy(() => import('./PageSingle').then((m) => ({ default: m.PageSingle })));
|
|
12
|
+
|
|
13
|
+
export const PageSingleLazy = LazyPageSingle;
|
|
14
|
+
export { pageSingleLoader } from './loader';
|
|
15
|
+
export type { PageSingleProps, StaticPage } from './types';
|
|
16
|
+
|
|
17
|
+
async function loader(
|
|
18
|
+
ctx: { params: IdParams; locale?: string },
|
|
19
|
+
extend?: (
|
|
20
|
+
data: PageSingleProps,
|
|
21
|
+
ctx: { params: IdParams }
|
|
22
|
+
) => Promise<Record<string, unknown>> | Record<string, unknown>
|
|
23
|
+
): Promise<PageSingleProps> {
|
|
24
|
+
const data = await pageSingleLoader({ params: ctx.params });
|
|
25
|
+
|
|
26
|
+
if (extend) {
|
|
27
|
+
const extra = await extend(data, ctx);
|
|
28
|
+
return { ...data, ...extra } as PageSingleProps;
|
|
29
|
+
}
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function head(ctx: TwilightContext, data: PageSingleProps): HeadDescriptor {
|
|
34
|
+
const title = data.page.title;
|
|
35
|
+
const description = data.page.content?.replace(/<[^>]+>/g, '');
|
|
36
|
+
|
|
37
|
+
const base: HeadDescriptor = {
|
|
38
|
+
title,
|
|
39
|
+
description,
|
|
40
|
+
canonical: data.page.url,
|
|
41
|
+
openGraph: {
|
|
42
|
+
type: 'article',
|
|
43
|
+
title,
|
|
44
|
+
description,
|
|
45
|
+
url: data.page.url,
|
|
46
|
+
publishedTime: data.page.created_at?.published_time,
|
|
47
|
+
modifiedTime: data.page.created_at?.modified_time,
|
|
48
|
+
},
|
|
49
|
+
alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return base;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const PageSingle = {
|
|
56
|
+
id: RouteId.PAGE_SINGLE,
|
|
57
|
+
loader,
|
|
58
|
+
head,
|
|
59
|
+
Component: LazyPageSingle,
|
|
60
|
+
} as const;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PageSingleProps } from './types';
|
|
2
|
+
import type { IdParams } from '../types';
|
|
3
|
+
import { page } from '../../api/page';
|
|
4
|
+
import { RouteId } from '../../router/route-ids';
|
|
5
|
+
|
|
6
|
+
export async function pageSingleLoader({ params }: { params: IdParams }): Promise<PageSingleProps> {
|
|
7
|
+
const data = await page.findOrThrow(params.id);
|
|
8
|
+
return {
|
|
9
|
+
page: {
|
|
10
|
+
slug: RouteId.PAGE_SINGLE,
|
|
11
|
+
id: data.id,
|
|
12
|
+
title: data.name,
|
|
13
|
+
url: data.url,
|
|
14
|
+
content: data.content,
|
|
15
|
+
metadata: data.metadata,
|
|
16
|
+
created_at: data.created_at,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Page } from '../../types';
|
|
2
|
+
|
|
3
|
+
export interface StaticPage extends Page {
|
|
4
|
+
id?: number;
|
|
5
|
+
content?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
metadata?: {
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
created_at?: {
|
|
12
|
+
published_time?: string;
|
|
13
|
+
modified_time?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PageSingleProps {
|
|
18
|
+
page: StaticPage;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Raw shape returned by GET /store/v1/pages/{id}
|
|
23
|
+
* Matches the PageTransformer output from the Salla Store backend.
|
|
24
|
+
*/
|
|
25
|
+
export interface ApiPageResponse {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
slug?: string;
|
|
29
|
+
content?: string;
|
|
30
|
+
type?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
metadata?: StaticPage['metadata'];
|
|
33
|
+
created_at?: StaticPage['created_at'];
|
|
34
|
+
}
|