cradova 3.5.7 → 3.5.8

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/index.js CHANGED
@@ -1 +1 @@
1
- class U{static compId=0;afterMount=[];beforeMountActive=[];afterDeactivate=[];dispatchEvent(H){let L=this[H];if(H.includes("Active")){for(let T=0;T<L.length;T++)L[T]();return}while(L.length!==0)L.shift()()}}var J=new U;class G{id=0;component;effects=[];effectuate=null;rendered=!1;published=!1;preRendered=null;reference=null;subData=null;_state=[];_state_index=0;constructor(H){this.component=H.bind(this)}preRender(H){this.preRendered=this.render(H)}render(H){if(U.compId+=1,this.id=U.compId,this.effects=[],this.rendered=!1,!this.preRendered){this._state_index=0,this._state=[];let L=this.component(H);if(L instanceof HTMLElement)this.reference=L,this.effector.apply(this),this.rendered=!0,this.published=!0;else console.error(" ✘ Cradova err : Invalid html content, got - "+L);return L}else return this.preRendered}_effect(H){if(!this.rendered)this.effects.push(H.bind(this))}async effector(){for(let H=0;H<this.effects.length;H++){let L=await this.effects[H].apply(this);if(typeof L==="function")J.afterDeactivate.push(L)}if(this.effects=[],this.effectuate)this.effectuate(),this.effectuate=null}recall(H){if(!this.rendered)this.effectuate=()=>{if(this.published)this.activate(H)};else if(this.published)setTimeout(()=>{this.activate(H)})}async activate(H){if(this.published=!1,!this.rendered)return;this._state_index=0;let L=this.reference;if(document.contains(L)){let T=this.component(H);if(T instanceof HTMLElement)L.insertAdjacentElement("beforebegin",T),L.remove(),this.published=!0,this.reference=T,J.dispatchEvent("afterMount");else console.error(" ✘ Cradova err : Invalid html, got - "+T)}else this.reference=null,this.rendered=!1}}class Z{pn;subs;pipe;constructor(H,L){if(this.pipe=H,this.subs={},L&&L.persistName){this.pn=L.persistName;let T=localStorage.getItem(L.persistName);if(T&&T!=="undefined")this.pipe=JSON.parse(T);if(typeof H==="object"){for(let M in H)if(!Object.prototype.hasOwnProperty.call(this.pipe,M))this.pipe[M]=H[M]}}}publish(H,L){this.pipe[H]=L;let T=this.subs[H]||[];for(let M=0;M<T.length;M++){let E=T[M];E.subData=L,E.recall()}if(this.pn)localStorage.setItem(this.pn,JSON.stringify(this.pipe))}subscribe(H,L){if(L instanceof G){if(this.subs[H]?.find((T)=>T.id===L.id))return;if(!this.subs[H])this.subs[H]=[L];else this.subs[H].push(L);if(this.pipe[H])L.subData=this.pipe[H]}}clearPersist(){if(this.pn)localStorage.removeItem(this.pn)}}class q{_name;_html;_template=document.createElement("div");_dropped=!1;_snapshot;_snapshot_html;_deCB;constructor(H){let{template:L,name:T}=H;this._html=L,this._name=T||document.title,this._template.setAttribute("id","page"),this._snapshot=H.snapshotIsolation||!1}async _takeSnapShot(){if(A.doc.dataset.snapshot==="true")return;try{let H=await fetch(location.href);if(!H.ok)throw new Error("Failed to fetch the page");let L=await H.text(),M=new DOMParser().parseFromString(L,"text/html");M.title=this._name;let E=M.querySelector('[data-wrapper="app"]');if(E)E.setAttribute("data-snapshot","true"),E.innerHTML=this._snapshot_html;else{console.error("Wrapper or template is not found");return}let I=M.documentElement.outerHTML;await fetch(`${location.origin}`,{body:I,method:"POST",headers:{"Content-Type":"text/html","cradova-snapshot":location.href.slice(location.origin.length)}})}catch(H){console.error("Snapshot error:",H)}this._snapshot_html=void 0}set onDeactivate(H){this._deCB=H}drop(H){if(typeof H==="boolean"){this._dropped=H;return}else return this._dropped}async _activate(){if(this._dropped){history.go(-1);return}let H=this._html.apply(this);if(H instanceof HTMLElement)this._template.innerHTML="",this._template.appendChild(H);else throw new Error(` ✘ Cradova err: template function for the page returned ${H} instead of html`);if(document.title=this._name,A.doc.innerHTML="",J.dispatchEvent("beforeMountActive"),this._snapshot)this._snapshot_html=this._template.outerHTML;if(A.doc.appendChild(this._template),J.dispatchEvent("afterMount"),window.scrollTo({top:0,left:0,behavior:"instant"}),J.dispatchEvent("afterDeactivate"),this._snapshot)this._takeSnapShot()}}class Q{doc=null;lastNavigatedRouteController;nextRouteController;lastNavigatedRoute;pageShow=null;pageHide=null;errorHandler;loadingPage=null;pageData={params:{}};routes={};paused=!1;route(H,L){if(!L)console.error(" ✘ Cradova err: not a valid page ",L);return this.routes[H]=L}async router(H,L){let T=window.location.href,M,E;if(this.paused){window.location.hash="paused";return}if(this.nextRouteController)M=this.nextRouteController,this.nextRouteController=void 0;else[M,E]=this.checker(T);if(typeof M!=="undefined")try{if(typeof M==="function"){if(this.loadingPage instanceof q)await this.loadingPage._activate();if(M=await M(),M?.default)M=M.default;if(!M){if(this.lastNavigatedRoute)history.pushState({},T,this.lastNavigatedRoute);return}}if(E)this.pageData.params=E;await M._activate(),this.lastNavigatedRouteController&&this.lastNavigatedRouteController._deCB?.(),this.lastNavigatedRoute=T,this.lastNavigatedRouteController=M}catch(I){if(typeof this.errorHandler==="function")this.errorHandler(I,T);else console.error(I)}else if(this.routes["*"])await this.routes["*"]._activate()}checker(H){if(H[0]!=="/")H=H.slice(H.indexOf("/",8));if(this.routes[H])return[this.routes[H],{path:H}];if(H.includes("?")){let L,T={};if([H,L]=H.split("?"),new URLSearchParams(L).forEach((M,E)=>{T[E]=M}),this.routes[H])return[this.routes[H],T]}for(let L in this.routes){if(L.includes(":")){let T=H.split("/"),M=L.split("/");if(H.endsWith("/"))T.pop();let E=0,I=0;if(M.length===T.length){for(let D=0;D<M.length;D++){if(M[D].includes(":")){I++;continue}if(T[D]===M[D])E++}if(E+I===M.length){let D={};for(let O=0;O<M.length;O++)if(M[O].includes(":"))D[M[O].split(":")[1]]=T[O];return[this.routes[L],D]}}}if(L.includes("*")){let T=L.slice(0,-1);if(H.startsWith(T))return[this.routes[L],{extraPath:H.slice(T.length)}]}}return[]}}var A=new Q;class Y{static BrowserRoutes(H){for(let L in H){let T=H[L];if(typeof T==="object"&&typeof T.then==="function"||typeof T==="function")A.routes[L]=async()=>{let M=typeof T==="function"?await T():await T;return A.route(L,M)};else A.route(L,T)}Y._mount()}static pauseNavigation(){A.paused=!0,window.location.hash="paused"}static resumeNavigation(){A.paused=!1,window.location.replace(window.location.pathname+window.location.search),history.go(-1)}static navigate(H,L){if(typeof H!=="string")console.error(" ✘ Cradova err: href must be a defined path but got "+H+" instead");let T=null,M;if(H.includes("."))window.location.href=H;else{if([T,M]=A.checker(H),T)A.nextRouteController=T,window.history.pushState({},"",H);A.pageData.params=M,A.pageData.data=L,A.router(null)}}static setLoadingPage(H){if(H instanceof q)A.loadingPage=H;else throw new Error(" ✘ Cradova err: Loading Page should be a cradova page class")}static get PageData(){return A.pageData}static addErrorHandler(H){if(typeof H==="function")A.errorHandler=H;else throw new Error(" ✘ Cradova err: callback for error event is not a function")}static _mount(){let H=document.querySelector("[data-wrapper=app]");if(H)A.doc=H;else throw new Error(`✘ Cradova err: please add '<div data-wrapper="app"></div>' to the body of your index.html file `);window.addEventListener("pageshow",()=>A.router()),window.addEventListener("popstate",(L)=>{L.preventDefault(),A.router()})}}class z{tree={};bindAs(H){return[this,H]}elem(H){let L=this.tree[H];if(document.contains(L))return L;this.tree[H]=void 0}swap(H,L){[this.tree[H],this.tree[L]]=[this.tree[L],this.tree[H]]}_append(H,L){this.tree[H]=L}}var K=(H,L)=>{let T={},M=void 0;if(L.length!==0)for(let E=0;E<L.length;E++){let I=L[E];if(typeof I==="function")I=I();if(I instanceof G)I=I.render();if(I instanceof HTMLElement||I instanceof DocumentFragment){H.appendChild(I);continue}if(Array.isArray(I)){H.appendChild(S(I));continue}if(typeof I==="string"){M=I;continue}if(typeof I==="object"){Object.assign(T,I);continue}}else return H;if(typeof T==="object"&&H)for(let[E,I]of Object.entries(T)){if(E==="style"&&typeof I==="object"){Object.assign(H.style,I);continue}if(E==="href"){let D=I||"";if(!D.includes("://"))H.addEventListener("click",(O)=>{if(O.preventDefault(),Y.navigate(H.href),D.includes("#")){let W=D.split("#").at(-1);document.getElementById("#"+W)?.scrollIntoView()}});H.setAttribute(E,I);continue}if(E==="onmount"){J.afterMount.push(()=>{typeof T.onmount==="function"&&T.onmount.apply(H)});continue}if(E.includes("data-")||E.includes("aria-")){H.setAttribute(E,I);continue}if(Array.isArray(I)){if(E=="ref"&&I[0]instanceof z){I[0]._append(I[1],H);continue}}H[E]=I}if(M!==void 0)H.appendChild(document.createTextNode(M));return H},V=(H)=>{return(...L)=>K(document.createElement(H),L)};function S(H){let L=new DocumentFragment;for(let T of H)if(Array.isArray(T))L.appendChild(S(T));else{if(T instanceof G)T=T.render();if(typeof T==="function"){if(T=T(),typeof T==="function")T=T()}if(T instanceof HTMLElement||T instanceof DocumentFragment){L.appendChild(T);continue}if(typeof T==="string")L.appendChild(document.createTextNode(T))}return L}function x(H,...L){if(H)return L}function j(H,L,T){if(H)return L;return T}function y(H,...L){return(T)=>{if(T===H)return L;return}}function g(H,...L){let T;if(L.length){for(let M=0;M<L.length;M++)if(T=L[M](H),T)break}return T}function b(H,L){return Array.isArray(H)?H.map(L):void 0}var F=function(H){let L=document.createDocumentFragment();for(let T=0;T<H.length;T++){let M=H[T];if(typeof M==="function")M=M();if(M instanceof HTMLElement||M instanceof DocumentFragment){L.appendChild(M);continue}if(M instanceof String){L.appendChild(document.createTextNode(M));continue}console.error(" ✘ Cradova err: wrong element type"+M)}return L};function w(H,L){L._state_index+=1;let T=L._state_index;if(T>=L._state.length)L._state[T]=H;function M(E){if(typeof E==="function")E=E(L._state[T]);L._state[T]=E,L.recall()}return[L._state[T],M]}function _(H,L){L._effect(H)}function P(){return new z}var N=V("a"),B=V("audio"),c=V("button"),f=V("canvas"),R=V("div"),C=V("footer"),s=V("form"),v=V("h1"),d=V("h2"),i=V("h3"),o=V("h4"),h=V("h5"),u=V("h6"),m=V("header"),t=V("i"),p=V("iframe"),l=V("img"),r=V("input"),a=V("label"),e=V("li"),HH=V("main"),LH=V("nav"),TH=V("ol"),MH=V("optgroup"),EH=V("option"),IH=V("p"),VH=V("section"),AH=V("select"),DH=V("source"),OH=V("span"),JH=V("textarea"),GH=V("ul"),UH=V("video"),YH=(H,L)=>{let T=document.createElement("span");return T.innerHTML=H,K(T,L||[])},qH=(H)=>{let L=document.createElement("div");if(Array.isArray(H))L.innerHTML=H[0];else if(typeof H==="string")L.innerHTML=H;let T=new DocumentFragment;return T.append(...Array.from(L.children)),T};export{UH as video,w as useState,P as useRef,_ as useEffect,GH as ul,JH as textarea,YH as svg,OH as span,DH as source,AH as select,VH as section,qH as raw,IH as p,EH as option,MH as optgroup,TH as ol,LH as nav,K as makeElement,HH as main,b as loop,e as li,a as label,r as input,l as img,p as iframe,t as i,m as header,u as h6,h as h5,o as h4,i as h3,d as h2,v as h1,F as frag,s as form,C as footer,R as div,V as cra,f as canvas,c as button,B as audio,N as a,Z as Signal,Y as Router,S as Rhoda,q as Page,J as CradovaEvent,G as Comp,g as $switch,j as $ifelse,x as $if,y as $case};
1
+ class G{static compId=0;afterMount=[];beforeMountActive=[];afterDeactivate=[];dispatchEvent(H){let T=this[H];if(H.includes("Active")){for(let L=0;L<T.length;L++)T[L]();return}while(T.length!==0)T.shift()()}}var J=new G;class x{id=0;component;effects=[];effectuate=null;rendered=!1;published=!1;preRendered=null;reference=null;subData=null;publish=null;_state=[];_state_index=0;constructor(H){this.component=H.bind(this)}preRender(){this.preRendered=this.render()}render(){if(G.compId+=1,this.id=G.compId,this.effects=[],this.rendered=!1,!this.preRendered){this._state_index=0,this._state=[];let H=this.component();if(H instanceof HTMLElement)this.reference=H,this.effector.apply(this),this.rendered=!0,this.published=!0;else console.error(" ✘ Cradova err : Invalid html content, got - "+H);return H}else return this.preRendered}_effect(H){if(!this.rendered)this.effects.push(H.bind(this))}async effector(){for(let H=0;H<this.effects.length;H++){let T=await this.effects[H].apply(this);if(typeof T==="function")J.afterDeactivate.push(T)}if(this.effects=[],this.effectuate)this.effectuate(),this.effectuate=null}recall(){if(!this.rendered)this.effectuate=()=>{if(this.published)this.activate()};else if(this.published)setTimeout(()=>{this.activate()})}async activate(){if(this.published=!1,!this.rendered)return;this._state_index=0;let H=this.reference;if(document.contains(H)){let T=this.component();if(T instanceof HTMLElement)H.insertAdjacentElement("beforebegin",T),H.remove(),this.published=!0,this.reference=T,J.dispatchEvent("afterMount");else console.error(" ✘ Cradova err : Invalid html, got - "+T)}else this.reference=null,this.rendered=!1}}class W{pn;subs;pipe;constructor(H,T){if(this.pipe=H,this.subs={},T&&T.persistName){this.pn=T.persistName;let L=localStorage.getItem(T.persistName);if(L&&L!=="undefined")this.pipe=JSON.parse(L);if(typeof H==="object"){for(let M in H)if(!Object.prototype.hasOwnProperty.call(this.pipe,M))this.pipe[M]=H[M]}}}publish(H,T){this.pipe[H]=T;let L=this.subs[H]||[];for(let M=0;M<L.length;M++){let I=L[M];I.subData=T,I.recall()}if(this.pn)localStorage.setItem(this.pn,JSON.stringify(this.pipe))}subscribe(H,T){if(T instanceof x){if(this.subs[H]?.find((L)=>L.id===T.id))return;if(!this.subs[H])this.subs[H]=[T];else this.subs[H].push(T);if(this.pipe[H])T.subData=this.pipe[H],T.publish=(L)=>{this.publish(H,L)}}}clearPersist(){if(this.pn)localStorage.removeItem(this.pn)}}class U{_name;_html;_template=document.createElement("div");_dropped=!1;_snapshot;_snapshot_html;_deCB;constructor(H){let{template:T,name:L}=H;this._html=T,this._name=L||document.title,this._template.setAttribute("id","page"),this._snapshot=H.snapshotIsolation||!1}async _takeSnapShot(){if(A.doc.dataset.snapshot==="true")return;try{let H=await fetch(location.href);if(!H.ok)throw new Error("Failed to fetch the page");let T=await H.text(),M=new DOMParser().parseFromString(T,"text/html");M.title=this._name;let I=M.querySelector('[data-wrapper="app"]');if(I)I.setAttribute("data-snapshot","true"),I.innerHTML=this._snapshot_html;else{console.error("Wrapper or template is not found");return}let V=M.documentElement.outerHTML;await fetch(`${location.origin}`,{body:V,method:"POST",headers:{"Content-Type":"text/html","cradova-snapshot":location.href.slice(location.origin.length)}})}catch(H){console.error("Snapshot error:",H)}this._snapshot_html=void 0}set onDeactivate(H){this._deCB=H}drop(H){if(typeof H==="boolean"){this._dropped=H;return}else return this._dropped}async _activate(){if(this._dropped){history.go(-1);return}let H=this._html.apply(this);if(H instanceof HTMLElement)this._template.innerHTML="",this._template.appendChild(H);else throw new Error(` ✘ Cradova err: template function for the page returned ${H} instead of html`);if(document.title=this._name,A.doc.innerHTML="",J.dispatchEvent("beforeMountActive"),this._snapshot)this._snapshot_html=this._template.outerHTML;if(A.doc.appendChild(this._template),J.dispatchEvent("afterMount"),window.scrollTo({top:0,left:0,behavior:"instant"}),J.dispatchEvent("afterDeactivate"),this._snapshot)this._takeSnapShot()}}class z{doc=null;lastNavigatedRouteController;nextRouteController;lastNavigatedRoute;pageShow=null;pageHide=null;errorHandler;loadingPage=null;pageData={params:{}};routes={};paused=!1;route(H,T){if(!T)console.error(" ✘ Cradova err: not a valid page ",T);return this.routes[H]=T}async router(H,T){let L=window.location.href,M,I;if(this.paused){window.location.hash="paused";return}if(this.nextRouteController)M=this.nextRouteController,this.nextRouteController=void 0;else[M,I]=this.checker(L);if(typeof M!=="undefined")try{if(typeof M==="function"){if(this.loadingPage instanceof U)await this.loadingPage._activate();M=await M()}if(M?.default)M=M.default;if(!M){if(this.lastNavigatedRoute)history.pushState({},L,this.lastNavigatedRoute);return}if(I)this.pageData.params=I;await M._activate(),this.lastNavigatedRouteController&&this.lastNavigatedRouteController._deCB?.(),this.lastNavigatedRoute=L,this.lastNavigatedRouteController=M}catch(V){if(typeof this.errorHandler==="function")this.errorHandler(V,L);else console.error(V)}else if(this.routes["*"])await this.routes["*"]._activate()}checker(H){if(H[0]!=="/")H=H.slice(H.indexOf("/",8));if(this.routes[H])return[this.routes[H],{path:H}];if(H.includes("?")){let T,L={};if([H,T]=H.split("?"),new URLSearchParams(T).forEach((M,I)=>{L[I]=M}),this.routes[H])return[this.routes[H],L]}for(let T in this.routes){if(T.includes(":")){let L=H.split("/"),M=T.split("/");if(H.endsWith("/"))L.pop();let I=0,V=0;if(M.length===L.length){for(let D=0;D<M.length;D++){if(M[D].includes(":")){V++;continue}if(L[D]===M[D])I++}if(I+V===M.length){let D={};for(let O=0;O<M.length;O++)if(M[O].includes(":"))D[M[O].split(":")[1]]=L[O];return[this.routes[T],D]}}}if(T.includes("*")){let L=T.slice(0,-1);if(H.startsWith(L))return[this.routes[T],{extraPath:H.slice(L.length)}]}}return[]}}var A=new z;class S{static BrowserRoutes(H){for(let T in H){let L=H[T];if(typeof L==="object"&&typeof L.then==="function"||typeof L==="function")A.routes[T]=async()=>{let M=typeof L==="function"?await L():await L;return A.route(T,M)};else A.route(T,L)}S._mount()}static pauseNavigation(){A.paused=!0,window.location.hash="paused"}static resumeNavigation(){A.paused=!1,window.location.replace(window.location.pathname+window.location.search),history.go(-1)}static navigate(H,T){if(typeof H!=="string")console.error(" ✘ Cradova err: href must be a defined path but got "+H+" instead");let L=null,M;if(H.includes("."))window.location.href=H;else{if([L,M]=A.checker(H),L)A.nextRouteController=L,window.history.pushState({},"",H);A.pageData.params=M,A.pageData.data=T,A.router(null)}}static setLoadingPage(H){if(H instanceof U)A.loadingPage=H;else throw new Error(" ✘ Cradova err: Loading Page should be a cradova page class")}static get PageData(){return A.pageData}static addErrorHandler(H){if(typeof H==="function")A.errorHandler=H;else throw new Error(" ✘ Cradova err: callback for error event is not a function")}static _mount(){let H=document.querySelector("[data-wrapper=app]");if(H)A.doc=H;else throw new Error(`✘ Cradova err: please add '<div data-wrapper="app"></div>' to the body of your index.html file `);window.addEventListener("pageshow",()=>A.router()),window.addEventListener("popstate",(T)=>{T.preventDefault(),A.router()})}}class Y{tree={};bindAs(H){return[this,H]}elem(H){let T=this.tree[H];if(document.contains(T))return T;this.tree[H]=void 0}swap(H,T){[this.tree[H],this.tree[T]]=[this.tree[T],this.tree[H]]}_append(H,T){this.tree[H]=T}}var q=(H,T)=>{let L={},M=void 0;if(T.length!==0)for(let I=0;I<T.length;I++){let V=T[I];if(typeof V==="function")V=V();if(V instanceof x)V=V.render();if(V instanceof HTMLElement||V instanceof DocumentFragment){H.appendChild(V);continue}if(Array.isArray(V)){H.appendChild(K(V));continue}if(typeof V==="string"){M=V;continue}if(typeof V==="object"){Object.assign(L,V);continue}}else return H;if(typeof L==="object"&&H)for(let[I,V]of Object.entries(L)){if(I==="style"&&typeof V==="object"){Object.assign(H.style,V);continue}if(I==="href"){let D=V||"";if(!D.includes("://"))H.addEventListener("click",(O)=>{if(O.preventDefault(),S.navigate(H.href),D.includes("#")){let Q=D.split("#").at(-1);document.getElementById("#"+Q)?.scrollIntoView()}});H.setAttribute(I,V);continue}if(I==="onmount"){J.afterMount.push(()=>{typeof L.onmount==="function"&&L.onmount.apply(H)});continue}if(I.includes("data-")||I.includes("aria-")){H.setAttribute(I,V);continue}if(Array.isArray(V)){if(I=="ref"&&V[0]instanceof Y){V[0]._append(V[1],H);continue}}H[I]=V}if(M!==void 0)H.appendChild(document.createTextNode(M));return H},E=(H)=>{return(...T)=>q(document.createElement(H),T)};function K(H){let T=new DocumentFragment;for(let L of H)if(Array.isArray(L))T.appendChild(K(L));else{if(L instanceof x)L=L.render();if(typeof L==="function"){if(L=L(),typeof L==="function")L=L()}if(L instanceof HTMLElement||L instanceof DocumentFragment){T.appendChild(L);continue}if(typeof L==="string")T.appendChild(document.createTextNode(L))}return T}function b(H,...T){if(H)return T}function X(H,T,L){if(H)return T;return L}function y(H,...T){return(L)=>{if(L===H)return T;return}}function j(H,...T){let L;if(T.length){for(let M=0;M<T.length;M++)if(L=T[M](H),L)break}return L}function g(H,T){return Array.isArray(H)?H.map(T):void 0}var F=function(H){let T=document.createDocumentFragment();for(let L=0;L<H.length;L++){let M=H[L];if(typeof M==="function")M=M();if(M instanceof HTMLElement||M instanceof DocumentFragment){T.appendChild(M);continue}if(M instanceof String){T.appendChild(document.createTextNode(M));continue}console.error(" ✘ Cradova err: wrong element type"+M)}return T};function w(H,T){T._state_index+=1;let L=T._state_index;if(L>=T._state.length)T._state[L]=H;function M(I){if(typeof I==="function")I=I(T._state[L]);T._state[L]=I,T.recall()}return[T._state[L],M]}function n(H,T){T._effect(H)}function _(){return new Y}var c=E("a"),B=E("audio"),N=E("button"),f=E("canvas"),s=E("div"),R=E("footer"),C=E("form"),o=E("h1"),d=E("h2"),v=E("h3"),i=E("h4"),h=E("h5"),p=E("h6"),t=E("header"),u=E("i"),m=E("iframe"),l=E("img"),r=E("input"),a=E("label"),e=E("li"),HH=E("main"),TH=E("nav"),LH=E("ol"),MH=E("optgroup"),EH=E("option"),IH=E("p"),VH=E("section"),AH=E("select"),DH=E("source"),OH=E("span"),JH=E("textarea"),xH=E("ul"),GH=E("video"),SH=E("table"),UH=E("tbody"),YH=E("td"),qH=E("tr"),zH=(H,T)=>{let L=document.createElement("span");return L.innerHTML=H,q(L,T||[])},KH=(H)=>{let T=document.createElement("div");if(Array.isArray(H))T.innerHTML=H[0];else if(typeof H==="string")T.innerHTML=H;let L=new DocumentFragment;return L.append(...Array.from(T.children)),L};export{GH as video,w as useState,_ as useRef,n as useEffect,xH as ul,qH as tr,JH as textarea,YH as td,SH as tbody,UH as table,zH as svg,OH as span,DH as source,AH as select,VH as section,KH as raw,IH as p,EH as option,MH as optgroup,LH as ol,TH as nav,q as makeElement,HH as main,g as loop,e as li,a as label,r as input,l as img,m as iframe,u as i,t as header,p as h6,h as h5,i as h4,v as h3,d as h2,o as h1,F as frag,C as form,R as footer,s as div,E as cra,f as canvas,N as button,B as audio,c as a,W as Signal,S as Router,K as Rhoda,U as Page,J as CradovaEvent,x as Comp,j as $switch,X as $ifelse,b as $if,y as $case};
@@ -44,10 +44,11 @@ export declare class Comp<Props extends Record<string, any> = any> {
44
44
  private preRendered;
45
45
  private reference;
46
46
  subData: Props | null;
47
+ publish: ((data: any) => void) | null;
47
48
  _state: Props[];
48
49
  _state_index: number;
49
- constructor(component: (this: Comp<Props>, data?: Props) => HTMLElement);
50
- preRender(props: Props): void;
50
+ constructor(component: (this: Comp<Props>) => HTMLElement);
51
+ preRender(): void;
51
52
  /**
52
53
  * Cradova Comp
53
54
  * ---
@@ -55,7 +56,7 @@ export declare class Comp<Props extends Record<string, any> = any> {
55
56
  * @param data
56
57
  * @returns () => HTMLElement
57
58
  */
58
- render(props?: Props): HTMLElement;
59
+ render(): HTMLElement;
59
60
  _effect(fn: () => Promise<void> | void): void;
60
61
  private effector;
61
62
  /**
@@ -65,7 +66,7 @@ export declare class Comp<Props extends Record<string, any> = any> {
65
66
  * @param data
66
67
  * @returns
67
68
  */
68
- recall(props?: Props): void;
69
+ recall(): void;
69
70
  private activate;
70
71
  }
71
72
  /**
@@ -32,5 +32,9 @@ export declare const span: (...Children_and_Properties: VJS_params_TYPE<HTMLSpan
32
32
  export declare const textarea: (...Children_and_Properties: VJS_params_TYPE<HTMLTextAreaElement>) => HTMLTextAreaElement;
33
33
  export declare const ul: (...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>) => HTMLUListElement;
34
34
  export declare const video: (...Children_and_Properties: VJS_params_TYPE<HTMLVideoElement>) => HTMLVideoElement;
35
+ export declare const tbody: (...Children_and_Properties: VJS_params_TYPE<HTMLTableElement>) => HTMLTableElement;
36
+ export declare const table: (...Children_and_Properties: VJS_params_TYPE<HTMLTableSectionElement>) => HTMLTableSectionElement;
37
+ export declare const td: (...Children_and_Properties: VJS_params_TYPE<HTMLTableCellElement>) => HTMLTableCellElement;
38
+ export declare const tr: (...Children_and_Properties: VJS_params_TYPE<HTMLTableColElement>) => HTMLTableColElement;
35
39
  export declare const svg: (svg: string, properties?: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
36
40
  export declare const raw: (html: string | TemplateStringsArray) => DocumentFragment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cradova",
3
- "version": "3.5.7",
3
+ "version": "3.5.8",
4
4
  "description": "Build Powerful ⚡ Web Apps with Ease",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",