satori 0.0.8-beta.1 → 0.0.8-beta.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/esm/index.js CHANGED
@@ -1 +1 @@
1
- var st=Object.defineProperty,ft=Object.defineProperties;var ut=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable;var K=(t,r,e)=>r in t?st(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,L=(t,r)=>{for(var e in r||(r={}))lt.call(r,e)&&K(t,e,r[e]);if(q)for(var e of q(r))mt.call(r,e)&&K(t,e,r[e]);return t},Q=(t,r)=>ft(t,ut(r));var Z;function ct(t){Z=t}var i=Z;function v(t){let r=typeof t;return!(r==="number"||r==="bigint"||r==="string"||r==="boolean")}function tt(t){return/^class\s/.test(Function.prototype.toString.call(t))}function A(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}var et={p:{display:"block",marginTop:"1em",marginBottom:"1em"},div:{display:"block"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:"block",textAlign:"center"},hr:{display:"block",marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"inset"},h1:{display:"block",fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:"block",fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:"block",fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:"block",marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:"block",fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:"block",fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var dt=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textAlign","textTransform","whiteSpace","letterSpacing","transform","opacity"]);function D(t){let r={};for(let e in t)dt.has(e)&&(r[e]=t[e]);return r}import pt,{getPropertyName as gt}from"css-to-react-native";import ot from"parse-css-dimension";import{parseElementStyle as ht}from"css-background-parser";var bt=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),nt=[1,0,0,1,0,0];function yt(t,r){return typeof r=="number"?bt.has(t)?String(r):r+"px":r}function rt(t,r){if(typeof t=="number")return t;try{let e=new ot(t);if(e.type==="length")switch(e.unit){case"em":return e.value*r;case"rem":return e.value*16;default:return e.value}else if(e.type==="angle")switch(e.unit){case"deg":return e.value;case"rad":return e.value*180/Math.PI;default:return e.value}}catch{}}function P(t,r){let e=[];for(let n in t){let a=gt(n);e.push([a,yt(a,t[n])])}let o=pt(e);if(o.backgroundImage){let{backgrounds:n}=ht(o);o.backgroundImage=n}let f=o.fontSize||r.fontSize;if(typeof f=="string")try{let n=new ot(f);switch(n.unit){case"em":f=n.value*r.fontSize;break;case"rem":f=n.value*16;break}}catch{f=16}o.fontSize=f;for(let n in o){let a=o[n];if(typeof a=="string"){let s=rt(a,f);typeof s!="undefined"&&(o[n]=s),a=o[n]}if(n==="opacity"&&(a=o[n]=a*r.opacity),n==="transform"){let s=[...nt],l=a;for(let u of l){let d=Object.keys(u)[0],p=u[d],c=typeof p=="string"?rt(p,f):p,m=[...nt];switch(d){case"translateX":m[4]=c;break;case"translateY":m[5]=c;break;case"scaleX":m[0]=c;break;case"scaleY":m[3]=c;break;case"rotate":let E=c*Math.PI/180,g=Math.cos(E),h=Math.sin(E);m[0]=g,m[1]=h,m[2]=-h,m[3]=g;break;case"skewX":m[2]=Math.tan(c*Math.PI/180);break;case"skewY":m[1]=Math.tan(c*Math.PI/180);break}s=A(m,s)}o.transform=s}}return o}function x(t,r,e){let o=r[t];return typeof o=="undefined"?e:o}function M(t,r,e,o,f){let n=L(L(L({},e),P(et[r],e)),P(o,e));if(r==="img"){let a=parseInt(f.width),l=parseInt(f.height)/a;n.width||(n.width=a),n.height||(n.height=l*n.width)}return t.setDisplay(x(n.display,{flex:i.DISPLAY_FLEX,none:i.DISPLAY_NONE},i.DISPLAY_FLEX)),t.setAlignContent(x(n.alignContent,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,"space-between":i.ALIGN_SPACE_BETWEEN,"space-around":i.ALIGN_SPACE_AROUND,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_AUTO)),t.setAlignItems(x(n.alignItems,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_FLEX_START)),t.setAlignSelf(x(n.alignSelf,{stretch:i.ALIGN_STRETCH,center:i.ALIGN_CENTER,"flex-start":i.ALIGN_FLEX_START,"flex-end":i.ALIGN_FLEX_END,baseline:i.ALIGN_BASELINE,normal:i.ALIGN_AUTO},i.ALIGN_AUTO)),t.setJustifyContent(x(n.justifyContent,{center:i.JUSTIFY_CENTER,"flex-start":i.JUSTIFY_FLEX_START,"flex-end":i.JUSTIFY_FLEX_END,"space-between":i.JUSTIFY_SPACE_BETWEEN,"space-around":i.JUSTIFY_SPACE_AROUND},i.JUSTIFY_FLEX_START)),t.setFlexDirection(x(n.flexDirection,{row:i.FLEX_DIRECTION_ROW,column:i.FLEX_DIRECTION_COLUMN,"row-reverse":i.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":i.FLEX_DIRECTION_COLUMN_REVERSE},i.FLEX_DIRECTION_ROW)),t.setFlexWrap(x(n.flexWrap,{wrap:i.WRAP_WRAP,nowrap:i.WRAP_NO_WRAP,"wrap-reverse":i.WRAP_WRAP_REVERSE},i.WRAP_WRAP)),typeof n.flexBasis!="undefined"&&t.setFlexBasis(n.flexBasis),t.setFlexGrow(typeof n.flexGrow=="undefined"?0:n.flexGrow),t.setFlexShrink(typeof n.flexShrink=="undefined"?1:n.flexShrink),typeof n.maxHeight!="undefined"&&t.setMaxHeight(n.maxHeight),typeof n.maxWidth!="undefined"&&t.setMaxWidth(n.maxWidth),typeof n.minHeight!="undefined"&&t.setMinHeight(n.minHeight),typeof n.minWidth!="undefined"&&t.setMinWidth(n.minWidth),t.setOverflow(x(n.overflow,{visible:i.OVERFLOW_VISIBLE,hidden:i.OVERFLOW_HIDDEN},i.OVERFLOW_VISIBLE)),t.setMargin(i.EDGE_TOP,n.marginTop||0),t.setMargin(i.EDGE_BOTTOM,n.marginBottom||0),t.setMargin(i.EDGE_LEFT,n.marginLeft||0),t.setMargin(i.EDGE_RIGHT,n.marginRight||0),t.setBorder(i.EDGE_TOP,n.borderWidth||0),t.setBorder(i.EDGE_BOTTOM,n.borderWidth||0),t.setBorder(i.EDGE_LEFT,n.borderWidth||0),t.setBorder(i.EDGE_RIGHT,n.borderWidth||0),t.setPadding(i.EDGE_TOP,n.paddingTop||0),t.setPadding(i.EDGE_BOTTOM,n.paddingBottom||0),t.setPadding(i.EDGE_LEFT,n.paddingLeft||0),t.setPadding(i.EDGE_RIGHT,n.paddingRight||0),t.setPositionType(x(n.position,{absolute:i.POSITION_TYPE_ABSOLUTE,relative:i.POSITION_TYPE_RELATIVE},i.POSITION_TYPE_RELATIVE)),typeof n.top!="undefined"&&t.setPosition(i.EDGE_TOP,n.top),typeof n.bottom!="undefined"&&t.setPosition(i.EDGE_BOTTOM,n.bottom),typeof n.left!="undefined"&&t.setPosition(i.EDGE_LEFT,n.left),typeof n.right!="undefined"&&t.setPosition(i.EDGE_RIGHT,n.right),typeof n.height!="undefined"?t.setHeight(n.height):t.setHeightAuto(),typeof n.width!="undefined"?t.setWidth(n.width):t.setWidthAuto(),[n,D(n)]}import{LineBreaker as Et}from"css-line-break";function N({left:t,top:r,width:e,height:o},f,n){let a;if(n)a=f;else{let s=t+e/2,l=r+o/2;a=A([1,0,0,1,s,l],A(f,[1,0,0,1,-s,-l])),f.__parent&&(a=A(f.__parent,a)),f.splice(0,6,...a)}return`matrix(${a.join(",")})`}function Y({content:t,left:r,top:e,width:o,height:f,isInheritingTransform:n,path:a,debug:s},l){let u="",d=1,p="";return l.transform&&(u=N({left:r,top:e,width:o,height:f},l.transform,n)),l.opacity&&(d=+l.opacity),s&&(p=`<rect x="${r}" y="${e}" width="${o}" height="${a===null?.5:f}" fill="transparent" stroke="#575eff" stroke-width="1" ${u?`transform="${u}"`:""}></rect>`),a===null?`<text x="${r}" y="${e}" width="${o}" height="${f}" fill="${l.color}" font-weight="${l.fontWeight}" font-style="${l.fontStyle}" font-size="${l.fontSize}" font-family="${l.fontFamily}" ${l.letterSpacing?`letter-spacing="${l.letterSpacing}"`:""} ${u?`transform="${u}"`:""} ${d!==1?`opacity="${d}"`:""}>${t}</text>${p}`:`<path fill="${l.color}" ${u?`transform="${u}"`:""} ${d!==1?`opacity="${d}"`:""} d="${a}"></path>${p}`}function*X(t,r){let{parentStyle:e,parent:o,font:f,id:n,isInheritingTransform:a,debug:s,embedFont:l}=r,u=Et(t,{lineBreak:"strict",wordBreak:"normal"}),d=[];for(let g;!(g=u.next()).done;)d.push(g.value.slice());let p=[];o.setAlignItems(i.ALIGN_BASELINE),e.textAlign==="left"?o.setJustifyContent(i.JUSTIFY_FLEX_START):e.textAlign==="center"?o.setJustifyContent(i.JUSTIFY_CENTER):e.textAlign==="right"?o.setJustifyContent(i.JUSTIFY_FLEX_END):e.textAlign==="justify"&&o.setJustifyContent(i.JUSTIFY_SPACE_BETWEEN);for(let g of d){let h=i.Node.create();o.insertChild(h,o.getChildCount());let _=f.measure(g,e),S=(e.letterSpacing||0)*g.length;h.setWidth(_.width+S),h.setHeight(_.ascent*1.2),h.setMargin(i.EDGE_BOTTOM,_.descent*1.2),p.push(h)}let[c,m]=yield,E="";for(let g=0;g<p.length;g++){let h=p[g],_=d[g];e.position==="absolute"&&h.calculateLayout();let{left:S,top:$,width:F,height:I}=h.getComputedLayout();S+=c,$+=m;let R=null;l?R=f.getSVG(_,Q(L({},e),{top:$,left:S,letterSpacing:e.letterSpacing})):$+=f.getAscent(e),E+=Y({content:_,id:n,left:S,top:$,width:F,height:I,isInheritingTransform:a,path:R,debug:s},e)}return E}import $t from"gradient-parser";function _t(t){return t.type==="literal"?t.value:t.type==="hex"?`#${t.value}`:t.type==="rgb"?`rgb(${t.value.join(",")})`:t.type==="rgba"?`rgba(${t.value.join(",")})`:"transparent"}function U({id:t,width:r},{image:e}){if(e.startsWith("linear-gradient(")){let o=$t.parse(e)[0],f,n,a,s;if(o.orientation.type==="directional")[f,n,a,s]={top:[0,1,0,0],bottom:[0,0,0,1],left:[1,0,0,0],right:[0,0,1,0]}[o.orientation.value];else if(o.orientation.type==="angular"){let m=+o.orientation.value/180*Math.PI-Math.PI/2,E=Math.cos(m),g=Math.sin(m);f=0,n=0,a=E,s=g,a<0&&(f-=a,a=0),s<0&&(n-=s,s=0)}let l=r,u=[];for(let m of o.colorStops){let E=_t(m);if(!u.length&&(u.push({offset:0,color:E}),typeof m.length=="undefined"||m.length.value==="0"))continue;let g=typeof m.length=="undefined"?void 0:m.length.type==="%"?m.length.value/100:m.length.value/l;u.push({offset:g,color:E})}u.length||u.push({offset:0,color:"transparent"});let d=u[u.length-1];d.offset!==1&&(typeof d.offset=="undefined"?d.offset=1:u.push({offset:1,color:d.color}));let p=0,c=1;for(let m=0;m<u.length;m++)if(typeof u[m].offset=="undefined"){for(c<m&&(c=m);typeof u[c].offset=="undefined";)c++;u[m].offset=(u[c].offset-u[p].offset)/(c-p)*(m-p)+u[p].offset}else p=m;return[`satori_bi${t}`,`<linearGradient id="satori_bi${t}" x1="${f}" y1="${n}" x2="${a}" y2="${s}">${u.map(m=>`<stop offset="${m.offset*100}%" stop-color="${m.color}"/>`).join("")}</linearGradient>`]}if(e.startsWith("url(")){let o=e.slice(4,-1);return[`satori_bi${t}`,`<pattern id="satori_bi${t}" patternContentUnits="objectBoundingBox" width="1" height="1"><image href="${o}" x="0" y="0" width="1" height="1"/></pattern>`]}}function w(t,r,e){return e<t+r&&(e/2<t&&e/2<r?t=r=e/2:e/2<t?t=e-r:e/2<r&&(r=e-t)),[t,r]}function W({left:t,top:r,width:e,height:o},f){let{borderTopLeftRadius:n,borderTopRightRadius:a,borderBottomLeftRadius:s,borderBottomRightRadius:l}=f;return n=Math.min(n||0,e,o),a=Math.min(a||0,e,o),s=Math.min(s||0,e,o),l=Math.min(l||0,e,o),!n&&!a&&!s&&!l?"":([n,a]=w(n,a,e),[n,s]=w(n,s,o),[a,l]=w(a,l,o),[s,l]=w(s,l,e),`M${t+n},${r} h${e-n-a} a${a},${a} 0 0 1 ${a},${a} v${o-a-l} a${l},${l} 0 0 1 ${-l},${l} h${l+s-e} a${s},${s} 0 0 1 ${-s},${-s} v${s+n-o} a${n},${n} 0 0 1 ${n},${-n}`)}function O({id:t,width:r,height:e},o){if(!o.shadowColor||!o.shadowOffset||typeof o.shadowRadius=="undefined")return"";let f=Math.min(o.shadowOffset.width-o.shadowRadius*2,0),n=Math.max(o.shadowOffset.width+o.shadowRadius*2+r,r),a=Math.min(o.shadowOffset.height-o.shadowRadius*2,0),s=Math.max(o.shadowOffset.height+o.shadowRadius*2+e,e);return`<defs><filter id="satori_s-${t}" x="${f/r*100}%" y="${a/e*100}%" width="${(n-f)/r*100}%" height="${(s-a)/e*100}%"><feDropShadow dx="${o.shadowOffset.width}" dy="${o.shadowOffset.height}" stdDeviation="${o.shadowRadius}" flood-color="${o.shadowColor}" flood-opacity="1"/></filter></defs>`}function H({id:t,left:r,top:e,width:o,height:f,isInheritingTransform:n,debug:a},s){if(s.display==="none")return"";let l="rect",u="transparent",d=0,p="",c="",m=[],E=1,g="";if(s.backgroundColor&&m.push(s.backgroundColor),s.borderWidth&&(d=s.borderWidth,u=s.borderColor),s.opacity&&(E=+s.opacity),s.transform&&(p=N({left:r,top:e,width:o,height:f},s.transform,n)),s.backgroundImage){let S=s.backgroundImage.map(($,F)=>U({id:t+"_"+F,width:o,height:f},$)).filter(Boolean);for(let $ of S)c+=$[1],m.push(`url(#${$[0]})`)}let h=W({left:r,top:e,width:o,height:f},s);h&&(l="path");let _=O({width:o,height:f,id:t},s);return m.length||m.push("transparent"),a&&(g=`<rect x="${r}" y="${e}" width="${o}" height="${f}" fill="transparent" stroke="#ff5757" stroke-width="1" ${p?`transform="${p}"`:""}></rect>`),`${c?`<defs>${c}</defs>`:""}${_?`${_}<g filter="url(#satori_s-${t})">`:""}${E!==1?`<g opacity="${E}">`:""}${m.map((S,$)=>S==="transparent"&&!($===m.length-1&&d)?"":`<${l} x="${r}" y="${e}" width="${o}" height="${f}" fill="${S}" ${$===m.length-1&&d?`stroke="${u}" stroke-width="${d}"`:""} ${h?`d="${h}"`:""} ${p?`transform="${p}"`:""}></${l}>`).join("")}${E!==1?"</g>":""}${_?"</g>":""}${g}`}function z({id:t,left:r,top:e,width:o,height:f,src:n,debug:a},s){if(s.display==="none")return"";let l="",u=1,d=s.objectFit==="contain"?"xMidYMid":s.objectFit==="cover"?"xMidYMid slice":"none",p=W({left:r,top:e,width:o,height:f},s);p&&(l=`<clipPath id="satori_c-${t}"><path x="${r}" y="${e}" width="${o}" height="${f}" d="${p}"></path></clipPath>`),s.opacity&&(u=+s.opacity);let c=O({width:o,height:f,id:t},s);return`${c}${c?`<g filter="url(#satori_s-${t})">`:""}${l}<image href="${n}" x="${r}" y="${e}" width="${o}" height="${f}" preserveAspectRatio="${d}" ${l?`clip-path="url(#satori_c-${t})"`:""} ${u!==1?`opacity="${u}"`:""}></image>${c?"</g>":""}`}function*k(t,r){let{id:e,inheritedStyle:o,parent:f,font:n,debug:a,embedFont:s=!0}=r;if(t===null||typeof t=="undefined")return yield,"";if(!v(t)||typeof t.type=="function"){let T;if(!v(t))T=X(String(t),r);else{if(tt(t.type))throw new Error("Class component is not supported.");T=k(t.type(t.props),r)}T.next();let G=yield;return T.next(G).value}let{type:l,props:u}=t,{style:d,children:p}=u,c=i.Node.create();f.insertChild(c,f.getChildCount());let[m,E]=M(c,l,o,d,u),g=m.transform===o.transform;g||(m.transform.__parent=o.transform);let h=typeof p=="undefined"?[]:[].concat(p),_=[],S=0;for(let T of h){let G=k(T,{id:e*h.length+ ++S,parentStyle:m,inheritedStyle:E,isInheritingTransform:!0,parent:c,font:n,embedFont:s,debug:a});G.next(),_.push(G)}let[$,F]=yield;m.position==="absolute"&&c.calculateLayout();let{left:I,top:R,width:V,height:j}=c.getComputedLayout();I+=$,R+=F;let C="";l==="img"?C=z({id:e,left:I,top:R,width:V,height:j,src:u.src,isInheritingTransform:g,debug:a},m):C=H({id:e,left:I,top:R,width:V,height:j,isInheritingTransform:g,debug:a},m);for(let T of _)C+=T.next([I,R]).value;return C}import it from"opentype.js";var B=class{constructor(r){this.fonts=new Map;for(let e of r){let o=e.data,f="buffer"in o?it.parse(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)):it.parse(o);this.defaultFont||(this.defaultFont=f),this.fonts.has(e.name)||this.fonts.set(e.name,[]),this.fonts.get(e.name).push([f,e.weight,e.style])}}get({name:r,weight:e,style:o}){if(!this.fonts.has(r))return this.defaultFont;e==="normal"&&(e=400),e==="bold"&&(e=700);let f=[...this.fonts.get(r)];return f.sort(([n,a,s],[l,u,d])=>{if(a!==u)return a?!u||a===e?-1:u===e?1:e===400&&a===500||e===500&&a===400?-1:e===400&&u===500||e===500&&u===400?1:e<400?a<e&&u<e?u-a:a<e?-1:u<e?1:a-u:e<a&&e<u?a-u:e<a?-1:e<u?1:u-a:1;if(s!==d){if(s===o)return-1;if(d===o)return 1}return-1}),f[0][0]}measure(r,{fontFamily:e,fontSize:o,fontWeight:f=400,fontStyle:n="normal"}){let a=this.get({name:e,weight:f,style:n});return{width:a.getAdvanceWidth(r,o),ascent:a.ascender/a.unitsPerEm*o,descent:-(a.descender/a.unitsPerEm)*o}}getSVG(r,{fontFamily:e,fontSize:o,fontWeight:f=400,fontStyle:n="normal",top:a,left:s,letterSpacing:l=0}){let u=this.get({name:e,weight:f,style:n});return a+=u.ascender/u.unitsPerEm*o,u.getPath(r,s,a,o,{letterSpacing:l/o}).toPathData(2)}getAscent({fontFamily:r,fontSize:e,fontWeight:o=400,fontStyle:f="normal"}){let n=this.get({name:r,weight:o,style:f});return n.ascender/n.unitsPerEm*e}};function J({width:t,height:r,content:e},o){return`<svg width="${t}" height="${r}" viewBox="0 0 ${t} ${r}" xmlns="http://www.w3.org/2000/svg">${e}</svg>`}function at(t,r){if(!i)throw new Error("Satori is not initialized.");let e=new B(r.fonts),o=i.Node.create();o.setWidth(r.width),o.setHeight(r.height),o.setFlexDirection(i.FLEX_DIRECTION_ROW),o.setFlexWrap(i.WRAP_WRAP),o.setAlignContent(i.ALIGN_AUTO),o.setAlignItems(i.ALIGN_FLEX_START),o.setJustifyContent(i.JUSTIFY_FLEX_START);let f=k(t,{id:1,parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1},parent:o,font:e,embedFont:r.embedFont,debug:r.debug});f.next(),o.calculateLayout(r.width,r.height,i.DIRECTION_LTR);let n=f.next([0,0]).value;return J({width:r.width,height:r.height,content:n})}export{at as default,ct as init};
1
+ var ft=Object.defineProperty,ut=Object.defineProperties;var lt=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable;var Q=(t,o,e)=>o in t?ft(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,A=(t,o)=>{for(var e in o||(o={}))mt.call(o,e)&&Q(t,e,o[e]);if(K)for(var e of K(o))ct.call(o,e)&&Q(t,e,o[e]);return t},Z=(t,o)=>ut(t,lt(o));var tt;function dt(t){tt=t}function pt(){return tt}var R=pt;function D(t){let o=typeof t;return!(o==="number"||o==="bigint"||o==="string"||o==="boolean")}function et(t){return/^class\s/.test(Function.prototype.toString.call(t))}function F(t,o){return[t[0]*o[0]+t[2]*o[1],t[1]*o[0]+t[3]*o[1],t[0]*o[2]+t[2]*o[3],t[1]*o[2]+t[3]*o[3],t[0]*o[4]+t[2]*o[5]+t[4],t[1]*o[4]+t[3]*o[5]+t[5]]}var nt={p:{display:"block",marginTop:"1em",marginBottom:"1em"},div:{display:"block"},blockquote:{display:"block",marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40},center:{display:"block",textAlign:"center"},hr:{display:"block",marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,borderStyle:"inset"},h1:{display:"block",fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h2:{display:"block",fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold"},h3:{display:"block",fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold"},h4:{display:"block",marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},h5:{display:"block",fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold"},h6:{display:"block",fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold"},u:{textDecoration:"underline"},strong:{fontWeight:"bold"},b:{fontWeight:"bold"},i:{fontStyle:"italic"},em:{fontStyle:"italic"},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{display:"block",fontFamily:"monospace",whiteSpace:"pre",marginTop:"1em",marginBottom:"1em"},mark:{backgroundColor:"yellow",color:"black"},big:{fontSize:"larger"},small:{fontSize:"smaller"},s:{textDecoration:"line-through"}};var gt=new Set(["color","font","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textAlign","textTransform","whiteSpace","letterSpacing","transform","opacity"]);function M(t){let o={};for(let e in t)gt.has(e)&&(o[e]=t[e]);return o}import ht,{getPropertyName as bt}from"css-to-react-native";import it from"parse-css-dimension";import{parseElementStyle as yt}from"css-background-parser";var Et=new Set(["flex","flexGrow","flexShrink","flexBasis","fontWeight","lineHeight","opacity","scale","scaleX","scaleY"]),rt=[1,0,0,1,0,0];function $t(t,o){return typeof o=="number"?Et.has(t)?String(o):o+"px":o}function ot(t,o){if(typeof t=="number")return t;try{let e=new it(t);if(e.type==="length")switch(e.unit){case"em":return e.value*o;case"rem":return e.value*16;default:return e.value}else if(e.type==="angle")switch(e.unit){case"deg":return e.value;case"rad":return e.value*180/Math.PI;default:return e.value}}catch{}}function P(t,o){let e=[];for(let r in t){let n=bt(r);e.push([n,$t(n,t[r])])}let i=ht(e);if(i.backgroundImage){let{backgrounds:r}=yt(i);i.backgroundImage=r}let a=i.fontSize||o.fontSize;if(typeof a=="string")try{let r=new it(a);switch(r.unit){case"em":a=r.value*o.fontSize;break;case"rem":a=r.value*16;break}}catch{a=16}i.fontSize=a;for(let r in i){let n=i[r];if(typeof n=="string"){let s=ot(n,a);typeof s!="undefined"&&(i[r]=s),n=i[r]}if(r==="opacity"&&(n=i[r]=n*o.opacity),r==="transform"){let s=[...rt],l=n;for(let f of l){let m=Object.keys(f)[0],d=f[m],c=typeof d=="string"?ot(d,a):d,u=[...rt];switch(m){case"translateX":u[4]=c;break;case"translateY":u[5]=c;break;case"scaleX":u[0]=c;break;case"scaleY":u[3]=c;break;case"rotate":let p=c*Math.PI/180,$=Math.cos(p),g=Math.sin(p);u[0]=$,u[1]=g,u[2]=-g,u[3]=$;break;case"skewX":u[2]=Math.tan(c*Math.PI/180);break;case"skewY":u[1]=Math.tan(c*Math.PI/180);break}s=F(u,s)}i.transform=s}}return i}function S(t,o,e){let i=o[t];return typeof i=="undefined"?e:i}function Y(t,o,e,i,a){let r=R(),n=A(A(A({},e),P(nt[o],e)),P(i,e));if(o==="img"){let s=parseInt(a.width),f=parseInt(a.height)/s;n.width||(n.width=s),n.height||(n.height=f*n.width)}return t.setDisplay(S(n.display,{flex:r.DISPLAY_FLEX,none:r.DISPLAY_NONE},r.DISPLAY_FLEX)),t.setAlignContent(S(n.alignContent,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,"space-between":r.ALIGN_SPACE_BETWEEN,"space-around":r.ALIGN_SPACE_AROUND,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO)),t.setAlignItems(S(n.alignItems,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_FLEX_START)),t.setAlignSelf(S(n.alignSelf,{stretch:r.ALIGN_STRETCH,center:r.ALIGN_CENTER,"flex-start":r.ALIGN_FLEX_START,"flex-end":r.ALIGN_FLEX_END,baseline:r.ALIGN_BASELINE,normal:r.ALIGN_AUTO},r.ALIGN_AUTO)),t.setJustifyContent(S(n.justifyContent,{center:r.JUSTIFY_CENTER,"flex-start":r.JUSTIFY_FLEX_START,"flex-end":r.JUSTIFY_FLEX_END,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND},r.JUSTIFY_FLEX_START)),t.setFlexDirection(S(n.flexDirection,{row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE},r.FLEX_DIRECTION_ROW)),t.setFlexWrap(S(n.flexWrap,{wrap:r.WRAP_WRAP,nowrap:r.WRAP_NO_WRAP,"wrap-reverse":r.WRAP_WRAP_REVERSE},r.WRAP_WRAP)),typeof n.flexBasis!="undefined"&&t.setFlexBasis(n.flexBasis),t.setFlexGrow(typeof n.flexGrow=="undefined"?0:n.flexGrow),t.setFlexShrink(typeof n.flexShrink=="undefined"?1:n.flexShrink),typeof n.maxHeight!="undefined"&&t.setMaxHeight(n.maxHeight),typeof n.maxWidth!="undefined"&&t.setMaxWidth(n.maxWidth),typeof n.minHeight!="undefined"&&t.setMinHeight(n.minHeight),typeof n.minWidth!="undefined"&&t.setMinWidth(n.minWidth),t.setOverflow(S(n.overflow,{visible:r.OVERFLOW_VISIBLE,hidden:r.OVERFLOW_HIDDEN},r.OVERFLOW_VISIBLE)),t.setMargin(r.EDGE_TOP,n.marginTop||0),t.setMargin(r.EDGE_BOTTOM,n.marginBottom||0),t.setMargin(r.EDGE_LEFT,n.marginLeft||0),t.setMargin(r.EDGE_RIGHT,n.marginRight||0),t.setBorder(r.EDGE_TOP,n.borderWidth||0),t.setBorder(r.EDGE_BOTTOM,n.borderWidth||0),t.setBorder(r.EDGE_LEFT,n.borderWidth||0),t.setBorder(r.EDGE_RIGHT,n.borderWidth||0),t.setPadding(r.EDGE_TOP,n.paddingTop||0),t.setPadding(r.EDGE_BOTTOM,n.paddingBottom||0),t.setPadding(r.EDGE_LEFT,n.paddingLeft||0),t.setPadding(r.EDGE_RIGHT,n.paddingRight||0),t.setPositionType(S(n.position,{absolute:r.POSITION_TYPE_ABSOLUTE,relative:r.POSITION_TYPE_RELATIVE},r.POSITION_TYPE_RELATIVE)),typeof n.top!="undefined"&&t.setPosition(r.EDGE_TOP,n.top),typeof n.bottom!="undefined"&&t.setPosition(r.EDGE_BOTTOM,n.bottom),typeof n.left!="undefined"&&t.setPosition(r.EDGE_LEFT,n.left),typeof n.right!="undefined"&&t.setPosition(r.EDGE_RIGHT,n.right),typeof n.height!="undefined"?t.setHeight(n.height):t.setHeightAuto(),typeof n.width!="undefined"?t.setWidth(n.width):t.setWidthAuto(),[n,M(n)]}import{LineBreaker as _t}from"css-line-break";function N({left:t,top:o,width:e,height:i},a,r){let n;if(r)n=a;else{let s=t+e/2,l=o+i/2;n=F([1,0,0,1,s,l],F(a,[1,0,0,1,-s,-l])),a.__parent&&(n=F(a.__parent,n)),a.splice(0,6,...n)}return`matrix(${n.join(",")})`}function X({content:t,left:o,top:e,width:i,height:a,isInheritingTransform:r,path:n,debug:s},l){let f="",m=1,d="";return l.transform&&(f=N({left:o,top:e,width:i,height:a},l.transform,r)),l.opacity&&(m=+l.opacity),s&&(d=`<rect x="${o}" y="${e}" width="${i}" height="${n===null?.5:a}" fill="transparent" stroke="#575eff" stroke-width="1" ${f?`transform="${f}"`:""}></rect>`),n===null?`<text x="${o}" y="${e}" width="${i}" height="${a}" fill="${l.color}" font-weight="${l.fontWeight}" font-style="${l.fontStyle}" font-size="${l.fontSize}" font-family="${l.fontFamily}" ${l.letterSpacing?`letter-spacing="${l.letterSpacing}"`:""} ${f?`transform="${f}"`:""} ${m!==1?`opacity="${m}"`:""}>${t}</text>${d}`:`<path fill="${l.color}" ${f?`transform="${f}"`:""} ${m!==1?`opacity="${m}"`:""} d="${n}"></path>${d}`}function*U(t,o){let e=R(),{parentStyle:i,parent:a,font:r,id:n,isInheritingTransform:s,debug:l,embedFont:f}=o,m=_t(t,{lineBreak:"strict",wordBreak:"normal"}),d=[];for(let g;!(g=m.next()).done;)d.push(g.value.slice());let c=[];a.setAlignItems(e.ALIGN_BASELINE),i.textAlign==="left"?a.setJustifyContent(e.JUSTIFY_FLEX_START):i.textAlign==="center"?a.setJustifyContent(e.JUSTIFY_CENTER):i.textAlign==="right"?a.setJustifyContent(e.JUSTIFY_FLEX_END):i.textAlign==="justify"&&a.setJustifyContent(e.JUSTIFY_SPACE_BETWEEN);for(let g of d){let y=e.Node.create();a.insertChild(y,a.getChildCount());let _=r.measure(g,i),E=(i.letterSpacing||0)*g.length;y.setWidth(_.width+E),y.setHeight(_.ascent*1.2),y.setMargin(e.EDGE_BOTTOM,_.descent*1.2),c.push(y)}let[u,p]=yield,$="";for(let g=0;g<c.length;g++){let y=c[g],_=d[g];i.position==="absolute"&&y.calculateLayout();let{left:E,top:x,width:v,height:L}=y.getComputedLayout();E+=u,x+=p;let I=null;f?I=r.getSVG(_,Z(A({},i),{top:x,left:E,letterSpacing:i.letterSpacing})):x+=r.getAscent(i),$+=X({content:_,id:n,left:E,top:x,width:v,height:L,isInheritingTransform:s,path:I,debug:l},i)}return $}import St from"gradient-parser";function xt(t){return t.type==="literal"?t.value:t.type==="hex"?`#${t.value}`:t.type==="rgb"?`rgb(${t.value.join(",")})`:t.type==="rgba"?`rgba(${t.value.join(",")})`:"transparent"}function H({id:t,width:o},{image:e}){if(e.startsWith("linear-gradient(")){let i=St.parse(e)[0],a,r,n,s;if(i.orientation.type==="directional")[a,r,n,s]={top:[0,1,0,0],bottom:[0,0,0,1],left:[1,0,0,0],right:[0,0,1,0]}[i.orientation.value];else if(i.orientation.type==="angular"){let u=+i.orientation.value/180*Math.PI-Math.PI/2,p=Math.cos(u),$=Math.sin(u);a=0,r=0,n=p,s=$,n<0&&(a-=n,n=0),s<0&&(r-=s,s=0)}let l=o,f=[];for(let u of i.colorStops){let p=xt(u);if(!f.length&&(f.push({offset:0,color:p}),typeof u.length=="undefined"||u.length.value==="0"))continue;let $=typeof u.length=="undefined"?void 0:u.length.type==="%"?u.length.value/100:u.length.value/l;f.push({offset:$,color:p})}f.length||f.push({offset:0,color:"transparent"});let m=f[f.length-1];m.offset!==1&&(typeof m.offset=="undefined"?m.offset=1:f.push({offset:1,color:m.color}));let d=0,c=1;for(let u=0;u<f.length;u++)if(typeof f[u].offset=="undefined"){for(c<u&&(c=u);typeof f[c].offset=="undefined";)c++;f[u].offset=(f[c].offset-f[d].offset)/(c-d)*(u-d)+f[d].offset}else d=u;return[`satori_bi${t}`,`<linearGradient id="satori_bi${t}" x1="${a}" y1="${r}" x2="${n}" y2="${s}">${f.map(u=>`<stop offset="${u.offset*100}%" stop-color="${u.color}"/>`).join("")}</linearGradient>`]}if(e.startsWith("url(")){let i=e.slice(4,-1);return[`satori_bi${t}`,`<pattern id="satori_bi${t}" patternContentUnits="objectBoundingBox" width="1" height="1"><image href="${i}" x="0" y="0" width="1" height="1"/></pattern>`]}}function w(t,o,e){return e<t+o&&(e/2<t&&e/2<o?t=o=e/2:e/2<t?t=e-o:e/2<o&&(o=e-t)),[t,o]}function W({left:t,top:o,width:e,height:i},a){let{borderTopLeftRadius:r,borderTopRightRadius:n,borderBottomLeftRadius:s,borderBottomRightRadius:l}=a;return r=Math.min(r||0,e,i),n=Math.min(n||0,e,i),s=Math.min(s||0,e,i),l=Math.min(l||0,e,i),!r&&!n&&!s&&!l?"":([r,n]=w(r,n,e),[r,s]=w(r,s,i),[n,l]=w(n,l,i),[s,l]=w(s,l,e),`M${t+r},${o} h${e-r-n} a${n},${n} 0 0 1 ${n},${n} v${i-n-l} a${l},${l} 0 0 1 ${-l},${l} h${l+s-e} a${s},${s} 0 0 1 ${-s},${-s} v${s+r-i} a${r},${r} 0 0 1 ${r},${-r}`)}function O({id:t,width:o,height:e},i){if(!i.shadowColor||!i.shadowOffset||typeof i.shadowRadius=="undefined")return"";let a=Math.min(i.shadowOffset.width-i.shadowRadius*2,0),r=Math.max(i.shadowOffset.width+i.shadowRadius*2+o,o),n=Math.min(i.shadowOffset.height-i.shadowRadius*2,0),s=Math.max(i.shadowOffset.height+i.shadowRadius*2+e,e);return`<defs><filter id="satori_s-${t}" x="${a/o*100}%" y="${n/e*100}%" width="${(r-a)/o*100}%" height="${(s-n)/e*100}%"><feDropShadow dx="${i.shadowOffset.width}" dy="${i.shadowOffset.height}" stdDeviation="${i.shadowRadius}" flood-color="${i.shadowColor}" flood-opacity="1"/></filter></defs>`}function z({id:t,left:o,top:e,width:i,height:a,isInheritingTransform:r,debug:n},s){if(s.display==="none")return"";let l="rect",f="transparent",m=0,d="",c="",u=[],p=1,$="";if(s.backgroundColor&&u.push(s.backgroundColor),s.borderWidth&&(m=s.borderWidth,f=s.borderColor),s.opacity&&(p=+s.opacity),s.transform&&(d=N({left:o,top:e,width:i,height:a},s.transform,r)),s.backgroundImage){let _=s.backgroundImage.map((E,x)=>H({id:t+"_"+x,width:i,height:a},E)).filter(Boolean);for(let E of _)c+=E[1],u.push(`url(#${E[0]})`)}let g=W({left:o,top:e,width:i,height:a},s);g&&(l="path");let y=O({width:i,height:a,id:t},s);return u.length||u.push("transparent"),n&&($=`<rect x="${o}" y="${e}" width="${i}" height="${a}" fill="transparent" stroke="#ff5757" stroke-width="1" ${d?`transform="${d}"`:""}></rect>`),`${c?`<defs>${c}</defs>`:""}${y?`${y}<g filter="url(#satori_s-${t})">`:""}${p!==1?`<g opacity="${p}">`:""}${u.map((_,E)=>_==="transparent"&&!(E===u.length-1&&m)?"":`<${l} x="${o}" y="${e}" width="${i}" height="${a}" fill="${_}" ${E===u.length-1&&m?`stroke="${f}" stroke-width="${m}"`:""} ${g?`d="${g}"`:""} ${d?`transform="${d}"`:""}></${l}>`).join("")}${p!==1?"</g>":""}${y?"</g>":""}${$}`}function J({id:t,left:o,top:e,width:i,height:a,src:r,debug:n},s){if(s.display==="none")return"";let l="",f=1,m=s.objectFit==="contain"?"xMidYMid":s.objectFit==="cover"?"xMidYMid slice":"none",d=W({left:o,top:e,width:i,height:a},s);d&&(l=`<clipPath id="satori_c-${t}"><path x="${o}" y="${e}" width="${i}" height="${a}" d="${d}"></path></clipPath>`),s.opacity&&(f=+s.opacity);let c=O({width:i,height:a,id:t},s);return`${c}${c?`<g filter="url(#satori_s-${t})">`:""}${l}<image href="${r}" x="${o}" y="${e}" width="${i}" height="${a}" preserveAspectRatio="${m}" ${l?`clip-path="url(#satori_c-${t})"`:""} ${f!==1?`opacity="${f}"`:""}></image>${c?"</g>":""}`}function*k(t,o){let e=R(),{id:i,inheritedStyle:a,parent:r,font:n,debug:s,embedFont:l=!0}=o;if(t===null||typeof t=="undefined")return yield,"";if(!D(t)||typeof t.type=="function"){let T;if(!D(t))T=U(String(t),o);else{if(et(t.type))throw new Error("Class component is not supported.");T=k(t.type(t.props),o)}T.next();let G=yield;return T.next(G).value}let{type:f,props:m}=t,{style:d,children:c}=m,u=e.Node.create();r.insertChild(u,r.getChildCount());let[p,$]=Y(u,f,a,d,m),g=p.transform===a.transform;g||(p.transform.__parent=a.transform);let y=typeof c=="undefined"?[]:[].concat(c),_=[],E=0;for(let T of y){let G=k(T,{id:i*y.length+ ++E,parentStyle:p,inheritedStyle:$,isInheritingTransform:!0,parent:u,font:n,embedFont:l,debug:s});G.next(),_.push(G)}let[x,v]=yield;p.position==="absolute"&&u.calculateLayout();let{left:L,top:I,width:j,height:q}=u.getComputedLayout();L+=x,I+=v;let C="";f==="img"?C=J({id:i,left:L,top:I,width:j,height:q,src:m.src,isInheritingTransform:g,debug:s},p):C=z({id:i,left:L,top:I,width:j,height:q,isInheritingTransform:g,debug:s},p);for(let T of _)C+=T.next([L,I]).value;return C}import at from"opentype.js";var B=class{constructor(o){this.fonts=new Map;for(let e of o){let i=e.data,a="buffer"in i?at.parse(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):at.parse(i);this.defaultFont||(this.defaultFont=a),this.fonts.has(e.name)||this.fonts.set(e.name,[]),this.fonts.get(e.name).push([a,e.weight,e.style])}}get({name:o,weight:e,style:i}){if(!this.fonts.has(o))return this.defaultFont;e==="normal"&&(e=400),e==="bold"&&(e=700);let a=[...this.fonts.get(o)];return a.sort(([r,n,s],[l,f,m])=>{if(n!==f)return n?!f||n===e?-1:f===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&f===500||e===500&&f===400?1:e<400?n<e&&f<e?f-n:n<e?-1:f<e?1:n-f:e<n&&e<f?n-f:e<n?-1:e<f?1:f-n:1;if(s!==m){if(s===i)return-1;if(m===i)return 1}return-1}),a[0][0]}measure(o,{fontFamily:e,fontSize:i,fontWeight:a=400,fontStyle:r="normal"}){let n=this.get({name:e,weight:a,style:r});return{width:n.getAdvanceWidth(o,i),ascent:n.ascender/n.unitsPerEm*i,descent:-(n.descender/n.unitsPerEm)*i}}getSVG(o,{fontFamily:e,fontSize:i,fontWeight:a=400,fontStyle:r="normal",top:n,left:s,letterSpacing:l=0}){let f=this.get({name:e,weight:a,style:r});return n+=f.ascender/f.unitsPerEm*i,f.getPath(o,s,n,i,{letterSpacing:l/i}).toPathData(2)}getAscent({fontFamily:o,fontSize:e,fontWeight:i=400,fontStyle:a="normal"}){let r=this.get({name:o,weight:i,style:a});return r.ascender/r.unitsPerEm*e}};function V({width:t,height:o,content:e},i){return`<svg width="${t}" height="${o}" viewBox="0 0 ${t} ${o}" xmlns="http://www.w3.org/2000/svg">${e}</svg>`}function st(t,o){let e=R();if(!e)throw new Error("Satori is not initialized.");let i=new B(o.fonts),a=e.Node.create();a.setWidth(o.width),a.setHeight(o.height),a.setFlexDirection(e.FLEX_DIRECTION_ROW),a.setFlexWrap(e.WRAP_WRAP),a.setAlignContent(e.ALIGN_AUTO),a.setAlignItems(e.ALIGN_FLEX_START),a.setJustifyContent(e.JUSTIFY_FLEX_START);let r=k(t,{id:1,parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1},parent:a,font:i,embedFont:o.embedFont,debug:o.debug});r.next(),a.calculateLayout(o.width,o.height,e.DIRECTION_LTR);let n=r.next([0,0]).value;return V({width:o.width,height:o.height,content:n})}export{st as default,dt as init};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "satori",
3
- "version": "0.0.8-beta.1",
3
+ "version": "0.0.8-beta.2",
4
4
  "description": "A lightweight library to convert HTML JSX to SVG string.",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/index.d.ts",