Socket
Socket
Sign inDemoInstall

satori

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

satori - npm Package Compare versions

Comparing version 0.0.8-beta.0 to 0.0.8-beta.1

2

dist/esm/index.js

@@ -1,1 +0,1 @@

var ft=Object.defineProperty,ut=Object.defineProperties;var lt=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable;var K=(t,r,e)=>r in t?ft(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,L=(t,r)=>{for(var e in r||(r={}))mt.call(r,e)&&K(t,e,r[e]);if(q)for(var e of q(r))ct.call(r,e)&&K(t,e,r[e]);return t},Q=(t,r)=>ut(t,lt(r));var Z=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(r,e)=>(typeof require!="undefined"?require:r)[e]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var dt=Z("yoga-wasm-web"),tt;async function pt(t){t||(t=Z("yoga-wasm-web/dist/yoga.wasm")),tt=await dt(t)}var i=tt;function w(t){let r=typeof t;return!(r==="number"||r==="bigint"||r==="string"||r==="boolean")}function et(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 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 D(t){let r={};for(let e in t)gt.has(e)&&(r[e]=t[e]);return r}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,r){return typeof r=="number"?Et.has(t)?String(r):r+"px":r}function ot(t,r){if(typeof t=="number")return t;try{let e=new it(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=bt(n);e.push([a,$t(a,t[n])])}let o=ht(e);if(o.backgroundImage){let{backgrounds:n}=yt(o);o.backgroundImage=n}let f=o.fontSize||r.fontSize;if(typeof f=="string")try{let n=new it(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=ot(a,f);typeof s!="undefined"&&(o[n]=s),a=o[n]}if(n==="opacity"&&(a=o[n]=a*r.opacity),n==="transform"){let s=[...rt],l=a;for(let u of l){let d=Object.keys(u)[0],p=u[d],c=typeof p=="string"?ot(p,f):p,m=[...rt];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(nt[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 _t}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=_t(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 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 U({id:t,width:r},{image:e}){if(e.startsWith("linear-gradient(")){let o=St.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=xt(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 B(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]=B(n,a,e),[n,s]=B(n,s,o),[a,l]=B(a,l,o),[s,l]=B(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(!w(t)||typeof t.type=="function"){let T;if(!w(t))T=X(String(t),r);else{if(et(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 at from"opentype.js";var v=class{constructor(r){this.fonts=new Map;for(let e of r){let o=e.data,f="buffer"in o?at.parse(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)):at.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 st(t,r){if(!i)throw new Error("Satori is not initialized.");let e=new v(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{st as default,pt as init};
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};
import { ReactNode } from 'react';
import * as yoga_layout from 'yoga-layout';
declare function init(wasm: any): Promise<void>;
declare function init(yoga: typeof yoga_layout): void;

@@ -5,0 +6,0 @@ /**

{
"name": "satori",
"version": "0.0.8-beta.0",
"version": "0.0.8-beta.1",
"description": "A lightweight library to convert HTML JSX to SVG string.",

@@ -50,5 +50,4 @@ "module": "./dist/esm/index.js",

"opentype.js": "^1.3.4",
"parse-css-dimension": "^1.1.0",
"yoga-wasm-web": "^0.0.3"
"parse-css-dimension": "^1.1.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc