@minejs/jsx 0.2.5 → 0.2.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/README.md +19 -19
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{jsx-dev-runtime-DmA69Qn_.d.cts → jsx-dev-runtime-BMji0LKs.d.cts} +43 -2
- package/dist/{jsx-dev-runtime-DmA69Qn_.d.ts → jsx-dev-runtime-BMji0LKs.d.ts} +43 -2
- package/dist/jsx-dev-runtime.cjs +2 -2
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.cjs +2 -2
- package/dist/jsx-runtime.cjs.map +1 -1
- package/dist/jsx-runtime.d.cts +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +2 -2
- package/dist/jsx-runtime.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<div align="center">
|
|
11
|
-
<img src="https://img.shields.io/badge/v-0.2.
|
|
11
|
+
<img src="https://img.shields.io/badge/v-0.2.7-black"/>
|
|
12
12
|
<img src="https://img.shields.io/badge/🔥-@minejs-black"/>
|
|
13
13
|
<br>
|
|
14
|
-
<img src="https://img.shields.io/badge/coverage-
|
|
14
|
+
<img src="https://img.shields.io/badge/coverage-98.11%25-brightgreen" alt="Test Coverage" />
|
|
15
15
|
<img src="https://img.shields.io/github/issues/minejs-org/jsx?style=flat" alt="Github Repo Issues" />
|
|
16
16
|
<img src="https://img.shields.io/github/stars/minejs-org/jsx?style=social" alt="GitHub Repo stars" />
|
|
17
17
|
</div>
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
```typescript
|
|
53
53
|
// Create simple element
|
|
54
54
|
const el = jsx('div', {
|
|
55
|
-
className: 'container',
|
|
56
|
-
children: 'Hello World'
|
|
55
|
+
className : 'container',
|
|
56
|
+
children : 'Hello World'
|
|
57
57
|
})
|
|
58
58
|
|
|
59
59
|
// Create with attributes
|
|
60
60
|
const button = jsx('button', {
|
|
61
|
-
id: 'submit',
|
|
62
|
-
children: 'Click me',
|
|
63
|
-
onClick: () => console.log('Clicked!')
|
|
61
|
+
id : 'submit',
|
|
62
|
+
children : 'Click me',
|
|
63
|
+
onClick : () => console.log('Clicked!')
|
|
64
64
|
})
|
|
65
65
|
```
|
|
66
66
|
|
|
@@ -107,22 +107,22 @@
|
|
|
107
107
|
```typescript
|
|
108
108
|
// Apply Tailwind-like props directly!
|
|
109
109
|
const card = jsx('div', {
|
|
110
|
-
display: 'flex',
|
|
111
|
-
direction: 'column',
|
|
112
|
-
p: 4,
|
|
113
|
-
gap: 2,
|
|
114
|
-
bg: 'white',
|
|
115
|
-
shadow: 'md',
|
|
116
|
-
radius: 'lg',
|
|
117
|
-
children: 'Beautiful Card'
|
|
110
|
+
display : 'flex',
|
|
111
|
+
direction : 'column',
|
|
112
|
+
p : 4, // padding: 1rem
|
|
113
|
+
gap : 2, // gap: 0.5rem
|
|
114
|
+
bg : 'white', // background-color
|
|
115
|
+
shadow : 'md', // box-shadow
|
|
116
|
+
radius : 'lg', // border-radius
|
|
117
|
+
children : 'Beautiful Card'
|
|
118
118
|
})
|
|
119
119
|
|
|
120
120
|
// Create Overlay
|
|
121
121
|
const modal = jsx('div', {
|
|
122
|
-
overlay: true,
|
|
123
|
-
backdrop: true,
|
|
124
|
-
location: 'center',
|
|
125
|
-
children: 'Modal Content'
|
|
122
|
+
overlay : true,
|
|
123
|
+
backdrop : true,
|
|
124
|
+
location : 'center',
|
|
125
|
+
children : 'Modal Content'
|
|
126
126
|
})
|
|
127
127
|
```
|
|
128
128
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var signals=require('@minejs/signals');var w=[],S=false;function b(e,n,t={}){let o=typeof n=="string"?document.querySelector(n):n;if(!o)throw new Error(`Container not found: ${n}`);let r=typeof e=="function"?e():e;if(!r)throw new Error("Component returned null or undefined");switch(t.mode||"replace"){case "replace":o.innerHTML="",o.appendChild(r);break;case "append":o.appendChild(r);break;case "prepend":o.insertBefore(r,o.firstChild);break;default:o.innerHTML="",o.appendChild(r);}return t.onMount?.(),{element:r,unmount:()=>{if(r instanceof Element)r.remove();else if(r instanceof DocumentFragment)for(;r.firstChild;)r.removeChild(r.firstChild);t.onUnmount?.();},update:i=>{r instanceof Element&&i instanceof Element?r.replaceWith(i):i instanceof Element&&r instanceof DocumentFragment&&r.parentNode&&r.parentNode.replaceChild(i,r);}}}function Ve(e,n){return b(e,n,{mode:"replace"})}function ye(e,n){let t=typeof n=="string"?document.querySelector(n):n;if(!t)throw new Error(`Portal container not found: ${n}`);let o=document.createComment("portal");return e instanceof Node&&t.appendChild(e),o}function Ue(e,n){let t=typeof n=="string"?document.querySelector(n):n,o=t instanceof HTMLElement?t:null;if(!o)throw new Error(`Container not found: ${n}`);return b(e,o,{mode:"replace"})}function Qe(e,n){let t=null,o=false,r=null;return l=>{if(t)return t(l);if(r){let i=document.createElement("div");return i.className="crux-lazy-error",i.textContent=`Error loading component: ${r.message}`,i.style.color="red",i}return o||(o=true,e().then(i=>{t=i.default;}).catch(i=>{r=i instanceof Error?i:new Error(String(i));})),n||we()}}function we(){let e=document.createElement("div");return e.textContent="Loading...",e}function Ze(e){try{return e.children}catch(n){return e.fallback(n)}}function en(e){if(e.children instanceof Promise){let n=document.createElement("div");return n.style.display="contents",e.fallback instanceof Node&&n.appendChild(e.fallback),e.children.then(t=>{n.innerHTML="",t instanceof Node&&n.appendChild(t);}),n}else return e.children}function nn(e){return ye(e.children,e.to)}function tn(e){w.push(e),S||(S=true,queueMicrotask(Se));}function Se(){let e=w;w=[],S=false,e.forEach(n=>n());}function be(){return typeof window<"u"&&typeof document<"u"}function on(e){be()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e());}function rn(e){let n=typeof e=="string"?document.querySelector(e):e;if(!n||!(n instanceof HTMLElement))throw new Error(`Root container not found: ${e}`);let t=null;return {render(o){t&&t.unmount(),t=b(o,n);},unmount(){t&&(t.unmount(),t=null);}}}function ln(e){return e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function g(e){return e.replace(/\s+/g," ").trim()}var W=[/^display-(.+)$/,/^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|table|table-row|table-cell|flow-root|contents|hidden)$/,/^(static|fixed|absolute|relative|sticky)$/,/^inset-(.+)$/,/^inset-x-(.+)$/,/^inset-y-(.+)$/,/^start-(.+)$/,/^end-(.+)$/,/^top-(.+)$/,/^bottom-(.+)$/,/^z-(.+)$/,/^flex-(row|col)(-reverse)?$/,/^flex-(wrap|nowrap)(-reverse)?$/,/^flex-(1|auto|initial|none)$/,/^basis-(.+)$/,/^grow(-0)?$/,/^shrink(-0)?$/,/^order-(.+)$/,/^gap-(\d+)$/,/^gap-x-(.+)$/,/^gap-y-(.+)$/,/^justify-items-(.+)$/,/^justify-self-(.+)$/,/^justify-(start|end|center|between|around|evenly|stretch)$/,/^content-(.+)$/,/^items-(.+)$/,/^self-(.+)$/,/^place-content-(.+)$/,/^place-items-(.+)$/,/^place-self-(.+)$/,/^grid-cols-(.+)$/,/^col-span-(.+)$/,/^col-start-(.+)$/,/^col-end-(.+)$/,/^grid-rows-(.+)$/,/^row-span-(.+)$/,/^row-start-(.+)$/,/^row-end-(.+)$/,/^grid-flow-(.+)$/,/^p-(.+)$/,/^px-(.+)$/,/^py-(.+)$/,/^pt-(.+)$/,/^pb-(.+)$/,/^ps-(.+)$/,/^pe-(.+)$/,/^m-(.+)$/,/^mx-(.+)$/,/^my-(.+)$/,/^mt-(.+)$/,/^mb-(.+)$/,/^ms-(.+)$/,/^me-(.+)$/,/^w-(.+)$/,/^min-w-(.+)$/,/^max-w-(.+)$/,/^h-(.+)$/,/^min-h-(.+)$/,/^max-h-(.+)$/,/^font-(sans|serif|mono)$/,/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,/^text-(xs|sm|base|md|lg|xl|\d+xl)$/,/^leading-(.+)$/,/^tracking-(.+)$/,/^text-(left|center|right|justify|start|end)$/,/^text-(wrap|nowrap|balance|pretty)$/,/^(truncate|text-ellipsis|text-clip)$/,/^(uppercase|lowercase|capitalize|normal-case)$/,/^(italic|not-italic)$/,/^(underline|overline|line-through|no-underline)$/,/^text-(?!left|center|right|justify|start|end|xs|sm|base|md|lg|xl|\d+xl|wrap|nowrap|balance|pretty|ellipsis|clip).+$/,/^bg-(?!blend).+$/,/^bg-blend-(.+)$/,/^mix-blend-(.+)$/,/^shadow(.*)$/,/^opacity-(.+)$/,/^blur(.*)$/,/^brightness-(.+)$/,/^contrast-(.+)$/,/^grayscale(.*)$/,/^invert(.*)$/,/^saturate-(.+)$/,/^sepia(.*)$/,/^hue-rotate-(.+)$/,/^backdrop-blur(.*)$/,/^transition(.*)$/];function I(e){let n=e.trim().split(/\s+/);if(n.length<=1&&n[0]==="")return "";if(n.length===1)return n[0];let t=new Set,o=[];for(let r=n.length-1;r>=0;r--){let l=n[r];if(!l)continue;let i=l;for(let s=0;s<W.length;s++)if(W[s].test(l)){i=s;break}t.has(i)||(t.add(i),o.push(l));}return o.reverse().join(" ")}var k={center:"justify-center items-center",top:"justify-center items-start",bottom:"justify-center items-end",left:"justify-start items-center",right:"justify-end items-center","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},Ee={block:"block","inline-block":"inline-block",flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid"},$e={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},Ce={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Me={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},Le={xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full",min:"max-w-min",max:"max-w-max",fit:"max-w-fit",none:"max-w-none",prose:"max-w-prose"},Te={0:"border-0",1:"border",2:"border-2",4:"border-4",8:"border-8"},He={none:"rounded-none",sm:"rounded-sm",base:"rounded",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"},ve={none:"shadow-none",xs:"shadow-xs",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl",inner:"shadow-inner"};function m(e,n){if(n!==void 0)return `${e}-${n}`}function f(e,n){if(n!==void 0)return n==="auto"?`${e}-auto`:`${e}-${n}`}var z=new Set([0,1,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,48,56,64]),Ne=new Set(["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","5/6","1/12"]),Pe=new Set(["auto","full","screen","min","max","fit"]),Xe=new Set(["auto","full","screen","min","max","fit"]),Je=new Set(["0","full","min","max","fit"]),Re=new Set(["none","full","min","max","fit"]),je=new Set(["0","full","screen","min","max","fit"]),Ae=new Set(["none","full","screen","min","max","fit"]),u=(e,n,t)=>n===void 0?null:t&&n in t?{class:t[n]}:typeof n=="number"&&z.has(n)?{class:`${e}-${n}`}:(e==="w"||e==="h")&&Ne.has(n)?{class:`${e}-${n}`}:(e==="w"?Pe:e==="h"?Xe:e==="min-w"?Je:e==="min-h"?je:e==="max-w"?Re:Ae).has(n)?{class:`${e}-${n}`}:["min-w","max-w","min-h","max-h"].includes(e)&&typeof n=="number"&&z.has(n)?{class:`${e}-${n}`}:{style:{[e==="w"?"width":e==="h"?"height":e==="min-w"?"minWidth":e==="min-h"?"minHeight":e==="max-w"?"maxWidth":"maxHeight"]:n}},B=new Set(["display","direction","align","justify","wrap","gap","gapX","gapY","w","h","minW","minH","maxW","maxH","p","px","py","ps","pe","pt","pb","m","mx","my","ms","me","mt","mb","bg","color","border","borderColor","radius","shadow","position","overflow","zIndex","overlay","location","backdrop"]);function Y(e){let{display:n,direction:t,align:o,justify:r,wrap:l,gap:i,gapX:s,gapY:a,w:p,h:U,minW:Q,minH:Z,maxW:ee,maxH:ne,p:te,px:oe,py:re,ps:ie,pe:se,pt:le,pb:ae,m:ce,mx:de,my:me,ms:fe,me:ue,mt:pe,mb:he,bg:L,color:T,border:H,borderColor:v,radius:N,shadow:P,position:ge,overflow:X,zIndex:J,overlay:h,location:y,backdrop:xe}=e,R=u("w",p),j=u("h",U),A=u("min-w",Q),_=u("min-h",Z),O=u("max-w",ee,Le),D=u("max-h",ne),F={...R?.style,...j?.style,...A?.style,..._?.style,...O?.style,...D?.style,...h&&xe?{backgroundColor:"rgba(0, 0, 0, 0.5)"}:{}};return {className:[h&&"absolute inset-0 w-full h-full flex",h&&y&&k[y],h&&!y&&k.center,n&&Ee[n],t&&$e[t],o&&Ce[o],r&&Me[r],l&&"flex-wrap",i!==void 0&&`gap-${i}`,s!==void 0&&`gap-x-${s}`,a!==void 0&&`gap-y-${a}`,R?.class,j?.class,A?.class,_?.class,O?.class,D?.class,m("p",te),m("px",oe),m("py",re),m("ps",ie),m("pe",se),m("pt",le),m("pb",ae),f("m",ce),f("mx",de),f("my",me),f("ms",fe),f("me",ue),f("mt",pe),f("mb",he),L&&`bg-${L}`,T&&`text-${T}`,H!==void 0&&Te[H],v&&`border-${v}`,N&&He[N],P&&ve[P],ge,X&&`overflow-${X}`,J&&`z-${J}`].filter(Boolean).join(" "),style:Object.keys(F).length>0?F:void 0}}function M(e,n){return typeof e=="function"?e(n||{}):Fe(e,n||{})}var un=M;function K(e){let n=document.createDocumentFragment();return x(e.children).forEach(o=>{o instanceof Node&&n.appendChild(o);}),n}var G=false;function _e(){if(G||typeof window>"u"||typeof MutationObserver>"u")return;G=true;let e=new MutationObserver(n=>{n.forEach(t=>{t.addedNodes.forEach(o=>{o instanceof Element&&Oe(o);});});});document.body?e.observe(document.body,{childList:true,subtree:true}):document.addEventListener("DOMContentLoaded",()=>{document.body&&e.observe(document.body,{childList:true,subtree:true});});}function Oe(e){if(e.hasAttribute("data-mine-onload")){let t=e.__onload;typeof t=="function"&&t(e);}e.querySelectorAll("[data-mine-onload]").forEach(t=>{let o=t.__onload;typeof o=="function"&&o(t);});}var E=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","text","tspan","defs","clipPath","linearGradient","radialGradient","stop","mask","pattern","image","use","symbol","marker","foreignObject","animate","animateTransform","animateMotion","set","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","title","desc","metadata"]),$=new Set(["math","maction","maligngroup","malignmark","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mlongdiv","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mscarries","mscarry","msgroup","msline","mspace","msqrt","msrow","mstack","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","semantics","annotation","annotation-xml"]),V="http://www.w3.org/2000/svg",De="http://www.w3.org/1998/Math/MathML";function Fe(e,n){n.as&&(e=n.as);let t;E.has(e)?t=document.createElementNS(V,e):$.has(e)?t=document.createElementNS(De,e):t=document.createElement(e);let o="dangerouslySetInnerHTML"in n&&n.dangerouslySetInnerHTML!=null&&typeof n.dangerouslySetInnerHTML=="object"&&"__html"in n.dangerouslySetInnerHTML&&typeof n.dangerouslySetInnerHTML.__html=="string",{className:r,style:l}=Y(n);l&&!E.has(e)&&!$.has(e)&&C(t,l);let i=false;for(let[s,a]of Object.entries(n))if(!B.has(s)&&s!=="as"){if(s==="children")o||We(t,a);else if(s==="dangerouslySetInnerHTML")Ge(t,a);else if(s==="onload")t.__onload=a,t.setAttribute("data-mine-onload",""),_e();else if(s==="ref")Ie(t,a);else if(s.startsWith("on"))ke(t,s,a);else if(s==="id")ze(t,a);else if(s==="htmlFor")Be(t,a);else if(s==="className"||s==="class")i=true,q(t,a,r);else if(s==="style")Ye(t,a);else if(signals.isSignal(a))qe(t,s,a);else if(typeof a=="boolean")a&&t.setAttribute(s,"");else if(a!=null)if(E.has(e)||$.has(e)){let p=typeof a=="string"?g(a):String(a);t.setAttribute(s,p);}else if(s in t)t[s]=a;else {let p=typeof a=="string"?g(a):String(a);t.setAttribute(s,p);}}return !i&&r&&q(t,r),t}function We(e,n){x(n).forEach(o=>{if(o instanceof Node)e.appendChild(o);else if(signals.isSignal(o)){let r=document.createTextNode("");signals.effect(()=>{r.textContent=String(o());}),e.appendChild(r);}else o!=null&&o!==false&&e.appendChild(document.createTextNode(String(o)));});}function x(e){return e==null||e===false?[]:Array.isArray(e)?e.flatMap(x):[e]}function Ie(e,n){signals.isSignal(n)?n.set(e):typeof n=="function"&&n(e);}function ke(e,n,t){if(typeof t!="function")return;let o=n.slice(2).toLowerCase();e.addEventListener(o,t);}function q(e,n,t=""){let o=r=>{let l=t?`${t} ${r}`:r,i=I(String(l));e.namespaceURI===V?e.setAttribute("class",i):e.className=i;};signals.isSignal(n)?signals.effect(()=>{let r=n();r!=null?o(String(r)):t&&o("");}):n!=null&&o(String(n));}function ze(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();t!=null?e.id=String(t):e.removeAttribute("id");}):n!=null&&(e.id=String(n));}function Be(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();t!=null?e.setAttribute("for",String(t)):e.removeAttribute("for");}):n!=null&&e.setAttribute("for",String(n));}function Ye(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();C(e,t);}):C(e,n);}function C(e,n){typeof n=="string"?e.style.cssText=n:typeof n=="object"&&n!=null&&Object.entries(n).forEach(([t,o])=>{if(o!=null){let r=t.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`);e.style.setProperty(r,String(o));}});}function Ge(e,n){if(n!=null&&typeof n=="object"&&"__html"in n){let t=n.__html;typeof t=="string"&&(e.innerHTML=t);}}function qe(e,n,t){signals.effect(()=>{let o=t();if(o!=null)if(n in e)e[n]=o;else {let r=typeof o=="string"?g(o):String(o);e.setAttribute(n,r);}else e.removeAttribute(n);});}function pn(e){return e}function hn(e){return n=>e(n)()}function gn(e){let n=document.createDocumentFragment();return e.forEach(t=>{t instanceof Node&&n.appendChild(t);}),n}function xn(e){if(signals.isSignal(e.when)){let n=document.createComment("show"),t=document.createDocumentFragment();t.appendChild(n);let o=null;return signals.effect(()=>{let r=e.when,l=r();l&&!o?(o=x(e.children)[0],o instanceof Node&&n.parentNode?.insertBefore(o,n)):!l&&o&&(o.remove(),o=null);}),t}else return e.when?M(K,{children:e.children}):null}function yn(e){for(let n of e.children)if(signals.isSignal(n.when)?n.when():n.when)return M(K,{children:n.children});return null}function wn(e){let n=document.createDocumentFragment();if(signals.isSignal(e.each)){let t=document.createElement("div");t.style.display="contents",signals.effect(()=>{let o=e.each,r=o();t.innerHTML="",r.forEach((l,i)=>{let s=e.children(l,i);s instanceof Node&&t.appendChild(s);});}),n.appendChild(t);}else e.each.forEach((o,r)=>{let l=e.children(o,r);l instanceof Node&&n.appendChild(l);});return n}
|
|
2
|
-
exports.ErrorBoundary=
|
|
1
|
+
'use strict';var signals=require('@minejs/signals');var w=[],C=false;function S(e,n,t={}){let r=typeof n=="string"?document.querySelector(n):n;if(!r)throw new Error(`Container not found: ${n}`);let o=typeof e=="function"?e():e;if(!o)throw new Error("Component returned null or undefined");switch(t.mode||"replace"){case "replace":r.innerHTML="",r.appendChild(o);break;case "append":r.appendChild(o);break;case "prepend":r.insertBefore(o,r.firstChild);break;default:r.innerHTML="",r.appendChild(o);}return t.onMount?.(),{element:o,unmount:()=>{if(o instanceof Element)o.remove();else if(o instanceof DocumentFragment)for(;o.firstChild;)o.removeChild(o.firstChild);t.onUnmount?.();},update:i=>{o instanceof Element&&i instanceof Element?o.replaceWith(i):i instanceof Element&&o instanceof DocumentFragment&&o.parentNode&&o.parentNode.replaceChild(i,o);}}}function Wn(e,n){return S(e,n,{mode:"replace"})}function Ge(e,n){let t=typeof n=="string"?document.querySelector(n):n;if(!t)throw new Error(`Portal container not found: ${n}`);let r=document.createComment("portal");return e instanceof Node&&t.appendChild(e),r}function Dn(e,n){let t=typeof n=="string"?document.querySelector(n):n,r=t instanceof HTMLElement?t:null;if(!r)throw new Error(`Container not found: ${n}`);return S(e,r,{mode:"replace"})}function _n(e,n){let t=null,r=false,o=null;return l=>{if(t)return t(l);if(o){let i=document.createElement("div");return i.className="crux-lazy-error",i.textContent=`Error loading component: ${o.message}`,i.style.color="red",i}return r||(r=true,e().then(i=>{t=i.default;}).catch(i=>{o=i instanceof Error?i:new Error(String(i));})),n||Ye()}}function Ye(){let e=document.createElement("div");return e.textContent="Loading...",e}function Fn(e){try{return e.children}catch(n){return e.fallback(n)}}function On(e){if(e.children instanceof Promise){let n=document.createElement("div");return n.style.display="contents",e.fallback instanceof Node&&n.appendChild(e.fallback),e.children.then(t=>{n.innerHTML="",t instanceof Node&&n.appendChild(t);}),n}else return e.children}function kn(e){return Ge(e.children,e.to)}function In(e){w.push(e),C||(C=true,queueMicrotask(qe));}function qe(){let e=w;w=[],C=false,e.forEach(n=>n());}function Ke(){return typeof window<"u"&&typeof document<"u"}function Bn(e){Ke()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e());}function Gn(e){let n=typeof e=="string"?document.querySelector(e):e;if(!n||!(n instanceof HTMLElement))throw new Error(`Root container not found: ${e}`);let t=null;return {render(r){t&&t.unmount(),t=S(r,n);},unmount(){t&&(t.unmount(),t=null);}}}function qn(e){return e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function x(e){return e.replace(/\s+/g," ").trim()}var le=[/^display-(.+)$/,/^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|table|table-row|table-cell|flow-root|contents|hidden)$/,/^(static|fixed|absolute|relative|sticky)$/,/^inset-(.+)$/,/^inset-x-(.+)$/,/^inset-y-(.+)$/,/^start-(.+)$/,/^end-(.+)$/,/^top-(.+)$/,/^bottom-(.+)$/,/^z-(.+)$/,/^flex-(row|col)(-reverse)?$/,/^flex-(wrap|nowrap)(-reverse)?$/,/^flex-(1|auto|initial|none)$/,/^basis-(.+)$/,/^grow(-0)?$/,/^shrink(-0)?$/,/^order-(.+)$/,/^gap-(\d+)$/,/^gap-x-(.+)$/,/^gap-y-(.+)$/,/^justify-items-(.+)$/,/^justify-self-(.+)$/,/^justify-(start|end|center|between|around|evenly|stretch)$/,/^content-(.+)$/,/^items-(.+)$/,/^self-(.+)$/,/^place-content-(.+)$/,/^place-items-(.+)$/,/^place-self-(.+)$/,/^grid-cols-(.+)$/,/^col-span-(.+)$/,/^col-start-(.+)$/,/^col-end-(.+)$/,/^grid-rows-(.+)$/,/^row-span-(.+)$/,/^row-start-(.+)$/,/^row-end-(.+)$/,/^grid-flow-(.+)$/,/^p-(.+)$/,/^px-(.+)$/,/^py-(.+)$/,/^pt-(.+)$/,/^pb-(.+)$/,/^ps-(.+)$/,/^pe-(.+)$/,/^m-(.+)$/,/^mx-(.+)$/,/^my-(.+)$/,/^mt-(.+)$/,/^mb-(.+)$/,/^ms-(.+)$/,/^me-(.+)$/,/^w-(.+)$/,/^min-w-(.+)$/,/^max-w-(.+)$/,/^h-(.+)$/,/^min-h-(.+)$/,/^max-h-(.+)$/,/^font-(sans|serif|mono)$/,/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,/^text-(xs|sm|base|md|lg|xl|\d+xl)$/,/^leading-(.+)$/,/^tracking-(.+)$/,/^text-(left|center|right|justify|start|end)$/,/^text-(wrap|nowrap|balance|pretty)$/,/^(truncate|text-ellipsis|text-clip)$/,/^(uppercase|lowercase|capitalize|normal-case)$/,/^(italic|not-italic)$/,/^(underline|no-underline)$/,/^(overline)$/,/^(line-through)$/,/^text-(?!left|center|right|justify|start|end|xs|sm|base|md|lg|xl|\d+xl|wrap|nowrap|balance|pretty|ellipsis|clip).+$/,/^bg-(?!blend).+$/,/^bg-blend-(.+)$/,/^mix-blend-(.+)$/,/^shadow(.*)$/,/^opacity-(.+)$/,/^blur(.*)$/,/^brightness-(.+)$/,/^contrast-(.+)$/,/^grayscale(.*)$/,/^invert(.*)$/,/^saturate-(.+)$/,/^sepia(.*)$/,/^hue-rotate-(.+)$/,/^backdrop-blur(.*)$/,/^transition(.*)$/];function de(e){let n=e.trim().split(/\s+/);if(n.length<=1&&n[0]==="")return "";if(n.length===1)return n[0];let t=new Set,r=[];for(let o=n.length-1;o>=0;o--){let l=n[o];if(!l)continue;let i=l;for(let a=0;a<le.length;a++)if(le[a].test(l)){i=a;break}t.has(i)||(t.add(i),r.push(l));}return r.reverse().join(" ")}var ce={center:"justify-center items-center",top:"justify-center items-start",bottom:"justify-center items-end",left:"justify-start items-center",right:"justify-end items-center","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},Ue={block:"block","inline-block":"inline-block",flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid"},Ve={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},Qe={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Ze={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},en={xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full",min:"max-w-min",max:"max-w-max",fit:"max-w-fit",none:"max-w-none",prose:"max-w-prose"},nn={0:"border-0",1:"border",2:"border-2",4:"border-4",8:"border-8"},tn={none:"rounded-none",sm:"rounded-sm",base:"rounded",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"},rn={none:"shadow-none",xs:"shadow-xs",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl","2xl":"shadow-2xl",inner:"shadow-inner"},on={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",groove:"border-groove",ridge:"border-ridge",inset:"border-inset",hidden:"border-hidden",none:"border-none"},an={auto:"cursor-auto",default:"cursor-default",pointer:"cursor-pointer",wait:"cursor-wait",text:"cursor-text",move:"cursor-move",help:"cursor-help","not-allowed":"cursor-not-allowed",none:"cursor-none",grab:"cursor-grab",grabbing:"cursor-grabbing"},sn={none:"select-none",text:"select-text",all:"select-all",auto:"select-auto"},ln={none:"pointer-events-none",auto:"pointer-events-auto"},dn={none:"resize-none",both:"resize",y:"resize-y",x:"resize-x"},cn={none:"animate-none",spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse",bounce:"animate-bounce","fade-in":"animate-fade-in","fade-out":"animate-fade-out","slide-in-up":"animate-slide-in-up","slide-in-down":"animate-slide-in-down","slide-in-left":"animate-slide-in-left","slide-in-right":"animate-slide-in-right","zoom-in":"animate-zoom-in","zoom-out":"animate-zoom-out"},mn={linear:"animate-ease-linear",in:"animate-ease-in",out:"animate-ease-out","in-out":"animate-ease-in-out"},un={forwards:"animate-fill-forwards",backwards:"animate-fill-backwards",both:"animate-fill-both",none:"animate-fill-none"},fn={xs:"text-xs",sm:"text-sm",base:"text-base",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl","7xl":"text-7xl","8xl":"text-8xl","9xl":"text-9xl"},pn={thin:"font-thin",extralight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extrabold:"font-extrabold",black:"font-black"},gn={start:"text-start",end:"text-end",left:"text-left",right:"text-right",center:"text-center",justify:"text-justify"},xn={wrap:"text-wrap",nowrap:"text-nowrap",balance:"text-balance",pretty:"text-pretty"},hn={uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize",none:"normal-case"};function u(e,n){if(n!==void 0)return `${e}-${n}`}function f(e,n){if(n!==void 0)return n==="auto"?`${e}-auto`:`${e}-${n}`}var me=new Set([0,1,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,48,56,64]),yn=new Set(["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","5/6","1/12"]),bn=new Set(["auto","full","screen","min","max","fit"]),wn=new Set(["auto","full","screen","min","max","fit"]),Cn=new Set(["0","full","min","max","fit"]),Sn=new Set(["none","full","min","max","fit"]),En=new Set(["0","full","screen","min","max","fit"]),$n=new Set(["none","full","screen","min","max","fit"]),c=(e,n,t)=>n===void 0?null:t&&n in t?{class:t[n]}:typeof n=="number"&&me.has(n)?{class:`${e}-${n}`}:(e==="w"||e==="h")&&yn.has(n)?{class:`${e}-${n}`}:(e==="w"?bn:e==="h"?wn:e==="min-w"?Cn:e==="min-h"?En:e==="max-w"?Sn:$n).has(n)?{class:`${e}-${n}`}:["min-w","max-w","min-h","max-h"].includes(e)&&typeof n=="number"&&me.has(n)?{class:`${e}-${n}`}:{style:{[e==="w"?"width":e==="h"?"height":e==="min-w"?"minWidth":e==="min-h"?"minHeight":e==="max-w"?"maxWidth":"maxHeight"]:n}},ue=new Set(["display","direction","align","justify","wrap","grow","shrink","basis","order","gap","gapX","gapY","w","h","size","minW","minH","maxW","maxH","p","px","py","ps","pe","pt","pb","m","mx","my","ms","me","mt","mb","bg","color","border","borderStyle","borderColor","radius","shadow","opacity","position","overflow","zIndex","overlay","location","backdrop","divider","cursor","select","pointerEvents","resize","animate","animateDuration","animateDelay","animateEase","animateFill","textSize","textWeight","textAlign","textWrap","textTransform","italic","underline","lineThrough","truncate"]);function fe(e){let{display:n,direction:t,align:r,justify:o,wrap:l,grow:i,shrink:a,basis:s,order:p,gap:L,gapX:v,gapY:R,w:ye,h:be,size:H,minW:we,minH:Ce,maxW:Se,maxH:Ee,p:$e,px:Me,py:Te,ps:Le,pe:ve,pt:Re,pb:He,m:Ae,mx:Pe,my:Ne,ms:Xe,me:ze,mt:Je,mb:je,bg:A,color:P,border:N,borderStyle:X,borderColor:z,radius:J,shadow:j,opacity:W,position:We,overflow:D,zIndex:_,overlay:g,location:y,backdrop:De,divider:b,cursor:F,select:O,pointerEvents:k,resize:I,animate:B,animateDuration:G,animateDelay:Y,animateEase:q,animateFill:K,textSize:U,textWeight:V,textAlign:Q,textWrap:Z,textTransform:ee,italic:_e,underline:Fe,lineThrough:Oe,truncate:ke}=e,Ie=c("w",H),Be=c("h",H),ne=c("w",ye)||Ie,te=c("h",be)||Be,re=c("min-w",we),oe=c("min-h",Ce),ie=c("max-w",Se,en),ae=c("max-h",Ee),se={...ne?.style,...te?.style,...re?.style,...oe?.style,...ie?.style,...ae?.style,...s&&typeof s=="string"&&!["auto","full"].includes(s)?{flexBasis:s}:{},...p!==void 0?{order:p}:{},...i!==void 0&&typeof i=="number"?{flexGrow:i}:{},...a!==void 0&&typeof a=="number"?{flexShrink:a}:{},...g&&De?{backgroundColor:"rgba(0, 0, 0, 0.5)"}:{}};return {className:[g&&"absolute inset-0 w-full h-full flex",g&&y&&ce[y],g&&!y&&ce.center,n&&Ue[n],t&&Ve[t],r&&Qe[r],o&&Ze[o],l&&"flex-wrap",i===true&&"grow",i===false&&"grow-0",a===true&&"shrink",a===false&&"shrink-0",s&&typeof s=="string"&&["auto","full"].includes(s)&&`basis-${s}`,L!==void 0&&`gap-${L}`,v!==void 0&&`gap-x-${v}`,R!==void 0&&`gap-y-${R}`,ne?.class,te?.class,re?.class,oe?.class,ie?.class,ae?.class,u("p",$e),u("px",Me),u("py",Te),u("ps",Le),u("pe",ve),u("pt",Re),u("pb",He),f("m",Ae),f("mx",Pe),f("my",Ne),f("ms",Xe),f("me",ze),f("mt",Je),f("mb",je),A&&`bg-${A}`,P&&`text-${P}`,N!==void 0&&nn[N],X&&on[X],z&&`border-${z}`,J&&tn[J],j&&rn[j],W!==void 0&&`opacity-${W}`,We,D&&`overflow-${D}`,_&&`z-${_}`,F&&an[F],O&&sn[O],k&&ln[k],I&&dn[I],B&&cn[B],G&&`animate-duration-${G}`,Y&&`animate-delay-${Y}`,q&&mn[q],K&&un[K],U&&fn[U],V&&pn[V],Q&&gn[Q],Z&&xn[Z],ee&&hn[ee],_e&&"italic",Fe&&"underline",Oe&&"line-through",ke&&"truncate",b===true&&"border-t",b==="horizontal"&&"border-t",b==="vertical"&&"border-s"].filter(Boolean).join(" "),style:Object.keys(se).length>0?se:void 0}}function T(e,n){return typeof e=="function"?e(n||{}):vn(e,n||{})}var et=T;function xe(e){let n=document.createDocumentFragment();return h(e.children).forEach(r=>{r instanceof Node&&n.appendChild(r);}),n}var pe=false;function Mn(){if(pe||typeof window>"u"||typeof MutationObserver>"u")return;pe=true;let e=new MutationObserver(n=>{n.forEach(t=>{t.addedNodes.forEach(r=>{r instanceof Element&&Tn(r);});});});document.body?e.observe(document.body,{childList:true,subtree:true}):document.addEventListener("DOMContentLoaded",()=>{document.body&&e.observe(document.body,{childList:true,subtree:true});});}function Tn(e){if(e.hasAttribute("data-mine-onload")){let t=e.__onload;typeof t=="function"&&t(e);}e.querySelectorAll("[data-mine-onload]").forEach(t=>{let r=t.__onload;typeof r=="function"&&r(t);});}var E=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","text","tspan","defs","clipPath","linearGradient","radialGradient","stop","mask","pattern","image","use","symbol","marker","foreignObject","animate","animateTransform","animateMotion","set","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","title","desc","metadata"]),$=new Set(["math","maction","maligngroup","malignmark","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mlongdiv","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mscarries","mscarry","msgroup","msline","mspace","msqrt","msrow","mstack","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","semantics","annotation","annotation-xml"]),he="http://www.w3.org/2000/svg",Ln="http://www.w3.org/1998/Math/MathML";function vn(e,n){n.as&&(e=n.as);let t;E.has(e)?t=document.createElementNS(he,e):$.has(e)?t=document.createElementNS(Ln,e):t=document.createElement(e);let r="dangerouslySetInnerHTML"in n&&n.dangerouslySetInnerHTML!=null&&typeof n.dangerouslySetInnerHTML=="object"&&"__html"in n.dangerouslySetInnerHTML&&typeof n.dangerouslySetInnerHTML.__html=="string",{className:o,style:l}=fe(n);n.divider&&!n.role&&t.setAttribute("role","separator"),l&&!E.has(e)&&!$.has(e)&&M(t,l);let i=false;for(let[a,s]of Object.entries(n))if(!ue.has(a)&&a!=="as"){if(a==="children")r||Rn(t,s);else if(a==="dangerouslySetInnerHTML")zn(t,s);else if(a==="onload")t.__onload=s,t.setAttribute("data-mine-onload",""),Mn();else if(a==="ref")Hn(t,s);else if(a.startsWith("on"))An(t,a,s);else if(a==="id")Pn(t,s);else if(a==="htmlFor")Nn(t,s);else if(a==="className"||a==="class")i=true,ge(t,s,o);else if(a==="style")Xn(t,s);else if(signals.isSignal(s))Jn(t,a,s);else if(typeof s=="boolean")s&&t.setAttribute(a,"");else if(s!=null)if(E.has(e)||$.has(e)){let p=typeof s=="string"?x(s):String(s);t.setAttribute(a,p);}else if(a in t)t[a]=s;else {let p=typeof s=="string"?x(s):String(s);t.setAttribute(a,p);}}return !i&&o&&ge(t,o),t}function Rn(e,n){h(n).forEach(r=>{if(r instanceof Node)e.appendChild(r);else if(signals.isSignal(r)){let o=document.createTextNode("");signals.effect(()=>{o.textContent=String(r());}),e.appendChild(o);}else r!=null&&r!==false&&e.appendChild(document.createTextNode(String(r)));});}function h(e){return e==null||e===false?[]:Array.isArray(e)?e.flatMap(h):[e]}function Hn(e,n){signals.isSignal(n)?n.set(e):typeof n=="function"&&n(e);}function An(e,n,t){if(typeof t!="function")return;let r=n.slice(2).toLowerCase();e.addEventListener(r,t);}function ge(e,n,t=""){let r=o=>{let l=t?`${t} ${o}`:o,i=de(String(l));e.namespaceURI===he?e.setAttribute("class",i):e.className=i;};signals.isSignal(n)?signals.effect(()=>{let o=n();o!=null?r(String(o)):t&&r("");}):n!=null&&r(String(n));}function Pn(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();t!=null?e.id=String(t):e.removeAttribute("id");}):n!=null&&(e.id=String(n));}function Nn(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();t!=null?e.setAttribute("for",String(t)):e.removeAttribute("for");}):n!=null&&e.setAttribute("for",String(n));}function Xn(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();M(e,t);}):M(e,n);}function M(e,n){typeof n=="string"?e.style.cssText=n:typeof n=="object"&&n!=null&&Object.entries(n).forEach(([t,r])=>{if(r!=null){let o=t.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`);e.style.setProperty(o,String(r));}});}function zn(e,n){if(n!=null&&typeof n=="object"&&"__html"in n){let t=n.__html;typeof t=="string"&&(e.innerHTML=t);}}function Jn(e,n,t){signals.effect(()=>{let r=t();if(r!=null)if(n in e)e[n]=r;else {let o=typeof r=="string"?x(r):String(r);e.setAttribute(n,o);}else e.removeAttribute(n);});}function nt(e){return e}function tt(e){return n=>e(n)()}function rt(e){let n=document.createDocumentFragment();return e.forEach(t=>{t instanceof Node&&n.appendChild(t);}),n}function ot(e){if(signals.isSignal(e.when)){let n=document.createComment("show"),t=document.createDocumentFragment();t.appendChild(n);let r=null;return signals.effect(()=>{let o=e.when,l=o();l&&!r?(r=h(e.children)[0],r instanceof Node&&n.parentNode?.insertBefore(r,n)):!l&&r&&(r.remove(),r=null);}),t}else return e.when?T(xe,{children:e.children}):null}function it(e){for(let n of e.children)if(signals.isSignal(n.when)?n.when():n.when)return T(xe,{children:n.children});return null}function at(e){let n=document.createDocumentFragment();if(signals.isSignal(e.each)){let t=document.createElement("div");t.style.display="contents",signals.effect(()=>{let r=e.each,o=r();t.innerHTML="",o.forEach((l,i)=>{let a=e.children(l,i);a instanceof Node&&t.appendChild(a);});}),n.appendChild(t);}else e.each.forEach((r,o)=>{let l=e.children(r,o);l instanceof Node&&n.appendChild(l);});return n}
|
|
2
|
+
exports.ErrorBoundary=Fn;exports.For=at;exports.Fragment=xe;exports.Show=ot;exports.Suspense=On;exports.Switch=it;exports.Teleport=kn;exports.cleanClassName=de;exports.component=nt;exports.createElements=rt;exports.createPortal=Ge;exports.createRoot=Gn;exports.defineComponent=tt;exports.hydrate=Dn;exports.isBrowser=Ke;exports.jsx=T;exports.jsxs=et;exports.lazy=_n;exports.minifyHTML=qn;exports.mount=Wn;exports.normalizeString=x;exports.onDOMReady=Bn;exports.queueUpdate=In;exports.render=S;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|