@minejs/jsx 0.1.8 → 0.2.0

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 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.1.8-black"/>
11
+ <img src="https://img.shields.io/badge/v-0.2.0-black"/>
12
12
  <img src="https://img.shields.io/badge/🔥-@minejs-black"/>
13
13
  <br>
14
- <img src="https://img.shields.io/badge/coverage-91.43%25-brightgreen" alt="Test Coverage" />
14
+ <img src="https://img.shields.io/badge/coverage-97.65%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>
@@ -102,6 +102,22 @@
102
102
  })
103
103
  ```
104
104
 
105
+ - ### 5. Layout & Styling Props
106
+
107
+ ```typescript
108
+ // Apply Tailwind-like props directly!
109
+ const card = jsx('div', {
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
+ })
119
+ ```
120
+
105
121
  <br>
106
122
 
107
123
  - ## API Reference 🔥
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var signals=require('@minejs/signals');var d=[],u=false;function p(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:l=>{r instanceof Element&&l instanceof Element?r.replaceWith(l):l instanceof Element&&r instanceof DocumentFragment&&r.parentNode&&r.parentNode.replaceChild(l,r);}}}function R(e,n){return p(e,n,{mode:"replace"})}function L(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 z(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 p(e,o,{mode:"replace"})}function G(e,n){let t=null,o=false,r=null;return i=>{if(t)return t(i);if(r){let l=document.createElement("div");return l.className="crux-lazy-error",l.textContent=`Error loading component: ${r.message}`,l.style.color="red",l}return o||(o=true,e().then(l=>{t=l.default;}).catch(l=>{r=l instanceof Error?l:new Error(String(l));})),n||T()}}function T(){let e=document.createElement("div");return e.textContent="Loading...",e}function q(e){try{return e.children}catch(n){return e.fallback(n)}}function B(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 V(e){return L(e.children,e.to)}function U(e){d.push(e),u||(u=true,queueMicrotask(v));}function v(){let e=d;d=[],u=false,e.forEach(n=>n());}function J(){return typeof window<"u"&&typeof document<"u"}function W(e){J()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e());}function K(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=p(o,n);},unmount(){t&&(t.unmount(),t=null);}}}function Z(e){return e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function f(e){return e.replace(/\s+/g," ").trim()}var $=[/^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 S(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 i=n[r];if(!i)continue;let l=i;for(let s=0;s<$.length;s++)if($[s].test(i)){l=s;break}t.has(l)||(t.add(l),o.push(i));}return o.reverse().join(" ")}function y(e,n){return typeof e=="function"?e(n||{}):X(e,n||{})}var te=y;function w(e){let n=document.createDocumentFragment();return m(e.children).forEach(o=>{o instanceof Node&&n.appendChild(o);}),n}var b=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"]),x=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"]),C="http://www.w3.org/2000/svg",N="http://www.w3.org/1998/Math/MathML";function X(e,n){let t;b.has(e)?t=document.createElementNS(C,e):x.has(e)?t=document.createElementNS(N,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";for(let[r,i]of Object.entries(n))if(r==="children")o||H(t,i);else if(r==="dangerouslySetInnerHTML")_(t,i);else if(r==="ref")A(t,i);else if(r==="onload")k(t,i);else if(r.startsWith("on"))D(t,r,i);else if(r==="className"||r==="class")O(t,i);else if(r==="style")j(t,i);else if(signals.isSignal(i))I(t,r,i);else if(typeof i=="boolean")i&&t.setAttribute(r,"");else if(i!=null)if(b.has(e)||x.has(e)){let l=typeof i=="string"?f(i):String(i);t.setAttribute(r,l);}else if(r in t)t[r]=i;else {let l=typeof i=="string"?f(i):String(i);t.setAttribute(r,l);}return t}function H(e,n){m(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 m(e){return e==null||e===false?[]:Array.isArray(e)?e.flatMap(m):[e]}var g=new WeakMap,E="data-mine-onload",h=null;function P(){h||typeof MutationObserver>"u"||(h=new MutationObserver(e=>{e.forEach(n=>{n.addedNodes.forEach(t=>{t.nodeType===1&&F(t);});});}),h.observe(document,{childList:true,subtree:true}));}function F(e){if(e.hasAttribute(E)){let t=g.get(e);t&&t();}e.querySelectorAll(`[${E}]`).forEach(t=>{let o=g.get(t);o&&o();});}function k(e,n){typeof n=="function"&&(g.set(e,n),e.setAttribute(E,"true"),P());}function A(e,n){signals.isSignal(n)?n.set(e):typeof n=="function"&&n(e);}function D(e,n,t){if(typeof t!="function")return;let o=n.slice(2).toLowerCase();e.addEventListener(o,t);}function O(e,n){let t=o=>{let r=S(String(o));e.namespaceURI===C?e.setAttribute("class",r):e.className=r;};signals.isSignal(n)?signals.effect(()=>{let o=n();o!=null&&t(String(o));}):n!=null&&t(String(n));}function j(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,o])=>{if(o!=null){let r=t.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);e.style.setProperty(r,String(o));}});}function _(e,n){if(n!=null&&typeof n=="object"&&"__html"in n){let t=n.__html;typeof t=="string"&&(e.innerHTML=t);}}function I(e,n,t){signals.effect(()=>{let o=t();if(o!=null)if(n in e)e[n]=o;else {let r=typeof o=="string"?f(o):String(o);e.setAttribute(n,r);}else e.removeAttribute(n);});}function oe(e){return e}function re(e){return n=>e(n)()}function ie(e){let n=document.createDocumentFragment();return e.forEach(t=>{t instanceof Node&&n.appendChild(t);}),n}function le(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,i=r();i&&!o?(o=m(e.children)[0],o instanceof Node&&n.parentNode?.insertBefore(o,n)):!i&&o&&(o.remove(),o=null);}),t}else return e.when?y(w,{children:e.children}):null}function ae(e){for(let n of e.children)if(signals.isSignal(n.when)?n.when():n.when)return y(w,{children:n.children});return null}function se(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((i,l)=>{let s=e.children(i,l);s instanceof Node&&t.appendChild(s);});}),n.appendChild(t);}else e.each.forEach((o,r)=>{let i=e.children(o,r);i instanceof Node&&n.appendChild(i);});return n}
2
- exports.ErrorBoundary=q;exports.For=se;exports.Fragment=w;exports.Show=le;exports.Suspense=B;exports.Switch=ae;exports.Teleport=V;exports.cleanClassName=S;exports.component=oe;exports.createElements=ie;exports.createPortal=L;exports.createRoot=K;exports.defineComponent=re;exports.hydrate=z;exports.isBrowser=J;exports.jsx=y;exports.jsxs=te;exports.lazy=G;exports.minifyHTML=Z;exports.mount=R;exports.normalizeString=f;exports.onDOMReady=W;exports.queueUpdate=U;exports.render=p;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var signals=require('@minejs/signals');var x=[],y=false;function w(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 Be(e,n){return w(e,n,{mode:"replace"})}function pe(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 Ye(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 w(e,o,{mode:"replace"})}function Ge(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||he()}}function he(){let e=document.createElement("div");return e.textContent="Loading...",e}function qe(e){try{return e.children}catch(n){return e.fallback(n)}}function Ke(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 Ve(e){return pe(e.children,e.to)}function Ue(e){x.push(e),y||(y=true,queueMicrotask(ge));}function ge(){let e=x;x=[],y=false,e.forEach(n=>n());}function xe(){return typeof window<"u"&&typeof document<"u"}function Qe(e){xe()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e());}function Ze(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=w(o,n);},unmount(){t&&(t.unmount(),t=null);}}}function nn(e){return e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function h(e){return e.replace(/\s+/g," ").trim()}var j=[/^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 W(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<j.length;s++)if(j[s].test(l)){i=s;break}t.has(i)||(t.add(i),o.push(l));}return o.reverse().join(" ")}var ye={block:"block","inline-block":"inline-block",flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid"},we={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},Se={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Ee={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},$e={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"},be={0:"border-0",1:"border",2:"border-2",4:"border-4",8:"border-8"},Ce={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"},Me={none:"shadow-none",xs:"shadow-xs",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl",inner:"shadow-inner"};function d(e,n){if(n!==void 0)return `${e}-${n}`}function m(e,n){if(n!==void 0)return n==="auto"?`${e}-auto`:`${e}-${n}`}var F=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]),Le=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"]),Te=new Set(["auto","full","screen","min","max","fit"]),He=new Set(["auto","full","screen","min","max","fit"]),Ne=new Set(["0","full","min","max","fit"]),Xe=new Set(["none","full","min","max","fit"]),ve=new Set(["0","full","screen","min","max","fit"]),Je=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"&&F.has(n)?{class:`${e}-${n}`}:(e==="w"||e==="h")&&Le.has(n)?{class:`${e}-${n}`}:(e==="w"?Te:e==="h"?He:e==="min-w"?Ne:e==="min-h"?ve:e==="max-w"?Xe:Je).has(n)?{class:`${e}-${n}`}:["min-w","max-w","min-h","max-h"].includes(e)&&typeof n=="number"&&F.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}},I=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"]);function z(e){let{display:n,direction:t,align:o,justify:r,wrap:l,gap:i,gapX:s,gapY:a,w:p,h:q,minW:K,minH:V,maxW:U,maxH:Q,p:Z,px:ee,py:ne,ps:te,pe:oe,pt:re,pb:ie,m:se,mx:le,my:ae,ms:ce,me:de,mt:me,mb:fe,bg:C,color:M,border:L,borderColor:T,radius:H,shadow:N,position:ue,overflow:X,zIndex:v}=e,J=u("w",p),P=u("h",q),R=u("min-w",K),_=u("min-h",V),A=u("max-w",U,$e),D=u("max-h",Q),O={...J?.style,...P?.style,...R?.style,..._?.style,...A?.style,...D?.style};return {className:[n&&ye[n],t&&we[t],o&&Se[o],r&&Ee[r],l&&"flex-wrap",i!==void 0&&`gap-${i}`,s!==void 0&&`gap-x-${s}`,a!==void 0&&`gap-y-${a}`,J?.class,P?.class,R?.class,_?.class,A?.class,D?.class,d("p",Z),d("px",ee),d("py",ne),d("ps",te),d("pe",oe),d("pt",re),d("pb",ie),m("m",se),m("mx",le),m("my",ae),m("ms",ce),m("me",de),m("mt",me),m("mb",fe),C&&`bg-${C}`,M&&`text-${M}`,L!==void 0&&be[L],T&&`border-${T}`,H&&Ce[H],N&&Me[N],ue,X&&`overflow-${X}`,v&&`z-${v}`].filter(Boolean).join(" "),style:Object.keys(O).length>0?O:void 0}}function b(e,n){return typeof e=="function"?e(n||{}):Ae(e,n||{})}var an=b;function Y(e){let n=document.createDocumentFragment();return g(e.children).forEach(o=>{o instanceof Node&&n.appendChild(o);}),n}var k=false;function Pe(){if(k||typeof window>"u"||typeof MutationObserver>"u")return;k=true;let e=new MutationObserver(n=>{n.forEach(t=>{t.addedNodes.forEach(o=>{o instanceof Element&&Re(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 Re(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 S=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"]),E=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"]),G="http://www.w3.org/2000/svg",_e="http://www.w3.org/1998/Math/MathML";function Ae(e,n){let t;S.has(e)?t=document.createElementNS(G,e):E.has(e)?t=document.createElementNS(_e,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}=z(n);l&&!S.has(e)&&!E.has(e)&&$(t,l);let i=false;for(let[s,a]of Object.entries(n))if(!I.has(s)){if(s==="children")o||De(t,a);else if(s==="dangerouslySetInnerHTML")Ie(t,a);else if(s==="onload")t.__onload=a,t.setAttribute("data-mine-onload",""),Pe();else if(s==="ref")Oe(t,a);else if(s.startsWith("on"))je(t,s,a);else if(s==="id")We(t,a);else if(s==="className"||s==="class")i=true,B(t,a,r);else if(s==="style")Fe(t,a);else if(signals.isSignal(a))ze(t,s,a);else if(typeof a=="boolean")a&&t.setAttribute(s,"");else if(a!=null)if(S.has(e)||E.has(e)){let p=typeof a=="string"?h(a):String(a);t.setAttribute(s,p);}else if(s in t)t[s]=a;else {let p=typeof a=="string"?h(a):String(a);t.setAttribute(s,p);}}return !i&&r&&B(t,r),t}function De(e,n){g(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 g(e){return e==null||e===false?[]:Array.isArray(e)?e.flatMap(g):[e]}function Oe(e,n){signals.isSignal(n)?n.set(e):typeof n=="function"&&n(e);}function je(e,n,t){if(typeof t!="function")return;let o=n.slice(2).toLowerCase();e.addEventListener(o,t);}function B(e,n,t=""){let o=r=>{let l=t?`${t} ${r}`:r,i=W(String(l));e.namespaceURI===G?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 We(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 Fe(e,n){signals.isSignal(n)?signals.effect(()=>{let t=n();$(e,t);}):$(e,n);}function $(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 Ie(e,n){if(n!=null&&typeof n=="object"&&"__html"in n){let t=n.__html;typeof t=="string"&&(e.innerHTML=t);}}function ze(e,n,t){signals.effect(()=>{let o=t();if(o!=null)if(n in e)e[n]=o;else {let r=typeof o=="string"?h(o):String(o);e.setAttribute(n,r);}else e.removeAttribute(n);});}function cn(e){return e}function dn(e){return n=>e(n)()}function mn(e){let n=document.createDocumentFragment();return e.forEach(t=>{t instanceof Node&&n.appendChild(t);}),n}function fn(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=g(e.children)[0],o instanceof Node&&n.parentNode?.insertBefore(o,n)):!l&&o&&(o.remove(),o=null);}),t}else return e.when?b(Y,{children:e.children}):null}function un(e){for(let n of e.children)if(signals.isSignal(n.when)?n.when():n.when)return b(Y,{children:n.children});return null}function pn(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=qe;exports.For=pn;exports.Fragment=Y;exports.Show=fn;exports.Suspense=Ke;exports.Switch=un;exports.Teleport=Ve;exports.cleanClassName=W;exports.component=cn;exports.createElements=mn;exports.createPortal=pe;exports.createRoot=Ze;exports.defineComponent=dn;exports.hydrate=Ye;exports.isBrowser=xe;exports.jsx=b;exports.jsxs=an;exports.lazy=Ge;exports.minifyHTML=nn;exports.mount=Be;exports.normalizeString=h;exports.onDOMReady=Qe;exports.queueUpdate=Ue;exports.render=w;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/mod/render.ts","../src/mod/utils.ts","../src/mod/runtime.ts"],"names":["updateQueue","isFlushPending","render","component","container","options","target","element","newElement","mount","createPortal","children","placeholder","hydrate","targetElement","lazy","loader","fallback","loadedComponent","loading","error","props","errorDiv","module","err","createLoadingElement","div","ErrorBoundary","Suspense","Teleport","queueUpdate","fn","flushUpdates","updates","isBrowser","onDOMReady","callback","createRoot","mounted","minifyHTML","html","normalizeString","value","CONFLICT_GROUPS","cleanClassName","tokens","seenGroups","result","i","token","matchedGroup","g","jsx","type","createHTMLElement","jsxs","Fragment","fragment","normalizeChildren","child","SVG_ELEMENTS","MATHML_ELEMENTS","SVG_NAMESPACE","MATHML_NAMESPACE","hasValidDangerouslySetInnerHTML","key","appendChildren","handleDangerouslySetInnerHTML","handleRef","handleOnLoad","handleEvent","handleClassName","handleStyle","isSignal","handleReactiveProp","attrValue","parent","textNode","effect","onLoadMap","ONLOAD_ATTR","observer","initObserver","mutations","mutation","node","checkOnLoad","cb","descendant","ref","eventName","handler","event","setClass","val","cleaned","className","styles","applyStyles","cssKey","m","signal","defineComponent","setup","createElements","elements","el","Show","currentElement","when","condition","Switch","caseItem","For","each","items","item","index"],"mappings":"oDAiBI,IAAIA,CAAAA,CAA8B,EAAC,CAC/BC,CAAAA,CAAiB,KAAA,CAmBd,SAASC,CAAAA,CACZC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CAAyB,EAAC,CACV,CAEhB,IAAMC,CAAAA,CAAS,OAAOF,CAAAA,EAAc,QAAA,CAC9B,QAAA,CAAS,cAAcA,CAAS,CAAA,CAChCA,CAAAA,CAEN,GAAI,CAACE,CAAAA,CACD,MAAM,IAAI,KAAA,CAAM,CAAA,qBAAA,EAAwBF,CAAS,CAAA,CAAE,CAAA,CAIvD,IAAMG,CAAAA,CAAU,OAAOJ,CAAAA,EAAc,UAAA,CAAaA,CAAAA,EAAU,CAAIA,EAEhE,GAAI,CAACI,CAAAA,CACD,MAAM,IAAI,KAAA,CAAM,sCAAsC,CAAA,CAM1D,OAFaF,CAAAA,CAAQ,IAAA,EAAQ,SAAA,EAGzB,KAAK,SAAA,CACDC,CAAAA,CAAO,SAAA,CAAY,EAAA,CACnBA,CA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CAAE,SAAUwD,CAAAA,CAAS,QAAS,CAAC,CAAA,CAI5D,OAAO,IACX,CAKO,SAASC,EAAAA,CAAO5F,CAAAA,CAGR,CACX,IAAMoC,CAAAA,CAAW,SAAS,sBAAA,EAAuB,CAEjD,GAAIgB,gBAAAA,CAASpD,CAAAA,CAAM,IAAI,EAAG,CAEtB,IAAMjB,CAAAA,CAAY,QAAA,CAAS,aAAA,CAAc,KAAK,EAC9CA,CAAAA,CAAU,KAAA,CAAM,OAAA,CAAU,UAAA,CAE1B0E,cAAAA,CAAO,IAAM,CACT,IAAMoC,CAAAA,CAAO7F,CAAAA,CAAM,IAAA,CACb8F,CAAAA,CAAQD,CAAAA,GACd9G,CAAAA,CAAU,SAAA,CAAY,EAAA,CAEtB+G,CAAAA,CAAM,OAAA,CAAQ,CAACC,EAAWC,CAAAA,GAAe,CACrC,IAAM9G,CAAAA,CAAUc,CAAAA,CAAM,QAAA,CAAS+F,EAAMC,CAAK,CAAA,CACtC9G,CAAAA,YAAmB,IAAA,EACnBH,CAAAA,CAAU,WAAA,CAAYG,CAAO,EAErC,CAAC,EACL,CAAC,CAAA,CAEDkD,CAAAA,CAAS,YAAYrD,CAAS,EAClC,CAAA,KAEiBiB,CAAAA,CAAM,IAAA,CACd,OAAA,CAAQ,CAAC+F,CAAAA,CAAMC,CAAAA,GAAU,CAC1B,IAAM9G,CAAAA,CAAUc,CAAAA,CAAM,SAAS+F,CAAAA,CAAMC,CAAK,CAAA,CACtC9G,CAAAA,YAAmB,IAAA,EACnBkD,CAAAA,CAAS,WAAA,CAAYlD,CAAO,EAEpC,CAAC,CAAA,CAGL,OAAOkD,CACX","file":"index.cjs","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// src/mod/render.ts\r\n//\r\n// Made with ❤️ by Maysara.\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ PACK ════════════════════════════════════════╗\r\n\r\n import type { JSXElement, RenderOptions, MountedComponent } from '../types';\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ INIT ════════════════════════════════════════╗\r\n\r\n let updateQueue: (() => void)[] = [];\r\n let isFlushPending = false;\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\n /**\r\n * Render a component to the DOM\r\n * @param component - Component or JSX element to render\r\n * @param container - DOM element or selector to mount to\r\n * @param options - Rendering options (mode, callbacks)\r\n * @returns MountedComponent with unmount and update methods\r\n * @throws Error if container not found or component returns null\r\n * @example\r\n * const el = jsx('div', { children: 'Hello' });\r\n * render(el, document.body);\r\n */\r\n export function render(\r\n component: JSXElement | (() => JSXElement),\r\n container: HTMLElement | string,\r\n options: RenderOptions = {}\r\n ): MountedComponent {\r\n // Resolve container\r\n const target = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n if (!target) {\r\n throw new Error(`Container not found: ${container}`);\r\n }\r\n\r\n // Get element from component\r\n const element = typeof component === 'function' ? component() : component;\r\n\r\n if (!element) {\r\n throw new Error('Component returned null or undefined');\r\n }\r\n\r\n // Mount to DOM based on mode\r\n const mode = options.mode || 'replace';\r\n\r\n switch (mode) {\r\n case 'replace':\r\n target.innerHTML = '';\r\n target.appendChild(element as Node);\r\n break;\r\n\r\n case 'append':\r\n target.appendChild(element as Node);\r\n break;\r\n\r\n case 'prepend':\r\n target.insertBefore(element as Node, target.firstChild);\r\n break;\r\n\r\n default:\r\n // Invalid mode, fall back to replace\r\n target.innerHTML = '';\r\n target.appendChild(element as Node);\r\n }\r\n\r\n // Call onMount callback\r\n options.onMount?.();\r\n\r\n // Return mounted component interface\r\n return {\r\n element: element as Element | DocumentFragment,\r\n\r\n unmount: () => {\r\n if (element instanceof Element) {\r\n element.remove();\r\n } else if (element instanceof DocumentFragment) {\r\n // DocumentFragment doesn't have remove method, remove all children\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n }\r\n options.onUnmount?.();\r\n },\r\n\r\n update: (newElement: JSXElement) => {\r\n if (element instanceof Element && newElement instanceof Element) {\r\n element.replaceWith(newElement);\r\n } else if (newElement instanceof Element) {\r\n // If current is DocumentFragment and new is Element\r\n if (element instanceof DocumentFragment && element.parentNode) {\r\n element.parentNode.replaceChild(newElement, element);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Simple mount function (alias for render with replace mode)\r\n */\r\n export function mount(\r\n component: JSXElement | (() => JSXElement),\r\n container: HTMLElement | string\r\n ): MountedComponent {\r\n return render(component, container, { mode: 'replace' });\r\n }\r\n\r\n /**\r\n * Render component to a different location in the DOM\r\n */\r\n export function createPortal(\r\n children: JSXElement,\r\n container: HTMLElement | string\r\n ): JSXElement {\r\n const target = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n if (!target) {\r\n throw new Error(`Portal container not found: ${container}`);\r\n }\r\n\r\n // Create a placeholder comment\r\n const placeholder = document.createComment('portal');\r\n\r\n // Mount children to target\r\n if (children instanceof Node) {\r\n target.appendChild(children);\r\n }\r\n\r\n return placeholder as any;\r\n }\r\n\r\n /**\r\n * Hydrate server-rendered HTML with client-side interactivity\r\n * @param component - Component to hydrate\r\n * @param container - Container with server-rendered HTML\r\n */\r\n export function hydrate(\r\n component: JSXElement | (() => JSXElement),\r\n container: HTMLElement | string\r\n ): MountedComponent {\r\n const targetElement = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n const target = targetElement instanceof HTMLElement ? targetElement : null;\r\n\r\n if (!target) {\r\n throw new Error(`Container not found: ${container}`);\r\n }\r\n\r\n // For now, just replace (future: smart hydration)\r\n return render(component, target, { mode: 'replace' });\r\n }\r\n\r\n /**\r\n * Lazy load a component with dynamic imports\r\n * @param loader - Async function that returns a component module\r\n * @param fallback - Element to show while loading (optional)\r\n * @returns A component that renders loaded component or fallback/error state\r\n * @example\r\n * const LazyComponent = lazy(() => import('./Component'), <div>Loading...</div>);\r\n */\r\n export function lazy<P = any>(\r\n loader: () => Promise<{ default: (props: P) => JSXElement }>,\r\n fallback?: JSXElement\r\n ): (props: P) => JSXElement {\r\n let loadedComponent: ((props: P) => JSXElement) | null = null;\r\n let loading = false;\r\n let error: Error | null = null;\r\n\r\n return (props: P) => {\r\n // If already loaded, return component\r\n if (loadedComponent) {\r\n return loadedComponent(props);\r\n }\r\n\r\n // If error occurred, show error\r\n if (error) {\r\n const errorDiv = document.createElement('div');\r\n errorDiv.className = 'crux-lazy-error';\r\n errorDiv.textContent = `Error loading component: ${error.message}`;\r\n errorDiv.style.color = 'red';\r\n return errorDiv;\r\n }\r\n\r\n // If not loading yet, start loading\r\n if (!loading) {\r\n loading = true;\r\n\r\n loader()\r\n .then(module => {\r\n loadedComponent = module.default;\r\n // TODO: Trigger re-render when loaded\r\n })\r\n .catch(err => {\r\n error = err instanceof Error ? err : new Error(String(err));\r\n // TODO: Trigger re-render on error\r\n });\r\n }\r\n\r\n // Show fallback while loading\r\n return fallback || createLoadingElement();\r\n };\r\n }\r\n\r\n function createLoadingElement(): HTMLElement {\r\n const div = document.createElement('div');\r\n div.textContent = 'Loading...';\r\n return div;\r\n }\r\n\r\n /**\r\n * Error boundary component\r\n */\r\n export function ErrorBoundary(props: {\r\n fallback: (error: Error) => JSXElement\r\n children: JSXElement\r\n }): JSXElement {\r\n try {\r\n return props.children;\r\n } catch (error) {\r\n return props.fallback(error as Error);\r\n }\r\n }\r\n\r\n /**\r\n * Suspense component for handling loading states\r\n */\r\n export function Suspense(props: {\r\n fallback: JSXElement\r\n children: JSXElement | Promise<JSXElement>\r\n }): JSXElement {\r\n if (props.children instanceof Promise) {\r\n // Create container for async content\r\n const container = document.createElement('div');\r\n container.style.display = 'contents';\r\n\r\n // Show fallback first\r\n if (props.fallback instanceof Node) {\r\n container.appendChild(props.fallback);\r\n }\r\n\r\n // Load actual content\r\n props.children.then(element => {\r\n container.innerHTML = '';\r\n if (element instanceof Node) {\r\n container.appendChild(element);\r\n }\r\n });\r\n\r\n return container;\r\n } else {\r\n return props.children;\r\n }\r\n }\r\n\r\n /**\r\n * Teleport component (like Vue's Teleport)\r\n */\r\n export function Teleport(props: {\r\n to: string | HTMLElement\r\n children: JSXElement\r\n }): JSXElement {\r\n return createPortal(props.children, props.to);\r\n }\r\n\r\n /**\r\n * Queue a DOM update to be batched\r\n */\r\n export function queueUpdate(fn: () => void): void {\r\n updateQueue.push(fn);\r\n\r\n if (!isFlushPending) {\r\n isFlushPending = true;\r\n queueMicrotask(flushUpdates);\r\n }\r\n }\r\n\r\n /**\r\n * Flush all queued updates\r\n */\r\n function flushUpdates(): void {\r\n const updates = updateQueue;\r\n updateQueue = [];\r\n isFlushPending = false;\r\n\r\n updates.forEach(fn => fn());\r\n }\r\n\r\n // ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n // ╔════════════════════════════════════════ HELP ════════════════════════════════════════╗\r\n\r\n /**\r\n * Check if code is running in browser\r\n */\r\n export function isBrowser(): boolean {\r\n return typeof window !== 'undefined' && typeof document !== 'undefined';\r\n }\r\n\r\n /**\r\n * Wait for DOM to be ready\r\n */\r\n export function onDOMReady(callback: () => void): void {\r\n if (isBrowser()) {\r\n if (document.readyState === 'loading') {\r\n document.addEventListener('DOMContentLoaded', callback);\r\n } else {\r\n callback();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Create a root for rendering\r\n */\r\n export function createRoot(container: HTMLElement | string) {\r\n const target = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n if (!target || !(target instanceof HTMLElement)) {\r\n throw new Error(`Root container not found: ${container}`);\r\n }\r\n\r\n let mounted: MountedComponent | null = null;\r\n\r\n return {\r\n render(component: JSXElement | (() => JSXElement)) {\r\n if (mounted) {\r\n mounted.unmount();\r\n }\r\n mounted = render(component, target);\r\n },\r\n\r\n unmount() {\r\n if (mounted) {\r\n mounted.unmount();\r\n mounted = null;\r\n }\r\n }\r\n };\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝","// src/mod/utils.ts\r\n//\r\n// Made with ❤️ by Maysara.\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\n /**\r\n * Minify HTML string by removing excess whitespace\r\n * Collapses multiple spaces, tabs, and newlines into single spaces\r\n * Removes leading/trailing whitespace from text nodes\r\n * @param html - HTML string to minify\r\n * @returns Minified HTML string\r\n */\r\n export function minifyHTML(html: string): string {\r\n // Collapse multiple whitespace characters (spaces, tabs, newlines) into single space\r\n return html\r\n .replace(/\\s+/g, ' ') // Replace multiple whitespace with single space\r\n .replace(/>\\s+</g, '><') // Remove spaces between closing and opening tags\r\n .trim(); // Remove leading/trailing whitespace\r\n }\r\n\r\n /**\r\n * Normalize a string value by removing excess whitespace\r\n * Useful for class names, ids, and other attributes with multi-line definitions\r\n * @param value - String value to normalize\r\n * @returns Normalized string with collapsed whitespace\r\n */\r\n export function normalizeString(value: string): string {\r\n return value\r\n .replace(/\\s+/g, ' ') // Collapse multiple whitespace into single space\r\n .trim(); // Remove leading/trailing whitespace\r\n }\r\n\r\n // Regex patterns for class groups that should be mutually exclusive\r\n // The order matters for partial matches, though we try to use strict patterns where possible.\r\n const CONFLICT_GROUPS = [\r\n // Layout\r\n /^display-(.+)$/, \r\n /^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|table|table-row|table-cell|flow-root|contents|hidden)$/,\r\n /^(static|fixed|absolute|relative|sticky)$/,\r\n /^inset-(.+)$/,\r\n /^inset-x-(.+)$/,\r\n /^inset-y-(.+)$/,\r\n /^start-(.+)$/,\r\n /^end-(.+)$/,\r\n /^top-(.+)$/,\r\n /^bottom-(.+)$/,\r\n /^z-(.+)$/,\r\n\r\n // Flex/Grid\r\n /^flex-(row|col)(-reverse)?$/,\r\n /^flex-(wrap|nowrap)(-reverse)?$/,\r\n /^flex-(1|auto|initial|none)$/,\r\n /^basis-(.+)$/,\r\n /^grow(-0)?$/,\r\n /^shrink(-0)?$/,\r\n /^order-(.+)$/,\r\n /^gap-(\\d+)$/, // gap-4\r\n /^gap-x-(.+)$/,\r\n /^gap-y-(.+)$/,\r\n /^justify-items-(.+)$/,\r\n /^justify-self-(.+)$/,\r\n /^justify-(start|end|center|between|around|evenly|stretch)$/, // justify-content\r\n /^content-(.+)$/, // align-content\r\n /^items-(.+)$/, // align-items\r\n /^self-(.+)$/, // align-self\r\n /^place-content-(.+)$/,\r\n /^place-items-(.+)$/,\r\n /^place-self-(.+)$/,\r\n /^grid-cols-(.+)$/,\r\n /^col-span-(.+)$/,\r\n /^col-start-(.+)$/,\r\n /^col-end-(.+)$/,\r\n /^grid-rows-(.+)$/,\r\n /^row-span-(.+)$/,\r\n /^row-start-(.+)$/,\r\n /^row-end-(.+)$/,\r\n /^grid-flow-(.+)$/,\r\n\r\n // Spacing\r\n /^p-(.+)$/,\r\n /^px-(.+)$/,\r\n /^py-(.+)$/,\r\n /^pt-(.+)$/,\r\n /^pb-(.+)$/,\r\n /^ps-(.+)$/,\r\n /^pe-(.+)$/,\r\n /^m-(.+)$/,\r\n /^mx-(.+)$/,\r\n /^my-(.+)$/,\r\n /^mt-(.+)$/,\r\n /^mb-(.+)$/,\r\n /^ms-(.+)$/,\r\n /^me-(.+)$/,\r\n\r\n // Sizing\r\n /^w-(.+)$/,\r\n /^min-w-(.+)$/,\r\n /^max-w-(.+)$/,\r\n /^h-(.+)$/,\r\n /^min-h-(.+)$/,\r\n /^max-h-(.+)$/,\r\n\r\n // Typography\r\n /^font-(sans|serif|mono)$/,\r\n /^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,\r\n /^text-(xs|sm|base|md|lg|xl|\\d+xl)$/, // Font size\r\n /^leading-(.+)$/,\r\n /^tracking-(.+)$/,\r\n /^text-(left|center|right|justify|start|end)$/, // Text align\r\n /^text-(wrap|nowrap|balance|pretty)$/,\r\n /^(truncate|text-ellipsis|text-clip)$/,\r\n /^(uppercase|lowercase|capitalize|normal-case)$/,\r\n /^(italic|not-italic)$/,\r\n /^(underline|overline|line-through|no-underline)$/,\r\n /^text-(?!left|center|right|justify|start|end|xs|sm|base|md|lg|xl|\\d+xl|wrap|nowrap|balance|pretty|ellipsis|clip).+$/, // Text color\r\n\r\n // Background & Effects\r\n /^bg-(?!blend).+$/, // Background color\r\n /^bg-blend-(.+)$/,\r\n /^mix-blend-(.+)$/,\r\n /^shadow(.*)$/,\r\n /^opacity-(.+)$/,\r\n /^blur(.*)$/,\r\n /^brightness-(.+)$/,\r\n /^contrast-(.+)$/,\r\n /^grayscale(.*)$/,\r\n /^invert(.*)$/,\r\n /^saturate-(.+)$/,\r\n /^sepia(.*)$/,\r\n /^hue-rotate-(.+)$/,\r\n /^backdrop-blur(.*)$/,\r\n /^transition(.*)$/\r\n ];\r\n\r\n /**\r\n * Clean up class names by removing duplicates and keeping the latest one.\r\n * Handles conflict groups (e.g., 'justify-start' overrides 'justify-center').\r\n * @param value - Class name string\r\n * @returns Cleaned class name string\r\n */\r\n export function cleanClassName(value: string): string {\r\n const tokens = value.trim().split(/\\s+/);\r\n // optimization: if 0 or 1 token, just return trimmed\r\n if (tokens.length <= 1 && tokens[0] === '') return '';\r\n if (tokens.length === 1) return tokens[0];\r\n\r\n const seenGroups = new Set<number | string>();\r\n const result: string[] = [];\r\n\r\n // Iterate backwards to keep latest\r\n for (let i = tokens.length - 1; i >= 0; i--) {\r\n const token = tokens[i];\r\n if (!token) continue;\r\n\r\n let matchedGroup: number | string = token; // Default to token itself (exact match dedupe)\r\n\r\n // Check if token belongs to a known conflict group\r\n for (let g = 0; g < CONFLICT_GROUPS.length; g++) {\r\n if (CONFLICT_GROUPS[g].test(token)) {\r\n matchedGroup = g;\r\n break;\r\n }\r\n }\r\n\r\n if (!seenGroups.has(matchedGroup)) {\r\n seenGroups.add(matchedGroup);\r\n result.push(token);\r\n }\r\n }\r\n\r\n return result.reverse().join(' ');\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// src/mod/runtime.ts\r\n//\r\n// Made with ❤️ by Maysara.\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ PACK ════════════════════════════════════════╗\r\n\r\n import { effect, isSignal, type Signal } from '@minejs/signals';\r\n import type { JSXElement, JSXProps, ComponentFunction } from '../types';\r\n import { normalizeString, cleanClassName } from './utils';\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\n /**\r\n * Creates a DOM element from JSX\r\n * This is called automatically by TypeScript when it sees JSX syntax\r\n */\r\n export function jsx(\r\n type: string | ComponentFunction,\r\n props: JSXProps | null\r\n ): JSXElement | null {\r\n // Handle component (function)\r\n if (typeof type === 'function') {\r\n return type(props || {});\r\n }\r\n\r\n // Handle HTML element (string)\r\n return createHTMLElement(type, props || {});\r\n }\r\n\r\n /**\r\n * Same as jsx() but for elements with multiple children\r\n * (Used by TypeScript JSX transform)\r\n */\r\n export const jsxs = jsx;\r\n\r\n /**\r\n * Fragment component (like React.Fragment)\r\n */\r\n export function Fragment(props: { children?: any }): DocumentFragment {\r\n const fragment = document.createDocumentFragment();\r\n const children = normalizeChildren(props.children);\r\n\r\n children.forEach(child => {\r\n if (child instanceof Node) {\r\n fragment.appendChild(child);\r\n }\r\n });\r\n\r\n return fragment;\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ ════ ════════════════════════════════════════╗\r\n\r\n // ============================================================================\r\n // HTML ELEMENT CREATION\r\n // ============================================================================\r\n\r\n // SVG elements that need to be created with createElementNS\r\n const SVG_ELEMENTS = new Set([\r\n 'svg', 'path', 'circle', 'rect', 'line', 'polyline', 'polygon',\r\n 'ellipse', 'g', 'text', 'tspan', 'defs', 'clipPath', 'linearGradient',\r\n 'radialGradient', 'stop', 'mask', 'pattern', 'image', 'use', 'symbol',\r\n 'marker', 'foreignObject', 'animate', 'animateTransform', 'animateMotion',\r\n 'set', 'filter', 'feBlend', 'feColorMatrix', 'feComponentTransfer',\r\n 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap',\r\n 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR',\r\n 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology',\r\n 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile',\r\n 'feTurbulence', 'title', 'desc', 'metadata'\r\n ]);\r\n\r\n // MathML elements that need to be created with createElementNS\r\n const MATHML_ELEMENTS = new Set([\r\n 'math', 'maction', 'maligngroup', 'malignmark', 'menclose', 'merror',\r\n 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mlongdiv',\r\n 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom',\r\n 'mroot', 'mrow', 'ms', 'mscarries', 'mscarry', 'msgroup', 'msline',\r\n 'mspace', 'msqrt', 'msrow', 'mstack', 'mstyle', 'msub', 'msup',\r\n 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover',\r\n 'semantics', 'annotation', 'annotation-xml'\r\n ]);\r\n\r\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\r\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\r\n\r\n function createHTMLElement(type: string, props: JSXProps): Element {\r\n // Determine namespace and create element appropriately\r\n let element: Element;\r\n\r\n if (SVG_ELEMENTS.has(type)) {\r\n element = document.createElementNS(SVG_NAMESPACE, type);\r\n } else if (MATHML_ELEMENTS.has(type)) {\r\n element = document.createElementNS(MATHML_NAMESPACE, type);\r\n } else {\r\n element = document.createElement(type);\r\n }\r\n\r\n // Check if dangerouslySetInnerHTML is present and valid - it takes precedence over children\r\n const hasValidDangerouslySetInnerHTML = 'dangerouslySetInnerHTML' in props\r\n && props.dangerouslySetInnerHTML != null\r\n && typeof props.dangerouslySetInnerHTML === 'object'\r\n && '__html' in props.dangerouslySetInnerHTML\r\n && typeof props.dangerouslySetInnerHTML.__html === 'string';\r\n\r\n // Set properties and attributes\r\n for (const [key, value] of Object.entries(props)) {\r\n if (key === 'children') {\r\n // Skip children if dangerouslySetInnerHTML is present and valid\r\n if (!hasValidDangerouslySetInnerHTML) {\r\n appendChildren(element, value);\r\n }\r\n } else if (key === 'dangerouslySetInnerHTML') {\r\n // Handle dangerouslySetInnerHTML - inject raw HTML\r\n handleDangerouslySetInnerHTML(element as HTMLElement, value);\r\n } else if (key === 'ref') {\r\n // Handle ref\r\n handleRef(element as HTMLElement, value);\r\n } else if (key === 'onload') {\r\n // Handle onload\r\n handleOnLoad(element, value);\r\n } else if (key.startsWith('on')) {\r\n // Handle events (onClick, onInput, etc)\r\n handleEvent(element, key, value);\r\n } else if (key === 'className' || key === 'class') {\r\n // Handle className/class\r\n handleClassName(element, value);\r\n } else if (key === 'style') {\r\n // Handle inline styles\r\n handleStyle(element as HTMLElement, value);\r\n } else if (isSignal(value)) {\r\n // Handle reactive props\r\n handleReactiveProp(element, key, value);\r\n } else if (typeof value === 'boolean') {\r\n // Handle boolean attributes (disabled, checked, etc)\r\n if (value) {\r\n element.setAttribute(key, '');\r\n }\r\n } else if (value != null) {\r\n // Handle static props\r\n // For SVG/MathML elements, always use setAttribute to preserve case sensitivity\r\n if (SVG_ELEMENTS.has(type) || MATHML_ELEMENTS.has(type)) {\r\n const attrValue = typeof value === 'string' ? normalizeString(value) : String(value);\r\n element.setAttribute(key, attrValue);\r\n } else {\r\n // For HTML elements, prefer property assignment\r\n if (key in element) {\r\n (element as any)[key] = value;\r\n } else {\r\n const attrValue = typeof value === 'string' ? normalizeString(value) : String(value);\r\n element.setAttribute(key, attrValue);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return element;\r\n }\r\n\r\n // ============================================================================\r\n // CHILDREN HANDLING\r\n // ============================================================================\r\n\r\n function appendChildren(parent: Element, children: any): void {\r\n const normalized = normalizeChildren(children);\r\n\r\n normalized.forEach(child => {\r\n if (child instanceof Node) {\r\n parent.appendChild(child);\r\n } else if (isSignal(child)) {\r\n // Reactive text node\r\n const textNode = document.createTextNode('');\r\n effect(() => {\r\n textNode.textContent = String(child());\r\n });\r\n parent.appendChild(textNode);\r\n } else if (child != null && child !== false) {\r\n // Static text node\r\n parent.appendChild(document.createTextNode(String(child)));\r\n }\r\n });\r\n }\r\n\r\n function normalizeChildren(children: any): any[] {\r\n if (children == null || children === false) {\r\n return [];\r\n }\r\n\r\n if (Array.isArray(children)) {\r\n return children.flatMap(normalizeChildren);\r\n }\r\n\r\n return [children];\r\n }\r\n\r\n // ============================================================================\r\n // ONLOAD HANDLING\r\n // ============================================================================\r\n\r\n const onLoadMap = new WeakMap<Element, () => void>();\r\n const ONLOAD_ATTR = 'data-mine-onload';\r\n let observer: MutationObserver | null = null;\r\n\r\n function initObserver() {\r\n if (observer) return;\r\n if (typeof MutationObserver === 'undefined') return;\r\n\r\n observer = new MutationObserver((mutations) => {\r\n mutations.forEach(mutation => {\r\n mutation.addedNodes.forEach(node => {\r\n if (node.nodeType === 1) { // Node.ELEMENT_NODE\r\n checkOnLoad(node as Element);\r\n }\r\n });\r\n });\r\n });\r\n\r\n observer.observe(document, {\r\n childList: true,\r\n subtree: true\r\n });\r\n }\r\n\r\n function checkOnLoad(element: Element) {\r\n if (element.hasAttribute(ONLOAD_ATTR)) {\r\n const cb = onLoadMap.get(element);\r\n if (cb) cb();\r\n }\r\n\r\n // Check descendants\r\n const descendants = element.querySelectorAll(`[${ONLOAD_ATTR}]`);\r\n descendants.forEach(descendant => {\r\n const cb = onLoadMap.get(descendant);\r\n if (cb) cb();\r\n });\r\n }\r\n\r\n function handleOnLoad(element: Element, callback: any): void {\r\n if (typeof callback !== 'function') return;\r\n\r\n onLoadMap.set(element, callback);\r\n element.setAttribute(ONLOAD_ATTR, 'true');\r\n initObserver();\r\n }\r\n\r\n // ============================================================================\r\n // REF HANDLING\r\n // ============================================================================\r\n\r\n function handleRef(element: HTMLElement, ref: any): void {\r\n if (isSignal(ref)) {\r\n ref.set(element);\r\n } else if (typeof ref === 'function') {\r\n ref(element);\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // EVENT HANDLING\r\n // ============================================================================\r\n\r\n function handleEvent(element: Element, eventName: string, handler: any): void {\r\n if (typeof handler !== 'function') return;\r\n\r\n // Convert onClick → click, onInput → input, etc\r\n const event = eventName.slice(2).toLowerCase();\r\n\r\n element.addEventListener(event, handler);\r\n }\r\n\r\n // ============================================================================\r\n // CLASS NAME HANDLING\r\n // ============================================================================\r\n\r\n function handleClassName(element: Element, value: any): void {\r\n const setClass = (val: string) => {\r\n const cleaned = cleanClassName(String(val));\r\n if (element.namespaceURI === SVG_NAMESPACE) {\r\n element.setAttribute('class', cleaned);\r\n } else {\r\n element.className = cleaned;\r\n }\r\n };\r\n\r\n if (isSignal(value)) {\r\n // Reactive className\r\n effect(() => {\r\n const className = value();\r\n if (className != null) {\r\n setClass(String(className));\r\n }\r\n });\r\n } else if (value != null) {\r\n // Static className\r\n setClass(String(value));\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // STYLE HANDLING\r\n // ============================================================================\r\n\r\n function handleStyle(element: HTMLElement, value: any): void {\r\n if (isSignal(value)) {\r\n // Reactive style object\r\n effect(() => {\r\n const styles = value();\r\n applyStyles(element, styles);\r\n });\r\n } else {\r\n // Static style\r\n applyStyles(element, value);\r\n }\r\n }\r\n\r\n function applyStyles(element: HTMLElement, styles: any): void {\r\n if (typeof styles === 'string') {\r\n element.style.cssText = styles;\r\n } else if (typeof styles === 'object' && styles != null) {\r\n Object.entries(styles).forEach(([key, value]) => {\r\n if (value != null) {\r\n // Convert camelCase to kebab-case\r\n const cssKey = key.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`);\r\n element.style.setProperty(cssKey, String(value));\r\n }\r\n });\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // DANGEROUSLY SET INNER HTML\r\n // ============================================================================\r\n\r\n function handleDangerouslySetInnerHTML(element: HTMLElement, value: any): void {\r\n if (value != null && typeof value === 'object' && '__html' in value) {\r\n // Extract __html property and inject as raw HTML\r\n const html = value.__html;\r\n if (typeof html === 'string') {\r\n element.innerHTML = html;\r\n }\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // REACTIVE PROP HANDLING\r\n // ============================================================================\r\n\r\n function handleReactiveProp(element: Element, key: string, signal: Signal<any>): void {\r\n effect(() => {\r\n const value = signal();\r\n\r\n if (value != null) {\r\n if (key in element) {\r\n // Set as property (for input.value, etc)\r\n ; (element as any)[key] = value;\r\n } else {\r\n // Set as attribute, normalize if string\r\n const attrValue = typeof value === 'string' ? normalizeString(value) : String(value);\r\n element.setAttribute(key, attrValue);\r\n }\r\n } else {\r\n element.removeAttribute(key);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Create a component from a function\r\n * Provides a cleaner API than raw JSX\r\n */\r\n export function component<P = any>(\r\n fn: (props: P) => JSXElement | null\r\n ): ComponentFunction<P> {\r\n return fn;\r\n }\r\n\r\n /**\r\n * Create a component with setup function\r\n * Similar to Vue's Composition API\r\n */\r\n export function defineComponent<P = any>(\r\n setup: (props: P) => () => JSXElement | null\r\n ): ComponentFunction<P> {\r\n return (props: P) => {\r\n const render = setup(props);\r\n return render();\r\n };\r\n }\r\n\r\n // ============================================================================\r\n // UTILITY FUNCTIONS\r\n // ============================================================================\r\n\r\n /**\r\n * Create multiple elements at once\r\n */\r\n export function createElements(elements: any[]): DocumentFragment {\r\n const fragment = document.createDocumentFragment();\r\n\r\n elements.forEach(el => {\r\n if (el instanceof Node) {\r\n fragment.appendChild(el);\r\n }\r\n });\r\n\r\n return fragment;\r\n }\r\n\r\n /**\r\n * Show/hide element based on condition\r\n */\r\n export function Show(props: {\r\n when: boolean | Signal<boolean>\r\n children: any\r\n }): JSXElement | null {\r\n if (isSignal(props.when)) {\r\n const placeholder = document.createComment('show');\r\n const parent = document.createDocumentFragment();\r\n parent.appendChild(placeholder);\r\n\r\n let currentElement: Element | null = null;\r\n\r\n effect(() => {\r\n const when = props.when as Signal<boolean>;\r\n const condition = when();\r\n\r\n if (condition && !currentElement) {\r\n // Show: create and insert element\r\n const children = normalizeChildren(props.children);\r\n currentElement = children[0] as Element;\r\n\r\n if (currentElement instanceof Node) {\r\n placeholder.parentNode?.insertBefore(currentElement, placeholder);\r\n }\r\n } else if (!condition && currentElement) {\r\n // Hide: remove element\r\n currentElement.remove();\r\n currentElement = null;\r\n }\r\n });\r\n\r\n return parent as any;\r\n } else {\r\n // Static condition\r\n return (props.when as boolean) ? jsx(Fragment, { children: props.children }) : null;\r\n }\r\n }\r\n\r\n /**\r\n * Render different elements based on condition\r\n */\r\n export function Switch(props: {\r\n children: { when: boolean | Signal<boolean>; children: any }[]\r\n }): JSXElement | null {\r\n // Find first matching case\r\n for (const caseItem of props.children) {\r\n const condition = isSignal(caseItem.when) ? caseItem.when() : caseItem.when;\r\n\r\n if (condition) {\r\n return jsx(Fragment, { children: caseItem.children });\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Iterate over array and render elements\r\n */\r\n export function For<T>(props: {\r\n each: T[] | Signal<T[]>\r\n children: (item: T, index: number) => JSXElement\r\n }): JSXElement {\r\n const fragment = document.createDocumentFragment();\r\n\r\n if (isSignal(props.each)) {\r\n // Reactive list\r\n const container = document.createElement('div');\r\n container.style.display = 'contents'; // Don't affect layout\r\n\r\n effect(() => {\r\n const each = props.each as Signal<T[]>;\r\n const items = each();\r\n container.innerHTML = ''; // Clear\r\n\r\n items.forEach((item: any, index: any) => {\r\n const element = props.children(item, index);\r\n if (element instanceof Node) {\r\n container.appendChild(element);\r\n }\r\n });\r\n });\r\n\r\n fragment.appendChild(container);\r\n } else {\r\n // Static list\r\n const each = props.each as T[];\r\n each.forEach((item, index) => {\r\n const element = props.children(item, index);\r\n if (element instanceof Node) {\r\n fragment.appendChild(element);\r\n }\r\n });\r\n }\r\n\r\n return fragment as any;\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n"]}
1
+ {"version":3,"sources":["../src/mod/render.ts","../src/mod/utils.ts","../src/mod/style.ts","../src/mod/runtime.ts"],"names":["updateQueue","isFlushPending","render","component","container","options","target","element","newElement","mount","createPortal","children","placeholder","hydrate","targetElement","lazy","loader","fallback","loadedComponent","loading","error","props","errorDiv","module","err","createLoadingElement","div","ErrorBoundary","Suspense","Teleport","queueUpdate","fn","flushUpdates","updates","isBrowser","onDOMReady","callback","createRoot","mounted","minifyHTML","html","normalizeString","value","CONFLICT_GROUPS","cleanClassName","tokens","seenGroups","result","i","token","matchedGroup","g","displayClassMap","directionClassMap","alignClassMap","justifyClassMap","maxWidthClassMap","borderWidthClassMap","radiusClassMap","shadowClassMap","spacingClass","prefix","marginClass","SCALE","FRACTIONS","W_KEYWORDS","H_KEYWORDS","MIN_W_KEYWORDS","MAX_W_KEYWORDS","MIN_H_KEYWORDS","MAX_H_KEYWORDS","resolveSize","key","val","map","STYLE_PROPS","resolveStyleProps","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","wRes","hRes","minWRes","minHRes","maxWRes","maxHRes","computedStyle","jsx","type","createHTMLElement","jsxs","Fragment","fragment","normalizeChildren","child","observerInitialized","initOnLoadObserver","observer","mutations","mutation","node","checkOnLoad","handler","SVG_ELEMENTS","MATHML_ELEMENTS","SVG_NAMESPACE","MATHML_NAMESPACE","hasValidDangerouslySetInnerHTML","containerClass","containerStyle","applyStyles","handledClass","appendChildren","handleDangerouslySetInnerHTML","handleRef","handleEvent","handleId","handleClassName","handleStyle","isSignal","handleReactiveProp","attrValue","parent","textNode","effect","ref","eventName","event","baseClass","setClass","fullClass","cleaned","className","id","styles","cssKey","signal","defineComponent","setup","createElements","elements","el","Show","current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ASoK,EAAMC,CAAK,CAAA,CACtCnL,CAAAA,YAAmB,IAAA,EACnBuH,EAAS,WAAA,CAAYvH,CAAO,EAEpC,CAAC,CAAA,CAGL,OAAOuH,CACX","file":"index.cjs","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// src/mod/render.ts\r\n//\r\n// Made with ❤️ by Maysara.\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ PACK ════════════════════════════════════════╗\r\n\r\n import type { JSXElement, RenderOptions, MountedComponent } from '../types';\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ INIT ════════════════════════════════════════╗\r\n\r\n let updateQueue: (() => void)[] = [];\r\n let isFlushPending = false;\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\n /**\r\n * Render a component to the DOM\r\n * @param component - Component or JSX element to render\r\n * @param container - DOM element or selector to mount to\r\n * @param options - Rendering options (mode, callbacks)\r\n * @returns MountedComponent with unmount and update methods\r\n * @throws Error if container not found or component returns null\r\n * @example\r\n * const el = jsx('div', { children: 'Hello' });\r\n * render(el, document.body);\r\n */\r\n export function render(\r\n component: JSXElement | (() => JSXElement),\r\n container: HTMLElement | string,\r\n options: RenderOptions = {}\r\n ): MountedComponent {\r\n // Resolve container\r\n const target = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n if (!target) {\r\n throw new Error(`Container not found: ${container}`);\r\n }\r\n\r\n // Get element from component\r\n const element = typeof component === 'function' ? component() : component;\r\n\r\n if (!element) {\r\n throw new Error('Component returned null or undefined');\r\n }\r\n\r\n // Mount to DOM based on mode\r\n const mode = options.mode || 'replace';\r\n\r\n switch (mode) {\r\n case 'replace':\r\n target.innerHTML = '';\r\n target.appendChild(element as Node);\r\n break;\r\n\r\n case 'append':\r\n target.appendChild(element as Node);\r\n break;\r\n\r\n case 'prepend':\r\n target.insertBefore(element as Node, target.firstChild);\r\n break;\r\n\r\n default:\r\n // Invalid mode, fall back to replace\r\n target.innerHTML = '';\r\n target.appendChild(element as Node);\r\n }\r\n\r\n // Call onMount callback\r\n options.onMount?.();\r\n\r\n // Return mounted component interface\r\n return {\r\n element: element as Element | DocumentFragment,\r\n\r\n unmount: () => {\r\n if (element instanceof Element) {\r\n element.remove();\r\n } else if (element instanceof DocumentFragment) {\r\n // DocumentFragment doesn't have remove method, remove all children\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n }\r\n options.onUnmount?.();\r\n },\r\n\r\n update: (newElement: JSXElement) => {\r\n if (element instanceof Element && newElement instanceof Element) {\r\n element.replaceWith(newElement);\r\n } else if (newElement instanceof Element) {\r\n // If current is DocumentFragment and new is Element\r\n if (element instanceof DocumentFragment && element.parentNode) {\r\n element.parentNode.replaceChild(newElement, element);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Simple mount function (alias for render with replace mode)\r\n */\r\n export function mount(\r\n component: JSXElement | (() => JSXElement),\r\n container: HTMLElement | string\r\n ): MountedComponent {\r\n return render(component, container, { mode: 'replace' });\r\n }\r\n\r\n /**\r\n * Render component to a different location in the DOM\r\n */\r\n export function createPortal(\r\n children: JSXElement,\r\n container: HTMLElement | string\r\n ): JSXElement {\r\n const target = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n if (!target) {\r\n throw new Error(`Portal container not found: ${container}`);\r\n }\r\n\r\n // Create a placeholder comment\r\n const placeholder = document.createComment('portal');\r\n\r\n // Mount children to target\r\n if (children instanceof Node) {\r\n target.appendChild(children);\r\n }\r\n\r\n return placeholder as any;\r\n }\r\n\r\n /**\r\n * Hydrate server-rendered HTML with client-side interactivity\r\n * @param component - Component to hydrate\r\n * @param container - Container with server-rendered HTML\r\n */\r\n export function hydrate(\r\n component: JSXElement | (() => JSXElement),\r\n container: HTMLElement | string\r\n ): MountedComponent {\r\n const targetElement = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n const target = targetElement instanceof HTMLElement ? targetElement : null;\r\n\r\n if (!target) {\r\n throw new Error(`Container not found: ${container}`);\r\n }\r\n\r\n // For now, just replace (future: smart hydration)\r\n return render(component, target, { mode: 'replace' });\r\n }\r\n\r\n /**\r\n * Lazy load a component with dynamic imports\r\n * @param loader - Async function that returns a component module\r\n * @param fallback - Element to show while loading (optional)\r\n * @returns A component that renders loaded component or fallback/error state\r\n * @example\r\n * const LazyComponent = lazy(() => import('./Component'), <div>Loading...</div>);\r\n */\r\n export function lazy<P = any>(\r\n loader: () => Promise<{ default: (props: P) => JSXElement }>,\r\n fallback?: JSXElement\r\n ): (props: P) => JSXElement {\r\n let loadedComponent: ((props: P) => JSXElement) | null = null;\r\n let loading = false;\r\n let error: Error | null = null;\r\n\r\n return (props: P) => {\r\n // If already loaded, return component\r\n if (loadedComponent) {\r\n return loadedComponent(props);\r\n }\r\n\r\n // If error occurred, show error\r\n if (error) {\r\n const errorDiv = document.createElement('div');\r\n errorDiv.className = 'crux-lazy-error';\r\n errorDiv.textContent = `Error loading component: ${error.message}`;\r\n errorDiv.style.color = 'red';\r\n return errorDiv;\r\n }\r\n\r\n // If not loading yet, start loading\r\n if (!loading) {\r\n loading = true;\r\n\r\n loader()\r\n .then(module => {\r\n loadedComponent = module.default;\r\n // TODO: Trigger re-render when loaded\r\n })\r\n .catch(err => {\r\n error = err instanceof Error ? err : new Error(String(err));\r\n // TODO: Trigger re-render on error\r\n });\r\n }\r\n\r\n // Show fallback while loading\r\n return fallback || createLoadingElement();\r\n };\r\n }\r\n\r\n function createLoadingElement(): HTMLElement {\r\n const div = document.createElement('div');\r\n div.textContent = 'Loading...';\r\n return div;\r\n }\r\n\r\n /**\r\n * Error boundary component\r\n */\r\n export function ErrorBoundary(props: {\r\n fallback: (error: Error) => JSXElement\r\n children: JSXElement\r\n }): JSXElement {\r\n try {\r\n return props.children;\r\n } catch (error) {\r\n return props.fallback(error as Error);\r\n }\r\n }\r\n\r\n /**\r\n * Suspense component for handling loading states\r\n */\r\n export function Suspense(props: {\r\n fallback: JSXElement\r\n children: JSXElement | Promise<JSXElement>\r\n }): JSXElement {\r\n if (props.children instanceof Promise) {\r\n // Create container for async content\r\n const container = document.createElement('div');\r\n container.style.display = 'contents';\r\n\r\n // Show fallback first\r\n if (props.fallback instanceof Node) {\r\n container.appendChild(props.fallback);\r\n }\r\n\r\n // Load actual content\r\n props.children.then(element => {\r\n container.innerHTML = '';\r\n if (element instanceof Node) {\r\n container.appendChild(element);\r\n }\r\n });\r\n\r\n return container;\r\n } else {\r\n return props.children;\r\n }\r\n }\r\n\r\n /**\r\n * Teleport component (like Vue's Teleport)\r\n */\r\n export function Teleport(props: {\r\n to: string | HTMLElement\r\n children: JSXElement\r\n }): JSXElement {\r\n return createPortal(props.children, props.to);\r\n }\r\n\r\n /**\r\n * Queue a DOM update to be batched\r\n */\r\n export function queueUpdate(fn: () => void): void {\r\n updateQueue.push(fn);\r\n\r\n if (!isFlushPending) {\r\n isFlushPending = true;\r\n queueMicrotask(flushUpdates);\r\n }\r\n }\r\n\r\n /**\r\n * Flush all queued updates\r\n */\r\n function flushUpdates(): void {\r\n const updates = updateQueue;\r\n updateQueue = [];\r\n isFlushPending = false;\r\n\r\n updates.forEach(fn => fn());\r\n }\r\n\r\n // ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n // ╔════════════════════════════════════════ HELP ════════════════════════════════════════╗\r\n\r\n /**\r\n * Check if code is running in browser\r\n */\r\n export function isBrowser(): boolean {\r\n return typeof window !== 'undefined' && typeof document !== 'undefined';\r\n }\r\n\r\n /**\r\n * Wait for DOM to be ready\r\n */\r\n export function onDOMReady(callback: () => void): void {\r\n if (isBrowser()) {\r\n if (document.readyState === 'loading') {\r\n document.addEventListener('DOMContentLoaded', callback);\r\n } else {\r\n callback();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Create a root for rendering\r\n */\r\n export function createRoot(container: HTMLElement | string) {\r\n const target = typeof container === 'string'\r\n ? document.querySelector(container)\r\n : container;\r\n\r\n if (!target || !(target instanceof HTMLElement)) {\r\n throw new Error(`Root container not found: ${container}`);\r\n }\r\n\r\n let mounted: MountedComponent | null = null;\r\n\r\n return {\r\n render(component: JSXElement | (() => JSXElement)) {\r\n if (mounted) {\r\n mounted.unmount();\r\n }\r\n mounted = render(component, target);\r\n },\r\n\r\n unmount() {\r\n if (mounted) {\r\n mounted.unmount();\r\n mounted = null;\r\n }\r\n }\r\n };\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝","// src/mod/utils.ts\r\n//\r\n// Made with ❤️ by Maysara.\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\n /**\r\n * Minify HTML string by removing excess whitespace\r\n * Collapses multiple spaces, tabs, and newlines into single spaces\r\n * Removes leading/trailing whitespace from text nodes\r\n * @param html - HTML string to minify\r\n * @returns Minified HTML string\r\n */\r\n export function minifyHTML(html: string): string {\r\n // Collapse multiple whitespace characters (spaces, tabs, newlines) into single space\r\n return html\r\n .replace(/\\s+/g, ' ') // Replace multiple whitespace with single space\r\n .replace(/>\\s+</g, '><') // Remove spaces between closing and opening tags\r\n .trim(); // Remove leading/trailing whitespace\r\n }\r\n\r\n /**\r\n * Normalize a string value by removing excess whitespace\r\n * Useful for class names, ids, and other attributes with multi-line definitions\r\n * @param value - String value to normalize\r\n * @returns Normalized string with collapsed whitespace\r\n */\r\n export function normalizeString(value: string): string {\r\n return value\r\n .replace(/\\s+/g, ' ') // Collapse multiple whitespace into single space\r\n .trim(); // Remove leading/trailing whitespace\r\n }\r\n\r\n // Regex patterns for class groups that should be mutually exclusive\r\n // The order matters for partial matches, though we try to use strict patterns where possible.\r\n const CONFLICT_GROUPS = [\r\n // Layout\r\n /^display-(.+)$/, \r\n /^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|table|table-row|table-cell|flow-root|contents|hidden)$/,\r\n /^(static|fixed|absolute|relative|sticky)$/,\r\n /^inset-(.+)$/,\r\n /^inset-x-(.+)$/,\r\n /^inset-y-(.+)$/,\r\n /^start-(.+)$/,\r\n /^end-(.+)$/,\r\n /^top-(.+)$/,\r\n /^bottom-(.+)$/,\r\n /^z-(.+)$/,\r\n\r\n // Flex/Grid\r\n /^flex-(row|col)(-reverse)?$/,\r\n /^flex-(wrap|nowrap)(-reverse)?$/,\r\n /^flex-(1|auto|initial|none)$/,\r\n /^basis-(.+)$/,\r\n /^grow(-0)?$/,\r\n /^shrink(-0)?$/,\r\n /^order-(.+)$/,\r\n /^gap-(\\d+)$/, // gap-4\r\n /^gap-x-(.+)$/,\r\n /^gap-y-(.+)$/,\r\n /^justify-items-(.+)$/,\r\n /^justify-self-(.+)$/,\r\n /^justify-(start|end|center|between|around|evenly|stretch)$/, // justify-content\r\n /^content-(.+)$/, // align-content\r\n /^items-(.+)$/, // align-items\r\n /^self-(.+)$/, // align-self\r\n /^place-content-(.+)$/,\r\n /^place-items-(.+)$/,\r\n /^place-self-(.+)$/,\r\n /^grid-cols-(.+)$/,\r\n /^col-span-(.+)$/,\r\n /^col-start-(.+)$/,\r\n /^col-end-(.+)$/,\r\n /^grid-rows-(.+)$/,\r\n /^row-span-(.+)$/,\r\n /^row-start-(.+)$/,\r\n /^row-end-(.+)$/,\r\n /^grid-flow-(.+)$/,\r\n\r\n // Spacing\r\n /^p-(.+)$/,\r\n /^px-(.+)$/,\r\n /^py-(.+)$/,\r\n /^pt-(.+)$/,\r\n /^pb-(.+)$/,\r\n /^ps-(.+)$/,\r\n /^pe-(.+)$/,\r\n /^m-(.+)$/,\r\n /^mx-(.+)$/,\r\n /^my-(.+)$/,\r\n /^mt-(.+)$/,\r\n /^mb-(.+)$/,\r\n /^ms-(.+)$/,\r\n /^me-(.+)$/,\r\n\r\n // Sizing\r\n /^w-(.+)$/,\r\n /^min-w-(.+)$/,\r\n /^max-w-(.+)$/,\r\n /^h-(.+)$/,\r\n /^min-h-(.+)$/,\r\n /^max-h-(.+)$/,\r\n\r\n // Typography\r\n /^font-(sans|serif|mono)$/,\r\n /^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,\r\n /^text-(xs|sm|base|md|lg|xl|\\d+xl)$/, // Font size\r\n /^leading-(.+)$/,\r\n /^tracking-(.+)$/,\r\n /^text-(left|center|right|justify|start|end)$/, // Text align\r\n /^text-(wrap|nowrap|balance|pretty)$/,\r\n /^(truncate|text-ellipsis|text-clip)$/,\r\n /^(uppercase|lowercase|capitalize|normal-case)$/,\r\n /^(italic|not-italic)$/,\r\n /^(underline|overline|line-through|no-underline)$/,\r\n /^text-(?!left|center|right|justify|start|end|xs|sm|base|md|lg|xl|\\d+xl|wrap|nowrap|balance|pretty|ellipsis|clip).+$/, // Text color\r\n\r\n // Background & Effects\r\n /^bg-(?!blend).+$/, // Background color\r\n /^bg-blend-(.+)$/,\r\n /^mix-blend-(.+)$/,\r\n /^shadow(.*)$/,\r\n /^opacity-(.+)$/,\r\n /^blur(.*)$/,\r\n /^brightness-(.+)$/,\r\n /^contrast-(.+)$/,\r\n /^grayscale(.*)$/,\r\n /^invert(.*)$/,\r\n /^saturate-(.+)$/,\r\n /^sepia(.*)$/,\r\n /^hue-rotate-(.+)$/,\r\n /^backdrop-blur(.*)$/,\r\n /^transition(.*)$/\r\n ];\r\n\r\n /**\r\n * Clean up class names by removing duplicates and keeping the latest one.\r\n * Handles conflict groups (e.g., 'justify-start' overrides 'justify-center').\r\n * @param value - Class name string\r\n * @returns Cleaned class name string\r\n */\r\n export function cleanClassName(value: string): string {\r\n const tokens = value.trim().split(/\\s+/);\r\n // optimization: if 0 or 1 token, just return trimmed\r\n if (tokens.length <= 1 && tokens[0] === '') return '';\r\n if (tokens.length === 1) return tokens[0];\r\n\r\n const seenGroups = new Set<number | string>();\r\n const result: string[] = [];\r\n\r\n // Iterate backwards to keep latest\r\n for (let i = tokens.length - 1; i >= 0; i--) {\r\n const token = tokens[i];\r\n if (!token) continue;\r\n\r\n let matchedGroup: number | string = token; // Default to token itself (exact match dedupe)\r\n\r\n // Check if token belongs to a known conflict group\r\n for (let g = 0; g < CONFLICT_GROUPS.length; g++) {\r\n if (CONFLICT_GROUPS[g].test(token)) {\r\n matchedGroup = g;\r\n break;\r\n }\r\n }\r\n\r\n if (!seenGroups.has(matchedGroup)) {\r\n seenGroups.add(matchedGroup);\r\n result.push(token);\r\n }\r\n }\r\n\r\n return result.reverse().join(' ');\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n","\r\nimport type {\r\n ContainerProps,\r\n ContainerDisplay,\r\n ContainerDirection,\r\n ContainerAlign,\r\n ContainerJustify,\r\n ContainerMaxWidth,\r\n ContainerBorderWidth,\r\n ContainerRadius,\r\n ContainerShadow,\r\n ContainerSpace,\r\n ContainerSpaceOrAuto\r\n} from '../types';\r\n\r\n// ╔════════════════════════════════════════ MAPS ════════════════════════════════════════╗\r\n\r\nconst displayClassMap: Record<ContainerDisplay, string> = {\r\n block: 'block',\r\n 'inline-block': 'inline-block',\r\n flex: 'flex',\r\n 'inline-flex': 'inline-flex',\r\n grid: 'grid',\r\n 'inline-grid': 'inline-grid'\r\n};\r\n\r\nconst directionClassMap: Record<ContainerDirection, string> = {\r\n row: 'flex-row',\r\n 'row-reverse': 'flex-row-reverse',\r\n column: 'flex-col',\r\n 'column-reverse': 'flex-col-reverse'\r\n};\r\n\r\nconst alignClassMap: Record<ContainerAlign, string> = {\r\n start: 'items-start',\r\n center: 'items-center',\r\n end: 'items-end',\r\n stretch: 'items-stretch',\r\n baseline: 'items-baseline'\r\n};\r\n\r\nconst justifyClassMap: Record<ContainerJustify, string> = {\r\n start: 'justify-start',\r\n center: 'justify-center',\r\n end: 'justify-end',\r\n between: 'justify-between',\r\n around: 'justify-around',\r\n evenly: 'justify-evenly'\r\n};\r\n\r\nconst maxWidthClassMap: Record<ContainerMaxWidth, string> = {\r\n xs: 'max-w-xs',\r\n sm: 'max-w-sm',\r\n md: 'max-w-md',\r\n lg: 'max-w-lg',\r\n xl: 'max-w-xl',\r\n '2xl': 'max-w-2xl',\r\n '3xl': 'max-w-3xl',\r\n '4xl': 'max-w-4xl',\r\n '5xl': 'max-w-5xl',\r\n '6xl': 'max-w-6xl',\r\n '7xl': 'max-w-7xl',\r\n full: 'max-w-full',\r\n min: 'max-w-min',\r\n max: 'max-w-max',\r\n fit: 'max-w-fit',\r\n none: 'max-w-none',\r\n prose: 'max-w-prose'\r\n};\r\n\r\nconst borderWidthClassMap: Record<ContainerBorderWidth, string> = {\r\n 0: 'border-0',\r\n 1: 'border',\r\n 2: 'border-2',\r\n 4: 'border-4',\r\n 8: 'border-8'\r\n};\r\n\r\nconst radiusClassMap: Record<ContainerRadius, string> = {\r\n none: 'rounded-none',\r\n sm: 'rounded-sm',\r\n base: 'rounded',\r\n md: 'rounded-md',\r\n lg: 'rounded-lg',\r\n xl: 'rounded-xl',\r\n '2xl': 'rounded-2xl',\r\n '3xl': 'rounded-3xl',\r\n full: 'rounded-full'\r\n};\r\n\r\nconst shadowClassMap: Record<ContainerShadow, string> = {\r\n none: 'shadow-none',\r\n xs: 'shadow-xs',\r\n sm: 'shadow-sm',\r\n md: 'shadow-md',\r\n lg: 'shadow-lg',\r\n xl: 'shadow-xl',\r\n inner: 'shadow-inner'\r\n};\r\n\r\n// ╔════════════════════════════════════════ HELP ════════════════════════════════════════╗\r\n\r\nfunction spacingClass(prefix: string, value: ContainerSpace | undefined): string | undefined {\r\n if (value === undefined) return undefined;\r\n return `${prefix}-${value}`;\r\n}\r\n\r\nfunction marginClass(prefix: string, value: ContainerSpaceOrAuto | undefined): string | undefined {\r\n if (value === undefined) return undefined;\r\n if (value === 'auto') return `${prefix}-auto`;\r\n return `${prefix}-${value}`;\r\n}\r\n\r\nconst SCALE = new Set([\r\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64\r\n]);\r\nconst FRACTIONS = 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']);\r\n\r\nconst W_KEYWORDS = new Set(['auto', 'full', 'screen', 'min', 'max', 'fit']);\r\nconst H_KEYWORDS = new Set(['auto', 'full', 'screen', 'min', 'max', 'fit']);\r\nconst MIN_W_KEYWORDS = new Set(['0', 'full', 'min', 'max', 'fit']);\r\nconst MAX_W_KEYWORDS = new Set(['none', 'full', 'min', 'max', 'fit']);\r\nconst MIN_H_KEYWORDS = new Set(['0', 'full', 'screen', 'min', 'max', 'fit']);\r\nconst MAX_H_KEYWORDS = new Set(['none', 'full', 'screen', 'min', 'max', 'fit']);\r\n\r\nconst resolveSize = (\r\n key: 'w' | 'h' | 'min-w' | 'min-h' | 'max-w' | 'max-h',\r\n val: string | number | undefined,\r\n map?: Record<string, string>\r\n) => {\r\n if (val === undefined) return null;\r\n\r\n // Check map first (e.g. max-w-xs)\r\n if (map && val in map) {\r\n return { class: map[val] };\r\n }\r\n\r\n // Check numeric scale\r\n if (typeof val === 'number' && SCALE.has(val)) {\r\n return { class: `${key}-${val}` };\r\n }\r\n\r\n // Check fractions (only for w, h)\r\n if ((key === 'w' || key === 'h') && FRACTIONS.has(val as string)) {\r\n return { class: `${key}-${val}` };\r\n }\r\n\r\n // Check keywords\r\n const keywords =\r\n key === 'w' ? W_KEYWORDS :\r\n key === 'h' ? H_KEYWORDS :\r\n key === 'min-w' ? MIN_W_KEYWORDS :\r\n key === 'min-h' ? MIN_H_KEYWORDS :\r\n key === 'max-w' ? MAX_W_KEYWORDS :\r\n MAX_H_KEYWORDS;\r\n\r\n if (keywords.has(val as string)) {\r\n return { class: `${key}-${val}` };\r\n }\r\n\r\n // Also check scale for min/max props (we added loops to SCSS)\r\n if (['min-w', 'max-w', 'min-h', 'max-h'].includes(key) && typeof val === 'number' && SCALE.has(val)) {\r\n return { class: `${key}-${val}` };\r\n }\r\n\r\n // Fallback to inline style\r\n const styleProp =\r\n key === 'w' ? 'width' :\r\n key === 'h' ? 'height' :\r\n key === 'min-w' ? 'minWidth' :\r\n key === 'min-h' ? 'minHeight' :\r\n key === 'max-w' ? 'maxWidth' :\r\n 'maxHeight';\r\n\r\n return { style: { [styleProp]: val } };\r\n};\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\nexport const STYLE_PROPS = new Set([\r\n 'display', 'direction', 'align', 'justify', 'wrap',\r\n 'gap', 'gapX', 'gapY',\r\n 'w', 'h', 'minW', 'minH', 'maxW', 'maxH',\r\n 'p', 'px', 'py', 'ps', 'pe', 'pt', 'pb',\r\n 'm', 'mx', 'my', 'ms', 'me', 'mt', 'mb',\r\n 'bg', 'color', 'border', 'borderColor', 'radius', 'shadow',\r\n 'position', 'overflow', 'zIndex'\r\n]);\r\n\r\nexport function resolveStyleProps(props: ContainerProps): { className: string; style: any } {\r\n const {\r\n display,\r\n direction,\r\n align,\r\n justify,\r\n wrap,\r\n gap,\r\n gapX,\r\n gapY,\r\n w,\r\n h,\r\n minW,\r\n minH,\r\n maxW,\r\n maxH,\r\n p,\r\n px,\r\n py,\r\n ps,\r\n pe,\r\n pt,\r\n pb,\r\n m,\r\n mx,\r\n my,\r\n ms,\r\n me,\r\n mt,\r\n mb,\r\n bg,\r\n color,\r\n border,\r\n borderColor,\r\n radius,\r\n shadow,\r\n position,\r\n overflow,\r\n zIndex,\r\n } = props;\r\n\r\n const wRes = resolveSize('w', w);\r\n const hRes = resolveSize('h', h);\r\n const minWRes = resolveSize('min-w', minW);\r\n const minHRes = resolveSize('min-h', minH);\r\n const maxWRes = resolveSize('max-w', maxW, maxWidthClassMap);\r\n const maxHRes = resolveSize('max-h', maxH);\r\n\r\n const computedStyle = {\r\n ...wRes?.style,\r\n ...hRes?.style,\r\n ...minWRes?.style,\r\n ...minHRes?.style,\r\n ...maxWRes?.style,\r\n ...maxHRes?.style,\r\n };\r\n\r\n const classes = [\r\n display && displayClassMap[display],\r\n direction && directionClassMap[direction],\r\n align && alignClassMap[align],\r\n justify && justifyClassMap[justify],\r\n wrap && 'flex-wrap',\r\n gap !== undefined && `gap-${gap}`,\r\n gapX !== undefined && `gap-x-${gapX}`,\r\n gapY !== undefined && `gap-y-${gapY}`,\r\n wRes?.class,\r\n hRes?.class,\r\n minWRes?.class,\r\n minHRes?.class,\r\n maxWRes?.class,\r\n maxHRes?.class,\r\n spacingClass('p', p),\r\n spacingClass('px', px),\r\n spacingClass('py', py),\r\n spacingClass('ps', ps),\r\n spacingClass('pe', pe),\r\n spacingClass('pt', pt),\r\n spacingClass('pb', pb),\r\n marginClass('m', m),\r\n marginClass('mx', mx),\r\n marginClass('my', my),\r\n marginClass('ms', ms),\r\n marginClass('me', me),\r\n marginClass('mt', mt),\r\n marginClass('mb', mb),\r\n bg && `bg-${bg}`,\r\n color && `text-${color}`,\r\n border !== undefined && borderWidthClassMap[border],\r\n borderColor && `border-${borderColor}`,\r\n radius && radiusClassMap[radius],\r\n shadow && shadowClassMap[shadow],\r\n position,\r\n overflow && `overflow-${overflow}`,\r\n zIndex && `z-${zIndex}`,\r\n ]\r\n .filter(Boolean)\r\n .join(' ');\r\n\r\n return {\r\n className: classes,\r\n style: Object.keys(computedStyle).length > 0 ? computedStyle : undefined\r\n };\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n// src/mod/runtime.ts\r\n//\r\n// Made with ❤️ by Maysara.\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ PACK ════════════════════════════════════════╗\r\n\r\n import { effect, isSignal, type Signal } from '@minejs/signals';\r\n import type { JSXElement, JSXProps, ComponentFunction } from '../types';\r\n import { normalizeString, cleanClassName } from './utils';\r\n import { resolveStyleProps, STYLE_PROPS } from './style';\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ CORE ════════════════════════════════════════╗\r\n\r\n /**\r\n * Creates a DOM element from JSX\r\n * This is called automatically by TypeScript when it sees JSX syntax\r\n */\r\n export function jsx(\r\n type: string | ComponentFunction,\r\n props: JSXProps | null\r\n ): JSXElement | null {\r\n // Handle component (function)\r\n if (typeof type === 'function') {\r\n return type(props || {});\r\n }\r\n\r\n // Handle HTML element (string)\r\n return createHTMLElement(type, props || {});\r\n }\r\n\r\n /**\r\n * Same as jsx() but for elements with multiple children\r\n * (Used by TypeScript JSX transform)\r\n */\r\n export const jsxs = jsx;\r\n\r\n /**\r\n * Fragment component (like React.Fragment)\r\n */\r\n export function Fragment(props: { children?: any }): DocumentFragment {\r\n const fragment = document.createDocumentFragment();\r\n const children = normalizeChildren(props.children);\r\n\r\n children.forEach(child => {\r\n if (child instanceof Node) {\r\n fragment.appendChild(child);\r\n }\r\n });\r\n\r\n return fragment;\r\n }\r\n\r\n // ============================================================================\r\n // DOM OBSERVER (onload support)\r\n // ============================================================================\r\n\r\n let observerInitialized = false;\r\n\r\n function initOnLoadObserver() {\r\n if (observerInitialized) return;\r\n if (typeof window === 'undefined' || typeof MutationObserver === 'undefined') return;\r\n\r\n observerInitialized = true;\r\n\r\n const observer = new MutationObserver((mutations) => {\r\n mutations.forEach((mutation) => {\r\n mutation.addedNodes.forEach((node) => {\r\n if (node instanceof Element) {\r\n checkOnLoad(node);\r\n }\r\n });\r\n });\r\n });\r\n\r\n if (document.body) {\r\n observer.observe(document.body, { childList: true, subtree: true });\r\n } else {\r\n document.addEventListener('DOMContentLoaded', () => {\r\n if (document.body) {\r\n observer.observe(document.body, { childList: true, subtree: true });\r\n }\r\n });\r\n }\r\n }\r\n\r\n function checkOnLoad(element: Element) {\r\n if (element.hasAttribute('data-mine-onload')) {\r\n const handler = (element as any)['__onload'];\r\n if (typeof handler === 'function') {\r\n handler(element);\r\n }\r\n }\r\n\r\n const children = element.querySelectorAll('[data-mine-onload]');\r\n children.forEach((child) => {\r\n const handler = (child as any)['__onload'];\r\n if (typeof handler === 'function') {\r\n handler(child);\r\n }\r\n });\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n\r\n\r\n\r\n// ╔════════════════════════════════════════ ════ ════════════════════════════════════════╗\r\n\r\n // ============================================================================\r\n // HTML ELEMENT CREATION\r\n // ============================================================================\r\n\r\n // SVG elements that need to be created with createElementNS\r\n const SVG_ELEMENTS = new Set([\r\n 'svg', 'path', 'circle', 'rect', 'line', 'polyline', 'polygon',\r\n 'ellipse', 'g', 'text', 'tspan', 'defs', 'clipPath', 'linearGradient',\r\n 'radialGradient', 'stop', 'mask', 'pattern', 'image', 'use', 'symbol',\r\n 'marker', 'foreignObject', 'animate', 'animateTransform', 'animateMotion',\r\n 'set', 'filter', 'feBlend', 'feColorMatrix', 'feComponentTransfer',\r\n 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap',\r\n 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR',\r\n 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology',\r\n 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile',\r\n 'feTurbulence', 'title', 'desc', 'metadata'\r\n ]);\r\n\r\n // MathML elements that need to be created with createElementNS\r\n const MATHML_ELEMENTS = new Set([\r\n 'math', 'maction', 'maligngroup', 'malignmark', 'menclose', 'merror',\r\n 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mlongdiv',\r\n 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom',\r\n 'mroot', 'mrow', 'ms', 'mscarries', 'mscarry', 'msgroup', 'msline',\r\n 'mspace', 'msqrt', 'msrow', 'mstack', 'mstyle', 'msub', 'msup',\r\n 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover',\r\n 'semantics', 'annotation', 'annotation-xml'\r\n ]);\r\n\r\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\r\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\r\n\r\n function createHTMLElement(type: string, props: JSXProps): Element {\r\n // Determine namespace and create element appropriately\r\n let element: Element;\r\n\r\n if (SVG_ELEMENTS.has(type)) {\r\n element = document.createElementNS(SVG_NAMESPACE, type);\r\n } else if (MATHML_ELEMENTS.has(type)) {\r\n element = document.createElementNS(MATHML_NAMESPACE, type);\r\n } else {\r\n element = document.createElement(type);\r\n }\r\n\r\n // Check if dangerouslySetInnerHTML is present and valid - it takes precedence over children\r\n const hasValidDangerouslySetInnerHTML = 'dangerouslySetInnerHTML' in props\r\n && props.dangerouslySetInnerHTML != null\r\n && typeof props.dangerouslySetInnerHTML === 'object'\r\n && '__html' in props.dangerouslySetInnerHTML\r\n && typeof props.dangerouslySetInnerHTML.__html === 'string';\r\n\r\n // Resolve container props (style props)\r\n const { className: containerClass, style: containerStyle } = resolveStyleProps(props);\r\n\r\n // Apply container styles immediately (as base)\r\n if (containerStyle && !SVG_ELEMENTS.has(type) && !MATHML_ELEMENTS.has(type)) {\r\n applyStyles(element as HTMLElement, containerStyle);\r\n }\r\n\r\n let handledClass = false;\r\n\r\n // Set properties and attributes\r\n for (const [key, value] of Object.entries(props)) {\r\n // Skip container style props as they are already handled\r\n if (STYLE_PROPS.has(key)) continue;\r\n\r\n if (key === 'children') {\r\n // Skip children if dangerouslySetInnerHTML is present and valid\r\n if (!hasValidDangerouslySetInnerHTML) {\r\n appendChildren(element, value);\r\n }\r\n } else if (key === 'dangerouslySetInnerHTML') {\r\n // Handle dangerouslySetInnerHTML - inject raw HTML\r\n handleDangerouslySetInnerHTML(element as HTMLElement, value);\r\n } else if (key === 'onload') {\r\n // Handle onload lifecycle event\r\n (element as any)['__onload'] = value;\r\n element.setAttribute('data-mine-onload', '');\r\n initOnLoadObserver();\r\n } else if (key === 'ref') {\r\n // Handle ref\r\n handleRef(element as HTMLElement, value);\r\n } else if (key.startsWith('on')) {\r\n // Handle events (onClick, onInput, etc)\r\n handleEvent(element, key, value);\r\n } else if (key === 'id') {\r\n // Handle id\r\n handleId(element, value);\r\n } else if (key === 'className' || key === 'class') {\r\n // Handle className/class\r\n handledClass = true;\r\n handleClassName(element, value, containerClass);\r\n } else if (key === 'style') {\r\n // Handle inline styles\r\n handleStyle(element as HTMLElement, value);\r\n } else if (isSignal(value)) {\r\n // Handle reactive props\r\n handleReactiveProp(element, key, value);\r\n } else if (typeof value === 'boolean') {\r\n // Handle boolean attributes (disabled, checked, etc)\r\n if (value) {\r\n element.setAttribute(key, '');\r\n }\r\n } else if (value != null) {\r\n // Handle static props\r\n // For SVG/MathML elements, always use setAttribute to preserve case sensitivity\r\n if (SVG_ELEMENTS.has(type) || MATHML_ELEMENTS.has(type)) {\r\n const attrValue = typeof value === 'string' ? normalizeString(value) : String(value);\r\n element.setAttribute(key, attrValue);\r\n } else {\r\n // For HTML elements, prefer property assignment\r\n if (key in element) {\r\n (element as any)[key] = value;\r\n } else {\r\n const attrValue = typeof value === 'string' ? normalizeString(value) : String(value);\r\n element.setAttribute(key, attrValue);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // If no explicit className was provided but we have container classes, apply them\r\n if (!handledClass && containerClass) {\r\n handleClassName(element, containerClass);\r\n }\r\n\r\n return element;\r\n }\r\n\r\n // ============================================================================\r\n // CHILDREN HANDLING\r\n // ============================================================================\r\n\r\n function appendChildren(parent: Element, children: any): void {\r\n const normalized = normalizeChildren(children);\r\n\r\n normalized.forEach(child => {\r\n if (child instanceof Node) {\r\n parent.appendChild(child);\r\n } else if (isSignal(child)) {\r\n // Reactive text node\r\n const textNode = document.createTextNode('');\r\n effect(() => {\r\n textNode.textContent = String(child());\r\n });\r\n parent.appendChild(textNode);\r\n } else if (child != null && child !== false) {\r\n // Static text node\r\n parent.appendChild(document.createTextNode(String(child)));\r\n }\r\n });\r\n }\r\n\r\n function normalizeChildren(children: any): any[] {\r\n if (children == null || children === false) {\r\n return [];\r\n }\r\n\r\n if (Array.isArray(children)) {\r\n return children.flatMap(normalizeChildren);\r\n }\r\n\r\n return [children];\r\n }\r\n\r\n // ============================================================================\r\n // REF HANDLING\r\n // ============================================================================\r\n\r\n function handleRef(element: HTMLElement, ref: any): void {\r\n if (isSignal(ref)) {\r\n ref.set(element);\r\n } else if (typeof ref === 'function') {\r\n ref(element);\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // EVENT HANDLING\r\n // ============================================================================\r\n\r\n function handleEvent(element: Element, eventName: string, handler: any): void {\r\n if (typeof handler !== 'function') return;\r\n\r\n // Convert onClick → click, onInput → input, etc\r\n const event = eventName.slice(2).toLowerCase();\r\n\r\n element.addEventListener(event, handler);\r\n }\r\n\r\n // ============================================================================\r\n // CLASS NAME HANDLING\r\n // ============================================================================\r\n\r\n function handleClassName(element: Element, value: any, baseClass: string = ''): void {\r\n const setClass = (val: string) => {\r\n const fullClass = baseClass ? `${baseClass} ${val}` : val;\r\n const cleaned = cleanClassName(String(fullClass));\r\n if (element.namespaceURI === SVG_NAMESPACE) {\r\n element.setAttribute('class', cleaned);\r\n } else {\r\n element.className = cleaned;\r\n }\r\n };\r\n\r\n if (isSignal(value)) {\r\n // Reactive className\r\n effect(() => {\r\n const className = value();\r\n if (className != null) {\r\n setClass(String(className));\r\n } else if (baseClass) {\r\n setClass('');\r\n }\r\n });\r\n } else if (value != null) {\r\n // Static className\r\n setClass(String(value));\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // ID HANDLING\r\n // ============================================================================\r\n\r\n function handleId(element: Element, value: any): void {\r\n if (isSignal(value)) {\r\n // Reactive id\r\n effect(() => {\r\n const id = value();\r\n if (id != null) {\r\n element.id = String(id);\r\n } else {\r\n element.removeAttribute('id');\r\n }\r\n });\r\n } else if (value != null) {\r\n // Static id\r\n element.id = String(value);\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // STYLE HANDLING\r\n // ============================================================================\r\n\r\n function handleStyle(element: HTMLElement, value: any): void {\r\n if (isSignal(value)) {\r\n // Reactive style object\r\n effect(() => {\r\n const styles = value();\r\n applyStyles(element, styles);\r\n });\r\n } else {\r\n // Static style\r\n applyStyles(element, value);\r\n }\r\n }\r\n\r\n function applyStyles(element: HTMLElement, styles: any): void {\r\n if (typeof styles === 'string') {\r\n element.style.cssText = styles;\r\n } else if (typeof styles === 'object' && styles != null) {\r\n Object.entries(styles).forEach(([key, value]) => {\r\n if (value != null) {\r\n // Convert camelCase to kebab-case\r\n const cssKey = key.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`);\r\n element.style.setProperty(cssKey, String(value));\r\n }\r\n });\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // DANGEROUSLY SET INNER HTML\r\n // ============================================================================\r\n\r\n function handleDangerouslySetInnerHTML(element: HTMLElement, value: any): void {\r\n if (value != null && typeof value === 'object' && '__html' in value) {\r\n // Extract __html property and inject as raw HTML\r\n const html = value.__html;\r\n if (typeof html === 'string') {\r\n element.innerHTML = html;\r\n }\r\n }\r\n }\r\n\r\n // ============================================================================\r\n // REACTIVE PROP HANDLING\r\n // ============================================================================\r\n\r\n function handleReactiveProp(element: Element, key: string, signal: Signal<any>): void {\r\n effect(() => {\r\n const value = signal();\r\n\r\n if (value != null) {\r\n if (key in element) {\r\n // Set as property (for input.value, etc)\r\n ; (element as any)[key] = value;\r\n } else {\r\n // Set as attribute, normalize if string\r\n const attrValue = typeof value === 'string' ? normalizeString(value) : String(value);\r\n element.setAttribute(key, attrValue);\r\n }\r\n } else {\r\n element.removeAttribute(key);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Create a component from a function\r\n * Provides a cleaner API than raw JSX\r\n */\r\n export function component<P = any>(\r\n fn: (props: P) => JSXElement | null\r\n ): ComponentFunction<P> {\r\n return fn;\r\n }\r\n\r\n /**\r\n * Create a component with setup function\r\n * Similar to Vue's Composition API\r\n */\r\n export function defineComponent<P = any>(\r\n setup: (props: P) => () => JSXElement | null\r\n ): ComponentFunction<P> {\r\n return (props: P) => {\r\n const render = setup(props);\r\n return render();\r\n };\r\n }\r\n\r\n // ============================================================================\r\n // UTILITY FUNCTIONS\r\n // ============================================================================\r\n\r\n /**\r\n * Create multiple elements at once\r\n */\r\n export function createElements(elements: any[]): DocumentFragment {\r\n const fragment = document.createDocumentFragment();\r\n\r\n elements.forEach(el => {\r\n if (el instanceof Node) {\r\n fragment.appendChild(el);\r\n }\r\n });\r\n\r\n return fragment;\r\n }\r\n\r\n /**\r\n * Show/hide element based on condition\r\n */\r\n export function Show(props: {\r\n when: boolean | Signal<boolean>\r\n children: any\r\n }): JSXElement | null {\r\n if (isSignal(props.when)) {\r\n const placeholder = document.createComment('show');\r\n const parent = document.createDocumentFragment();\r\n parent.appendChild(placeholder);\r\n\r\n let currentElement: Element | null = null;\r\n\r\n effect(() => {\r\n const when = props.when as Signal<boolean>;\r\n const condition = when();\r\n\r\n if (condition && !currentElement) {\r\n // Show: create and insert element\r\n const children = normalizeChildren(props.children);\r\n currentElement = children[0] as Element;\r\n\r\n if (currentElement instanceof Node) {\r\n placeholder.parentNode?.insertBefore(currentElement, placeholder);\r\n }\r\n } else if (!condition && currentElement) {\r\n // Hide: remove element\r\n currentElement.remove();\r\n currentElement = null;\r\n }\r\n });\r\n\r\n return parent as any;\r\n } else {\r\n // Static condition\r\n return (props.when as boolean) ? jsx(Fragment, { children: props.children }) : null;\r\n }\r\n }\r\n\r\n /**\r\n * Render different elements based on condition\r\n */\r\n export function Switch(props: {\r\n children: { when: boolean | Signal<boolean>; children: any }[]\r\n }): JSXElement | null {\r\n // Find first matching case\r\n for (const caseItem of props.children) {\r\n const condition = isSignal(caseItem.when) ? caseItem.when() : caseItem.when;\r\n\r\n if (condition) {\r\n return jsx(Fragment, { children: caseItem.children });\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Iterate over array and render elements\r\n */\r\n export function For<T>(props: {\r\n each: T[] | Signal<T[]>\r\n children: (item: T, index: number) => JSXElement\r\n }): JSXElement {\r\n const fragment = document.createDocumentFragment();\r\n\r\n if (isSignal(props.each)) {\r\n // Reactive list\r\n const container = document.createElement('div');\r\n container.style.display = 'contents'; // Don't affect layout\r\n\r\n effect(() => {\r\n const each = props.each as Signal<T[]>;\r\n const items = each();\r\n container.innerHTML = ''; // Clear\r\n\r\n items.forEach((item: any, index: any) => {\r\n const element = props.children(item, index);\r\n if (element instanceof Node) {\r\n container.appendChild(element);\r\n }\r\n });\r\n });\r\n\r\n fragment.appendChild(container);\r\n } else {\r\n // Static list\r\n const each = props.each as T[];\r\n each.forEach((item, index) => {\r\n const element = props.children(item, index);\r\n if (element instanceof Node) {\r\n fragment.appendChild(element);\r\n }\r\n });\r\n }\r\n\r\n return fragment as any;\r\n }\r\n\r\n// ╚══════════════════════════════════════════════════════════════════════════════════════╝\r\n"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { J as JSXElement, R as RenderOptions, M as MountedComponent } from './jsx-dev-runtime-DakPS8WV.cjs';
2
- export { C as ComponentFunction, g as For, F as Fragment, a as JSXProps, S as Show, f as Switch, c as component, e as createElements, d as defineComponent, j as jsx, b as jsxs } from './jsx-dev-runtime-DakPS8WV.cjs';
1
+ import { J as JSXElement, R as RenderOptions, M as MountedComponent } from './jsx-dev-runtime-1zxAmaFq.cjs';
2
+ export { C as ComponentFunction, d as ContainerAlign, a as ContainerAs, q as ContainerBg, s as ContainerBorderColor, t as ContainerBorderWidth, c as ContainerDirection, b as ContainerDisplay, j as ContainerFraction, f as ContainerGap, n as ContainerHeight, e as ContainerJustify, p as ContainerMaxHeight, l as ContainerMaxWidth, o as ContainerMinHeight, m as ContainerMinWidth, x as ContainerOverflow, w as ContainerPosition, y as ContainerProps, u as ContainerRadius, i as ContainerScale, v as ContainerShadow, g as ContainerSpace, h as ContainerSpaceOrAuto, r as ContainerTextColor, k as ContainerWidth, I as For, F as Fragment, z as JSXProps, S as Show, H as Switch, D as component, G as createElements, E as defineComponent, A as jsx, B as jsxs } from './jsx-dev-runtime-1zxAmaFq.cjs';
3
3
  import '@minejs/signals';
4
4
 
5
5
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { J as JSXElement, R as RenderOptions, M as MountedComponent } from './jsx-dev-runtime-DakPS8WV.js';
2
- export { C as ComponentFunction, g as For, F as Fragment, a as JSXProps, S as Show, f as Switch, c as component, e as createElements, d as defineComponent, j as jsx, b as jsxs } from './jsx-dev-runtime-DakPS8WV.js';
1
+ import { J as JSXElement, R as RenderOptions, M as MountedComponent } from './jsx-dev-runtime-1zxAmaFq.js';
2
+ export { C as ComponentFunction, d as ContainerAlign, a as ContainerAs, q as ContainerBg, s as ContainerBorderColor, t as ContainerBorderWidth, c as ContainerDirection, b as ContainerDisplay, j as ContainerFraction, f as ContainerGap, n as ContainerHeight, e as ContainerJustify, p as ContainerMaxHeight, l as ContainerMaxWidth, o as ContainerMinHeight, m as ContainerMinWidth, x as ContainerOverflow, w as ContainerPosition, y as ContainerProps, u as ContainerRadius, i as ContainerScale, v as ContainerShadow, g as ContainerSpace, h as ContainerSpaceOrAuto, r as ContainerTextColor, k as ContainerWidth, I as For, F as Fragment, z as JSXProps, S as Show, H as Switch, D as component, G as createElements, E as defineComponent, A as jsx, B as jsxs } from './jsx-dev-runtime-1zxAmaFq.js';
3
3
  import '@minejs/signals';
4
4
 
5
5
  /**
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import {isSignal,effect}from'@minejs/signals';var d=[],u=false;function p(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:l=>{r instanceof Element&&l instanceof Element?r.replaceWith(l):l instanceof Element&&r instanceof DocumentFragment&&r.parentNode&&r.parentNode.replaceChild(l,r);}}}function R(e,n){return p(e,n,{mode:"replace"})}function L(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 z(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 p(e,o,{mode:"replace"})}function G(e,n){let t=null,o=false,r=null;return i=>{if(t)return t(i);if(r){let l=document.createElement("div");return l.className="crux-lazy-error",l.textContent=`Error loading component: ${r.message}`,l.style.color="red",l}return o||(o=true,e().then(l=>{t=l.default;}).catch(l=>{r=l instanceof Error?l:new Error(String(l));})),n||T()}}function T(){let e=document.createElement("div");return e.textContent="Loading...",e}function q(e){try{return e.children}catch(n){return e.fallback(n)}}function B(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 V(e){return L(e.children,e.to)}function U(e){d.push(e),u||(u=true,queueMicrotask(v));}function v(){let e=d;d=[],u=false,e.forEach(n=>n());}function J(){return typeof window<"u"&&typeof document<"u"}function W(e){J()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e());}function K(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=p(o,n);},unmount(){t&&(t.unmount(),t=null);}}}function Z(e){return e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function f(e){return e.replace(/\s+/g," ").trim()}var $=[/^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 S(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 i=n[r];if(!i)continue;let l=i;for(let s=0;s<$.length;s++)if($[s].test(i)){l=s;break}t.has(l)||(t.add(l),o.push(i));}return o.reverse().join(" ")}function y(e,n){return typeof e=="function"?e(n||{}):X(e,n||{})}var te=y;function w(e){let n=document.createDocumentFragment();return m(e.children).forEach(o=>{o instanceof Node&&n.appendChild(o);}),n}var b=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"]),x=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"]),C="http://www.w3.org/2000/svg",N="http://www.w3.org/1998/Math/MathML";function X(e,n){let t;b.has(e)?t=document.createElementNS(C,e):x.has(e)?t=document.createElementNS(N,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";for(let[r,i]of Object.entries(n))if(r==="children")o||H(t,i);else if(r==="dangerouslySetInnerHTML")_(t,i);else if(r==="ref")A(t,i);else if(r==="onload")k(t,i);else if(r.startsWith("on"))D(t,r,i);else if(r==="className"||r==="class")O(t,i);else if(r==="style")j(t,i);else if(isSignal(i))I(t,r,i);else if(typeof i=="boolean")i&&t.setAttribute(r,"");else if(i!=null)if(b.has(e)||x.has(e)){let l=typeof i=="string"?f(i):String(i);t.setAttribute(r,l);}else if(r in t)t[r]=i;else {let l=typeof i=="string"?f(i):String(i);t.setAttribute(r,l);}return t}function H(e,n){m(n).forEach(o=>{if(o instanceof Node)e.appendChild(o);else if(isSignal(o)){let r=document.createTextNode("");effect(()=>{r.textContent=String(o());}),e.appendChild(r);}else o!=null&&o!==false&&e.appendChild(document.createTextNode(String(o)));});}function m(e){return e==null||e===false?[]:Array.isArray(e)?e.flatMap(m):[e]}var g=new WeakMap,E="data-mine-onload",h=null;function P(){h||typeof MutationObserver>"u"||(h=new MutationObserver(e=>{e.forEach(n=>{n.addedNodes.forEach(t=>{t.nodeType===1&&F(t);});});}),h.observe(document,{childList:true,subtree:true}));}function F(e){if(e.hasAttribute(E)){let t=g.get(e);t&&t();}e.querySelectorAll(`[${E}]`).forEach(t=>{let o=g.get(t);o&&o();});}function k(e,n){typeof n=="function"&&(g.set(e,n),e.setAttribute(E,"true"),P());}function A(e,n){isSignal(n)?n.set(e):typeof n=="function"&&n(e);}function D(e,n,t){if(typeof t!="function")return;let o=n.slice(2).toLowerCase();e.addEventListener(o,t);}function O(e,n){let t=o=>{let r=S(String(o));e.namespaceURI===C?e.setAttribute("class",r):e.className=r;};isSignal(n)?effect(()=>{let o=n();o!=null&&t(String(o));}):n!=null&&t(String(n));}function j(e,n){isSignal(n)?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,o])=>{if(o!=null){let r=t.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);e.style.setProperty(r,String(o));}});}function _(e,n){if(n!=null&&typeof n=="object"&&"__html"in n){let t=n.__html;typeof t=="string"&&(e.innerHTML=t);}}function I(e,n,t){effect(()=>{let o=t();if(o!=null)if(n in e)e[n]=o;else {let r=typeof o=="string"?f(o):String(o);e.setAttribute(n,r);}else e.removeAttribute(n);});}function oe(e){return e}function re(e){return n=>e(n)()}function ie(e){let n=document.createDocumentFragment();return e.forEach(t=>{t instanceof Node&&n.appendChild(t);}),n}function le(e){if(isSignal(e.when)){let n=document.createComment("show"),t=document.createDocumentFragment();t.appendChild(n);let o=null;return effect(()=>{let r=e.when,i=r();i&&!o?(o=m(e.children)[0],o instanceof Node&&n.parentNode?.insertBefore(o,n)):!i&&o&&(o.remove(),o=null);}),t}else return e.when?y(w,{children:e.children}):null}function ae(e){for(let n of e.children)if(isSignal(n.when)?n.when():n.when)return y(w,{children:n.children});return null}function se(e){let n=document.createDocumentFragment();if(isSignal(e.each)){let t=document.createElement("div");t.style.display="contents",effect(()=>{let o=e.each,r=o();t.innerHTML="",r.forEach((i,l)=>{let s=e.children(i,l);s instanceof Node&&t.appendChild(s);});}),n.appendChild(t);}else e.each.forEach((o,r)=>{let i=e.children(o,r);i instanceof Node&&n.appendChild(i);});return n}
2
- export{q as ErrorBoundary,se as For,w as Fragment,le as Show,B as Suspense,ae as Switch,V as Teleport,S as cleanClassName,oe as component,ie as createElements,L as createPortal,K as createRoot,re as defineComponent,z as hydrate,J as isBrowser,y as jsx,te as jsxs,G as lazy,Z as minifyHTML,R as mount,f as normalizeString,W as onDOMReady,U as queueUpdate,p as render};//# sourceMappingURL=index.js.map
1
+ import {isSignal,effect}from'@minejs/signals';var x=[],y=false;function w(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 Be(e,n){return w(e,n,{mode:"replace"})}function pe(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 Ye(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 w(e,o,{mode:"replace"})}function Ge(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||he()}}function he(){let e=document.createElement("div");return e.textContent="Loading...",e}function qe(e){try{return e.children}catch(n){return e.fallback(n)}}function Ke(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 Ve(e){return pe(e.children,e.to)}function Ue(e){x.push(e),y||(y=true,queueMicrotask(ge));}function ge(){let e=x;x=[],y=false,e.forEach(n=>n());}function xe(){return typeof window<"u"&&typeof document<"u"}function Qe(e){xe()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e());}function Ze(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=w(o,n);},unmount(){t&&(t.unmount(),t=null);}}}function nn(e){return e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function h(e){return e.replace(/\s+/g," ").trim()}var j=[/^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 W(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<j.length;s++)if(j[s].test(l)){i=s;break}t.has(i)||(t.add(i),o.push(l));}return o.reverse().join(" ")}var ye={block:"block","inline-block":"inline-block",flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid"},we={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},Se={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Ee={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},$e={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"},be={0:"border-0",1:"border",2:"border-2",4:"border-4",8:"border-8"},Ce={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"},Me={none:"shadow-none",xs:"shadow-xs",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl",inner:"shadow-inner"};function d(e,n){if(n!==void 0)return `${e}-${n}`}function m(e,n){if(n!==void 0)return n==="auto"?`${e}-auto`:`${e}-${n}`}var F=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]),Le=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"]),Te=new Set(["auto","full","screen","min","max","fit"]),He=new Set(["auto","full","screen","min","max","fit"]),Ne=new Set(["0","full","min","max","fit"]),Xe=new Set(["none","full","min","max","fit"]),ve=new Set(["0","full","screen","min","max","fit"]),Je=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"&&F.has(n)?{class:`${e}-${n}`}:(e==="w"||e==="h")&&Le.has(n)?{class:`${e}-${n}`}:(e==="w"?Te:e==="h"?He:e==="min-w"?Ne:e==="min-h"?ve:e==="max-w"?Xe:Je).has(n)?{class:`${e}-${n}`}:["min-w","max-w","min-h","max-h"].includes(e)&&typeof n=="number"&&F.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}},I=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"]);function z(e){let{display:n,direction:t,align:o,justify:r,wrap:l,gap:i,gapX:s,gapY:a,w:p,h:q,minW:K,minH:V,maxW:U,maxH:Q,p:Z,px:ee,py:ne,ps:te,pe:oe,pt:re,pb:ie,m:se,mx:le,my:ae,ms:ce,me:de,mt:me,mb:fe,bg:C,color:M,border:L,borderColor:T,radius:H,shadow:N,position:ue,overflow:X,zIndex:v}=e,J=u("w",p),P=u("h",q),R=u("min-w",K),_=u("min-h",V),A=u("max-w",U,$e),D=u("max-h",Q),O={...J?.style,...P?.style,...R?.style,..._?.style,...A?.style,...D?.style};return {className:[n&&ye[n],t&&we[t],o&&Se[o],r&&Ee[r],l&&"flex-wrap",i!==void 0&&`gap-${i}`,s!==void 0&&`gap-x-${s}`,a!==void 0&&`gap-y-${a}`,J?.class,P?.class,R?.class,_?.class,A?.class,D?.class,d("p",Z),d("px",ee),d("py",ne),d("ps",te),d("pe",oe),d("pt",re),d("pb",ie),m("m",se),m("mx",le),m("my",ae),m("ms",ce),m("me",de),m("mt",me),m("mb",fe),C&&`bg-${C}`,M&&`text-${M}`,L!==void 0&&be[L],T&&`border-${T}`,H&&Ce[H],N&&Me[N],ue,X&&`overflow-${X}`,v&&`z-${v}`].filter(Boolean).join(" "),style:Object.keys(O).length>0?O:void 0}}function b(e,n){return typeof e=="function"?e(n||{}):Ae(e,n||{})}var an=b;function Y(e){let n=document.createDocumentFragment();return g(e.children).forEach(o=>{o instanceof Node&&n.appendChild(o);}),n}var k=false;function Pe(){if(k||typeof window>"u"||typeof MutationObserver>"u")return;k=true;let e=new MutationObserver(n=>{n.forEach(t=>{t.addedNodes.forEach(o=>{o instanceof Element&&Re(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 Re(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 S=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"]),E=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"]),G="http://www.w3.org/2000/svg",_e="http://www.w3.org/1998/Math/MathML";function Ae(e,n){let t;S.has(e)?t=document.createElementNS(G,e):E.has(e)?t=document.createElementNS(_e,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}=z(n);l&&!S.has(e)&&!E.has(e)&&$(t,l);let i=false;for(let[s,a]of Object.entries(n))if(!I.has(s)){if(s==="children")o||De(t,a);else if(s==="dangerouslySetInnerHTML")Ie(t,a);else if(s==="onload")t.__onload=a,t.setAttribute("data-mine-onload",""),Pe();else if(s==="ref")Oe(t,a);else if(s.startsWith("on"))je(t,s,a);else if(s==="id")We(t,a);else if(s==="className"||s==="class")i=true,B(t,a,r);else if(s==="style")Fe(t,a);else if(isSignal(a))ze(t,s,a);else if(typeof a=="boolean")a&&t.setAttribute(s,"");else if(a!=null)if(S.has(e)||E.has(e)){let p=typeof a=="string"?h(a):String(a);t.setAttribute(s,p);}else if(s in t)t[s]=a;else {let p=typeof a=="string"?h(a):String(a);t.setAttribute(s,p);}}return !i&&r&&B(t,r),t}function De(e,n){g(n).forEach(o=>{if(o instanceof Node)e.appendChild(o);else if(isSignal(o)){let r=document.createTextNode("");effect(()=>{r.textContent=String(o());}),e.appendChild(r);}else o!=null&&o!==false&&e.appendChild(document.createTextNode(String(o)));});}function g(e){return e==null||e===false?[]:Array.isArray(e)?e.flatMap(g):[e]}function Oe(e,n){isSignal(n)?n.set(e):typeof n=="function"&&n(e);}function je(e,n,t){if(typeof t!="function")return;let o=n.slice(2).toLowerCase();e.addEventListener(o,t);}function B(e,n,t=""){let o=r=>{let l=t?`${t} ${r}`:r,i=W(String(l));e.namespaceURI===G?e.setAttribute("class",i):e.className=i;};isSignal(n)?effect(()=>{let r=n();r!=null?o(String(r)):t&&o("");}):n!=null&&o(String(n));}function We(e,n){isSignal(n)?effect(()=>{let t=n();t!=null?e.id=String(t):e.removeAttribute("id");}):n!=null&&(e.id=String(n));}function Fe(e,n){isSignal(n)?effect(()=>{let t=n();$(e,t);}):$(e,n);}function $(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 Ie(e,n){if(n!=null&&typeof n=="object"&&"__html"in n){let t=n.__html;typeof t=="string"&&(e.innerHTML=t);}}function ze(e,n,t){effect(()=>{let o=t();if(o!=null)if(n in e)e[n]=o;else {let r=typeof o=="string"?h(o):String(o);e.setAttribute(n,r);}else e.removeAttribute(n);});}function cn(e){return e}function dn(e){return n=>e(n)()}function mn(e){let n=document.createDocumentFragment();return e.forEach(t=>{t instanceof Node&&n.appendChild(t);}),n}function fn(e){if(isSignal(e.when)){let n=document.createComment("show"),t=document.createDocumentFragment();t.appendChild(n);let o=null;return effect(()=>{let r=e.when,l=r();l&&!o?(o=g(e.children)[0],o instanceof Node&&n.parentNode?.insertBefore(o,n)):!l&&o&&(o.remove(),o=null);}),t}else return e.when?b(Y,{children:e.children}):null}function un(e){for(let n of e.children)if(isSignal(n.when)?n.when():n.when)return b(Y,{children:n.children});return null}function pn(e){let n=document.createDocumentFragment();if(isSignal(e.each)){let t=document.createElement("div");t.style.display="contents",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
+ export{qe as ErrorBoundary,pn as For,Y as Fragment,fn as Show,Ke as Suspense,un as Switch,Ve as Teleport,W as cleanClassName,cn as component,mn as createElements,pe as createPortal,Ze as createRoot,dn as defineComponent,Ye as hydrate,xe as isBrowser,b as jsx,an as jsxs,Ge as lazy,nn as minifyHTML,Be as mount,h as normalizeString,Qe as onDOMReady,Ue as queueUpdate,w as render};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map