@stacksjs/stx 0.2.762 → 0.2.765
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-01484snf.js +2 -0
- package/dist/{chunk-b51p56k5.js → chunk-07c8rk93.js} +2 -2
- package/dist/chunk-09cera09.js +2 -0
- package/dist/{chunk-zhrz4zvw.js → chunk-0d29b573.js} +4 -4
- package/dist/chunk-0f5276fm.js +2 -0
- package/dist/{chunk-8yyq3nfg.js → chunk-0nzeqc13.js} +2 -2
- package/dist/chunk-16n128gh.js +2 -0
- package/dist/chunk-171bbyqv.js +2 -0
- package/dist/{chunk-dnsf934e.js → chunk-1day2nbr.js} +5 -5
- package/dist/chunk-1g0g498y.js +2 -0
- package/dist/{chunk-x5seqmrv.js → chunk-1g5fg1ys.js} +2 -2
- package/dist/chunk-1qppvj48.js +2 -0
- package/dist/{chunk-tpfxvw4q.js → chunk-1w4a0xya.js} +14 -14
- package/dist/chunk-1z77g0j6.js +2 -0
- package/dist/chunk-2hbwpm36.js +177 -0
- package/dist/{chunk-rh2qth8r.js → chunk-2mckhfet.js} +5 -5
- package/dist/chunk-31e7xkrt.js +2 -0
- package/dist/chunk-3ffz7pd4.js +2 -0
- package/dist/{chunk-37y8sg48.js → chunk-3mf27gj6.js} +2 -2
- package/dist/{chunk-gwjh981q.js → chunk-49w4cbqb.js} +7 -7
- package/dist/chunk-4bhbtvtm.js +2 -0
- package/dist/{chunk-18chz0q4.js → chunk-4m3666pm.js} +1 -1
- package/dist/{chunk-xtwc2dbk.js → chunk-4tppbw4r.js} +2 -2
- package/dist/{chunk-rmk8efc3.js → chunk-4yk7zngj.js} +109 -109
- package/dist/{chunk-rj3p5fdy.js → chunk-51dxp9w9.js} +3 -3
- package/dist/chunk-59r38w60.js +2 -0
- package/dist/chunk-5ttj2c0h.js +2 -0
- package/dist/chunk-5x312c05.js +2 -0
- package/dist/chunk-65h2h51z.js +2 -0
- package/dist/chunk-6ch8t3d9.js +3 -0
- package/dist/{chunk-tshpcvcy.js → chunk-6h6teyxp.js} +2 -2
- package/dist/{chunk-319aez2f.js → chunk-6jnrpnxb.js} +3 -3
- package/dist/chunk-6rd0zz6k.js +2 -0
- package/dist/{chunk-8y54tpbr.js → chunk-74y29xxs.js} +5 -5
- package/dist/{chunk-t1shvfhm.js → chunk-7aw9qm74.js} +47 -47
- package/dist/chunk-7bvhpdqv.js +2 -0
- package/dist/{chunk-0fs9kx0h.js → chunk-7yx2ztt5.js} +2 -2
- package/dist/{chunk-f8p8ggvw.js → chunk-8hanmv49.js} +4 -4
- package/dist/{chunk-j1tsda22.js → chunk-8prk7e1z.js} +10 -10
- package/dist/{chunk-nm9tnxnw.js → chunk-8zgvr0fw.js} +5 -5
- package/dist/{chunk-pqbxa0r7.js → chunk-a2yptg7r.js} +2 -2
- package/dist/{chunk-qystt1qc.js → chunk-a627f39k.js} +1 -1
- package/dist/{chunk-ds6mbfdq.js → chunk-as4s0nf5.js} +3 -3
- package/dist/chunk-axxd53tn.js +2 -0
- package/dist/{chunk-evxp3wmv.js → chunk-ay02q27h.js} +7 -7
- package/dist/{chunk-2eamszdq.js → chunk-ay5g5cbk.js} +2 -2
- package/dist/chunk-b8ar6431.js +2 -0
- package/dist/{chunk-yb71b2d6.js → chunk-b8hsvzqb.js} +2 -2
- package/dist/chunk-bnm7ym0g.js +2 -0
- package/dist/{chunk-0sd4td6z.js → chunk-bnwkytme.js} +3 -3
- package/dist/chunk-brg2ydrk.js +2 -0
- package/dist/chunk-bwkw2dw3.js +2 -0
- package/dist/chunk-c0fwppzc.js +2 -0
- package/dist/{chunk-8rk79ha1.js → chunk-c1b481my.js} +2 -2
- package/dist/chunk-c5kpc7rn.js +2 -0
- package/dist/{chunk-59k4xb92.js → chunk-c5mbhfff.js} +5 -5
- package/dist/chunk-c8256r1a.js +2 -0
- package/dist/chunk-cap6exxx.js +2 -0
- package/dist/{chunk-mbe4gqd3.js → chunk-ccedry39.js} +2 -2
- package/dist/chunk-cft1sprt.js +2 -0
- package/dist/{chunk-qjbcp3tc.js → chunk-cswar3zs.js} +3 -3
- package/dist/{chunk-t2cq4bpe.js → chunk-dphhs29v.js} +6 -6
- package/dist/chunk-dt0deg4z.js +2 -0
- package/dist/{chunk-jgk5j35w.js → chunk-dvh63p75.js} +4 -4
- package/dist/{chunk-932zx5q4.js → chunk-dxk5r71v.js} +6 -6
- package/dist/{chunk-d96xddt9.js → chunk-e1e5xf8z.js} +13 -13
- package/dist/{chunk-w2pch5xn.js → chunk-e645nk33.js} +2 -2
- package/dist/{chunk-qpb80r4b.js → chunk-efr9dgt6.js} +2 -2
- package/dist/chunk-ejqr5cva.js +2 -0
- package/dist/{chunk-fxmc5006.js → chunk-et831a4y.js} +2 -2
- package/dist/{chunk-5yhv5eqq.js → chunk-ev4zxhpd.js} +2 -2
- package/dist/chunk-evbxyw80.js +2 -0
- package/dist/chunk-f66n66c8.js +2 -0
- package/dist/chunk-f6h8yagj.js +2 -0
- package/dist/{chunk-y8pftjg8.js → chunk-fjbhtakz.js} +1 -1
- package/dist/chunk-fpsm2qed.js +2 -0
- package/dist/{chunk-v1ff2dfp.js → chunk-fta169tc.js} +3 -3
- package/dist/{chunk-a222bwpc.js → chunk-ftt3r7wh.js} +5 -5
- package/dist/{chunk-48g9wez2.js → chunk-fz717vpc.js} +29 -29
- package/dist/chunk-fzf7yfpn.js +2 -0
- package/dist/chunk-gaatje2g.js +2 -0
- package/dist/{chunk-b0z2n941.js → chunk-h8yk9qm7.js} +2 -2
- package/dist/chunk-hfcmbbkq.js +2 -0
- package/dist/{chunk-3mz088mb.js → chunk-jb1c4e49.js} +2 -2
- package/dist/chunk-jhz0dvqz.js +2 -0
- package/dist/chunk-k54pgbzm.js +2 -0
- package/dist/{chunk-r8zhed35.js → chunk-kc3kt59e.js} +2 -2
- package/dist/chunk-kkx2gqk8.js +2 -0
- package/dist/{chunk-rqd6b2nc.js → chunk-knzp4c6m.js} +3 -3
- package/dist/{chunk-m3z13f59.js → chunk-kwy0spcd.js} +3 -3
- package/dist/{chunk-b7x8b83z.js → chunk-m15nbvck.js} +1 -1
- package/dist/{chunk-wby7qzha.js → chunk-m3dr63n0.js} +3 -3
- package/dist/{chunk-eb6p3p62.js → chunk-mdtjjzqc.js} +2 -2
- package/dist/{chunk-epa73jvs.js → chunk-mmcqgwk7.js} +2 -2
- package/dist/{chunk-02c46de1.js → chunk-mpaepc7n.js} +165 -42
- package/dist/{chunk-0kq0k4pg.js → chunk-n5dd6rpt.js} +2 -2
- package/dist/{chunk-jyp2mmts.js → chunk-n8gfetjx.js} +2 -2
- package/dist/chunk-n9zka6dg.js +2 -0
- package/dist/{chunk-bvctccab.js → chunk-nj5azxxj.js} +3 -3
- package/dist/{chunk-42zqmcnc.js → chunk-nr3pepv1.js} +3 -3
- package/dist/{chunk-r1tp2gnr.js → chunk-p42kp93g.js} +1 -1
- package/dist/{chunk-2zd51tj4.js → chunk-pqgk9mxp.js} +2 -2
- package/dist/chunk-pvx57vpw.js +2 -0
- package/dist/{chunk-fhpsf4z7.js → chunk-q22hwm64.js} +5 -5
- package/dist/chunk-qcz104h3.js +2 -0
- package/dist/chunk-qgvez75f.js +2 -0
- package/dist/{chunk-y4mp1rra.js → chunk-qv2k0qb1.js} +94 -94
- package/dist/{chunk-k2ex94n8.js → chunk-qv99gqee.js} +1 -1
- package/dist/chunk-r0j6jkxc.js +2 -0
- package/dist/{chunk-ben8bjnk.js → chunk-rv0yth27.js} +4 -4
- package/dist/chunk-rzh4xgb4.js +2 -0
- package/dist/chunk-rzv9xcyp.js +2 -0
- package/dist/{chunk-4tgn1frg.js → chunk-s2py8kg7.js} +2 -2
- package/dist/chunk-s922mx0k.js +2 -0
- package/dist/{chunk-rd33qkfs.js → chunk-s9m2gfns.js} +7 -7
- package/dist/{chunk-xt034729.js → chunk-scq0h2cs.js} +6 -6
- package/dist/{chunk-ak93e1zz.js → chunk-stww901w.js} +5 -5
- package/dist/chunk-sy4wqxta.js +2 -0
- package/dist/chunk-szdm8wfn.js +2 -0
- package/dist/chunk-t424gvwc.js +2 -0
- package/dist/{chunk-yk456jp4.js → chunk-t6d7m4tf.js} +7 -7
- package/dist/{chunk-mdvtermb.js → chunk-t70s45hc.js} +2 -2
- package/dist/{chunk-dvpk4c1y.js → chunk-t8cgxk8w.js} +2 -2
- package/dist/{chunk-edhxg3rz.js → chunk-tqf8a258.js} +56 -56
- package/dist/{chunk-9k8ztdcc.js → chunk-vkpmemb1.js} +2 -2
- package/dist/chunk-vtvaa8y9.js +2 -0
- package/dist/chunk-vvj09a7b.js +2 -0
- package/dist/{chunk-rxm1mjkb.js → chunk-vvm38ysm.js} +1 -1
- package/dist/chunk-vwjy6491.js +2 -0
- package/dist/{chunk-736ex6r5.js → chunk-vy1weqvj.js} +4 -4
- package/dist/chunk-w2nzevn0.js +2 -0
- package/dist/chunk-wadp2rmj.js +2 -0
- package/dist/{chunk-k9247v28.js → chunk-wb2ej5by.js} +1 -1
- package/dist/chunk-wbkcwj27.js +2 -0
- package/dist/{chunk-2typf9dh.js → chunk-wp4nqnn7.js} +1 -1
- package/dist/chunk-wzp8y0a4.js +2 -0
- package/dist/chunk-xc1he6hs.js +2 -0
- package/dist/{chunk-m6rzsbas.js → chunk-xcstrdhp.js} +4 -4
- package/dist/{chunk-cdcrd33m.js → chunk-ysfeg3cn.js} +2 -2
- package/dist/chunk-ytzzth34.js +2 -0
- package/dist/{chunk-xgnmgjpv.js → chunk-z6sg0dq3.js} +4 -4
- package/dist/{chunk-k9wr8xf5.js → chunk-zfaa5xn5.js} +6 -6
- package/dist/chunk-zhxg6b64.js +2 -0
- package/dist/{chunk-rha8sv1h.js → chunk-zjar9jdd.js} +2 -2
- package/dist/{chunk-89801pjp.js → chunk-zs8yjtaz.js} +5 -5
- package/dist/{chunk-q3azy64b.js → chunk-ztbk9yqv.js} +4 -4
- package/dist/cli.js +19 -19
- package/dist/client/signals-bootstrap-runtime.js +1 -1
- package/dist/client/signals-class-runtime.js +5 -5
- package/dist/client/signals-dom-ready-runtime.js +1 -0
- package/dist/client/signals-expression-runtime.js +118 -0
- package/dist/client/signals-for-runtime.js +7 -7
- package/dist/client/signals-if-chain-runtime.js +3 -3
- package/dist/client/signals-if-runtime.js +7 -7
- package/dist/client/signals-model-runtime.js +1 -1
- package/dist/client/signals-process-element-runtime.js +12 -8
- package/dist/client/signals-show-runtime.js +1 -1
- package/dist/client/signals-style-runtime.js +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-virtual-list.d.ts +24 -0
- package/dist/composables/use-virtual-list.js +76 -0
- package/dist/config.js +3 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/document-shell.d.ts +10 -1
- package/dist/document-shell.js +1 -1
- package/dist/expressions.js +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/native/compiler/render-screen.d.ts +2 -8
- package/dist/native/compiler/render-screen.js +3 -10
- package/dist/native/event-names.js +2 -0
- package/dist/native/primitives-dir.d.ts +13 -0
- package/dist/native/primitives-dir.js +14 -0
- package/dist/native/prop-names.js +1 -0
- package/dist/process.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +8 -8
- package/dist/state-management.d.ts +22 -0
- package/dist/types/config-types.d.ts +2 -0
- package/dist/unresolved-identifiers.js +1 -0
- package/dist/utils.js +20 -2
- package/package.json +5 -5
- package/stx.d.ts +4 -0
- package/dist/chunk-00nz3pas.js +0 -2
- package/dist/chunk-05jdq9tw.js +0 -177
- package/dist/chunk-0cajfv7y.js +0 -2
- package/dist/chunk-13v3vgb6.js +0 -2
- package/dist/chunk-1p8t2ekg.js +0 -2
- package/dist/chunk-1rcntvgx.js +0 -2
- package/dist/chunk-1w5gtkd6.js +0 -2
- package/dist/chunk-28vtqwxh.js +0 -2
- package/dist/chunk-298gj90a.js +0 -2
- package/dist/chunk-2gn6smrq.js +0 -2
- package/dist/chunk-2wq0h5ye.js +0 -2
- package/dist/chunk-3wxb7mfb.js +0 -2
- package/dist/chunk-528cn6qm.js +0 -2
- package/dist/chunk-5x0g7e9y.js +0 -2
- package/dist/chunk-633a53wg.js +0 -2
- package/dist/chunk-6b737vch.js +0 -2
- package/dist/chunk-72ns4q88.js +0 -2
- package/dist/chunk-86cg9qqm.js +0 -2
- package/dist/chunk-8czxtjwm.js +0 -2
- package/dist/chunk-8h5mqs28.js +0 -2
- package/dist/chunk-940wny2b.js +0 -2
- package/dist/chunk-9fh4ah7t.js +0 -2
- package/dist/chunk-a81rt2t4.js +0 -3
- package/dist/chunk-ad9dt9rk.js +0 -2
- package/dist/chunk-ak4w2emd.js +0 -2
- package/dist/chunk-b8dtz3v8.js +0 -2
- package/dist/chunk-cenvzm5q.js +0 -2
- package/dist/chunk-d49pst1m.js +0 -2
- package/dist/chunk-dj0qy19b.js +0 -2
- package/dist/chunk-e2q79dfs.js +0 -2
- package/dist/chunk-ebxncrd8.js +0 -2
- package/dist/chunk-fht1zs1r.js +0 -2
- package/dist/chunk-fjfrgef4.js +0 -2
- package/dist/chunk-fmk9hjht.js +0 -2
- package/dist/chunk-fxnk5ee8.js +0 -2
- package/dist/chunk-j1z7tgdp.js +0 -2
- package/dist/chunk-jq1698j4.js +0 -2
- package/dist/chunk-k0jkpw0q.js +0 -2
- package/dist/chunk-k469ym7a.js +0 -2
- package/dist/chunk-m5740sd3.js +0 -2
- package/dist/chunk-mdw96yhg.js +0 -2
- package/dist/chunk-mebf9vwb.js +0 -2
- package/dist/chunk-p2se8s6r.js +0 -2
- package/dist/chunk-p7zrz0wb.js +0 -2
- package/dist/chunk-pdnyfk2v.js +0 -2
- package/dist/chunk-qfhjtz2q.js +0 -2
- package/dist/chunk-r5tsewzd.js +0 -2
- package/dist/chunk-rnvrtcz6.js +0 -2
- package/dist/chunk-s36cpnxa.js +0 -2
- package/dist/chunk-tfy1m821.js +0 -2
- package/dist/chunk-vc3ppphz.js +0 -2
- package/dist/chunk-vttx66q0.js +0 -2
- package/dist/chunk-vxs07119.js +0 -2
- package/dist/chunk-x1x69g3s.js +0 -2
- package/dist/chunk-x8hz5gzb.js +0 -2
- package/dist/chunk-xfdtym3s.js +0 -2
- package/dist/chunk-y6mqq78g.js +0 -2
- package/dist/chunk-ycttwgpg.js +0 -2
- package/dist/chunk-yd6x9226.js +0 -2
- package/dist/chunk-yn3kff5k.js +0 -2
- package/dist/chunk-ynjm2tm0.js +0 -2
- package/dist/chunk-zpjdp0he.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,c}from"./chunk-
|
|
2
|
+
import{t,c}from"./chunk-1w4a0xya.js";import{r,yn,h}from"./chunk-qv2k0qb1.js";import{et}from"./chunk-8hanmv49.js";import{xs,Ss}from"./chunk-ay02q27h.js";import{yc,Ko,ws,vs}from"./chunk-ztbk9yqv.js";import{gc,mc}from"./chunk-knzp4c6m.js";import{vt}from"./chunk-am4wadh7.js";import{ln,kc,gr,mr}from"./chunk-s2py8kg7.js";import{g}from"./chunk-0dve54ne.js";import{Ys}from"./chunk-et831a4y.js";import Q from"fs";import N from"path";import{loadConfigWithResult as Bt}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,n={}){let{duration:i,delay:o,ease:s,direction:l,custom:d}={...B,...n};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
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; } }
|
|
@@ -9,7 +9,7 @@ import{t,c}from"./chunk-tpfxvw4q.js";import{r,yn,h}from"./chunk-y4mp1rra.js";imp
|
|
|
9
9
|
@keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
|
|
10
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 at(){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 ot(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 lt(e=0.1,n="0px"){return`
|
|
41
41
|
<script data-stx-scoped data-stx-run="always">
|
|
42
42
|
// Intersection Observer for scroll animations
|
|
43
43
|
(function() {
|
|
@@ -52,7 +52,7 @@ else {
|
|
|
52
52
|
// Create the observer
|
|
53
53
|
const options = {
|
|
54
54
|
root: null, // Use viewport
|
|
55
|
-
rootMargin: '${
|
|
55
|
+
rootMargin: '${n}',
|
|
56
56
|
threshold: ${e}
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -80,7 +80,7 @@ else {
|
|
|
80
80
|
}
|
|
81
81
|
})();
|
|
82
82
|
</script>
|
|
83
|
-
`}function
|
|
83
|
+
`}function ct(){return`
|
|
84
84
|
<style id="stx-animation-base">
|
|
85
85
|
:root {
|
|
86
86
|
--stx-transition-duration: 300ms;
|
|
@@ -195,13 +195,13 @@ 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 dt(e,n,i={}){let{staggerDelay:o=50,sequence:s=!1}=i;return`
|
|
199
199
|
<script data-stx-scoped data-stx-run="always">
|
|
200
200
|
// Animation Group: ${e}
|
|
201
201
|
(function() {
|
|
202
|
-
const elements = ${JSON.stringify(
|
|
202
|
+
const elements = ${JSON.stringify(n)};
|
|
203
203
|
const staggerDelay = ${o};
|
|
204
|
-
const sequence = ${
|
|
204
|
+
const sequence = ${s};
|
|
205
205
|
|
|
206
206
|
function animateGroup() {
|
|
207
207
|
elements.forEach((selector, index) => {
|
|
@@ -232,11 +232,11 @@ else {
|
|
|
232
232
|
}
|
|
233
233
|
})();
|
|
234
234
|
</script>
|
|
235
|
-
`}var
|
|
236
|
-
style="--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},
|
|
238
|
-
</head>`)}if(
|
|
239
|
-
`+
|
|
235
|
+
`}var Pe={name:"transition",handler:(e,n,i,o)=>{if(n.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let s=n[0],l=n.length>1?Number.parseInt(n[1],10)||B.duration:B.duration,d=n.length>2?n[2]||B.ease:B.ease,p=n.length>3?Number.parseInt(n[3],10)||B.delay:B.delay,u=n.length>4?n[4]||B.direction:B.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(s,{duration:l,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(s==="fade")v="stx-fade";else if(s==="slide")v="stx-slide";else if(s==="scale")v="stx-scale";else if(s==="flip")v="stx-flip";else if(s==="rotate")v="stx-rotate";return`<div id="${m}" class="${f} ${v} ${u==="out"?"stx-out":""}"
|
|
236
|
+
style="--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},ke={name:"scrollAnimate",handler:(e,n,i,o)=>{if(n.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let s=n[0],l=n.length>1?Number.parseInt(n[1],10)||300:300,d=n.length>2?n[2]||"ease":"ease",p=n.length>3?Number.parseFloat(n[3])||0.2:0.2,u=n.length>4?Number.parseInt(n[4],10)||0:0,m=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${l}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,f="stx-transition stx-observe stx-out";if(s==="fade")f+=" stx-fade";else if(s==="slide-up"||s==="slide")f+=" stx-from-bottom";else if(s==="slide-down")f+=" stx-from-top";else if(s==="slide-left")f+=" stx-from-right";else if(s==="slide-right")f+=" stx-from-left";else if(s==="scale")f+=" stx-scale";else if(s.includes("-"))f+=` stx-${s}`;else f+=` stx-${s}`;return`<div id="${m}" class="${f}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Ae={name:"animationGroup",handler:(e,n,i,o)=>{if(n.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let s=n[0],l=n.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(s,l,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,n,i,o)=>{let s=n.length>0?n[0].toLowerCase()==="true":!0,l=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function cc(e,n,i,o){let s=e;if(o.animation?.enabled===!1)return s;let l=i.includes("test")&&i.includes("animation");if(!ot(s)&&!l)return s;if(!s.includes('<style id="stx-animation-base">')){let p=ct();s=s.replace("</head>",`${p}
|
|
238
|
+
</head>`)}if(s.includes("stx-observe")){if(!s.includes("Intersection Observer for scroll animations")){let u=lt(),m=s.lastIndexOf("</body>");if(m!==-1)s=s.slice(0,m)+u+`
|
|
239
|
+
`+s.slice(m)}}return s}async function ut(e,n,i,o){let s=n[0]?.replace(/['"]/g,"")||"main",l=et();if(s!=="main")l=l.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${l}</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 Oe(e){let n=e.heatmap;if(!n?.enabled)return"";let i={...pt,...n};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
241
241
|
<script>
|
|
242
242
|
(function() {
|
|
@@ -619,9 +619,9 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
623
|
-
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}l[m]=y}return{data:l,content:
|
|
624
|
-
`),
|
|
622
|
+
`}function lc(e,n){let i=Oe(n);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,n,i,o)=>{let s=i.__stx_config||{};if(n.length>0){let l=mt(n.join(" "));s.heatmap={...s.heatmap,...l,enabled:!0}}return Oe(s)}};function mt(e){let n={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[s,l]=o.split("="),d=l?.replace(/["']/g,"");switch(s){case"endpoint":n.endpoint=d;break;case"samplingRate":n.samplingRate=Number.parseInt(d,10);break;case"batchSize":n.batchSize=Number.parseInt(d,10);break;case"trackMouse":n.trackMouse=d==="true";break;case"trackClicks":n.trackClicks=d==="true";break;case"trackScroll":n.trackScroll=d==="true";break;case"honorDnt":n.honorDnt=d==="true";break;case"debugOverlay":n.debugOverlay=d==="true";break}}return n}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e){let n=e.trim().toLowerCase();return!n.startsWith("javascript:")&&!n.startsWith("vbscript:")&&!n.startsWith("data:text/html")}function ur(e){let n=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(n);if(!i)return{data:{},content:e.trim()};let o=i[1],s=e.slice(i[0].length),l={};for(let d of o.split(`
|
|
623
|
+
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}l[m]=y}return{data:l,content:s.trim()}}function Ze(e,n={}){let{gfm:i=!0,breaks:o=!1}=n,s=e,l=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=l.length,x=f?` class="language-${J(f)}"`:"";return l.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),s=s.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),s=s.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),s=s.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),s=s.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),s=s.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),s=s.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),s=s.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),s=s.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),s=s.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/__(.+?)__/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)s=s.replace(/~~(.+?)~~/g,"<del>$1</del>");if(s=s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ie(v)?J(v):""}" alt="${J(f)}" />`),s=s.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(v)?J(v):""}">${f}</a>`),s=s.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),s=s.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),s=s.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
624
|
+
`),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),i)s=s.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,f,v)=>{let x=`<tr>${f.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,k=v.trim().split(`
|
|
625
625
|
`).map((S)=>`<tr>${S.split("|").map((A)=>A.trim()).filter(Boolean).map((A)=>`<td>${J(A)}</td>`).join("")}</tr>`).join(`
|
|
626
626
|
`);return`<table>
|
|
627
627
|
<thead>
|
|
@@ -630,15 +630,15 @@ ${x}
|
|
|
630
630
|
<tbody>
|
|
631
631
|
${k}
|
|
632
632
|
</tbody>
|
|
633
|
-
</table>`});if(i)
|
|
633
|
+
</table>`});if(i)s=s.replace(/<li>\s*\[\s*\]\s*/g,'<li><input type="checkbox" disabled /> '),s=s.replace(/<li>\s*\[x\]\s*/gi,'<li><input type="checkbox" checked disabled /> ');let d=s.split(`
|
|
634
634
|
`),p=[],u=!1,m=[];for(let y of d){let f=y.trim();if(/^<(?:h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|th|td|hr|div|p)/.test(f)||/^\0CODEBLOCK\d+\0$/.test(f)||f===""){if(u&&m.length>0)p.push(`<p>${m.join(o?`<br />
|
|
635
635
|
`:`
|
|
636
636
|
`)}</p>`),m=[],u=!1;p.push(y)}else u=!0,m.push(f)}if(u&&m.length>0)p.push(`<p>${m.join(o?`<br />
|
|
637
637
|
`:`
|
|
638
|
-
`)}</p>`);if(
|
|
639
|
-
`),o)
|
|
640
|
-
`);for(let y=0;y<l.length;y++)
|
|
641
|
-
`||A==="\r"||A===" "||A===void 0)f++;v=S+9}else{if(f--,f===0){b=_;break}v=_+12}}if(b===-1)continue;let x=e.slice(y,b),k=e.slice(p,b+12);
|
|
638
|
+
`)}</p>`);if(s=p.join(`
|
|
639
|
+
`),o)s=s.replace(/\n/g,`<br />
|
|
640
|
+
`);for(let y=0;y<l.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,l[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function uc(e,n,i=""){let o=e,s=[],l=/@markdown(?:\([^)]*\))?/g,d;while((d=l.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let S=e.indexOf("@markdown",v),_=e.indexOf("@endmarkdown",v);if(_===-1)break;if(S!==-1&&S<_&&S!==p){let A=e[S+9];if(A==="("||A===`
|
|
641
|
+
`||A==="\r"||A===" "||A===void 0)f++;v=S+9}else{if(f--,f===0){b=_;break}v=_+12}}if(b===-1)continue;let x=e.slice(y,b),k=e.slice(p,b+12);s.push({fullMatch:k,options:m,content:x,index:p}),l.lastIndex=b+12}for(let{fullMatch:p,options:u,content:m,index:y}of s)try{let f={};if(u)u.split(",").forEach((x)=>{let k=x.trim();if(k)f[k]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=Ze(m.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=h("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Te(e,n,i,o){let s={gfm:!0,breaks:!1};return n.forEach((l)=>{let d=l.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),Ze(e.trim(),s)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,n=Z,i={},o){return n.sort((s,l)=>s-l).map((s)=>`${re(e,{...i,w:s,fm:o})} ${s}w`).join(", ")}function Me(e,n,i=gt,o={},s){return i.sort((l,d)=>l-d).map((l)=>{let d=Math.round(n*l);return`${re(e,{...o,w:d,dpr:l,fm:s})} ${l}x`}).join(", ")}function ge(e,n="100vw"){if(!e||Object.keys(e).length===0)return n;let o=Object.entries(e).map(([s,l])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:l,numericBp:Number.parseInt(d)||0}}).sort((s,l)=>s.numericBp-l.numericBp).map(({bp:s,size:l})=>`(max-width: ${s}) ${l}`);return o.push(n),o.join(", ")}function re(e,n={}){let i=Object.entries(n).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("&"),s=e.includes("?")?"&":"?";return`${e}${s}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
|
|
642
642
|
.stx-img-placeholder {
|
|
643
643
|
position: relative;
|
|
644
644
|
overflow: hidden;
|
|
@@ -667,11 +667,11 @@ ${k}
|
|
|
667
667
|
filter: blur(0);
|
|
668
668
|
transform: scale(1);
|
|
669
669
|
}
|
|
670
|
-
`.trim();async function
|
|
670
|
+
`.trim();async function yt(){try{return await import("ts-images")}catch{return null}}async function bt(e,n={}){let i={...ht,...n},o=await yt();if(o)try{return await xt(e,i,o)}catch(s){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${s}`)}return wt(e,i)}async function xt(e,n,i){let{generatePlaceholder:o,generateThumbHash:s}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[n.strategy]||"blur";if(n.strategy==="thumbhash")return{dataURL:(await s(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await o(e,{width:n.width,height:n.height,quality:n.quality,blurLevel:n.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:n.strategy,dominantColor:p.dominantColor,css:p.css}}function wt(e,n){let i=n.width||20,o=n.height||i,s="#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:n.strategy,dominantColor:"#e5e7eb"}}function je(e,n,i={}){let o=i.transitionDuration||300,s=i.easing||"ease-out";return`
|
|
671
671
|
#${e} {
|
|
672
672
|
--stx-img-transition-duration: ${o}ms;
|
|
673
|
-
--stx-img-transition-easing: ${
|
|
674
|
-
background-image: url('${
|
|
673
|
+
--stx-img-transition-easing: ${s};
|
|
674
|
+
background-image: url('${n.dataURL}');
|
|
675
675
|
background-size: cover;
|
|
676
676
|
background-position: center;
|
|
677
677
|
}
|
|
@@ -684,20 +684,20 @@ ${k}
|
|
|
684
684
|
#${e}.stx-img-loaded img {
|
|
685
685
|
opacity: 1;
|
|
686
686
|
}
|
|
687
|
-
`.trim()}var
|
|
688
|
-
`):void 0,script:
|
|
687
|
+
`.trim()}var he=new Map;async function Ne(e,n={}){let i=`${e}:${JSON.stringify(n)}`;if(he.has(i))return he.get(i);let o=await bt(e,n);return he.set(i,o),o}async function $t(){try{return await import("./chunk-65h2h51z.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,n={}){let i=n,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,n);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,n);let{src:s,alt:l,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:k={},lazy:S=!0,priority:_=!1,loading:A=_?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:L}=e,{class:W,style:T,id:V}=e,R=e.data||{},{isDev:z=!1,baseUrl:G=""}=n;if(z&&!n.optimize)return Dt(e);let F,O,H=V||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!_)try{F=await Ne(s,{strategy:x,...k}),O=je(H,F,k)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,F,n);else X=await St(e,H,F,n);let ee;if(_){let De=f.includes("webp")?"webp":f[0],nt=me(s,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(O)ae.push(O);let rt=S?We(H):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
|
|
688
|
+
`):void 0,script:rt}}async function St(e,n,i,o){let{src:s,alt:l,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:x=!1,loading:k=x?"eager":ce,decoding:S=le,fetchpriority:_,objectFit:A,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,L=e.data||{},W=typeof u==="object"?ge(u):u||"100vw",T=[];for(let z of y){let G=me(s,m,{...v,q:f},z),F=fe(z);if(b&&!x)T.push(` <source type="${F}" data-srcset="${G}" data-sizes="${W}" />`);else T.push(` <source type="${F}" srcset="${G}" sizes="${W}" />`)}let V=be({src:re(s,{...v,q:f}),alt:l,width:d,height:p,loading:x?void 0:k,decoding:S,fetchpriority:x?"high":_,objectFit:A,objectPosition:E,crossorigin:I,referrerpolicy:w,className:Le(C,i),style:xe(D,A,E,i),lazy:b&&!x,data:L}),R;if(i){let z=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;R=`<div id="${n}" class="stx-img-placeholder" style="${z}">
|
|
689
689
|
<picture>
|
|
690
690
|
${T.join(`
|
|
691
691
|
`)}
|
|
692
692
|
<img ${V} />
|
|
693
693
|
</picture>
|
|
694
|
-
</div>`}else R=`<picture${
|
|
694
|
+
</div>`}else R=`<picture${n?` id="${n}"`:""}>
|
|
695
695
|
${T.join(`
|
|
696
696
|
`)}
|
|
697
697
|
<img ${V} />
|
|
698
|
-
</picture>`;return R}function
|
|
698
|
+
</picture>`;return R}function Ct(e,n,i,o){let{src:s,alt:l,width:d,height:p,dpr:u=[1,2,3],quality:m=ve,params:y={},lazy:f=!0,priority:v=!1,loading:b=v?"eager":ce,decoding:x=le,fetchpriority:k,objectFit:S,objectPosition:_,crossorigin:A,referrerpolicy:E}=e,{class:I,style:w}=e,C=e.data||{},D=typeof d==="number"?d:Number.parseInt(String(d),10),L=Me(s,D,u,{...y,q:m}),W=be({src:re(s,{...y,w:D,q:m}),alt:l,width:d,height:p,loading:v?void 0:b,decoding:x,fetchpriority:v?"high":k,objectFit:S,objectPosition:_,crossorigin:A,referrerpolicy:E,className:Le(I,i),style:xe(w,S,_,i),lazy:f&&!v,data:C}),T=f&&!v?`data-srcset="${L}"`:`srcset="${L}"`;if(i){let V=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${n}" class="stx-img-placeholder" style="${V}">
|
|
699
699
|
<img ${W} ${T} />
|
|
700
|
-
</div>`}return`<img ${
|
|
700
|
+
</div>`}return`<img ${n?`id="${n}" `:""}${W} ${T} />`}function Dt(e){let{src:n,alt:i,width:o,height:s,loading:l=ce,decoding:d=le,fetchpriority:p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,priority:v=!1}=e,{class:b,style:x,id:k}=e,S=e.data||{};return{html:`<img ${be({src:n,alt:i,width:o,height:s,loading:v?"eager":l,decoding:d,fetchpriority:v?"high":p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,className:b,style:xe(x,u,m),id:k,data:S})} />`}}function be(e){let n=[];if(e.lazy)n.push(`data-src="${U(e.src)}"`),n.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else n.push(`src="${U(e.src)}"`);if(n.push(`alt="${U(e.alt)}"`),e.width)n.push(`width="${e.width}"`);if(e.height)n.push(`height="${e.height}"`);if(e.loading)n.push(`loading="${e.loading}"`);if(e.decoding)n.push(`decoding="${e.decoding}"`);if(e.fetchpriority)n.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)n.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)n.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)n.push(`class="${U(e.className)}"`);if(e.style)n.push(`style="${U(e.style)}"`);if(e.id)n.push(`id="${U(e.id)}"`);if(e.data)for(let[i,o]of Object.entries(e.data))n.push(`data-${i}="${U(o)}"`);if(e.lazy)n.push("data-stx-lazy");return n.join(" ")}function Le(e,n){let i=[];if(e)i.push(e);if(n)i.push("stx-img-blur");return i.join(" ")||""}function xe(e,n,i,o){let s=[];if(n)s.push(`object-fit: ${n}`);if(i)s.push(`object-position: ${i}`);if(o)s.push("opacity: 0; transition: opacity 300ms ease-out");if(e)s.push(e);return s.join("; ")}function U(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function We(e){return`
|
|
701
701
|
(function() {
|
|
702
702
|
const container = document.getElementById('${e}');
|
|
703
703
|
if (!container) return;
|
|
@@ -734,7 +734,7 @@ ${T.join(`
|
|
|
734
734
|
|
|
735
735
|
observer.observe(container);
|
|
736
736
|
})();
|
|
737
|
-
`.trim()}async function
|
|
737
|
+
`.trim()}async function Pt(e,n){let i=await $t();if(!i)return oe({...e,process:!1},n);let o=n.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 Fe(e,l,n)}else{let l=await i.processImage(e.src,e,o);if(l.processed)return we(e,l,n)}return oe({...e,process:!1},n)}async function we(e,n,i){let{alt:o,width:s,height:l,lazy:d=!0,priority:p=!1,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f}=e,{class:v,style:b}=e,x=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,k=e.data||{},S=n.variants||[],_=S.find((O)=>O.format==="jpeg")||S.find((O)=>O.format==="webp")||S[0],A=_?.url||e.src,E=S.filter((O)=>O.format===(_?.format||"jpeg")).map((O)=>`${O.url} ${O.width}w`).join(", "),I=new Map;for(let O of S){if(!I.has(O.format))I.set(O.format,[]);I.get(O.format).push(O)}let w=[],C=["avif","webp","jpeg","png"];for(let O of C){let H=I.get(O);if(H&&H.length>0){let ie=H.map((ee)=>`${ee.url} ${ee.width}w`).join(", "),X=fe(O);if(d&&!p)w.push(` <source type="${X}" data-srcset="${ie}" />`);else w.push(` <source type="${X}" srcset="${ie}" />`)}}let D=[];if(d&&!p){if(D.push(`data-src="${U(A)}"`),D.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),E)D.push(`data-srcset="${E}"`)}else if(D.push(`src="${U(A)}"`),E)D.push(`srcset="${E}"`);D.push(`alt="${U(o)}"`);let L=s||n.originalWidth,W=l||n.originalHeight;if(L)D.push(`width="${L}"`);if(W)D.push(`height="${W}"`);if(!p)D.push(`loading="${d?"lazy":"eager"}"`);if(D.push('decoding="async"'),p)D.push('fetchpriority="high"');if(y)D.push(`crossorigin="${y}"`);if(f)D.push(`referrerpolicy="${f}"`);let T=[];if(u)T.push(`object-fit: ${u}`);if(m)T.push(`object-position: ${m}`);if(n.placeholder&&d)T.push("opacity: 0; transition: opacity 300ms ease-out");if(b)T.push(b);if(T.length>0)D.push(`style="${T.join("; ")}"`);let V=[];if(v)V.push(v);if(n.placeholder)V.push("stx-img-blur");if(V.length>0)D.push(`class="${V.join(" ")}"`);if(d&&!p)D.push("data-stx-lazy");for(let[O,H]of Object.entries(k))D.push(`data-${O}="${U(H)}"`);let R;if(n.placeholder||n.dominantColor&&e.useDominantColor){let O=n.placeholder?`background-image: url('${n.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${n.dominantColor};`;R=`<div id="${x}" class="stx-img-placeholder" style="${O}">
|
|
738
738
|
<picture>
|
|
739
739
|
${w.join(`
|
|
740
740
|
`)}
|
|
@@ -744,11 +744,11 @@ ${w.join(`
|
|
|
744
744
|
${w.join(`
|
|
745
745
|
`)}
|
|
746
746
|
<img ${D.join(" ")} />
|
|
747
|
-
</picture>`;let z=[];if(
|
|
748
|
-
`):void 0,script:G}}async function
|
|
747
|
+
</picture>`;let z=[];if(n.placeholder)z.push(ye);let G=d?We(x):void 0,F;if(p&&E)F=`<link rel="preload" as="image" imagesrcset="${E}" />`;return{html:R,preloadLink:F,css:z.length>0?z.join(`
|
|
748
|
+
`):void 0,script:G}}async function Fe(e,n,i){let o={src:n.src,processed:!0,variants:[],placeholder:n.placeholder?.dataURL,originalWidth:n.placeholder?.width,originalHeight:n.placeholder?.height};for(let[s,l]of Object.entries(n.byFormat))if(l)o.variants.push(...l);return we(e,o,i)}function kt(){return vt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,n,i,o)=>{let{src:s,alt:l,options:d}=At(e,n,i);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:s,alt:l||"",widths:d.widths||Z,formats:d.formats||te,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},u=i.__isDev||!1,m=await oe(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
|
|
749
749
|
`+y;if(m.css)y+=`
|
|
750
750
|
<style>${m.css}</style>`;if(m.script)y+=`
|
|
751
|
-
<script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function
|
|
751
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,n,i){if(n.src)return{src:String(n.src),alt:String(n.alt||""),options:n.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=_t(o),l=$e(s[0],i)||"",d=$e(s[1],i)||"",p={};if(s[2]){let u=$e(s[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof s[2]==="string")try{p=JSON.parse(s[2])}catch{}}return{src:l,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",l=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function $e(e,n){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=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function ys(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let n of e)if(Rt(ne.join(n,"View.stx")))return n;return e[0]}async function Ue(){try{return await import("./chunk-brg2ydrk.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,n={}){let i=n,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,n);let s;if(o.generatePoster&&o.src&&!e.poster)s=await Nt(o,i);let{src:l,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:x=!0,lazy:k=!0,player:S="native",type:_,width:A,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||p,{class:L,style:W}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,n);if(_&&_!=="video")return Et(l||"",_,e);let V=d.length>0?d:l?[{src:l,type:Ke(l)}]:[],R=[`id="${T}"`];if(m)R.push("controls");if(y)R.push("autoplay");if(f)R.push("muted");if(v)R.push("loop");if(x)R.push("playsinline");if(w)R.push("disablepictureinpicture");if(C)R.push("disableremoteplayback");if(I)R.push(`crossorigin="${I}"`);if(k){if(R.push(`data-preload="${b}"`),R.push('preload="none"'),D)R.push(`data-poster="${M(D)}"`);R.push("data-stx-lazy")}else if(R.push(`preload="${b}"`),D)R.push(`poster="${M(D)}"`);if(A)R.push(`width="${A}"`);if(E)R.push(`height="${E}"`);if(L)R.push(`class="${M(L)}"`);if(W)R.push(`style="${M(W)}"`);let z=V.map((O)=>` <source ${k?`data-src="${M(O.src)}"`:`src="${M(O.src)}"`} type="${O.type}"${O.media?` media="${O.media}"`:""} />`).join(`
|
|
752
752
|
`),G=`<video ${R.join(" ")}>
|
|
753
753
|
${z}
|
|
754
754
|
Your browser does not support the video tag.
|
|
@@ -787,9 +787,9 @@ ${z}
|
|
|
787
787
|
|
|
788
788
|
observer.observe(video);
|
|
789
789
|
})();
|
|
790
|
-
`.trim();return{html:G,script:F}}function
|
|
790
|
+
`.trim();return{html:G,script:F}}function Et(e,n,i){let{width:o=640,height:s=360}=i,{class:l,style:d}=i,p=i.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,u,m=null;switch(n){case"youtube":m=Tt(e),u=m?`https://www.youtube-nocookie.com/embed/${m}`:e;break;case"vimeo":m=Mt(e),u=m?`https://player.vimeo.com/video/${m}`:e;break;case"dailymotion":m=e.split("/").pop()||"",u=`https://www.dailymotion.com/embed/video/${m}`;break;case"twitch":m=e.split("/").pop()||"",u=`https://player.twitch.tv/?video=${m}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:u=e}let y=[`id="${p}"`,`src="${M(u)}"`,`width="${o}"`,`height="${s}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(l)y.push(`class="${M(l)}"`);if(d)y.push(`style="${M(d)}"`);if(i.lazy)y.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
791
791
|
<iframe ${y.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
|
|
792
|
-
</div>`}}function
|
|
792
|
+
</div>`}}function It(e,n={}){let{src:i,sources:o=[],poster:s,controls:l=!0,autoplay:d=!1,muted:p=!1,loop:u=!1,preload:m="metadata",playsinline:y=!0,lazy:f=!0,width:v,height:b}=e,{class:x,style:k}=e,S=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,_={src:o.length>0?o:i,autoplay:d,loop:u,muted:p,playsinline:y,preload:m,poster:s,controls:l,title:e.title},A=["position: relative",v?`width: ${typeof v==="number"?v+"px":v}`:"width: 100%",b?`height: ${typeof b==="number"?b+"px":b}`:"",k||""].filter(Boolean).join("; "),E=`
|
|
793
793
|
<div
|
|
794
794
|
id="${S}"
|
|
795
795
|
class="ts-video-player${x?" "+M(x):""}"
|
|
@@ -799,8 +799,8 @@ ${z}
|
|
|
799
799
|
${f?"data-lazy":""}
|
|
800
800
|
>
|
|
801
801
|
<div class="ts-video-player__container">
|
|
802
|
-
${
|
|
803
|
-
<div class="ts-video-player__placeholder" style="background-image: url('${M(
|
|
802
|
+
${s?`
|
|
803
|
+
<div class="ts-video-player__placeholder" style="background-image: url('${M(s)}');">
|
|
804
804
|
<button class="ts-video-player__play-button" aria-label="Play video">
|
|
805
805
|
<svg viewBox="0 0 24 24" fill="currentColor" width="64" height="64">
|
|
806
806
|
<path d="M8 5v14l11-7z"/>
|
|
@@ -826,7 +826,7 @@ ${z}
|
|
|
826
826
|
|
|
827
827
|
// Load ts-video-player from CDN
|
|
828
828
|
var script = document.createElement('script');
|
|
829
|
-
script.src = '${
|
|
829
|
+
script.src = '${Ot}';
|
|
830
830
|
script.onload = initPlayer;
|
|
831
831
|
script.onerror = function() {
|
|
832
832
|
console.error('[stx] Failed to load ts-video-player');
|
|
@@ -956,10 +956,10 @@ else {
|
|
|
956
956
|
.ts-video-player__play-button svg {
|
|
957
957
|
margin-left: 4px;
|
|
958
958
|
}
|
|
959
|
-
`.trim();return{html:E,script:I,css:w}}function
|
|
959
|
+
`.trim();return{html:E,script:I,css:w}}function Ke(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 Tt(e){let n=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let i of n){let o=e.match(i);if(o)return o[1]}return null}function Mt(e){let n=e.match(/vimeo\.com\/(\d+)/);return n?n[1]:null}function M(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}async function jt(e,n){let i=await Ue();if(!i)return de({...e,process:!1},n);let o=n.tsVideosConfig,s=await i.processVideo(e.src,e,o,e.onProcessProgress);if(s.processed)return Ge(e,s,n);return de({...e,process:!1},n)}async function Nt(e,n){let i=await Ue();if(!i||!e.src)return;let o=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},s=n.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await i.generatePoster(e.src,o,s.outputDir,s.baseUrl||"/videos"))?.url}function Ge(e,n,i){let{controls:o=Be,autoplay:s=!1,muted:l=!1,loop:d=!1,preload:p=Je,playsinline:u=!0,lazy:m=!0,width:y,height:f,crossorigin:v,disablePictureInPicture:b=!1,disableRemotePlayback:x=!1}=e,{class:k,style:S}=e,_=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,A=e.src,E=Ke(A);if(n.transcoded)A=n.transcoded.url,E="video/mp4";let I=n.streaming?.hls||n.streaming?.dash;if(I){if(n.streaming?.hls)A=n.streaming.hls.manifestUrl,E="application/x-mpegURL";else if(n.streaming?.dash)A=n.streaming.dash.manifestUrl,E="application/dash+xml"}let w=n.poster?.url||e.poster,C=[`id="${_}"`];if(o)C.push("controls");if(s)C.push("autoplay");if(l)C.push("muted");if(d)C.push("loop");if(u)C.push("playsinline");if(b)C.push("disablepictureinpicture");if(x)C.push("disableremoteplayback");if(v)C.push(`crossorigin="${v}"`);if(m){if(C.push(`data-preload="${p}"`),C.push('preload="none"'),w)C.push(`data-poster="${M(w)}"`);C.push("data-stx-lazy")}else if(C.push(`preload="${p}"`),w)C.push(`poster="${M(w)}"`);let D=y||n.metadata?.width,L=f||n.metadata?.height;if(D)C.push(`width="${D}"`);if(L)C.push(`height="${L}"`);if(k)C.push(`class="${M(k)}"`);if(S)C.push(`style="${M(S)}"`);let T=` <source ${m?`data-src="${M(A)}"`:`src="${M(A)}"`} type="${E}" />`,V=`<video ${C.join(" ")}>
|
|
960
960
|
${T}
|
|
961
961
|
Your browser does not support the video tag.
|
|
962
|
-
</video>`;if(
|
|
962
|
+
</video>`;if(n.spriteSheet)V=`<div class="stx-video-wrapper" data-sprite-sheet="${M(n.spriteSheet.url)}" data-sprite-cols="${n.spriteSheet.columns}" data-sprite-interval="${n.spriteSheet.interval}">
|
|
963
963
|
${V}
|
|
964
964
|
</div>`;let R;if(m)R=`
|
|
965
965
|
(function() {
|
|
@@ -1005,13 +1005,13 @@ ${V}
|
|
|
1005
1005
|
width: 100%;
|
|
1006
1006
|
height: auto;
|
|
1007
1007
|
}
|
|
1008
|
-
`.trim();return{html:V,script:R,css:z}}function
|
|
1008
|
+
`.trim();return{html:V,script:R,css:z}}function Ye(){return vt({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,n,i,o)=>{let{src:s,options:l}=Vt(e,n,i);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,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},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await de(d,u),y=m.html;if(m.css)y+=`
|
|
1009
1009
|
<style>${m.css}</style>`;if(m.script)y+=`
|
|
1010
|
-
<script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function
|
|
1011
|
-
* ${
|
|
1010
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,n,i){if(n.src)return{src:String(n.src),options:n.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=zt(o),l=Xe(s[0],i)||"",d={};if(s[1]){let p=Xe(s[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:l,options:d}}function zt(e){let n=[],i="",o=!1,s="",l=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function Xe(e,n){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=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import q from"path";async function bs(e,n){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 s of i)try{let l=await Wt(s,e,n);if(l)o.push(l)}catch(l){if(console.error(`Error building web component ${s.name}:`,l),e.debug)throw l}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:l,extends:d}=e;if(!o||!s||!l)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(s)&&await r(s))p=s;else if(n.componentsDir){let k=q.join(n.componentsDir,s);if(await r(k))p=k}if(!p)p=await yn(s,process.cwd(),n,i);if(!p)return console.error(`Web component source file not found: ${s}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?qt({name:o,tag:l,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Ft({name:o,tag:l,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=n.webComponents?.outputDir||"dist/web-components";await Lt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${l}.${b}`);if(await Bun.write(x,f),n.debug)console.log(`Built web component ${o} -> ${x}`);return x}function Ft(e){let{name:n,tag:i,baseElement:o="HTMLElement",source:s,shadowDOM:l,template:d,styleSource:p,attributes:u=[]}=e,m=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
|
|
1011
|
+
* ${n} Web Component
|
|
1012
1012
|
* Auto-generated from stx component
|
|
1013
1013
|
*/
|
|
1014
|
-
class ${
|
|
1014
|
+
class ${n.replace(/\W/g,"")} extends ${o} {
|
|
1015
1015
|
constructor() {
|
|
1016
1016
|
super()
|
|
1017
1017
|
this._initialized = false
|
|
@@ -1098,8 +1098,8 @@ class ${s.replace(/\W/g,"")} extends ${o} {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
// Register the web component
|
|
1101
|
-
customElements.define('${i}', ${
|
|
1102
|
-
`}function
|
|
1101
|
+
customElements.define('${i}', ${n.replace(/\W/g,"")})
|
|
1102
|
+
`}function qt(e){let{name:n,tag:i,baseElement:o="HTMLElement",source:s,shadowDOM:l,template:d,styleSource:p,attributes:u=[],attributeTypes:m={}}=e,y=n.replace(/\W/g,""),f=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)f=f.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),f=f.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),f=f.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),f=f.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");f=f.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let v=p?`<link rel="stylesheet" href="${p}">`:"",b=(w)=>{switch(m[w]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},x=(w)=>w.replace(/-([a-z])/g,(C,D)=>D.toUpperCase()),k=u.map((w)=>` private _${x(w)}: ${b(w)} | null = null;`).join(`
|
|
1103
1103
|
`),S=u.map((w)=>{let C=b(w),D=x(w);return`
|
|
1104
1104
|
get ${D}(): ${C} | null {
|
|
1105
1105
|
return this._${D};
|
|
@@ -1115,7 +1115,7 @@ else {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
}`}).join(`
|
|
1117
1117
|
`),_=u.length>0?`/**
|
|
1118
|
-
* Props interface for ${
|
|
1118
|
+
* Props interface for ${n}
|
|
1119
1119
|
*/
|
|
1120
1120
|
export interface ${y}Props {
|
|
1121
1121
|
${u.map((w)=>{let C=b(w);return` ${x(w)}?: ${C};`}).join(`
|
|
@@ -1157,7 +1157,7 @@ catch { return value; }
|
|
|
1157
1157
|
${l?"this.shadowRoot!.innerHTML":"this.innerHTML"} = \`${v}${f}\`;
|
|
1158
1158
|
this._processSlots();
|
|
1159
1159
|
}`;return`/**
|
|
1160
|
-
* ${
|
|
1160
|
+
* ${n} Web Component
|
|
1161
1161
|
* Auto-generated from stx component (TypeScript)
|
|
1162
1162
|
*
|
|
1163
1163
|
* @example
|
|
@@ -1176,7 +1176,7 @@ interface SlotChangeDetail {
|
|
|
1176
1176
|
|
|
1177
1177
|
${_}
|
|
1178
1178
|
/**
|
|
1179
|
-
* ${
|
|
1179
|
+
* ${n} custom element class
|
|
1180
1180
|
* @customElement ${i}
|
|
1181
1181
|
*/
|
|
1182
1182
|
export class ${y} extends ${o} {
|
|
@@ -1254,7 +1254,7 @@ declare global {
|
|
|
1254
1254
|
|
|
1255
1255
|
// Register the web component
|
|
1256
1256
|
customElements.define('${i}', ${y});
|
|
1257
|
-
`}function
|
|
1257
|
+
`}function Ht(e,n){let i=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),o=i?i[1].trim():"",s=n,l=[],d=!0;if(o){let f=o.match(/export\s+default\s+({[\s\S]*})/);if(f)try{let v=f[1],b=v.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(b)s=b[1];let x=v.match(/props\s*:\s*\[([\s\S]*?)\]/);if(x)l=x[1].split(",").map((S)=>S.trim().replace(/['"`]/g,"")).filter((S)=>S.length>0);let k=v.match(/shadowDOM\s*:\s*(true|false)/);if(k)d=k[1]==="true"}catch{}}let p=e.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),u=p?p[1].trim():"",m=e.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),y=m?m[1].trim():"";return{tag:s,props:l,template:u,styles:y,script:o,shadowDOM:d}}function Ut(e){let{tag:n,props:i,template:o,styles:s,shadowDOM:l}=e,d=n.split("-").map((f)=>f.charAt(0).toUpperCase()+f.slice(1)).join(""),p=o.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),u=s.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),m=i.map((f)=>`'${f}'`).join(", "),y=i.map((f)=>`
|
|
1258
1258
|
get ${f}() {
|
|
1259
1259
|
return this.getAttribute('${f}') || '';
|
|
1260
1260
|
}
|
|
@@ -1304,9 +1304,9 @@ ${y}
|
|
|
1304
1304
|
}
|
|
1305
1305
|
}
|
|
1306
1306
|
|
|
1307
|
-
customElements.define('${
|
|
1308
|
-
`}async function
|
|
1309
|
-
${
|
|
1310
|
-
</script>`}var j={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:ln,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:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Xe,hasEndTag:!1,description:"Include a web component in the template"},fc,gc,ws,vs,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Js],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 Ut(e,s,i){let o=s||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),l=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,s){let i=s.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function Of(e,s){let i=!e.root,o=Ut(e.root,e.pagesDir,s);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${s}::${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(!Se.has(e)){let n={};for(let l of ue){let d=e[l];if(typeof d==="string"&&d)n[l]=d}Se.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let l of ue){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Bt(d,n))continue;e[l]=N.join(n,d)}}for(let n of ue){let l=e[n];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[n]=N.resolve(s,l)}return e}function Jt(e,s){let i=Se.get(e);for(let o of ue){let n=e[o];if(typeof n!=="string"||!n)continue;let l=N.isAbsolute(n)?n:N.join(s,n);if(Q.existsSync(l))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Sc(e.stateDir),e.stateDir=gr(),e.cachePath=mr(e.cachePath),e.build)e.build.cacheDir=mr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=mr(e.media.cache.directory);if(e.story)e.story.outDir=mr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function Uo(e,s=Ht){try{return await s(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let s=e?N.resolve(e):process.cwd(),i=de.get(s);if(i&&i.signature!==ys(i.graph)){let l=Y.get(s);if(Y.delete(s),de.delete(s),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-cenvzm5q.js"),{partialsCache:p}=await import("./chunk-qfhjtz2q.js");if(d(),p.clear(),l&&i.configSignature===bs(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await qo(y,s),de.set(s,{graph:y,signature:ys(y),configSignature:bs(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(s,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(s);if(o)return o;let n=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(s,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(s,"config",`ui${v}`))),u;if(d&&p){let v=await Uo({name:"ui",cwd:N.join(s,"config"),defaultConfig:j,errorPolicy:"throw",verbose:!1});u=(await Uo({name:"stx",alias:"ui",cwd:s,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Uo({name:"stx",alias:"ui",cwd:s,defaultConfig:j,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await hc(s,j);u=v.config,de.set(s,{graph:v.graph,signature:ys(v.graph),configSignature:bs(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-k0jkpw0q.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-d49pst1m.js");await b(s,u.runtimeConfig)}Kt(u),Gt(u),Of(u,s),Jt(u,s);let m=[],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{g.resolve(b,{paths:[s]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-mebf9vwb.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[s]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(s,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
|
-
`)}catch(A){console.warn(`[stx] Failed to load plugin ${S}:`,A.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(s
|
|
1312
|
-
export{
|
|
1307
|
+
customElements.define('${n}', ${d});
|
|
1308
|
+
`}async function Qe(e,n,i,o){if(n.length<1)return c("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=n[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(o),`${s}.stx`)]:[q.join(q.dirname(o),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(o),`${s}.stx`)],u=null;for(let f of p)if(await r(f)){u=await Bun.file(f).text();break}if(!u)return c("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,s);return`<script type="module">
|
|
1309
|
+
${Ut(m)}
|
|
1310
|
+
</script>`}var j={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:ln,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:Qe,hasEndTag:!1,description:"Include a web component in the template"},gc,mc,xs,Ss,Pe,Ae,_e,ke,Re,Ee,qe,Se,...Ys],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,n,i){let o=n||"pages";if(e)return{root:e,pagesDir:o};let s=i||process.cwd(),l=N.join(s,"resources","views"),d=N.join(s,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,n){let i=n.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return o===s||o.startsWith(`${s}/`)}function Nf(e,n){let i=!e.root,o=Jt(e.root,e.pagesDir,n);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let s=`${n}::${o.root}`;if(!tt.has(s))tt.add(s),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 s={};for(let l of pe){let d=e[l];if(typeof d==="string"&&d)s[l]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let l of pe){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,s))continue;e[l]=N.join(s,d)}}for(let s of pe){let l=e[s];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[s]=N.resolve(n,l)}return e}function Gt(e,n){let i=Ce.get(e);for(let o of pe){let s=e[o];if(typeof s!=="string"||!s)continue;let l=N.isAbsolute(s)?s:N.join(n,s);if(Q.existsSync(l))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", 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(kc(e.stateDir),e.stateDir=gr(),e.cachePath=mr(e.cachePath),e.build)e.build.cacheDir=mr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=mr(e.media.cache.directory);if(e.story)e.story.outDir=mr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Wo(e,n=Bt){try{return await n(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let n=e?N.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==ws(i.graph)){let l=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-6rd0zz6k.js"),{partialsCache:p}=await import("./chunk-kkx2gqk8.js");if(d(),p.clear(),l&&i.configSignature===vs(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await Ko(y,n),ue.set(n,{graph:y,signature:ws(y),configSignature:vs(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(n,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(n);if(o)return o;let s=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(n,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await Wo({name:"ui",cwd:N.join(n,"config"),defaultConfig:j,errorPolicy:"throw",verbose:!1});u=(await Wo({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Wo({name:"stx",alias:"ui",cwd:n,defaultConfig:j,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await yc(n,j);u=v.config,ue.set(n,{graph:v.graph,signature:ws(v.graph),configSignature:vs(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-5ttj2c0h.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-rzh4xgb4.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Nf(u,n),Gt(u,n);let m=[],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{g.resolve(b,{paths:[n]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-qgvez75f.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[n]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(n,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
|
+
`)}catch(A){console.warn(`[stx] Failed to load plugin ${S}:`,A.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:ys(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(n,s),s.catch(()=>{if(Y.get(n)===s)Y.delete(n)}),!e)se=s,s.then((l)=>{K=l}).catch(()=>{});return s}var P=new Proxy(j,{get(e,n){if(K&&n in K)return K[n];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[n]}});function Nh(e){return e}function Dh(e){let n=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")n.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")n.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")n.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")n.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)n.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)n.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))n.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))n.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)n.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)n.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))n.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))n.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))n.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))n.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))n.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))n.push({path:`middleware[${s}].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)n.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))n.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))n.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((s,l)=>{if(!s.pattern||typeof s.pattern!=="string")n.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(s.strategy))n.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))n.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))n.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))n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)n.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)n.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:n.length===0,errors:n,warnings:i}}
|
|
1312
|
+
export{cc,lc,ur,Ze,uc,ys,bs,j,Nf,Wo,a,P,Nh,Dh};
|