From f98cb19ee1aaf925f745cd062ee3c01d82d27a3e Mon Sep 17 00:00:00 2001 From: natxocc Date: Wed, 29 Apr 2026 22:54:00 +0200 Subject: [PATCH] Increase exports --- dist/sigpro.esm.js | 5 ++++- dist/sigpro.esm.min.js | 2 +- dist/sigpro.js | 5 ++++- dist/sigpro.min.js | 2 +- docs/sigpro.js | 5 ++++- sigpro.js | 4 ++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dist/sigpro.esm.js b/dist/sigpro.esm.js index 94e11dc..f72f82b 100644 --- a/dist/sigpro.esm.js +++ b/dist/sigpro.esm.js @@ -514,7 +514,7 @@ var mount = (comp, target) => { return inst; }; if (typeof window !== "undefined") { - Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch }); + Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj }); "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".split(" ").forEach((tag) => { window[tag] = (props, children) => h(tag, props, children); }); @@ -525,6 +525,9 @@ export { router, onUnmount, mount, + isObj, + isFunc, + isArr, h, each, batch, diff --git a/dist/sigpro.esm.min.js b/dist/sigpro.esm.min.js index 9ff93a3..d2f1c8e 100644 --- a/dist/sigpro.esm.min.js +++ b/dist/sigpro.esm.min.js @@ -1 +1 @@ -var w=(e)=>typeof e==="function",B=(e)=>e&&typeof e==="object",g=Array.isArray,E=typeof document<"u"?document:null,V=(e)=>e?._isRuntime?e.container:e instanceof Node?e:E.createTextNode(e==null?"":String(e)),d=null,_=null,N=!1,R=0,O=new Set,I=new WeakMap,j=Symbol("iter"),k=new WeakMap,W="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xlink",q=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),b=(e)=>{if(!e||e._disposed)return;e._disposed=!0;let s=[e];while(s.length){let n=s.pop();if(n._cleanups)n._cleanups.forEach((r)=>r()),n._cleanups.clear();if(n._children)n._children.forEach((r)=>s.push(r)),n._children.clear();if(n._deps)n._deps.forEach((r)=>r.delete(n)),n._deps.clear()}},v=(e)=>{if(_)(_._cleanups||=new Set).add(e)},K=(e)=>{let s=d;d=null;try{return e()}finally{d=s}},x=(e,s=!1)=>{let n=()=>{if(n._disposed)return;if(n._deps)n._deps.forEach((i)=>i.delete(n));if(n._cleanups)n._cleanups.forEach((i)=>i()),n._cleanups.clear();let r=d,o=_;d=_=n;try{return n._result=e()}catch(i){console.error("[SigPro]",i)}finally{d=r,_=o}};if(n._deps=n._cleanups=n._children=null,n._disposed=!1,n._isComputed=s,n._depth=d?d._depth+1:0,n._mounts=[],n._parent=_,_)(_._children||=new Set).add(n);return n},$=()=>{if(N)return;N=!0;let e=Array.from(O).sort((s,n)=>s._depth-n._depth);O.clear();for(let s of e)if(!s._disposed)s();N=!1},z=(e)=>{R++;try{return e()}finally{if(R--,R===0&&O.size>0&&!N)$()}},m=(e,s=!1)=>{if(!s&&d&&!d._disposed)e.add(d),(d._deps||=new Set).add(e);else if(s&&e.size>0){let n=!1;for(let r of e){if(r===d||r._disposed)continue;if(r._isComputed){if(r._dirty=!0,r._subs)m(r._subs,!0)}else O.add(r),n=!0}if(n&&!N&&R===0)queueMicrotask($)}},P=(e,s=null)=>{let n=new Set;if(w(e)){let r,o=()=>{if(o._dirty){let i=d;d=o;try{let t=e();if(!Object.is(r,t))r=t,m(n,!0)}finally{d=i}o._dirty=!1}return m(n),r};return o._isComputed=!0,o._subs=n,o._dirty=!0,o._deps=null,o._disposed=!1,o}if(s)try{e=JSON.parse(localStorage.getItem(s))??e}catch(r){}return(...r)=>{if(r.length){let o=w(r[0])?r[0](e):r[0];if(!Object.is(e,o)){if(e=o,s)localStorage.setItem(s,JSON.stringify(e));m(n,!0)}}return m(n),e}},D=(e)=>{if(!B(e))return e;let s=I.get(e);if(s)return s;let n=new Map,r=(i)=>{let t=n.get(i);if(!t)n.set(i,t=new Set);return t},o=new Proxy(e,{get(i,t,c){if(typeof t!=="symbol")m(r(t));return D(Reflect.get(i,t,c))},set(i,t,c,l){let a=Reflect.has(i,t),f=Reflect.get(i,t,l),u=Reflect.set(i,t,c,l);if(u&&!Object.is(f,c)){if(m(r(t),!0),!a)m(r(j),!0)}return u},deleteProperty(i,t){let c=Reflect.deleteProperty(i,t);if(c)m(r(t),!0),m(r(j),!0);return c},ownKeys(i){return m(r(j)),Reflect.ownKeys(i)}});return I.set(e,o),o},T=(e,s)=>{if(s===void 0){let r=x(e);return r(),()=>b(r)}let n=x(()=>{let r=Array.isArray(e)?e.map((o)=>o()):e();K(()=>s(r))});return n(),()=>b(n)},U=(e)=>{if(!e)return;if(e._cleanups)e._cleanups.forEach((s)=>s()),e._cleanups.clear();if(e._ownerEffect)b(e._ownerEffect);if(e.childNodes)e.childNodes.forEach((s)=>U(s))},J=/^\s*(javascript|data|vbscript):/i,Q=new Set(["src","href","formaction","action","background","code","archive"]),X=(e)=>Q.has(e)||e.startsWith("on"),L=(e,s)=>{if(s==null||s===!1)return null;if(X(e)){let n=String(s);if(J.test(n))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${e}`),"#"}return s},A=(e,s={},n=[])=>{if(s instanceof Node||g(s)||!B(s))n=s,s={};if(w(e)){let t=x(()=>{let f=e(s,{children:n,emit:(u,...h)=>s[`on${u[0].toUpperCase()}${u.slice(1)}`]?.(...h)});return t._result=f,f});t();let c=t._result;if(c==null)return null;let l=c instanceof Node||g(c)&&c.every((f)=>f instanceof Node)?c:E.createTextNode(String(c)),a=(f)=>{if(B(f)&&!f._isRuntime)f._mounts=t._mounts||[],f._cleanups=t._cleanups||new Set,f._ownerEffect=t};return g(l)?l.forEach(a):a(l),l}let r=q.has(e),o=r?E.createElementNS(W,e):E.createElement(e);o._cleanups=new Set;for(let t of Object.keys(s)){let c=s[t];if(t==="ref"){w(c)?c(o):c.current=o;continue}if(r&&t.startsWith("xlink:")){let l=L(t.slice(6),c);l==null?o.removeAttributeNS(M,t.slice(6)):o.setAttributeNS(M,t.slice(6),l);continue}if(t.startsWith("on")){let l=t.slice(2).toLowerCase();o.addEventListener(l,c);let a=()=>o.removeEventListener(l,c);o._cleanups.add(a),v(a)}else if(w(c)){let l=x(()=>{let a=L(t,c());if(t==="class")o.className=a||"";else if(a==null)o.removeAttribute(t);else if(t==="style"&&typeof a==="string")o.setAttribute("style",a);else if(t in o&&!r)o[t]=a;else o.setAttribute(t,a===!0?"":a)});if(l(),o._cleanups.add(()=>b(l)),v(()=>b(l)),/^(INPUT|TEXTAREA|SELECT)$/.test(o.tagName)&&(t==="value"||t==="checked")){let a=t==="checked"?"change":"input";o.addEventListener(a,(f)=>c(f.target[t]))}}else{let l=L(t,c);if(l!=null)if(t==="style"&&typeof l==="string")o.setAttribute("style",l);else if(t in o&&!r)o[t]=l;else o.setAttribute(t,l===!0?"":l)}}let i=(t)=>{if(g(t))return t.forEach(i);if(w(t)){let c=E.createTextNode("");o.appendChild(c);let l=[],a=x(()=>{let f=t(),u=(g(f)?f:[f]).map(V);l.forEach((p)=>{if(p._isRuntime)p.destroy();else U(p);if(p.parentNode)p.remove()});let h=c;for(let p=u.length-1;p>=0;p--){let y=u[p];if(y.parentNode!==h.parentNode)h.parentNode?.insertBefore(y,h);if(y._mounts)y._mounts.forEach((G)=>G());h=y}l=u});a(),o._cleanups.add(()=>b(a)),v(()=>b(a))}else{let c=V(t);if(o.appendChild(c),c._mounts)c._mounts.forEach((l)=>l())}};return i(n),o},C=(e)=>{let s=new Set,n=_,r=d,o=E.createElement("div");o.style.display="contents",o.setAttribute("role","presentation"),_={_cleanups:s},d=null;let i=(t)=>{if(!t)return;if(t._isRuntime)s.add(t.destroy),o.appendChild(t.container);else if(g(t))t.forEach(i);else o.appendChild(t instanceof Node?t:E.createTextNode(String(t==null?"":t)))};try{i(e({onCleanup:(t)=>s.add(t)}))}finally{_=n,d=r}return{_isRuntime:!0,container:o,destroy:()=>{s.forEach((t)=>t()),U(o),o.remove()}}},F=(e,s,n=null)=>{let r=E.createTextNode(""),o=A("div",{style:"display:contents"},[r]),i=null;return T(()=>!!(w(e)?e():e),(t)=>{if(i)i.destroy(),i=null;let c=t?s:n;if(c)i=C(()=>w(c)?c():c),o.insertBefore(i.container,r)}),v(()=>i?.destroy()),o},H=(e,s,n)=>{let r=E.createTextNode(""),o=A("div",{style:"display:contents"},[r]),i=new Map;return T(()=>(w(e)?e():e)||[],(t)=>{let c=new Map,l=[],a=t||[];for(let u=0;us(h,u));else i.delete(p);c.set(p,y),l.push(y)}i.forEach((u)=>u.destroy());let f=r;for(let u=l.length-1;u>=0;u--){let p=l[u].container;if(p.nextSibling!==f)o.insertBefore(p,f);f=p}i=c}),o},S=(e)=>{let s=()=>window.location.hash.slice(1)||"/",n=P(s()),r=()=>n(s());window.addEventListener("hashchange",r),v(()=>window.removeEventListener("hashchange",r));let o=A("div",{class:"router-hook"}),i=null;return T([n],()=>{let t=n(),c=e.find((l)=>{let a=l.path.split("/").filter(Boolean),f=t.split("/").filter(Boolean);return a.length===f.length&&a.every((u,h)=>u[0]===":"||u===f[h])})||e.find((l)=>l.path==="*");if(c){i?.destroy();let l={};c.path.split("/").filter(Boolean).forEach((a,f)=>{if(a[0]===":")l[a.slice(1)]=t.split("/").filter(Boolean)[f]}),S.params(l),i=C(()=>w(c.component)?c.component(l):c.component),o.replaceChildren(i.container)}}),o};S.params=P({});S.to=(e)=>window.location.hash=e.replace(/^#?\/?/,"#/");S.back=()=>window.history.back();S.path=()=>window.location.hash.replace(/^#/,"")||"/";var Y=(e,s)=>{let n=typeof s==="string"?E.querySelector(s):s;if(!n)return;if(k.has(n))k.get(n).destroy();let r=C(w(e)?e:()=>e);return n.replaceChildren(r.container),k.set(n,r),r};if(typeof window<"u")Object.assign(window,{$:P,$$:D,watch:T,h:A,when:F,each:H,router:S,mount:Y,batch:z}),"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".split(" ").forEach((e)=>{window[e]=(s,n)=>A(e,s,n)});export{F as when,T as watch,S as router,v as onUnmount,Y as mount,A as h,H as each,z as batch,D as $$,P as $}; +var _=(e)=>typeof e==="function",O=(e)=>e&&typeof e==="object",b=Array.isArray,E=typeof document<"u"?document:null,V=(e)=>e?._isRuntime?e.container:e instanceof Node?e:E.createTextNode(e==null?"":String(e)),d=null,m=null,v=!1,R=0,T=new Set,I=new WeakMap,k=Symbol("iter"),L=new WeakMap,W="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xlink",q=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),g=(e)=>{if(!e||e._disposed)return;e._disposed=!0;let s=[e];while(s.length){let n=s.pop();if(n._cleanups)n._cleanups.forEach((r)=>r()),n._cleanups.clear();if(n._children)n._children.forEach((r)=>s.push(r)),n._children.clear();if(n._deps)n._deps.forEach((r)=>r.delete(n)),n._deps.clear()}},S=(e)=>{if(m)(m._cleanups||=new Set).add(e)},K=(e)=>{let s=d;d=null;try{return e()}finally{d=s}},x=(e,s=!1)=>{let n=()=>{if(n._disposed)return;if(n._deps)n._deps.forEach((i)=>i.delete(n));if(n._cleanups)n._cleanups.forEach((i)=>i()),n._cleanups.clear();let r=d,o=m;d=m=n;try{return n._result=e()}catch(i){console.error("[SigPro]",i)}finally{d=r,m=o}};if(n._deps=n._cleanups=n._children=null,n._disposed=!1,n._isComputed=s,n._depth=d?d._depth+1:0,n._mounts=[],n._parent=m,m)(m._children||=new Set).add(n);return n},$=()=>{if(v)return;v=!0;let e=Array.from(T).sort((s,n)=>s._depth-n._depth);T.clear();for(let s of e)if(!s._disposed)s();v=!1},z=(e)=>{R++;try{return e()}finally{if(R--,R===0&&T.size>0&&!v)$()}},w=(e,s=!1)=>{if(!s&&d&&!d._disposed)e.add(d),(d._deps||=new Set).add(e);else if(s&&e.size>0){let n=!1;for(let r of e){if(r===d||r._disposed)continue;if(r._isComputed){if(r._dirty=!0,r._subs)w(r._subs,!0)}else T.add(r),n=!0}if(n&&!v&&R===0)queueMicrotask($)}},P=(e,s=null)=>{let n=new Set;if(_(e)){let r,o=()=>{if(o._dirty){let i=d;d=o;try{let t=e();if(!Object.is(r,t))r=t,w(n,!0)}finally{d=i}o._dirty=!1}return w(n),r};return o._isComputed=!0,o._subs=n,o._dirty=!0,o._deps=null,o._disposed=!1,o}if(s)try{e=JSON.parse(localStorage.getItem(s))??e}catch(r){}return(...r)=>{if(r.length){let o=_(r[0])?r[0](e):r[0];if(!Object.is(e,o)){if(e=o,s)localStorage.setItem(s,JSON.stringify(e));w(n,!0)}}return w(n),e}},D=(e)=>{if(!O(e))return e;let s=I.get(e);if(s)return s;let n=new Map,r=(i)=>{let t=n.get(i);if(!t)n.set(i,t=new Set);return t},o=new Proxy(e,{get(i,t,c){if(typeof t!=="symbol")w(r(t));return D(Reflect.get(i,t,c))},set(i,t,c,l){let a=Reflect.has(i,t),f=Reflect.get(i,t,l),u=Reflect.set(i,t,c,l);if(u&&!Object.is(f,c)){if(w(r(t),!0),!a)w(r(k),!0)}return u},deleteProperty(i,t){let c=Reflect.deleteProperty(i,t);if(c)w(r(t),!0),w(r(k),!0);return c},ownKeys(i){return w(r(k)),Reflect.ownKeys(i)}});return I.set(e,o),o},C=(e,s)=>{if(s===void 0){let r=x(e);return r(),()=>g(r)}let n=x(()=>{let r=Array.isArray(e)?e.map((o)=>o()):e();K(()=>s(r))});return n(),()=>g(n)},U=(e)=>{if(!e)return;if(e._cleanups)e._cleanups.forEach((s)=>s()),e._cleanups.clear();if(e._ownerEffect)g(e._ownerEffect);if(e.childNodes)e.childNodes.forEach((s)=>U(s))},J=/^\s*(javascript|data|vbscript):/i,Q=new Set(["src","href","formaction","action","background","code","archive"]),X=(e)=>Q.has(e)||e.startsWith("on"),B=(e,s)=>{if(s==null||s===!1)return null;if(X(e)){let n=String(s);if(J.test(n))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${e}`),"#"}return s},A=(e,s={},n=[])=>{if(s instanceof Node||b(s)||!O(s))n=s,s={};if(_(e)){let t=x(()=>{let f=e(s,{children:n,emit:(u,...h)=>s[`on${u[0].toUpperCase()}${u.slice(1)}`]?.(...h)});return t._result=f,f});t();let c=t._result;if(c==null)return null;let l=c instanceof Node||b(c)&&c.every((f)=>f instanceof Node)?c:E.createTextNode(String(c)),a=(f)=>{if(O(f)&&!f._isRuntime)f._mounts=t._mounts||[],f._cleanups=t._cleanups||new Set,f._ownerEffect=t};return b(l)?l.forEach(a):a(l),l}let r=q.has(e),o=r?E.createElementNS(W,e):E.createElement(e);o._cleanups=new Set;for(let t of Object.keys(s)){let c=s[t];if(t==="ref"){_(c)?c(o):c.current=o;continue}if(r&&t.startsWith("xlink:")){let l=B(t.slice(6),c);l==null?o.removeAttributeNS(M,t.slice(6)):o.setAttributeNS(M,t.slice(6),l);continue}if(t.startsWith("on")){let l=t.slice(2).toLowerCase();o.addEventListener(l,c);let a=()=>o.removeEventListener(l,c);o._cleanups.add(a),S(a)}else if(_(c)){let l=x(()=>{let a=B(t,c());if(t==="class")o.className=a||"";else if(a==null)o.removeAttribute(t);else if(t==="style"&&typeof a==="string")o.setAttribute("style",a);else if(t in o&&!r)o[t]=a;else o.setAttribute(t,a===!0?"":a)});if(l(),o._cleanups.add(()=>g(l)),S(()=>g(l)),/^(INPUT|TEXTAREA|SELECT)$/.test(o.tagName)&&(t==="value"||t==="checked")){let a=t==="checked"?"change":"input";o.addEventListener(a,(f)=>c(f.target[t]))}}else{let l=B(t,c);if(l!=null)if(t==="style"&&typeof l==="string")o.setAttribute("style",l);else if(t in o&&!r)o[t]=l;else o.setAttribute(t,l===!0?"":l)}}let i=(t)=>{if(b(t))return t.forEach(i);if(_(t)){let c=E.createTextNode("");o.appendChild(c);let l=[],a=x(()=>{let f=t(),u=(b(f)?f:[f]).map(V);l.forEach((p)=>{if(p._isRuntime)p.destroy();else U(p);if(p.parentNode)p.remove()});let h=c;for(let p=u.length-1;p>=0;p--){let y=u[p];if(y.parentNode!==h.parentNode)h.parentNode?.insertBefore(y,h);if(y._mounts)y._mounts.forEach((G)=>G());h=y}l=u});a(),o._cleanups.add(()=>g(a)),S(()=>g(a))}else{let c=V(t);if(o.appendChild(c),c._mounts)c._mounts.forEach((l)=>l())}};return i(n),o},j=(e)=>{let s=new Set,n=m,r=d,o=E.createElement("div");o.style.display="contents",o.setAttribute("role","presentation"),m={_cleanups:s},d=null;let i=(t)=>{if(!t)return;if(t._isRuntime)s.add(t.destroy),o.appendChild(t.container);else if(b(t))t.forEach(i);else o.appendChild(t instanceof Node?t:E.createTextNode(String(t==null?"":t)))};try{i(e({onCleanup:(t)=>s.add(t)}))}finally{m=n,d=r}return{_isRuntime:!0,container:o,destroy:()=>{s.forEach((t)=>t()),U(o),o.remove()}}},F=(e,s,n=null)=>{let r=E.createTextNode(""),o=A("div",{style:"display:contents"},[r]),i=null;return C(()=>!!(_(e)?e():e),(t)=>{if(i)i.destroy(),i=null;let c=t?s:n;if(c)i=j(()=>_(c)?c():c),o.insertBefore(i.container,r)}),S(()=>i?.destroy()),o},H=(e,s,n)=>{let r=E.createTextNode(""),o=A("div",{style:"display:contents"},[r]),i=new Map;return C(()=>(_(e)?e():e)||[],(t)=>{let c=new Map,l=[],a=t||[];for(let u=0;us(h,u));else i.delete(p);c.set(p,y),l.push(y)}i.forEach((u)=>u.destroy());let f=r;for(let u=l.length-1;u>=0;u--){let p=l[u].container;if(p.nextSibling!==f)o.insertBefore(p,f);f=p}i=c}),o},N=(e)=>{let s=()=>window.location.hash.slice(1)||"/",n=P(s()),r=()=>n(s());window.addEventListener("hashchange",r),S(()=>window.removeEventListener("hashchange",r));let o=A("div",{class:"router-hook"}),i=null;return C([n],()=>{let t=n(),c=e.find((l)=>{let a=l.path.split("/").filter(Boolean),f=t.split("/").filter(Boolean);return a.length===f.length&&a.every((u,h)=>u[0]===":"||u===f[h])})||e.find((l)=>l.path==="*");if(c){i?.destroy();let l={};c.path.split("/").filter(Boolean).forEach((a,f)=>{if(a[0]===":")l[a.slice(1)]=t.split("/").filter(Boolean)[f]}),N.params(l),i=j(()=>_(c.component)?c.component(l):c.component),o.replaceChildren(i.container)}}),o};N.params=P({});N.to=(e)=>window.location.hash=e.replace(/^#?\/?/,"#/");N.back=()=>window.history.back();N.path=()=>window.location.hash.replace(/^#/,"")||"/";var Y=(e,s)=>{let n=typeof s==="string"?E.querySelector(s):s;if(!n)return;if(L.has(n))L.get(n).destroy();let r=j(_(e)?e:()=>e);return n.replaceChildren(r.container),L.set(n,r),r};if(typeof window<"u")Object.assign(window,{$:P,$$:D,watch:C,h:A,when:F,each:H,router:N,mount:Y,batch:z,onUnmount:S,isArr:b,isFunc:_,isObj:O}),"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".split(" ").forEach((e)=>{window[e]=(s,n)=>A(e,s,n)});export{F as when,C as watch,N as router,S as onUnmount,Y as mount,O as isObj,_ as isFunc,b as isArr,A as h,H as each,z as batch,D as $$,P as $}; diff --git a/dist/sigpro.js b/dist/sigpro.js index 626417f..9738d8c 100644 --- a/dist/sigpro.js +++ b/dist/sigpro.js @@ -45,6 +45,9 @@ router: () => router, onUnmount: () => onUnmount, mount: () => mount, + isObj: () => isObj, + isFunc: () => isFunc, + isArr: () => isArr, h: () => h, each: () => each, batch: () => batch, @@ -568,7 +571,7 @@ return inst; }; if (typeof window !== "undefined") { - Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch }); + Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj }); "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".split(" ").forEach((tag) => { window[tag] = (props, children) => h(tag, props, children); }); diff --git a/dist/sigpro.min.js b/dist/sigpro.min.js index e3590a5..b0a0304 100644 --- a/dist/sigpro.min.js +++ b/dist/sigpro.min.js @@ -1 +1 @@ -(()=>{var{defineProperty:k,getOwnPropertyNames:X,getOwnPropertyDescriptor:F}=Object,H=Object.prototype.hasOwnProperty;function Y(e){return this[e]}var Z=(e)=>{var s=(M??=new WeakMap).get(e),t;if(s)return s;if(s=k({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of X(e))if(!H.call(s,o))k(s,o,{get:Y.bind(e,o),enumerable:!(t=F(e,o))||t.enumerable})}return M.set(e,s),s},M;var ee=(e)=>e;function te(e,s){this[e]=ee.bind(null,s)}var ne=(e,s)=>{for(var t in s)k(e,t,{get:s[t],enumerable:!0,configurable:!0,set:te.bind(s,t)})};var ae={};ne(ae,{when:()=>K,watch:()=>R,router:()=>g,onUnmount:()=>N,mount:()=>J,h:()=>v,each:()=>z,batch:()=>q,$$:()=>V,$:()=>C});var w=(e)=>typeof e==="function",U=(e)=>e&&typeof e==="object",S=Array.isArray,E=typeof document<"u"?document:null,$=(e)=>e?._isRuntime?e.container:e instanceof Node?e:E.createTextNode(e==null?"":String(e)),d=null,_=null,x=!1,O=0,T=new Set,D=new WeakMap,L=Symbol("iter"),B=new WeakMap,se="http://www.w3.org/2000/svg",G="http://www.w3.org/1999/xlink",oe=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),b=(e)=>{if(!e||e._disposed)return;e._disposed=!0;let s=[e];while(s.length){let t=s.pop();if(t._cleanups)t._cleanups.forEach((o)=>o()),t._cleanups.clear();if(t._children)t._children.forEach((o)=>s.push(o)),t._children.clear();if(t._deps)t._deps.forEach((o)=>o.delete(t)),t._deps.clear()}},N=(e)=>{if(_)(_._cleanups||=new Set).add(e)},re=(e)=>{let s=d;d=null;try{return e()}finally{d=s}},A=(e,s=!1)=>{let t=()=>{if(t._disposed)return;if(t._deps)t._deps.forEach((i)=>i.delete(t));if(t._cleanups)t._cleanups.forEach((i)=>i()),t._cleanups.clear();let o=d,r=_;d=_=t;try{return t._result=e()}catch(i){console.error("[SigPro]",i)}finally{d=o,_=r}};if(t._deps=t._cleanups=t._children=null,t._disposed=!1,t._isComputed=s,t._depth=d?d._depth+1:0,t._mounts=[],t._parent=_,_)(_._children||=new Set).add(t);return t},W=()=>{if(x)return;x=!0;let e=Array.from(T).sort((s,t)=>s._depth-t._depth);T.clear();for(let s of e)if(!s._disposed)s();x=!1},q=(e)=>{O++;try{return e()}finally{if(O--,O===0&&T.size>0&&!x)W()}},m=(e,s=!1)=>{if(!s&&d&&!d._disposed)e.add(d),(d._deps||=new Set).add(e);else if(s&&e.size>0){let t=!1;for(let o of e){if(o===d||o._disposed)continue;if(o._isComputed){if(o._dirty=!0,o._subs)m(o._subs,!0)}else T.add(o),t=!0}if(t&&!x&&O===0)queueMicrotask(W)}},C=(e,s=null)=>{let t=new Set;if(w(e)){let o,r=()=>{if(r._dirty){let i=d;d=r;try{let n=e();if(!Object.is(o,n))o=n,m(t,!0)}finally{d=i}r._dirty=!1}return m(t),o};return r._isComputed=!0,r._subs=t,r._dirty=!0,r._deps=null,r._disposed=!1,r}if(s)try{e=JSON.parse(localStorage.getItem(s))??e}catch(o){}return(...o)=>{if(o.length){let r=w(o[0])?o[0](e):o[0];if(!Object.is(e,r)){if(e=r,s)localStorage.setItem(s,JSON.stringify(e));m(t,!0)}}return m(t),e}},V=(e)=>{if(!U(e))return e;let s=D.get(e);if(s)return s;let t=new Map,o=(i)=>{let n=t.get(i);if(!n)t.set(i,n=new Set);return n},r=new Proxy(e,{get(i,n,c){if(typeof n!=="symbol")m(o(n));return V(Reflect.get(i,n,c))},set(i,n,c,l){let a=Reflect.has(i,n),f=Reflect.get(i,n,l),u=Reflect.set(i,n,c,l);if(u&&!Object.is(f,c)){if(m(o(n),!0),!a)m(o(L),!0)}return u},deleteProperty(i,n){let c=Reflect.deleteProperty(i,n);if(c)m(o(n),!0),m(o(L),!0);return c},ownKeys(i){return m(o(L)),Reflect.ownKeys(i)}});return D.set(e,r),r},R=(e,s)=>{if(s===void 0){let o=A(e);return o(),()=>b(o)}let t=A(()=>{let o=Array.isArray(e)?e.map((r)=>r()):e();re(()=>s(o))});return t(),()=>b(t)},I=(e)=>{if(!e)return;if(e._cleanups)e._cleanups.forEach((s)=>s()),e._cleanups.clear();if(e._ownerEffect)b(e._ownerEffect);if(e.childNodes)e.childNodes.forEach((s)=>I(s))},ce=/^\s*(javascript|data|vbscript):/i,ie=new Set(["src","href","formaction","action","background","code","archive"]),le=(e)=>ie.has(e)||e.startsWith("on"),P=(e,s)=>{if(s==null||s===!1)return null;if(le(e)){let t=String(s);if(ce.test(t))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${e}`),"#"}return s},v=(e,s={},t=[])=>{if(s instanceof Node||S(s)||!U(s))t=s,s={};if(w(e)){let n=A(()=>{let f=e(s,{children:t,emit:(u,...h)=>s[`on${u[0].toUpperCase()}${u.slice(1)}`]?.(...h)});return n._result=f,f});n();let c=n._result;if(c==null)return null;let l=c instanceof Node||S(c)&&c.every((f)=>f instanceof Node)?c:E.createTextNode(String(c)),a=(f)=>{if(U(f)&&!f._isRuntime)f._mounts=n._mounts||[],f._cleanups=n._cleanups||new Set,f._ownerEffect=n};return S(l)?l.forEach(a):a(l),l}let o=oe.has(e),r=o?E.createElementNS(se,e):E.createElement(e);r._cleanups=new Set;for(let n of Object.keys(s)){let c=s[n];if(n==="ref"){w(c)?c(r):c.current=r;continue}if(o&&n.startsWith("xlink:")){let l=P(n.slice(6),c);l==null?r.removeAttributeNS(G,n.slice(6)):r.setAttributeNS(G,n.slice(6),l);continue}if(n.startsWith("on")){let l=n.slice(2).toLowerCase();r.addEventListener(l,c);let a=()=>r.removeEventListener(l,c);r._cleanups.add(a),N(a)}else if(w(c)){let l=A(()=>{let a=P(n,c());if(n==="class")r.className=a||"";else if(a==null)r.removeAttribute(n);else if(n==="style"&&typeof a==="string")r.setAttribute("style",a);else if(n in r&&!o)r[n]=a;else r.setAttribute(n,a===!0?"":a)});if(l(),r._cleanups.add(()=>b(l)),N(()=>b(l)),/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName)&&(n==="value"||n==="checked")){let a=n==="checked"?"change":"input";r.addEventListener(a,(f)=>c(f.target[n]))}}else{let l=P(n,c);if(l!=null)if(n==="style"&&typeof l==="string")r.setAttribute("style",l);else if(n in r&&!o)r[n]=l;else r.setAttribute(n,l===!0?"":l)}}let i=(n)=>{if(S(n))return n.forEach(i);if(w(n)){let c=E.createTextNode("");r.appendChild(c);let l=[],a=A(()=>{let f=n(),u=(S(f)?f:[f]).map($);l.forEach((p)=>{if(p._isRuntime)p.destroy();else I(p);if(p.parentNode)p.remove()});let h=c;for(let p=u.length-1;p>=0;p--){let y=u[p];if(y.parentNode!==h.parentNode)h.parentNode?.insertBefore(y,h);if(y._mounts)y._mounts.forEach((Q)=>Q());h=y}l=u});a(),r._cleanups.add(()=>b(a)),N(()=>b(a))}else{let c=$(n);if(r.appendChild(c),c._mounts)c._mounts.forEach((l)=>l())}};return i(t),r},j=(e)=>{let s=new Set,t=_,o=d,r=E.createElement("div");r.style.display="contents",r.setAttribute("role","presentation"),_={_cleanups:s},d=null;let i=(n)=>{if(!n)return;if(n._isRuntime)s.add(n.destroy),r.appendChild(n.container);else if(S(n))n.forEach(i);else r.appendChild(n instanceof Node?n:E.createTextNode(String(n==null?"":n)))};try{i(e({onCleanup:(n)=>s.add(n)}))}finally{_=t,d=o}return{_isRuntime:!0,container:r,destroy:()=>{s.forEach((n)=>n()),I(r),r.remove()}}},K=(e,s,t=null)=>{let o=E.createTextNode(""),r=v("div",{style:"display:contents"},[o]),i=null;return R(()=>!!(w(e)?e():e),(n)=>{if(i)i.destroy(),i=null;let c=n?s:t;if(c)i=j(()=>w(c)?c():c),r.insertBefore(i.container,o)}),N(()=>i?.destroy()),r},z=(e,s,t)=>{let o=E.createTextNode(""),r=v("div",{style:"display:contents"},[o]),i=new Map;return R(()=>(w(e)?e():e)||[],(n)=>{let c=new Map,l=[],a=n||[];for(let u=0;us(h,u));else i.delete(p);c.set(p,y),l.push(y)}i.forEach((u)=>u.destroy());let f=o;for(let u=l.length-1;u>=0;u--){let p=l[u].container;if(p.nextSibling!==f)r.insertBefore(p,f);f=p}i=c}),r},g=(e)=>{let s=()=>window.location.hash.slice(1)||"/",t=C(s()),o=()=>t(s());window.addEventListener("hashchange",o),N(()=>window.removeEventListener("hashchange",o));let r=v("div",{class:"router-hook"}),i=null;return R([t],()=>{let n=t(),c=e.find((l)=>{let a=l.path.split("/").filter(Boolean),f=n.split("/").filter(Boolean);return a.length===f.length&&a.every((u,h)=>u[0]===":"||u===f[h])})||e.find((l)=>l.path==="*");if(c){i?.destroy();let l={};c.path.split("/").filter(Boolean).forEach((a,f)=>{if(a[0]===":")l[a.slice(1)]=n.split("/").filter(Boolean)[f]}),g.params(l),i=j(()=>w(c.component)?c.component(l):c.component),r.replaceChildren(i.container)}}),r};g.params=C({});g.to=(e)=>window.location.hash=e.replace(/^#?\/?/,"#/");g.back=()=>window.history.back();g.path=()=>window.location.hash.replace(/^#/,"")||"/";var J=(e,s)=>{let t=typeof s==="string"?E.querySelector(s):s;if(!t)return;if(B.has(t))B.get(t).destroy();let o=j(w(e)?e:()=>e);return t.replaceChildren(o.container),B.set(t,o),o};if(typeof window<"u")Object.assign(window,{$:C,$$:V,watch:R,h:v,when:K,each:z,router:g,mount:J,batch:q}),"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".split(" ").forEach((e)=>{window[e]=(s,t)=>v(e,s,t)});})(); +(()=>{var{defineProperty:L,getOwnPropertyNames:X,getOwnPropertyDescriptor:F}=Object,H=Object.prototype.hasOwnProperty;function Y(e){return this[e]}var Z=(e)=>{var s=(M??=new WeakMap).get(e),t;if(s)return s;if(s=L({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of X(e))if(!H.call(s,o))L(s,o,{get:Y.bind(e,o),enumerable:!(t=F(e,o))||t.enumerable})}return M.set(e,s),s},M;var ee=(e)=>e;function te(e,s){this[e]=ee.bind(null,s)}var ne=(e,s)=>{for(var t in s)L(e,t,{get:s[t],enumerable:!0,configurable:!0,set:te.bind(s,t)})};var ae={};ne(ae,{when:()=>K,watch:()=>O,router:()=>N,onUnmount:()=>S,mount:()=>J,isObj:()=>R,isFunc:()=>_,isArr:()=>b,h:()=>v,each:()=>z,batch:()=>q,$$:()=>V,$:()=>j});var _=(e)=>typeof e==="function",R=(e)=>e&&typeof e==="object",b=Array.isArray,E=typeof document<"u"?document:null,$=(e)=>e?._isRuntime?e.container:e instanceof Node?e:E.createTextNode(e==null?"":String(e)),d=null,m=null,x=!1,T=0,C=new Set,D=new WeakMap,B=Symbol("iter"),P=new WeakMap,se="http://www.w3.org/2000/svg",G="http://www.w3.org/1999/xlink",oe=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),g=(e)=>{if(!e||e._disposed)return;e._disposed=!0;let s=[e];while(s.length){let t=s.pop();if(t._cleanups)t._cleanups.forEach((o)=>o()),t._cleanups.clear();if(t._children)t._children.forEach((o)=>s.push(o)),t._children.clear();if(t._deps)t._deps.forEach((o)=>o.delete(t)),t._deps.clear()}},S=(e)=>{if(m)(m._cleanups||=new Set).add(e)},re=(e)=>{let s=d;d=null;try{return e()}finally{d=s}},A=(e,s=!1)=>{let t=()=>{if(t._disposed)return;if(t._deps)t._deps.forEach((i)=>i.delete(t));if(t._cleanups)t._cleanups.forEach((i)=>i()),t._cleanups.clear();let o=d,r=m;d=m=t;try{return t._result=e()}catch(i){console.error("[SigPro]",i)}finally{d=o,m=r}};if(t._deps=t._cleanups=t._children=null,t._disposed=!1,t._isComputed=s,t._depth=d?d._depth+1:0,t._mounts=[],t._parent=m,m)(m._children||=new Set).add(t);return t},W=()=>{if(x)return;x=!0;let e=Array.from(C).sort((s,t)=>s._depth-t._depth);C.clear();for(let s of e)if(!s._disposed)s();x=!1},q=(e)=>{T++;try{return e()}finally{if(T--,T===0&&C.size>0&&!x)W()}},w=(e,s=!1)=>{if(!s&&d&&!d._disposed)e.add(d),(d._deps||=new Set).add(e);else if(s&&e.size>0){let t=!1;for(let o of e){if(o===d||o._disposed)continue;if(o._isComputed){if(o._dirty=!0,o._subs)w(o._subs,!0)}else C.add(o),t=!0}if(t&&!x&&T===0)queueMicrotask(W)}},j=(e,s=null)=>{let t=new Set;if(_(e)){let o,r=()=>{if(r._dirty){let i=d;d=r;try{let n=e();if(!Object.is(o,n))o=n,w(t,!0)}finally{d=i}r._dirty=!1}return w(t),o};return r._isComputed=!0,r._subs=t,r._dirty=!0,r._deps=null,r._disposed=!1,r}if(s)try{e=JSON.parse(localStorage.getItem(s))??e}catch(o){}return(...o)=>{if(o.length){let r=_(o[0])?o[0](e):o[0];if(!Object.is(e,r)){if(e=r,s)localStorage.setItem(s,JSON.stringify(e));w(t,!0)}}return w(t),e}},V=(e)=>{if(!R(e))return e;let s=D.get(e);if(s)return s;let t=new Map,o=(i)=>{let n=t.get(i);if(!n)t.set(i,n=new Set);return n},r=new Proxy(e,{get(i,n,c){if(typeof n!=="symbol")w(o(n));return V(Reflect.get(i,n,c))},set(i,n,c,l){let a=Reflect.has(i,n),f=Reflect.get(i,n,l),u=Reflect.set(i,n,c,l);if(u&&!Object.is(f,c)){if(w(o(n),!0),!a)w(o(B),!0)}return u},deleteProperty(i,n){let c=Reflect.deleteProperty(i,n);if(c)w(o(n),!0),w(o(B),!0);return c},ownKeys(i){return w(o(B)),Reflect.ownKeys(i)}});return D.set(e,r),r},O=(e,s)=>{if(s===void 0){let o=A(e);return o(),()=>g(o)}let t=A(()=>{let o=Array.isArray(e)?e.map((r)=>r()):e();re(()=>s(o))});return t(),()=>g(t)},I=(e)=>{if(!e)return;if(e._cleanups)e._cleanups.forEach((s)=>s()),e._cleanups.clear();if(e._ownerEffect)g(e._ownerEffect);if(e.childNodes)e.childNodes.forEach((s)=>I(s))},ce=/^\s*(javascript|data|vbscript):/i,ie=new Set(["src","href","formaction","action","background","code","archive"]),le=(e)=>ie.has(e)||e.startsWith("on"),U=(e,s)=>{if(s==null||s===!1)return null;if(le(e)){let t=String(s);if(ce.test(t))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${e}`),"#"}return s},v=(e,s={},t=[])=>{if(s instanceof Node||b(s)||!R(s))t=s,s={};if(_(e)){let n=A(()=>{let f=e(s,{children:t,emit:(u,...h)=>s[`on${u[0].toUpperCase()}${u.slice(1)}`]?.(...h)});return n._result=f,f});n();let c=n._result;if(c==null)return null;let l=c instanceof Node||b(c)&&c.every((f)=>f instanceof Node)?c:E.createTextNode(String(c)),a=(f)=>{if(R(f)&&!f._isRuntime)f._mounts=n._mounts||[],f._cleanups=n._cleanups||new Set,f._ownerEffect=n};return b(l)?l.forEach(a):a(l),l}let o=oe.has(e),r=o?E.createElementNS(se,e):E.createElement(e);r._cleanups=new Set;for(let n of Object.keys(s)){let c=s[n];if(n==="ref"){_(c)?c(r):c.current=r;continue}if(o&&n.startsWith("xlink:")){let l=U(n.slice(6),c);l==null?r.removeAttributeNS(G,n.slice(6)):r.setAttributeNS(G,n.slice(6),l);continue}if(n.startsWith("on")){let l=n.slice(2).toLowerCase();r.addEventListener(l,c);let a=()=>r.removeEventListener(l,c);r._cleanups.add(a),S(a)}else if(_(c)){let l=A(()=>{let a=U(n,c());if(n==="class")r.className=a||"";else if(a==null)r.removeAttribute(n);else if(n==="style"&&typeof a==="string")r.setAttribute("style",a);else if(n in r&&!o)r[n]=a;else r.setAttribute(n,a===!0?"":a)});if(l(),r._cleanups.add(()=>g(l)),S(()=>g(l)),/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName)&&(n==="value"||n==="checked")){let a=n==="checked"?"change":"input";r.addEventListener(a,(f)=>c(f.target[n]))}}else{let l=U(n,c);if(l!=null)if(n==="style"&&typeof l==="string")r.setAttribute("style",l);else if(n in r&&!o)r[n]=l;else r.setAttribute(n,l===!0?"":l)}}let i=(n)=>{if(b(n))return n.forEach(i);if(_(n)){let c=E.createTextNode("");r.appendChild(c);let l=[],a=A(()=>{let f=n(),u=(b(f)?f:[f]).map($);l.forEach((p)=>{if(p._isRuntime)p.destroy();else I(p);if(p.parentNode)p.remove()});let h=c;for(let p=u.length-1;p>=0;p--){let y=u[p];if(y.parentNode!==h.parentNode)h.parentNode?.insertBefore(y,h);if(y._mounts)y._mounts.forEach((Q)=>Q());h=y}l=u});a(),r._cleanups.add(()=>g(a)),S(()=>g(a))}else{let c=$(n);if(r.appendChild(c),c._mounts)c._mounts.forEach((l)=>l())}};return i(t),r},k=(e)=>{let s=new Set,t=m,o=d,r=E.createElement("div");r.style.display="contents",r.setAttribute("role","presentation"),m={_cleanups:s},d=null;let i=(n)=>{if(!n)return;if(n._isRuntime)s.add(n.destroy),r.appendChild(n.container);else if(b(n))n.forEach(i);else r.appendChild(n instanceof Node?n:E.createTextNode(String(n==null?"":n)))};try{i(e({onCleanup:(n)=>s.add(n)}))}finally{m=t,d=o}return{_isRuntime:!0,container:r,destroy:()=>{s.forEach((n)=>n()),I(r),r.remove()}}},K=(e,s,t=null)=>{let o=E.createTextNode(""),r=v("div",{style:"display:contents"},[o]),i=null;return O(()=>!!(_(e)?e():e),(n)=>{if(i)i.destroy(),i=null;let c=n?s:t;if(c)i=k(()=>_(c)?c():c),r.insertBefore(i.container,o)}),S(()=>i?.destroy()),r},z=(e,s,t)=>{let o=E.createTextNode(""),r=v("div",{style:"display:contents"},[o]),i=new Map;return O(()=>(_(e)?e():e)||[],(n)=>{let c=new Map,l=[],a=n||[];for(let u=0;us(h,u));else i.delete(p);c.set(p,y),l.push(y)}i.forEach((u)=>u.destroy());let f=o;for(let u=l.length-1;u>=0;u--){let p=l[u].container;if(p.nextSibling!==f)r.insertBefore(p,f);f=p}i=c}),r},N=(e)=>{let s=()=>window.location.hash.slice(1)||"/",t=j(s()),o=()=>t(s());window.addEventListener("hashchange",o),S(()=>window.removeEventListener("hashchange",o));let r=v("div",{class:"router-hook"}),i=null;return O([t],()=>{let n=t(),c=e.find((l)=>{let a=l.path.split("/").filter(Boolean),f=n.split("/").filter(Boolean);return a.length===f.length&&a.every((u,h)=>u[0]===":"||u===f[h])})||e.find((l)=>l.path==="*");if(c){i?.destroy();let l={};c.path.split("/").filter(Boolean).forEach((a,f)=>{if(a[0]===":")l[a.slice(1)]=n.split("/").filter(Boolean)[f]}),N.params(l),i=k(()=>_(c.component)?c.component(l):c.component),r.replaceChildren(i.container)}}),r};N.params=j({});N.to=(e)=>window.location.hash=e.replace(/^#?\/?/,"#/");N.back=()=>window.history.back();N.path=()=>window.location.hash.replace(/^#/,"")||"/";var J=(e,s)=>{let t=typeof s==="string"?E.querySelector(s):s;if(!t)return;if(P.has(t))P.get(t).destroy();let o=k(_(e)?e:()=>e);return t.replaceChildren(o.container),P.set(t,o),o};if(typeof window<"u")Object.assign(window,{$:j,$$:V,watch:O,h:v,when:K,each:z,router:N,mount:J,batch:q,onUnmount:S,isArr:b,isFunc:_,isObj:R}),"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".split(" ").forEach((e)=>{window[e]=(s,t)=>v(e,s,t)});})(); diff --git a/docs/sigpro.js b/docs/sigpro.js index 626417f..9738d8c 100644 --- a/docs/sigpro.js +++ b/docs/sigpro.js @@ -45,6 +45,9 @@ router: () => router, onUnmount: () => onUnmount, mount: () => mount, + isObj: () => isObj, + isFunc: () => isFunc, + isArr: () => isArr, h: () => h, each: () => each, batch: () => batch, @@ -568,7 +571,7 @@ return inst; }; if (typeof window !== "undefined") { - Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch }); + Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj }); "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".split(" ").forEach((tag) => { window[tag] = (props, children) => h(tag, props, children); }); diff --git a/sigpro.js b/sigpro.js index 25db2ba..d83123c 100644 --- a/sigpro.js +++ b/sigpro.js @@ -508,10 +508,10 @@ const mount = (comp, target) => { } if (typeof window !== "undefined") { - Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch }) + Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj }) "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" .split(" ") .forEach(tag => { window[tag] = (props, children) => h(tag, props, children) }) } -export { $, $$, watch, batch, h, mount, when, each, router, onUnmount } \ No newline at end of file +export { $, $$, watch, batch, h, mount, when, each, router, onUnmount, isArr, isFunc, isObj } \ No newline at end of file