From dc9af3181f37b554dbdd7fdef3599be60310d37f Mon Sep 17 00:00:00 2001 From: natxocc Date: Thu, 14 May 2026 16:57:56 +0200 Subject: [PATCH] when problem --- dist/sigpro.js | 2 +- docs/install.md | 16 ++++------------ docs/sigpro.js | 2 +- src/sigpro.js | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/dist/sigpro.js b/dist/sigpro.js index ec03579..22695f6 100644 --- a/dist/sigpro.js +++ b/dist/sigpro.js @@ -1 +1 @@ -var m=(e)=>typeof e=="function",q=(e)=>e&&typeof e=="object",g=Array.isArray,N=typeof document<"u"?document:null,w=(e)=>N.createTextNode(e==null?"":String(e)),G=(e)=>e?._rt?e._cnt:e instanceof Node?e:w(e),B=(e)=>e.children,A=(e)=>m(e)?e():e,d=null,p=null,E=0,M=0,C=new Set,L=new WeakMap,D="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xlink",R=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),z=new Set(["src","href","formaction","action","background","code","archive"]),k=(e)=>{if(e)e.forEach((l)=>l()),e.clear()},b=(e)=>{if(!e||e._x)return;e._x=1;let l=[e],r;while(r=l.pop()){if(k(r._c),r._ch)r._ch.forEach((o)=>l.push(o)),r._ch.clear();if(r._d)r._d.forEach((o)=>o.delete(r)),r._d.clear()}},S=(e)=>p&&(p._c||=new Set).add(e),F=(e)=>{let l=d;d=null;try{return e()}finally{d=l}},v=(e,l=0)=>{let r=()=>{if(r._x)return;if(r._d)r._d.forEach((a)=>a.delete(r));k(r._c);let o=d,n=p;d=p=r;try{return r._res=e()}catch(a){console.error("[SigPro]",a)}finally{d=o,p=n}};if(r._d=r._c=r._ch=null,r._x=0,r._iC=l,r._dp=d?d._dp+1:0,r._m=[],r._p=p,p)(p._ch||=new Set).add(r);return r},W=()=>{if(E)return;E=1;let e=[...C].sort((l,r)=>l._dp-r._dp);C.clear();for(let l of e)if(!l._x)l();E=0},J=(e)=>{M++;try{return e()}finally{if(!--M&&C.size&&!E)W()}},x=(e,l=0)=>{if(!l&&d&&!d._x)e.add(d),(d._d||=new Set).add(e);else if(l&&e.size){let r=0;for(let o of e){if(o===d||o._x)continue;if(o._iC){if(o._dt=1,o._sb)x(o._sb,1)}else C.add(o),r=1}if(r&&!E&&!M)queueMicrotask(W)}},V=(e,l=null)=>{let r=new Set;if(m(e)){let o,n=()=>{if(n._dt){let a=d;d=n;try{let t=e();if(!Object.is(o,t))o=t,x(r,1)}finally{d=a}n._dt=0}return x(r),o};return n._iC=n._dt=1,n._sb=r,n._d=null,n._x=0,n}if(l)try{e=JSON.parse(localStorage.getItem(l))??e}catch(o){}return(...o)=>{if(o.length){let n=m(o[0])?o[0](e):o[0];if(!Object.is(e,n)){if(e=n,l)localStorage.setItem(l,JSON.stringify(e));x(r,1)}}return x(r),e}},P=(e,l)=>{let r=v(l?()=>{let o=g(e)?e.map((n)=>n()):e();F(()=>l(o))}:e);return r(),()=>b(r)},U=(e)=>{if(!e)return;if(k(e._c),e._oE)b(e._oE);if(e.childNodes)e.childNodes.forEach(U)},j=(e,l)=>l==null||l===!1?null:(z.has(e)||e.startsWith("on"))&&/^\s*(javascript|data|vbscript):/i.test(String(l))?"#":l,O=(e,l={},r=[])=>{if(l instanceof Node||g(l)||!q(l))r=l,l={};if(m(e)){let t=v(()=>t._res=e(l,{children:r,emit:(i,...f)=>l[`on${i[0].toUpperCase()}${i.slice(1)}`]?.(...f)}));if(t(),t._res==null)return null;let s=t._res instanceof Node||g(t._res)&&t._res.every((i)=>i instanceof Node)?t._res:w(t._res),c=(i)=>{if(q(i)&&!i._rt)i._m=t._m||[],i._c=t._c||new Set,i._oE=t};return g(s)?s.forEach(c):c(s),s}let o=R.has(e),n=o?N.createElementNS(D,e):N.createElement(e);n._c=new Set;for(let t in l){let s=l[t];if(t==="ref"){m(s)?s(n):s.current=n;continue}if(o&&t.startsWith("xlink:")){let c=j(t.slice(6),s);c==null?n.removeAttributeNS(I,t.slice(6)):n.setAttributeNS(I,t.slice(6),c);continue}if(t.startsWith("on")){let c=t.slice(2).toLowerCase();n.addEventListener(c,s);let i=()=>n.removeEventListener(c,s);n._c.add(i),S(i)}else if(m(s)){let c=v(()=>{let i=j(t,s());if(t==="class")n.className=i||"";else if(i==null)n.removeAttribute(t);else if(t==="style"&&typeof i=="string")n.setAttribute("style",i);else if(t in n&&!o)n[t]=i;else n.setAttribute(t,i===!0?"":i)});if(c(),n._c.add(()=>b(c)),S(()=>b(c)),/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName)&&(t==="value"||t==="checked"))n.addEventListener(t==="checked"?"change":"input",(i)=>s(i.target[t]))}else{let c=j(t,s);if(c!=null)if(t==="style"&&typeof c=="string")n.setAttribute("style",c);else if(t in n&&!o)n[t]=c;else n.setAttribute(t,c===!0?"":c)}}let a=(t)=>{if(g(t))return t.forEach(a);if(m(t)){let s=w(""),c=[];n.appendChild(s);let i=v(()=>{let f=t(),h=(g(f)?f:[f]).map(G),y=s;c.forEach((u)=>{if(u._rt?u.destroy():U(u),u.parentNode)u.remove()});for(let u=h.length-1;u>=0;u--){let _=h[u];if(_.parentNode!==y.parentNode)y.parentNode?.insertBefore(_,y);if(_._m)_._m.forEach(($)=>$());y=_}c=h});i(),n._c.add(()=>b(i)),S(()=>b(i))}else{let s=G(t);if(n.appendChild(s),s._m)s._m.forEach((c)=>c())}};return a(r),n},T=(e)=>{let l=new Set,r=p,o=d,n=N.createElement("div");n.style.display="contents",n.setAttribute("role","presentation"),p={_c:l},d=null;let a=(t)=>{if(!t)return;if(t._rt)l.add(t.destroy),n.appendChild(t._cnt);else if(g(t))t.forEach(a);else n.appendChild(t instanceof Node?t:w(t))};try{a(e({onCleanup:(t)=>l.add(t)}))}finally{p=r,d=o}return{_rt:1,_cnt:n,destroy:()=>{k(l),U(n),n.remove()}}},X=(e,l,r=null)=>{let o=w(""),n=O("div",{style:"display:contents"},[o]),a;return P(()=>!!A(e),(t)=>{if(a)a.destroy(),a=null;let s=t?l:r;if(s)a=T(()=>A(s)),n.insertBefore(a._cnt,o)}),S(()=>a?.destroy()),n},K=(e,l,r)=>{let o=w(""),n=O("div",{style:"display:contents"},[o]),a=new Map;return P(()=>A(e)||[],(t)=>{let s=new Map,c=[];for(let f=0,h=(t||[]).length;fl(y,f));else a.delete(u);s.set(u,_),c.push(_)}a.forEach((f)=>f.destroy());let i=o;for(let f=c.length-1;f>=0;f--){let h=c[f]._cnt;if(h.nextSibling!==i)n.insertBefore(h,i);i=h}a=s}),n},Q=(e,l)=>{let r=typeof l=="string"?N.querySelector(l):l;if(!r)return;if(L.has(r))L.get(r).destroy();let o=T(m(e)?e:()=>e);return r.replaceChildren(o._cnt),L.set(r,o),o},H="a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video",Y={$:V,watch:P,batch:J,h:O,Fragment:B,render:T,mount:Q,when:X,each:K,onUnmount:S,val:A,isA:g,isF:m,isO:q};if(typeof window<"u")window.SigPro=Y,H.split(" ").forEach((e)=>{window[e]=(l,r)=>O(e,l,r)});export{P as watch,A as val,T as render,S as onUnmount,Q as mount,q as isO,m as isF,g as isA,O as h,K as each,J as batch,Y as SigPro,B as Fragment,V as $}; +var m=(e)=>typeof e=="function",q=(e)=>e&&typeof e=="object",g=Array.isArray,N=typeof document<"u"?document:null,w=(e)=>N.createTextNode(e==null?"":String(e)),G=(e)=>e?._rt?e._cnt:e instanceof Node?e:w(e),B=(e)=>e.children,A=(e)=>m(e)?e():e,d=null,p=null,E=0,M=0,C=new Set,L=new WeakMap,D="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xlink",R=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),z=new Set(["src","href","formaction","action","background","code","archive"]),k=(e)=>{if(e)e.forEach((l)=>l()),e.clear()},b=(e)=>{if(!e||e._x)return;e._x=1;let l=[e],r;while(r=l.pop()){if(k(r._c),r._ch)r._ch.forEach((o)=>l.push(o)),r._ch.clear();if(r._d)r._d.forEach((o)=>o.delete(r)),r._d.clear()}},S=(e)=>p&&(p._c||=new Set).add(e),F=(e)=>{let l=d;d=null;try{return e()}finally{d=l}},v=(e,l=0)=>{let r=()=>{if(r._x)return;if(r._d)r._d.forEach((a)=>a.delete(r));k(r._c);let o=d,n=p;d=p=r;try{return r._res=e()}catch(a){console.error("[SigPro]",a)}finally{d=o,p=n}};if(r._d=r._c=r._ch=null,r._x=0,r._iC=l,r._dp=d?d._dp+1:0,r._m=[],r._p=p,p)(p._ch||=new Set).add(r);return r},W=()=>{if(E)return;E=1;let e=[...C].sort((l,r)=>l._dp-r._dp);C.clear();for(let l of e)if(!l._x)l();E=0},J=(e)=>{M++;try{return e()}finally{if(!--M&&C.size&&!E)W()}},x=(e,l=0)=>{if(!l&&d&&!d._x)e.add(d),(d._d||=new Set).add(e);else if(l&&e.size){let r=0;for(let o of e){if(o===d||o._x)continue;if(o._iC){if(o._dt=1,o._sb)x(o._sb,1)}else C.add(o),r=1}if(r&&!E&&!M)queueMicrotask(W)}},V=(e,l=null)=>{let r=new Set;if(m(e)){let o,n=()=>{if(n._dt){let a=d;d=n;try{let t=e();if(!Object.is(o,t))o=t,x(r,1)}finally{d=a}n._dt=0}return x(r),o};return n._iC=n._dt=1,n._sb=r,n._d=null,n._x=0,n}if(l)try{e=JSON.parse(localStorage.getItem(l))??e}catch(o){}return(...o)=>{if(o.length){let n=m(o[0])?o[0](e):o[0];if(!Object.is(e,n)){if(e=n,l)localStorage.setItem(l,JSON.stringify(e));x(r,1)}}return x(r),e}},P=(e,l)=>{let r=v(l?()=>{let o=g(e)?e.map((n)=>n()):e();F(()=>l(o))}:e);return r(),()=>b(r)},U=(e)=>{if(!e)return;if(k(e._c),e._oE)b(e._oE);if(e.childNodes)e.childNodes.forEach(U)},j=(e,l)=>l==null||l===!1?null:(z.has(e)||e.startsWith("on"))&&/^\s*(javascript|data|vbscript):/i.test(String(l))?"#":l,O=(e,l={},r=[])=>{if(l instanceof Node||g(l)||!q(l))r=l,l={};if(m(e)){let t=v(()=>t._res=e(l,{children:r,emit:(i,...f)=>l[`on${i[0].toUpperCase()}${i.slice(1)}`]?.(...f)}));if(t(),t._res==null)return null;let s=t._res instanceof Node||g(t._res)&&t._res.every((i)=>i instanceof Node)?t._res:w(t._res),c=(i)=>{if(q(i)&&!i._rt)i._m=t._m||[],i._c=t._c||new Set,i._oE=t};return g(s)?s.forEach(c):c(s),s}let o=R.has(e),n=o?N.createElementNS(D,e):N.createElement(e);n._c=new Set;for(let t in l){let s=l[t];if(t==="ref"){m(s)?s(n):s.current=n;continue}if(o&&t.startsWith("xlink:")){let c=j(t.slice(6),s);c==null?n.removeAttributeNS(I,t.slice(6)):n.setAttributeNS(I,t.slice(6),c);continue}if(t.startsWith("on")){let c=t.slice(2).toLowerCase();n.addEventListener(c,s);let i=()=>n.removeEventListener(c,s);n._c.add(i),S(i)}else if(m(s)){let c=v(()=>{let i=j(t,s());if(t==="class")n.className=i||"";else if(i==null)n.removeAttribute(t);else if(t==="style"&&typeof i=="string")n.setAttribute("style",i);else if(t in n&&!o)n[t]=i;else n.setAttribute(t,i===!0?"":i)});if(c(),n._c.add(()=>b(c)),S(()=>b(c)),/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName)&&(t==="value"||t==="checked"))n.addEventListener(t==="checked"?"change":"input",(i)=>s(i.target[t]))}else{let c=j(t,s);if(c!=null)if(t==="style"&&typeof c=="string")n.setAttribute("style",c);else if(t in n&&!o)n[t]=c;else n.setAttribute(t,c===!0?"":c)}}let a=(t)=>{if(g(t))return t.forEach(a);if(m(t)){let s=w(""),c=[];n.appendChild(s);let i=v(()=>{let f=t(),h=(g(f)?f:[f]).map(G),y=s;c.forEach((u)=>{if(u._rt?u.destroy():U(u),u.parentNode)u.remove()});for(let u=h.length-1;u>=0;u--){let _=h[u];if(_.parentNode!==y.parentNode)y.parentNode?.insertBefore(_,y);if(_._m)_._m.forEach(($)=>$());y=_}c=h});i(),n._c.add(()=>b(i)),S(()=>b(i))}else{let s=G(t);if(n.appendChild(s),s._m)s._m.forEach((c)=>c())}};return a(r),n},T=(e)=>{let l=new Set,r=p,o=d,n=N.createElement("div");n.style.display="contents",n.setAttribute("role","presentation"),p={_c:l},d=null;let a=(t)=>{if(!t)return;if(t._rt)l.add(t.destroy),n.appendChild(t._cnt);else if(g(t))t.forEach(a);else n.appendChild(t instanceof Node?t:w(t))};try{a(e({onCleanup:(t)=>l.add(t)}))}finally{p=r,d=o}return{_rt:1,_cnt:n,destroy:()=>{k(l),U(n),n.remove()}}},X=(e,l,r=null)=>{let o=w(""),n=O("div",{style:"display:contents"},[o]),a;return P(()=>!!A(e),(t)=>{if(a)a.destroy(),a=null;let s=t?l:r;if(s)a=T(()=>A(s)),n.insertBefore(a._cnt,o)}),S(()=>a?.destroy()),n},K=(e,l,r)=>{let o=w(""),n=O("div",{style:"display:contents"},[o]),a=new Map;return P(()=>A(e)||[],(t)=>{let s=new Map,c=[];for(let f=0,h=(t||[]).length;fl(y,f));else a.delete(u);s.set(u,_),c.push(_)}a.forEach((f)=>f.destroy());let i=o;for(let f=c.length-1;f>=0;f--){let h=c[f]._cnt;if(h.nextSibling!==i)n.insertBefore(h,i);i=h}a=s}),n},Q=(e,l)=>{let r=typeof l=="string"?N.querySelector(l):l;if(!r)return;if(L.has(r))L.get(r).destroy();let o=T(m(e)?e:()=>e);return r.replaceChildren(o._cnt),L.set(r,o),o},H="a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video",Y={$:V,watch:P,batch:J,h:O,Fragment:B,render:T,mount:Q,when:X,each:K,onUnmount:S,val:A,isA:g,isF:m,isO:q};if(typeof window<"u")window.SigPro=Y,H.split(" ").forEach((e)=>{window[e]=(l,r)=>O(e,l,r)});export{X as when,P as watch,A as val,T as render,S as onUnmount,Q as mount,q as isO,m as isF,g as isA,O as h,K as each,J as batch,Y as SigPro,B as Fragment,V as $}; diff --git a/docs/install.md b/docs/install.md index 4795873..753dac4 100644 --- a/docs/install.md +++ b/docs/install.md @@ -25,19 +25,12 @@ bun add sigpro ```html ``` @@ -51,7 +44,7 @@ bun add sigpro SigPro uses **lowercase** Tag Helpers (e.g., `div`, `button`) to keep the syntax close to raw HTML, while still being pure JavaScript functions.
- +
```javascript @@ -74,7 +67,7 @@ mount(App, "#app");
- +
```html @@ -83,7 +76,6 @@ mount(App, "#app");
-