@stacksjs/stx 0.2.195 → 0.2.197
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-0ae6chzd.js +4 -0
- package/dist/chunk-0w0mrtme.js +2 -0
- package/dist/chunk-0y46fbkx.js +3 -0
- package/dist/chunk-118a77bs.js +4471 -0
- package/dist/chunk-12nvcvtn.js +3 -0
- package/dist/chunk-14ynv5ah.js +2 -0
- package/dist/chunk-1e25ksp6.js +3 -0
- package/dist/chunk-1mhc4g86.js +43 -0
- package/dist/chunk-1thssz8x.js +2 -0
- package/dist/chunk-1yk07x7b.js +2 -0
- package/dist/chunk-2zkj69dg.js +13 -0
- package/dist/chunk-338316c2.js +2 -0
- package/dist/chunk-3952ykhb.js +1655 -0
- package/dist/chunk-3es366z4.js +3 -0
- package/dist/chunk-3m49eb4v.js +2 -0
- package/dist/chunk-3nmpfsw5.js +2 -0
- package/dist/chunk-3vy1q9da.js +2 -0
- package/dist/chunk-4a4h28pp.js +3022 -0
- package/dist/chunk-4pf61rcb.js +2 -0
- package/dist/chunk-5anpcnde.js +2 -0
- package/dist/chunk-5mkkre22.js +505 -0
- package/dist/chunk-5n0dt838.js +2 -0
- package/dist/chunk-5s2y052b.js +2 -0
- package/dist/chunk-5v64c8tr.js +2 -0
- package/dist/chunk-5xd7vge2.js +2 -0
- package/dist/chunk-6bxcjdp4.js +2 -0
- package/dist/chunk-6msvxnbr.js +2 -0
- package/dist/chunk-7kger0se.js +1280 -0
- package/dist/chunk-7ry55nms.js +3 -0
- package/dist/chunk-7s0wfa4e.js +24 -0
- package/dist/chunk-7w4c5w2b.js +2 -0
- package/dist/chunk-8src5smc.js +15 -0
- package/dist/chunk-937effkz.js +2 -0
- package/dist/chunk-9b82d4g5.js +3 -0
- package/dist/chunk-9xh78snm.js +3 -0
- package/dist/chunk-a2899x2t.js +2 -0
- package/dist/chunk-abpw3b39.js +2 -0
- package/dist/chunk-avwj12at.js +194 -0
- package/dist/chunk-b6jhznkh.js +71 -0
- package/dist/chunk-bpa2jeyw.js +3 -0
- package/dist/chunk-cbc56wpd.js +3 -0
- package/dist/chunk-dhpy0h9y.js +2 -0
- package/dist/chunk-dtmwr674.js +302 -0
- package/dist/chunk-dxfcyj8t.js +2 -0
- package/dist/chunk-e0460y7f.js +29 -0
- package/dist/chunk-ede7zpjf.js +2 -0
- package/dist/chunk-ehfzp7xe.js +2 -0
- package/dist/chunk-fd77g6t6.js +2 -0
- package/dist/chunk-fnkxbnka.js +30 -0
- package/dist/chunk-fvjh7rx0.js +84 -0
- package/dist/chunk-g19skgmw.js +18 -0
- package/dist/chunk-gcnrdgrq.js +3 -0
- package/dist/chunk-h2wpnxrh.js +8 -0
- package/dist/chunk-hb83d0qc.js +2 -0
- package/dist/chunk-hncp9gz6.js +8 -0
- package/dist/chunk-ht51fz7w.js +4 -0
- package/dist/chunk-hyrjade7.js +321 -0
- package/dist/chunk-hyyzp99b.js +2 -0
- package/dist/chunk-jpbk42j7.js +2 -0
- package/dist/chunk-jr5tp4ks.js +2 -0
- package/dist/chunk-k03b9z9e.js +898 -0
- package/dist/chunk-kjr22neh.js +3 -0
- package/dist/chunk-mjt5e2jy.js +2 -0
- package/dist/chunk-mkm91b6w.js +2 -0
- package/dist/chunk-mtr2f82n.js +2 -0
- package/dist/chunk-n8zpm7xb.js +397 -0
- package/dist/chunk-ndnc7k2n.js +22 -0
- package/dist/chunk-nenge2m2.js +2 -0
- package/dist/chunk-nngpktr2.js +2 -0
- package/dist/chunk-nsjyn31z.js +2 -0
- package/dist/chunk-nye9brje.js +147 -0
- package/dist/chunk-p5kp35dy.js +2 -0
- package/dist/chunk-pw0rzgpv.js +3 -0
- package/dist/chunk-q020t182.js +2 -0
- package/dist/chunk-q4gp9egt.js +4 -0
- package/dist/chunk-q8szpd6w.js +3 -0
- package/dist/chunk-q9n5swx7.js +3 -0
- package/dist/chunk-qpcwahse.js +2 -0
- package/dist/chunk-qz75kx6n.js +231 -0
- package/dist/chunk-r41nsgym.js +116 -0
- package/dist/chunk-r4qnvxhv.js +18 -0
- package/dist/chunk-r6p4ws0a.js +3809 -0
- package/dist/chunk-rdf7d42n.js +2 -0
- package/dist/chunk-rs2fa3g1.js +2 -0
- package/dist/chunk-ryjpp51z.js +499 -0
- package/dist/chunk-s018d32j.js +30 -0
- package/dist/chunk-spn8e3b3.js +2 -0
- package/dist/chunk-sry9atvv.js +2 -0
- package/dist/chunk-st5qggks.js +3 -0
- package/dist/chunk-tywvd1zc.js +11 -0
- package/dist/chunk-v3ryxw4v.js +2 -0
- package/dist/chunk-va9k88da.js +2 -0
- package/dist/chunk-vgk5v31k.js +216 -0
- package/dist/chunk-vj320kyr.js +2 -0
- package/dist/chunk-vr3qtsj4.js +2 -0
- package/dist/chunk-w0ng9e1m.js +341 -0
- package/dist/chunk-w29sv5jf.js +2 -0
- package/dist/chunk-whq99ytc.js +7987 -0
- package/dist/chunk-wnaddtv3.js +288 -0
- package/dist/chunk-wtengj6h.js +2 -0
- package/dist/chunk-x0ks1fer.js +1194 -0
- package/dist/chunk-x0zh76yv.js +4 -0
- package/dist/chunk-x13f5bbe.js +358 -0
- package/dist/chunk-xfp10a23.js +2 -0
- package/dist/chunk-xp3fp266.js +11 -0
- package/dist/chunk-xz019t7t.js +2 -0
- package/dist/chunk-y35rktea.js +12 -0
- package/dist/chunk-y4hkqsgw.js +4 -0
- package/dist/chunk-yab6d6kb.js +28 -0
- package/dist/chunk-yckd6ks5.js +3 -0
- package/dist/chunk-ycn1vnv2.js +5 -0
- package/dist/chunk-yf3bmmkk.js +8 -0
- package/dist/chunk-ygr11tgz.js +3 -0
- package/dist/chunk-ymccpdg6.js +351 -0
- package/dist/chunk-yr2wc2pa.js +3 -0
- package/dist/chunk-yv340gxj.js +2 -0
- package/dist/chunk-z2sp0k8d.js +3 -0
- package/dist/chunk-z5cm0bwn.js +11 -0
- package/dist/chunk-zda3hvde.js +14 -0
- package/dist/chunk-zgvga8rc.js +5 -0
- package/dist/chunk-zqbw8zqq.js +3 -0
- package/dist/cli.js +108 -27481
- package/dist/craft-entry.js +9 -5
- package/dist/craft.js +7 -18503
- package/dist/database.js +2 -2
- package/dist/pwa.js +8 -16603
- package/dist/ssg.js +52 -15512
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var j=["batch","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],X=["onMount","onDestroy"];function B(z="const",F=[],J){let Z=F.length?j.filter((Q)=>!F.includes(Q)):j;if(J!==void 0)Z=Z.filter((Q)=>{let $=Q.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${$}(?![\\w$])`).test(J)});return`${z} { ${Z.join(", ")} } = window.stx;`}var W=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var Y=j.filter((z)=>!W.includes(z));function V(z){if(!z)return!1;return Y.some((F)=>new RegExp(`\\b${F}\\s*(?:<[^>]*>)?\\s*\\(`).test(z))}var P=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],C=/\s@[a-z][\w.:-]*\s*=/i;function G(z){if(!z)return!1;let F=K(z);if(P.some((J)=>J.test(F)))return!0;return V(F)}function D(z){if(!z)return!1;return C.test(K(z))||G(z)}var f=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function H(z){return f.includes(z.toLowerCase())}var q=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],U=["x-init","x-transition","x-effect","x-on"],w=[...q,...U];function M(){return`{${q.map((z)=>`'${z}':1`).join(",")}}`}function K(z){if(!z)return z;let F=(J)=>J.replace(/(<[^>]*>)|([^<]+)/g,(Z,Q,$)=>Q??" ".repeat($.length));return z.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(J,Z,Q,$)=>Z+F(Q)+$).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(J,Z,Q,$)=>Z+F(Q)+$).replace(/<!--[\s\S]*?-->/g,(J)=>" ".repeat(J.length))}
|
|
3
|
+
export{j as dt,X as et,B as ft,V as gt,G as ht,D as it,H as jt,w as kt,M as lt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fh as x,Kh as M,Lh as C,Mh as v,Nh as P}from"./chunk-q8szpd6w.js";import{hu as y}from"./chunk-pw0rzgpv.js";import{resolve as h,basename as f,extname as u,join as m}from"path";import{mkdir as l}from"fs/promises";var I={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class z{config;constructor(J={}){this.config={...I,...J}}async get(J,Z){return C(J,Z,"image",this.config)}async set(J,Z,Y){return v(J,Z,Y,"image",this.config)}async clear(){return P("image",this.config)}updateConfig(J){this.config={...this.config,...J}}}var H=null;function S(J){if(!H)H=new z(J);else if(J)H.updateConfig(J);return H}async function w(J,Z,Y){let K=Y?{directory:`${Y.outputDir}/../.cache`}:{};return S(K).get(J,Z)}async function Q(J,Z,Y,K){let X=K?{directory:`${K.outputDir}/../.cache`}:{};return S(X).set(J,Z,Y)}async function d(){return S().clear()}async function R(){try{return await import("ts-images")}catch{return null}}function b(J){switch(J){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function p(J,Z){let Y=Z?b(Z):b("web"),K=J.formatQuality||{};return{jpeg:{...Y.jpeg,...K.jpeg},png:{...Y.png,...K.png},webp:{...Y.webp,...K.webp},avif:{...Y.avif,...K.avif}}}async function g(J,Z,Y){let K=await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:J,processed:!1};let X=await w(J,Z,Y);if(X)return X;try{let N=h(J);if(!await M(N))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let L=p(Y,Z.preset),V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await l(V,{recursive:!0});let q=await x(N),U=f(J,u(J)),E=Z.outputFormat?[Z.outputFormat]:Y.defaultFormats||["avif","webp","jpeg"],G={src:J,processed:!0,variants:[],hash:q},j=null;if(Z.transformations&&Z.transformations.length>0)j=await D(N,Z.transformations,K);for(let $ of E){let A=L[$]||{},W=`${U}-${q}.${$}`,_=m(V,W);try{let O=await K.optimizeImage({input:j||N,output:_,format:$,quality:A.quality,progressive:A.progressive});if(O){if(G.variants.push({path:_,url:`${F}/${W}`,width:O.width||0,height:O.height||0,format:$,size:O.outputSize||0}),!G.originalWidth&&O.width)G.originalWidth=O.width,G.originalHeight=O.height}}catch(O){G.errors=G.errors||[],G.errors.push(`Failed to optimize ${$}: ${O}`)}}if(Z.embedThumbhash||Z.placeholder==="thumbhash")try{let $=await K.generateThumbHash(N);G.placeholder=$.dataUrl}catch($){G.errors=G.errors||[],G.errors.push(`Failed to generate thumbhash: ${$}`)}if(Z.useDominantColor)try{let $=await K.generatePlaceholder(N,{strategy:"dominant-color"});G.dominantColor=$.dominantColor}catch($){G.errors=G.errors||[],G.errors.push(`Failed to extract dominant color: ${$}`)}return await Q(J,Z,G,Y),G}catch(N){return{src:J,processed:!1,errors:[`Processing failed: ${N}`]}}}async function n(J,Z,Y,K){let X=await R();if(!X)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await X.optimizeImage({input:J,output:K,format:Z,quality:Y}))?.outputSize}}catch(N){return{success:!1,error:String(N)}}}async function D(J,Z,Y){let K=Y||await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let X=await K.decode(J);for(let N of Z){let L=N.options||{};switch(N.type){case"resize":if(L.width||L.height)X=await K.resize(X,{width:L.width,height:L.height,fit:L.fit});break;case"blur":if(L.sigma!==void 0)X=await K.blur(X,L.sigma);break;case"sharpen":if(L.amount!==void 0)X=await K.sharpen(X,L.amount);break;case"grayscale":X=await K.grayscale(X);break;case"rotate":if(L.angle!==void 0)X=await K.rotate(X,L.angle);break;case"flip":X=await K.flip(X);break;case"flop":X=await K.flop(X);break;case"brightness":if(L.value!==void 0)X=await K.brightness(X,L.value);break;case"contrast":if(L.value!==void 0)X=await K.contrast(X,L.value);break;case"saturation":if(L.value!==void 0)X=await K.saturation(X,L.value);break}}return await K.encode(X,"png")}catch(X){return console.error(`[stx-media] Transformation failed: ${X}`),null}}import{resolve as c,basename as i,extname as r,join as o}from"path";import{mkdir as a}from"fs/promises";async function e(){try{return await import("ts-images")}catch{return null}}var s=[320,480,640,768,1024,1280,1536,1920];async function t(J,Z,Y){let K=await e();if(!K)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let X=c(J);if(!await M(X))return console.warn(`[stx-media] Source file not found: ${J}`),null;try{let N=Z.responsiveWidths||Y.breakpoints||s,L=Z.formats||Y.defaultFormats||["avif","webp","jpeg"],V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await a(V,{recursive:!0});let q=await x(X),U=i(J,r(J)),E=Y.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},G={src:J,byFormat:{},srcsets:{}};for(let $ of L){G.byFormat[$]=[];let A=[];for(let W of N){let _=`${U}-${W}w-${q}.${$}`,O=o(V,_),B=`${F}/${_}`;try{let T=E[$]?.quality||80;if(await M(O)){G.byFormat[$].push({path:O,url:B,width:W,height:0,format:$,size:0}),A.push(`${B} ${W}w`);continue}let k=await K.processImage({input:X,output:O,format:$,quality:T,resize:{width:W}});if(k)G.byFormat[$].push({path:O,url:B,width:W,height:k.height||Math.round(W*(k.height||1)/(k.width||1)),format:$,size:k.outputSize||0}),A.push(`${B} ${W}w`)}catch(T){console.warn(`[stx-media] Failed to generate ${$} at ${W}w: ${T}`)}}G.srcsets[$]=A.join(", ")}let j=Z.placeholder||Y.placeholderStrategy||"thumbhash";if(j!=="none")try{if(j==="thumbhash"){let $=await K.generateThumbHash(X);G.placeholder={dataURL:$.dataUrl,width:$.width||32,height:$.height||32,strategy:"thumbhash"}}else{let $=await K.generatePlaceholder(X,{strategy:j,width:20});G.placeholder={dataURL:$.dataURL,width:$.width,height:$.height,strategy:j}}}catch($){console.warn(`[stx-media] Failed to generate placeholder: ${$}`)}return G.sizes=Z.sizes||JJ(N),G}catch(N){return console.error(`[stx-media] Responsive generation failed: ${N}`),null}}function JJ(J){let Z=[...J].sort((K,X)=>K-X),Y=[];for(let K=0;K<Z.length-1;K++){let X=Z[K];Y.push(`(max-width: ${X}px) ${X}px`)}return Y.push(`${Z[Z.length-1]}px`),Y.join(", ")}function KJ(J,Z="width"){if(!J||J.length===0)return"";if(Z==="dpr")return J.filter((Y)=>Y.dpr).map((Y)=>`${Y.url} ${Y.dpr}x`).join(", ");return J.map((Y)=>`${Y.url} ${Y.width}w`).join(", ")}export{z as lh,w as mh,Q as nh,d as oh,g as ph,n as qh,D as rh,t as sh,KJ as th};
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function B(){return`<script data-stx-hydration-runtime>
|
|
3
|
+
(function() {
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
var stxIslands = window.__stxIslands = window.__stxIslands || {
|
|
7
|
+
_registry: {},
|
|
8
|
+
_hydrated: new Set(),
|
|
9
|
+
|
|
10
|
+
register: function(name, loader) {
|
|
11
|
+
this._registry[name] = loader;
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
hydrateIsland: function(el) {
|
|
15
|
+
var id = el.getAttribute('data-island');
|
|
16
|
+
if (!id || this._hydrated.has(id)) return Promise.resolve();
|
|
17
|
+
this._hydrated.add(id);
|
|
18
|
+
|
|
19
|
+
var componentName = el.getAttribute('data-component');
|
|
20
|
+
var propsScript = el.querySelector('script[data-island-props="' + id + '"]');
|
|
21
|
+
var props = {};
|
|
22
|
+
if (propsScript) {
|
|
23
|
+
try { props = JSON.parse(propsScript.textContent || '{}'); }
|
|
24
|
+
catch (e) {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var loader = componentName ? this._registry[componentName] : null;
|
|
28
|
+
|
|
29
|
+
if (loader) {
|
|
30
|
+
return Promise.resolve(typeof loader === 'function' ? loader() : loader)
|
|
31
|
+
.then(function(mod) {
|
|
32
|
+
var comp = mod && mod.default ? mod.default : mod;
|
|
33
|
+
if (comp && comp.hydrate) {
|
|
34
|
+
return comp.hydrate(el, props);
|
|
35
|
+
}
|
|
36
|
+
else if (comp && comp.mount) {
|
|
37
|
+
return comp.mount(el, props);
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
.then(function() {
|
|
41
|
+
el.classList.add('hydrated');
|
|
42
|
+
el.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
43
|
+
})
|
|
44
|
+
.catch(function(err) {
|
|
45
|
+
console.error('[stx] Hydration failed for island:', id, err);
|
|
46
|
+
el.classList.add('hydrated');
|
|
47
|
+
el.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// No loader registered \u2014 just mark as hydrated (CSS-only island)
|
|
52
|
+
el.classList.add('hydrated');
|
|
53
|
+
el.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
_setupStrategy: function(el) {
|
|
58
|
+
var self = this;
|
|
59
|
+
var strategy = el.getAttribute('data-strategy') || 'load';
|
|
60
|
+
|
|
61
|
+
switch (strategy) {
|
|
62
|
+
case 'load':
|
|
63
|
+
self.hydrateIsland(el);
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
case 'idle':
|
|
67
|
+
if ('requestIdleCallback' in window) {
|
|
68
|
+
requestIdleCallback(function() { self.hydrateIsland(el); }, { timeout: 2000 });
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setTimeout(function() { self.hydrateIsland(el); }, 200);
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
case 'visible':
|
|
76
|
+
if ('IntersectionObserver' in window) {
|
|
77
|
+
var rootMargin = el.getAttribute('data-root-margin') || '0px';
|
|
78
|
+
var threshold = parseFloat(el.getAttribute('data-threshold') || '0') || 0;
|
|
79
|
+
var obs = new IntersectionObserver(function(entries) {
|
|
80
|
+
entries.forEach(function(entry) {
|
|
81
|
+
if (entry.isIntersecting) {
|
|
82
|
+
obs.disconnect();
|
|
83
|
+
self.hydrateIsland(el);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, { rootMargin: rootMargin, threshold: threshold });
|
|
87
|
+
obs.observe(el);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
self.hydrateIsland(el);
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
case 'media':
|
|
95
|
+
var mediaQuery = el.getAttribute('data-media') || '(min-width: 768px)';
|
|
96
|
+
var mq = window.matchMedia(mediaQuery);
|
|
97
|
+
if (mq.matches) {
|
|
98
|
+
self.hydrateIsland(el);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
var handler = function(e) {
|
|
102
|
+
if (e.matches) {
|
|
103
|
+
mq.removeEventListener('change', handler);
|
|
104
|
+
self.hydrateIsland(el);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
mq.addEventListener('change', handler);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
|
|
111
|
+
case 'hover':
|
|
112
|
+
var events = ['mouseenter', 'focusin', 'touchstart'];
|
|
113
|
+
var hoverHandler = function() {
|
|
114
|
+
events.forEach(function(e) { el.removeEventListener(e, hoverHandler); });
|
|
115
|
+
self.hydrateIsland(el);
|
|
116
|
+
};
|
|
117
|
+
events.forEach(function(e) {
|
|
118
|
+
el.addEventListener(e, hoverHandler, { once: true, passive: true });
|
|
119
|
+
});
|
|
120
|
+
break;
|
|
121
|
+
|
|
122
|
+
case 'event':
|
|
123
|
+
var eventName = el.getAttribute('data-event') || 'stx:activate';
|
|
124
|
+
window.addEventListener(eventName, function evtHandler(e) {
|
|
125
|
+
if (!e.detail || e.detail.id === el.getAttribute('data-island') || e.detail.id === '*') {
|
|
126
|
+
window.removeEventListener(eventName, evtHandler);
|
|
127
|
+
self.hydrateIsland(el);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
|
|
132
|
+
case 'only':
|
|
133
|
+
var tmpl = el.querySelector('template[data-client-content]');
|
|
134
|
+
if (tmpl) {
|
|
135
|
+
el.innerHTML = tmpl.innerHTML;
|
|
136
|
+
}
|
|
137
|
+
el.classList.add('hydrated');
|
|
138
|
+
break;
|
|
139
|
+
|
|
140
|
+
default:
|
|
141
|
+
self.hydrateIsland(el);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
initIslands: function() {
|
|
146
|
+
var self = this;
|
|
147
|
+
var islands = document.querySelectorAll('.stx-island:not(.hydrated)');
|
|
148
|
+
islands.forEach(function(el) {
|
|
149
|
+
self._setupStrategy(el);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Auto-init on DOMContentLoaded
|
|
155
|
+
if (document.readyState === 'loading') {
|
|
156
|
+
document.addEventListener('DOMContentLoaded', function() { stxIslands.initIslands(); });
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
stxIslands.initIslands();
|
|
160
|
+
}
|
|
161
|
+
})();
|
|
162
|
+
</script>`}function I(q){if(q.size===0)return"";return`<script data-stx-island-manifest>
|
|
163
|
+
(function() {
|
|
164
|
+
if (!window.__stxIslands) return;
|
|
165
|
+
${Array.from(q.entries()).map(([w,z])=>` window.__stxIslands.register('${w}', function() { return import('${z}'); });`).join(`
|
|
166
|
+
`)}
|
|
167
|
+
})();
|
|
168
|
+
</script>`}function E(q){let j=q.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(j)return j[1];let w=q.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(w)return w[1];return null}function V(q,j){let w={},z=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,G;while((G=z.exec(q))!==null){let K=G[1],Q=G[2];if(Q in j)w[K]=j[Q];else w[K]=Q}return w}function f(){let q=new Map;return{islands:q,register(j){q.set(j.id,j)},get(j){return q.get(j)},async hydrate(j){let w=q.get(j);if(!w||w.hydrated)return;if(w.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:j,component:w.component}}))},async hydrateAll(){let j=Array.from(q.values()).filter((w)=>!w.hydrated).map((w)=>this.hydrate(w.id));await Promise.all(j)}}}function k(q){return`
|
|
169
|
+
<script data-hydrate="${q}">
|
|
170
|
+
(function() {
|
|
171
|
+
const island = document.querySelector('[data-island="${q}"]');
|
|
172
|
+
if (!island) return;
|
|
173
|
+
|
|
174
|
+
// Immediately hydrate
|
|
175
|
+
island.classList.add('hydrated');
|
|
176
|
+
island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
177
|
+
})();
|
|
178
|
+
</script>
|
|
179
|
+
`}function A(q,j){let w=j.timeout||2000,z=j.priority||"low";return`
|
|
180
|
+
<script data-hydrate="${q}">
|
|
181
|
+
(function() {
|
|
182
|
+
const island = document.querySelector('[data-island="${q}"]');
|
|
183
|
+
if (!island) return;
|
|
184
|
+
|
|
185
|
+
function hydrate() {
|
|
186
|
+
if (island.classList.contains('hydrated')) return;
|
|
187
|
+
island.classList.add('hydrated');
|
|
188
|
+
island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if ('requestIdleCallback' in window) {
|
|
192
|
+
const idleOptions = { timeout: ${w} };
|
|
193
|
+
${z==="high"?"requestIdleCallback(hydrate, idleOptions);":`
|
|
194
|
+
// Low priority: wait for multiple idle periods
|
|
195
|
+
let idleCount = 0;
|
|
196
|
+
function waitForIdle() {
|
|
197
|
+
requestIdleCallback((deadline) => {
|
|
198
|
+
if (deadline.didTimeout || ++idleCount >= 2) {
|
|
199
|
+
hydrate();
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
waitForIdle();
|
|
203
|
+
}
|
|
204
|
+
}, idleOptions);
|
|
205
|
+
}
|
|
206
|
+
waitForIdle();
|
|
207
|
+
`}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
// Fallback for browsers without requestIdleCallback
|
|
211
|
+
setTimeout(hydrate, ${w});
|
|
212
|
+
}
|
|
213
|
+
})();
|
|
214
|
+
</script>
|
|
215
|
+
`}function M(q,j){let w=j.rootMargin||"0px",z=j.threshold||0;return`
|
|
216
|
+
<script data-hydrate="${q}">
|
|
217
|
+
(function() {
|
|
218
|
+
const island = document.querySelector('[data-island="${q}"]');
|
|
219
|
+
if (!island) return;
|
|
220
|
+
|
|
221
|
+
function hydrate() {
|
|
222
|
+
if (island.classList.contains('hydrated')) return;
|
|
223
|
+
island.classList.add('hydrated');
|
|
224
|
+
island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if ('IntersectionObserver' in window) {
|
|
228
|
+
const observer = new IntersectionObserver((entries) => {
|
|
229
|
+
entries.forEach((entry) => {
|
|
230
|
+
if (entry.isIntersecting) {
|
|
231
|
+
observer.disconnect();
|
|
232
|
+
hydrate();
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}, {
|
|
236
|
+
rootMargin: '${w}',
|
|
237
|
+
threshold: ${JSON.stringify(z)}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
observer.observe(island);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
// Fallback: hydrate on load
|
|
244
|
+
hydrate();
|
|
245
|
+
}
|
|
246
|
+
})();
|
|
247
|
+
</script>
|
|
248
|
+
`}function N(q,j){let w=j.media||"(min-width: 768px)";return`
|
|
249
|
+
<script data-hydrate="${q}">
|
|
250
|
+
(function() {
|
|
251
|
+
const island = document.querySelector('[data-island="${q}"]');
|
|
252
|
+
if (!island) return;
|
|
253
|
+
|
|
254
|
+
function hydrate() {
|
|
255
|
+
if (island.classList.contains('hydrated')) return;
|
|
256
|
+
island.classList.add('hydrated');
|
|
257
|
+
island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const mediaQuery = window.matchMedia('${w}');
|
|
261
|
+
|
|
262
|
+
function handleMediaChange(e) {
|
|
263
|
+
if (e.matches) {
|
|
264
|
+
mediaQuery.removeEventListener('change', handleMediaChange);
|
|
265
|
+
hydrate();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (mediaQuery.matches) {
|
|
270
|
+
hydrate();
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
mediaQuery.addEventListener('change', handleMediaChange);
|
|
274
|
+
}
|
|
275
|
+
})();
|
|
276
|
+
</script>
|
|
277
|
+
`}function D(q){return`
|
|
278
|
+
<script data-hydrate="${q}">
|
|
279
|
+
(function() {
|
|
280
|
+
const island = document.querySelector('[data-island="${q}"]');
|
|
281
|
+
if (!island) return;
|
|
282
|
+
|
|
283
|
+
function hydrate() {
|
|
284
|
+
if (island.classList.contains('hydrated')) return;
|
|
285
|
+
island.classList.add('hydrated');
|
|
286
|
+
island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Hydrate on first interaction
|
|
290
|
+
const events = ['mouseenter', 'focusin', 'touchstart'];
|
|
291
|
+
const handler = () => {
|
|
292
|
+
events.forEach(e => island.removeEventListener(e, handler));
|
|
293
|
+
hydrate();
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
events.forEach(e => island.addEventListener(e, handler, { once: true, passive: true }));
|
|
297
|
+
})();
|
|
298
|
+
</script>
|
|
299
|
+
`}function P(q,j){let w=j.event||"stx:activate";return`
|
|
300
|
+
<script data-hydrate="${q}">
|
|
301
|
+
(function() {
|
|
302
|
+
const island = document.querySelector('[data-island="${q}"]');
|
|
303
|
+
if (!island) return;
|
|
304
|
+
|
|
305
|
+
function hydrate() {
|
|
306
|
+
if (island.classList.contains('hydrated')) return;
|
|
307
|
+
island.classList.add('hydrated');
|
|
308
|
+
island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Listen for custom event
|
|
312
|
+
window.addEventListener('${w}', function handler(e) {
|
|
313
|
+
if (!e.detail || e.detail.id === '${q}' || e.detail.id === '*') {
|
|
314
|
+
window.removeEventListener('${w}', handler);
|
|
315
|
+
hydrate();
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
})();
|
|
319
|
+
</script>
|
|
320
|
+
`}function b(q,j={},w){let z=q,G=!1,K=/@client:(load|idle|visible|media|only|hover|event)/i.test(q);if(z=W(z,"load",j),z=W(z,"idle",j),z=W(z,"visible",j),z=W(z,"media",j),z=C(z),z=W(z,"hover",j),z=W(z,"event",j),G=K&&z!==q,G)z+=`
|
|
321
|
+
`+B();return z}function W(q,j,w){let z=new RegExp(`@client:${j}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return q.replace(z,(G,K,Q)=>{let F={strategy:j};if(K)try{let R=K.split(",").map((X)=>X.trim());for(let X of R){let[L,O]=X.split(":").map((Y)=>Y.trim());if(L&&O){let Y=O.replace(/^['"]|['"]$/g,"");F[L]=Y}}}catch{}let J=`island-${Math.random().toString(36).substring(2,9)}`,Z=E(Q.trim()),$=V(Q.trim(),w),U=[];if(F.rootMargin)U.push(`data-root-margin="${F.rootMargin}"`);if(F.threshold!==void 0)U.push(`data-threshold="${F.threshold}"`);if(F.media)U.push(`data-media="${F.media}"`);if(F.event)U.push(`data-event="${F.event}"`);if(Z)U.push(`data-component="${Z}"`);let _=Object.keys($).length>0?`
|
|
322
|
+
<script type="application/json" data-island-props="${J}">${JSON.stringify($)}</script>`:"",T="";switch(j){case"load":T=k(J);break;case"idle":T=A(J,F);break;case"visible":T=M(J,F);break;case"media":T=N(J,F);break;case"hover":T=D(J);break;case"event":T=P(J,F);break}return`
|
|
323
|
+
<div data-island="${J}"
|
|
324
|
+
data-strategy="${j}"
|
|
325
|
+
${U.join(`
|
|
326
|
+
`)}
|
|
327
|
+
class="stx-island"
|
|
328
|
+
style="contents;">
|
|
329
|
+
${Q.trim()}${_}
|
|
330
|
+
</div>
|
|
331
|
+
${T}
|
|
332
|
+
`})}function C(q){let j=/@client:only\s*([\s\S]*?)@endclient/gi;return q.replace(j,(w,z)=>{let G=`island-only-${Math.random().toString(36).substring(2,9)}`;return`
|
|
333
|
+
<div data-island="${G}"
|
|
334
|
+
data-strategy="only"
|
|
335
|
+
class="stx-island stx-client-only">
|
|
336
|
+
<!-- Client-only content will be rendered here -->
|
|
337
|
+
<template data-client-content>${z.trim()}</template>
|
|
338
|
+
</div>
|
|
339
|
+
<script data-hydrate="${G}">
|
|
340
|
+
(function() {
|
|
341
|
+
const island = document.querySelector('[data-island="${G}"]');
|
|
342
|
+
if (!island) return;
|
|
343
|
+
|
|
344
|
+
const template = island.querySelector('template[data-client-content]');
|
|
345
|
+
if (template) {
|
|
346
|
+
island.innerHTML = template.innerHTML;
|
|
347
|
+
island.classList.add('hydrated');
|
|
348
|
+
}
|
|
349
|
+
})();
|
|
350
|
+
</script>
|
|
351
|
+
`})}function H(){return`
|
|
352
|
+
/* Island base styles */
|
|
353
|
+
.stx-island {
|
|
354
|
+
display: contents;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* Pre-hydration state */
|
|
358
|
+
.stx-island:not(.hydrated) {
|
|
359
|
+
/* Optional: add loading indicator */
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* Hydrated state */
|
|
363
|
+
.stx-island.hydrated {
|
|
364
|
+
/* Island is now interactive */
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* Client-only placeholder */
|
|
368
|
+
.stx-client-only:not(.hydrated) {
|
|
369
|
+
min-height: 50px;
|
|
370
|
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
371
|
+
background-size: 200% 100%;
|
|
372
|
+
animation: island-shimmer 1.5s infinite;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
@keyframes island-shimmer {
|
|
376
|
+
0% { background-position: 200% 0; }
|
|
377
|
+
100% { background-position: -200% 0; }
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* Hydration transition */
|
|
381
|
+
.stx-island {
|
|
382
|
+
transition: opacity 0.2s ease-out;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.stx-island:not(.hydrated) {
|
|
386
|
+
opacity: 0.7;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.stx-island.hydrated {
|
|
390
|
+
opacity: 1;
|
|
391
|
+
}
|
|
392
|
+
`}function S(q){if(typeof window>"u")return;let j=document.querySelector(`[data-island="${q}"]`);if(!j||j.classList.contains("hydrated"))return;j.classList.add("hydrated"),j.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function h(q){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${q}"]:not(.hydrated)`).forEach((w)=>{w.classList.add("hydrated"),w.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function g(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((j)=>{j.classList.add("hydrated"),j.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function v(q){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${q}"]`)?.classList.contains("hydrated")??!1}function u(q){return new Promise((j)=>{if(typeof window>"u"){j();return}let w=document.querySelector(`[data-island="${q}"]`);if(!w){j();return}if(w.classList.contains("hydrated")){j();return}w.addEventListener("stx:hydrated",()=>j(),{once:!0})})}function x(q){return q.replace(/@static\s*([\s\S]*?)@endstatic/gi,(j,w)=>{return`<div class="stx-static">${w.trim()}</div>`})}function y(q){let j=q.map((w)=>({id:w.id,component:w.component,strategy:w.options.strategy,props:w.props}));return`
|
|
393
|
+
<script type="application/json" id="stx-island-manifest">
|
|
394
|
+
${JSON.stringify(j)}
|
|
395
|
+
</script>
|
|
396
|
+
`}var r={processPartialHydrationDirectives:b,processStaticDirectives:x,generatePartialHydrationCSS:H,generateIslandManifest:y,createIslandRegistry:f,hydrateIsland:S,hydrateByStrategy:h,hydrateAll:g,isHydrated:v,onHydrated:u};
|
|
397
|
+
export{B as mi,I as ni,E as oi,V as pi,f as qi,b as ri,H as si,S as ti,h as ui,g as vi,v as wi,u as xi,x as yi,y as zi,r as Ai};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hs as Y}from"./chunk-xp3fp266.js";import{dt as N}from"./chunk-kjr22neh.js";import C from"path";var O=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function x(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function R(K){let J=[],Q=x(K);O.lastIndex=0;let Z;while((Z=O.exec(Q))!==null){let j=(Z[1]||"").trim(),F=(Z[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=(Z[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=Z.index+F,$=Z.index+Z[0].length-z,U=K.slice(W,$);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let G=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",X=B(K,W);J.push({kind:G,code:U,startLine:X,attrs:j})}return J}function B(K,J){let Q=1;for(let Z=0;Z<J&&Z<K.length;Z++)if(K.charCodeAt(Z)===10)Q++;return Q}function M(K,J){let Q=K.lastIndexOf(`
|
|
3
|
+
`,J-1)+1;return J-Q+1}function k(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
|
|
4
|
+
`)J[z]=" "},Z=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of Z){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function T(K){let J=0,Q="";for(let Z=0;Z<K.length;Z++){let j=K[Z];if(Q){if(j==="\\"){Z++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[Z+1]==="|"){Z++;continue}if(K[Z-1]==="|")continue;return K.slice(0,Z)}}return K}var L=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,g="__stx_interpolated",D="__StxElement",A="__StxTemplateValue",E=`type ${A}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function P(K){return K.replace(/\{\{[\s\S]*?\}\}/g,g).replace(/\{!![\s\S]*?!!\}/g,g)}function Zj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
|
|
5
|
+
`).length-1,Z=J.length-Q;return`0${" ".repeat(Math.max(0,Z-1))}${`
|
|
6
|
+
`.repeat(Q)}`})}var b=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],u=new RegExp(String.raw`^[ \t]*@(?:${b.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function $j(K){return K.replace(u,(J)=>J.replace(/[^\n]/g," "))}var S=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function h(K){let J=k(K),Q=[],Z=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,j;while((j=Z.exec(J))!==null){if(j[1]||j[3])continue;let z=j[2]??j[4]??"",W=j[2]!==void 0?2:3,$=T(z);if(!$.trim())continue;let U=j.index+W+($.length-$.trimStart().length);Q.push({code:$.trim(),line:B(J,U),column:M(J,U),kind:"interpolation"})}w.lastIndex=0;while((j=w.exec(J))!==null){let F=j[1],z=j[3]??"",W=F.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(S.has(W)||S.has(F))continue;if(!z.trim())continue;let $=j.index+j[0].indexOf(j[2],j[0].indexOf(F)+F.length)+1;if(L.has(W)){let q=z.match(/\s+(?:in|of)\s+/);if(!q||q.index===void 0)continue;let G=z.slice(q.index+q[0].length),X=q.index+q[0].length+(G.length-G.trimStart().length);Q.push({code:P(G.trim()),line:B(J,$+X),column:M(J,$+X),kind:"directive",attribute:W});continue}let U=z.length-z.trimStart().length;Q.push({code:P(z.trim()),line:B(J,$+U),column:M(J,$+U),kind:"directive",attribute:W})}return Q.sort((F,z)=>F.line-z.line||F.column-z.column),Q}function p(K){let J=new Map,Q=(W,$)=>{let U=W.split(/[,[\]{}()\s]+/).filter(Boolean);for(let q of U){let G=q.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(G))continue;let X=U.length===1?$:void 0,H=J.get(G);if(!H)J.set(G,{name:G,iterable:X});else if(H.iterable!==X)H.iterable=void 0}},Z=/^\$?[A-Z_$][\w$]*$/i,j=(W)=>{let $=W.trim();return Z.test($)?$:void 0};for(let W of K.matchAll(/@for(?:each|else)\s*\(([\s\S]*?)\)/g)){let $=W[1].match(/^([\s\S]*?)\bas\b([\s\S]*)$/);if(!$)continue;Q($[2].replace(/=>/g," "),j($[1]))}for(let W of K.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)/g))Q(W[1]);let F=k(K);w.lastIndex=0;let z;while((z=w.exec(F))!==null){let W=z[1].replace(/\..*$/,"");if(!L.has(W))continue;let $=z[3].match(/\s+(?:in|of)\s+/);if(!$||$.index===void 0)continue;Q(z[3].slice(0,$.index),j(z[3].slice($.index+$[0].length)))}for(let W of K.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let $ of W[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))Q($[1]);return[...J.values()].sort((W,$)=>W.name.localeCompare($.name))}function V(K){let J=new Set;for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))J.add(Q[1]);for(let Q of K.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let Z of Q[1].split(",")){let j=Z.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(j))J.add(j)}return[...J].sort()}function m(){return["declare var window: any",...N.map((K)=>`declare var ${K}: any`)].join(`
|
|
7
|
+
`)}var l=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore"];function d(){return l.map((K)=>`declare var ${K}: any`).join(`
|
|
8
|
+
`)}function _(K){let J=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,Q,Z=!1,j=new Set,F=Y(K);while((Q=J.exec(F))!==null){Z=!0;for(let z of i(Q[1])){let W=z.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(W))j.add(W)}}return Z?[...j]:null}function i(K){let J=[],Q=0,Z="";for(let j of K){if(j===","&&Q===0){J.push(Z),Z="";continue}if(j==="("||j==="["||j==="{")Q++;else if(j===")"||j==="]"||j==="}")Q--;Z+=j}return J.push(Z),J.filter((j)=>j.trim().length>0)}function c(K){let J=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,Q=[],Z=K.replace(J,(j)=>{return Q.push(j.trim()),j.split(`
|
|
9
|
+
`).map(()=>"").join(`
|
|
10
|
+
`)});return{imports:Q.join(`
|
|
11
|
+
`),body:Z}}function f(K){let J=Y(K),Q=Array(J.length),Z=0;for(let W=0;W<J.length;W++){let $=J[W];if($==="}"||$===")"||$==="]")Z=Math.max(0,Z-1);if(Q[W]=Z,$==="{"||$==="("||$==="[")Z++}let j=[],F=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,z;while((z=F.exec(J))!==null){if(Q[z.index]!==0)continue;let W=z[1],$=z[2],U;if(W==="interface"){let q=J.indexOf("{",z.index);if(q===-1)continue;let G=0;U=-1;for(let X=q;X<J.length;X++)if(J[X]==="{")G++;else if(J[X]==="}"&&--G===0){U=X+1;break}if(U===-1)continue}else{let q=0;U=J.length;for(let G=J.indexOf("=",z.index)+1;G<J.length;G++){let X=J[G];if(X==="{"||X==="["||X==="("||X==="<")q++;else if(X==="}"||X==="]"||X===")"||X===">")q--;else if(q<=0&&(X===";"||X===`
|
|
12
|
+
`&&!/[=|&,<([{]\s*$/.test(J.slice(Math.max(0,G-40),G)))){U=X===";"?G+1:G;break}}}j.push({name:$,text:K.slice(z.index,U).replace(/^[ \t]*export[ \t]+/,"")}),F.lastIndex=U}return j}function o(K){return new Set(f(K).map((J)=>J.name))}function zj(K,J=""){let Q=_(K),Z=o(J),j=f(K).filter((U)=>!Z.has(U.name)).map((U)=>U.text);if(!Q){let U=V(K);if(U.length===0&&j.length===0)return"";return["",`// ${n}`,...j,...U.map((q)=>`declare var ${q}: any`)].join(`
|
|
13
|
+
`)}if(Q.length===0)return j.length>0?["",`// ${I}`,...j].join(`
|
|
14
|
+
`):"";let{imports:F,body:z}=c(K),W=z.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),$=["",`// ${I}`];if(F)$.push(F);return $.push(...j),$.push(`async function ${v}() {`,W,` return { ${Q.join(", ")} }`,"}",`type ${y} = Awaited<ReturnType<typeof ${v}>>`,...Q.map((U)=>`declare var ${U}: ${y}[${JSON.stringify(U)}]`)),$.join(`
|
|
15
|
+
`)}function r(K){let Q=Y(K).split(""),Z=0;for(let j=0;j<Q.length;j++){let F=Q[j];if(F==="{"||F==="("||F==="["){Z++;continue}if(F==="}"||F===")"||F==="]"){Z=Math.max(0,Z-1);continue}if(Z>0&&F!==`
|
|
16
|
+
`)Q[j]=" "}return V(Q.join(""))}function Wj(K,J){if(_(K)!==null)return[];let Q=Y(J),Z=new Set(N);return r(K).filter((j)=>{if(Z.has(j))return!1;if(V(J).includes(j))return!1;return new RegExp(`(?<![.#\\w$])${j}(?![\\w$])`).test(Q)})}var I="stx: types for the declared client payload (#1868)",n="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",v="__stxServerScope",y="__StxClientPayload";var a=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","$errors","$csrf","props","slot"];var s=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function t(K){let J=K.code.trim();if(!J)return null;if(K.attribute?.startsWith("@")){if(s.test(J))return null;let Z=";(($event: any): void => { ";return{text:`${Z}${J} });`,prefixLength:Z.length}}let Q=";void ((";return{text:`${Q}${J}));`,prefixLength:Q.length}}var e=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function jj(K,J){if(!J)return K;return K.replace(e,(Q,Z,j,F)=>{let z=C.resolve(J,F).replace(/\\/g,"/");return`${Z}${j}${z}${j}`})}function Fj(K,J={}){let Q=R(K),Z=K.split(`
|
|
17
|
+
`),j=Array.from({length:Z.length},()=>""),F=new Map;for(let W of Q)jj(W.code,J.originDir??"").split(`
|
|
18
|
+
`).forEach((U,q)=>{let G=W.startLine-1+q;if(G<j.length)j[G]=U});let z=(W,$)=>{if(j.push(W),$)F.set(j.length,$)};if(J.globals!==!1){if(z(""),J.runtimeGlobals!==!1)for(let $ of m().split(`
|
|
19
|
+
`))z($);for(let $ of d().split(`
|
|
20
|
+
`))z($);for(let $ of a)z(`declare var ${$}: any`);z(`declare var ${g}: any`);let W=new Set(Q.flatMap(($)=>V($.code)));z(`type ${D}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let $ of p(K)){if(W.has($.name))continue;let U=$.iterable&&W.has($.iterable)?`${D}<typeof ${$.iterable}>`:"any";z(`declare var ${$.name}: ${U}`)}}if(J.templateExpressions!==!1){let W=h(K).map(($)=>({expression:$,statement:t($)})).filter(($)=>$.statement!==null);if(W.length>0){let U=[...new Set(Q.flatMap((G)=>V(G.code)))].filter((G)=>/^[A-Z_$][\w$]*$/i.test(G)),q=0;if(U.length>0){z(E);for(let G of U)z(`type __StxT_${G} = ${A}<typeof ${G}>`);z(`;((${U.map((G)=>`${G}: __StxT_${G}`).join(", ")}) => {`),q=1}for(let{expression:G,statement:X}of W){let H=" ".repeat(q);z(H+X.text,{line:G.line,column:G.column,expression:G,prefixLength:X.prefixLength+H.length})}if(q>0)z("});")}}return z("export {}"),{text:j.join(`
|
|
21
|
+
`),lineMap:F,sourceLineCount:Z.length}}function Gj(K,J,Q){let Z=K.lineMap.get(J);if(!Z)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-(Z.prefixLength??0));return{line:Z.line,column:Z.column+j,expression:Z.expression}}
|
|
22
|
+
export{R as yg,Zj as zg,$j as Ag,h as Bg,V as Cg,d as Dg,zj as Eg,Wj as Fg,jj as Gg,Fj as Hg,Gj as Ig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$g as h,Ug as a,Vg as b,Wg as c,Xg as d,Yg as e,Zg as f,_g as g,ah as i,bh as j,ch as k,dh as l}from"./chunk-st5qggks.js";import"./chunk-pw0rzgpv.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Af as i,Bf as j,Cf as k,Df as l,Ef as m,Ff as n,Gf as o,sf as a,tf as b,uf as c,vf as d,wf as e,xf as f,yf as g,zf as h}from"./chunk-fnkxbnka.js";import"./chunk-pw0rzgpv.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ah as g,Bh as h,Ch as i,Dh as j,Eh as k,uh as a,vh as b,wh as c,xh as d,yh as e,zh as f}from"./chunk-e0460y7f.js";import"./chunk-q8szpd6w.js";import"./chunk-pw0rzgpv.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var N=new Map,Q=new Map;function T(A){if(N.set(A.name,A),A.client)Q.set(A.name,A.client)}function V(A){return N.get(A)}function W(){return Array.from(N.values())}function X(A){return Q.delete(A),N.delete(A)}function G(A){return T(A),{name:A.name,hasEndTag:A.hasEndTag??!0,description:A.description,handler:async(C,F,H,L)=>{let J=U(F,A.defaults);if(A.validate){let E=A.validate(J);if(E!==!0){let M=typeof E==="string"?E:`Invalid parameters for @${A.name}`;throw Error(M)}}let K=C;if(A.transform)K=await A.transform(C,J,H,L);if(A.clientScript){let E=A.clientScript(J);K+=`<script>${E}</script>`}if(A.css){let E=A.css(J);K+=`<style>${E}</style>`}return K}}}function Y(A,B){let C=typeof B==="function"?{mounted:B}:B;return Q.set(A,C),C}function U(A,B){let C={...B};for(let F of A){let H=F.indexOf(":"),L=F.indexOf("="),J=H>=0&&(L<0||H<L)?H:L;if(J>=0){let K=F.slice(0,J).trim(),E=F.slice(J+1).trim();if(E==="true")E=!0;else if(E==="false")E=!1;else if(E==="null")E=null;else if(!Number.isNaN(Number(E)))E=Number(E);else if(typeof E==="string"&&E.startsWith("{"))try{E=JSON.parse(E)}catch{}C[K]=E}else{let K=Object.keys(C).filter((E)=>!B||!(E in B)).length;C[K===0?"value":`arg${K}`]=F}}return C}function Z(){return[G({name:"uppercase",description:"Convert content to uppercase",transform:(A)=>A.toUpperCase()}),G({name:"lowercase",description:"Convert content to lowercase",transform:(A)=>A.toLowerCase()}),G({name:"capitalize",description:"Capitalize first letter of content",transform:(A)=>A.charAt(0).toUpperCase()+A.slice(1)}),G({name:"trim",description:"Remove leading and trailing whitespace",transform:(A)=>A.trim()}),G({name:"truncate",description:"Truncate content to specified length",defaults:{length:100,suffix:"..."},transform:(A,{length:B,suffix:C})=>A.length>B?A.slice(0,B)+C:A}),G({name:"highlight",description:"Highlight content with background color",defaults:{color:"yellow"},transform:(A,{color:B})=>`<mark style="background-color: ${B}; padding: 0.1em 0.2em; border-radius: 0.2em;">${A}</mark>`}),G({name:"badge",description:"Create a badge/tag",defaults:{variant:"default",color:""},transform:(A,{variant:B,color:C})=>{let F={default:"background: #e5e7eb; color: #374151;",primary:"background: #3b82f6; color: white;",success:"background: #10b981; color: white;",warning:"background: #f59e0b; color: white;",danger:"background: #ef4444; color: white;",info:"background: #06b6d4; color: white;"};return`<span style="${C?`background: ${C}; color: white;`:F[B]||F.default} padding: 0.25em 0.5em; border-radius: 9999px; font-size: 0.875em; font-weight: 500;">${A}</span>`}}),G({name:"code",description:"Style content as inline code",transform:(A)=>`<code style="background: #f3f4f6; padding: 0.2em 0.4em; border-radius: 0.25em; font-family: ui-monospace, monospace; font-size: 0.875em;">${A}</code>`}),G({name:"tooltip",description:"Add a tooltip to content",defaults:{text:"",position:"top"},hasEndTag:!0,transform:(A,{text:B,position:C})=>`<span class="stx-tooltip" data-tooltip="${B}" data-tooltip-position="${C}" style="position: relative; cursor: help;">${A}</span>`,css:()=>`
|
|
3
|
+
.stx-tooltip::after {
|
|
4
|
+
content: attr(data-tooltip);
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: 100%;
|
|
7
|
+
left: 50%;
|
|
8
|
+
transform: translateX(-50%);
|
|
9
|
+
padding: 0.5em 0.75em;
|
|
10
|
+
background: #1f2937;
|
|
11
|
+
color: white;
|
|
12
|
+
font-size: 0.75rem;
|
|
13
|
+
border-radius: 0.25rem;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
visibility: hidden;
|
|
17
|
+
transition: opacity 0.2s, visibility 0.2s;
|
|
18
|
+
z-index: 1000;
|
|
19
|
+
margin-bottom: 0.25rem;
|
|
20
|
+
}
|
|
21
|
+
.stx-tooltip:hover::after {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
visibility: visible;
|
|
24
|
+
}
|
|
25
|
+
`}),G({name:"clipboard",description:"Add copy to clipboard functionality",defaults:{label:"Copy"},transform:(A,{label:B})=>{let C=`clipboard-${Date.now()}-${Math.random().toString(36).slice(2)}`;return`
|
|
26
|
+
<span class="stx-clipboard" data-clipboard-id="${C}">
|
|
27
|
+
<span class="stx-clipboard-content">${A}</span>
|
|
28
|
+
<button type="button" class="stx-clipboard-btn" onclick="navigator.clipboard.writeText(document.querySelector('[data-clipboard-id=\\'${C}\\'] .stx-clipboard-content').textContent).then(() => { this.textContent = 'Copied!'; setTimeout(() => this.textContent = '${B}', 2000); })">${B}</button>
|
|
29
|
+
</span>
|
|
30
|
+
`},css:()=>`
|
|
31
|
+
.stx-clipboard {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 0.5em;
|
|
35
|
+
}
|
|
36
|
+
.stx-clipboard-btn {
|
|
37
|
+
padding: 0.25em 0.5em;
|
|
38
|
+
font-size: 0.75em;
|
|
39
|
+
background: #e5e7eb;
|
|
40
|
+
border: none;
|
|
41
|
+
border-radius: 0.25em;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
.stx-clipboard-btn:hover {
|
|
45
|
+
background: #d1d5db;
|
|
46
|
+
}
|
|
47
|
+
`}),G({name:"time",description:"Display relative time",defaults:{date:""},hasEndTag:!1,transform:(A,{date:B})=>{let C=B?new Date(B).getTime():Date.now();return`<time datetime="${new Date(C).toISOString()}" data-stx-relative-time="${C}"></time>`},clientScript:()=>`
|
|
48
|
+
document.querySelectorAll('[data-stx-relative-time]').forEach(el => {
|
|
49
|
+
const timestamp = parseInt(el.dataset.stxRelativeTime);
|
|
50
|
+
const rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' });
|
|
51
|
+
const diff = timestamp - Date.now();
|
|
52
|
+
const seconds = Math.floor(diff / 1000);
|
|
53
|
+
const minutes = Math.floor(seconds / 60);
|
|
54
|
+
const hours = Math.floor(minutes / 60);
|
|
55
|
+
const days = Math.floor(hours / 24);
|
|
56
|
+
|
|
57
|
+
if (Math.abs(days) > 0) el.textContent = rtf.format(days, 'day');
|
|
58
|
+
else if (Math.abs(hours) > 0) el.textContent = rtf.format(hours, 'hour');
|
|
59
|
+
else if (Math.abs(minutes) > 0) el.textContent = rtf.format(minutes, 'minute');
|
|
60
|
+
else el.textContent = rtf.format(seconds, 'second');
|
|
61
|
+
});
|
|
62
|
+
`}),G({name:"currency",description:"Format number as currency",defaults:{amount:0,currency:"USD",locale:"en-US"},hasEndTag:!1,transform:(A,{amount:B,currency:C,locale:F})=>{return new Intl.NumberFormat(F,{style:"currency",currency:C}).format(B)}}),G({name:"number",description:"Format number with locale",defaults:{value:0,decimals:2,locale:"en-US"},hasEndTag:!1,transform:(A,{value:B,decimals:C,locale:F})=>{return new Intl.NumberFormat(F,{minimumFractionDigits:C,maximumFractionDigits:C}).format(B)}}),G({name:"pluralize",description:"Pluralize text based on count",defaults:{count:0,singular:"",plural:""},hasEndTag:!1,transform:(A,{count:B,singular:C,plural:F})=>{let H=B===1?C:F||C+"s";return`${B} ${H}`}})]}function _(){return`
|
|
63
|
+
// STX Directive Runtime
|
|
64
|
+
(function() {
|
|
65
|
+
if (typeof window === 'undefined') return;
|
|
66
|
+
|
|
67
|
+
window.STX = window.STX || {};
|
|
68
|
+
window.STX.directives = window.STX.directives || {};
|
|
69
|
+
|
|
70
|
+
// Register a client-side directive
|
|
71
|
+
window.STX.directive = function(name, definition) {
|
|
72
|
+
if (typeof definition === 'function') {
|
|
73
|
+
definition = { mounted: definition };
|
|
74
|
+
}
|
|
75
|
+
window.STX.directives[name] = definition;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Apply directive to element
|
|
79
|
+
window.STX.applyDirective = function(el, name, value, arg, modifiers) {
|
|
80
|
+
const directive = window.STX.directives[name];
|
|
81
|
+
if (!directive) {
|
|
82
|
+
console.warn('[stx] Unknown directive:', name);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const binding = {
|
|
87
|
+
value: value,
|
|
88
|
+
arg: arg,
|
|
89
|
+
modifiers: modifiers || {},
|
|
90
|
+
dir: directive
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// Store binding on element for updates
|
|
94
|
+
el.__stx_directives__ = el.__stx_directives__ || {};
|
|
95
|
+
el.__stx_directives__[name] = binding;
|
|
96
|
+
|
|
97
|
+
// Call lifecycle hooks
|
|
98
|
+
if (directive.created) directive.created(el, binding);
|
|
99
|
+
if (directive.beforeMount) directive.beforeMount(el, binding);
|
|
100
|
+
|
|
101
|
+
// Defer mounted until DOM is ready
|
|
102
|
+
requestAnimationFrame(function() {
|
|
103
|
+
if (directive.mounted) directive.mounted(el, binding);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Update directive on element
|
|
108
|
+
window.STX.updateDirective = function(el, name, newValue) {
|
|
109
|
+
const binding = el.__stx_directives__ && el.__stx_directives__[name];
|
|
110
|
+
if (!binding) return;
|
|
111
|
+
|
|
112
|
+
const directive = binding.dir;
|
|
113
|
+
const oldValue = binding.value;
|
|
114
|
+
binding.oldValue = oldValue;
|
|
115
|
+
binding.value = newValue;
|
|
116
|
+
|
|
117
|
+
if (directive.beforeUpdate) directive.beforeUpdate(el, binding);
|
|
118
|
+
if (directive.updated) directive.updated(el, binding);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Remove directive from element
|
|
122
|
+
window.STX.removeDirective = function(el, name) {
|
|
123
|
+
const binding = el.__stx_directives__ && el.__stx_directives__[name];
|
|
124
|
+
if (!binding) return;
|
|
125
|
+
|
|
126
|
+
const directive = binding.dir;
|
|
127
|
+
if (directive.beforeUnmount) directive.beforeUnmount(el, binding);
|
|
128
|
+
if (directive.unmounted) directive.unmounted(el, binding);
|
|
129
|
+
|
|
130
|
+
delete el.__stx_directives__[name];
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Auto-apply directives on page load
|
|
134
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
135
|
+
document.querySelectorAll('[data-stx-directive]').forEach(function(el) {
|
|
136
|
+
const directives = el.dataset.stxDirective.split(';');
|
|
137
|
+
directives.forEach(function(d) {
|
|
138
|
+
const [name, value] = d.split(':').map(s => s.trim());
|
|
139
|
+
window.STX.applyDirective(el, name, value);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
console.log('[stx] Directive runtime initialized');
|
|
145
|
+
})();
|
|
146
|
+
`}function $(A){let B=/v-(\w+)(?::(\w+))?(?:\.([\w.]+))?="([^"]*)"/g;return A.replace(B,(C,F,H,L,J)=>{let E=(L?L.split("."):[]).reduce((M,S)=>{return M[S]=!0,M},{});return`data-stx-directive="${F}:${J}" data-stx-directive-arg="${H||""}" data-stx-directive-modifiers='${JSON.stringify(E)}'`})}
|
|
147
|
+
export{T as is,V as js,W as ks,X as ls,G as ms,Y as ns,Z as os,_ as ps,$ as qs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gk as a,hk as b,ik as c,jk as d}from"./chunk-4a4h28pp.js";import"./chunk-g19skgmw.js";import"./chunk-r6p4ws0a.js";import"./chunk-8src5smc.js";import"./chunk-gcnrdgrq.js";import"./chunk-xp3fp266.js";import"./chunk-nye9brje.js";import"./chunk-tywvd1zc.js";import"./chunk-cbc56wpd.js";import"./chunk-x0zh76yv.js";import"./chunk-0ae6chzd.js";import"./chunk-kjr22neh.js";import"./chunk-3952ykhb.js";import"./chunk-dtmwr674.js";import"./chunk-pw0rzgpv.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
|