@base-framework/atoms
Version:
This will add default atoms to the base framework.
3 lines (2 loc) • 6.18 kB
JavaScript
import{Atom as e}from"@base-framework/base";import{Builder as b,dataBinder as i}from"@base-framework/base";var d=t=>({tag:"comment",textContent:`${t.type} placeholder`,onCreated:t.onCreated});var C=(t,o,a,r)=>r,u=(t,o,a,r)=>{let c=null;return s=>{let p=t(s,o,r);if(p===void 0)return;c&&b.removeNode(c),p=C(r,a,s,p);let x=b.build(p,null,r);c=x.children[0],o.parentNode.insertBefore(x,o.nextSibling)}},l=t=>d({type:"on",onCreated:t.onCreated}),h=t=>t.data?t.data:t.context&&t.context.data?t.context.data:t.state?t.state:null,y=(...t)=>{let o=[...t],a=o.pop();if(typeof a=="function")return l({onCreated:(r,c)=>{if(o.length<2){let p=h(c);o.unshift(p)}let s=u(a,r,o[1],c);i.watch(r,o[0],o[1],s)}})},k=(...t)=>{let o=[...t],a=o.pop();if(typeof a=="function")return l({onCreated:(r,c)=>{if(o.length<2){let p=c.state;o.unshift(p)}let s=u(a,r,o[1],c);i.watch(r,o[0],o[1],s)}})},B=(...t)=>l({onCreated:(o,a)=>{let r=[...t],c=r.pop();if(typeof c!="function")return;r.length<2&&r.unshift(a.route);let s=u(c,o,r[1],a);i.watch(o,r[0],r[1],s)}}),S=(...t)=>{let o=[...t],a=o.pop();if(typeof a=="function")return l({onCreated:(r,c)=>{if(o.length<2){let g=h(c);o.unshift(g)}let s=o[2],x=u((g,f,m)=>g===s?a(g,f,m):null,r,o[1],c);i.watch(r,o[0],o[1],x)}})},T=(...t)=>{let o=[...t],a=o.pop();if(typeof a=="function")return l({onCreated:(r,c)=>{if(o.length<2){let g=c.state;o.unshift(g)}let s=o[2],x=u((g,f,m)=>g===s?a(g,f,m):null,r,o[1],c);i.watch(r,o[0],o[1],x)}})};import{Builder as D}from"@base-framework/base";var H=(t,o,a)=>{let r=t(a);if(r===void 0)return;let c=D.build(r,null,a);o.parentNode.insertBefore(c,o.nextSibling)},O=t=>d({type:"use",onCreated:t.onCreated}),I=t=>O({onCreated:(o,a)=>{H(t,o,a)}});var n=(t,o)=>({...t,children:o}),E=t=>({...t,tag:"DOCTYPE"}),K=e((t,o)=>n({...t,tag:"html"},o)),Q=e((t,o)=>n({...t,tag:"script"},o)),W=e((t,o)=>n({...t,tag:"style"},o)),Y=e((t,o)=>n({...t,tag:"head"},o)),$=t=>({...t}),j=t=>({...t,tag:"meta"}),z=t=>({...t,tag:"link"}),G=e((t,o)=>n({...t,tag:"body"},o)),J=e((t,o)=>n(t,o)),X=e((t,o)=>n({...t,tag:"dialog"},o)),Z=e((t,o)=>n({...t,tag:"span"},o)),_=e((t,o)=>n({...t,tag:"p"},o)),tt=e((t,o)=>n({...t,tag:"a"},o)),L=e((t,o)=>n({...t,tag:"button"},o)),ot=e((t,o)=>L({...t,type:"submit"},o)),et=e((t,o)=>n({...t,tag:"ul"},o)),nt=e((t,o)=>n({...t,tag:"li"},o)),rt=e(t=>n({...t,tag:"img"},null)),at=e(t=>n({...t,tag:"br"},null)),ct=e(t=>n({...t,tag:"hr"},null)),st=e((t,o)=>n({...t,tag:"text"},o)),pt=e((t,o)=>n({...t,tag:"h1"},o)),gt=e((t,o)=>n({...t,tag:"h2"},o)),xt=e((t,o)=>n({...t,tag:"h3"},o)),it=e((t,o)=>n({...t,tag:"h4"},o)),ut=e((t,o)=>n({...t,tag:"h5"},o)),lt=e((t,o)=>n({...t,tag:"h6"},o)),P=e(t=>n({...t,tag:"input"},null)),dt=e((t,o)=>n({...t,tag:"label"},o)),ft=e(t=>P({...t,type:"checkbox"})),mt=e((t,o)=>n({...t,tag:"section"},o)),bt=e((t,o)=>n({...t,tag:"article"},o)),ht=e((t,o)=>n({...t,tag:"header"},o)),Ct=e((t,o)=>n({...t,tag:"footer"},o)),yt=e((t,o)=>n({...t,tag:"nav"},o)),kt=e((t,o)=>n({...t,tag:"aside"},o)),Bt=e((t,o)=>n({...t,tag:"figure"},o)),St=e((t,o)=>n({...t,tag:"figcaption"},o)),Tt=e((t,o)=>n({...t,tag:"main"},o)),Dt=e((t,o)=>n({...t,tag:"video"},o)),Ht=e((t,o)=>n({...t,tag:"audio"},o)),Ot=e((t,o)=>n({...t,tag:"table"},o)),It=e((t,o)=>n({...t,tag:"tr"},o)),Lt=e((t,o)=>n({...t,tag:"th"},o)),Pt=e((t,o)=>n({...t,tag:"td"},o)),vt=e((t,o)=>n({...t,tag:"thead"},o)),wt=e((t,o)=>n({...t,tag:"tbody"},o)),At=e((t,o)=>n({...t,tag:"tfoot"},o)),Rt=e((t,o)=>n({...t,tag:"form"},o)),Ft=e((t,o)=>n({...t,tag:"select"},o)),Vt=e((t,o)=>n({...t,tag:"option"},o)),Mt=e((t,o)=>n({...t,tag:"textarea"},o)),Nt=e((t,o)=>n({...t,tag:"canvas"},o)),Ut=e((t,o)=>n({...t,tag:"progress"},o)),qt=e((t,o)=>n({...t,tag:"blockquote"},o)),Et=e((t,o)=>n({...t,tag:"pre"},o)),Kt=e((t,o)=>n({...t,tag:"code"},o)),Qt=e((t,o)=>n({...t,tag:"ol"},o)),Wt=e((t,o)=>n({...t,tag:"dl"},o)),Yt=e((t,o)=>n({...t,tag:"dt"},o)),$t=e((t,o)=>n({...t,tag:"dd"},o)),jt=e((t,o)=>n({...t,tag:"fieldset"},o)),zt=e((t,o)=>n({...t,tag:"legend"},o)),Gt=e((t,o)=>n({...t,tag:"meter"},o)),Jt=e((t,o)=>n({...t,tag:"iframe"},o)),Xt=e((t,o)=>n({...t,tag:"details"},o)),Zt=e((t,o)=>n({...t,tag:"summary"},o)),_t=e((t,o)=>n({...t,tag:"em"},o)),to=e((t,o)=>n({...t,tag:"strong"},o)),oo=e((t,o)=>n({...t,tag:"small"},o)),eo=e((t,o)=>n({...t,tag:"s"},o)),no=e((t,o)=>n({...t,tag:"cite"},o)),ro=e((t,o)=>n({...t,tag:"q"},o)),ao=e((t,o)=>n({...t,tag:"dfn"},o)),co=e((t,o)=>n({...t,tag:"abbr"},o)),so=e((t,o)=>n({...t,tag:"data"},o)),po=e((t,o)=>n({...t,tag:"time"},o)),go=e((t,o)=>n({...t,tag:"var"},o)),xo=e((t,o)=>n({...t,tag:"samp"},o)),io=e((t,o)=>n({...t,tag:"kbd"},o)),uo=e((t,o)=>n({...t,tag:"sub"},o)),lo=e((t,o)=>n({...t,tag:"sup"},o)),fo=e((t,o)=>n({...t,tag:"i"},o)),mo=e((t,o)=>n({...t,tag:"b"},o)),bo=e((t,o)=>n({...t,tag:"u"},o)),ho=e((t,o)=>n({...t,tag:"mark"},o)),Co=e((t,o)=>n({...t,tag:"ruby"},o)),yo=e((t,o)=>n({...t,tag:"rt"},o)),ko=e((t,o)=>n({...t,tag:"rp"},o)),Bo=e((t,o)=>n({...t,tag:"bdi"},o)),So=e((t,o)=>n({...t,tag:"bdo"},o)),To=e(t=>n({...t,tag:"wbr"},null)),Do=e(t=>n({...t,tag:"comment"},null));export{tt as A,co as Abbr,bt as Article,kt as Aside,Ht as Audio,mo as B,Bo as Bdi,So as Bdo,qt as Blockquote,G as Body,at as Br,L as Button,Nt as Canvas,ft as Checkbox,no as Cite,Kt as Code,Do as Comment,so as Data,$t as Dd,Xt as Details,ao as Dfn,X as Dialog,J as Div,Wt as Dl,E as Doctype,Yt as Dt,_t as Em,jt as Fieldset,St as Figcaption,Bt as Figure,Ct as Footer,Rt as Form,pt as H1,gt as H2,xt as H3,it as H4,ut as H5,lt as H6,Y as Head,ht as Header,ct as Hr,K as Html,fo as I,S as If,T as IfState,Jt as Iframe,rt as Img,P as Input,io as Kbd,dt as Label,zt as Legend,nt as Li,z as Link,Tt as Main,ho as Mark,j as Meta,Gt as Meter,yt as Nav,Qt as Ol,y as On,B as OnRoute,k as OnState,Vt as Option,_ as P,Et as Pre,Ut as Progress,ro as Q,ko as Rp,yo as Rt,Co as Ruby,eo as S,xo as Samp,Q as Script,mt as Section,Ft as Select,oo as Small,Z as Span,to as Strong,W as Style,uo as Sub,ot as SubmitButton,Zt as Summary,lo as Sup,Ot as Table,wt as Tbody,Pt as Td,st as Text,Mt as Textarea,At as Tfoot,Lt as Th,vt as Thead,po as Time,$ as Title,It as Tr,bo as U,et as Ul,I as UseParent,go as Var,Dt as Video,To as Wbr};
//# sourceMappingURL=atoms.js.map