@leafer-in/flow 1.0.0-rc.30 → 1.0.1

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.
@@ -1 +1 @@
1
- export*from"@leafer-in/resize";import{BoxData as t,dataProcessor as o,autoLayoutType as e,registerUI as n,Box as i,AlignHelper as h,PointHelper as r,MathHelper as s,decorateLeafAttr as c,attr as a,doBoundsType as l,UI as _,BoundsHelper as g}from"@leafer-ui/draw";function u(t,o,e,n){var i,h=arguments.length,r=h<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,o,e,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(h<3?i(r):h>3?i(o,e,r):i(o,e))||r);return h>3&&r&&Object.defineProperty(o,e,r),r}"function"==typeof SuppressedError&&SuppressedError;let f=class extends i{get __tag(){return"Flow"}constructor(t){super(t),this.__hasAutoLayout=!0}};u([o(class extends t{})],f.prototype,"__",void 0),u([e("x")],f.prototype,"flow",void 0),f=u([n()],f);const w={},p={"top-left":"from",top:"center","top-right":"to",right:"to","bottom-right":"to",bottom:"center","bottom-left":"from",left:"from",center:"center","baseline-left":"from","baseline-center":"center","baseline-right":"to"},d={"top-left":"from",top:"from","top-right":"from",right:"center","bottom-right":"to",bottom:"to","bottom-left":"to",left:"center",center:"center","baseline-left":"to","baseline-center":"to","baseline-right":"to"};function y(t,o,e){h.toPoint(e,o,t.__layout.contentBounds,w);const n=t.__;o.x=n.__autoWidth?0:w.x,o.y=n.__autoHeight?0:w.y}const{move:x}=r;function G(t,o,e,n,i,h){const{children:r}=t;let s,c,{x:a,start:l}=o,_=n;a+=e;for(let t=0,e=o.count;t<e;t++)s=r[h?l-t:l+t],s.__.inFlow&&0!==s.__.visible?(c=s.__flowBounds,"from"!==i&&(_=n+(o.height-c.height)/("center"===i?2:1)),x(s,a-c.x,_-c.y),a+=c.width+o.gap):e++}function m(t,o,e){const n="width"===e?"height":"width";t[e]=Math.max(t[e],o[e]),t[n]+=t.count?o[n]+t.gap:o[n],t.list.push(o),t.count++}const b={};function A(t,o){const{gap:e,flowAlign:n,flowWrap:i,__autoWidth:h,__autoHeight:r}=t.__,s=i&&(o?!h:!r);return"object"==typeof e?(b.xGap=e.x||0,b.yGap=e.y||0):b.xGap=b.yGap=e,b.isAutoXGap="string"==typeof b.xGap&&!h,b.isAutoYGap="string"==typeof b.yGap&&!r,b.complex=s||"top-left"!==n||t.__hasGrow||b.isAutoXGap||b.isAutoYGap,b.wrap=s,b.complex&&(b.isFitXGap="fit"===b.xGap&&!h,b.isFitYGap="fit"===b.yGap&&!r,"object"==typeof n?(b.contentAlign=n.content||"top-left",b.rowXAlign=n.x||"from",b.rowYAlign=n.y||"from"):(b.contentAlign=n,b.rowXAlign=p[n],b.rowYAlign=d[n])),b}function v(t,o){return{x:0,y:0,width:0,height:0,gap:o,start:t,count:0,grow:0}}function B(t,o,e,n){const{count:i}=t;i>1&&(e>t[o]||n)&&(t.gap=(e-t[o])/(i-1),t[o]=e)}function R(t,o){return"box"===o?t.__local:t.__layout.localStrokeBounds}const{within:F}=s;function X(t,o,e,n){let i,h,r,s=0,c=o.hasRangeSize&&[],{grow:a,start:l}=o;const _=o.width<e?(e-o.width)/a:0,{children:g}=t;_&&(o.width=e);for(let t=0,e=o.count;t<e;t++)i=g[n?l-t:l+t],i.__.inFlow&&0!==i.__.visible?(h=i.__widthGrow)&&(r=Y(i,i.__flowBounds,_*h),r?(s+=r,a-=h):c&&(i.__.widthRange?c.unshift(i):c.push(i))):e++;s&&function(t,o,e){let n,i,h,r;t.forEach((t=>{n=t.__widthGrow,i=o/e*n,r=Y(t,h=t.__flowBounds,h.width+i),o-=i-r,e-=n}))}(c,s,a)}function Y(t,o,e){const{widthRange:n,lockRatio:i}=t.__,h=n?F(e,n.min,n.max):e,r=h/o.width;return t.scaleResize(r,i?r:1),o.width=h,e-h}const{within:k}=s;function S(t,o,e,n){let i,h,r,s=0,c=o.hasRangeSize&&[],{grow:a,start:l}=o;const _=o.height<e?(e-o.height)/a:0,{children:g}=t;_&&(o.height=e);for(let t=0,e=o.count;t<e;t++)i=g[n?l-t:l+t],i.__.inFlow&&0!==i.__.visible?(h=i.__heightGrow)&&(r=z(i,i.__flowBounds,_*h),r?(s+=r,a-=h):c&&(i.__.heightRange?c.unshift(i):c.push(i))):e++;s&&function(t,o,e){let n,i,h,r;t.forEach((t=>{n=t.__heightGrow,i=o/e*n,r=z(t,h=t.__flowBounds,h.height+i),o-=i-r,e-=n}))}(c,s,a)}function z(t,o,e){const{heightRange:n,lockRatio:i}=t.__,h=n?k(e,n.min,n.max):e,r=h/o.height;return t.scaleResize(i?r:1,r),o.height=h,e-h}const{move:W}=r;const{move:j}=r;function C(t,o,e,n,i,h){const{children:r}=t;let s,c,{y:a,start:l}=o,_=e;a+=n;for(let t=0,n=o.count;t<n;t++)s=r[h?l-t:l+t],s.__.inFlow&&0!==s.__.visible?(c=s.__flowBounds,"from"!==i&&(_=e+(o.width-c.width)/("center"===i?2:1)),j(s,_-c.x,a-c.y),a+=c.height+o.gap):n++}const{move:E}=r;function P(t){return c(t,(t=>a({set(o){const e="number"==typeof o?o:0;"autoWidth"===t?this.__widthGrow=e:this.__heightGrow=e,!e||this.parent&&this.parent.__hasGrow||this.waitParent((()=>{this.parent.__hasGrow=!0})),this.__setAttr(t,o)&&l(this)}})))}const{copyAndSpread:H}=g;let M=function(t,o){const e="width",{children:n,itemBox:i}=t,h=A(t,!0),{complex:r,wrap:s,xGap:c,yGap:a,isAutoXGap:l,isFitXGap:_}=h;if(!n.length)return;const g=s&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},u=l?0:c;let f,w,d,x,b,{x:F,y:Y,width:k,height:S}=t.__layout.contentBounds;for(let h=0,c=n.length;h<c;h++)f=n[x=o?c-1-h:h],f.__.inFlow&&0!==f.__.visible&&(w=R(f,i),r?(f.__flowBounds=w,b||(b=v(x,u)),s&&b.count&&b.width+w.width>k&&(b.grow?X(t,b,k,o):l&&B(b,e,k,_),m(g,b,e),b=v(x,u)),d=w.width,f.__widthGrow&&(b.grow+=f.__widthGrow,d=0,f.__.widthRange&&(b.hasRangeSize=!0)),f.__heightGrow&&z(f,w,S),b.width+=b.count?d+u:d,b.height=Math.max(b.height,w.height),b.count++):(W(f,F-w.x,Y-w.y),F+=w.width+u));if(r){const{isAutoYGap:n,isFitYGap:i,contentAlign:r,rowXAlign:c,rowYAlign:u}=h;b.count&&(b.grow?X(t,b,k,o):l&&B(b,e,k,_),s&&m(g,b,e)),s?(n?B(g,"height",S,i):g.gap=a,function(t,o,e,n){y(t,o,e);const{list:i}=o;if(i.length>1&&(n||(n=p[e]),"from"!==n)){let t;for(let e=0,h=i.length;e<h;e++)t=i[e],t.x=o.width-t.width,"center"===n&&(t.x/=2)}}(t,g,r,c),function(t,o,e,n){const{list:i}=o,h="reverse"===t.__.flowWrap;let r,{x:s,y:c}=o;for(let a=0,l=i.length;a<l;a++)r=i[h?l-1-a:a],G(t,r,s,c,e,n),c+=r.height+o.gap}(t,g,u,o)):(y(t,b,r),G(t,b,0,b.y,u,o))}},O=function(t,o){const e="height",{children:n,itemBox:i}=t,h=A(t,!1),{complex:r,wrap:s,xGap:c,yGap:a,isAutoYGap:l,isFitYGap:_}=h;if(!n.length)return;const g=s&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},u=l?0:a;let f,w,p,x,G,{x:b,y:F,width:X,height:k}=t.__layout.contentBounds;for(let h=0,c=n.length;h<c;h++)f=n[x=o?c-1-h:h],f.__.inFlow&&0!==f.__.visible&&(w=R(f,i),r?(f.__flowBounds=w,G||(G=v(x,u)),s&&G.count&&G.height+w.height>k&&(G.grow&&S(t,G,k,o),l&&B(G,e,k,_),m(g,G,e),G=v(x,u)),p=w.height,f.__heightGrow&&(G.grow+=f.__heightGrow,p=0,f.__.heightRange&&(G.hasRangeSize=!0)),f.__widthGrow&&Y(f,w,X),G.height+=G.count?p+u:p,G.width=Math.max(G.width,w.width),G.count++):(E(f,b-w.x,F-w.y),F+=w.height+u));if(r){const{isAutoXGap:n,isFitXGap:i,contentAlign:r,rowXAlign:a,rowYAlign:u}=h;G.count&&(G.grow&&S(t,G,k,o),l&&B(G,e,k,_),s&&m(g,G,e)),s?(n?B(g,"width",X,i):g.gap=c,function(t,o,e,n){y(t,o,e);const{list:i}=o;if(i.length>1&&(n||(n=d[e]),"from"!==n)){let t;for(let e=0,h=i.length;e<h;e++)t=i[e],t.y=o.height-t.height,"center"===n&&(t.y/=2)}}(t,g,r,u),function(t,o,e,n){const{list:i}=o,h="reverse"===t.__.flowWrap;let r,{x:s,y:c}=o;for(let a=0,l=i.length;a<l;a++)r=i[h?l-1-a:a],C(t,r,s,c,e,n),s+=r.width+o.gap}(t,g,a,o)):(y(t,G,r),C(t,G,G.x,0,a,o))}};_.changeAttr("autoWidth",void 0,P),_.changeAttr("autoHeight",void 0,P),i.prototype.__updateFlowLayout=function(){this.leafer.created=!1;const{flow:t}=this.__;switch(t){case"x":case!0:M(this);break;case"y":O(this);break;case"x-reverse":M(this,!0);break;case"y-reverse":O(this,!0)}this.leafer.created=!0},i.prototype.__updateContentBounds=function(){const{padding:t}=this.__,o=this.__layout,e=o.contentBounds===o.boxBounds;t?(e&&o.shrinkContent(),H(o.contentBounds,o.boxBounds,t,!0)):e||o.shrinkContentCancel()};export{f as Flow};
1
+ import{PathCommandMap as t,MatrixHelper as e,Leaf as o,Text as i,Path as n,Line as s,Polygon as h,Group as c,Box as r,BoxData as a,dataProcessor as l,autoLayoutType as _,registerUI as u,AlignHelper as f,PointHelper as g,MathHelper as p,decorateLeafAttr as d,attr as w,doBoundsType as y,UI as x,BoundsHelper as b}from"@leafer-ui/draw";const{M:G,L:m,C:R,Q:z,Z:A,N:B,D:k,X:v,G:F,F:S,O:X,P:Y,U:C}=t,P={scale(t,e,o){if(!t)return;let i,n=0,s=t.length;for(;n<s;)switch(i=t[n],i){case G:case m:W(t,e,o,n,1),n+=3;break;case R:W(t,e,o,n,3),n+=7;break;case z:W(t,e,o,n,2),n+=5;break;case A:n+=1;break;case B:W(t,e,o,n,2),n+=5;break;case k:W(t,e,o,n,2),n+=9;break;case v:W(t,e,o,n,2),n+=6;break;case F:W(t,e,o,n,2),n+=9;break;case S:W(t,e,o,n,2),n+=5;break;case X:t[n]=F,t.splice(n+4,0,t[n+3],0),W(t,e,o,n,2),n+=9,s+=2;break;case Y:t[n]=S,t.splice(n+4,0,t[n+3]),W(t,e,o,n,2),n+=5,s+=1;break;case C:W(t,e,o,n,2),n+=6}},scalePoints(t,e,o,i,n){for(let s=n?i+1:0,h=n?s+2*n:t.length;s<h;s+=2)t[s]*=e,t[s+1]*=o}},{scalePoints:W}=P,O=e.get();function j(t,e,o){t.pathInputed?H(t,e,o):(1!==e&&(t.width*=e),1!==o&&(t.height*=o))}function E(t,e,o){const{width:i,height:n}=t.__localBoxBounds;1!==e?(t.fontSize*=e,t.y-=n*(e-o)/2):1!==o&&(t.fontSize*=o,t.x-=i*(o-e)/2)}function H(t,e,o){P.scale(t.__.path,e,o),t.path=t.__.path}function M(t,e,o){P.scalePoints(t.__.points,e,o),t.points=t.__.points}function I(t,e,o){const{children:i}=t;for(let t=0;t<i.length;t++)O.a=e,O.d=o,i[t].transform(O,!0)}const L=o.prototype;function D(t,e,o,i){var n,s=arguments.length,h=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,o,i);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(h=(s<3?n(h):s>3?n(e,o,h):n(e,o))||h);return s>3&&h&&Object.defineProperty(e,o,h),h}L.scaleResize=function(t,e=t,o){const i=this;o||i.editConfig&&"scale"===i.editConfig.editSize?(i.scaleX*=t,i.scaleY*=e):(t<0&&(i.scaleX*=-1,t=-t),e<0&&(i.scaleY*=-1,e=-e),this.__scaleResize(t,e))},L.__scaleResize=function(t,e){j(this,t,e)},L.resizeWidth=function(t){const e=t/this.getBounds("box","local").width;this.scaleOf(this.__layout.boxBounds,e,this.__.lockRatio?e:1,!0)},L.resizeHeight=function(t){const e=t/this.getBounds("box","local").height;this.scaleOf(this.__layout.boxBounds,this.__.lockRatio?e:1,e,!0)},i.prototype.__scaleResize=function(t,e){this.__.__autoSize&&(this.__.resizeFontSize||this.editConfig&&"font-size"===this.editConfig.editSize)?E(this,t,e):j(this,t,e)},n.prototype.__scaleResize=function(t,e){H(this,t,e)},s.prototype.__scaleResize=function(t,e){this.pathInputed?H(this,t,e):this.points?M(this,t,e):this.width*=t},h.prototype.__scaleResize=function(t,e){this.pathInputed?H(this,t,e):this.points?M(this,t,e):j(this,t,e)},c.prototype.__scaleResize=function(t,e){I(this,t,e)},r.prototype.__scaleResize=function(t,e){this.__.__autoSize&&this.children.length?I(this,t,e):(j(this,t,e),this.__.resizeChildren&&I(this,t,e))},"function"==typeof SuppressedError&&SuppressedError;let N=class extends r{get __tag(){return"Flow"}constructor(t){super(t),this.__hasAutoLayout=!0}};D([l(class extends a{})],N.prototype,"__",void 0),D([_("x")],N.prototype,"flow",void 0),N=D([u()],N);const Q={},U={"top-left":"from",top:"center","top-right":"to",right:"to","bottom-right":"to",bottom:"center","bottom-left":"from",left:"from",center:"center","baseline-left":"from","baseline-center":"center","baseline-right":"to"},Z={"top-left":"from",top:"from","top-right":"from",right:"center","bottom-right":"to",bottom:"to","bottom-left":"to",left:"center",center:"center","baseline-left":"to","baseline-center":"to","baseline-right":"to"};function q(t,e,o){f.toPoint(o,e,t.__layout.contentBounds,Q);const i=t.__;e.x=i.__autoWidth?0:Q.x,e.y=i.__autoHeight?0:Q.y}const{move:J}=g;function K(t,e,o,i,n,s){const{children:h}=t;let c,r,{x:a,start:l}=e,_=i;a+=o;for(let t=0,o=e.count;t<o;t++)c=h[s?l-t:l+t],c.__.inFlow&&0!==c.__.visible?(r=c.__flowBounds,"from"!==n&&(_=i+(e.height-r.height)/("center"===n?2:1)),J(c,a-r.x,_-r.y),a+=r.width+e.gap):o++}function T(t,e,o){const i="width"===o?"height":"width";t[o]=Math.max(t[o],e[o]),t[i]+=t.count?e[i]+t.gap:e[i],t.list.push(e),t.count++}const V={};function $(t,e){const{gap:o,flowAlign:i,flowWrap:n,__autoWidth:s,__autoHeight:h}=t.__,c=n&&(e?!s:!h);return"object"==typeof o?(V.xGap=o.x||0,V.yGap=o.y||0):V.xGap=V.yGap=o,V.isAutoXGap="string"==typeof V.xGap&&!s,V.isAutoYGap="string"==typeof V.yGap&&!h,V.complex=c||"top-left"!==i||t.__hasGrow||V.isAutoXGap||V.isAutoYGap,V.wrap=c,V.complex&&(V.isFitXGap="fit"===V.xGap&&!s,V.isFitYGap="fit"===V.yGap&&!h,"object"==typeof i?(V.contentAlign=i.content||"top-left",V.rowXAlign=i.x||"from",V.rowYAlign=i.y||"from"):(V.contentAlign=i,V.rowXAlign=U[i],V.rowYAlign=Z[i])),V}function tt(t,e){return{x:0,y:0,width:0,height:0,gap:e,start:t,count:0,grow:0}}function et(t,e,o,i){const{count:n}=t;n>1&&(o>t[e]||i)&&(t.gap=(o-t[e])/(n-1),t[e]=o)}function ot(t,e){return"box"===e?t.__local:t.__layout.localStrokeBounds}const{within:it}=p;function nt(t,e,o,i){let n,s,h,c=0,r=e.hasRangeSize&&[],{grow:a,start:l}=e;const _=e.width<o?(o-e.width)/a:0,{children:u}=t;_&&(e.width=o);for(let t=0,o=e.count;t<o;t++)n=u[i?l-t:l+t],n.__.inFlow&&0!==n.__.visible?(s=n.__widthGrow)&&(h=st(n,n.__flowBounds,_*s),h?(c+=h,a-=s):r&&(n.__.widthRange?r.unshift(n):r.push(n))):o++;c&&function(t,e,o){let i,n,s,h;t.forEach((t=>{i=t.__widthGrow,n=e/o*i,h=st(t,s=t.__flowBounds,s.width+n),e-=n-h,o-=i}))}(r,c,a)}function st(t,e,o){const{widthRange:i,lockRatio:n}=t.__,s=i?it(o,i):o,h=s/e.width;return t.scaleResize(h,n?h:1),e.width=s,o-s}const{within:ht}=p;function ct(t,e,o,i){let n,s,h,c=0,r=e.hasRangeSize&&[],{grow:a,start:l}=e;const _=e.height<o?(o-e.height)/a:0,{children:u}=t;_&&(e.height=o);for(let t=0,o=e.count;t<o;t++)n=u[i?l-t:l+t],n.__.inFlow&&0!==n.__.visible?(s=n.__heightGrow)&&(h=rt(n,n.__flowBounds,_*s),h?(c+=h,a-=s):r&&(n.__.heightRange?r.unshift(n):r.push(n))):o++;c&&function(t,e,o){let i,n,s,h;t.forEach((t=>{i=t.__heightGrow,n=e/o*i,h=rt(t,s=t.__flowBounds,s.height+n),e-=n-h,o-=i}))}(r,c,a)}function rt(t,e,o){const{heightRange:i,lockRatio:n}=t.__,s=i?ht(o,i):o,h=s/e.height;return t.scaleResize(n?h:1,h),e.height=s,o-s}const{move:at}=g;const{move:lt}=g;function _t(t,e,o,i,n,s){const{children:h}=t;let c,r,{y:a,start:l}=e,_=o;a+=i;for(let t=0,i=e.count;t<i;t++)c=h[s?l-t:l+t],c.__.inFlow&&0!==c.__.visible?(r=c.__flowBounds,"from"!==n&&(_=o+(e.width-r.width)/("center"===n?2:1)),lt(c,_-r.x,a-r.y),a+=r.height+e.gap):i++}const{move:ut}=g;function ft(t){return d(t,(t=>w({set(e){const o="number"==typeof e?e:0;"autoWidth"===t?this.__widthGrow=o:this.__heightGrow=o,!o||this.parent&&this.parent.__hasGrow||this.waitParent((()=>{this.parent.__hasGrow=!0})),this.__setAttr(t,e)&&y(this)}})))}const{copyAndSpread:gt}=b;let pt=function(t,e){const o="width",{children:i,itemBox:n}=t,s=$(t,!0),{complex:h,wrap:c,xGap:r,yGap:a,isAutoXGap:l,isFitXGap:_}=s;if(!i.length)return;const u=c&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},f=l?0:r;let g,p,d,w,y,{x:x,y:b,width:G,height:m}=t.__layout.contentBounds;for(let s=0,r=i.length;s<r;s++)g=i[w=e?r-1-s:s],g.__.inFlow&&0!==g.__.visible&&(p=ot(g,n),h?(g.__flowBounds=p,y||(y=tt(w,f)),c&&y.count&&y.width+p.width>G&&(y.grow?nt(t,y,G,e):l&&et(y,o,G,_),T(u,y,o),y=tt(w,f)),d=p.width,g.__widthGrow&&(y.grow+=g.__widthGrow,d=0,g.__.widthRange&&(y.hasRangeSize=!0)),g.__heightGrow&&rt(g,p,m),y.width+=y.count?d+f:d,y.height=Math.max(y.height,p.height),y.count++):(at(g,x-p.x,b-p.y),x+=p.width+f));if(h){const{isAutoYGap:i,isFitYGap:n,contentAlign:h,rowXAlign:r,rowYAlign:f}=s;y.count&&(y.grow?nt(t,y,G,e):l&&et(y,o,G,_),c&&T(u,y,o)),c?(i?et(u,"height",m,n):u.gap=a,function(t,e,o,i){q(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=U[o]),"from"!==i)){let t;for(let o=0,s=n.length;o<s;o++)t=n[o],t.x=e.width-t.width,"center"===i&&(t.x/=2)}}(t,u,h,r),function(t,e,o,i){const{list:n}=e,s="reverse"===t.__.flowWrap;let h,{x:c,y:r}=e;for(let a=0,l=n.length;a<l;a++)h=n[s?l-1-a:a],K(t,h,c,r,o,i),r+=h.height+e.gap}(t,u,f,e)):(q(t,y,h),K(t,y,0,y.y,f,e))}},dt=function(t,e){const o="height",{children:i,itemBox:n}=t,s=$(t,!1),{complex:h,wrap:c,xGap:r,yGap:a,isAutoYGap:l,isFitYGap:_}=s;if(!i.length)return;const u=c&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},f=l?0:a;let g,p,d,w,y,{x:x,y:b,width:G,height:m}=t.__layout.contentBounds;for(let s=0,r=i.length;s<r;s++)g=i[w=e?r-1-s:s],g.__.inFlow&&0!==g.__.visible&&(p=ot(g,n),h?(g.__flowBounds=p,y||(y=tt(w,f)),c&&y.count&&y.height+p.height>m&&(y.grow&&ct(t,y,m,e),l&&et(y,o,m,_),T(u,y,o),y=tt(w,f)),d=p.height,g.__heightGrow&&(y.grow+=g.__heightGrow,d=0,g.__.heightRange&&(y.hasRangeSize=!0)),g.__widthGrow&&st(g,p,G),y.height+=y.count?d+f:d,y.width=Math.max(y.width,p.width),y.count++):(ut(g,x-p.x,b-p.y),b+=p.height+f));if(h){const{isAutoXGap:i,isFitXGap:n,contentAlign:h,rowXAlign:a,rowYAlign:f}=s;y.count&&(y.grow&&ct(t,y,m,e),l&&et(y,o,m,_),c&&T(u,y,o)),c?(i?et(u,"width",G,n):u.gap=r,function(t,e,o,i){q(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=Z[o]),"from"!==i)){let t;for(let o=0,s=n.length;o<s;o++)t=n[o],t.y=e.height-t.height,"center"===i&&(t.y/=2)}}(t,u,h,f),function(t,e,o,i){const{list:n}=e,s="reverse"===t.__.flowWrap;let h,{x:c,y:r}=e;for(let a=0,l=n.length;a<l;a++)h=n[s?l-1-a:a],_t(t,h,c,r,o,i),c+=h.width+e.gap}(t,u,a,e)):(q(t,y,h),_t(t,y,y.x,0,a,e))}};x.changeAttr("autoWidth",void 0,ft),x.changeAttr("autoHeight",void 0,ft),r.prototype.__updateFlowLayout=function(){this.leafer.created=!1;const{flow:t}=this.__;switch(t){case"x":case!0:pt(this);break;case"y":dt(this);break;case"x-reverse":pt(this,!0);break;case"y-reverse":dt(this,!0)}this.leafer.created=!0},r.prototype.__updateContentBounds=function(){const{padding:t}=this.__,e=this.__layout,o=e.contentBounds===e.boxBounds;t?(o&&e.shrinkContent(),gt(e.contentBounds,e.boxBounds,t,!0)):o||e.shrinkContentCancel()};export{N as Flow,P as PathScaler,j as scaleResize,E as scaleResizeFontSize,I as scaleResizeGroup,H as scaleResizePath,M as scaleResizePoints};