@salla.sa/twilight-theme-engine 1.0.182 → 1.0.184
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-6UAS7JIW.js → AddToCartForm-BXMZXMAQ.js} +3 -3
- package/dist/{AddToCartForm-6UAS7JIW.js.map → AddToCartForm-BXMZXMAQ.js.map} +1 -1
- package/dist/{BlogAuthorPage-ATDUQ466.js → BlogAuthorPage-LWTWAIUG.js} +20 -19
- package/dist/BlogAuthorPage-LWTWAIUG.js.map +1 -0
- package/dist/{BlogCategoryPage-C55VAV4F.js → BlogCategoryPage-5FWA7Z4V.js} +20 -19
- package/dist/BlogCategoryPage-5FWA7Z4V.js.map +1 -0
- package/dist/{BlogPage-UQXMNC6I.js → BlogPage-OZVMM5FZ.js} +18 -17
- package/dist/BlogPage-OZVMM5FZ.js.map +1 -0
- package/dist/{BlogSinglePage-AFVLH7EU.js → BlogSinglePage-CBNVZ6FT.js} +18 -17
- package/dist/BlogSinglePage-CBNVZ6FT.js.map +1 -0
- package/dist/{BlogTagPage-ZFUL4MMJ.js → BlogTagPage-MPK5WFI3.js} +20 -19
- package/dist/BlogTagPage-MPK5WFI3.js.map +1 -0
- package/dist/{BrandsPage-XW4PAOQ2.js → BrandsPage-JUCEETY6.js} +19 -18
- package/dist/BrandsPage-JUCEETY6.js.map +1 -0
- package/dist/{Breadcrumb-HNGUTJAF.js → Breadcrumb-RFYPI5MK.js} +18 -17
- package/dist/Breadcrumb-RFYPI5MK.js.map +1 -0
- package/dist/CanvasOverlay-IBVG2YOL.js +655 -0
- package/dist/CanvasOverlay-IBVG2YOL.js.map +1 -0
- package/dist/{CartItem-6JZTKWPN.js → CartItem-WYXY5DCU.js} +18 -17
- package/dist/CartItem-WYXY5DCU.js.map +1 -0
- package/dist/{CartSummary-FVMOXTW4.js → CartSummary-US7JIXIR.js} +18 -17
- package/dist/CartSummary-US7JIXIR.js.map +1 -0
- package/dist/{Copyright-AEAMRPF6.js → Copyright-6TJIEFKN.js} +3 -3
- package/dist/{Copyright-AEAMRPF6.js.map → Copyright-6TJIEFKN.js.map} +1 -1
- package/dist/{CustomerLayout-W2KYMLFV.js → CustomerLayout-YGLWTBJK.js} +18 -17
- package/dist/CustomerLayout-YGLWTBJK.js.map +1 -0
- package/dist/{Footer-VA5QEMJT.js → Footer-2MXKBHCK.js} +3 -3
- package/dist/{Footer-VA5QEMJT.js.map → Footer-2MXKBHCK.js.map} +1 -1
- package/dist/GoogleTag-VRMJ4J6C.js +15 -0
- package/dist/{GoogleTag-YOJ2NCZD.js.map → GoogleTag-VRMJ4J6C.js.map} +1 -1
- package/dist/{Header-FU2LPTGO.js → Header-HTLVEBKS.js} +8 -8
- package/dist/{Header-FU2LPTGO.js.map → Header-HTLVEBKS.js.map} +1 -1
- package/dist/{LatestProducts-QDK4C35P.js → LatestProducts-XF6O6YBW.js} +20 -19
- package/dist/LatestProducts-XF6O6YBW.js.map +1 -0
- package/dist/{LiveEditorBar-NHUTCSF2.js → LiveEditorBar-3ZCT3ZVC.js} +4 -14
- package/dist/LiveEditorBar-3ZCT3ZVC.js.map +1 -0
- package/dist/{LoyaltyPage-6S2O35FJ.js → LoyaltyPage-CRYYVP7F.js} +18 -17
- package/dist/LoyaltyPage-CRYYVP7F.js.map +1 -0
- package/dist/{LoyaltyPointsPage-4WCDQDAT.js → LoyaltyPointsPage-TJI6RMDD.js} +6 -6
- package/dist/{LoyaltyPointsPage-4WCDQDAT.js.map → LoyaltyPointsPage-TJI6RMDD.js.map} +1 -1
- package/dist/{MainMenu-6CZ5JFBX.js → MainMenu-J66FADE2.js} +5 -5
- package/dist/{MainMenu-6CZ5JFBX.js.map → MainMenu-J66FADE2.js.map} +1 -1
- package/dist/{MasterLayout-PBARTDT2.js → MasterLayout-R6M52USI.js} +18 -17
- package/dist/{MasterLayout-PBARTDT2.js.map → MasterLayout-R6M52USI.js.map} +1 -1
- package/dist/{MobileMenu-WZ4BWLCR.js → MobileMenu-SBKTELPR.js} +19 -18
- package/dist/MobileMenu-SBKTELPR.js.map +1 -0
- package/dist/{NotificationsPage-72O3QRPH.js → NotificationsPage-BSS6TKPU.js} +18 -17
- package/dist/NotificationsPage-BSS6TKPU.js.map +1 -0
- package/dist/{OrderSinglePage-KBZNLHBH.js → OrderSinglePage-7MZA4WXK.js} +19 -18
- package/dist/OrderSinglePage-7MZA4WXK.js.map +1 -0
- package/dist/{OrdersPage-JI644YDE.js → OrdersPage-3M2BNDIF.js} +18 -17
- package/dist/OrdersPage-3M2BNDIF.js.map +1 -0
- package/dist/{PageSingle-N5FNOITW.js → PageSingle-TKG2DT43.js} +3 -3
- package/dist/{PageSingle-N5FNOITW.js.map → PageSingle-TKG2DT43.js.map} +1 -1
- package/dist/{ProductDetails-EQVBWJ6N.js → ProductDetails-GYOFXHCM.js} +4 -4
- package/dist/{ProductDetails-EQVBWJ6N.js.map → ProductDetails-GYOFXHCM.js.map} +1 -1
- package/dist/{ProfilePage-AQRZT2XO.js → ProfilePage-5GKNEEJH.js} +18 -17
- package/dist/ProfilePage-5GKNEEJH.js.map +1 -0
- package/dist/{ReviewsPage-PS6KUW2G.js → ReviewsPage-KQJ5ARCW.js} +3 -3
- package/dist/{ReviewsPage-PS6KUW2G.js.map → ReviewsPage-KQJ5ARCW.js.map} +1 -1
- package/dist/{SeoCartWidget-RZHQOFIM.js → SeoCartWidget-X3ELSC66.js} +18 -17
- package/dist/SeoCartWidget-X3ELSC66.js.map +1 -0
- package/dist/{SettingsPage-FR4RHLQT.js → SettingsPage-JP6YRQBY.js} +18 -17
- package/dist/SettingsPage-JP6YRQBY.js.map +1 -0
- package/dist/{StoreClosedNotification-BFZYZAPB.js → StoreClosedNotification-2MBV7TMJ.js} +19 -18
- package/dist/{StoreClosedNotification-BFZYZAPB.js.map → StoreClosedNotification-2MBV7TMJ.js.map} +1 -1
- package/dist/{TestimonialsPage-3YEKHU3I.js → TestimonialsPage-Z4TEJMTE.js} +3 -3
- package/dist/{TestimonialsPage-3YEKHU3I.js.map → TestimonialsPage-Z4TEJMTE.js.map} +1 -1
- package/dist/{ThankYouPage-5364A5NA.js → ThankYouPage-N4H4EZWE.js} +18 -17
- package/dist/ThankYouPage-N4H4EZWE.js.map +1 -0
- package/dist/{WalletPage-524UGX2C.js → WalletPage-ZWQAFY5I.js} +19 -18
- package/dist/WalletPage-ZWQAFY5I.js.map +1 -0
- package/dist/{WebMcpTools-UTSIV5ZJ.js → WebMcpTools-ITTIZWVX.js} +5 -5
- package/dist/{WebMcpTools-UTSIV5ZJ.js.map → WebMcpTools-ITTIZWVX.js.map} +1 -1
- package/dist/{WishlistPage-EVKHYKVI.js → WishlistPage-E7FQDESK.js} +20 -19
- package/dist/WishlistPage-E7FQDESK.js.map +1 -0
- package/dist/api/advertisement.js +2 -2
- package/dist/api/apps.js +2 -2
- package/dist/api/blog.js +3 -3
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/client.js +1 -1
- package/dist/api/custom-url.js +2 -2
- package/dist/api/home.js +2 -2
- package/dist/api/loyalty.js +3 -3
- package/dist/api/menu.js +2 -2
- package/dist/api/notification.js +2 -2
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/profile.js +1 -1
- package/dist/api/store.js +2 -2
- package/dist/api/translations.js +2 -2
- package/dist/api/user.js +2 -2
- package/dist/api/wallet.js +2 -2
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-RSSHK3JC.js → chunk-22P6SS2A.js} +3 -3
- package/dist/{chunk-RSSHK3JC.js.map → chunk-22P6SS2A.js.map} +1 -1
- package/dist/{chunk-A7BDFM2C.js → chunk-2ESGE7G5.js} +4 -4
- package/dist/{chunk-A7BDFM2C.js.map → chunk-2ESGE7G5.js.map} +1 -1
- package/dist/{chunk-OB6L6M2T.js → chunk-2WYCMQC2.js} +3 -3
- package/dist/{chunk-OB6L6M2T.js.map → chunk-2WYCMQC2.js.map} +1 -1
- package/dist/{chunk-B6FAKL6U.js → chunk-4LUPSWUB.js} +5 -5
- package/dist/{chunk-B6FAKL6U.js.map → chunk-4LUPSWUB.js.map} +1 -1
- package/dist/{chunk-G2EDQO46.js → chunk-4NWPVTAW.js} +4 -4
- package/dist/{chunk-G2EDQO46.js.map → chunk-4NWPVTAW.js.map} +1 -1
- package/dist/{chunk-P43LC5TV.js → chunk-4QDOYW5G.js} +7 -7
- package/dist/{chunk-P43LC5TV.js.map → chunk-4QDOYW5G.js.map} +1 -1
- package/dist/{chunk-4XL4V3TX.js → chunk-66MUJY4O.js} +5 -5
- package/dist/{chunk-4XL4V3TX.js.map → chunk-66MUJY4O.js.map} +1 -1
- package/dist/{chunk-JUG4JHR7.js → chunk-BJPDNTGG.js} +7 -7
- package/dist/{chunk-JUG4JHR7.js.map → chunk-BJPDNTGG.js.map} +1 -1
- package/dist/{chunk-WCA25DUZ.js → chunk-C4GFF2YN.js} +3 -3
- package/dist/{chunk-WCA25DUZ.js.map → chunk-C4GFF2YN.js.map} +1 -1
- package/dist/{chunk-UWGHQLEW.js → chunk-CC3NJRHG.js} +4 -4
- package/dist/{chunk-UWGHQLEW.js.map → chunk-CC3NJRHG.js.map} +1 -1
- package/dist/{chunk-HGYZPNWO.js → chunk-CCSFB6R3.js} +3 -3
- package/dist/{chunk-HGYZPNWO.js.map → chunk-CCSFB6R3.js.map} +1 -1
- package/dist/chunk-DFAXWCUA.js +16 -0
- package/dist/chunk-DFAXWCUA.js.map +1 -0
- package/dist/{chunk-WPMRMORF.js → chunk-DRQDCW6L.js} +4 -4
- package/dist/{chunk-WPMRMORF.js.map → chunk-DRQDCW6L.js.map} +1 -1
- package/dist/{chunk-WC2XULCS.js → chunk-E6YGF2OV.js} +6 -6
- package/dist/{chunk-WC2XULCS.js.map → chunk-E6YGF2OV.js.map} +1 -1
- package/dist/{chunk-SQAAODYN.js → chunk-ELGZOQEY.js} +3 -3
- package/dist/chunk-ELGZOQEY.js.map +1 -0
- package/dist/{chunk-XF33VTAA.js → chunk-EU5CJ6IF.js} +3 -3
- package/dist/{chunk-XF33VTAA.js.map → chunk-EU5CJ6IF.js.map} +1 -1
- package/dist/{chunk-YEER2VOP.js → chunk-FE53P2MQ.js} +13 -8
- package/dist/chunk-FE53P2MQ.js.map +1 -0
- package/dist/{chunk-SLMOKFUU.js → chunk-FTFEYCD4.js} +4 -4
- package/dist/{chunk-SLMOKFUU.js.map → chunk-FTFEYCD4.js.map} +1 -1
- package/dist/{chunk-3XUIPPPX.js → chunk-GCFVHBB4.js} +4 -4
- package/dist/{chunk-3XUIPPPX.js.map → chunk-GCFVHBB4.js.map} +1 -1
- package/dist/{chunk-IHWF6GCB.js → chunk-GDFGWNRH.js} +3 -3
- package/dist/{chunk-IHWF6GCB.js.map → chunk-GDFGWNRH.js.map} +1 -1
- package/dist/{chunk-WYPMPXMW.js → chunk-GKFMID4U.js} +3 -3
- package/dist/{chunk-WYPMPXMW.js.map → chunk-GKFMID4U.js.map} +1 -1
- package/dist/{chunk-LWJVLCCA.js → chunk-HD2EHZXD.js} +3 -3
- package/dist/{chunk-LWJVLCCA.js.map → chunk-HD2EHZXD.js.map} +1 -1
- package/dist/{chunk-DE5QLYBD.js → chunk-HN4HJVG2.js} +3 -3
- package/dist/{chunk-DE5QLYBD.js.map → chunk-HN4HJVG2.js.map} +1 -1
- package/dist/{chunk-RDT2CI5O.js → chunk-JL3EJFLU.js} +3 -3
- package/dist/{chunk-RDT2CI5O.js.map → chunk-JL3EJFLU.js.map} +1 -1
- package/dist/{chunk-YVFQ46DK.js → chunk-KKSXC3AL.js} +3 -3
- package/dist/{chunk-YVFQ46DK.js.map → chunk-KKSXC3AL.js.map} +1 -1
- package/dist/{chunk-TRLFPQBT.js → chunk-KV2ZGHLJ.js} +3 -3
- package/dist/{chunk-TRLFPQBT.js.map → chunk-KV2ZGHLJ.js.map} +1 -1
- package/dist/{chunk-XCYWOZGV.js → chunk-LDZ662RB.js} +3 -3
- package/dist/{chunk-XCYWOZGV.js.map → chunk-LDZ662RB.js.map} +1 -1
- package/dist/{chunk-HNOCZOHR.js → chunk-M2KBGBRZ.js} +5 -5
- package/dist/{chunk-HNOCZOHR.js.map → chunk-M2KBGBRZ.js.map} +1 -1
- package/dist/{chunk-KMU3HLVB.js → chunk-MEHYWO4V.js} +14 -14
- package/dist/{chunk-KMU3HLVB.js.map → chunk-MEHYWO4V.js.map} +1 -1
- package/dist/{chunk-HQNAM7Y4.js → chunk-NE2THJ27.js} +3 -3
- package/dist/{chunk-HQNAM7Y4.js.map → chunk-NE2THJ27.js.map} +1 -1
- package/dist/{chunk-3NFN57KF.js → chunk-NW3EJHKU.js} +3 -3
- package/dist/{chunk-3NFN57KF.js.map → chunk-NW3EJHKU.js.map} +1 -1
- package/dist/{chunk-WMOSPN6L.js → chunk-OXLJWZHG.js} +4 -4
- package/dist/{chunk-WMOSPN6L.js.map → chunk-OXLJWZHG.js.map} +1 -1
- package/dist/{chunk-OIEBC7N6.js → chunk-PRRBXYWL.js} +4 -4
- package/dist/{chunk-OIEBC7N6.js.map → chunk-PRRBXYWL.js.map} +1 -1
- package/dist/{chunk-4RI6HIGS.js → chunk-RJ6WA2PN.js} +3 -3
- package/dist/{chunk-4RI6HIGS.js.map → chunk-RJ6WA2PN.js.map} +1 -1
- package/dist/{chunk-O6LWGK2G.js → chunk-S3OQWQAI.js} +8 -8
- package/dist/{chunk-O6LWGK2G.js.map → chunk-S3OQWQAI.js.map} +1 -1
- package/dist/{chunk-7OB6AB6R.js → chunk-SXIZV4RR.js} +4 -4
- package/dist/{chunk-7OB6AB6R.js.map → chunk-SXIZV4RR.js.map} +1 -1
- package/dist/{chunk-KZQICDF2.js → chunk-SZAYYAGZ.js} +5 -5
- package/dist/{chunk-KZQICDF2.js.map → chunk-SZAYYAGZ.js.map} +1 -1
- package/dist/{chunk-QG2BU24D.js → chunk-T2Q4QEJC.js} +3 -3
- package/dist/{chunk-QG2BU24D.js.map → chunk-T2Q4QEJC.js.map} +1 -1
- package/dist/{chunk-T3LHKGD6.js → chunk-T3Z5LGEB.js} +4 -4
- package/dist/{chunk-T3LHKGD6.js.map → chunk-T3Z5LGEB.js.map} +1 -1
- package/dist/{chunk-7Z4ESL2L.js → chunk-TCMWH7T4.js} +4 -4
- package/dist/{chunk-7Z4ESL2L.js.map → chunk-TCMWH7T4.js.map} +1 -1
- package/dist/{chunk-5XB3ZB46.js → chunk-UKIPON5Z.js} +3 -3
- package/dist/{chunk-5XB3ZB46.js.map → chunk-UKIPON5Z.js.map} +1 -1
- package/dist/{chunk-TBWR3H3J.js → chunk-UUUQKBPI.js} +4 -4
- package/dist/{chunk-TBWR3H3J.js.map → chunk-UUUQKBPI.js.map} +1 -1
- package/dist/{chunk-7DNYKCQK.js → chunk-V3SV7CFU.js} +3 -3
- package/dist/{chunk-7DNYKCQK.js.map → chunk-V3SV7CFU.js.map} +1 -1
- package/dist/chunk-VJF4DOIT.js +140 -0
- package/dist/chunk-VJF4DOIT.js.map +1 -0
- package/dist/{chunk-IH54NYKV.js → chunk-W6DMFGXD.js} +4 -4
- package/dist/{chunk-IH54NYKV.js.map → chunk-W6DMFGXD.js.map} +1 -1
- package/dist/{chunk-TW4MCKDB.js → chunk-WCPMQXCB.js} +3 -3
- package/dist/{chunk-TW4MCKDB.js.map → chunk-WCPMQXCB.js.map} +1 -1
- package/dist/{chunk-FCMOS2UJ.js → chunk-WPOWH4QC.js} +3 -3
- package/dist/{chunk-FCMOS2UJ.js.map → chunk-WPOWH4QC.js.map} +1 -1
- package/dist/{chunk-OS5H7BNV.js → chunk-XH5DODND.js} +4 -4
- package/dist/{chunk-OS5H7BNV.js.map → chunk-XH5DODND.js.map} +1 -1
- package/dist/{chunk-SLOGMIWR.js → chunk-XPF7HBIG.js} +28 -19
- package/dist/chunk-XPF7HBIG.js.map +1 -0
- package/dist/{chunk-DGEXG3FP.js → chunk-ZYBNAJDE.js} +4 -4
- package/dist/{chunk-DGEXG3FP.js.map → chunk-ZYBNAJDE.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 +16 -15
- package/dist/components/home/index.js +21 -20
- package/dist/components/layout/index.js +4 -4
- package/dist/components/live-editor/CanvasOverlay.d.ts +14 -0
- package/dist/components/live-editor/CanvasOverlay.d.ts.map +1 -0
- package/dist/components/live-editor/LiveEditorBar.d.ts.map +1 -1
- package/dist/components/live-editor/box.d.ts +12 -0
- package/dist/components/live-editor/box.d.ts.map +1 -0
- package/dist/components/live-editor/canvas.d.ts +65 -0
- package/dist/components/live-editor/canvas.d.ts.map +1 -0
- package/dist/components/live-editor/frame.d.ts +2 -0
- package/dist/components/live-editor/frame.d.ts.map +1 -1
- package/dist/components/live-editor/index.d.ts +3 -2
- package/dist/components/live-editor/index.d.ts.map +1 -1
- package/dist/components/product/index.js +18 -17
- package/dist/components/store/index.js +17 -16
- package/dist/components/tracking/index.js +6 -6
- package/dist/{custom-urls-GA4EQODA.js → custom-urls-OYOBNKZP.js} +7 -7
- package/dist/{custom-urls-GA4EQODA.js.map → custom-urls-OYOBNKZP.js.map} +1 -1
- package/dist/dev/editor/index.js +2 -2
- package/dist/dev/index.js +1 -1
- package/dist/{document-class-AFX34W3O.js → document-class-YU2IEUHN.js} +17 -17
- package/dist/{document-class-AFX34W3O.js.map → document-class-YU2IEUHN.js.map} +1 -1
- package/dist/hooks/index.js +16 -15
- package/dist/hooks/useGtm.js +16 -15
- package/dist/hooks/useMoney.js +16 -15
- package/dist/hooks/useStore.js +16 -15
- package/dist/hooks/useUser.js +3 -3
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/{navigation-EML4VCRE.js → navigation-BPBJFGPC.js} +5 -5
- package/dist/{navigation-EML4VCRE.js.map → navigation-BPBJFGPC.js.map} +1 -1
- package/dist/{navigation-XTIOGZ5F.js → navigation-XAEI4C2J.js} +4 -4
- package/dist/{navigation-XTIOGZ5F.js.map → navigation-XAEI4C2J.js.map} +1 -1
- package/dist/{not-found-2NDDVRRU.js → not-found-YFDGAWRB.js} +19 -18
- package/dist/not-found-YFDGAWRB.js.map +1 -0
- package/dist/providers/NavigationProvider.d.ts.map +1 -1
- package/dist/providers/index.js +16 -15
- package/dist/routes/account/orders.js +4 -4
- package/dist/routes/account.js +13 -13
- package/dist/routes/blog.js +8 -8
- package/dist/routes/brands.js +4 -4
- package/dist/routes/cart.js +24 -23
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +22 -21
- package/dist/routes/index.js +8 -8
- package/dist/routes/loyalty.js +5 -5
- package/dist/routes/page.js +4 -4
- package/dist/routes/product-listing.js +26 -25
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +25 -24
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +8 -8
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +22 -21
- package/dist/{store-lookup-EP64Y6W4.js → store-lookup-HRMWL5KT.js} +8 -8
- package/dist/{store-lookup-EP64Y6W4.js.map → store-lookup-HRMWL5KT.js.map} +1 -1
- package/dist/tanstack.js +17 -17
- package/dist/utils/index.js +3 -3
- package/package.json +1 -1
- package/tailwind/components/live-editor/CanvasOverlay.tsx.txt +812 -0
- package/tailwind/components/live-editor/LiveEditorBar.tsx.txt +1 -24
- package/tailwind/components/live-editor/box.ts.txt +22 -0
- package/tailwind/components/live-editor/canvas.ts.txt +218 -0
- package/tailwind/components/live-editor/frame.ts.txt +1 -1
- package/tailwind/components/live-editor/index.tsx.txt +18 -2
- package/dist/BlogAuthorPage-ATDUQ466.js.map +0 -1
- package/dist/BlogCategoryPage-C55VAV4F.js.map +0 -1
- package/dist/BlogPage-UQXMNC6I.js.map +0 -1
- package/dist/BlogSinglePage-AFVLH7EU.js.map +0 -1
- package/dist/BlogTagPage-ZFUL4MMJ.js.map +0 -1
- package/dist/BrandsPage-XW4PAOQ2.js.map +0 -1
- package/dist/Breadcrumb-HNGUTJAF.js.map +0 -1
- package/dist/CartItem-6JZTKWPN.js.map +0 -1
- package/dist/CartSummary-FVMOXTW4.js.map +0 -1
- package/dist/CustomerLayout-W2KYMLFV.js.map +0 -1
- package/dist/GoogleTag-YOJ2NCZD.js +0 -15
- package/dist/LatestProducts-QDK4C35P.js.map +0 -1
- package/dist/LiveEditorBar-NHUTCSF2.js.map +0 -1
- package/dist/LoyaltyPage-6S2O35FJ.js.map +0 -1
- package/dist/MobileMenu-WZ4BWLCR.js.map +0 -1
- package/dist/NotificationsPage-72O3QRPH.js.map +0 -1
- package/dist/OrderSinglePage-KBZNLHBH.js.map +0 -1
- package/dist/OrdersPage-JI644YDE.js.map +0 -1
- package/dist/ProfilePage-AQRZT2XO.js.map +0 -1
- package/dist/SeoCartWidget-RZHQOFIM.js.map +0 -1
- package/dist/SettingsPage-FR4RHLQT.js.map +0 -1
- package/dist/ThankYouPage-5364A5NA.js.map +0 -1
- package/dist/WalletPage-524UGX2C.js.map +0 -1
- package/dist/WishlistPage-EVKHYKVI.js.map +0 -1
- package/dist/chunk-SLOGMIWR.js.map +0 -1
- package/dist/chunk-SQAAODYN.js.map +0 -1
- package/dist/chunk-YEER2VOP.js.map +0 -1
- package/dist/not-found-2NDDVRRU.js.map +0 -1
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
import { boxOf } from './chunk-DFAXWCUA.js';
|
|
2
|
+
import { moveLiveBlock } from './chunk-IXHM24Z4.js';
|
|
3
|
+
import { takeCanvasCommands, postToCanvas, matchBlocks } from './chunk-VJF4DOIT.js';
|
|
4
|
+
import { targetOf, BLOCK_ATTRIBUTE, areaOf, TARGET_SELECTOR } from './chunk-ELGZOQEY.js';
|
|
5
|
+
import './chunk-OXMUPNMH.js';
|
|
6
|
+
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
7
|
+
import './chunk-T72DAX7R.js';
|
|
8
|
+
import './chunk-DGUM43GV.js';
|
|
9
|
+
import { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
10
|
+
import { createPortal, flushSync } from 'react-dom';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var PARTS = {
|
|
14
|
+
logo: '[data-live-editor="logo"], .navbar-brand, .site-header__brand, .store-footer__logo',
|
|
15
|
+
menu: '[data-live-editor="menu"], custom-main-menu, .main-menu, .site-header__mainmenu, .store-footer__menu'
|
|
16
|
+
};
|
|
17
|
+
var PART_TARGETS = `${PARTS.logo}, ${PARTS.menu}`;
|
|
18
|
+
var DRAG_EDGE = 60;
|
|
19
|
+
var DEFAULT_LABELS = {
|
|
20
|
+
ar: {
|
|
21
|
+
add_here: "\u0623\u0636\u0641 \u0639\u0646\u0635\u0631 \u0647\u0646\u0627",
|
|
22
|
+
header: "\u0631\u0623\u0633 \u0627\u0644\u0635\u0641\u062D\u0629",
|
|
23
|
+
footer: "\u062A\u0630\u064A\u064A\u0644 \u0627\u0644\u0635\u0641\u062D\u0629",
|
|
24
|
+
logo: "\u0627\u0644\u0634\u0639\u0627\u0631",
|
|
25
|
+
header_menu: "\u0627\u0644\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",
|
|
26
|
+
footer_menu: "\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0641\u0648\u062A\u0631"
|
|
27
|
+
},
|
|
28
|
+
en: {
|
|
29
|
+
add_here: "Add an element here",
|
|
30
|
+
header: "Header",
|
|
31
|
+
footer: "Footer",
|
|
32
|
+
logo: "Logo",
|
|
33
|
+
header_menu: "Main menu",
|
|
34
|
+
footer_menu: "Footer menu"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var CANVAS_CSS = `
|
|
38
|
+
.s-canvas-layer{position:fixed;inset:0;z-index:2147483000;pointer-events:none}
|
|
39
|
+
.s-canvas-box{--s-canvas-border:2px;position:absolute;display:none;box-sizing:border-box;border:var(--s-canvas-border) solid #5196f3}
|
|
40
|
+
.s-canvas-tag{position:absolute;top:calc(var(--s-canvas-border) * -1);inset-inline-start:calc(var(--s-canvas-border) * -1);display:flex;align-items:center;gap:10px;max-width:calc(100% + var(--s-canvas-border) * 2);height:26px;box-sizing:border-box;padding-block:0;padding-inline:14px 16px;background:#5196f3;color:#fff;font-family:inherit;font-size:12px;font-weight:500;line-height:26px;white-space:nowrap;border-start-end-radius:8px;border-end-end-radius:8px;pointer-events:auto}
|
|
41
|
+
.s-canvas-title{overflow:hidden;text-overflow:ellipsis}
|
|
42
|
+
.s-canvas-handle{display:flex;flex-shrink:0;cursor:grab;touch-action:none}
|
|
43
|
+
.s-canvas-handle svg{width:16px;height:16px}
|
|
44
|
+
.s-canvas-add{position:absolute;top:0;left:50%;width:40px;height:40px;margin:-20px 0 0 -20px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#5196f3;color:#fff;cursor:pointer;pointer-events:auto}
|
|
45
|
+
.s-canvas-add svg{width:22px;height:22px}
|
|
46
|
+
.s-canvas-tip{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%);display:none;padding:8px 12px;border-radius:10px;background:#fff;color:#444;font-family:inherit;font-size:13px;line-height:18px;white-space:nowrap;box-shadow:0 4px 12px rgba(18,18,23,.12)}
|
|
47
|
+
.s-canvas-tip::after{content:'';position:absolute;top:100%;left:50%;margin-left:-6px;border:6px solid transparent;border-top-color:#fff}
|
|
48
|
+
.s-canvas-add:hover .s-canvas-tip{display:block}
|
|
49
|
+
.s-canvas-box.is-top .s-canvas-add{margin-top:4px}
|
|
50
|
+
.s-canvas-box.is-top .s-canvas-tip{bottom:auto;top:calc(100% + 10px)}
|
|
51
|
+
.s-canvas-box.is-top .s-canvas-tip::after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:#fff}
|
|
52
|
+
.s-canvas-box.is-fixed .s-canvas-handle,.s-canvas-box.is-fixed .s-canvas-add,.s-canvas-box--select:not(.is-hovered) .s-canvas-add{display:none}
|
|
53
|
+
.s-canvas-box.is-part .s-canvas-tag,.s-canvas-box--parent .s-canvas-add{display:none}
|
|
54
|
+
.s-canvas-box--parent{--s-canvas-border:1.5px;border-style:dashed}
|
|
55
|
+
.s-canvas-drop{position:absolute;display:none;height:4px;margin-top:-2px;border-radius:2px;background:#5196f3}
|
|
56
|
+
`;
|
|
57
|
+
var DRAGGING_CSS = "html,html *{cursor:grabbing!important;user-select:none}";
|
|
58
|
+
var DRAG_ICON = /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "5", r: "1.5" }),
|
|
60
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "5", r: "1.5" }),
|
|
61
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "12", r: "1.5" }),
|
|
62
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "12", r: "1.5" }),
|
|
63
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "19", r: "1.5" }),
|
|
64
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "19", r: "1.5" })
|
|
65
|
+
] });
|
|
66
|
+
var ADD_ICON = /* @__PURE__ */ jsx(
|
|
67
|
+
"svg",
|
|
68
|
+
{
|
|
69
|
+
width: "14",
|
|
70
|
+
height: "14",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
fill: "none",
|
|
73
|
+
stroke: "currentColor",
|
|
74
|
+
strokeWidth: "2.5",
|
|
75
|
+
strokeLinecap: "round",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14" })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
function useLabels() {
|
|
81
|
+
const { t, i18n } = useTranslation();
|
|
82
|
+
const defaults = i18n?.language?.startsWith("ar") ? DEFAULT_LABELS.ar : DEFAULT_LABELS.en;
|
|
83
|
+
return Object.fromEntries(
|
|
84
|
+
Object.keys(defaults).map((key) => [
|
|
85
|
+
key,
|
|
86
|
+
t(`blocks.live_editor.canvas.${key}`, { defaultValue: defaults[key] })
|
|
87
|
+
])
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function roleOf(el) {
|
|
91
|
+
const block = targetOf(el);
|
|
92
|
+
return block ? areaOf(block) ?? "component" : null;
|
|
93
|
+
}
|
|
94
|
+
function partOf(el) {
|
|
95
|
+
if (el.hasAttribute(BLOCK_ATTRIBUTE) || areaOf(el)) return null;
|
|
96
|
+
if (el.matches(PARTS.logo)) return "logo";
|
|
97
|
+
return el.matches(PARTS.menu) ? "menu" : null;
|
|
98
|
+
}
|
|
99
|
+
function outermost(part) {
|
|
100
|
+
const kind = partOf(part);
|
|
101
|
+
if (!kind) return part;
|
|
102
|
+
let found = part;
|
|
103
|
+
for (let up = part.parentElement?.closest(PARTS[kind]); up; up = up.parentElement?.closest(PARTS[kind])) {
|
|
104
|
+
found = up;
|
|
105
|
+
}
|
|
106
|
+
return found;
|
|
107
|
+
}
|
|
108
|
+
function pick(node) {
|
|
109
|
+
if (!(node instanceof Element)) return null;
|
|
110
|
+
const part = node.closest(PART_TARGETS);
|
|
111
|
+
const block = part ? targetOf(part) : null;
|
|
112
|
+
if (part && block && areaOf(block)) return outermost(part);
|
|
113
|
+
return targetOf(node);
|
|
114
|
+
}
|
|
115
|
+
var visible = (el) => {
|
|
116
|
+
const box = boxOf(el);
|
|
117
|
+
return box.width > 0 && box.height > 0;
|
|
118
|
+
};
|
|
119
|
+
function siblings(el) {
|
|
120
|
+
const parent = el.parentElement;
|
|
121
|
+
if (!parent) return [];
|
|
122
|
+
return Array.from(parent.children).filter(
|
|
123
|
+
(child) => child instanceof HTMLElement && child.hasAttribute(BLOCK_ATTRIBUTE)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
var pageBlocks = () => Array.from(document.querySelectorAll(`[${BLOCK_ATTRIBUTE}]`)).filter(
|
|
127
|
+
(el) => !el.closest('[role="dialog"]')
|
|
128
|
+
);
|
|
129
|
+
function nameBlocks(blocks) {
|
|
130
|
+
const els = pageBlocks();
|
|
131
|
+
const names = { map: /* @__PURE__ */ new WeakMap(), listed: blocks !== null, seen: new WeakSet(els) };
|
|
132
|
+
if (!blocks?.length) return names;
|
|
133
|
+
matchBlocks(
|
|
134
|
+
els.map((el) => el.getAttribute(BLOCK_ATTRIBUTE) ?? ""),
|
|
135
|
+
blocks
|
|
136
|
+
).forEach((block, at) => {
|
|
137
|
+
if (block) names.map.set(els[at], block);
|
|
138
|
+
});
|
|
139
|
+
return names;
|
|
140
|
+
}
|
|
141
|
+
function idOf(el, names) {
|
|
142
|
+
const block = targetOf(el);
|
|
143
|
+
if (!block) return null;
|
|
144
|
+
const area = areaOf(block);
|
|
145
|
+
if (area) return area;
|
|
146
|
+
const named = names.map.get(block);
|
|
147
|
+
if (named) return named.eid;
|
|
148
|
+
return names.listed ? null : block.getAttribute(BLOCK_ATTRIBUTE);
|
|
149
|
+
}
|
|
150
|
+
function titleOf(el, names, labels) {
|
|
151
|
+
const role = roleOf(el);
|
|
152
|
+
const part = partOf(el);
|
|
153
|
+
if (part === "logo") return labels.logo;
|
|
154
|
+
if (part === "menu") return role === "header" ? labels.header_menu : labels.footer_menu;
|
|
155
|
+
if (role === "header" || role === "footer") return labels[role];
|
|
156
|
+
const block = targetOf(el);
|
|
157
|
+
return block && names.map.get(block)?.title || "";
|
|
158
|
+
}
|
|
159
|
+
function findBlock(eid, names) {
|
|
160
|
+
if (eid === "header" || eid === "footer") {
|
|
161
|
+
return Array.from(document.querySelectorAll(TARGET_SELECTOR)).find(
|
|
162
|
+
(el) => !el.hasAttribute(BLOCK_ATTRIBUTE) && areaOf(el) === eid
|
|
163
|
+
) ?? null;
|
|
164
|
+
}
|
|
165
|
+
return pageBlocks().find((el) => {
|
|
166
|
+
const named = names.map.get(el);
|
|
167
|
+
if (named) return named.eid === eid;
|
|
168
|
+
return !names.listed && el.getAttribute(BLOCK_ATTRIBUTE) === eid;
|
|
169
|
+
}) ?? null;
|
|
170
|
+
}
|
|
171
|
+
function find(eid, part, names) {
|
|
172
|
+
const block = findBlock(eid, names);
|
|
173
|
+
if (!block || !part || roleOf(block) === "component") return block;
|
|
174
|
+
return Array.from(block.querySelectorAll(PARTS[part])).find(visible) ?? block;
|
|
175
|
+
}
|
|
176
|
+
function neighbours(el, names) {
|
|
177
|
+
if (roleOf(el) !== "component") return { prev: null, next: null };
|
|
178
|
+
const list = siblings(el);
|
|
179
|
+
const at = list.indexOf(el);
|
|
180
|
+
return {
|
|
181
|
+
prev: list[at - 1] ? idOf(list[at - 1], names) : null,
|
|
182
|
+
next: list[at + 1] ? idOf(list[at + 1], names) : null
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function rectOf(el) {
|
|
186
|
+
const box = boxOf(el);
|
|
187
|
+
return { x: box.left, y: box.top, width: box.width, height: box.height };
|
|
188
|
+
}
|
|
189
|
+
var SLIDE_MS = 200;
|
|
190
|
+
var slides = /* @__PURE__ */ new WeakMap();
|
|
191
|
+
function slideBlocks(blocks, change) {
|
|
192
|
+
const still = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
193
|
+
if (typeof Element.prototype.animate !== "function" || still) return change() ? [] : null;
|
|
194
|
+
const tops = blocks.map((el) => el.getBoundingClientRect().top + window.scrollY);
|
|
195
|
+
if (!change()) return null;
|
|
196
|
+
const started = [];
|
|
197
|
+
blocks.forEach((el, at) => {
|
|
198
|
+
if (!el.isConnected) return;
|
|
199
|
+
slides.get(el)?.cancel();
|
|
200
|
+
const shift = tops[at] - (el.getBoundingClientRect().top + window.scrollY);
|
|
201
|
+
if (Math.abs(shift) < 1) return;
|
|
202
|
+
const slide = el.animate([{ transform: `translateY(${shift}px)` }, { transform: "none" }], {
|
|
203
|
+
duration: SLIDE_MS,
|
|
204
|
+
easing: "cubic-bezier(.2, 0, 0, 1)"
|
|
205
|
+
});
|
|
206
|
+
slides.set(el, slide);
|
|
207
|
+
started.push(slide);
|
|
208
|
+
});
|
|
209
|
+
return started;
|
|
210
|
+
}
|
|
211
|
+
function moveBlock(from, to) {
|
|
212
|
+
let moved = false;
|
|
213
|
+
flushSync(() => {
|
|
214
|
+
moved = moveLiveBlock(from, to);
|
|
215
|
+
});
|
|
216
|
+
return moved;
|
|
217
|
+
}
|
|
218
|
+
function useLayoutTick() {
|
|
219
|
+
const [, setTick] = useState(0);
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
let frame = 0;
|
|
222
|
+
const schedule = () => {
|
|
223
|
+
if (frame) return;
|
|
224
|
+
frame = requestAnimationFrame(() => {
|
|
225
|
+
frame = 0;
|
|
226
|
+
setTick((n) => n + 1);
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
window.addEventListener("scroll", schedule, { capture: true, passive: true });
|
|
230
|
+
window.addEventListener("resize", schedule);
|
|
231
|
+
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(schedule) : null;
|
|
232
|
+
observer?.observe(document.body);
|
|
233
|
+
return () => {
|
|
234
|
+
cancelAnimationFrame(frame);
|
|
235
|
+
window.removeEventListener("scroll", schedule, { capture: true });
|
|
236
|
+
window.removeEventListener("resize", schedule);
|
|
237
|
+
observer?.disconnect();
|
|
238
|
+
};
|
|
239
|
+
}, []);
|
|
240
|
+
return () => setTick((n) => n + 1);
|
|
241
|
+
}
|
|
242
|
+
function CanvasBox({ kind, target, at, title, hovered, labels, onTag, onAdd, onHandle }) {
|
|
243
|
+
const shown = target?.isConnected ? target : null;
|
|
244
|
+
const box = shown ? boxOf(shown) : null;
|
|
245
|
+
const role = shown ? roleOf(shown) : null;
|
|
246
|
+
const className = [
|
|
247
|
+
"s-canvas-box",
|
|
248
|
+
`s-canvas-box--${kind}`,
|
|
249
|
+
role && role !== "component" ? "is-fixed" : "",
|
|
250
|
+
shown && partOf(shown) ? "is-part" : "",
|
|
251
|
+
box && box.top < 12 ? "is-top" : "",
|
|
252
|
+
hovered ? "is-hovered" : ""
|
|
253
|
+
].filter(Boolean).join(" ");
|
|
254
|
+
const style = box ? {
|
|
255
|
+
display: "block",
|
|
256
|
+
top: box.top - at.top,
|
|
257
|
+
left: box.left - at.left,
|
|
258
|
+
width: box.width,
|
|
259
|
+
height: box.height
|
|
260
|
+
} : void 0;
|
|
261
|
+
return /* @__PURE__ */ jsxs("div", { className, style, "data-testid": `canvas-box-${kind}`, children: [
|
|
262
|
+
/* @__PURE__ */ jsxs(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
className: "s-canvas-tag",
|
|
266
|
+
"aria-hidden": "true",
|
|
267
|
+
"data-testid": `canvas-tag-${kind}`,
|
|
268
|
+
onClick: () => shown && onTag(shown),
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ jsx(
|
|
271
|
+
"span",
|
|
272
|
+
{
|
|
273
|
+
className: "s-canvas-handle",
|
|
274
|
+
"data-testid": `canvas-handle-${kind}`,
|
|
275
|
+
onPointerDown: (event) => shown && onHandle(event, shown),
|
|
276
|
+
children: DRAG_ICON
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
/* @__PURE__ */ jsx("span", { className: "s-canvas-title", "data-testid": `canvas-title-${kind}`, children: title })
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ jsxs(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
className: "s-canvas-add",
|
|
287
|
+
"aria-hidden": "true",
|
|
288
|
+
"data-testid": `canvas-add-${kind}`,
|
|
289
|
+
onClick: () => shown && onAdd(shown),
|
|
290
|
+
children: [
|
|
291
|
+
ADD_ICON,
|
|
292
|
+
/* @__PURE__ */ jsx("span", { className: "s-canvas-tip", "data-testid": `canvas-tip-${kind}`, children: labels.add_here })
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
] });
|
|
297
|
+
}
|
|
298
|
+
function CanvasOverlay({
|
|
299
|
+
origin,
|
|
300
|
+
blocks
|
|
301
|
+
}) {
|
|
302
|
+
const labels = useLabels();
|
|
303
|
+
const [root, setRoot] = useState(null);
|
|
304
|
+
const [layer, setLayer] = useState(null);
|
|
305
|
+
const [hovered, setHovered] = useState(null);
|
|
306
|
+
const [selected, setSelected] = useState(null);
|
|
307
|
+
const [drop, setDrop] = useState(null);
|
|
308
|
+
const [dragging, setDragging] = useState(false);
|
|
309
|
+
const [names, setNames] = useState(() => ({
|
|
310
|
+
map: /* @__PURE__ */ new WeakMap(),
|
|
311
|
+
listed: false,
|
|
312
|
+
seen: /* @__PURE__ */ new WeakSet()
|
|
313
|
+
}));
|
|
314
|
+
const hoveredRef = useRef(null);
|
|
315
|
+
const selectedRef = useRef(null);
|
|
316
|
+
const namesRef = useRef(names);
|
|
317
|
+
const drag = useRef(null);
|
|
318
|
+
const lastRect = useRef("");
|
|
319
|
+
const wanted = useRef(null);
|
|
320
|
+
const listed = useRef(blocks);
|
|
321
|
+
const refresh = useLayoutTick();
|
|
322
|
+
const post = (message) => postToCanvas(origin, message);
|
|
323
|
+
const hover = (el) => {
|
|
324
|
+
if (hoveredRef.current === el) return;
|
|
325
|
+
hoveredRef.current = el;
|
|
326
|
+
setHovered(el);
|
|
327
|
+
};
|
|
328
|
+
const select = (target, reveal = false) => {
|
|
329
|
+
wanted.current = null;
|
|
330
|
+
if (!idOf(target, namesRef.current)) {
|
|
331
|
+
if (selectedRef.current === target) deselect(true);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
selectedRef.current = target;
|
|
335
|
+
setSelected(target);
|
|
336
|
+
if (reveal) target.scrollIntoView({ block: "nearest" });
|
|
337
|
+
const rect = rectOf(target);
|
|
338
|
+
lastRect.current = JSON.stringify(rect);
|
|
339
|
+
const named = namesRef.current;
|
|
340
|
+
post({
|
|
341
|
+
type: "select",
|
|
342
|
+
eid: idOf(target, named),
|
|
343
|
+
role: roleOf(target),
|
|
344
|
+
tag: target.tagName.toLowerCase(),
|
|
345
|
+
text: titleOf(target, named, labels),
|
|
346
|
+
part: partOf(target),
|
|
347
|
+
idx: null,
|
|
348
|
+
rect,
|
|
349
|
+
...neighbours(target, named)
|
|
350
|
+
});
|
|
351
|
+
};
|
|
352
|
+
const deselect = (notify) => {
|
|
353
|
+
wanted.current = null;
|
|
354
|
+
if (!selectedRef.current) return;
|
|
355
|
+
selectedRef.current = null;
|
|
356
|
+
setSelected(null);
|
|
357
|
+
lastRect.current = "";
|
|
358
|
+
if (notify) post({ type: "deselect" });
|
|
359
|
+
};
|
|
360
|
+
const reordered = (target) => {
|
|
361
|
+
post({
|
|
362
|
+
type: "reorder",
|
|
363
|
+
eid: idOf(target, namesRef.current),
|
|
364
|
+
after: neighbours(target, namesRef.current).prev
|
|
365
|
+
});
|
|
366
|
+
select(target);
|
|
367
|
+
refresh();
|
|
368
|
+
};
|
|
369
|
+
const follow = (slides2) => {
|
|
370
|
+
if (!slides2?.length) return;
|
|
371
|
+
const until = performance.now() + SLIDE_MS + 50;
|
|
372
|
+
const tick = () => {
|
|
373
|
+
refresh();
|
|
374
|
+
if (performance.now() < until) requestAnimationFrame(tick);
|
|
375
|
+
};
|
|
376
|
+
requestAnimationFrame(tick);
|
|
377
|
+
};
|
|
378
|
+
const move = (eid, direction) => {
|
|
379
|
+
const target = find(eid, void 0, namesRef.current);
|
|
380
|
+
if (!target || roleOf(target) !== "component") return;
|
|
381
|
+
const list = siblings(target);
|
|
382
|
+
const at2 = list.indexOf(target);
|
|
383
|
+
const to = direction === "up" ? at2 - 1 : at2 + 1;
|
|
384
|
+
if (to < 0 || to >= list.length) return;
|
|
385
|
+
const slides2 = slideBlocks(list, () => {
|
|
386
|
+
if (!moveBlock(at2, to)) return false;
|
|
387
|
+
target.scrollIntoView({ block: "nearest" });
|
|
388
|
+
return true;
|
|
389
|
+
});
|
|
390
|
+
if (!slides2) return;
|
|
391
|
+
reordered(target);
|
|
392
|
+
follow(slides2);
|
|
393
|
+
};
|
|
394
|
+
const order = (eids) => {
|
|
395
|
+
const targets = eids.map((eid) => findBlock(eid, namesRef.current)).filter((el) => !!el && roleOf(el) === "component");
|
|
396
|
+
const list = targets.length ? siblings(targets[0]) : [];
|
|
397
|
+
const inList = new Set(list);
|
|
398
|
+
const placed = targets.filter((el) => inList.has(el));
|
|
399
|
+
if (!placed.length) return;
|
|
400
|
+
const isPlaced = new Set(placed);
|
|
401
|
+
const laidOut = [...placed, ...list.filter((el) => !isPlaced.has(el))];
|
|
402
|
+
const current = [...list];
|
|
403
|
+
const slides2 = slideBlocks(list, () => {
|
|
404
|
+
flushSync(() => {
|
|
405
|
+
laidOut.forEach((el, to) => {
|
|
406
|
+
const from = current.indexOf(el);
|
|
407
|
+
if (from === to || !moveLiveBlock(from, to)) return;
|
|
408
|
+
current.splice(to, 0, ...current.splice(from, 1));
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
return true;
|
|
412
|
+
});
|
|
413
|
+
refresh();
|
|
414
|
+
follow(slides2);
|
|
415
|
+
};
|
|
416
|
+
const placeDrop = (y) => {
|
|
417
|
+
const state = drag.current;
|
|
418
|
+
if (!state || !layer) return;
|
|
419
|
+
const { list, target } = state;
|
|
420
|
+
let place = list.findIndex((item) => {
|
|
421
|
+
const box3 = boxOf(item);
|
|
422
|
+
return y < box3.top + box3.height / 2;
|
|
423
|
+
});
|
|
424
|
+
if (place === -1) place = list.length;
|
|
425
|
+
const from = list.indexOf(target);
|
|
426
|
+
state.place = place === from || place === from + 1 ? null : place;
|
|
427
|
+
if (state.place === null) {
|
|
428
|
+
setDrop(null);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const anchor = list[place] ?? list[list.length - 1];
|
|
432
|
+
const box2 = boxOf(anchor);
|
|
433
|
+
const at2 = layer.getBoundingClientRect();
|
|
434
|
+
setDrop({
|
|
435
|
+
top: (list[place] ? box2.top : box2.top + box2.height) - at2.top,
|
|
436
|
+
left: box2.left - at2.left,
|
|
437
|
+
width: box2.width
|
|
438
|
+
});
|
|
439
|
+
};
|
|
440
|
+
const dragStep = () => {
|
|
441
|
+
const state = drag.current;
|
|
442
|
+
if (!state) return;
|
|
443
|
+
state.frame = 0;
|
|
444
|
+
const { y } = state;
|
|
445
|
+
const bottom = window.innerHeight - DRAG_EDGE;
|
|
446
|
+
const over = y < DRAG_EDGE ? y - DRAG_EDGE : y > bottom ? y - bottom : 0;
|
|
447
|
+
if (over) window.scrollBy(0, Math.max(-DRAG_EDGE, Math.min(DRAG_EDGE, over)) / 3);
|
|
448
|
+
placeDrop(y);
|
|
449
|
+
if (over) state.frame = requestAnimationFrame(() => latest.current.dragStep());
|
|
450
|
+
};
|
|
451
|
+
const startDrag = (event, target) => {
|
|
452
|
+
const unnamed = !idOf(target, namesRef.current);
|
|
453
|
+
if (roleOf(target) !== "component" || event.button !== 0 || unnamed) return;
|
|
454
|
+
event.preventDefault();
|
|
455
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
456
|
+
siblings(target).forEach((el) => slides.get(el)?.finish());
|
|
457
|
+
drag.current = { target, list: siblings(target), place: null, y: event.clientY, frame: 0 };
|
|
458
|
+
setDragging(true);
|
|
459
|
+
if (selectedRef.current !== target) select(target);
|
|
460
|
+
};
|
|
461
|
+
const endDrag = (event) => {
|
|
462
|
+
const state = drag.current;
|
|
463
|
+
if (!state) return;
|
|
464
|
+
if (event.type !== "pointercancel") placeDrop(state.y);
|
|
465
|
+
drag.current = null;
|
|
466
|
+
cancelAnimationFrame(state.frame);
|
|
467
|
+
setDrop(null);
|
|
468
|
+
setDragging(false);
|
|
469
|
+
const { target, list, place } = state;
|
|
470
|
+
if (place === null || event.type === "pointercancel") return;
|
|
471
|
+
const from = list.indexOf(target);
|
|
472
|
+
const slides2 = slideBlocks(list, () => moveBlock(from, place > from ? place - 1 : place));
|
|
473
|
+
if (!slides2) return;
|
|
474
|
+
reordered(target);
|
|
475
|
+
follow(slides2);
|
|
476
|
+
};
|
|
477
|
+
const onPointerMove = (event) => {
|
|
478
|
+
const state = drag.current;
|
|
479
|
+
if (state) {
|
|
480
|
+
state.y = event.clientY;
|
|
481
|
+
if (!state.frame) state.frame = requestAnimationFrame(() => latest.current.dragStep());
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
if (layer?.contains(event.target)) return;
|
|
485
|
+
const target = pick(event.target);
|
|
486
|
+
hover(target && idOf(target, namesRef.current) ? target : null);
|
|
487
|
+
};
|
|
488
|
+
const onLeave = (event) => {
|
|
489
|
+
if (event.relatedTarget || drag.current) return;
|
|
490
|
+
hover(null);
|
|
491
|
+
};
|
|
492
|
+
const onClick = (event) => {
|
|
493
|
+
if (layer?.contains(event.target)) return;
|
|
494
|
+
event.preventDefault();
|
|
495
|
+
event.stopPropagation();
|
|
496
|
+
const target = pick(event.target);
|
|
497
|
+
if (target) select(target);
|
|
498
|
+
else deselect(true);
|
|
499
|
+
};
|
|
500
|
+
const swallow = (event) => {
|
|
501
|
+
if (layer?.contains(event.target)) return;
|
|
502
|
+
event.preventDefault();
|
|
503
|
+
event.stopPropagation();
|
|
504
|
+
};
|
|
505
|
+
const onKey = (event) => {
|
|
506
|
+
if (event.key === "Escape") deselect(true);
|
|
507
|
+
};
|
|
508
|
+
const onCommand = (command) => {
|
|
509
|
+
switch (command.type) {
|
|
510
|
+
case "select": {
|
|
511
|
+
const target = find(command.eid, command.part, namesRef.current);
|
|
512
|
+
if (target) select(target, true);
|
|
513
|
+
else {
|
|
514
|
+
deselect(false);
|
|
515
|
+
post({ type: "deselect" });
|
|
516
|
+
wanted.current = { eid: command.eid, part: command.part };
|
|
517
|
+
}
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
case "deselect":
|
|
521
|
+
wanted.current = null;
|
|
522
|
+
deselect(false);
|
|
523
|
+
break;
|
|
524
|
+
case "move":
|
|
525
|
+
move(command.eid, command.direction);
|
|
526
|
+
break;
|
|
527
|
+
case "order":
|
|
528
|
+
order(command.eids);
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
const rename = (retell) => {
|
|
533
|
+
const before = namesRef.current;
|
|
534
|
+
const next = nameBlocks(listed.current);
|
|
535
|
+
namesRef.current = next;
|
|
536
|
+
setNames(next);
|
|
537
|
+
if (hoveredRef.current && !idOf(hoveredRef.current, next)) hover(null);
|
|
538
|
+
const asked = wanted.current;
|
|
539
|
+
const target = asked ? find(asked.eid, asked.part, next) : selectedRef.current;
|
|
540
|
+
if (!target?.isConnected) return;
|
|
541
|
+
if (asked || retell || idOf(target, before) !== idOf(target, next)) select(target, !!asked);
|
|
542
|
+
};
|
|
543
|
+
const handlers = {
|
|
544
|
+
onPointerMove,
|
|
545
|
+
endDrag,
|
|
546
|
+
onLeave,
|
|
547
|
+
onClick,
|
|
548
|
+
swallow,
|
|
549
|
+
onKey,
|
|
550
|
+
onCommand,
|
|
551
|
+
dragStep,
|
|
552
|
+
rename
|
|
553
|
+
};
|
|
554
|
+
const latest = useRef(handlers);
|
|
555
|
+
useEffect(() => {
|
|
556
|
+
latest.current = handlers;
|
|
557
|
+
});
|
|
558
|
+
useEffect(() => setRoot(document.body), []);
|
|
559
|
+
useLayoutEffect(() => {
|
|
560
|
+
listed.current = blocks;
|
|
561
|
+
latest.current.rename(true);
|
|
562
|
+
}, [blocks]);
|
|
563
|
+
useEffect(() => {
|
|
564
|
+
if (typeof MutationObserver === "undefined") return;
|
|
565
|
+
const observer = new MutationObserver(() => {
|
|
566
|
+
if (pageBlocks().some((el) => !namesRef.current.seen.has(el))) latest.current.rename(false);
|
|
567
|
+
});
|
|
568
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
569
|
+
return () => observer.disconnect();
|
|
570
|
+
}, []);
|
|
571
|
+
useEffect(() => {
|
|
572
|
+
const pointerMove = (event) => latest.current.onPointerMove(event);
|
|
573
|
+
const pointerUp = (event) => latest.current.endDrag(event);
|
|
574
|
+
const mouseOut = (event) => latest.current.onLeave(event);
|
|
575
|
+
const click = (event) => latest.current.onClick(event);
|
|
576
|
+
const doubleClick = (event) => latest.current.swallow(event);
|
|
577
|
+
const keyDown = (event) => latest.current.onKey(event);
|
|
578
|
+
window.addEventListener("pointermove", pointerMove, { passive: true });
|
|
579
|
+
window.addEventListener("pointerup", pointerUp);
|
|
580
|
+
window.addEventListener("pointercancel", pointerUp);
|
|
581
|
+
document.addEventListener("mouseout", mouseOut);
|
|
582
|
+
window.addEventListener("click", click, true);
|
|
583
|
+
window.addEventListener("dblclick", doubleClick, true);
|
|
584
|
+
window.addEventListener("keydown", keyDown);
|
|
585
|
+
const stop = takeCanvasCommands((command) => latest.current.onCommand(command));
|
|
586
|
+
return () => {
|
|
587
|
+
window.removeEventListener("pointermove", pointerMove);
|
|
588
|
+
window.removeEventListener("pointerup", pointerUp);
|
|
589
|
+
window.removeEventListener("pointercancel", pointerUp);
|
|
590
|
+
document.removeEventListener("mouseout", mouseOut);
|
|
591
|
+
window.removeEventListener("click", click, true);
|
|
592
|
+
window.removeEventListener("dblclick", doubleClick, true);
|
|
593
|
+
window.removeEventListener("keydown", keyDown);
|
|
594
|
+
stop();
|
|
595
|
+
if (drag.current) cancelAnimationFrame(drag.current.frame);
|
|
596
|
+
drag.current = null;
|
|
597
|
+
};
|
|
598
|
+
}, []);
|
|
599
|
+
useEffect(() => {
|
|
600
|
+
const target = selectedRef.current;
|
|
601
|
+
if (!target) return;
|
|
602
|
+
if (!target.isConnected) {
|
|
603
|
+
deselect(true);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
const rect = rectOf(target);
|
|
607
|
+
const key = JSON.stringify(rect);
|
|
608
|
+
if (key === lastRect.current) return;
|
|
609
|
+
lastRect.current = key;
|
|
610
|
+
post({ type: "rect", eid: idOf(target, namesRef.current), part: partOf(target), rect });
|
|
611
|
+
});
|
|
612
|
+
if (!root) return null;
|
|
613
|
+
const at = layer ? layer.getBoundingClientRect() : { top: 0, left: 0 };
|
|
614
|
+
const box = (kind, target, isHovered = false) => /* @__PURE__ */ jsx(
|
|
615
|
+
CanvasBox,
|
|
616
|
+
{
|
|
617
|
+
kind,
|
|
618
|
+
target,
|
|
619
|
+
at,
|
|
620
|
+
title: target?.isConnected ? titleOf(target, names, labels) : "",
|
|
621
|
+
hovered: isHovered,
|
|
622
|
+
labels,
|
|
623
|
+
onTag: (el) => {
|
|
624
|
+
if (el !== selectedRef.current) select(el);
|
|
625
|
+
},
|
|
626
|
+
onAdd: (el) => {
|
|
627
|
+
const eid = idOf(el, namesRef.current);
|
|
628
|
+
if (eid) post({ type: "add", eid, place: "before" });
|
|
629
|
+
},
|
|
630
|
+
onHandle: startDrag
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
return createPortal(
|
|
634
|
+
/* @__PURE__ */ jsxs("div", { ref: setLayer, className: "s-canvas-layer", "data-testid": "canvas-overlay-layer", children: [
|
|
635
|
+
/* @__PURE__ */ jsx("style", { children: CANVAS_CSS }),
|
|
636
|
+
dragging && /* @__PURE__ */ jsx("style", { children: DRAGGING_CSS }),
|
|
637
|
+
box("parent", selected && partOf(selected) ? targetOf(selected) : null),
|
|
638
|
+
box("hover", hovered !== selected ? hovered : null),
|
|
639
|
+
box("select", selected, !!selected && hovered === selected),
|
|
640
|
+
/* @__PURE__ */ jsx(
|
|
641
|
+
"div",
|
|
642
|
+
{
|
|
643
|
+
className: "s-canvas-drop",
|
|
644
|
+
"data-testid": "canvas-drop-line",
|
|
645
|
+
style: drop ? { display: "block", ...drop } : void 0
|
|
646
|
+
}
|
|
647
|
+
)
|
|
648
|
+
] }),
|
|
649
|
+
root
|
|
650
|
+
);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export { CanvasOverlay };
|
|
654
|
+
//# sourceMappingURL=CanvasOverlay-IBVG2YOL.js.map
|
|
655
|
+
//# sourceMappingURL=CanvasOverlay-IBVG2YOL.js.map
|