@salla.sa/twilight-theme-engine 1.0.173 → 1.0.175
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-VTBOHLUX.js → AddToCartForm-C3FWHFD4.js} +4 -3
- package/dist/AddToCartForm-C3FWHFD4.js.map +1 -0
- package/dist/{BlogAuthorPage-YGUAMHUF.js → BlogAuthorPage-7W7K7IMP.js} +19 -18
- package/dist/BlogAuthorPage-7W7K7IMP.js.map +1 -0
- package/dist/{BlogCategoryPage-G4YFGNWX.js → BlogCategoryPage-DVCUXFFB.js} +19 -18
- package/dist/BlogCategoryPage-DVCUXFFB.js.map +1 -0
- package/dist/{BlogPage-7SBQ7QM3.js → BlogPage-JU7WXPAO.js} +17 -16
- package/dist/BlogPage-JU7WXPAO.js.map +1 -0
- package/dist/{BlogSinglePage-THZBCWHZ.js → BlogSinglePage-BO3H373O.js} +17 -16
- package/dist/BlogSinglePage-BO3H373O.js.map +1 -0
- package/dist/{BlogTagPage-IOA5V6DR.js → BlogTagPage-TXVT2F4A.js} +19 -18
- package/dist/BlogTagPage-TXVT2F4A.js.map +1 -0
- package/dist/{BrandsPage-XOPICQRQ.js → BrandsPage-233ICYLO.js} +18 -17
- package/dist/BrandsPage-233ICYLO.js.map +1 -0
- package/dist/{Breadcrumb-GS6PCHYZ.js → Breadcrumb-AL6KQ3AJ.js} +17 -16
- package/dist/Breadcrumb-AL6KQ3AJ.js.map +1 -0
- package/dist/{CartItem-5W46GZCN.js → CartItem-STZEX5ML.js} +17 -16
- package/dist/CartItem-STZEX5ML.js.map +1 -0
- package/dist/{CartSummary-URLCQGOH.js → CartSummary-NBL4W3MD.js} +17 -16
- package/dist/CartSummary-NBL4W3MD.js.map +1 -0
- package/dist/{Copyright-WUVGM6L4.js → Copyright-57SVW6E5.js} +4 -3
- package/dist/Copyright-57SVW6E5.js.map +1 -0
- package/dist/{CustomerLayout-YMC7LGIY.js → CustomerLayout-4IFBNFCA.js} +17 -16
- package/dist/CustomerLayout-4IFBNFCA.js.map +1 -0
- package/dist/{Footer-GGSJAPFV.js → Footer-RQ44MW6G.js} +5 -4
- package/dist/{Footer-GGSJAPFV.js.map → Footer-RQ44MW6G.js.map} +1 -1
- package/dist/GoogleTag-J7KKZZ2O.js +15 -0
- package/dist/{GoogleTag-E7TGN35M.js.map → GoogleTag-J7KKZZ2O.js.map} +1 -1
- package/dist/{Header-KKRI5YVD.js → Header-CQ5OHZ45.js} +9 -8
- package/dist/{Header-KKRI5YVD.js.map → Header-CQ5OHZ45.js.map} +1 -1
- package/dist/{LatestProducts-P2WDLVQE.js → LatestProducts-XYGMGDMG.js} +19 -18
- package/dist/LatestProducts-XYGMGDMG.js.map +1 -0
- package/dist/{LoyaltyPage-U2PIXUE7.js → LoyaltyPage-C54UQ7D4.js} +17 -16
- package/dist/LoyaltyPage-C54UQ7D4.js.map +1 -0
- package/dist/{LoyaltyPointsPage-LTEDSY53.js → LoyaltyPointsPage-UNDIJ7WA.js} +6 -6
- package/dist/{LoyaltyPointsPage-LTEDSY53.js.map → LoyaltyPointsPage-UNDIJ7WA.js.map} +1 -1
- package/dist/{MainMenu-OOHZS7ZY.js → MainMenu-4Z5FB5P4.js} +6 -5
- package/dist/MainMenu-4Z5FB5P4.js.map +1 -0
- package/dist/{MasterLayout-USLUIILK.js → MasterLayout-Q2ROPDUV.js} +17 -16
- package/dist/{MasterLayout-USLUIILK.js.map → MasterLayout-Q2ROPDUV.js.map} +1 -1
- package/dist/{MobileMenu-NQN7OFAO.js → MobileMenu-WAFUVW4A.js} +18 -17
- package/dist/MobileMenu-WAFUVW4A.js.map +1 -0
- package/dist/{NotificationsPage-SR3QKLKK.js → NotificationsPage-G7FMTEA2.js} +17 -16
- package/dist/NotificationsPage-G7FMTEA2.js.map +1 -0
- package/dist/{OrderSinglePage-XTF63LB4.js → OrderSinglePage-X6MCOL6W.js} +18 -17
- package/dist/OrderSinglePage-X6MCOL6W.js.map +1 -0
- package/dist/{OrdersPage-U2XMA4RN.js → OrdersPage-UD7GBAVD.js} +17 -16
- package/dist/OrdersPage-UD7GBAVD.js.map +1 -0
- package/dist/{PageSingle-I3KYW73A.js → PageSingle-7ZH7WWMF.js} +4 -3
- package/dist/PageSingle-7ZH7WWMF.js.map +1 -0
- package/dist/{ProductDetails-KJUKC77N.js → ProductDetails-GA6HMHFZ.js} +5 -4
- package/dist/ProductDetails-GA6HMHFZ.js.map +1 -0
- package/dist/{ProfilePage-7QR7LADM.js → ProfilePage-GB46VBMN.js} +17 -16
- package/dist/ProfilePage-GB46VBMN.js.map +1 -0
- package/dist/{ReviewsPage-6CUXKQTE.js → ReviewsPage-4OFPQ73X.js} +4 -3
- package/dist/ReviewsPage-4OFPQ73X.js.map +1 -0
- package/dist/{SeoCartWidget-N2LA6A7X.js → SeoCartWidget-3VJJPN6Q.js} +17 -16
- package/dist/SeoCartWidget-3VJJPN6Q.js.map +1 -0
- package/dist/{SettingsPage-GOCQCD2S.js → SettingsPage-ZBWPLXXZ.js} +17 -16
- package/dist/SettingsPage-ZBWPLXXZ.js.map +1 -0
- package/dist/{StoreClosedNotification-HENJD2FF.js → StoreClosedNotification-JKPZLCQW.js} +18 -17
- package/dist/{StoreClosedNotification-HENJD2FF.js.map → StoreClosedNotification-JKPZLCQW.js.map} +1 -1
- package/dist/{TestimonialsPage-WUAQTTCJ.js → TestimonialsPage-ZLKUBVH2.js} +4 -3
- package/dist/TestimonialsPage-ZLKUBVH2.js.map +1 -0
- package/dist/{ThankYouPage-4DBKB2GP.js → ThankYouPage-W7TLYF5K.js} +17 -16
- package/dist/ThankYouPage-W7TLYF5K.js.map +1 -0
- package/dist/{WalletPage-3DKLWXL3.js → WalletPage-2DFZQSBP.js} +18 -17
- package/dist/WalletPage-2DFZQSBP.js.map +1 -0
- package/dist/{WebMcpTools-QJ6BM3A5.js → WebMcpTools-5DGFFQDR.js} +5 -5
- package/dist/{WebMcpTools-QJ6BM3A5.js.map → WebMcpTools-5DGFFQDR.js.map} +1 -1
- package/dist/{WishlistPage-Y5FOA72G.js → WishlistPage-76YDKKT3.js} +19 -18
- package/dist/WishlistPage-76YDKKT3.js.map +1 -0
- package/dist/api/advertisement.js +2 -2
- package/dist/api/apps.js +2 -2
- package/dist/api/blog.js +3 -3
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/custom-url.js +2 -2
- package/dist/api/home.js +2 -2
- package/dist/api/loyalty.js +3 -3
- package/dist/api/menu.js +2 -2
- package/dist/api/notification.js +2 -2
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/profile.js +1 -1
- package/dist/api/store.js +2 -2
- package/dist/api/translations.js +2 -2
- package/dist/api/user.js +2 -2
- package/dist/api/wallet.js +2 -2
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-EOAKXOGS.js → chunk-2B3TEWS5.js} +4 -4
- package/dist/{chunk-EOAKXOGS.js.map → chunk-2B3TEWS5.js.map} +1 -1
- package/dist/{chunk-JGRPYAEQ.js → chunk-36ZY4C3I.js} +4 -4
- package/dist/{chunk-JGRPYAEQ.js.map → chunk-36ZY4C3I.js.map} +1 -1
- package/dist/{chunk-KKV7MI4T.js → chunk-3WW5RRMV.js} +3 -3
- package/dist/{chunk-KKV7MI4T.js.map → chunk-3WW5RRMV.js.map} +1 -1
- package/dist/{chunk-W66Y6VFR.js → chunk-4NA4FWJR.js} +3 -3
- package/dist/{chunk-W66Y6VFR.js.map → chunk-4NA4FWJR.js.map} +1 -1
- package/dist/{chunk-KQPSRSDX.js → chunk-4YBXC6VB.js} +3 -3
- package/dist/{chunk-KQPSRSDX.js.map → chunk-4YBXC6VB.js.map} +1 -1
- package/dist/{chunk-ZGLG5K2X.js → chunk-5CNEKDOL.js} +5 -5
- package/dist/{chunk-ZGLG5K2X.js.map → chunk-5CNEKDOL.js.map} +1 -1
- package/dist/{chunk-CGXPLTDP.js → chunk-5JTABBET.js} +3 -3
- package/dist/{chunk-CGXPLTDP.js.map → chunk-5JTABBET.js.map} +1 -1
- package/dist/{chunk-ZOLSQJ6L.js → chunk-5SIHL4SO.js} +5 -5
- package/dist/{chunk-ZOLSQJ6L.js.map → chunk-5SIHL4SO.js.map} +1 -1
- package/dist/{chunk-72DTLJ4M.js → chunk-5U26XIYM.js} +4 -4
- package/dist/{chunk-72DTLJ4M.js.map → chunk-5U26XIYM.js.map} +1 -1
- package/dist/{chunk-GQATERRD.js → chunk-AEGTXS5Z.js} +3 -3
- package/dist/{chunk-GQATERRD.js.map → chunk-AEGTXS5Z.js.map} +1 -1
- package/dist/{chunk-573JVFS6.js → chunk-BOW6FYVT.js} +4 -4
- package/dist/{chunk-573JVFS6.js.map → chunk-BOW6FYVT.js.map} +1 -1
- package/dist/{chunk-62IGEDXC.js → chunk-C6LFYWTH.js} +5 -5
- package/dist/{chunk-62IGEDXC.js.map → chunk-C6LFYWTH.js.map} +1 -1
- package/dist/{chunk-M4RPRK6X.js → chunk-DCVO3Y3H.js} +3 -3
- package/dist/{chunk-M4RPRK6X.js.map → chunk-DCVO3Y3H.js.map} +1 -1
- package/dist/{chunk-EXXYVFOL.js → chunk-EJN2SKCV.js} +3 -3
- package/dist/{chunk-EXXYVFOL.js.map → chunk-EJN2SKCV.js.map} +1 -1
- package/dist/{chunk-WKYVO7GA.js → chunk-ELWQBJG5.js} +4 -4
- package/dist/{chunk-WKYVO7GA.js.map → chunk-ELWQBJG5.js.map} +1 -1
- package/dist/{chunk-ROOK3RYP.js → chunk-F3L5GYPS.js} +7 -7
- package/dist/{chunk-ROOK3RYP.js.map → chunk-F3L5GYPS.js.map} +1 -1
- package/dist/{chunk-G7FOGIKO.js → chunk-FBRQ27SR.js} +4 -4
- package/dist/{chunk-G7FOGIKO.js.map → chunk-FBRQ27SR.js.map} +1 -1
- package/dist/{chunk-U3O4WFYE.js → chunk-G7BQM7RU.js} +3 -3
- package/dist/{chunk-U3O4WFYE.js.map → chunk-G7BQM7RU.js.map} +1 -1
- package/dist/{chunk-GGC3GNGE.js → chunk-IM6MQVVO.js} +3 -3
- package/dist/{chunk-GGC3GNGE.js.map → chunk-IM6MQVVO.js.map} +1 -1
- package/dist/{chunk-2DHRNBRV.js → chunk-INOCELVE.js} +3 -3
- package/dist/{chunk-2DHRNBRV.js.map → chunk-INOCELVE.js.map} +1 -1
- package/dist/{chunk-4EUFOCSW.js → chunk-IPCZONQT.js} +3 -3
- package/dist/{chunk-4EUFOCSW.js.map → chunk-IPCZONQT.js.map} +1 -1
- package/dist/{chunk-VZVHWGOT.js → chunk-IVO6YRRK.js} +3 -20
- package/dist/chunk-IVO6YRRK.js.map +1 -0
- package/dist/{chunk-QT5R6I4Z.js → chunk-JOLKCJWI.js} +3 -3
- package/dist/{chunk-QT5R6I4Z.js.map → chunk-JOLKCJWI.js.map} +1 -1
- package/dist/{chunk-O35RSSIG.js → chunk-KOBI67BT.js} +9 -7
- package/dist/chunk-KOBI67BT.js.map +1 -0
- package/dist/{chunk-BCANDN7W.js → chunk-LRJWJNJS.js} +3 -3
- package/dist/{chunk-BCANDN7W.js.map → chunk-LRJWJNJS.js.map} +1 -1
- package/dist/{chunk-V4R2MRG4.js → chunk-MCHRCHO3.js} +4 -4
- package/dist/{chunk-V4R2MRG4.js.map → chunk-MCHRCHO3.js.map} +1 -1
- package/dist/{chunk-DVRYI7Z2.js → chunk-MWTNO2CP.js} +7 -7
- package/dist/{chunk-DVRYI7Z2.js.map → chunk-MWTNO2CP.js.map} +1 -1
- package/dist/{chunk-KJQZBZOP.js → chunk-NYSKWLQB.js} +17 -17
- package/dist/{chunk-KJQZBZOP.js.map → chunk-NYSKWLQB.js.map} +1 -1
- package/dist/{chunk-TJZNVDXQ.js → chunk-OIO6UK7R.js} +3 -3
- package/dist/{chunk-TJZNVDXQ.js.map → chunk-OIO6UK7R.js.map} +1 -1
- package/dist/{chunk-SD2EXGJ7.js → chunk-PVBV2NZC.js} +4 -4
- package/dist/{chunk-SD2EXGJ7.js.map → chunk-PVBV2NZC.js.map} +1 -1
- package/dist/{chunk-PFTWGCOB.js → chunk-QVKKI5MG.js} +3 -3
- package/dist/{chunk-PFTWGCOB.js.map → chunk-QVKKI5MG.js.map} +1 -1
- package/dist/{chunk-WRQWVA43.js → chunk-RGQUB3PL.js} +4 -4
- package/dist/{chunk-WRQWVA43.js.map → chunk-RGQUB3PL.js.map} +1 -1
- package/dist/{chunk-ESPZHE6Q.js → chunk-SF7S7JTU.js} +3 -3
- package/dist/{chunk-ESPZHE6Q.js.map → chunk-SF7S7JTU.js.map} +1 -1
- package/dist/{chunk-4XBIRLXV.js → chunk-T3664AQW.js} +4 -4
- package/dist/{chunk-4XBIRLXV.js.map → chunk-T3664AQW.js.map} +1 -1
- package/dist/{chunk-RQFNZYJ6.js → chunk-TCSM2DM4.js} +4 -4
- package/dist/{chunk-RQFNZYJ6.js.map → chunk-TCSM2DM4.js.map} +1 -1
- package/dist/{chunk-3X7V5WZM.js → chunk-TH3ZNTOU.js} +3 -3
- package/dist/{chunk-3X7V5WZM.js.map → chunk-TH3ZNTOU.js.map} +1 -1
- package/dist/{chunk-TTGSA43I.js → chunk-TRY7HEE2.js} +5 -5
- package/dist/{chunk-TTGSA43I.js.map → chunk-TRY7HEE2.js.map} +1 -1
- package/dist/chunk-UE2BAFKQ.js +22 -0
- package/dist/chunk-UE2BAFKQ.js.map +1 -0
- package/dist/{chunk-OROGLC4M.js → chunk-UNCMDVB7.js} +27 -14
- package/dist/chunk-UNCMDVB7.js.map +1 -0
- package/dist/{chunk-EF5KA7NS.js → chunk-UVUQG4Q5.js} +5 -5
- package/dist/{chunk-EF5KA7NS.js.map → chunk-UVUQG4Q5.js.map} +1 -1
- package/dist/{chunk-WTHBHPEW.js → chunk-VKUXMOB3.js} +3 -3
- package/dist/{chunk-WTHBHPEW.js.map → chunk-VKUXMOB3.js.map} +1 -1
- package/dist/{chunk-DSVXHHGG.js → chunk-WFJI3OLT.js} +4 -4
- package/dist/{chunk-DSVXHHGG.js.map → chunk-WFJI3OLT.js.map} +1 -1
- package/dist/{chunk-XTWAHQN5.js → chunk-WJB3YBF5.js} +3 -3
- package/dist/{chunk-XTWAHQN5.js.map → chunk-WJB3YBF5.js.map} +1 -1
- package/dist/{chunk-QSFFYY5C.js → chunk-XCGBPYRZ.js} +4 -4
- package/dist/{chunk-QSFFYY5C.js.map → chunk-XCGBPYRZ.js.map} +1 -1
- package/dist/{chunk-3CFFTSYB.js → chunk-XL6ITANU.js} +3 -3
- package/dist/{chunk-3CFFTSYB.js.map → chunk-XL6ITANU.js.map} +1 -1
- package/dist/{chunk-ZZWQG4CA.js → chunk-XND5HU3O.js} +7 -7
- package/dist/{chunk-ZZWQG4CA.js.map → chunk-XND5HU3O.js.map} +1 -1
- package/dist/{chunk-23ZYXGCV.js → chunk-XOFOMJ4E.js} +4 -4
- package/dist/{chunk-23ZYXGCV.js.map → chunk-XOFOMJ4E.js.map} +1 -1
- package/dist/{chunk-LXXUUYOP.js → chunk-XQ7N5EVD.js} +4 -4
- package/dist/{chunk-LXXUUYOP.js.map → chunk-XQ7N5EVD.js.map} +1 -1
- package/dist/{chunk-OJGYVNGL.js → chunk-XZO7ZWHI.js} +4 -4
- package/dist/{chunk-OJGYVNGL.js.map → chunk-XZO7ZWHI.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +2 -1
- package/dist/components/drawer/index.js +15 -14
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/index.js +20 -19
- package/dist/components/layout/index.js +4 -4
- package/dist/components/product/index.js +17 -16
- package/dist/components/store/index.js +16 -15
- package/dist/components/tracking/index.js +6 -6
- package/dist/{custom-urls-MLYQCNMI.js → custom-urls-BAKURERE.js} +7 -7
- package/dist/{custom-urls-MLYQCNMI.js.map → custom-urls-BAKURERE.js.map} +1 -1
- package/dist/dev/editor/index.js +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-3TIRU6H3.js → document-class-VW4NEJUX.js} +17 -16
- package/dist/{document-class-3TIRU6H3.js.map → document-class-VW4NEJUX.js.map} +1 -1
- package/dist/hooks/index.js +15 -14
- package/dist/hooks/useGtm.js +15 -14
- package/dist/hooks/useMoney.js +15 -14
- package/dist/hooks/useStore.js +15 -14
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/{navigation-ENKLSLYF.js → navigation-54CI4J6L.js} +4 -4
- package/dist/{navigation-ENKLSLYF.js.map → navigation-54CI4J6L.js.map} +1 -1
- package/dist/{navigation-K5BBPLFU.js → navigation-C26Y4VCK.js} +5 -5
- package/dist/{navigation-K5BBPLFU.js.map → navigation-C26Y4VCK.js.map} +1 -1
- package/dist/{not-found-5VDDIWBR.js → not-found-4RVH4PCY.js} +18 -17
- package/dist/not-found-4RVH4PCY.js.map +1 -0
- package/dist/providers/index.js +15 -14
- package/dist/routes/account/orders.js +4 -4
- package/dist/routes/account.js +13 -13
- package/dist/routes/blog.js +8 -8
- package/dist/routes/brands.js +4 -4
- package/dist/routes/cart.js +24 -23
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +21 -20
- package/dist/routes/index.js +8 -8
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product-listing/BrandSkeleton.d.ts +6 -0
- package/dist/routes/product-listing/BrandSkeleton.d.ts.map +1 -0
- package/dist/routes/product-listing/index.d.ts +2 -0
- package/dist/routes/product-listing/index.d.ts.map +1 -1
- package/dist/routes/product-listing.js +53 -28
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +24 -23
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +8 -8
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +21 -20
- package/dist/{store-lookup-L5G3GWL3.js → store-lookup-DIUCAZKB.js} +8 -8
- package/dist/{store-lookup-L5G3GWL3.js.map → store-lookup-DIUCAZKB.js.map} +1 -1
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack.js +17 -16
- package/dist/tanstack.js.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/vite/adapters/tanstack.adapter.d.ts.map +1 -1
- package/dist/vite/index.js +1 -0
- package/dist/vite/index.js.map +1 -1
- package/package.json +1 -1
- package/tailwind/components/home/HomePageRenderer.tsx.txt +2 -0
- package/tailwind/routes/product-listing/BrandSkeleton.tsx.txt +55 -0
- package/tailwind/routes/product-listing/index.tsx.txt +2 -0
- package/dist/AddToCartForm-VTBOHLUX.js.map +0 -1
- package/dist/BlogAuthorPage-YGUAMHUF.js.map +0 -1
- package/dist/BlogCategoryPage-G4YFGNWX.js.map +0 -1
- package/dist/BlogPage-7SBQ7QM3.js.map +0 -1
- package/dist/BlogSinglePage-THZBCWHZ.js.map +0 -1
- package/dist/BlogTagPage-IOA5V6DR.js.map +0 -1
- package/dist/BrandsPage-XOPICQRQ.js.map +0 -1
- package/dist/Breadcrumb-GS6PCHYZ.js.map +0 -1
- package/dist/CartItem-5W46GZCN.js.map +0 -1
- package/dist/CartSummary-URLCQGOH.js.map +0 -1
- package/dist/Copyright-WUVGM6L4.js.map +0 -1
- package/dist/CustomerLayout-YMC7LGIY.js.map +0 -1
- package/dist/GoogleTag-E7TGN35M.js +0 -15
- package/dist/LatestProducts-P2WDLVQE.js.map +0 -1
- package/dist/LoyaltyPage-U2PIXUE7.js.map +0 -1
- package/dist/MainMenu-OOHZS7ZY.js.map +0 -1
- package/dist/MobileMenu-NQN7OFAO.js.map +0 -1
- package/dist/NotificationsPage-SR3QKLKK.js.map +0 -1
- package/dist/OrderSinglePage-XTF63LB4.js.map +0 -1
- package/dist/OrdersPage-U2XMA4RN.js.map +0 -1
- package/dist/PageSingle-I3KYW73A.js.map +0 -1
- package/dist/ProductDetails-KJUKC77N.js.map +0 -1
- package/dist/ProfilePage-7QR7LADM.js.map +0 -1
- package/dist/ReviewsPage-6CUXKQTE.js.map +0 -1
- package/dist/SeoCartWidget-N2LA6A7X.js.map +0 -1
- package/dist/SettingsPage-GOCQCD2S.js.map +0 -1
- package/dist/TestimonialsPage-WUAQTTCJ.js.map +0 -1
- package/dist/ThankYouPage-4DBKB2GP.js.map +0 -1
- package/dist/WalletPage-3DKLWXL3.js.map +0 -1
- package/dist/WishlistPage-Y5FOA72G.js.map +0 -1
- package/dist/chunk-O35RSSIG.js.map +0 -1
- package/dist/chunk-OROGLC4M.js.map +0 -1
- package/dist/chunk-VZVHWGOT.js.map +0 -1
- package/dist/not-found-5VDDIWBR.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/routes/account/wishlist/WishlistShare.tsx","../src/routes/account/wishlist/WishlistPage.tsx"],"names":["SallaSocialShare","useEffect","jsxs","jsx","SallaButton","useRef","useState","useCallback","items"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,QAAA,CAAmB,EAAE,CAAA;AAC3D,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,EAAE,CAAA;AAE3C,EAAA,MAAM,YAAA,GAAe,MAAA,CAAiB,EAAE,CAAA;AACxC,EAAA,MAAM,cAAA,GAAiB,OAAkC,IAAI,CAAA;AAE7D,EAAA,MAAM,KAAA,GAAQ,WAAA,CAAY,OAAO,GAAA,EAAe,SAAA,KAAuB;A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AAA,EAAK,YAAY,GAAG,CAAA;AAAA,QAE3C,WAACK,MAAAA,KAAU;AACV,UAAA,MAAM,SAAA,GAAYA,MAAAA,CAAM,MAAA,CAAO,CAAC,IAAA,KAAS,CAAC,UAAA,CAAW,GAAA,CAAI,MAAA,CAAO,IAAA,CAAK,EAAE,CAAC,CAAC,CAAA;AACzE,UAAA,UAAA,CAAW,YAAA,CAAa,UAAU,SAAA,CAAU,GAAA,CAAI,CAAC,IAAA,KAAS,MAAA,CAAO,IAAA,CAAK,EAAE,CAAC,CAAA;AACzE,UAAA,OAAO,SAAA,CAAU,GAAA,CAAI,CAAC,IAAA,qBACpBL,GAAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cAEC,OAAA,EAAS,IAAA;AAAA,cACT,UAAU,WAAA,CAAY,GAAA,CAAI,MAAA,CAAO,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,cACzC,SAAA,EAAW,cAAA;AAAA,cACX,SAAA,EAAW;AAAA,gBACT,WAAW,UAAA,CAAW,SAAA;AAAA,gBACtB,UAAU,aAAA,CAAc,GAAA,CAAI,MAAA,CAAO,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,gBAC3C,UAAU,UAAA,CAAW;AAAA;AACvB,aAAA;AAAA,YARK,IAAA,CAAK;AAAA,WAUb,CAAA;AAAA,QACH;AAAA,OAAA;AAAA,MAnCK;AAAA,KAoCP;AAAA,oBACAA,GAAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,6BAAA,EAA8B;AAAA,GAAA,EAC/C,CAAA;AAEJ","file":"WishlistPage-76YDKKT3.js","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\n// The eager (non-deferred) export: the share dialog is opened imperatively through a ref, and the\n// deferred wrapper doesn't attach it until it has hydrated — a click before that would do nothing.\nimport { SallaSocialShareCore as SallaSocialShare } from '@salla.sa/twilight-components-react/social-share';\nimport { useTranslation } from '../../../providers/I18nProvider';\n\ntype ShareResponse = { data?: { url?: string }; url?: string } | undefined;\ntype SocialShareElement = HTMLElement & {\n url?: string;\n refresh?: () => Promise<void>;\n open?: () => Promise<void>;\n close?: () => Promise<void>;\n};\n\n/**\n * Share state for the wishlist page: the \"Share\" dropdown (share the whole list / share\n * specific items), the selection used by \"specific items\", and the share request itself.\n * Mirrors what the SDK's `<salla-wishlist-actions>` does, but drives the page's own React\n * list — that component needs a sibling `<salla-products-list>`, which this page doesn't render.\n */\nexport function useWishlistShare() {\n const [menuOpen, setMenuOpen] = useState(false);\n const [selecting, setSelecting] = useState(false);\n const [selectedIds, setSelectedIds] = useState<number[]>([]);\n const [sharing, setSharing] = useState(false);\n const [shareUrl, setShareUrl] = useState('');\n /** Ids of every product currently rendered (later cursor pages included), for \"select all\". */\n const loadedIdsRef = useRef<number[]>([]);\n const socialShareRef = useRef<SocialShareElement | null>(null);\n\n const share = useCallback(async (ids: number[], selectAll: boolean) => {\n if (!window.salla?.wishlist?.share) return;\n setSharing(true);\n try {\n const response = (await window.salla.wishlist.share(ids, selectAll)) as ShareResponse;\n const url = response?.data?.url || response?.url || '';\n if (!url) return;\n setShareUrl(url);\n const element = socialShareRef.current;\n if (element) {\n element.url = url;\n await element.refresh?.();\n await element.open?.();\n }\n } catch {\n // The SDK reports a failed share itself (notification); nothing to recover here.\n } finally {\n setSharing(false);\n }\n }, []);\n\n const shareAll = useCallback(() => {\n setMenuOpen(false);\n void share([], true);\n }, [share]);\n\n const shareSelected = useCallback(() => {\n if (selectedIds.length) void share(selectedIds, false);\n }, [share, selectedIds]);\n\n const startSelecting = useCallback(() => {\n setMenuOpen(false);\n setSelecting(true);\n }, []);\n\n const cancelSelecting = useCallback(() => {\n setSelecting(false);\n setSelectedIds([]);\n setShareUrl('');\n void socialShareRef.current?.close?.();\n }, []);\n\n const toggleSelected = useCallback((id: number) => {\n setShareUrl('');\n setSelectedIds((current) =>\n current.includes(id) ? current.filter((existing) => existing !== id) : [...current, id]\n );\n }, []);\n\n const selectedIdsRef = useRef(selectedIds);\n useEffect(() => {\n selectedIdsRef.current = selectedIds;\n }, [selectedIds]);\n\n const deselect = useCallback((id: number) => {\n if (!selectedIdsRef.current.includes(id)) return;\n // A link built for the old selection would still offer the removed product.\n setShareUrl('');\n const element = socialShareRef.current;\n if (element) {\n element.url = undefined;\n void element.close?.();\n }\n setSelectedIds((current) => current.filter((existing) => existing !== id));\n }, []);\n\n const toggleAll = useCallback(() => {\n setShareUrl('');\n setSelectedIds((current) =>\n current.length && current.length === loadedIdsRef.current.length\n ? []\n : [...loadedIdsRef.current]\n );\n }, []);\n\n return {\n menuOpen,\n setMenuOpen,\n selecting,\n selectedIds,\n sharing,\n shareUrl,\n loadedIdsRef,\n socialShareRef,\n shareAll,\n shareSelected,\n startSelecting,\n cancelSelecting,\n toggleSelected,\n toggleAll,\n deselect,\n };\n}\n\nexport type WishlistShareState = ReturnType<typeof useWishlistShare>;\n\n/** The bar above the wishlist: the \"Share\" dropdown, or — while picking products — the selection controls. */\nexport function WishlistShareBar({\n state,\n hasProducts,\n}: {\n state: WishlistShareState;\n hasProducts: boolean;\n}) {\n const { t } = useTranslation();\n const rootRef = useRef<HTMLDivElement>(null);\n const { menuOpen, setMenuOpen } = state;\n\n // Close the dropdown on an outside click or Escape.\n useEffect(() => {\n if (!menuOpen) return;\n const onPointerDown = (event: MouseEvent) => {\n if (!rootRef.current?.contains(event.target as Node)) setMenuOpen(false);\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setMenuOpen(false);\n };\n document.addEventListener('mousedown', onPointerDown);\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('mousedown', onPointerDown);\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [menuOpen, setMenuOpen]);\n\n const selectedCount = state.selectedIds.length;\n const allSelected = selectedCount > 0 && selectedCount === state.loadedIdsRef.current.length;\n\n return (\n <div ref={rootRef} className=\"s-wishlist-actions\">\n <div className=\"s-wishlist-actions-bar flex items-center justify-end gap-3 mb-3\">\n {state.selecting ? (\n <div className=\"s-wishlist-actions-selection flex items-center gap-3\">\n <label className=\"s-wishlist-actions-select-all inline-flex items-center gap-2 text-sm\">\n <input\n type=\"checkbox\"\n checked={allSelected}\n ref={(input) => {\n if (input) input.indeterminate = selectedCount > 0 && !allSelected;\n }}\n onChange={state.toggleAll}\n />\n {t('pages.wishlist.select_all', 'Select all')}\n </label>\n <SallaButton\n color=\"primary\"\n disabled={selectedCount === 0 || state.sharing}\n onClick={state.shareSelected}\n >\n {t('pages.wishlist.share', 'Share')}\n {selectedCount > 0 ? ` (${selectedCount})` : ''}\n </SallaButton>\n <SallaButton fill=\"outline\" color=\"light\" onClick={state.cancelSelecting}>\n {t('common.elements.cancel', 'Cancel')}\n </SallaButton>\n </div>\n ) : (\n <div className=\"s-wishlist-actions-dropdown relative\">\n <SallaButton\n color=\"primary\"\n fill=\"outline\"\n disabled={!hasProducts || state.sharing}\n aria-haspopup=\"true\"\n aria-expanded={menuOpen}\n onClick={() => setMenuOpen(!menuOpen)}\n >\n <span className=\"flex items-center justify-center gap-2\">\n <i className=\"sicon-share-alt\" aria-hidden=\"true\" />\n {t('pages.wishlist.share', 'Share')}\n <i className=\"sicon-keyboard_arrow_down\" aria-hidden=\"true\" />\n </span>\n </SallaButton>\n {menuOpen && (\n <ul\n role=\"menu\"\n className=\"s-wishlist-actions-menu absolute z-10 mt-2 min-w-48 rounded-md bg-white py-2 shadow-default rtl:right-0 ltr:left-0\"\n >\n <li role=\"none\">\n <button\n type=\"button\"\n role=\"menuitem\"\n className=\"s-wishlist-actions-item block w-full px-4 py-2 text-start text-sm text-gray-700 hover:bg-gray-50\"\n onClick={state.shareAll}\n >\n {t('pages.wishlist.share_all', 'Share the list')}\n </button>\n </li>\n <li role=\"none\">\n <button\n type=\"button\"\n role=\"menuitem\"\n className=\"s-wishlist-actions-item block w-full px-4 py-2 text-start text-sm text-gray-700 hover:bg-gray-50\"\n onClick={state.startSelecting}\n >\n {t('pages.wishlist.share_specific', 'Share specific items')}\n </button>\n </li>\n </ul>\n )}\n </div>\n )}\n </div>\n {/* Same setup as the SDK's <salla-wishlist-actions>: the centered modal variant, opened by the\n dropdown rather than by the component's own round share button, so the default\n `widget` slot (that button) is replaced by an empty anchor. */}\n <SallaSocialShare\n ref={state.socialShareRef as never}\n url={state.shareUrl || undefined}\n mode=\"modal\"\n modalTitle={t('pages.wishlist.share_list_title', 'Share wishlist')}\n className=\"s-wishlist-actions-social\"\n >\n <span slot=\"widget\" className=\"s-wishlist-actions-social-anchor\" aria-hidden=\"true\" />\n </SallaSocialShare>\n </div>\n );\n}\n","import { useCallback, useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { ItemsList } from '@salla.sa/twilight-components-react';\nimport { SallaAddProductButton } from '@salla.sa/twilight-components-react/add-product-button';\nimport { SallaButton } from '@salla.sa/twilight-components-react/button';\nimport { wishlist } from '../../../api/wishlist';\nimport type { Product } from '../../../types';\nimport { HookSlot, useWishlist, useMoney } from '../../../hooks';\nimport { useTranslation } from '../../../providers/I18nProvider';\nimport type { WishlistPageProps } from './types';\nimport { WishlistShareBar, useWishlistShare } from './WishlistShare';\nimport { NoContent, Image } from '../../../components/common';\nimport { useLocation } from '../../../providers/NavigationProvider';\nimport { onSallaEvent } from '../../../utils/sdk-helpers';\n\ninterface WishlistCardSelection {\n /** \"Share specific items\" mode: the card shows a checkbox and toggles on click. */\n selecting: boolean;\n selected: boolean;\n onToggle: (id: number) => void;\n}\n\n// The loaded component copies host attributes (not properties) onto its inner salla-button.\nconst setAddButtonAttributes = (el: HTMLElement | null) => {\n el?.setAttribute('loader-position', 'center');\n el?.setAttribute('fill', 'outline');\n};\n\nconst REMOVING_MS = 300;\n\nconst REMOVING_STYLE: CSSProperties = {\n opacity: 0,\n transform: 'scale(0.95)',\n transition: `opacity ${REMOVING_MS}ms ease-in-out, transform ${REMOVING_MS}ms ease-in-out`,\n};\n\nfunction WishlistCard({\n product: prod,\n selection,\n removing,\n onRemoved,\n}: {\n product: Product;\n selection?: WishlistCardSelection;\n /** Fades the card out, then calls `onRemoved` once the fade ends. */\n removing?: boolean;\n onRemoved?: (id: number) => void;\n}) {\n const { remove } = useWishlist();\n const { format } = useMoney();\n\n // Drops the card even when `transitionend` never fires (hidden tab, overridden styles).\n useEffect(() => {\n if (!removing) return;\n const timer = setTimeout(() => onRemoved?.(Number(prod.id)), REMOVING_MS + 50);\n return () => clearTimeout(timer);\n }, [removing, onRemoved, prod.id]);\n\n const handleRemove = () => {\n if (prod.id) {\n remove(Number(prod.id));\n }\n };\n\n const displayPrice = prod.sale_price ?? prod.price;\n const regularPrice = prod.regular_price;\n\n return (\n <div\n id={`wishlist-product-${prod.id}`}\n className={`product-entry product-entry--wishlist${selection?.selected ? ' is-selected' : ''}`}\n style={removing ? REMOVING_STYLE : undefined}\n onTransitionEnd={(event) => {\n if (removing && event.target === event.currentTarget && event.propertyName === 'opacity') {\n onRemoved?.(Number(prod.id));\n }\n }}\n >\n {selection?.selecting && (\n <input\n type=\"checkbox\"\n className=\"s-wishlist-select shrink-0 rtl:ml-4 ltr:mr-4\"\n aria-label={prod.name}\n checked={selection.selected}\n onChange={() => selection.onToggle(Number(prod.id))}\n />\n )}\n <div className=\"flex items-center mb-4 sm:mb-0\">\n <a href={prod.url} className=\"product-entry__image\">\n <Image\n className=\"object-cover w-full h-full\"\n src={prod.image?.url}\n alt={prod.image?.alt ?? prod.name}\n aspectRatio=\"1/1\"\n />\n </a>\n <div className=\"flex-1 rtl:pr-5 ltr:pl-5\">\n <h3 className=\"text-sm text-gray-800 leading-6 mb-1.5 rtl:pl-5 ltr:pr-5 rtl:md:pl-8 ltr:md:pr-8 line-clamp-1\">\n <a href={prod.url}>{prod.name}</a>\n </h3>\n <div className=\"w-full center-between\">\n {prod.is_on_sale && regularPrice ? (\n <div className=\"space-x-1 rtl:space-x-reverse\">\n <h4 className=\"inline-block text-sm font-bold text-red-400\">\n {format(displayPrice)}\n </h4>\n <span className=\"text-sm text-gray-500 line-through\">{format(regularPrice)}</span>\n </div>\n ) : (\n <h4 className=\"text-sm font-bold\">{format(displayPrice)}</h4>\n )}\n </div>\n </div>\n </div>\n <div className=\"flex items-center space-x-4 rtl:space-x-reverse\">\n <SallaAddProductButton\n ref={setAddButtonAttributes}\n productStatus={prod.status}\n productId={prod.id}\n productType={prod.type}\n fill=\"outline\"\n className=\"flex-grow w-full sm:grow-0 md:w-40\"\n />\n <SallaButton\n loaderPosition=\"center\"\n shape=\"icon\"\n size=\"small\"\n color=\"danger\"\n className=\"btn--delete\"\n onClick={handleRemove}\n >\n <i className=\"sicon-cancel\" />\n </SallaButton>\n </div>\n </div>\n );\n}\n\n/** The loaded wishlist pages, reloaded from the server once every loaded card is removed (like Twig). */\nfunction useWishlistItems(\n { query, products, pagination }: WishlistPageProps,\n onRemoved: (id: number) => void\n) {\n const queryClient = useQueryClient();\n // Track the next page to load (starts at page 2 since page 1 is SSR)\n const nextPageRef = useRef(query.page + 1);\n const [removedIds, setRemovedIds] = useState<ReadonlySet<number>>(() => new Set());\n const [removingIds, setRemovingIds] = useState<ReadonlySet<number>>(() => new Set());\n const [reloaded, setReloaded] = useState<{\n items: Product[];\n next: string | null;\n generation: number;\n } | null>(null);\n const loadedRef = useRef({\n ids: products.map((prod) => Number(prod.id)),\n hasMore: !!pagination?.next,\n });\n\n // A `?page=` navigation keeps this instance, so drop what the previous page removed or reloaded.\n const [loadedProducts, setLoadedProducts] = useState(products);\n if (loadedProducts !== products) {\n setLoadedProducts(products);\n setRemovedIds(new Set());\n setRemovingIds(new Set());\n setReloaded(null);\n }\n\n useEffect(() => {\n nextPageRef.current = query.page + 1;\n loadedRef.current = {\n ids: products.map((prod) => Number(prod.id)),\n hasMore: !!pagination?.next,\n };\n }, [products, query.page, pagination?.next]);\n\n useEffect(() => {\n const handleRemoved = (_response: unknown, id: unknown) => {\n const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n (reduceMotion ? setRemovedIds : setRemovingIds)((current) =>\n new Set(current).add(Number(id))\n );\n onRemoved(Number(id));\n };\n\n return onSallaEvent('wishlist::removed', handleRemoved);\n }, [onRemoved]);\n\n useEffect(() => {\n const { ids, hasMore } = loadedRef.current;\n if (!ids.length || !ids.every((id) => removedIds.has(id))) return;\n\n const reset = (items: Product[], next: string | null) => {\n nextPageRef.current = query.page + 1;\n loadedRef.current = { ids: items.map((prod) => Number(prod.id)), hasMore: !!next };\n setRemovedIds(new Set());\n setRemovingIds(new Set());\n setReloaded((current) => ({ items, next, generation: (current?.generation ?? 0) + 1 }));\n };\n\n if (!hasMore) {\n reset([], null);\n return;\n }\n\n let cancelled = false;\n queryClient\n .fetchQuery({ ...wishlist.queries.list({ page: query.page }), staleTime: 0 })\n .then((result) => {\n if (!cancelled) reset(result.items, result.next);\n })\n // A failed reload keeps the list as it is; later pages still load on scroll.\n .catch(() => undefined);\n return () => {\n cancelled = true;\n };\n }, [removedIds, query.page, products, queryClient]);\n\n const loader = async () => {\n const pageToLoad = nextPageRef.current;\n const result = await wishlist.list({ page: pageToLoad });\n\n nextPageRef.current = pageToLoad + 1;\n loadedRef.current = {\n ids: [...loadedRef.current.ids, ...result.items.map((prod) => Number(prod.id))],\n hasMore: !!result.next,\n };\n\n return {\n items: result.items,\n next: result.next,\n };\n };\n\n const finishRemoving = useCallback((id: number) => {\n setRemovedIds((current) => (current.has(id) ? current : new Set(current).add(id)));\n }, []);\n\n return {\n items: reloaded ? reloaded.items : products,\n next: reloaded ? reloaded.next : pagination?.next,\n generation: reloaded?.generation ?? 0,\n removedIds,\n removingIds,\n finishRemoving,\n loader,\n };\n}\n\nexport function WishlistPage(props: WishlistPageProps) {\n const { t } = useTranslation();\n const { pathname, searchStr } = useLocation();\n const shareState = useWishlistShare();\n const selectedIdSet = useMemo(() => new Set(shareState.selectedIds), [shareState.selectedIds]);\n const { items, next, generation, removedIds, removingIds, finishRemoving, loader } =\n useWishlistItems(props, shareState.deselect);\n const hasRemaining = items.some((prod) => !removedIds.has(Number(prod.id)));\n\n return (\n <div className=\"space-y-5\" id=\"wishlist\">\n {/* The SDK unconditionally auto-renders its own `<salla-wishlist-actions>` into this\n slot on every `customer.wishlist` page (tools/twilight's init-static-sections.js),\n but that widget only works alongside a sibling `<salla-products-list>` web\n component -- this page renders its products via the React-native `ItemsList`\n instead, so the SDK's widget never finds one and sits permanently disabled.\n `WishlistShareBar` below is this page's own, fully working replacement for the\n exact same \"Share\" feature. The slot itself stays (removing it would also drop\n whatever themes/apps register here via the hook registry, not just this widget);\n `#wishlist > salla-wishlist-actions` (user-pages.scss) hides just the dead\n SDK widget, which the SDK always inserts as this element's first child. */}\n <HookSlot name=\"customer:wishlist.items.start\" />\n <WishlistShareBar state={shareState} hasProducts={hasRemaining || !!next} />\n <ItemsList<Product>\n key={generation}\n items={items}\n loader={loader}\n mode={next ? 'infinite' : 'static'}\n pageUrl={pathname + searchStr}\n className=\"s-products-list\"\n itemsClassName=\"s-products-list-wrapper s-products-list-row-cards\"\n empty={\n <div className=\"text-center py-16\">\n <NoContent\n icon=\"sicon-heart\"\n message={t('common.errors.no_wishlist', \"You don't have any wishes\")}\n actionLabel={t('pages.offer.continue_shopping', 'Continue shopping')}\n actionUrl=\"/\"\n />\n </div>\n }\n t={(key, fallback) => t(key, fallback || key)}\n >\n {(items) => {\n const remaining = items.filter((item) => !removedIds.has(Number(item.id)));\n shareState.loadedIdsRef.current = remaining.map((item) => Number(item.id));\n return remaining.map((prod) => (\n <WishlistCard\n key={prod.id}\n product={prod}\n removing={removingIds.has(Number(prod.id))}\n onRemoved={finishRemoving}\n selection={{\n selecting: shareState.selecting,\n selected: selectedIdSet.has(Number(prod.id)),\n onToggle: shareState.toggleSelected,\n }}\n />\n ));\n }}\n </ItemsList>\n <HookSlot name=\"customer:wishlist.items.end\" />\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { advertisement, advertisementsFor } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { advertisement, advertisementsFor } from '../chunk-INOCELVE.js';
|
|
2
|
+
import '../chunk-JOLKCJWI.js';
|
|
3
3
|
import '../chunk-Z5M4YYWT.js';
|
|
4
4
|
import '../chunk-F6GOQAYU.js';
|
|
5
5
|
import '../chunk-6L27TXQZ.js';
|
package/dist/api/apps.js
CHANGED
package/dist/api/blog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { blog } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { blog } from '../chunk-2B3TEWS5.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/brands.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { brand } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { brand } from '../chunk-T3664AQW.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/cart.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { cart } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { cart } from '../chunk-36ZY4C3I.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/category.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { category } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { category } from '../chunk-XCGBPYRZ.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { STORE_IDENTIFIER_HEADER, api, cdn, filesCdn, getActiveCurrency, getActiveScope, getActiveScopeId, getAuthToken } from '../chunk-
|
|
1
|
+
export { STORE_IDENTIFIER_HEADER, api, cdn, filesCdn, getActiveCurrency, getActiveScope, getActiveScopeId, getAuthToken } from '../chunk-JOLKCJWI.js';
|
|
2
2
|
import '../chunk-Z5M4YYWT.js';
|
|
3
3
|
import '../chunk-F6GOQAYU.js';
|
|
4
4
|
import '../chunk-6L27TXQZ.js';
|
package/dist/api/custom-url.js
CHANGED
package/dist/api/home.js
CHANGED
package/dist/api/loyalty.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { loyalty } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { loyalty } from '../chunk-TCSM2DM4.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/menu.js
CHANGED
package/dist/api/notification.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { notification } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { notification } from '../chunk-G7BQM7RU.js';
|
|
2
|
+
import '../chunk-JOLKCJWI.js';
|
|
3
3
|
import '../chunk-Z5M4YYWT.js';
|
|
4
4
|
import '../chunk-F6GOQAYU.js';
|
|
5
5
|
import '../chunk-6L27TXQZ.js';
|
package/dist/api/order.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { order } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { order } from '../chunk-5U26XIYM.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/page.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { page } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { page } from '../chunk-BOW6FYVT.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/product.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { getProductPreview, isProductPreviewQuery, parseNextPageToken, product, productDetailQueryKey, productPreviewQueryKey, rememberProductPreview, shouldDehydrateQuery } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { getProductPreview, isProductPreviewQuery, parseNextPageToken, product, productDetailQueryKey, productPreviewQueryKey, rememberProductPreview, shouldDehydrateQuery } from '../chunk-FBRQ27SR.js';
|
|
2
|
+
import '../chunk-QVKKI5MG.js';
|
|
3
3
|
import '../chunk-OUW6WESU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-JOLKCJWI.js';
|
|
5
5
|
import '../chunk-Z5M4YYWT.js';
|
|
6
6
|
import '../chunk-GHKOMS3G.js';
|
|
7
7
|
import '../chunk-F6GOQAYU.js';
|
package/dist/api/profile.js
CHANGED
package/dist/api/store.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { store } from '../chunk-
|
|
1
|
+
export { store } from '../chunk-LRJWJNJS.js';
|
|
2
2
|
import '../chunk-FFN6BITL.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-JOLKCJWI.js';
|
|
4
4
|
import '../chunk-Z5M4YYWT.js';
|
|
5
5
|
import '../chunk-F6GOQAYU.js';
|
|
6
6
|
export { resolveStoreIdentifier } from '../chunk-6L27TXQZ.js';
|
package/dist/api/translations.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { commonTranslationsPath, storeTranslationsPath, translations } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { commonTranslationsPath, storeTranslationsPath, translations } from '../chunk-4NA4FWJR.js';
|
|
2
|
+
import '../chunk-JOLKCJWI.js';
|
|
3
3
|
import '../chunk-Z5M4YYWT.js';
|
|
4
4
|
import '../chunk-F6GOQAYU.js';
|
|
5
5
|
import '../chunk-6L27TXQZ.js';
|
package/dist/api/user.js
CHANGED
package/dist/api/wallet.js
CHANGED
package/dist/api/wishlist.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { wishlist } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { wishlist } from '../chunk-MCHRCHO3.js';
|
|
2
|
+
import '../chunk-FBRQ27SR.js';
|
|
3
|
+
import '../chunk-QVKKI5MG.js';
|
|
4
4
|
import '../chunk-OUW6WESU.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-JOLKCJWI.js';
|
|
6
6
|
import '../chunk-Z5M4YYWT.js';
|
|
7
7
|
import '../chunk-GHKOMS3G.js';
|
|
8
8
|
import '../chunk-F6GOQAYU.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-QVKKI5MG.js';
|
|
2
|
+
import { api } from './chunk-JOLKCJWI.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
5
5
|
var blog = {
|
|
@@ -63,5 +63,5 @@ var blog = {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export { blog };
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-2B3TEWS5.js.map
|
|
67
|
+
//# sourceMappingURL=chunk-2B3TEWS5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/blog.ts"],"names":[],"mappings":";;;;AAyCO,IAAM,IAAA,GAAO;AAAA,EAClB,GAAA,EAAK,OAAO,MAAA,KAAgD;AAC1D,IAAA,MAAM,UAAmC,EAAC;AAC1C,IAAA,IAAI,MAAA,UAAgB,MAAA,GAAS,MAAA;AAE7B,IAAA,MAAM,WAAW,MAAM,GAAA,CAAI,IAAI,MAAA,EAAQ,OAAoB,EAAE,IAAA,EAAsB;AAEnF,IAAA,OAAO;AAAA,MACL,UAAA,EAAY,QAAA,CAAS,IAAA,CAAK,UAAA,IAAc,EAAC;AAAA,MACzC,MAAA,EAAQ,QAAA,CAAS,IAAA,CAAK,MAAA,IAAU,EAAC;AAAA,MACjC,QAAA,EAA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AA,CAAS,IAAA,CAAK,EAAA,EAAI,MAAM,CAAC;AAAA,GAC1C;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,SAAS,CAAC,EAAE,QAAO,KAAM,IAAA,CAAK,IAAI,MAAM;AAAA,KACzC,CAAA;AAAA,IACH,QAAA,EAAU,CAAC,MAAA,KACT,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAA,EAAY,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,CAAC,EAAE,MAAA,EAAO,KAAM,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,EAAE,GAAG,MAAA,EAAQ,MAAA,EAAQ;AAAA,KAClE,CAAA;AAAA,IACH,OAAA,EAAS,CAAC,EAAA,KACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,SAAA,EAAW,EAAE,CAAA;AAAA,MAChC,OAAA,EAAS,CAAC,EAAE,MAAA,OAAa,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,EAAA,EAAI,MAAM;AAAA,KACvD;AAAA;AAEP","file":"chunk-2B3TEWS5.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport type { Options as KyOptions } from 'ky';\nimport { api } from './client';\nimport type { Pagination } from './types';\nimport type {\n ArticleSummary,\n ArticleDetail,\n BlogAuthor,\n BlogCategory,\n BlogTag,\n BlogOverview,\n} from '../routes/blog/types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport interface BlogArticlesListParams {\n category?: string;\n author?: string;\n tag?: string;\n page?: number;\n cursor?: string | null;\n signal?: AbortSignal;\n}\n\nexport interface BlogArticlesListResponse {\n data: ArticleSummary[];\n categories?: BlogCategory[];\n category: BlogCategory;\n author: BlogAuthor;\n tag: BlogTag;\n cursor: Pagination;\n}\n\nexport interface BlogGetResponse {\n data: {\n categories: BlogCategory[] | null;\n slides: ArticleSummary[] | null;\n articles: ArticleSummary[] | null;\n popular: ArticleSummary[] | null;\n };\n}\n\nexport const blog = {\n get: async (signal?: AbortSignal): Promise<BlogOverview> => {\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api.get('blog', options as KyOptions).json<BlogGetResponse>();\n\n return {\n categories: response.data.categories ?? [],\n slides: response.data.slides ?? [],\n articles: response.data.articles ?? [],\n popular: response.data.popular ?? [],\n };\n },\n\n articles: {\n list: async (params?: BlogArticlesListParams): Promise<BlogArticlesListResponse> => {\n const { category, author, tag, page, cursor, signal } = params ?? {};\n\n const searchParams = new URLSearchParams();\n if (page !== undefined) searchParams.set('page', String(page));\n if (cursor) searchParams.set('cursor', cursor);\n if (category) searchParams.set('category', category);\n if (author) searchParams.set('author', author);\n if (tag) searchParams.set('tag', tag);\n\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`blog/articles?${searchParams.toString()}`, options as KyOptions)\n .json<{\n data: ArticleSummary[] | null;\n categories?: BlogCategory[] | null;\n category: BlogCategory;\n author: BlogAuthor;\n tag: BlogTag;\n cursor: Pagination;\n }>();\n\n return {\n data: response.data ?? [],\n categories: response.categories ?? undefined,\n category: response.category,\n author: response.author,\n tag: response.tag,\n cursor: response.cursor,\n };\n },\n\n find: async (id: string, signal?: AbortSignal): Promise<ArticleDetail> => {\n const options: Record<string, unknown> = {};\n if (signal) options.signal = signal;\n\n const response = await api\n .get(`blog/articles/${id}`, options as KyOptions)\n .json<{ data: ArticleDetail | null }>();\n\n if (!response.data) {\n throw new Error(`Article ${id} not found`);\n }\n\n return response.data;\n },\n\n findOrThrow: (id: string, signal?: AbortSignal): Promise<ArticleDetail> =>\n orThrow(blog.articles.find(id, signal)),\n },\n\n queries: {\n overview: () =>\n queryOptions({\n queryKey: ['blog', 'overview'],\n queryFn: ({ signal }) => blog.get(signal),\n }),\n articles: (params?: Omit<BlogArticlesListParams, 'signal'>) =>\n queryOptions({\n queryKey: ['blog', 'articles', params],\n queryFn: ({ signal }) => blog.articles.list({ ...params, signal }),\n }),\n article: (id: string) =>\n queryOptions({\n queryKey: ['blog', 'article', id],\n queryFn: ({ signal }) => blog.articles.find(id, signal),\n }),\n },\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { orThrow } from './chunk-
|
|
2
|
-
import { api } from './chunk-
|
|
1
|
+
import { orThrow } from './chunk-QVKKI5MG.js';
|
|
2
|
+
import { api } from './chunk-JOLKCJWI.js';
|
|
3
3
|
import { getSallaSDK } from './chunk-F6GOQAYU.js';
|
|
4
4
|
import { queryOptions } from '@tanstack/react-query';
|
|
5
5
|
|
|
@@ -44,5 +44,5 @@ var cart = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export { cart };
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-36ZY4C3I.js.map
|
|
48
|
+
//# sourceMappingURL=chunk-36ZY4C3I.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/cart.ts"],"names":[],"mappings":";;;;;AAaA,SAAS,sBAAsB,IAAA,EAAoC;AACjE,EAAA,IAAI,CAAC,IAAA,CAAK,IAAA,EAAM,OAAO,IAAA;AACvB,EAAA,OAAO;AAAA,IACL,GAAG,IAAA,CAAK,IAAA;AAAA,IACR,OAAA,EAAS,KAAK,OAAA,IAAW,IAAA;AAAA;AAAA,IAEzB,IAAA,EAAM,IAAA,CAAK,IAAA,IAAQ,IAAA,CAAK,KAAK,IAAA,IAAQ;AAAA,GACvC;AACF;AAEO,IAAM,IAAA,GAAO;AAAA,EAClB,GAAA,EAAK,OAAO,MAAA,KAAyC;AACnD,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,KAAA,EAAQ,MAAM,CAAA,CAAE,CAAA,CAAE,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sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type { Cart } from '../types';\nimport { orThrow } from '../providers/NavigationProvider';\nimport { getSallaSDK } from '../utils/sdk-helpers';\n\nexport interface CartApiResponse {\n /** Absent once the cart was turned into an order (the body then carries a top-level `redirect`). */\n cart?: Omit<Cart, 'loyalty'>;\n loyalty?: Cart['loyalty'];\n gift?: Cart['gift'];\n}\n\nfunction normalizeCartResponse(data: CartApiResponse): Cart | null {\n if (!data.cart) return null;\n return {\n ...data.cart,\n loyalty: data.loyalty ?? null,\n // The API sends `gift` inside `cart`.\n gift: data.gift ?? data.cart.gift ?? null,\n } as Cart;\n}\n\nexport const cart = {\n get: async (cartId: number): Promise<Cart | null> => {\n const { data } = await api.get(`cart/${cartId}`).json<{ data: CartApiResponse }>();\n return normalizeCartResponse(data);\n },\n\n getOrThrow: (cartId: number): Promise<Cart | null> => orThrow(cart.get(cartId)),\n\n /** The visitor's cart id, which only the Salla SDK knows; `null` outside the browser. */\n getCurrentId: async (): Promise<number | null> => {\n const salla = getSallaSDK();\n if (!salla) return null;\n // The app bundle can run before the SDK module, when `salla` is still the head stub.\n await salla.onReady().catch(() => undefined);\n return salla.cart.api.getCurrentCartId();\n },\n\n queries: {\n detail: (cartId: number) =>\n queryOptions({\n queryKey: ['cart', cartId],\n queryFn: () => cart.get(cartId),\n // The SDK changes the cart from any page, so a cached copy is never safe to show.\n staleTime: 0,\n gcTime: 0,\n }),\n currentId: () =>\n queryOptions({\n queryKey: ['cart', 'current-id'],\n queryFn: () => cart.getCurrentId(),\n // Completing an order starts a new cart, so an earlier id is never reused.\n staleTime: 0,\n gcTime: 0,\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-JOLKCJWI.js';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
var apps = {
|
|
@@ -40,5 +40,5 @@ var apps = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export { apps };
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-3WW5RRMV.js.map
|
|
44
|
+
//# sourceMappingURL=chunk-3WW5RRMV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/apps.ts"],"names":[],"mappings":";;;AAmCO,IAAM,IAAA,GAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,UAAU,YAAmC;AAC3C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,eAAA,EAAiB,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA,CACtC,IAAA,EAA8B;AACjC,IAAA,OAAO,QAAQ,EAAC;AAAA,EAClB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAU,YAAkC;AAC1C,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CACpB,GAAA,CAAI,wBAAA,EAA0B,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA,CAC/C,IAAA,EAAsC;AACzC,IAAA,OAAO,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,IAAQ,EAAC,EAAE;AAAA,EAClC,CAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,OAAA,EAAS,MAAM,IAAA,CAAK,QAAA,EAAS;AAAA;AAAA,MAE7B,SAAA,EAAW,QAAA;AAAA;AAAA;AAAA;AAAA,MAIX,KAAA,EAAO;AAAA,KACR,CAAA;AAAA,IAEH,QAAA,EAAU,MACR,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,UAAU,CAAA;AAAA,MAC7B,OAAA,EAAS,MAAM,I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k-3WW5RRMV.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\n\nexport interface AppSnippetRow {\n place: string;\n content: string;\n url?: string | null;\n /**\n * Raw snippet id, emitted as `data-snippet-id`. Present only on CDN rows — the\n * inline branch of the backend's snippet parser omits the key entirely.\n */\n id?: number;\n /** `{{customer.x}}` placeholders in `content` to substitute from SDK config `user.*` keys. */\n customer_parameters?: string[];\n}\n\nexport interface AppSnippet {\n service: string;\n app_id: string;\n /** Encoded app id (`getRouteKey()`): the scope id its snippets bind to via `data-scope-id`,\n * and its settings-bucket key. Absent on payloads predating the settings API. */\n id?: string;\n app_slug: string;\n status: string;\n snippets: AppSnippetRow[];\n}\n\n/**\n * Per-app public `app.*` buckets for CDN snippets, keyed by encoded app id (== `AppSnippet.id`,\n * the `Salla.appScope` scope id). One isolated bucket per app; reads within a scope are bare `app.*`.\n */\nexport interface AppSettings {\n apps: Record<string, Record<string, unknown>>;\n}\n\nexport const apps = {\n /**\n * Installed apps' snippets (scripts/HTML to inject). Timeout-bounded because it's awaited in\n * rootBeforeLoad (SSR/TTFB): a slow response degrades to no CDN tags, never stalls the page.\n */\n snippets: async (): Promise<AppSnippet[]> => {\n const { data } = await api\n .get('apps/snippets', { timeout: 2500 })\n .json<{ data?: AppSnippet[] }>();\n return data ?? [];\n },\n\n /**\n * Per-app public `app.*` buckets, keyed by encoded app id. Timeout-bounded (SSR-awaited):\n * a slow response degrades to empty buckets (fail-open), never strands injection.\n */\n settings: async (): Promise<AppSettings> => {\n const { data } = await api\n .get('apps/snippets/settings', { timeout: 2500 })\n .json<{ data?: Partial<AppSettings> }>();\n return { apps: data?.apps ?? {} };\n },\n\n queries: {\n snippets: () =>\n queryOptions({\n queryKey: ['apps', 'snippets'],\n queryFn: () => apps.snippets(),\n // Snippets are static per session; one fetch per page load is enough.\n staleTime: Infinity,\n // No retry: this is awaited in rootBeforeLoad, so the router's default `retry: 1` would\n // make the SSR wait 2 x the 2500ms timeout (plus backoff) before failing open. The\n // 2500ms timeout must be the whole budget; the client fallback query does the retrying.\n retry: 0,\n }),\n\n settings: () =>\n queryOptions({\n queryKey: ['apps', 'settings'],\n queryFn: () => apps.settings(),\n // Encoded app ids and their buckets are stable per page; one fetch is enough.\n staleTime: Infinity,\n retry: 0,\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filesCdn, cdn } from './chunk-
|
|
1
|
+
import { filesCdn, cdn } from './chunk-JOLKCJWI.js';
|
|
2
2
|
import { storeTranslationsQueryKey, translationsQueryKey, composeMessages, isPlainObject } from './chunk-AWV3WEKH.js';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -126,5 +126,5 @@ var translations = {
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
export { commonTranslationsPath, storeTranslationsPath, translations };
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-4NA4FWJR.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-4NA4FWJR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,C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A,EAAU,qBAAqB,MAAM,CAAA;AAAA,MACrC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,MAAM;AAAA,KACvC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,OAAA,EAAS,CAAC,OAAA,EAA0B,MAAA,KAClC,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,yBAAA,CAA0B,OAAA,EAAS,MAAM,CAAA;AAAA,MACnD,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,CAAS,SAAS,MAAM;AAAA,KACrD;AAAA;AAEP","file":"chunk-W66Y6VFR.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/translations.ts"],"names":[],"mappings":";;;;AAiEA,IAAM,kBAAA,GAAqB,sBAAA;AAGpB,SAAS,uBAAuB,MAAA,EAAwB;AAC7D,EAAA,OAAO,uBAAuB,MAAM,CAAA,KAAA,CAAA;AACtC;AAWO,SAAS,qBAAA,CAAsB,SAA0B,MAAA,EAAwB;AACtF,EAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,KAAA,CAAA;AAC1C;AAUA,eAAe,eACb,IAAA,EACA,EAAE,aAAa,KAAA,EAAM,GAA8B,EAAC,EAC1B;AAE1B,EAAA,MAAM,UAAA,GAAa,CAAC,MAAA,EAAgB,KAAA,KAA0B;AAC5D,IAAA,IAAI,UAAA,EAAY,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,EAAI,EAAE,KAAA,EAAO,CAAA;AAC9E,IAAA,OAAA,CAAQ,IAAA,CAAK,gBAAA,EAAkB,MAAA,EAAQ,IAAA,EAAM,SAAS,EAAE,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,EAAE,eAAA,EAAiB,KAAA,EAAO,OAAA,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M;AAAA,KACrD;AAAA;AAEP","file":"chunk-4NA4FWJR.js","sourcesContent":["/**\n * @fileoverview Where a storefront's words come from.\n *\n * Two files, merged: the platform's copy for this language, and the merchant's\n * own edits for this language and this store. Both are plain JSON objects on\n * the uploader's CDN, one per language.\n *\n * ```\n * https://cdn.files.salla.network/translations/common/<locale>.json the platform's\n * https://cdn.files.salla.network/translations/<storeId>/<locale>.json the merchant's\n * ```\n *\n * **What this replaces, and why.** Until now the engine read a single global\n * file, `cdn.salla.network/js/translations.json`, holding every language keyed\n * `\"<locale>.trans\"`. Nothing publishes that file: it is an object last written\n * on 2026-03-26, carrying only `ar` and `en` where the platform has 39 locales,\n * 405 keys behind `Languages-Module` and 959 English strings textually\n * different from it. So every React storefront has been serving copy from\n * March, and a key added since has never reached one. It also carried no\n * merchant overrides at all — a merchant editing their theme's wording in the\n * Dashboard changed nothing on a React theme.\n *\n * **Merchant overrides are read, and only when there are any.** Getting here\n * took two corrections worth keeping.\n *\n * The first is the address. A merchant's own wording lives at\n * `translations/<storeId>/<locale>.json`, keyed by `store()->getRouteKey()` —\n * the Optimus-encoded numeric id. An early version addressed it with\n * `resolveStoreIdentifier()`, on the claim that the two are the same string.\n * That is true of the `store-identifier` *header*, which accepts a host, a\n * username or an id, and false of the R2 key: on a custom domain the resolver\n * returns `reefperfumes.com` and on a shared host a username like\n * `mtgr-alaatr-2`. Both 404, both then read as \"this store has no overrides\",\n * and the merchant's wording silently never appears — so the feature would have\n * worked under `?storeId=` alone, which is preview and localhost. It is\n * `settings.store.id` now, which is known only after the settings query.\n *\n * The second is when to ask at all. Most stores have never customised a word,\n * and a miss is an uncached round trip (`cf-cache-status: DYNAMIC` on the 404)\n * on the critical path of every SSR render. So the request is made only when\n * `settings.languages[<ISO>].has_custom_translations` says there is something\n * to get — a flag `Languages-Module` writes when a merchant saves a\n * translation. A store without overrides pays nothing, which is what made this\n * shippable at all.\n *\n * ⚠️ The flag is written on save, so a store whose wording predates it reads as\n * `false` until someone edits a translation or the backfill runs. That is a\n * store keeping today's behaviour, not a regression — React themes have never\n * read merchant overrides — but it does mean the feature is only as complete as\n * the backfill.\n *\n * **Rollout is by fallback, not by flag.** `translations/common/` is written by\n * a sync in the theme build service that may not have run yet, and a hard switch\n * would leave every storefront with no platform strings at all. A missing common\n * file therefore falls back to the old global one, which is exactly today's\n * behaviour — so this is safe to ship before the bucket is populated, and stops\n * using the fallback on its own once it is.\n */\nimport { queryOptions } from '@tanstack/react-query';\nimport { cdn, filesCdn } from './client';\nimport { storeTranslationsQueryKey, translationsQueryKey } from './translations-key';\nimport { composeMessages, isPlainObject, type Messages } from './messages';\nimport type { TranslationMessages } from '../providers/I18nProvider';\n\n/** The global file this used to be the only reader of. See the file comment. */\nconst LEGACY_GLOBAL_FILE = 'js/translations.json';\n\n/** One language of platform copy, shared by every store. */\nexport function commonTranslationsPath(locale: string): string {\n return `translations/common/${locale}.json`;\n}\n\n/**\n * One language of a single merchant's own wording.\n *\n * `storeId` is `settings.store.id`, which is the value `Languages-Module` names\n * the object with (`store()->getRouteKey()`, the Optimus-encoded numeric id).\n * It is **not** `resolveStoreIdentifier()`: that returns a hostname on a custom\n * domain and a username on a shared host, both of which 404 here and would read\n * as \"this merchant has no overrides\" — silently, on every store but a preview.\n */\nexport function storeTranslationsPath(storeId: string | number, locale: string): string {\n return `translations/${storeId}/${locale}.json`;\n}\n\n/**\n * Reads one language file, or `null` when there is nothing to read.\n *\n * A 404 is the ordinary answer, not a failure: most stores have never had a\n * word customised, so their file does not exist. Distinguishing it from a real\n * error matters only for the log — both end in `null` — but a warning on every\n * page load of every uncustomised store is a warning nobody will read.\n */\nasync function readLocaleFile(\n path: string,\n { failLoudly = false }: { failLoudly?: boolean } = {}\n): Promise<Messages | null> {\n /** A 404 always means \"absent\"; everything else is a failure to read. */\n const unreadable = (reason: string, cause?: unknown): null => {\n if (failLoudly) throw new Error(`[translations] ${path}: ${reason}`, { cause });\n console.warn('[translations]', reason, path, cause ?? '');\n return null;\n };\n\n try {\n const response = await filesCdn.get(path, { throwHttpErrors: false, timeout: 5000 });\n if (response.status === 404) return null;\n\n if (!response.ok) {\n return unreadable(`answered ${response.status}`);\n }\n\n const data: unknown = await response.json();\n if (!isPlainObject(data)) {\n return unreadable('is not a JSON object');\n }\n\n return data;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith('[translations]')) throw error;\n return unreadable('could not be read', error);\n }\n}\n\n/**\n * The pre-CDN global file, sliced to one language.\n *\n * Only reached when `translations/common/<locale>.json` is missing, which is\n * the state of the bucket until the sync has run once.\n */\nasync function readLegacyGlobal(locale: string): Promise<Messages | null> {\n try {\n const data = await cdn.get(LEGACY_GLOBAL_FILE, { timeout: 5000 }).json<TranslationMessages>();\n const forLocale = data?.[`${locale}.trans`];\n return isPlainObject(forLocale) ? forLocale : null;\n } catch {\n console.warn('[translations] the legacy global file could not be read either');\n return null;\n }\n}\n\nexport const translations = {\n /**\n * The platform's copy for `locale`.\n *\n * One file, so one request. See the file comment for why the merchant's own\n * wording is not merged in here yet and what it is waiting on.\n */\n get: async (locale: string): Promise<TranslationMessages | null> => {\n const common = await readLocaleFile(commonTranslationsPath(locale));\n const base = common ?? (await readLegacyGlobal(locale));\n if (!base) return null;\n\n // Still wrapped in the `<locale>.trans` shape the rest of the engine reads.\n // `createI18nInstance` slices by that key and so does the SDK bridge in\n // `I18nProvider`; changing the envelope here would be a second change for\n // no gain, since one language is all any of them ever take out of it.\n return { [`${locale}.trans`]: base as Record<string, string> };\n },\n\n /**\n * This merchant's own wording for `locale`, or `null` if they have none.\n *\n * Only worth calling when `settings.languages[<ISO>].has_custom_translations`\n * says there is something to get. Most stores have never customised a word,\n * and a miss here is an uncached round trip — `cf-cache-status: DYNAMIC` on a\n * 404 — on the critical path of an SSR render. The flag is what makes this\n * free for everyone who does not use it.\n *\n * Returned unwrapped, unlike {@link translations.get}: this is merged into\n * that one's messages rather than handed to i18next on its own.\n */\n forStore: async (storeId: string | number, locale: string): Promise<Messages | null> =>\n // `failLoudly`, unlike the platform file: this is only ever called because\n // the settings said overrides exist, so a 500, a timeout or a body that is\n // not JSON is a failure to read them — not a store that has none. Returning\n // `null` there would cache \"no overrides\" as a success, skip the query's\n // retry, and serve Salla's wording in place of the merchant's until the\n // entry expired. A 404 still means absent, and `rootBeforeLoad` catches the\n // throw and keeps the platform copy, so the worst case is unchanged.\n readLocaleFile(storeTranslationsPath(storeId, locale), { failLoudly: true }),\n\n /**\n * The platform's copy for `locale` with this merchant's wording laid over it.\n *\n * Takes the two as values rather than fetching them, so the caller decides\n * whether the second request happens at all and both stay separately cached.\n */\n /**\n * The platform's copy for `locale` with this merchant's wording over it.\n *\n * Delegates to `composeMessages`, which every other reader of these two\n * entries also uses — see `api/messages.ts` for why there is exactly one.\n */\n merge: (\n common: TranslationMessages | null,\n overrides: Messages | null,\n locale: string\n ): TranslationMessages | null => composeMessages(common, overrides, locale) ?? null,\n\n queries: {\n /**\n * @param locale taken as an argument rather than read from the twilight\n * context, and that is load-bearing. This key is built on the server, on\n * hydration, and again lazily from the context accessor; if any of the\n * three read a locale the others had not been given yet, the hydrated page\n * would miss the dehydrated entry and refetch both files it was just\n * handed. Every caller already has the locale in hand.\n *\n * The store is deliberately **not** in the key. One document serves one\n * store — a request that names a different one is redirected with\n * `reloadDocument`, so the client never changes store under a live cache —\n * and adding a value that resolves from the request on the server and from\n * the injected env on the client is how a key stops matching across\n * hydration.\n */\n byLocale: (locale: string) =>\n queryOptions({\n queryKey: translationsQueryKey(locale),\n queryFn: () => translations.get(locale),\n }),\n\n /**\n * This merchant's overrides, cached apart from the platform's copy.\n *\n * Its own entry rather than a wider `byLocale` key, so the common file is\n * fetched and dehydrated once per language whatever the store does, and a\n * store with no overrides never has an entry at all. Both sides compute the\n * key from the settings payload, so the hydrated page finds what the server\n * dehydrated instead of refetching it.\n */\n byStore: (storeId: string | number, locale: string) =>\n queryOptions({\n queryKey: storeTranslationsQueryKey(storeId, locale),\n queryFn: () => translations.forStore(storeId, locale),\n }),\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getActiveScope, api } from './chunk-
|
|
1
|
+
import { getActiveScope, api } from './chunk-JOLKCJWI.js';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
async function list(params) {
|
|
@@ -45,5 +45,5 @@ var home = {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export { home };
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-4YBXC6VB.js.map
|
|
49
|
+
//# sourceMappingURL=chunk-4YBXC6VB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/home.ts"],"names":[],"mappings":";;;AAQA,eAAe,KAAK,MAAA,EAA+D;AACjF,EAAA,MAAM,KAAA,GAAQ,SAAS,CAAA,CAAA,EAAI,IAAI,gBAAgB,MAAM,CAAA,CAAE,QAAA,EAAU,CAAA,CAAA,GAAK,EAAA;AACtE,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,cAAA,EAAiB,KAAK,CAAA,CAAE,CAAA,CAAE,IAAA,EAAoC;AAC7F,EAAA,OAAO,QAAQ,EAAC;AAClB;AAGA,SAAS,OAAA,CAAQ,QAA6B,QAAA,EAAoD;AAChG,EAAA,IAAI,CAAC,QAAA,CAAS,MAAA,EAAQ,OAAO,MAAA;AAC7B,EAAA,MAAM,KAAA,GAAQ,IAAI,GAAA,CAAI,QAAA,CAAS,IAAI,CAAC,KAAA,KAAU,KAAA,CAAM,IAAI,CAAC,CAAA;AACzD,EAAA,MAAM,IAAA,GAAO,SAAS,GAAA,CAAI,CAAC,UAAU,IAAA,CAAK,SAAA,CAAU,KAAK,CAAC,CAAA;AAC1D,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,CAAC,KAAA,KAAU;AAC9B,IAAA,IAAI,CAAC,KAA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AAM,IAAA,CAAK,UAAA;AAAW,KAChC,CAAA;AAAA,IAEH,MAAA,EAAQ,CAAC,IAAA,EAAc,KAAA,KACrB,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,MAAA,EAAQ,QAAA,EAAU,MAAM,KAAK,CAAA;AAAA,MACxC,OAAA,EAAS,MAAM,IAAA,CAAK,MAAA,CAAO,MAAM,KAAK;AAAA,KACvC;AAAA;AAEP","file":"chunk-4YBXC6VB.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api, getActiveScope } from './client';\nimport type { HomeComponentData } from '../types';\n\n/** The page a hook's blocks render on; blocks can target specific products, categories or pages. */\nexport type BlockScope =\n { product_id: number | string } | { category_id: number | string } | { page_id: number | string };\n\nasync function list(params?: Record<string, string>): Promise<HomeComponentData[]> {\n const query = params ? `?${new URLSearchParams(params).toString()}` : '';\n const { data } = await api.get(`component/list${query}`).json<{ data: HomeComponentData[] }>();\n return data ?? [];\n}\n\n/** `blocks` minus each of `excluded`, matched by content: the API sends no id or order to match on. */\nfunction without(blocks: HomeComponentData[], excluded: HomeComponentData[]): HomeComponentData[] {\n if (!excluded.length) return blocks;\n const paths = new Set(excluded.map((block) => block.path));\n const left = excluded.map((block) => JSON.stringify(block));\n return blocks.filter((block) => {\n if (!paths.has(block.path)) return true;\n const index = left.indexOf(JSON.stringify(block));\n if (index === -1) return true;\n left.splice(index, 1);\n return false;\n });\n}\n\nexport const home = {\n components: async (): Promise<HomeComponentData[]> => {\n // The unfiltered list also has the product, category and page blocks, which the home leaves out.\n const [blocks, pageBlocks] = await Promise.all([list(), list({ show_in: 'pages' })]);\n return without(blocks, pageBlocks);\n },\n\n /** The blocks the merchant placed at `hook` on a product, category or page. */\n blocks: async (hook: string, scope: BlockScope): Promise<HomeComponentData[]> => {\n const scopeParams = Object.fromEntries(\n Object.entries(scope).map(([key, id]) => [key, String(id)])\n );\n const blocks = await list({ hooks: hook, ...scopeParams });\n return blocks.map((block) => ({ ...block, path: block.path.replace('home.', '') }));\n },\n\n queries: {\n components: () =>\n queryOptions({\n // Each market (scope) has its own theme version, and its own home page with it.\n queryKey: ['home', 'components', { scope: getActiveScope() }],\n queryFn: () => home.components(),\n }),\n\n blocks: (hook: string, scope: BlockScope) =>\n queryOptions({\n queryKey: ['home', 'blocks', hook, scope],\n queryFn: () => home.blocks(hook, scope),\n }),\n },\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { customUrl } from './chunk-
|
|
2
|
-
import { store } from './chunk-
|
|
3
|
-
import { redirect } from './chunk-
|
|
1
|
+
import { customUrl } from './chunk-EJN2SKCV.js';
|
|
2
|
+
import { store } from './chunk-LRJWJNJS.js';
|
|
3
|
+
import { redirect } from './chunk-QVKKI5MG.js';
|
|
4
4
|
import { isLocale } from './chunk-T72DAX7R.js';
|
|
5
5
|
|
|
6
6
|
// src/routes/custom-urls.ts
|
|
@@ -87,5 +87,5 @@ async function customUrlRedirect(pathname, search, options) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export { customUrlKey, customUrlPagePath, customUrlRedirect, storePathOf, withAddressQuery };
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-5CNEKDOL.js.map
|
|
91
|
+
//# sourceMappingURL=chunk-5CNEKDOL.js.map
|