@stacksjs/stx 0.2.674 → 0.2.676
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/{chunk-szevd7d5.js → chunk-028e9fty.js} +2 -2
- package/dist/{chunk-rr527jt6.js → chunk-078qg8r5.js} +2 -2
- package/dist/chunk-0gk78x3r.js +2 -0
- package/dist/{chunk-fw413k9q.js → chunk-1b9thkg5.js} +2 -2
- package/dist/chunk-1e73whqh.js +2 -0
- package/dist/chunk-1rztwjdj.js +130 -0
- package/dist/{chunk-srq9fqq8.js → chunk-245sas8r.js} +38 -38
- package/dist/chunk-248a88mc.js +2 -0
- package/dist/chunk-2nqtmp8c.js +2 -0
- package/dist/chunk-2pga7zzb.js +4 -0
- package/dist/{chunk-bkkpq8dx.js → chunk-304dbbsw.js} +10 -10
- package/dist/{chunk-z22zy22p.js → chunk-34e8e8te.js} +2 -2
- package/dist/{chunk-md2jn67b.js → chunk-374nhgyf.js} +2 -2
- package/dist/chunk-3bfegbpw.js +2 -0
- package/dist/chunk-3gdt16xa.js +2 -0
- package/dist/chunk-3wsm9g9c.js +2 -0
- package/dist/chunk-3xx9d934.js +2 -0
- package/dist/{chunk-ham5x7ts.js → chunk-4fhbh04h.js} +4 -4
- package/dist/{chunk-5vt48yce.js → chunk-4jnv2v5e.js} +9 -9
- package/dist/chunk-4rk5qnqf.js +24 -0
- package/dist/chunk-526mf3fr.js +4 -0
- package/dist/chunk-54zkkxmb.js +2 -0
- package/dist/{chunk-kdebh22m.js → chunk-551s7ha0.js} +10 -10
- package/dist/chunk-5v7vm8cv.js +14 -0
- package/dist/{chunk-rdr09efy.js → chunk-5z0q3qv3.js} +5 -5
- package/dist/{chunk-6sjtyd0k.js → chunk-5z8mq37c.js} +4 -4
- package/dist/{chunk-ce6zddpf.js → chunk-6beg47t4.js} +2 -2
- package/dist/{chunk-trz8z4j4.js → chunk-6bwca55g.js} +37 -37
- package/dist/chunk-6kam8r5y.js +2 -0
- package/dist/{chunk-tddnb5bv.js → chunk-6ycyaf5g.js} +2 -2
- package/dist/chunk-707sx5sk.js +20 -0
- package/dist/chunk-78d5tn4r.js +2 -0
- package/dist/{chunk-pb6erpj3.js → chunk-78x52gz3.js} +5 -5
- package/dist/{chunk-zp79zkkd.js → chunk-78yjmbbs.js} +2 -2
- package/dist/{chunk-v21bhhjb.js → chunk-7j7h1eg3.js} +1 -1
- package/dist/{chunk-zmg1peyg.js → chunk-8aq07a1j.js} +3 -3
- package/dist/chunk-8p92r2sc.js +2 -0
- package/dist/chunk-909ymsjz.js +2 -0
- package/dist/{chunk-r7fdw2v5.js → chunk-97h9ga3b.js} +3 -3
- package/dist/chunk-9859r1d5.js +2 -0
- package/dist/{chunk-25zmy8q6.js → chunk-9wdd7eq6.js} +2 -2
- package/dist/{chunk-p6qd7ad0.js → chunk-a2zb5fgg.js} +2 -2
- package/dist/chunk-arh1qgmp.js +2 -0
- package/dist/chunk-b18x0v21.js +2 -0
- package/dist/chunk-b23vscaq.js +2 -0
- package/dist/{chunk-4b9s7wgy.js → chunk-be2rswkw.js} +2 -2
- package/dist/{chunk-qz5b8ed4.js → chunk-bh19ezq0.js} +5 -5
- package/dist/chunk-bm42rsaa.js +2 -0
- package/dist/{chunk-cbjabv1w.js → chunk-bpj387yx.js} +6 -6
- package/dist/chunk-c4enpsj8.js +2 -0
- package/dist/chunk-cdbaanmx.js +2 -0
- package/dist/chunk-cfm6a679.js +2 -0
- package/dist/chunk-cs8wq7nv.js +2 -0
- package/dist/{chunk-hegfgw27.js → chunk-cxgremn0.js} +5 -5
- package/dist/chunk-d2xf5hh9.js +2 -0
- package/dist/{chunk-rym0309c.js → chunk-d4ch6exz.js} +3 -3
- package/dist/chunk-dda8pdya.js +2 -0
- package/dist/{chunk-7adznted.js → chunk-dera8fmc.js} +2 -2
- package/dist/chunk-dmd7mgjw.js +3 -0
- package/dist/chunk-ds91e0fe.js +2 -0
- package/dist/{chunk-hgry3mjd.js → chunk-dxh45gve.js} +1 -1
- package/dist/chunk-e492je6q.js +2 -0
- package/dist/{chunk-7j1zgrnf.js → chunk-ehzd1yc6.js} +9 -9
- package/dist/chunk-etz2dmec.js +2 -0
- package/dist/{chunk-4s8zacxg.js → chunk-f26n6y9p.js} +4 -4
- package/dist/{chunk-4w6baw62.js → chunk-fbrgz3s8.js} +2 -2
- package/dist/chunk-fd72t30s.js +2 -0
- package/dist/{chunk-sqn3y9qt.js → chunk-fdvfzknd.js} +2 -2
- package/dist/chunk-ft3f9nj0.js +2 -0
- package/dist/{chunk-dgc1a3yt.js → chunk-fzc98qgn.js} +7 -7
- package/dist/{chunk-s0vtjyyj.js → chunk-g12ht81a.js} +2 -2
- package/dist/chunk-g6gqja52.js +2 -0
- package/dist/{chunk-hb3edeq9.js → chunk-ga5kjf9b.js} +6 -6
- package/dist/chunk-ggwvnpwj.js +2 -0
- package/dist/{chunk-hsmcbh0p.js → chunk-ghm9f13q.js} +5 -5
- package/dist/chunk-gx6wxmbv.js +2 -0
- package/dist/chunk-gz5rvwgx.js +2 -0
- package/dist/chunk-hamk3dky.js +2 -0
- package/dist/{chunk-vayhx642.js → chunk-haz2ezyk.js} +2 -2
- package/dist/chunk-hh58k0nh.js +3 -0
- package/dist/chunk-hqj28381.js +3 -0
- package/dist/chunk-j60jye3e.js +25 -0
- package/dist/chunk-jjet6qxq.js +2 -0
- package/dist/chunk-jk7chxkt.js +2 -0
- package/dist/{chunk-d09q93yf.js → chunk-jv021x8e.js} +2 -2
- package/dist/{chunk-pg2v1pb5.js → chunk-k06n5bjp.js} +3 -3
- package/dist/{chunk-35ezh7de.js → chunk-k72jqz6a.js} +3 -3
- package/dist/chunk-kn34esxw.js +2 -0
- package/dist/chunk-kqbpkg8n.js +2 -0
- package/dist/{chunk-aet1pgw7.js → chunk-krcd3039.js} +74 -74
- package/dist/{chunk-asezs2n3.js → chunk-kxj8e1gd.js} +6 -6
- package/dist/{chunk-5zhp87wv.js → chunk-mabja59q.js} +2 -2
- package/dist/chunk-mf19qxgv.js +3 -0
- package/dist/chunk-mjsebtg6.js +2 -0
- package/dist/{chunk-fd49fahd.js → chunk-mn47s2ef.js} +5 -5
- package/dist/{chunk-nj343mw2.js → chunk-mq915g3j.js} +5 -5
- package/dist/chunk-n63r9b4f.js +2 -0
- package/dist/{chunk-j6m8xqh3.js → chunk-n8wvqnfc.js} +2 -2
- package/dist/chunk-n94ts3t9.js +21 -0
- package/dist/{chunk-w7t2cfgy.js → chunk-p27ptd9f.js} +65 -65
- package/dist/{chunk-t0k16vqv.js → chunk-p9az13b2.js} +2 -2
- package/dist/chunk-pwn0j1vq.js +2 -0
- package/dist/chunk-q1jcf6vm.js +2 -0
- package/dist/{chunk-am2w363p.js → chunk-q3gactm1.js} +4 -4
- package/dist/chunk-q3nnaxf9.js +2 -0
- package/dist/{chunk-w3d98907.js → chunk-q4rejyd2.js} +2 -2
- package/dist/{chunk-hz4x7h0n.js → chunk-qbzqary0.js} +5 -5
- package/dist/{chunk-a4p18ybc.js → chunk-qr7a378v.js} +3 -3
- package/dist/{chunk-bsajk82t.js → chunk-qwdcts9w.js} +19 -19
- package/dist/chunk-rc79yyqx.js +2 -0
- package/dist/{chunk-yx3dpdwc.js → chunk-rfc5pdv2.js} +3 -3
- package/dist/chunk-rnws0dh3.js +2 -0
- package/dist/chunk-rxxajm31.js +31 -0
- package/dist/{chunk-thceyzj6.js → chunk-rza1p6e4.js} +2 -2
- package/dist/chunk-s73z8zss.js +11 -0
- package/dist/chunk-s8qe247r.js +2 -0
- package/dist/{chunk-d1a86qx8.js → chunk-sptewgky.js} +1 -1
- package/dist/{chunk-mwnhdsbp.js → chunk-sqh3tvtw.js} +2 -2
- package/dist/{chunk-6s7tvmqp.js → chunk-sr3hmrah.js} +2 -2
- package/dist/chunk-sswy3tfc.js +2 -0
- package/dist/chunk-swxznm5v.js +2 -0
- package/dist/{chunk-9dtbvjpp.js → chunk-tmqrbs98.js} +31 -20
- package/dist/chunk-tst8p27s.js +12 -0
- package/dist/chunk-tz09earb.js +2 -0
- package/dist/{chunk-fbmth6xv.js → chunk-vay5v6sj.js} +13 -13
- package/dist/{chunk-ck2e3e47.js → chunk-vd5w1jaz.js} +3 -3
- package/dist/chunk-vewt3464.js +2 -0
- package/dist/{chunk-xghcsg3f.js → chunk-vg1pg6yt.js} +1 -1
- package/dist/{chunk-s2wptfm1.js → chunk-wav0xbnb.js} +2 -2
- package/dist/chunk-whzvx5w5.js +2 -0
- package/dist/chunk-wk1gt95z.js +2 -0
- package/dist/{chunk-t9kxhe46.js → chunk-wr1gm35v.js} +1 -1
- package/dist/{chunk-faakv1p6.js → chunk-wscnjtss.js} +2 -2
- package/dist/{chunk-t79jfpv6.js → chunk-x4q4bx3q.js} +2 -2
- package/dist/chunk-x63f2ywm.js +2 -0
- package/dist/{chunk-y1pcdeg9.js → chunk-x7wr720m.js} +5 -5
- package/dist/chunk-xk7cp691.js +2 -0
- package/dist/chunk-xna6b7km.js +2 -0
- package/dist/{chunk-v6peecfp.js → chunk-xnx06qqt.js} +2 -2
- package/dist/chunk-xw4rm5zj.js +2 -0
- package/dist/{chunk-5qtthtg3.js → chunk-y34tyrpb.js} +7 -7
- package/dist/chunk-yar7fwrb.js +2 -0
- package/dist/{chunk-2zzc7006.js → chunk-yn9kvsk1.js} +2 -2
- package/dist/chunk-yt33wzqk.js +2 -0
- package/dist/chunk-z35ftpqp.js +421 -0
- package/dist/{chunk-4bgjrrvz.js → chunk-z7ghjs7w.js} +1 -1
- package/dist/chunk-zq7xbc1k.js +2 -0
- package/dist/cli.js +22 -22
- package/dist/client/signals-for-runtime.js +16 -5
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/headwind-to-style.js +13 -1
- package/dist/native/compiler/html-to-ir.d.ts +2 -0
- package/dist/native/compiler/html-to-ir.js +9 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/compiler/render-screen.js +4 -3
- package/dist/native/compiler/style-config.d.ts +3 -0
- package/dist/native/compiler/style-config.js +5 -0
- package/dist/native/components/primitives.d.ts +2 -0
- package/dist/native/event-names.js +2 -0
- package/dist/native/prop-names.js +1 -0
- package/dist/native/runtime/craft-bridge.js +15 -8
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.js +75 -16
- package/dist/ssg-static-paths.d.ts +12 -0
- package/dist/ssg-static-paths.js +62 -0
- package/dist/ssg.d.ts +2 -4
- package/dist/ssg.js +43 -47
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-0jwdcqj8.js +0 -2
- package/dist/chunk-0mwdq478.js +0 -2
- package/dist/chunk-0nfqgv4n.js +0 -4
- package/dist/chunk-1y6egkty.js +0 -2
- package/dist/chunk-280p4q7a.js +0 -2
- package/dist/chunk-2881tcqt.js +0 -2
- package/dist/chunk-2a775q7x.js +0 -2
- package/dist/chunk-2asdbd5e.js +0 -2
- package/dist/chunk-34yj93hh.js +0 -2
- package/dist/chunk-40tswfe7.js +0 -21
- package/dist/chunk-41de209e.js +0 -2
- package/dist/chunk-506mv7hb.js +0 -3
- package/dist/chunk-5s1ay9mv.js +0 -2
- package/dist/chunk-7kznee1g.js +0 -2
- package/dist/chunk-7mvz972c.js +0 -12
- package/dist/chunk-80zgyaqe.js +0 -2
- package/dist/chunk-84tqb1rn.js +0 -2
- package/dist/chunk-8azm7nha.js +0 -2
- package/dist/chunk-902qnyg0.js +0 -2
- package/dist/chunk-9n6jwcpb.js +0 -2
- package/dist/chunk-a6y8td0d.js +0 -2
- package/dist/chunk-a7kt1ts4.js +0 -2
- package/dist/chunk-a81y8g40.js +0 -2
- package/dist/chunk-aft1zc84.js +0 -2
- package/dist/chunk-bawq4fqy.js +0 -31
- package/dist/chunk-bdp2r0v4.js +0 -2
- package/dist/chunk-brtvm8mb.js +0 -2
- package/dist/chunk-bvzr9zqt.js +0 -2
- package/dist/chunk-cbvgtf3m.js +0 -2
- package/dist/chunk-cfydbaeq.js +0 -2
- package/dist/chunk-dq8c3h4n.js +0 -2
- package/dist/chunk-e36pne7n.js +0 -2
- package/dist/chunk-e62qfexp.js +0 -2
- package/dist/chunk-eq5jzaj5.js +0 -2
- package/dist/chunk-f9zyf9n6.js +0 -421
- package/dist/chunk-fb7t1nn9.js +0 -24
- package/dist/chunk-fr39emcz.js +0 -2
- package/dist/chunk-fsq13amm.js +0 -2
- package/dist/chunk-fxh12vqd.js +0 -2
- package/dist/chunk-gcc9fa33.js +0 -2
- package/dist/chunk-h6t2ney6.js +0 -2
- package/dist/chunk-hvtzw1jh.js +0 -2
- package/dist/chunk-j8g5cvvm.js +0 -2
- package/dist/chunk-jzjpyyw2.js +0 -2
- package/dist/chunk-k1b8x73j.js +0 -2
- package/dist/chunk-nw9bdk2n.js +0 -2
- package/dist/chunk-p4jkswz8.js +0 -2
- package/dist/chunk-p4r90vqf.js +0 -2
- package/dist/chunk-p8bgy5tt.js +0 -2
- package/dist/chunk-pqqe2b6m.js +0 -11
- package/dist/chunk-q6nwcav4.js +0 -2
- package/dist/chunk-qmqavdz2.js +0 -2
- package/dist/chunk-qpw72bty.js +0 -2
- package/dist/chunk-qwnh1kj6.js +0 -2
- package/dist/chunk-qy9m6qdn.js +0 -2
- package/dist/chunk-qychcdsm.js +0 -2
- package/dist/chunk-rj3w1ama.js +0 -2
- package/dist/chunk-rv39s5az.js +0 -20
- package/dist/chunk-sf0r963g.js +0 -2
- package/dist/chunk-ss820yys.js +0 -2
- package/dist/chunk-t4j9g2vh.js +0 -2
- package/dist/chunk-trh7s6k3.js +0 -130
- package/dist/chunk-ttemwrbx.js +0 -2
- package/dist/chunk-twqzn21x.js +0 -14
- package/dist/chunk-v14rq8b4.js +0 -3
- package/dist/chunk-vdxg7e1y.js +0 -4
- package/dist/chunk-vq513cxx.js +0 -2
- package/dist/chunk-vvq8xe3n.js +0 -2
- package/dist/chunk-w8t31bn9.js +0 -2
- package/dist/chunk-x1kz4d7j.js +0 -2
- package/dist/chunk-xaa36b0x.js +0 -3
- package/dist/chunk-xcsyqwxf.js +0 -25
- package/dist/chunk-xn9jrjzh.js +0 -2
- package/dist/chunk-z97bwx8m.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var qs=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function Gi(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||qs},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
|
|
2
|
+
var Gs=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function Gi(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||Gs},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
|
|
3
3
|
`)}function N(e,t,r){let n=" ".repeat(r);if(r===0)t.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let i=`node_${r}`;t.push(`${n} var ${i} = try ${e.zigType}.init(allocator);`);for(let[o,s]of Object.entries(e.props))if(s.type==="literal"){let a=typeof s.value==="string"?`"${s.value}"`:String(s.value);t.push(`${n} ${i}.set${J(o)}(${a});`)}for(let o=0;o<e.children.length;o++){let s=e.children[o];if(s.type==="text"){let a=s.props.text?.type==="literal"?String(s.props.text.value):"";t.push(`${n} try ${i}.addChild(try craft.Text.init(allocator, "${a}"));`)}else N(s,t,r+1),t.push(`${n} try ${i}.addChild(node_${r+1});`)}if(r===0)t.push(` return ${i}.element();`),t.push("}")}function E(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('import { Craft } from "@stacksjs/craft";'),r.push(""),r.push("export function render(): Craft.Element {"),r.push(" return "+v(e,1)+";"),r.push("}"),r.join(`
|
|
4
4
|
`)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
|
|
5
5
|
${r} [${o.join(`,
|
|
6
6
|
${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
|
|
7
|
-
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function
|
|
8
|
-
export{
|
|
7
|
+
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Xi(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Gi,createHotReloadServer:Xi,NATIVE_COMPONENTS:Gs},op=K;
|
|
8
|
+
export{Gs,Gi,Xi,op};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Go,jp,Bp,cc,ze,du,Es,Fp,zp,Hp,Vp,Up,Wp,qp,Kp,Gp}from"./chunk-qwdcts9w.js";export{Wp as applyHead,Fp as definePageMeta,Go as getHead,jp as getPageMeta,ze as mergeHeadConfigs,qp as processHeadDirective,Gp as processMetaDirective,Kp as processTitleDirective,Up as renderBodyAttrs,Hp as renderHead,Vp as renderHtmlAttrs,Bp as resetHead,Es as seoMetaToHeadConfig,cc as useHead,zp as usePageTitle,du as useSeoMeta,zp as useTitle};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function
|
|
2
|
+
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function Zi(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function Qi(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
|
|
3
3
|
`);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
4
|
+
`)}function ea(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
|
|
5
|
+
export{Zi,Qi,ea};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function
|
|
3
|
-
export{
|
|
2
|
+
import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function Be(n,f){return m.run(n,f)}function yn(){return m.getStore()}function ws(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Ho(){return ws().public}function A(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Nt(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
|
|
3
|
+
export{Be,yn,ws,Ho,A,Nt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function
|
|
3
|
-
export{
|
|
2
|
+
var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function q(n){let i=0,e,c=d.map(()=>{return});while(i<n.length){if(e===void 0||e!==null&&e.index<i)u.lastIndex=i,e=u.exec(n);if(!e)return null;let a=e.index,r=-1,o=null;for(let l=0;l<d.length;l++){let g=d[l],t=c[l];if(t===void 0||t!==null&&t.index<i)g.open.lastIndex=i,t=g.open.exec(n),c[l]=t;if(!t)continue;if(t.index<a&&(r===-1||t.index<r))r=t.index,o=g.close}if(r===-1||!o)return{index:a,tag:e[0],attrs:e[1]??""};o.lastIndex=r;let s=o.exec(n);if(!s)return null;i=s.index+s[0].length}return null}function Ge(n,i){let e=q(n);if(!e)return n;return n.slice(0,e.index)+i(e.tag,e.attrs)+n.slice(e.index+e.tag.length)}
|
|
3
|
+
export{q,Ge};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Au}from"./chunk-4rk5qnqf.js";import"./chunk-krcd3039.js";import"./chunk-551s7ha0.js";import"./chunk-078qg8r5.js";import"./chunk-j60jye3e.js";import"./chunk-304dbbsw.js";import"./chunk-ehzd1yc6.js";import"./chunk-xnx06qqt.js";import"./chunk-n94ts3t9.js";import"./chunk-5v7vm8cv.js";import"./chunk-dxh45gve.js";import"./chunk-be2rswkw.js";import"./chunk-245sas8r.js";import"./chunk-d4ch6exz.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-y34tyrpb.js";import"./chunk-f26n6y9p.js";import"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{Au as startInteractive};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ve,Do,Mo,Yl,It,Ka,Lo,Ga,Pp,Ne,fn,De}from"./chunk-z35ftpqp.js";import{ec,r}from"./chunk-tst8p27s.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{ve as BROWSER_CORE_IMPORTS,Yl as STX_AUTO_IMPORTS,Do as extractAndStripCssImports,Ne as extractBridgeData,ec as findInterpolationEnd,Ga as generateAutoImportDestructuring,Pp as generateBrowserAutoImportDestructuring,fn as generateServerDataBridge,It as injectBrowserCoreAutoImports,De as processClientScript,Lo as referencesName,Mo as renderVendorStyleTags,r as stripCommentsAndLiterals,Ka as transformAutoImports};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{Ra,n,pe}from"./chunk-z35ftpqp.js";import{Qe}from"./chunk-yn9kvsk1.js";import{c}from"./chunk-mf19qxgv.js";import o from"fs";import l from"path";var Rl=new Map,m=new Map;async function yp(e){let r;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){r=s;break}throw m.delete(e),Error(`File not found: ${e}${r?` (${r.message})`:""}`)}function bp(e){m.delete(e)}function vp(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function wp(e){x=e}async function Al(e=!1){let t=x??await import("./chunk-rc79yyqx.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function Pl(){if(S===null){let{getRouterScript:e}=await import("./chunk-hamk3dky.js");S=e()}return S}var y={};async function xp(e,t=!1){let r=e==="runtime"?await Al(t):await Pl(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==r)s={content:r,hash:Bun.hash(r).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:r,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,u=new Map,p=0;function C(e){return c(process.cwd(),"module-bundles",`${e}.js`)}function Sp(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),r=u.get(t),i=r!==void 0;if(i)u.delete(t),p-=r.length*2;u.set(t,e),p+=e.length*2;while(u.size>1&&(u.size>E||p>T)){let s=u.keys().next().value;p-=u.get(s).length*2,u.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(l.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function go(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=u.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function kp(){m.clear(),pe(),Ra(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((r)=>({name:r.name,timing:r.timing,handler:String(r.handler)})),customDirectives:(e.customDirectives??[]).map((r)=>({name:r.name,hasEndTag:r.hasEndTag===!0,rawParams:r.rawParams===!0,handler:String(r.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function Zn(e,t){try{if(!t.cachePath)return null;let r=l.resolve(t.cachePath),i=l.join(r,`${Gr(e)}.html`),s=l.join(r,`${Gr(e)}.meta.json`);if(!await n(i)||!await n(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==Qe())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await n(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(r){return console.warn(`Cache error for ${e}:`,r),null}}async function Qn(e,t,r,i){try{if(!i.cachePath)return;let s=l.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=l.join(s,`${Gr(e)}.html`),a=l.join(s,`${Gr(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(r),cacheVersion:i.cacheVersion,engine:Qe(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),Rl.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:r})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function Gr(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
|
|
3
|
+
export{Rl,yp,bp,vp,wp,Al,Pl,xp,Sp,go,kp,Zn,Qn,Gr};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Y,Z,Q,
|
|
2
|
+
import{Y,Z,Q,Tn,ge,Ce,dt,Wt,$n,Rn,An,ee,Pn,In}from"./chunk-x4q4bx3q.js";import{bt}from"./chunk-3hxd5td3.js";function Ec(s,r={}){let{src:e,alt:t,width:n,height:a,sizes:i="100vw",loading:m="lazy",priority:o=!1,quality:u=Q,placeholder:l="none",formats:f=Z,widths:y=Y,decoding:c="async",fetchpriority:h,objectFit:d,objectPosition:g}=s,{class:p,style:v}=s,{processedImage:w,variants:I,optimize:b=!0,isDev:A=!1}=r;if(I&&I.length>0)return G(s,I,w);if(A||!b)return X(s);return te(s)}function G(s,r,e){let{src:t,alt:n,width:a,height:i,sizes:m="100vw",loading:o="lazy",priority:u=!1,decoding:l="async",fetchpriority:f,objectFit:y,objectPosition:c,placeholder:h="none"}=s,{class:d,style:g}=s,p=Rn(r),v=$n(r),w=typeof m==="object"?Wt(m):m,I=e?e.aspectRatio:a&&i?Number(a)/Number(i):void 0,b=[];if(I)b.push(`aspect-ratio: ${I}`);if(y)b.push(`object-fit: ${y}`);if(c)b.push(`object-position: ${c}`);if(g)b.push(g);let A=b.length>0?` style="${b.join("; ")}"`:"",S=d?` class="${d}"`:"",F=u?"":` loading="${o}"`,R=` decoding="${l}"`,C=f?` fetchpriority="${f}"`:u?' fetchpriority="high"':"",E=["avif","webp","jpeg","png"],M=[];for(let k of E){let z=p.get(k);if(z&&z.length>0){let O=dt(z),K=ee(k);M.push(` <source type="${K}" srcset="${O}" sizes="${w}" />`)}}let U="",L="",T;if(h!=="none"&&e?.placeholder){let k=`img-${Math.random().toString(36).slice(2,8)}`;if(U=`<div class="stx-image-wrapper" id="${k}">`,L="</div>",h==="blur")T=`
|
|
3
3
|
#${k} {
|
|
4
4
|
position: relative;
|
|
5
5
|
background-image: url('${e.placeholder}');
|
|
@@ -23,14 +23,14 @@ ${M.join(`
|
|
|
23
23
|
src="${v?.url||t}"
|
|
24
24
|
alt="${B(n)}"${_}${H}${S}${A}${F}${R}${C}
|
|
25
25
|
/>
|
|
26
|
-
</picture>${L}`,V;if(u&&v){let k=p.get("webp"),z=k?.[Math.floor(k.length/2)]||v,O=ee(z.format);V=`<link rel="preload" as="image" href="${z.url}" type="${O}" />`}return{html:J,preloadLink:V,placeholderCss:T}}function X(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${B(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function te(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=Q,formats:u=Z,widths:l=Y,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,S=` decoding="${f}"`,F=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",R=typeof a==="object"?
|
|
26
|
+
</picture>${L}`,V;if(u&&v){let k=p.get("webp"),z=k?.[Math.floor(k.length/2)]||v,O=ee(z.format);V=`<link rel="preload" as="image" href="${z.url}" type="${O}" />`}return{html:J,preloadLink:V,placeholderCss:T}}function X(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${B(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function te(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=Q,formats:u=Z,widths:l=Y,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,S=` decoding="${f}"`,F=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",R=typeof a==="object"?Wt(a):a,C=`
|
|
27
27
|
data-stx-image
|
|
28
28
|
data-src="${r}"
|
|
29
29
|
data-sizes="${R}"
|
|
30
30
|
data-quality="${o}"
|
|
31
31
|
data-formats="${u.join(",")}"
|
|
32
32
|
data-widths="${l.join(",")}"
|
|
33
|
-
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${B(e)}"${I}${b}${w}${v}${A}${S}${F} ${C} />`}}function
|
|
33
|
+
`.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${B(e)}"${I}${b}${w}${v}${A}${S}${F} ${C} />`}}function ki(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function Tc(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=ki(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function B(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var D=new Map;function $c(){D.clear()}async function se(s,r){let e=`${s}:${JSON.stringify(r)}`;if(D.has(e))return D.get(e);try{let t=await Ce(s,r);return D.set(e,t),t}catch{return null}}function _i(){return bt({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=re(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:Y),formats:a.formats||Z,quality:a.quality||Q,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await ge())return q(t,n||"",a);let o=await se(t,i);if(!o)return q(t,n||"",a);return ie(o,n||"",a)}})}function re(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ae(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ae(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function q(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function ie(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=dt(p),w=ee(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
|
|
34
34
|
`;if(d+=l.join(`
|
|
35
35
|
`)+`
|
|
36
36
|
`,d+=` <img ${c.join(" ")} />
|
|
@@ -39,5 +39,5 @@ ${d}
|
|
|
39
39
|
</div>`}else if(e.placeholder==="color"){let p=n.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");d=`<div id="${g}" class="stx-image-placeholder" style="background-color: ${p};">
|
|
40
40
|
${d}
|
|
41
41
|
</div>`}}if(e.priority&&y){let g=ee(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
|
|
42
|
-
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var
|
|
43
|
-
export{
|
|
42
|
+
`+d}return d}function x(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var Rc=_i();import P from"fs";import j from"path";function Ac(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=Z,widths:a=Y,quality:i=Q,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await ge()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await P.promises.mkdir(l,{recursive:!0});if(y){let g=await Tn();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=ne(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ce(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await ge())return;await P.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!P.existsSync(w))continue;let I=await N(w);g.push(...I)}let p=f?g.filter((w)=>oe(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=W(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await Ce(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=P.statSync(I).size,S=Pn(b.variants);if(c.stats.savedBytes+=Math.max(0,A-S/b.variants.length),y)console.log(` \u2713 ${j.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${In(c.stats.savedBytes)}`)}}}function ne(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function oe(s,r){let e=j.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ce(s,r){return s}async function N(s){let r=[];async function e(t){let n=await P.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=j.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&An(i))r.push(i)}}return await e(s),r}function W(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function Pc(s,r,e={}){if(!await ge())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return Ce(s,{...e,outputDir:r})}async function Ic(s,r,e={}){let{formats:t=Z,widths:n=Y,quality:a=Q,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await ge())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await P.promises.mkdir(r,{recursive:!0});let l=await N(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=W(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await Ce(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${j.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function Ci(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function Oc(s,r){let e=Ci(s);await Bun.write(r,JSON.stringify(e,null,2))}var Nu={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{Ec,ki,Tc,$c,_i,Rc,Ac,Pc,Ic,Ci,Oc,Nu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ue,ja,ms,dn,g,Ne,De}from"./chunk-z35ftpqp.js";import{er,Je,N}from"./chunk-245sas8r.js";import{Un,o}from"./chunk-krcd3039.js";import{ye}from"./chunk-5v7vm8cv.js";function b(s){return s.endsWith(".md")||s.endsWith(".markdown")}function k(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let u;while((u=n.exec(s))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function R(s,e={}){let{data:r,content:m}=er(s),a=await(e.renderer??((n)=>Je(n)))(m);return{html:k(a),frontmatter:r??{}}}import{dirname as v,resolve as _}from"path";function M(s){let e=s,r=ue(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(s))!==null){let i=u[1],l=u[2],d=u[0],f=i.includes("server");if(p(l))n.push(d);else if(f)a.push(l);else c.push(d)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=i.exec(t))!==null){let f=l.index+l[0].length,x=t.indexOf("</script>",f);if(x===-1)continue;d.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let f=d.length-1;f>=0;f--)t=t.substring(0,d[f].start)+t.substring(d[f].end)}for(let i of c)t=t.replace(i,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function E(s,e){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -7,12 +7,12 @@ import{le,La,ps,ln,g,Oe,Ne}from"./chunk-f9zyf9n6.js";import{Zn,Xe,N}from"./chunk
|
|
|
7
7
|
<title>${(e||"stx").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
|
-
${
|
|
10
|
+
${s}
|
|
11
11
|
</body>
|
|
12
|
-
</html>`}async function
|
|
12
|
+
</html>`}async function Ji(s,e={}){let r=_(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(b(r)){let n=await R(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=_(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};dn(l);let d=await S(c,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),f=await p.text(),x={...l,content:d},y={...i,context:x,injectCSS:t};return S(f,n,y)}return S(c,r,e)}async function S(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=M(s),n={...N,...r.options},p={__filename:e,__dirname:v(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...ms(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of c)await g(i,p,e);let u=new Set,t=m;if(t=await o(t,p,e,n,u),ja(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
|
|
13
13
|
${a.join(`
|
|
14
|
-
`)}`}else{if(r.processClientScripts!==!1&&a.length>0){let i=p.__stx_event_bindings||[],l=
|
|
14
|
+
`)}`}else{if(r.processClientScripts!==!1&&a.length>0){let i=p.__stx_event_bindings||[],l=Ne(p),d=await Promise.all(a.map(async(w)=>{let C=w.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(C))return w;let h=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!h)return w;return await De(h[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})})),x=[await Un(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
|
|
15
15
|
`);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${x}
|
|
16
16
|
$1`);else t+=`
|
|
17
|
-
${x}`}t=await
|
|
18
|
-
export{
|
|
17
|
+
${x}`}t=await ye(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=E(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-78d5tn4r.js");t=await i(t)}catch{}return t}
|
|
18
|
+
export{Ji};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Rl,yp,bp,vp,wp,Al,Pl,xp,Sp,go,kp,Zn,Qn,Gr}from"./chunk-be2rswkw.js";import{Qe}from"./chunk-yn9kvsk1.js";import"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{wp as __setSignalsGeneratorsForTest,Qe as cacheEngineFingerprint,Qn as cacheTemplate,Zn as checkCache,kp as clearDevCaches,Pl as getCachedRouterScript,Al as getCachedSignalsRuntime,xp as getServeClientAsset,go as getServeModuleBundle,Gr as hashFilePath,bp as invalidateFileCache,vp as invalidateFileCacheByDir,yp as readFileCached,Sp as registerServeModuleBundle,Rl as templateCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fc,Qu,zc,Hc,ed,td}from"./chunk-fbrgz3s8.js";import"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{td as applySlots,ed as extractSlotContent,Qu as parseSlotElement,Fc as parseSlots,Hc as processSlots,zc as renderSlot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pl,fl,Ee,gl,ta,Xt,Jt,ip,na,Yt,Hn,ml,hl,yl,Xs,Zt,bl,Qt,vl}from"./chunk-707sx5sk.js";import"./chunk-qbzqary0.js";import"./chunk-374nhgyf.js";import"./chunk-245sas8r.js";import"./chunk-d4ch6exz.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-y34tyrpb.js";import"./chunk-f26n6y9p.js";import"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{Hn as MODULE_SPECIFIER_PREFIX,pl as bundleCacheDir,fl as bundleCacheEntryLimit,Qt as bundleClientScript,Jt as clearBundleFailures,Ee as clientBundleDependencies,Xt as getBundleFailures,Yt as hasUserImports,Zt as moduleSubstitutionKey,hl as normalizeRegistrySpecifiers,bl as queueClientBundleBuild,ta as recordBundleFailure,ml as registryIdForPath,na as resolveBundlerFallback,yl as rewriteRegistryImports,ip as setBundlerFallbackMode,gl as shouldLogBundlerDiagnostics,vl as tempBuildName,Xs as withModuleSubstitutes};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`)
|
|
2
|
+
import{r}from"./chunk-tst8p27s.js";function y(e,n,i=240){return e.slice(n,n+i)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(e)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(e)||/\b(?:const|let|var)\s+alert\s*=/.test(e)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(e,n)=>{let i=e.indexOf("(",n);if(i===-1)return!0;let o=e.slice(i+1,e.indexOf(")",i)+1);return!/\b(?:location|search|href|url)\b/i.test(o)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(e,n)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,n,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(e,n)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,n))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(e)=>/setTimeout\s*\(/.test(e)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],C=["confirm","tooltip",...v.map((e)=>e.rule)];function g(e,n){let i=1;for(let o=0;o<n;o++)if(e[o]===`
|
|
3
|
+
`)i++;return i}function b(e,n){let i=e.lastIndexOf(`
|
|
4
4
|
`,n)+1,o=e.indexOf(`
|
|
5
|
-
`,n);return e.slice(
|
|
6
|
-
${t.reason}`)}if(l.length>0){
|
|
7
|
-
use ${t.reason}`)}return
|
|
5
|
+
`,n);return e.slice(i,o===-1?e.length:o).trim().slice(0,120)}function S(e,n){let i=e.slice(0,n),o=i.lastIndexOf("function"),l=i.lastIndexOf("=>"),s=Math.max(o,l);if(s===-1)return!1;let t=e.slice(Math.max(0,s-120),s);return/\basync\b[^;{}]*$/.test(t)}function k(e){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(e)||/\b(?:const|let|var)\s+confirm\s*=/.test(e)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(e)}function A(e,n,i){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),s="",t=0,a;while((a=o.exec(l))!==null){let c=a.index+a[1].length,u=g(e,c),d=b(e,c);if(/stxConfirm\s*\($/.test(e.slice(0,c+8)))continue;let p=S(e,c);if(i.push({file:n,line:u,rule:"confirm",applied:p,snippet:d,reason:p?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),p)s+=e.slice(t,c)+"await stxConfirm(",t=c+(a[0].length-a[1].length)}return s+e.slice(t)}function E(e,n,i){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),s="",t=0,a;while((a=o.exec(l))!==null){let[c,u,d,p]=a,h=g(e,a.index),f=b(e,a.index),w=u.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(w)){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:`\`title\` on <${w}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test(u)||p.trim()===""){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}i.push({file:n,line:h,rule:"tooltip",applied:!0,snippet:f}),s+=e.slice(t,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,t=a.index+c.length}return s+e.slice(t)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(n)=>n.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(n)=>n.replace(/[^\n]/g," "))}function F(e){let n=(i)=>i.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,n).replace(/\/\/[^\n]*/g,n)}function m(e,n=!1){let i=R(e);return(n?F(i):r(i)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,s)=>/\bclient\b/i.test(s)?l:l.replace(/[^\n]/g," "))}function O(e,n,i,o){let l=m(e),s=m(e,!0);for(let t of v){if(!i.includes(t.rule))continue;if(t.requires&&!t.requires(e))continue;t.pattern.lastIndex=0;let a,c=/['"]/.test(t.pattern.source)?s:l;t.pattern.lastIndex=0;while((a=t.pattern.exec(c))!==null){if(t.reject?.(e,a.index))continue;o.push({file:n,line:g(e,a.index),rule:t.rule,applied:!1,snippet:b(e,a.index),reason:`${t.primitive} \u2014 ${t.why}`})}}}function q(e,n={}){let i=n.rules??C,o=n.file??"<source>",l=[];O(e,o,i,l);let s=e;if(i.includes("confirm"))s=A(s,o,l);if(i.includes("tooltip"))s=E(s,o,l);l.sort((c,u)=>c.line-u.line);let t=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(t.has(u))return!1;return t.add(u),!0});return{code:s,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,n){if(e.length===0)return"No hand-rolled equivalents found.";let i=e.filter((t)=>t.applied),o=e.filter((t)=>!t.applied&&x.has(t.rule)),l=e.filter((t)=>!t.applied&&!x.has(t.rule)),s=[];if(i.length>0){s.push(n?`Rewrote ${i.length} site(s):`:`Would rewrite ${i.length} site(s) (pass --fix):`);for(let t of i)s.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}`)}if(o.length>0){s.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let t of o)s.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}
|
|
6
|
+
${t.reason}`)}if(l.length>0){s.push("",`An stx primitive already covers this \u2014 ${l.length} site(s):`);for(let t of l)s.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}
|
|
7
|
+
use ${t.reason}`)}return s.join(`
|
|
8
8
|
`)}export{q as codemodSource,I as formatCodemodFindings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nc,Ei,Du,Dc,Mc,Mu,Lu}from"./chunk-vay5v6sj.js";import"./chunk-ghm9f13q.js";import"./chunk-707sx5sk.js";import"./chunk-qbzqary0.js";import"./chunk-374nhgyf.js";import"./chunk-n94ts3t9.js";import"./chunk-5v7vm8cv.js";import"./chunk-dxh45gve.js";import"./chunk-245sas8r.js";import"./chunk-d4ch6exz.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-y34tyrpb.js";import"./chunk-f26n6y9p.js";import{Rt,Vl}from"./chunk-z35ftpqp.js";import"./chunk-sqh3tvtw.js";import"./chunk-9wdd7eq6.js";import"./chunk-qwdcts9w.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{Nc as buildVirtualSource,Rt as extractScriptBlocks,Vl as extractTemplateExpressions,Dc as findRuntimeTypeDeclarations,Mc as findStxModuleDeclarations,Lu as formatTypecheckDiagnostics,Du as sourcePathFor,Mu as typecheckStxFiles,Ei as virtualPathFor};
|