@stacksjs/stx 0.2.870 → 0.2.872
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-6mjd3pqd.js → chunk-18a3vdnq.js} +3 -3
- package/dist/{chunk-cwmfxbhz.js → chunk-1c8j9zdp.js} +1 -1
- package/dist/{chunk-nkwj7eq3.js → chunk-1p9rb7rt.js} +1 -1
- package/dist/{chunk-9ffvh6cr.js → chunk-2jccw1km.js} +2 -2
- package/dist/chunk-2nd3h37q.js +2 -0
- package/dist/{chunk-81n2s24z.js → chunk-2yrd286h.js} +1 -1
- package/dist/chunk-3k5g4tbn.js +2 -0
- package/dist/chunk-3qewdhvh.js +2 -0
- package/dist/{chunk-tjwzy9xq.js → chunk-40h07m5w.js} +1 -1
- package/dist/{chunk-tv61s6fc.js → chunk-4ay62hs9.js} +1 -1
- package/dist/chunk-4es07dwb.js +2 -0
- package/dist/{chunk-zbvfjm4a.js → chunk-4nb7egk0.js} +2 -2
- package/dist/{chunk-q58f5wk2.js → chunk-4p51hk75.js} +5 -5
- package/dist/{chunk-m4k6ndf5.js → chunk-4v70bs2q.js} +1 -1
- package/dist/{chunk-6ggme8xx.js → chunk-5nj2k8zf.js} +1 -1
- package/dist/{chunk-sbvkk4cn.js → chunk-6mkn81pd.js} +2 -2
- package/dist/{chunk-sb3dx4dd.js → chunk-6s7q8kw3.js} +2 -2
- package/dist/chunk-71hjqg16.js +177 -0
- package/dist/{chunk-3ryp43f3.js → chunk-73k579v7.js} +1 -1
- package/dist/{chunk-3f51tn2b.js → chunk-7cvbz4eq.js} +2 -2
- package/dist/{chunk-4vtw6f0c.js → chunk-7j0qkye5.js} +2 -2
- package/dist/chunk-7mqnbn1x.js +2 -0
- package/dist/chunk-7q3ar8ay.js +2 -0
- package/dist/chunk-808fbm83.js +2 -0
- package/dist/chunk-832m6nwr.js +2051 -0
- package/dist/{chunk-1mqcttg3.js → chunk-8tk8yf91.js} +2 -2
- package/dist/{chunk-wb7s2cnb.js → chunk-9bnggqhj.js} +8 -8
- package/dist/{chunk-t5ekex4s.js → chunk-9c07p1vq.js} +4 -4
- package/dist/{chunk-rpep1ve3.js → chunk-9fyw1xkh.js} +2 -2
- package/dist/{chunk-311mrz2n.js → chunk-a8164hnf.js} +1 -1
- package/dist/chunk-asrzmw7w.js +2 -0
- package/dist/{chunk-pfr3cazq.js → chunk-av2vknrs.js} +2 -2
- package/dist/chunk-b2kkezey.js +2 -0
- package/dist/{chunk-dg4zxpbq.js → chunk-b8vs32dw.js} +3 -3
- package/dist/{chunk-y1cvab1b.js → chunk-ba86dkhs.js} +1 -1
- package/dist/{chunk-d9k8j44b.js → chunk-bbq79tap.js} +6 -6
- package/dist/chunk-bfvr4byj.js +21 -0
- package/dist/{chunk-gesktj4m.js → chunk-bmbqr2br.js} +1 -1
- package/dist/chunk-bqs9wyje.js +2 -0
- package/dist/chunk-c63027nw.js +2 -0
- package/dist/{chunk-0tyyad6q.js → chunk-csymxc5a.js} +8 -8
- package/dist/chunk-cv9vmz5x.js +2 -0
- package/dist/{chunk-6ksyrmpp.js → chunk-d0h18m2r.js} +1 -1
- package/dist/{chunk-sb8n32rn.js → chunk-dhbpbjt3.js} +1 -1
- package/dist/{chunk-3v7xht2q.js → chunk-dv1edvz8.js} +1 -1
- package/dist/{chunk-1dt8e7ew.js → chunk-e2t7mk29.js} +2 -2
- package/dist/{chunk-4t5t33yj.js → chunk-e549f7a9.js} +2 -2
- package/dist/{chunk-adqh1gp1.js → chunk-e7s109j6.js} +1 -1
- package/dist/chunk-eczy00w6.js +2 -0
- package/dist/{chunk-h0nxd9xg.js → chunk-f5gg0pxj.js} +1 -1
- package/dist/chunk-gc4bgven.js +2 -0
- package/dist/{chunk-7chzhef2.js → chunk-gvz0kqkz.js} +1 -1
- package/dist/{chunk-5d0csn7w.js → chunk-hcaedzck.js} +1 -1
- package/dist/{chunk-drdr0a53.js → chunk-hd4vn78w.js} +1 -1
- package/dist/{chunk-dy7vqv1x.js → chunk-hhbt8grm.js} +2 -2
- package/dist/{chunk-gcsy3z1e.js → chunk-j89p53vx.js} +3 -3
- package/dist/{chunk-y0msz738.js → chunk-jcr69v95.js} +4 -4
- package/dist/{chunk-rt55f47q.js → chunk-jf3n1f32.js} +3 -3
- package/dist/chunk-jkevn2jy.js +2 -0
- package/dist/{chunk-xr3x6wk6.js → chunk-jnj9s2yw.js} +1 -1
- package/dist/{chunk-dwqjrbse.js → chunk-jpgc0j8x.js} +2 -2
- package/dist/{chunk-mwxehpse.js → chunk-kkevjppm.js} +2 -2
- package/dist/{chunk-z8x86cr7.js → chunk-kx6y1cqw.js} +5 -5
- package/dist/{chunk-cbpxd3qa.js → chunk-kzhget9h.js} +1 -1
- package/dist/{chunk-mnx6njd4.js → chunk-m131znxe.js} +6 -6
- package/dist/chunk-me7cxs0e.js +2 -0
- package/dist/{chunk-w1rrfj39.js → chunk-mm00bb1p.js} +1 -1
- package/dist/{chunk-fcvgf88g.js → chunk-my6tp8rn.js} +1 -1
- package/dist/chunk-p2kqsb5k.js +2 -0
- package/dist/chunk-pc8jnkb3.js +2 -0
- package/dist/{chunk-zpgj4asv.js → chunk-pj1znb6y.js} +1 -1
- package/dist/{chunk-hze3158c.js → chunk-pnqdwqw9.js} +56 -56
- package/dist/{chunk-79y9amt1.js → chunk-pywz8q4k.js} +5 -5
- package/dist/{chunk-k7m8659h.js → chunk-q50x1gfd.js} +2 -2
- package/dist/{chunk-1637r8fg.js → chunk-q8d0wf0w.js} +1 -1
- package/dist/{chunk-qmr5xsjj.js → chunk-qk1fkfvj.js} +1 -1
- package/dist/{chunk-7wae4311.js → chunk-qt4dha3g.js} +4 -4
- package/dist/{chunk-n7w8n327.js → chunk-qvxtq5vb.js} +1 -1
- package/dist/{chunk-7d6jq5j8.js → chunk-rvbw12e1.js} +2 -2
- package/dist/{chunk-vrcr4b13.js → chunk-s584xnzx.js} +1 -1
- package/dist/{chunk-pdpmtmfj.js → chunk-s70e5jbq.js} +10 -10
- package/dist/chunk-tahw02kf.js +2 -0
- package/dist/{chunk-zfq2vvex.js → chunk-tc36b3r4.js} +24 -24
- package/dist/{chunk-d4zcwtna.js → chunk-teahvty8.js} +1 -1
- package/dist/chunk-tfsf9pes.js +2 -0
- package/dist/chunk-thyxsg54.js +2 -0
- package/dist/chunk-txjtd4gj.js +2 -0
- package/dist/{chunk-mrh08821.js → chunk-tyvm49be.js} +2 -2
- package/dist/{chunk-m1a3a32y.js → chunk-v4ab2jzz.js} +1 -1
- package/dist/{chunk-12sk3dtm.js → chunk-v99hgmsx.js} +1 -1
- package/dist/chunk-vf91b9b9.js +20 -0
- package/dist/chunk-vmq773pb.js +2 -0
- package/dist/{chunk-3asy7ev5.js → chunk-vv9anbw1.js} +1 -1
- package/dist/{chunk-hvx6j4a2.js → chunk-vvxcebpn.js} +2 -2
- package/dist/{chunk-5h9d6jew.js → chunk-wk2rge05.js} +3 -3
- package/dist/{chunk-wk188ph7.js → chunk-y48ykf1n.js} +4 -4
- package/dist/chunk-y69hhxn8.js +2 -0
- package/dist/{chunk-ca9x39p1.js → chunk-ycb07ppz.js} +1 -1
- package/dist/chunk-z0qxrx9r.js +3 -0
- package/dist/chunk-z2wfgva6.js +2 -0
- package/dist/{chunk-x7redxyd.js → chunk-z9xe3xkg.js} +2 -2
- package/dist/{chunk-stdddhk9.js → chunk-zfrzdje6.js} +2 -2
- package/dist/cli.js +14 -14
- package/dist/component-library.js +140 -36
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/native/accessibility.d.ts +15 -0
- package/dist/native/accessibility.js +14 -4
- package/dist/native/compiler/html-to-ir.js +56 -1
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.js +4 -1
- package/dist/ssg.js +5 -5
- package/package.json +5 -5
- package/dist/chunk-04f6r2kh.js +0 -2
- package/dist/chunk-0jchm9gg.js +0 -2
- package/dist/chunk-5sbtbfj3.js +0 -2
- package/dist/chunk-79sr2kxg.js +0 -2
- package/dist/chunk-8cf6995c.js +0 -2
- package/dist/chunk-8cgn4re9.js +0 -2
- package/dist/chunk-94e6kmjm.js +0 -2
- package/dist/chunk-aa6ztwdq.js +0 -2
- package/dist/chunk-bz1jgrx8.js +0 -2
- package/dist/chunk-eh1rdapx.js +0 -2
- package/dist/chunk-hb6r4pxp.js +0 -2
- package/dist/chunk-jksjr12b.js +0 -2
- package/dist/chunk-khe30jmk.js +0 -3
- package/dist/chunk-ndrgek64.js +0 -2
- package/dist/chunk-nxecjev1.js +0 -2
- package/dist/chunk-ps6m8n9n.js +0 -2
- package/dist/chunk-pxce4aag.js +0 -2
- package/dist/chunk-qm0qn2xa.js +0 -177
- package/dist/chunk-qxxvaxee.js +0 -2
- package/dist/chunk-rhhq8k9f.js +0 -2
- package/dist/chunk-s2a9vfdg.js +0 -2
- package/dist/chunk-sew1z7cv.js +0 -21
- package/dist/chunk-swzxhkh2.js +0 -2042
- package/dist/chunk-tg7kt56m.js +0 -2
- package/dist/chunk-ttr8ay8h.js +0 -2
- package/dist/chunk-w2hqjv5e.js +0 -2
- package/dist/chunk-xb34eyne.js +0 -2
- package/dist/chunk-y0dee635.js +0 -2
- package/dist/chunk-yx3vghee.js +0 -2
- package/dist/chunk-zf9n3esr.js +0 -20
|
@@ -4,8 +4,11 @@ const STATE_KEYS = {
|
|
|
4
4
|
"aria-checked": "checked",
|
|
5
5
|
"aria-disabled": "disabled",
|
|
6
6
|
"aria-expanded": "expanded",
|
|
7
|
-
"aria-busy": "busy"
|
|
8
|
-
|
|
7
|
+
"aria-busy": "busy",
|
|
8
|
+
"aria-current": "selected"
|
|
9
|
+
};
|
|
10
|
+
export const READER_GROUP = "data-stx-reader-group";
|
|
11
|
+
const ROLES = {
|
|
9
12
|
alert: "alert",
|
|
10
13
|
button: "button",
|
|
11
14
|
checkbox: "checkbox",
|
|
@@ -15,6 +18,7 @@ const STATE_KEYS = {
|
|
|
15
18
|
image: "image",
|
|
16
19
|
img: "image",
|
|
17
20
|
link: "link",
|
|
21
|
+
list: "list",
|
|
18
22
|
menu: "menu",
|
|
19
23
|
menubar: "menubar",
|
|
20
24
|
menuitem: "menuitem",
|
|
@@ -34,19 +38,21 @@ const STATE_KEYS = {
|
|
|
34
38
|
toolbar: "toolbar"
|
|
35
39
|
};
|
|
36
40
|
export function isAccessibilityAttribute(name) {
|
|
37
|
-
return name === "role" || name === "aria-label" || name === "aria-valuetext" || name in STATE_KEYS;
|
|
41
|
+
return name === "role" || name === "aria-label" || name === "aria-valuetext" || name === "aria-hidden" || name in STATE_KEYS;
|
|
38
42
|
}
|
|
39
43
|
function stateValue(name, value) {
|
|
40
44
|
if (value === void 0 || value === null)
|
|
41
45
|
return;
|
|
42
46
|
const text = String(value).trim().toLowerCase();
|
|
47
|
+
if (name === "aria-current")
|
|
48
|
+
return text !== "false";
|
|
43
49
|
if (text === "mixed")
|
|
44
50
|
return name === "aria-checked" ? "mixed" : !0;
|
|
45
51
|
if (text === "undefined")
|
|
46
52
|
return;
|
|
47
53
|
return text === "" || text === "true";
|
|
48
54
|
}
|
|
49
|
-
function nativeRole(value) {
|
|
55
|
+
export function nativeRole(value) {
|
|
50
56
|
if (value === void 0 || value === null)
|
|
51
57
|
return null;
|
|
52
58
|
for (const role of String(value).trim().toLowerCase().split(/\s+/))
|
|
@@ -80,6 +86,10 @@ export function applyStaticAccessibility(props) {
|
|
|
80
86
|
if (patch)
|
|
81
87
|
Object.assign(derived, patch);
|
|
82
88
|
}
|
|
89
|
+
if (stateValue("aria-hidden", props["aria-hidden"]) === !0)
|
|
90
|
+
derived.accessibilityRole = "none";
|
|
91
|
+
if (props[READER_GROUP] !== void 0)
|
|
92
|
+
delete derived.accessibilityLabel;
|
|
83
93
|
for (const key of ["accessibilityLabel", "accessibilityRole", "accessibilityValue"])
|
|
84
94
|
if (props[key] === void 0 && derived[key] !== void 0 && derived[key] !== null)
|
|
85
95
|
props[key] = derived[key];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACCESSIBILITY_FIELDS, projectAccessibility } from "../accessibility.js";
|
|
1
|
+
import { ACCESSIBILITY_FIELDS, nativeRole, projectAccessibility, READER_GROUP } from "../accessibility.js";
|
|
2
2
|
import { applyStaticTextEntry } from "../text-entry.js";
|
|
3
3
|
import { NATIVE_EVENT_NAMES as EVENT_NAMES } from "../event-names.js";
|
|
4
4
|
import { NATIVE_BOOLEAN_PROPS, nativePropName } from "../prop-names.js";
|
|
@@ -252,6 +252,10 @@ function settle(frame, diagnostics) {
|
|
|
252
252
|
node.children = flattened ? [flattened] : [];
|
|
253
253
|
return node;
|
|
254
254
|
}
|
|
255
|
+
if (node.type === "Text" && elements.length === 0 && node.children.length > 0) {
|
|
256
|
+
node.children = text ? [text] : [];
|
|
257
|
+
return node;
|
|
258
|
+
}
|
|
255
259
|
if (CONTAINER_TYPES.has(node.type) && elements.length > 0)
|
|
256
260
|
node.children = elements;
|
|
257
261
|
return node;
|
|
@@ -515,10 +519,61 @@ export async function translateHtmlToIR(html, options = {}) {
|
|
|
515
519
|
if (typeof child !== "string")
|
|
516
520
|
project(child);
|
|
517
521
|
};
|
|
522
|
+
nameControlsFromLabels(root);
|
|
523
|
+
markReaderGroups(root);
|
|
518
524
|
project(root);
|
|
519
525
|
boundScrollingViewports(root);
|
|
520
526
|
return { root, diagnostics };
|
|
521
527
|
}
|
|
528
|
+
const READER_CONTROLS = new Set([
|
|
529
|
+
"Button",
|
|
530
|
+
"Link",
|
|
531
|
+
"TouchableOpacity",
|
|
532
|
+
"TouchableHighlight",
|
|
533
|
+
"Pressable",
|
|
534
|
+
"TextInput",
|
|
535
|
+
"Switch",
|
|
536
|
+
"Checkbox",
|
|
537
|
+
"Slider",
|
|
538
|
+
"Picker",
|
|
539
|
+
"SegmentedControl",
|
|
540
|
+
"DatePicker"
|
|
541
|
+
]);
|
|
542
|
+
function holdsControl(node) {
|
|
543
|
+
return node.children.some((child) => typeof child !== "string" && (READER_CONTROLS.has(child.type) || child.events.onPress !== void 0 || child.props.href !== void 0 || holdsControl(child)));
|
|
544
|
+
}
|
|
545
|
+
function markReaderGroups(node) {
|
|
546
|
+
const labelled = node.props["aria-label"] !== void 0 || node.bindings?.["aria-label"] !== void 0;
|
|
547
|
+
if (node.type === "View" && labelled && nativeRole(node.props.role) === null && node.events.onPress === void 0 && holdsControl(node))
|
|
548
|
+
node.props[READER_GROUP] = "";
|
|
549
|
+
for (const child of node.children)
|
|
550
|
+
if (typeof child !== "string")
|
|
551
|
+
markReaderGroups(child);
|
|
552
|
+
}
|
|
553
|
+
const LABELLED_CONTROLS = new Set(["TextInput", "Picker", "Switch", "Checkbox", "Slider", "DatePicker"]);
|
|
554
|
+
function nameControlsFromLabels(root) {
|
|
555
|
+
const byId = new Map, labels = [], visit = (node) => {
|
|
556
|
+
if (typeof node.props.id === "string" && node.props.id)
|
|
557
|
+
byId.set(node.props.id, node);
|
|
558
|
+
if (typeof node.props.for === "string" && node.props.for)
|
|
559
|
+
labels.push(node);
|
|
560
|
+
for (const child of node.children)
|
|
561
|
+
if (typeof child !== "string")
|
|
562
|
+
visit(child);
|
|
563
|
+
};
|
|
564
|
+
visit(root);
|
|
565
|
+
for (const label of labels) {
|
|
566
|
+
const control = byId.get(label.props.for);
|
|
567
|
+
if (!control || !LABELLED_CONTROLS.has(control.type))
|
|
568
|
+
continue;
|
|
569
|
+
const named = ["aria-label", "accessibilityLabel"].some((name) => control.props[name] !== void 0 || control.bindings?.[name] !== void 0), words = label.bindings?.text === void 0 ? flattenText(label) : "";
|
|
570
|
+
if (named || !words || words.includes("{{"))
|
|
571
|
+
continue;
|
|
572
|
+
control.props["aria-label"] = words;
|
|
573
|
+
if (label.props["aria-hidden"] === void 0 && label.bindings?.["aria-hidden"] === void 0)
|
|
574
|
+
label.props["aria-hidden"] = "true";
|
|
575
|
+
}
|
|
576
|
+
}
|
|
522
577
|
function boundScrollingViewports(node, inRow = !1) {
|
|
523
578
|
if (["ScrollView", "FlatList", "SectionList"].includes(node.type))
|
|
524
579
|
return !node.props.horizontal && (Number(node.style.flex) > 0 || Number(node.style.flexGrow) > 0);
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ao,
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{ao,Xt,Ml,Vg}from"./chunk-18a3vdnq.js";import{io,Hi,Fg,zg,Hg}from"./chunk-zfrzdje6.js";import{Ol,Nl,Dl,jg,Bg}from"./chunk-r0v2chpn.js";import{Ge,Nn,Vi}from"./chunk-tyvm49be.js";import{Ug,Wg,qg,Kg,co,Py}from"./chunk-srgnevws.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-c63027nw.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Ge(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=ao(n,t);if(a){let s=Xt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Hi(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,Nl as auditBuildOutput,Ol as auditConfig,re as buildPwaAssets,Dl as calculateAuditResult,Bg as formatAuditResult,Vi as formatSize,j as generateManifest,_ as generateManifestJson,zg as generateManifestLink,F as generateOfflinePage,Ge as generatePrecacheManifest,Nn as generatePrecacheManifestJs,M as generatePwaIcons,io as generatePwaTags,ao as generateServiceWorker,Vg as generateServiceWorkerAuto,Fg as generateSwRegistrationScript,Hg as generateThemeColorMeta,N as getExpectedIconPaths,Xt as getServiceWorkerFileName,Hi as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Ml as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,co as pwaDirectives,Ug as pwaInstallDirective,qg as pwaOfflineDirective,Kg as pwaPushDirective,Wg as pwaUpdateDirective,Py as registerPwaDirectives,jg as runPwaAudit,D as validateManifest};
|
|
@@ -210,12 +210,15 @@ function conditionIsClientReactive(condition, signalNames, context, clientLoopVa
|
|
|
210
210
|
}
|
|
211
211
|
function branchToAttrElement(content, attrName, attrValue) {
|
|
212
212
|
const attr = attrValue === void 0 ? ` ${attrName}` : ` ${attrName}="${attrValue.replace(/"/g, """)}"`, trimmed = content.trim(), singleElementMatch = trimmed.match(SINGLE_ELEMENT_RE);
|
|
213
|
-
if (singleElementMatch && isBalancedForTag(singleElementMatch[3], singleElementMatch[1])) {
|
|
213
|
+
if (singleElementMatch && !isComponentTagName(singleElementMatch[1]) && isBalancedForTag(singleElementMatch[3], singleElementMatch[1])) {
|
|
214
214
|
const [, tag, attrs, innerContent] = singleElementMatch;
|
|
215
215
|
return `<${tag}${attrs}${attr}>${innerContent}</${tag}>`;
|
|
216
216
|
}
|
|
217
217
|
return `<template${attr}>${trimmed}</template>`;
|
|
218
218
|
}
|
|
219
|
+
function isComponentTagName(tag) {
|
|
220
|
+
return /^[A-Z]/.test(tag);
|
|
221
|
+
}
|
|
219
222
|
function isBalancedForTag(inner, tag) {
|
|
220
223
|
const tokenRe = new RegExp(`<(/)?${tag}(?=[\\s/>])`, "gi");
|
|
221
224
|
let depth = 0, m;
|
package/dist/ssg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-9zrvh3pz.js";import{k,yl}from"./chunk-
|
|
3
|
-
`)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Lt;function Ut(t){let n=r(t),{depths:s}=
|
|
2
|
+
import"./chunk-9zrvh3pz.js";import{k,yl}from"./chunk-csymxc5a.js";import"./chunk-qjey0jk6.js";import"./chunk-farh4p7f.js";import{Dt,w}from"./chunk-pnqdwqw9.js";import"./chunk-60yppcbb.js";import"./chunk-mm00bb1p.js";import"./chunk-tnp2ta5q.js";import{Rt,At,Pt,It,Ot,Nt}from"./chunk-hhbt8grm.js";import{a}from"./chunk-jcr69v95.js";import{Os}from"./chunk-6mkn81pd.js";import"./chunk-rw5492e2.js";import"./chunk-kkevjppm.js";import{xe,cn,ln}from"./chunk-vf91b9b9.js";import"./chunk-1p9rb7rt.js";import{x}from"./chunk-av2vknrs.js";import{kt,i}from"./chunk-tc36b3r4.js";import"./chunk-kx6y1cqw.js";import"./chunk-s70e5jbq.js";import{vs}from"./chunk-bfvr4byj.js";import"./chunk-y48ykf1n.js";import"./chunk-q1wxgw5s.js";import{lc,uc,dc}from"./chunk-v4xes880.js";import{on,sr,or}from"./chunk-ymdw4fhd.js";import{an}from"./chunk-v99hgmsx.js";import"./chunk-z0qxrx9r.js";import"./chunk-vvxcebpn.js";import{ee,_e}from"./chunk-4p51hk75.js";import"./chunk-a8164hnf.js";import"./chunk-6s7q8kw3.js";import{l}from"./chunk-46pxmpeb.js";import{r,Y}from"./chunk-z9xe3xkg.js";import{f}from"./chunk-fd1bpv35.js";import R from"fs";import m from"path";import{createHash as vt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Et=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ct(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,o=t.replace(Et,(e,u,g,v)=>{let S=v.trim();if(!S)return e;if(/\bdata-stx-src=/.test(g))return e;if(n.minify)S=$t(S);let p=Ct(S);if(!s.has(p))s.set(p,S);let P=n.integrity?` data-stx-integrity="sha384-${vt("sha384").update(S).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),c=Array.from(s,([e,u])=>({hash:e,code:u}));return{html:o,chunks:c}}var Bt=new Set(["visible","idle"]);function lt(t){if(!t.includes("data-stx-src="))return t;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(t))!==null)n.set(o[1],o[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Bt.has(n.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,v=w(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let S=Array.from(c).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!S)return t;return t.slice(0,v)+S+t.slice(v)}var jt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let n=t.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Ft(t){for(let n of jt){let s=t[n];if(!s)continue;let o=X(s);if(o)return{url:o,source:"env",via:n}}return null}function ut(t){if(!t||typeof t!=="object")return null;let n=t,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?X(s):null}async function Tt(t){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,o);if(!n(c))continue;try{let e=await import(c),u=ut(e.default??e);if(u)return u}catch{}}return null}async function dt(t={}){let n=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=ut(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await Tt(n);if(c)return{url:c,source:"site.config",via:"url"};let e=Ft(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function gt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
|
+
`)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Lt;function Ut(t){let n=r(t),{depths:s}=Y(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=k(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),v=k(n,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(c.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=e.exec(n))!==null){if(s[c.index]!==0)continue;let u=yl(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function pt(t){let n="read";try{let s=await Bun.file(t).text();n="parse";let o=an(s),c=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>s.indexOf(e.fullTag)-s.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Lt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let g=Ut(u);if(/\bdefineStaticPaths\b/.test(r(g))&&Dt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let S=await v();n="result";let p=Array.isArray(S)?{paths:S}:S;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class ft{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=m.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await R.promises.mkdir(this.cacheDir,{recursive:!0});let t=m.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let s=R.statSync(t),o=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of n)if(R.existsSync(e)){let u=R.statSync(e);o+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,n){let s=this.cache.get(t);if(!s)return null;let o=mt(n).some((u)=>R.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&R.existsSync(u)&&vs(R.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(t),null;let e=this.getHash(n,s.dependencies??[]);if(s.hash!==e)return this.cache.delete(t),null;return s.html}set(t,n,s,o){let c=this.getHash(n,s);this.cache.set(t,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return m.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let s=this.getFilePath(t);await R.promises.mkdir(m.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await R.promises.unlink(n)}async invalidatePattern(t){let n=m.join(this.cacheDir,"isr");if(!R.existsSync(n))return;let s=await R.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(t.test(c))await R.promises.unlink(m.join(n,o))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function _t(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let s=await pt(t.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${t.pattern} (${t.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let c of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(c.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function mt(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let n of mt(t))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(t,n,s){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
|
|
4
4
|
return (async function getStaticProps() {
|
|
5
5
|
${e[1]}
|
|
6
6
|
})()
|
|
@@ -36,7 +36,7 @@ ${t.map((o)=>{let c=new URL(o.loc,n).href,e=` <url>
|
|
|
36
36
|
${s.join(`
|
|
37
37
|
`)}
|
|
38
38
|
</channel>
|
|
39
|
-
</rss>`}async function Kt(t={}){let n=Date.now();ln();let s=await a(process.cwd()),o=s.build||{},c=await dt({explicit:t.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(gt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,S={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&R.existsSync(e.outputDir))await R.promises.rm(e.outputDir,{recursive:!0});await R.promises.mkdir(e.outputDir,{recursive:!0});let C=e.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-
|
|
39
|
+
</rss>`}async function Kt(t={}){let n=Date.now();ln();let s=await a(process.cwd()),o=s.build||{},c=await dt({explicit:t.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(gt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,S={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&R.existsSync(e.outputDir))await R.promises.rm(e.outputDir,{recursive:!0});await R.promises.mkdir(e.outputDir,{recursive:!0});let C=e.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-ba86dkhs.js");try{C=y(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-tahw02kf.js"),E=await b(e.publicDir,e.outputDir);if(E.count>0)console.log(`Optimized ${E.count} image(s) for responsive delivery`),C=[C,E.fingerprint].filter(Boolean).join(":");let O=new ft(e.cacheDir,C);if(e.cache)await O.load();try{let{generateCss:d}=await import("./chunk-ba86dkhs.js");await d('<div class="bg-black"></div>')}catch{}Rt();let yt=s?.routeMiddleware?.dir||"middleware";await Pt(process.cwd(),yt);let V=At();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let St=s?.routeMiddleware?.global||[];dc(s?.layoutsDir,l(process.cwd()));let Q=ee(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Q.length} routes`);let U=[];for(let d of Q)try{let y=await _t(d);for(let D of y)U.push({route:d,url:D.url,params:D.params,props:D.props,revalidate:D.revalidate??e.revalidate})}catch(y){let D=y instanceof Error?y:Error(String(y));u.failedCount++,u.errors.push({route:d.pattern,error:D}),await e.hooks.onError?.(D,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,D)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let _=[],tt=[];for(let d=0;d<U.length;d+=e.concurrency)tt.push(U.slice(d,d+e.concurrency));for(let d of tt)await Promise.all(d.map(async(y)=>{let{route:D,url:h,params:M,props:xt,revalidate:nt}=y;try{await e.hooks.onPageStart?.(h);let G=await Bun.file(D.filePath).text(),A=Zt(G),bt=A?.middleware?Array.isArray(A.middleware)?A.middleware:[A.middleware]:[],it=[...St,...bt];if(it.length>0){let j=It(h,M,A||{}),N=Ot(j,null,void 0,{isServer:!0}),F=await Nt(it,N);if(F.redirect){let I=typeof F.redirect==="string"?F.redirect:F.redirect.path||F.redirect,z=Qt(String(I),h),L=te(h,e);await R.promises.mkdir(m.dirname(L),{recursive:!0}),await Bun.write(L,z),u.successCount++,u.pages.push({route:h,outputPath:L,size:Buffer.byteLength(z),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${I}`);return}if(F.abort){let I=typeof F.abort==="string"?F.abort:F.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${I}`);return}}let st=A?.validate;if(typeof st==="function")try{if(!await st({params:M})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let B=null,at=!1;if(e.cache){if(B=O.get(h,D.filePath),B)at=!0,u.cachedCount++}if(!B){let j=await wt(D,M,xt,e,s);if(B=j.html,e.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
40
40
|
${j.includeFailures.join(`
|
|
41
41
|
`)}
|
|
42
42
|
Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&j.serverScriptFailures.length>0)throw Error(`${j.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
|
@@ -65,7 +65,7 @@ ${d}`)}if(e.cache)await O.save();if(e.generate404){let d=m.join(e.pagesDir,"404.
|
|
|
65
65
|
<a href="/">Go home</a>
|
|
66
66
|
</div>
|
|
67
67
|
</body>
|
|
68
|
-
</html>`)}for(let d of[500]){let y=m.join(e.pagesDir,`${d}.stx`);if(await Bun.file(y).exists()){let D=new Set,h={...s,minifyClient:!0,debug:!1,cache:!1},M=await i(await Bun.file(y).text(),{},y,h,D);await Bun.write(m.join(e.outputDir,`${d}.html`),M)}}let K=m.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,y={...s,minifyClient:!0,debug:!1,cache:!1},D=await i(await Bun.file(K).text(),{},K,y,d);await Bun.write(m.join(e.outputDir,"error.html"),D)}if(e.sitemap&&_.length>0){let d=Jt(_,e.domain),y=m.join(e.outputDir,"sitemap.xml");await Bun.write(y,d),u.sitemapPath=y,console.log(`Generated sitemap.xml with ${_.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},y=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],D=Os({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...y.length>0?{disallow:y}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(m.join(e.outputDir,"robots.txt"),D),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},y=[];if(d.getItems)y=await d.getItems();let D=Vt(d,y),h=m.join(e.outputDir,"rss.xml");await Bun.write(h,D),u.rssPath=h,console.log(`Generated rss.xml with ${y.length} items`)}let W=lc(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=uc(e.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&R.existsSync(e.publicDir))await
|
|
68
|
+
</html>`)}for(let d of[500]){let y=m.join(e.pagesDir,`${d}.stx`);if(await Bun.file(y).exists()){let D=new Set,h={...s,minifyClient:!0,debug:!1,cache:!1},M=await i(await Bun.file(y).text(),{},y,h,D);await Bun.write(m.join(e.outputDir,`${d}.html`),M)}}let K=m.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,y={...s,minifyClient:!0,debug:!1,cache:!1},D=await i(await Bun.file(K).text(),{},K,y,d);await Bun.write(m.join(e.outputDir,"error.html"),D)}if(e.sitemap&&_.length>0){let d=Jt(_,e.domain),y=m.join(e.outputDir,"sitemap.xml");await Bun.write(y,d),u.sitemapPath=y,console.log(`Generated sitemap.xml with ${_.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},y=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],D=Os({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...y.length>0?{disallow:y}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(m.join(e.outputDir,"robots.txt"),D),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},y=[];if(d.getItems)y=await d.getItems();let D=Vt(d,y),h=m.join(e.outputDir,"rss.xml");await Bun.write(h,D),u.rssPath=h,console.log(`Generated rss.xml with ${y.length} items`)}let W=lc(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=uc(e.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&R.existsSync(e.publicDir))await Z(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let rt=or();if(rt)await Z(rt,m.join(e.outputDir,sr)),console.log(`Copied assets from ${on}`)}catch(C){throw await e.hooks.onError?.(C),C}if(u.buildTime=Date.now()-n,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let C={generatedChunks:g.size,totalBytes:v,chunks:S,pages:p};await Bun.write(m.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(C,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
|
|
69
69
|
Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
70
70
|
Build complete!
|
|
71
71
|
Total: ${u.totalPages} pages
|
|
@@ -73,7 +73,7 @@ Build complete!
|
|
|
73
73
|
Cached: ${u.cachedCount}
|
|
74
74
|
Failed: ${u.failedCount}
|
|
75
75
|
Time: ${u.buildTime}ms${P}
|
|
76
|
-
`),u}async function
|
|
76
|
+
`),u}async function Z(t,n){await R.promises.mkdir(n,{recursive:!0});let s=await R.promises.readdir(t,{withFileTypes:!0});for(let o of s){let c=m.join(t,o.name),e=m.join(n,o.name);if(o.isDirectory())await R.promises.mkdir(e,{recursive:!0}),await Z(c,e);else await R.promises.copyFile(c,e)}}function Xt(t={}){let n=t.cacheDir||l(process.cwd(),"ssg-cache"),s=new ht(n),o=t.revalidate||3600;return{async get(c){let e=await s.get(c);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(c).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(c){let u=ee(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>c.match(P.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${c}`);return}let g=c.match(u.regex),v={};if(g)u.params.forEach((P,C)=>{v[P]=g[C+1]});let S=await a(),{html:p}=await wt(u,v,{},t,S);await s.set(c,{html:p,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:Wt(p)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Yt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},c=n;if(s){let S=s[1];c=n.slice(s[0].length).trim();for(let p of S.split(`
|
|
77
77
|
`)){let P=p.indexOf(":");if(P>0){let C=p.slice(0,P).trim(),b=p.slice(P+1).trim();if(b==="true")b=!0;else if(b==="false")b=!1;else if(/^\d+$/.test(b))b=parseInt(b,10);else if(/^\d+\.\d+$/.test(b))b=parseFloat(b);else if(b.startsWith("[")&&b.endsWith("]"))b=b.slice(1,-1).split(",").map((E)=>E.trim().replace(/^['"]|['"]$/g,""));o[C]=b}}}let e=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],g=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,v;while((v=g.exec(e))!==null){let S=parseInt(v[1],10),p=v[2],P=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:P,text:p,level:S})}return{content:e,data:o,toc:u}}}}function Zt(t){return kt(t)}function Qt(t,n){return`<!DOCTYPE html>
|
|
78
78
|
<html>
|
|
79
79
|
<head>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.872",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/clapp": "^0.2.17",
|
|
130
|
-
"@stacksjs/desktop": "0.2.
|
|
131
|
-
"@stacksjs/sanitizer": "0.2.
|
|
130
|
+
"@stacksjs/desktop": "0.2.872",
|
|
131
|
+
"@stacksjs/sanitizer": "0.2.872",
|
|
132
132
|
"@stacksjs/ts-css": "^0.3.21",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
134
|
"@types/dom-speech-recognition": "^0.0.12",
|
|
135
|
-
"bun-plugin-stx": "0.2.
|
|
135
|
+
"bun-plugin-stx": "0.2.872",
|
|
136
136
|
"bunfig": "^0.15.21",
|
|
137
|
-
"stx-router": "0.2.
|
|
137
|
+
"stx-router": "0.2.872",
|
|
138
138
|
"ts-broadcasting": "^0.0.13",
|
|
139
139
|
"ts-images": "^0.2.22",
|
|
140
140
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-04f6r2kh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ym,Aa,_u,Zm,Qm,eh,th,nh,Cu,Eu,rh,sh,oh,ih}from"./chunk-cwmfxbhz.js";import"./chunk-zfq2vvex.js";import"./chunk-pfr3cazq.js";import"./chunk-pdpmtmfj.js";import"./chunk-q1wxgw5s.js";import"./chunk-z8x86cr7.js";import"./chunk-khe30jmk.js";import"./chunk-wk188ph7.js";import"./chunk-hvx6j4a2.js";import"./chunk-sew1z7cv.js";import"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import"./chunk-nkwj7eq3.js";import"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{_u as SUSPENSE_RESOLVER_RUNTIME,Aa as buildSuspenseResolveScript,nh as createStreamRenderer,eh as extractStreamBoundaries,ih as generateHydrationRuntime,Eu as islandDirective,sh as processSectionDirectives,Qm as processStreamDirectives,rh as registerStreamingDirectives,Zm as renderStreamingPage,Ym as streamTemplate,th as streamTemplateSimple,oh as streamToResponse,Cu as streamingSuspenseDirective};
|
package/dist/chunk-0jchm9gg.js
DELETED
package/dist/chunk-5sbtbfj3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Wi,qi,Ki,Gg,Xg,Jg,Ll,Yg,Zg}from"./chunk-tjwzy9xq.js";export{Wi as ImageProcessorCache,Ll as applyTransformations,Gg as clearImageCache,Yg as generateResponsiveVariants,Zg as generateSrcset,qi as getCachedImageResult,Jg as optimizeImage,Xg as processImage,Ki as setCachedImageResult};
|
package/dist/chunk-79sr2kxg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{cr,i}from"./chunk-zfq2vvex.js";import"./chunk-pfr3cazq.js";import"./chunk-pdpmtmfj.js";import"./chunk-q1wxgw5s.js";import"./chunk-z8x86cr7.js";import"./chunk-khe30jmk.js";import"./chunk-wk188ph7.js";import"./chunk-hvx6j4a2.js";import"./chunk-sew1z7cv.js";import{_e}from"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import"./chunk-nkwj7eq3.js";import"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import{je,Gs,Xs}from"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{cr as buildModulesTag,_e as injectRouterScript,i as processDirectives,Gs as processJsonDirective,Xs as processOnceDirective,je as validateClientScript};
|
package/dist/chunk-8cf6995c.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{La,ja,Ba,Fa,Bh}from"./chunk-wb7s2cnb.js";import"./chunk-79y9amt1.js";import"./chunk-4t5t33yj.js";import"./chunk-5h9d6jew.js";import"./chunk-zfq2vvex.js";import"./chunk-pfr3cazq.js";import"./chunk-pdpmtmfj.js";import"./chunk-q1wxgw5s.js";import"./chunk-z8x86cr7.js";import"./chunk-khe30jmk.js";import"./chunk-wk188ph7.js";import"./chunk-hvx6j4a2.js";import"./chunk-sew1z7cv.js";import"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import"./chunk-nkwj7eq3.js";import"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{La as buildNative,Bh as default,ja as findCraftBinary,Fa as getAvailableFormats,Ba as getAvailableTargets};
|
package/dist/chunk-8cgn4re9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Eo,Eh,Th}from"./chunk-dg4zxpbq.js";import"./chunk-zf9n3esr.js";import"./chunk-mwxehpse.js";import"./chunk-9zrvh3pz.js";import"./chunk-sew1z7cv.js";import"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Th as clearComposableCache,Eh as getComposableScript,Eo as listComposableModules};
|
package/dist/chunk-94e6kmjm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{U,rg,ri,$c,a,M,iy,ay}from"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{M as config,U as defaultConfig,iy as defineStxConfig,ri as discoverConfig,a as loadStxConfig,$c as resolveInstalledPackage,rg as resolveStxDirectories,ay as validateConfig};
|
package/dist/chunk-aa6ztwdq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ya,mm,ba,hm,Yl,Zl,ym,bm}from"./chunk-9ffvh6cr.js";import"./chunk-dg4zxpbq.js";import"./chunk-zf9n3esr.js";import"./chunk-mwxehpse.js";import"./chunk-9zrvh3pz.js";import"./chunk-sew1z7cv.js";import"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import{lt,gg}from"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ya as buildScriptVirtualFile,mm as buildVirtualSource,lt as extractScriptBlocks,gg as extractTemplateExpressions,Yl as findRuntimeTypeDeclarations,Zl as findStxModuleDeclarations,bm as formatTypecheckDiagnostics,hm as sourcePathFor,ym as typecheckStxFiles,ba as virtualPathFor};
|
package/dist/chunk-bz1jgrx8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fl,zl}from"./chunk-swzxhkh2.js";import"./chunk-v37zmez0.js";import"./chunk-tv61s6fc.js";import"./chunk-81n2s24z.js";import"./chunk-gesktj4m.js";import"./chunk-nack2xs5.js";import"./chunk-d9k8j44b.js";import"./chunk-9ffvh6cr.js";import"./chunk-ca9x39p1.js";import"./chunk-7wae4311.js";import"./chunk-6ftee542.js";import"./chunk-vrcr4b13.js";import"./chunk-ew5cey88.js";import"./chunk-3v7xht2q.js";import"./chunk-k7m8659h.js";import"./chunk-ysfeg3cn.js";import"./chunk-01mwbg1r.js";import"./chunk-55zq2ha8.js";import"./chunk-hev4t4d5.js";import"./chunk-1mqcttg3.js";import"./chunk-7d6jq5j8.js";import"./chunk-cwmfxbhz.js";import"./chunk-qcxrcypb.js";import"./chunk-gbtbfg7e.js";import"./chunk-cqhwzd9y.js";import"./chunk-j1efsjsb.js";import"./chunk-rt55f47q.js";import"./chunk-dg4zxpbq.js";import"./chunk-mnx6njd4.js";import"./chunk-4t5t33yj.js";import"./chunk-5h9d6jew.js";import"./chunk-v4xes880.js";import{an}from"./chunk-12sk3dtm.js";import{Ff}from"./chunk-zf9n3esr.js";import"./chunk-mwxehpse.js";import"./chunk-9zrvh3pz.js";import{Ne,i}from"./chunk-zfq2vvex.js";import"./chunk-pfr3cazq.js";import"./chunk-pdpmtmfj.js";import"./chunk-q1wxgw5s.js";import"./chunk-z8x86cr7.js";import"./chunk-khe30jmk.js";import"./chunk-wk188ph7.js";import"./chunk-hvx6j4a2.js";import"./chunk-sew1z7cv.js";import{_e}from"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import{hr,yr}from"./chunk-nkwj7eq3.js";import{$s,U,a}from"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import{L,h,He}from"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";import{Ui}from"./chunk-fd1bpv35.js";import"./chunk-tjwzy9xq.js";import"./chunk-3f51tn2b.js";export{$s as buildWebComponents,yr as cacheTemplate,hr as checkCache,an as classifyAllScripts,Fl as createMiddleware,zl as createRoute,U as defaultConfig,h as extractVariables,L as findSfcTemplateBlock,_e as injectRouterScript,Ui as insertBeforeBodyClose,a as loadStxConfig,He as processClientScript,i as processDirectives,Ne as readMarkdownFile,Ff as withinBundlerCallback};
|
package/dist/chunk-eh1rdapx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ra,vu,Kn,Xm,xu,Su,ku,Jm}from"./chunk-7d6jq5j8.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Kn as Validator,vu as defineForm,xu as processErrorDirective,Su as processErrorsDirective,Jm as processFormValidationDirectives,ku as processHasErrorsDirective,Ra as useForm,Xm as v};
|
package/dist/chunk-hb6r4pxp.js
DELETED
package/dist/chunk-jksjr12b.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{qh,Gf,tt,wc,Kh,gs,ms,hs}from"./chunk-pdpmtmfj.js";import"./chunk-z8x86cr7.js";import"./chunk-khe30jmk.js";import"./chunk-hvx6j4a2.js";import"./chunk-311mrz2n.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Kh as clearOnceStore,wc as onceStore,tt as partialsCache,gs as processIncludes,ms as processStackPushDirectives,hs as processStackReplacements,qh as resetUnscopedSignalWarnings,Gf as topLevelElements};
|
package/dist/chunk-khe30jmk.js
DELETED
package/dist/chunk-ndrgek64.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ws,Jf,Ko,Yf}from"./chunk-wk188ph7.js";import"./chunk-hvx6j4a2.js";import"./chunk-sew1z7cv.js";import"./chunk-q58f5wk2.js";import"./chunk-311mrz2n.js";import"./chunk-y0msz738.js";import"./chunk-sb3dx4dd.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-sbvkk4cn.js";import"./chunk-dy7vqv1x.js";import{jt}from"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Yf as declareBareLoopHead,jt as parseLoopBinding,Jf as processLoops,Ko as processLoopsAsync,ws as reportDeferredLoopWarnings};
|
package/dist/chunk-nxecjev1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tu,Im,nu,ru,Om,Nm}from"./chunk-3v7xht2q.js";import"./chunk-hze3158c.js";import"./chunk-w1rrfj39.js";import"./chunk-60yppcbb.js";import"./chunk-0tyyad6q.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Nm as applySlots,Om as extractSlotContent,Im as parseSlotElement,tu as parseSlots,ru as processSlots,nu as renderSlot};
|
package/dist/chunk-ps6m8n9n.js
DELETED
package/dist/chunk-pxce4aag.js
DELETED