@salla.sa/twilight-theme-engine 1.0.137 → 1.0.139

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.
Files changed (242) hide show
  1. package/dist/{AddToCartForm-NKY5PPUO.js → AddToCartForm-QGJ2XVCZ.js} +3 -3
  2. package/dist/{AddToCartForm-NKY5PPUO.js.map → AddToCartForm-QGJ2XVCZ.js.map} +1 -1
  3. package/dist/{BlogAuthorPage-BEFTTLZP.js → BlogAuthorPage-5QGP4RDK.js} +16 -16
  4. package/dist/{BlogAuthorPage-BEFTTLZP.js.map → BlogAuthorPage-5QGP4RDK.js.map} +1 -1
  5. package/dist/{BlogCategoryPage-ZHI4BOOC.js → BlogCategoryPage-FH7ASETM.js} +16 -16
  6. package/dist/{BlogCategoryPage-ZHI4BOOC.js.map → BlogCategoryPage-FH7ASETM.js.map} +1 -1
  7. package/dist/{BlogPage-YYZFF5TI.js → BlogPage-HNNR2Q4U.js} +14 -14
  8. package/dist/{BlogPage-YYZFF5TI.js.map → BlogPage-HNNR2Q4U.js.map} +1 -1
  9. package/dist/{BlogSinglePage-B7LWBOTP.js → BlogSinglePage-OYXJCOJ2.js} +14 -14
  10. package/dist/{BlogSinglePage-B7LWBOTP.js.map → BlogSinglePage-OYXJCOJ2.js.map} +1 -1
  11. package/dist/{BlogTagPage-MRHYZNWV.js → BlogTagPage-XEHXO4PE.js} +16 -16
  12. package/dist/{BlogTagPage-MRHYZNWV.js.map → BlogTagPage-XEHXO4PE.js.map} +1 -1
  13. package/dist/{BrandsPage-EBQRAGCH.js → BrandsPage-QSTJTEAA.js} +15 -15
  14. package/dist/{BrandsPage-EBQRAGCH.js.map → BrandsPage-QSTJTEAA.js.map} +1 -1
  15. package/dist/{Breadcrumb-LXOPBBN4.js → Breadcrumb-7QGTM5S5.js} +14 -14
  16. package/dist/{Breadcrumb-LXOPBBN4.js.map → Breadcrumb-7QGTM5S5.js.map} +1 -1
  17. package/dist/{CartItem-7MMLNUN4.js → CartItem-7FNRMTQS.js} +14 -14
  18. package/dist/{CartItem-7MMLNUN4.js.map → CartItem-7FNRMTQS.js.map} +1 -1
  19. package/dist/{CartSummary-G547ABBP.js → CartSummary-A32524GZ.js} +14 -14
  20. package/dist/{CartSummary-G547ABBP.js.map → CartSummary-A32524GZ.js.map} +1 -1
  21. package/dist/{Copyright-73W4NHW7.js → Copyright-PVSTODJF.js} +3 -3
  22. package/dist/{Copyright-73W4NHW7.js.map → Copyright-PVSTODJF.js.map} +1 -1
  23. package/dist/{CustomerLayout-JTKY24VZ.js → CustomerLayout-NOHKTFXG.js} +14 -14
  24. package/dist/{CustomerLayout-JTKY24VZ.js.map → CustomerLayout-NOHKTFXG.js.map} +1 -1
  25. package/dist/{Footer-E2KUIBSW.js → Footer-RDRSICZP.js} +4 -4
  26. package/dist/{Footer-E2KUIBSW.js.map → Footer-RDRSICZP.js.map} +1 -1
  27. package/dist/{Header-FVSR2NSQ.js → Header-YCS4HJCH.js} +8 -8
  28. package/dist/{Header-FVSR2NSQ.js.map → Header-YCS4HJCH.js.map} +1 -1
  29. package/dist/LatestProducts-JEOWAHON.js +107 -0
  30. package/dist/LatestProducts-JEOWAHON.js.map +1 -0
  31. package/dist/{LoyaltyPage-MTUCGVJ5.js → LoyaltyPage-TE5E3OJC.js} +14 -14
  32. package/dist/{LoyaltyPage-MTUCGVJ5.js.map → LoyaltyPage-TE5E3OJC.js.map} +1 -1
  33. package/dist/{LoyaltyPointsPage-CF2X3ZHW.js → LoyaltyPointsPage-GI3EQOLY.js} +6 -6
  34. package/dist/{LoyaltyPointsPage-CF2X3ZHW.js.map → LoyaltyPointsPage-GI3EQOLY.js.map} +1 -1
  35. package/dist/{MainMenu-IDJXM45R.js → MainMenu-46II2DJE.js} +5 -5
  36. package/dist/{MainMenu-IDJXM45R.js.map → MainMenu-46II2DJE.js.map} +1 -1
  37. package/dist/{MasterLayout-44QYYOSX.js → MasterLayout-ZYWD2XZO.js} +14 -14
  38. package/dist/{MasterLayout-44QYYOSX.js.map → MasterLayout-ZYWD2XZO.js.map} +1 -1
  39. package/dist/{MobileMenu-TLDDRK6H.js → MobileMenu-O7354R4E.js} +15 -15
  40. package/dist/{MobileMenu-TLDDRK6H.js.map → MobileMenu-O7354R4E.js.map} +1 -1
  41. package/dist/NoContent-7A7OR2NZ.js +6 -0
  42. package/dist/NoContent-7A7OR2NZ.js.map +1 -0
  43. package/dist/{NotificationsPage-6MJCAI6D.js → NotificationsPage-OZKKZ2CC.js} +14 -14
  44. package/dist/{NotificationsPage-6MJCAI6D.js.map → NotificationsPage-OZKKZ2CC.js.map} +1 -1
  45. package/dist/{OrderSinglePage-ZRKP4PJX.js → OrderSinglePage-IVOIE2YE.js} +15 -15
  46. package/dist/{OrderSinglePage-ZRKP4PJX.js.map → OrderSinglePage-IVOIE2YE.js.map} +1 -1
  47. package/dist/{OrdersPage-U3GHFHDO.js → OrdersPage-PMLHIHDV.js} +14 -14
  48. package/dist/{OrdersPage-U3GHFHDO.js.map → OrdersPage-PMLHIHDV.js.map} +1 -1
  49. package/dist/{PageSingle-TOJXQ5LW.js → PageSingle-C3NBFFHR.js} +3 -3
  50. package/dist/{PageSingle-TOJXQ5LW.js.map → PageSingle-C3NBFFHR.js.map} +1 -1
  51. package/dist/{ProductDetails-WX5LQXLW.js → ProductDetails-R7SFKXNC.js} +4 -4
  52. package/dist/{ProductDetails-WX5LQXLW.js.map → ProductDetails-R7SFKXNC.js.map} +1 -1
  53. package/dist/{ProfilePage-EVVDBLYL.js → ProfilePage-5FU4N6O7.js} +14 -14
  54. package/dist/{ProfilePage-EVVDBLYL.js.map → ProfilePage-5FU4N6O7.js.map} +1 -1
  55. package/dist/{ReviewsPage-B2K3VNYU.js → ReviewsPage-M7QHDNCJ.js} +3 -3
  56. package/dist/{ReviewsPage-B2K3VNYU.js.map → ReviewsPage-M7QHDNCJ.js.map} +1 -1
  57. package/dist/{SeoCartWidget-R5ZCOT4Q.js → SeoCartWidget-T6PF34G4.js} +14 -14
  58. package/dist/{SeoCartWidget-R5ZCOT4Q.js.map → SeoCartWidget-T6PF34G4.js.map} +1 -1
  59. package/dist/{SettingsPage-WGBMWUTX.js → SettingsPage-HBREYY5Q.js} +14 -14
  60. package/dist/{SettingsPage-WGBMWUTX.js.map → SettingsPage-HBREYY5Q.js.map} +1 -1
  61. package/dist/{StoreClosedNotification-2ZEUFOMA.js → StoreClosedNotification-QTKW4PQ2.js} +15 -15
  62. package/dist/{StoreClosedNotification-2ZEUFOMA.js.map → StoreClosedNotification-QTKW4PQ2.js.map} +1 -1
  63. package/dist/{TestimonialsPage-UVUX2PE3.js → TestimonialsPage-ESB4CQRS.js} +3 -3
  64. package/dist/{TestimonialsPage-UVUX2PE3.js.map → TestimonialsPage-ESB4CQRS.js.map} +1 -1
  65. package/dist/{ThankYouPage-EIQ57UHN.js → ThankYouPage-BLYIJQNV.js} +14 -14
  66. package/dist/{ThankYouPage-EIQ57UHN.js.map → ThankYouPage-BLYIJQNV.js.map} +1 -1
  67. package/dist/{WalletPage-HQAM2ZXP.js → WalletPage-7YOOVSXO.js} +15 -15
  68. package/dist/{WalletPage-HQAM2ZXP.js.map → WalletPage-7YOOVSXO.js.map} +1 -1
  69. package/dist/{WishlistPage-2IOAOQGS.js → WishlistPage-MXVTTJD6.js} +16 -16
  70. package/dist/{WishlistPage-2IOAOQGS.js.map → WishlistPage-MXVTTJD6.js.map} +1 -1
  71. package/dist/api/advertisement.js +2 -2
  72. package/dist/api/apps.js +2 -2
  73. package/dist/api/blog.js +3 -3
  74. package/dist/api/brands.js +3 -3
  75. package/dist/api/cart.js +3 -3
  76. package/dist/api/category.js +3 -3
  77. package/dist/api/client.js +1 -1
  78. package/dist/api/home.js +2 -2
  79. package/dist/api/loyalty.js +3 -3
  80. package/dist/api/menu.js +2 -2
  81. package/dist/api/notification.js +2 -2
  82. package/dist/api/order.js +3 -3
  83. package/dist/api/page.js +3 -3
  84. package/dist/api/product.js +3 -3
  85. package/dist/api/profile.js +1 -1
  86. package/dist/api/store.d.ts.map +1 -1
  87. package/dist/api/store.js +2 -2
  88. package/dist/api/translations.js +2 -2
  89. package/dist/api/user.js +2 -2
  90. package/dist/api/wallet.js +2 -2
  91. package/dist/api/wishlist.js +4 -4
  92. package/dist/{chunk-3PHBJ3TA.js → chunk-2IGIQA2S.js} +49 -6
  93. package/dist/chunk-2IGIQA2S.js.map +1 -0
  94. package/dist/{NoContent-63TMCPGY.js → chunk-33FWLJXY.js} +2 -4
  95. package/dist/chunk-33FWLJXY.js.map +1 -0
  96. package/dist/{chunk-5Y4NL57B.js → chunk-5J3HVOTR.js} +3 -3
  97. package/dist/{chunk-5Y4NL57B.js.map → chunk-5J3HVOTR.js.map} +1 -1
  98. package/dist/{chunk-MT7DVK2V.js → chunk-5KKQUH72.js} +3 -3
  99. package/dist/{chunk-MT7DVK2V.js.map → chunk-5KKQUH72.js.map} +1 -1
  100. package/dist/{chunk-HJGBOABY.js → chunk-62FNNS7U.js} +7 -7
  101. package/dist/{chunk-HJGBOABY.js.map → chunk-62FNNS7U.js.map} +1 -1
  102. package/dist/{chunk-NPN23RYM.js → chunk-7CGTHJ6S.js} +7 -5
  103. package/dist/chunk-7CGTHJ6S.js.map +1 -0
  104. package/dist/{chunk-7GBVI6SK.js → chunk-AORRIQPD.js} +4 -4
  105. package/dist/{chunk-7GBVI6SK.js.map → chunk-AORRIQPD.js.map} +1 -1
  106. package/dist/{chunk-PYDHLM3Y.js → chunk-BBMRL2QU.js} +4 -4
  107. package/dist/{chunk-PYDHLM3Y.js.map → chunk-BBMRL2QU.js.map} +1 -1
  108. package/dist/{chunk-7IQX4GHT.js → chunk-C5UK27T6.js} +4 -4
  109. package/dist/{chunk-7IQX4GHT.js.map → chunk-C5UK27T6.js.map} +1 -1
  110. package/dist/{chunk-K356POFX.js → chunk-E7TU4RW4.js} +3 -3
  111. package/dist/{chunk-K356POFX.js.map → chunk-E7TU4RW4.js.map} +1 -1
  112. package/dist/{chunk-IC6Z6BB2.js → chunk-ECFDJBTE.js} +7 -7
  113. package/dist/{chunk-IC6Z6BB2.js.map → chunk-ECFDJBTE.js.map} +1 -1
  114. package/dist/{chunk-OXUIG3H3.js → chunk-ECMDQQO2.js} +3 -3
  115. package/dist/{chunk-OXUIG3H3.js.map → chunk-ECMDQQO2.js.map} +1 -1
  116. package/dist/{chunk-T2WCFT6J.js → chunk-ELQFU3RH.js} +4 -4
  117. package/dist/{chunk-T2WCFT6J.js.map → chunk-ELQFU3RH.js.map} +1 -1
  118. package/dist/chunk-EPMM5ZWB.js +206 -0
  119. package/dist/chunk-EPMM5ZWB.js.map +1 -0
  120. package/dist/{chunk-DKYNZHZN.js → chunk-FG2B552D.js} +3 -3
  121. package/dist/{chunk-DKYNZHZN.js.map → chunk-FG2B552D.js.map} +1 -1
  122. package/dist/{chunk-L22FKPMY.js → chunk-FN4I3UDJ.js} +3 -3
  123. package/dist/{chunk-L22FKPMY.js.map → chunk-FN4I3UDJ.js.map} +1 -1
  124. package/dist/{chunk-V7RDFLP6.js → chunk-GCZ46XF6.js} +38 -57
  125. package/dist/chunk-GCZ46XF6.js.map +1 -0
  126. package/dist/{chunk-JK7WLO72.js → chunk-HGNR4XBD.js} +21 -9
  127. package/dist/chunk-HGNR4XBD.js.map +1 -0
  128. package/dist/{chunk-E74WBS5R.js → chunk-HUJARQI7.js} +3 -3
  129. package/dist/{chunk-E74WBS5R.js.map → chunk-HUJARQI7.js.map} +1 -1
  130. package/dist/{chunk-QG2ORHKD.js → chunk-ICQIH7F6.js} +3 -3
  131. package/dist/{chunk-QG2ORHKD.js.map → chunk-ICQIH7F6.js.map} +1 -1
  132. package/dist/{chunk-BYP72WXK.js → chunk-ISDSQORB.js} +4 -4
  133. package/dist/{chunk-BYP72WXK.js.map → chunk-ISDSQORB.js.map} +1 -1
  134. package/dist/{chunk-W6BDJU4X.js → chunk-J4GUGMPX.js} +3 -3
  135. package/dist/{chunk-W6BDJU4X.js.map → chunk-J4GUGMPX.js.map} +1 -1
  136. package/dist/{chunk-K7BDIB3L.js → chunk-J5OJ7JM2.js} +3 -3
  137. package/dist/{chunk-K7BDIB3L.js.map → chunk-J5OJ7JM2.js.map} +1 -1
  138. package/dist/{chunk-CYDQFZRF.js → chunk-JI6ZNE7R.js} +3 -3
  139. package/dist/{chunk-CYDQFZRF.js.map → chunk-JI6ZNE7R.js.map} +1 -1
  140. package/dist/{chunk-NZX2ZEF7.js → chunk-JRWBBN3M.js} +4 -4
  141. package/dist/{chunk-NZX2ZEF7.js.map → chunk-JRWBBN3M.js.map} +1 -1
  142. package/dist/{chunk-HFWQRV3W.js → chunk-LQ2PXFR4.js} +3 -3
  143. package/dist/{chunk-HFWQRV3W.js.map → chunk-LQ2PXFR4.js.map} +1 -1
  144. package/dist/{chunk-5MIP3DUG.js → chunk-N63CWDNI.js} +4 -4
  145. package/dist/{chunk-5MIP3DUG.js.map → chunk-N63CWDNI.js.map} +1 -1
  146. package/dist/{chunk-2WEGBUAG.js → chunk-NVPOH3CU.js} +6 -201
  147. package/dist/chunk-NVPOH3CU.js.map +1 -0
  148. package/dist/{chunk-O47T67E3.js → chunk-ONPV2TED.js} +5 -5
  149. package/dist/{chunk-O47T67E3.js.map → chunk-ONPV2TED.js.map} +1 -1
  150. package/dist/{chunk-COSCD4AH.js → chunk-P4UZRDTR.js} +14 -14
  151. package/dist/{chunk-COSCD4AH.js.map → chunk-P4UZRDTR.js.map} +1 -1
  152. package/dist/{chunk-PEENIBSF.js → chunk-PLPIAVLJ.js} +3 -3
  153. package/dist/{chunk-PEENIBSF.js.map → chunk-PLPIAVLJ.js.map} +1 -1
  154. package/dist/{chunk-QU5J4QXM.js → chunk-RSHQ43OI.js} +3 -3
  155. package/dist/{chunk-QU5J4QXM.js.map → chunk-RSHQ43OI.js.map} +1 -1
  156. package/dist/{chunk-VT4HELNA.js → chunk-TZCTCRGB.js} +3 -3
  157. package/dist/{chunk-VT4HELNA.js.map → chunk-TZCTCRGB.js.map} +1 -1
  158. package/dist/{chunk-LQBDOXLO.js → chunk-VZ342V4W.js} +4 -4
  159. package/dist/{chunk-LQBDOXLO.js.map → chunk-VZ342V4W.js.map} +1 -1
  160. package/dist/{chunk-7VYVQMYE.js → chunk-WWGGQY6N.js} +4 -4
  161. package/dist/{chunk-7VYVQMYE.js.map → chunk-WWGGQY6N.js.map} +1 -1
  162. package/dist/{chunk-67J4DMB3.js → chunk-XETMTAZC.js} +4 -4
  163. package/dist/{chunk-67J4DMB3.js.map → chunk-XETMTAZC.js.map} +1 -1
  164. package/dist/{chunk-OYD6FP42.js → chunk-XNBCPEH6.js} +7 -7
  165. package/dist/{chunk-OYD6FP42.js.map → chunk-XNBCPEH6.js.map} +1 -1
  166. package/dist/{chunk-GKM24XYF.js → chunk-XRX6VFSO.js} +4 -4
  167. package/dist/{chunk-GKM24XYF.js.map → chunk-XRX6VFSO.js.map} +1 -1
  168. package/dist/{chunk-GHM37DUT.js → chunk-Y6X3TVOI.js} +3 -3
  169. package/dist/{chunk-GHM37DUT.js.map → chunk-Y6X3TVOI.js.map} +1 -1
  170. package/dist/{chunk-SLAP5YVD.js → chunk-YF3U4WYG.js} +4 -4
  171. package/dist/{chunk-SLAP5YVD.js.map → chunk-YF3U4WYG.js.map} +1 -1
  172. package/dist/{chunk-BPCSMALD.js → chunk-ZU7TSTT7.js} +3 -3
  173. package/dist/{chunk-BPCSMALD.js.map → chunk-ZU7TSTT7.js.map} +1 -1
  174. package/dist/components/cart/index.js +1 -1
  175. package/dist/components/common/index.js +1 -1
  176. package/dist/components/drawer/index.js +12 -12
  177. package/dist/components/home/HomePageRenderer.d.ts +3 -1
  178. package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
  179. package/dist/components/home/LatestProducts.d.ts +13 -0
  180. package/dist/components/home/LatestProducts.d.ts.map +1 -0
  181. package/dist/components/home/index.js +17 -16
  182. package/dist/components/home/lazy.d.ts +1 -0
  183. package/dist/components/home/lazy.d.ts.map +1 -1
  184. package/dist/components/home/register.d.ts.map +1 -1
  185. package/dist/components/layout/index.js +4 -4
  186. package/dist/components/product/index.js +14 -13
  187. package/dist/components/store/index.js +13 -13
  188. package/dist/dev/editor/index.js +1 -1
  189. package/dist/dev/index.js +1 -1
  190. package/dist/{document-class-TCFZKDMC.js → document-class-LR4X2CH5.js} +11 -11
  191. package/dist/{document-class-TCFZKDMC.js.map → document-class-LR4X2CH5.js.map} +1 -1
  192. package/dist/hooks/index.js +12 -12
  193. package/dist/hooks/useGtm.js +12 -12
  194. package/dist/hooks/useMoney.js +12 -12
  195. package/dist/hooks/useStore.js +12 -12
  196. package/dist/hooks/useUser.js +3 -3
  197. package/dist/index.js +12 -12
  198. package/dist/{navigation-OID45FWX.js → navigation-5PCMFALH.js} +4 -4
  199. package/dist/{navigation-OID45FWX.js.map → navigation-5PCMFALH.js.map} +1 -1
  200. package/dist/{navigation-7F6D5AI5.js → navigation-OQ2ZT3ID.js} +5 -5
  201. package/dist/{navigation-7F6D5AI5.js.map → navigation-OQ2ZT3ID.js.map} +1 -1
  202. package/dist/{not-found-377JUHOW.js → not-found-YHQVBI7H.js} +15 -15
  203. package/dist/{not-found-377JUHOW.js.map → not-found-YHQVBI7H.js.map} +1 -1
  204. package/dist/providers/index.js +12 -12
  205. package/dist/routes/account/orders.js +4 -4
  206. package/dist/routes/account.js +13 -13
  207. package/dist/routes/blog.js +8 -8
  208. package/dist/routes/brands.js +4 -4
  209. package/dist/routes/cart.js +21 -20
  210. package/dist/routes/cart.js.map +1 -1
  211. package/dist/routes/home/HomePage.d.ts.map +1 -1
  212. package/dist/routes/home.js +18 -17
  213. package/dist/routes/index.js +3 -3
  214. package/dist/routes/loyalty.js +5 -5
  215. package/dist/routes/page.js +4 -4
  216. package/dist/routes/product-listing.js +19 -18
  217. package/dist/routes/product-listing.js.map +1 -1
  218. package/dist/routes/product.js +17 -16
  219. package/dist/routes/product.js.map +1 -1
  220. package/dist/routes/root/beforeLoad.d.ts +32 -13
  221. package/dist/routes/root/beforeLoad.d.ts.map +1 -1
  222. package/dist/routes/seo-redirects.js +3 -3
  223. package/dist/routes/testimonials.js +2 -2
  224. package/dist/routes/thank-you.js +4 -4
  225. package/dist/skeleton.js +18 -17
  226. package/dist/{store-lookup-FNWIAJLT.js → store-lookup-NJCTSPFL.js} +8 -8
  227. package/dist/{store-lookup-FNWIAJLT.js.map → store-lookup-NJCTSPFL.js.map} +1 -1
  228. package/dist/tanstack.js +11 -11
  229. package/dist/utils/index.js +2 -2
  230. package/package.json +1 -1
  231. package/tailwind/components/home/HomePageRenderer.tsx.txt +14 -3
  232. package/tailwind/components/home/LatestProducts.tsx.txt +63 -0
  233. package/tailwind/components/home/lazy.ts.txt +4 -0
  234. package/tailwind/components/home/register.ts.txt +2 -0
  235. package/tailwind/routes/home/HomePage.tsx.txt +6 -0
  236. package/tailwind/routes/root/beforeLoad.ts.txt +74 -19
  237. package/dist/NoContent-63TMCPGY.js.map +0 -1
  238. package/dist/chunk-2WEGBUAG.js.map +0 -1
  239. package/dist/chunk-3PHBJ3TA.js.map +0 -1
  240. package/dist/chunk-JK7WLO72.js.map +0 -1
  241. package/dist/chunk-NPN23RYM.js.map +0 -1
  242. package/dist/chunk-V7RDFLP6.js.map +0 -1
@@ -3,27 +3,46 @@ import type { StoreContext } from '../../api/store';
3
3
  import { type AppSnippet, type AppSettings } from '../../api/apps';
4
4
  import type { TwilightLocation } from '../../twilight/context';
5
5
  import { type ActiveScope } from '../../utils/cookies';
6
+ /**
7
+ * The market the settings were answered for, when the request asked with another one and
8
+ * its address did not switch market; null otherwise.
9
+ *
10
+ * That is a market's own domain (`us.store.com`): the API serves the market the domain is
11
+ * pinned to, whatever the `scope` cookie remembers from an earlier visit. The page has to
12
+ * take that market over, or the SDK keeps sending the remembered one and creates the
13
+ * guest's cart in it, which every request answered for the domain's market then refuses
14
+ * (TD-17588). A request that asked with no scope has nothing stale to correct. The branch
15
+ * is dropped with the market it belonged to; the type is store-wide, so it is the
16
+ * answer's, else the requested one.
17
+ */
18
+ export declare function hostPinnedScope(url: string, requested: ActiveScope | null, settings: StoreContext): ActiveScope | null;
6
19
  /**
7
20
  * The scope to write to the `scope` cookie for this request, or null to leave the cookie
8
21
  * as it is.
9
22
  *
10
- * Only for a market a `?scope=` URL switched to, and only when the settings were answered
11
- * for it: the API falls back to another market when it does not accept the requested one,
12
- * and Twig keeps the previous choice then too, rather than recording one the page is not
13
- * showing. Its type is the one the settings answered with: a URL names only the id, and
14
- * the store-wide type is assumed until the answer says otherwise (a store browsing by
15
- * branch or city), so later requests send the type the API matches against.
23
+ * The market a market's own domain answered with, over a remembered one; see
24
+ * {@link hostPinnedScope}.
25
+ *
26
+ * Otherwise only for a market a `?scope=` URL switched to, and only when the settings were
27
+ * answered for it: the API falls back to another market when it does not accept the
28
+ * requested one, and Twig keeps the previous choice then too, rather than recording one
29
+ * the page is not showing. Its type is the one the settings answered with: a URL names
30
+ * only the id, and the store-wide type is assumed until the answer says otherwise (a
31
+ * store browsing by branch or city), so later requests send the type the API matches
32
+ * against.
16
33
  */
17
34
  export declare function scopeCookieUpdate(url: string, cookieHeader: string | null, settings: StoreContext): ActiveScope | null;
18
35
  /**
19
- * Gives the request's scope the type its settings answered with, for the rest of this
20
- * render, and files the settings and ads under the key the corrected scope makes, so the browser
21
- * — which reads the corrected scope from the cookie (see {@link scopeCookieUpdate}) — finds
22
- * them dehydrated instead of fetching them again. The entry under the assumed type's key
23
- * is removed, so the page carries them once. Server-only; a no-op when the type
24
- * already matches or the settings answered another scope.
36
+ * Gives the request the scope its settings answered with, for the rest of this render:
37
+ * the market a market's own domain is pinned to when the request asked with another (see
38
+ * {@link hostPinnedScope}; only with the page `url`), else the same scope with the type
39
+ * the answer named. Files the settings and ads under the key the corrected scope makes, so
40
+ * the browser — which reads the corrected scope from the cookie (see
41
+ * {@link scopeCookieUpdate}) — finds them dehydrated instead of fetching them again. The
42
+ * entry under the assumed scope's key is removed, so the page carries them once.
43
+ * Server-only; a no-op when there is nothing to correct.
25
44
  */
26
- export declare function alignRequestScopeType(queryClient: QueryClient, settings: StoreContext): void;
45
+ export declare function alignRequestScope(queryClient: QueryClient, settings: StoreContext, url?: string): void;
27
46
  /**
28
47
  * Writes {@link scopeCookieUpdate} to the response. Read from the request itself rather
29
48
  * than the middleware's context, for the same reason as {@link readServerCookieToken}.
@@ -1 +1 @@
1
- {"version":3,"file":"beforeLoad.d.ts","sourceRoot":"","sources":["../../../src/routes/root/beforeLoad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAoC7B;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,QAAQ,EAAE,YAAY,GACrB,WAAW,GAAG,IAAI,CAOpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAmB5F;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oFAoBP,CAAC;AA0B1B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAMhF;AA2CD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC,GAAG,EAAE,KAAK,GAAG,KAAK,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,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pendingOrdersRedirectLoader, productsSourceRedirectLoader, ratingRedirectLoader, slugBrandRedirectLoader } from '../chunk-QG2ORHKD.js';
2
- import '../chunk-PEENIBSF.js';
1
+ export { LogoutRedirect, accountRedirectLoader, pendingOrdersRedirectLoader, productsSourceRedirectLoader, ratingRedirectLoader, slugBrandRedirectLoader } from '../chunk-ICQIH7F6.js';
2
+ import '../chunk-PLPIAVLJ.js';
3
3
  import '../chunk-OUW6WESU.js';
4
- import '../chunk-K7BDIB3L.js';
4
+ import '../chunk-J5OJ7JM2.js';
5
5
  import '../chunk-Z5M4YYWT.js';
6
6
  import '../chunk-3E3ABCPC.js';
7
7
  import '../chunk-NHA4SBKG.js';
@@ -33,10 +33,10 @@ async function reviewsLoader() {
33
33
 
34
34
  // src/routes/testimonials/index.tsx
35
35
  var LazyTestimonialsPage = lazyComponent(
36
- () => import('../TestimonialsPage-UVUX2PE3.js').then((m) => ({ default: m.TestimonialsPage }))
36
+ () => import('../TestimonialsPage-ESB4CQRS.js').then((m) => ({ default: m.TestimonialsPage }))
37
37
  );
38
38
  var LazyReviewsPage = lazyComponent(
39
- () => import('../ReviewsPage-B2K3VNYU.js').then((m) => ({ default: m.ReviewsPage }))
39
+ () => import('../ReviewsPage-M7QHDNCJ.js').then((m) => ({ default: m.ReviewsPage }))
40
40
  );
41
41
  var TestimonialsPage = LazyTestimonialsPage;
42
42
  var ReviewsPage = LazyReviewsPage;
@@ -1,8 +1,8 @@
1
- import { order } from '../chunk-GKM24XYF.js';
1
+ import { order } from '../chunk-XRX6VFSO.js';
2
2
  import { buildHreflangAlternates } from '../chunk-RYGEIQWO.js';
3
- import '../chunk-PEENIBSF.js';
3
+ import '../chunk-PLPIAVLJ.js';
4
4
  import { RouteId } from '../chunk-OUW6WESU.js';
5
- import '../chunk-K7BDIB3L.js';
5
+ import '../chunk-J5OJ7JM2.js';
6
6
  import '../chunk-Z5M4YYWT.js';
7
7
  import '../chunk-3E3ABCPC.js';
8
8
  import '../chunk-NHA4SBKG.js';
@@ -41,7 +41,7 @@ async function thankYouLoader({
41
41
 
42
42
  // src/routes/thank-you/index.tsx
43
43
  var LazyThankYouPage = lazyComponent(
44
- () => import('../ThankYouPage-EIQ57UHN.js').then((m) => ({ default: m.ThankYouPage }))
44
+ () => import('../ThankYouPage-BLYIJQNV.js').then((m) => ({ default: m.ThankYouPage }))
45
45
  );
46
46
  var ThankYouPage = LazyThankYouPage;
47
47
  async function loader(ctx, extend) {
package/dist/skeleton.js CHANGED
@@ -1,31 +1,32 @@
1
1
  export { BlogSkeleton, BreadcrumbSkeleton, CartSkeleton, CustomerLayoutSkeleton, CustomerPageSkeleton, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, SkeletonPulse } from './chunk-N7CCSGZF.js';
2
- export { HomeSkeleton } from './chunk-NPN23RYM.js';
2
+ export { HomeSkeleton } from './chunk-7CGTHJ6S.js';
3
3
  import './chunk-IXHM24Z4.js';
4
- import './chunk-JK7WLO72.js';
5
- import './chunk-L22FKPMY.js';
6
- import './chunk-BYP72WXK.js';
7
- import './chunk-2WEGBUAG.js';
4
+ import './chunk-HGNR4XBD.js';
5
+ import './chunk-FN4I3UDJ.js';
6
+ import './chunk-ISDSQORB.js';
7
+ import './chunk-EPMM5ZWB.js';
8
+ import './chunk-NVPOH3CU.js';
8
9
  import './chunk-Y32RHCOH.js';
9
- import './chunk-COSCD4AH.js';
10
+ import './chunk-P4UZRDTR.js';
10
11
  import './chunk-H2QBHOF2.js';
11
- import './chunk-IC6Z6BB2.js';
12
- import './chunk-HFWQRV3W.js';
12
+ import './chunk-ECFDJBTE.js';
13
+ import './chunk-LQ2PXFR4.js';
13
14
  import './chunk-N6ZE6HUX.js';
14
15
  import './chunk-X55R4VVK.js';
15
- import './chunk-DKYNZHZN.js';
16
+ import './chunk-FG2B552D.js';
16
17
  import './chunk-OXMUPNMH.js';
17
- import './chunk-W6BDJU4X.js';
18
+ import './chunk-J4GUGMPX.js';
18
19
  import './chunk-VVZNW5CB.js';
19
20
  import './chunk-WQPG22DY.js';
20
21
  import './chunk-GD26FI4J.js';
21
22
  import './chunk-Q7E4TNN7.js';
22
23
  import './chunk-RYGEIQWO.js';
23
- import './chunk-PEENIBSF.js';
24
+ import './chunk-PLPIAVLJ.js';
24
25
  import './chunk-OUW6WESU.js';
25
26
  import './chunk-HOJ5E2PG.js';
26
27
  import './chunk-HI5V5X3S.js';
27
- import './chunk-5Y4NL57B.js';
28
- import './chunk-GHM37DUT.js';
28
+ import './chunk-5J3HVOTR.js';
29
+ import './chunk-Y6X3TVOI.js';
29
30
  import './chunk-MVT5AF2A.js';
30
31
  import './chunk-Z653O7MX.js';
31
32
  import './chunk-ZCH7W7DZ.js';
@@ -36,16 +37,16 @@ import './chunk-7V36I5GT.js';
36
37
  import './chunk-6WI7R2BD.js';
37
38
  import './chunk-LFHYQ6AN.js';
38
39
  import './chunk-OAMIDZKW.js';
39
- import './chunk-CYDQFZRF.js';
40
+ import './chunk-JI6ZNE7R.js';
40
41
  import './chunk-OQIIJRAS.js';
41
42
  import './chunk-V2ZDTY6H.js';
42
- import './chunk-BPCSMALD.js';
43
+ import './chunk-ZU7TSTT7.js';
43
44
  import './chunk-5XDPAKF5.js';
44
45
  import './chunk-GCPEMNSU.js';
45
- import './chunk-K7BDIB3L.js';
46
+ import './chunk-J5OJ7JM2.js';
46
47
  import './chunk-Z5M4YYWT.js';
47
48
  import './chunk-TYNZ5B2B.js';
48
- import './chunk-PYDHLM3Y.js';
49
+ import './chunk-BBMRL2QU.js';
49
50
  import './chunk-AXW67SY7.js';
50
51
  import './chunk-BYMOPN2S.js';
51
52
  import './chunk-SKLEJJ6M.js';
@@ -1,11 +1,11 @@
1
- import { category } from './chunk-67J4DMB3.js';
2
- import { blog } from './chunk-7VYVQMYE.js';
3
- import { brand } from './chunk-T2WCFT6J.js';
4
- import { product } from './chunk-BYP72WXK.js';
1
+ import { category } from './chunk-XETMTAZC.js';
2
+ import { blog } from './chunk-WWGGQY6N.js';
3
+ import { brand } from './chunk-ELQFU3RH.js';
4
+ import { product } from './chunk-ISDSQORB.js';
5
5
  import { DEV_LOOKUP_BUDGET_MS } from './chunk-OXMUPNMH.js';
6
- import './chunk-PEENIBSF.js';
6
+ import './chunk-PLPIAVLJ.js';
7
7
  import './chunk-OUW6WESU.js';
8
- import './chunk-K7BDIB3L.js';
8
+ import './chunk-J5OJ7JM2.js';
9
9
  import './chunk-Z5M4YYWT.js';
10
10
  import './chunk-3E3ABCPC.js';
11
11
  import './chunk-NHA4SBKG.js';
@@ -111,5 +111,5 @@ function lookupInStore(source, query) {
111
111
  }
112
112
 
113
113
  export { lookupInStore };
114
- //# sourceMappingURL=store-lookup-FNWIAJLT.js.map
115
- //# sourceMappingURL=store-lookup-FNWIAJLT.js.map
114
+ //# sourceMappingURL=store-lookup-NJCTSPFL.js.map
115
+ //# sourceMappingURL=store-lookup-NJCTSPFL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev/store-lookup.ts"],"names":["categories"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAM,QAAA,GAAW,EAAA;AAEjB,IAAM,SAAA,GAAY,EAAA;AAalB,eAAe,OAAA,CACb,WACA,IAAA,EACc;AACd,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,GAAA,EAAI,GAAI,oBAAA;AAC9B,EAAA,MAAM,QAAa,EAAC;AACpB,EAAA,IAAI,MAAA,GAAwB,IAAA;AAC5B,EAAA,KAAA,IAAS,IAAA,GAAO,CAAA,EAAG,IAAA,IAAQ,SAAA,EAAW,QAAQ,CAAA,EAAG;AAC/C,IAAA,MAAM,EAAE,KAAA,EAAO,IAAA,KAAS,MAAM,SAAA,CAAU,MAAM,MAAM,CAAA;AACpD,IAAA,KAAA,CAAM,IAAA,CAAK,GAAG,KAAA,CAAM,MAAA,CAAO,IAAI,CAAC,CAAA;AAChC,IAAA,IAAI,KAAA,CAAM,UAAU,QAAA,IAAY,CAAC,QAAQ,IAAA,CAAK,GAAA,MAAS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AAM,CAAA,CAAE,IAAA,EAAM,GAAA,EAAK,CAAA,CAAE,GAAA;AAAI,GAC7C,CAAE,CAAA;AACN;AAEA,IAAM,OAAA,GAAgF;AAAA,EACpF,QAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAA,EAAe,YAAA;AAAA,EACf,eAAA,EAAiB;AACnB,CAAA;AAEO,SAAS,aAAA,CAAc,QAAyB,KAAA,EAAyC;AAC9F,EAAA,MAAM,MAAA,GAAS,QAAQ,MAAM,CAAA;AAC7B,EAAA,IAAI,CAAC,MAAA,EAAQ,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,cAAA,EAAiB,MAAM,CAAA,CAAE,CAAC,CAAA;AACvE,EAAA,OAAO,MAAA,CAAO,KAAA,CAAM,IAAA,EAAM,CAAA;AAC5B","file":"store-lookup-FNWIAJLT.js","sourcesContent":["/**\n * Runs in the editor's frame (the storefront), which has the engine's API\n * client set up for the dev store: answers the editor's pickers with the real\n * store's products, categories, brands and blog. Loaded with `import()` on the\n * first lookup, so a storefront never carries it.\n *\n * Each item's `data` is what a block receives for it, in the API's shape: a\n * product block reads only the ids and fetches the rest, while categories and\n * brands are drawn from what is saved.\n */\n\nimport { product } from '../api/product';\nimport { category } from '../api/category';\nimport { brand } from '../api/brands';\nimport { blog } from '../api/blog';\nimport type { Category } from '../types';\nimport { DEV_LOOKUP_BUDGET_MS, type DevLookupItem, type DevLookupSource } from './schema-types';\n\n/** Enough to choose from; a search narrows it further. */\nconst PER_PAGE = 20;\n/** How far a paged list is searched before giving up, so a big store can't stall the picker. */\nconst MAX_PAGES = 10;\n\ninterface Page<T> {\n items: T[];\n next: string | null;\n}\n\n/**\n * The matching items of a paged list, read page after page until there are\n * enough, the pages run out, or the time budget is spent: a brand or article on\n * page three is still found, and what was found so far always reaches the\n * editor before it stops waiting (`DEV_LOOKUP_BUDGET_MS` < its timeout).\n */\nasync function collect<T>(\n fetchPage: (page: number, cursor: string | null) => Promise<Page<T>>,\n keep: (item: T) => boolean\n): Promise<T[]> {\n const deadline = Date.now() + DEV_LOOKUP_BUDGET_MS;\n const found: T[] = [];\n let cursor: string | null = null;\n for (let page = 1; page <= MAX_PAGES; page += 1) {\n const { items, next } = await fetchPage(page, cursor);\n found.push(...items.filter(keep));\n if (found.length >= PER_PAGE || !next || Date.now() >= deadline) break;\n cursor = next;\n }\n return found.slice(0, PER_PAGE);\n}\n\nfunction matches(name: string, query: string): boolean {\n return !query || name.toLowerCase().includes(query.toLowerCase());\n}\n\n/** Categories with their subcategories, flattened, parents first. */\nfunction flatten(categories: Category[]): Category[] {\n return categories.flatMap((c) => [c, ...flatten(c.sub_categories ?? [])]);\n}\n\nasync function products(query: string): Promise<DevLookupItem[]> {\n const { items } = await product.list({\n source: query ? 'search' : 'latest',\n ...(query ? { keyword: query } : {}),\n perPage: PER_PAGE,\n });\n // List responses send the id as a numeric string; the block reads a number. Use it for both.\n return items.map((p) => ({\n id: Number(p.id),\n name: p.name,\n image: p.image?.url,\n url: p.url,\n data: { id: Number(p.id), name: p.name, url: p.url, image: p.image?.url ?? null },\n }));\n}\n\nasync function categories(query: string): Promise<DevLookupItem[]> {\n return flatten(await category.list())\n .filter((c) => matches(c.name, query))\n .slice(0, PER_PAGE)\n .map((c) => ({\n id: c.id,\n name: c.name,\n image: c.image ?? undefined,\n url: c.url,\n data: { id: c.id, name: c.name, url: c.url, image: c.image ?? null, icon: c.icon ?? null },\n }));\n}\n\nasync function brands(query: string): Promise<DevLookupItem[]> {\n const found = await collect(\n (page) => brand.list(page),\n (b) => matches(b.name, query)\n );\n return found.map((b) => ({\n id: b.id,\n name: b.name,\n image: b.logo,\n url: b.url,\n data: { id: b.id, name: b.name, url: b.url, logo: b.logo, banner: b.banner ?? null },\n }));\n}\n\nasync function blogArticles(query: string): Promise<DevLookupItem[]> {\n const found = await collect(\n async (_page, cursor) => {\n const { data, cursor: pages } = await blog.articles.list(cursor ? { cursor } : undefined);\n return { items: data, next: pages?.next ?? null };\n },\n (a) => matches(a.name, query)\n );\n return found.map((a) => ({\n id: a.id,\n name: a.name,\n image: a.image,\n url: a.url,\n data: { id: a.id, name: a.name, url: a.url },\n }));\n}\n\nasync function blogCategories(query: string): Promise<DevLookupItem[]> {\n const { categories: list } = await blog.get();\n return list\n .filter((c) => matches(c.name, query))\n .slice(0, PER_PAGE)\n .map((c) => ({\n id: c.id,\n name: c.name,\n url: c.url,\n data: { id: c.id, name: c.name, url: c.url },\n }));\n}\n\nconst LOOKUPS: Record<DevLookupSource, (query: string) => Promise<DevLookupItem[]>> = {\n products,\n categories,\n brands,\n blog_articles: blogArticles,\n blog_categories: blogCategories,\n};\n\nexport function lookupInStore(source: DevLookupSource, query: string): Promise<DevLookupItem[]> {\n const lookup = LOOKUPS[source];\n if (!lookup) return Promise.reject(new Error(`no lookup for ${source}`));\n return lookup(query.trim());\n}\n"]}
1
+ {"version":3,"sources":["../src/dev/store-lookup.ts"],"names":["categories"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAM,QAAA,GAAW,EAAA;AAEjB,IAAM,SAAA,GAAY,EAAA;AAalB,eAAe,OAAA,CACb,WACA,IAAA,EACc;AACd,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,GAAA,EAAI,GAAI,oBAAA;AAC9B,EAAA,MAAM,QAAa,EAAC;AACpB,EAAA,IAAI,MAAA,GAAwB,IAAA;AAC5B,EAAA,KAAA,IAAS,IAAA,GAAO,CAAA,EAAG,IAAA,IAAQ,SAAA,EAAW,QAAQ,CAAA,EAAG;AAC/C,IAAA,MAAM,EAAE,KAAA,EAAO,IAAA,KAAS,MAAM,SAAA,CAAU,MAAM,MAAM,CAAA;AACpD,IAAA,KAAA,CAAM,IAAA,CAAK,GAAG,KAAA,CAAM,MAAA,CAAO,IAAI,CAAC,CAAA;AAChC,IAAA,IAAI,KAAA,CAAM,UAAU,QAAA,IAAY,CAAC,QAAQ,IAAA,CAAK,GAAA,MAAS,QAAA,EAAU;AAC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,IAAA,EAAM,GAAA,EAAK,CAAA,CAAE,GAAA;AAAI,GAC7C,CAAE,CAAA;AACN;AAEA,IAAM,OAAA,GAAgF;AAAA,EACpF,QAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAA,EAAe,YAAA;AAAA,EACf,eAAA,EAAiB;AACnB,CAAA;AAEO,SAAS,aAAA,CAAc,QAAyB,KAAA,EAAyC;AAC9F,EAAA,MAAM,MAAA,GAAS,QAAQ,MAAM,CAAA;AAC7B,EAAA,IAAI,CAAC,MAAA,EAAQ,OAAO,OAAA,CAAQ,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,cAAA,EAAiB,MAAM,CAAA,CAAE,CAAC,CAAA;AACvE,EAAA,OAAO,MAAA,CAAO,KAAA,CAAM,IAAA,EAAM,CAAA;AAC5B","file":"store-lookup-NJCTSPFL.js","sourcesContent":["/**\n * Runs in the editor's frame (the storefront), which has the engine's API\n * client set up for the dev store: answers the editor's pickers with the real\n * store's products, categories, brands and blog. Loaded with `import()` on the\n * first lookup, so a storefront never carries it.\n *\n * Each item's `data` is what a block receives for it, in the API's shape: a\n * product block reads only the ids and fetches the rest, while categories and\n * brands are drawn from what is saved.\n */\n\nimport { product } from '../api/product';\nimport { category } from '../api/category';\nimport { brand } from '../api/brands';\nimport { blog } from '../api/blog';\nimport type { Category } from '../types';\nimport { DEV_LOOKUP_BUDGET_MS, type DevLookupItem, type DevLookupSource } from './schema-types';\n\n/** Enough to choose from; a search narrows it further. */\nconst PER_PAGE = 20;\n/** How far a paged list is searched before giving up, so a big store can't stall the picker. */\nconst MAX_PAGES = 10;\n\ninterface Page<T> {\n items: T[];\n next: string | null;\n}\n\n/**\n * The matching items of a paged list, read page after page until there are\n * enough, the pages run out, or the time budget is spent: a brand or article on\n * page three is still found, and what was found so far always reaches the\n * editor before it stops waiting (`DEV_LOOKUP_BUDGET_MS` < its timeout).\n */\nasync function collect<T>(\n fetchPage: (page: number, cursor: string | null) => Promise<Page<T>>,\n keep: (item: T) => boolean\n): Promise<T[]> {\n const deadline = Date.now() + DEV_LOOKUP_BUDGET_MS;\n const found: T[] = [];\n let cursor: string | null = null;\n for (let page = 1; page <= MAX_PAGES; page += 1) {\n const { items, next } = await fetchPage(page, cursor);\n found.push(...items.filter(keep));\n if (found.length >= PER_PAGE || !next || Date.now() >= deadline) break;\n cursor = next;\n }\n return found.slice(0, PER_PAGE);\n}\n\nfunction matches(name: string, query: string): boolean {\n return !query || name.toLowerCase().includes(query.toLowerCase());\n}\n\n/** Categories with their subcategories, flattened, parents first. */\nfunction flatten(categories: Category[]): Category[] {\n return categories.flatMap((c) => [c, ...flatten(c.sub_categories ?? [])]);\n}\n\nasync function products(query: string): Promise<DevLookupItem[]> {\n const { items } = await product.list({\n source: query ? 'search' : 'latest',\n ...(query ? { keyword: query } : {}),\n perPage: PER_PAGE,\n });\n // List responses send the id as a numeric string; the block reads a number. Use it for both.\n return items.map((p) => ({\n id: Number(p.id),\n name: p.name,\n image: p.image?.url,\n url: p.url,\n data: { id: Number(p.id), name: p.name, url: p.url, image: p.image?.url ?? null },\n }));\n}\n\nasync function categories(query: string): Promise<DevLookupItem[]> {\n return flatten(await category.list())\n .filter((c) => matches(c.name, query))\n .slice(0, PER_PAGE)\n .map((c) => ({\n id: c.id,\n name: c.name,\n image: c.image ?? undefined,\n url: c.url,\n data: { id: c.id, name: c.name, url: c.url, image: c.image ?? null, icon: c.icon ?? null },\n }));\n}\n\nasync function brands(query: string): Promise<DevLookupItem[]> {\n const found = await collect(\n (page) => brand.list(page),\n (b) => matches(b.name, query)\n );\n return found.map((b) => ({\n id: b.id,\n name: b.name,\n image: b.logo,\n url: b.url,\n data: { id: b.id, name: b.name, url: b.url, logo: b.logo, banner: b.banner ?? null },\n }));\n}\n\nasync function blogArticles(query: string): Promise<DevLookupItem[]> {\n const found = await collect(\n async (_page, cursor) => {\n const { data, cursor: pages } = await blog.articles.list(cursor ? { cursor } : undefined);\n return { items: data, next: pages?.next ?? null };\n },\n (a) => matches(a.name, query)\n );\n return found.map((a) => ({\n id: a.id,\n name: a.name,\n image: a.image,\n url: a.url,\n data: { id: a.id, name: a.name, url: a.url },\n }));\n}\n\nasync function blogCategories(query: string): Promise<DevLookupItem[]> {\n const { categories: list } = await blog.get();\n return list\n .filter((c) => matches(c.name, query))\n .slice(0, PER_PAGE)\n .map((c) => ({\n id: c.id,\n name: c.name,\n url: c.url,\n data: { id: c.id, name: c.name, url: c.url },\n }));\n}\n\nconst LOOKUPS: Record<DevLookupSource, (query: string) => Promise<DevLookupItem[]>> = {\n products,\n categories,\n brands,\n blog_articles: blogArticles,\n blog_categories: blogCategories,\n};\n\nexport function lookupInStore(source: DevLookupSource, query: string): Promise<DevLookupItem[]> {\n const lookup = LOOKUPS[source];\n if (!lookup) return Promise.reject(new Error(`no lookup for ${source}`));\n return lookup(query.trim());\n}\n"]}
package/dist/tanstack.js CHANGED
@@ -1,26 +1,26 @@
1
- export { tanstackDocumentAdapter as attrs, createRouter, createTwilightRootRoute, useTanstackDocumentAttrs as useAttrs } from './chunk-V7RDFLP6.js';
2
- import { requestHostOf } from './chunk-MT7DVK2V.js';
3
- export { TanStackLinkAdapter, TanStackNavigationProvider, createTanStackLinkAdapter } from './chunk-MT7DVK2V.js';
1
+ export { tanstackDocumentAdapter as attrs, createRouter, createTwilightRootRoute, useTanstackDocumentAttrs as useAttrs } from './chunk-GCZ46XF6.js';
2
+ import { requestHostOf } from './chunk-5KKQUH72.js';
3
+ export { TanStackLinkAdapter, TanStackNavigationProvider, createTanStackLinkAdapter } from './chunk-5KKQUH72.js';
4
4
  import './chunk-Z4Y55HWX.js';
5
5
  export { tanstackHeadAdapter as head, withHead } from './chunk-5UWRPWK2.js';
6
6
  import { CRITICAL_STYLE_HREF } from './chunk-4FJGZQD3.js';
7
- import './chunk-VT4HELNA.js';
8
- import { readNativeAppHeaders } from './chunk-3PHBJ3TA.js';
9
- import './chunk-E74WBS5R.js';
10
- import './chunk-BYP72WXK.js';
7
+ import './chunk-TZCTCRGB.js';
8
+ import { readNativeAppHeaders } from './chunk-2IGIQA2S.js';
9
+ import './chunk-HUJARQI7.js';
10
+ import './chunk-ISDSQORB.js';
11
11
  import { rootHead } from './chunk-N6ZE6HUX.js';
12
12
  import './chunk-X55R4VVK.js';
13
- import './chunk-W6BDJU4X.js';
13
+ import './chunk-J4GUGMPX.js';
14
14
  import './chunk-WQPG22DY.js';
15
15
  import './chunk-GD26FI4J.js';
16
16
  import { maintenanceEvidence, MAINTENANCE_EVIDENCE_HEADER, maintenanceEvidenceHeader } from './chunk-Q7E4TNN7.js';
17
17
  import './chunk-RYGEIQWO.js';
18
- import './chunk-PEENIBSF.js';
18
+ import './chunk-PLPIAVLJ.js';
19
19
  import './chunk-OUW6WESU.js';
20
20
  import './chunk-JWXJPJBO.js';
21
21
  export { mergeDocumentDescriptors as mergeAttrs } from './chunk-CW625T2E.js';
22
- import './chunk-BPCSMALD.js';
23
- import './chunk-K7BDIB3L.js';
22
+ import './chunk-ZU7TSTT7.js';
23
+ import './chunk-J5OJ7JM2.js';
24
24
  import './chunk-Z5M4YYWT.js';
25
25
  import './chunk-TYNZ5B2B.js';
26
26
  import './chunk-BYMOPN2S.js';
@@ -1,6 +1,6 @@
1
1
  export { stripUnsafeHtml } from '../chunk-RUHSV4Z6.js';
2
2
  export { formatSallaPlural } from '../chunk-BT6HEEAP.js';
3
- export { dispatchRouteChanged } from '../chunk-VT4HELNA.js';
3
+ export { dispatchRouteChanged } from '../chunk-TZCTCRGB.js';
4
4
  export { sortOptions } from '../chunk-3LZJXKVO.js';
5
5
  export { color } from '../chunk-VVZNW5CB.js';
6
6
  export { applyAppScopeMocks, registerThemeHookSlots } from '../chunk-WQPG22DY.js';
@@ -8,7 +8,7 @@ export { mergeHead, resolveHead, setHeadAdapter } from '../chunk-GD26FI4J.js';
8
8
  export { buildBaseHead, buildHreflangAlternates, localeToOgLocale } from '../chunk-RYGEIQWO.js';
9
9
  export { asset, cdn, isPlaceholder } from '../chunk-ZCH7W7DZ.js';
10
10
  export { mergeDocumentDescriptors, mergeElementAttrs, normalizeClasses, syncAttrsToElement, toReactProps } from '../chunk-CW625T2E.js';
11
- import '../chunk-K7BDIB3L.js';
11
+ import '../chunk-J5OJ7JM2.js';
12
12
  import '../chunk-Z5M4YYWT.js';
13
13
  export { getSallaSDK, getStoreIdentifier, onSallaEvent, whenSallaLoaded, whenSallaReady } from '../chunk-NHA4SBKG.js';
14
14
  export { AUTH_TOKEN_COOKIE_NAME, clearAuthTokenCookie, extractTokenFromCookies } from '../chunk-FXVII733.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-theme-engine",
3
- "version": "1.0.137",
3
+ "version": "1.0.139",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -125,6 +125,12 @@ export type HomeComponentConfig = {
125
125
  const COMPONENT_CONFIG: Record<string, HomeComponentConfig> = {
126
126
  'products-slider': { height: '450px', placeholder: <ProductsSliderSkeleton /> },
127
127
  'fixed-products': { height: '450px', placeholder: <FixedProductsSkeleton /> },
128
+ 'latest-products': {
129
+ height: '450px',
130
+ placeholder: <FixedProductsSkeleton />,
131
+ // As in Twig Raed's `latest-products.twig`.
132
+ className: 's-block s-block--latest-products container mt-6 sm:mt-8',
133
+ },
128
134
  'featured-products': {
129
135
  height: '450px',
130
136
  placeholder: <ProductsSliderSkeleton />,
@@ -211,9 +217,11 @@ function resolveComponentConfig(path: string): HomeComponentConfig | undefined {
211
217
  * id comes first: a customized layout keeps the store blocks' row ids among
212
218
  * their fields, and duplicates share them. A built-in block (fixed products,
213
219
  * YouTube, …) has neither id nor key, so it goes by its path, which the
214
- * editor matches to the block's slug; the bar says which copy.
220
+ * editor matches to the block's slug; the bar says which copy. A block the
221
+ * engine adds itself (`editable: false`) is not the merchant's, so it has none.
215
222
  */
216
- function liveBlockIdOf(data: HomeComponentData): string | undefined {
223
+ function liveBlockIdOf(data: HomeComponentData, editable?: boolean): string | undefined {
224
+ if (editable === false) return undefined;
217
225
  const devId = typeof data.__dev_id === 'string' ? data.__dev_id.replace(/~\d+$/, '') : undefined;
218
226
  const id = devId ?? data.id ?? data.key;
219
227
  if (typeof id === 'number' || (typeof id === 'string' && id)) return String(id);
@@ -228,11 +236,14 @@ export const HomeComponentRenderer = memo(function HomeComponentRenderer({
228
236
  data,
229
237
  index,
230
238
  priority,
239
+ editable,
231
240
  }: {
232
241
  data: HomeComponentData;
233
242
  index: number;
234
243
  /** Mount right away with eager images. Defaults to the first three blocks of the page. */
235
244
  priority?: boolean;
245
+ /** False for a block the engine adds, not the merchant: the theme editor's bar leaves it alone. */
246
+ editable?: boolean;
236
247
  }) {
237
248
  const renderCountRef = useRef(0);
238
249
  renderCountRef.current += 1;
@@ -268,7 +279,7 @@ export const HomeComponentRenderer = memo(function HomeComponentRenderer({
268
279
  ? config.id(data)
269
280
  : config.id
270
281
  : undefined;
271
- const liveBlockId = liveBlockIdOf(data);
282
+ const liveBlockId = liveBlockIdOf(data, editable);
272
283
  const height = config?.height || '400px';
273
284
  // A theme's config replaces the engine's, but keeps its mount timing unless the theme sets one.
274
285
  const renderOnMount = config?.renderOnMount ?? COMPONENT_CONFIG[data.path]?.renderOnMount;
@@ -0,0 +1,63 @@
1
+ import { useCallback, useRef } from 'react';
2
+ import { ProductCardSkeleton, SallaProductsList } from '@salla.sa/twilight-components-react';
3
+ import { parseNextPageToken, product } from '../../api/product';
4
+ import { ProductCard } from '../product/ProductCard';
5
+ import { NoContent } from '../common/NoContent';
6
+ import { useTranslation } from '../../providers/I18nProvider';
7
+ import type { Product } from '../../types';
8
+
9
+ export interface LatestProductsProps {
10
+ data: {
11
+ title?: string;
12
+ priority?: boolean;
13
+ [key: string]: unknown;
14
+ };
15
+ }
16
+
17
+ /**
18
+ * Twig's `latest-products` block (the Store app's LatestProductsWidget): the store's newest
19
+ * products, loading more as the customer scrolls. A home page with no blocks shows it.
20
+ */
21
+ export function LatestProducts({ data }: LatestProductsProps) {
22
+ const { t } = useTranslation();
23
+ const nextRef = useRef<string | null>(null);
24
+
25
+ const loader = useCallback(async () => {
26
+ const result = await product.list({ source: 'latest', ...parseNextPageToken(nextRef.current) });
27
+ nextRef.current = result.next;
28
+ return result;
29
+ }, []);
30
+
31
+ return (
32
+ <>
33
+ <div className="s-block__title">
34
+ <h2>{data.title || t('blocks.home.latest_products', 'Latest Products')}</h2>
35
+ </div>
36
+ <SallaProductsList<Product>
37
+ loader={loader}
38
+ mode="infinite"
39
+ itemsClassName="s-products-list-vertical-cards"
40
+ skeleton={<ProductCardSkeleton />}
41
+ skeletonType="item"
42
+ skeletonCount={8}
43
+ empty={
44
+ <NoContent
45
+ icon="sicon-shopping-bag"
46
+ message={t('pages.categories.no_products', 'No products found in this category')}
47
+ />
48
+ }
49
+ t={(key, fallback) => t(key, fallback || key)}
50
+ >
51
+ {(products) =>
52
+ products.map((item, index) => (
53
+ <ProductCard
54
+ key={item.id}
55
+ product={item}
56
+ imagePriority={!!data.priority && index < 2}
57
+ />
58
+ ))
59
+ }
60
+ </SallaProductsList>
61
+ </>
62
+ );
63
+ }
@@ -4,6 +4,10 @@ export { ProductsSlider as LazyProductsSlider } from './ProductsSlider';
4
4
  export { StoreFeatures as LazyStoreFeatures } from './StoreFeatures';
5
5
  export { FixedBanner as LazyFixedBanner } from './FixedBanner';
6
6
  export { FixedProducts as LazyFixedProducts } from './FixedProducts';
7
+ // Only a home page with no blocks shows it, so most stores never load it.
8
+ export const LazyLatestProducts = lazyComponent(() =>
9
+ import('./LatestProducts').then((m) => ({ default: m.LatestProducts }))
10
+ );
7
11
  export { FeaturedProductsStyle1 as LazyFeaturedProductsStyle1 } from './FeaturedProductsStyle1';
8
12
  export { FeaturedProductsStyle2 as LazyFeaturedProductsStyle2 } from './FeaturedProductsStyle2';
9
13
  export { FeaturedProductsStyle3 as LazyFeaturedProductsStyle3 } from './FeaturedProductsStyle3';
@@ -3,6 +3,7 @@ import {
3
3
  LazyStoreFeatures,
4
4
  LazyFixedBanner,
5
5
  LazyFixedProducts,
6
+ LazyLatestProducts,
6
7
  LazyFeaturedProductsStyle1,
7
8
  LazyFeaturedProductsStyle2,
8
9
  LazyFeaturedProductsStyle3,
@@ -24,6 +25,7 @@ export const DefaultHomeComponents: Record<string, AnyHomeComponent | null> = {
24
25
  youtube: LazyYoutube,
25
26
  'square-photos': LazySquarePhotos,
26
27
  'fixed-products': LazyFixedProducts,
28
+ 'latest-products': LazyLatestProducts,
27
29
  'products-slider': LazyProductsSlider,
28
30
  'parallax-background': LazyParallaxBackground,
29
31
  'featured-products:style1': LazyFeaturedProductsStyle1,
@@ -33,6 +33,9 @@ export const HomeSkeleton = memo(function HomeSkeleton() {
33
33
  );
34
34
  });
35
35
 
36
+ /** As on Twig, a home page with no blocks lists the store's latest products instead. */
37
+ const LATEST_PRODUCTS: HomeComponentData = { path: 'latest-products' };
38
+
36
39
  /** The blocks' places in the store's order: 0, 1, 2… */
37
40
  const storeOrder = (blocks: readonly unknown[]) => Array.from(blocks, (_, at) => at);
38
41
 
@@ -71,6 +74,9 @@ export const HomePage = memo(function HomePage({ components = [] }: HomePageProp
71
74
  // a move keeps its state; a dev layout block keeps its own id.
72
75
  return <HomeComponentRenderer key={data.__dev_id ?? at} data={data} index={index} />;
73
76
  })}
77
+ {!renderedComponents.length && (
78
+ <HomeComponentRenderer data={LATEST_PRODUCTS} index={0} editable={false} />
79
+ )}
74
80
  <HookSlot name="home:end" />
75
81
  <ReorderProducts />
76
82
  </>
@@ -63,22 +63,52 @@ const readServerCookieToken = createIsomorphicFn()
63
63
  })
64
64
  .client((): string | null => null);
65
65
 
66
+ /**
67
+ * The market the settings were answered for, when the request asked with another one and
68
+ * its address did not switch market; null otherwise.
69
+ *
70
+ * That is a market's own domain (`us.store.com`): the API serves the market the domain is
71
+ * pinned to, whatever the `scope` cookie remembers from an earlier visit. The page has to
72
+ * take that market over, or the SDK keeps sending the remembered one and creates the
73
+ * guest's cart in it, which every request answered for the domain's market then refuses
74
+ * (TD-17588). A request that asked with no scope has nothing stale to correct. The branch
75
+ * is dropped with the market it belonged to; the type is store-wide, so it is the
76
+ * answer's, else the requested one.
77
+ */
78
+ export function hostPinnedScope(
79
+ url: string,
80
+ requested: ActiveScope | null,
81
+ settings: StoreContext
82
+ ): ActiveScope | null {
83
+ if (!requested || extractScopeFromUrl(url)) return null;
84
+ const answered = settings.store?.scope;
85
+ if (answered?.id == null || String(answered.id) === requested.id) return null;
86
+ const type = answered.type ?? requested.type;
87
+ return type ? { id: String(answered.id), type } : { id: String(answered.id) };
88
+ }
89
+
66
90
  /**
67
91
  * The scope to write to the `scope` cookie for this request, or null to leave the cookie
68
92
  * as it is.
69
93
  *
70
- * Only for a market a `?scope=` URL switched to, and only when the settings were answered
71
- * for it: the API falls back to another market when it does not accept the requested one,
72
- * and Twig keeps the previous choice then too, rather than recording one the page is not
73
- * showing. Its type is the one the settings answered with: a URL names only the id, and
74
- * the store-wide type is assumed until the answer says otherwise (a store browsing by
75
- * branch or city), so later requests send the type the API matches against.
94
+ * The market a market's own domain answered with, over a remembered one; see
95
+ * {@link hostPinnedScope}.
96
+ *
97
+ * Otherwise only for a market a `?scope=` URL switched to, and only when the settings were
98
+ * answered for it: the API falls back to another market when it does not accept the
99
+ * requested one, and Twig keeps the previous choice then too, rather than recording one
100
+ * the page is not showing. Its type is the one the settings answered with: a URL names
101
+ * only the id, and the store-wide type is assumed until the answer says otherwise (a
102
+ * store browsing by branch or city), so later requests send the type the API matches
103
+ * against.
76
104
  */
77
105
  export function scopeCookieUpdate(
78
106
  url: string,
79
107
  cookieHeader: string | null,
80
108
  settings: StoreContext
81
109
  ): ActiveScope | null {
110
+ const pinned = hostPinnedScope(url, extractScopeFromCookies(cookieHeader), settings);
111
+ if (pinned) return pinned;
82
112
  if (!extractScopeFromUrl(url)) return null;
83
113
  const scope = resolveRequestScope(url, cookieHeader);
84
114
  const answered = settings.store?.scope;
@@ -87,27 +117,41 @@ export function scopeCookieUpdate(
87
117
  return sameScope(extractScopeFromCookies(cookieHeader), typed) ? null : typed;
88
118
  }
89
119
 
120
+ /** The request's scope with the type its settings answered with, or null when that changes nothing. */
121
+ function withAnsweredType(scope: ActiveScope | null, settings: StoreContext): ActiveScope | null {
122
+ const answered = settings.store?.scope;
123
+ if (!scope || !answered?.type || String(answered.id) !== scope.id) return null;
124
+ return answered.type === scope.type ? null : { ...scope, type: answered.type };
125
+ }
126
+
90
127
  /**
91
- * Gives the request's scope the type its settings answered with, for the rest of this
92
- * render, and files the settings and ads under the key the corrected scope makes, so the browser
93
- * — which reads the corrected scope from the cookie (see {@link scopeCookieUpdate}) — finds
94
- * them dehydrated instead of fetching them again. The entry under the assumed type's key
95
- * is removed, so the page carries them once. Server-only; a no-op when the type
96
- * already matches or the settings answered another scope.
128
+ * Gives the request the scope its settings answered with, for the rest of this render:
129
+ * the market a market's own domain is pinned to when the request asked with another (see
130
+ * {@link hostPinnedScope}; only with the page `url`), else the same scope with the type
131
+ * the answer named. Files the settings and ads under the key the corrected scope makes, so
132
+ * the browser — which reads the corrected scope from the cookie (see
133
+ * {@link scopeCookieUpdate}) — finds them dehydrated instead of fetching them again. The
134
+ * entry under the assumed scope's key is removed, so the page carries them once.
135
+ * Server-only; a no-op when there is nothing to correct.
97
136
  */
98
- export function alignRequestScopeType(queryClient: QueryClient, settings: StoreContext): void {
137
+ export function alignRequestScope(
138
+ queryClient: QueryClient,
139
+ settings: StoreContext,
140
+ url?: string
141
+ ): void {
99
142
  let scope: ActiveScope | null;
100
143
  try {
101
144
  scope = getTwilightContext().scope;
102
145
  } catch {
103
146
  return;
104
147
  }
105
- const answered = settings.store?.scope;
106
- if (!scope || !answered?.type || String(answered.id) !== scope.id) return;
107
- if (answered.type === scope.type) return;
148
+ const aligned =
149
+ (url === undefined ? null : hostPinnedScope(url, scope, settings)) ??
150
+ withAnsweredType(scope, settings);
151
+ if (!aligned) return;
108
152
  const assumedKey = storeApi.queries.settings().queryKey;
109
153
  const assumedAdsKey = advertisement.queries.list().queryKey;
110
- updateTwilightContext({ scope: { ...scope, type: answered.type } });
154
+ updateTwilightContext({ scope: aligned });
111
155
  queryClient.setQueryData(storeApi.queries.settings().queryKey, settings);
112
156
  // Moved, not copied: both would be dehydrated, sending the settings twice.
113
157
  queryClient.removeQueries({ queryKey: assumedKey, exact: true });
@@ -191,10 +235,21 @@ export function resolveMaintenance(href: string, settings: StoreContext): boolea
191
235
  return showsMaintenancePage(settings, viewAsOwner, currentHost());
192
236
  }
193
237
 
194
- /** On the server, once the settings are in: {@link alignRequestScopeType}, then {@link persistRequestScope}. */
238
+ /** The URL of the request being rendered; null outside one (a prerender) and in the browser. */
239
+ const serverRequestUrl = createIsomorphicFn()
240
+ .server((): string | null => {
241
+ try {
242
+ return String(getRequestUrl());
243
+ } catch {
244
+ return null;
245
+ }
246
+ })
247
+ .client((): string | null => null);
248
+
249
+ /** On the server, once the settings are in: {@link alignRequestScope}, then {@link persistRequestScope}. */
195
250
  function settleRequestScope(queryClient: QueryClient, settings: StoreContext): void {
196
251
  if (typeof window !== 'undefined') return;
197
- alignRequestScopeType(queryClient, settings);
252
+ alignRequestScope(queryClient, settings, serverRequestUrl() ?? undefined);
198
253
  persistRequestScope(settings);
199
254
  }
200
255