@salla.sa/twilight-theme-engine 1.0.23 → 1.0.24
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-5P2QQGOG.js → AddToCartForm-RPBBQKPK.js} +3 -3
- package/dist/{AddToCartForm-5P2QQGOG.js.map → AddToCartForm-RPBBQKPK.js.map} +1 -1
- package/dist/{BlogAuthorPage-QJLGMSK3.js → BlogAuthorPage-TVFUV56M.js} +15 -13
- package/dist/BlogAuthorPage-TVFUV56M.js.map +1 -0
- package/dist/{BlogCategoryPage-H7VYN7OV.js → BlogCategoryPage-IJUXUKS7.js} +15 -13
- package/dist/BlogCategoryPage-IJUXUKS7.js.map +1 -0
- package/dist/{BlogPage-LWAQ6ZVO.js → BlogPage-PRQXQDUH.js} +13 -11
- package/dist/BlogPage-PRQXQDUH.js.map +1 -0
- package/dist/{BlogSinglePage-DMAMK26P.js → BlogSinglePage-FMFV7W3Z.js} +13 -11
- package/dist/BlogSinglePage-FMFV7W3Z.js.map +1 -0
- package/dist/{BlogTagPage-6URVT6AD.js → BlogTagPage-HTGO6BSN.js} +15 -13
- package/dist/BlogTagPage-HTGO6BSN.js.map +1 -0
- package/dist/{BrandsPage-AANQU2O3.js → BrandsPage-U35JXHJR.js} +13 -11
- package/dist/BrandsPage-U35JXHJR.js.map +1 -0
- package/dist/{Breadcrumb-UAMFZYT6.js → Breadcrumb-MMZI72KB.js} +13 -11
- package/dist/Breadcrumb-MMZI72KB.js.map +1 -0
- package/dist/{CartItem-3677CNHU.js → CartItem-QT2MDGJW.js} +13 -11
- package/dist/CartItem-QT2MDGJW.js.map +1 -0
- package/dist/{CartSummary-BJJNE6C5.js → CartSummary-DYGLRM55.js} +13 -11
- package/dist/CartSummary-DYGLRM55.js.map +1 -0
- package/dist/{Copyright-DHEUTAZQ.js → Copyright-IJC4R2EC.js} +3 -3
- package/dist/{Copyright-DHEUTAZQ.js.map → Copyright-IJC4R2EC.js.map} +1 -1
- package/dist/{CustomerLayout-SG2CUIJU.js → CustomerLayout-GJVHZWIJ.js} +13 -11
- package/dist/CustomerLayout-GJVHZWIJ.js.map +1 -0
- package/dist/{Footer-OHHHBUAR.js → Footer-B2NQD5SY.js} +13 -11
- package/dist/{Footer-OHHHBUAR.js.map → Footer-B2NQD5SY.js.map} +1 -1
- package/dist/{Header-NIEPJXYE.js → Header-4BVMG3XU.js} +6 -6
- package/dist/{Header-NIEPJXYE.js.map → Header-4BVMG3XU.js.map} +1 -1
- package/dist/{LoyaltyPage-YBVHG57L.js → LoyaltyPage-5BRVSONO.js} +14 -12
- package/dist/LoyaltyPage-5BRVSONO.js.map +1 -0
- package/dist/{MainMenu-U6WGGXHK.js → MainMenu-G2UOWOOA.js} +7 -7
- package/dist/{MainMenu-U6WGGXHK.js.map → MainMenu-G2UOWOOA.js.map} +1 -1
- package/dist/{MasterLayout-YOBUFJNN.js → MasterLayout-5ICJO4UO.js} +13 -11
- package/dist/{MasterLayout-YOBUFJNN.js.map → MasterLayout-5ICJO4UO.js.map} +1 -1
- package/dist/{MobileMenu-DNMUVXPY.js → MobileMenu-HLOHDYMD.js} +14 -12
- package/dist/MobileMenu-HLOHDYMD.js.map +1 -0
- package/dist/{NotificationsPage-X7PIHUNY.js → NotificationsPage-6EWGCPYG.js} +13 -11
- package/dist/NotificationsPage-6EWGCPYG.js.map +1 -0
- package/dist/{OrderSinglePage-E7SXRGRF.js → OrderSinglePage-6XI6DREN.js} +14 -12
- package/dist/OrderSinglePage-6XI6DREN.js.map +1 -0
- package/dist/{OrdersPage-G6HBVJKI.js → OrdersPage-RNOQQBIY.js} +14 -12
- package/dist/OrdersPage-RNOQQBIY.js.map +1 -0
- package/dist/{PageSingle-PVGXNR42.js → PageSingle-XIHQ5WLE.js} +3 -3
- package/dist/{PageSingle-PVGXNR42.js.map → PageSingle-XIHQ5WLE.js.map} +1 -1
- package/dist/{ProductDetails-XG26QCTN.js → ProductDetails-2N6XFO3N.js} +3 -3
- package/dist/{ProductDetails-XG26QCTN.js.map → ProductDetails-2N6XFO3N.js.map} +1 -1
- package/dist/{ProfilePage-6QDPXYNR.js → ProfilePage-M4D55XUW.js} +13 -11
- package/dist/ProfilePage-M4D55XUW.js.map +1 -0
- package/dist/{SeoCartWidget-GR6PYXDP.js → SeoCartWidget-QUYOXYUG.js} +13 -11
- package/dist/SeoCartWidget-QUYOXYUG.js.map +1 -0
- package/dist/{SettingsPage-2OVEIVCT.js → SettingsPage-5VXVGDGN.js} +13 -11
- package/dist/SettingsPage-5VXVGDGN.js.map +1 -0
- package/dist/{StoreClosedNotification-NU5QC2TG.js → StoreClosedNotification-FFCHNXJC.js} +14 -12
- package/dist/{StoreClosedNotification-NU5QC2TG.js.map → StoreClosedNotification-FFCHNXJC.js.map} +1 -1
- package/dist/{TestimonialsPage-4UJWE4X4.js → TestimonialsPage-7JP3OLAU.js} +3 -3
- package/dist/{TestimonialsPage-4UJWE4X4.js.map → TestimonialsPage-7JP3OLAU.js.map} +1 -1
- package/dist/{ThankYouPage-5IDWYLTL.js → ThankYouPage-6WFBFJQE.js} +13 -11
- package/dist/ThankYouPage-6WFBFJQE.js.map +1 -0
- package/dist/{WalletPage-MQR4UAMN.js → WalletPage-PQUO54K7.js} +14 -12
- package/dist/WalletPage-PQUO54K7.js.map +1 -0
- package/dist/{WishlistPage-4YADKHYB.js → WishlistPage-XHJDEZCY.js} +14 -12
- package/dist/WishlistPage-XHJDEZCY.js.map +1 -0
- package/dist/api/apps.d.ts +40 -10
- package/dist/api/apps.d.ts.map +1 -1
- package/dist/api/apps.js +4 -22
- package/dist/api/apps.js.map +1 -1
- package/dist/api/brands.js +5 -5
- package/dist/api/cart.js +5 -5
- package/dist/api/category.js +5 -5
- package/dist/api/client.d.ts +6 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +3 -3
- package/dist/api/home.js +4 -4
- package/dist/api/loyalty.js +5 -5
- package/dist/api/menu.js +4 -4
- package/dist/api/notification.js +4 -4
- package/dist/api/order.js +5 -5
- package/dist/api/page.js +5 -5
- package/dist/api/product.js +5 -5
- package/dist/api/profile.js +3 -3
- package/dist/api/store.js +4 -4
- package/dist/api/translations.js +4 -4
- package/dist/api/user.js +4 -4
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-QQGFEBYP.js → chunk-2FDMBW2G.js} +3 -3
- package/dist/{chunk-QQGFEBYP.js.map → chunk-2FDMBW2G.js.map} +1 -1
- package/dist/{chunk-A5XHG5DY.js → chunk-2JHVZBQ7.js} +3 -3
- package/dist/{chunk-A5XHG5DY.js.map → chunk-2JHVZBQ7.js.map} +1 -1
- package/dist/{chunk-FUH74TV3.js → chunk-2WNYE75P.js} +39 -4
- package/dist/chunk-2WNYE75P.js.map +1 -0
- package/dist/{chunk-PASKA2UT.js → chunk-4EHNAFYR.js} +4 -4
- package/dist/{chunk-PASKA2UT.js.map → chunk-4EHNAFYR.js.map} +1 -1
- package/dist/{chunk-OY3VMBTA.js → chunk-53AXOEUK.js} +4 -4
- package/dist/{chunk-OY3VMBTA.js.map → chunk-53AXOEUK.js.map} +1 -1
- package/dist/{chunk-MSBPOHMV.js → chunk-6V45LHKF.js} +7 -7
- package/dist/{chunk-MSBPOHMV.js.map → chunk-6V45LHKF.js.map} +1 -1
- package/dist/{chunk-FXXATUWJ.js → chunk-ABKWUNWF.js} +5 -5
- package/dist/{chunk-FXXATUWJ.js.map → chunk-ABKWUNWF.js.map} +1 -1
- package/dist/{chunk-VOTDCMG3.js → chunk-AY6KRPHL.js} +3 -3
- package/dist/{chunk-VOTDCMG3.js.map → chunk-AY6KRPHL.js.map} +1 -1
- package/dist/{chunk-R5VMDBV2.js → chunk-BR26I5WV.js} +4 -4
- package/dist/{chunk-R5VMDBV2.js.map → chunk-BR26I5WV.js.map} +1 -1
- package/dist/chunk-E2FO6OSL.js +136 -0
- package/dist/chunk-E2FO6OSL.js.map +1 -0
- package/dist/{chunk-MD35JQVL.js → chunk-EGXKYLBD.js} +4 -4
- package/dist/{chunk-MD35JQVL.js.map → chunk-EGXKYLBD.js.map} +1 -1
- package/dist/{chunk-HPR6QACC.js → chunk-EXYGVSRB.js} +3 -3
- package/dist/{chunk-HPR6QACC.js.map → chunk-EXYGVSRB.js.map} +1 -1
- package/dist/{chunk-KOVPH7TW.js → chunk-F7TFLW56.js} +5 -4
- package/dist/chunk-F7TFLW56.js.map +1 -0
- package/dist/{chunk-Y73ZOE3I.js → chunk-FALZ7SZO.js} +4 -4
- package/dist/{chunk-Y73ZOE3I.js.map → chunk-FALZ7SZO.js.map} +1 -1
- package/dist/{chunk-2PWN27HQ.js → chunk-GVMWHNQ5.js} +4 -4
- package/dist/{chunk-2PWN27HQ.js.map → chunk-GVMWHNQ5.js.map} +1 -1
- package/dist/{chunk-RW2WZ4BN.js → chunk-LP3IE6UV.js} +4 -4
- package/dist/{chunk-RW2WZ4BN.js.map → chunk-LP3IE6UV.js.map} +1 -1
- package/dist/{chunk-POU6ARSQ.js → chunk-LSR4FTZJ.js} +4 -4
- package/dist/{chunk-POU6ARSQ.js.map → chunk-LSR4FTZJ.js.map} +1 -1
- package/dist/{chunk-2WBVZR4E.js → chunk-LUFVVUWZ.js} +4 -4
- package/dist/{chunk-2WBVZR4E.js.map → chunk-LUFVVUWZ.js.map} +1 -1
- package/dist/{chunk-BH6NMIAK.js → chunk-MAYB5543.js} +116 -13
- package/dist/chunk-MAYB5543.js.map +1 -0
- package/dist/{chunk-X4Z6MIBG.js → chunk-MLJS3VEC.js} +6 -6
- package/dist/{chunk-X4Z6MIBG.js.map → chunk-MLJS3VEC.js.map} +1 -1
- package/dist/{chunk-DFIZHPDP.js → chunk-NUPOX7ID.js} +4 -4
- package/dist/{chunk-DFIZHPDP.js.map → chunk-NUPOX7ID.js.map} +1 -1
- package/dist/{chunk-DA43QUYK.js → chunk-NXM2FQJ7.js} +3 -3
- package/dist/{chunk-DA43QUYK.js.map → chunk-NXM2FQJ7.js.map} +1 -1
- package/dist/chunk-O36J2QLP.js +14 -0
- package/dist/{chunk-W64WJKTH.js.map → chunk-O36J2QLP.js.map} +1 -1
- package/dist/{chunk-WI7TR7RK.js → chunk-OPKTJIZQ.js} +10 -2
- package/dist/chunk-OPKTJIZQ.js.map +1 -0
- package/dist/{chunk-ZBTCQZVO.js → chunk-PQNPO2J3.js} +3 -3
- package/dist/{chunk-ZBTCQZVO.js.map → chunk-PQNPO2J3.js.map} +1 -1
- package/dist/{chunk-2CRMGVH6.js → chunk-Q5DFI4WQ.js} +3 -3
- package/dist/{chunk-2CRMGVH6.js.map → chunk-Q5DFI4WQ.js.map} +1 -1
- package/dist/{chunk-DIKZRWOS.js → chunk-QAZXUVOA.js} +4 -4
- package/dist/{chunk-DIKZRWOS.js.map → chunk-QAZXUVOA.js.map} +1 -1
- package/dist/{chunk-EEYZYG36.js → chunk-QMT3KQ3V.js} +4 -4
- package/dist/{chunk-EEYZYG36.js.map → chunk-QMT3KQ3V.js.map} +1 -1
- package/dist/{chunk-4BH3L5ZI.js → chunk-SBDHJUNI.js} +3 -3
- package/dist/{chunk-4BH3L5ZI.js.map → chunk-SBDHJUNI.js.map} +1 -1
- package/dist/{chunk-UXCLRJ3Q.js → chunk-SQCDRDPH.js} +6 -6
- package/dist/{chunk-UXCLRJ3Q.js.map → chunk-SQCDRDPH.js.map} +1 -1
- package/dist/{chunk-TFDN2SKC.js → chunk-U3S6RFYL.js} +3 -3
- package/dist/{chunk-TFDN2SKC.js.map → chunk-U3S6RFYL.js.map} +1 -1
- package/dist/chunk-ULAPZSHY.js +44 -0
- package/dist/chunk-ULAPZSHY.js.map +1 -0
- package/dist/{chunk-KN6YUQ6L.js → chunk-UNGQL6AB.js} +3 -3
- package/dist/{chunk-KN6YUQ6L.js.map → chunk-UNGQL6AB.js.map} +1 -1
- package/dist/{chunk-7P3CT2PM.js → chunk-UQ2MAJXN.js} +14 -4
- package/dist/chunk-UQ2MAJXN.js.map +1 -0
- package/dist/{chunk-QHDMWYJO.js → chunk-URH4CDTN.js} +4 -4
- package/dist/{chunk-QHDMWYJO.js.map → chunk-URH4CDTN.js.map} +1 -1
- package/dist/{chunk-H3QMQIKP.js → chunk-VIRPVAK3.js} +3 -3
- package/dist/{chunk-H3QMQIKP.js.map → chunk-VIRPVAK3.js.map} +1 -1
- package/dist/{chunk-IIQKLIII.js → chunk-WPJEVWKC.js} +247 -156
- package/dist/chunk-WPJEVWKC.js.map +1 -0
- package/dist/{chunk-ODXQLAF4.js → chunk-YY2CTLTJ.js} +5 -5
- package/dist/{chunk-ODXQLAF4.js.map → chunk-YY2CTLTJ.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +11 -9
- package/dist/components/home/index.js +14 -12
- package/dist/components/layout/index.js +5 -5
- package/dist/components/product/index.js +12 -10
- package/dist/components/snippets/AppsSnippets.d.ts +18 -0
- package/dist/components/snippets/AppsSnippets.d.ts.map +1 -0
- package/dist/components/snippets/index.d.ts +2 -0
- package/dist/components/snippets/index.d.ts.map +1 -0
- package/dist/components/store/index.js +13 -11
- package/dist/components/store/index.js.map +1 -1
- package/dist/document-class-XCYIBISX.js +23 -0
- package/dist/{document-class-224GXQZQ.js.map → document-class-XCYIBISX.js.map} +1 -1
- package/dist/hooks/index.js +11 -9
- package/dist/hooks/useGtm.js +11 -9
- package/dist/hooks/useMoney.js +11 -9
- package/dist/hooks/useStore.js +11 -9
- package/dist/hooks/useUser.js +5 -5
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/{navigation-SXCM653S.js → navigation-WMJ77B6H.js} +4 -4
- package/dist/{navigation-SXCM653S.js.map → navigation-WMJ77B6H.js.map} +1 -1
- package/dist/{navigation-B6FATNWM.js → navigation-WXELHHVJ.js} +5 -5
- package/dist/{navigation-B6FATNWM.js.map → navigation-WXELHHVJ.js.map} +1 -1
- package/dist/{not-found-EMPUSRN4.js → not-found-AO2ZXILV.js} +13 -11
- package/dist/not-found-AO2ZXILV.js.map +1 -0
- package/dist/providers/TwilightProvider.d.ts.map +1 -1
- package/dist/providers/index.js +11 -9
- package/dist/routes/account/orders.js +6 -6
- package/dist/routes/account.js +14 -14
- package/dist/routes/blog.js +10 -10
- package/dist/routes/brands.js +6 -6
- package/dist/routes/cart.js +19 -17
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +16 -14
- package/dist/routes/index.js +3 -3
- package/dist/routes/loyalty.js +6 -6
- package/dist/routes/page.js +6 -6
- package/dist/routes/product-listing.js +16 -14
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +14 -12
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/root/beforeLoad.d.ts +7 -0
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/root/head.d.ts +14 -0
- package/dist/routes/root/head.d.ts.map +1 -1
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +6 -6
- package/dist/skeleton.js +16 -14
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack.js +14 -12
- package/dist/tanstack.js.map +1 -1
- package/dist/twilight/context.d.ts +7 -0
- package/dist/twilight/context.d.ts.map +1 -1
- package/dist/twilight/ensure-context.d.ts.map +1 -1
- package/dist/types/salla-sdk.d.ts +15 -0
- package/dist/types/salla-sdk.d.ts.map +1 -1
- package/dist/utils/app-scope.d.ts +46 -0
- package/dist/utils/app-scope.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/inline-script.d.ts +8 -0
- package/dist/utils/inline-script.d.ts.map +1 -0
- package/dist/utils/runtime-env.d.ts +34 -0
- package/dist/utils/runtime-env.d.ts.map +1 -0
- package/dist/utils/sdk-helpers.d.ts +4 -2
- package/dist/utils/sdk-helpers.d.ts.map +1 -1
- package/dist/utils/theme-hook-slots.d.ts +36 -0
- package/dist/utils/theme-hook-slots.d.ts.map +1 -0
- package/dist/vite/index.js +2 -2
- package/package.json +1 -1
- package/dist/BlogAuthorPage-QJLGMSK3.js.map +0 -1
- package/dist/BlogCategoryPage-H7VYN7OV.js.map +0 -1
- package/dist/BlogPage-LWAQ6ZVO.js.map +0 -1
- package/dist/BlogSinglePage-DMAMK26P.js.map +0 -1
- package/dist/BlogTagPage-6URVT6AD.js.map +0 -1
- package/dist/BrandsPage-AANQU2O3.js.map +0 -1
- package/dist/Breadcrumb-UAMFZYT6.js.map +0 -1
- package/dist/CartItem-3677CNHU.js.map +0 -1
- package/dist/CartSummary-BJJNE6C5.js.map +0 -1
- package/dist/CustomerLayout-SG2CUIJU.js.map +0 -1
- package/dist/LoyaltyPage-YBVHG57L.js.map +0 -1
- package/dist/MobileMenu-DNMUVXPY.js.map +0 -1
- package/dist/NotificationsPage-X7PIHUNY.js.map +0 -1
- package/dist/OrderSinglePage-E7SXRGRF.js.map +0 -1
- package/dist/OrdersPage-G6HBVJKI.js.map +0 -1
- package/dist/ProfilePage-6QDPXYNR.js.map +0 -1
- package/dist/SeoCartWidget-GR6PYXDP.js.map +0 -1
- package/dist/SettingsPage-2OVEIVCT.js.map +0 -1
- package/dist/ThankYouPage-5IDWYLTL.js.map +0 -1
- package/dist/WalletPage-MQR4UAMN.js.map +0 -1
- package/dist/WishlistPage-4YADKHYB.js.map +0 -1
- package/dist/chunk-7P3CT2PM.js.map +0 -1
- package/dist/chunk-BH6NMIAK.js.map +0 -1
- package/dist/chunk-FUH74TV3.js.map +0 -1
- package/dist/chunk-IIQKLIII.js.map +0 -1
- package/dist/chunk-KOVPH7TW.js.map +0 -1
- package/dist/chunk-W64WJKTH.js +0 -14
- package/dist/chunk-WI7TR7RK.js.map +0 -1
- package/dist/document-class-224GXQZQ.js +0 -21
- package/dist/not-found-EMPUSRN4.js.map +0 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ErrorPage } from './chunk-Z4Y55HWX.js';
|
|
2
|
-
import { ensureTwilightContextFromMatches, tanstackHeadAdapter } from './chunk-
|
|
3
|
-
import { dispatchRouteChanged } from './chunk-
|
|
2
|
+
import { ensureTwilightContextFromMatches, tanstackHeadAdapter } from './chunk-UQ2MAJXN.js';
|
|
3
|
+
import { dispatchRouteChanged } from './chunk-Q5DFI4WQ.js';
|
|
4
4
|
import { resolveHead, mergeHead, setHeadAdapter } from './chunk-B3EFOE57.js';
|
|
5
|
-
import { store } from './chunk-
|
|
6
|
-
import { translations } from './chunk-
|
|
5
|
+
import { store } from './chunk-LP3IE6UV.js';
|
|
6
|
+
import { translations } from './chunk-EXYGVSRB.js';
|
|
7
7
|
import { buildBaseHead } from './chunk-TZ3E5BN4.js';
|
|
8
|
-
import {
|
|
8
|
+
import { apps } from './chunk-ULAPZSHY.js';
|
|
9
|
+
import { renderThemeHookSlotsScript, renderAppScopeInstallScript } from './chunk-E2FO6OSL.js';
|
|
10
|
+
import { RedirectError, NotFoundError, UnauthorizedError } from './chunk-PQNPO2J3.js';
|
|
9
11
|
import { RouteId } from './chunk-MTONGOJD.js';
|
|
10
|
-
import { AUTH_TOKEN_COOKIE_NAME, syncSdkLocale, syncScopeCookie, extractTokenFromCookies } from './chunk-
|
|
11
|
-
import { getTwilightContext, SettingsError, updateTwilightContext, createI18nInstance } from './chunk-
|
|
12
|
+
import { AUTH_TOKEN_COOKIE_NAME, renderRuntimeEnvScript, escapeForInlineScript, readEnv, syncSdkLocale, syncScopeCookie, extractTokenFromCookies } from './chunk-2WNYE75P.js';
|
|
13
|
+
import { getTwilightContext, SettingsError, updateTwilightContext, createI18nInstance } from './chunk-OPKTJIZQ.js';
|
|
12
14
|
import { useDocumentClass } from './chunk-JWXJPJBO.js';
|
|
13
15
|
import { toReactProps, mergeElementAttrs } from './chunk-CW625T2E.js';
|
|
14
16
|
import { FALLBACK_LOCALE, getLanguageInfo } from './chunk-T72DAX7R.js';
|
|
@@ -37,10 +39,29 @@ async function rootBeforeLoad(ctx) {
|
|
|
37
39
|
updateTwilightContext({ locale });
|
|
38
40
|
syncSdkLocale(locale);
|
|
39
41
|
syncScopeCookie();
|
|
40
|
-
const [settingsResult, translationsResult] = await Promise.all(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const [settingsResult, translationsResult, snippetsResult, appSettingsResult] = await Promise.all(
|
|
43
|
+
[
|
|
44
|
+
ctx.context.queryClient.ensureQueryData(store.queries.settings()),
|
|
45
|
+
ctx.context.queryClient.ensureQueryData(translations.queries.byLocale()),
|
|
46
|
+
// Snippets → SSR CDN <script> tags (AppsSnippets.ssrCdnScripts). Non-fatal + logged:
|
|
47
|
+
// on failure AppsSnippets falls back to its own client-side query for the same data,
|
|
48
|
+
// so the tags render a paint later instead of being lost for the page load.
|
|
49
|
+
ctx.context.queryClient.ensureQueryData(apps.queries.snippets()).catch((error) => {
|
|
50
|
+
console.warn("[salla] apps/snippets prefetch failed; rendering no CDN snippet tags", error);
|
|
51
|
+
return void 0;
|
|
52
|
+
}),
|
|
53
|
+
// Buckets → rootHead installs `Salla.appScope` inline in the SSR head (before any snippet
|
|
54
|
+
// onReady runs). Non-fatal + logged: the head installs the factory either way, and the
|
|
55
|
+
// client query seeds the buckets into that install once it resolves.
|
|
56
|
+
ctx.context.queryClient.ensureQueryData(apps.queries.settings()).catch((error) => {
|
|
57
|
+
console.warn(
|
|
58
|
+
"[salla] apps/snippets/settings prefetch failed; appScope buckets unseeded",
|
|
59
|
+
error
|
|
60
|
+
);
|
|
61
|
+
return void 0;
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
);
|
|
44
65
|
if (!settingsResult) {
|
|
45
66
|
throw new SettingsError("Failed to load store settings. Make sure VITE_STORE_DOMAIN is set.");
|
|
46
67
|
}
|
|
@@ -61,13 +82,17 @@ async function rootBeforeLoad(ctx) {
|
|
|
61
82
|
locale,
|
|
62
83
|
location: ctx.location,
|
|
63
84
|
i18n,
|
|
64
|
-
authToken
|
|
85
|
+
authToken,
|
|
86
|
+
appsSnippets: snippetsResult,
|
|
87
|
+
appsSettings: appSettingsResult
|
|
65
88
|
});
|
|
66
89
|
return {
|
|
67
90
|
settings: settingsResult,
|
|
68
91
|
locale,
|
|
69
92
|
dir,
|
|
70
|
-
authToken
|
|
93
|
+
authToken,
|
|
94
|
+
appsSnippets: snippetsResult,
|
|
95
|
+
appsSettings: appSettingsResult
|
|
71
96
|
};
|
|
72
97
|
}
|
|
73
98
|
|
|
@@ -75,17 +100,19 @@ async function rootBeforeLoad(ctx) {
|
|
|
75
100
|
var SALLA_ICONS_CSS_URL = "https://cdn.assets.salla.network/static/fonts/sallaicons.css?v=2.0.5";
|
|
76
101
|
var LIT_VERSION = "3.3.3";
|
|
77
102
|
var LIT_CDN_BASE = `https://cdn.assets.salla.network/static/lit/${LIT_VERSION}`;
|
|
103
|
+
var LIT_IMPORTS = {
|
|
104
|
+
lit: `${LIT_CDN_BASE}/lit.js`,
|
|
105
|
+
"lit/": `${LIT_CDN_BASE}/`,
|
|
106
|
+
"lit-html": `${LIT_CDN_BASE}/lit-html/lit-html.js`,
|
|
107
|
+
"lit-html/": `${LIT_CDN_BASE}/lit-html/`,
|
|
108
|
+
"lit-element": `${LIT_CDN_BASE}/lit-element/lit-element.js`,
|
|
109
|
+
"lit-element/": `${LIT_CDN_BASE}/lit-element/`,
|
|
110
|
+
"@lit/reactive-element": `${LIT_CDN_BASE}/reactive-element/reactive-element.js`,
|
|
111
|
+
"@lit/reactive-element/": `${LIT_CDN_BASE}/reactive-element/`
|
|
112
|
+
};
|
|
78
113
|
var TWILIGHT_RELEASE_CDN = "https://cdn.salla.network/js/twilight";
|
|
79
114
|
var TWILIGHT_DEV_CDN = "https://cdn.assets.salla.network/dev/@salla.sa/twilight";
|
|
80
115
|
var DEFAULT_TWILIGHT_SDK_URL = `${TWILIGHT_DEV_CDN}/9b1ad668bb386735f64a045e4c13b4c5508ad4c8/twilight.esm.js`;
|
|
81
|
-
function readEnv(key) {
|
|
82
|
-
try {
|
|
83
|
-
const vite = import.meta.env?.[key];
|
|
84
|
-
if (vite) return vite;
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
87
|
-
return typeof process !== "undefined" ? process.env?.[key] : void 0;
|
|
88
|
-
}
|
|
89
116
|
function resolveTwilightSdkUrl(settings) {
|
|
90
117
|
const urlOverride = readEnv("VITE_TWILIGHT_URL");
|
|
91
118
|
if (urlOverride) return urlOverride;
|
|
@@ -104,7 +131,6 @@ var LOADING_CSS = `
|
|
|
104
131
|
@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
|
|
105
132
|
html,body{margin:0;padding:0;height:100%}
|
|
106
133
|
`.trim();
|
|
107
|
-
var escapeForInlineScript = (value) => value.replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
108
134
|
var SALLA_INIT_SCRIPT = `
|
|
109
135
|
window.salla = window.Salla = window.Salla || window.salla || {};
|
|
110
136
|
window.Salla.onReady = window.Salla.onReady || function(callback) {
|
|
@@ -120,6 +146,22 @@ window.Salla.onReady = window.Salla.onReady || function(callback) {
|
|
|
120
146
|
});
|
|
121
147
|
};
|
|
122
148
|
`.trim();
|
|
149
|
+
function snippetPreconnectOrigins(snippets) {
|
|
150
|
+
if (!snippets?.length) return [];
|
|
151
|
+
const origins = /* @__PURE__ */ new Set();
|
|
152
|
+
for (const app of snippets) {
|
|
153
|
+
if (app.status !== "enabled") continue;
|
|
154
|
+
for (const s of app.snippets) {
|
|
155
|
+
if (!s.url) continue;
|
|
156
|
+
try {
|
|
157
|
+
origins.add(new URL(s.url).origin);
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
if (origins.size >= 4) return [...origins];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return [...origins];
|
|
164
|
+
}
|
|
123
165
|
function rootHead(ctx) {
|
|
124
166
|
ensureTwilightContextFromMatches(ctx.matches);
|
|
125
167
|
let settings;
|
|
@@ -134,140 +176,185 @@ function rootHead(ctx) {
|
|
|
134
176
|
throw e;
|
|
135
177
|
}
|
|
136
178
|
const locale = ctx.params.locale || FALLBACK_LOCALE;
|
|
137
|
-
const
|
|
138
|
-
const fontUrl = settings?.theme?.font?.url || settings?.theme?.font?.path;
|
|
139
|
-
const fontUrlWithDisplay = fontUrl?.includes("fonts.googleapis.com") && !fontUrl.includes("display=") ? `${fontUrl}${fontUrl.includes("?") ? "&" : "?"}display=swap` : fontUrl;
|
|
140
|
-
const favicon = store2?.icon;
|
|
141
|
-
const primaryColor = settings?.theme?.color?.primary;
|
|
142
|
-
const twilightSdkUrl = resolveTwilightSdkUrl(settings);
|
|
143
|
-
const isGoogleFont = fontUrl?.includes("fonts.googleapis.com");
|
|
144
|
-
const fontFamilyName = settings?.theme?.font?.family_name;
|
|
145
|
-
const customization = settings?.theme?.customization;
|
|
146
|
-
const customJs = customization?.js?.trim();
|
|
147
|
-
const customCss = customization?.css?.trim();
|
|
148
|
-
const isCustomCssUrl = customCss?.startsWith("http") || customCss?.startsWith("//");
|
|
149
|
-
const isCustomJsUrl = customJs?.startsWith("http") || customJs?.startsWith("//");
|
|
150
|
-
const baseHead = buildBaseHead(settings, locale);
|
|
179
|
+
const parts = deriveHeadParts(settings);
|
|
151
180
|
return resolveHead(
|
|
152
|
-
mergeHead(
|
|
153
|
-
meta:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{ name: "theme-color", content: primaryColor },
|
|
159
|
-
{ name: "msapplication-navbutton-color", content: primaryColor },
|
|
160
|
-
{ name: "apple-mobile-web-app-status-bar-style", content: primaryColor }
|
|
161
|
-
] : []
|
|
162
|
-
],
|
|
163
|
-
links: [
|
|
164
|
-
{ rel: "preconnect", href: "https://api.salla.dev" },
|
|
165
|
-
{ rel: "preconnect", href: "https://cdn.salla.sa" },
|
|
166
|
-
{ rel: "preconnect", href: "https://cdn.assets.salla.network", crossOrigin: "anonymous" },
|
|
167
|
-
...fontUrl ? [
|
|
168
|
-
{
|
|
169
|
-
rel: "preconnect",
|
|
170
|
-
href: "https://fonts.gstatic.com",
|
|
171
|
-
crossOrigin: "anonymous"
|
|
172
|
-
}
|
|
173
|
-
] : [],
|
|
174
|
-
{ rel: "modulepreload", href: twilightSdkUrl },
|
|
175
|
-
{ rel: "modulepreload", href: `${LIT_CDN_BASE}/lit.js` },
|
|
176
|
-
...fontUrlWithDisplay ? [
|
|
177
|
-
{
|
|
178
|
-
id: "salla-theme-font",
|
|
179
|
-
rel: "stylesheet",
|
|
180
|
-
href: fontUrlWithDisplay,
|
|
181
|
-
media: "print"
|
|
182
|
-
}
|
|
183
|
-
] : [],
|
|
184
|
-
...fontUrlWithDisplay && !isGoogleFont && fontFamilyName ? [
|
|
185
|
-
{
|
|
186
|
-
id: "salla-font-display-override",
|
|
187
|
-
rel: "preload",
|
|
188
|
-
as: "style",
|
|
189
|
-
href: fontUrlWithDisplay
|
|
190
|
-
}
|
|
191
|
-
] : [],
|
|
192
|
-
...favicon ? [{ rel: "icon", href: favicon }] : [],
|
|
193
|
-
...favicon ? [{ id: "salla-apple-icon", rel: "apple-touch-icon-precomposed", href: favicon }] : [],
|
|
194
|
-
...isCustomCssUrl && customCss ? [{ id: "salla-custom-css", rel: "stylesheet", href: customCss }] : [],
|
|
195
|
-
{
|
|
196
|
-
id: "salla-icons-css",
|
|
197
|
-
rel: "stylesheet",
|
|
198
|
-
href: SALLA_ICONS_CSS_URL,
|
|
199
|
-
media: "print"
|
|
200
|
-
},
|
|
201
|
-
// {
|
|
202
|
-
// id: 'intl-tel-input-css',
|
|
203
|
-
// rel: 'stylesheet',
|
|
204
|
-
// href: 'https://cdn.jsdelivr.net/npm/intl-tel-input@26.8.0/build/css/intlTelInput.css',
|
|
205
|
-
// },
|
|
206
|
-
...isCustomJsUrl && customJs ? [{ id: "salla-custom-js-preload", rel: "preload", as: "script", href: customJs }] : []
|
|
207
|
-
],
|
|
208
|
-
styles: [
|
|
209
|
-
{ id: "twilight-loading", children: LOADING_CSS },
|
|
210
|
-
...!isGoogleFont && fontFamilyName ? [
|
|
211
|
-
{
|
|
212
|
-
id: "salla-font-display-swap",
|
|
213
|
-
children: `@font-face{font-family:"${fontFamilyName}";font-display:swap;src:local("${fontFamilyName}")}`
|
|
214
|
-
}
|
|
215
|
-
] : [],
|
|
216
|
-
...!isCustomCssUrl && customCss ? [{ id: "salla-custom-css", children: customCss }] : []
|
|
217
|
-
],
|
|
218
|
-
importMap: [
|
|
219
|
-
{
|
|
220
|
-
imports: {
|
|
221
|
-
lit: `${LIT_CDN_BASE}/lit.js`,
|
|
222
|
-
"lit/": `${LIT_CDN_BASE}/`,
|
|
223
|
-
"lit-html": `${LIT_CDN_BASE}/lit-html/lit-html.js`,
|
|
224
|
-
"lit-html/": `${LIT_CDN_BASE}/lit-html/`,
|
|
225
|
-
"lit-element": `${LIT_CDN_BASE}/lit-element/lit-element.js`,
|
|
226
|
-
"lit-element/": `${LIT_CDN_BASE}/lit-element/`,
|
|
227
|
-
"@lit/reactive-element": `${LIT_CDN_BASE}/reactive-element/reactive-element.js`,
|
|
228
|
-
"@lit/reactive-element/": `${LIT_CDN_BASE}/reactive-element/`
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
],
|
|
232
|
-
scripts: [
|
|
233
|
-
{ id: "twilight-init", children: SALLA_INIT_SCRIPT },
|
|
234
|
-
{ id: "salla-async-css", children: MEDIA_SWAP_SCRIPT },
|
|
235
|
-
{
|
|
236
|
-
id: "salla-sdk",
|
|
237
|
-
type: "module",
|
|
238
|
-
src: twilightSdkUrl
|
|
239
|
-
},
|
|
240
|
-
...store2?.settings?.ticketing_system_enabled ? [
|
|
241
|
-
{
|
|
242
|
-
id: "salla-ticketing-script",
|
|
243
|
-
src: "https://cdn.assets.salla.network/latest/@salla.sa/ui-store-ticketing-system/ticketing-system.es.js",
|
|
244
|
-
type: "module"
|
|
245
|
-
}
|
|
246
|
-
] : [],
|
|
247
|
-
// Fast checkout for quick-purchase feature (product pages, landing pages)
|
|
248
|
-
...store2?.settings?.quick_order ? [
|
|
249
|
-
{
|
|
250
|
-
id: "fast-checkout-js",
|
|
251
|
-
type: "module",
|
|
252
|
-
src: "https://cdn.assets.salla.network/mini-checkout/widget/widget.esm.js?v=0.0.9"
|
|
253
|
-
}
|
|
254
|
-
] : [],
|
|
255
|
-
...isCustomJsUrl && customJs ? [
|
|
256
|
-
{
|
|
257
|
-
id: "salla-custom-js",
|
|
258
|
-
children: `document.addEventListener('twilight::initiated',function(){var s=document.createElement('script');s.src=${escapeForInlineScript(JSON.stringify(customJs))};s.async=true;document.head.appendChild(s)},{once:true});`
|
|
259
|
-
}
|
|
260
|
-
] : [],
|
|
261
|
-
...!isCustomJsUrl && customJs ? [
|
|
262
|
-
{
|
|
263
|
-
id: "salla-custom-js",
|
|
264
|
-
children: `try { ${customJs} } catch(e) { console.warn("[ThemeCustomization] Custom JS error:", e); }`
|
|
265
|
-
}
|
|
266
|
-
] : []
|
|
267
|
-
]
|
|
181
|
+
mergeHead(buildBaseHead(settings, locale), {
|
|
182
|
+
meta: buildRootMeta(parts),
|
|
183
|
+
links: buildRootLinks(parts),
|
|
184
|
+
styles: buildRootStyles(parts),
|
|
185
|
+
importMap: [{ imports: LIT_IMPORTS }],
|
|
186
|
+
scripts: buildRootScripts(parts)
|
|
268
187
|
})
|
|
269
188
|
);
|
|
270
189
|
}
|
|
190
|
+
function deriveFontParts(theme) {
|
|
191
|
+
const font = theme?.font;
|
|
192
|
+
const fontUrl = font?.url || font?.path;
|
|
193
|
+
const isGoogleFont = fontUrl?.includes("fonts.googleapis.com");
|
|
194
|
+
const needsDisplay = Boolean(isGoogleFont && fontUrl && !fontUrl.includes("display="));
|
|
195
|
+
const separator = fontUrl?.includes("?") ? "&" : "?";
|
|
196
|
+
return {
|
|
197
|
+
fontUrl,
|
|
198
|
+
isGoogleFont,
|
|
199
|
+
fontFamilyName: font?.family_name,
|
|
200
|
+
fontUrlWithDisplay: needsDisplay ? `${fontUrl}${separator}display=swap` : fontUrl
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function deriveCustomizationParts(theme) {
|
|
204
|
+
const customization = theme?.customization;
|
|
205
|
+
const customJs = customization?.js?.trim();
|
|
206
|
+
const customCss = customization?.css?.trim();
|
|
207
|
+
const isUrl = (value) => Boolean(value?.startsWith("http") || value?.startsWith("//"));
|
|
208
|
+
return {
|
|
209
|
+
customJs,
|
|
210
|
+
customCss,
|
|
211
|
+
isCustomCssUrl: isUrl(customCss),
|
|
212
|
+
isCustomJsUrl: isUrl(customJs)
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function deriveHeadParts(settings) {
|
|
216
|
+
const store2 = settings?.store;
|
|
217
|
+
return {
|
|
218
|
+
store: store2,
|
|
219
|
+
favicon: store2?.icon,
|
|
220
|
+
primaryColor: settings?.theme?.color?.primary,
|
|
221
|
+
...deriveFontParts(settings?.theme),
|
|
222
|
+
...deriveCustomizationParts(settings?.theme),
|
|
223
|
+
twilightSdkUrl: resolveTwilightSdkUrl(settings),
|
|
224
|
+
// Warm the connection to the snippet host(s) during head parse, so the body's deferred
|
|
225
|
+
// `<script src>` snippet tags fetch off an already-open socket instead of DNS+TCP+TLS.
|
|
226
|
+
snippetPreconnects: snippetPreconnectOrigins(getTwilightContext().appsSnippets).map((href) => ({
|
|
227
|
+
rel: "preconnect",
|
|
228
|
+
href
|
|
229
|
+
})),
|
|
230
|
+
// Install `Salla.appScope` inline at parse time, before the SDK is ready — else a snippet's
|
|
231
|
+
// onReady callback calls it too early and throws. Always emitted, even when the settings
|
|
232
|
+
// prefetch failed: the CDN snippet tags ship regardless (they come from the *snippets*
|
|
233
|
+
// endpoint), so the factory has to exist for them. `installAppScope` then seeds the real
|
|
234
|
+
// buckets into this install once the client query resolves.
|
|
235
|
+
appScopeInstallScript: renderAppScopeInstallScript(
|
|
236
|
+
getTwilightContext().appsSettings ?? { apps: {} }
|
|
237
|
+
),
|
|
238
|
+
// Whitelist the theme's own hook slots at parse time too, for the same reason: apps register
|
|
239
|
+
// their `onReady` callbacks from parser-inserted snippet tags, long before React hydrates.
|
|
240
|
+
themeHookSlotsScript: renderThemeHookSlotsScript(),
|
|
241
|
+
// Env this render resolved (worker `vars` live in server-only `process.env`), handed to the
|
|
242
|
+
// client so it doesn't silently fall back to the production defaults. Re-rendered on the
|
|
243
|
+
// client during hydration, where it resolves to the same values or to nothing.
|
|
244
|
+
runtimeEnvScript: renderRuntimeEnvScript()
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function buildRootMeta(p) {
|
|
248
|
+
return [
|
|
249
|
+
{ name: "robots", content: "index, follow" },
|
|
250
|
+
{ name: "msapplication-TileColor", content: "#ffffff" },
|
|
251
|
+
...p.favicon ? [{ name: "msapplication-TileImage", content: p.favicon }] : [],
|
|
252
|
+
...p.primaryColor ? [
|
|
253
|
+
{ name: "theme-color", content: p.primaryColor },
|
|
254
|
+
{ name: "msapplication-navbutton-color", content: p.primaryColor },
|
|
255
|
+
{ name: "apple-mobile-web-app-status-bar-style", content: p.primaryColor }
|
|
256
|
+
] : []
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
function buildRootLinks(p) {
|
|
260
|
+
return [
|
|
261
|
+
{ rel: "preconnect", href: "https://api.salla.dev" },
|
|
262
|
+
{ rel: "preconnect", href: "https://cdn.salla.sa" },
|
|
263
|
+
{ rel: "preconnect", href: "https://cdn.assets.salla.network", crossOrigin: "anonymous" },
|
|
264
|
+
// Warm the installed apps' CDN snippet host(s) — see snippetPreconnectOrigins.
|
|
265
|
+
...p.snippetPreconnects,
|
|
266
|
+
...p.fontUrl ? [
|
|
267
|
+
{
|
|
268
|
+
rel: "preconnect",
|
|
269
|
+
href: "https://fonts.gstatic.com",
|
|
270
|
+
crossOrigin: "anonymous"
|
|
271
|
+
}
|
|
272
|
+
] : [],
|
|
273
|
+
{ rel: "modulepreload", href: p.twilightSdkUrl },
|
|
274
|
+
{ rel: "modulepreload", href: `${LIT_CDN_BASE}/lit.js` },
|
|
275
|
+
...p.fontUrlWithDisplay ? [
|
|
276
|
+
{
|
|
277
|
+
id: "salla-theme-font",
|
|
278
|
+
rel: "stylesheet",
|
|
279
|
+
href: p.fontUrlWithDisplay,
|
|
280
|
+
media: "print"
|
|
281
|
+
}
|
|
282
|
+
] : [],
|
|
283
|
+
...p.fontUrlWithDisplay && !p.isGoogleFont && p.fontFamilyName ? [
|
|
284
|
+
{
|
|
285
|
+
id: "salla-font-display-override",
|
|
286
|
+
rel: "preload",
|
|
287
|
+
as: "style",
|
|
288
|
+
href: p.fontUrlWithDisplay
|
|
289
|
+
}
|
|
290
|
+
] : [],
|
|
291
|
+
...p.favicon ? [{ rel: "icon", href: p.favicon }] : [],
|
|
292
|
+
...p.favicon ? [{ id: "salla-apple-icon", rel: "apple-touch-icon-precomposed", href: p.favicon }] : [],
|
|
293
|
+
...p.isCustomCssUrl && p.customCss ? [{ id: "salla-custom-css", rel: "stylesheet", href: p.customCss }] : [],
|
|
294
|
+
{
|
|
295
|
+
id: "salla-icons-css",
|
|
296
|
+
rel: "stylesheet",
|
|
297
|
+
href: SALLA_ICONS_CSS_URL,
|
|
298
|
+
media: "print"
|
|
299
|
+
},
|
|
300
|
+
// {
|
|
301
|
+
// id: 'intl-tel-input-css',
|
|
302
|
+
// rel: 'stylesheet',
|
|
303
|
+
// href: 'https://cdn.jsdelivr.net/npm/intl-tel-input@26.8.0/build/css/intlTelInput.css',
|
|
304
|
+
// },
|
|
305
|
+
...p.isCustomJsUrl && p.customJs ? [{ id: "salla-custom-js-preload", rel: "preload", as: "script", href: p.customJs }] : []
|
|
306
|
+
];
|
|
307
|
+
}
|
|
308
|
+
function buildRootStyles(p) {
|
|
309
|
+
return [
|
|
310
|
+
{ id: "twilight-loading", children: LOADING_CSS },
|
|
311
|
+
...!p.isGoogleFont && p.fontFamilyName ? [
|
|
312
|
+
{
|
|
313
|
+
id: "salla-font-display-swap",
|
|
314
|
+
children: `@font-face{font-family:"${p.fontFamilyName}";font-display:swap;src:local("${p.fontFamilyName}")}`
|
|
315
|
+
}
|
|
316
|
+
] : [],
|
|
317
|
+
...!p.isCustomCssUrl && p.customCss ? [{ id: "salla-custom-css", children: p.customCss }] : []
|
|
318
|
+
];
|
|
319
|
+
}
|
|
320
|
+
function buildRootScripts(p) {
|
|
321
|
+
return [
|
|
322
|
+
// First: the API base / store identifier this render used, so the hydrated client
|
|
323
|
+
// resolves the same ones (worker `vars` never reach the browser bundle on their own).
|
|
324
|
+
...p.runtimeEnvScript ? [{ id: "salla-runtime-env", children: p.runtimeEnvScript }] : [],
|
|
325
|
+
{ id: "twilight-init", children: SALLA_INIT_SCRIPT },
|
|
326
|
+
// After twilight-init (which defines window.Salla) and before the SDK module, so the
|
|
327
|
+
// appScope factory exists ahead of any snippet's onReady callback firing.
|
|
328
|
+
{ id: "salla-app-scope", children: p.appScopeInstallScript },
|
|
329
|
+
// Arms the hook-slot whitelist push here, so its `twilight::initiated` listener is
|
|
330
|
+
// registered before any app snippet's — listeners fire in registration order.
|
|
331
|
+
...p.themeHookSlotsScript ? [{ id: "salla-theme-hook-slots", children: p.themeHookSlotsScript }] : [],
|
|
332
|
+
{ id: "salla-async-css", children: MEDIA_SWAP_SCRIPT },
|
|
333
|
+
{ id: "salla-sdk", type: "module", src: p.twilightSdkUrl },
|
|
334
|
+
...p.store?.settings?.ticketing_system_enabled ? [
|
|
335
|
+
{
|
|
336
|
+
id: "salla-ticketing-script",
|
|
337
|
+
src: "https://cdn.assets.salla.network/latest/@salla.sa/ui-store-ticketing-system/ticketing-system.es.js",
|
|
338
|
+
type: "module"
|
|
339
|
+
}
|
|
340
|
+
] : [],
|
|
341
|
+
// Fast checkout for quick-purchase feature (product pages, landing pages)
|
|
342
|
+
...p.store?.settings?.quick_order ? [
|
|
343
|
+
{
|
|
344
|
+
id: "fast-checkout-js",
|
|
345
|
+
type: "module",
|
|
346
|
+
src: "https://cdn.assets.salla.network/mini-checkout/widget/widget.esm.js?v=0.0.9"
|
|
347
|
+
}
|
|
348
|
+
] : [],
|
|
349
|
+
...p.customJs ? [buildCustomJsScript(p.customJs, Boolean(p.isCustomJsUrl))] : []
|
|
350
|
+
];
|
|
351
|
+
}
|
|
352
|
+
function buildCustomJsScript(customJs, isUrl) {
|
|
353
|
+
return {
|
|
354
|
+
id: "salla-custom-js",
|
|
355
|
+
children: isUrl ? `document.addEventListener('twilight::initiated',function(){var s=document.createElement('script');s.src=${escapeForInlineScript(JSON.stringify(customJs))};s.async=true;document.head.appendChild(s)},{once:true});` : `try { ${customJs} } catch(e) { console.warn("[ThemeCustomization] Custom JS error:", e); }`
|
|
356
|
+
};
|
|
357
|
+
}
|
|
271
358
|
var TANSTACK_ROUTE_ID_MAP = {
|
|
272
359
|
"/{-$locale}/": RouteId.INDEX,
|
|
273
360
|
"/{-$locale}/cart": RouteId.CART,
|
|
@@ -304,7 +391,7 @@ function resolveRouteId(tanstackId) {
|
|
|
304
391
|
return TANSTACK_ROUTE_ID_MAP[tanstackId] ?? tanstackId;
|
|
305
392
|
}
|
|
306
393
|
var LazyNotFoundPage = lazy(
|
|
307
|
-
() => import('./not-found-
|
|
394
|
+
() => import('./not-found-AO2ZXILV.js').then((m) => ({ default: m.NotFoundPage }))
|
|
308
395
|
);
|
|
309
396
|
function StoreUnavailablePage() {
|
|
310
397
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -403,6 +490,8 @@ function hydrateTwilightContext(router, queryClient) {
|
|
|
403
490
|
const settings = beforeLoadCtx?.settings ?? matchCtx?.settings;
|
|
404
491
|
const locale = beforeLoadCtx?.locale ?? matchCtx?.locale;
|
|
405
492
|
const authToken = beforeLoadCtx?.authToken ?? matchCtx?.authToken;
|
|
493
|
+
const appsSnippets = beforeLoadCtx?.appsSnippets ?? matchCtx?.appsSnippets;
|
|
494
|
+
const appsSettings = beforeLoadCtx?.appsSettings ?? matchCtx?.appsSettings;
|
|
406
495
|
if (!settings || !locale) {
|
|
407
496
|
warnHydrationBail(
|
|
408
497
|
`root match carried no ${!settings ? "settings" : "locale"} (beforeLoadContext and context both empty)`
|
|
@@ -434,7 +523,9 @@ function hydrateTwilightContext(router, queryClient) {
|
|
|
434
523
|
authToken,
|
|
435
524
|
location,
|
|
436
525
|
page,
|
|
437
|
-
routeId
|
|
526
|
+
routeId,
|
|
527
|
+
appsSnippets,
|
|
528
|
+
appsSettings
|
|
438
529
|
});
|
|
439
530
|
}
|
|
440
531
|
function createRouter(routeTree, options) {
|
|
@@ -622,5 +713,5 @@ function tanstackDocumentAdapter(descriptor) {
|
|
|
622
713
|
}
|
|
623
714
|
|
|
624
715
|
export { RouteDocumentSync, TanStackDocumentSync, createRouter, createTwilightRootRoute, rootHead, tanstackDocumentAdapter, useTanstackDocumentAttrs };
|
|
625
|
-
//# sourceMappingURL=chunk-
|
|
626
|
-
//# sourceMappingURL=chunk-
|
|
716
|
+
//# sourceMappingURL=chunk-WPJEVWKC.js.map
|
|
717
|
+
//# sourceMappingURL=chunk-WPJEVWKC.js.map
|