@leafer-ui/draw 1.0.0-rc.18 → 1.0.0-rc.19

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/lib/draw.cjs CHANGED
@@ -875,7 +875,7 @@ exports.Leafer = class Leafer extends exports.Group {
875
875
  hittable: true,
876
876
  smooth: true,
877
877
  zoom: {
878
- min: 0.02,
878
+ min: 0.01,
879
879
  max: 256
880
880
  },
881
881
  move: {
package/lib/draw.esm.js CHANGED
@@ -874,7 +874,7 @@ let Leafer = class Leafer extends Group {
874
874
  hittable: true,
875
875
  smooth: true,
876
876
  zoom: {
877
- min: 0.02,
877
+ min: 0.01,
878
878
  max: 256
879
879
  },
880
880
  move: {
@@ -1 +1 @@
1
- import{defineLeafAttr as t,doStrokeType as e,defineKey as i,Debug as s,LeafData as o,PathConvert as r,OneRadian as a,dataProcessor as _,dataType as n,surfaceType as h,opacityType as d,sortType as p,maskType as l,eraserType as u,positionType as c,boundsType as y,scaleType as v,rotationType as g,autoLayoutType as f,hitType as w,strokeType as x,cursorType as m,naturalBoundsType as R,pathInputType as S,pathType as k,rewrite as b,Leaf as B,useModule as A,rewriteAble as C,pen as P,PathCorner as F,PathDrawer as D,UICreator as E,registerUI as L,Branch as T,ImageManager as W,DataHelper as I,Creator as M,CanvasManager as z,LeaferEvent as O,canvasSizeAttrs as N,Bounds as H,ResizeEvent as V,AutoBounds as Y,WaitHelper as X,Run as U,LayoutEvent as j,RenderEvent as G,WatchEvent as J,affectRenderBoundsType as $,BoundsHelper as K,Platform as q,PathCommandDataHelper as Q,affectStrokeBoundsType as Z,getPointData as tt,PointHelper as et,PathBounds as it,ImageEvent as st,Matrix as ot,MathHelper as rt,PathCreator as at}from"@leafer/core";export*from"@leafer/core";function _t(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var _=t.length-1;_>=0;_--)(o=t[_])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}"function"==typeof SuppressedError&&SuppressedError;const nt={},ht={},dt={},pt={},lt={},ut={},ct={},yt={},vt={};function gt(e){return(i,s)=>{const o=s+"Style";t(i,s,e,{set(t){this.__setAttr(s,t),this.waitLeafer((()=>{vt.setStyle&&vt.setStyle(this,o,t)}))}})}}function ft(i){return(s,o)=>{t(s,o,i,{set(t){this.__setAttr(o,t);const i=this.__;i.__useArrow="none"!==i.startArrow||"none"!==i.endArrow,e(this)}})}}function wt(e){return(i,s)=>{t(i,s,e,{set(t){this.__setAttr(s,t),t&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}})}}function xt(e){return(i,s)=>{t(i,s,e,{set(t){this.__setAttr(s,t),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}})}}function mt(){return(t,e)=>{const s="_"+e;i(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}const{parse:Rt}=r,St={},kt=s.get("UIData");class bt extends o{get __strokeWidth(){const{strokeWidth:t,strokeWidthFixed:e}=this;if(e){let{scaleX:e}=this.__leaf.__nowWorld;return e<0&&(e=-e),e>1?t/e:t}return t}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this.__leaf.leafer&&(this.__leaf.leafer.watcher.hasVisible=!0),this._visible=t}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,kt.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,kt.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("fill",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isFills=!0,this._fill||(this._fill=St)):(this.__isFills&&(this.__removeInput("fill"),lt.recycleImage("fill",this),this.__isFills=!1,this.__pixelFill&&(this.__pixelFill=!1)),this._fill=t)}setStroke(t){"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("stroke",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isStrokes=!0,this._stroke||(this._stroke=St)):(this.__isStrokes&&(this.__removeInput("stroke"),lt.recycleImage("stroke",this),this.__isStrokes=!1,this.__pixelStroke&&(this.__pixelStroke=!1)),this._stroke=t)}setPath(t){"string"==typeof t?(this.__setInput("path",t),this._path=Rt(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){this.__setInput("shadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._shadow=t.length?t:null):this._shadow=t?!1===t.visible?null:[t]:null}setInnerShadow(t){this.__setInput("innerShadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._innerShadow=t.length?t:null):this._innerShadow=t?!1===t.visible?null:[t]:null}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&pt.compute("fill",this.__leaf),e&&pt.compute("stroke",this.__leaf),this.__needComputePaint=!1}}const Bt={number:(t,e)=>"object"==typeof t?"percent"===t.type?t.value/100*e:t.value:t};class At extends bt{}class Ct extends At{get __boxStroke(){return!0}}class Pt extends At{}class Ft extends Ct{}class Dt extends bt{}class Et extends bt{get __boxStroke(){return!0}}class Lt extends bt{get __boxStroke(){return!0}}class Tt extends bt{}class Wt extends bt{}class It extends bt{}class Mt extends At{}const zt={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Ot extends bt{setFontWeight(t){"string"==typeof t?(this.__setInput("fontWeight",t),this._fontWeight=zt[t]||400):(this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t)}}class Nt extends Et{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.__leaf.image&&(this.__leaf.image=null),this.fill=t?{type:"image",mode:"strench",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(){const t=super.__getInputData();return delete t.fill,t}}class Ht extends Et{}const Vt={__updateStrokeSpread(){let t=0,e=0;const{stroke:i,hitStroke:s,strokeAlign:o,strokeWidth:r}=this.__;if((i||"all"===s)&&r&&"inside"!==o&&(e=t="center"===o?r/2:r,!this.__.__boxStroke)){const{miterLimit:e,strokeCap:i}=this.__,s="Line"!==this.__tag?1/Math.sin(e*a/2)*Math.sqrt(r)-t:0,o="none"===i?0:r;t+=Math.max(s,o)}return this.__layout.strokeBoxSpread=e,this.__.__useArrow&&(t+=5*r),t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o}=this.__;e&&e.forEach((e=>{t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)})),s&&(t=Math.max(t,s));let r=t=Math.ceil(t);return i&&i.forEach((t=>{r=Math.max(r,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)})),o&&(r=Math.max(r,o)),this.__layout.renderShapeSpread=r,t}},Yt={__updateChange(){const t=this.__;if(t.__useEffect){const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o}=this.__;t.__useEffect=!!(e||i||s||o)}t.__checkSingle();t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect?t.__complex=!0:t.__complex&&(t.__complex=!1)},__drawFast(t,e){Xt(this,t,e)},__draw(t,e){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:s,stroke:o,__drawAfterFill:r}=i;if(this.__drawRenderPath(t),i.__useEffect){const a=pt.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:_,innerShadow:n}=i;_&&ct.shadow(this,t,a),s&&(i.__isFills?pt.fills(s,this,t):pt.fill(s,this,t)),r&&this.__drawAfterFill(t,e),n&&ct.innerShadow(this,t,a),o&&(i.__isStrokes?pt.strokes(o,this,t):pt.stroke(o,this,t)),a.worldCanvas&&a.worldCanvas.recycle(),a.canvas.recycle()}else s&&(i.__isFills?pt.fills(s,this,t):pt.fill(s,this,t)),r&&this.__drawAfterFill(t,e),o&&(i.__isStrokes?pt.strokes(o,this,t):pt.stroke(o,this,t))}else i.__pathInputed?Xt(this,t,e):this.__drawFast(t,e)},__renderShape(t,e){if(this.__worldOpacity){t.setWorld(this.__nowWorld=this.__getNowWorld(e));const{fill:i,stroke:s}=this.__;this.__drawRenderPath(t),i&&(this.__.__pixelFill?pt.fills(i,this,t):pt.fill("#000000",this,t)),s&&(this.__.__pixelStroke?pt.strokes(s,this,t):pt.stroke("#000000",this,t))}}};function Xt(t,e,i){const{fill:s,stroke:o,__drawAfterFill:r}=t.__;t.__drawRenderPath(e),s&&pt.fill(s,t,e),r&&t.__drawAfterFill(e,i),o&&pt.stroke(o,t,e)}const Ut={__drawFast(t,e){const{width:i,height:s,fill:o,stroke:r,__drawAfterFill:a}=this.__;if(o&&(t.fillStyle=o,t.fillRect(0,0,i,s)),a&&this.__drawAfterFill(t,e),r){const{strokeAlign:e,__strokeWidth:o}=this.__;if(!o)return;t.setStroke(r,o,this.__);const a=o/2;switch(e){case"center":t.strokeRect(0,0,i,s);break;case"inside":t.strokeRect(a,a,i-o,s-o);break;case"outside":t.strokeRect(-a,-a,i+o,s+o)}}}};var jt;let Gt=jt=class extends B{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){"number"==typeof t?this.scaleX=this.scaleY=t:(this.scaleX=t.x,this.scaleY=t.y)}get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get pen(){return P.set(this.path=this.__.path||[]),P}constructor(t){super(t)}reset(t){}set(t){Object.assign(this,t)}get(t){return"string"==typeof t?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){}findOne(t,e){}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;if(!i){const{width:t,height:e}=this.boxBounds;(t||e)&&(P.set(i=[]),this.__drawPathByBox(P))}return t?r.toCanvasData(i,!0):i}getPathString(t,e){return r.stringify(this.getPath(t,e))}__onUpdateSize(){if(this.__.__input){const t=this.__;if(t.__needComputePaint=!0,t.lazy&&this.leafer&&!this.leafer.canvas.bounds.hit(this.__world))return;t.__computePaint()}}__updateRenderPath(){if(this.__.path){const t=this.__;t.__pathForRender=t.cornerRadius?F.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&dt.addArrows(this,!t.cornerRadius)}}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?D.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:i,width:s,height:o}=this.__layout.boxBounds;this.__.cornerRadius?t.roundRect(e,i,s,o,this.__.cornerRadius):t.rect(e,i,s,o)}export(t,e){return yt.export(this,t,e)}clone(){return jt.one(this.toJSON())}static one(t,e,i,s,o){return E.get(t.tag||this.prototype.__tag,t,e,i,s,o)}static registerUI(){L()(this)}static registerData(t){_(t)(this.prototype)}destroy(){this.fill=this.stroke=null,super.destroy()}};_t([_(bt)],Gt.prototype,"__",void 0),_t([mt()],Gt.prototype,"zoomLayer",void 0),_t([n("")],Gt.prototype,"id",void 0),_t([n("")],Gt.prototype,"name",void 0),_t([n("")],Gt.prototype,"className",void 0),_t([h("pass-through")],Gt.prototype,"blendMode",void 0),_t([d(1)],Gt.prototype,"opacity",void 0),_t([d(!0)],Gt.prototype,"visible",void 0),_t([gt(!1)],Gt.prototype,"selected",void 0),_t([gt(!1)],Gt.prototype,"disabled",void 0),_t([n(!1)],Gt.prototype,"locked",void 0),_t([p(0)],Gt.prototype,"zIndex",void 0),_t([l(!1)],Gt.prototype,"mask",void 0),_t([h("pixel")],Gt.prototype,"maskType",void 0),_t([u(!1)],Gt.prototype,"eraser",void 0),_t([c(0)],Gt.prototype,"x",void 0),_t([c(0)],Gt.prototype,"y",void 0),_t([y(100)],Gt.prototype,"width",void 0),_t([y(100)],Gt.prototype,"height",void 0),_t([v(1)],Gt.prototype,"scaleX",void 0),_t([v(1)],Gt.prototype,"scaleY",void 0),_t([g(0)],Gt.prototype,"rotation",void 0),_t([g(0)],Gt.prototype,"skewX",void 0),_t([g(0)],Gt.prototype,"skewY",void 0),_t([f()],Gt.prototype,"around",void 0),_t([n(!1)],Gt.prototype,"draggable",void 0),_t([n(!1)],Gt.prototype,"editable",void 0),_t([n("size")],Gt.prototype,"editSize",void 0),_t([w(!0)],Gt.prototype,"hittable",void 0),_t([w("path")],Gt.prototype,"hitFill",void 0),_t([x("path")],Gt.prototype,"hitStroke",void 0),_t([w(!1)],Gt.prototype,"hitBox",void 0),_t([w(!0)],Gt.prototype,"hitChildren",void 0),_t([w(!0)],Gt.prototype,"hitSelf",void 0),_t([w()],Gt.prototype,"hitRadius",void 0),_t([m("")],Gt.prototype,"cursor",void 0),_t([h()],Gt.prototype,"fill",void 0),_t([x()],Gt.prototype,"stroke",void 0),_t([x("inside")],Gt.prototype,"strokeAlign",void 0),_t([x(1)],Gt.prototype,"strokeWidth",void 0),_t([x(!1)],Gt.prototype,"strokeWidthFixed",void 0),_t([x("none")],Gt.prototype,"strokeCap",void 0),_t([x("miter")],Gt.prototype,"strokeJoin",void 0),_t([x()],Gt.prototype,"dashPattern",void 0),_t([x()],Gt.prototype,"dashOffset",void 0),_t([x(10)],Gt.prototype,"miterLimit",void 0),_t([n(!1)],Gt.prototype,"lazy",void 0),_t([R(1)],Gt.prototype,"pixelRatio",void 0),_t([S()],Gt.prototype,"path",void 0),_t([k()],Gt.prototype,"windingRule",void 0),_t([ft("none")],Gt.prototype,"startArrow",void 0),_t([ft("none")],Gt.prototype,"endArrow",void 0),_t([k(0)],Gt.prototype,"cornerRadius",void 0),_t([k()],Gt.prototype,"cornerSmoothing",void 0),_t([wt()],Gt.prototype,"shadow",void 0),_t([wt()],Gt.prototype,"innerShadow",void 0),_t([wt()],Gt.prototype,"blur",void 0),_t([wt()],Gt.prototype,"backgroundBlur",void 0),_t([wt()],Gt.prototype,"grayscale",void 0),_t([n()],Gt.prototype,"normalStyle",void 0),_t([n()],Gt.prototype,"hoverStyle",void 0),_t([n()],Gt.prototype,"pressStyle",void 0),_t([n()],Gt.prototype,"focusStyle",void 0),_t([n()],Gt.prototype,"selectedStyle",void 0),_t([n()],Gt.prototype,"disabledStyle",void 0),_t([b(B.prototype.reset)],Gt.prototype,"reset",null),Gt=jt=_t([A(Vt),A(Yt),C()],Gt);let Jt=class extends Gt{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t){if(t.children){const{children:e}=t;let i;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t),e.forEach((t=>{i=t.__?t:E.get(t.tag,t),this.add(i)})),t.children=e}else super.set(t)}toJSON(){const t=super.toJSON();return t.children=this.children.map((t=>t.toJSON())),t}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};_t([_(At)],Jt.prototype,"__",void 0),Jt=_t([A(T),L()],Jt);const $t=s.get("Leafer");let Kt=class extends Jt{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&W.isComplete}get layoutLocked(){return!this.layouter.running}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}constructor(t,e){super(e),this.config={type:"design",start:!0,hittable:!0,smooth:!0,zoom:{min:.02,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0,autoDistance:2}},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t)}init(t,e){if(this.canvas)return;let i;this.__setLeafer(this),t&&I.assign(this.config,t);const{config:s}=this;this.initType(s.type),this.canvas=M.canvas(s),this.__controllers.push(this.renderer=M.renderer(this,this.canvas,s),this.watcher=M.watcher(this,s),this.layouter=M.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(s),this.view=this.canvas.view,e?(this.__bindApp(e),i=e.running):(this.selector=M.selector(this),this.interaction=M.interaction(this,this.canvas,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=M.hitCanvasManager()),this.canvasManager=new z,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(this.canvas),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),this.onInit()}onInit(){}initType(t){}set(t){this.children?super.set(t):setTimeout((()=>{super.set(t)}))}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.ready?this.emitLeafer(O.RESTART):this.emitLeafer(O.START),this.__controllers.forEach((t=>t.start())),this.isApp||this.renderer.render(),this.running=!0)}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach((t=>t.stop())),this.running=!1,this.emitLeafer(O.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=I.copyAttrs({},t,N);Object.keys(e).forEach((t=>this[t]=e[t]))}forceFullRender(){this.forceRender()}forceRender(t){this.renderer.addBlock(t?new H(t):this.canvas.bounds),this.viewReady&&this.renderer.update()}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}__doResize(t){if(!this.canvas||this.canvas.isSameSize(t))return;const e=I.copyAttrs({},this.canvas,N);this.canvas.resize(t),this.__onResize(new V(t,e))}__onResize(t){this.emitEvent(t),I.copyAttrs(this.__,t,N),setTimeout((()=>{this.canvasManager&&this.canvasManager.clearRecycled()}),0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(t){t.width&&t.height||(this.autoLayout=new Y(t),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){this.canvas&&(N.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t&&(this.canvas.hittable=e)),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&N.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const i=I.copyAttrs({},this.canvas,N);i[t]=this.config[t]=e,e&&this.canvas.stopAutoLayout(),this.__doResize(i)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceFullRender()}__onCreated(){this.created=!0}__onReady(){this.ready||(this.ready=!0,this.emitLeafer(O.BEFORE_READY),this.emitLeafer(O.READY),this.emitLeafer(O.AFTER_READY),X.run(this.__readyWait))}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(O.VIEW_READY),X.run(this.__viewReadyWait))}__onNextRender(){if(this.viewReady){X.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1)}}__checkViewCompleted(t=!0){this.nextRender((()=>{this.imageReady&&(t&&this.emitLeafer(O.VIEW_COMPLETED),X.run(this.__viewCompletedWait),this.viewCompleted=!0)}))}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender((()=>this.interaction.updateCursor()))}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t)}zoom(t,e,i){}validScale(t){const{scaleX:e}=this.zoomLayer.__,{min:i,max:s}=this.app.config.zoom,o=Math.abs(e*t);return o<i?t=i/e:o>s&&(t=s/e),t}__checkUpdateLayout(){this.__layout.update()}emitLeafer(t){this.emitEvent(new O(t,this))}__listenEvents(){const t=U.start("FirstCreate "+this.innerName);this.once(O.START,(()=>U.end(t))),this.once(j.END,(()=>this.__onReady())),this.once(G.START,(()=>this.__onCreated())),this.once(G.END,(()=>this.__onViewReady())),this.__eventIds.push(this.on_(J.DATA,this.__onWatchData,this),this.on_(G.NEXT,this.__onNextRender,this),this.on_(j.CHECK_UPDATE,this.__checkUpdateLayout,this))}__removeListenEvents(){this.off_(this.__eventIds),this.__eventIds.length=0}destroy(){setTimeout((()=>{if(!this.destroyed)try{this.stop(),this.emitEvent(new O(O.END,this)),this.__removeListenEvents(),this.__controllers.forEach((t=>{this.parent&&t===this.interaction||t.destroy()})),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout((()=>{W.clearRecycled()}),100)}catch(t){$t.error(t)}}))}};_t([_(Pt)],Kt.prototype,"__",void 0),_t([y()],Kt.prototype,"pixelRatio",void 0),Kt=_t([L()],Kt);let qt=class extends Gt{get __tag(){return"Rect"}constructor(t){super(t)}};_t([_(Et)],qt.prototype,"__",void 0),qt=_t([A(Ut),C(),L()],qt);const Qt=qt.prototype,Zt=Jt.prototype,te={},{copy:ee,add:ie}=K;let se=class extends Jt{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){let t=this.__updateRectRenderSpread()||super.__updateRenderSpread();return this.__.__drawAfterFill="hide"===this.__.overflow,t||(t=this.__.__drawAfterFill?0:1),t}__updateRectBoxBounds(){}__updateBoxBounds(){const t=this.__;if(t.__autoSide&&this.children.length){if(this.leafer&&this.leafer.layouter.addExtra(this),super.__updateBoxBounds(),!t.__autoSize){const e=this.__layout.boxBounds;t.__autoWidth||(e.x=0,e.width=t.width),t.__autoHeight||(e.y=0,e.height=t.height)}}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){if(this.__updateRectRenderBounds(),!this.__.__drawAfterFill){const{renderBounds:t}=this.__layout;ee(te,t),super.__updateRenderBounds(),ie(t,te)}}__updateRectRenderBounds(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.__renderGroup(t,e))}__drawAfterFill(t,e){t.save(),t.clip(),this.__renderGroup(t,e),t.restore(),this.__.stroke&&this.__drawRenderPath(t)}};_t([_(Ct)],se.prototype,"__",void 0),_t([$("show")],se.prototype,"overflow",void 0),_t([b(Qt.__updateStrokeSpread)],se.prototype,"__updateStrokeSpread",null),_t([b(Qt.__updateRenderSpread)],se.prototype,"__updateRectRenderSpread",null),_t([b(Qt.__updateBoxBounds)],se.prototype,"__updateRectBoxBounds",null),_t([b(Qt.__updateStrokeBounds)],se.prototype,"__updateStrokeBounds",null),_t([b(Qt.__updateRenderBounds)],se.prototype,"__updateRectRenderBounds",null),_t([b(Qt.__updateChange)],se.prototype,"__updateRectChange",null),_t([b(Qt.__render)],se.prototype,"__renderRect",null),_t([b(Zt.__render)],se.prototype,"__renderGroup",null),se=_t([C(),L()],se);let oe=class extends se{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}};_t([_(Ft)],oe.prototype,"__",void 0),_t([h("#FFFFFF")],oe.prototype,"fill",void 0),_t([$("hide")],oe.prototype,"overflow",void 0),oe=_t([L()],oe);const{moveTo:re,closePath:ae,ellipse:_e}=Q;let ne=class extends Gt{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:o}=this.__,r=t/2,a=e/2,_=this.__.path=[];i?(s||o?(i<1&&_e(_,r,a,r*i,a*i,0,s,o,!1),_e(_,r,a,r,a,0,o,s,!0),i<1&&ae(_)):(i<1&&(_e(_,r,a,r*i,a*i),re(_,t,a)),_e(_,r,a,r,a,0,360,0,!0)),q.ellipseToCurve&&(this.__.path=this.getPath(!0))):s||o?(re(_,r,a),_e(_,r,a,r,a,0,s,o,!1),ae(_)):_e(_,r,a,r,a)}};_t([_(Lt)],ne.prototype,"__",void 0),_t([k(0)],ne.prototype,"innerRadius",void 0),_t([k(0)],ne.prototype,"startAngle",void 0),_t([k(0)],ne.prototype,"endAngle",void 0),ne=_t([L()],ne);const{moveTo:he,lineTo:de,drawPoints:pe}=Q,{rotate:le,getAngle:ue,getDistance:ce,defaultPoint:ye}=et,{toBounds:ve}=it;let ge=class extends Gt{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i=tt();return t&&(i.x=t),e&&le(i,e),i}set toPoint(t){this.width=ce(ye,t),this.rotation=ue(ye,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];this.__.points?pe(t,this.__.points,!1):(he(t,0,0),de(t,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?(pe(t.__pathForRender=[],t.points,t.curve,this.pathClosed),t.__useArrow&&dt.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?ve(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}};_t([_(Dt)],ge.prototype,"__",void 0),_t([Z("center")],ge.prototype,"strokeAlign",void 0),_t([y(0)],ge.prototype,"height",void 0),_t([k()],ge.prototype,"points",void 0),_t([k(0)],ge.prototype,"curve",void 0),ge=_t([L()],ge);const{sin:fe,cos:we,PI:xe}=Math,{moveTo:me,lineTo:Re,closePath:Se,drawPoints:ke}=Q,be=ge.prototype;let Be=class extends Gt{get __tag(){return"Polygon"}constructor(t){super(t),this.pathClosed=!0}__updatePath(){const t=this.__.path=[];if(this.__.points)ke(t,this.__.points,!1,!0);else{const{width:e,height:i,sides:s}=this.__,o=e/2,r=i/2;me(t,o,0);for(let e=1;e<s;e++)Re(t,o+o*fe(2*e*xe/s),r-r*we(2*e*xe/s))}Se(t)}__updateRenderPath(){}__updateBoxBounds(){}};_t([_(Tt)],Be.prototype,"__",void 0),_t([k(3)],Be.prototype,"sides",void 0),_t([k()],Be.prototype,"points",void 0),_t([k(0)],Be.prototype,"curve",void 0),_t([b(be.__updateRenderPath)],Be.prototype,"__updateRenderPath",null),_t([b(be.__updateBoxBounds)],Be.prototype,"__updateBoxBounds",null),Be=_t([C(),L()],Be);const{sin:Ae,cos:Ce,PI:Pe}=Math,{moveTo:Fe,lineTo:De,closePath:Ee}=Q;let Le=class extends Gt{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,o=t/2,r=e/2,a=this.__.path=[];Fe(a,o,0);for(let t=1;t<2*i;t++)De(a,o+(t%2==0?o:o*s)*Ae(t*Pe/i),r-(t%2==0?r:r*s)*Ce(t*Pe/i));Ee(a)}};_t([_(Wt)],Le.prototype,"__",void 0),_t([k(5)],Le.prototype,"corners",void 0),_t([k(.382)],Le.prototype,"innerRadius",void 0),Le=_t([L()],Le);let Te=class extends qt{get __tag(){return"Image"}get ready(){return!!this.image&&this.image.ready}constructor(t){super(t),this.on(st.LOADED,(t=>{"fill"===t.attrName&&t.attrValue.url===this.url&&(this.image=t.image)}))}destroy(){this.image=null,super.destroy()}};_t([_(Nt)],Te.prototype,"__",void 0),_t([y("")],Te.prototype,"url",void 0),Te=_t([L()],Te);let We=class extends qt{get __tag(){return"Canvas"}constructor(t){super(t),this.canvas=M.canvas(this.__),this.context=this.canvas.context,this.__.__drawAfterFill=!0}draw(t,e,i,s){t.__layout.update();const o=new ot(t.__world).invert(),r=new ot;e&&r.translate(e.x,e.y),i&&("number"==typeof i?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),o.multiplyParent(r),t.__render(this.canvas,{matrix:o.withScale()}),this.paint()}paint(){this.forceUpdate("fill")}__drawAfterFill(t,e){const i=this.canvas.view,{width:s,height:o}=this;this.__.cornerRadius?(t.save(),t.clip(),t.drawImage(this.canvas.view,0,0,i.width,i.height,0,0,s,o),t.restore()):t.drawImage(this.canvas.view,0,0,i.width,i.height,0,0,s,o)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e}=this.__;t.smooth!==e&&(t.smooth=e),t.resize(this.__)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null,this.context=null),super.destroy()}};_t([_(Ht)],We.prototype,"__",void 0),_t([xt(100)],We.prototype,"width",void 0),_t([xt(100)],We.prototype,"height",void 0),_t([xt(q.devicePixelRatio)],We.prototype,"pixelRatio",void 0),_t([xt(!0)],We.prototype,"smooth",void 0),_t([w("all")],We.prototype,"hitFill",void 0),We=_t([L()],We);const{copyAndSpread:Ie,includes:Me,spread:ze,setList:Oe}=K;let Ne=class extends Gt{get __tag(){return"Text"}get textDrawData(){return this.__layout.update(),this.__.__textDrawData}constructor(t){super(t)}__drawHitPath(t){const{__lineHeight:e,__baseLine:i,__textDrawData:s}=this.__;t.beginPath(),this.__.__letterSpacing<0?this.__drawPathByData(t):s.rows.forEach((s=>t.rect(s.x,s.y-i,s.width,e)))}__drawPathByData(t,e){const{x:i,y:s,width:o,height:r}=this.__layout.boxBounds;t.rect(i,s,o,r)}__drawRenderPath(t){t.font=this.__.__font}__updateTextDrawData(){const t=this.__;t.__textDrawData=nt.getDrawData(t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{lineHeight:i,letterSpacing:s,fontFamily:o,fontSize:r,fontWeight:a,italic:_,textCase:n,textOverflow:h,padding:d}=t,p=t.__autoWidth,l=t.__autoHeight;t.__lineHeight=Bt.number(i,r),t.__letterSpacing=Bt.number(s,r),t.__padding=d?rt.fourNumber(d):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${_?"italic ":""}${"small-caps"===n?"small-caps ":""}${"normal"!==a?a+" ":""}${r}px ${o}`,t.__clipText="show"!==h&&!t.__autoSize,this.__updateTextDrawData();const{bounds:u}=t.__textDrawData,c=e.boxBounds;if(t.__lineHeight<r&&ze(u,r/2),p||l){if(c.x=p?u.x:0,c.y=l?u.y:0,c.width=p?u.width:t.width,c.height=l?u.height:t.height,d){const[e,i,s,o]=t.__padding;p&&(c.x-=o,c.width+=i+o),l&&(c.y-=e,c.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();const y=Me(c,u)?c:u;y!==e.contentBounds?(e.contentBounds=y,e.renderChanged=!0,Oe(t.__textBoxBounds={},[c,u])):t.__textBoxBounds=y}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.__layout.boxBounds===this.__layout.contentBounds?0:1),t}__updateRenderBounds(){Ie(this.__layout.renderBounds,this.__.__textBoxBounds,this.__layout.renderSpread)}};_t([_(Ot)],Ne.prototype,"__",void 0),_t([y(0)],Ne.prototype,"width",void 0),_t([y(0)],Ne.prototype,"height",void 0),_t([y(0)],Ne.prototype,"padding",void 0),_t([h("#000000")],Ne.prototype,"fill",void 0),_t([Z("outside")],Ne.prototype,"strokeAlign",void 0),_t([w("all")],Ne.prototype,"hitFill",void 0),_t([y("")],Ne.prototype,"text",void 0),_t([y("L")],Ne.prototype,"fontFamily",void 0),_t([y(12)],Ne.prototype,"fontSize",void 0),_t([y("normal")],Ne.prototype,"fontWeight",void 0),_t([y(!1)],Ne.prototype,"italic",void 0),_t([y("none")],Ne.prototype,"textCase",void 0),_t([y("none")],Ne.prototype,"textDecoration",void 0),_t([y(0)],Ne.prototype,"letterSpacing",void 0),_t([y({type:"percent",value:150})],Ne.prototype,"lineHeight",void 0),_t([y(0)],Ne.prototype,"paraIndent",void 0),_t([y(0)],Ne.prototype,"paraSpacing",void 0),_t([y("left")],Ne.prototype,"textAlign",void 0),_t([y("top")],Ne.prototype,"verticalAlign",void 0),_t([y("normal")],Ne.prototype,"textWrap",void 0),_t([y("show")],Ne.prototype,"textOverflow",void 0),Ne=_t([L()],Ne);let He=class extends Gt{get __tag(){return"Path"}constructor(t){super(t),this.__.__pathInputed=2}};_t([_(It)],He.prototype,"__",void 0),_t([Z("center")],He.prototype,"strokeAlign",void 0),He=_t([L()],He);let Ve=class extends Jt{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(t){const e=this.pathElement=new He(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this.__path.length=0,this.paint(),this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,o,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,o){return this}ellipse(t,e,i,s,o,r,a,_){return this}arc(t,e,i,s,o,r){return this}arcTo(t,e,i,s,o){return this}drawEllipse(t,e,i,s,o,r,a,_){return this}drawArc(t,e,i,s,o,r){return this}drawPoints(t,e,i){return this}paint(){this.pathElement.forceUpdate("path")}};_t([_(Mt)],Ve.prototype,"__",void 0),_t([(t,e)=>{i(t,e,{get(){return this.__path}})}],Ve.prototype,"path",void 0),Ve=_t([A(at,["beginPath","path"]),L()],Ve);export{se as Box,Ct as BoxData,We as Canvas,Ht as CanvasData,ht as ColorConvert,ct as Effect,ne as Ellipse,Lt as EllipseData,yt as Export,oe as Frame,Ft as FrameData,Jt as Group,At as GroupData,Te as Image,Nt as ImageData,Kt as Leafer,Pt as LeaferData,ge as Line,Dt as LineData,pt as Paint,ut as PaintGradient,lt as PaintImage,He as Path,dt as PathArrow,It as PathData,Ve as Pen,Mt as PenData,Be as Polygon,Tt as PolygonData,qt as Rect,Et as RectData,Ut as RectRender,Le as Star,Wt as StarData,vt as State,Ne as Text,nt as TextConvert,Ot as TextData,Gt as UI,Vt as UIBounds,bt as UIData,Yt as UIRender,Bt as UnitConvert,ft as arrowType,wt as effectType,xt as resizeType,gt as stateType,mt as zoomLayerType};
1
+ import{defineLeafAttr as t,doStrokeType as e,defineKey as i,Debug as s,LeafData as o,PathConvert as r,OneRadian as a,dataProcessor as _,dataType as n,surfaceType as h,opacityType as d,sortType as p,maskType as l,eraserType as u,positionType as c,boundsType as y,scaleType as v,rotationType as g,autoLayoutType as f,hitType as w,strokeType as x,cursorType as m,naturalBoundsType as R,pathInputType as S,pathType as k,rewrite as b,Leaf as B,useModule as A,rewriteAble as C,pen as P,PathCorner as F,PathDrawer as D,UICreator as E,registerUI as L,Branch as T,ImageManager as W,DataHelper as I,Creator as M,CanvasManager as z,LeaferEvent as O,canvasSizeAttrs as N,Bounds as H,ResizeEvent as V,AutoBounds as Y,WaitHelper as X,Run as U,LayoutEvent as j,RenderEvent as G,WatchEvent as J,affectRenderBoundsType as $,BoundsHelper as K,Platform as q,PathCommandDataHelper as Q,affectStrokeBoundsType as Z,getPointData as tt,PointHelper as et,PathBounds as it,ImageEvent as st,Matrix as ot,MathHelper as rt,PathCreator as at}from"@leafer/core";export*from"@leafer/core";function _t(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var _=t.length-1;_>=0;_--)(o=t[_])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}"function"==typeof SuppressedError&&SuppressedError;const nt={},ht={},dt={},pt={},lt={},ut={},ct={},yt={},vt={};function gt(e){return(i,s)=>{const o=s+"Style";t(i,s,e,{set(t){this.__setAttr(s,t),this.waitLeafer((()=>{vt.setStyle&&vt.setStyle(this,o,t)}))}})}}function ft(i){return(s,o)=>{t(s,o,i,{set(t){this.__setAttr(o,t);const i=this.__;i.__useArrow="none"!==i.startArrow||"none"!==i.endArrow,e(this)}})}}function wt(e){return(i,s)=>{t(i,s,e,{set(t){this.__setAttr(s,t),t&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}})}}function xt(e){return(i,s)=>{t(i,s,e,{set(t){this.__setAttr(s,t),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}})}}function mt(){return(t,e)=>{const s="_"+e;i(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}const{parse:Rt}=r,St={},kt=s.get("UIData");class bt extends o{get __strokeWidth(){const{strokeWidth:t,strokeWidthFixed:e}=this;if(e){let{scaleX:e}=this.__leaf.__nowWorld;return e<0&&(e=-e),e>1?t/e:t}return t}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this.__leaf.leafer&&(this.__leaf.leafer.watcher.hasVisible=!0),this._visible=t}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,kt.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,kt.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("fill",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isFills=!0,this._fill||(this._fill=St)):(this.__isFills&&(this.__removeInput("fill"),lt.recycleImage("fill",this),this.__isFills=!1,this.__pixelFill&&(this.__pixelFill=!1)),this._fill=t)}setStroke(t){"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("stroke",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isStrokes=!0,this._stroke||(this._stroke=St)):(this.__isStrokes&&(this.__removeInput("stroke"),lt.recycleImage("stroke",this),this.__isStrokes=!1,this.__pixelStroke&&(this.__pixelStroke=!1)),this._stroke=t)}setPath(t){"string"==typeof t?(this.__setInput("path",t),this._path=Rt(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){this.__setInput("shadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._shadow=t.length?t:null):this._shadow=t?!1===t.visible?null:[t]:null}setInnerShadow(t){this.__setInput("innerShadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._innerShadow=t.length?t:null):this._innerShadow=t?!1===t.visible?null:[t]:null}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&pt.compute("fill",this.__leaf),e&&pt.compute("stroke",this.__leaf),this.__needComputePaint=!1}}const Bt={number:(t,e)=>"object"==typeof t?"percent"===t.type?t.value/100*e:t.value:t};class At extends bt{}class Ct extends At{get __boxStroke(){return!0}}class Pt extends At{}class Ft extends Ct{}class Dt extends bt{}class Et extends bt{get __boxStroke(){return!0}}class Lt extends bt{get __boxStroke(){return!0}}class Tt extends bt{}class Wt extends bt{}class It extends bt{}class Mt extends At{}const zt={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Ot extends bt{setFontWeight(t){"string"==typeof t?(this.__setInput("fontWeight",t),this._fontWeight=zt[t]||400):(this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t)}}class Nt extends Et{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.__leaf.image&&(this.__leaf.image=null),this.fill=t?{type:"image",mode:"strench",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(){const t=super.__getInputData();return delete t.fill,t}}class Ht extends Et{}const Vt={__updateStrokeSpread(){let t=0,e=0;const{stroke:i,hitStroke:s,strokeAlign:o,strokeWidth:r}=this.__;if((i||"all"===s)&&r&&"inside"!==o&&(e=t="center"===o?r/2:r,!this.__.__boxStroke)){const{miterLimit:e,strokeCap:i}=this.__,s="Line"!==this.__tag?1/Math.sin(e*a/2)*Math.sqrt(r)-t:0,o="none"===i?0:r;t+=Math.max(s,o)}return this.__layout.strokeBoxSpread=e,this.__.__useArrow&&(t+=5*r),t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o}=this.__;e&&e.forEach((e=>{t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)})),s&&(t=Math.max(t,s));let r=t=Math.ceil(t);return i&&i.forEach((t=>{r=Math.max(r,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)})),o&&(r=Math.max(r,o)),this.__layout.renderShapeSpread=r,t}},Yt={__updateChange(){const t=this.__;if(t.__useEffect){const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o}=this.__;t.__useEffect=!!(e||i||s||o)}t.__checkSingle();t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect?t.__complex=!0:t.__complex&&(t.__complex=!1)},__drawFast(t,e){Xt(this,t,e)},__draw(t,e){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:s,stroke:o,__drawAfterFill:r}=i;if(this.__drawRenderPath(t),i.__useEffect){const a=pt.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:_,innerShadow:n}=i;_&&ct.shadow(this,t,a),s&&(i.__isFills?pt.fills(s,this,t):pt.fill(s,this,t)),r&&this.__drawAfterFill(t,e),n&&ct.innerShadow(this,t,a),o&&(i.__isStrokes?pt.strokes(o,this,t):pt.stroke(o,this,t)),a.worldCanvas&&a.worldCanvas.recycle(),a.canvas.recycle()}else s&&(i.__isFills?pt.fills(s,this,t):pt.fill(s,this,t)),r&&this.__drawAfterFill(t,e),o&&(i.__isStrokes?pt.strokes(o,this,t):pt.stroke(o,this,t))}else i.__pathInputed?Xt(this,t,e):this.__drawFast(t,e)},__renderShape(t,e){if(this.__worldOpacity){t.setWorld(this.__nowWorld=this.__getNowWorld(e));const{fill:i,stroke:s}=this.__;this.__drawRenderPath(t),i&&(this.__.__pixelFill?pt.fills(i,this,t):pt.fill("#000000",this,t)),s&&(this.__.__pixelStroke?pt.strokes(s,this,t):pt.stroke("#000000",this,t))}}};function Xt(t,e,i){const{fill:s,stroke:o,__drawAfterFill:r}=t.__;t.__drawRenderPath(e),s&&pt.fill(s,t,e),r&&t.__drawAfterFill(e,i),o&&pt.stroke(o,t,e)}const Ut={__drawFast(t,e){const{width:i,height:s,fill:o,stroke:r,__drawAfterFill:a}=this.__;if(o&&(t.fillStyle=o,t.fillRect(0,0,i,s)),a&&this.__drawAfterFill(t,e),r){const{strokeAlign:e,__strokeWidth:o}=this.__;if(!o)return;t.setStroke(r,o,this.__);const a=o/2;switch(e){case"center":t.strokeRect(0,0,i,s);break;case"inside":t.strokeRect(a,a,i-o,s-o);break;case"outside":t.strokeRect(-a,-a,i+o,s+o)}}}};var jt;let Gt=jt=class extends B{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){"number"==typeof t?this.scaleX=this.scaleY=t:(this.scaleX=t.x,this.scaleY=t.y)}get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get pen(){return P.set(this.path=this.__.path||[]),P}constructor(t){super(t)}reset(t){}set(t){Object.assign(this,t)}get(t){return"string"==typeof t?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){}findOne(t,e){}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;if(!i){const{width:t,height:e}=this.boxBounds;(t||e)&&(P.set(i=[]),this.__drawPathByBox(P))}return t?r.toCanvasData(i,!0):i}getPathString(t,e){return r.stringify(this.getPath(t,e))}__onUpdateSize(){if(this.__.__input){const t=this.__;if(t.__needComputePaint=!0,t.lazy&&this.leafer&&!this.leafer.canvas.bounds.hit(this.__world))return;t.__computePaint()}}__updateRenderPath(){if(this.__.path){const t=this.__;t.__pathForRender=t.cornerRadius?F.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&dt.addArrows(this,!t.cornerRadius)}}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?D.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:i,width:s,height:o}=this.__layout.boxBounds;this.__.cornerRadius?t.roundRect(e,i,s,o,this.__.cornerRadius):t.rect(e,i,s,o)}export(t,e){return yt.export(this,t,e)}clone(){return jt.one(this.toJSON())}static one(t,e,i,s,o){return E.get(t.tag||this.prototype.__tag,t,e,i,s,o)}static registerUI(){L()(this)}static registerData(t){_(t)(this.prototype)}destroy(){this.fill=this.stroke=null,super.destroy()}};_t([_(bt)],Gt.prototype,"__",void 0),_t([mt()],Gt.prototype,"zoomLayer",void 0),_t([n("")],Gt.prototype,"id",void 0),_t([n("")],Gt.prototype,"name",void 0),_t([n("")],Gt.prototype,"className",void 0),_t([h("pass-through")],Gt.prototype,"blendMode",void 0),_t([d(1)],Gt.prototype,"opacity",void 0),_t([d(!0)],Gt.prototype,"visible",void 0),_t([gt(!1)],Gt.prototype,"selected",void 0),_t([gt(!1)],Gt.prototype,"disabled",void 0),_t([n(!1)],Gt.prototype,"locked",void 0),_t([p(0)],Gt.prototype,"zIndex",void 0),_t([l(!1)],Gt.prototype,"mask",void 0),_t([h("pixel")],Gt.prototype,"maskType",void 0),_t([u(!1)],Gt.prototype,"eraser",void 0),_t([c(0)],Gt.prototype,"x",void 0),_t([c(0)],Gt.prototype,"y",void 0),_t([y(100)],Gt.prototype,"width",void 0),_t([y(100)],Gt.prototype,"height",void 0),_t([v(1)],Gt.prototype,"scaleX",void 0),_t([v(1)],Gt.prototype,"scaleY",void 0),_t([g(0)],Gt.prototype,"rotation",void 0),_t([g(0)],Gt.prototype,"skewX",void 0),_t([g(0)],Gt.prototype,"skewY",void 0),_t([f()],Gt.prototype,"around",void 0),_t([n(!1)],Gt.prototype,"draggable",void 0),_t([n(!1)],Gt.prototype,"editable",void 0),_t([n("size")],Gt.prototype,"editSize",void 0),_t([w(!0)],Gt.prototype,"hittable",void 0),_t([w("path")],Gt.prototype,"hitFill",void 0),_t([x("path")],Gt.prototype,"hitStroke",void 0),_t([w(!1)],Gt.prototype,"hitBox",void 0),_t([w(!0)],Gt.prototype,"hitChildren",void 0),_t([w(!0)],Gt.prototype,"hitSelf",void 0),_t([w()],Gt.prototype,"hitRadius",void 0),_t([m("")],Gt.prototype,"cursor",void 0),_t([h()],Gt.prototype,"fill",void 0),_t([x()],Gt.prototype,"stroke",void 0),_t([x("inside")],Gt.prototype,"strokeAlign",void 0),_t([x(1)],Gt.prototype,"strokeWidth",void 0),_t([x(!1)],Gt.prototype,"strokeWidthFixed",void 0),_t([x("none")],Gt.prototype,"strokeCap",void 0),_t([x("miter")],Gt.prototype,"strokeJoin",void 0),_t([x()],Gt.prototype,"dashPattern",void 0),_t([x()],Gt.prototype,"dashOffset",void 0),_t([x(10)],Gt.prototype,"miterLimit",void 0),_t([n(!1)],Gt.prototype,"lazy",void 0),_t([R(1)],Gt.prototype,"pixelRatio",void 0),_t([S()],Gt.prototype,"path",void 0),_t([k()],Gt.prototype,"windingRule",void 0),_t([ft("none")],Gt.prototype,"startArrow",void 0),_t([ft("none")],Gt.prototype,"endArrow",void 0),_t([k(0)],Gt.prototype,"cornerRadius",void 0),_t([k()],Gt.prototype,"cornerSmoothing",void 0),_t([wt()],Gt.prototype,"shadow",void 0),_t([wt()],Gt.prototype,"innerShadow",void 0),_t([wt()],Gt.prototype,"blur",void 0),_t([wt()],Gt.prototype,"backgroundBlur",void 0),_t([wt()],Gt.prototype,"grayscale",void 0),_t([n()],Gt.prototype,"normalStyle",void 0),_t([n()],Gt.prototype,"hoverStyle",void 0),_t([n()],Gt.prototype,"pressStyle",void 0),_t([n()],Gt.prototype,"focusStyle",void 0),_t([n()],Gt.prototype,"selectedStyle",void 0),_t([n()],Gt.prototype,"disabledStyle",void 0),_t([b(B.prototype.reset)],Gt.prototype,"reset",null),Gt=jt=_t([A(Vt),A(Yt),C()],Gt);let Jt=class extends Gt{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t){if(t.children){const{children:e}=t;let i;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t),e.forEach((t=>{i=t.__?t:E.get(t.tag,t),this.add(i)})),t.children=e}else super.set(t)}toJSON(){const t=super.toJSON();return t.children=this.children.map((t=>t.toJSON())),t}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};_t([_(At)],Jt.prototype,"__",void 0),Jt=_t([A(T),L()],Jt);const $t=s.get("Leafer");let Kt=class extends Jt{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&W.isComplete}get layoutLocked(){return!this.layouter.running}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}constructor(t,e){super(e),this.config={type:"design",start:!0,hittable:!0,smooth:!0,zoom:{min:.01,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0,autoDistance:2}},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t)}init(t,e){if(this.canvas)return;let i;this.__setLeafer(this),t&&I.assign(this.config,t);const{config:s}=this;this.initType(s.type),this.canvas=M.canvas(s),this.__controllers.push(this.renderer=M.renderer(this,this.canvas,s),this.watcher=M.watcher(this,s),this.layouter=M.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(s),this.view=this.canvas.view,e?(this.__bindApp(e),i=e.running):(this.selector=M.selector(this),this.interaction=M.interaction(this,this.canvas,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=M.hitCanvasManager()),this.canvasManager=new z,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(this.canvas),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),this.onInit()}onInit(){}initType(t){}set(t){this.children?super.set(t):setTimeout((()=>{super.set(t)}))}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.ready?this.emitLeafer(O.RESTART):this.emitLeafer(O.START),this.__controllers.forEach((t=>t.start())),this.isApp||this.renderer.render(),this.running=!0)}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach((t=>t.stop())),this.running=!1,this.emitLeafer(O.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=I.copyAttrs({},t,N);Object.keys(e).forEach((t=>this[t]=e[t]))}forceFullRender(){this.forceRender()}forceRender(t){this.renderer.addBlock(t?new H(t):this.canvas.bounds),this.viewReady&&this.renderer.update()}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}__doResize(t){if(!this.canvas||this.canvas.isSameSize(t))return;const e=I.copyAttrs({},this.canvas,N);this.canvas.resize(t),this.__onResize(new V(t,e))}__onResize(t){this.emitEvent(t),I.copyAttrs(this.__,t,N),setTimeout((()=>{this.canvasManager&&this.canvasManager.clearRecycled()}),0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(t){t.width&&t.height||(this.autoLayout=new Y(t),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){this.canvas&&(N.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t&&(this.canvas.hittable=e)),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&N.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const i=I.copyAttrs({},this.canvas,N);i[t]=this.config[t]=e,e&&this.canvas.stopAutoLayout(),this.__doResize(i)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceFullRender()}__onCreated(){this.created=!0}__onReady(){this.ready||(this.ready=!0,this.emitLeafer(O.BEFORE_READY),this.emitLeafer(O.READY),this.emitLeafer(O.AFTER_READY),X.run(this.__readyWait))}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(O.VIEW_READY),X.run(this.__viewReadyWait))}__onNextRender(){if(this.viewReady){X.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1)}}__checkViewCompleted(t=!0){this.nextRender((()=>{this.imageReady&&(t&&this.emitLeafer(O.VIEW_COMPLETED),X.run(this.__viewCompletedWait),this.viewCompleted=!0)}))}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender((()=>this.interaction.updateCursor()))}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t)}zoom(t,e,i){}validScale(t){const{scaleX:e}=this.zoomLayer.__,{min:i,max:s}=this.app.config.zoom,o=Math.abs(e*t);return o<i?t=i/e:o>s&&(t=s/e),t}__checkUpdateLayout(){this.__layout.update()}emitLeafer(t){this.emitEvent(new O(t,this))}__listenEvents(){const t=U.start("FirstCreate "+this.innerName);this.once(O.START,(()=>U.end(t))),this.once(j.END,(()=>this.__onReady())),this.once(G.START,(()=>this.__onCreated())),this.once(G.END,(()=>this.__onViewReady())),this.__eventIds.push(this.on_(J.DATA,this.__onWatchData,this),this.on_(G.NEXT,this.__onNextRender,this),this.on_(j.CHECK_UPDATE,this.__checkUpdateLayout,this))}__removeListenEvents(){this.off_(this.__eventIds),this.__eventIds.length=0}destroy(){setTimeout((()=>{if(!this.destroyed)try{this.stop(),this.emitEvent(new O(O.END,this)),this.__removeListenEvents(),this.__controllers.forEach((t=>{this.parent&&t===this.interaction||t.destroy()})),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout((()=>{W.clearRecycled()}),100)}catch(t){$t.error(t)}}))}};_t([_(Pt)],Kt.prototype,"__",void 0),_t([y()],Kt.prototype,"pixelRatio",void 0),Kt=_t([L()],Kt);let qt=class extends Gt{get __tag(){return"Rect"}constructor(t){super(t)}};_t([_(Et)],qt.prototype,"__",void 0),qt=_t([A(Ut),C(),L()],qt);const Qt=qt.prototype,Zt=Jt.prototype,te={},{copy:ee,add:ie}=K;let se=class extends Jt{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){let t=this.__updateRectRenderSpread()||super.__updateRenderSpread();return this.__.__drawAfterFill="hide"===this.__.overflow,t||(t=this.__.__drawAfterFill?0:1),t}__updateRectBoxBounds(){}__updateBoxBounds(){const t=this.__;if(t.__autoSide&&this.children.length){if(this.leafer&&this.leafer.layouter.addExtra(this),super.__updateBoxBounds(),!t.__autoSize){const e=this.__layout.boxBounds;t.__autoWidth||(e.x=0,e.width=t.width),t.__autoHeight||(e.y=0,e.height=t.height)}}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){if(this.__updateRectRenderBounds(),!this.__.__drawAfterFill){const{renderBounds:t}=this.__layout;ee(te,t),super.__updateRenderBounds(),ie(t,te)}}__updateRectRenderBounds(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.__renderGroup(t,e))}__drawAfterFill(t,e){t.save(),t.clip(),this.__renderGroup(t,e),t.restore(),this.__.stroke&&this.__drawRenderPath(t)}};_t([_(Ct)],se.prototype,"__",void 0),_t([$("show")],se.prototype,"overflow",void 0),_t([b(Qt.__updateStrokeSpread)],se.prototype,"__updateStrokeSpread",null),_t([b(Qt.__updateRenderSpread)],se.prototype,"__updateRectRenderSpread",null),_t([b(Qt.__updateBoxBounds)],se.prototype,"__updateRectBoxBounds",null),_t([b(Qt.__updateStrokeBounds)],se.prototype,"__updateStrokeBounds",null),_t([b(Qt.__updateRenderBounds)],se.prototype,"__updateRectRenderBounds",null),_t([b(Qt.__updateChange)],se.prototype,"__updateRectChange",null),_t([b(Qt.__render)],se.prototype,"__renderRect",null),_t([b(Zt.__render)],se.prototype,"__renderGroup",null),se=_t([C(),L()],se);let oe=class extends se{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}};_t([_(Ft)],oe.prototype,"__",void 0),_t([h("#FFFFFF")],oe.prototype,"fill",void 0),_t([$("hide")],oe.prototype,"overflow",void 0),oe=_t([L()],oe);const{moveTo:re,closePath:ae,ellipse:_e}=Q;let ne=class extends Gt{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:o}=this.__,r=t/2,a=e/2,_=this.__.path=[];i?(s||o?(i<1&&_e(_,r,a,r*i,a*i,0,s,o,!1),_e(_,r,a,r,a,0,o,s,!0),i<1&&ae(_)):(i<1&&(_e(_,r,a,r*i,a*i),re(_,t,a)),_e(_,r,a,r,a,0,360,0,!0)),q.ellipseToCurve&&(this.__.path=this.getPath(!0))):s||o?(re(_,r,a),_e(_,r,a,r,a,0,s,o,!1),ae(_)):_e(_,r,a,r,a)}};_t([_(Lt)],ne.prototype,"__",void 0),_t([k(0)],ne.prototype,"innerRadius",void 0),_t([k(0)],ne.prototype,"startAngle",void 0),_t([k(0)],ne.prototype,"endAngle",void 0),ne=_t([L()],ne);const{moveTo:he,lineTo:de,drawPoints:pe}=Q,{rotate:le,getAngle:ue,getDistance:ce,defaultPoint:ye}=et,{toBounds:ve}=it;let ge=class extends Gt{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i=tt();return t&&(i.x=t),e&&le(i,e),i}set toPoint(t){this.width=ce(ye,t),this.rotation=ue(ye,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];this.__.points?pe(t,this.__.points,!1):(he(t,0,0),de(t,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?(pe(t.__pathForRender=[],t.points,t.curve,this.pathClosed),t.__useArrow&&dt.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?ve(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}};_t([_(Dt)],ge.prototype,"__",void 0),_t([Z("center")],ge.prototype,"strokeAlign",void 0),_t([y(0)],ge.prototype,"height",void 0),_t([k()],ge.prototype,"points",void 0),_t([k(0)],ge.prototype,"curve",void 0),ge=_t([L()],ge);const{sin:fe,cos:we,PI:xe}=Math,{moveTo:me,lineTo:Re,closePath:Se,drawPoints:ke}=Q,be=ge.prototype;let Be=class extends Gt{get __tag(){return"Polygon"}constructor(t){super(t),this.pathClosed=!0}__updatePath(){const t=this.__.path=[];if(this.__.points)ke(t,this.__.points,!1,!0);else{const{width:e,height:i,sides:s}=this.__,o=e/2,r=i/2;me(t,o,0);for(let e=1;e<s;e++)Re(t,o+o*fe(2*e*xe/s),r-r*we(2*e*xe/s))}Se(t)}__updateRenderPath(){}__updateBoxBounds(){}};_t([_(Tt)],Be.prototype,"__",void 0),_t([k(3)],Be.prototype,"sides",void 0),_t([k()],Be.prototype,"points",void 0),_t([k(0)],Be.prototype,"curve",void 0),_t([b(be.__updateRenderPath)],Be.prototype,"__updateRenderPath",null),_t([b(be.__updateBoxBounds)],Be.prototype,"__updateBoxBounds",null),Be=_t([C(),L()],Be);const{sin:Ae,cos:Ce,PI:Pe}=Math,{moveTo:Fe,lineTo:De,closePath:Ee}=Q;let Le=class extends Gt{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,o=t/2,r=e/2,a=this.__.path=[];Fe(a,o,0);for(let t=1;t<2*i;t++)De(a,o+(t%2==0?o:o*s)*Ae(t*Pe/i),r-(t%2==0?r:r*s)*Ce(t*Pe/i));Ee(a)}};_t([_(Wt)],Le.prototype,"__",void 0),_t([k(5)],Le.prototype,"corners",void 0),_t([k(.382)],Le.prototype,"innerRadius",void 0),Le=_t([L()],Le);let Te=class extends qt{get __tag(){return"Image"}get ready(){return!!this.image&&this.image.ready}constructor(t){super(t),this.on(st.LOADED,(t=>{"fill"===t.attrName&&t.attrValue.url===this.url&&(this.image=t.image)}))}destroy(){this.image=null,super.destroy()}};_t([_(Nt)],Te.prototype,"__",void 0),_t([y("")],Te.prototype,"url",void 0),Te=_t([L()],Te);let We=class extends qt{get __tag(){return"Canvas"}constructor(t){super(t),this.canvas=M.canvas(this.__),this.context=this.canvas.context,this.__.__drawAfterFill=!0}draw(t,e,i,s){t.__layout.update();const o=new ot(t.__world).invert(),r=new ot;e&&r.translate(e.x,e.y),i&&("number"==typeof i?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),o.multiplyParent(r),t.__render(this.canvas,{matrix:o.withScale()}),this.paint()}paint(){this.forceUpdate("fill")}__drawAfterFill(t,e){const i=this.canvas.view,{width:s,height:o}=this;this.__.cornerRadius?(t.save(),t.clip(),t.drawImage(this.canvas.view,0,0,i.width,i.height,0,0,s,o),t.restore()):t.drawImage(this.canvas.view,0,0,i.width,i.height,0,0,s,o)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e}=this.__;t.smooth!==e&&(t.smooth=e),t.resize(this.__)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null,this.context=null),super.destroy()}};_t([_(Ht)],We.prototype,"__",void 0),_t([xt(100)],We.prototype,"width",void 0),_t([xt(100)],We.prototype,"height",void 0),_t([xt(q.devicePixelRatio)],We.prototype,"pixelRatio",void 0),_t([xt(!0)],We.prototype,"smooth",void 0),_t([w("all")],We.prototype,"hitFill",void 0),We=_t([L()],We);const{copyAndSpread:Ie,includes:Me,spread:ze,setList:Oe}=K;let Ne=class extends Gt{get __tag(){return"Text"}get textDrawData(){return this.__layout.update(),this.__.__textDrawData}constructor(t){super(t)}__drawHitPath(t){const{__lineHeight:e,__baseLine:i,__textDrawData:s}=this.__;t.beginPath(),this.__.__letterSpacing<0?this.__drawPathByData(t):s.rows.forEach((s=>t.rect(s.x,s.y-i,s.width,e)))}__drawPathByData(t,e){const{x:i,y:s,width:o,height:r}=this.__layout.boxBounds;t.rect(i,s,o,r)}__drawRenderPath(t){t.font=this.__.__font}__updateTextDrawData(){const t=this.__;t.__textDrawData=nt.getDrawData(t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{lineHeight:i,letterSpacing:s,fontFamily:o,fontSize:r,fontWeight:a,italic:_,textCase:n,textOverflow:h,padding:d}=t,p=t.__autoWidth,l=t.__autoHeight;t.__lineHeight=Bt.number(i,r),t.__letterSpacing=Bt.number(s,r),t.__padding=d?rt.fourNumber(d):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${_?"italic ":""}${"small-caps"===n?"small-caps ":""}${"normal"!==a?a+" ":""}${r}px ${o}`,t.__clipText="show"!==h&&!t.__autoSize,this.__updateTextDrawData();const{bounds:u}=t.__textDrawData,c=e.boxBounds;if(t.__lineHeight<r&&ze(u,r/2),p||l){if(c.x=p?u.x:0,c.y=l?u.y:0,c.width=p?u.width:t.width,c.height=l?u.height:t.height,d){const[e,i,s,o]=t.__padding;p&&(c.x-=o,c.width+=i+o),l&&(c.y-=e,c.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();const y=Me(c,u)?c:u;y!==e.contentBounds?(e.contentBounds=y,e.renderChanged=!0,Oe(t.__textBoxBounds={},[c,u])):t.__textBoxBounds=y}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.__layout.boxBounds===this.__layout.contentBounds?0:1),t}__updateRenderBounds(){Ie(this.__layout.renderBounds,this.__.__textBoxBounds,this.__layout.renderSpread)}};_t([_(Ot)],Ne.prototype,"__",void 0),_t([y(0)],Ne.prototype,"width",void 0),_t([y(0)],Ne.prototype,"height",void 0),_t([y(0)],Ne.prototype,"padding",void 0),_t([h("#000000")],Ne.prototype,"fill",void 0),_t([Z("outside")],Ne.prototype,"strokeAlign",void 0),_t([w("all")],Ne.prototype,"hitFill",void 0),_t([y("")],Ne.prototype,"text",void 0),_t([y("L")],Ne.prototype,"fontFamily",void 0),_t([y(12)],Ne.prototype,"fontSize",void 0),_t([y("normal")],Ne.prototype,"fontWeight",void 0),_t([y(!1)],Ne.prototype,"italic",void 0),_t([y("none")],Ne.prototype,"textCase",void 0),_t([y("none")],Ne.prototype,"textDecoration",void 0),_t([y(0)],Ne.prototype,"letterSpacing",void 0),_t([y({type:"percent",value:150})],Ne.prototype,"lineHeight",void 0),_t([y(0)],Ne.prototype,"paraIndent",void 0),_t([y(0)],Ne.prototype,"paraSpacing",void 0),_t([y("left")],Ne.prototype,"textAlign",void 0),_t([y("top")],Ne.prototype,"verticalAlign",void 0),_t([y("normal")],Ne.prototype,"textWrap",void 0),_t([y("show")],Ne.prototype,"textOverflow",void 0),Ne=_t([L()],Ne);let He=class extends Gt{get __tag(){return"Path"}constructor(t){super(t),this.__.__pathInputed=2}};_t([_(It)],He.prototype,"__",void 0),_t([Z("center")],He.prototype,"strokeAlign",void 0),He=_t([L()],He);let Ve=class extends Jt{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(t){const e=this.pathElement=new He(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this.__path.length=0,this.paint(),this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,o,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,o){return this}ellipse(t,e,i,s,o,r,a,_){return this}arc(t,e,i,s,o,r){return this}arcTo(t,e,i,s,o){return this}drawEllipse(t,e,i,s,o,r,a,_){return this}drawArc(t,e,i,s,o,r){return this}drawPoints(t,e,i){return this}paint(){this.pathElement.forceUpdate("path")}};_t([_(Mt)],Ve.prototype,"__",void 0),_t([(t,e)=>{i(t,e,{get(){return this.__path}})}],Ve.prototype,"path",void 0),Ve=_t([A(at,["beginPath","path"]),L()],Ve);export{se as Box,Ct as BoxData,We as Canvas,Ht as CanvasData,ht as ColorConvert,ct as Effect,ne as Ellipse,Lt as EllipseData,yt as Export,oe as Frame,Ft as FrameData,Jt as Group,At as GroupData,Te as Image,Nt as ImageData,Kt as Leafer,Pt as LeaferData,ge as Line,Dt as LineData,pt as Paint,ut as PaintGradient,lt as PaintImage,He as Path,dt as PathArrow,It as PathData,Ve as Pen,Mt as PenData,Be as Polygon,Tt as PolygonData,qt as Rect,Et as RectData,Ut as RectRender,Le as Star,Wt as StarData,vt as State,Ne as Text,nt as TextConvert,Ot as TextData,Gt as UI,Vt as UIBounds,bt as UIData,Yt as UIRender,Bt as UnitConvert,ft as arrowType,wt as effectType,xt as resizeType,gt as stateType,mt as zoomLayerType};
package/lib/draw.min.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var t=require("@leafer/core");function e(t,e,s,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,r);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(i<3?o(a):i>3?o(e,s,a):o(e,s))||a);return i>3&&a&&Object.defineProperty(e,s,a),a}"function"==typeof SuppressedError&&SuppressedError;const s={},r={},o={},i={},a={},n={},p={};function h(e){return(s,r)=>{const o=r+"Style";t.defineLeafAttr(s,r,e,{set(t){this.__setAttr(r,t),this.waitLeafer((()=>{p.setStyle&&p.setStyle(this,o,t)}))}})}}function _(e){return(s,r)=>{t.defineLeafAttr(s,r,e,{set(e){this.__setAttr(r,e);const s=this.__;s.__useArrow="none"!==s.startArrow||"none"!==s.endArrow,t.doStrokeType(this)}})}}function d(e){return(s,r)=>{t.defineLeafAttr(s,r,e,{set(t){this.__setAttr(r,t),t&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}})}}function l(e){return(s,r)=>{t.defineLeafAttr(s,r,e,{set(t){this.__setAttr(r,t),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}})}}function u(){return(e,s)=>{const r="_"+s;t.defineKey(e,s,{set(t){this.isLeafer&&(this[r]=t)},get(){return this.isLeafer?this[r]||this:this.leafer&&this.leafer.zoomLayer}})}}const{parse:c}=t.PathConvert,y={},x=t.Debug.get("UIData");class v extends t.LeafData{get __strokeWidth(){const{strokeWidth:t,strokeWidthFixed:e}=this;if(e){let{scaleX:e}=this.__leaf.__nowWorld;return e<0&&(e=-e),e>1?t/e:t}return t}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this.__leaf.leafer&&(this.__leaf.leafer.watcher.hasVisible=!0),this._visible=t}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,x.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,x.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("fill",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isFills=!0,this._fill||(this._fill=y)):(this.__isFills&&(this.__removeInput("fill"),i.recycleImage("fill",this),this.__isFills=!1,this.__pixelFill&&(this.__pixelFill=!1)),this._fill=t)}setStroke(t){"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("stroke",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isStrokes=!0,this._stroke||(this._stroke=y)):(this.__isStrokes&&(this.__removeInput("stroke"),i.recycleImage("stroke",this),this.__isStrokes=!1,this.__pixelStroke&&(this.__pixelStroke=!1)),this._stroke=t)}setPath(t){"string"==typeof t?(this.__setInput("path",t),this._path=c(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){this.__setInput("shadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._shadow=t.length?t:null):this._shadow=t?!1===t.visible?null:[t]:null}setInnerShadow(t){this.__setInput("innerShadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._innerShadow=t.length?t:null):this._innerShadow=t?!1===t.visible?null:[t]:null}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&o.compute("fill",this.__leaf),e&&o.compute("stroke",this.__leaf),this.__needComputePaint=!1}}const g={number:(t,e)=>"object"==typeof t?"percent"===t.type?t.value/100*e:t.value:t};class f extends v{}class w extends f{get __boxStroke(){return!0}}class m extends f{}class T extends w{}class I extends v{}class R extends v{get __boxStroke(){return!0}}class P extends v{get __boxStroke(){return!0}}class b extends v{}class S extends v{}class k extends v{}class B extends f{}const U={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class C extends v{setFontWeight(t){"string"==typeof t?(this.__setInput("fontWeight",t),this._fontWeight=U[t]||400):(this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t)}}class A extends R{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.__leaf.image&&(this.__leaf.image=null),this.fill=t?{type:"image",mode:"strench",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(){const t=super.__getInputData();return delete t.fill,t}}class L extends R{}const D={__updateStrokeSpread(){let e=0,s=0;const{stroke:r,hitStroke:o,strokeAlign:i,strokeWidth:a}=this.__;if((r||"all"===o)&&a&&"inside"!==i&&(s=e="center"===i?a/2:a,!this.__.__boxStroke)){const{miterLimit:s,strokeCap:r}=this.__,o="Line"!==this.__tag?1/Math.sin(s*t.OneRadian/2)*Math.sqrt(a)-e:0,i="none"===r?0:a;e+=Math.max(o,i)}return this.__layout.strokeBoxSpread=s,this.__.__useArrow&&(e+=5*a),e},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:r,backgroundBlur:o}=this.__;e&&e.forEach((e=>{t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)})),r&&(t=Math.max(t,r));let i=t=Math.ceil(t);return s&&s.forEach((t=>{i=Math.max(i,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)})),o&&(i=Math.max(i,o)),this.__layout.renderShapeSpread=i,t}},E={__updateChange(){const t=this.__;if(t.__useEffect){const{shadow:e,innerShadow:s,blur:r,backgroundBlur:o}=this.__;t.__useEffect=!!(e||s||r||o)}t.__checkSingle();t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect?t.__complex=!0:t.__complex&&(t.__complex=!1)},__drawFast(t,e){F(this,t,e)},__draw(t,e){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:r,stroke:i,__drawAfterFill:n}=s;if(this.__drawRenderPath(t),s.__useEffect){const p=o.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:_}=s;h&&a.shadow(this,t,p),r&&(s.__isFills?o.fills(r,this,t):o.fill(r,this,t)),n&&this.__drawAfterFill(t,e),_&&a.innerShadow(this,t,p),i&&(s.__isStrokes?o.strokes(i,this,t):o.stroke(i,this,t)),p.worldCanvas&&p.worldCanvas.recycle(),p.canvas.recycle()}else r&&(s.__isFills?o.fills(r,this,t):o.fill(r,this,t)),n&&this.__drawAfterFill(t,e),i&&(s.__isStrokes?o.strokes(i,this,t):o.stroke(i,this,t))}else s.__pathInputed?F(this,t,e):this.__drawFast(t,e)},__renderShape(t,e){if(this.__worldOpacity){t.setWorld(this.__nowWorld=this.__getNowWorld(e));const{fill:s,stroke:r}=this.__;this.__drawRenderPath(t),s&&(this.__.__pixelFill?o.fills(s,this,t):o.fill("#000000",this,t)),r&&(this.__.__pixelStroke?o.strokes(r,this,t):o.stroke("#000000",this,t))}}};function F(t,e,s){const{fill:r,stroke:i,__drawAfterFill:a}=t.__;t.__drawRenderPath(e),r&&o.fill(r,t,e),a&&t.__drawAfterFill(e,s),i&&o.stroke(i,t,e)}const W={__drawFast(t,e){const{width:s,height:r,fill:o,stroke:i,__drawAfterFill:a}=this.__;if(o&&(t.fillStyle=o,t.fillRect(0,0,s,r)),a&&this.__drawAfterFill(t,e),i){const{strokeAlign:e,__strokeWidth:o}=this.__;if(!o)return;t.setStroke(i,o,this.__);const a=o/2;switch(e){case"center":t.strokeRect(0,0,s,r);break;case"inside":t.strokeRect(a,a,s-o,r-o);break;case"outside":t.strokeRect(-a,-a,s+o,r+o)}}}};var M;exports.UI=M=class extends t.Leaf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){"number"==typeof t?this.scaleX=this.scaleY=t:(this.scaleX=t.x,this.scaleY=t.y)}get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get pen(){return t.pen.set(this.path=this.__.path||[]),t.pen}constructor(t){super(t)}reset(t){}set(t){Object.assign(this,t)}get(t){return"string"==typeof t?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){}findOne(t,e){}getPath(e,s){this.__layout.update();let r=s?this.__.__pathForRender:this.__.path;if(!r){const{width:e,height:s}=this.boxBounds;(e||s)&&(t.pen.set(r=[]),this.__drawPathByBox(t.pen))}return e?t.PathConvert.toCanvasData(r,!0):r}getPathString(e,s){return t.PathConvert.stringify(this.getPath(e,s))}__onUpdateSize(){if(this.__.__input){const t=this.__;if(t.__needComputePaint=!0,t.lazy&&this.leafer&&!this.leafer.canvas.bounds.hit(this.__world))return;t.__computePaint()}}__updateRenderPath(){if(this.__.path){const e=this.__;e.__pathForRender=e.cornerRadius?t.PathCorner.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&r.addArrows(this,!e.cornerRadius)}}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(e,s){s?t.PathDrawer.drawPathByData(e,s):this.__drawPathByBox(e)}__drawPathByBox(t){const{x:e,y:s,width:r,height:o}=this.__layout.boxBounds;this.__.cornerRadius?t.roundRect(e,s,r,o,this.__.cornerRadius):t.rect(e,s,r,o)}export(t,e){return n.export(this,t,e)}clone(){return M.one(this.toJSON())}static one(e,s,r,o,i){return t.UICreator.get(e.tag||this.prototype.__tag,e,s,r,o,i)}static registerUI(){t.registerUI()(this)}static registerData(e){t.dataProcessor(e)(this.prototype)}destroy(){this.fill=this.stroke=null,super.destroy()}},e([t.dataProcessor(v)],exports.UI.prototype,"__",void 0),e([u()],exports.UI.prototype,"zoomLayer",void 0),e([t.dataType("")],exports.UI.prototype,"id",void 0),e([t.dataType("")],exports.UI.prototype,"name",void 0),e([t.dataType("")],exports.UI.prototype,"className",void 0),e([t.surfaceType("pass-through")],exports.UI.prototype,"blendMode",void 0),e([t.opacityType(1)],exports.UI.prototype,"opacity",void 0),e([t.opacityType(!0)],exports.UI.prototype,"visible",void 0),e([h(!1)],exports.UI.prototype,"selected",void 0),e([h(!1)],exports.UI.prototype,"disabled",void 0),e([t.dataType(!1)],exports.UI.prototype,"locked",void 0),e([t.sortType(0)],exports.UI.prototype,"zIndex",void 0),e([t.maskType(!1)],exports.UI.prototype,"mask",void 0),e([t.surfaceType("pixel")],exports.UI.prototype,"maskType",void 0),e([t.eraserType(!1)],exports.UI.prototype,"eraser",void 0),e([t.positionType(0)],exports.UI.prototype,"x",void 0),e([t.positionType(0)],exports.UI.prototype,"y",void 0),e([t.boundsType(100)],exports.UI.prototype,"width",void 0),e([t.boundsType(100)],exports.UI.prototype,"height",void 0),e([t.scaleType(1)],exports.UI.prototype,"scaleX",void 0),e([t.scaleType(1)],exports.UI.prototype,"scaleY",void 0),e([t.rotationType(0)],exports.UI.prototype,"rotation",void 0),e([t.rotationType(0)],exports.UI.prototype,"skewX",void 0),e([t.rotationType(0)],exports.UI.prototype,"skewY",void 0),e([t.autoLayoutType()],exports.UI.prototype,"around",void 0),e([t.dataType(!1)],exports.UI.prototype,"draggable",void 0),e([t.dataType(!1)],exports.UI.prototype,"editable",void 0),e([t.dataType("size")],exports.UI.prototype,"editSize",void 0),e([t.hitType(!0)],exports.UI.prototype,"hittable",void 0),e([t.hitType("path")],exports.UI.prototype,"hitFill",void 0),e([t.strokeType("path")],exports.UI.prototype,"hitStroke",void 0),e([t.hitType(!1)],exports.UI.prototype,"hitBox",void 0),e([t.hitType(!0)],exports.UI.prototype,"hitChildren",void 0),e([t.hitType(!0)],exports.UI.prototype,"hitSelf",void 0),e([t.hitType()],exports.UI.prototype,"hitRadius",void 0),e([t.cursorType("")],exports.UI.prototype,"cursor",void 0),e([t.surfaceType()],exports.UI.prototype,"fill",void 0),e([t.strokeType()],exports.UI.prototype,"stroke",void 0),e([t.strokeType("inside")],exports.UI.prototype,"strokeAlign",void 0),e([t.strokeType(1)],exports.UI.prototype,"strokeWidth",void 0),e([t.strokeType(!1)],exports.UI.prototype,"strokeWidthFixed",void 0),e([t.strokeType("none")],exports.UI.prototype,"strokeCap",void 0),e([t.strokeType("miter")],exports.UI.prototype,"strokeJoin",void 0),e([t.strokeType()],exports.UI.prototype,"dashPattern",void 0),e([t.strokeType()],exports.UI.prototype,"dashOffset",void 0),e([t.strokeType(10)],exports.UI.prototype,"miterLimit",void 0),e([t.dataType(!1)],exports.UI.prototype,"lazy",void 0),e([t.naturalBoundsType(1)],exports.UI.prototype,"pixelRatio",void 0),e([t.pathInputType()],exports.UI.prototype,"path",void 0),e([t.pathType()],exports.UI.prototype,"windingRule",void 0),e([_("none")],exports.UI.prototype,"startArrow",void 0),e([_("none")],exports.UI.prototype,"endArrow",void 0),e([t.pathType(0)],exports.UI.prototype,"cornerRadius",void 0),e([t.pathType()],exports.UI.prototype,"cornerSmoothing",void 0),e([d()],exports.UI.prototype,"shadow",void 0),e([d()],exports.UI.prototype,"innerShadow",void 0),e([d()],exports.UI.prototype,"blur",void 0),e([d()],exports.UI.prototype,"backgroundBlur",void 0),e([d()],exports.UI.prototype,"grayscale",void 0),e([t.dataType()],exports.UI.prototype,"normalStyle",void 0),e([t.dataType()],exports.UI.prototype,"hoverStyle",void 0),e([t.dataType()],exports.UI.prototype,"pressStyle",void 0),e([t.dataType()],exports.UI.prototype,"focusStyle",void 0),e([t.dataType()],exports.UI.prototype,"selectedStyle",void 0),e([t.dataType()],exports.UI.prototype,"disabledStyle",void 0),e([t.rewrite(t.Leaf.prototype.reset)],exports.UI.prototype,"reset",null),exports.UI=M=e([t.useModule(D),t.useModule(E),t.rewriteAble()],exports.UI),exports.Group=class extends exports.UI{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(e){if(e.children){const{children:s}=e;let r;delete e.children,this.children?this.clear():this.__setBranch(),super.set(e),s.forEach((e=>{r=e.__?e:t.UICreator.get(e.tag,e),this.add(r)})),e.children=s}else super.set(e)}toJSON(){const t=super.toJSON();return t.children=this.children.map((t=>t.toJSON())),t}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}},e([t.dataProcessor(f)],exports.Group.prototype,"__",void 0),exports.Group=e([t.useModule(t.Branch),t.registerUI()],exports.Group);const z=t.Debug.get("Leafer");exports.Leafer=class extends exports.Group{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&t.ImageManager.isComplete}get layoutLocked(){return!this.layouter.running}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}constructor(t,e){super(e),this.config={type:"design",start:!0,hittable:!0,smooth:!0,zoom:{min:.02,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0,autoDistance:2}},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t)}init(e,s){if(this.canvas)return;let r;this.__setLeafer(this),e&&t.DataHelper.assign(this.config,e);const{config:o}=this;this.initType(o.type),this.canvas=t.Creator.canvas(o),this.__controllers.push(this.renderer=t.Creator.renderer(this,this.canvas,o),this.watcher=t.Creator.watcher(this,o),this.layouter=t.Creator.layouter(this,o)),this.isApp&&this.__setApp(),this.__checkAutoLayout(o),this.view=this.canvas.view,s?(this.__bindApp(s),r=s.running):(this.selector=t.Creator.selector(this),this.interaction=t.Creator.interaction(this,this.canvas,this.selector,o),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=t.Creator.hitCanvasManager()),this.canvasManager=new t.CanvasManager,r=o.start),this.hittable=o.hittable,this.fill=o.fill,this.canvasManager.add(this.canvas),this.__listenEvents(),r&&(this.__startTimer=setTimeout(this.start.bind(this))),this.onInit()}onInit(){}initType(t){}set(t){this.children?super.set(t):setTimeout((()=>{super.set(t)}))}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.ready?this.emitLeafer(t.LeaferEvent.RESTART):this.emitLeafer(t.LeaferEvent.START),this.__controllers.forEach((t=>t.start())),this.isApp||this.renderer.render(),this.running=!0)}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach((t=>t.stop())),this.running=!1,this.emitLeafer(t.LeaferEvent.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(e){const s=t.DataHelper.copyAttrs({},e,t.canvasSizeAttrs);Object.keys(s).forEach((t=>this[t]=s[t]))}forceFullRender(){this.forceRender()}forceRender(e){this.renderer.addBlock(e?new t.Bounds(e):this.canvas.bounds),this.viewReady&&this.renderer.update()}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}__doResize(e){if(!this.canvas||this.canvas.isSameSize(e))return;const s=t.DataHelper.copyAttrs({},this.canvas,t.canvasSizeAttrs);this.canvas.resize(e),this.__onResize(new t.ResizeEvent(e,s))}__onResize(e){this.emitEvent(e),t.DataHelper.copyAttrs(this.__,e,t.canvasSizeAttrs),setTimeout((()=>{this.canvasManager&&this.canvasManager.clearRecycled()}),0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(e){e.width&&e.height||(this.autoLayout=new t.AutoBounds(e),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(e,s){this.canvas&&(t.canvasSizeAttrs.includes(e)?this.__changeCanvasSize(e,s):"fill"===e?this.__changeFill(s):"hittable"===e&&(this.canvas.hittable=s)),super.__setAttr(e,s)}__getAttr(e){return this.canvas&&t.canvasSizeAttrs.includes(e)?this.canvas[e]:super.__getAttr(e)}__changeCanvasSize(e,s){const r=t.DataHelper.copyAttrs({},this.canvas,t.canvasSizeAttrs);r[e]=this.config[e]=s,s&&this.canvas.stopAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceFullRender()}__onCreated(){this.created=!0}__onReady(){this.ready||(this.ready=!0,this.emitLeafer(t.LeaferEvent.BEFORE_READY),this.emitLeafer(t.LeaferEvent.READY),this.emitLeafer(t.LeaferEvent.AFTER_READY),t.WaitHelper.run(this.__readyWait))}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(t.LeaferEvent.VIEW_READY),t.WaitHelper.run(this.__viewReadyWait))}__onNextRender(){if(this.viewReady){t.WaitHelper.run(this.__nextRenderWait);const{imageReady:e}=this;e&&!this.viewCompleted&&this.__checkViewCompleted(),e||(this.viewCompleted=!1)}}__checkViewCompleted(e=!0){this.nextRender((()=>{this.imageReady&&(e&&this.emitLeafer(t.LeaferEvent.VIEW_COMPLETED),t.WaitHelper.run(this.__viewCompletedWait),this.viewCompleted=!0)}))}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender((()=>this.interaction.updateCursor()))}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const r=this.__nextRenderWait;if(s){for(let e=0;e<r.length;e++)if(r[e]===t){r.splice(e,1);break}}else r.push(t)}zoom(t,e,s){}validScale(t){const{scaleX:e}=this.zoomLayer.__,{min:s,max:r}=this.app.config.zoom,o=Math.abs(e*t);return o<s?t=s/e:o>r&&(t=r/e),t}__checkUpdateLayout(){this.__layout.update()}emitLeafer(e){this.emitEvent(new t.LeaferEvent(e,this))}__listenEvents(){const e=t.Run.start("FirstCreate "+this.innerName);this.once(t.LeaferEvent.START,(()=>t.Run.end(e))),this.once(t.LayoutEvent.END,(()=>this.__onReady())),this.once(t.RenderEvent.START,(()=>this.__onCreated())),this.once(t.RenderEvent.END,(()=>this.__onViewReady())),this.__eventIds.push(this.on_(t.WatchEvent.DATA,this.__onWatchData,this),this.on_(t.RenderEvent.NEXT,this.__onNextRender,this),this.on_(t.LayoutEvent.CHECK_UPDATE,this.__checkUpdateLayout,this))}__removeListenEvents(){this.off_(this.__eventIds),this.__eventIds.length=0}destroy(){setTimeout((()=>{if(!this.destroyed)try{this.stop(),this.emitEvent(new t.LeaferEvent(t.LeaferEvent.END,this)),this.__removeListenEvents(),this.__controllers.forEach((t=>{this.parent&&t===this.interaction||t.destroy()})),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout((()=>{t.ImageManager.clearRecycled()}),100)}catch(t){z.error(t)}}))}},e([t.dataProcessor(m)],exports.Leafer.prototype,"__",void 0),e([t.boundsType()],exports.Leafer.prototype,"pixelRatio",void 0),exports.Leafer=e([t.registerUI()],exports.Leafer),exports.Rect=class extends exports.UI{get __tag(){return"Rect"}constructor(t){super(t)}},e([t.dataProcessor(R)],exports.Rect.prototype,"__",void 0),exports.Rect=e([t.useModule(W),t.rewriteAble(),t.registerUI()],exports.Rect);const H=exports.Rect.prototype,O=exports.Group.prototype,N={},{copy:G,add:V}=t.BoundsHelper;exports.Box=class extends exports.Group{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){let t=this.__updateRectRenderSpread()||super.__updateRenderSpread();return this.__.__drawAfterFill="hide"===this.__.overflow,t||(t=this.__.__drawAfterFill?0:1),t}__updateRectBoxBounds(){}__updateBoxBounds(){const t=this.__;if(t.__autoSide&&this.children.length){if(this.leafer&&this.leafer.layouter.addExtra(this),super.__updateBoxBounds(),!t.__autoSize){const e=this.__layout.boxBounds;t.__autoWidth||(e.x=0,e.width=t.width),t.__autoHeight||(e.y=0,e.height=t.height)}}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){if(this.__updateRectRenderBounds(),!this.__.__drawAfterFill){const{renderBounds:t}=this.__layout;G(N,t),super.__updateRenderBounds(),V(t,N)}}__updateRectRenderBounds(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.__renderGroup(t,e))}__drawAfterFill(t,e){t.save(),t.clip(),this.__renderGroup(t,e),t.restore(),this.__.stroke&&this.__drawRenderPath(t)}},e([t.dataProcessor(w)],exports.Box.prototype,"__",void 0),e([t.affectRenderBoundsType("show")],exports.Box.prototype,"overflow",void 0),e([t.rewrite(H.__updateStrokeSpread)],exports.Box.prototype,"__updateStrokeSpread",null),e([t.rewrite(H.__updateRenderSpread)],exports.Box.prototype,"__updateRectRenderSpread",null),e([t.rewrite(H.__updateBoxBounds)],exports.Box.prototype,"__updateRectBoxBounds",null),e([t.rewrite(H.__updateStrokeBounds)],exports.Box.prototype,"__updateStrokeBounds",null),e([t.rewrite(H.__updateRenderBounds)],exports.Box.prototype,"__updateRectRenderBounds",null),e([t.rewrite(H.__updateChange)],exports.Box.prototype,"__updateRectChange",null),e([t.rewrite(H.__render)],exports.Box.prototype,"__renderRect",null),e([t.rewrite(O.__render)],exports.Box.prototype,"__renderGroup",null),exports.Box=e([t.rewriteAble(),t.registerUI()],exports.Box),exports.Frame=class extends exports.Box{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}},e([t.dataProcessor(T)],exports.Frame.prototype,"__",void 0),e([t.surfaceType("#FFFFFF")],exports.Frame.prototype,"fill",void 0),e([t.affectRenderBoundsType("hide")],exports.Frame.prototype,"overflow",void 0),exports.Frame=e([t.registerUI()],exports.Frame);const{moveTo:j,closePath:Y,ellipse:X}=t.PathCommandDataHelper;exports.Ellipse=class extends exports.UI{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:e,height:s,innerRadius:r,startAngle:o,endAngle:i}=this.__,a=e/2,n=s/2,p=this.__.path=[];r?(o||i?(r<1&&X(p,a,n,a*r,n*r,0,o,i,!1),X(p,a,n,a,n,0,i,o,!0),r<1&&Y(p)):(r<1&&(X(p,a,n,a*r,n*r),j(p,e,n)),X(p,a,n,a,n,0,360,0,!0)),t.Platform.ellipseToCurve&&(this.__.path=this.getPath(!0))):o||i?(j(p,a,n),X(p,a,n,a,n,0,o,i,!1),Y(p)):X(p,a,n,a,n)}},e([t.dataProcessor(P)],exports.Ellipse.prototype,"__",void 0),e([t.pathType(0)],exports.Ellipse.prototype,"innerRadius",void 0),e([t.pathType(0)],exports.Ellipse.prototype,"startAngle",void 0),e([t.pathType(0)],exports.Ellipse.prototype,"endAngle",void 0),exports.Ellipse=e([t.registerUI()],exports.Ellipse);const{moveTo:J,lineTo:K,drawPoints:$}=t.PathCommandDataHelper,{rotate:q,getAngle:Q,getDistance:Z,defaultPoint:tt}=t.PointHelper,{toBounds:et}=t.PathBounds;exports.Line=class extends exports.UI{get __tag(){return"Line"}get toPoint(){const{width:e,rotation:s}=this.__,r=t.getPointData();return e&&(r.x=e),s&&q(r,s),r}set toPoint(t){this.width=Z(tt,t),this.rotation=Q(tt,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];this.__.points?$(t,this.__.points,!1):(J(t,0,0),K(t,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?($(t.__pathForRender=[],t.points,t.curve,this.pathClosed),t.__useArrow&&r.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?et(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}},e([t.dataProcessor(I)],exports.Line.prototype,"__",void 0),e([t.affectStrokeBoundsType("center")],exports.Line.prototype,"strokeAlign",void 0),e([t.boundsType(0)],exports.Line.prototype,"height",void 0),e([t.pathType()],exports.Line.prototype,"points",void 0),e([t.pathType(0)],exports.Line.prototype,"curve",void 0),exports.Line=e([t.registerUI()],exports.Line);const{sin:st,cos:rt,PI:ot}=Math,{moveTo:it,lineTo:at,closePath:nt,drawPoints:pt}=t.PathCommandDataHelper,ht=exports.Line.prototype;exports.Polygon=class extends exports.UI{get __tag(){return"Polygon"}constructor(t){super(t),this.pathClosed=!0}__updatePath(){const t=this.__.path=[];if(this.__.points)pt(t,this.__.points,!1,!0);else{const{width:e,height:s,sides:r}=this.__,o=e/2,i=s/2;it(t,o,0);for(let e=1;e<r;e++)at(t,o+o*st(2*e*ot/r),i-i*rt(2*e*ot/r))}nt(t)}__updateRenderPath(){}__updateBoxBounds(){}},e([t.dataProcessor(b)],exports.Polygon.prototype,"__",void 0),e([t.pathType(3)],exports.Polygon.prototype,"sides",void 0),e([t.pathType()],exports.Polygon.prototype,"points",void 0),e([t.pathType(0)],exports.Polygon.prototype,"curve",void 0),e([t.rewrite(ht.__updateRenderPath)],exports.Polygon.prototype,"__updateRenderPath",null),e([t.rewrite(ht.__updateBoxBounds)],exports.Polygon.prototype,"__updateBoxBounds",null),exports.Polygon=e([t.rewriteAble(),t.registerUI()],exports.Polygon);const{sin:_t,cos:dt,PI:lt}=Math,{moveTo:ut,lineTo:ct,closePath:yt}=t.PathCommandDataHelper;exports.Star=class extends exports.UI{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:s,innerRadius:r}=this.__,o=t/2,i=e/2,a=this.__.path=[];ut(a,o,0);for(let t=1;t<2*s;t++)ct(a,o+(t%2==0?o:o*r)*_t(t*lt/s),i-(t%2==0?i:i*r)*dt(t*lt/s));yt(a)}},e([t.dataProcessor(S)],exports.Star.prototype,"__",void 0),e([t.pathType(5)],exports.Star.prototype,"corners",void 0),e([t.pathType(.382)],exports.Star.prototype,"innerRadius",void 0),exports.Star=e([t.registerUI()],exports.Star),exports.Image=class extends exports.Rect{get __tag(){return"Image"}get ready(){return!!this.image&&this.image.ready}constructor(e){super(e),this.on(t.ImageEvent.LOADED,(t=>{"fill"===t.attrName&&t.attrValue.url===this.url&&(this.image=t.image)}))}destroy(){this.image=null,super.destroy()}},e([t.dataProcessor(A)],exports.Image.prototype,"__",void 0),e([t.boundsType("")],exports.Image.prototype,"url",void 0),exports.Image=e([t.registerUI()],exports.Image),exports.Canvas=class extends exports.Rect{get __tag(){return"Canvas"}constructor(e){super(e),this.canvas=t.Creator.canvas(this.__),this.context=this.canvas.context,this.__.__drawAfterFill=!0}draw(e,s,r,o){e.__layout.update();const i=new t.Matrix(e.__world).invert(),a=new t.Matrix;s&&a.translate(s.x,s.y),r&&("number"==typeof r?a.scale(r):a.scale(r.x,r.y)),o&&a.rotate(o),i.multiplyParent(a),e.__render(this.canvas,{matrix:i.withScale()}),this.paint()}paint(){this.forceUpdate("fill")}__drawAfterFill(t,e){const s=this.canvas.view,{width:r,height:o}=this;this.__.cornerRadius?(t.save(),t.clip(),t.drawImage(this.canvas.view,0,0,s.width,s.height,0,0,r,o),t.restore()):t.drawImage(this.canvas.view,0,0,s.width,s.height,0,0,r,o)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e}=this.__;t.smooth!==e&&(t.smooth=e),t.resize(this.__)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null,this.context=null),super.destroy()}},e([t.dataProcessor(L)],exports.Canvas.prototype,"__",void 0),e([l(100)],exports.Canvas.prototype,"width",void 0),e([l(100)],exports.Canvas.prototype,"height",void 0),e([l(t.Platform.devicePixelRatio)],exports.Canvas.prototype,"pixelRatio",void 0),e([l(!0)],exports.Canvas.prototype,"smooth",void 0),e([t.hitType("all")],exports.Canvas.prototype,"hitFill",void 0),exports.Canvas=e([t.registerUI()],exports.Canvas);const{copyAndSpread:xt,includes:vt,spread:gt,setList:ft}=t.BoundsHelper;exports.Text=class extends exports.UI{get __tag(){return"Text"}get textDrawData(){return this.__layout.update(),this.__.__textDrawData}constructor(t){super(t)}__drawHitPath(t){const{__lineHeight:e,__baseLine:s,__textDrawData:r}=this.__;t.beginPath(),this.__.__letterSpacing<0?this.__drawPathByData(t):r.rows.forEach((r=>t.rect(r.x,r.y-s,r.width,e)))}__drawPathByData(t,e){const{x:s,y:r,width:o,height:i}=this.__layout.boxBounds;t.rect(s,r,o,i)}__drawRenderPath(t){t.font=this.__.__font}__updateTextDrawData(){const t=this.__;t.__textDrawData=s.getDrawData(t.text,this.__)}__updateBoxBounds(){const e=this.__,s=this.__layout,{lineHeight:r,letterSpacing:o,fontFamily:i,fontSize:a,fontWeight:n,italic:p,textCase:h,textOverflow:_,padding:d}=e,l=e.__autoWidth,u=e.__autoHeight;e.__lineHeight=g.number(r,a),e.__letterSpacing=g.number(o,a),e.__padding=d?t.MathHelper.fourNumber(d):void 0,e.__baseLine=e.__lineHeight-(e.__lineHeight-.7*a)/2,e.__font=`${p?"italic ":""}${"small-caps"===h?"small-caps ":""}${"normal"!==n?n+" ":""}${a}px ${i}`,e.__clipText="show"!==_&&!e.__autoSize,this.__updateTextDrawData();const{bounds:c}=e.__textDrawData,y=s.boxBounds;if(e.__lineHeight<a&&gt(c,a/2),l||u){if(y.x=l?c.x:0,y.y=u?c.y:0,y.width=l?c.width:e.width,y.height=u?c.height:e.height,d){const[t,s,r,o]=e.__padding;l&&(y.x-=o,y.width+=s+o),u&&(y.y-=t,y.height+=r+t)}this.__updateNaturalSize()}else super.__updateBoxBounds();const x=vt(y,c)?y:c;x!==s.contentBounds?(s.contentBounds=x,s.renderChanged=!0,ft(e.__textBoxBounds={},[y,c])):e.__textBoxBounds=x}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.__layout.boxBounds===this.__layout.contentBounds?0:1),t}__updateRenderBounds(){xt(this.__layout.renderBounds,this.__.__textBoxBounds,this.__layout.renderSpread)}},e([t.dataProcessor(C)],exports.Text.prototype,"__",void 0),e([t.boundsType(0)],exports.Text.prototype,"width",void 0),e([t.boundsType(0)],exports.Text.prototype,"height",void 0),e([t.boundsType(0)],exports.Text.prototype,"padding",void 0),e([t.surfaceType("#000000")],exports.Text.prototype,"fill",void 0),e([t.affectStrokeBoundsType("outside")],exports.Text.prototype,"strokeAlign",void 0),e([t.hitType("all")],exports.Text.prototype,"hitFill",void 0),e([t.boundsType("")],exports.Text.prototype,"text",void 0),e([t.boundsType("L")],exports.Text.prototype,"fontFamily",void 0),e([t.boundsType(12)],exports.Text.prototype,"fontSize",void 0),e([t.boundsType("normal")],exports.Text.prototype,"fontWeight",void 0),e([t.boundsType(!1)],exports.Text.prototype,"italic",void 0),e([t.boundsType("none")],exports.Text.prototype,"textCase",void 0),e([t.boundsType("none")],exports.Text.prototype,"textDecoration",void 0),e([t.boundsType(0)],exports.Text.prototype,"letterSpacing",void 0),e([t.boundsType({type:"percent",value:150})],exports.Text.prototype,"lineHeight",void 0),e([t.boundsType(0)],exports.Text.prototype,"paraIndent",void 0),e([t.boundsType(0)],exports.Text.prototype,"paraSpacing",void 0),e([t.boundsType("left")],exports.Text.prototype,"textAlign",void 0),e([t.boundsType("top")],exports.Text.prototype,"verticalAlign",void 0),e([t.boundsType("normal")],exports.Text.prototype,"textWrap",void 0),e([t.boundsType("show")],exports.Text.prototype,"textOverflow",void 0),exports.Text=e([t.registerUI()],exports.Text),exports.Path=class extends exports.UI{get __tag(){return"Path"}constructor(t){super(t),this.__.__pathInputed=2}},e([t.dataProcessor(k)],exports.Path.prototype,"__",void 0),e([t.affectStrokeBoundsType("center")],exports.Path.prototype,"strokeAlign",void 0),exports.Path=e([t.registerUI()],exports.Path),exports.Pen=class extends exports.Group{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(t){const e=this.pathElement=new exports.Path(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this.__path.length=0,this.paint(),this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,r,o,i){return this}quadraticCurveTo(t,e,s,r){return this}closePath(){return this}rect(t,e,s,r){return this}roundRect(t,e,s,r,o){return this}ellipse(t,e,s,r,o,i,a,n){return this}arc(t,e,s,r,o,i){return this}arcTo(t,e,s,r,o){return this}drawEllipse(t,e,s,r,o,i,a,n){return this}drawArc(t,e,s,r,o,i){return this}drawPoints(t,e,s){return this}paint(){this.pathElement.forceUpdate("path")}},e([t.dataProcessor(B)],exports.Pen.prototype,"__",void 0),e([(e,s)=>{t.defineKey(e,s,{get(){return this.__path}})}],exports.Pen.prototype,"path",void 0),exports.Pen=e([t.useModule(t.PathCreator,["beginPath","path"]),t.registerUI()],exports.Pen),exports.BoxData=w,exports.CanvasData=L,exports.ColorConvert={},exports.Effect=a,exports.EllipseData=P,exports.Export=n,exports.FrameData=T,exports.GroupData=f,exports.ImageData=A,exports.LeaferData=m,exports.LineData=I,exports.Paint=o,exports.PaintGradient={},exports.PaintImage=i,exports.PathArrow=r,exports.PathData=k,exports.PenData=B,exports.PolygonData=b,exports.RectData=R,exports.RectRender=W,exports.StarData=S,exports.State=p,exports.TextConvert=s,exports.TextData=C,exports.UIBounds=D,exports.UIData=v,exports.UIRender=E,exports.UnitConvert=g,exports.arrowType=_,exports.effectType=d,exports.resizeType=l,exports.stateType=h,exports.zoomLayerType=u,Object.keys(t).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}));
1
+ "use strict";var t=require("@leafer/core");function e(t,e,s,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,r);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(i<3?o(a):i>3?o(e,s,a):o(e,s))||a);return i>3&&a&&Object.defineProperty(e,s,a),a}"function"==typeof SuppressedError&&SuppressedError;const s={},r={},o={},i={},a={},n={},p={};function h(e){return(s,r)=>{const o=r+"Style";t.defineLeafAttr(s,r,e,{set(t){this.__setAttr(r,t),this.waitLeafer((()=>{p.setStyle&&p.setStyle(this,o,t)}))}})}}function _(e){return(s,r)=>{t.defineLeafAttr(s,r,e,{set(e){this.__setAttr(r,e);const s=this.__;s.__useArrow="none"!==s.startArrow||"none"!==s.endArrow,t.doStrokeType(this)}})}}function d(e){return(s,r)=>{t.defineLeafAttr(s,r,e,{set(t){this.__setAttr(r,t),t&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}})}}function l(e){return(s,r)=>{t.defineLeafAttr(s,r,e,{set(t){this.__setAttr(r,t),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}})}}function u(){return(e,s)=>{const r="_"+s;t.defineKey(e,s,{set(t){this.isLeafer&&(this[r]=t)},get(){return this.isLeafer?this[r]||this:this.leafer&&this.leafer.zoomLayer}})}}const{parse:c}=t.PathConvert,y={},x=t.Debug.get("UIData");class v extends t.LeafData{get __strokeWidth(){const{strokeWidth:t,strokeWidthFixed:e}=this;if(e){let{scaleX:e}=this.__leaf.__nowWorld;return e<0&&(e=-e),e>1?t/e:t}return t}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this.__leaf.leafer&&(this.__leaf.leafer.watcher.hasVisible=!0),this._visible=t}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,x.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,x.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("fill",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isFills=!0,this._fill||(this._fill=y)):(this.__isFills&&(this.__removeInput("fill"),i.recycleImage("fill",this),this.__isFills=!1,this.__pixelFill&&(this.__pixelFill=!1)),this._fill=t)}setStroke(t){"string"!=typeof t&&t?"object"==typeof t&&(this.__setInput("stroke",t),this.__leaf.__layout.boxChanged||this.__leaf.__layout.boxChange(),this.__isStrokes=!0,this._stroke||(this._stroke=y)):(this.__isStrokes&&(this.__removeInput("stroke"),i.recycleImage("stroke",this),this.__isStrokes=!1,this.__pixelStroke&&(this.__pixelStroke=!1)),this._stroke=t)}setPath(t){"string"==typeof t?(this.__setInput("path",t),this._path=c(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){this.__setInput("shadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._shadow=t.length?t:null):this._shadow=t?!1===t.visible?null:[t]:null}setInnerShadow(t){this.__setInput("innerShadow",t),t instanceof Array?(t.some((t=>!1===t.visible))&&(t=t.filter((t=>!1!==t.visible))),this._innerShadow=t.length?t:null):this._innerShadow=t?!1===t.visible?null:[t]:null}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&o.compute("fill",this.__leaf),e&&o.compute("stroke",this.__leaf),this.__needComputePaint=!1}}const g={number:(t,e)=>"object"==typeof t?"percent"===t.type?t.value/100*e:t.value:t};class f extends v{}class w extends f{get __boxStroke(){return!0}}class m extends f{}class T extends w{}class I extends v{}class R extends v{get __boxStroke(){return!0}}class P extends v{get __boxStroke(){return!0}}class b extends v{}class S extends v{}class k extends v{}class B extends f{}const U={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class C extends v{setFontWeight(t){"string"==typeof t?(this.__setInput("fontWeight",t),this._fontWeight=U[t]||400):(this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t)}}class A extends R{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.__leaf.image&&(this.__leaf.image=null),this.fill=t?{type:"image",mode:"strench",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(){const t=super.__getInputData();return delete t.fill,t}}class L extends R{}const D={__updateStrokeSpread(){let e=0,s=0;const{stroke:r,hitStroke:o,strokeAlign:i,strokeWidth:a}=this.__;if((r||"all"===o)&&a&&"inside"!==i&&(s=e="center"===i?a/2:a,!this.__.__boxStroke)){const{miterLimit:s,strokeCap:r}=this.__,o="Line"!==this.__tag?1/Math.sin(s*t.OneRadian/2)*Math.sqrt(a)-e:0,i="none"===r?0:a;e+=Math.max(o,i)}return this.__layout.strokeBoxSpread=s,this.__.__useArrow&&(e+=5*a),e},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:r,backgroundBlur:o}=this.__;e&&e.forEach((e=>{t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)})),r&&(t=Math.max(t,r));let i=t=Math.ceil(t);return s&&s.forEach((t=>{i=Math.max(i,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)})),o&&(i=Math.max(i,o)),this.__layout.renderShapeSpread=i,t}},E={__updateChange(){const t=this.__;if(t.__useEffect){const{shadow:e,innerShadow:s,blur:r,backgroundBlur:o}=this.__;t.__useEffect=!!(e||s||r||o)}t.__checkSingle();t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect?t.__complex=!0:t.__complex&&(t.__complex=!1)},__drawFast(t,e){F(this,t,e)},__draw(t,e){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:r,stroke:i,__drawAfterFill:n}=s;if(this.__drawRenderPath(t),s.__useEffect){const p=o.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:_}=s;h&&a.shadow(this,t,p),r&&(s.__isFills?o.fills(r,this,t):o.fill(r,this,t)),n&&this.__drawAfterFill(t,e),_&&a.innerShadow(this,t,p),i&&(s.__isStrokes?o.strokes(i,this,t):o.stroke(i,this,t)),p.worldCanvas&&p.worldCanvas.recycle(),p.canvas.recycle()}else r&&(s.__isFills?o.fills(r,this,t):o.fill(r,this,t)),n&&this.__drawAfterFill(t,e),i&&(s.__isStrokes?o.strokes(i,this,t):o.stroke(i,this,t))}else s.__pathInputed?F(this,t,e):this.__drawFast(t,e)},__renderShape(t,e){if(this.__worldOpacity){t.setWorld(this.__nowWorld=this.__getNowWorld(e));const{fill:s,stroke:r}=this.__;this.__drawRenderPath(t),s&&(this.__.__pixelFill?o.fills(s,this,t):o.fill("#000000",this,t)),r&&(this.__.__pixelStroke?o.strokes(r,this,t):o.stroke("#000000",this,t))}}};function F(t,e,s){const{fill:r,stroke:i,__drawAfterFill:a}=t.__;t.__drawRenderPath(e),r&&o.fill(r,t,e),a&&t.__drawAfterFill(e,s),i&&o.stroke(i,t,e)}const W={__drawFast(t,e){const{width:s,height:r,fill:o,stroke:i,__drawAfterFill:a}=this.__;if(o&&(t.fillStyle=o,t.fillRect(0,0,s,r)),a&&this.__drawAfterFill(t,e),i){const{strokeAlign:e,__strokeWidth:o}=this.__;if(!o)return;t.setStroke(i,o,this.__);const a=o/2;switch(e){case"center":t.strokeRect(0,0,s,r);break;case"inside":t.strokeRect(a,a,s-o,r-o);break;case"outside":t.strokeRect(-a,-a,s+o,r+o)}}}};var M;exports.UI=M=class extends t.Leaf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){"number"==typeof t?this.scaleX=this.scaleY=t:(this.scaleX=t.x,this.scaleY=t.y)}get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get pen(){return t.pen.set(this.path=this.__.path||[]),t.pen}constructor(t){super(t)}reset(t){}set(t){Object.assign(this,t)}get(t){return"string"==typeof t?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){}findOne(t,e){}getPath(e,s){this.__layout.update();let r=s?this.__.__pathForRender:this.__.path;if(!r){const{width:e,height:s}=this.boxBounds;(e||s)&&(t.pen.set(r=[]),this.__drawPathByBox(t.pen))}return e?t.PathConvert.toCanvasData(r,!0):r}getPathString(e,s){return t.PathConvert.stringify(this.getPath(e,s))}__onUpdateSize(){if(this.__.__input){const t=this.__;if(t.__needComputePaint=!0,t.lazy&&this.leafer&&!this.leafer.canvas.bounds.hit(this.__world))return;t.__computePaint()}}__updateRenderPath(){if(this.__.path){const e=this.__;e.__pathForRender=e.cornerRadius?t.PathCorner.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&r.addArrows(this,!e.cornerRadius)}}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(e,s){s?t.PathDrawer.drawPathByData(e,s):this.__drawPathByBox(e)}__drawPathByBox(t){const{x:e,y:s,width:r,height:o}=this.__layout.boxBounds;this.__.cornerRadius?t.roundRect(e,s,r,o,this.__.cornerRadius):t.rect(e,s,r,o)}export(t,e){return n.export(this,t,e)}clone(){return M.one(this.toJSON())}static one(e,s,r,o,i){return t.UICreator.get(e.tag||this.prototype.__tag,e,s,r,o,i)}static registerUI(){t.registerUI()(this)}static registerData(e){t.dataProcessor(e)(this.prototype)}destroy(){this.fill=this.stroke=null,super.destroy()}},e([t.dataProcessor(v)],exports.UI.prototype,"__",void 0),e([u()],exports.UI.prototype,"zoomLayer",void 0),e([t.dataType("")],exports.UI.prototype,"id",void 0),e([t.dataType("")],exports.UI.prototype,"name",void 0),e([t.dataType("")],exports.UI.prototype,"className",void 0),e([t.surfaceType("pass-through")],exports.UI.prototype,"blendMode",void 0),e([t.opacityType(1)],exports.UI.prototype,"opacity",void 0),e([t.opacityType(!0)],exports.UI.prototype,"visible",void 0),e([h(!1)],exports.UI.prototype,"selected",void 0),e([h(!1)],exports.UI.prototype,"disabled",void 0),e([t.dataType(!1)],exports.UI.prototype,"locked",void 0),e([t.sortType(0)],exports.UI.prototype,"zIndex",void 0),e([t.maskType(!1)],exports.UI.prototype,"mask",void 0),e([t.surfaceType("pixel")],exports.UI.prototype,"maskType",void 0),e([t.eraserType(!1)],exports.UI.prototype,"eraser",void 0),e([t.positionType(0)],exports.UI.prototype,"x",void 0),e([t.positionType(0)],exports.UI.prototype,"y",void 0),e([t.boundsType(100)],exports.UI.prototype,"width",void 0),e([t.boundsType(100)],exports.UI.prototype,"height",void 0),e([t.scaleType(1)],exports.UI.prototype,"scaleX",void 0),e([t.scaleType(1)],exports.UI.prototype,"scaleY",void 0),e([t.rotationType(0)],exports.UI.prototype,"rotation",void 0),e([t.rotationType(0)],exports.UI.prototype,"skewX",void 0),e([t.rotationType(0)],exports.UI.prototype,"skewY",void 0),e([t.autoLayoutType()],exports.UI.prototype,"around",void 0),e([t.dataType(!1)],exports.UI.prototype,"draggable",void 0),e([t.dataType(!1)],exports.UI.prototype,"editable",void 0),e([t.dataType("size")],exports.UI.prototype,"editSize",void 0),e([t.hitType(!0)],exports.UI.prototype,"hittable",void 0),e([t.hitType("path")],exports.UI.prototype,"hitFill",void 0),e([t.strokeType("path")],exports.UI.prototype,"hitStroke",void 0),e([t.hitType(!1)],exports.UI.prototype,"hitBox",void 0),e([t.hitType(!0)],exports.UI.prototype,"hitChildren",void 0),e([t.hitType(!0)],exports.UI.prototype,"hitSelf",void 0),e([t.hitType()],exports.UI.prototype,"hitRadius",void 0),e([t.cursorType("")],exports.UI.prototype,"cursor",void 0),e([t.surfaceType()],exports.UI.prototype,"fill",void 0),e([t.strokeType()],exports.UI.prototype,"stroke",void 0),e([t.strokeType("inside")],exports.UI.prototype,"strokeAlign",void 0),e([t.strokeType(1)],exports.UI.prototype,"strokeWidth",void 0),e([t.strokeType(!1)],exports.UI.prototype,"strokeWidthFixed",void 0),e([t.strokeType("none")],exports.UI.prototype,"strokeCap",void 0),e([t.strokeType("miter")],exports.UI.prototype,"strokeJoin",void 0),e([t.strokeType()],exports.UI.prototype,"dashPattern",void 0),e([t.strokeType()],exports.UI.prototype,"dashOffset",void 0),e([t.strokeType(10)],exports.UI.prototype,"miterLimit",void 0),e([t.dataType(!1)],exports.UI.prototype,"lazy",void 0),e([t.naturalBoundsType(1)],exports.UI.prototype,"pixelRatio",void 0),e([t.pathInputType()],exports.UI.prototype,"path",void 0),e([t.pathType()],exports.UI.prototype,"windingRule",void 0),e([_("none")],exports.UI.prototype,"startArrow",void 0),e([_("none")],exports.UI.prototype,"endArrow",void 0),e([t.pathType(0)],exports.UI.prototype,"cornerRadius",void 0),e([t.pathType()],exports.UI.prototype,"cornerSmoothing",void 0),e([d()],exports.UI.prototype,"shadow",void 0),e([d()],exports.UI.prototype,"innerShadow",void 0),e([d()],exports.UI.prototype,"blur",void 0),e([d()],exports.UI.prototype,"backgroundBlur",void 0),e([d()],exports.UI.prototype,"grayscale",void 0),e([t.dataType()],exports.UI.prototype,"normalStyle",void 0),e([t.dataType()],exports.UI.prototype,"hoverStyle",void 0),e([t.dataType()],exports.UI.prototype,"pressStyle",void 0),e([t.dataType()],exports.UI.prototype,"focusStyle",void 0),e([t.dataType()],exports.UI.prototype,"selectedStyle",void 0),e([t.dataType()],exports.UI.prototype,"disabledStyle",void 0),e([t.rewrite(t.Leaf.prototype.reset)],exports.UI.prototype,"reset",null),exports.UI=M=e([t.useModule(D),t.useModule(E),t.rewriteAble()],exports.UI),exports.Group=class extends exports.UI{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(e){if(e.children){const{children:s}=e;let r;delete e.children,this.children?this.clear():this.__setBranch(),super.set(e),s.forEach((e=>{r=e.__?e:t.UICreator.get(e.tag,e),this.add(r)})),e.children=s}else super.set(e)}toJSON(){const t=super.toJSON();return t.children=this.children.map((t=>t.toJSON())),t}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}},e([t.dataProcessor(f)],exports.Group.prototype,"__",void 0),exports.Group=e([t.useModule(t.Branch),t.registerUI()],exports.Group);const z=t.Debug.get("Leafer");exports.Leafer=class extends exports.Group{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&t.ImageManager.isComplete}get layoutLocked(){return!this.layouter.running}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}constructor(t,e){super(e),this.config={type:"design",start:!0,hittable:!0,smooth:!0,zoom:{min:.01,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0,autoDistance:2}},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t)}init(e,s){if(this.canvas)return;let r;this.__setLeafer(this),e&&t.DataHelper.assign(this.config,e);const{config:o}=this;this.initType(o.type),this.canvas=t.Creator.canvas(o),this.__controllers.push(this.renderer=t.Creator.renderer(this,this.canvas,o),this.watcher=t.Creator.watcher(this,o),this.layouter=t.Creator.layouter(this,o)),this.isApp&&this.__setApp(),this.__checkAutoLayout(o),this.view=this.canvas.view,s?(this.__bindApp(s),r=s.running):(this.selector=t.Creator.selector(this),this.interaction=t.Creator.interaction(this,this.canvas,this.selector,o),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=t.Creator.hitCanvasManager()),this.canvasManager=new t.CanvasManager,r=o.start),this.hittable=o.hittable,this.fill=o.fill,this.canvasManager.add(this.canvas),this.__listenEvents(),r&&(this.__startTimer=setTimeout(this.start.bind(this))),this.onInit()}onInit(){}initType(t){}set(t){this.children?super.set(t):setTimeout((()=>{super.set(t)}))}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.ready?this.emitLeafer(t.LeaferEvent.RESTART):this.emitLeafer(t.LeaferEvent.START),this.__controllers.forEach((t=>t.start())),this.isApp||this.renderer.render(),this.running=!0)}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach((t=>t.stop())),this.running=!1,this.emitLeafer(t.LeaferEvent.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(e){const s=t.DataHelper.copyAttrs({},e,t.canvasSizeAttrs);Object.keys(s).forEach((t=>this[t]=s[t]))}forceFullRender(){this.forceRender()}forceRender(e){this.renderer.addBlock(e?new t.Bounds(e):this.canvas.bounds),this.viewReady&&this.renderer.update()}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}__doResize(e){if(!this.canvas||this.canvas.isSameSize(e))return;const s=t.DataHelper.copyAttrs({},this.canvas,t.canvasSizeAttrs);this.canvas.resize(e),this.__onResize(new t.ResizeEvent(e,s))}__onResize(e){this.emitEvent(e),t.DataHelper.copyAttrs(this.__,e,t.canvasSizeAttrs),setTimeout((()=>{this.canvasManager&&this.canvasManager.clearRecycled()}),0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(e){e.width&&e.height||(this.autoLayout=new t.AutoBounds(e),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(e,s){this.canvas&&(t.canvasSizeAttrs.includes(e)?this.__changeCanvasSize(e,s):"fill"===e?this.__changeFill(s):"hittable"===e&&(this.canvas.hittable=s)),super.__setAttr(e,s)}__getAttr(e){return this.canvas&&t.canvasSizeAttrs.includes(e)?this.canvas[e]:super.__getAttr(e)}__changeCanvasSize(e,s){const r=t.DataHelper.copyAttrs({},this.canvas,t.canvasSizeAttrs);r[e]=this.config[e]=s,s&&this.canvas.stopAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceFullRender()}__onCreated(){this.created=!0}__onReady(){this.ready||(this.ready=!0,this.emitLeafer(t.LeaferEvent.BEFORE_READY),this.emitLeafer(t.LeaferEvent.READY),this.emitLeafer(t.LeaferEvent.AFTER_READY),t.WaitHelper.run(this.__readyWait))}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(t.LeaferEvent.VIEW_READY),t.WaitHelper.run(this.__viewReadyWait))}__onNextRender(){if(this.viewReady){t.WaitHelper.run(this.__nextRenderWait);const{imageReady:e}=this;e&&!this.viewCompleted&&this.__checkViewCompleted(),e||(this.viewCompleted=!1)}}__checkViewCompleted(e=!0){this.nextRender((()=>{this.imageReady&&(e&&this.emitLeafer(t.LeaferEvent.VIEW_COMPLETED),t.WaitHelper.run(this.__viewCompletedWait),this.viewCompleted=!0)}))}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender((()=>this.interaction.updateCursor()))}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const r=this.__nextRenderWait;if(s){for(let e=0;e<r.length;e++)if(r[e]===t){r.splice(e,1);break}}else r.push(t)}zoom(t,e,s){}validScale(t){const{scaleX:e}=this.zoomLayer.__,{min:s,max:r}=this.app.config.zoom,o=Math.abs(e*t);return o<s?t=s/e:o>r&&(t=r/e),t}__checkUpdateLayout(){this.__layout.update()}emitLeafer(e){this.emitEvent(new t.LeaferEvent(e,this))}__listenEvents(){const e=t.Run.start("FirstCreate "+this.innerName);this.once(t.LeaferEvent.START,(()=>t.Run.end(e))),this.once(t.LayoutEvent.END,(()=>this.__onReady())),this.once(t.RenderEvent.START,(()=>this.__onCreated())),this.once(t.RenderEvent.END,(()=>this.__onViewReady())),this.__eventIds.push(this.on_(t.WatchEvent.DATA,this.__onWatchData,this),this.on_(t.RenderEvent.NEXT,this.__onNextRender,this),this.on_(t.LayoutEvent.CHECK_UPDATE,this.__checkUpdateLayout,this))}__removeListenEvents(){this.off_(this.__eventIds),this.__eventIds.length=0}destroy(){setTimeout((()=>{if(!this.destroyed)try{this.stop(),this.emitEvent(new t.LeaferEvent(t.LeaferEvent.END,this)),this.__removeListenEvents(),this.__controllers.forEach((t=>{this.parent&&t===this.interaction||t.destroy()})),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout((()=>{t.ImageManager.clearRecycled()}),100)}catch(t){z.error(t)}}))}},e([t.dataProcessor(m)],exports.Leafer.prototype,"__",void 0),e([t.boundsType()],exports.Leafer.prototype,"pixelRatio",void 0),exports.Leafer=e([t.registerUI()],exports.Leafer),exports.Rect=class extends exports.UI{get __tag(){return"Rect"}constructor(t){super(t)}},e([t.dataProcessor(R)],exports.Rect.prototype,"__",void 0),exports.Rect=e([t.useModule(W),t.rewriteAble(),t.registerUI()],exports.Rect);const H=exports.Rect.prototype,O=exports.Group.prototype,N={},{copy:G,add:V}=t.BoundsHelper;exports.Box=class extends exports.Group{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){let t=this.__updateRectRenderSpread()||super.__updateRenderSpread();return this.__.__drawAfterFill="hide"===this.__.overflow,t||(t=this.__.__drawAfterFill?0:1),t}__updateRectBoxBounds(){}__updateBoxBounds(){const t=this.__;if(t.__autoSide&&this.children.length){if(this.leafer&&this.leafer.layouter.addExtra(this),super.__updateBoxBounds(),!t.__autoSize){const e=this.__layout.boxBounds;t.__autoWidth||(e.x=0,e.width=t.width),t.__autoHeight||(e.y=0,e.height=t.height)}}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){if(this.__updateRectRenderBounds(),!this.__.__drawAfterFill){const{renderBounds:t}=this.__layout;G(N,t),super.__updateRenderBounds(),V(t,N)}}__updateRectRenderBounds(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.__renderGroup(t,e))}__drawAfterFill(t,e){t.save(),t.clip(),this.__renderGroup(t,e),t.restore(),this.__.stroke&&this.__drawRenderPath(t)}},e([t.dataProcessor(w)],exports.Box.prototype,"__",void 0),e([t.affectRenderBoundsType("show")],exports.Box.prototype,"overflow",void 0),e([t.rewrite(H.__updateStrokeSpread)],exports.Box.prototype,"__updateStrokeSpread",null),e([t.rewrite(H.__updateRenderSpread)],exports.Box.prototype,"__updateRectRenderSpread",null),e([t.rewrite(H.__updateBoxBounds)],exports.Box.prototype,"__updateRectBoxBounds",null),e([t.rewrite(H.__updateStrokeBounds)],exports.Box.prototype,"__updateStrokeBounds",null),e([t.rewrite(H.__updateRenderBounds)],exports.Box.prototype,"__updateRectRenderBounds",null),e([t.rewrite(H.__updateChange)],exports.Box.prototype,"__updateRectChange",null),e([t.rewrite(H.__render)],exports.Box.prototype,"__renderRect",null),e([t.rewrite(O.__render)],exports.Box.prototype,"__renderGroup",null),exports.Box=e([t.rewriteAble(),t.registerUI()],exports.Box),exports.Frame=class extends exports.Box{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}},e([t.dataProcessor(T)],exports.Frame.prototype,"__",void 0),e([t.surfaceType("#FFFFFF")],exports.Frame.prototype,"fill",void 0),e([t.affectRenderBoundsType("hide")],exports.Frame.prototype,"overflow",void 0),exports.Frame=e([t.registerUI()],exports.Frame);const{moveTo:j,closePath:Y,ellipse:X}=t.PathCommandDataHelper;exports.Ellipse=class extends exports.UI{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:e,height:s,innerRadius:r,startAngle:o,endAngle:i}=this.__,a=e/2,n=s/2,p=this.__.path=[];r?(o||i?(r<1&&X(p,a,n,a*r,n*r,0,o,i,!1),X(p,a,n,a,n,0,i,o,!0),r<1&&Y(p)):(r<1&&(X(p,a,n,a*r,n*r),j(p,e,n)),X(p,a,n,a,n,0,360,0,!0)),t.Platform.ellipseToCurve&&(this.__.path=this.getPath(!0))):o||i?(j(p,a,n),X(p,a,n,a,n,0,o,i,!1),Y(p)):X(p,a,n,a,n)}},e([t.dataProcessor(P)],exports.Ellipse.prototype,"__",void 0),e([t.pathType(0)],exports.Ellipse.prototype,"innerRadius",void 0),e([t.pathType(0)],exports.Ellipse.prototype,"startAngle",void 0),e([t.pathType(0)],exports.Ellipse.prototype,"endAngle",void 0),exports.Ellipse=e([t.registerUI()],exports.Ellipse);const{moveTo:J,lineTo:K,drawPoints:$}=t.PathCommandDataHelper,{rotate:q,getAngle:Q,getDistance:Z,defaultPoint:tt}=t.PointHelper,{toBounds:et}=t.PathBounds;exports.Line=class extends exports.UI{get __tag(){return"Line"}get toPoint(){const{width:e,rotation:s}=this.__,r=t.getPointData();return e&&(r.x=e),s&&q(r,s),r}set toPoint(t){this.width=Z(tt,t),this.rotation=Q(tt,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];this.__.points?$(t,this.__.points,!1):(J(t,0,0),K(t,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?($(t.__pathForRender=[],t.points,t.curve,this.pathClosed),t.__useArrow&&r.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?et(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}},e([t.dataProcessor(I)],exports.Line.prototype,"__",void 0),e([t.affectStrokeBoundsType("center")],exports.Line.prototype,"strokeAlign",void 0),e([t.boundsType(0)],exports.Line.prototype,"height",void 0),e([t.pathType()],exports.Line.prototype,"points",void 0),e([t.pathType(0)],exports.Line.prototype,"curve",void 0),exports.Line=e([t.registerUI()],exports.Line);const{sin:st,cos:rt,PI:ot}=Math,{moveTo:it,lineTo:at,closePath:nt,drawPoints:pt}=t.PathCommandDataHelper,ht=exports.Line.prototype;exports.Polygon=class extends exports.UI{get __tag(){return"Polygon"}constructor(t){super(t),this.pathClosed=!0}__updatePath(){const t=this.__.path=[];if(this.__.points)pt(t,this.__.points,!1,!0);else{const{width:e,height:s,sides:r}=this.__,o=e/2,i=s/2;it(t,o,0);for(let e=1;e<r;e++)at(t,o+o*st(2*e*ot/r),i-i*rt(2*e*ot/r))}nt(t)}__updateRenderPath(){}__updateBoxBounds(){}},e([t.dataProcessor(b)],exports.Polygon.prototype,"__",void 0),e([t.pathType(3)],exports.Polygon.prototype,"sides",void 0),e([t.pathType()],exports.Polygon.prototype,"points",void 0),e([t.pathType(0)],exports.Polygon.prototype,"curve",void 0),e([t.rewrite(ht.__updateRenderPath)],exports.Polygon.prototype,"__updateRenderPath",null),e([t.rewrite(ht.__updateBoxBounds)],exports.Polygon.prototype,"__updateBoxBounds",null),exports.Polygon=e([t.rewriteAble(),t.registerUI()],exports.Polygon);const{sin:_t,cos:dt,PI:lt}=Math,{moveTo:ut,lineTo:ct,closePath:yt}=t.PathCommandDataHelper;exports.Star=class extends exports.UI{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:s,innerRadius:r}=this.__,o=t/2,i=e/2,a=this.__.path=[];ut(a,o,0);for(let t=1;t<2*s;t++)ct(a,o+(t%2==0?o:o*r)*_t(t*lt/s),i-(t%2==0?i:i*r)*dt(t*lt/s));yt(a)}},e([t.dataProcessor(S)],exports.Star.prototype,"__",void 0),e([t.pathType(5)],exports.Star.prototype,"corners",void 0),e([t.pathType(.382)],exports.Star.prototype,"innerRadius",void 0),exports.Star=e([t.registerUI()],exports.Star),exports.Image=class extends exports.Rect{get __tag(){return"Image"}get ready(){return!!this.image&&this.image.ready}constructor(e){super(e),this.on(t.ImageEvent.LOADED,(t=>{"fill"===t.attrName&&t.attrValue.url===this.url&&(this.image=t.image)}))}destroy(){this.image=null,super.destroy()}},e([t.dataProcessor(A)],exports.Image.prototype,"__",void 0),e([t.boundsType("")],exports.Image.prototype,"url",void 0),exports.Image=e([t.registerUI()],exports.Image),exports.Canvas=class extends exports.Rect{get __tag(){return"Canvas"}constructor(e){super(e),this.canvas=t.Creator.canvas(this.__),this.context=this.canvas.context,this.__.__drawAfterFill=!0}draw(e,s,r,o){e.__layout.update();const i=new t.Matrix(e.__world).invert(),a=new t.Matrix;s&&a.translate(s.x,s.y),r&&("number"==typeof r?a.scale(r):a.scale(r.x,r.y)),o&&a.rotate(o),i.multiplyParent(a),e.__render(this.canvas,{matrix:i.withScale()}),this.paint()}paint(){this.forceUpdate("fill")}__drawAfterFill(t,e){const s=this.canvas.view,{width:r,height:o}=this;this.__.cornerRadius?(t.save(),t.clip(),t.drawImage(this.canvas.view,0,0,s.width,s.height,0,0,r,o),t.restore()):t.drawImage(this.canvas.view,0,0,s.width,s.height,0,0,r,o)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e}=this.__;t.smooth!==e&&(t.smooth=e),t.resize(this.__)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null,this.context=null),super.destroy()}},e([t.dataProcessor(L)],exports.Canvas.prototype,"__",void 0),e([l(100)],exports.Canvas.prototype,"width",void 0),e([l(100)],exports.Canvas.prototype,"height",void 0),e([l(t.Platform.devicePixelRatio)],exports.Canvas.prototype,"pixelRatio",void 0),e([l(!0)],exports.Canvas.prototype,"smooth",void 0),e([t.hitType("all")],exports.Canvas.prototype,"hitFill",void 0),exports.Canvas=e([t.registerUI()],exports.Canvas);const{copyAndSpread:xt,includes:vt,spread:gt,setList:ft}=t.BoundsHelper;exports.Text=class extends exports.UI{get __tag(){return"Text"}get textDrawData(){return this.__layout.update(),this.__.__textDrawData}constructor(t){super(t)}__drawHitPath(t){const{__lineHeight:e,__baseLine:s,__textDrawData:r}=this.__;t.beginPath(),this.__.__letterSpacing<0?this.__drawPathByData(t):r.rows.forEach((r=>t.rect(r.x,r.y-s,r.width,e)))}__drawPathByData(t,e){const{x:s,y:r,width:o,height:i}=this.__layout.boxBounds;t.rect(s,r,o,i)}__drawRenderPath(t){t.font=this.__.__font}__updateTextDrawData(){const t=this.__;t.__textDrawData=s.getDrawData(t.text,this.__)}__updateBoxBounds(){const e=this.__,s=this.__layout,{lineHeight:r,letterSpacing:o,fontFamily:i,fontSize:a,fontWeight:n,italic:p,textCase:h,textOverflow:_,padding:d}=e,l=e.__autoWidth,u=e.__autoHeight;e.__lineHeight=g.number(r,a),e.__letterSpacing=g.number(o,a),e.__padding=d?t.MathHelper.fourNumber(d):void 0,e.__baseLine=e.__lineHeight-(e.__lineHeight-.7*a)/2,e.__font=`${p?"italic ":""}${"small-caps"===h?"small-caps ":""}${"normal"!==n?n+" ":""}${a}px ${i}`,e.__clipText="show"!==_&&!e.__autoSize,this.__updateTextDrawData();const{bounds:c}=e.__textDrawData,y=s.boxBounds;if(e.__lineHeight<a&&gt(c,a/2),l||u){if(y.x=l?c.x:0,y.y=u?c.y:0,y.width=l?c.width:e.width,y.height=u?c.height:e.height,d){const[t,s,r,o]=e.__padding;l&&(y.x-=o,y.width+=s+o),u&&(y.y-=t,y.height+=r+t)}this.__updateNaturalSize()}else super.__updateBoxBounds();const x=vt(y,c)?y:c;x!==s.contentBounds?(s.contentBounds=x,s.renderChanged=!0,ft(e.__textBoxBounds={},[y,c])):e.__textBoxBounds=x}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.__layout.boxBounds===this.__layout.contentBounds?0:1),t}__updateRenderBounds(){xt(this.__layout.renderBounds,this.__.__textBoxBounds,this.__layout.renderSpread)}},e([t.dataProcessor(C)],exports.Text.prototype,"__",void 0),e([t.boundsType(0)],exports.Text.prototype,"width",void 0),e([t.boundsType(0)],exports.Text.prototype,"height",void 0),e([t.boundsType(0)],exports.Text.prototype,"padding",void 0),e([t.surfaceType("#000000")],exports.Text.prototype,"fill",void 0),e([t.affectStrokeBoundsType("outside")],exports.Text.prototype,"strokeAlign",void 0),e([t.hitType("all")],exports.Text.prototype,"hitFill",void 0),e([t.boundsType("")],exports.Text.prototype,"text",void 0),e([t.boundsType("L")],exports.Text.prototype,"fontFamily",void 0),e([t.boundsType(12)],exports.Text.prototype,"fontSize",void 0),e([t.boundsType("normal")],exports.Text.prototype,"fontWeight",void 0),e([t.boundsType(!1)],exports.Text.prototype,"italic",void 0),e([t.boundsType("none")],exports.Text.prototype,"textCase",void 0),e([t.boundsType("none")],exports.Text.prototype,"textDecoration",void 0),e([t.boundsType(0)],exports.Text.prototype,"letterSpacing",void 0),e([t.boundsType({type:"percent",value:150})],exports.Text.prototype,"lineHeight",void 0),e([t.boundsType(0)],exports.Text.prototype,"paraIndent",void 0),e([t.boundsType(0)],exports.Text.prototype,"paraSpacing",void 0),e([t.boundsType("left")],exports.Text.prototype,"textAlign",void 0),e([t.boundsType("top")],exports.Text.prototype,"verticalAlign",void 0),e([t.boundsType("normal")],exports.Text.prototype,"textWrap",void 0),e([t.boundsType("show")],exports.Text.prototype,"textOverflow",void 0),exports.Text=e([t.registerUI()],exports.Text),exports.Path=class extends exports.UI{get __tag(){return"Path"}constructor(t){super(t),this.__.__pathInputed=2}},e([t.dataProcessor(k)],exports.Path.prototype,"__",void 0),e([t.affectStrokeBoundsType("center")],exports.Path.prototype,"strokeAlign",void 0),exports.Path=e([t.registerUI()],exports.Path),exports.Pen=class extends exports.Group{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(t){const e=this.pathElement=new exports.Path(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this.__path.length=0,this.paint(),this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,r,o,i){return this}quadraticCurveTo(t,e,s,r){return this}closePath(){return this}rect(t,e,s,r){return this}roundRect(t,e,s,r,o){return this}ellipse(t,e,s,r,o,i,a,n){return this}arc(t,e,s,r,o,i){return this}arcTo(t,e,s,r,o){return this}drawEllipse(t,e,s,r,o,i,a,n){return this}drawArc(t,e,s,r,o,i){return this}drawPoints(t,e,s){return this}paint(){this.pathElement.forceUpdate("path")}},e([t.dataProcessor(B)],exports.Pen.prototype,"__",void 0),e([(e,s)=>{t.defineKey(e,s,{get(){return this.__path}})}],exports.Pen.prototype,"path",void 0),exports.Pen=e([t.useModule(t.PathCreator,["beginPath","path"]),t.registerUI()],exports.Pen),exports.BoxData=w,exports.CanvasData=L,exports.ColorConvert={},exports.Effect=a,exports.EllipseData=P,exports.Export=n,exports.FrameData=T,exports.GroupData=f,exports.ImageData=A,exports.LeaferData=m,exports.LineData=I,exports.Paint=o,exports.PaintGradient={},exports.PaintImage=i,exports.PathArrow=r,exports.PathData=k,exports.PenData=B,exports.PolygonData=b,exports.RectData=R,exports.RectRender=W,exports.StarData=S,exports.State=p,exports.TextConvert=s,exports.TextData=C,exports.UIBounds=D,exports.UIData=v,exports.UIRender=E,exports.UnitConvert=g,exports.arrowType=_,exports.effectType=d,exports.resizeType=l,exports.stateType=h,exports.zoomLayerType=u,Object.keys(t).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/draw",
3
- "version": "1.0.0-rc.18",
3
+ "version": "1.0.0-rc.19",
4
4
  "description": "@leafer-ui/draw",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -29,10 +29,10 @@
29
29
  "leaferjs"
30
30
  ],
31
31
  "dependencies": {
32
- "@leafer/core": "1.0.0-rc.18",
33
- "@leafer-ui/display": "1.0.0-rc.18",
34
- "@leafer-ui/display-module": "1.0.0-rc.18",
35
- "@leafer-ui/decorator": "1.0.0-rc.18",
36
- "@leafer-ui/external": "1.0.0-rc.18"
32
+ "@leafer/core": "1.0.0-rc.19",
33
+ "@leafer-ui/display": "1.0.0-rc.19",
34
+ "@leafer-ui/display-module": "1.0.0-rc.19",
35
+ "@leafer-ui/decorator": "1.0.0-rc.19",
36
+ "@leafer-ui/external": "1.0.0-rc.19"
37
37
  }
38
38
  }