@inottn/miniposter
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -1,1 +0,1 @@ | ||
"use strict";var m=require("@inottn/fp-utils");const C=function(h,e){let t=0,s=h.length;for(;t<s;){const n=t+(s-t>>1);e(n)?s=n:t=n+1}return s-1},T=function({left:h,textAlign:e,textWidth:t,width:s}){if(m.isUndefined(s))return h;const n=s-(t||0);switch(e){case"center":return h+n/2;case"right":return h+n;default:return h}};var F=Object.defineProperty,O=Object.defineProperties,S=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,y=(h,e,t)=>e in h?F(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,v=(h,e)=>{for(var t in e||(e={}))j.call(e,t)&&y(h,t,e[t]);if(R)for(var t of R(e))I.call(e,t)&&y(h,t,e[t]);return h},E=(h,e)=>O(h,S(e)),x=(h,e,t)=>(y(h,typeof e!="symbol"?e+"":e,t),t);class q{constructor(e,t){x(this,"canvas"),x(this,"context"),x(this,"options"),x(this,"images",new Map),x(this,"fonts",new Map),this.canvas=e,this.context=e.getContext("2d"),this.options=t}toPx(e){const{pixelRatio:t=1}=this.options;return typeof e=="number"?e*t:e.map(this.toPx.bind(this))}async render(e){const{canvas:t,context:s,options:n}=this,{width:i,height:r,pixelRatio:o=1,backgroundColor:l,borderRadius:d,overflow:f}=v(v({},n),e),{children:a}=e;if(!i||!r)throw Error("\u7F3A\u5C11 width \u6216 height \u53C2\u6570");if(t.width=i*o,t.height=r*o,s.save(),d&&(this.drawRoundRect(0,0,t.width,t.height,d),s.clip()),l&&(s.fillStyle=l,s.fillRect(0,0,t.width,t.height)),f!=="hidden"&&s.restore(),m.isNonEmptyArray(a)){this.loadAssets(a);for(const c of a)c.type==="image"&&await this.renderImage(c),c.type==="text"&&await this.renderText(c)}f==="hidden"&&s.restore()}async renderImage(e){const{context:t}=this,{src:s,backgroundColor:n,borderRadius:i,objectFit:r="fill"}=e,[o,l]=this.images.get(s);let[d,f,a,c]=this.toPx([e.left,e.top,e.width,e.height]);await l,t.save(),i&&(this.drawRoundRect(d,f,a,c,this.toPx(i)),t.clip()),n&&(t.fillStyle=n,t.fillRect(d,f,a,c));const g=o.width/o.height,p=a/c;if(!(r==="fill"||g===p)&&(r==="contain"||r==="cover"))if(r==="contain"?g>p:g<p){const u=o.width/a,w=c;c=o.height/u,f+=(w-c)*.5}else{const u=o.height/c,w=a;a=o.width/u,d+=(w-a)*.5}t.drawImage(o,d,f,a,c),t.restore()}async renderText(e){const{context:t}=this,[s,n,i]=this.toPx([e.left,e.top,e.fontSize||16]),r=e.lineHeight?this.toPx(e.lineHeight):i*1.43,{color:o="#333",fontFamily:l,fontWeight:d=400,fontSrc:f,textAlign:a="left",textDecoration:c}=e;f&&await this.fonts.get(f),t.save(),e.width&&(t.textAlign=a),t.textBaseline="top",t.fillStyle=o,t.font=`${d} ${i}px ${l}`;const g=e.width?this.toPx(e.width):void 0,p=T({left:s,textAlign:a,width:g});(e.width?this.getAllLines(e):[e.content]).forEach((u,w)=>{const b=n+(r-i)/2+r*w;if(t.fillText(u,p,b),c==="line-through"){const{width:P}=t.measureText(u),A=T({left:s,textAlign:a,textWidth:P,width:g});t.fillRect(A,b+i*.46,P,i/14)}}),t.restore()}getAllLines(e){const{context:t}=this,s=this.toPx(e.width),{content:n,lineClamp:i=1/0}=e,r=[];let o=0;for(;o<n.length&&r.length<i;){const l=o;o=C(n,d=>t.measureText(n.slice(o,d+1)).width>s)+1,o===l&&(o=l+1),i===r.length+1?r.push(n.slice(l,o-1)+"..."):r.push(n.slice(l,o))}return r}drawRoundRect(e,t,s,n,i){const{context:r}=this;typeof i=="number"?i=[i,i,i,i]:i.length===1?i=[i[0],i[0],i[0],i[0]]:i.length===2?i=[i[0],i[1],i[0],i[1]]:i.length===3&&(i=[i[0],i[1],i[2],i[1]]),r.beginPath(),r.moveTo(e+i[0],t),r.lineTo(e+s-i[1],t),r.quadraticCurveTo(e+s,t,e+s,t+i[1]),r.lineTo(e+s,t+n-i[2]),r.quadraticCurveTo(e+s,t+n,e+s-i[2],t+n),r.lineTo(e+i[3],t+n),r.quadraticCurveTo(e,t+n,e,t+n-i[3]),r.lineTo(e,t+i[0]),r.quadraticCurveTo(e,t,e+i[0],t),r.closePath()}loadAssets(e){e.forEach(t=>{const{type:s}=t;s==="image"&&this.loadImage(t),s==="text"&&t.fontFamily&&this.loadFont(t)})}loadImage(e){const{src:t}=e;if(!this.images.has(t)){const s=this.canvas.createImage();s.src=t,this.images.set(t,[s,new Promise((n,i)=>{s.onload=n,s.onerror=i})])}}loadFont(e){const{fontFamily:t,fontSrc:s}=e;this.fonts.has(s)||this.fonts.set(s,new Promise((n,i)=>{my.loadFontFace({family:t,source:`url('${s}')`,success:n,fail:i})}))}export(e){const{canvas:t}=this,{width:s,height:n}=this.options,{promise:i,resolve:r,reject:o}=m.withResolvers();return t.toTempFilePath(E(v({x:0,y:0,width:s,height:n},e),{success:r,fail:o})),i}}exports.MiniPoster=q; | ||
"use strict";var m=require("@inottn/fp-utils");const M=function(h,e){let t=0,s=h.length;for(;t<s;){const o=t+(s-t>>1);e(o)?s=o:t=o+1}return s-1},R=function({left:h,textAlign:e,textWidth:t,width:s}){if(m.isUndefined(s))return h;const o=s-(t||0);switch(e){case"center":return h+o/2;case"right":return h+o;default:return h}};var T=Object.defineProperty,F=Object.defineProperties,O=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,y=(h,e,t)=>e in h?T(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,P=(h,e)=>{for(var t in e||(e={}))S.call(e,t)&&y(h,t,e[t]);if(I)for(var t of I(e))j.call(e,t)&&y(h,t,e[t]);return h},C=(h,e)=>F(h,O(e)),x=(h,e,t)=>(y(h,typeof e!="symbol"?e+"":e,t),t);class E{constructor(e,t){x(this,"canvas"),x(this,"context"),x(this,"options"),x(this,"images",new Map),x(this,"fonts",new Map),this.canvas=e,this.context=e.getContext("2d"),this.options=t}toPx(e){const{pixelRatio:t=1}=this.options;return typeof e=="number"?e*t:e.map(this.toPx.bind(this))}async render(e){const{canvas:t,context:s,options:o}=this,{width:i,height:n,pixelRatio:r=1,backgroundColor:c,borderRadius:l,overflow:f}=P(P({},o),e),{children:a}=e;if(!i||!n)throw Error("\u7F3A\u5C11 width \u6216 height \u53C2\u6570");if(t.width=i*r,t.height=n*r,s.save(),l&&(this.drawRoundedRect(0,0,t.width,t.height,this.toPx(l)),s.clip()),c&&(s.fillStyle=c,s.fillRect(0,0,t.width,t.height)),f!=="hidden"&&s.restore(),m.isNonEmptyArray(a)){this.loadAssets(a);for(const d of a)d.type==="image"&&await this.renderImage(d),d.type==="text"&&await this.renderText(d)}f==="hidden"&&s.restore()}async renderImage(e){const{context:t}=this,{src:s,backgroundColor:o,borderRadius:i,objectFit:n="fill"}=e,[r,c]=this.images.get(s);let[l,f,a,d]=this.toPx([e.left,e.top,e.width,e.height]);await c,t.save(),i&&(this.drawRoundedRect(l,f,a,d,this.toPx(i)),t.clip()),o&&(t.fillStyle=o,t.fillRect(l,f,a,d));const g=r.width/r.height,u=a/d;if(!(n==="fill"||g===u)&&(n==="contain"||n==="cover"))if(n==="contain"?g>u:g<u){const p=r.width/a,w=d;d=r.height/p,f+=(w-d)*.5}else{const p=r.height/d,w=a;a=r.width/p,l+=(w-a)*.5}t.drawImage(r,l,f,a,d),t.restore()}async renderText(e){const{context:t}=this,[s,o,i]=this.toPx([e.left,e.top,e.fontSize||16]),n=e.lineHeight?this.toPx(e.lineHeight):i*1.43,{color:r="#333",fontFamily:c,fontWeight:l=400,fontSrc:f,textAlign:a="left",textDecoration:d}=e;f&&await this.fonts.get(f),t.save(),e.width&&(t.textAlign=a),t.textBaseline="top",t.fillStyle=r,t.font=`${l} ${i}px ${c}`;const g=e.width?this.toPx(e.width):void 0,u=R({left:s,textAlign:a,width:g});(e.width?this.getAllLines(e):[e.content]).forEach((p,w)=>{const v=o+(n-i)/2+n*w;if(t.fillText(p,u,v),d==="line-through"){const{width:b}=t.measureText(p),A=R({left:s,textAlign:a,textWidth:b,width:g});t.fillRect(A,v+i*.46,b,i/14)}}),t.restore()}getAllLines(e){const{context:t}=this,s=this.toPx(e.width),{content:o,lineClamp:i=1/0}=e,n=[];let r=0;for(;r<o.length&&n.length<i;){const c=r;r=M(o,l=>t.measureText(o.slice(r,l+1)).width>s)+1,r===c&&(r=c+1),i===n.length+1?n.push(o.slice(c,r-1)+"..."):n.push(o.slice(c,r))}return n}drawRoundedRect(e,t,s,o,i){const{context:n}=this;typeof i=="number"?i=[i,i,i,i]:i.length===1?i=[i[0],i[0],i[0],i[0]]:i.length===2?i=[i[0],i[1],i[0],i[1]]:i.length===3&&(i=[i[0],i[1],i[2],i[1]]);const[r,c,l,f]=i.map(a=>Math.min(a,s/2,o/2));n.save(),n.translate(e,t),n.beginPath(),n.moveTo(r,0),n.lineTo(s-c,0),n.arc(s-c,c,c,Math.PI*3/2,0,!1),n.lineTo(s,o-l),n.arc(s-l,o-l,l,0,Math.PI/2,!1),n.lineTo(f,o),n.arc(f,o-f,f,Math.PI/2,Math.PI,!1),n.lineTo(0,r),n.arc(r,r,r,Math.PI,Math.PI*3/2,!1),n.closePath(),n.restore()}loadAssets(e){e.forEach(t=>{const{type:s}=t;s==="image"&&this.loadImage(t),s==="text"&&t.fontFamily&&this.loadFont(t)})}loadImage(e){const{src:t}=e;if(!this.images.has(t)){const s=this.canvas.createImage();s.src=t,this.images.set(t,[s,new Promise((o,i)=>{s.onload=o,s.onerror=i})])}}loadFont(e){const{fontFamily:t,fontSrc:s}=e;this.fonts.has(s)||this.fonts.set(s,new Promise((o,i)=>{my.loadFontFace({family:t,source:`url('${s}')`,success:o,fail:i})}))}export(e){const{canvas:t}=this,{width:s,height:o}=this.options,{promise:i,resolve:n,reject:r}=m.withResolvers();return t.toTempFilePath(C(P({x:0,y:0,width:s,height:o},e),{success:n,fail:r})),i}}exports.MiniPoster=E; |
@@ -1,1 +0,1 @@ | ||
import{isUndefined as A,isNonEmptyArray as C,withResolvers as F}from"@inottn/fp-utils";const O=function(h,e){let t=0,n=h.length;for(;t<n;){const s=t+(n-t>>1);e(s)?n=s:t=s+1}return n-1},P=function({left:h,textAlign:e,textWidth:t,width:n}){if(A(n))return h;const s=n-(t||0);switch(e){case"center":return h+s/2;case"right":return h+s;default:return h}};var S=Object.defineProperty,j=Object.defineProperties,I=Object.getOwnPropertyDescriptors,T=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,m=(h,e,t)=>e in h?S(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,y=(h,e)=>{for(var t in e||(e={}))E.call(e,t)&&m(h,t,e[t]);if(T)for(var t of T(e))q.call(e,t)&&m(h,t,e[t]);return h},$=(h,e)=>j(h,I(e)),x=(h,e,t)=>(m(h,typeof e!="symbol"?e+"":e,t),t);class L{constructor(e,t){x(this,"canvas"),x(this,"context"),x(this,"options"),x(this,"images",new Map),x(this,"fonts",new Map),this.canvas=e,this.context=e.getContext("2d"),this.options=t}toPx(e){const{pixelRatio:t=1}=this.options;return typeof e=="number"?e*t:e.map(this.toPx.bind(this))}async render(e){const{canvas:t,context:n,options:s}=this,{width:i,height:r,pixelRatio:o=1,backgroundColor:l,borderRadius:d,overflow:f}=y(y({},s),e),{children:a}=e;if(!i||!r)throw Error("\u7F3A\u5C11 width \u6216 height \u53C2\u6570");if(t.width=i*o,t.height=r*o,n.save(),d&&(this.drawRoundRect(0,0,t.width,t.height,d),n.clip()),l&&(n.fillStyle=l,n.fillRect(0,0,t.width,t.height)),f!=="hidden"&&n.restore(),C(a)){this.loadAssets(a);for(const c of a)c.type==="image"&&await this.renderImage(c),c.type==="text"&&await this.renderText(c)}f==="hidden"&&n.restore()}async renderImage(e){const{context:t}=this,{src:n,backgroundColor:s,borderRadius:i,objectFit:r="fill"}=e,[o,l]=this.images.get(n);let[d,f,a,c]=this.toPx([e.left,e.top,e.width,e.height]);await l,t.save(),i&&(this.drawRoundRect(d,f,a,c,this.toPx(i)),t.clip()),s&&(t.fillStyle=s,t.fillRect(d,f,a,c));const g=o.width/o.height,p=a/c;if(!(r==="fill"||g===p)&&(r==="contain"||r==="cover"))if(r==="contain"?g>p:g<p){const u=o.width/a,w=c;c=o.height/u,f+=(w-c)*.5}else{const u=o.height/c,w=a;a=o.width/u,d+=(w-a)*.5}t.drawImage(o,d,f,a,c),t.restore()}async renderText(e){const{context:t}=this,[n,s,i]=this.toPx([e.left,e.top,e.fontSize||16]),r=e.lineHeight?this.toPx(e.lineHeight):i*1.43,{color:o="#333",fontFamily:l,fontWeight:d=400,fontSrc:f,textAlign:a="left",textDecoration:c}=e;f&&await this.fonts.get(f),t.save(),e.width&&(t.textAlign=a),t.textBaseline="top",t.fillStyle=o,t.font=`${d} ${i}px ${l}`;const g=e.width?this.toPx(e.width):void 0,p=P({left:n,textAlign:a,width:g});(e.width?this.getAllLines(e):[e.content]).forEach((u,w)=>{const v=s+(r-i)/2+r*w;if(t.fillText(u,p,v),c==="line-through"){const{width:b}=t.measureText(u),R=P({left:n,textAlign:a,textWidth:b,width:g});t.fillRect(R,v+i*.46,b,i/14)}}),t.restore()}getAllLines(e){const{context:t}=this,n=this.toPx(e.width),{content:s,lineClamp:i=1/0}=e,r=[];let o=0;for(;o<s.length&&r.length<i;){const l=o;o=O(s,d=>t.measureText(s.slice(o,d+1)).width>n)+1,o===l&&(o=l+1),i===r.length+1?r.push(s.slice(l,o-1)+"..."):r.push(s.slice(l,o))}return r}drawRoundRect(e,t,n,s,i){const{context:r}=this;typeof i=="number"?i=[i,i,i,i]:i.length===1?i=[i[0],i[0],i[0],i[0]]:i.length===2?i=[i[0],i[1],i[0],i[1]]:i.length===3&&(i=[i[0],i[1],i[2],i[1]]),r.beginPath(),r.moveTo(e+i[0],t),r.lineTo(e+n-i[1],t),r.quadraticCurveTo(e+n,t,e+n,t+i[1]),r.lineTo(e+n,t+s-i[2]),r.quadraticCurveTo(e+n,t+s,e+n-i[2],t+s),r.lineTo(e+i[3],t+s),r.quadraticCurveTo(e,t+s,e,t+s-i[3]),r.lineTo(e,t+i[0]),r.quadraticCurveTo(e,t,e+i[0],t),r.closePath()}loadAssets(e){e.forEach(t=>{const{type:n}=t;n==="image"&&this.loadImage(t),n==="text"&&t.fontFamily&&this.loadFont(t)})}loadImage(e){const{src:t}=e;if(!this.images.has(t)){const n=this.canvas.createImage();n.src=t,this.images.set(t,[n,new Promise((s,i)=>{n.onload=s,n.onerror=i})])}}loadFont(e){const{fontFamily:t,fontSrc:n}=e;this.fonts.has(n)||this.fonts.set(n,new Promise((s,i)=>{my.loadFontFace({family:t,source:`url('${n}')`,success:s,fail:i})}))}export(e){const{canvas:t}=this,{width:n,height:s}=this.options,{promise:i,resolve:r,reject:o}=F();return t.toTempFilePath($(y({x:0,y:0,width:n,height:s},e),{success:r,fail:o})),i}}export{L as MiniPoster}; | ||
import{isUndefined as A,isNonEmptyArray as T,withResolvers as F}from"@inottn/fp-utils";const M=function(h,e){let t=0,s=h.length;for(;t<s;){const o=t+(s-t>>1);e(o)?s=o:t=o+1}return s-1},b=function({left:h,textAlign:e,textWidth:t,width:s}){if(A(s))return h;const o=s-(t||0);switch(e){case"center":return h+o/2;case"right":return h+o;default:return h}};var O=Object.defineProperty,S=Object.defineProperties,j=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,m=(h,e,t)=>e in h?O(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,y=(h,e)=>{for(var t in e||(e={}))C.call(e,t)&&m(h,t,e[t]);if(R)for(var t of R(e))E.call(e,t)&&m(h,t,e[t]);return h},$=(h,e)=>S(h,j(e)),x=(h,e,t)=>(m(h,typeof e!="symbol"?e+"":e,t),t);class L{constructor(e,t){x(this,"canvas"),x(this,"context"),x(this,"options"),x(this,"images",new Map),x(this,"fonts",new Map),this.canvas=e,this.context=e.getContext("2d"),this.options=t}toPx(e){const{pixelRatio:t=1}=this.options;return typeof e=="number"?e*t:e.map(this.toPx.bind(this))}async render(e){const{canvas:t,context:s,options:o}=this,{width:i,height:n,pixelRatio:r=1,backgroundColor:c,borderRadius:l,overflow:f}=y(y({},o),e),{children:a}=e;if(!i||!n)throw Error("\u7F3A\u5C11 width \u6216 height \u53C2\u6570");if(t.width=i*r,t.height=n*r,s.save(),l&&(this.drawRoundedRect(0,0,t.width,t.height,this.toPx(l)),s.clip()),c&&(s.fillStyle=c,s.fillRect(0,0,t.width,t.height)),f!=="hidden"&&s.restore(),T(a)){this.loadAssets(a);for(const d of a)d.type==="image"&&await this.renderImage(d),d.type==="text"&&await this.renderText(d)}f==="hidden"&&s.restore()}async renderImage(e){const{context:t}=this,{src:s,backgroundColor:o,borderRadius:i,objectFit:n="fill"}=e,[r,c]=this.images.get(s);let[l,f,a,d]=this.toPx([e.left,e.top,e.width,e.height]);await c,t.save(),i&&(this.drawRoundedRect(l,f,a,d,this.toPx(i)),t.clip()),o&&(t.fillStyle=o,t.fillRect(l,f,a,d));const g=r.width/r.height,w=a/d;if(!(n==="fill"||g===w)&&(n==="contain"||n==="cover"))if(n==="contain"?g>w:g<w){const p=r.width/a,u=d;d=r.height/p,f+=(u-d)*.5}else{const p=r.height/d,u=a;a=r.width/p,l+=(u-a)*.5}t.drawImage(r,l,f,a,d),t.restore()}async renderText(e){const{context:t}=this,[s,o,i]=this.toPx([e.left,e.top,e.fontSize||16]),n=e.lineHeight?this.toPx(e.lineHeight):i*1.43,{color:r="#333",fontFamily:c,fontWeight:l=400,fontSrc:f,textAlign:a="left",textDecoration:d}=e;f&&await this.fonts.get(f),t.save(),e.width&&(t.textAlign=a),t.textBaseline="top",t.fillStyle=r,t.font=`${l} ${i}px ${c}`;const g=e.width?this.toPx(e.width):void 0,w=b({left:s,textAlign:a,width:g});(e.width?this.getAllLines(e):[e.content]).forEach((p,u)=>{const P=o+(n-i)/2+n*u;if(t.fillText(p,w,P),d==="line-through"){const{width:v}=t.measureText(p),I=b({left:s,textAlign:a,textWidth:v,width:g});t.fillRect(I,P+i*.46,v,i/14)}}),t.restore()}getAllLines(e){const{context:t}=this,s=this.toPx(e.width),{content:o,lineClamp:i=1/0}=e,n=[];let r=0;for(;r<o.length&&n.length<i;){const c=r;r=M(o,l=>t.measureText(o.slice(r,l+1)).width>s)+1,r===c&&(r=c+1),i===n.length+1?n.push(o.slice(c,r-1)+"..."):n.push(o.slice(c,r))}return n}drawRoundedRect(e,t,s,o,i){const{context:n}=this;typeof i=="number"?i=[i,i,i,i]:i.length===1?i=[i[0],i[0],i[0],i[0]]:i.length===2?i=[i[0],i[1],i[0],i[1]]:i.length===3&&(i=[i[0],i[1],i[2],i[1]]);const[r,c,l,f]=i.map(a=>Math.min(a,s/2,o/2));n.save(),n.translate(e,t),n.beginPath(),n.moveTo(r,0),n.lineTo(s-c,0),n.arc(s-c,c,c,Math.PI*3/2,0,!1),n.lineTo(s,o-l),n.arc(s-l,o-l,l,0,Math.PI/2,!1),n.lineTo(f,o),n.arc(f,o-f,f,Math.PI/2,Math.PI,!1),n.lineTo(0,r),n.arc(r,r,r,Math.PI,Math.PI*3/2,!1),n.closePath(),n.restore()}loadAssets(e){e.forEach(t=>{const{type:s}=t;s==="image"&&this.loadImage(t),s==="text"&&t.fontFamily&&this.loadFont(t)})}loadImage(e){const{src:t}=e;if(!this.images.has(t)){const s=this.canvas.createImage();s.src=t,this.images.set(t,[s,new Promise((o,i)=>{s.onload=o,s.onerror=i})])}}loadFont(e){const{fontFamily:t,fontSrc:s}=e;this.fonts.has(s)||this.fonts.set(s,new Promise((o,i)=>{my.loadFontFace({family:t,source:`url('${s}')`,success:o,fail:i})}))}export(e){const{canvas:t}=this,{width:s,height:o}=this.options,{promise:i,resolve:n,reject:r}=F();return t.toTempFilePath($(y({x:0,y:0,width:s,height:o},e),{success:n,fail:r})),i}}export{L as MiniPoster}; |
@@ -74,3 +74,3 @@ interface Canvas { | ||
getAllLines(data: TextConfig): string[]; | ||
drawRoundRect(x: number, y: number, width: number, height: number, radius: Radius): void; | ||
drawRoundedRect(x: number, y: number, width: number, height: number, radius: Radius): void; | ||
loadAssets(data: NonNullable<Config['children']>): void; | ||
@@ -77,0 +77,0 @@ loadImage(data: ImageConfig): void; |
{ | ||
"name": "@inottn/miniposter", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"packageManager": "pnpm@8.7.0", | ||
@@ -5,0 +5,0 @@ "description": "使用 canvas 轻松绘制小程序海报", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14454