sigpro 2.0.6 → 2.0.7

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/sigpro.js CHANGED
@@ -1 +1 @@
1
- function X({update:e,notify:t,unwatched:n}){return{link:f,unlink:s,propagate:l,checkDirty:p,shallowPropagate:h};function f(i,r,u){let c=r.depsTail;if(c!==void 0&&c.dep===i)return;let o=c!==void 0?c.nextDep:r.deps;if(o!==void 0&&o.dep===i){o.version=u,r.depsTail=o;return}let d=i.subsTail;if(d!==void 0&&d.version===u&&d.sub===r)return;let b=r.depsTail=i.subsTail={version:u,dep:i,sub:r,prevDep:c,nextDep:o,prevSub:d,nextSub:void 0};if(o!==void 0)o.prevDep=b;if(c!==void 0)c.nextDep=b;else r.deps=b;if(d!==void 0)d.nextSub=b;else i.subs=b}function s(i,r=i.sub){let{dep:u,prevDep:c,nextDep:o,nextSub:d,prevSub:b}=i;if(o!==void 0)o.prevDep=c;else r.depsTail=c;if(c!==void 0)c.nextDep=o;else r.deps=o;if(d!==void 0)d.prevSub=b;else u.subsTail=b;if(b!==void 0)b.nextSub=d;else if((u.subs=d)===void 0)n(u);return o}function l(i,r){let u=i.nextSub,c;e:do{let o=i.sub,d=o.flags;if(!(d&60)){if(o.flags=d|32,r)o.flags|=8}else if(!(d&12))d=0;else if(!(d&4))o.flags=d&-9|32;else if(!(d&48)&&a(i,o))o.flags=d|8|32,d&=1;else d=0;if(d&2)t(o);if(d&1){let b=o.subs;if(b!==void 0){let y=(i=b).nextSub;if(y!==void 0)c={value:u,prev:c},u=y;continue}}if((i=u)!==void 0){u=i.nextSub;continue}while(c!==void 0)if(i=c.value,c=c.prev,i!==void 0){u=i.nextSub;continue e}break}while(!0)}function p(i,r){let u,c=0,o=!1;e:do{let d=i.dep,b=d.flags;if(r.flags&16)o=!0;else if((b&17)===17){let y=d.subs;if(e(d)){if(y.nextSub!==void 0)h(y);o=!0}}else if((b&33)===33){u={value:i,prev:u},i=d.deps,r=d,++c;continue}if(!o){let y=i.nextDep;if(y!==void 0){i=y;continue}}while(c--){if(i=u.value,u=u.prev,o){let W=r.subs;if(e(r)){if(W.nextSub!==void 0)h(W);r=i.sub;continue}o=!1}else r.flags&=-33;r=i.sub;let y=i.nextDep;if(y!==void 0){i=y;continue e}}return o&&!!r.flags}while(!0)}function h(i){do{let r=i.sub,u=r.flags;if((u&48)===32){if(r.flags=u|16,(u&6)===2)t(r)}}while((i=i.nextSub)!==void 0)}function a(i,r){let u=r.depsTail;while(u!==void 0){if(u===i)return!0;u=u.prevDep}return!1}}var A=0,T=0,_=0,m=0,D=0,g,v=[],{link:R,unlink:C,propagate:Y,checkDirty:G,shallowPropagate:I}=X({update(e){if("getter"in e)return B(e);if("currentValue"in e)return F(e);return e.flags=1,!0},notify(e){let t=D,n=t;do if(v[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);D=t;while(n<--t){let f=v[n];v[n++]=v[t],v[t]=f}},unwatched(e){if("getter"in e){if(e.depsTail!==void 0)e.flags=17,z(e)}else if("currentValue"in e);else if("fn"in e)$.call(e);else k.call(e)}});function S(e){return ne.bind({currentValue:e,pendingValue:e,subs:void 0,subsTail:void 0,flags:1})}function Z(e){return te.bind({value:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:0,getter:e})}function x(e){let t={fn:e,cleanup:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:6},n=g;if(g=t,n!==void 0)R(t,n,0),n.flags|=64;try{++T;let f=t.fn();t.cleanup=typeof f==="function"?f:void 0}finally{--T,g=n,t.flags&=-5}return $.bind(t)}function O(e){let t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:1},n=g;if(g=t,n!==void 0)R(t,n,0),n.flags|=64;try{e()}finally{g=n}return k.bind(t)}function ue(e){++_;try{return e()}finally{if(!--_)q()}}function B(e){if(e.flags&64){let n=e.depsTail;while(n!==void 0){let{prevDep:f,dep:s}=n;if(!("getter"in s)&&!("currentValue"in s))C(n,e);n=f}}e.depsTail=void 0,e.flags=5;let t=g;g=e;try{++A;let n=e.value;return!Object.is(n,e.value=e.getter(n))}finally{g=t,e.flags&=-5,K(e)}}function F(e){return e.flags=1,!Object.is(e.currentValue,e.currentValue=e.pendingValue)}function ee(e){let t=e.flags;if(t&16||t&32&&G(e.deps,e)){if(t&64){let f=e.depsTail;while(f!==void 0){let{prevDep:s,dep:l}=f;if(!("getter"in l)&&!("currentValue"in l))C(f,e);f=s}}if(e.cleanup){if(J(e),!e.flags)return}e.depsTail=void 0,e.flags=6;let n=g;g=e;try{++A,++T;let f=e.fn();e.cleanup=typeof f==="function"?f:void 0}finally{--T,g=n,e.flags&=-5,K(e)}}else if(e.deps!==void 0)e.flags=2|t&64}function q(){try{while(m<D){let e=v[m];v[m++]=void 0,ee(e)}}finally{while(m<D){let e=v[m];v[m++]=void 0,e.flags|=10}if(m=0,D=0,v.length>64)v.length=64}}function te(){let e=this.flags;if(e&16||e&32&&(G(this.deps,this)||(this.flags=e&-33,!1))){if(B(this)){let n=this.subs;if(n!==void 0)I(n)}}else if(!e){this.flags=5;let n=g;g=this;try{this.value=this.getter()}finally{g=n,this.flags&=-5}}let t=g;if(t!==void 0)R(this,t,A);return this.value}function ne(...e){if(e.length){if(!Object.is(this.pendingValue,this.pendingValue=e[0])){this.flags=17;let t=this.subs;if(t!==void 0){if(Y(t,!!T),!_)q()}}}else{if(this.flags&16){if(F(this)){let n=this.subs;if(n!==void 0)I(n)}}let t=g;if(t!==void 0)R(this,t,A);return this.currentValue}}function J(e){let t=e.cleanup;e.cleanup=void 0;let n=g;g=void 0;try{t()}finally{g=n}}function $(){if(k.call(this),this.cleanup)J(this)}function k(){this.flags=0,z(this);let e=this.subs;if(e!==void 0)C(e)}function z(e){let t=e.depsTail;while(t!==void 0){let n=t.prevDep;C(t,e),t=n}}function K(e){let t=e.depsTail,n=t!==void 0?t.nextDep:e.deps;while(n!==void 0)n=C(n,e)}function H(e){let t=g;g=void 0;try{return e()}finally{g=t}}function le(e,t,{immediate:n=!1}={}){let f,s=!0;return x(()=>{let l=e();if(s){if(s=!1,f=l,n)H(()=>t(l,void 0));return}if(Object.is(f,l))return;let p=f;f=l,H(()=>t(l,p))})}function ie(e,t){let n=t,f;try{let l=localStorage.getItem(e);if(l!==null)n=JSON.parse(l),f=l}catch{}let s=S(n);return x(()=>{try{let l=JSON.stringify(s());if(f!==l)localStorage.setItem(e,l),f=l}catch{}}),s}var w=typeof document<"u"?document:null,se="http://www.w3.org/2000/svg",fe=new Set("svg path circle rect line polyline polygon g defs text textPath tspan use symbol image marker ellipse foreignObject clipPath mask linearGradient radialGradient pattern filter stop animate animateMotion animateTransform view desc metadata title switch feGaussianBlur feOffset feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feImage feMerge feMergeNode feMorphology fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" "));function M(e,t,n,f){if(t==="class"||t==="className"){if(f)if(n==null||n===!1)e.removeAttribute("class");else e.setAttribute("class",n===!0?"":n);else e.className=n??"";return}if(n==null||n===!1){if(t==="style")e._lastStyle=void 0;e.removeAttribute(t);return}if(t==="style"){let s=e._lastStyle;if(typeof n==="string"){if(s!==void 0)e.removeAttribute("style"),e._lastStyle=void 0;e.setAttribute("style",n);return}if(typeof n==="object"){if(s===void 0&&e.hasAttribute("style"))e.removeAttribute("style");if(s){for(let l in s)if(!(l in n))e.style.removeProperty(l)}for(let l in n){let p=n[l];if(p==null||p===!1)e.style.removeProperty(l);else e.style.setProperty(l,String(p))}e._lastStyle=n;return}}if(f){e.setAttribute(t,n===!0?"":n);return}if(t in e&&typeof e[t]!=="function")e[t]=n;else e.setAttribute(t,n===!0?"":n)}function E(e){let t=[e];while(t.length){let n=t.pop();if(n._stopScope)n._stopScope(),n._stopScope=null;if(n._cln){for(let s of n._cln)s();n._cln=null}let f=n.childNodes;for(let s=0,l=f.length;s<l;s++)t.push(f[s])}}function N(e,t={},...n){if(typeof e==="function"){let h,a=O(()=>{h=e(t,n)}),i=(r)=>{if(r instanceof Node)r._stopScope=a;else if(Array.isArray(r))r.forEach(i)};return i(h),h}if(t instanceof Node||Array.isArray(t)||t!==null&&typeof t!=="object"||t===void 0)n=[t,...n],t={};let f=fe.has(e),s=f?w.createElementNS(se,e):w.createElement(e),l,p=!1;for(let h of Object.keys(t||{})){let a=t[h];if(h==="ref"){if(typeof a==="function")a(s);else if(a!=null&&typeof a==="object")a.current=s;continue}if(e==="select"&&h==="value"){l=a;continue}if(h==="html"){if(p=!0,typeof a==="function"){let i;x(()=>{let r=a()??"";if(r!==i)s.innerHTML=r,i=r})}else s.innerHTML=a??"";continue}if(h.startsWith("on")&&typeof a==="function"){let i=h.slice(2).toLowerCase();s.addEventListener(i,a),(s._cln||(s._cln=[])).push(()=>s.removeEventListener(i,a))}else if(typeof a==="function")x(()=>M(s,h,a(),f));else M(s,h,a,f)}if(!p){let h=(a)=>{if(Array.isArray(a)){for(let i of a)h(i);return}if(a==null||a===!1||a===!0)return;if(typeof a==="function"){let i=w.createComment("");s.appendChild(i),x(()=>{let r=a(),u=Array.isArray(r)?r:[r],c=[];for(let o of u){if(o==null||o===!1||o===!0)continue;c.push(o instanceof Node?o:w.createTextNode(String(o)))}for(let o of c)s.insertBefore(o,i);return()=>{for(let o of c)E(o),o.remove()}});return}s.appendChild(a instanceof Node?a:w.createTextNode(String(a)))};h(n)}if(l!==void 0)if(typeof l==="function")x(()=>M(s,"value",l(),f));else M(s,"value",l,f);return s}function ae(e,t){let n=typeof t==="string"?w.querySelector(t):t;if(!n)return()=>{};let f,s=O(()=>{f=N(e,{})}),l=(Array.isArray(f)?f:[f]).filter((p)=>p!=null&&p!==!1&&p!==!0).map((p)=>p instanceof Node?p:w.createTextNode(String(p)));return n.replaceChildren(...l),()=>{s();for(let p of l)E(p);n.replaceChildren()}}function ce(e){if(!(e instanceof Node))return;if(E(e),e.parentNode)e.parentNode.removeChild(e)}var re="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 table tbody td template textarea tfoot th thead time tr u ul video",de=(e=typeof window<"u"?window:null)=>{if(!e)return;for(let t of re.split(" "))e[t]=(n,...f)=>N(t,n,...f)},V=S(typeof window<"u"?window.location.hash.slice(1)||"/":"/"),oe=S({});if(typeof window<"u")window.addEventListener("hashchange",()=>{V(window.location.hash.slice(1)||"/")});var Q=new Map,L=S(0);if(typeof window<"u")window.__sigpro_hmr_page__=(e,t)=>{Q.set(e,t),L(L()+1)};var j=(e)=>()=>{let t=N("div",{class:"router-hook"}),n,f,s,l=x(()=>{L();let p=V(),h=p.split("/").filter(Boolean),a=e.find((u)=>{let c=u.path.split("/").filter(Boolean);return c.length===h.length&&c.every((o,d)=>o[0]===":"||o===h[d])})||e.find((u)=>u.path==="*");if(!a){if(n)n(),n=void 0;t.replaceChildren(),f=s=void 0;return}let i={};a.path.split("/").filter(Boolean).forEach((u,c)=>{if(u[0]===":")i[u.slice(1)]=h[c]});let r=Q.get(a.path)??a.component;if(p===f&&r===s)return;if(f=p,s=r,n)n();oe(i),n=O(()=>{let u=typeof r==="function"?N(r,i):r,c=u==null?[]:Array.isArray(u)?u:[u];t.replaceChildren(...c)})});return t._stopScope=()=>{if(n)n();l()},t};j.to=(e)=>{if(typeof window<"u")window.location.hash=e.replace(/^#?\/?/,"#/")};j.back=()=>{if(typeof window<"u")window.history.back()};j.path=()=>V();var U=S("en"),P={},pe=(e)=>{for(let t of Object.keys(e))P[t]||={},Object.assign(P[t],e[t])},he=(e)=>{if(e&&P[e])U(e)},ge=(e)=>()=>P[U()]?.[e]??e,be=async(e,t=null,n=null,f=null)=>{if(n)n(!0);try{let s=await fetch(e,{method:t?"POST":"GET",headers:{"Content-Type":"application/json"},body:t?JSON.stringify(t):void 0,credentials:"include",signal:f});if(!s.ok)throw Error(`Error ${s.status}: ${await s.text()}`);if(s.status===204)return null;return await s.json()}finally{if(n)n(!1)}},ye=(e,t)=>{if(typeof e==="function")return Z(e);if(t!==void 0)return ie(t,e);return S(e)};export{le as watch,H as untrack,ce as unmount,ge as t,S as signal,he as setLocale,oe as routerParams,j as router,ae as mount,ie as local,L as hmrTick,N as h,de as exposeTags,O as effectScope,x as effect,be as db,V as currentPath,U as currentLocale,Z as computed,ue as batch,pe as addLang,ye as $};
1
+ function X({update:e,notify:n,unwatched:t}){return{link:i,unlink:s,propagate:r,checkDirty:u,shallowPropagate:l};function i(f,a,p){let c=a.depsTail;if(c!==void 0&&c.dep===f)return;let o=c!==void 0?c.nextDep:a.deps;if(o!==void 0&&o.dep===f){o.version=p,a.depsTail=o;return}let h=f.subsTail;if(h!==void 0&&h.version===p&&h.sub===a)return;let b=a.depsTail=f.subsTail={version:p,dep:f,sub:a,prevDep:c,nextDep:o,prevSub:h,nextSub:void 0};if(o!==void 0)o.prevDep=b;if(c!==void 0)c.nextDep=b;else a.deps=b;if(h!==void 0)h.nextSub=b;else f.subs=b}function s(f,a=f.sub){let{dep:p,prevDep:c,nextDep:o,nextSub:h,prevSub:b}=f;if(o!==void 0)o.prevDep=c;else a.depsTail=c;if(c!==void 0)c.nextDep=o;else a.deps=o;if(h!==void 0)h.prevSub=b;else p.subsTail=b;if(b!==void 0)b.nextSub=h;else if((p.subs=h)===void 0)t(p);return o}function r(f,a){let p=f.nextSub,c;e:do{let o=f.sub,h=o.flags;if(!(h&60)){if(o.flags=h|32,a)o.flags|=8}else if(!(h&12))h=0;else if(!(h&4))o.flags=h&-9|32;else if(!(h&48)&&d(f,o))o.flags=h|8|32,h&=1;else h=0;if(h&2)n(o);if(h&1){let b=o.subs;if(b!==void 0){let y=(f=b).nextSub;if(y!==void 0)c={value:p,prev:c},p=y;continue}}if((f=p)!==void 0){p=f.nextSub;continue}while(c!==void 0)if(f=c.value,c=c.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function u(f,a){let p,c=0,o=!1;e:do{let h=f.dep,b=h.flags;if(a.flags&16)o=!0;else if((b&17)===17){let y=h.subs;if(e(h)){if(y.nextSub!==void 0)l(y);o=!0}}else if((b&33)===33){p={value:f,prev:p},f=h.deps,a=h,++c;continue}if(!o){let y=f.nextDep;if(y!==void 0){f=y;continue}}while(c--){if(f=p.value,p=p.prev,o){let k=a.subs;if(e(a)){if(k.nextSub!==void 0)l(k);a=f.sub;continue}o=!1}else a.flags&=-33;a=f.sub;let y=f.nextDep;if(y!==void 0){f=y;continue e}}return o&&!!a.flags}while(!0)}function l(f){do{let a=f.sub,p=a.flags;if((p&48)===32){if(a.flags=p|16,(p&6)===2)n(a)}}while((f=f.nextSub)!==void 0)}function d(f,a){let p=a.depsTail;while(p!==void 0){if(p===f)return!0;p=p.prevDep}return!1}}var _=0,D=0,O=0,v=0,x=0,g,m=[],{link:M,unlink:C,propagate:Y,checkDirty:F,shallowPropagate:I}=X({update(e){if("getter"in e)return G(e);if("currentValue"in e)return H(e);return e.flags=1,!0},notify(e){let n=x,t=n;do if(m[n++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);x=n;while(t<--n){let i=m[t];m[t++]=m[n],m[n]=i}},unwatched(e){if("getter"in e){if(e.depsTail!==void 0)e.flags=17,U(e)}else if("currentValue"in e);else if("fn"in e)J.call(e);else j.call(e)}});function T(e){return te.bind({currentValue:e,pendingValue:e,subs:void 0,subsTail:void 0,flags:1})}function re(e){return ee.bind({value:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:0,getter:e})}function S(e){let n={fn:e,cleanup:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:6},t=g;if(g=n,t!==void 0)M(n,t,0),t.flags|=64;try{++D;let i=n.fn();n.cleanup=typeof i==="function"?i:void 0}finally{--D,g=t,n.flags&=-5}return J.bind(n)}function V(e){let n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:1},t=g;if(g=n,t!==void 0)M(n,t,0),t.flags|=64;try{e()}finally{g=t}return j.bind(n)}function ue(e){++O;try{return e()}finally{if(!--O)q()}}function G(e){if(e.flags&64){let t=e.depsTail;while(t!==void 0){let{prevDep:i,dep:s}=t;if(!("getter"in s)&&!("currentValue"in s))C(t,e);t=i}}e.depsTail=void 0,e.flags=5;let n=g;g=e;try{++_;let t=e.value;return!Object.is(t,e.value=e.getter(t))}finally{g=n,e.flags&=-5,z(e)}}function H(e){return e.flags=1,!Object.is(e.currentValue,e.currentValue=e.pendingValue)}function Z(e){let n=e.flags;if(n&16||n&32&&F(e.deps,e)){if(n&64){let i=e.depsTail;while(i!==void 0){let{prevDep:s,dep:r}=i;if(!("getter"in r)&&!("currentValue"in r))C(i,e);i=s}}if(e.cleanup){if($(e),!e.flags)return}e.depsTail=void 0,e.flags=6;let t=g;g=e;try{++_,++D;let i=e.fn();e.cleanup=typeof i==="function"?i:void 0}finally{--D,g=t,e.flags&=-5,z(e)}}else if(e.deps!==void 0)e.flags=2|n&64}function q(){try{while(v<x){let e=m[v];m[v++]=void 0,Z(e)}}finally{while(v<x){let e=m[v];m[v++]=void 0,e.flags|=10}if(v=0,x=0,m.length>64)m.length=64}}function ee(){let e=this.flags;if(e&16||e&32&&(F(this.deps,this)||(this.flags=e&-33,!1))){if(G(this)){let t=this.subs;if(t!==void 0)I(t)}}else if(!e){this.flags=5;let t=g;g=this;try{this.value=this.getter()}finally{g=t,this.flags&=-5}}let n=g;if(n!==void 0)M(this,n,_);return this.value}function te(...e){if(e.length){if(!Object.is(this.pendingValue,this.pendingValue=e[0])){this.flags=17;let n=this.subs;if(n!==void 0){if(Y(n,!!D),!O)q()}}}else{if(this.flags&16){if(H(this)){let t=this.subs;if(t!==void 0)I(t)}}let n=g;if(n!==void 0)M(this,n,_);return this.currentValue}}function $(e){let n=e.cleanup;e.cleanup=void 0;let t=g;g=void 0;try{n()}finally{g=t}}function J(){if(j.call(this),this.cleanup)$(this)}function j(){this.flags=0,U(this);let e=this.subs;if(e!==void 0)C(e)}function U(e){let n=e.depsTail;while(n!==void 0){let t=n.prevDep;C(n,e),n=t}}function z(e){let n=e.depsTail,t=n!==void 0?n.nextDep:e.deps;while(t!==void 0)t=C(t,e)}function B(e){let n=g;g=void 0;try{return e()}finally{g=n}}function le(e,n,{immediate:t=!1}={}){let i,s=!0;return S(()=>{let r=e();if(s){if(s=!1,i=r,t)B(()=>n(r,void 0));return}if(Object.is(i,r))return;let u=i;i=r,B(()=>n(r,u))})}function ae(e,n){let t=n,i;try{let r=localStorage.getItem(e);if(r!==null)t=JSON.parse(r),i=r}catch{}let s=T(t);return S(()=>{try{let r=JSON.stringify(s());if(i!==r)localStorage.setItem(e,r),i=r}catch{}}),s}var w=typeof document<"u"?document:null,ne="http://www.w3.org/2000/svg",ie=new Set("svg path circle rect line polyline polygon g defs text textPath tspan use symbol image marker ellipse foreignObject clipPath mask linearGradient radialGradient pattern filter stop animate animateMotion animateTransform view desc metadata title switch feGaussianBlur feOffset feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feImage feMerge feMergeNode feMorphology fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),se=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","defer","disabled","formNoValidate","hidden","inert","loop","multiple","muted","noValidate","open","playsInline","readOnly","required","reversed","selected"]);function P(e,n,t,i){let s=n.toLowerCase();if(s==="innerhtml"||s==="outerhtml"||s==="srcdoc")return;if(s.startsWith("on")&&t!=null&&t!==!1)return;if(/^(href|src|action|formaction|poster|data|xlink:href)$/i.test(n)&&t!=null&&t!==!1){if(typeof t!=="string")return;try{let r=new URL(t,"https://placeholder.invalid/").protocol,u=r==="data:"&&s==="src"&&/^(img|source|video|audio|track|input)$/i.test(e.tagName)&&/^data:image\/(png|jpe?g|gif|webp|avif|bmp);/i.test(t.trim());if(!/^(https?|mailto|tel|blob):$/.test(r)&&!u)return}catch{return}}if(n==="class"||n==="className"){if(i)if(t==null||t===!1)e.removeAttribute("class");else e.setAttribute("class",t===!0?"":t);else e.className=t??"";return}if(se.has(n)&&!i&&n in e){let r=t!=null&&t!==!1;if(e[n]=r,r)e.setAttribute(n,"");else e.removeAttribute(n);return}if(t==null||t===!1){if(n==="style")e._lastStyle=void 0;e.removeAttribute(n);return}if(n==="style"){let r=e._lastStyle;if(typeof t==="string"){if(r!==void 0)e.removeAttribute("style"),e._lastStyle=void 0;e.setAttribute("style",t);return}if(typeof t==="object"){if(r){for(let u in r)if(!(u in t))if(u.startsWith("--"))e.style.removeProperty(u);else e.style[u]=""}for(let u in t){let l=t[u];if(u.startsWith("--"))if(l==null||l===!1)e.style.removeProperty(u);else e.style.setProperty(u,String(l));else e.style[u]=l==null||l===!1?"":String(l)}e._lastStyle=t;return}}if(i){e.setAttribute(n,t===!0?"":t);return}if(n in e&&typeof e[n]!=="function")e[n]=t;else e.setAttribute(n,t===!0?"":t)}function N(e){let n=[e];while(n.length){let t=n.pop();if(t._stopScope)t._stopScope(),t._stopScope=null;if(t._cln){for(let s of t._cln)s();t._cln=null}let i=t.childNodes;for(let s=0,r=i.length;s<r;s++)n.push(i[s])}}function R(e,n={},...t){if(typeof e==="function"){let l,d=V(()=>{l=e(n,t)}),f=(a)=>{if(a instanceof Node)a._stopScope=d;else if(Array.isArray(a))a.forEach(f)};return f(l),l}if(n instanceof Node||Array.isArray(n)||n!==null&&typeof n!=="object")t=[n,...t],n={};let i=ie.has(e),s=i?w.createElementNS(ne,e):w.createElement(e),r;for(let l of Object.keys(n||{})){let d=n[l];if(l==="ref"){if(typeof d==="function")d(s);else if(d!=null&&typeof d==="object")d.current=s;continue}if(e==="select"&&l==="value"){r=d;continue}if(l.startsWith("on")&&typeof d==="function"){let f=l.slice(2).toLowerCase();s.addEventListener(f,d),(s._cln||(s._cln=[])).push(()=>s.removeEventListener(f,d))}else if(typeof d==="function")S(()=>P(s,l,d(),i));else P(s,l,d,i)}let u=(l)=>{if(Array.isArray(l)){for(let d of l)u(d);return}if(l==null||l===!1||l===!0)return;if(typeof l==="function"){let d=w.createComment("");s.appendChild(d);let f=S(()=>{let a=l(),p=Array.isArray(a)?a:[a],c=[];for(let o of p){if(o==null||o===!1||o===!0)continue;c.push(o instanceof Node?o:w.createTextNode(String(o)))}for(let o of c)s.insertBefore(o,d);return()=>{for(let o of c)N(o),o.remove()}});(s._cln||(s._cln=[])).push(f);return}s.appendChild(l instanceof Node?l:w.createTextNode(String(l)))};if(u(t),r!==void 0)if(typeof r==="function")S(()=>P(s,"value",r(),i));else P(s,"value",r,i);return s}function ce(e,n){let t=typeof n==="string"?w.querySelector(n):n;if(!t)return()=>{};let i,s=V(()=>{i=R(e,{})}),r=(Array.isArray(i)?i:[i]).filter((u)=>u!=null&&u!==!1&&u!==!0).map((u)=>u instanceof Node?u:w.createTextNode(String(u)));while(t.firstChild)N(t.firstChild),t.removeChild(t.firstChild);for(let u of r)t.appendChild(u);return()=>{s();for(let u of r)N(u);t.replaceChildren()}}function de(e){if(!(e instanceof Node))return;if(N(e),e.parentNode)e.parentNode.removeChild(e)}var fe="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 table tbody td template textarea tfoot th thead time tr u ul video",pe=(e=typeof window<"u"?window:null)=>{if(!e)return;for(let n of fe.split(" "))e[n]=(t,...i)=>R(n,t,...i)},E=T(typeof window<"u"?window.location.hash.slice(1)||"/":"/"),oe=T({});if(typeof window<"u")window.addEventListener("hashchange",()=>{E(window.location.hash.slice(1)||"/")});var K=new Map,L=T(0);if(typeof window<"u")window.__sigpro_hmr_page__=(e,n)=>{K.set(e,n),L(L()+1)};var W=(e)=>()=>{e=[...e].sort((u,l)=>(u.path==="*")-(l.path==="*")||u.path.split("/").filter((d)=>d[0]===":").length-l.path.split("/").filter((d)=>d[0]===":").length);let n=R("div",{class:"router-hook"}),t,i,s,r=S(()=>{L();let u=E(),d=u.split(/[?#]/)[0].split("/").filter(Boolean),f=e.find((c)=>{let o=c.path.split("/").filter(Boolean);return o.length===d.length&&o.every((h,b)=>h[0]===":"||h===d[b])})||e.find((c)=>c.path==="*");if(!f){if(t)t(),t=void 0;n.replaceChildren(),i=s=void 0;return}let a={};f.path.split("/").filter(Boolean).forEach((c,o)=>{if(c[0]===":")a[c.slice(1)]=d[o]});let p=K.get(f.path)??f.component;if(u===i&&p===s)return;if(i=u,s=p,t)t();oe(a),t=V(()=>{let c=typeof p==="function"?R(p,a):p,o=c==null?[]:Array.isArray(c)?c:[c];n.replaceChildren(...o)})});return n._stopScope=()=>{if(t)t();r()},n};W.to=(e)=>{if(typeof window<"u")window.location.hash=e.replace(/^#?\/?/,"#/")};W.back=()=>{if(typeof window<"u")window.history.back()};W.path=()=>E();var Q=T("en"),A={},he=(e)=>{for(let n of Object.keys(e))A[n]||={},Object.assign(A[n],e[n])},ge=(e)=>{if(e&&A[e])Q(e)},be=(e)=>()=>A[Q()]?.[e]??e,ye=async(e,n=null,t=null,i=null)=>{if(t)t(!0);try{let s=typeof FormData<"u"&&n instanceof FormData,r=typeof Blob<"u"&&n instanceof Blob,u=typeof URLSearchParams<"u"&&n instanceof URLSearchParams,l=s||r||u,d=await fetch(e,{method:n!==null&&n!==void 0?"POST":"GET",headers:l?void 0:{"Content-Type":"application/json"},body:n==null?void 0:l?n:JSON.stringify(n),credentials:"include",signal:i});if(!d.ok)throw Object.assign(Error(`HTTP ${d.status}`),{status:d.status,statusText:d.statusText});if(d.status===204)return null;return await d.json()}finally{if(t)t(!1)}};export{le as watch,B as untrack,de as unmount,be as t,T as signal,ge as setLocale,oe as routerParams,W as router,ce as mount,ae as local,L as hmrTick,R as h,pe as exposeTags,S as effect,ye as db,E as currentPath,Q as currentLocale,re as computed,ue as batch,he as addLang};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigpro",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
package/sigpro.d.ts CHANGED
@@ -10,12 +10,11 @@
10
10
  // ============================================================================
11
11
 
12
12
  /**
13
- * A reactive signal. Call with no args to read, with a value or an updater
14
- * function to write.
13
+ * A reactive signal. Call with no args to read, with a value to write.
15
14
  */
16
15
  export interface Signal<T> {
17
16
  (): T;
18
- (value: T | ((prev: T) => T)): void;
17
+ (value: T): void;
19
18
  }
20
19
 
21
20
  export function signal<T>(initialValue: T): Signal<T>;
@@ -31,12 +30,6 @@ export function computed<T>(getter: (oldValue?: T) => T): ReadonlySignal<T>;
31
30
  */
32
31
  export function effect(fn: () => void | (() => void)): () => void;
33
32
 
34
- /**
35
- * Groups child effects in a scope. Does not track deps and does not
36
- * re-execute. Returns a disposer for all effects created inside.
37
- */
38
- export function effectScope(fn: () => void): () => void;
39
-
40
33
  /** Runs `fn` without tracking reads as dependencies. */
41
34
  export function untrack<T>(fn: () => T): T;
42
35
 
@@ -71,16 +64,20 @@ export type PropValue<T = any> = T | (() => T);
71
64
  *
72
65
  * Special keys:
73
66
  * - `ref`: function or `{ current }` object
74
- * - `html`: sets `innerHTML` reactively (children ignored when present)
75
- * - `on*`: DOM event listeners (case-sensitive after `on`: `onclick`, `onInput`)
67
+ * - `on*`: DOM event listeners (e.g. `onclick`, `onInput`)
76
68
  * - `class` / `className`: element class
77
- * - `style`: CSS string or object of properties
69
+ * - `style`: CSS string or object of properties (camelCase keys,
70
+ * `--custom` keys go through `setProperty`)
78
71
  * - anything else: assigned as property if present on the element,
79
72
  * otherwise set as attribute
73
+ *
74
+ * For security, `innerHTML`, `outerHTML` and `srcdoc` are ignored.
75
+ * URL props (`href`, `src`, `action`, `formAction`, `poster`, `data`,
76
+ * `xlink:href`) are restricted to `http(s)`, `mailto`, `tel`, `blob`,
77
+ * and safe `data:image/*` for images.
80
78
  */
81
79
  export type Props = {
82
80
  ref?: ((el: Element) => void) | { current: Element | null };
83
- html?: PropValue<string | null | undefined>;
84
81
  class?: PropValue<string | null | undefined>;
85
82
  className?: PropValue<string | null | undefined>;
86
83
  style?: PropValue<
@@ -147,7 +144,7 @@ export function unmount(node: Node): void;
147
144
  // ============================================================================
148
145
 
149
146
  export interface RouteDefinition {
150
- /** `/`, `/user/:id`, `/blog/*`, or `*` for fallback. */
147
+ /** `/`, `/user/:id`, or `*` for fallback. */
151
148
  path: string;
152
149
  component:
153
150
  | ((params: Record<string, string>) => Node | Node[] | null)
@@ -202,8 +199,17 @@ export function t(key: string): () => string;
202
199
  // ============================================================================
203
200
 
204
201
  /**
205
- * JSON fetch helper. POSTs when `data` is provided, GETs otherwise. Calls
202
+ * Fetch helper. POSTs when `data` is provided, GETs otherwise. Calls
206
203
  * `loading(true/false)` around the request. Pass `abortSignal` to cancel.
204
+ *
205
+ * `data` may be:
206
+ * - a plain object/array/primitive → sent as JSON
207
+ * - `FormData` → sent as multipart/form-data (browser sets Content-Type)
208
+ * - `Blob` / `File` → sent as binary (browser sets Content-Type)
209
+ * - `URLSearchParams` → sent as application/x-www-form-urlencoded
210
+ *
211
+ * On non-2xx responses the returned Error has `status` and `statusText`.
212
+ * Returns `null` for 204/205 responses. Parses the response as JSON.
207
213
  */
208
214
  export function db<T = any>(
209
215
  url: string,
@@ -212,25 +218,6 @@ export function db<T = any>(
212
218
  abortSignal?: AbortSignal | null
213
219
  ): Promise<T>;
214
220
 
215
- // ============================================================================
216
- // Universal factory
217
- // ============================================================================
218
-
219
- /**
220
- * Universal reactive factory:
221
- * - called with a getter → wrapped in `computed()`
222
- * - called with a value + key → `local(key, value)`
223
- * - called with a value → `signal(value)`
224
- *
225
- * @example
226
- * const count = $(0); // signal
227
- * const theme = $('dark', 'app.theme'); // localStorage signal
228
- * const double = $(() => count() * 2); // computed
229
- */
230
- export function $<T>(getter: (oldValue?: T) => T): ReadonlySignal<T>;
231
- export function $<T>(value: T, key: string): Signal<T>;
232
- export function $<T>(value: T): Signal<T>;
233
-
234
221
  // ============================================================================
235
222
  // Tag Helpers (registered by `exposeTags`)
236
223
  // ============================================================================
@@ -311,7 +298,6 @@ export const strong: TagHelper;
311
298
  export const sub: TagHelper;
312
299
  export const summary: TagHelper;
313
300
  export const sup: TagHelper;
314
- export const svg: TagHelper;
315
301
  export const table: TagHelper;
316
302
  export const tbody: TagHelper;
317
303
  export const td: TagHelper;
@@ -334,7 +320,6 @@ declare const SigPro: {
334
320
  signal: typeof signal;
335
321
  computed: typeof computed;
336
322
  effect: typeof effect;
337
- effectScope: typeof effectScope;
338
323
  untrack: typeof untrack;
339
324
  batch: typeof batch;
340
325
  watch: typeof watch;
@@ -352,7 +337,6 @@ declare const SigPro: {
352
337
  setLocale: typeof setLocale;
353
338
  t: typeof t;
354
339
  db: typeof db;
355
- $: typeof $;
356
340
  };
357
341
 
358
342
  export default SigPro;
@@ -368,7 +352,6 @@ declare global {
368
352
  signal: typeof signal;
369
353
  computed: typeof computed;
370
354
  effect: typeof effect;
371
- effectScope: typeof effectScope;
372
355
  untrack: typeof untrack;
373
356
  batch: typeof batch;
374
357
  watch: typeof watch;
@@ -386,7 +369,6 @@ declare global {
386
369
  setLocale: typeof setLocale;
387
370
  t: typeof t;
388
371
  db: typeof db;
389
- $: typeof $;
390
372
 
391
373
  a: TagHelper; abbr: TagHelper; article: TagHelper; aside: TagHelper;
392
374
  audio: TagHelper; b: TagHelper; blockquote: TagHelper; br: TagHelper;
@@ -405,7 +387,7 @@ declare global {
405
387
  p: TagHelper; picture: TagHelper; pre: TagHelper; progress: TagHelper;
406
388
  section: TagHelper; select: TagHelper; slot: TagHelper; small: TagHelper;
407
389
  source: TagHelper; span: TagHelper; strong: TagHelper; sub: TagHelper;
408
- summary: TagHelper; sup: TagHelper; svg: TagHelper; table: TagHelper;
390
+ summary: TagHelper; sup: TagHelper; table: TagHelper;
409
391
  tbody: TagHelper; td: TagHelper; template: TagHelper; textarea: TagHelper;
410
392
  tfoot: TagHelper; th: TagHelper; thead: TagHelper; time: TagHelper;
411
393
  tr: TagHelper; u: TagHelper; ul: TagHelper; video: TagHelper;