@stacksjs/stx 0.2.861 → 0.2.862
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/analytics.js +3 -2
- package/dist/animation.js +3 -3
- package/dist/app-shell.js +4 -3
- package/dist/{chunk-14cvwsy1.js → chunk-01c16zw4.js} +2 -2
- package/dist/chunk-0bfgsv31.js +2 -0
- package/dist/chunk-0c9c9v03.js +14 -0
- package/dist/{chunk-naj146zq.js → chunk-0fh47gp0.js} +2 -2
- package/dist/chunk-0fpx3ctt.js +2 -0
- package/dist/chunk-0twkeh31.js +2 -0
- package/dist/chunk-0xtda6aw.js +2 -0
- package/dist/chunk-12sv6b9c.js +2 -0
- package/dist/chunk-194t5qat.js +2 -0
- package/dist/chunk-1crn4fv0.js +2 -0
- package/dist/chunk-1d3swbqw.js +2 -0
- package/dist/{chunk-9syvkm5z.js → chunk-1mqcttg3.js} +6 -6
- package/dist/chunk-1qf07v41.js +2 -0
- package/dist/chunk-24hq8mka.js +3 -0
- package/dist/chunk-2asyyky3.js +2 -0
- package/dist/chunk-2dpessnc.js +54 -0
- package/dist/{chunk-h4aqpf2r.js → chunk-2jgtfjyr.js} +5 -5
- package/dist/chunk-2kfayg4t.js +712 -0
- package/dist/chunk-2rff5mbj.js +4 -0
- package/dist/chunk-2s7rmn9r.js +3 -0
- package/dist/{chunk-avp271q4.js → chunk-2srjavsn.js} +2 -2
- package/dist/chunk-2zqh7xct.js +2 -0
- package/dist/chunk-321fbxnm.js +1327 -0
- package/dist/chunk-3gk1e2b1.js +2 -0
- package/dist/chunk-3ryp43f3.js +2 -0
- package/dist/{chunk-12r22pf0.js → chunk-3z1mmar2.js} +2 -2
- package/dist/{chunk-zhxdpzga.js → chunk-46ddesnf.js} +3 -3
- package/dist/chunk-46pxmpeb.js +3 -0
- package/dist/chunk-4pr29yrx.js +2 -0
- package/dist/{chunk-6nb49h13.js → chunk-4xanjv22.js} +125 -126
- package/dist/chunk-4ykgjewy.js +16 -0
- package/dist/{chunk-tjz3r7rj.js → chunk-55zq2ha8.js} +5 -5
- package/dist/{chunk-gggadrs4.js → chunk-5a0d3048.js} +3 -3
- package/dist/chunk-5ertqfs3.js +2 -0
- package/dist/chunk-627hzzs3.js +2 -0
- package/dist/chunk-64ebysb4.js +2 -0
- package/dist/{chunk-4rrxrxp6.js → chunk-669b2bya.js} +4 -4
- package/dist/{chunk-38qp2pg2.js → chunk-67dgp45w.js} +2 -2
- package/dist/chunk-6fstz73t.js +2 -0
- package/dist/{chunk-5xdkmn39.js → chunk-6ftee542.js} +2 -2
- package/dist/{chunk-5wr1qqz3.js → chunk-6k4ac74t.js} +2 -2
- package/dist/{chunk-121cgm3s.js → chunk-6m63rc7m.js} +8 -8
- package/dist/{chunk-c2w4wc9f.js → chunk-6m6y9bbx.js} +1 -1
- package/dist/chunk-6pczzq5f.js +2 -0
- package/dist/{chunk-6tp0w6hf.js → chunk-7ayvybdy.js} +3 -3
- package/dist/chunk-7mjf144y.js +2 -0
- package/dist/{chunk-5neezkj1.js → chunk-7mpqfg98.js} +21 -21
- package/dist/chunk-7q5h2cve.js +2 -0
- package/dist/chunk-7wqevtks.js +2 -0
- package/dist/chunk-84ztb43k.js +2 -0
- package/dist/{chunk-bag9q4m0.js → chunk-8502xb4n.js} +39 -39
- package/dist/{chunk-5ka3h8dy.js → chunk-85j9qh7v.js} +45 -46
- package/dist/{chunk-cxpq2zna.js → chunk-8arfg8kp.js} +3 -3
- package/dist/{chunk-xmy6g81m.js → chunk-8hhhmscy.js} +2 -2
- package/dist/{chunk-fyfvqd2s.js → chunk-8me8hamk.js} +2 -2
- package/dist/{chunk-pb09xy77.js → chunk-8s6s6nd0.js} +2 -2
- package/dist/chunk-8v1zpdef.js +2 -0
- package/dist/chunk-94mpe1ny.js +3 -0
- package/dist/chunk-94wnfxnd.js +2 -0
- package/dist/chunk-9jxs8sw2.js +2 -0
- package/dist/{chunk-eye156nv.js → chunk-9y9jecky.js} +1 -1
- package/dist/{chunk-mzes9ds7.js → chunk-9zrvh3pz.js} +2 -2
- package/dist/{chunk-68w65mhs.js → chunk-adb045wf.js} +3 -3
- package/dist/{chunk-fpkp0bqf.js → chunk-adqh1gp1.js} +1 -1
- package/dist/chunk-az5xw3w8.js +2 -0
- package/dist/chunk-ba91r7q9.js +2 -0
- package/dist/{chunk-qkcn0exq.js → chunk-brzjass3.js} +6 -6
- package/dist/chunk-bv7g3b3b.js +2 -0
- package/dist/chunk-bwdbj60y.js +3 -0
- package/dist/chunk-bwz2ehq9.js +33 -0
- package/dist/{chunk-3wg9kr5z.js → chunk-bx5d87xx.js} +6 -7
- package/dist/chunk-bz6dg4k8.js +3 -0
- package/dist/chunk-c34qn4k8.js +16 -0
- package/dist/{chunk-37tefp7s.js → chunk-cqhwzd9y.js} +5 -5
- package/dist/chunk-cvgbtmxp.js +2 -0
- package/dist/chunk-czpn3n1p.js +2 -0
- package/dist/chunk-dhnw2qwq.js +25 -0
- package/dist/{chunk-65cbfx5x.js → chunk-dpmayc2w.js} +2 -2
- package/dist/{chunk-d6216bcw.js → chunk-dtarm8x9.js} +9 -9
- package/dist/chunk-dydy9zrq.js +3 -0
- package/dist/chunk-eafqxbr0.js +2 -0
- package/dist/{chunk-hyea17hp.js → chunk-eeq8k81z.js} +155 -157
- package/dist/{chunk-qjm23ma2.js → chunk-ew5cey88.js} +1 -1
- package/dist/chunk-fa97kz5j.js +2 -0
- package/dist/{chunk-xppm4cs4.js → chunk-farh4p7f.js} +3 -3
- package/dist/{chunk-b1tctqn5.js → chunk-fnxg6134.js} +10 -10
- package/dist/chunk-g075cc67.js +2 -0
- package/dist/{chunk-zpkgs5d3.js → chunk-g5xth2yx.js} +6 -6
- package/dist/{chunk-q6w7a1vc.js → chunk-gbtbfg7e.js} +3 -3
- package/dist/{chunk-15jymk6t.js → chunk-gd56arnm.js} +2 -2
- package/dist/chunk-gmm3kffd.js +2 -0
- package/dist/{chunk-8hck9qqm.js → chunk-gp8hgpt9.js} +4 -4
- package/dist/chunk-h2qgqjkn.js +2 -0
- package/dist/chunk-h65shwe9.js +2 -0
- package/dist/chunk-hdjn7nw9.js +20 -0
- package/dist/{chunk-cq2hedwn.js → chunk-hev4t4d5.js} +6 -6
- package/dist/chunk-hf5fj7pr.js +2 -0
- package/dist/{chunk-7yhhwv07.js → chunk-hmdkf6c6.js} +2 -2
- package/dist/chunk-hsp9h3jn.js +2 -0
- package/dist/{chunk-vggtxttf.js → chunk-j1efsjsb.js} +5 -5
- package/dist/chunk-j4zrq17p.js +2 -0
- package/dist/chunk-jx5mss16.js +2 -0
- package/dist/chunk-jz84z19v.js +2 -0
- package/dist/{chunk-5rxks14t.js → chunk-k32q90b2.js} +2 -2
- package/dist/{chunk-x69457q9.js → chunk-kbdz4762.js} +8 -8
- package/dist/chunk-kw11yydy.js +2 -0
- package/dist/{chunk-wrbhq1y2.js → chunk-kwk3kxrx.js} +3 -3
- package/dist/chunk-kyer53x3.js +2 -0
- package/dist/chunk-m9cperj4.js +2 -0
- package/dist/{chunk-zs4s9fcq.js → chunk-mcnwvh06.js} +6 -6
- package/dist/chunk-meqsd5bt.js +2 -0
- package/dist/{chunk-dba4bwkd.js → chunk-mfa07erx.js} +16 -16
- package/dist/chunk-mj4wbrw7.js +2 -0
- package/dist/{chunk-76360zky.js → chunk-mjy98ppb.js} +9 -9
- package/dist/{chunk-jh2v1vvb.js → chunk-mrh08821.js} +3 -3
- package/dist/{chunk-15rkvc0t.js → chunk-n058hznh.js} +5 -5
- package/dist/{chunk-9n8t7v78.js → chunk-n3jw3xpj.js} +2 -2
- package/dist/chunk-nz9z3ct9.js +2 -0
- package/dist/chunk-p0tkhd12.js +2 -0
- package/dist/chunk-p2etn78y.js +2 -0
- package/dist/{chunk-1nankvf6.js → chunk-pbakxcv8.js} +2 -2
- package/dist/{chunk-t5q31st4.js → chunk-q1wxgw5s.js} +2 -2
- package/dist/chunk-qa5y30sy.js +72 -0
- package/dist/{chunk-m3p4hksq.js → chunk-qbghf76y.js} +4 -4
- package/dist/{chunk-a6d92kv6.js → chunk-qcxrcypb.js} +2 -2
- package/dist/{chunk-1jwcp2k0.js → chunk-qjey0jk6.js} +2 -2
- package/dist/chunk-rqa92xm4.js +2 -0
- package/dist/chunk-rvhrtnv3.js +12 -0
- package/dist/{chunk-bg0ywp5w.js → chunk-s0sad753.js} +2 -2
- package/dist/chunk-s92j8k4z.js +2 -0
- package/dist/chunk-s9df8srx.js +6 -0
- package/dist/{chunk-dt73ww6m.js → chunk-sb8n32rn.js} +1 -1
- package/dist/chunk-snz2cxqv.js +2 -0
- package/dist/{chunk-36vksrry.js → chunk-srgnevws.js} +2 -2
- package/dist/chunk-srgpz94e.js +42 -0
- package/dist/{chunk-9pyvc0dc.js → chunk-tnp2ta5q.js} +2 -2
- package/dist/{chunk-gx96hctv.js → chunk-v37zmez0.js} +2 -2
- package/dist/chunk-v408qsze.js +2 -0
- package/dist/{chunk-thdnk1kd.js → chunk-v4xes880.js} +3 -3
- package/dist/chunk-vfx1p83g.js +33 -0
- package/dist/chunk-vk98r75z.js +2 -0
- package/dist/{chunk-yj9nyt93.js → chunk-vvzys1x7.js} +3 -3
- package/dist/{chunk-f1vvhbmw.js → chunk-w6pzkcjp.js} +2 -2
- package/dist/chunk-x0s68p47.js +2 -0
- package/dist/{chunk-3gfd9t8a.js → chunk-x512h2gv.js} +4 -4
- package/dist/{chunk-nwxjh1gv.js → chunk-x7redxyd.js} +4 -4
- package/dist/chunk-xjxcwrqs.js +2 -0
- package/dist/chunk-xsq2jf96.js +2 -0
- package/dist/chunk-xymr4ys9.js +3 -0
- package/dist/{chunk-7bajrfb1.js → chunk-y3qg95wa.js} +8 -8
- package/dist/chunk-y7f2x57s.js +2 -0
- package/dist/chunk-ymdw4fhd.js +3 -0
- package/dist/chunk-ymjjn9pw.js +20 -0
- package/dist/chunk-ynkbv9jq.js +4 -0
- package/dist/{chunk-e8nzbz66.js → chunk-ysfeg3cn.js} +2 -2
- package/dist/chunk-ytzzth34.js +2 -0
- package/dist/chunk-yxpjj003.js +2 -0
- package/dist/chunk-z1rs6b4x.js +2 -0
- package/dist/{chunk-tm201m9x.js → chunk-z512gt4v.js} +3 -3
- package/dist/chunk-z6ntmv5x.js +2 -0
- package/dist/{chunk-5n7m8vqx.js → chunk-zbvfjm4a.js} +2 -2
- package/dist/chunk-zsnmk5me.js +2 -0
- package/dist/cli.js +35 -35
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/serve-app.js +3 -2
- package/dist/dev-server/serve-multi.js +3 -4
- package/dist/dev-server/ts-css.js +4 -5
- package/dist/document-shell.js +4 -3
- package/dist/document-tags.d.ts +8 -0
- package/dist/document-tags.js +37 -0
- package/dist/events.js +2 -1
- package/dist/head-injection.js +2 -1
- package/dist/heatmap.js +2 -1
- package/dist/hot-reload.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/native-build.js +3 -3
- package/dist/process.js +5 -6
- package/dist/production-build.js +3 -3
- package/dist/pwa/inject.js +3 -3
- package/dist/pwa.js +3 -3
- package/dist/reactive-bindings.js +2 -1
- package/dist/reactive.js +2 -1
- package/dist/render.js +1 -1
- package/dist/runtime-injection.js +6 -6
- package/dist/serve.js +1 -1
- package/dist/site-builder/build.js +1 -1
- package/dist/site-builder/i18n.js +2 -2
- package/dist/site-builder/router.js +1 -1
- package/dist/site-builder/theme.js +1 -1
- package/dist/ssg.js +30 -31
- package/dist/template-hydrator.js +2 -1
- package/dist/web-components/css-scoping.js +3 -3
- package/dist/x-element.js +2 -1
- package/package.json +5 -5
- package/dist/body-close.d.ts +0 -13
- package/dist/body-close.js +0 -8
- package/dist/chunk-02css3vk.js +0 -14
- package/dist/chunk-0hqr6bff.js +0 -2
- package/dist/chunk-15sgdvyd.js +0 -2
- package/dist/chunk-261t62q4.js +0 -712
- package/dist/chunk-2b4a8tbd.js +0 -3
- package/dist/chunk-2fw36w1x.js +0 -2
- package/dist/chunk-2jcxsw75.js +0 -2
- package/dist/chunk-2pbhdaka.js +0 -2
- package/dist/chunk-2wba5ypm.js +0 -2
- package/dist/chunk-353gnvfe.js +0 -2
- package/dist/chunk-3cr5y8v1.js +0 -2
- package/dist/chunk-3y7yp0ka.js +0 -2
- package/dist/chunk-41wwqw0q.js +0 -2
- package/dist/chunk-4a1y51fs.js +0 -2
- package/dist/chunk-4a751brg.js +0 -2
- package/dist/chunk-4jgcd4d9.js +0 -33
- package/dist/chunk-5awhm4na.js +0 -2
- package/dist/chunk-5fhp9hxd.js +0 -2
- package/dist/chunk-5mg443dw.js +0 -2
- package/dist/chunk-5q4tncfw.js +0 -18
- package/dist/chunk-5x9ajbq0.js +0 -2
- package/dist/chunk-6g7tkmty.js +0 -2
- package/dist/chunk-72bj7ea4.js +0 -2
- package/dist/chunk-74g64pzt.js +0 -20
- package/dist/chunk-7de5y29a.js +0 -54
- package/dist/chunk-7ycmnsh5.js +0 -2
- package/dist/chunk-811hh6vp.js +0 -2
- package/dist/chunk-830ej8d2.js +0 -72
- package/dist/chunk-8fkmxrat.js +0 -2
- package/dist/chunk-8p9npc8y.js +0 -2
- package/dist/chunk-9fz3h6sx.js +0 -2
- package/dist/chunk-9jr30fns.js +0 -2
- package/dist/chunk-9xr628ew.js +0 -3
- package/dist/chunk-a9m6ajd7.js +0 -2
- package/dist/chunk-aj6vqdf7.js +0 -25
- package/dist/chunk-asr5v51s.js +0 -2
- package/dist/chunk-b7nmgkwa.js +0 -42
- package/dist/chunk-bv14vry8.js +0 -3
- package/dist/chunk-byx82s10.js +0 -2
- package/dist/chunk-c9y1g61m.js +0 -2
- package/dist/chunk-ck5nzbbv.js +0 -2
- package/dist/chunk-cvdm0hgq.js +0 -2
- package/dist/chunk-e0fxgbcc.js +0 -2
- package/dist/chunk-ed2m6pjf.js +0 -2
- package/dist/chunk-ednwdhv0.js +0 -2
- package/dist/chunk-egtphftq.js +0 -2
- package/dist/chunk-f18rxz70.js +0 -2
- package/dist/chunk-fahqq7c4.js +0 -2
- package/dist/chunk-fcbpzdyz.js +0 -2
- package/dist/chunk-gc79s0wh.js +0 -20
- package/dist/chunk-gjnrmz2q.js +0 -4
- package/dist/chunk-gp1dt8b8.js +0 -33
- package/dist/chunk-h0dsxxz4.js +0 -2
- package/dist/chunk-h2cvfp9y.js +0 -2
- package/dist/chunk-jhm1228j.js +0 -4
- package/dist/chunk-k3yym9zg.js +0 -2
- package/dist/chunk-k9fsd6t3.js +0 -2
- package/dist/chunk-kepxsjfx.js +0 -2
- package/dist/chunk-kgrvvtcy.js +0 -3
- package/dist/chunk-kh01rvag.js +0 -2
- package/dist/chunk-kv40xq53.js +0 -1329
- package/dist/chunk-mad172af.js +0 -2
- package/dist/chunk-mjkdskeg.js +0 -12
- package/dist/chunk-npt0mdzb.js +0 -2
- package/dist/chunk-p95fsnbk.js +0 -2
- package/dist/chunk-ptc3yqn3.js +0 -2
- package/dist/chunk-pybm7c9p.js +0 -2
- package/dist/chunk-q87hkwfg.js +0 -3
- package/dist/chunk-qe6631me.js +0 -2
- package/dist/chunk-qnx71b17.js +0 -2
- package/dist/chunk-qx8cav4w.js +0 -2
- package/dist/chunk-rb7cwck6.js +0 -2
- package/dist/chunk-s1e0t3hv.js +0 -2
- package/dist/chunk-s7vfmasx.js +0 -2
- package/dist/chunk-scwbttvt.js +0 -3
- package/dist/chunk-shy2hkvj.js +0 -2
- package/dist/chunk-sxtvy0sm.js +0 -3
- package/dist/chunk-t7z67vf6.js +0 -2
- package/dist/chunk-tarvase5.js +0 -2
- package/dist/chunk-tqs9pcga.js +0 -2
- package/dist/chunk-twjfrywv.js +0 -2
- package/dist/chunk-v0wdgxga.js +0 -3
- package/dist/chunk-vyna2rsq.js +0 -2
- package/dist/chunk-w4gjx2zs.js +0 -18
- package/dist/chunk-xhe7pw6e.js +0 -2
- package/dist/chunk-y86mpnrg.js +0 -2
- package/dist/chunk-z99bf0q0.js +0 -3
- package/dist/chunk-zm0g7ntw.js +0 -2
- package/dist/chunk-zrm2x65c.js +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,
|
|
2
|
+
import{t,u}from"./chunk-qa5y30sy.js";import{gi,s,_n,y}from"./chunk-2kfayg4t.js";import{it}from"./chunk-x512h2gv.js";import{Ps,Is}from"./chunk-mfa07erx.js";import{Mc,oi,Rs,As}from"./chunk-669b2bya.js";import{Ic,Oc}from"./chunk-adb045wf.js";import{Tt}from"./chunk-w6pzkcjp.js";import{yn,zc,Sr,kr}from"./chunk-46pxmpeb.js";import{b}from"./chunk-94mpe1ny.js";import{co}from"./chunk-srgnevws.js";import{c,f}from"./chunk-s9df8srx.js";import Q from"fs";import L from"path";import{loadConfigWithResult as Kt}from"bunfig";var K={duration:300,delay:0,ease:"ease",direction:"both"};function ot(e,r={}){let{duration:i,delay:o,ease:n,direction:l,custom:d}={...K,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
|
-
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${
|
|
4
|
+
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${l==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
6
|
-
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }`;case"scale":return`${
|
|
6
|
+
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }`;case"scale":return`${l==="in"?"transform: scale(0.95); opacity: 0; animation: scaleIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: scale(1); opacity: 1; animation: scaleOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: scale(1); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
7
7
|
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
|
|
8
|
-
@keyframes scaleOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }`;case"flip":return`${
|
|
8
|
+
@keyframes scaleOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }`;case"flip":return`${l==="in"?"transform: perspective(400px) rotateX(-90deg); opacity: 0; animation: flipIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: perspective(400px) rotateX(0); opacity: 1; animation: flipOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: perspective(400px) rotateX(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
9
9
|
@keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
|
|
10
|
-
@keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${
|
|
10
|
+
@keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${l==="in"?"transform: rotate(-90deg); opacity: 0; animation: rotateIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: rotate(0); opacity: 1; animation: rotateOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: rotate(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
11
11
|
@keyframes rotateIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
|
|
12
|
-
@keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function
|
|
12
|
+
@keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function lt(){return`
|
|
13
13
|
<script data-stx-scoped data-stx-run="once">
|
|
14
14
|
// Motion preferences handling
|
|
15
15
|
(function() {
|
|
@@ -37,7 +37,7 @@ else {
|
|
|
37
37
|
});
|
|
38
38
|
})();
|
|
39
39
|
</script>
|
|
40
|
-
`}function
|
|
40
|
+
`}function ct(e){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((i)=>i.test(e))}function dt(e=0.1,r="0px"){return`
|
|
41
41
|
<script data-stx-scoped data-stx-run="always">
|
|
42
42
|
// Intersection Observer for scroll animations
|
|
43
43
|
(function() {
|
|
@@ -80,7 +80,7 @@ else {
|
|
|
80
80
|
}
|
|
81
81
|
})();
|
|
82
82
|
</script>
|
|
83
|
-
`}function
|
|
83
|
+
`}function ut(){return`
|
|
84
84
|
<style id="stx-animation-base">
|
|
85
85
|
:root {
|
|
86
86
|
--stx-transition-duration: 300ms;
|
|
@@ -195,7 +195,7 @@ else {
|
|
|
195
195
|
transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
|
|
196
196
|
}
|
|
197
197
|
</style>
|
|
198
|
-
`}function
|
|
198
|
+
`}function pt(e,r,i={}){let{staggerDelay:o=50,sequence:n=!1}=i;return`
|
|
199
199
|
<script data-stx-scoped data-stx-run="always">
|
|
200
200
|
// Animation Group: ${e}
|
|
201
201
|
(function() {
|
|
@@ -232,11 +232,10 @@ else {
|
|
|
232
232
|
}
|
|
233
233
|
})();
|
|
234
234
|
</script>
|
|
235
|
-
`}var
|
|
236
|
-
style="--stx-transition-duration: ${
|
|
237
|
-
${
|
|
238
|
-
|
|
239
|
-
`+n.slice(g)}}return n}async function ut(e,r,i,o){let n=r[0]?.replace(/['"]/g,"")||"main",c=rt();if(n!=="main")c=c.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Ee(e){let r=e.heatmap;if(!r?.enabled)return"";let i={...pt,...r};return`
|
|
235
|
+
`}var Ae={name:"transition",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let n=r[0],l=r.length>1?Number.parseInt(r[1],10)||K.duration:K.duration,d=r.length>2?r[2]||K.ease:K.ease,m=r.length>3?Number.parseInt(r[3],10)||K.delay:K.delay,p=r.length>4?r[4]||K.direction:K.direction,g=`stx-transition-${Math.random().toString(36).substr(2,9)}`,v=ot(n,{duration:l,delay:m,ease:d,direction:p}),h="stx-transition",x="";if(n==="fade")x="stx-fade";else if(n==="slide")x="stx-slide";else if(n==="scale")x="stx-scale";else if(n==="flip")x="stx-flip";else if(n==="rotate")x="stx-rotate";return`<div id="${g}" class="${h} ${x} ${p==="out"?"stx-out":""}"
|
|
236
|
+
style="--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${m}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},_e={name:"scrollAnimate",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let n=r[0],l=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",m=r.length>3?Number.parseFloat(r[3])||0.2:0.2,p=r.length>4?Number.parseInt(r[4],10)||0:0,g=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,v=`--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms; will-change: opacity, transform;`,h="stx-transition stx-observe stx-out";if(n==="fade")h+=" stx-fade";else if(n==="slide-up"||n==="slide")h+=" stx-from-bottom";else if(n==="slide-down")h+=" stx-from-top";else if(n==="slide-left")h+=" stx-from-right";else if(n==="slide-right")h+=" stx-from-left";else if(n==="scale")h+=" stx-scale";else if(n.includes("-"))h+=` stx-${n}`;else h+=` stx-${n}`;return`<div id="${g}" class="${h}" style="${v}" data-threshold="${m}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Re={name:"animationGroup",handler:(e,r,i,o)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let n=r[0],l=r.slice(1).map((g)=>g.startsWith("#")||g.startsWith(".")?g:`#${g}`),d=i.staggerDelay||50,m=i.sequence||!0,p=pt(n,l,{staggerDelay:d,sequence:m});return`${e}
|
|
237
|
+
${p}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ee={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,l=lt();return`<div data-animate="${n?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function Cc(e,r,i,o){let n=e;if(o.animation?.enabled===!1)return n;let l=i.includes("test")&&i.includes("animation");if(!ct(n)&&!l)return n;if(!n.includes('<style id="stx-animation-base">')){let m=ut();n=f(n,m)}if(n.includes("stx-observe")){if(!n.includes("Intersection Observer for scroll animations")){let p=dt(),g=c(n);if(g!==-1)n=n.slice(0,g)+p+`
|
|
238
|
+
`+n.slice(g)}}return n}async function mt(e,r,i,o){let n=r[0]?.replace(/['"]/g,"")||"main",l=it();if(n!=="main")l=l.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${l}</script>`}var Oe={name:"stxRouter",handler:mt,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var gt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Ie(e){let r=e.heatmap;if(!r?.enabled)return"";let i={...gt,...r};return`
|
|
240
239
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
241
240
|
<script>
|
|
242
241
|
(function() {
|
|
@@ -619,26 +618,26 @@ else {
|
|
|
619
618
|
};
|
|
620
619
|
})();
|
|
621
620
|
</script>
|
|
622
|
-
`}function
|
|
623
|
-
`)){let
|
|
624
|
-
`),n=n.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),n=n.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),n=n.replace(/<\/ul>\n<ul>/g,""),n=n.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),n=n.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),n=n.replace(/<\/ol>\n<ol>/g,""),n=n.replace(/<li data-ul>/g,"<li>"),n=n.replace(/<li data-ol>/g,"<li>"),i)n=n.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(
|
|
625
|
-
`).map((
|
|
621
|
+
`}function Ec(e,r){let i=Ie(r);if(!i)return e;let o=c(e);if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Te={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,i,o)=>{let n=i.__stx_config||{};if(r.length>0){let l=ft(r.join(" "));n.heatmap={...n.heatmap,...l,enabled:!0}}return Ie(n)}};function ft(e){let r={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[n,l]=o.split("="),d=l?.replace(/["']/g,"");switch(n){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function G(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Me(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function br(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(r);if(!i)return{data:{},content:e.trim()};let o=i[1],n=e.slice(i[0].length),l={};for(let d of o.split(`
|
|
622
|
+
`)){let m=d.trim();if(!m||m.startsWith("#"))continue;let p=m.indexOf(":");if(p===-1)continue;let g=m.slice(0,p).trim(),v=m.slice(p+1).trim();if(typeof v==="string"){if(v.startsWith('"')&&v.endsWith('"')||v.startsWith("'")&&v.endsWith("'"))v=v.slice(1,-1);else if(v.startsWith("[")&&v.endsWith("]"))try{v=JSON.parse(v)}catch{}else if(v==="true")v=!0;else if(v==="false")v=!1;else if(/^-?\d+(?:\.\d+)?$/.test(v))v=Number(v)}l[g]=v}return{data:l,content:n.trim()}}function st(e,r={}){let{gfm:i=!0,breaks:o=!1}=r,n=e,l=[];if(n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(v,h,x)=>{let w=l.length,C=h?` class="language-${G(h)}"`:"";return l.push(`<pre><code${C}>${G(x.trim())}</code></pre>`),`\x00CODEBLOCK${w}\x00`}),n=n.replace(/`([^`]*)`/g,(v,h)=>`<code>${G(h)}</code>`),n=n.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),n=n.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),n=n.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),n=n.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),n=n.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),n=n.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),n=n.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),n=n.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),n=n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),n=n.replace(/__(.+?)__/g,"<strong>$1</strong>"),n=n.replace(/\*(.+?)\*/g,"<em>$1</em>"),n=n.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)n=n.replace(/~~(.+?)~~/g,"<del>$1</del>");if(n=n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(v,h,x)=>`<img src="${Me(x)?G(x):""}" alt="${G(h)}" />`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(v,h,x)=>`<a href="${Me(x)?G(x):""}">${h}</a>`),n=n.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),n=n.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),n=n.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
623
|
+
`),n=n.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),n=n.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),n=n.replace(/<\/ul>\n<ul>/g,""),n=n.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),n=n.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),n=n.replace(/<\/ol>\n<ol>/g,""),n=n.replace(/<li data-ul>/g,"<li>"),n=n.replace(/<li data-ol>/g,"<li>"),i)n=n.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(v,h,x)=>{let C=`<tr>${h.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<th>${G(k)}</th>`).join("")}</tr>`,_=x.trim().split(`
|
|
624
|
+
`).map((k)=>`<tr>${k.split("|").map((R)=>R.trim()).filter(Boolean).map((R)=>`<td>${G(R)}</td>`).join("")}</tr>`).join(`
|
|
626
625
|
`);return`<table>
|
|
627
626
|
<thead>
|
|
628
|
-
${
|
|
627
|
+
${C}
|
|
629
628
|
</thead>
|
|
630
629
|
<tbody>
|
|
631
|
-
${
|
|
630
|
+
${_}
|
|
632
631
|
</tbody>
|
|
633
632
|
</table>`});if(i)n=n.replace(/<li>\s*\[\s*\]\s*/g,'<li><input type="checkbox" disabled /> '),n=n.replace(/<li>\s*\[x\]\s*/gi,'<li><input type="checkbox" checked disabled /> ');let d=n.split(`
|
|
634
|
-
`),
|
|
633
|
+
`),m=[],p=!1,g=[];for(let v of d){let h=v.trim();if(/^<(?:h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|th|td|hr|div|p)/.test(h)||/^\0CODEBLOCK\d+\0$/.test(h)||h===""){if(p&&g.length>0)m.push(`<p>${g.join(o?`<br />
|
|
635
634
|
`:`
|
|
636
|
-
`)}</p>`),g=[],
|
|
635
|
+
`)}</p>`),g=[],p=!1;m.push(v)}else p=!0,g.push(h)}if(p&&g.length>0)m.push(`<p>${g.join(o?`<br />
|
|
637
636
|
`:`
|
|
638
|
-
`)}</p>`);if(n=
|
|
637
|
+
`)}</p>`);if(n=m.join(`
|
|
639
638
|
`),o)n=n.replace(/\n/g,`<br />
|
|
640
|
-
`);for(let
|
|
641
|
-
`||
|
|
639
|
+
`);for(let v=0;v<l.length;v++)n=n.replace(`\x00CODEBLOCK${v}\x00`,l[v]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function Tc(e,r,i=""){let o=e,n=[],l=/@markdown(?:\([^)]*\))?/g,d;while((d=l.exec(e))!==null){let m=d.index,p=d[0].match(/@markdown\(([^)]*)\)/),g=p?p[1]:"",v=m+d[0].length,h=1,x=v,w=-1;while(h>0&&x<e.length){let k=e.indexOf("@markdown",x),E=e.indexOf("@endmarkdown",x);if(E===-1)break;if(k!==-1&&k<E&&k!==m){let R=e[k+9];if(R==="("||R===`
|
|
640
|
+
`||R==="\r"||R===" "||R===void 0)h++;x=k+9}else{if(h--,h===0){w=E;break}x=E+12}}if(w===-1)continue;let C=e.slice(v,w),_=e.slice(m,w+12);n.push({fullMatch:_,options:g,content:C,index:m}),l.lastIndex=w+12}for(let{fullMatch:m,options:p,content:g,index:v}of n)try{let h={};if(p)p.split(",").forEach((C)=>{let _=C.trim();if(_)h[_]=!0});let x={gfm:h.gfm??!0,breaks:h.breaks??!1},w=st(g.trim(),x);o=o.split(m).join(w)}catch(h){let x=h instanceof Error?h.message:String(h),w=y("Markdown Directive",`Error processing markdown: ${x}`,i,e,v,m);o=o.split(m).join(w)}return o}async function je(e,r,i,o){let n={gfm:!0,breaks:!1};return r.forEach((l)=>{let d=l.trim().replace(/['"]/g,"");if(d==="breaks")n.breaks=!0;if(d==="no-gfm")n.gfm=!1}),st(e.trim(),n)}var te=[320,480,640,768,1024,1280,1536,1920,2560],ht=[1,1.5,2,3],ne=["avif","webp","jpeg"],yt={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function fe(e,r=te,i={},o){return r.sort((n,l)=>n-l).map((n)=>`${se(e,{...i,w:n,fm:o})} ${n}w`).join(", ")}function Ne(e,r,i=ht,o={},n){return i.sort((l,d)=>l-d).map((l)=>{let d=Math.round(r*l);return`${se(e,{...o,w:d,dpr:l,fm:n})} ${l}x`}).join(", ")}function he(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let o=Object.entries(e).map(([n,l])=>{let d=/^\d+$/.test(n)?`${n}px`:n;return{bp:d,size:l,numericBp:Number.parseInt(d)||0}}).sort((n,l)=>n.numericBp-l.numericBp).map(({bp:n,size:l})=>`(max-width: ${n}) ${l}`);return o.push(r),o.join(", ")}function se(e,r={}){let i=Object.entries(r).filter(([,l])=>l!==void 0&&l!==null).map(([l,d])=>{if(Array.isArray(d))return[l,d.join(",")];return[l,String(d)]});if(i.length===0)return e;let o=i.map(([l,d])=>`${l}=${encodeURIComponent(d)}`).join("&"),n=e.includes("?")?"&":"?";return`${e}${n}${o}`}function ye(e){return yt[e]||"application/octet-stream"}var vt={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},be=`
|
|
642
641
|
.stx-img-placeholder {
|
|
643
642
|
position: relative;
|
|
644
643
|
overflow: hidden;
|
|
@@ -667,7 +666,7 @@ ${P}
|
|
|
667
666
|
filter: blur(0);
|
|
668
667
|
transform: scale(1);
|
|
669
668
|
}
|
|
670
|
-
`.trim();async function
|
|
669
|
+
`.trim();async function bt(){try{return await import("ts-images")}catch{return null}}async function xt(e,r={}){let i={...vt,...r},o=await bt();if(o)try{return await wt(e,i,o)}catch(n){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${n}`)}return $t(e,i)}async function wt(e,r,i){let{generatePlaceholder:o,generateThumbHash:n}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[r.strategy]||"blur";if(r.strategy==="thumbhash")return{dataURL:(await n(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let m=await o(e,{width:r.width,height:r.height,quality:r.quality,blurLevel:r.blurLevel,strategy:d,base64Encode:!0});return{dataURL:m.dataURL,width:m.width,height:m.height,aspectRatio:m.aspectRatio,originalWidth:m.originalWidth,originalHeight:m.originalHeight,strategy:r.strategy,dominantColor:m.dominantColor,css:m.css}}function $t(e,r){let i=r.width||20,o=r.height||i,n="#e5e7eb",l=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}" viewBox="0 0 ${i} ${o}"><rect fill="#e5e7eb" width="${i}" height="${o}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,width:i,height:o,aspectRatio:i/o,originalWidth:0,originalHeight:0,strategy:r.strategy,dominantColor:"#e5e7eb"}}function Ve(e,r,i={}){let o=i.transitionDuration||300,n=i.easing||"ease-out";return`
|
|
671
670
|
#${e} {
|
|
672
671
|
--stx-img-transition-duration: ${o}ms;
|
|
673
672
|
--stx-img-transition-easing: ${n};
|
|
@@ -684,20 +683,20 @@ ${P}
|
|
|
684
683
|
#${e}.stx-img-loaded img {
|
|
685
684
|
opacity: 1;
|
|
686
685
|
}
|
|
687
|
-
`.trim()}var
|
|
688
|
-
`):void 0,script:
|
|
686
|
+
`.trim()}var ve=new Map;async function ze(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(ve.has(i))return ve.get(i);let o=await xt(e,r);return ve.set(i,o),o}async function St(){try{return await import("./chunk-h65shwe9.js")}catch(e){if(!Le)console.warn("[stx-media] Image processor not available, some features disabled:",e),Le=!0;return null}}var Le=!1,xe=80,de="async",ue="lazy",We=!1;async function ce(e,r={}){let i=r,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return kt(o,i)}if(i.processedResult?.processed)return Se(e,i.processedResult,r);if(i.responsiveVariants)return qe(e,i.responsiveVariants,r);let{src:n,alt:l,width:d,height:m,sizes:p,widths:g=te,dpr:v,formats:h=ne,quality:x=xe,params:w={},placeholder:C="none",placeholderOptions:_={},lazy:k=!0,priority:E=!1,loading:R=E?"eager":ue,decoding:T=de,fetchpriority:M,objectFit:A,objectPosition:P,crossorigin:S,referrerpolicy:j}=e,{class:H,style:N,id:z}=e,O=e.data||{},{isDev:W=!1,baseUrl:X=""}=r;if(W&&!r.optimize)return Pt(e);let q,I,B=z||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(C!=="none"&&!E)try{q=await ze(n,{strategy:C,..._}),I=Ve(B,q,_)}catch{}let oe=v!==void 0&&d!==void 0,ee;if(oe)ee=Dt(e,B,q,r);else ee=await Ct(e,B,q,r);let re;if(E){let ke=h.includes("webp")?"webp":h[0],nt=fe(n,g,{...w,q:x},ke),at=typeof p==="object"?he(p):p||"100vw";re=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${at}" />`}let le=[];if(!We&&C!=="none")le.push(be),We=!0;if(I)le.push(I);let rt=k?He(B):void 0;return{html:ee,preloadLink:re,css:le.length>0?le.join(`
|
|
687
|
+
`):void 0,script:rt}}async function Ct(e,r,i,o){let{src:n,alt:l,width:d,height:m,sizes:p,widths:g=te,formats:v=ne,quality:h=xe,params:x={},lazy:w=!0,priority:C=!1,loading:_=C?"eager":ue,decoding:k=de,fetchpriority:E,objectFit:R,objectPosition:T,crossorigin:M,referrerpolicy:A}=e,{class:P,style:S}=e,j=e.data||{},H=typeof p==="object"?he(p):p||"100vw",N=[];for(let W of v){let X=fe(n,g,{...x,q:h},W),q=ye(W);if(w&&!C)N.push(` <source type="${q}" data-srcset="${X}" data-sizes="${H}" />`);else N.push(` <source type="${q}" srcset="${X}" sizes="${H}" />`)}let z=we({src:se(n,{...x,q:h}),alt:l,width:d,height:m,loading:C?void 0:_,decoding:k,fetchpriority:C?"high":E,objectFit:R,objectPosition:T,crossorigin:M,referrerpolicy:A,className:Fe(P,i),style:$e(S,R,T,i),lazy:w&&!C,data:j}),O;if(i){let W=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;O=`<div id="${r}" class="stx-img-placeholder" style="${W}">
|
|
689
688
|
<picture>
|
|
690
|
-
${
|
|
689
|
+
${N.join(`
|
|
691
690
|
`)}
|
|
692
|
-
<img ${
|
|
691
|
+
<img ${z} />
|
|
693
692
|
</picture>
|
|
694
|
-
</div>`}else
|
|
695
|
-
${
|
|
693
|
+
</div>`}else O=`<picture${r?` id="${r}"`:""}>
|
|
694
|
+
${N.join(`
|
|
696
695
|
`)}
|
|
697
|
-
<img ${
|
|
698
|
-
</picture>`;return
|
|
699
|
-
<img ${
|
|
700
|
-
</div>`}return`<img ${r?`id="${r}" `:""}${
|
|
696
|
+
<img ${z} />
|
|
697
|
+
</picture>`;return O}function Dt(e,r,i,o){let{src:n,alt:l,width:d,height:m,dpr:p=[1,2,3],quality:g=xe,params:v={},lazy:h=!0,priority:x=!1,loading:w=x?"eager":ue,decoding:C=de,fetchpriority:_,objectFit:k,objectPosition:E,crossorigin:R,referrerpolicy:T}=e,{class:M,style:A}=e,P=e.data||{},S=typeof d==="number"?d:Number.parseInt(String(d),10),j=Ne(n,S,p,{...v,q:g}),H=we({src:se(n,{...v,w:S,q:g}),alt:l,width:d,height:m,loading:x?void 0:w,decoding:C,fetchpriority:x?"high":_,objectFit:k,objectPosition:E,crossorigin:R,referrerpolicy:T,className:Fe(M,i),style:$e(A,k,E,i),lazy:h&&!x,data:P}),N=h&&!x?`data-srcset="${j}"`:`srcset="${j}"`;if(i){let z=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${r}" class="stx-img-placeholder" style="${z}">
|
|
698
|
+
<img ${H} ${N} />
|
|
699
|
+
</div>`}return`<img ${r?`id="${r}" `:""}${H} ${N} />`}function Pt(e){let{src:r,alt:i,width:o,height:n,loading:l=ue,decoding:d=de,fetchpriority:m,objectFit:p,objectPosition:g,crossorigin:v,referrerpolicy:h,priority:x=!1}=e,{class:w,style:C,id:_}=e,k=e.data||{};return{html:`<img ${we({src:r,alt:i,width:o,height:n,loading:x?"eager":l,decoding:d,fetchpriority:x?"high":m,objectFit:p,objectPosition:g,crossorigin:v,referrerpolicy:h,className:w,style:$e(C,p,g),id:_,data:k})} />`}}function we(e){let r=[];if(e.lazy)r.push(`data-src="${J(e.src)}"`),r.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else r.push(`src="${J(e.src)}"`);if(r.push(`alt="${J(e.alt)}"`),e.width)r.push(`width="${e.width}"`);if(e.height)r.push(`height="${e.height}"`);if(e.loading)r.push(`loading="${e.loading}"`);if(e.decoding)r.push(`decoding="${e.decoding}"`);if(e.fetchpriority)r.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)r.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)r.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)r.push(`class="${J(e.className)}"`);if(e.style)r.push(`style="${J(e.style)}"`);if(e.id)r.push(`id="${J(e.id)}"`);if(e.data)for(let[i,o]of Object.entries(e.data))r.push(`data-${i}="${J(o)}"`);if(e.lazy)r.push("data-stx-lazy");return r.join(" ")}function Fe(e,r){let i=[];if(e)i.push(e);if(r)i.push("stx-img-blur");return i.join(" ")||""}function $e(e,r,i,o){let n=[];if(r)n.push(`object-fit: ${r}`);if(i)n.push(`object-position: ${i}`);if(o)n.push("opacity: 0; transition: opacity 300ms ease-out");if(e)n.push(e);return n.join("; ")}function J(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function He(e){return`
|
|
701
700
|
(function() {
|
|
702
701
|
const container = document.getElementById('${e}');
|
|
703
702
|
if (!container) return;
|
|
@@ -734,27 +733,27 @@ ${M.join(`
|
|
|
734
733
|
|
|
735
734
|
observer.observe(container);
|
|
736
735
|
})();
|
|
737
|
-
`.trim()}async function
|
|
736
|
+
`.trim()}async function kt(e,r){let i=await St();if(!i)return ce({...e,process:!1},r);let o=r.tsImagesConfig;if(e.responsiveWidths&&e.responsiveWidths.length>0||e.widths&&e.widths.length>0||!e.width&&!e.dpr){let l=await i.generateResponsiveVariants(e.src,e,o);if(l)return qe(e,l,r)}else{let l=await i.processImage(e.src,e,o);if(l.processed)return Se(e,l,r)}return ce({...e,process:!1},r)}async function Se(e,r,i){let{alt:o,width:n,height:l,lazy:d=!0,priority:m=!1,objectFit:p,objectPosition:g,crossorigin:v,referrerpolicy:h}=e,{class:x,style:w}=e,C=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,_=e.data||{},k=r.variants||[],E=k.find((I)=>I.format==="jpeg")||k.find((I)=>I.format==="webp")||k[0],R=E?.url||e.src,T=k.filter((I)=>I.format===(E?.format||"jpeg")).map((I)=>`${I.url} ${I.width}w`).join(", "),M=new Map;for(let I of k){if(!M.has(I.format))M.set(I.format,[]);M.get(I.format).push(I)}let A=[],P=["avif","webp","jpeg","png"];for(let I of P){let B=M.get(I);if(B&&B.length>0){let oe=B.map((re)=>`${re.url} ${re.width}w`).join(", "),ee=ye(I);if(d&&!m)A.push(` <source type="${ee}" data-srcset="${oe}" />`);else A.push(` <source type="${ee}" srcset="${oe}" />`)}}let S=[];if(d&&!m){if(S.push(`data-src="${J(R)}"`),S.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),T)S.push(`data-srcset="${T}"`)}else if(S.push(`src="${J(R)}"`),T)S.push(`srcset="${T}"`);S.push(`alt="${J(o)}"`);let j=n||r.originalWidth,H=l||r.originalHeight;if(j)S.push(`width="${j}"`);if(H)S.push(`height="${H}"`);if(!m)S.push(`loading="${d?"lazy":"eager"}"`);if(S.push('decoding="async"'),m)S.push('fetchpriority="high"');if(v)S.push(`crossorigin="${v}"`);if(h)S.push(`referrerpolicy="${h}"`);let N=[];if(p)N.push(`object-fit: ${p}`);if(g)N.push(`object-position: ${g}`);if(r.placeholder&&d)N.push("opacity: 0; transition: opacity 300ms ease-out");if(w)N.push(w);if(N.length>0)S.push(`style="${N.join("; ")}"`);let z=[];if(x)z.push(x);if(r.placeholder)z.push("stx-img-blur");if(z.length>0)S.push(`class="${z.join(" ")}"`);if(d&&!m)S.push("data-stx-lazy");for(let[I,B]of Object.entries(_))S.push(`data-${I}="${J(B)}"`);let O;if(r.placeholder||r.dominantColor&&e.useDominantColor){let I=r.placeholder?`background-image: url('${r.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${r.dominantColor};`;O=`<div id="${C}" class="stx-img-placeholder" style="${I}">
|
|
738
737
|
<picture>
|
|
739
|
-
${
|
|
738
|
+
${A.join(`
|
|
740
739
|
`)}
|
|
741
|
-
<img ${
|
|
740
|
+
<img ${S.join(" ")} />
|
|
742
741
|
</picture>
|
|
743
|
-
</div>`}else
|
|
744
|
-
${
|
|
742
|
+
</div>`}else O=`<picture${C?` id="${C}"`:""}>
|
|
743
|
+
${A.join(`
|
|
745
744
|
`)}
|
|
746
|
-
<img ${
|
|
747
|
-
</picture>`;let
|
|
748
|
-
`):void 0,script:
|
|
749
|
-
`+
|
|
750
|
-
<style>${g.css}</style>`;if(g.script)
|
|
751
|
-
<script>${g.script}</script>`;return
|
|
752
|
-
`),
|
|
753
|
-
${
|
|
745
|
+
<img ${S.join(" ")} />
|
|
746
|
+
</picture>`;let W=[];if(r.placeholder)W.push(be);let X=d?He(C):void 0,q;if(m&&T)q=`<link rel="preload" as="image" imagesrcset="${T}" />`;return{html:O,preloadLink:q,css:W.length>0?W.join(`
|
|
747
|
+
`):void 0,script:X}}async function qe(e,r,i){let o={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[n,l]of Object.entries(r.byFormat))if(l)o.variants.push(...l);return Se(e,o,i)}function At(){return Tt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,i,o)=>{let{src:n,alt:l,options:d}=_t(e,r,i);if(!n)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let m={src:n,alt:l||"",widths:d.widths||te,formats:d.formats||ne,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},p=i.__isDev||!1,g=await ce(m,{isDev:p}),v=g.html;if(g.preloadLink)v=g.preloadLink+`
|
|
748
|
+
`+v;if(g.css)v+=`
|
|
749
|
+
<style>${g.css}</style>`;if(g.script)v+=`
|
|
750
|
+
<script>${g.script}</script>`;return v},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function _t(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=Rt(o),l=Ce(n[0],i)||"",d=Ce(n[1],i)||"",m={};if(n[2]){let p=Ce(n[2],i);if(typeof p==="object"&&p!==null)m=p;else if(typeof n[2]==="string")try{m=JSON.parse(n[2])}catch{}}return{src:l,alt:d,options:m}}function Rt(e){let r=[],i="",o=!1,n="",l=0,d=0;for(let m=0;m<e.length;m++){let p=e[m],g=m>0?e[m-1]:"";if((p==='"'||p==="'"||p==="`")&&g!=="\\"){if(!o)o=!0,n=p;else if(p===n)o=!1,n="";else i+=p;continue}if(!o){if(p==="{")l++;if(p==="}")l--;if(p==="[")d++;if(p==="]")d--;if(p===","&&l===0&&d===0){r.push(i.trim()),i="";continue}}i+=p}if(i.trim())r.push(i.trim());return r}function Ce(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Ue=At();import{existsSync as Et}from"fs";import ie from"path";function Ts(){let e=[ie.join(import.meta.dir,"primitives"),ie.join(import.meta.dir,"..","primitives"),ie.join(import.meta.dir,"native","primitives"),ie.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Et(ie.join(r,"View.stx")))return r;return e[0]}async function Je(){try{return await import("./chunk-64ebysb4.js")}catch(e){if(!Be)console.warn("[stx-media] Video processor not available, some features disabled:",e),Be=!0;return null}}var Be=!1,Ke=!0,Ge="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function pe(e,r={}){let i=r,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return Vt(o,i)}if(i.processedResult?.processed)return Xe(e,i.processedResult,r);let n;if(o.generatePoster&&o.src&&!e.poster)n=await zt(o,i);let{src:l,sources:d=[],poster:m,posterPlaceholder:p,controls:g=Ke,autoplay:v=!1,muted:h=!1,loop:x=!1,preload:w=Ge,playsinline:C=!0,lazy:_=!0,player:k="native",type:E,width:R,height:T,crossorigin:M,disablePictureInPicture:A=!1,disableRemotePlayback:P=!1}=e,S=n||m,{class:j,style:H}=e,N=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(k==="ts-video")return Mt(e,r);if(E&&E!=="video")return It(l||"",E,e);let z=d.length>0?d:l?[{src:l,type:Ye(l)}]:[],O=[`id="${N}"`];if(g)O.push("controls");if(v)O.push("autoplay");if(h)O.push("muted");if(x)O.push("loop");if(C)O.push("playsinline");if(A)O.push("disablepictureinpicture");if(P)O.push("disableremoteplayback");if(M)O.push(`crossorigin="${M}"`);if(_){if(O.push(`data-preload="${w}"`),O.push('preload="none"'),S)O.push(`data-poster="${F(S)}"`);O.push("data-stx-lazy")}else if(O.push(`preload="${w}"`),S)O.push(`poster="${F(S)}"`);if(R)O.push(`width="${R}"`);if(T)O.push(`height="${T}"`);if(j)O.push(`class="${F(j)}"`);if(H)O.push(`style="${F(H)}"`);let W=z.map((I)=>` <source ${_?`data-src="${F(I.src)}"`:`src="${F(I.src)}"`} type="${I.type}"${I.media?` media="${I.media}"`:""} />`).join(`
|
|
751
|
+
`),X=`<video ${O.join(" ")}>
|
|
752
|
+
${W}
|
|
754
753
|
Your browser does not support the video tag.
|
|
755
|
-
</video>`,
|
|
754
|
+
</video>`,q;if(_)q=`
|
|
756
755
|
(function() {
|
|
757
|
-
var video = document.getElementById('${
|
|
756
|
+
var video = document.getElementById('${N}');
|
|
758
757
|
if (!video) return;
|
|
759
758
|
|
|
760
759
|
var observer = new IntersectionObserver(function(entries) {
|
|
@@ -787,20 +786,20 @@ ${V}
|
|
|
787
786
|
|
|
788
787
|
observer.observe(video);
|
|
789
788
|
})();
|
|
790
|
-
`.trim();return{html:
|
|
791
|
-
<iframe ${
|
|
792
|
-
</div>`}}function
|
|
789
|
+
`.trim();return{html:X,script:q}}function It(e,r,i){let{width:o=640,height:n=360}=i,{class:l,style:d}=i,m=i.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,p,g=null;switch(r){case"youtube":g=jt(e),p=g?`https://www.youtube-nocookie.com/embed/${g}`:e;break;case"vimeo":g=Nt(e),p=g?`https://player.vimeo.com/video/${g}`:e;break;case"dailymotion":g=e.split("/").pop()||"",p=`https://www.dailymotion.com/embed/video/${g}`;break;case"twitch":g=e.split("/").pop()||"",p=`https://player.twitch.tv/?video=${g}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:p=e}let v=[`id="${m}"`,`src="${F(p)}"`,`width="${o}"`,`height="${n}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(l)v.push(`class="${F(l)}"`);if(d)v.push(`style="${F(d)}"`);if(i.lazy)v.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
790
|
+
<iframe ${v.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
|
|
791
|
+
</div>`}}function Mt(e,r={}){let{src:i,sources:o=[],poster:n,controls:l=!0,autoplay:d=!1,muted:m=!1,loop:p=!1,preload:g="metadata",playsinline:v=!0,lazy:h=!0,width:x,height:w}=e,{class:C,style:_}=e,k=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,E={src:o.length>0?o:i,autoplay:d,loop:p,muted:m,playsinline:v,preload:g,poster:n,controls:l,title:e.title},R=["position: relative",x?`width: ${typeof x==="number"?x+"px":x}`:"width: 100%",w?`height: ${typeof w==="number"?w+"px":w}`:"",_||""].filter(Boolean).join("; "),T=`
|
|
793
792
|
<div
|
|
794
|
-
id="${
|
|
795
|
-
class="ts-video-player${
|
|
796
|
-
style="${
|
|
793
|
+
id="${k}"
|
|
794
|
+
class="ts-video-player${C?" "+F(C):""}"
|
|
795
|
+
style="${R}"
|
|
797
796
|
data-ts-video-player
|
|
798
|
-
data-config='${JSON.stringify(
|
|
799
|
-
${
|
|
797
|
+
data-config='${JSON.stringify(E)}'
|
|
798
|
+
${h?"data-lazy":""}
|
|
800
799
|
>
|
|
801
800
|
<div class="ts-video-player__container">
|
|
802
801
|
${n?`
|
|
803
|
-
<div class="ts-video-player__placeholder" style="background-image: url('${
|
|
802
|
+
<div class="ts-video-player__placeholder" style="background-image: url('${F(n)}');">
|
|
804
803
|
<button class="ts-video-player__play-button" aria-label="Play video">
|
|
805
804
|
<svg viewBox="0 0 24 24" fill="currentColor" width="64" height="64">
|
|
806
805
|
<path d="M8 5v14l11-7z"/>
|
|
@@ -810,9 +809,9 @@ ${V}
|
|
|
810
809
|
`:""}
|
|
811
810
|
</div>
|
|
812
811
|
</div>
|
|
813
|
-
`.trim(),
|
|
812
|
+
`.trim(),M=`
|
|
814
813
|
(function() {
|
|
815
|
-
var container = document.getElementById('${
|
|
814
|
+
var container = document.getElementById('${k}');
|
|
816
815
|
if (!container) return;
|
|
817
816
|
|
|
818
817
|
var config = JSON.parse(container.dataset.config || '{}');
|
|
@@ -826,7 +825,7 @@ ${V}
|
|
|
826
825
|
|
|
827
826
|
// Load ts-video-player from CDN
|
|
828
827
|
var script = document.createElement('script');
|
|
829
|
-
script.src = '${
|
|
828
|
+
script.src = '${Ot}';
|
|
830
829
|
script.onload = initPlayer;
|
|
831
830
|
script.onerror = function() {
|
|
832
831
|
console.error('[stx] Failed to load ts-video-player');
|
|
@@ -904,7 +903,7 @@ else {
|
|
|
904
903
|
});
|
|
905
904
|
}
|
|
906
905
|
})();
|
|
907
|
-
`.trim(),
|
|
906
|
+
`.trim(),A=`
|
|
908
907
|
.ts-video-player {
|
|
909
908
|
position: relative;
|
|
910
909
|
background: #000;
|
|
@@ -956,14 +955,14 @@ else {
|
|
|
956
955
|
.ts-video-player__play-button svg {
|
|
957
956
|
margin-left: 4px;
|
|
958
957
|
}
|
|
959
|
-
`.trim();return{html:
|
|
960
|
-
${
|
|
958
|
+
`.trim();return{html:T,script:M,css:A}}function Ye(e){switch(e.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function jt(e){let r=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let i of r){let o=e.match(i);if(o)return o[1]}return null}function Nt(e){let r=e.match(/vimeo\.com\/(\d+)/);return r?r[1]:null}function F(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}async function Vt(e,r){let i=await Je();if(!i)return pe({...e,process:!1},r);let o=r.tsVideosConfig,n=await i.processVideo(e.src,e,o,e.onProcessProgress);if(n.processed)return Xe(e,n,r);return pe({...e,process:!1},r)}async function zt(e,r){let i=await Je();if(!i||!e.src)return;let o=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},n=r.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await i.generatePoster(e.src,o,n.outputDir,n.baseUrl||"/videos"))?.url}function Xe(e,r,i){let{controls:o=Ke,autoplay:n=!1,muted:l=!1,loop:d=!1,preload:m=Ge,playsinline:p=!0,lazy:g=!0,width:v,height:h,crossorigin:x,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,{class:_,style:k}=e,E=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,R=e.src,T=Ye(R);if(r.transcoded)R=r.transcoded.url,T="video/mp4";let M=r.streaming?.hls||r.streaming?.dash;if(M){if(r.streaming?.hls)R=r.streaming.hls.manifestUrl,T="application/x-mpegURL";else if(r.streaming?.dash)R=r.streaming.dash.manifestUrl,T="application/dash+xml"}let A=r.poster?.url||e.poster,P=[`id="${E}"`];if(o)P.push("controls");if(n)P.push("autoplay");if(l)P.push("muted");if(d)P.push("loop");if(p)P.push("playsinline");if(w)P.push("disablepictureinpicture");if(C)P.push("disableremoteplayback");if(x)P.push(`crossorigin="${x}"`);if(g){if(P.push(`data-preload="${m}"`),P.push('preload="none"'),A)P.push(`data-poster="${F(A)}"`);P.push("data-stx-lazy")}else if(P.push(`preload="${m}"`),A)P.push(`poster="${F(A)}"`);let S=v||r.metadata?.width,j=h||r.metadata?.height;if(S)P.push(`width="${S}"`);if(j)P.push(`height="${j}"`);if(_)P.push(`class="${F(_)}"`);if(k)P.push(`style="${F(k)}"`);let N=` <source ${g?`data-src="${F(R)}"`:`src="${F(R)}"`} type="${T}" />`,z=`<video ${P.join(" ")}>
|
|
959
|
+
${N}
|
|
961
960
|
Your browser does not support the video tag.
|
|
962
|
-
</video>`;if(r.spriteSheet)
|
|
963
|
-
${
|
|
964
|
-
</div>`;let
|
|
961
|
+
</video>`;if(r.spriteSheet)z=`<div class="stx-video-wrapper" data-sprite-sheet="${F(r.spriteSheet.url)}" data-sprite-cols="${r.spriteSheet.columns}" data-sprite-interval="${r.spriteSheet.interval}">
|
|
962
|
+
${z}
|
|
963
|
+
</div>`;let O;if(g)O=`
|
|
965
964
|
(function() {
|
|
966
|
-
var video = document.getElementById('${
|
|
965
|
+
var video = document.getElementById('${E}');
|
|
967
966
|
if (!video) return;
|
|
968
967
|
|
|
969
968
|
var observer = new IntersectionObserver(function(entries) {
|
|
@@ -996,7 +995,7 @@ ${j}
|
|
|
996
995
|
|
|
997
996
|
observer.observe(video);
|
|
998
997
|
})();
|
|
999
|
-
`.trim();let
|
|
998
|
+
`.trim();let W;if(M)W=`
|
|
1000
999
|
.stx-video-wrapper {
|
|
1001
1000
|
position: relative;
|
|
1002
1001
|
width: 100%;
|
|
@@ -1005,9 +1004,9 @@ ${j}
|
|
|
1005
1004
|
width: 100%;
|
|
1006
1005
|
height: auto;
|
|
1007
1006
|
}
|
|
1008
|
-
`.trim();return{html:
|
|
1009
|
-
<style>${g.css}</style>`;if(g.script)
|
|
1010
|
-
<script>${g.script}</script>`;return
|
|
1007
|
+
`.trim();return{html:z,script:O,css:W}}function Ze(){return Tt({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,r,i,o)=>{let{src:n,options:l}=Lt(e,r,i);if(!n)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:n,poster:l.poster,controls:l.controls!==!1,autoplay:l.autoplay||!1,muted:l.muted||!1,loop:l.loop||!1,preload:l.preload||"metadata",playsinline:l.playsinline!==!1,lazy:l.lazy!==!1,player:l.player||"native",type:l.type,width:l.width,height:l.height,class:l.class,style:l.style,id:l.id,crossorigin:l.crossorigin,disablePictureInPicture:l.disablePictureInPicture,disableRemotePlayback:l.disableRemotePlayback,title:l.title,quality:l.quality,platform:l.platform,process:l.process,generatePoster:l.generatePoster,streaming:l.streaming,transcode:l.transcode,spriteSheet:l.spriteSheet,waveform:l.waveform},p={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},g=await pe(d,p),v=g.html;if(g.css)v+=`
|
|
1008
|
+
<style>${g.css}</style>`;if(g.script)v+=`
|
|
1009
|
+
<script>${g.script}</script>`;return v},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Lt(e,r,i){if(r.src)return{src:String(r.src),options:r.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=Wt(o),l=Qe(n[0],i)||"",d={};if(n[1]){let m=Qe(n[1],i);if(typeof m==="object"&&m!==null)d=m;else if(typeof n[1]==="string")try{d=JSON.parse(n[1])}catch{}}return{src:l,options:d}}function Wt(e){let r=[],i="",o=!1,n="",l=0,d=0;for(let m=0;m<e.length;m++){let p=e[m],g=m>0?e[m-1]:"";if((p==='"'||p==="'"||p==="`")&&g!=="\\"){if(!o)o=!0,n=p;else if(p===n)o=!1,n="";else i+=p;continue}if(!o){if(p==="{")l++;if(p==="}")l--;if(p==="[")d++;if(p==="]")d--;if(p===","&&l===0&&d===0){r.push(i.trim()),i="";continue}}i+=p}if(i.trim())r.push(i.trim());return r}function Qe(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var De=Ze();import Ft from"fs";import U from"path";async function $s(e,r){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let n of i)try{let l=await Ht(n,e,r);if(l)o.push(l)}catch(l){if(console.error(`Error building web component ${n.name}:`,l),e.debug)throw l}}return o}async function Ht(e,r,i){let{name:o,file:n,tag:l,extends:d}=e;if(!o||!n||!l)return console.error("Invalid web component configuration, missing required fields:",e),null;let m=null;if(U.isAbsolute(n)&&await s(n))m=n;else if(r.componentsDir){let _=U.join(r.componentsDir,n);if(await s(_))m=_}if(!m)m=await _n(n,process.cwd(),r,i);if(!m)return console.error(`Web component source file not found: ${n}`),null;let p=await Bun.file(m).text();i.add(m);let v=(e.outputFormat||"js")==="ts",h=v?Ut({name:o,tag:l,baseElement:d,source:p,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):qt({name:o,tag:l,baseElement:d,source:p,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),x=r.webComponents?.outputDir||"dist/web-components";await Ft.promises.mkdir(x,{recursive:!0});let w=v?"ts":"js",C=U.join(x,`${l}.${w}`);if(await Bun.write(C,h),r.debug)console.log(`Built web component ${o} -> ${C}`);return C}function qt(e){let{name:r,tag:i,baseElement:o="HTMLElement",source:n,shadowDOM:l,template:d,styleSource:m,attributes:p=[]}=e,g=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)g=g.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),g=g.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),g=g.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),g=g.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let v="";if(m)v=`<link rel="stylesheet" href="${m}">`;return`/**
|
|
1011
1010
|
* ${r} Web Component
|
|
1012
1011
|
* Auto-generated from stx component
|
|
1013
1012
|
*/
|
|
@@ -1015,26 +1014,26 @@ class ${r.replace(/\W/g,"")} extends ${o} {
|
|
|
1015
1014
|
constructor() {
|
|
1016
1015
|
super()
|
|
1017
1016
|
this._initialized = false
|
|
1018
|
-
${
|
|
1019
|
-
${
|
|
1017
|
+
${l?"":"this._slotContent = []"}
|
|
1018
|
+
${l?'this.attachShadow({ mode: "open" })':""}
|
|
1020
1019
|
}
|
|
1021
1020
|
|
|
1022
1021
|
${d?`
|
|
1023
1022
|
_createTemplate() {
|
|
1024
1023
|
const template = document.createElement('template')
|
|
1025
|
-
template.innerHTML = \`${
|
|
1026
|
-
${
|
|
1024
|
+
template.innerHTML = \`${v}${g}\`
|
|
1025
|
+
${l?"this.shadowRoot.appendChild(template.content.cloneNode(true))":"this.appendChild(template.content.cloneNode(true))"}
|
|
1027
1026
|
this._processSlots()
|
|
1028
1027
|
}
|
|
1029
1028
|
`:`
|
|
1030
1029
|
_render() {
|
|
1031
|
-
${
|
|
1030
|
+
${l?"this.shadowRoot.innerHTML":"this.innerHTML"} = \`${v}${g}\`
|
|
1032
1031
|
this._processSlots()
|
|
1033
1032
|
}
|
|
1034
1033
|
`}
|
|
1035
1034
|
|
|
1036
1035
|
_processSlots() {
|
|
1037
|
-
${
|
|
1036
|
+
${l?`// Shadow DOM handles slot assignment automatically
|
|
1038
1037
|
// Listen for slot changes if needed
|
|
1039
1038
|
const slots = this.shadowRoot.querySelectorAll('slot')
|
|
1040
1039
|
slots.forEach(slot => {
|
|
@@ -1072,9 +1071,9 @@ class ${r.replace(/\W/g,"")} extends ${o} {
|
|
|
1072
1071
|
}`}
|
|
1073
1072
|
}
|
|
1074
1073
|
|
|
1075
|
-
${
|
|
1074
|
+
${p.length>0?`
|
|
1076
1075
|
static get observedAttributes() {
|
|
1077
|
-
return [${
|
|
1076
|
+
return [${p.map((h)=>`'${h}'`).join(", ")}]
|
|
1078
1077
|
}
|
|
1079
1078
|
|
|
1080
1079
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
@@ -1087,7 +1086,7 @@ class ${r.replace(/\W/g,"")} extends ${o} {
|
|
|
1087
1086
|
|
|
1088
1087
|
connectedCallback() {
|
|
1089
1088
|
if (this._initialized) return
|
|
1090
|
-
${
|
|
1089
|
+
${l?"":"this._slotContent = Array.from(this.childNodes)"}
|
|
1091
1090
|
this._initialized = true
|
|
1092
1091
|
${d?"this._createTemplate()":"this._render()"}
|
|
1093
1092
|
}
|
|
@@ -1099,31 +1098,31 @@ class ${r.replace(/\W/g,"")} extends ${o} {
|
|
|
1099
1098
|
|
|
1100
1099
|
// Register the web component
|
|
1101
1100
|
customElements.define('${i}', ${r.replace(/\W/g,"")})
|
|
1102
|
-
`}function
|
|
1103
|
-
`),
|
|
1104
|
-
get ${
|
|
1105
|
-
return this._${
|
|
1101
|
+
`}function Ut(e){let{name:r,tag:i,baseElement:o="HTMLElement",source:n,shadowDOM:l,template:d,styleSource:m,attributes:p=[],attributeTypes:g={}}=e,v=r.replace(/\W/g,""),h=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)h=h.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),h=h.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),h=h.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),h=h.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");h=h.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let x=m?`<link rel="stylesheet" href="${m}">`:"",w=(A)=>{switch(g[A]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},C=(A)=>A.replace(/-([a-z])/g,(P,S)=>S.toUpperCase()),_=p.map((A)=>` private _${C(A)}: ${w(A)} | null = null;`).join(`
|
|
1102
|
+
`),k=p.map((A)=>{let P=w(A),S=C(A);return`
|
|
1103
|
+
get ${S}(): ${P} | null {
|
|
1104
|
+
return this._${S};
|
|
1106
1105
|
}
|
|
1107
1106
|
|
|
1108
|
-
set ${
|
|
1109
|
-
this._${
|
|
1107
|
+
set ${S}(value: ${P} | null) {
|
|
1108
|
+
this._${S} = value;
|
|
1110
1109
|
if (value !== null) {
|
|
1111
|
-
this.setAttribute('${
|
|
1110
|
+
this.setAttribute('${A}', String(value));
|
|
1112
1111
|
}
|
|
1113
1112
|
else {
|
|
1114
|
-
this.removeAttribute('${
|
|
1113
|
+
this.removeAttribute('${A}');
|
|
1115
1114
|
}
|
|
1116
1115
|
}`}).join(`
|
|
1117
|
-
`),
|
|
1116
|
+
`),E=p.length>0?`/**
|
|
1118
1117
|
* Props interface for ${r}
|
|
1119
1118
|
*/
|
|
1120
|
-
export interface ${
|
|
1121
|
-
${
|
|
1119
|
+
export interface ${v}Props {
|
|
1120
|
+
${p.map((A)=>{let P=w(A);return` ${C(A)}?: ${P};`}).join(`
|
|
1122
1121
|
`)}
|
|
1123
1122
|
}
|
|
1124
|
-
`:"",
|
|
1123
|
+
`:"",R=p.length>0?`
|
|
1125
1124
|
static get observedAttributes(): string[] {
|
|
1126
|
-
return [${
|
|
1125
|
+
return [${p.map((A)=>`'${A}'`).join(", ")}];
|
|
1127
1126
|
}
|
|
1128
1127
|
|
|
1129
1128
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {
|
|
@@ -1146,15 +1145,15 @@ catch { return value; }
|
|
|
1146
1145
|
default: return value;
|
|
1147
1146
|
}
|
|
1148
1147
|
}
|
|
1149
|
-
`:"",
|
|
1148
|
+
`:"",T=d?`
|
|
1150
1149
|
private _createTemplate(): void {
|
|
1151
1150
|
const template = document.createElement('template');
|
|
1152
|
-
template.innerHTML = \`${
|
|
1153
|
-
${
|
|
1151
|
+
template.innerHTML = \`${x}${h}\`;
|
|
1152
|
+
${l?"this.shadowRoot!.appendChild(template.content.cloneNode(true));":"this.appendChild(template.content.cloneNode(true));"}
|
|
1154
1153
|
this._processSlots();
|
|
1155
1154
|
}`:`
|
|
1156
1155
|
private _render(): void {
|
|
1157
|
-
${
|
|
1156
|
+
${l?"this.shadowRoot!.innerHTML":"this.innerHTML"} = \`${x}${h}\`;
|
|
1158
1157
|
this._processSlots();
|
|
1159
1158
|
}`;return`/**
|
|
1160
1159
|
* ${r} Web Component
|
|
@@ -1174,22 +1173,22 @@ interface SlotChangeDetail {
|
|
|
1174
1173
|
assignedNodes: Node[];
|
|
1175
1174
|
}
|
|
1176
1175
|
|
|
1177
|
-
${
|
|
1176
|
+
${E}
|
|
1178
1177
|
/**
|
|
1179
1178
|
* ${r} custom element class
|
|
1180
1179
|
* @customElement ${i}
|
|
1181
1180
|
*/
|
|
1182
|
-
export class ${
|
|
1183
|
-
${
|
|
1181
|
+
export class ${v} extends ${o} {
|
|
1182
|
+
${_}
|
|
1184
1183
|
private _initialized = false;
|
|
1185
|
-
${
|
|
1184
|
+
${l?"":"private _slotContent: Node[] = [];"}
|
|
1186
1185
|
|
|
1187
1186
|
constructor() {
|
|
1188
1187
|
super();
|
|
1189
|
-
${
|
|
1188
|
+
${l?'this.attachShadow({ mode: "open" });':""}
|
|
1190
1189
|
}
|
|
1191
|
-
${
|
|
1192
|
-
${
|
|
1190
|
+
${T}
|
|
1191
|
+
${l?`
|
|
1193
1192
|
private _processSlots(): void {
|
|
1194
1193
|
const slots = this.shadowRoot!.querySelectorAll('slot');
|
|
1195
1194
|
slots.forEach((slot) => {
|
|
@@ -1226,12 +1225,12 @@ ${c?`
|
|
|
1226
1225
|
}
|
|
1227
1226
|
}
|
|
1228
1227
|
}`}
|
|
1228
|
+
${R}
|
|
1229
1229
|
${k}
|
|
1230
|
-
${C}
|
|
1231
1230
|
|
|
1232
1231
|
connectedCallback(): void {
|
|
1233
1232
|
if (this._initialized) return;
|
|
1234
|
-
${
|
|
1233
|
+
${l?"":"this._slotContent = Array.from(this.childNodes);"}
|
|
1235
1234
|
this._initialized = true;
|
|
1236
1235
|
${d?"this._createTemplate();":"this._render();"}
|
|
1237
1236
|
}
|
|
@@ -1248,22 +1247,22 @@ ${C}
|
|
|
1248
1247
|
// Type augmentation for HTMLElementTagNameMap
|
|
1249
1248
|
declare global {
|
|
1250
1249
|
interface HTMLElementTagNameMap {
|
|
1251
|
-
'${i}': ${
|
|
1250
|
+
'${i}': ${v};
|
|
1252
1251
|
}
|
|
1253
1252
|
}
|
|
1254
1253
|
|
|
1255
1254
|
// Register the web component
|
|
1256
|
-
customElements.define('${i}', ${
|
|
1257
|
-
`}function
|
|
1258
|
-
get ${
|
|
1259
|
-
return this.getAttribute('${
|
|
1255
|
+
customElements.define('${i}', ${v});
|
|
1256
|
+
`}function Bt(e,r){let i=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),o=i?i[1].trim():"",n=r,l=[],d=!0;if(o){let h=o.match(/export\s+default\s+({[\s\S]*})/);if(h)try{let x=h[1],w=x.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(w)n=w[1];let C=x.match(/props\s*:\s*\[([\s\S]*?)\]/);if(C)l=C[1].split(",").map((k)=>k.trim().replace(/['"`]/g,"")).filter((k)=>k.length>0);let _=x.match(/shadowDOM\s*:\s*(true|false)/);if(_)d=_[1]==="true"}catch{}}let m=e.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),p=m?m[1].trim():"",g=e.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),v=g?g[1].trim():"";return{tag:n,props:l,template:p,styles:v,script:o,shadowDOM:d}}function Jt(e){let{tag:r,props:i,template:o,styles:n,shadowDOM:l}=e,d=r.split("-").map((h)=>h.charAt(0).toUpperCase()+h.slice(1)).join(""),m=o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),p=n.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),g=i.map((h)=>`'${h}'`).join(", "),v=i.map((h)=>`
|
|
1257
|
+
get ${h}() {
|
|
1258
|
+
return this.getAttribute('${h}') || '';
|
|
1260
1259
|
}
|
|
1261
|
-
set ${
|
|
1260
|
+
set ${h}(value) {
|
|
1262
1261
|
if (value) {
|
|
1263
|
-
this.setAttribute('${
|
|
1262
|
+
this.setAttribute('${h}', value);
|
|
1264
1263
|
}
|
|
1265
1264
|
else {
|
|
1266
|
-
this.removeAttribute('${
|
|
1265
|
+
this.removeAttribute('${h}');
|
|
1267
1266
|
}
|
|
1268
1267
|
}`).join(`
|
|
1269
1268
|
`);return`/**
|
|
@@ -1273,7 +1272,7 @@ else {
|
|
|
1273
1272
|
class ${d} extends HTMLElement {
|
|
1274
1273
|
constructor() {
|
|
1275
1274
|
super();
|
|
1276
|
-
${
|
|
1275
|
+
${l?"this.attachShadow({ mode: 'open' });":""}
|
|
1277
1276
|
this._render();
|
|
1278
1277
|
}
|
|
1279
1278
|
|
|
@@ -1286,17 +1285,17 @@ class ${d} extends HTMLElement {
|
|
|
1286
1285
|
this._render();
|
|
1287
1286
|
}
|
|
1288
1287
|
}
|
|
1289
|
-
${
|
|
1288
|
+
${v}
|
|
1290
1289
|
|
|
1291
1290
|
_render() {
|
|
1292
|
-
const template = \`${
|
|
1291
|
+
const template = \`${p?`<style>${p}</style>`:""}${m}\`;
|
|
1293
1292
|
|
|
1294
1293
|
// Interpolate {{ prop }} with attribute values
|
|
1295
1294
|
const rendered = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, prop) => {
|
|
1296
1295
|
return this.getAttribute(prop) || '';
|
|
1297
1296
|
});
|
|
1298
1297
|
|
|
1299
|
-
${
|
|
1298
|
+
${l?"this.shadowRoot.innerHTML = rendered;":"this.innerHTML = rendered;"}
|
|
1300
1299
|
}
|
|
1301
1300
|
|
|
1302
1301
|
connectedCallback() {
|
|
@@ -1305,8 +1304,8 @@ ${y}
|
|
|
1305
1304
|
}
|
|
1306
1305
|
|
|
1307
1306
|
customElements.define('${r}', ${d});
|
|
1308
|
-
`}async function
|
|
1309
|
-
${
|
|
1310
|
-
</script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:gn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},Rc,Ac,$s,Rs,Pe,Ae,_e,ke,Re,Oe,He,Se,...oo],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(X.existsSync(c)&&X.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(X.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function eg(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${o.root}`;if(!Qe.has(n))Qe.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,n))continue;e[c]=N.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||N.isAbsolute(c))continue;e[n]=N.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=N.isAbsolute(n)?n:N.join(r,n);if(X.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(jc(e.stateDir),e.stateDir=wr(),e.cachePath=vr(e.cachePath),e.build)e.build.cacheDir=vr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=vr(e.media.cache.directory);if(e.story)e.story.outDir=vr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function ei(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var Zt=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Cc(e,r){let i=h.resolve(e,{paths:[r]});if(Zt.test(i))throw Error(`${e} is not installed in ${r} (found only in Bun's install cache)`);return i}async function a(e){let r=e?N.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==Es(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-rb7cwck6.js"),{partialsCache:p}=await import("./chunk-15sgdvyd.js");if(d(),p.clear(),c&&i.configSignature===Ts(i.graph)){let u=c.then(async(g)=>{let y={...i.graph};await ni(y,r),ue.set(r,{graph:y,signature:Es(y),configSignature:Ts(y)});let f={...g,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>X.existsSync(N.join(r,`stx.config${v}`))),p=c.some((v)=>X.existsSync(N.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await ei({name:"ui",cwd:N.join(r,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await ei({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await ei({name:"stx",alias:"ui",cwd:r,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await Ic(r,F);u=v.config,ue.set(r,{graph:v.graph,signature:Es(v.graph),configSignature:Ts(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-p95fsnbk.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-tarvase5.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),eg(u,r),Gt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{Cc(b,r),g.push(b)}catch{}}let f=[...u.plugins??[],...g];if(f.length>0){let{pluginManager:v}=await import("./chunk-egtphftq.js"),b=[],w=[],P=new Set(u.componentPackages??["@stacksjs/components"]),C=[];for(let A of f){let k=typeof A==="string"?A:A[0],E=typeof A==="string"?{}:A[1]||{};try{let I,D;try{let x=Cc(k,r);I=await import(x),D=N.dirname(x)}catch{let x=N.resolve(r,k);I=await import(x),D=N.dirname(x)}let S=I.default||I;if(!v.has(S.name))await v.register(S,u);if(S.components){let x=Array.isArray(S.components)?S.components:[S.components],T=P.has(S.name)||P.has(k)||P.has(k.replace(/\/stx-plugin$/,""));for(let L of x){let M=N.resolve(D,L);b.push(M);let j=T;if(!j){let _=di(N.join(M,"package.json"));if(_)try{let V=JSON.parse(X.readFileSync(N.join(_,"package.json"),"utf8"));j=typeof V.name==="string"&&P.has(V.name)}catch{}}if(j)w.push(M)}}if(S.pages){let x=N.resolve(D,S.pages),T=E.path||"/";C.push({dir:x,prefix:T})}if(S.setup){let x={addDirective:(T)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(T)},addRoute:(T,L)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[T]=L},addMiddleware:(T)=>{u.middleware=u.middleware||[],u.middleware.push(T)},pluginDir:D,config:u};await S.setup(E,x)}process.stderr.write(`[stx] Plugin loaded: ${S.name||k}
|
|
1311
|
-
`)}catch(
|
|
1312
|
-
export{
|
|
1307
|
+
`}async function et(e,r,i,o){if(r.length<1)return u("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=r[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",m=U.isAbsolute(d)?[U.join(d,`${n}.stx`),U.join(U.dirname(o),`${n}.stx`)]:[U.join(U.dirname(o),d,`${n}.stx`),U.join(process.cwd(),d,`${n}.stx`),U.join(U.dirname(o),`${n}.stx`)],p=null;for(let h of m)if(await s(h)){p=await Bun.file(h).text();break}if(!p)return u("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let g=Bt(p,n);return`<script type="module">
|
|
1308
|
+
${Jt(g)}
|
|
1309
|
+
</script>`}var V={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:yn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:je,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:et,hasEndTag:!1,description:"Include a web component in the template"},Ic,Oc,Ps,Is,Ae,Re,Ee,_e,Oe,Te,Ue,De,...co],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Gt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),l=L.join(n,"resources","views"),d=L.join(n,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=L.join(n,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,ge=["partialsDir","componentsDir","layoutsDir"],Pe=new WeakMap;function Yt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function rg(e,r){let i=!e.root,o=Gt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${o.root}`;if(!tt.has(n))tt.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Pe.has(e)){let n={};for(let l of ge){let d=e[l];if(typeof d==="string"&&d)n[l]=d}Pe.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let l of ge){let d=e[l];if(typeof d!=="string"||!d)continue;if(L.isAbsolute(d)||Yt(d,n))continue;e[l]=L.join(n,d)}}for(let n of ge){let l=e[n];if(typeof l!=="string"||!l||L.isAbsolute(l))continue;e[n]=L.resolve(r,l)}return e}function Xt(e,r){let i=Pe.get(e);for(let o of ge){let n=e[o];if(typeof n!=="string"||!n)continue;let l=L.isAbsolute(n)?n:L.join(r,n);if(Q.existsSync(l))continue;let d=i?.[o]??n,m=e.root,p=!!m&&m!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(p?`, resolved under root "${m}".`:"."))}}function Zt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Qt(e){if(zc(e.stateDir),e.stateDir=Sr(),e.cachePath=kr(e.cachePath),e.build)e.build.cacheDir=kr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=kr(e.media.cache.directory);if(e.story)e.story.outDir=kr(e.story.outDir)}var Y=null,Z=new Map,me=new Map,ae=null;async function ri(e,r=Kt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var er=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function $c(e,r){let i=b.resolve(e,{paths:[r]});if(er.test(i))throw Error(`${e} is not installed in ${r} (found only in Bun's install cache)`);return i}async function a(e){let r=e?L.resolve(e):process.cwd(),i=me.get(r);if(i&&i.signature!==Rs(i.graph)){let l=Z.get(r);if(Z.delete(r),me.delete(r),!e)Y=null,ae=null;let{clearComponentCache:d}=await import("./chunk-y7f2x57s.js"),{partialsCache:m}=await import("./chunk-kyer53x3.js");if(d(),m.clear(),l&&i.configSignature===As(i.graph)){let p=l.then(async(g)=>{let v={...i.graph};await oi(v,r),me.set(r,{graph:v,signature:Rs(v),configSignature:As(v)});let h={...g,_layerGraph:v};if(!e)Y=h;return h});return Z.set(r,p),p}}if(!e){if(Y)return Y;if(ae)return ae}let o=Z.get(r);if(o)return o;let n=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((x)=>Q.existsSync(L.join(r,`stx.config${x}`))),m=l.some((x)=>Q.existsSync(L.join(r,"config",`ui${x}`))),p;if(d&&m){let x=await ri({name:"ui",cwd:L.join(r,"config"),defaultConfig:V,errorPolicy:"throw",verbose:!1});p=(await ri({name:"stx",alias:"ui",cwd:r,defaultConfig:x.config,errorPolicy:"throw",verbose:!1})).config}else p=(await ri({name:"stx",alias:"ui",cwd:r,defaultConfig:V,errorPolicy:"throw",verbose:!1})).config;if(p.extends!==void 0||i){let x=await Mc(r,V);p=x.config,me.set(r,{graph:x.graph,signature:Rs(x.graph),configSignature:As(x.graph)})}if(p.runtimeConfig){let{resolveRuntimeConfig:x}=await import("./chunk-3gk1e2b1.js");x(p.runtimeConfig,{});let{generateRuntimeConfigTypes:w}=await import("./chunk-1crn4fv0.js");await w(r,p.runtimeConfig)}Zt(p),Qt(p),rg(p,r),Xt(p,r);let g=[],v=new Set((p.plugins??[]).map((x)=>typeof x==="string"?x:x[0]));for(let x of p.componentPackages??["@stacksjs/components"]){let w=`${x}/stx-plugin`;if(v.has(w)||v.has(x))continue;try{$c(w,r),g.push(w)}catch{}}let h=[...p.plugins??[],...g];if(h.length>0){let{pluginManager:x}=await import("./chunk-xjxcwrqs.js"),w=[],C=[],_=new Set(p.componentPackages??["@stacksjs/components"]),k=[];for(let E of h){let R=typeof E==="string"?E:E[0],T=typeof E==="string"?{}:E[1]||{};try{let M,A;try{let S=$c(R,r);M=await import(S),A=L.dirname(S)}catch{let S=L.resolve(r,R);M=await import(S),A=L.dirname(S)}let P=M.default||M;if(!x.has(P.name))await x.register(P,p);if(P.components){let S=Array.isArray(P.components)?P.components:[P.components],j=_.has(P.name)||_.has(R)||_.has(R.replace(/\/stx-plugin$/,""));for(let H of S){let N=L.resolve(A,H);w.push(N);let z=j;if(!z){let O=gi(L.join(N,"package.json"));if(O)try{let W=JSON.parse(Q.readFileSync(L.join(O,"package.json"),"utf8"));z=typeof W.name==="string"&&_.has(W.name)}catch{}}if(z)C.push(N)}}if(P.pages){let S=L.resolve(A,P.pages),j=T.path||"/";k.push({dir:S,prefix:j})}if(P.setup){let S={addDirective:(j)=>{p.customDirectives=p.customDirectives||[],p.customDirectives.push(j)},addRoute:(j,H)=>{p.apiRoutes=p.apiRoutes||{},p.apiRoutes[j]=H},addMiddleware:(j)=>{p.middleware=p.middleware||[],p.middleware.push(j)},pluginDir:A,config:p};await P.setup(T,S)}process.stderr.write(`[stx] Plugin loaded: ${P.name||R}
|
|
1310
|
+
`)}catch(M){console.warn(`[stx] Failed to load plugin ${R}:`,M.message)}}p._pluginComponentDirs=w,p._componentPackageDirs=C,p._pluginPageDirs=k}if(p.nativePrimitives!==!1)p._nativePrimitivesFallback={dir:Ts(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return p})();if(Z.set(r,n),n.catch(()=>{if(Z.get(r)===n)Z.delete(r)}),!e)ae=n,n.then((l)=>{Y=l}).catch(()=>{});return n}var D=new Proxy(V,{get(e,r){if(Y&&r in Y)return Y[r];if(!ae)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function iy(e){return e}function ay(e){let r=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))r.push({path:`middleware[${n}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((n,l)=>{if(!n.pattern||typeof n.pattern!=="string")r.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))r.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(n.maxAgeSeconds!==void 0&&(typeof n.maxAgeSeconds!=="number"||n.maxAgeSeconds<0))r.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(n.maxEntries!==void 0&&(typeof n.maxEntries!=="number"||n.maxEntries<1))r.push({path:`pwa.routes[${l}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((n)=>typeof n!=="number"||n<16||n>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((l)=>!o.includes(l)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:i}}
|
|
1311
|
+
export{Cc,Ec,br,st,Tc,Ts,$s,V,rg,ri,$c,a,D,iy,ay};
|