@leafer-game/miniapp 1.3.1 → 1.3.3

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.
@@ -1533,10 +1533,10 @@ const DataHelper = {
1533
1533
  Object.keys(merge).forEach(key => {
1534
1534
  var _a, _b;
1535
1535
  value = merge[key];
1536
- if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1536
+ if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
1537
1537
  return assign$1(t[key], merge[key], exclude && exclude[key]);
1538
1538
  if (exclude && (key in exclude)) {
1539
- if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1539
+ if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
1540
1540
  assign$1(t[key] = {}, merge[key], exclude[key]);
1541
1541
  return;
1542
1542
  }
@@ -1705,7 +1705,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1705
1705
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1706
1706
  PERFORMANCE OF THIS SOFTWARE.
1707
1707
  ***************************************************************************** */
1708
- /* global Reflect, Promise, SuppressedError, Symbol */
1708
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1709
1709
 
1710
1710
 
1711
1711
  function __decorate(decorators, target, key, desc) {
@@ -1773,7 +1773,7 @@ let Canvas$1 = class Canvas {
1773
1773
  }
1774
1774
  setTransform(_a, _b, _c, _d, _e, _f) { }
1775
1775
  resetTransform() { }
1776
- getTransform() { return void 0; }
1776
+ getTransform() { return undefined; }
1777
1777
  save() { }
1778
1778
  restore() { }
1779
1779
  transform(a, b, c, d, e, f) {
@@ -1830,12 +1830,12 @@ let Canvas$1 = class Canvas {
1830
1830
  ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
1831
1831
  rect(_x, _y, _width, _height) { }
1832
1832
  roundRect(_x, _y, _width, _height, _radius) { }
1833
- createConicGradient(_startAngle, _x, _y) { return void 0; }
1834
- createLinearGradient(_x0, _y0, _x1, _y1) { return void 0; }
1835
- createPattern(_image, _repetition) { return void 0; }
1836
- createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return void 0; }
1833
+ createConicGradient(_startAngle, _x, _y) { return undefined; }
1834
+ createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
1835
+ createPattern(_image, _repetition) { return undefined; }
1836
+ createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
1837
1837
  fillText(_text, _x, _y, _maxWidth) { }
1838
- measureText(_text) { return void 0; }
1838
+ measureText(_text) { return undefined; }
1839
1839
  strokeText(_text, _x, _y, _maxWidth) { }
1840
1840
  destroy() {
1841
1841
  this.context = null;
@@ -1843,79 +1843,79 @@ let Canvas$1 = class Canvas {
1843
1843
  };
1844
1844
  __decorate([
1845
1845
  contextAttr('imageSmoothingEnabled')
1846
- ], Canvas$1.prototype, "smooth", void 0);
1846
+ ], Canvas$1.prototype, "smooth", undefined);
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingQuality')
1849
- ], Canvas$1.prototype, "smoothLevel", void 0);
1849
+ ], Canvas$1.prototype, "smoothLevel", undefined);
1850
1850
  __decorate([
1851
1851
  contextAttr('globalAlpha')
1852
- ], Canvas$1.prototype, "opacity", void 0);
1852
+ ], Canvas$1.prototype, "opacity", undefined);
1853
1853
  __decorate([
1854
1854
  contextAttr()
1855
- ], Canvas$1.prototype, "fillStyle", void 0);
1855
+ ], Canvas$1.prototype, "fillStyle", undefined);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas$1.prototype, "strokeStyle", void 0);
1858
+ ], Canvas$1.prototype, "strokeStyle", undefined);
1859
1859
  __decorate([
1860
1860
  contextAttr('lineWidth')
1861
- ], Canvas$1.prototype, "strokeWidth", void 0);
1861
+ ], Canvas$1.prototype, "strokeWidth", undefined);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineCap')
1864
- ], Canvas$1.prototype, "strokeCap", void 0);
1864
+ ], Canvas$1.prototype, "strokeCap", undefined);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineJoin')
1867
- ], Canvas$1.prototype, "strokeJoin", void 0);
1867
+ ], Canvas$1.prototype, "strokeJoin", undefined);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineDashOffset')
1870
- ], Canvas$1.prototype, "dashOffset", void 0);
1870
+ ], Canvas$1.prototype, "dashOffset", undefined);
1871
1871
  __decorate([
1872
1872
  contextAttr()
1873
- ], Canvas$1.prototype, "miterLimit", void 0);
1873
+ ], Canvas$1.prototype, "miterLimit", undefined);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas$1.prototype, "shadowBlur", void 0);
1876
+ ], Canvas$1.prototype, "shadowBlur", undefined);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas$1.prototype, "shadowColor", void 0);
1879
+ ], Canvas$1.prototype, "shadowColor", undefined);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas$1.prototype, "shadowOffsetX", void 0);
1882
+ ], Canvas$1.prototype, "shadowOffsetX", undefined);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas$1.prototype, "shadowOffsetY", void 0);
1885
+ ], Canvas$1.prototype, "shadowOffsetY", undefined);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas$1.prototype, "filter", void 0);
1888
+ ], Canvas$1.prototype, "filter", undefined);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas$1.prototype, "font", void 0);
1891
+ ], Canvas$1.prototype, "font", undefined);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas$1.prototype, "fontKerning", void 0);
1894
+ ], Canvas$1.prototype, "fontKerning", undefined);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas$1.prototype, "fontStretch", void 0);
1897
+ ], Canvas$1.prototype, "fontStretch", undefined);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas$1.prototype, "fontVariantCaps", void 0);
1900
+ ], Canvas$1.prototype, "fontVariantCaps", undefined);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas$1.prototype, "textAlign", void 0);
1903
+ ], Canvas$1.prototype, "textAlign", undefined);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas$1.prototype, "textBaseline", void 0);
1906
+ ], Canvas$1.prototype, "textBaseline", undefined);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas$1.prototype, "textRendering", void 0);
1909
+ ], Canvas$1.prototype, "textRendering", undefined);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas$1.prototype, "wordSpacing", void 0);
1912
+ ], Canvas$1.prototype, "wordSpacing", undefined);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas$1.prototype, "letterSpacing", void 0);
1915
+ ], Canvas$1.prototype, "letterSpacing", undefined);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas$1.prototype, "direction", void 0);
1918
+ ], Canvas$1.prototype, "direction", undefined);
1919
1919
  __decorate([
1920
1920
  contextMethod()
1921
1921
  ], Canvas$1.prototype, "setTransform", null);
@@ -3384,7 +3384,7 @@ class TaskItem {
3384
3384
  this.task = task;
3385
3385
  }
3386
3386
  run() {
3387
- return __awaiter(this, void 0, void 0, function* () {
3387
+ return __awaiter(this, undefined, undefined, function* () {
3388
3388
  try {
3389
3389
  if (this.task && !this.isComplete && this.parent.running)
3390
3390
  yield this.task();
@@ -3696,7 +3696,7 @@ class LeaferImage {
3696
3696
  load(onSuccess, onError) {
3697
3697
  if (!this.loading) {
3698
3698
  this.loading = true;
3699
- ImageManager.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3699
+ ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3700
3700
  return yield Platform.origin.loadImage(this.url).then((img) => {
3701
3701
  this.ready = true;
3702
3702
  this.width = img.naturalWidth || img.width;
@@ -5175,8 +5175,7 @@ const LeafBounds = {
5175
5175
  __updateAutoLayout() {
5176
5176
  this.__layout.matrixChanged = true;
5177
5177
  if (this.isBranch) {
5178
- if (this.leaferIsReady)
5179
- this.leafer.layouter.addExtra(this);
5178
+ this.__extraUpdate();
5180
5179
  if (this.__.flow) {
5181
5180
  if (this.__layout.boxChanged)
5182
5181
  this.__updateFlowLayout();
@@ -5329,7 +5328,7 @@ let Leaf = class Leaf {
5329
5328
  get __worldFlipped() { return this.__world.scaleX < 0 || this.__world.scaleY < 0; }
5330
5329
  get __onlyHitMask() { return this.__hasMask && !this.__.hitChildren; }
5331
5330
  get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
5332
- get __inLazyBounds() { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world); }
5331
+ get __inLazyBounds() { return this.leaferIsCreated && this.leafer.lazyBounds.hit(this.__world); }
5333
5332
  get pathInputed() { return this.__.__pathInputed; }
5334
5333
  set event(map) { this.on(map); }
5335
5334
  constructor(data) {
@@ -5440,6 +5439,10 @@ let Leaf = class Leaf {
5440
5439
  forceRender(_bounds, _sync) {
5441
5440
  this.forceUpdate('surface');
5442
5441
  }
5442
+ __extraUpdate() {
5443
+ if (this.leaferIsReady)
5444
+ this.leafer.layouter.addExtra(this);
5445
+ }
5443
5446
  __updateWorldMatrix() { }
5444
5447
  __updateLocalMatrix() { }
5445
5448
  __updateWorldBounds() { }
@@ -6007,7 +6010,7 @@ class LeafLevelList {
6007
6010
  }
6008
6011
  }
6009
6012
 
6010
- const version = "1.3.1";
6013
+ const version = "1.3.3";
6011
6014
 
6012
6015
  class LeaferCanvas extends LeaferCanvasBase {
6013
6016
  get allowBackgroundColor() { return false; }
@@ -6491,7 +6494,7 @@ class Layouter {
6491
6494
  }
6492
6495
  partLayout() {
6493
6496
  var _a;
6494
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6497
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6495
6498
  return;
6496
6499
  const t = Run.start('PartLayout');
6497
6500
  const { target, __updatedList: updateList } = this;
@@ -6678,7 +6681,7 @@ class Renderer {
6678
6681
  partRender() {
6679
6682
  const { canvas, updateBlocks: list } = this;
6680
6683
  if (!list)
6681
- return debug$3.warn('PartRender: need update attr');
6684
+ return;
6682
6685
  this.mergeBlocks();
6683
6686
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6684
6687
  this.clipRender(block); });
@@ -7062,6 +7065,7 @@ class UIData extends LeafData {
7062
7065
  return t.fill && this.__hasStroke;
7063
7066
  }
7064
7067
  get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
7068
+ get __hasSurface() { const t = this; return (t.fill || t.stroke); }
7065
7069
  get __autoWidth() { return !this._width; }
7066
7070
  get __autoHeight() { return !this._height; }
7067
7071
  get __autoSide() { return !this._width || !this._height; }
@@ -7534,7 +7538,7 @@ let UI = UI_1 = class UI extends Leaf {
7534
7538
  animate(_keyframe, _options, _type, _isTemp) {
7535
7539
  return Plugin.need('animate');
7536
7540
  }
7537
- killAnimate(_type, _killStyle) { }
7541
+ killAnimate(_type, _nextStyle) { }
7538
7542
  export(_filename, _options) {
7539
7543
  return Plugin.need('export');
7540
7544
  }
@@ -7565,199 +7569,199 @@ let UI = UI_1 = class UI extends Leaf {
7565
7569
  };
7566
7570
  __decorate([
7567
7571
  dataProcessor(UIData)
7568
- ], UI.prototype, "__", void 0);
7572
+ ], UI.prototype, "__", undefined);
7569
7573
  __decorate([
7570
7574
  zoomLayerType()
7571
- ], UI.prototype, "zoomLayer", void 0);
7575
+ ], UI.prototype, "zoomLayer", undefined);
7572
7576
  __decorate([
7573
7577
  dataType('')
7574
- ], UI.prototype, "id", void 0);
7578
+ ], UI.prototype, "id", undefined);
7575
7579
  __decorate([
7576
7580
  dataType('')
7577
- ], UI.prototype, "name", void 0);
7581
+ ], UI.prototype, "name", undefined);
7578
7582
  __decorate([
7579
7583
  dataType('')
7580
- ], UI.prototype, "className", void 0);
7584
+ ], UI.prototype, "className", undefined);
7581
7585
  __decorate([
7582
7586
  surfaceType('pass-through')
7583
- ], UI.prototype, "blendMode", void 0);
7587
+ ], UI.prototype, "blendMode", undefined);
7584
7588
  __decorate([
7585
7589
  opacityType(1)
7586
- ], UI.prototype, "opacity", void 0);
7590
+ ], UI.prototype, "opacity", undefined);
7587
7591
  __decorate([
7588
7592
  visibleType(true)
7589
- ], UI.prototype, "visible", void 0);
7593
+ ], UI.prototype, "visible", undefined);
7590
7594
  __decorate([
7591
7595
  surfaceType(false)
7592
- ], UI.prototype, "locked", void 0);
7596
+ ], UI.prototype, "locked", undefined);
7593
7597
  __decorate([
7594
7598
  sortType(0)
7595
- ], UI.prototype, "zIndex", void 0);
7599
+ ], UI.prototype, "zIndex", undefined);
7596
7600
  __decorate([
7597
7601
  maskType(false)
7598
- ], UI.prototype, "mask", void 0);
7602
+ ], UI.prototype, "mask", undefined);
7599
7603
  __decorate([
7600
7604
  eraserType(false)
7601
- ], UI.prototype, "eraser", void 0);
7605
+ ], UI.prototype, "eraser", undefined);
7602
7606
  __decorate([
7603
7607
  positionType(0, true)
7604
- ], UI.prototype, "x", void 0);
7608
+ ], UI.prototype, "x", undefined);
7605
7609
  __decorate([
7606
7610
  positionType(0, true)
7607
- ], UI.prototype, "y", void 0);
7611
+ ], UI.prototype, "y", undefined);
7608
7612
  __decorate([
7609
7613
  boundsType(100, true)
7610
- ], UI.prototype, "width", void 0);
7614
+ ], UI.prototype, "width", undefined);
7611
7615
  __decorate([
7612
7616
  boundsType(100, true)
7613
- ], UI.prototype, "height", void 0);
7617
+ ], UI.prototype, "height", undefined);
7614
7618
  __decorate([
7615
7619
  scaleType(1, true)
7616
- ], UI.prototype, "scaleX", void 0);
7620
+ ], UI.prototype, "scaleX", undefined);
7617
7621
  __decorate([
7618
7622
  scaleType(1, true)
7619
- ], UI.prototype, "scaleY", void 0);
7623
+ ], UI.prototype, "scaleY", undefined);
7620
7624
  __decorate([
7621
7625
  rotationType(0, true)
7622
- ], UI.prototype, "rotation", void 0);
7626
+ ], UI.prototype, "rotation", undefined);
7623
7627
  __decorate([
7624
7628
  rotationType(0, true)
7625
- ], UI.prototype, "skewX", void 0);
7629
+ ], UI.prototype, "skewX", undefined);
7626
7630
  __decorate([
7627
7631
  rotationType(0, true)
7628
- ], UI.prototype, "skewY", void 0);
7632
+ ], UI.prototype, "skewY", undefined);
7629
7633
  __decorate([
7630
7634
  positionType(0, true)
7631
- ], UI.prototype, "offsetX", void 0);
7635
+ ], UI.prototype, "offsetX", undefined);
7632
7636
  __decorate([
7633
7637
  positionType(0, true)
7634
- ], UI.prototype, "offsetY", void 0);
7638
+ ], UI.prototype, "offsetY", undefined);
7635
7639
  __decorate([
7636
7640
  positionType(0, true)
7637
- ], UI.prototype, "scrollX", void 0);
7641
+ ], UI.prototype, "scrollX", undefined);
7638
7642
  __decorate([
7639
7643
  positionType(0, true)
7640
- ], UI.prototype, "scrollY", void 0);
7644
+ ], UI.prototype, "scrollY", undefined);
7641
7645
  __decorate([
7642
7646
  autoLayoutType()
7643
- ], UI.prototype, "origin", void 0);
7647
+ ], UI.prototype, "origin", undefined);
7644
7648
  __decorate([
7645
7649
  autoLayoutType()
7646
- ], UI.prototype, "around", void 0);
7650
+ ], UI.prototype, "around", undefined);
7647
7651
  __decorate([
7648
7652
  dataType(false)
7649
- ], UI.prototype, "lazy", void 0);
7653
+ ], UI.prototype, "lazy", undefined);
7650
7654
  __decorate([
7651
7655
  naturalBoundsType(1)
7652
- ], UI.prototype, "pixelRatio", void 0);
7656
+ ], UI.prototype, "pixelRatio", undefined);
7653
7657
  __decorate([
7654
7658
  pathInputType()
7655
- ], UI.prototype, "path", void 0);
7659
+ ], UI.prototype, "path", undefined);
7656
7660
  __decorate([
7657
7661
  pathType()
7658
- ], UI.prototype, "windingRule", void 0);
7662
+ ], UI.prototype, "windingRule", undefined);
7659
7663
  __decorate([
7660
7664
  pathType(true)
7661
- ], UI.prototype, "closed", void 0);
7665
+ ], UI.prototype, "closed", undefined);
7662
7666
  __decorate([
7663
7667
  boundsType(0)
7664
- ], UI.prototype, "padding", void 0);
7668
+ ], UI.prototype, "padding", undefined);
7665
7669
  __decorate([
7666
7670
  boundsType(false)
7667
- ], UI.prototype, "lockRatio", void 0);
7671
+ ], UI.prototype, "lockRatio", undefined);
7668
7672
  __decorate([
7669
7673
  boundsType()
7670
- ], UI.prototype, "widthRange", void 0);
7674
+ ], UI.prototype, "widthRange", undefined);
7671
7675
  __decorate([
7672
7676
  boundsType()
7673
- ], UI.prototype, "heightRange", void 0);
7677
+ ], UI.prototype, "heightRange", undefined);
7674
7678
  __decorate([
7675
7679
  dataType(false)
7676
- ], UI.prototype, "draggable", void 0);
7680
+ ], UI.prototype, "draggable", undefined);
7677
7681
  __decorate([
7678
7682
  dataType()
7679
- ], UI.prototype, "dragBounds", void 0);
7683
+ ], UI.prototype, "dragBounds", undefined);
7680
7684
  __decorate([
7681
7685
  dataType(false)
7682
- ], UI.prototype, "editable", void 0);
7686
+ ], UI.prototype, "editable", undefined);
7683
7687
  __decorate([
7684
7688
  hitType(true)
7685
- ], UI.prototype, "hittable", void 0);
7689
+ ], UI.prototype, "hittable", undefined);
7686
7690
  __decorate([
7687
7691
  hitType('path')
7688
- ], UI.prototype, "hitFill", void 0);
7692
+ ], UI.prototype, "hitFill", undefined);
7689
7693
  __decorate([
7690
7694
  strokeType('path')
7691
- ], UI.prototype, "hitStroke", void 0);
7695
+ ], UI.prototype, "hitStroke", undefined);
7692
7696
  __decorate([
7693
7697
  hitType(false)
7694
- ], UI.prototype, "hitBox", void 0);
7698
+ ], UI.prototype, "hitBox", undefined);
7695
7699
  __decorate([
7696
7700
  hitType(true)
7697
- ], UI.prototype, "hitChildren", void 0);
7701
+ ], UI.prototype, "hitChildren", undefined);
7698
7702
  __decorate([
7699
7703
  hitType(true)
7700
- ], UI.prototype, "hitSelf", void 0);
7704
+ ], UI.prototype, "hitSelf", undefined);
7701
7705
  __decorate([
7702
7706
  hitType()
7703
- ], UI.prototype, "hitRadius", void 0);
7707
+ ], UI.prototype, "hitRadius", undefined);
7704
7708
  __decorate([
7705
7709
  cursorType('')
7706
- ], UI.prototype, "cursor", void 0);
7710
+ ], UI.prototype, "cursor", undefined);
7707
7711
  __decorate([
7708
7712
  surfaceType()
7709
- ], UI.prototype, "fill", void 0);
7713
+ ], UI.prototype, "fill", undefined);
7710
7714
  __decorate([
7711
7715
  strokeType()
7712
- ], UI.prototype, "stroke", void 0);
7716
+ ], UI.prototype, "stroke", undefined);
7713
7717
  __decorate([
7714
7718
  strokeType('inside')
7715
- ], UI.prototype, "strokeAlign", void 0);
7719
+ ], UI.prototype, "strokeAlign", undefined);
7716
7720
  __decorate([
7717
7721
  strokeType(1)
7718
- ], UI.prototype, "strokeWidth", void 0);
7722
+ ], UI.prototype, "strokeWidth", undefined);
7719
7723
  __decorate([
7720
7724
  strokeType(false)
7721
- ], UI.prototype, "strokeWidthFixed", void 0);
7725
+ ], UI.prototype, "strokeWidthFixed", undefined);
7722
7726
  __decorate([
7723
7727
  strokeType('none')
7724
- ], UI.prototype, "strokeCap", void 0);
7728
+ ], UI.prototype, "strokeCap", undefined);
7725
7729
  __decorate([
7726
7730
  strokeType('miter')
7727
- ], UI.prototype, "strokeJoin", void 0);
7731
+ ], UI.prototype, "strokeJoin", undefined);
7728
7732
  __decorate([
7729
7733
  strokeType()
7730
- ], UI.prototype, "dashPattern", void 0);
7734
+ ], UI.prototype, "dashPattern", undefined);
7731
7735
  __decorate([
7732
7736
  strokeType()
7733
- ], UI.prototype, "dashOffset", void 0);
7737
+ ], UI.prototype, "dashOffset", undefined);
7734
7738
  __decorate([
7735
7739
  strokeType(10)
7736
- ], UI.prototype, "miterLimit", void 0);
7740
+ ], UI.prototype, "miterLimit", undefined);
7737
7741
  __decorate([
7738
7742
  pathType(0)
7739
- ], UI.prototype, "cornerRadius", void 0);
7743
+ ], UI.prototype, "cornerRadius", undefined);
7740
7744
  __decorate([
7741
7745
  pathType()
7742
- ], UI.prototype, "cornerSmoothing", void 0);
7746
+ ], UI.prototype, "cornerSmoothing", undefined);
7743
7747
  __decorate([
7744
7748
  effectType()
7745
- ], UI.prototype, "shadow", void 0);
7749
+ ], UI.prototype, "shadow", undefined);
7746
7750
  __decorate([
7747
7751
  effectType()
7748
- ], UI.prototype, "innerShadow", void 0);
7752
+ ], UI.prototype, "innerShadow", undefined);
7749
7753
  __decorate([
7750
7754
  effectType()
7751
- ], UI.prototype, "blur", void 0);
7755
+ ], UI.prototype, "blur", undefined);
7752
7756
  __decorate([
7753
7757
  effectType()
7754
- ], UI.prototype, "backgroundBlur", void 0);
7758
+ ], UI.prototype, "backgroundBlur", undefined);
7755
7759
  __decorate([
7756
7760
  effectType()
7757
- ], UI.prototype, "grayscale", void 0);
7761
+ ], UI.prototype, "grayscale", undefined);
7758
7762
  __decorate([
7759
7763
  dataType({})
7760
- ], UI.prototype, "data", void 0);
7764
+ ], UI.prototype, "data", undefined);
7761
7765
  __decorate([
7762
7766
  rewrite(Leaf.prototype.reset)
7763
7767
  ], UI.prototype, "reset", null);
@@ -7818,7 +7822,7 @@ let Group = class Group extends UI {
7818
7822
  };
7819
7823
  __decorate([
7820
7824
  dataProcessor(GroupData)
7821
- ], Group.prototype, "__", void 0);
7825
+ ], Group.prototype, "__", undefined);
7822
7826
  Group = __decorate([
7823
7827
  useModule(Branch),
7824
7828
  registerUI()
@@ -7989,8 +7993,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7989
7993
  __setAttr(attrName, newValue) {
7990
7994
  if (this.canvas) {
7991
7995
  if (canvasSizeAttrs.includes(attrName)) {
7992
- if (!newValue)
7993
- debug$1.warn(attrName + ' is 0');
7994
7996
  this.__changeCanvasSize(attrName, newValue);
7995
7997
  }
7996
7998
  else if (attrName === 'fill') {
@@ -8030,8 +8032,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8030
8032
  this.created = true;
8031
8033
  }
8032
8034
  __onReady() {
8033
- if (this.ready)
8034
- return;
8035
8035
  this.ready = true;
8036
8036
  this.emitLeafer(LeaferEvent.BEFORE_READY);
8037
8037
  this.emitLeafer(LeaferEvent.READY);
@@ -8045,6 +8045,20 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8045
8045
  this.emitLeafer(LeaferEvent.VIEW_READY);
8046
8046
  WaitHelper.run(this.__viewReadyWait);
8047
8047
  }
8048
+ __onLayoutEnd() {
8049
+ const { grow, growWidth, growHeight } = this.config;
8050
+ if (grow) {
8051
+ let { width, height, pixelRatio } = this;
8052
+ const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
8053
+ if (growWidth !== false)
8054
+ width = Math.max(1, bounds.x + bounds.width);
8055
+ if (growHeight !== false)
8056
+ height = Math.max(1, bounds.y + bounds.height);
8057
+ this.__doResize({ width, height, pixelRatio });
8058
+ }
8059
+ if (!this.ready)
8060
+ this.__onReady();
8061
+ }
8048
8062
  __onNextRender() {
8049
8063
  if (this.viewReady) {
8050
8064
  WaitHelper.run(this.__nextRenderWait);
@@ -8138,10 +8152,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8138
8152
  const runId = Run.start('FirstCreate ' + this.innerName);
8139
8153
  this.once(LeaferEvent.START, () => Run.end(runId));
8140
8154
  this.once(LayoutEvent.START, () => this.updateLazyBounds());
8141
- this.once(LayoutEvent.END, () => this.__onReady());
8142
8155
  this.once(RenderEvent.START, () => this.__onCreated());
8143
8156
  this.once(RenderEvent.END, () => this.__onViewReady());
8144
- this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8157
+ this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8145
8158
  }
8146
8159
  __removeListenEvents() {
8147
8160
  this.off_(this.__eventIds);
@@ -8182,10 +8195,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8182
8195
  Leafer.list = new LeafList();
8183
8196
  __decorate([
8184
8197
  dataProcessor(LeaferData)
8185
- ], Leafer.prototype, "__", void 0);
8198
+ ], Leafer.prototype, "__", undefined);
8186
8199
  __decorate([
8187
8200
  boundsType()
8188
- ], Leafer.prototype, "pixelRatio", void 0);
8201
+ ], Leafer.prototype, "pixelRatio", undefined);
8189
8202
  Leafer = Leafer_1 = __decorate([
8190
8203
  registerUI()
8191
8204
  ], Leafer);
@@ -8198,7 +8211,7 @@ let Rect = class Rect extends UI {
8198
8211
  };
8199
8212
  __decorate([
8200
8213
  dataProcessor(RectData)
8201
- ], Rect.prototype, "__", void 0);
8214
+ ], Rect.prototype, "__", undefined);
8202
8215
  Rect = __decorate([
8203
8216
  useModule(RectRender),
8204
8217
  rewriteAble(),
@@ -8223,6 +8236,8 @@ let Box = class Box extends Group {
8223
8236
  const data = this.__;
8224
8237
  if (this.children.length) {
8225
8238
  if (data.__autoSide) {
8239
+ if (data.__hasSurface)
8240
+ this.__extraUpdate();
8226
8241
  super.__updateBoxBounds();
8227
8242
  const { boxBounds } = this.__layout;
8228
8243
  if (!data.__autoSize) {
@@ -8287,13 +8302,13 @@ let Box = class Box extends Group {
8287
8302
  };
8288
8303
  __decorate([
8289
8304
  dataProcessor(BoxData)
8290
- ], Box.prototype, "__", void 0);
8305
+ ], Box.prototype, "__", undefined);
8291
8306
  __decorate([
8292
8307
  dataType(false)
8293
- ], Box.prototype, "resizeChildren", void 0);
8308
+ ], Box.prototype, "resizeChildren", undefined);
8294
8309
  __decorate([
8295
8310
  affectRenderBoundsType('show')
8296
- ], Box.prototype, "overflow", void 0);
8311
+ ], Box.prototype, "overflow", undefined);
8297
8312
  __decorate([
8298
8313
  rewrite(rect$1.__updateStrokeSpread)
8299
8314
  ], Box.prototype, "__updateStrokeSpread", null);
@@ -8332,13 +8347,13 @@ let Frame = class Frame extends Box {
8332
8347
  };
8333
8348
  __decorate([
8334
8349
  dataProcessor(FrameData)
8335
- ], Frame.prototype, "__", void 0);
8350
+ ], Frame.prototype, "__", undefined);
8336
8351
  __decorate([
8337
8352
  surfaceType('#FFFFFF')
8338
- ], Frame.prototype, "fill", void 0);
8353
+ ], Frame.prototype, "fill", undefined);
8339
8354
  __decorate([
8340
8355
  affectRenderBoundsType('hide')
8341
- ], Frame.prototype, "overflow", void 0);
8356
+ ], Frame.prototype, "overflow", undefined);
8342
8357
  Frame = __decorate([
8343
8358
  registerUI()
8344
8359
  ], Frame);
@@ -8385,16 +8400,16 @@ let Ellipse = class Ellipse extends UI {
8385
8400
  };
8386
8401
  __decorate([
8387
8402
  dataProcessor(EllipseData)
8388
- ], Ellipse.prototype, "__", void 0);
8403
+ ], Ellipse.prototype, "__", undefined);
8389
8404
  __decorate([
8390
8405
  pathType(0)
8391
- ], Ellipse.prototype, "innerRadius", void 0);
8406
+ ], Ellipse.prototype, "innerRadius", undefined);
8392
8407
  __decorate([
8393
8408
  pathType(0)
8394
- ], Ellipse.prototype, "startAngle", void 0);
8409
+ ], Ellipse.prototype, "startAngle", undefined);
8395
8410
  __decorate([
8396
8411
  pathType(0)
8397
- ], Ellipse.prototype, "endAngle", void 0);
8412
+ ], Ellipse.prototype, "endAngle", undefined);
8398
8413
  Ellipse = __decorate([
8399
8414
  registerUI()
8400
8415
  ], Ellipse);
@@ -8453,22 +8468,22 @@ let Line = class Line extends UI {
8453
8468
  };
8454
8469
  __decorate([
8455
8470
  dataProcessor(LineData)
8456
- ], Line.prototype, "__", void 0);
8471
+ ], Line.prototype, "__", undefined);
8457
8472
  __decorate([
8458
8473
  affectStrokeBoundsType('center')
8459
- ], Line.prototype, "strokeAlign", void 0);
8474
+ ], Line.prototype, "strokeAlign", undefined);
8460
8475
  __decorate([
8461
8476
  boundsType(0)
8462
- ], Line.prototype, "height", void 0);
8477
+ ], Line.prototype, "height", undefined);
8463
8478
  __decorate([
8464
8479
  pathType()
8465
- ], Line.prototype, "points", void 0);
8480
+ ], Line.prototype, "points", undefined);
8466
8481
  __decorate([
8467
8482
  pathType(0)
8468
- ], Line.prototype, "curve", void 0);
8483
+ ], Line.prototype, "curve", undefined);
8469
8484
  __decorate([
8470
8485
  pathType(false)
8471
- ], Line.prototype, "closed", void 0);
8486
+ ], Line.prototype, "closed", undefined);
8472
8487
  Line = __decorate([
8473
8488
  registerUI()
8474
8489
  ], Line);
@@ -8501,16 +8516,16 @@ let Polygon = class Polygon extends UI {
8501
8516
  };
8502
8517
  __decorate([
8503
8518
  dataProcessor(PolygonData)
8504
- ], Polygon.prototype, "__", void 0);
8519
+ ], Polygon.prototype, "__", undefined);
8505
8520
  __decorate([
8506
8521
  pathType(3)
8507
- ], Polygon.prototype, "sides", void 0);
8522
+ ], Polygon.prototype, "sides", undefined);
8508
8523
  __decorate([
8509
8524
  pathType()
8510
- ], Polygon.prototype, "points", void 0);
8525
+ ], Polygon.prototype, "points", undefined);
8511
8526
  __decorate([
8512
8527
  pathType(0)
8513
- ], Polygon.prototype, "curve", void 0);
8528
+ ], Polygon.prototype, "curve", undefined);
8514
8529
  __decorate([
8515
8530
  rewrite(line.__updateRenderPath)
8516
8531
  ], Polygon.prototype, "__updateRenderPath", null);
@@ -8542,13 +8557,13 @@ let Star = class Star extends UI {
8542
8557
  };
8543
8558
  __decorate([
8544
8559
  dataProcessor(StarData)
8545
- ], Star.prototype, "__", void 0);
8560
+ ], Star.prototype, "__", undefined);
8546
8561
  __decorate([
8547
8562
  pathType(5)
8548
- ], Star.prototype, "corners", void 0);
8563
+ ], Star.prototype, "corners", undefined);
8549
8564
  __decorate([
8550
8565
  pathType(0.382)
8551
- ], Star.prototype, "innerRadius", void 0);
8566
+ ], Star.prototype, "innerRadius", undefined);
8552
8567
  Star = __decorate([
8553
8568
  registerUI()
8554
8569
  ], Star);
@@ -8570,10 +8585,10 @@ let Image = class Image extends Rect {
8570
8585
  };
8571
8586
  __decorate([
8572
8587
  dataProcessor(ImageData)
8573
- ], Image.prototype, "__", void 0);
8588
+ ], Image.prototype, "__", undefined);
8574
8589
  __decorate([
8575
8590
  boundsType('')
8576
- ], Image.prototype, "url", void 0);
8591
+ ], Image.prototype, "url", undefined);
8577
8592
  Image = __decorate([
8578
8593
  registerUI()
8579
8594
  ], Image);
@@ -8636,25 +8651,25 @@ let Canvas = class Canvas extends Rect {
8636
8651
  };
8637
8652
  __decorate([
8638
8653
  dataProcessor(CanvasData)
8639
- ], Canvas.prototype, "__", void 0);
8654
+ ], Canvas.prototype, "__", undefined);
8640
8655
  __decorate([
8641
8656
  resizeType(100)
8642
- ], Canvas.prototype, "width", void 0);
8657
+ ], Canvas.prototype, "width", undefined);
8643
8658
  __decorate([
8644
8659
  resizeType(100)
8645
- ], Canvas.prototype, "height", void 0);
8660
+ ], Canvas.prototype, "height", undefined);
8646
8661
  __decorate([
8647
8662
  resizeType(1)
8648
- ], Canvas.prototype, "pixelRatio", void 0);
8663
+ ], Canvas.prototype, "pixelRatio", undefined);
8649
8664
  __decorate([
8650
8665
  resizeType(true)
8651
- ], Canvas.prototype, "smooth", void 0);
8666
+ ], Canvas.prototype, "smooth", undefined);
8652
8667
  __decorate([
8653
8668
  dataType(false)
8654
- ], Canvas.prototype, "safeResize", void 0);
8669
+ ], Canvas.prototype, "safeResize", undefined);
8655
8670
  __decorate([
8656
8671
  resizeType()
8657
- ], Canvas.prototype, "contextSettings", void 0);
8672
+ ], Canvas.prototype, "contextSettings", undefined);
8658
8673
  Canvas = __decorate([
8659
8674
  registerUI()
8660
8675
  ], Canvas);
@@ -8745,76 +8760,76 @@ let Text = class Text extends UI {
8745
8760
  };
8746
8761
  __decorate([
8747
8762
  dataProcessor(TextData)
8748
- ], Text.prototype, "__", void 0);
8763
+ ], Text.prototype, "__", undefined);
8749
8764
  __decorate([
8750
8765
  boundsType(0)
8751
- ], Text.prototype, "width", void 0);
8766
+ ], Text.prototype, "width", undefined);
8752
8767
  __decorate([
8753
8768
  boundsType(0)
8754
- ], Text.prototype, "height", void 0);
8769
+ ], Text.prototype, "height", undefined);
8755
8770
  __decorate([
8756
8771
  dataType(false)
8757
- ], Text.prototype, "resizeFontSize", void 0);
8772
+ ], Text.prototype, "resizeFontSize", undefined);
8758
8773
  __decorate([
8759
8774
  surfaceType('#000000')
8760
- ], Text.prototype, "fill", void 0);
8775
+ ], Text.prototype, "fill", undefined);
8761
8776
  __decorate([
8762
8777
  affectStrokeBoundsType('outside')
8763
- ], Text.prototype, "strokeAlign", void 0);
8778
+ ], Text.prototype, "strokeAlign", undefined);
8764
8779
  __decorate([
8765
8780
  hitType('all')
8766
- ], Text.prototype, "hitFill", void 0);
8781
+ ], Text.prototype, "hitFill", undefined);
8767
8782
  __decorate([
8768
8783
  boundsType('')
8769
- ], Text.prototype, "text", void 0);
8784
+ ], Text.prototype, "text", undefined);
8770
8785
  __decorate([
8771
- boundsType('L')
8772
- ], Text.prototype, "fontFamily", void 0);
8786
+ boundsType('caption')
8787
+ ], Text.prototype, "fontFamily", undefined);
8773
8788
  __decorate([
8774
8789
  boundsType(12)
8775
- ], Text.prototype, "fontSize", void 0);
8790
+ ], Text.prototype, "fontSize", undefined);
8776
8791
  __decorate([
8777
8792
  boundsType('normal')
8778
- ], Text.prototype, "fontWeight", void 0);
8793
+ ], Text.prototype, "fontWeight", undefined);
8779
8794
  __decorate([
8780
8795
  boundsType(false)
8781
- ], Text.prototype, "italic", void 0);
8796
+ ], Text.prototype, "italic", undefined);
8782
8797
  __decorate([
8783
8798
  boundsType('none')
8784
- ], Text.prototype, "textCase", void 0);
8799
+ ], Text.prototype, "textCase", undefined);
8785
8800
  __decorate([
8786
8801
  boundsType('none')
8787
- ], Text.prototype, "textDecoration", void 0);
8802
+ ], Text.prototype, "textDecoration", undefined);
8788
8803
  __decorate([
8789
8804
  boundsType(0)
8790
- ], Text.prototype, "letterSpacing", void 0);
8805
+ ], Text.prototype, "letterSpacing", undefined);
8791
8806
  __decorate([
8792
8807
  boundsType({ type: 'percent', value: 1.5 })
8793
- ], Text.prototype, "lineHeight", void 0);
8808
+ ], Text.prototype, "lineHeight", undefined);
8794
8809
  __decorate([
8795
8810
  boundsType(0)
8796
- ], Text.prototype, "paraIndent", void 0);
8811
+ ], Text.prototype, "paraIndent", undefined);
8797
8812
  __decorate([
8798
8813
  boundsType(0)
8799
- ], Text.prototype, "paraSpacing", void 0);
8814
+ ], Text.prototype, "paraSpacing", undefined);
8800
8815
  __decorate([
8801
8816
  boundsType('x')
8802
- ], Text.prototype, "writingMode", void 0);
8817
+ ], Text.prototype, "writingMode", undefined);
8803
8818
  __decorate([
8804
8819
  boundsType('left')
8805
- ], Text.prototype, "textAlign", void 0);
8820
+ ], Text.prototype, "textAlign", undefined);
8806
8821
  __decorate([
8807
8822
  boundsType('top')
8808
- ], Text.prototype, "verticalAlign", void 0);
8823
+ ], Text.prototype, "verticalAlign", undefined);
8809
8824
  __decorate([
8810
8825
  boundsType(true)
8811
- ], Text.prototype, "autoSizeAlign", void 0);
8826
+ ], Text.prototype, "autoSizeAlign", undefined);
8812
8827
  __decorate([
8813
8828
  boundsType('normal')
8814
- ], Text.prototype, "textWrap", void 0);
8829
+ ], Text.prototype, "textWrap", undefined);
8815
8830
  __decorate([
8816
8831
  boundsType('show')
8817
- ], Text.prototype, "textOverflow", void 0);
8832
+ ], Text.prototype, "textOverflow", undefined);
8818
8833
  Text = __decorate([
8819
8834
  registerUI()
8820
8835
  ], Text);
@@ -8827,10 +8842,10 @@ let Path = class Path extends UI {
8827
8842
  };
8828
8843
  __decorate([
8829
8844
  dataProcessor(PathData)
8830
- ], Path.prototype, "__", void 0);
8845
+ ], Path.prototype, "__", undefined);
8831
8846
  __decorate([
8832
8847
  affectStrokeBoundsType('center')
8833
- ], Path.prototype, "strokeAlign", void 0);
8848
+ ], Path.prototype, "strokeAlign", undefined);
8834
8849
  Path = __decorate([
8835
8850
  registerUI()
8836
8851
  ], Path);
@@ -8869,10 +8884,10 @@ let Pen = class Pen extends Group {
8869
8884
  };
8870
8885
  __decorate([
8871
8886
  dataProcessor(PenData)
8872
- ], Pen.prototype, "__", void 0);
8887
+ ], Pen.prototype, "__", undefined);
8873
8888
  __decorate([
8874
8889
  penPathType()
8875
- ], Pen.prototype, "path", void 0);
8890
+ ], Pen.prototype, "path", undefined);
8876
8891
  Pen = __decorate([
8877
8892
  useModule(PathCreator, ['set', 'path', 'paint']),
8878
8893
  registerUI()
@@ -10057,9 +10072,9 @@ leaf.__hitWorld = function (point) {
10057
10072
  }
10058
10073
  return this.__hit(inner);
10059
10074
  };
10060
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
10061
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
10062
- leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
10075
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
10076
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
10077
+ leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
10063
10078
  leaf.__drawHitPath = function (canvas) { if (canvas)
10064
10079
  this.__drawRenderPath(canvas); };
10065
10080
 
@@ -10899,7 +10914,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
10899
10914
  }
10900
10915
  else {
10901
10916
  if (!paint.patternTask) {
10902
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
10917
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
10903
10918
  paint.patternTask = null;
10904
10919
  if (canvas.bounds.hit(ui.__nowWorld))
10905
10920
  createPattern(ui, paint, pixelRatio);
@@ -11055,7 +11070,7 @@ function shadow$1(ui, current, shape) {
11055
11070
  const end = shadow.length - 1;
11056
11071
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
11057
11072
  shadow.forEach((item, index) => {
11058
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
11073
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
11059
11074
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
11060
11075
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
11061
11076
  copyBounds = bounds;
@@ -11131,7 +11146,7 @@ function innerShadow(ui, current, shape) {
11131
11146
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
11132
11147
  copyBounds = bounds;
11133
11148
  }
11134
- other.fillWorld(copyBounds, item.color, 'source-in');
11149
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
11135
11150
  if (ui.__worldFlipped) {
11136
11151
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
11137
11152
  }
@@ -11493,7 +11508,7 @@ function layoutChar(drawData, style, width, _height) {
11493
11508
  rows.forEach(row => {
11494
11509
  if (row.words) {
11495
11510
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
11496
- addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11511
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11497
11512
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
11498
11513
  if (row.isOverflow && !letterSpacing)
11499
11514
  row.textMode = true;
@@ -11515,7 +11530,7 @@ function layoutChar(drawData, style, width, _height) {
11515
11530
  else {
11516
11531
  charX = toChar(word.data, charX, row.data, row.isOverflow);
11517
11532
  }
11518
- if (!row.paraEnd && addWordWidth) {
11533
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
11519
11534
  charX += addWordWidth;
11520
11535
  row.width += addWordWidth;
11521
11536
  }
@@ -11911,25 +11926,25 @@ let Robot = class Robot extends UI {
11911
11926
  };
11912
11927
  __decorate([
11913
11928
  dataProcessor(RobotData)
11914
- ], Robot.prototype, "__", void 0);
11929
+ ], Robot.prototype, "__", undefined);
11915
11930
  __decorate([
11916
11931
  boundsType()
11917
- ], Robot.prototype, "robot", void 0);
11932
+ ], Robot.prototype, "robot", undefined);
11918
11933
  __decorate([
11919
11934
  dataType()
11920
- ], Robot.prototype, "actions", void 0);
11935
+ ], Robot.prototype, "actions", undefined);
11921
11936
  __decorate([
11922
11937
  dataType('')
11923
- ], Robot.prototype, "action", void 0);
11938
+ ], Robot.prototype, "action", undefined);
11924
11939
  __decorate([
11925
11940
  surfaceType(0)
11926
- ], Robot.prototype, "now", void 0);
11941
+ ], Robot.prototype, "now", undefined);
11927
11942
  __decorate([
11928
11943
  dataType(12)
11929
- ], Robot.prototype, "FPS", void 0);
11944
+ ], Robot.prototype, "FPS", undefined);
11930
11945
  __decorate([
11931
11946
  dataType(true)
11932
- ], Robot.prototype, "loop", void 0);
11947
+ ], Robot.prototype, "loop", undefined);
11933
11948
  Robot = __decorate([
11934
11949
  registerUI()
11935
11950
  ], Robot);
@@ -11997,7 +12012,9 @@ function updateStyle(leaf, style, type) {
11997
12012
  type = null;
11998
12013
  let transition = type ? getTransition(type, style, leaf) : false;
11999
12014
  const fromStyle = transition ? getFromStyle(leaf, style) : undefined;
12000
- leaf.killAnimate('transition');
12015
+ const nextStyle = State.canAnimate && getStyle(leaf);
12016
+ if (nextStyle)
12017
+ leaf.killAnimate('transition');
12001
12018
  if (normalStyle)
12002
12019
  leaf.set(normalStyle, 'temp');
12003
12020
  const statesStyle = getStyle(leaf);
@@ -12027,7 +12044,8 @@ function updateStyle(leaf, style, type) {
12027
12044
  }
12028
12045
  function getStyle(leaf) {
12029
12046
  let exist;
12030
- const style = {}, { state } = leaf, button = findParentButton(leaf);
12047
+ const style = {}, button = findParentButton(leaf);
12048
+ const state = button ? (leaf.state || button.state) : leaf.state;
12031
12049
  const stateStyle = state && leaf.states[state];
12032
12050
  if (stateStyle && State.isState(state, leaf, button))
12033
12051
  exist = assign(style, stateStyle);
@@ -12098,7 +12116,7 @@ function setState(leaf, stateName, stateStyle) {
12098
12116
  if (leaf.button)
12099
12117
  setChildrenState(leaf.children, null, stateName);
12100
12118
  }
12101
- function setChildrenState(children, stateType, state) {
12119
+ function setChildrenState(children, stateType, stateName) {
12102
12120
  if (!children)
12103
12121
  return;
12104
12122
  let leaf, update;
@@ -12122,10 +12140,10 @@ function setChildrenState(children, stateType, state) {
12122
12140
  if (update)
12123
12141
  setPointerState(leaf, stateType);
12124
12142
  }
12125
- else if (state)
12126
- setState(leaf, state);
12143
+ else if (stateName !== undefined)
12144
+ setState(leaf, stateName);
12127
12145
  if (leaf.isBranch)
12128
- setChildrenState(leaf.children, stateType, state);
12146
+ setChildrenState(leaf.children, stateType, stateName);
12129
12147
  }
12130
12148
  }
12131
12149
 
@@ -12141,7 +12159,7 @@ function unsetState(leaf, stateName, stateStyle) {
12141
12159
  if (leaf.button)
12142
12160
  unsetChildrenState(leaf.children, null, stateName);
12143
12161
  }
12144
- function unsetChildrenState(children, stateType, state) {
12162
+ function unsetChildrenState(children, stateType, stateName) {
12145
12163
  if (!children)
12146
12164
  return;
12147
12165
  let leaf;
@@ -12149,10 +12167,10 @@ function unsetChildrenState(children, stateType, state) {
12149
12167
  leaf = children[i];
12150
12168
  if (stateType)
12151
12169
  unsetPointerState(leaf, stateType);
12152
- else if (state)
12153
- unsetState(leaf, state);
12170
+ else if (stateName !== undefined)
12171
+ unsetState(leaf, stateName);
12154
12172
  if (leaf.isBranch)
12155
- unsetChildrenState(leaf.children, stateType, state);
12173
+ unsetChildrenState(leaf.children, stateType, stateName);
12156
12174
  }
12157
12175
  }
12158
12176
 
@@ -12370,8 +12388,11 @@ function animationType(defaultValue) {
12370
12388
  return decorateLeafAttr(defaultValue, (key) => attr({
12371
12389
  set(value) {
12372
12390
  this.__setAttr(key, value);
12373
- if (this.leafer)
12374
- value ? this.animate(value, undefined, 'animation') : this.killAnimate('animation');
12391
+ if (this.leafer) {
12392
+ this.killAnimate('animation');
12393
+ if (value)
12394
+ this.animate(value, undefined, 'animation');
12395
+ }
12375
12396
  }
12376
12397
  }));
12377
12398
  }
@@ -12408,22 +12429,29 @@ let Animate = class Animate extends Eventer {
12408
12429
  get completed() { return this.time >= this.duration && !this.started; }
12409
12430
  get frame() { return this.frames[this.nowIndex]; }
12410
12431
  get frameTotalTime() { return this.frame.totalTime || this.frame.duration || 0; }
12432
+ get nowReverse() { return (this.mainReverse ? 1 : 0) + (this.frameReverse ? 1 : 0) === 1; }
12411
12433
  get realEnding() {
12412
12434
  let count;
12413
- const { ending, reverse, loop } = this;
12435
+ const { ending, reverse, swing, loop } = this;
12414
12436
  if (ending === 'from')
12415
12437
  count = 0;
12416
12438
  else if (ending === 'to')
12417
12439
  count = 1;
12418
12440
  else {
12419
12441
  count = reverse ? 0 : 1;
12420
- if (loop && typeof loop === 'number')
12442
+ if (swing && loop && typeof loop === 'number')
12421
12443
  count += loop - 1;
12422
12444
  }
12423
12445
  return count % 2 ? 'to' : 'from';
12424
12446
  }
12425
12447
  constructor(target, keyframe, options, isTemp) {
12426
12448
  super();
12449
+ if (keyframe) {
12450
+ if (keyframe.keyframes)
12451
+ options = keyframe, keyframe = keyframe.keyframes;
12452
+ else if (keyframe.style)
12453
+ options = keyframe, keyframe = keyframe.style;
12454
+ }
12427
12455
  this.init(target, keyframe, options, isTemp);
12428
12456
  }
12429
12457
  init(target, keyframe, options, isTemp) {
@@ -12439,16 +12467,14 @@ let Animate = class Animate extends Eventer {
12439
12467
  break;
12440
12468
  case 'object': this.config = options, options.event && (this.event = options.event);
12441
12469
  }
12442
- if (!keyframe)
12443
- return;
12444
- this.keyframes = keyframe instanceof Array ? keyframe : [keyframe];
12470
+ this.keyframes = keyframe instanceof Array ? keyframe : (keyframe ? [keyframe] : []);
12445
12471
  const { easing, attrs } = this;
12446
12472
  this.easingFn = AnimateEasing.get(easing);
12447
12473
  if (attrs || this.attrsMap)
12448
12474
  this.attrsMap = attrs ? attrs.reduce((map, value) => { map[value] = true; return map; }, {}) : undefined;
12449
12475
  this.frames = [];
12450
12476
  this.create();
12451
- if (this.autoplay)
12477
+ if (this.autoplay && this.frames.length)
12452
12478
  this.timer = setTimeout(() => {
12453
12479
  this.timer = 0;
12454
12480
  this.play();
@@ -12497,7 +12523,7 @@ let Animate = class Animate extends Eventer {
12497
12523
  }
12498
12524
  create() {
12499
12525
  const { target, frames, keyframes, config } = this, { length } = keyframes, joinBefore = length > 1 ? this.join : true;
12500
- let addedDuration = 0, totalAutoDuration = 0, before, keyframe, item, style;
12526
+ let totalTime = 0, totalAutoTime = 0, before, keyframe, item, style, times;
12501
12527
  if (length > 1)
12502
12528
  this.fromStyle = {}, this.toStyle = {};
12503
12529
  for (let i = 0; i < length; i++) {
@@ -12506,27 +12532,32 @@ let Animate = class Animate extends Eventer {
12506
12532
  if (!before)
12507
12533
  before = joinBefore ? target : style;
12508
12534
  item = { style, beforeStyle: {} };
12535
+ times = 1;
12509
12536
  if (keyframe.style) {
12510
- const { duration, autoDuration, delay, autoDelay, easing } = keyframe;
12537
+ const { duration, autoDuration, delay, autoDelay, easing, swing, loop } = keyframe;
12538
+ if (swing)
12539
+ item.swing = typeof swing === 'number' ? swing : 2, times = item.swing * 2 - 1;
12540
+ if (loop)
12541
+ item.loop = times = typeof loop === 'number' ? loop : 2;
12511
12542
  if (duration) {
12512
- item.duration = duration, addedDuration += duration;
12543
+ item.duration = duration, totalTime += duration * times;
12513
12544
  if (delay)
12514
12545
  item.totalTime = duration + delay;
12515
12546
  }
12516
12547
  else {
12517
12548
  if (autoDuration)
12518
- item.autoDuration = autoDuration, totalAutoDuration += autoDuration;
12549
+ item.autoDuration = autoDuration, totalAutoTime += autoDuration * times;
12519
12550
  }
12520
12551
  if (delay)
12521
- item.delay = delay, addedDuration += delay;
12552
+ item.delay = delay, totalTime += delay * times;
12522
12553
  else if (autoDelay)
12523
- item.autoDelay = autoDelay, totalAutoDuration += autoDelay;
12554
+ item.autoDelay = autoDelay, totalAutoTime += autoDelay * times;
12524
12555
  if (easing)
12525
12556
  item.easingFn = AnimateEasing.get(easing);
12526
12557
  }
12527
12558
  if (!item.autoDuration && item.duration === undefined) {
12528
12559
  if (length > 1)
12529
- (i > 0 || joinBefore) ? totalAutoDuration++ : item.duration = 0;
12560
+ (i > 0 || joinBefore) ? totalAutoTime += times : item.duration = 0;
12530
12561
  else
12531
12562
  item.duration = this.duration;
12532
12563
  }
@@ -12542,14 +12573,14 @@ let Animate = class Animate extends Eventer {
12542
12573
  before = style;
12543
12574
  frames.push(item);
12544
12575
  }
12545
- if (totalAutoDuration) {
12546
- if (this.duration <= addedDuration || !(config && config.duration))
12547
- this.changeDuration(addedDuration + frameDuration * totalAutoDuration);
12548
- this.allocateTime((this.duration - addedDuration) / totalAutoDuration);
12576
+ if (totalAutoTime) {
12577
+ if (this.duration <= totalTime || !(config && config.duration))
12578
+ this.changeDuration(totalTime + frameDuration * totalAutoTime);
12579
+ this.allocateTime((this.duration - totalTime) / totalAutoTime);
12549
12580
  }
12550
12581
  else {
12551
- if (addedDuration)
12552
- this.changeDuration(addedDuration);
12582
+ if (totalTime)
12583
+ this.changeDuration(totalTime);
12553
12584
  }
12554
12585
  this.emit(AnimateEvent.CREATED, this);
12555
12586
  }
@@ -12576,7 +12607,7 @@ let Animate = class Animate extends Eventer {
12576
12607
  if (frame.autoDelay)
12577
12608
  frame.delay = frame.autoDelay * partTime;
12578
12609
  if (frame.delay)
12579
- frame.totalTime = frame.duration, frame.totalTime += frame.delay;
12610
+ frame.totalTime = frame.duration + frame.delay;
12580
12611
  }
12581
12612
  }
12582
12613
  }
@@ -12594,7 +12625,7 @@ let Animate = class Animate extends Eventer {
12594
12625
  if (realTime < duration) {
12595
12626
  while (realTime - this.playedTotalTime > this.frameTotalTime) {
12596
12627
  this.transition(1);
12597
- this.nowReverse ? this.reverseNextFrame() : this.nextFrame();
12628
+ this.mainReverse ? this.reverseNextFrame() : this.nextFrame();
12598
12629
  }
12599
12630
  const itemDelay = this.nowReverse ? 0 : (this.frame.delay || 0);
12600
12631
  const itemPlayedTime = realTime - this.playedTotalTime - itemDelay;
@@ -12618,9 +12649,9 @@ let Animate = class Animate extends Eventer {
12618
12649
  const { loop, loopDelay, swing } = this;
12619
12650
  if (loop !== false || swing) {
12620
12651
  this.looped ? this.looped++ : this.looped = 1;
12621
- if (!(typeof loop === 'number' && (!loop || this.looped >= loop))) {
12652
+ if (this.needLoop(this.looped, loop, swing)) {
12622
12653
  if (swing)
12623
- this.nowReverse = !this.nowReverse;
12654
+ this.mainReverse = !this.mainReverse;
12624
12655
  if (loopDelay)
12625
12656
  this.timer = setTimeout(() => { this.timer = 0, this.begin(); }, loopDelay / this.speed * 1000);
12626
12657
  else
@@ -12635,8 +12666,8 @@ let Animate = class Animate extends Eventer {
12635
12666
  start(seek) {
12636
12667
  this.requestAnimateTime = 1;
12637
12668
  const { reverse } = this;
12638
- if (reverse || this.nowReverse)
12639
- this.nowReverse = reverse;
12669
+ if (reverse || this.mainReverse)
12670
+ this.mainReverse = reverse;
12640
12671
  if (this.looped)
12641
12672
  this.looped = 0;
12642
12673
  if (seek)
@@ -12654,12 +12685,12 @@ let Animate = class Animate extends Eventer {
12654
12685
  }
12655
12686
  begin(seek) {
12656
12687
  this.playedTotalTime = this.time = 0;
12657
- this.nowReverse ? this.setTo() : this.setFrom();
12688
+ this.mainReverse ? this.setTo() : this.setFrom();
12658
12689
  if (!seek)
12659
12690
  this.requestAnimate();
12660
12691
  }
12661
12692
  end() {
12662
- this.nowReverse ? this.setFrom() : this.setTo();
12693
+ this.mainReverse ? this.setFrom() : this.setTo();
12663
12694
  }
12664
12695
  complete() {
12665
12696
  this.requestAnimateTime = 0;
@@ -12682,15 +12713,19 @@ let Animate = class Animate extends Eventer {
12682
12713
  this.setStyle(this.toStyle);
12683
12714
  }
12684
12715
  nextFrame() {
12716
+ if (this.needLoopFrame())
12717
+ return this.increaseTime();
12685
12718
  if (this.nowIndex + 1 >= this.frames.length)
12686
12719
  return;
12687
- this.playedTotalTime += this.frameTotalTime;
12720
+ this.increaseTime();
12688
12721
  this.nowIndex++;
12689
12722
  }
12690
12723
  reverseNextFrame() {
12724
+ if (this.needLoopFrame())
12725
+ return this.increaseTime();
12691
12726
  if (this.nowIndex - 1 < 0)
12692
12727
  return;
12693
- this.playedTotalTime += this.frameTotalTime;
12728
+ this.increaseTime();
12694
12729
  this.nowIndex--;
12695
12730
  }
12696
12731
  transition(t) {
@@ -12726,6 +12761,27 @@ let Animate = class Animate extends Eventer {
12726
12761
  target.__ ? target.set(style, this.isTemp ? 'temp' : false) : Object.assign(target, style);
12727
12762
  }
12728
12763
  }
12764
+ increaseTime() {
12765
+ this.playedTotalTime += this.frameTotalTime;
12766
+ }
12767
+ needLoop(looped, loop, swing) {
12768
+ return !(this.needStopLoop(looped, loop) || this.needStopLoop(looped, swing, true));
12769
+ }
12770
+ needStopLoop(looped, times, swing) {
12771
+ return typeof times === 'number' && (!times || looped >= (swing ? times * 2 - 1 : times));
12772
+ }
12773
+ needLoopFrame() {
12774
+ const { loop, swing } = this.frame;
12775
+ if (loop || swing) {
12776
+ this.frameLooped ? this.frameLooped++ : this.frameLooped = 1;
12777
+ if (swing)
12778
+ this.frameReverse = !this.frameReverse;
12779
+ if (this.needLoop(this.frameLooped, loop, swing))
12780
+ return true;
12781
+ this.frameLooped = this.frameReverse = undefined;
12782
+ }
12783
+ return false;
12784
+ }
12729
12785
  clearTimer(fn) {
12730
12786
  if (this.timer) {
12731
12787
  clearTimeout(this.timer), this.timer = 0;
@@ -12747,44 +12803,102 @@ let Animate = class Animate extends Eventer {
12747
12803
  };
12748
12804
  __decorate([
12749
12805
  animateAttr('ease')
12750
- ], Animate.prototype, "easing", void 0);
12806
+ ], Animate.prototype, "easing", undefined);
12751
12807
  __decorate([
12752
12808
  animateAttr(0)
12753
- ], Animate.prototype, "delay", void 0);
12809
+ ], Animate.prototype, "delay", undefined);
12754
12810
  __decorate([
12755
12811
  animateAttr(frameDuration)
12756
- ], Animate.prototype, "duration", void 0);
12812
+ ], Animate.prototype, "duration", undefined);
12757
12813
  __decorate([
12758
12814
  animateAttr('auto')
12759
- ], Animate.prototype, "ending", void 0);
12815
+ ], Animate.prototype, "ending", undefined);
12760
12816
  __decorate([
12761
12817
  animateAttr(false)
12762
- ], Animate.prototype, "reverse", void 0);
12818
+ ], Animate.prototype, "reverse", undefined);
12763
12819
  __decorate([
12764
12820
  animateAttr(false)
12765
- ], Animate.prototype, "swing", void 0);
12821
+ ], Animate.prototype, "swing", undefined);
12766
12822
  __decorate([
12767
12823
  animateAttr(false)
12768
- ], Animate.prototype, "loop", void 0);
12824
+ ], Animate.prototype, "loop", undefined);
12769
12825
  __decorate([
12770
12826
  animateAttr(0)
12771
- ], Animate.prototype, "loopDelay", void 0);
12827
+ ], Animate.prototype, "loopDelay", undefined);
12772
12828
  __decorate([
12773
12829
  animateAttr(1)
12774
- ], Animate.prototype, "speed", void 0);
12830
+ ], Animate.prototype, "speed", undefined);
12775
12831
  __decorate([
12776
12832
  animateAttr(true)
12777
- ], Animate.prototype, "autoplay", void 0);
12833
+ ], Animate.prototype, "autoplay", undefined);
12778
12834
  __decorate([
12779
12835
  animateAttr()
12780
- ], Animate.prototype, "join", void 0);
12836
+ ], Animate.prototype, "join", undefined);
12781
12837
  __decorate([
12782
12838
  animateAttr()
12783
- ], Animate.prototype, "attrs", void 0);
12839
+ ], Animate.prototype, "attrs", undefined);
12784
12840
  Animate = __decorate([
12785
12841
  useModule(LeafEventer)
12786
12842
  ], Animate);
12787
12843
 
12844
+ let AnimateList = class AnimateList extends Animate {
12845
+ get completed() { return this.list.every(item => item.completed); }
12846
+ get endingStyle() { return this._endingStyle; }
12847
+ constructor(target, animation, isTemp) {
12848
+ super(target, null);
12849
+ this.list = [];
12850
+ this.updateList(animation, isTemp);
12851
+ }
12852
+ updateList(animation, isTemp) {
12853
+ this.fromStyle = {};
12854
+ this.toStyle = {};
12855
+ this._endingStyle = {};
12856
+ if (!animation)
12857
+ animation = this.list.filter(item => {
12858
+ const { completed } = item;
12859
+ if (completed)
12860
+ item.destroy();
12861
+ return !completed;
12862
+ });
12863
+ this.list = animation.map(item => {
12864
+ const animate = item.target ? item : new Animate(this.target, item, isTemp);
12865
+ Object.assign(this.fromStyle, animate.fromStyle);
12866
+ Object.assign(this.toStyle, animate.toStyle);
12867
+ Object.assign(this._endingStyle, animate.endingStyle);
12868
+ return animate;
12869
+ });
12870
+ }
12871
+ play() {
12872
+ this.each(item => item.play());
12873
+ }
12874
+ pause() {
12875
+ this.each(item => item.pause());
12876
+ }
12877
+ stop() {
12878
+ this.each(item => item.stop());
12879
+ }
12880
+ seek(time) {
12881
+ this.each(item => item.seek(time));
12882
+ }
12883
+ kill(complete, killStyle) {
12884
+ this.each(item => item.kill(complete, killStyle));
12885
+ this.destroy();
12886
+ }
12887
+ each(func) {
12888
+ this.list.forEach(func);
12889
+ }
12890
+ destroy(complete) {
12891
+ const { list } = this;
12892
+ if (list.length) {
12893
+ this.each(item => item.destroy(complete));
12894
+ list.length = 0;
12895
+ }
12896
+ }
12897
+ };
12898
+ AnimateList = __decorate([
12899
+ useModule(LeafEventer)
12900
+ ], AnimateList);
12901
+
12788
12902
  const colorNames = {
12789
12903
  transparent: 'FFF0',
12790
12904
  aliceblue: 'F0F8FF',
@@ -13121,7 +13235,8 @@ function getDecimalLen(num) {
13121
13235
  return decimal ? decimal.length : 0;
13122
13236
  }
13123
13237
  function value(from, to, t) {
13124
- return (typeof from === 'number' && typeof to === 'number') ? from + (to - from) * t : to;
13238
+ const fromIsNumber = typeof from === 'number', toIsNumber = typeof to === 'number';
13239
+ return (fromIsNumber && toIsNumber) ? from + (to - from) * t : ((toIsNumber || fromIsNumber) ? number(from, to, t) : from);
13125
13240
  }
13126
13241
  function number(from, to, t, roundValue) {
13127
13242
  from || (from = 0), to || (to = 0);
@@ -13165,23 +13280,40 @@ dataType()(ui$2, 'transitionOut');
13165
13280
  ui$2.animate = function (keyframe, options, kill, isTemp) {
13166
13281
  if (keyframe === undefined)
13167
13282
  return this.__animate;
13168
- if (typeof keyframe === 'object') {
13169
- if (keyframe.keyframes)
13170
- options = keyframe, keyframe = keyframe.keyframes;
13171
- else if (keyframe.style)
13172
- options = keyframe, keyframe = keyframe.style;
13173
- }
13174
- const animate = new Animate(this, keyframe, options, isTemp);
13175
- this.killAnimate(kill, animate.toStyle);
13176
- return this.__animate = animate;
13283
+ const isAnimationList = keyframe instanceof Array && !options && kill;
13284
+ let nextAnimate = isAnimationList ? new AnimateList(this, keyframe, isTemp) : new Animate(this, keyframe, options, isTemp);
13285
+ this.killAnimate(kill, nextAnimate.toStyle);
13286
+ const animate = this.__animate;
13287
+ if (animate) {
13288
+ if (nextAnimate instanceof AnimateList)
13289
+ nextAnimate.list.unshift(animate);
13290
+ else
13291
+ nextAnimate = new AnimateList(this, [animate, nextAnimate]);
13292
+ }
13293
+ return this.__animate = nextAnimate;
13177
13294
  };
13178
- ui$2.killAnimate = function (_type, killStyle) {
13295
+ ui$2.killAnimate = function (_type, nextStyle) {
13179
13296
  const animate = this.__animate;
13180
- if (animate)
13181
- animate.kill(true, killStyle), this.__animate = null;
13297
+ if (animate) {
13298
+ let kill = false;
13299
+ if (nextStyle && !animate.completed) {
13300
+ if (animate instanceof AnimateList)
13301
+ animate.updateList();
13302
+ const { toStyle } = animate;
13303
+ for (let key in nextStyle)
13304
+ if (key in toStyle) {
13305
+ kill = true;
13306
+ break;
13307
+ }
13308
+ }
13309
+ else
13310
+ kill = true;
13311
+ if (kill)
13312
+ animate.kill(true, nextStyle), this.__animate = null;
13313
+ }
13182
13314
  };
13183
13315
  ui$2.__runAnimation = function (type, complete) {
13184
- this.animate(type === 'in' ? this.animation : this.animationOut);
13316
+ this.animate(type === 'in' ? this.animation : this.animationOut, undefined, 'animation');
13185
13317
  if (complete)
13186
13318
  this.__animate.on(AnimateEvent.COMPLETED, complete);
13187
13319
  };
@@ -13475,12 +13607,12 @@ ui$1.__updateMotionPath = function () {
13475
13607
  data.__pathForMotion = undefined;
13476
13608
  if (this.motionPath) {
13477
13609
  let child;
13478
- const { children } = this.parent, { leaferIsReady } = this;
13610
+ const { children } = this.parent;
13479
13611
  for (let i = 0; i < children.length; i++) {
13480
13612
  child = children[i];
13481
13613
  if (!isNull(child.motion) && !child.__layout.matrixChanged) {
13482
- if (leaferIsReady && child !== this)
13483
- this.leafer.layouter.addExtra(child);
13614
+ if (child !== this)
13615
+ child.__extraUpdate();
13484
13616
  updateMotion(child);
13485
13617
  }
13486
13618
  }
@@ -13699,4 +13831,4 @@ if (platform === 'ios') {
13699
13831
  };
13700
13832
  }
13701
13833
 
13702
- export { AlignHelper, Animate, AnimateEasing, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
13834
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };