@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,354 @@
|
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { redirect } from '@tanstack/react-router';
|
|
3
|
+
import { createIsomorphicFn } from '@tanstack/react-start';
|
|
4
|
+
import {
|
|
5
|
+
getCookie,
|
|
6
|
+
getRequestHeader,
|
|
7
|
+
getRequestUrl,
|
|
8
|
+
setCookie,
|
|
9
|
+
} from '@tanstack/react-start/server';
|
|
10
|
+
import type { StoreContext } from '../../api/store';
|
|
11
|
+
import { store as storeApi } from '../../api/store';
|
|
12
|
+
import { apps, type AppSnippet, type AppSettings } from '../../api/apps';
|
|
13
|
+
import { translations } from '../../api/translations';
|
|
14
|
+
import { advertisement } from '../../api/advertisement';
|
|
15
|
+
import { FALLBACK_LOCALE, getLanguageInfo } from '../../providers/locale-constants';
|
|
16
|
+
import { createI18nInstance } from '../../providers/i18n-factory';
|
|
17
|
+
import type { TwilightLocation } from '../../twilight/context';
|
|
18
|
+
import { getTwilightContext, updateTwilightContext } from '../../twilight/context';
|
|
19
|
+
import {
|
|
20
|
+
AUTH_TOKEN_COOKIE_NAME,
|
|
21
|
+
extractScopeFromCookies,
|
|
22
|
+
extractScopeFromUrl,
|
|
23
|
+
extractTokenFromCookies,
|
|
24
|
+
resolveRequestScope,
|
|
25
|
+
sameScope,
|
|
26
|
+
SCOPE_COOKIE_MAX_AGE,
|
|
27
|
+
SCOPE_COOKIE_NAME,
|
|
28
|
+
syncScopeCookie,
|
|
29
|
+
type ActiveScope,
|
|
30
|
+
} from '../../utils/cookies';
|
|
31
|
+
import { syncSdkLocale, syncSdkThemeVersion } from '../../utils/sdk-helpers';
|
|
32
|
+
import { SettingsError } from '../../utils/errors';
|
|
33
|
+
import { resolveStoreBaseRedirect } from '../../utils/store-identity';
|
|
34
|
+
|
|
35
|
+
// Reads the `token` cookie from the incoming request on the SERVER. twilightMiddleware
|
|
36
|
+
// extracts the same cookie into a custom ALS, but that ALS does NOT propagate to the
|
|
37
|
+
// route's beforeLoad / React SSR render (they run in a different async scope), so the
|
|
38
|
+
// token must be read again here from the framework's own request context. On the client
|
|
39
|
+
// this is a no-op (the cookie is read from document.cookie below instead). The server
|
|
40
|
+
// import is stripped from the client bundle by createIsomorphicFn.
|
|
41
|
+
const readServerCookieToken = createIsomorphicFn()
|
|
42
|
+
.server((): string | null => {
|
|
43
|
+
try {
|
|
44
|
+
return getCookie(AUTH_TOKEN_COOKIE_NAME) ?? null;
|
|
45
|
+
} catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
.client((): string | null => null);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The scope to write to the `scope` cookie for this request, or null to leave the cookie
|
|
53
|
+
* as it is.
|
|
54
|
+
*
|
|
55
|
+
* Only for a market a `?scope=` URL switched to, and only when the settings were answered
|
|
56
|
+
* for it: the API falls back to another market when it does not accept the requested one,
|
|
57
|
+
* and Twig keeps the previous choice then too, rather than recording one the page is not
|
|
58
|
+
* showing. Its type is the one the settings answered with: a URL names only the id, and
|
|
59
|
+
* the store-wide type is assumed until the answer says otherwise (a store browsing by
|
|
60
|
+
* branch or city), so later requests send the type the API matches against.
|
|
61
|
+
*/
|
|
62
|
+
export function scopeCookieUpdate(
|
|
63
|
+
url: string,
|
|
64
|
+
cookieHeader: string | null,
|
|
65
|
+
settings: StoreContext
|
|
66
|
+
): ActiveScope | null {
|
|
67
|
+
if (!extractScopeFromUrl(url)) return null;
|
|
68
|
+
const scope = resolveRequestScope(url, cookieHeader);
|
|
69
|
+
const answered = settings.store?.scope;
|
|
70
|
+
if (!scope || answered?.id == null || String(answered.id) !== scope.id) return null;
|
|
71
|
+
const typed = answered.type ? { ...scope, type: answered.type } : scope;
|
|
72
|
+
return sameScope(extractScopeFromCookies(cookieHeader), typed) ? null : typed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Gives the request's scope the type its settings answered with, for the rest of this
|
|
77
|
+
* render, and files the settings and ads under the key the corrected scope makes, so the browser
|
|
78
|
+
* — which reads the corrected scope from the cookie (see {@link scopeCookieUpdate}) — finds
|
|
79
|
+
* them dehydrated instead of fetching them again. The entry under the assumed type's key
|
|
80
|
+
* is removed, so the page carries them once. Server-only; a no-op when the type
|
|
81
|
+
* already matches or the settings answered another scope.
|
|
82
|
+
*/
|
|
83
|
+
export function alignRequestScopeType(queryClient: QueryClient, settings: StoreContext): void {
|
|
84
|
+
let scope: ActiveScope | null;
|
|
85
|
+
try {
|
|
86
|
+
scope = getTwilightContext().scope;
|
|
87
|
+
} catch {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const answered = settings.store?.scope;
|
|
91
|
+
if (!scope || !answered?.type || String(answered.id) !== scope.id) return;
|
|
92
|
+
if (answered.type === scope.type) return;
|
|
93
|
+
const assumedKey = storeApi.queries.settings().queryKey;
|
|
94
|
+
const assumedAdsKey = advertisement.queries.list().queryKey;
|
|
95
|
+
updateTwilightContext({ scope: { ...scope, type: answered.type } });
|
|
96
|
+
queryClient.setQueryData(storeApi.queries.settings().queryKey, settings);
|
|
97
|
+
// Moved, not copied: both would be dehydrated, sending the settings twice.
|
|
98
|
+
queryClient.removeQueries({ queryKey: assumedKey, exact: true });
|
|
99
|
+
const ads = queryClient.getQueryData(assumedAdsKey);
|
|
100
|
+
if (ads) queryClient.setQueryData(advertisement.queries.list().queryKey, ads);
|
|
101
|
+
queryClient.removeQueries({ queryKey: assumedAdsKey, exact: true });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Writes {@link scopeCookieUpdate} to the response. Read from the request itself rather
|
|
106
|
+
* than the middleware's context, for the same reason as {@link readServerCookieToken}.
|
|
107
|
+
* Server-only.
|
|
108
|
+
*/
|
|
109
|
+
export const persistRequestScope = createIsomorphicFn()
|
|
110
|
+
.server((settings: StoreContext): void => {
|
|
111
|
+
let scope: ActiveScope | null;
|
|
112
|
+
try {
|
|
113
|
+
scope = scopeCookieUpdate(
|
|
114
|
+
String(getRequestUrl()),
|
|
115
|
+
getRequestHeader('cookie') ?? null,
|
|
116
|
+
settings
|
|
117
|
+
);
|
|
118
|
+
} catch {
|
|
119
|
+
// Outside a request (prerender): there is no response to write to.
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (!scope) return;
|
|
123
|
+
setCookie(SCOPE_COOKIE_NAME, JSON.stringify(scope), {
|
|
124
|
+
path: '/',
|
|
125
|
+
maxAge: SCOPE_COOKIE_MAX_AGE,
|
|
126
|
+
sameSite: 'lax',
|
|
127
|
+
});
|
|
128
|
+
})
|
|
129
|
+
.client((): void => {});
|
|
130
|
+
|
|
131
|
+
/** On the server, once the settings are in: {@link alignRequestScopeType}, then {@link persistRequestScope}. */
|
|
132
|
+
function settleRequestScope(queryClient: QueryClient, settings: StoreContext): void {
|
|
133
|
+
if (typeof window !== 'undefined') return;
|
|
134
|
+
alignRequestScopeType(queryClient, settings);
|
|
135
|
+
persistRequestScope(settings);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface BeforeLoadResult {
|
|
139
|
+
settings: StoreContext;
|
|
140
|
+
locale: string;
|
|
141
|
+
dir: 'ltr' | 'rtl';
|
|
142
|
+
authToken: string | null;
|
|
143
|
+
/** Installed apps' snippets, threaded through the beforeLoad context (and recovered on the
|
|
144
|
+
* client via ensureTwilightContextFromMatches) so AppsSnippets can render CDN tags in SSR. */
|
|
145
|
+
appsSnippets?: AppSnippet[];
|
|
146
|
+
/** Per-app public `app.*` buckets, threaded the same way so rootHead can install the
|
|
147
|
+
* `Salla.appScope` factory inline in the SSR head. */
|
|
148
|
+
appsSettings?: AppSettings;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The platform's copy for `locale`, with this merchant's own wording over it.
|
|
153
|
+
*
|
|
154
|
+
* Returns the platform's copy untouched — and makes no request — unless the
|
|
155
|
+
* settings say this language has overrides. That gate is the whole reason this
|
|
156
|
+
* is affordable: the object 404s for most stores, uncached, on the critical
|
|
157
|
+
* path of an SSR render.
|
|
158
|
+
*
|
|
159
|
+
* The entry is found by ISO code rather than by index or key. The API sends
|
|
160
|
+
* `languages` as an object keyed by **upper-case** ISO, and `storeApi` converts
|
|
161
|
+
* it to an array on the way through (`languagesToArray`), so neither the
|
|
162
|
+
* upper-case key nor a position is available here — and matching case-sensitively
|
|
163
|
+
* on `code` would be a lookup that misses silently, leaving the flag absent and
|
|
164
|
+
* the feature simply never running.
|
|
165
|
+
*
|
|
166
|
+
* Nothing about this is fatal. A failed override read leaves the platform's
|
|
167
|
+
* copy in place, which is a storefront in the words Salla ships rather than a
|
|
168
|
+
* storefront that did not render.
|
|
169
|
+
*/
|
|
170
|
+
async function withMerchantTranslations(
|
|
171
|
+
queryClient: QueryClient,
|
|
172
|
+
settings: StoreContext,
|
|
173
|
+
locale: string,
|
|
174
|
+
common: Awaited<ReturnType<typeof translations.get>>
|
|
175
|
+
): Promise<Awaited<ReturnType<typeof translations.get>>> {
|
|
176
|
+
const wanted = locale.toLowerCase();
|
|
177
|
+
const language = settings.languages?.find(
|
|
178
|
+
(entry) => (entry.iso_code ?? entry.code)?.toLowerCase() === wanted
|
|
179
|
+
);
|
|
180
|
+
const storeId = settings.store?.id;
|
|
181
|
+
|
|
182
|
+
if (!language?.has_custom_translations || !storeId) return common;
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const overrides = await queryClient.ensureQueryData(
|
|
186
|
+
translations.queries.byStore(storeId, locale)
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
return translations.merge(common, overrides, locale);
|
|
190
|
+
} catch (error) {
|
|
191
|
+
console.warn('[salla] merchant translations could not be read; using the platform copy', error);
|
|
192
|
+
return common;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export async function rootBeforeLoad(ctx: {
|
|
197
|
+
params: Record<string, string>;
|
|
198
|
+
location: TwilightLocation;
|
|
199
|
+
context: {
|
|
200
|
+
queryClient: QueryClient;
|
|
201
|
+
setLocation?: (location: Partial<TwilightLocation>) => void;
|
|
202
|
+
};
|
|
203
|
+
serverContext?: {
|
|
204
|
+
authToken?: string | null;
|
|
205
|
+
};
|
|
206
|
+
}): Promise<BeforeLoadResult> {
|
|
207
|
+
const locale = ctx.params.locale || FALLBACK_LOCALE;
|
|
208
|
+
const { dir } = getLanguageInfo(locale);
|
|
209
|
+
|
|
210
|
+
if (ctx.context.setLocation) {
|
|
211
|
+
ctx.context.setLocation(ctx.location);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Set locale in context before any API calls so interceptor uses correct locale
|
|
215
|
+
updateTwilightContext({ locale });
|
|
216
|
+
|
|
217
|
+
// Re-assert the locale on the Salla SDK on every navigation. The SDK's axios
|
|
218
|
+
// accept-language header drifts off the route locale (navigator.language default,
|
|
219
|
+
// account-language override on profile fetch — see syncSdkLocale), which makes
|
|
220
|
+
// SDK API calls (e.g. the cart's salla.api.cart.details) return wrong-locale data.
|
|
221
|
+
syncSdkLocale(locale);
|
|
222
|
+
|
|
223
|
+
// Mirror the SDK's selected branch into the `scope` cookie. The SDK persists the
|
|
224
|
+
// selection in localStorage ONLY, so the server — which can only see cookies —
|
|
225
|
+
// would otherwise compute scope=null for every visitor who picked a branch, and
|
|
226
|
+
// the dehydrated settings query (keyed on the scope) would never match on the
|
|
227
|
+
// client. No-op on the server and while the SDK storage API is still hydrating.
|
|
228
|
+
syncScopeCookie();
|
|
229
|
+
|
|
230
|
+
const [settingsResult, translationsResult, snippetsResult, appSettingsResult] = await Promise.all(
|
|
231
|
+
[
|
|
232
|
+
ctx.context.queryClient.ensureQueryData(storeApi.queries.settings()),
|
|
233
|
+
ctx.context.queryClient.ensureQueryData(translations.queries.byLocale(locale)),
|
|
234
|
+
// Snippets → SSR CDN <script> tags (AppsSnippets.ssrCdnScripts). Non-fatal + logged:
|
|
235
|
+
// on failure AppsSnippets falls back to its own client-side query for the same data,
|
|
236
|
+
// so the tags render a paint later instead of being lost for the page load.
|
|
237
|
+
ctx.context.queryClient.ensureQueryData(apps.queries.snippets()).catch((error): undefined => {
|
|
238
|
+
console.warn('[salla] apps/snippets prefetch failed; rendering no CDN snippet tags', error);
|
|
239
|
+
return undefined;
|
|
240
|
+
}),
|
|
241
|
+
// Buckets → rootHead installs `Salla.appScope` inline in the SSR head (before any snippet
|
|
242
|
+
// onReady runs). Non-fatal + logged: the head installs the factory either way, and the
|
|
243
|
+
// client query seeds the buckets into that install once it resolves.
|
|
244
|
+
ctx.context.queryClient.ensureQueryData(apps.queries.settings()).catch((error): undefined => {
|
|
245
|
+
console.warn(
|
|
246
|
+
'[salla] apps/snippets/settings prefetch failed; appScope buckets unseeded',
|
|
247
|
+
error
|
|
248
|
+
);
|
|
249
|
+
return undefined;
|
|
250
|
+
}),
|
|
251
|
+
// Ads → the header's announcement bar renders on the server, so it no longer pushes the
|
|
252
|
+
// page down when it arrives. Non-fatal: the bar then loads on the client, as before.
|
|
253
|
+
ctx.context.queryClient
|
|
254
|
+
.ensureQueryData(advertisement.queries.list())
|
|
255
|
+
.catch((error): undefined => {
|
|
256
|
+
console.warn('[salla] advertisements prefetch failed; the ad bar loads late', error);
|
|
257
|
+
return undefined;
|
|
258
|
+
}),
|
|
259
|
+
]
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
if (!settingsResult) {
|
|
263
|
+
throw new SettingsError('Failed to load store settings. Make sure VITE_STORE_DOMAIN is set.');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Settings answered for another market name another theme version; the SDK only
|
|
267
|
+
// read its `s-version-id` at init — see syncSdkThemeVersion.
|
|
268
|
+
syncSdkThemeVersion(settingsResult.headers);
|
|
269
|
+
|
|
270
|
+
settleRequestScope(ctx.context.queryClient, settingsResult);
|
|
271
|
+
|
|
272
|
+
// On a host where the store is the root of every URL, a page has one address:
|
|
273
|
+
// `/<username>/…`. A request that found its store some other way (`?storeId=`,
|
|
274
|
+
// the preview cookie, `VITE_STORE_DOMAIN`) is sent there now that the settings
|
|
275
|
+
// say what the username is. A full load rather than a client navigation, because
|
|
276
|
+
// the router handling this request was built without that root.
|
|
277
|
+
const storeBaseHref = resolveStoreBaseRedirect(settingsResult.store?.username, ctx.location.href);
|
|
278
|
+
if (storeBaseHref) {
|
|
279
|
+
throw redirect({ href: storeBaseHref, reloadDocument: true, replace: true });
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// The merchant's own wording, laid over the platform's — but only when the
|
|
283
|
+
// settings say this language has any.
|
|
284
|
+
//
|
|
285
|
+
// Sequenced after the `Promise.all` on purpose: the object is keyed by
|
|
286
|
+
// `settings.store.id`, which the settings query is what produces, so this
|
|
287
|
+
// cannot join the batch above. The cost of a second round trip is why it is
|
|
288
|
+
// gated rather than always fetched — see `api/translations.ts` for the two
|
|
289
|
+
// corrections that shape led to.
|
|
290
|
+
const messages = await withMerchantTranslations(
|
|
291
|
+
ctx.context.queryClient,
|
|
292
|
+
settingsResult,
|
|
293
|
+
locale,
|
|
294
|
+
translationsResult
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
// Create i18n instance with loaded translations
|
|
298
|
+
const i18n = createI18nInstance(locale, messages ?? undefined);
|
|
299
|
+
|
|
300
|
+
// Resolve authToken with fallback chain:
|
|
301
|
+
// 1. SSR context (from middleware extracting cookies on server)
|
|
302
|
+
// 2. The twilight context token. On the SERVER this is the token twilightMiddleware
|
|
303
|
+
// extracted from the `token` cookie into the request ALS — reading it here is
|
|
304
|
+
// essential, otherwise this loader's updateTwilightContext() below would
|
|
305
|
+
// overwrite the middleware's token with null and every SSR render (e.g. the
|
|
306
|
+
// account hub) would be unauthenticated. On the CLIENT it's the clientStore
|
|
307
|
+
// token from hydration or a previous navigation.
|
|
308
|
+
// 3. The `token` cookie read directly — client fallback when clientStore is empty
|
|
309
|
+
// and salla.storage hasn't hydrated yet.
|
|
310
|
+
// 4. Salla SDK storage (salla.storage.get('token'))
|
|
311
|
+
let existingToken: string | null = null;
|
|
312
|
+
try {
|
|
313
|
+
existingToken = getTwilightContext().authToken;
|
|
314
|
+
} catch {
|
|
315
|
+
// No request context (e.g. server call outside the middleware ALS) — fall through.
|
|
316
|
+
existingToken = null;
|
|
317
|
+
}
|
|
318
|
+
const cookieToken =
|
|
319
|
+
typeof document !== 'undefined'
|
|
320
|
+
? extractTokenFromCookies(document.cookie, AUTH_TOKEN_COOKIE_NAME)
|
|
321
|
+
: null;
|
|
322
|
+
const sallaToken =
|
|
323
|
+
typeof window !== 'undefined' && typeof window.salla?.storage?.get === 'function'
|
|
324
|
+
? (window.salla.storage.get(AUTH_TOKEN_COOKIE_NAME) as string | null)
|
|
325
|
+
: null;
|
|
326
|
+
const serverCookieToken = readServerCookieToken();
|
|
327
|
+
const authToken =
|
|
328
|
+
ctx.serverContext?.authToken ??
|
|
329
|
+
serverCookieToken ??
|
|
330
|
+
existingToken ??
|
|
331
|
+
cookieToken ??
|
|
332
|
+
sallaToken ??
|
|
333
|
+
null;
|
|
334
|
+
|
|
335
|
+
updateTwilightContext({
|
|
336
|
+
queryClient: ctx.context.queryClient,
|
|
337
|
+
settings: settingsResult,
|
|
338
|
+
locale,
|
|
339
|
+
location: ctx.location,
|
|
340
|
+
i18n,
|
|
341
|
+
authToken,
|
|
342
|
+
appsSnippets: snippetsResult,
|
|
343
|
+
appsSettings: appSettingsResult,
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
return {
|
|
347
|
+
settings: settingsResult,
|
|
348
|
+
locale,
|
|
349
|
+
dir,
|
|
350
|
+
authToken,
|
|
351
|
+
appsSnippets: snippetsResult,
|
|
352
|
+
appsSettings: appSettingsResult,
|
|
353
|
+
};
|
|
354
|
+
}
|