@stacksjs/stx 0.2.468 → 0.2.470
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-0q8xacmn.js +2 -0
- package/dist/{chunk-zkg0rbmp.js → chunk-168dqya1.js} +3 -3
- package/dist/{chunk-9kzk7zyy.js → chunk-250psr2a.js} +1 -1
- package/dist/chunk-2a22ep8p.js +2 -0
- package/dist/{chunk-151d1av1.js → chunk-2qz5gqqe.js} +7 -7
- package/dist/{chunk-gxbd7pwn.js → chunk-3c6v9hp1.js} +1 -1
- package/dist/{chunk-hhy33p5v.js → chunk-3jjevm1j.js} +6 -6
- package/dist/{chunk-n8y0hp9b.js → chunk-3q9hhpvz.js} +1 -1
- package/dist/chunk-4waxn99v.js +2 -0
- package/dist/{chunk-bqx3dqv1.js → chunk-564pmmj3.js} +1 -1
- package/dist/{chunk-8adstrk5.js → chunk-594tt40e.js} +2 -2
- package/dist/{chunk-cxbp2m66.js → chunk-5rx7ptse.js} +2 -2
- package/dist/chunk-695de40v.js +2 -0
- package/dist/chunk-6a1g18h4.js +2 -0
- package/dist/{chunk-s23ka56m.js → chunk-6sken7b2.js} +1 -1
- package/dist/{chunk-gkj42zq7.js → chunk-6vstn9dk.js} +1 -1
- package/dist/{chunk-tdsajnjm.js → chunk-71ttf2ne.js} +1 -1
- package/dist/{chunk-g1562mcs.js → chunk-8v24kvjk.js} +1 -1
- package/dist/chunk-94d2t16y.js +2 -0
- package/dist/{chunk-cjb46akr.js → chunk-98gxw97n.js} +1 -1
- package/dist/{chunk-27kb6nrb.js → chunk-9kb3my0w.js} +2 -2
- package/dist/{chunk-ggde5cqk.js → chunk-9pjy59d6.js} +65 -65
- package/dist/{chunk-9rpw3gqx.js → chunk-9q3dbv0w.js} +1 -1
- package/dist/{chunk-81nqrcn0.js → chunk-a6amx427.js} +1 -1
- package/dist/{chunk-t7s0pdtw.js → chunk-aw4jxj6a.js} +2 -2
- package/dist/chunk-b5mfa6w6.js +2 -0
- package/dist/chunk-bprn7crb.js +2 -0
- package/dist/{chunk-mqdnfn4h.js → chunk-cxgr65kt.js} +1 -1
- package/dist/{chunk-5rvbpmzc.js → chunk-cxkyt6ht.js} +1 -1
- package/dist/{chunk-m8w4hve0.js → chunk-dj3b04tn.js} +1 -1
- package/dist/chunk-ds6eqyq2.js +2 -0
- package/dist/chunk-dy0gm4e4.js +2 -0
- package/dist/chunk-e8ewjcmj.js +2 -0
- package/dist/{chunk-g4dmjede.js → chunk-f64rmdvt.js} +2 -2
- package/dist/chunk-fkgdbdqa.js +2 -0
- package/dist/chunk-g9dh9yat.js +2 -0
- package/dist/chunk-gg4hrjrf.js +2 -0
- package/dist/chunk-gna3h2yv.js +2 -0
- package/dist/{chunk-tbef3yyk.js → chunk-gskjzw5r.js} +3 -3
- package/dist/chunk-gyfb3rj5.js +2 -0
- package/dist/chunk-gzk5ak8f.js +2 -0
- package/dist/{chunk-xnjcmhs5.js → chunk-hjhz90kg.js} +2 -2
- package/dist/{chunk-t794av8e.js → chunk-hvmtpe7w.js} +1 -1
- package/dist/chunk-j04s01mf.js +2 -0
- package/dist/{chunk-a6s6hvcd.js → chunk-j3z1bfjt.js} +1 -1
- package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
- package/dist/chunk-kyda9myt.js +2 -0
- package/dist/chunk-m4sd2ker.js +2 -0
- package/dist/chunk-mhjndjjb.js +2 -0
- package/dist/{chunk-8h8pf1cj.js → chunk-mn6gcvk9.js} +4 -4
- package/dist/{chunk-x0mc2kv0.js → chunk-mx446wgp.js} +12 -4
- package/dist/{chunk-cwzkq9bs.js → chunk-nma8b17c.js} +71 -16
- package/dist/chunk-nrjevcyh.js +2 -0
- package/dist/chunk-pq9978k5.js +2 -0
- package/dist/{chunk-28s5x7wv.js → chunk-pz537q62.js} +2 -2
- package/dist/{chunk-2542vq5p.js → chunk-qf7da9f6.js} +1 -1
- package/dist/chunk-r0gx4p2m.js +2 -0
- package/dist/{chunk-jjebxeee.js → chunk-r7m8dh2g.js} +5 -5
- package/dist/{chunk-cnxf8e5p.js → chunk-rdn3egy7.js} +1 -1
- package/dist/chunk-rskf20cw.js +2 -0
- package/dist/{chunk-dts9z53c.js → chunk-rvzx5s72.js} +1 -1
- package/dist/{chunk-99kt56fn.js → chunk-scvzv5y2.js} +2 -2
- package/dist/chunk-sz2cf4w6.js +2 -0
- package/dist/{chunk-07mksefx.js → chunk-tydxqfs6.js} +1 -1
- package/dist/chunk-vbbrtrcg.js +2 -0
- package/dist/chunk-vc24bahj.js +2 -0
- package/dist/chunk-vkgsj6k0.js +2 -0
- package/dist/{chunk-a0jyh65n.js → chunk-wc6k446y.js} +3 -3
- package/dist/{chunk-2swdrsrq.js → chunk-wzeq29c1.js} +2 -2
- package/dist/{chunk-8xcg2dqy.js → chunk-xc27xdm6.js} +1 -1
- package/dist/{chunk-ss7wapbh.js → chunk-xts31rkc.js} +199 -199
- package/dist/{chunk-ykqq6cw0.js → chunk-y42ge4xh.js} +20 -20
- package/dist/chunk-y51pb1tc.js +2 -0
- package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
- package/dist/{chunk-s10r6hxp.js → chunk-yd7g02v5.js} +7 -7
- package/dist/chunk-yn2d8x8m.js +3 -0
- package/dist/{chunk-c9fj7t9b.js → chunk-yv00fy8z.js} +1 -1
- package/dist/cli.js +43 -43
- package/dist/color-mode-boot.js +1 -1
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/ts-css.js +18 -2
- package/dist/pwa.js +3 -3
- package/dist/signals.js +69 -14
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-129ernx4.js +0 -2
- package/dist/chunk-2njt4vbe.js +0 -2
- package/dist/chunk-3w22gpa9.js +0 -2
- package/dist/chunk-3ztpcnga.js +0 -2
- package/dist/chunk-4aw47rmg.js +0 -2
- package/dist/chunk-549wm9qp.js +0 -2
- package/dist/chunk-5jak1hxp.js +0 -2
- package/dist/chunk-7ppykfx2.js +0 -2
- package/dist/chunk-82nw3942.js +0 -2
- package/dist/chunk-8h2adg8c.js +0 -2
- package/dist/chunk-9h1kq4hv.js +0 -2
- package/dist/chunk-awsg50kd.js +0 -2
- package/dist/chunk-ax1xbz1k.js +0 -2
- package/dist/chunk-cg8hg6cs.js +0 -3
- package/dist/chunk-g3xgcnh4.js +0 -2
- package/dist/chunk-j338fs8k.js +0 -2
- package/dist/chunk-kyd15xqj.js +0 -2
- package/dist/chunk-m5asyydz.js +0 -2
- package/dist/chunk-m5dgc757.js +0 -2
- package/dist/chunk-m6cfxjyy.js +0 -2
- package/dist/chunk-mmh37ywa.js +0 -2
- package/dist/chunk-nskfyvbv.js +0 -2
- package/dist/chunk-q0w6a9hv.js +0 -2
- package/dist/chunk-q9yhnqe5.js +0 -2
- package/dist/chunk-rkzvmk04.js +0 -2
- package/dist/chunk-rx6a75yf.js +0 -2
- package/dist/chunk-se4b8sjc.js +0 -2
- package/dist/chunk-t4rgn046.js +0 -2
- package/dist/chunk-tr3e1qzf.js +0 -2
- package/dist/chunk-vr4t7exr.js +0 -2
- package/dist/chunk-zb5p05v4.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{To}from"./chunk-
|
|
2
|
+
import{To}from"./chunk-r7m8dh2g.js";import{d}from"./chunk-yn2d8x8m.js";var dd=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -931,7 +931,7 @@ else if (data.type === 'event' && data.method) {
|
|
|
931
931
|
}
|
|
932
932
|
})();
|
|
933
933
|
</script>
|
|
934
|
-
`.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${a}`)}function
|
|
934
|
+
`.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${a}`)}function ud(){return!1}function pd(e,r={}){let a=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(a,(i,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return wo(t)})}function vo(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let a=wo(r);if(e.includes("</head>"))return e.replace("</head>",`${a}
|
|
935
935
|
</head>`);if(e.includes("<body"))return e.replace(/(<body[^>]*>)/,`$1
|
|
936
936
|
${a}`);return a+e}var Br={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,r)=>{let a=e.checked?"checked":"",i=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
937
937
|
<input type="checkbox" class="craft-checkbox" ${a} ${i}>
|
|
@@ -1365,7 +1365,7 @@ ${a}`);return a+e}var Br={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
</style>
|
|
1368
|
-
`,
|
|
1368
|
+
`,fd=`
|
|
1369
1369
|
<script id="craft-component-runtime">
|
|
1370
1370
|
(function() {
|
|
1371
1371
|
if (window.__stxCraftComponentRuntime) return;
|
|
@@ -2934,17 +2934,17 @@ ${a}`);return a+e}var Br={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
2934
2934
|
document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
|
|
2935
2935
|
})();
|
|
2936
2936
|
</script>
|
|
2937
|
-
`;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),r,a)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),r,a)),e}function R(e,r,a,i,s){let t=i.components?.[e]||Br[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${a}</div>`;let n=A(r),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,a);let
|
|
2937
|
+
`;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),r,a)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",r,a)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),r,a)),e}function R(e,r,a,i,s){let t=i.components?.[e]||Br[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${a}</div>`;let n=A(r),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,a);let l=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${l}>`;return`<${t.fallbackTag} ${l}>${a}</${t.fallbackTag}>`}function A(e){let r={},a=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,i;while((i=a.exec(e))!==null){let[s,t,n,c]=i,l=n??c;if(s.startsWith(":"))r[t]=l;else if(s.startsWith("@"))r[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=l;else if(l===void 0)r[t]=!0;else r[t]=l}return r}function j(e,r){let a=I(String(e.id||`craft-sidebar-${K(r||JSON.stringify(e))}`)),i=Q(e.spaces)||Y(r),s=i.length?[]:X(e.sections)||F(r),t=String(e.selectedSpace||i[0]?.id||""),n=i.find((g)=>g.id===t)||i[0],c=String(e.selectedItem||e.selected||(i.length?n?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),l={id:a,variant:String(e.variant||"desktop"),material:String(e.material||"sidebar"),backgroundEffect:String(e.backgroundEffect||"shimmer"),allowsVibrancy:e.allowsVibrancy!==!1&&e.allowsVibrancy!=="false",materialOpacity:Number(e.materialOpacity??0.68),materialDarkOpacity:e.materialDarkOpacity===void 0?void 0:Number(e.materialDarkOpacity),minWidth:e.minWidth===void 0?240:Number(e.minWidth),maxWidth:e.maxWidth===void 0?340:Number(e.maxWidth),canCollapse:e.canCollapse!==!1&&e.canCollapse!=="false",searchPlaceholder:e.searchPlaceholder?String(e.searchPlaceholder):void 0,selectedItem:c,sections:s,spaces:i,selectedSpace:t||void 0},f=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),p=Number(e.width||e.sidebarWidth||286),u=e.native===!1||e.native==="false"?"false":"true",x=l.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(l.searchPlaceholder)}"></div>`:"",b;if(i.length)b=G(i,t,c);else if(s.length)b=s.map((g)=>D(g,c)).join("");else b=r;return`<aside class="${h(f)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(a)}" data-native="${u}" style="--craft-sidebar-width:${p}px">
|
|
2938
2938
|
${x}
|
|
2939
2939
|
${b}
|
|
2940
2940
|
</aside>
|
|
2941
|
-
<script type="application/json" data-craft-sidebar-config="${h(a)}">${Z(
|
|
2941
|
+
<script type="application/json" data-craft-sidebar-config="${h(a)}">${Z(l)}</script>`}function H(e,r){let a=I(String(e.id||e.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${h(a)}">
|
|
2942
2942
|
${e.label?`<div class="craft-sidebar-space-title">${C(String(e.label))}</div>`:""}
|
|
2943
2943
|
${r}
|
|
2944
2944
|
</section>`}function V(e,r){let a=String(e.header||e.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${h(String(e.id||"section"))}">
|
|
2945
2945
|
${a?`<div class="craft-sidebar-section-title">${C(a)}</div>`:""}
|
|
2946
2946
|
${r}
|
|
2947
|
-
</section>`}function W(e,r){let a={id:String(e.id||I(String(e.label||r||"item"))),label:String(e.label||r||""),icon:e.icon?String(e.icon):void 0,badge:e.badge?String(e.badge):void 0,tintColor:e.tintColor?String(e.tintColor):void 0};return O(a,String(e.selected||"")==="true")}function F(e){let r=[],a=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.id||I(String(s.header||s.title||`section-${r.length+1}`))),c=String(s.header||s.title||n),
|
|
2947
|
+
</section>`}function W(e,r){let a={id:String(e.id||I(String(e.label||r||"item"))),label:String(e.label||r||""),icon:e.icon?String(e.icon):void 0,badge:e.badge?String(e.badge):void 0,tintColor:e.tintColor?String(e.tintColor):void 0};return O(a,String(e.selected||"")==="true")}function F(e){let r=[],a=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.id||I(String(s.header||s.title||`section-${r.length+1}`))),c=String(s.header||s.title||n),l=J(t);r.push({id:n,header:c,title:c,items:l})}return r}function J(e){let r=[],a=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=String(s.label||(i[2]||"").replace(/<[^>]*>/g,"").trim()),n=String(s.id||I(t||`item-${r.length+1}`));r.push({id:n,label:t,icon:s.icon?String(s.icon):void 0,badge:s.badge?String(s.badge):void 0,tintColor:s.tintColor?String(s.tintColor):void 0})}return r}function Y(e){let r=[],a=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,i;while((i=a.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.label||s.title||`Space ${r.length+1}`);r.push({id:String(s.id||I(n)),label:n,icon:s.icon?String(s.icon):void 0,tint:s.tint?String(s.tint):void 0,sections:F(t)})}return r}function Q(e){if(!e)return;if(Array.isArray(e))return e;if(typeof e!=="string")return;try{let r=JSON.parse(e);return Array.isArray(r)?r:void 0}catch{return}}function G(e,r,a){let i=e.map((t)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${h(t.id)}" data-selected="${t.id===r?"true":"false"}" title="${h(t.label||t.id)}">${t.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(t.icon)}"></span>`:C((t.label||t.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${e.map((t)=>`<section class="craft-sidebar-space" data-space-id="${h(t.id)}" data-selected="${t.id===r?"true":"false"}">
|
|
2948
2948
|
${t.label?`<div class="craft-sidebar-space-title">${C(t.label)}</div>`:""}
|
|
2949
2949
|
${t.sections.map((n)=>D(n,a)).join("")}
|
|
2950
2950
|
</section>`).join("")}</div>
|
|
@@ -2955,16 +2955,16 @@ ${a}`);return a+e}var Br={button:{nativeType:"craft-button",fallbackTag:"button"
|
|
|
2955
2955
|
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(e.icon)}"${a}></span>`:""}
|
|
2956
2956
|
<span class="craft-sidebar-item-label">${C(e.label)}</span>
|
|
2957
2957
|
${e.badge?`<span class="craft-sidebar-item-badge">${C(e.badge)}</span>`:""}
|
|
2958
|
-
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let r=5381;for(let a=0;a<e.length;a++)r=r*33^e.charCodeAt(a);return(r>>>0).toString(36)}function C(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return C(e).replace(/`/g,"`")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,r,a){let i=[];i.push(`class="${a.join(" ")}"`),i.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,""");i.push(`${s}="${n}"`)}return i.join(" ")}function
|
|
2959
|
-
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",
|
|
2958
|
+
</button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let r=5381;for(let a=0;a<e.length;a++)r=r*33^e.charCodeAt(a);return(r>>>0).toString(36)}function C(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return C(e).replace(/`/g,"`")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,r,a){let i=[];i.push(`class="${a.join(" ")}"`),i.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,""");i.push(`${s}="${n}"`)}return i.join(" ")}function gd(e,r){Br[e]=r}function md(){return{...Br}}import{existsSync as z,mkdirSync as v,copyFileSync as k,chmodSync as T}from"fs";import{join as o,basename as te}from"path";import{spawn as E,execSync as re}from"child_process";import{tmpdir as M,homedir as q,platform as ae}from"os";async function ko(e){let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||P(),format:e.format||"app",error:`Input file not found: ${e.input}`};let a=e.target||P(),i=e.format||ue(a),s=e.output||o(process.cwd(),"dist","native");if(!z(s))v(s,{recursive:!0});let t=await To(e.input,{context:e.context,options:{isDev:!1}});if(t=vo(t,{debug:e.verbose}),t=So(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${xo}
|
|
2959
|
+
</head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",l=e.craftPath||await fe();if(!l)return{success:!1,target:a,format:i,error:"Craft binary not found. Please install Craft or specify craftPath."};if(e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${a}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${l}`);let f;switch(a){case"macos":f=await ie(t,n,c,s,i,e,l);break;case"windows":f=await oe(t,n,c,s,i,e,l);break;case"linux":f=await ce(t,n,c,s,i,e,l);break;case"ios":f=await de(t,n,c,s,e,l);break;case"android":f=await le(t,n,c,s,e,l);break;default:f={success:!1,target:a,format:i,error:`Unsupported target: ${a}`}}return f.duration=Date.now()-r,f}catch(a){return{success:!1,target:e.target||P(),format:e.format||"app",error:a.message,duration:Date.now()-r}}}async function ie(e,r,a,i,s,t,n){let c=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,l=o(i,`${r}.app`),f=o(l,"Contents"),p=o(f,"MacOS"),u=o(f,"Resources");v(p,{recursive:!0}),v(u,{recursive:!0});let x=o(u,"index.html");await Bun.write(x,e);let b="";if(t.sidebar?.enabled&&t.sidebar?.config)b=o(u,"sidebar-config.json"),await Bun.write(b,JSON.stringify(t.sidebar.config));let g=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",m=t.menubarOnly??t.systemTray;if((t.bundleStyle||(await se(n)?"executable":"launcher"))==="executable"){let S=o(p,r);k(n,S),T(S,493);let w={html:"index.html",title:t.window?.title||r,width:t.window?.width||1200,height:t.window?.height||800,devTools:Boolean(t.devTools)};if(m)w.menubarOnly=!0;else if(t.systemTray)w.systemTray=!0;if(t.window?.frameless)w.frameless=!0;if(t.window?.transparent)w.transparent=!0;if(t.window?.alwaysOnTop)w.alwaysOnTop=!0;if(t.window?.resizable===!1)w.resizable=!1;await Bun.write(o(u,"craft.json"),`${JSON.stringify(w,null,2)}
|
|
2960
2960
|
`)}else{let S=o(p,"craft");k(n,S),T(S,493);let w=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",U=`#!/bin/bash
|
|
2961
2961
|
set -euo pipefail
|
|
2962
2962
|
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
2963
2963
|
RESOURCES="$DIR/../Resources"
|
|
2964
2964
|
exec "$DIR/craft" --html-file "$RESOURCES/index.html" \\
|
|
2965
2965
|
${[`--title "${t.window?.title||r}"`,`--width ${t.window?.width||1200}`,`--height ${t.window?.height||800}`,m?"--menubar-only":t.systemTray?"--system-tray":"",t.devTools?"":"--no-devtools",t.window?.frameless?"--frameless":"",t.window?.transparent?"--transparent":"",t.window?.alwaysOnTop?"--always-on-top":"",t.window?.resizable===!1?"--no-resize":"",w].filter(Boolean).join(" \\\n ")}
|
|
2966
|
-
`,N=o(p,r);await Bun.write(N,U),T(N,493)}let B=Boolean(t.icon&&await Bun.file(t.icon).exists());if(B)k(t.icon,o(
|
|
2967
|
-
${i}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;let[n,c,
|
|
2966
|
+
`,N=o(p,r);await Bun.write(N,U),T(N,493)}let B=Boolean(t.icon&&await Bun.file(t.icon).exists());if(B)k(t.icon,o(u,"AppIcon.icns"));let L={CFBundleExecutable:r,CFBundleIdentifier:c,CFBundleName:r,CFBundleDisplayName:r,CFBundleShortVersionString:a,CFBundleVersion:a,CFBundlePackageType:"APPL",CFBundleSignature:"????",LSMinimumSystemVersion:t.minimumSystemVersion||"13.0",NSHighResolutionCapable:!0,NSSupportsAutomaticGraphicsSwitching:!0,LSUIElement:t.menubarOnly??Boolean(t.systemTray),...B?{CFBundleIconFile:"AppIcon"}:{},...t.category?{LSApplicationCategoryType:t.category}:{},...t.copyright?{NSHumanReadableCopyright:t.copyright}:{},...t.infoPlist||{}};if(await Bun.write(o(f,"Info.plist"),ne(L)),s==="dmg"){let S=o(i,`${r}-${a}.dmg`),w=await pe(l,S,r);if(!w.success)return{success:!1,target:"macos",format:"dmg",error:w.error};return{success:!0,target:"macos",format:"dmg",outputPath:S}}return{success:!0,target:"macos",format:"app",outputPath:l}}async function se(e){try{let r=Bun.spawn([e,"--version"],{stdout:"pipe",stderr:"pipe"}),[a,i]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]);await r.exited;let t=`${a}
|
|
2967
|
+
${i}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;let[n,c,l]=t.slice(1).map(Number);if(n>0||c>0)return!0;return l>=57}catch{return!1}}function _(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ne(e){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2968
2968
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
2969
2969
|
<plist version="1.0">
|
|
2970
2970
|
<dict>
|
|
@@ -2973,7 +2973,7 @@ ${Object.entries(e).map(([a,i])=>{let s=typeof i==="boolean"?`<${i}/>`:typeof i=
|
|
|
2973
2973
|
`)}
|
|
2974
2974
|
</dict>
|
|
2975
2975
|
</plist>
|
|
2976
|
-
`}async function oe(e,r,a,i,s,t,n){let c=o(i,r);v(c,{recursive:!0});let
|
|
2976
|
+
`}async function oe(e,r,a,i,s,t,n){let c=o(i,r);v(c,{recursive:!0});let l=o(c,"index.html");await Bun.write(l,e),k(n,o(c,"craft.exe"));let f=`@echo off
|
|
2977
2977
|
set DIR=%~dp0
|
|
2978
2978
|
"%DIR%craft.exe" --html-file "%DIR%index.html" ^
|
|
2979
2979
|
--title "${t.window?.title||r}" ^
|
|
@@ -2981,7 +2981,7 @@ set DIR=%~dp0
|
|
|
2981
2981
|
--height ${t.window?.height||800} ^
|
|
2982
2982
|
${t.systemTray?"--system-tray":""} ^
|
|
2983
2983
|
${t.devTools?"":"--no-devtools"}
|
|
2984
|
-
`;if(await Bun.write(o(c,`${r}.bat`),
|
|
2984
|
+
`;if(await Bun.write(o(c,`${r}.bat`),f),s==="zip"){let p=o(i,`${r}-${a}-windows.zip`),u=await be(c,p);if(!u.success)return{success:!1,target:"windows",format:"zip",error:u.error};return{success:!0,target:"windows",format:"zip",outputPath:p}}return{success:!0,target:"windows",format:"app",outputPath:c}}async function ce(e,r,a,i,s,t,n){let c=o(i,r);v(c,{recursive:!0});let l=o(c,"index.html");await Bun.write(l,e);let f=o(c,"craft");k(n,f),T(f,493);let p=`#!/bin/bash
|
|
2985
2985
|
set -euo pipefail
|
|
2986
2986
|
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
2987
2987
|
exec "$DIR/craft" --html-file "$DIR/index.html" \\
|
|
@@ -2990,15 +2990,15 @@ exec "$DIR/craft" --html-file "$DIR/index.html" \\
|
|
|
2990
2990
|
--height ${t.window?.height||800} \\
|
|
2991
2991
|
${t.systemTray?"--system-tray":""} \\
|
|
2992
2992
|
${t.devTools?"":"--no-devtools"}
|
|
2993
|
-
`,
|
|
2993
|
+
`,u=o(c,r.toLowerCase());await Bun.write(u,p),T(u,493);let x=`[Desktop Entry]
|
|
2994
2994
|
Type=Application
|
|
2995
2995
|
Name=${r}
|
|
2996
|
-
Exec=${
|
|
2996
|
+
Exec=${u}
|
|
2997
2997
|
Terminal=false
|
|
2998
2998
|
Categories=Utility;
|
|
2999
2999
|
`;if(await Bun.write(o(c,`${r.toLowerCase()}.desktop`),x),s==="deb"){let b=o(i,`${r.toLowerCase()}_${a}_amd64.deb`),g=await ge(c,b,r,a,t);if(!g.success)return{success:!1,target:"linux",format:"deb",error:g.error};return{success:!0,target:"linux",format:"deb",outputPath:b}}if(s==="appimage"){let b=o(i,`${r}-${a}-x86_64.AppImage`),g=await me(c,b,r,t);if(!g.success)return{success:!1,target:"linux",format:"appimage",error:g.error};return{success:!0,target:"linux",format:"appimage",outputPath:b}}return{success:!0,target:"linux",format:"app",outputPath:c}}async function de(e,r,a,i,s,t){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${r}' to create an iOS project.`}}async function le(e,r,a,i,s,t){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${r}' to create an Android project.`}}async function fe(){if(process.env.CRAFT_BIN&&await Bun.file(process.env.CRAFT_BIN).exists())return process.env.CRAFT_BIN;let e=[o(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft"),o(process.cwd(),"../craft/packages/zig/zig-out/bin/craft"),o(q(),"Code/Tools/craft/packages/zig/zig-out/bin/craft"),o(q(),"Code/craft/packages/zig/zig-out/bin/craft"),"/usr/local/bin/craft","/usr/bin/craft",o(q(),".local/bin/craft"),o(process.env.LOCALAPPDATA||"","craft","craft.exe"),o(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let r of e)if(await Bun.file(r).exists())return r;try{let a=re("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
|
|
3000
|
-
`)[0];if(a&&await Bun.file(a).exists())return a}catch{}return null}function P(){switch(ae()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function ue(e){switch(e){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function pe(e,r,a){return new Promise((i)=>{let s=E("hdiutil",["create","-volname",a,"-srcfolder",e,"-ov","-format","UDZO",r]);s.on("close",(t)=>{if(t===0)i({success:!0});else i({success:!1,error:`hdiutil exited with code ${t}`})}),s.on("error",(t)=>{i({success:!1,error:t.message})})})}async function be(e,r){return new Promise((a)=>{let i=E("zip",["-r",r,"."],{cwd:e});i.on("close",(s)=>{if(s===0)a({success:!0});else a({success:!1,error:`zip exited with code ${s}`})}),i.on("error",(s)=>{a({success:!1,error:s.message})})})}async function ge(e,r,a,i,s){return new Promise((t)=>{try{let n=o(M(),`stx-deb-${Date.now()}`),c=o(n,"DEBIAN"),
|
|
3001
|
-
exec /usr/share/${a.toLowerCase()}/${a.toLowerCase()} "$@"`;
|
|
3000
|
+
`)[0];if(a&&await Bun.file(a).exists())return a}catch{}return null}function P(){switch(ae()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function ue(e){switch(e){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function pe(e,r,a){return new Promise((i)=>{let s=E("hdiutil",["create","-volname",a,"-srcfolder",e,"-ov","-format","UDZO",r]);s.on("close",(t)=>{if(t===0)i({success:!0});else i({success:!1,error:`hdiutil exited with code ${t}`})}),s.on("error",(t)=>{i({success:!1,error:t.message})})})}async function be(e,r){return new Promise((a)=>{let i=E("zip",["-r",r,"."],{cwd:e});i.on("close",(s)=>{if(s===0)a({success:!0});else a({success:!1,error:`zip exited with code ${s}`})}),i.on("error",(s)=>{a({success:!1,error:s.message})})})}async function ge(e,r,a,i,s){return new Promise((t)=>{try{let n=o(M(),`stx-deb-${Date.now()}`),c=o(n,"DEBIAN"),l=o(n,"usr","bin"),f=o(n,"usr","share","applications"),p=o(n,"usr","share",a.toLowerCase());v(c,{recursive:!0}),v(l,{recursive:!0}),v(f,{recursive:!0}),v(p,{recursive:!0});let u=d("fs").readdirSync(e);for(let m of u)k(o(e,m),o(p,m));let x=`#!/bin/bash
|
|
3001
|
+
exec /usr/share/${a.toLowerCase()}/${a.toLowerCase()} "$@"`;d("fs").writeFileSync(o(l,a.toLowerCase()),x),T(o(l,a.toLowerCase()),493);let b=`Package: ${a.toLowerCase()}
|
|
3002
3002
|
Version: ${i}
|
|
3003
3003
|
Section: utils
|
|
3004
3004
|
Priority: optional
|
|
@@ -3006,17 +3006,17 @@ Architecture: amd64
|
|
|
3006
3006
|
Depends: libgtk-3-0, libwebkit2gtk-4.0-37
|
|
3007
3007
|
Maintainer: ${s.author||"Unknown"}
|
|
3008
3008
|
Description: ${s.description||a}
|
|
3009
|
-
`;
|
|
3009
|
+
`;d("fs").writeFileSync(o(c,"control"),b);let g=E("dpkg-deb",["--build",n,r]);g.on("close",(m)=>{if(d("fs").rmSync(n,{recursive:!0,force:!0}),m===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${m}`})}),g.on("error",(m)=>{d("fs").rmSync(n,{recursive:!0,force:!0}),t({success:!1,error:m.message})})}catch(n){t({success:!1,error:n.message})}})}async function me(e,r,a,i){return new Promise((s)=>{try{let t=o(M(),`stx-appimage-${Date.now()}`),n=o(t,`${a}.AppDir`),c=o(n,"usr"),l=o(c,"bin"),f=o(c,"share");v(l,{recursive:!0}),v(f,{recursive:!0});let p=o(f,a.toLowerCase());v(p,{recursive:!0});let u=d("fs").readdirSync(e);for(let y of u)k(o(e,y),o(p,y));let x=`#!/bin/bash
|
|
3010
3010
|
SELF=$(readlink -f "$0")
|
|
3011
3011
|
HERE=\${SELF%/*}
|
|
3012
3012
|
export PATH="\${HERE}/usr/bin:\${PATH}"
|
|
3013
3013
|
exec "\${HERE}/usr/share/${a.toLowerCase()}/${a.toLowerCase()}" "$@"
|
|
3014
|
-
`;
|
|
3014
|
+
`;d("fs").writeFileSync(o(n,"AppRun"),x),T(o(n,"AppRun"),493);let b=`[Desktop Entry]
|
|
3015
3015
|
Type=Application
|
|
3016
3016
|
Name=${a}
|
|
3017
3017
|
Exec=${a.toLowerCase()}
|
|
3018
3018
|
Terminal=false
|
|
3019
3019
|
Categories=Utility;
|
|
3020
3020
|
Icon=${a.toLowerCase()}
|
|
3021
|
-
`;
|
|
3022
|
-
export{
|
|
3021
|
+
`;d("fs").writeFileSync(o(n,`${a.toLowerCase()}.desktop`),b);let g=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(d("fs").writeFileSync(o(n,`${a.toLowerCase()}.png`),g),i.icon&&z(i.icon))k(i.icon,o(n,`${a.toLowerCase()}.png`));let m=E("appimagetool",[n,r],{env:{...process.env,ARCH:"x86_64"}});m.on("close",(y)=>{if(d("fs").rmSync(t,{recursive:!0,force:!0}),y===0)T(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${y}. Install from https://appimage.github.io/appimagetool/`})}),m.on("error",(y)=>{d("fs").rmSync(t,{recursive:!0,force:!0}),s({success:!1,error:`appimagetool not found: ${y.message}`})})}catch(t){s({success:!1,error:t.message})}})}function Co(){return[P()]}function $o(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var he={buildNative:ko,getAvailableTargets:Co,getAvailableFormats:$o,detectPlatform:P},hd=he;
|
|
3022
|
+
export{dd,wo,ud,pd,vo,Br,xo,fd,So,gd,md,ko,Co,$o,hd};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Cs,$s,Es,_s,Zn,Qn,Ud,Wd,qd,Kd,er,Xd}from"./chunk-yd7g02v5.js";import"./chunk-gskjzw5r.js";import"./chunk-ab7vh24b.js";export{Xd as generateDefaultRobotsTxt,er as generateRobotsTxt,Wd as generateSitemap,qd as generateSitemapIndex,_s as injectSeoTags,Zn as metaDirective,Cs as processMetaDirectives,Es as processSeoDirective,$s as processStructuredData,Ud as registerSeoDirectives,Kd as scanForSitemapEntries,Qn as structuredDataDirective};
|