@stacksjs/stx 0.2.413 → 0.2.415
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/appearance-bootstrap.js +1 -1
- package/dist/binding-manifest.d.ts +1 -1
- package/dist/builtins/image-delivery.js +19 -11
- package/dist/bundle-analyzer.js +20 -20
- package/dist/chunk-020xyn9q.js +3 -0
- package/dist/chunk-04jhmfbz.js +2 -0
- package/dist/chunk-0pnj3zt2.js +2 -0
- package/dist/{chunk-bwjxk1dw.js → chunk-0zaess6f.js} +29 -29
- package/dist/chunk-1098mas0.js +2 -0
- package/dist/chunk-169n1vpx.js +12 -0
- package/dist/chunk-18vmfkcc.js +2 -0
- package/dist/chunk-1b6t12hd.js +2 -0
- package/dist/chunk-1xdzcy9d.js +14 -0
- package/dist/chunk-1zs30k3y.js +2 -0
- package/dist/chunk-2ce7f416.js +2 -0
- package/dist/chunk-340a824p.js +2 -0
- package/dist/chunk-393341w7.js +2 -0
- package/dist/chunk-39g1134q.js +2 -0
- package/dist/chunk-3efw27as.js +2785 -0
- package/dist/chunk-3kthfs03.js +3 -0
- package/dist/chunk-3qn1wcdg.js +2 -0
- package/dist/chunk-3s2vnqcf.js +2 -0
- package/dist/chunk-42wbs8vq.js +17 -0
- package/dist/chunk-4bjravgk.js +2 -0
- package/dist/chunk-5gsxpaqk.js +2 -0
- package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
- package/dist/chunk-6cfa3g0r.js +2 -0
- package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
- package/dist/chunk-6hc5vz20.js +3 -0
- package/dist/chunk-6q6g76vg.js +499 -0
- package/dist/chunk-74j18qk0.js +930 -0
- package/dist/chunk-752hw7cd.js +4 -0
- package/dist/{chunk-kgd8kchy.js → chunk-765e1s44.js} +11 -76
- package/dist/chunk-7gkv67ky.js +4 -0
- package/dist/chunk-7z2ra0yf.js +2 -0
- package/dist/chunk-8eqrwj1k.js +20 -0
- package/dist/chunk-8nhshfz6.js +5 -0
- package/dist/chunk-92ps1xpk.js +2 -0
- package/dist/chunk-96k8s808.js +3 -0
- package/dist/chunk-9amp82bx.js +7 -0
- package/dist/chunk-9g27ybyr.js +3 -0
- package/dist/chunk-9p9qkbtg.js +3 -0
- package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
- package/dist/{chunk-24zher49.js → chunk-9vrja6vp.js} +4 -4
- package/dist/chunk-9xrbve19.js +2 -0
- package/dist/chunk-a688m6js.js +3 -0
- package/dist/chunk-ak1cgcah.js +5 -0
- package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
- package/dist/chunk-amtr3rmf.js +11 -0
- package/dist/chunk-atws6p5s.js +2 -0
- package/dist/chunk-b84h16er.js +61 -0
- package/dist/chunk-b98be3yp.js +32 -0
- package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
- package/dist/chunk-ce1sejr3.js +3 -0
- package/dist/chunk-cg8hg6cs.js +3 -0
- package/dist/{chunk-4f9zyfdw.js → chunk-czxt605c.js} +4 -5
- package/dist/chunk-dd8cja4h.js +2 -0
- package/dist/chunk-dgdm3hy3.js +2 -0
- package/dist/chunk-e9hs7kk6.js +12 -0
- package/dist/chunk-eed4fwps.js +3 -0
- package/dist/chunk-ej9j6k1q.js +3 -0
- package/dist/chunk-et0rr8c7.js +3 -0
- package/dist/chunk-f1sxycmv.js +2 -0
- package/dist/chunk-f46qsp4m.js +4 -0
- package/dist/chunk-fbcv4fes.js +2 -0
- package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
- package/dist/chunk-fjs0a8h7.js +2 -0
- package/dist/chunk-fpfzm238.js +2 -0
- package/dist/chunk-fr2txj8q.js +829 -0
- package/dist/{chunk-xssw417m.js → chunk-ft4p6d28.js} +14 -14
- package/dist/chunk-fyzajkrx.js +2 -0
- package/dist/chunk-fzapbw9p.js +3 -0
- package/dist/chunk-g03s93qr.js +3 -0
- package/dist/chunk-g186znp9.js +33 -0
- package/dist/chunk-gawrg4gb.js +216 -0
- package/dist/chunk-gc1drn2p.js +2 -0
- package/dist/chunk-gea5hf0v.js +2 -0
- package/dist/chunk-gqv3ta5d.js +2 -0
- package/dist/chunk-h6kp2m9r.js +2 -0
- package/dist/chunk-h6zsqb9r.js +3 -0
- package/dist/{chunk-2snqdnk9.js → chunk-h85hrwkq.js} +13 -13
- package/dist/chunk-hbxz85wy.js +2 -0
- package/dist/chunk-hepd9qgx.js +6 -0
- package/dist/chunk-hhnw2sn3.js +2 -0
- package/dist/chunk-hjg3ndgh.js +2 -0
- package/dist/chunk-hk1mj4tz.js +2 -0
- package/dist/{chunk-smcj3442.js → chunk-hkrmcbwy.js} +79 -79
- package/dist/chunk-hn9pkyv8.js +2 -0
- package/dist/chunk-hpgr4qgp.js +2 -0
- package/dist/chunk-hrbbbtbn.js +2 -0
- package/dist/chunk-j03revz2.js +8 -0
- package/dist/chunk-j9qcrwbg.js +2 -0
- package/dist/chunk-jk4njz0w.js +2 -0
- package/dist/chunk-jmabeqfq.js +2 -0
- package/dist/chunk-jnkrn913.js +4 -0
- package/dist/chunk-jp10q90g.js +2 -0
- package/dist/chunk-jt0n43mk.js +2 -0
- package/dist/chunk-kjbv8a3m.js +2 -0
- package/dist/chunk-m1vdghnx.js +2 -0
- package/dist/chunk-m4sk62wb.js +5 -0
- package/dist/chunk-md8rqn48.js +30 -0
- package/dist/chunk-mp6hy8g4.js +2 -0
- package/dist/chunk-nc8my58s.js +2 -0
- package/dist/chunk-ngc2wke4.js +3 -0
- package/dist/chunk-nn2vstke.js +2 -0
- package/dist/chunk-nppdrf0x.js +2 -0
- package/dist/chunk-p2v2a68k.js +2 -0
- package/dist/chunk-pazfr1a1.js +2 -0
- package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
- package/dist/chunk-pdb5fw3r.js +2 -0
- package/dist/chunk-pdt69hpb.js +2 -0
- package/dist/chunk-pgzvyrv6.js +29 -0
- package/dist/chunk-px7fvbj6.js +3 -0
- package/dist/chunk-q6vrb2pe.js +2 -0
- package/dist/chunk-q7qchkvk.js +2 -0
- package/dist/chunk-q9bdh4s5.js +8 -0
- package/dist/chunk-qghxz7jm.js +194 -0
- package/dist/chunk-r3f9jcf7.js +5 -0
- package/dist/chunk-re8b5r9x.js +3 -0
- package/dist/chunk-s5xezjps.js +3 -0
- package/dist/chunk-sd321bn3.js +2 -0
- package/dist/chunk-shr559s7.js +3 -0
- package/dist/chunk-t4hzprsm.js +3 -0
- package/dist/chunk-t5pvq5mx.js +2 -0
- package/dist/{chunk-pv3d7sfn.js → chunk-t61vdbje.js} +89 -89
- package/dist/chunk-tafqyf2g.js +2033 -0
- package/dist/chunk-tfexmdkt.js +3 -0
- package/dist/chunk-thyt8ed8.js +6 -0
- package/dist/chunk-v91p6ekp.js +24 -0
- package/dist/chunk-vgvtnwxa.js +4 -0
- package/dist/chunk-w72qx0eb.js +2 -0
- package/dist/chunk-wfy1zq53.js +30 -0
- package/dist/chunk-wzx0164n.js +18 -0
- package/dist/chunk-x0q32ees.js +3 -0
- package/dist/chunk-xfp7k0v8.js +64 -0
- package/dist/chunk-xtvf6n6f.js +4 -0
- package/dist/chunk-xwzvfqcb.js +2 -0
- package/dist/chunk-y1cmjvk3.js +43 -0
- package/dist/chunk-y5310237.js +311 -0
- package/dist/chunk-ya0qecph.js +27 -0
- package/dist/chunk-yazk54jr.js +8 -0
- package/dist/chunk-ydjfar14.js +2 -0
- package/dist/chunk-ym95v4nc.js +3 -0
- package/dist/chunk-z0g9jvv0.js +40 -0
- package/dist/chunk-z23kaxq6.js +2 -0
- package/dist/chunk-z8xn5ta3.js +2 -0
- package/dist/{chunk-8sdhs0zk.js → chunk-zhxdpzga.js} +4 -4
- package/dist/cli.js +110 -110
- package/dist/craft-entry.js +7 -7
- package/dist/craft.js +7 -7
- package/dist/database.js +2 -2
- package/dist/image-optimization/component.js +4 -4
- package/dist/media/image/component.js +5 -5
- package/dist/media/protected/component.js +2 -2
- package/dist/media/video/index.js +4 -4
- package/dist/native/bridge/protocol.d.ts +325 -0
- package/dist/native/bridge/protocol.js +219 -0
- package/dist/native/cli.d.ts +24 -0
- package/dist/native/cli.js +52 -0
- package/dist/native/compiler/bundle.d.ts +41 -0
- package/dist/native/compiler/bundle.js +90 -0
- package/dist/native/compiler/client-script.d.ts +8 -0
- package/dist/native/compiler/client-script.js +31 -0
- package/dist/native/compiler/codegen.d.ts +10 -0
- package/dist/native/compiler/codegen.js +145 -0
- package/dist/native/compiler/headwind-to-style.d.ts +395 -0
- package/dist/native/compiler/headwind-to-style.js +1163 -0
- package/dist/native/compiler/html-to-ir.d.ts +41 -0
- package/dist/native/compiler/html-to-ir.js +411 -0
- package/dist/native/compiler/icons.d.ts +220 -0
- package/dist/native/compiler/icons.js +208 -0
- package/dist/native/compiler/ir.d.ts +234 -0
- package/dist/native/compiler/ir.js +15 -0
- package/dist/native/compiler/parser.d.ts +88 -0
- package/dist/native/compiler/parser.js +753 -0
- package/dist/native/compiler/render-screen.d.ts +26 -0
- package/dist/native/compiler/render-screen.js +31 -0
- package/dist/native/components/primitives.d.ts +291 -0
- package/dist/native/components/primitives.js +22 -0
- package/dist/native/hot-reload/client.d.ts +62 -0
- package/dist/native/hot-reload/client.js +324 -0
- package/dist/native/index.d.ts +90 -0
- package/dist/native/index.js +34 -0
- package/dist/native/primitives/ActivityIndicator.stx +5 -0
- package/dist/native/primitives/Button.stx +5 -0
- package/dist/native/primitives/DatePicker.stx +5 -0
- package/dist/native/primitives/FlatList.stx +5 -0
- package/dist/native/primitives/Image.stx +5 -0
- package/dist/native/primitives/ImageBackground.stx +5 -0
- package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
- package/dist/native/primitives/Modal.stx +5 -0
- package/dist/native/primitives/Picker.stx +5 -0
- package/dist/native/primitives/Pressable.stx +5 -0
- package/dist/native/primitives/RefreshControl.stx +5 -0
- package/dist/native/primitives/SafeAreaView.stx +5 -0
- package/dist/native/primitives/ScrollView.stx +5 -0
- package/dist/native/primitives/SectionList.stx +5 -0
- package/dist/native/primitives/Slider.stx +5 -0
- package/dist/native/primitives/StatusBar.stx +5 -0
- package/dist/native/primitives/Switch.stx +5 -0
- package/dist/native/primitives/Text.stx +5 -0
- package/dist/native/primitives/TextInput.stx +5 -0
- package/dist/native/primitives/TouchableHighlight.stx +5 -0
- package/dist/native/primitives/TouchableOpacity.stx +5 -0
- package/dist/native/primitives/View.stx +5 -0
- package/dist/native/runtime/craft.d.ts +75 -0
- package/dist/native/runtime/craft.js +0 -0
- package/dist/native/runtime/entry.d.ts +1 -0
- package/dist/native/runtime/entry.js +3 -0
- package/dist/native/runtime/index.d.ts +45 -0
- package/dist/native/runtime/index.js +165 -0
- package/dist/native/runtime/native-host.d.ts +33 -0
- package/dist/native/runtime/native-host.js +184 -0
- package/dist/native/runtime/screen.d.ts +43 -0
- package/dist/native/runtime/screen.js +808 -0
- package/dist/pwa/service-worker.js +1 -1
- package/dist/pwa/workbox.js +1 -1
- package/dist/pwa.js +8 -8
- package/dist/site-url.d.ts +1 -1
- package/dist/ssg.js +53 -53
- package/dist/visual-testing.js +42 -42
- package/dist/web-components/reactive-generator.js +2 -2
- package/package.json +9 -5
- package/dist/chunk-0btmm4m2.js +0 -147
- package/dist/chunk-0c2h69k2.js +0 -4
- package/dist/chunk-0d0qeqvv.js +0 -2
- package/dist/chunk-0psndabd.js +0 -2
- package/dist/chunk-0qv8yf53.js +0 -2
- package/dist/chunk-0vkxyvsd.js +0 -2
- package/dist/chunk-0we9nw1d.js +0 -3
- package/dist/chunk-0xqdmemy.js +0 -3
- package/dist/chunk-0y46fbkx.js +0 -3
- package/dist/chunk-158wqccn.js +0 -4422
- package/dist/chunk-1cyxbb8y.js +0 -16
- package/dist/chunk-1enwnh2a.js +0 -2
- package/dist/chunk-213pzm0d.js +0 -3
- package/dist/chunk-21hzqyja.js +0 -12
- package/dist/chunk-266t58b8.js +0 -5
- package/dist/chunk-27fgag95.js +0 -4
- package/dist/chunk-2a9n102n.js +0 -2
- package/dist/chunk-2eqzrczk.js +0 -2
- package/dist/chunk-2ke37m54.js +0 -14
- package/dist/chunk-35ds08e7.js +0 -3
- package/dist/chunk-3mtwkjcg.js +0 -2
- package/dist/chunk-4xr8zwkp.js +0 -2
- package/dist/chunk-58v77x2c.js +0 -2
- package/dist/chunk-5mhq8605.js +0 -2
- package/dist/chunk-5se8xt9e.js +0 -64
- package/dist/chunk-5zh0h080.js +0 -2
- package/dist/chunk-62435225.js +0 -2
- package/dist/chunk-6kdrncsx.js +0 -30
- package/dist/chunk-6n2rr3x7.js +0 -2
- package/dist/chunk-6xk87qf2.js +0 -30
- package/dist/chunk-72rwcbp6.js +0 -3
- package/dist/chunk-76w34xne.js +0 -3
- package/dist/chunk-7ekd7zj9.js +0 -2
- package/dist/chunk-7pr3wdd5.js +0 -3
- package/dist/chunk-7rxvafwc.js +0 -24
- package/dist/chunk-7tnwfa7w.js +0 -8
- package/dist/chunk-8c5je0wf.js +0 -2
- package/dist/chunk-8dz6nyvx.js +0 -2
- package/dist/chunk-98zj3fv2.js +0 -7
- package/dist/chunk-9e8t0twa.js +0 -3
- package/dist/chunk-9fqp72ze.js +0 -5
- package/dist/chunk-anydpa34.js +0 -3
- package/dist/chunk-ay6zjq8v.js +0 -3
- package/dist/chunk-az4v4ard.js +0 -3
- package/dist/chunk-ba5erggg.js +0 -2
- package/dist/chunk-bnagrdz6.js +0 -2
- package/dist/chunk-by8wghtf.js +0 -2
- package/dist/chunk-cd7h4q51.js +0 -2
- package/dist/chunk-cjmv8hgp.js +0 -33
- package/dist/chunk-cthf912y.js +0 -2
- package/dist/chunk-cxbpmwq5.js +0 -4
- package/dist/chunk-d3sy16qn.js +0 -2
- package/dist/chunk-dh6s7mrj.js +0 -1199
- package/dist/chunk-dm2nzg7a.js +0 -2
- package/dist/chunk-e2sgcnxc.js +0 -2
- package/dist/chunk-e3b7jj74.js +0 -2
- package/dist/chunk-ec4wq2sv.js +0 -6
- package/dist/chunk-ekzg97dn.js +0 -29
- package/dist/chunk-epjt342x.js +0 -2
- package/dist/chunk-eqe26g14.js +0 -18
- package/dist/chunk-ev0v1yma.js +0 -2
- package/dist/chunk-f53psr2y.js +0 -5
- package/dist/chunk-f8p69dsg.js +0 -3
- package/dist/chunk-f95drhdb.js +0 -194
- package/dist/chunk-ff5a6hvb.js +0 -17
- package/dist/chunk-fs5fy4h8.js +0 -2
- package/dist/chunk-fzsygce3.js +0 -2
- package/dist/chunk-g465x63k.js +0 -2
- package/dist/chunk-g708ekh1.js +0 -2
- package/dist/chunk-gcr9e83g.js +0 -11
- package/dist/chunk-gdmyrsr8.js +0 -4
- package/dist/chunk-gkms2ngq.js +0 -2
- package/dist/chunk-gnfywmgs.js +0 -7
- package/dist/chunk-hpf8kq7e.js +0 -2
- package/dist/chunk-j4x3faf8.js +0 -2
- package/dist/chunk-jkavtw9f.js +0 -2
- package/dist/chunk-kg1rdena.js +0 -3
- package/dist/chunk-km91wx0v.js +0 -2
- package/dist/chunk-kmsyvaex.js +0 -8
- package/dist/chunk-mrahwn5v.js +0 -8
- package/dist/chunk-nk3czvnk.js +0 -2
- package/dist/chunk-nmw4eewb.js +0 -2
- package/dist/chunk-nq5zxrk0.js +0 -4
- package/dist/chunk-ny67c03k.js +0 -3
- package/dist/chunk-p4wdxp2c.js +0 -2
- package/dist/chunk-pcxp4r9n.js +0 -3
- package/dist/chunk-pdyeaxc1.js +0 -2
- package/dist/chunk-pf06ded4.js +0 -2
- package/dist/chunk-pfs0gpzm.js +0 -2
- package/dist/chunk-pshdwq44.js +0 -2
- package/dist/chunk-pwgv84pn.js +0 -32
- package/dist/chunk-pwsnafp3.js +0 -4367
- package/dist/chunk-q9n5swx7.js +0 -3
- package/dist/chunk-qr346wnp.js +0 -2
- package/dist/chunk-r02hke04.js +0 -2
- package/dist/chunk-ranshpyc.js +0 -3
- package/dist/chunk-rn194bhp.js +0 -20
- package/dist/chunk-rn1hgyc8.js +0 -930
- package/dist/chunk-s7z5dp70.js +0 -43
- package/dist/chunk-s8jd13nb.js +0 -3
- package/dist/chunk-sn7exv0n.js +0 -2
- package/dist/chunk-t1tdjjht.js +0 -216
- package/dist/chunk-t6qx04s8.js +0 -499
- package/dist/chunk-t6y6gyps.js +0 -2
- package/dist/chunk-tjfs7cc3.js +0 -2
- package/dist/chunk-tkyrk66a.js +0 -3
- package/dist/chunk-tntv9hvq.js +0 -2
- package/dist/chunk-v3nwkveg.js +0 -12
- package/dist/chunk-vd4cb5xr.js +0 -2
- package/dist/chunk-vkhdce50.js +0 -2
- package/dist/chunk-w183av08.js +0 -2
- package/dist/chunk-w2m02njv.js +0 -2
- package/dist/chunk-wpjrcrs5.js +0 -2
- package/dist/chunk-wqmppf6b.js +0 -3
- package/dist/chunk-wtb9fxdy.js +0 -2
- package/dist/chunk-xmzygmcz.js +0 -3
- package/dist/chunk-xsng1mtq.js +0 -3
- package/dist/chunk-xxzefj4j.js +0 -2
- package/dist/chunk-yq8x8bxq.js +0 -47
- package/dist/chunk-ytma76qe.js +0 -3
- package/dist/chunk-yw1m115e.js +0 -2
- package/dist/chunk-z64a924m.js +0 -2
- package/dist/chunk-zcz9rs6p.js +0 -3
package/dist/chunk-s7z5dp70.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Hf as L,If as w,Jf as x,Kf as p,Lf as F,Mf as T,Pf as I,Qf as f,Rf as l,Sf as n,Tf as i,Uf as P,Vf as o,Wf as a}from"./chunk-ytma76qe.js";import{Ts as ZG}from"./chunk-0btmm4m2.js";function HG(X,Z={}){let{src:G,alt:J,width:q,height:$,sizes:K="100vw",loading:Q="lazy",priority:Y=!1,quality:M=x,placeholder:N="none",formats:j=w,widths:C=L,decoding:B="async",fetchpriority:V,objectFit:O,objectPosition:W}=X,H=X.class,z=X.style,{processedImage:R,variants:_,optimize:E=!0,isDev:S=!1}=Z;if(_&&_.length>0)return OG(X,_,R);if(S||!E)return MG(X);return VG(X)}function OG(X,Z,G){let{src:J,alt:q,width:$,height:K,sizes:Q="100vw",loading:Y="lazy",priority:M=!1,decoding:N="async",fetchpriority:j,objectFit:C,objectPosition:B,placeholder:V="none"}=X,O=X.class,W=X.style,H=n(Z),z=l(Z),R=typeof Q==="object"?f(Q):Q,_=G?G.aspectRatio:$&&K?Number($)/Number(K):void 0,E=[];if(_)E.push(`aspect-ratio: ${_}`);if(C)E.push(`object-fit: ${C}`);if(B)E.push(`object-position: ${B}`);if(W)E.push(W);let S=E.length>0?` style="${E.join("; ")}"`:"",b=O?` class="${O}"`:"",u=M?"":` loading="${Y}"`,d=` decoding="${N}"`,h=j?` fetchpriority="${j}"`:M?' fetchpriority="high"':"",r=["avif","webp","jpeg","png"],s=[];for(let U of r){let D=H.get(U);if(D&&D.length>0){let m=I(D),QG=P(U);s.push(` <source type="${QG}" srcset="${m}" sizes="${R}" />`)}}let e="",t="",g;if(V!=="none"&&G?.placeholder){let U=`img-${Math.random().toString(36).slice(2,8)}`;if(e=`<div class="stx-image-wrapper" id="${U}">`,t="</div>",V==="blur")g=`
|
|
3
|
-
#${U} {
|
|
4
|
-
position: relative;
|
|
5
|
-
background-image: url('${G.placeholder}');
|
|
6
|
-
background-size: cover;
|
|
7
|
-
background-position: center;
|
|
8
|
-
}
|
|
9
|
-
#${U} img {
|
|
10
|
-
transition: opacity 0.3s ease;
|
|
11
|
-
}
|
|
12
|
-
#${U}.loaded img {
|
|
13
|
-
opacity: 1;
|
|
14
|
-
}
|
|
15
|
-
`.trim();else if(V==="color")g=`
|
|
16
|
-
#${U} {
|
|
17
|
-
background-color: ${G.placeholder};
|
|
18
|
-
}
|
|
19
|
-
`.trim()}let BG=$?` width="${$}"`:G?` width="${G.width}"`:"",NG=K?` height="${K}"`:G?` height="${G.height}"`:"",WG=`${e}<picture>
|
|
20
|
-
${s.join(`
|
|
21
|
-
`)}
|
|
22
|
-
<img
|
|
23
|
-
src="${z?.url||J}"
|
|
24
|
-
alt="${c(q)}"${BG}${NG}${b}${S}${u}${d}${h}
|
|
25
|
-
/>
|
|
26
|
-
</picture>${t}`,GG;if(M&&z){let U=H.get("webp"),D=U?.[Math.floor(U.length/2)]||z,m=P(D.format);GG=`<link rel="preload" as="image" href="${D.url}" type="${m}" />`}return{html:WG,preloadLink:GG,placeholderCss:g}}function MG(X){let{src:Z,alt:G,width:J,height:q,loading:$="lazy",decoding:K="async",priority:Q=!1,fetchpriority:Y,objectFit:M,objectPosition:N}=X,j=X.class,C=X.style,B=[];if(M)B.push(`object-fit: ${M}`);if(N)B.push(`object-position: ${N}`);if(C)B.push(C);let V=B.length>0?` style="${B.join("; ")}"`:"",O=j?` class="${j}"`:"",W=J?` width="${J}"`:"",H=q?` height="${q}"`:"",z=Q?"":` loading="${$}"`,R=` decoding="${K}"`,_=Y?` fetchpriority="${Y}"`:Q?' fetchpriority="high"':"";return{html:`<img src="${Z}" alt="${c(G)}"${W}${H}${O}${V}${z}${R}${_} />`}}function VG(X){let{src:Z,alt:G,width:J,height:q,sizes:$="100vw",loading:K="lazy",priority:Q=!1,quality:Y=x,formats:M=w,widths:N=L,decoding:j="async",fetchpriority:C,objectFit:B,objectPosition:V}=X,O=X.class,W=X.style,H=[];if(B)H.push(`object-fit: ${B}`);if(V)H.push(`object-position: ${V}`);if(W)H.push(W);let z=H.length>0?` style="${H.join("; ")}"`:"",R=O?` class="${O}"`:"",_=J?` width="${J}"`:"",E=q?` height="${q}"`:"",S=Q?"":` loading="${K}"`,b=` decoding="${j}"`,u=C?` fetchpriority="${C}"`:Q?' fetchpriority="high"':"",d=typeof $==="object"?f($):$,h=`
|
|
27
|
-
data-stx-image
|
|
28
|
-
data-src="${Z}"
|
|
29
|
-
data-sizes="${d}"
|
|
30
|
-
data-quality="${Y}"
|
|
31
|
-
data-formats="${M.join(",")}"
|
|
32
|
-
data-widths="${N.join(",")}"
|
|
33
|
-
`.replace(/\s+/g," ").trim();return{html:`<img src="${Z}" alt="${c(G)}"${_}${E}${R}${z}${S}${b}${u} ${h} />`}}function JG(X){let Z=X.match(/<Image\s+([^>]*?)\/?>/);if(!Z)return null;let G=Z[1],J={},q=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,$;while(($=q.exec(G))!==null){let[,K,Q,Y,M]=$,N=Q??Y??M??!0;switch(K){case"src":J.src=String(N);break;case"alt":J.alt=String(N);break;case"width":J.width=Number(N)||N;break;case"height":J.height=Number(N)||N;break;case"sizes":J.sizes=String(N);break;case"loading":J.loading=N;break;case"priority":J.priority=N===!0||N==="true";break;case"quality":J.quality=Number(N);break;case"placeholder":J.placeholder=N;break;case"class":J.class=String(N);break;case"style":J.style=String(N);break;case"decoding":J.decoding=N;break;case"fetchpriority":J.fetchpriority=N;break;case"objectFit":J.objectFit=N;break;case"objectPosition":J.objectPosition=String(N);break}}if(!J.src||!J.alt)return null;return J}async function jG(X,Z){let G=/<Image\s+[^>]*?\/?>/g,J=[],q=[],$=X,K,Q=[];while((K=G.exec(X))!==null)Q.push({match:K[0],index:K.index});for(let Y=Q.length-1;Y>=0;Y--){let{match:M}=Q[Y],N=JG(M);if(N){let j=await Z(N);if($=$.replace(M,j.html),j.preloadLink)J.push(j.preloadLink);if(j.placeholderCss)q.push(j.placeholderCss)}}return{html:$,preloadLinks:J,styles:q}}function c(X){return X.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var y=new Map;function CG(){y.clear()}async function _G(X,Z){let G=`${X}:${JSON.stringify(Z)}`;if(y.has(G))return y.get(G);try{let J=await T(X,Z);return y.set(G,J),J}catch{return null}}function $G(){return ZG({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(X,Z,G)=>{let{src:J,alt:q,options:$}=EG(X,Z,G);if(!J)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let K={widths:$.widths||($.width?[$.width]:L),formats:$.formats||w,quality:$.quality||x,placeholder:($.placeholder==="color"?"dominant-color":$.placeholder)||"none"};if(!await F())return XG(J,q||"",$);let Y=await _G(J,K);if(!Y)return XG(J,q||"",$);return zG(Y,q||"",$)}})}function EG(X,Z,G){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let q=X.trim();if(q.startsWith("@image(")||q.startsWith("("))q=q.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let $=RG(q),K=$[0]||"",Q=$[1]||"",Y={};if(K&&!K.startsWith("/")&&!K.startsWith(".")&&!K.startsWith("http")){let M=G[K];if(typeof M==="string")K=M}if($[2])try{if(typeof $[2]==="string")Y=JSON.parse($[2]);else Y=$[2]}catch{}return{src:K,alt:Q,options:Y}}function RG(X){let Z=[],G="",J=!1,q="",$=0,K=0;for(let Q=0;Q<X.length;Q++){let Y=X[Q],M=Q>0?X[Q-1]:"";if((Y==='"'||Y==="'")&&M!=="\\"){if(!J)J=!0,q=Y;else if(Y===q)J=!1,q="";else G+=Y;continue}if(!J){if(Y==="{")$++;if(Y==="}")$--;if(Y==="[")K++;if(Y==="]")K--;if(Y===","&&$===0&&K===0){Z.push(G.trim()),G="";continue}}G+=Y}if(G.trim())Z.push(G.trim());return Z}function XG(X,Z,G){let J=[`src="${k(X)}"`];if(Z)J.push(`alt="${k(Z)}"`);if(G.width)J.push(`width="${G.width}"`);if(G.height)J.push(`height="${G.height}"`);if(G.class)J.push(`class="${k(G.class)}"`);if(G.style)J.push(`style="${k(G.style)}"`);if(G.lazy!==!1)J.push('loading="lazy"');return J.push('decoding="async"'),`<img ${J.join(" ")} />`}function zG(X,Z,G){let{variants:J,placeholder:q,width:$,height:K,aspectRatio:Q}=X,Y=new Map;for(let W of J){let H=Y.get(W.format)||[];H.push(W),Y.set(W.format,H)}let M=["avif","webp","jpeg","png"],N=[];for(let W of M){let H=Y.get(W);if(H&&H.length>0){let z=I(H),R=P(W),_=G.sizes||"100vw";N.push(` <source type="${R}" srcset="${k(z)}" sizes="${k(_)}" />`)}}let j=Y.get("jpeg")||[],C=j.length>0?j[Math.floor(j.length/2)]:J[Math.floor(J.length/2)],B=[`src="${C?.url||X.src}"`,`alt="${k(Z)}"`];if(G.width||$)B.push(`width="${G.width||$}"`);if(G.height||K)B.push(`height="${G.height||K}"`);if(G.class)B.push(`class="${k(G.class)}"`);let V=[];if(Q)V.push(`aspect-ratio: ${Q.toFixed(4)}`);if(G.style)V.push(G.style);if(V.length>0)B.push(`style="${V.join("; ")}"`);if(G.lazy!==!1&&!G.priority)B.push('loading="lazy"');if(B.push('decoding="async"'),G.priority)B.push('fetchpriority="high"');let O=`<picture>
|
|
34
|
-
`;if(O+=N.join(`
|
|
35
|
-
`)+`
|
|
36
|
-
`,O+=` <img ${B.join(" ")} />
|
|
37
|
-
`,O+="</picture>",G.placeholder&&q){let W=`stx-img-${Math.random().toString(36).slice(2,8)}`;if(G.placeholder==="blur"||G.placeholder==="thumbhash"){let H=q.replace(/'/g,"%27").replace(/"/g,"%22");O=`<div id="${W}" class="stx-image-placeholder" style="background-image: url('${H}'); background-size: cover;">
|
|
38
|
-
${O}
|
|
39
|
-
</div>`}else if(G.placeholder==="color"){let H=q.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");O=`<div id="${W}" class="stx-image-placeholder" style="background-color: ${H};">
|
|
40
|
-
${O}
|
|
41
|
-
</div>`}}if(G.priority&&C){let W=P(C.format);O=`<link rel="preload" as="image" href="${k(C.url)}" type="${W}" />
|
|
42
|
-
`+O}return O}function k(X){return X.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var UG=$G();import v from"fs";import A from"path";function LG(X={}){let{inputDirs:Z=["public","src/assets","assets"],outputDir:G="dist/images",baseUrl:J="/images",formats:q=w,widths:$=L,quality:K=x,placeholder:Q="none",concurrency:Y=4,cache:M=!0,cacheDir:N=".stx/image-cache",referencedOnly:j=!1,verbose:C=!1}=X,B={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(V){if(!await F()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(M)await v.promises.mkdir(N,{recursive:!0});if(C){let W=await p();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${W?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${Z.join(", ")}`),console.log(` Output dir: ${G}`),console.log(` Formats: ${q.join(", ")}`),console.log(` Widths: ${$.join(", ")}`)}},async buildStart(){B.imageReferences.clear(),B.processedImages.clear(),B.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(V,O){if(O.endsWith(".html")||O.endsWith(".stx")){let W=wG(V);for(let H of W)B.imageReferences.add(H)}if(V.includes("<Image")||V.includes("@image"))return await kG(V,{formats:q,widths:$,quality:K,placeholder:Q,outputDir:G,baseUrl:J,processedImages:B.processedImages});return V},async buildEnd(V){if(!await F())return;await v.promises.mkdir(G,{recursive:!0});let W=[];for(let R of Z){if(!v.existsSync(R))continue;let _=await KG(R);W.push(..._)}let H=j?W.filter((R)=>xG(R,B.imageReferences)):W;if(B.stats.totalImages=H.length,C)console.log(`[stx-images] Processing ${H.length} images...`);let z=qG(H,Y);for(let R of z)await Promise.all(R.map(async(_)=>{try{let E=await T(_,{formats:q,widths:$,quality:K,placeholder:Q,outputDir:G,baseUrl:J});B.processedImages.set(_,E),B.stats.optimizedImages++,B.stats.variants+=E.variants.length;let S=v.statSync(_).size,b=o(E.variants);if(B.stats.savedBytes+=Math.max(0,S-b/E.variants.length),C)console.log(` \u2713 ${A.basename(_)} \u2192 ${E.variants.length} variants`)}catch(E){console.error(`[stx-images] Error processing ${_}:`,E)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${B.stats.optimizedImages}/${B.stats.totalImages}`),console.log(` Variants: ${B.stats.variants}`),B.stats.savedBytes>0)console.log(` Saved: ~${a(B.stats.savedBytes)}`)}}}function wG(X){let Z=[],G=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,J;while((J=G.exec(X))!==null)Z.push(J[1]);let q=/<Image[^>]+src=["']([^"']+)["']/gi;while((J=q.exec(X))!==null)Z.push(J[1]);let $=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((J=$.exec(X))!==null)Z.push(J[1]);let K=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((J=K.exec(X))!==null)Z.push(J[1]);return Z}function xG(X,Z){let G=A.basename(X);for(let J of Z)if(J.endsWith(G)||J.includes(G))return!0;return!1}async function kG(X,Z){return X}async function KG(X){let Z=[];async function G(J){let q=await v.promises.readdir(J,{withFileTypes:!0});for(let $ of q){let K=A.join(J,$.name);if($.isDirectory())await G(K);else if($.isFile()&&i(K))Z.push(K)}}return await G(X),Z}function qG(X,Z){let G=[];for(let J=0;J<X.length;J+=Z)G.push(X.slice(J,J+Z));return G}async function FG(X,Z,G={}){if(!await F())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return T(X,{...G,outputDir:Z})}async function SG(X,Z,G={}){let{formats:J=w,widths:q=L,quality:$=x,placeholder:K="none",concurrency:Q=4,verbose:Y=!1}=G;if(!await F())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await v.promises.mkdir(Z,{recursive:!0});let N=await KG(X),j=[],C={totalImages:N.length,optimizedImages:0,savedBytes:0,variants:0},B=qG(N,Q);for(let V of B){let O=await Promise.all(V.map(async(W)=>{try{let H=await T(W,{formats:J,widths:q,quality:$,placeholder:K,outputDir:Z,baseUrl:"/"});if(C.optimizedImages++,C.variants+=H.variants.length,Y)console.log(` \u2713 ${A.basename(W)}`);return H}catch(H){return console.error(`Error processing ${W}:`,H),null}}));j.push(...O.filter((W)=>W!==null))}return{processed:j,stats:C}}function YG(X){let Z={};for(let G of X)Z[G.src]={variants:G.variants,placeholder:G.placeholder};return Z}async function PG(X,Z){let G=YG(X);await Bun.write(Z,JSON.stringify(G,null,2))}var cG={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
|
|
43
|
-
export{HG as tf,JG as uf,jG as vf,CG as wf,$G as xf,UG as yf,LG as zf,FG as Af,SG as Bf,YG as Cf,PG as Df,cG as Ef};
|
package/dist/chunk-s8jd13nb.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import v from"fs";import z from"path";import{fileURLToPath as B}from"url";var x;function G(){if(x)return x;let j="unknown";try{j=String(JSON.parse(v.readFileSync(new URL("../package.json",import.meta.url),"utf8")).version)}catch{}if(import.meta.url.endsWith(".ts"))try{let A=z.dirname(B(import.meta.url)),q=0;for(let k of v.readdirSync(A,{recursive:!0,withFileTypes:!0}))if(k.isFile()&&k.name.endsWith(".ts"))q=Math.max(q,v.statSync(z.join(k.parentPath,k.name)).mtimeMs);j+=`+src.${Math.trunc(q)}`}catch{}return x=j,j}
|
|
3
|
-
export{G as Fl};
|
package/dist/chunk-sn7exv0n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fu as a,Gu as b,Hu as c,Iu as d,Ju as e,Ku as f,Lu as g,Mu as h,Nu as i,Ou as j,Pu as k,Qu as l,Ru as m,Su as n,Tu as o,Uu as p}from"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
|
package/dist/chunk-t1tdjjht.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function w(Z,M){let{itemHeight:K,containerHeight:P,overscan:F=3,keyProperty:$="id",dynamicHeight:Q=!1,estimatedItemHeight:U=K,direction:G="vertical"}=M,k=[...Z],j=0,z=new Map;function _(){if(Q)return X();let q=Math.max(0,Math.floor(j/K)-F),A=Math.ceil(P/K),W=Math.min(k.length-1,q+A+F*2);return{startIndex:q,endIndex:W}}function X(){let q=0,A=0,W=k.length-1;for(let Y=0;Y<k.length;Y++){let V=z.get(Y)||U;if(q+V>j){A=Math.max(0,Y-F);break}q+=V}q=0;for(let Y=0;Y<k.length;Y++){let V=z.get(Y)||U;if(q+=V,q>j+P){W=Math.min(k.length-1,Y+F);break}}return{startIndex:A,endIndex:W}}function S(){if(Q){let q=0;for(let A=0;A<k.length;A++)q+=z.get(A)||U;return q}return k.length*K}function O(q){if(Q){let A=0;for(let W=0;W<q;W++)A+=z.get(W)||U;return A}return q*K}function N(){let{startIndex:q,endIndex:A}=_();return{startIndex:q,endIndex:A,scrollTop:j,totalHeight:S(),visibleItems:k.slice(q,A+1),itemHeights:new Map(z)}}function T(q,A="auto"){let W=O(q);J(W,A)}function J(q,A="auto"){j=Math.max(0,Math.min(q,S()-P))}function B(){_()}function y(q){k=[...q],z.clear(),B()}function D(){k=[],z.clear()}return{scrollToIndex:T,scrollToOffset:J,getState:N,refresh:B,setItems:y,destroy:D}}function C(Z,M={},K){let P=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return Z.replace(P,(F,$,Q,U)=>{let G=$.trim(),k=M[G];if(!k||!Array.isArray(k))return`<!-- virtualList: items "${G}" not found or not an array -->`;let j={itemHeight:50,containerHeight:400,overscan:3};if(Q)try{let J=Q.trim(),B=Function(`return ${J}`)();j={...j,...B}}catch{}let z=`vlist-${Math.random().toString(36).substring(2,9)}`,_=Math.ceil(j.containerHeight/j.itemHeight),X=j.overscan||3,S=0,O=Math.min(k.length-1,_+X),N="";for(let J=S;J<=O&&J<k.length;J++){let B=k[J],y=U.replace(/\{\{\s*item\s*\}\}/g,typeof B==="object"?JSON.stringify(B):String(B)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(D,q)=>{if(typeof B==="object"&&B!==null)return String(B[q]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(J));N+=`
|
|
3
|
-
<div class="virtual-item ${j.itemClass||""}"
|
|
4
|
-
style="position: absolute; top: ${J*j.itemHeight}px; height: ${j.itemHeight}px; width: 100%;"
|
|
5
|
-
data-index="${J}">
|
|
6
|
-
${y}
|
|
7
|
-
</div>`}let T=k.length*j.itemHeight;return`
|
|
8
|
-
<div id="${z}"
|
|
9
|
-
class="virtual-list-container ${j.containerClass||""}"
|
|
10
|
-
style="position: relative; height: ${j.containerHeight}px; overflow-y: auto;"
|
|
11
|
-
data-item-height="${j.itemHeight}"
|
|
12
|
-
data-total-items="${k.length}"
|
|
13
|
-
data-overscan="${X}">
|
|
14
|
-
<div class="virtual-list-viewport ${j.viewportClass||""}"
|
|
15
|
-
style="position: relative; height: ${T}px; width: 100%;">
|
|
16
|
-
${N}
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<script data-virtual-list="${z}">
|
|
20
|
-
(function() {
|
|
21
|
-
const container = document.getElementById('${z}');
|
|
22
|
-
if (!container) return;
|
|
23
|
-
|
|
24
|
-
const viewport = container.querySelector('.virtual-list-viewport');
|
|
25
|
-
const itemHeight = ${j.itemHeight};
|
|
26
|
-
const totalItems = ${k.length};
|
|
27
|
-
const overscan = ${X};
|
|
28
|
-
const containerHeight = ${j.containerHeight};
|
|
29
|
-
const items = ${JSON.stringify(k)};
|
|
30
|
-
const template = ${JSON.stringify(U.trim())};
|
|
31
|
-
|
|
32
|
-
let lastStartIndex = 0;
|
|
33
|
-
|
|
34
|
-
function renderItems(scrollTop) {
|
|
35
|
-
const startIndex = Math.max(0, Math.floor(scrollTop / itemHeight) - overscan);
|
|
36
|
-
const visibleCount = Math.ceil(containerHeight / itemHeight);
|
|
37
|
-
const endIndex = Math.min(totalItems - 1, startIndex + visibleCount + overscan * 2);
|
|
38
|
-
|
|
39
|
-
if (startIndex === lastStartIndex) return;
|
|
40
|
-
lastStartIndex = startIndex;
|
|
41
|
-
|
|
42
|
-
// Clear and re-render
|
|
43
|
-
viewport.innerHTML = '';
|
|
44
|
-
|
|
45
|
-
for (let i = startIndex; i <= endIndex; i++) {
|
|
46
|
-
const item = items[i];
|
|
47
|
-
const div = document.createElement('div');
|
|
48
|
-
div.className = 'virtual-item ${j.itemClass||""}';
|
|
49
|
-
div.style.cssText = 'position: absolute; top: ' + (i * itemHeight) + 'px; height: ' + itemHeight + 'px; width: 100%;';
|
|
50
|
-
div.dataset.index = i;
|
|
51
|
-
|
|
52
|
-
let html = template
|
|
53
|
-
.replace(/\\{\\{\\s*item\\s*\\}\\}/g, typeof item === 'object' ? JSON.stringify(item) : String(item))
|
|
54
|
-
.replace(/\\{\\{\\s*item\\.(\\w+)\\s*\\}\\}/g, (_, prop) => {
|
|
55
|
-
return typeof item === 'object' && item !== null ? String(item[prop] ?? '') : '';
|
|
56
|
-
})
|
|
57
|
-
.replace(/\\{\\{\\s*index\\s*\\}\\}/g, String(i));
|
|
58
|
-
|
|
59
|
-
div.innerHTML = html;
|
|
60
|
-
viewport.appendChild(div);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
container.addEventListener('scroll', function() {
|
|
65
|
-
requestAnimationFrame(() => renderItems(container.scrollTop));
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// Expose API
|
|
69
|
-
container.__virtualList = {
|
|
70
|
-
scrollToIndex: function(index) {
|
|
71
|
-
container.scrollTop = index * itemHeight;
|
|
72
|
-
},
|
|
73
|
-
refresh: function() {
|
|
74
|
-
renderItems(container.scrollTop);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
})();
|
|
78
|
-
</script>
|
|
79
|
-
`})}function b(){return`
|
|
80
|
-
.virtual-list-container {
|
|
81
|
-
position: relative;
|
|
82
|
-
overflow-y: auto;
|
|
83
|
-
overflow-x: hidden;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.virtual-list-container::-webkit-scrollbar {
|
|
87
|
-
width: 8px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.virtual-list-container::-webkit-scrollbar-track {
|
|
91
|
-
background: rgba(0, 0, 0, 0.1);
|
|
92
|
-
border-radius: 4px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.virtual-list-container::-webkit-scrollbar-thumb {
|
|
96
|
-
background: rgba(0, 0, 0, 0.3);
|
|
97
|
-
border-radius: 4px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.virtual-list-container::-webkit-scrollbar-thumb:hover {
|
|
101
|
-
background: rgba(0, 0, 0, 0.5);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.virtual-list-viewport {
|
|
105
|
-
position: relative;
|
|
106
|
-
width: 100%;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.virtual-item {
|
|
110
|
-
position: absolute;
|
|
111
|
-
left: 0;
|
|
112
|
-
right: 0;
|
|
113
|
-
box-sizing: border-box;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* Loading placeholder for items */
|
|
117
|
-
.virtual-item-placeholder {
|
|
118
|
-
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
119
|
-
background-size: 200% 100%;
|
|
120
|
-
animation: virtual-shimmer 1.5s infinite;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@keyframes virtual-shimmer {
|
|
124
|
-
0% { background-position: 200% 0; }
|
|
125
|
-
100% { background-position: -200% 0; }
|
|
126
|
-
}
|
|
127
|
-
`}function L(Z,M){let K=null,P=()=>{if(!K)K=w(Z(),M);return K};return{visibleItems:()=>{return P().getState().visibleItems},totalHeight:()=>{return P().getState().totalHeight},containerProps:()=>({style:{height:`${M.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(F)=>{let $=F.target;if(K)K.scrollToOffset($.scrollTop)}}),itemProps:(F)=>({style:{position:"absolute",top:`${F*M.itemHeight}px`,height:`${M.itemHeight}px`,width:"100%"},"data-index":F}),scrollToIndex:(F)=>{P().scrollToIndex(F)}}}function E(Z,M={},K){let P=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return Z.replace(P,(F,$,Q,U,G)=>{let k=$.trim(),j=M[k];if(!j||!Array.isArray(j))return`<!-- infiniteList: items "${k}" not found or not an array -->`;let z={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(Q)try{let S=Function(`return ${Q.trim()}`)();z={...z,...S}}catch{}let _=`ilist-${Math.random().toString(36).substring(2,9)}`,X=C(`@virtualList(${k}, ${JSON.stringify({itemHeight:z.itemHeight,containerHeight:z.containerHeight,overscan:z.overscan,containerClass:z.containerClass})})${U}@endvirtualList`,M);return X=X.replace("</script>",`
|
|
128
|
-
// Infinite scroll detection
|
|
129
|
-
container.addEventListener('scroll', function() {
|
|
130
|
-
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
131
|
-
const threshold = ${z.threshold};
|
|
132
|
-
const totalHeight = viewport.offsetHeight;
|
|
133
|
-
|
|
134
|
-
if (scrollBottom >= totalHeight - threshold) {
|
|
135
|
-
container.dispatchEvent(new CustomEvent('loadmore', { bubbles: true }));
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
</script>`),`
|
|
139
|
-
<div id="${_}" class="infinite-list-wrapper">
|
|
140
|
-
${X}
|
|
141
|
-
<div class="infinite-list-loading" style="display: none;">
|
|
142
|
-
${G}
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
`})}function f(Z,M={},K){let P=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return Z.replace(P,(F,$,Q,U)=>{let G=$.trim(),k=M[G];if(!k||!Array.isArray(k))return`<!-- virtualGrid: items "${G}" not found or not an array -->`;let j={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(Q)try{let B=Function(`return ${Q.trim()}`)();j={...j,...B}}catch{}let z=`vgrid-${Math.random().toString(36).substring(2,9)}`,_=Math.ceil(k.length/j.columns),X=_*(j.rowHeight+(j.gap||0)),S=Math.ceil(j.containerHeight/(j.rowHeight+(j.gap||0))),O=j.overscan||2,N=0,T=Math.min(_-1,S+O),J="";for(let B=N;B<=T;B++)for(let y=0;y<j.columns;y++){let D=B*j.columns+y;if(D>=k.length)break;let q=k[D],A=y*(100/j.columns),W=B*(j.rowHeight+(j.gap||0)),Y=U.replace(/\{\{\s*item\s*\}\}/g,typeof q==="object"?JSON.stringify(q):String(q)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(V,R)=>{if(typeof q==="object"&&q!==null)return String(q[R]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(D));J+=`
|
|
146
|
-
<div class="virtual-grid-item"
|
|
147
|
-
style="position: absolute; top: ${W}px; left: ${A}%; width: calc(${100/j.columns}% - ${j.gap||0}px); height: ${j.rowHeight}px;"
|
|
148
|
-
data-index="${D}">
|
|
149
|
-
${Y}
|
|
150
|
-
</div>`}return`
|
|
151
|
-
<div id="${z}"
|
|
152
|
-
class="virtual-grid-container"
|
|
153
|
-
style="position: relative; height: ${j.containerHeight}px; overflow-y: auto;">
|
|
154
|
-
<div class="virtual-grid-viewport"
|
|
155
|
-
style="position: relative; height: ${X}px; width: 100%;">
|
|
156
|
-
${J}
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
<script data-virtual-grid="${z}">
|
|
160
|
-
(function() {
|
|
161
|
-
const container = document.getElementById('${z}');
|
|
162
|
-
if (!container) return;
|
|
163
|
-
|
|
164
|
-
const viewport = container.querySelector('.virtual-grid-viewport');
|
|
165
|
-
const columns = ${j.columns};
|
|
166
|
-
const rowHeight = ${j.rowHeight};
|
|
167
|
-
const gap = ${j.gap||0};
|
|
168
|
-
const totalItems = ${k.length};
|
|
169
|
-
const overscan = ${O};
|
|
170
|
-
const containerHeight = ${j.containerHeight};
|
|
171
|
-
const items = ${JSON.stringify(k)};
|
|
172
|
-
const template = ${JSON.stringify(U.trim())};
|
|
173
|
-
|
|
174
|
-
let lastStartRow = 0;
|
|
175
|
-
|
|
176
|
-
function renderItems(scrollTop) {
|
|
177
|
-
const startRow = Math.max(0, Math.floor(scrollTop / (rowHeight + gap)) - overscan);
|
|
178
|
-
const visibleRowCount = Math.ceil(containerHeight / (rowHeight + gap));
|
|
179
|
-
const endRow = Math.min(Math.ceil(totalItems / columns) - 1, startRow + visibleRowCount + overscan * 2);
|
|
180
|
-
|
|
181
|
-
if (startRow === lastStartRow) return;
|
|
182
|
-
lastStartRow = startRow;
|
|
183
|
-
|
|
184
|
-
viewport.innerHTML = '';
|
|
185
|
-
|
|
186
|
-
for (let row = startRow; row <= endRow; row++) {
|
|
187
|
-
for (let col = 0; col < columns; col++) {
|
|
188
|
-
const index = row * columns + col;
|
|
189
|
-
if (index >= totalItems) break;
|
|
190
|
-
|
|
191
|
-
const item = items[index];
|
|
192
|
-
const div = document.createElement('div');
|
|
193
|
-
div.className = 'virtual-grid-item';
|
|
194
|
-
div.style.cssText = 'position: absolute; top: ' + (row * (rowHeight + gap)) + 'px; left: ' + (col * (100 / columns)) + '%; width: calc(' + (100 / columns) + '% - ' + gap + 'px); height: ' + rowHeight + 'px;';
|
|
195
|
-
div.dataset.index = index;
|
|
196
|
-
|
|
197
|
-
let html = template
|
|
198
|
-
.replace(/\\{\\{\\s*item\\s*\\}\\}/g, typeof item === 'object' ? JSON.stringify(item) : String(item))
|
|
199
|
-
.replace(/\\{\\{\\s*item\\.(\\w+)\\s*\\}\\}/g, (_, prop) => {
|
|
200
|
-
return typeof item === 'object' && item !== null ? String(item[prop] ?? '') : '';
|
|
201
|
-
})
|
|
202
|
-
.replace(/\\{\\{\\s*index\\s*\\}\\}/g, String(index));
|
|
203
|
-
|
|
204
|
-
div.innerHTML = html;
|
|
205
|
-
viewport.appendChild(div);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
container.addEventListener('scroll', function() {
|
|
211
|
-
requestAnimationFrame(() => renderItems(container.scrollTop));
|
|
212
|
-
});
|
|
213
|
-
})();
|
|
214
|
-
</script>
|
|
215
|
-
`})}var v={createVirtualList:w,processVirtualListDirectives:C,processInfiniteListDirectives:E,processVirtualGridDirectives:f,generateVirtualListCSS:b,useVirtualList:L};
|
|
216
|
-
export{w as Jh,C as Kh,b as Lh,L as Mh,E as Nh,f as Oh,v as Ph};
|