@takumi-rs/helpers 2.9.1 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/html.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./utils-Bzz5Ln_B.cjs");var n=Symbol(`Fragment`),r=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),i=new Set([`script`,`style`]),a=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,o=64,s=46,c=45,l=58,u=95,d=61,f=34,p=39,m=92;function h(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===o||e===s||e===c||e===l||e===u}function g(e){let t={};if(e){let n=`none`,r,i=``,a;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(n===`none`)h(s)?(r&&(t[r]=i,r=void 0,i=``),a=o,n=`key`):s===d&&r&&(n=`value`);else if(n===`key`)h(s)||(r=e.substring(a,o),n=s===d?`value`:`none`);else if(s===f||s===p){let t=s===f?`"`:`'`,r=o+1,a=e.indexOf(t,r);for(;a>0&&e.charCodeAt(a-1)===m;)a=e.indexOf(t,a+1);if(a===-1)break;i=e.substring(r,a),o=a,n=`none`}}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function _(e){let t=typeof e==`string`?e:e.value,n,o,s,c,l,u,d,f,p,m=[];a.lastIndex=0,o=n={type:0,children:[]};let h=0;function _(){c=t.substring(h,a.lastIndex-s[0].length),c&&o.children.push({type:2,value:c,parent:o})}for(;s=a.exec(t);){if(u=s[5]||s[8],d=s[6]||s[9],f=s[7]||s[10],i.has(o.name)&&s[2]!==o.name){l=a.lastIndex-s[0].length,o.children.length>0&&(o.children[0].value+=s[0]);continue}else if(u===`<!--`){if(l=a.lastIndex-s[0].length,i.has(o.name))continue;p={type:3,value:d,parent:o,loc:[{start:l,end:l+u.length},{start:a.lastIndex-f.length,end:a.lastIndex}]},m.push(p),p.parent.children.push(p)}else if(u===`<!`)l=a.lastIndex-s[0].length,p={type:4,value:d,parent:o,loc:[{start:l,end:l+u.length},{start:a.lastIndex-f.length,end:a.lastIndex}]},m.push(p),p.parent.children.push(p);else if(s[1]!==`/`)if(_(),i.has(o.name)){h=a.lastIndex,_();continue}else p={type:1,name:s[2]+``,attributes:g(s[3]),parent:o,children:[],loc:[{start:a.lastIndex-s[0].length,end:a.lastIndex}]},m.push(p),p.parent.children.push(p),s[4]&&s[4].indexOf(`/`)>-1||r.has(p.name)?(p.loc[1]=p.loc[0],p.isSelfClosingTag=!0):o=p;else _(),s[2]+``===o.name?(p=o,o=p.parent,p.loc.push({start:a.lastIndex-s[0].length,end:a.lastIndex}),c=t.substring(p.loc[0].end,p.loc[1].start),p.children.length===0&&p.children.push({type:2,value:c,parent:o})):s[2]+``===m[m.length-1].name&&m[m.length-1].isSelfClosingTag===!0&&(p=m[m.length-1],p.loc.push({start:a.lastIndex-s[0].length,end:a.lastIndex}));h=a.lastIndex}return c=t.slice(h),o.children.push({type:2,value:c,parent:o}),n}var v=Symbol(`HTMLString`),y=Symbol(`RenderFn`);function b(e,t=[v]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var x={"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function S(e){return e.replace(/[&<>]/g,e=>x[e]||e)}function C(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return t}function w(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function T(e){let{name:t,attributes:i={}}=e,a=e.children.map(e=>E(e)).join(``);if(y in e){let t=e[y](i,b(a));return t&&t[v]?t.value:S(String(t))}if(t===n)return a;let o=w(e);return o||r.has(t)?`<${e.name}${C(i)}${o?` /`:``}>`:`<${e.name}${C(i)}>${a}</${e.name}>`}function E(e){switch(e.type){case 0:return e.children.map(e=>E(e)).join(``);case 1:return T(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const D={quot:`"`,amp:`&`,lt:`<`,gt:`>`,apos:`'`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`⟨`,rang:`⟩`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`};function O(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?k(Number(t))??e:n?k(Number.parseInt(n,16))??e:Object.hasOwn(D,r)?D[r]:e):e}function k(e){if(!(!Number.isInteger(e)||e<0||e>1114111)&&!(e>=55296&&e<=57343))try{return String.fromCodePoint(e)}catch{return}}function A(e,n){let r=_(e),i={nodes:[],stylesheets:[]},a=t.u(n?.defaultStyles),o=n?.tailwindClassesProperty??`tw`;for(let e of r.children)j(e,a,o,i.nodes,i.stylesheets);return i}function j(n,r,i,a,o){if(n.type===3)return;if(n.type===2){let t=O(n.value??``);t&&a.push(e.l({text:t,preset:r?.span}));return}if(n.type===0){for(let e of n.children)j(e,r,i,a,o);return}if(n.type!==1)return;let s=n;if(s.name===`style`){let e=``;for(let t of s.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&o.push(e);return}if(s.name===`head`){let e=[];for(let t of s.children)j(t,r,i,e,o);return}let c=M(s,r,i);if(s.name===`br`){a.push(e.l({text:`
2
- `,preset:r?.br,...c}));return}if(s.name===`img`){let t=s.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);a.push(e.i({src:t,width:I(s.attributes?.width),height:I(s.attributes?.height),...c}));return}if(t.i(s.name))return;if(s.name===`svg`){a.push(e.i({src:E(s),width:I(s.attributes?.width),height:I(s.attributes?.height),...c}));return}let l=!0,u=``;for(let e of s.children)if(e.type!==3){if(e.type!==2){l=!1;break}u+=e.value??``}if(l&&u){a.push(e.l({text:O(u),...c}));return}let d=[];for(let e of s.children)j(e,r,i,d,o);a.push(e.t({children:d,...c}))}function M(e,n,r){let i=e.attributes?N(e.attributes):{},a=typeof i.style==`string`?P(i.style):void 0,o=t.l(i,r),s=typeof i[r]==`string`?i[r]:void 0,c=n&&e.name in n?n[e.name]:void 0;return{tagName:e.name,className:i.class,id:i.id,dir:i.dir,lang:i.lang,attributes:o,tw:s,style:a,preset:c}}function N(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=O(r))}return t}function P(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[F(i)]=a)}return Object.keys(t).length>0?t:void 0}function F(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function I(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function L(t){let{nodes:n,stylesheets:r}=A(t);return n.length===0?{node:e.t({}),stylesheets:r}:n.length===1&&n[0]?{node:n[0],stylesheets:r}:{node:e.t({style:{width:e.a(100),height:e.a(100)},children:n}),stylesheets:r}}exports.fromHtml=L;
2
+ `,preset:r?.br,...c}));return}if(s.name===`img`){let t=s.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);a.push(e.i({src:t,width:I(s.attributes?.width),height:I(s.attributes?.height),...c}));return}if(t.i(s.name))return;if(s.name===`svg`){a.push(e.i({src:E(s),width:I(s.attributes?.width),height:I(s.attributes?.height),...c}));return}let l=!0,u=``;for(let e of s.children)if(e.type!==3){if(e.type!==2){l=!1;break}u+=e.value??``}if(l&&u){a.push(e.l({text:O(u),...c}));return}let d=[];for(let e of s.children)j(e,r,i,d,o);a.push(e.t({children:d,...c}))}function M(e,n,r){let i=e.attributes?N(e.attributes):{},a=typeof i.style==`string`?P(i.style):void 0,o=t.l(i,r),s=typeof i[r]==`string`?i[r]:void 0,c=n&&e.name in n?n[e.name]:void 0;return{tagName:e.name,className:i.class,id:i.id,dir:i.dir,lang:i.lang,attributes:o,tw:s,style:a,preset:c}}function N(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=O(r))}return t}function P(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[F(i)]=a)}return Object.keys(t).length>0?t:void 0}function F(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function I(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}const L=e=>`text`in e&&typeof e.text==`string`&&e.text.trim()===``;function R(t){let{nodes:n,stylesheets:r}=A(t);for(;n[0]&&L(n[0]);)n.shift();for(;n.at(-1)&&L(n.at(-1));)n.pop();return n.length===0?{node:e.t({}),stylesheets:r}:n.length===1&&n[0]?{node:n[0],stylesheets:r}:{node:e.t({style:{display:`block`,width:e.a(100),height:e.a(100)},children:n}),stylesheets:r}}exports.fromHtml=R;
package/dist/html.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { r as Node } from "./types-Bfi8SERZ.cjs";
2
- import "./index.cjs";
3
2
  //#region src/html/index.d.ts
4
3
  declare function fromHtml(html: string): {
5
4
  node: Node;
package/dist/html.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { r as Node } from "./types-Bfi8SERZ.mjs";
2
- import "./index.mjs";
3
2
  //#region src/html/index.d.ts
4
3
  declare function fromHtml(html: string): {
5
4
  node: Node;
package/dist/html.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  import{a as e,i as t,l as n,t as r}from"./helpers-CVQCT1Rh.mjs";import{i,l as a,u as o}from"./utils-Oamta0Qj.mjs";var s=Symbol(`Fragment`),c=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),l=new Set([`script`,`style`]),u=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,d=64,f=46,p=45,m=58,h=95,g=61,_=34,v=39,y=92;function b(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===d||e===f||e===p||e===m||e===h}function x(e){let t={};if(e){let n=`none`,r,i=``,a;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(n===`none`)b(s)?(r&&(t[r]=i,r=void 0,i=``),a=o,n=`key`):s===g&&r&&(n=`value`);else if(n===`key`)b(s)||(r=e.substring(a,o),n=s===g?`value`:`none`);else if(s===_||s===v){let t=s===_?`"`:`'`,r=o+1,a=e.indexOf(t,r);for(;a>0&&e.charCodeAt(a-1)===y;)a=e.indexOf(t,a+1);if(a===-1)break;i=e.substring(r,a),o=a,n=`none`}}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function S(e){let t=typeof e==`string`?e:e.value,n,r,i,a,o,s,d,f,p,m=[];u.lastIndex=0,r=n={type:0,children:[]};let h=0;function g(){a=t.substring(h,u.lastIndex-i[0].length),a&&r.children.push({type:2,value:a,parent:r})}for(;i=u.exec(t);){if(s=i[5]||i[8],d=i[6]||i[9],f=i[7]||i[10],l.has(r.name)&&i[2]!==r.name){o=u.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(s===`<!--`){if(o=u.lastIndex-i[0].length,l.has(r.name))continue;p={type:3,value:d,parent:r,loc:[{start:o,end:o+s.length},{start:u.lastIndex-f.length,end:u.lastIndex}]},m.push(p),p.parent.children.push(p)}else if(s===`<!`)o=u.lastIndex-i[0].length,p={type:4,value:d,parent:r,loc:[{start:o,end:o+s.length},{start:u.lastIndex-f.length,end:u.lastIndex}]},m.push(p),p.parent.children.push(p);else if(i[1]!==`/`)if(g(),l.has(r.name)){h=u.lastIndex,g();continue}else p={type:1,name:i[2]+``,attributes:x(i[3]),parent:r,children:[],loc:[{start:u.lastIndex-i[0].length,end:u.lastIndex}]},m.push(p),p.parent.children.push(p),i[4]&&i[4].indexOf(`/`)>-1||c.has(p.name)?(p.loc[1]=p.loc[0],p.isSelfClosingTag=!0):r=p;else g(),i[2]+``===r.name?(p=r,r=p.parent,p.loc.push({start:u.lastIndex-i[0].length,end:u.lastIndex}),a=t.substring(p.loc[0].end,p.loc[1].start),p.children.length===0&&p.children.push({type:2,value:a,parent:r})):i[2]+``===m[m.length-1].name&&m[m.length-1].isSelfClosingTag===!0&&(p=m[m.length-1],p.loc.push({start:u.lastIndex-i[0].length,end:u.lastIndex}));h=u.lastIndex}return a=t.slice(h),r.children.push({type:2,value:a,parent:r}),n}var C=Symbol(`HTMLString`),w=Symbol(`RenderFn`);function T(e,t=[C]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var E={"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function D(e){return e.replace(/[&<>]/g,e=>E[e]||e)}function O(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return t}function k(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function A(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>j(e)).join(``);if(w in e){let t=e[w](n,T(r));return t&&t[C]?t.value:D(String(t))}if(t===s)return r;let i=k(e);return i||c.has(t)?`<${e.name}${O(n)}${i?` /`:``}>`:`<${e.name}${O(n)}>${r}</${e.name}>`}function j(e){switch(e.type){case 0:return e.children.map(e=>j(e)).join(``);case 1:return A(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const M={quot:`"`,amp:`&`,lt:`<`,gt:`>`,apos:`'`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`⟨`,rang:`⟩`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`};function N(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?P(Number(t))??e:n?P(Number.parseInt(n,16))??e:Object.hasOwn(M,r)?M[r]:e):e}function P(e){if(!(!Number.isInteger(e)||e<0||e>1114111)&&!(e>=55296&&e<=57343))try{return String.fromCodePoint(e)}catch{return}}function F(e,t){let n=S(e),r={nodes:[],stylesheets:[]},i=o(t?.defaultStyles),a=t?.tailwindClassesProperty??`tw`;for(let e of n.children)I(e,i,a,r.nodes,r.stylesheets);return r}function I(e,a,o,s,c){if(e.type===3)return;if(e.type===2){let t=N(e.value??``);t&&s.push(n({text:t,preset:a?.span}));return}if(e.type===0){for(let t of e.children)I(t,a,o,s,c);return}if(e.type!==1)return;let l=e;if(l.name===`style`){let e=``;for(let t of l.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&c.push(e);return}if(l.name===`head`){let e=[];for(let t of l.children)I(t,a,o,e,c);return}let u=L(l,a,o);if(l.name===`br`){s.push(n({text:`
2
- `,preset:a?.br,...u}));return}if(l.name===`img`){let e=l.attributes?.src;if(!e)throw Error(`Image element must have a 'src' prop.`);s.push(t({src:e,width:V(l.attributes?.width),height:V(l.attributes?.height),...u}));return}if(i(l.name))return;if(l.name===`svg`){s.push(t({src:j(l),width:V(l.attributes?.width),height:V(l.attributes?.height),...u}));return}let d=!0,f=``;for(let e of l.children)if(e.type!==3){if(e.type!==2){d=!1;break}f+=e.value??``}if(d&&f){s.push(n({text:N(f),...u}));return}let p=[];for(let e of l.children)I(e,a,o,p,c);s.push(r({children:p,...u}))}function L(e,t,n){let r=e.attributes?R(e.attributes):{},i=typeof r.style==`string`?z(r.style):void 0,o=a(r,n),s=typeof r[n]==`string`?r[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:r.class,id:r.id,dir:r.dir,lang:r.lang,attributes:o,tw:s,style:i,preset:c}}function R(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=N(r))}return t}function z(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[B(i)]=a)}return Object.keys(t).length>0?t:void 0}function B(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function V(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function H(t){let{nodes:n,stylesheets:i}=F(t);return n.length===0?{node:r({}),stylesheets:i}:n.length===1&&n[0]?{node:n[0],stylesheets:i}:{node:r({style:{width:e(100),height:e(100)},children:n}),stylesheets:i}}export{H as fromHtml};
2
+ `,preset:a?.br,...u}));return}if(l.name===`img`){let e=l.attributes?.src;if(!e)throw Error(`Image element must have a 'src' prop.`);s.push(t({src:e,width:V(l.attributes?.width),height:V(l.attributes?.height),...u}));return}if(i(l.name))return;if(l.name===`svg`){s.push(t({src:j(l),width:V(l.attributes?.width),height:V(l.attributes?.height),...u}));return}let d=!0,f=``;for(let e of l.children)if(e.type!==3){if(e.type!==2){d=!1;break}f+=e.value??``}if(d&&f){s.push(n({text:N(f),...u}));return}let p=[];for(let e of l.children)I(e,a,o,p,c);s.push(r({children:p,...u}))}function L(e,t,n){let r=e.attributes?R(e.attributes):{},i=typeof r.style==`string`?z(r.style):void 0,o=a(r,n),s=typeof r[n]==`string`?r[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:r.class,id:r.id,dir:r.dir,lang:r.lang,attributes:o,tw:s,style:i,preset:c}}function R(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=N(r))}return t}function z(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[B(i)]=a)}return Object.keys(t).length>0?t:void 0}function B(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function V(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}const H=e=>`text`in e&&typeof e.text==`string`&&e.text.trim()===``;function U(t){let{nodes:n,stylesheets:i}=F(t);for(;n[0]&&H(n[0]);)n.shift();for(;n.at(-1)&&H(n.at(-1));)n.pop();return n.length===0?{node:r({}),stylesheets:i}:n.length===1&&n[0]?{node:n[0],stylesheets:i}:{node:r({style:{display:`block`,width:e(100),height:e(100)},children:n}),stylesheets:i}}export{U as fromHtml};
package/dist/jsx.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./utils-Bzz5Ln_B.cjs");let n;function r(e,t){return typeof e==`object`&&e&&t in e?e[t]:void 0}function i(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}function a(e){let t=r(e,`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`);if(typeof t==`object`&&t&&`H`in t){let e=t;return{get:()=>e.H,set:t=>{e.H=t}}}let n=r(r(e,`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`),`ReactCurrentDispatcher`);if(typeof n==`object`&&n&&`current`in n){let e=n;return{get:()=>e.current,set:t=>{e.current=t}}}return null}function o(){return n??=import(`react`).then(e=>a(e.default??e)).catch(()=>null),n}function s(e,t){return e.contexts.has(t)?e.contexts.get(t):r(t,`_currentValue`)}const c=()=>{};function l(e,t){let n=t=>s(e,t),r=0;return{readContext:n,useContext:n,use:e=>{if(i(e)){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:e}return n(e)},useState:e=>[typeof e==`function`?e():e,c],useReducer:(e,t,n)=>[n?n(t):t,c],useMemo:e=>e(),useCallback:e=>e,useRef:e=>({current:e}),useEffect:c,useLayoutEffect:c,useInsertionEffect:c,useImperativeHandle:c,useDebugValue:c,useDeferredValue:e=>e,useTransition:()=>[!1,c],useOptimistic:e=>[e,c],useActionState:(e,t)=>[t,c,!1],useSyncExternalStore:(e,t,n)=>(n??t)(),useId:()=>`:t${t}-${r++}:`,useCacheRefresh:()=>c,useHostTransitionStatus:()=>({pending:!1,data:null,method:null,action:null})}}async function u(e,t,n){let r=await o();if(!r)return e(t);let a=n.ids.current++;for(let o=0;;o++){let s=r.get();r.set(l(n,a));let c;try{return e(t)}catch(e){c=e}finally{r.set(s)}if(!i(c)||o>=64)throw c;await d(c)}}async function d(e){try{e.value=await e,e.status=`fulfilled`}catch(t){e.reason=t,e.status=`rejected`}}function f(e){return typeof e==`string`||typeof e==`number`}function p(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function m(e){let n=[];for(let r in e)Object.hasOwn(e,r)&&n.push(`${t.t(r)}:${String(e[r]).trim()}`);return n.join(`;`)}const h=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function g(e,n){if(e===`children`||n==null)return;let r;if(r=e===`className`?`class`:h.has(e)?t.t(e):e,typeof n==`boolean`)return`${r}="${String(n)}"`;if(e===`style`&&typeof n==`object`){let e=m(n);if(e)return`style="${p(e)}"`}return`${r}="${p(String(n))}"`}function _(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=g(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const v=(e,n,r)=>{let i=e.props||{};if(t.n(e.type)){y(e.type(e.props),n,!1);return}if(typeof e.type==`symbol`){y(i.children,n,!1);return}if(t.a(e.type)){y(e.type.render(e.props,null),n,!1);return}if(t.s(e.type)){v({...e,type:e.type.type},n,r);return}if(typeof e.type!=`string`)return;n.push(`<`,e.type),_(i,n,r&&e.type===`svg`);let a=i.children;n.push(`>`),y(a,n,!1),n.push(`</`,e.type,`>`)};function y(e,n,r){if(e!=null&&e!==!1){if(f(e)){n.push(String(e));return}if(Array.isArray(e)){for(let t of e)y(t,n,!1);return}t.c(e)&&v(e,n,r)}}function b(e){let t=[];return y(e,t,!0),t.join(``)}function x({width:e,height:t,data:n,premultiplied:r,...i}){return{type:`img`,props:{...i,src:{width:e,height:t,data:n,premultiplied:r}},key:null}}function S(){return{nodes:[],stylesheets:[]}}async function C(n,r){let i=await w(n,{defaultStyles:T(r),presets:t.u(r?.defaultStyles),tailwindClassesProperty:r?.tailwindClassesProperty??`tw`,contexts:new Map,ids:{current:0}}),a=i.nodes,o;return o=a.length===0?e.t({}):a.length===1&&a[0]!==void 0?a[0]:e.t({children:a,style:{width:e.a(100),height:e.a(100)}}),{node:o,stylesheets:i.stylesheets}}async function w(n,r){return n==null||n===!1?S():n instanceof Promise?w(await n,r):typeof n==`object`&&Symbol.iterator in n?K(n,r):t.c(n)?await z(n,r):{nodes:[e.l({text:String(n),preset:r.presets?.span})],stylesheets:[]}}function T(e){return e&&`defaultStyles`in e?e.defaultStyles??t.d:t.d}const E=Symbol.for(`react.context`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.consumer`);function k(e,t){let n=e.type;if(typeof n!=`object`||!n)return;let i=r(n,`$$typeof`);if(i===D)return A(e,r(n,`_context`),t);if(i===O)return j(e,r(n,`_context`)??n,t);if(i===E)return typeof P(e)==`function`?j(e,n,t):A(e,n,t)}function A(e,t,n){let i=new Map(n.contexts);return i.set(t,r(e.props,`value`)),G(e,{...n,contexts:i})}function j(e,n,r){let i=P(e);return t.n(i)?w(i(s(r,n)),r):G(e,r)}async function M(e,t,n){return w(await u(e,t,n),n)}function N(e,n){if(t.a(e.type)){let{render:t}=e.type;return M(e=>t(e,null),e.props,n)}if(t.s(e.type)){let r=e.type.type;return t.n(r)?M(r,e.props,n):z({...e,type:r},n)}}function P(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function F(e){if(!t.c(e))return;let n=P(e);if(typeof n==`string`)return n;if(typeof n==`number`)return String(n);if(Array.isArray(n)||typeof n==`object`&&n&&Symbol.iterator in n)return R(n);if(t.c(n)&&t.o(n))return F(n)}function I(e){let t=[];for(let n of e){let e=L(n);if(e===void 0)return;t.push(e)}return t.join(``)}function L(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return I(e);if(!t.c(e))return;if(t.o(e))return L(P(e));let n=P(e);return n===void 0?``:typeof n==`object`&&n&&Symbol.iterator in n?I(n):L(n)}function R(e){let n=[],r=!1;for(let i of e){if(t.c(i))return;if(typeof i==`string`){r=!0,n.push(i);continue}if(typeof i==`number`){r=!0,n.push(String(i));continue}return}if(r)return n.join(``)}async function z(n,r){let i=k(n,r);if(i!==void 0)return i;if(t.n(n.type))return M(n.type,n.props,r);let a=N(n,r);if(a!==void 0)return a;if(t.o(n))return G(n,r);if(t.r(n,`style`)){let e=L(P(n));return{nodes:[],stylesheets:e&&e.length>0?[e]:[]}}if(t.r(n,`head`))return{nodes:[],stylesheets:(await G(n,r)).stylesheets};if(typeof n.type!=`string`||t.i(n.type))return S();let o=W(n,r);if(t.r(n,`br`))return{nodes:[e.l({text:`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./utils-Bzz5Ln_B.cjs");let n;function r(e,t){return typeof e==`object`&&e&&t in e?e[t]:void 0}function i(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}function a(e){let t=r(e,`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`);if(typeof t==`object`&&t&&`H`in t){let e=t;return{get:()=>e.H,set:t=>{e.H=t}}}let n=r(r(e,`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`),`ReactCurrentDispatcher`);if(typeof n==`object`&&n&&`current`in n){let e=n;return{get:()=>e.current,set:t=>{e.current=t}}}return null}function o(){return n??=import(`react`).then(e=>a(e.default??e)).catch(()=>null),n}function s(e,t){return e.contexts.has(t)?e.contexts.get(t):r(t,`_currentValue`)}const c=()=>{};function l(e,t){let n=t=>s(e,t),r=0;return{readContext:n,useContext:n,use:e=>{if(i(e)){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:e}return n(e)},useState:e=>[typeof e==`function`?e():e,c],useReducer:(e,t,n)=>[n?n(t):t,c],useMemo:e=>e(),useCallback:e=>e,useRef:e=>({current:e}),useEffect:c,useLayoutEffect:c,useInsertionEffect:c,useImperativeHandle:c,useDebugValue:c,useDeferredValue:e=>e,useTransition:()=>[!1,c],useOptimistic:e=>[e,c],useActionState:(e,t)=>[t,c,!1],useSyncExternalStore:(e,t,n)=>(n??t)(),useId:()=>`:t${t}-${r++}:`,useCacheRefresh:()=>c,useHostTransitionStatus:()=>({pending:!1,data:null,method:null,action:null})}}async function u(e,t,n){let r=await o();if(!r)return e(t);let a=n.ids.current++;for(let o=0;;o++){let s=r.get();r.set(l(n,a));let c;try{return e(t)}catch(e){c=e}finally{r.set(s)}if(!i(c)||o>=64)throw c;await d(c)}}async function d(e){try{e.value=await e,e.status=`fulfilled`}catch(t){e.reason=t,e.status=`rejected`}}function f(e){return typeof e==`string`||typeof e==`number`}function p(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function m(e){let n=[];for(let r in e)Object.hasOwn(e,r)&&n.push(`${t.t(r)}:${String(e[r]).trim()}`);return n.join(`;`)}const h=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function g(e,n){if(e===`children`||n==null)return;let r;if(r=e===`className`?`class`:h.has(e)?t.t(e):e,typeof n==`boolean`)return`${r}="${String(n)}"`;if(e===`style`&&typeof n==`object`){let e=m(n);if(e)return`style="${p(e)}"`}return`${r}="${p(String(n))}"`}function _(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=g(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const v=(e,n,r)=>{let i=e.props||{};if(t.n(e.type)){y(e.type(e.props),n,!1);return}if(typeof e.type==`symbol`){y(i.children,n,!1);return}if(t.a(e.type)){y(e.type.render(e.props,null),n,!1);return}if(t.s(e.type)){v({...e,type:e.type.type},n,r);return}if(typeof e.type!=`string`)return;n.push(`<`,e.type),_(i,n,r&&e.type===`svg`);let a=i.children;n.push(`>`),y(a,n,!1),n.push(`</`,e.type,`>`)};function y(e,n,r){if(e!=null&&e!==!1){if(f(e)){n.push(String(e));return}if(Array.isArray(e)){for(let t of e)y(t,n,!1);return}t.c(e)&&v(e,n,r)}}function b(e){let t=[];return y(e,t,!0),t.join(``)}function x({width:e,height:t,data:n,premultiplied:r,...i}){return{type:`img`,props:{...i,src:{width:e,height:t,data:n,premultiplied:r}},key:null}}function S(){return{nodes:[],stylesheets:[]}}async function C(n,r){let i=await w(n,{defaultStyles:T(r),presets:t.u(r?.defaultStyles),tailwindClassesProperty:r?.tailwindClassesProperty??`tw`,contexts:new Map,ids:{current:0}}),a=i.nodes,o;return o=a.length===0?e.t({}):a.length===1&&a[0]!==void 0?a[0]:e.t({children:a,style:{display:`block`,width:e.a(100),height:e.a(100)}}),{node:o,stylesheets:i.stylesheets}}async function w(n,r){return n==null||n===!1?S():n instanceof Promise?w(await n,r):typeof n==`object`&&Symbol.iterator in n?K(n,r):t.c(n)?await z(n,r):{nodes:[e.l({text:String(n),preset:r.presets?.span})],stylesheets:[]}}function T(e){return e&&`defaultStyles`in e?e.defaultStyles??t.d:t.d}const E=Symbol.for(`react.context`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.consumer`);function k(e,t){let n=e.type;if(typeof n!=`object`||!n)return;let i=r(n,`$$typeof`);if(i===D)return A(e,r(n,`_context`),t);if(i===O)return j(e,r(n,`_context`)??n,t);if(i===E)return typeof P(e)==`function`?j(e,n,t):A(e,n,t)}function A(e,t,n){let i=new Map(n.contexts);return i.set(t,r(e.props,`value`)),G(e,{...n,contexts:i})}function j(e,n,r){let i=P(e);return t.n(i)?w(i(s(r,n)),r):G(e,r)}async function M(e,t,n){return w(await u(e,t,n),n)}function N(e,n){if(t.a(e.type)){let{render:t}=e.type;return M(e=>t(e,null),e.props,n)}if(t.s(e.type)){let r=e.type.type;return t.n(r)?M(r,e.props,n):z({...e,type:r},n)}}function P(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function F(e){if(!t.c(e))return;let n=P(e);if(typeof n==`string`)return n;if(typeof n==`number`)return String(n);if(Array.isArray(n)||typeof n==`object`&&n&&Symbol.iterator in n)return R(n);if(t.c(n)&&t.o(n))return F(n)}function I(e){let t=[];for(let n of e){let e=L(n);if(e===void 0)return;t.push(e)}return t.join(``)}function L(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return I(e);if(!t.c(e))return;if(t.o(e))return L(P(e));let n=P(e);return n===void 0?``:typeof n==`object`&&n&&Symbol.iterator in n?I(n):L(n)}function R(e){let n=[],r=!1;for(let i of e){if(t.c(i))return;if(typeof i==`string`){r=!0,n.push(i);continue}if(typeof i==`number`){r=!0,n.push(String(i));continue}return}if(r)return n.join(``)}async function z(n,r){let i=k(n,r);if(i!==void 0)return i;if(t.n(n.type))return M(n.type,n.props,r);let a=N(n,r);if(a!==void 0)return a;if(t.o(n))return G(n,r);if(t.r(n,`style`)){let e=L(P(n));return{nodes:[],stylesheets:e&&e.length>0?[e]:[]}}if(t.r(n,`head`))return{nodes:[],stylesheets:(await G(n,r)).stylesheets};if(typeof n.type!=`string`||t.i(n.type))return S();let o=W(n,r);if(t.r(n,`br`))return{nodes:[e.l({text:`
2
2
  `,preset:r.presets?.br,...o})],stylesheets:[]};if(t.r(n,`img`))return{nodes:[B(n,r)],stylesheets:[]};if(t.r(n,`svg`))return{nodes:[V(n,r)],stylesheets:[]};let s=F(n);if(s!==void 0)return{nodes:[e.l({text:s,...o})],stylesheets:[]};let c=await G(n,r);return{nodes:[e.t({children:c.nodes,...o})],stylesheets:c.stylesheets}}function B(t,n){if(!t.props.src)throw Error(`Image element must have a 'src' prop.`);let r=W(t,n),i=t.props.width===void 0?void 0:Number(t.props.width),a=t.props.height===void 0?void 0:Number(t.props.height);return e.i({src:t.props.src,width:i,height:a,...r})}function V(t,n){let r=W(t,n);return e.i({src:b(t),width:t.props.width===void 0?void 0:Number(t.props.width),height:t.props.height===void 0?void 0:Number(t.props.height),...r})}function H(e,t){let n=t.presets,r=n&&typeof e.type==`string`&&e.type in n?n[e.type]:void 0,i=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(!i)return{preset:r};for(let e in i)if(Object.hasOwn(i,e))return{preset:r,style:i};return{preset:r}}function U(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function W(e,n){let r=e.props,{preset:i,style:a}=H(e,n),o=U(e,n),s=t.l(r,n.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:r.className??r.class,id:r.id,dir:r.dir,lang:r.lang,attributes:s,tw:o,style:a,preset:i}}function G(e,t){let n=P(e);return n===void 0?Promise.resolve(S()):w(n,t)}async function K(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=w(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}exports.Bitmap=x,exports.defaultStylePresets=t.d,exports.fromJsx=C;
package/dist/jsx.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{a as e,i as t,l as n,t as r}from"./helpers-CVQCT1Rh.mjs";import{a as i,c as a,d as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p,u as m}from"./utils-Oamta0Qj.mjs";let h;function g(e,t){return typeof e==`object`&&e&&t in e?e[t]:void 0}function _(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}function v(e){let t=g(e,`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`);if(typeof t==`object`&&t&&`H`in t){let e=t;return{get:()=>e.H,set:t=>{e.H=t}}}let n=g(g(e,`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`),`ReactCurrentDispatcher`);if(typeof n==`object`&&n&&`current`in n){let e=n;return{get:()=>e.current,set:t=>{e.current=t}}}return null}function y(){return h??=import(`react`).then(e=>v(e.default??e)).catch(()=>null),h}function b(e,t){return e.contexts.has(t)?e.contexts.get(t):g(t,`_currentValue`)}const x=()=>{};function ee(e,t){let n=t=>b(e,t),r=0;return{readContext:n,useContext:n,use:e=>{if(_(e)){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:e}return n(e)},useState:e=>[typeof e==`function`?e():e,x],useReducer:(e,t,n)=>[n?n(t):t,x],useMemo:e=>e(),useCallback:e=>e,useRef:e=>({current:e}),useEffect:x,useLayoutEffect:x,useInsertionEffect:x,useImperativeHandle:x,useDebugValue:x,useDeferredValue:e=>e,useTransition:()=>[!1,x],useOptimistic:e=>[e,x],useActionState:(e,t)=>[t,x,!1],useSyncExternalStore:(e,t,n)=>(n??t)(),useId:()=>`:t${t}-${r++}:`,useCacheRefresh:()=>x,useHostTransitionStatus:()=>({pending:!1,data:null,method:null,action:null})}}async function te(e,t,n){let r=await y();if(!r)return e(t);let i=n.ids.current++;for(let a=0;;a++){let o=r.get();r.set(ee(n,i));let s;try{return e(t)}catch(e){s=e}finally{r.set(o)}if(!_(s)||a>=64)throw s;await S(s)}}async function S(e){try{e.value=await e,e.status=`fulfilled`}catch(t){e.reason=t,e.status=`rejected`}}function C(e){return typeof e==`string`||typeof e==`number`}function w(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function T(e){let t=[];for(let n in e)Object.hasOwn(e,n)&&t.push(`${p(n)}:${String(e[n]).trim()}`);return t.join(`;`)}const E=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function D(e,t){if(e===`children`||t==null)return;let n;if(n=e===`className`?`class`:E.has(e)?p(e):e,typeof t==`boolean`)return`${n}="${String(t)}"`;if(e===`style`&&typeof t==`object`){let e=T(t);if(e)return`style="${w(e)}"`}return`${n}="${w(String(t))}"`}function O(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=D(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const k=(e,t,n)=>{let r=e.props||{};if(l(e.type)){A(e.type(e.props),t,!1);return}if(typeof e.type==`symbol`){A(r.children,t,!1);return}if(i(e.type)){A(e.type.render(e.props,null),t,!1);return}if(f(e.type)){k({...e,type:e.type.type},t,n);return}if(typeof e.type!=`string`)return;t.push(`<`,e.type),O(r,t,n&&e.type===`svg`);let a=r.children;t.push(`>`),A(a,t,!1),t.push(`</`,e.type,`>`)};function A(e,t,n){if(e!=null&&e!==!1){if(C(e)){t.push(String(e));return}if(Array.isArray(e)){for(let n of e)A(n,t,!1);return}a(e)&&k(e,t,n)}}function j(e){let t=[];return A(e,t,!0),t.join(``)}function M({width:e,height:t,data:n,premultiplied:r,...i}){return{type:`img`,props:{...i,src:{width:e,height:t,data:n,premultiplied:r}},key:null}}function N(){return{nodes:[],stylesheets:[]}}async function P(t,n){let i=await F(t,{defaultStyles:I(n),presets:m(n?.defaultStyles),tailwindClassesProperty:n?.tailwindClassesProperty??`tw`,contexts:new Map,ids:{current:0}}),a=i.nodes,o;return o=a.length===0?r({}):a.length===1&&a[0]!==void 0?a[0]:r({children:a,style:{width:e(100),height:e(100)}}),{node:o,stylesheets:i.stylesheets}}async function F(e,t){return e==null||e===!1?N():e instanceof Promise?F(await e,t):typeof e==`object`&&Symbol.iterator in e?ae(e,t):a(e)?await X(e,t):{nodes:[n({text:String(e),preset:t.presets?.span})],stylesheets:[]}}function I(e){return e&&`defaultStyles`in e?e.defaultStyles??o:o}const L=Symbol.for(`react.context`),R=Symbol.for(`react.provider`),z=Symbol.for(`react.consumer`);function B(e,t){let n=e.type;if(typeof n!=`object`||!n)return;let r=g(n,`$$typeof`);if(r===R)return V(e,g(n,`_context`),t);if(r===z)return H(e,g(n,`_context`)??n,t);if(r===L)return typeof G(e)==`function`?H(e,n,t):V(e,n,t)}function V(e,t,n){let r=new Map(n.contexts);return r.set(t,g(e.props,`value`)),$(e,{...n,contexts:r})}function H(e,t,n){let r=G(e);return l(r)?F(r(b(n,t)),n):$(e,n)}async function U(e,t,n){return F(await te(e,t,n),n)}function W(e,t){if(i(e.type)){let{render:n}=e.type;return U(e=>n(e,null),e.props,t)}if(f(e.type)){let n=e.type.type;return l(n)?U(n,e.props,t):X({...e,type:n},t)}}function G(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function K(e){if(!a(e))return;let t=G(e);if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(Array.isArray(t)||typeof t==`object`&&t&&Symbol.iterator in t)return Y(t);if(a(t)&&u(t))return K(t)}function q(e){let t=[];for(let n of e){let e=J(n);if(e===void 0)return;t.push(e)}return t.join(``)}function J(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return q(e);if(!a(e))return;if(u(e))return J(G(e));let t=G(e);return t===void 0?``:typeof t==`object`&&t&&Symbol.iterator in t?q(t):J(t)}function Y(e){let t=[],n=!1;for(let r of e){if(a(r))return;if(typeof r==`string`){n=!0,t.push(r);continue}if(typeof r==`number`){n=!0,t.push(String(r));continue}return}if(n)return t.join(``)}async function X(e,t){let i=B(e,t);if(i!==void 0)return i;if(l(e.type))return U(e.type,e.props,t);let a=W(e,t);if(a!==void 0)return a;if(u(e))return $(e,t);if(d(e,`style`)){let t=J(G(e));return{nodes:[],stylesheets:t&&t.length>0?[t]:[]}}if(d(e,`head`))return{nodes:[],stylesheets:(await $(e,t)).stylesheets};if(typeof e.type!=`string`||s(e.type))return N();let o=Q(e,t);if(d(e,`br`))return{nodes:[n({text:`
1
+ import{a as e,i as t,l as n,t as r}from"./helpers-CVQCT1Rh.mjs";import{a as i,c as a,d as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p,u as m}from"./utils-Oamta0Qj.mjs";let h;function g(e,t){return typeof e==`object`&&e&&t in e?e[t]:void 0}function _(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}function v(e){let t=g(e,`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`);if(typeof t==`object`&&t&&`H`in t){let e=t;return{get:()=>e.H,set:t=>{e.H=t}}}let n=g(g(e,`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`),`ReactCurrentDispatcher`);if(typeof n==`object`&&n&&`current`in n){let e=n;return{get:()=>e.current,set:t=>{e.current=t}}}return null}function y(){return h??=import(`react`).then(e=>v(e.default??e)).catch(()=>null),h}function b(e,t){return e.contexts.has(t)?e.contexts.get(t):g(t,`_currentValue`)}const x=()=>{};function ee(e,t){let n=t=>b(e,t),r=0;return{readContext:n,useContext:n,use:e=>{if(_(e)){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:e}return n(e)},useState:e=>[typeof e==`function`?e():e,x],useReducer:(e,t,n)=>[n?n(t):t,x],useMemo:e=>e(),useCallback:e=>e,useRef:e=>({current:e}),useEffect:x,useLayoutEffect:x,useInsertionEffect:x,useImperativeHandle:x,useDebugValue:x,useDeferredValue:e=>e,useTransition:()=>[!1,x],useOptimistic:e=>[e,x],useActionState:(e,t)=>[t,x,!1],useSyncExternalStore:(e,t,n)=>(n??t)(),useId:()=>`:t${t}-${r++}:`,useCacheRefresh:()=>x,useHostTransitionStatus:()=>({pending:!1,data:null,method:null,action:null})}}async function te(e,t,n){let r=await y();if(!r)return e(t);let i=n.ids.current++;for(let a=0;;a++){let o=r.get();r.set(ee(n,i));let s;try{return e(t)}catch(e){s=e}finally{r.set(o)}if(!_(s)||a>=64)throw s;await S(s)}}async function S(e){try{e.value=await e,e.status=`fulfilled`}catch(t){e.reason=t,e.status=`rejected`}}function C(e){return typeof e==`string`||typeof e==`number`}function w(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function T(e){let t=[];for(let n in e)Object.hasOwn(e,n)&&t.push(`${p(n)}:${String(e[n]).trim()}`);return t.join(`;`)}const E=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function D(e,t){if(e===`children`||t==null)return;let n;if(n=e===`className`?`class`:E.has(e)?p(e):e,typeof t==`boolean`)return`${n}="${String(t)}"`;if(e===`style`&&typeof t==`object`){let e=T(t);if(e)return`style="${w(e)}"`}return`${n}="${w(String(t))}"`}function O(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=D(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const k=(e,t,n)=>{let r=e.props||{};if(l(e.type)){A(e.type(e.props),t,!1);return}if(typeof e.type==`symbol`){A(r.children,t,!1);return}if(i(e.type)){A(e.type.render(e.props,null),t,!1);return}if(f(e.type)){k({...e,type:e.type.type},t,n);return}if(typeof e.type!=`string`)return;t.push(`<`,e.type),O(r,t,n&&e.type===`svg`);let a=r.children;t.push(`>`),A(a,t,!1),t.push(`</`,e.type,`>`)};function A(e,t,n){if(e!=null&&e!==!1){if(C(e)){t.push(String(e));return}if(Array.isArray(e)){for(let n of e)A(n,t,!1);return}a(e)&&k(e,t,n)}}function j(e){let t=[];return A(e,t,!0),t.join(``)}function M({width:e,height:t,data:n,premultiplied:r,...i}){return{type:`img`,props:{...i,src:{width:e,height:t,data:n,premultiplied:r}},key:null}}function N(){return{nodes:[],stylesheets:[]}}async function P(t,n){let i=await F(t,{defaultStyles:I(n),presets:m(n?.defaultStyles),tailwindClassesProperty:n?.tailwindClassesProperty??`tw`,contexts:new Map,ids:{current:0}}),a=i.nodes,o;return o=a.length===0?r({}):a.length===1&&a[0]!==void 0?a[0]:r({children:a,style:{display:`block`,width:e(100),height:e(100)}}),{node:o,stylesheets:i.stylesheets}}async function F(e,t){return e==null||e===!1?N():e instanceof Promise?F(await e,t):typeof e==`object`&&Symbol.iterator in e?ae(e,t):a(e)?await X(e,t):{nodes:[n({text:String(e),preset:t.presets?.span})],stylesheets:[]}}function I(e){return e&&`defaultStyles`in e?e.defaultStyles??o:o}const L=Symbol.for(`react.context`),R=Symbol.for(`react.provider`),z=Symbol.for(`react.consumer`);function B(e,t){let n=e.type;if(typeof n!=`object`||!n)return;let r=g(n,`$$typeof`);if(r===R)return V(e,g(n,`_context`),t);if(r===z)return H(e,g(n,`_context`)??n,t);if(r===L)return typeof G(e)==`function`?H(e,n,t):V(e,n,t)}function V(e,t,n){let r=new Map(n.contexts);return r.set(t,g(e.props,`value`)),$(e,{...n,contexts:r})}function H(e,t,n){let r=G(e);return l(r)?F(r(b(n,t)),n):$(e,n)}async function U(e,t,n){return F(await te(e,t,n),n)}function W(e,t){if(i(e.type)){let{render:n}=e.type;return U(e=>n(e,null),e.props,t)}if(f(e.type)){let n=e.type.type;return l(n)?U(n,e.props,t):X({...e,type:n},t)}}function G(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function K(e){if(!a(e))return;let t=G(e);if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(Array.isArray(t)||typeof t==`object`&&t&&Symbol.iterator in t)return Y(t);if(a(t)&&u(t))return K(t)}function q(e){let t=[];for(let n of e){let e=J(n);if(e===void 0)return;t.push(e)}return t.join(``)}function J(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return q(e);if(!a(e))return;if(u(e))return J(G(e));let t=G(e);return t===void 0?``:typeof t==`object`&&t&&Symbol.iterator in t?q(t):J(t)}function Y(e){let t=[],n=!1;for(let r of e){if(a(r))return;if(typeof r==`string`){n=!0,t.push(r);continue}if(typeof r==`number`){n=!0,t.push(String(r));continue}return}if(n)return t.join(``)}async function X(e,t){let i=B(e,t);if(i!==void 0)return i;if(l(e.type))return U(e.type,e.props,t);let a=W(e,t);if(a!==void 0)return a;if(u(e))return $(e,t);if(d(e,`style`)){let t=J(G(e));return{nodes:[],stylesheets:t&&t.length>0?[t]:[]}}if(d(e,`head`))return{nodes:[],stylesheets:(await $(e,t)).stylesheets};if(typeof e.type!=`string`||s(e.type))return N();let o=Q(e,t);if(d(e,`br`))return{nodes:[n({text:`
2
2
  `,preset:t.presets?.br,...o})],stylesheets:[]};if(d(e,`img`))return{nodes:[Z(e,t)],stylesheets:[]};if(d(e,`svg`))return{nodes:[ne(e,t)],stylesheets:[]};let c=K(e);if(c!==void 0)return{nodes:[n({text:c,...o})],stylesheets:[]};let f=await $(e,t);return{nodes:[r({children:f.nodes,...o})],stylesheets:f.stylesheets}}function Z(e,n){if(!e.props.src)throw Error(`Image element must have a 'src' prop.`);let r=Q(e,n),i=e.props.width===void 0?void 0:Number(e.props.width),a=e.props.height===void 0?void 0:Number(e.props.height);return t({src:e.props.src,width:i,height:a,...r})}function ne(e,n){let r=Q(e,n);return t({src:j(e),width:e.props.width===void 0?void 0:Number(e.props.width),height:e.props.height===void 0?void 0:Number(e.props.height),...r})}function re(e,t){let n=t.presets,r=n&&typeof e.type==`string`&&e.type in n?n[e.type]:void 0,i=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(!i)return{preset:r};for(let e in i)if(Object.hasOwn(i,e))return{preset:r,style:i};return{preset:r}}function ie(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function Q(e,t){let n=e.props,{preset:r,style:i}=re(e,t),a=ie(e,t),o=c(n,t.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:n.className??n.class,id:n.id,dir:n.dir,lang:n.lang,attributes:o,tw:a,style:i,preset:r}}function $(e,t){let n=G(e);return n===void 0?Promise.resolve(N()):F(n,t)}async function ae(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=F(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}export{M as Bitmap,o as defaultStylePresets,P as fromJsx};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/helpers",
3
- "version": "2.9.1",
3
+ "version": "2.9.2",
4
4
  "description": "Convert JSX and HTML to Takumi node trees. Load fonts and emoji.",
5
5
  "keywords": [
6
6
  "emoji",