leafer-game 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.
package/dist/web.js CHANGED
@@ -1536,10 +1536,10 @@ var LeaferUI = (function (exports) {
1536
1536
  Object.keys(merge).forEach(key => {
1537
1537
  var _a, _b;
1538
1538
  value = merge[key];
1539
- if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1539
+ if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
1540
1540
  return assign$1(t[key], merge[key], exclude && exclude[key]);
1541
1541
  if (exclude && (key in exclude)) {
1542
- if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1542
+ if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
1543
1543
  assign$1(t[key] = {}, merge[key], exclude[key]);
1544
1544
  return;
1545
1545
  }
@@ -1708,7 +1708,7 @@ var LeaferUI = (function (exports) {
1708
1708
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1709
1709
  PERFORMANCE OF THIS SOFTWARE.
1710
1710
  ***************************************************************************** */
1711
- /* global Reflect, Promise, SuppressedError, Symbol */
1711
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1712
1712
 
1713
1713
 
1714
1714
  function __decorate(decorators, target, key, desc) {
@@ -1776,7 +1776,7 @@ var LeaferUI = (function (exports) {
1776
1776
  }
1777
1777
  setTransform(_a, _b, _c, _d, _e, _f) { }
1778
1778
  resetTransform() { }
1779
- getTransform() { return void 0; }
1779
+ getTransform() { return undefined; }
1780
1780
  save() { }
1781
1781
  restore() { }
1782
1782
  transform(a, b, c, d, e, f) {
@@ -1833,12 +1833,12 @@ var LeaferUI = (function (exports) {
1833
1833
  ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
1834
1834
  rect(_x, _y, _width, _height) { }
1835
1835
  roundRect(_x, _y, _width, _height, _radius) { }
1836
- createConicGradient(_startAngle, _x, _y) { return void 0; }
1837
- createLinearGradient(_x0, _y0, _x1, _y1) { return void 0; }
1838
- createPattern(_image, _repetition) { return void 0; }
1839
- createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return void 0; }
1836
+ createConicGradient(_startAngle, _x, _y) { return undefined; }
1837
+ createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
1838
+ createPattern(_image, _repetition) { return undefined; }
1839
+ createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
1840
1840
  fillText(_text, _x, _y, _maxWidth) { }
1841
- measureText(_text) { return void 0; }
1841
+ measureText(_text) { return undefined; }
1842
1842
  strokeText(_text, _x, _y, _maxWidth) { }
1843
1843
  destroy() {
1844
1844
  this.context = null;
@@ -1846,79 +1846,79 @@ var LeaferUI = (function (exports) {
1846
1846
  }
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingEnabled')
1849
- ], Canvas.prototype, "smooth", void 0);
1849
+ ], Canvas.prototype, "smooth", undefined);
1850
1850
  __decorate([
1851
1851
  contextAttr('imageSmoothingQuality')
1852
- ], Canvas.prototype, "smoothLevel", void 0);
1852
+ ], Canvas.prototype, "smoothLevel", undefined);
1853
1853
  __decorate([
1854
1854
  contextAttr('globalAlpha')
1855
- ], Canvas.prototype, "opacity", void 0);
1855
+ ], Canvas.prototype, "opacity", undefined);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas.prototype, "fillStyle", void 0);
1858
+ ], Canvas.prototype, "fillStyle", undefined);
1859
1859
  __decorate([
1860
1860
  contextAttr()
1861
- ], Canvas.prototype, "strokeStyle", void 0);
1861
+ ], Canvas.prototype, "strokeStyle", undefined);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineWidth')
1864
- ], Canvas.prototype, "strokeWidth", void 0);
1864
+ ], Canvas.prototype, "strokeWidth", undefined);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineCap')
1867
- ], Canvas.prototype, "strokeCap", void 0);
1867
+ ], Canvas.prototype, "strokeCap", undefined);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineJoin')
1870
- ], Canvas.prototype, "strokeJoin", void 0);
1870
+ ], Canvas.prototype, "strokeJoin", undefined);
1871
1871
  __decorate([
1872
1872
  contextAttr('lineDashOffset')
1873
- ], Canvas.prototype, "dashOffset", void 0);
1873
+ ], Canvas.prototype, "dashOffset", undefined);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas.prototype, "miterLimit", void 0);
1876
+ ], Canvas.prototype, "miterLimit", undefined);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas.prototype, "shadowBlur", void 0);
1879
+ ], Canvas.prototype, "shadowBlur", undefined);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas.prototype, "shadowColor", void 0);
1882
+ ], Canvas.prototype, "shadowColor", undefined);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas.prototype, "shadowOffsetX", void 0);
1885
+ ], Canvas.prototype, "shadowOffsetX", undefined);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas.prototype, "shadowOffsetY", void 0);
1888
+ ], Canvas.prototype, "shadowOffsetY", undefined);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas.prototype, "filter", void 0);
1891
+ ], Canvas.prototype, "filter", undefined);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas.prototype, "font", void 0);
1894
+ ], Canvas.prototype, "font", undefined);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas.prototype, "fontKerning", void 0);
1897
+ ], Canvas.prototype, "fontKerning", undefined);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas.prototype, "fontStretch", void 0);
1900
+ ], Canvas.prototype, "fontStretch", undefined);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas.prototype, "fontVariantCaps", void 0);
1903
+ ], Canvas.prototype, "fontVariantCaps", undefined);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas.prototype, "textAlign", void 0);
1906
+ ], Canvas.prototype, "textAlign", undefined);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas.prototype, "textBaseline", void 0);
1909
+ ], Canvas.prototype, "textBaseline", undefined);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas.prototype, "textRendering", void 0);
1912
+ ], Canvas.prototype, "textRendering", undefined);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas.prototype, "wordSpacing", void 0);
1915
+ ], Canvas.prototype, "wordSpacing", undefined);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas.prototype, "letterSpacing", void 0);
1918
+ ], Canvas.prototype, "letterSpacing", undefined);
1919
1919
  __decorate([
1920
1920
  contextAttr()
1921
- ], Canvas.prototype, "direction", void 0);
1921
+ ], Canvas.prototype, "direction", undefined);
1922
1922
  __decorate([
1923
1923
  contextMethod()
1924
1924
  ], Canvas.prototype, "setTransform", null);
@@ -3387,7 +3387,7 @@ var LeaferUI = (function (exports) {
3387
3387
  this.task = task;
3388
3388
  }
3389
3389
  run() {
3390
- return __awaiter(this, void 0, void 0, function* () {
3390
+ return __awaiter(this, undefined, undefined, function* () {
3391
3391
  try {
3392
3392
  if (this.task && !this.isComplete && this.parent.running)
3393
3393
  yield this.task();
@@ -3699,7 +3699,7 @@ var LeaferUI = (function (exports) {
3699
3699
  load(onSuccess, onError) {
3700
3700
  if (!this.loading) {
3701
3701
  this.loading = true;
3702
- ImageManager.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3702
+ ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3703
3703
  return yield Platform.origin.loadImage(this.url).then((img) => {
3704
3704
  this.ready = true;
3705
3705
  this.width = img.naturalWidth || img.width;
@@ -5178,8 +5178,7 @@ var LeaferUI = (function (exports) {
5178
5178
  __updateAutoLayout() {
5179
5179
  this.__layout.matrixChanged = true;
5180
5180
  if (this.isBranch) {
5181
- if (this.leaferIsReady)
5182
- this.leafer.layouter.addExtra(this);
5181
+ this.__extraUpdate();
5183
5182
  if (this.__.flow) {
5184
5183
  if (this.__layout.boxChanged)
5185
5184
  this.__updateFlowLayout();
@@ -5332,7 +5331,7 @@ var LeaferUI = (function (exports) {
5332
5331
  get __worldFlipped() { return this.__world.scaleX < 0 || this.__world.scaleY < 0; }
5333
5332
  get __onlyHitMask() { return this.__hasMask && !this.__.hitChildren; }
5334
5333
  get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
5335
- get __inLazyBounds() { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world); }
5334
+ get __inLazyBounds() { return this.leaferIsCreated && this.leafer.lazyBounds.hit(this.__world); }
5336
5335
  get pathInputed() { return this.__.__pathInputed; }
5337
5336
  set event(map) { this.on(map); }
5338
5337
  constructor(data) {
@@ -5443,6 +5442,10 @@ var LeaferUI = (function (exports) {
5443
5442
  forceRender(_bounds, _sync) {
5444
5443
  this.forceUpdate('surface');
5445
5444
  }
5445
+ __extraUpdate() {
5446
+ if (this.leaferIsReady)
5447
+ this.leafer.layouter.addExtra(this);
5448
+ }
5446
5449
  __updateWorldMatrix() { }
5447
5450
  __updateLocalMatrix() { }
5448
5451
  __updateWorldBounds() { }
@@ -6010,7 +6013,7 @@ var LeaferUI = (function (exports) {
6010
6013
  }
6011
6014
  }
6012
6015
 
6013
- const version = "1.3.1";
6016
+ const version = "1.3.3";
6014
6017
 
6015
6018
  const debug$5 = Debug.get('LeaferCanvas');
6016
6019
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6229,7 +6232,7 @@ var LeaferUI = (function (exports) {
6229
6232
  },
6230
6233
  loadImage(src) {
6231
6234
  return new Promise((resolve, reject) => {
6232
- const img = new Image();
6235
+ const img = new Platform.origin.Image();
6233
6236
  const { crossOrigin } = Platform.image;
6234
6237
  if (crossOrigin) {
6235
6238
  img.setAttribute('crossOrigin', crossOrigin);
@@ -6239,7 +6242,10 @@ var LeaferUI = (function (exports) {
6239
6242
  img.onerror = (e) => { reject(e); };
6240
6243
  img.src = Platform.image.getRealURL(src);
6241
6244
  });
6242
- }
6245
+ },
6246
+ Image,
6247
+ PointerEvent,
6248
+ DragEvent
6243
6249
  };
6244
6250
  Platform.event = {
6245
6251
  stopDefault(origin) { origin.preventDefault(); },
@@ -6528,7 +6534,7 @@ var LeaferUI = (function (exports) {
6528
6534
  }
6529
6535
  partLayout() {
6530
6536
  var _a;
6531
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6537
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6532
6538
  return;
6533
6539
  const t = Run.start('PartLayout');
6534
6540
  const { target, __updatedList: updateList } = this;
@@ -6715,7 +6721,7 @@ var LeaferUI = (function (exports) {
6715
6721
  partRender() {
6716
6722
  const { canvas, updateBlocks: list } = this;
6717
6723
  if (!list)
6718
- return debug$3.warn('PartRender: need update attr');
6724
+ return;
6719
6725
  this.mergeBlocks();
6720
6726
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6721
6727
  this.clipRender(block); });
@@ -7099,6 +7105,7 @@ var LeaferUI = (function (exports) {
7099
7105
  return t.fill && this.__hasStroke;
7100
7106
  }
7101
7107
  get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
7108
+ get __hasSurface() { const t = this; return (t.fill || t.stroke); }
7102
7109
  get __autoWidth() { return !this._width; }
7103
7110
  get __autoHeight() { return !this._height; }
7104
7111
  get __autoSide() { return !this._width || !this._height; }
@@ -7571,7 +7578,7 @@ var LeaferUI = (function (exports) {
7571
7578
  animate(_keyframe, _options, _type, _isTemp) {
7572
7579
  return Plugin.need('animate');
7573
7580
  }
7574
- killAnimate(_type, _killStyle) { }
7581
+ killAnimate(_type, _nextStyle) { }
7575
7582
  export(_filename, _options) {
7576
7583
  return Plugin.need('export');
7577
7584
  }
@@ -7602,199 +7609,199 @@ var LeaferUI = (function (exports) {
7602
7609
  };
7603
7610
  __decorate([
7604
7611
  dataProcessor(UIData)
7605
- ], exports.UI.prototype, "__", void 0);
7612
+ ], exports.UI.prototype, "__", undefined);
7606
7613
  __decorate([
7607
7614
  zoomLayerType()
7608
- ], exports.UI.prototype, "zoomLayer", void 0);
7615
+ ], exports.UI.prototype, "zoomLayer", undefined);
7609
7616
  __decorate([
7610
7617
  dataType('')
7611
- ], exports.UI.prototype, "id", void 0);
7618
+ ], exports.UI.prototype, "id", undefined);
7612
7619
  __decorate([
7613
7620
  dataType('')
7614
- ], exports.UI.prototype, "name", void 0);
7621
+ ], exports.UI.prototype, "name", undefined);
7615
7622
  __decorate([
7616
7623
  dataType('')
7617
- ], exports.UI.prototype, "className", void 0);
7624
+ ], exports.UI.prototype, "className", undefined);
7618
7625
  __decorate([
7619
7626
  surfaceType('pass-through')
7620
- ], exports.UI.prototype, "blendMode", void 0);
7627
+ ], exports.UI.prototype, "blendMode", undefined);
7621
7628
  __decorate([
7622
7629
  opacityType(1)
7623
- ], exports.UI.prototype, "opacity", void 0);
7630
+ ], exports.UI.prototype, "opacity", undefined);
7624
7631
  __decorate([
7625
7632
  visibleType(true)
7626
- ], exports.UI.prototype, "visible", void 0);
7633
+ ], exports.UI.prototype, "visible", undefined);
7627
7634
  __decorate([
7628
7635
  surfaceType(false)
7629
- ], exports.UI.prototype, "locked", void 0);
7636
+ ], exports.UI.prototype, "locked", undefined);
7630
7637
  __decorate([
7631
7638
  sortType(0)
7632
- ], exports.UI.prototype, "zIndex", void 0);
7639
+ ], exports.UI.prototype, "zIndex", undefined);
7633
7640
  __decorate([
7634
7641
  maskType(false)
7635
- ], exports.UI.prototype, "mask", void 0);
7642
+ ], exports.UI.prototype, "mask", undefined);
7636
7643
  __decorate([
7637
7644
  eraserType(false)
7638
- ], exports.UI.prototype, "eraser", void 0);
7645
+ ], exports.UI.prototype, "eraser", undefined);
7639
7646
  __decorate([
7640
7647
  positionType(0, true)
7641
- ], exports.UI.prototype, "x", void 0);
7648
+ ], exports.UI.prototype, "x", undefined);
7642
7649
  __decorate([
7643
7650
  positionType(0, true)
7644
- ], exports.UI.prototype, "y", void 0);
7651
+ ], exports.UI.prototype, "y", undefined);
7645
7652
  __decorate([
7646
7653
  boundsType(100, true)
7647
- ], exports.UI.prototype, "width", void 0);
7654
+ ], exports.UI.prototype, "width", undefined);
7648
7655
  __decorate([
7649
7656
  boundsType(100, true)
7650
- ], exports.UI.prototype, "height", void 0);
7657
+ ], exports.UI.prototype, "height", undefined);
7651
7658
  __decorate([
7652
7659
  scaleType(1, true)
7653
- ], exports.UI.prototype, "scaleX", void 0);
7660
+ ], exports.UI.prototype, "scaleX", undefined);
7654
7661
  __decorate([
7655
7662
  scaleType(1, true)
7656
- ], exports.UI.prototype, "scaleY", void 0);
7663
+ ], exports.UI.prototype, "scaleY", undefined);
7657
7664
  __decorate([
7658
7665
  rotationType(0, true)
7659
- ], exports.UI.prototype, "rotation", void 0);
7666
+ ], exports.UI.prototype, "rotation", undefined);
7660
7667
  __decorate([
7661
7668
  rotationType(0, true)
7662
- ], exports.UI.prototype, "skewX", void 0);
7669
+ ], exports.UI.prototype, "skewX", undefined);
7663
7670
  __decorate([
7664
7671
  rotationType(0, true)
7665
- ], exports.UI.prototype, "skewY", void 0);
7672
+ ], exports.UI.prototype, "skewY", undefined);
7666
7673
  __decorate([
7667
7674
  positionType(0, true)
7668
- ], exports.UI.prototype, "offsetX", void 0);
7675
+ ], exports.UI.prototype, "offsetX", undefined);
7669
7676
  __decorate([
7670
7677
  positionType(0, true)
7671
- ], exports.UI.prototype, "offsetY", void 0);
7678
+ ], exports.UI.prototype, "offsetY", undefined);
7672
7679
  __decorate([
7673
7680
  positionType(0, true)
7674
- ], exports.UI.prototype, "scrollX", void 0);
7681
+ ], exports.UI.prototype, "scrollX", undefined);
7675
7682
  __decorate([
7676
7683
  positionType(0, true)
7677
- ], exports.UI.prototype, "scrollY", void 0);
7684
+ ], exports.UI.prototype, "scrollY", undefined);
7678
7685
  __decorate([
7679
7686
  autoLayoutType()
7680
- ], exports.UI.prototype, "origin", void 0);
7687
+ ], exports.UI.prototype, "origin", undefined);
7681
7688
  __decorate([
7682
7689
  autoLayoutType()
7683
- ], exports.UI.prototype, "around", void 0);
7690
+ ], exports.UI.prototype, "around", undefined);
7684
7691
  __decorate([
7685
7692
  dataType(false)
7686
- ], exports.UI.prototype, "lazy", void 0);
7693
+ ], exports.UI.prototype, "lazy", undefined);
7687
7694
  __decorate([
7688
7695
  naturalBoundsType(1)
7689
- ], exports.UI.prototype, "pixelRatio", void 0);
7696
+ ], exports.UI.prototype, "pixelRatio", undefined);
7690
7697
  __decorate([
7691
7698
  pathInputType()
7692
- ], exports.UI.prototype, "path", void 0);
7699
+ ], exports.UI.prototype, "path", undefined);
7693
7700
  __decorate([
7694
7701
  pathType()
7695
- ], exports.UI.prototype, "windingRule", void 0);
7702
+ ], exports.UI.prototype, "windingRule", undefined);
7696
7703
  __decorate([
7697
7704
  pathType(true)
7698
- ], exports.UI.prototype, "closed", void 0);
7705
+ ], exports.UI.prototype, "closed", undefined);
7699
7706
  __decorate([
7700
7707
  boundsType(0)
7701
- ], exports.UI.prototype, "padding", void 0);
7708
+ ], exports.UI.prototype, "padding", undefined);
7702
7709
  __decorate([
7703
7710
  boundsType(false)
7704
- ], exports.UI.prototype, "lockRatio", void 0);
7711
+ ], exports.UI.prototype, "lockRatio", undefined);
7705
7712
  __decorate([
7706
7713
  boundsType()
7707
- ], exports.UI.prototype, "widthRange", void 0);
7714
+ ], exports.UI.prototype, "widthRange", undefined);
7708
7715
  __decorate([
7709
7716
  boundsType()
7710
- ], exports.UI.prototype, "heightRange", void 0);
7717
+ ], exports.UI.prototype, "heightRange", undefined);
7711
7718
  __decorate([
7712
7719
  dataType(false)
7713
- ], exports.UI.prototype, "draggable", void 0);
7720
+ ], exports.UI.prototype, "draggable", undefined);
7714
7721
  __decorate([
7715
7722
  dataType()
7716
- ], exports.UI.prototype, "dragBounds", void 0);
7723
+ ], exports.UI.prototype, "dragBounds", undefined);
7717
7724
  __decorate([
7718
7725
  dataType(false)
7719
- ], exports.UI.prototype, "editable", void 0);
7726
+ ], exports.UI.prototype, "editable", undefined);
7720
7727
  __decorate([
7721
7728
  hitType(true)
7722
- ], exports.UI.prototype, "hittable", void 0);
7729
+ ], exports.UI.prototype, "hittable", undefined);
7723
7730
  __decorate([
7724
7731
  hitType('path')
7725
- ], exports.UI.prototype, "hitFill", void 0);
7732
+ ], exports.UI.prototype, "hitFill", undefined);
7726
7733
  __decorate([
7727
7734
  strokeType('path')
7728
- ], exports.UI.prototype, "hitStroke", void 0);
7735
+ ], exports.UI.prototype, "hitStroke", undefined);
7729
7736
  __decorate([
7730
7737
  hitType(false)
7731
- ], exports.UI.prototype, "hitBox", void 0);
7738
+ ], exports.UI.prototype, "hitBox", undefined);
7732
7739
  __decorate([
7733
7740
  hitType(true)
7734
- ], exports.UI.prototype, "hitChildren", void 0);
7741
+ ], exports.UI.prototype, "hitChildren", undefined);
7735
7742
  __decorate([
7736
7743
  hitType(true)
7737
- ], exports.UI.prototype, "hitSelf", void 0);
7744
+ ], exports.UI.prototype, "hitSelf", undefined);
7738
7745
  __decorate([
7739
7746
  hitType()
7740
- ], exports.UI.prototype, "hitRadius", void 0);
7747
+ ], exports.UI.prototype, "hitRadius", undefined);
7741
7748
  __decorate([
7742
7749
  cursorType('')
7743
- ], exports.UI.prototype, "cursor", void 0);
7750
+ ], exports.UI.prototype, "cursor", undefined);
7744
7751
  __decorate([
7745
7752
  surfaceType()
7746
- ], exports.UI.prototype, "fill", void 0);
7753
+ ], exports.UI.prototype, "fill", undefined);
7747
7754
  __decorate([
7748
7755
  strokeType()
7749
- ], exports.UI.prototype, "stroke", void 0);
7756
+ ], exports.UI.prototype, "stroke", undefined);
7750
7757
  __decorate([
7751
7758
  strokeType('inside')
7752
- ], exports.UI.prototype, "strokeAlign", void 0);
7759
+ ], exports.UI.prototype, "strokeAlign", undefined);
7753
7760
  __decorate([
7754
7761
  strokeType(1)
7755
- ], exports.UI.prototype, "strokeWidth", void 0);
7762
+ ], exports.UI.prototype, "strokeWidth", undefined);
7756
7763
  __decorate([
7757
7764
  strokeType(false)
7758
- ], exports.UI.prototype, "strokeWidthFixed", void 0);
7765
+ ], exports.UI.prototype, "strokeWidthFixed", undefined);
7759
7766
  __decorate([
7760
7767
  strokeType('none')
7761
- ], exports.UI.prototype, "strokeCap", void 0);
7768
+ ], exports.UI.prototype, "strokeCap", undefined);
7762
7769
  __decorate([
7763
7770
  strokeType('miter')
7764
- ], exports.UI.prototype, "strokeJoin", void 0);
7771
+ ], exports.UI.prototype, "strokeJoin", undefined);
7765
7772
  __decorate([
7766
7773
  strokeType()
7767
- ], exports.UI.prototype, "dashPattern", void 0);
7774
+ ], exports.UI.prototype, "dashPattern", undefined);
7768
7775
  __decorate([
7769
7776
  strokeType()
7770
- ], exports.UI.prototype, "dashOffset", void 0);
7777
+ ], exports.UI.prototype, "dashOffset", undefined);
7771
7778
  __decorate([
7772
7779
  strokeType(10)
7773
- ], exports.UI.prototype, "miterLimit", void 0);
7780
+ ], exports.UI.prototype, "miterLimit", undefined);
7774
7781
  __decorate([
7775
7782
  pathType(0)
7776
- ], exports.UI.prototype, "cornerRadius", void 0);
7783
+ ], exports.UI.prototype, "cornerRadius", undefined);
7777
7784
  __decorate([
7778
7785
  pathType()
7779
- ], exports.UI.prototype, "cornerSmoothing", void 0);
7786
+ ], exports.UI.prototype, "cornerSmoothing", undefined);
7780
7787
  __decorate([
7781
7788
  effectType()
7782
- ], exports.UI.prototype, "shadow", void 0);
7789
+ ], exports.UI.prototype, "shadow", undefined);
7783
7790
  __decorate([
7784
7791
  effectType()
7785
- ], exports.UI.prototype, "innerShadow", void 0);
7792
+ ], exports.UI.prototype, "innerShadow", undefined);
7786
7793
  __decorate([
7787
7794
  effectType()
7788
- ], exports.UI.prototype, "blur", void 0);
7795
+ ], exports.UI.prototype, "blur", undefined);
7789
7796
  __decorate([
7790
7797
  effectType()
7791
- ], exports.UI.prototype, "backgroundBlur", void 0);
7798
+ ], exports.UI.prototype, "backgroundBlur", undefined);
7792
7799
  __decorate([
7793
7800
  effectType()
7794
- ], exports.UI.prototype, "grayscale", void 0);
7801
+ ], exports.UI.prototype, "grayscale", undefined);
7795
7802
  __decorate([
7796
7803
  dataType({})
7797
- ], exports.UI.prototype, "data", void 0);
7804
+ ], exports.UI.prototype, "data", undefined);
7798
7805
  __decorate([
7799
7806
  rewrite(exports.Leaf.prototype.reset)
7800
7807
  ], exports.UI.prototype, "reset", null);
@@ -7855,7 +7862,7 @@ var LeaferUI = (function (exports) {
7855
7862
  };
7856
7863
  __decorate([
7857
7864
  dataProcessor(GroupData)
7858
- ], exports.Group.prototype, "__", void 0);
7865
+ ], exports.Group.prototype, "__", undefined);
7859
7866
  exports.Group = __decorate([
7860
7867
  useModule(exports.Branch),
7861
7868
  registerUI()
@@ -8026,8 +8033,6 @@ var LeaferUI = (function (exports) {
8026
8033
  __setAttr(attrName, newValue) {
8027
8034
  if (this.canvas) {
8028
8035
  if (canvasSizeAttrs.includes(attrName)) {
8029
- if (!newValue)
8030
- debug$1.warn(attrName + ' is 0');
8031
8036
  this.__changeCanvasSize(attrName, newValue);
8032
8037
  }
8033
8038
  else if (attrName === 'fill') {
@@ -8067,8 +8072,6 @@ var LeaferUI = (function (exports) {
8067
8072
  this.created = true;
8068
8073
  }
8069
8074
  __onReady() {
8070
- if (this.ready)
8071
- return;
8072
8075
  this.ready = true;
8073
8076
  this.emitLeafer(LeaferEvent.BEFORE_READY);
8074
8077
  this.emitLeafer(LeaferEvent.READY);
@@ -8082,6 +8085,20 @@ var LeaferUI = (function (exports) {
8082
8085
  this.emitLeafer(LeaferEvent.VIEW_READY);
8083
8086
  WaitHelper.run(this.__viewReadyWait);
8084
8087
  }
8088
+ __onLayoutEnd() {
8089
+ const { grow, growWidth, growHeight } = this.config;
8090
+ if (grow) {
8091
+ let { width, height, pixelRatio } = this;
8092
+ const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
8093
+ if (growWidth !== false)
8094
+ width = Math.max(1, bounds.x + bounds.width);
8095
+ if (growHeight !== false)
8096
+ height = Math.max(1, bounds.y + bounds.height);
8097
+ this.__doResize({ width, height, pixelRatio });
8098
+ }
8099
+ if (!this.ready)
8100
+ this.__onReady();
8101
+ }
8085
8102
  __onNextRender() {
8086
8103
  if (this.viewReady) {
8087
8104
  WaitHelper.run(this.__nextRenderWait);
@@ -8175,10 +8192,9 @@ var LeaferUI = (function (exports) {
8175
8192
  const runId = Run.start('FirstCreate ' + this.innerName);
8176
8193
  this.once(LeaferEvent.START, () => Run.end(runId));
8177
8194
  this.once(LayoutEvent.START, () => this.updateLazyBounds());
8178
- this.once(LayoutEvent.END, () => this.__onReady());
8179
8195
  this.once(RenderEvent.START, () => this.__onCreated());
8180
8196
  this.once(RenderEvent.END, () => this.__onViewReady());
8181
- this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8197
+ this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8182
8198
  }
8183
8199
  __removeListenEvents() {
8184
8200
  this.off_(this.__eventIds);
@@ -8219,10 +8235,10 @@ var LeaferUI = (function (exports) {
8219
8235
  exports.Leafer.list = new LeafList();
8220
8236
  __decorate([
8221
8237
  dataProcessor(LeaferData)
8222
- ], exports.Leafer.prototype, "__", void 0);
8238
+ ], exports.Leafer.prototype, "__", undefined);
8223
8239
  __decorate([
8224
8240
  boundsType()
8225
- ], exports.Leafer.prototype, "pixelRatio", void 0);
8241
+ ], exports.Leafer.prototype, "pixelRatio", undefined);
8226
8242
  exports.Leafer = Leafer_1 = __decorate([
8227
8243
  registerUI()
8228
8244
  ], exports.Leafer);
@@ -8235,7 +8251,7 @@ var LeaferUI = (function (exports) {
8235
8251
  };
8236
8252
  __decorate([
8237
8253
  dataProcessor(RectData)
8238
- ], exports.Rect.prototype, "__", void 0);
8254
+ ], exports.Rect.prototype, "__", undefined);
8239
8255
  exports.Rect = __decorate([
8240
8256
  useModule(RectRender),
8241
8257
  rewriteAble(),
@@ -8260,6 +8276,8 @@ var LeaferUI = (function (exports) {
8260
8276
  const data = this.__;
8261
8277
  if (this.children.length) {
8262
8278
  if (data.__autoSide) {
8279
+ if (data.__hasSurface)
8280
+ this.__extraUpdate();
8263
8281
  super.__updateBoxBounds();
8264
8282
  const { boxBounds } = this.__layout;
8265
8283
  if (!data.__autoSize) {
@@ -8324,13 +8342,13 @@ var LeaferUI = (function (exports) {
8324
8342
  };
8325
8343
  __decorate([
8326
8344
  dataProcessor(BoxData)
8327
- ], exports.Box.prototype, "__", void 0);
8345
+ ], exports.Box.prototype, "__", undefined);
8328
8346
  __decorate([
8329
8347
  dataType(false)
8330
- ], exports.Box.prototype, "resizeChildren", void 0);
8348
+ ], exports.Box.prototype, "resizeChildren", undefined);
8331
8349
  __decorate([
8332
8350
  affectRenderBoundsType('show')
8333
- ], exports.Box.prototype, "overflow", void 0);
8351
+ ], exports.Box.prototype, "overflow", undefined);
8334
8352
  __decorate([
8335
8353
  rewrite(rect$1.__updateStrokeSpread)
8336
8354
  ], exports.Box.prototype, "__updateStrokeSpread", null);
@@ -8369,13 +8387,13 @@ var LeaferUI = (function (exports) {
8369
8387
  };
8370
8388
  __decorate([
8371
8389
  dataProcessor(FrameData)
8372
- ], exports.Frame.prototype, "__", void 0);
8390
+ ], exports.Frame.prototype, "__", undefined);
8373
8391
  __decorate([
8374
8392
  surfaceType('#FFFFFF')
8375
- ], exports.Frame.prototype, "fill", void 0);
8393
+ ], exports.Frame.prototype, "fill", undefined);
8376
8394
  __decorate([
8377
8395
  affectRenderBoundsType('hide')
8378
- ], exports.Frame.prototype, "overflow", void 0);
8396
+ ], exports.Frame.prototype, "overflow", undefined);
8379
8397
  exports.Frame = __decorate([
8380
8398
  registerUI()
8381
8399
  ], exports.Frame);
@@ -8422,16 +8440,16 @@ var LeaferUI = (function (exports) {
8422
8440
  };
8423
8441
  __decorate([
8424
8442
  dataProcessor(EllipseData)
8425
- ], exports.Ellipse.prototype, "__", void 0);
8443
+ ], exports.Ellipse.prototype, "__", undefined);
8426
8444
  __decorate([
8427
8445
  pathType(0)
8428
- ], exports.Ellipse.prototype, "innerRadius", void 0);
8446
+ ], exports.Ellipse.prototype, "innerRadius", undefined);
8429
8447
  __decorate([
8430
8448
  pathType(0)
8431
- ], exports.Ellipse.prototype, "startAngle", void 0);
8449
+ ], exports.Ellipse.prototype, "startAngle", undefined);
8432
8450
  __decorate([
8433
8451
  pathType(0)
8434
- ], exports.Ellipse.prototype, "endAngle", void 0);
8452
+ ], exports.Ellipse.prototype, "endAngle", undefined);
8435
8453
  exports.Ellipse = __decorate([
8436
8454
  registerUI()
8437
8455
  ], exports.Ellipse);
@@ -8490,22 +8508,22 @@ var LeaferUI = (function (exports) {
8490
8508
  };
8491
8509
  __decorate([
8492
8510
  dataProcessor(LineData)
8493
- ], exports.Line.prototype, "__", void 0);
8511
+ ], exports.Line.prototype, "__", undefined);
8494
8512
  __decorate([
8495
8513
  affectStrokeBoundsType('center')
8496
- ], exports.Line.prototype, "strokeAlign", void 0);
8514
+ ], exports.Line.prototype, "strokeAlign", undefined);
8497
8515
  __decorate([
8498
8516
  boundsType(0)
8499
- ], exports.Line.prototype, "height", void 0);
8517
+ ], exports.Line.prototype, "height", undefined);
8500
8518
  __decorate([
8501
8519
  pathType()
8502
- ], exports.Line.prototype, "points", void 0);
8520
+ ], exports.Line.prototype, "points", undefined);
8503
8521
  __decorate([
8504
8522
  pathType(0)
8505
- ], exports.Line.prototype, "curve", void 0);
8523
+ ], exports.Line.prototype, "curve", undefined);
8506
8524
  __decorate([
8507
8525
  pathType(false)
8508
- ], exports.Line.prototype, "closed", void 0);
8526
+ ], exports.Line.prototype, "closed", undefined);
8509
8527
  exports.Line = __decorate([
8510
8528
  registerUI()
8511
8529
  ], exports.Line);
@@ -8538,16 +8556,16 @@ var LeaferUI = (function (exports) {
8538
8556
  };
8539
8557
  __decorate([
8540
8558
  dataProcessor(PolygonData)
8541
- ], exports.Polygon.prototype, "__", void 0);
8559
+ ], exports.Polygon.prototype, "__", undefined);
8542
8560
  __decorate([
8543
8561
  pathType(3)
8544
- ], exports.Polygon.prototype, "sides", void 0);
8562
+ ], exports.Polygon.prototype, "sides", undefined);
8545
8563
  __decorate([
8546
8564
  pathType()
8547
- ], exports.Polygon.prototype, "points", void 0);
8565
+ ], exports.Polygon.prototype, "points", undefined);
8548
8566
  __decorate([
8549
8567
  pathType(0)
8550
- ], exports.Polygon.prototype, "curve", void 0);
8568
+ ], exports.Polygon.prototype, "curve", undefined);
8551
8569
  __decorate([
8552
8570
  rewrite(line.__updateRenderPath)
8553
8571
  ], exports.Polygon.prototype, "__updateRenderPath", null);
@@ -8579,13 +8597,13 @@ var LeaferUI = (function (exports) {
8579
8597
  };
8580
8598
  __decorate([
8581
8599
  dataProcessor(StarData)
8582
- ], exports.Star.prototype, "__", void 0);
8600
+ ], exports.Star.prototype, "__", undefined);
8583
8601
  __decorate([
8584
8602
  pathType(5)
8585
- ], exports.Star.prototype, "corners", void 0);
8603
+ ], exports.Star.prototype, "corners", undefined);
8586
8604
  __decorate([
8587
8605
  pathType(0.382)
8588
- ], exports.Star.prototype, "innerRadius", void 0);
8606
+ ], exports.Star.prototype, "innerRadius", undefined);
8589
8607
  exports.Star = __decorate([
8590
8608
  registerUI()
8591
8609
  ], exports.Star);
@@ -8607,10 +8625,10 @@ var LeaferUI = (function (exports) {
8607
8625
  };
8608
8626
  __decorate([
8609
8627
  dataProcessor(ImageData)
8610
- ], exports.Image.prototype, "__", void 0);
8628
+ ], exports.Image.prototype, "__", undefined);
8611
8629
  __decorate([
8612
8630
  boundsType('')
8613
- ], exports.Image.prototype, "url", void 0);
8631
+ ], exports.Image.prototype, "url", undefined);
8614
8632
  exports.Image = __decorate([
8615
8633
  registerUI()
8616
8634
  ], exports.Image);
@@ -8673,25 +8691,25 @@ var LeaferUI = (function (exports) {
8673
8691
  };
8674
8692
  __decorate([
8675
8693
  dataProcessor(CanvasData)
8676
- ], exports.Canvas.prototype, "__", void 0);
8694
+ ], exports.Canvas.prototype, "__", undefined);
8677
8695
  __decorate([
8678
8696
  resizeType(100)
8679
- ], exports.Canvas.prototype, "width", void 0);
8697
+ ], exports.Canvas.prototype, "width", undefined);
8680
8698
  __decorate([
8681
8699
  resizeType(100)
8682
- ], exports.Canvas.prototype, "height", void 0);
8700
+ ], exports.Canvas.prototype, "height", undefined);
8683
8701
  __decorate([
8684
8702
  resizeType(1)
8685
- ], exports.Canvas.prototype, "pixelRatio", void 0);
8703
+ ], exports.Canvas.prototype, "pixelRatio", undefined);
8686
8704
  __decorate([
8687
8705
  resizeType(true)
8688
- ], exports.Canvas.prototype, "smooth", void 0);
8706
+ ], exports.Canvas.prototype, "smooth", undefined);
8689
8707
  __decorate([
8690
8708
  dataType(false)
8691
- ], exports.Canvas.prototype, "safeResize", void 0);
8709
+ ], exports.Canvas.prototype, "safeResize", undefined);
8692
8710
  __decorate([
8693
8711
  resizeType()
8694
- ], exports.Canvas.prototype, "contextSettings", void 0);
8712
+ ], exports.Canvas.prototype, "contextSettings", undefined);
8695
8713
  exports.Canvas = __decorate([
8696
8714
  registerUI()
8697
8715
  ], exports.Canvas);
@@ -8782,76 +8800,76 @@ var LeaferUI = (function (exports) {
8782
8800
  };
8783
8801
  __decorate([
8784
8802
  dataProcessor(TextData)
8785
- ], exports.Text.prototype, "__", void 0);
8803
+ ], exports.Text.prototype, "__", undefined);
8786
8804
  __decorate([
8787
8805
  boundsType(0)
8788
- ], exports.Text.prototype, "width", void 0);
8806
+ ], exports.Text.prototype, "width", undefined);
8789
8807
  __decorate([
8790
8808
  boundsType(0)
8791
- ], exports.Text.prototype, "height", void 0);
8809
+ ], exports.Text.prototype, "height", undefined);
8792
8810
  __decorate([
8793
8811
  dataType(false)
8794
- ], exports.Text.prototype, "resizeFontSize", void 0);
8812
+ ], exports.Text.prototype, "resizeFontSize", undefined);
8795
8813
  __decorate([
8796
8814
  surfaceType('#000000')
8797
- ], exports.Text.prototype, "fill", void 0);
8815
+ ], exports.Text.prototype, "fill", undefined);
8798
8816
  __decorate([
8799
8817
  affectStrokeBoundsType('outside')
8800
- ], exports.Text.prototype, "strokeAlign", void 0);
8818
+ ], exports.Text.prototype, "strokeAlign", undefined);
8801
8819
  __decorate([
8802
8820
  hitType('all')
8803
- ], exports.Text.prototype, "hitFill", void 0);
8821
+ ], exports.Text.prototype, "hitFill", undefined);
8804
8822
  __decorate([
8805
8823
  boundsType('')
8806
- ], exports.Text.prototype, "text", void 0);
8824
+ ], exports.Text.prototype, "text", undefined);
8807
8825
  __decorate([
8808
- boundsType('L')
8809
- ], exports.Text.prototype, "fontFamily", void 0);
8826
+ boundsType('caption')
8827
+ ], exports.Text.prototype, "fontFamily", undefined);
8810
8828
  __decorate([
8811
8829
  boundsType(12)
8812
- ], exports.Text.prototype, "fontSize", void 0);
8830
+ ], exports.Text.prototype, "fontSize", undefined);
8813
8831
  __decorate([
8814
8832
  boundsType('normal')
8815
- ], exports.Text.prototype, "fontWeight", void 0);
8833
+ ], exports.Text.prototype, "fontWeight", undefined);
8816
8834
  __decorate([
8817
8835
  boundsType(false)
8818
- ], exports.Text.prototype, "italic", void 0);
8836
+ ], exports.Text.prototype, "italic", undefined);
8819
8837
  __decorate([
8820
8838
  boundsType('none')
8821
- ], exports.Text.prototype, "textCase", void 0);
8839
+ ], exports.Text.prototype, "textCase", undefined);
8822
8840
  __decorate([
8823
8841
  boundsType('none')
8824
- ], exports.Text.prototype, "textDecoration", void 0);
8842
+ ], exports.Text.prototype, "textDecoration", undefined);
8825
8843
  __decorate([
8826
8844
  boundsType(0)
8827
- ], exports.Text.prototype, "letterSpacing", void 0);
8845
+ ], exports.Text.prototype, "letterSpacing", undefined);
8828
8846
  __decorate([
8829
8847
  boundsType({ type: 'percent', value: 1.5 })
8830
- ], exports.Text.prototype, "lineHeight", void 0);
8848
+ ], exports.Text.prototype, "lineHeight", undefined);
8831
8849
  __decorate([
8832
8850
  boundsType(0)
8833
- ], exports.Text.prototype, "paraIndent", void 0);
8851
+ ], exports.Text.prototype, "paraIndent", undefined);
8834
8852
  __decorate([
8835
8853
  boundsType(0)
8836
- ], exports.Text.prototype, "paraSpacing", void 0);
8854
+ ], exports.Text.prototype, "paraSpacing", undefined);
8837
8855
  __decorate([
8838
8856
  boundsType('x')
8839
- ], exports.Text.prototype, "writingMode", void 0);
8857
+ ], exports.Text.prototype, "writingMode", undefined);
8840
8858
  __decorate([
8841
8859
  boundsType('left')
8842
- ], exports.Text.prototype, "textAlign", void 0);
8860
+ ], exports.Text.prototype, "textAlign", undefined);
8843
8861
  __decorate([
8844
8862
  boundsType('top')
8845
- ], exports.Text.prototype, "verticalAlign", void 0);
8863
+ ], exports.Text.prototype, "verticalAlign", undefined);
8846
8864
  __decorate([
8847
8865
  boundsType(true)
8848
- ], exports.Text.prototype, "autoSizeAlign", void 0);
8866
+ ], exports.Text.prototype, "autoSizeAlign", undefined);
8849
8867
  __decorate([
8850
8868
  boundsType('normal')
8851
- ], exports.Text.prototype, "textWrap", void 0);
8869
+ ], exports.Text.prototype, "textWrap", undefined);
8852
8870
  __decorate([
8853
8871
  boundsType('show')
8854
- ], exports.Text.prototype, "textOverflow", void 0);
8872
+ ], exports.Text.prototype, "textOverflow", undefined);
8855
8873
  exports.Text = __decorate([
8856
8874
  registerUI()
8857
8875
  ], exports.Text);
@@ -8864,10 +8882,10 @@ var LeaferUI = (function (exports) {
8864
8882
  };
8865
8883
  __decorate([
8866
8884
  dataProcessor(PathData)
8867
- ], exports.Path.prototype, "__", void 0);
8885
+ ], exports.Path.prototype, "__", undefined);
8868
8886
  __decorate([
8869
8887
  affectStrokeBoundsType('center')
8870
- ], exports.Path.prototype, "strokeAlign", void 0);
8888
+ ], exports.Path.prototype, "strokeAlign", undefined);
8871
8889
  exports.Path = __decorate([
8872
8890
  registerUI()
8873
8891
  ], exports.Path);
@@ -8906,10 +8924,10 @@ var LeaferUI = (function (exports) {
8906
8924
  };
8907
8925
  __decorate([
8908
8926
  dataProcessor(PenData)
8909
- ], exports.Pen.prototype, "__", void 0);
8927
+ ], exports.Pen.prototype, "__", undefined);
8910
8928
  __decorate([
8911
8929
  penPathType()
8912
- ], exports.Pen.prototype, "path", void 0);
8930
+ ], exports.Pen.prototype, "path", undefined);
8913
8931
  exports.Pen = __decorate([
8914
8932
  useModule(PathCreator, ['set', 'path', 'paint']),
8915
8933
  registerUI()
@@ -10094,9 +10112,9 @@ var LeaferUI = (function (exports) {
10094
10112
  }
10095
10113
  return this.__hit(inner);
10096
10114
  };
10097
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
10098
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
10099
- 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); };
10115
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
10116
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
10117
+ leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
10100
10118
  leaf.__drawHitPath = function (canvas) { if (canvas)
10101
10119
  this.__drawRenderPath(canvas); };
10102
10120
 
@@ -11135,7 +11153,7 @@ var LeaferUI = (function (exports) {
11135
11153
  }
11136
11154
  else {
11137
11155
  if (!paint.patternTask) {
11138
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
11156
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
11139
11157
  paint.patternTask = null;
11140
11158
  if (canvas.bounds.hit(ui.__nowWorld))
11141
11159
  createPattern(ui, paint, pixelRatio);
@@ -11291,7 +11309,7 @@ var LeaferUI = (function (exports) {
11291
11309
  const end = shadow.length - 1;
11292
11310
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
11293
11311
  shadow.forEach((item, index) => {
11294
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
11312
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
11295
11313
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
11296
11314
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
11297
11315
  copyBounds = bounds;
@@ -11367,7 +11385,7 @@ var LeaferUI = (function (exports) {
11367
11385
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
11368
11386
  copyBounds = bounds;
11369
11387
  }
11370
- other.fillWorld(copyBounds, item.color, 'source-in');
11388
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
11371
11389
  if (ui.__worldFlipped) {
11372
11390
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
11373
11391
  }
@@ -11729,7 +11747,7 @@ var LeaferUI = (function (exports) {
11729
11747
  rows.forEach(row => {
11730
11748
  if (row.words) {
11731
11749
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
11732
- addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11750
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11733
11751
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
11734
11752
  if (row.isOverflow && !letterSpacing)
11735
11753
  row.textMode = true;
@@ -11751,7 +11769,7 @@ var LeaferUI = (function (exports) {
11751
11769
  else {
11752
11770
  charX = toChar(word.data, charX, row.data, row.isOverflow);
11753
11771
  }
11754
- if (!row.paraEnd && addWordWidth) {
11772
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
11755
11773
  charX += addWordWidth;
11756
11774
  row.width += addWordWidth;
11757
11775
  }
@@ -12140,25 +12158,25 @@ var LeaferUI = (function (exports) {
12140
12158
  };
12141
12159
  __decorate([
12142
12160
  dataProcessor(RobotData)
12143
- ], exports.Robot.prototype, "__", void 0);
12161
+ ], exports.Robot.prototype, "__", undefined);
12144
12162
  __decorate([
12145
12163
  boundsType()
12146
- ], exports.Robot.prototype, "robot", void 0);
12164
+ ], exports.Robot.prototype, "robot", undefined);
12147
12165
  __decorate([
12148
12166
  dataType()
12149
- ], exports.Robot.prototype, "actions", void 0);
12167
+ ], exports.Robot.prototype, "actions", undefined);
12150
12168
  __decorate([
12151
12169
  dataType('')
12152
- ], exports.Robot.prototype, "action", void 0);
12170
+ ], exports.Robot.prototype, "action", undefined);
12153
12171
  __decorate([
12154
12172
  surfaceType(0)
12155
- ], exports.Robot.prototype, "now", void 0);
12173
+ ], exports.Robot.prototype, "now", undefined);
12156
12174
  __decorate([
12157
12175
  dataType(12)
12158
- ], exports.Robot.prototype, "FPS", void 0);
12176
+ ], exports.Robot.prototype, "FPS", undefined);
12159
12177
  __decorate([
12160
12178
  dataType(true)
12161
- ], exports.Robot.prototype, "loop", void 0);
12179
+ ], exports.Robot.prototype, "loop", undefined);
12162
12180
  exports.Robot = __decorate([
12163
12181
  registerUI()
12164
12182
  ], exports.Robot);
@@ -12226,7 +12244,9 @@ var LeaferUI = (function (exports) {
12226
12244
  type = null;
12227
12245
  let transition = type ? getTransition(type, style, leaf) : false;
12228
12246
  const fromStyle = transition ? getFromStyle(leaf, style) : undefined;
12229
- leaf.killAnimate('transition');
12247
+ const nextStyle = State.canAnimate && getStyle(leaf);
12248
+ if (nextStyle)
12249
+ leaf.killAnimate('transition');
12230
12250
  if (normalStyle)
12231
12251
  leaf.set(normalStyle, 'temp');
12232
12252
  const statesStyle = getStyle(leaf);
@@ -12256,7 +12276,8 @@ var LeaferUI = (function (exports) {
12256
12276
  }
12257
12277
  function getStyle(leaf) {
12258
12278
  let exist;
12259
- const style = {}, { state } = leaf, button = findParentButton(leaf);
12279
+ const style = {}, button = findParentButton(leaf);
12280
+ const state = button ? (leaf.state || button.state) : leaf.state;
12260
12281
  const stateStyle = state && leaf.states[state];
12261
12282
  if (stateStyle && State.isState(state, leaf, button))
12262
12283
  exist = assign(style, stateStyle);
@@ -12327,7 +12348,7 @@ var LeaferUI = (function (exports) {
12327
12348
  if (leaf.button)
12328
12349
  setChildrenState(leaf.children, null, stateName);
12329
12350
  }
12330
- function setChildrenState(children, stateType, state) {
12351
+ function setChildrenState(children, stateType, stateName) {
12331
12352
  if (!children)
12332
12353
  return;
12333
12354
  let leaf, update;
@@ -12351,10 +12372,10 @@ var LeaferUI = (function (exports) {
12351
12372
  if (update)
12352
12373
  setPointerState(leaf, stateType);
12353
12374
  }
12354
- else if (state)
12355
- setState(leaf, state);
12375
+ else if (stateName !== undefined)
12376
+ setState(leaf, stateName);
12356
12377
  if (leaf.isBranch)
12357
- setChildrenState(leaf.children, stateType, state);
12378
+ setChildrenState(leaf.children, stateType, stateName);
12358
12379
  }
12359
12380
  }
12360
12381
 
@@ -12370,7 +12391,7 @@ var LeaferUI = (function (exports) {
12370
12391
  if (leaf.button)
12371
12392
  unsetChildrenState(leaf.children, null, stateName);
12372
12393
  }
12373
- function unsetChildrenState(children, stateType, state) {
12394
+ function unsetChildrenState(children, stateType, stateName) {
12374
12395
  if (!children)
12375
12396
  return;
12376
12397
  let leaf;
@@ -12378,10 +12399,10 @@ var LeaferUI = (function (exports) {
12378
12399
  leaf = children[i];
12379
12400
  if (stateType)
12380
12401
  unsetPointerState(leaf, stateType);
12381
- else if (state)
12382
- unsetState(leaf, state);
12402
+ else if (stateName !== undefined)
12403
+ unsetState(leaf, stateName);
12383
12404
  if (leaf.isBranch)
12384
- unsetChildrenState(leaf.children, stateType, state);
12405
+ unsetChildrenState(leaf.children, stateType, stateName);
12385
12406
  }
12386
12407
  }
12387
12408
 
@@ -12599,8 +12620,11 @@ var LeaferUI = (function (exports) {
12599
12620
  return decorateLeafAttr(defaultValue, (key) => attr({
12600
12621
  set(value) {
12601
12622
  this.__setAttr(key, value);
12602
- if (this.leafer)
12603
- value ? this.animate(value, undefined, 'animation') : this.killAnimate('animation');
12623
+ if (this.leafer) {
12624
+ this.killAnimate('animation');
12625
+ if (value)
12626
+ this.animate(value, undefined, 'animation');
12627
+ }
12604
12628
  }
12605
12629
  }));
12606
12630
  }
@@ -12637,22 +12661,29 @@ var LeaferUI = (function (exports) {
12637
12661
  get completed() { return this.time >= this.duration && !this.started; }
12638
12662
  get frame() { return this.frames[this.nowIndex]; }
12639
12663
  get frameTotalTime() { return this.frame.totalTime || this.frame.duration || 0; }
12664
+ get nowReverse() { return (this.mainReverse ? 1 : 0) + (this.frameReverse ? 1 : 0) === 1; }
12640
12665
  get realEnding() {
12641
12666
  let count;
12642
- const { ending, reverse, loop } = this;
12667
+ const { ending, reverse, swing, loop } = this;
12643
12668
  if (ending === 'from')
12644
12669
  count = 0;
12645
12670
  else if (ending === 'to')
12646
12671
  count = 1;
12647
12672
  else {
12648
12673
  count = reverse ? 0 : 1;
12649
- if (loop && typeof loop === 'number')
12674
+ if (swing && loop && typeof loop === 'number')
12650
12675
  count += loop - 1;
12651
12676
  }
12652
12677
  return count % 2 ? 'to' : 'from';
12653
12678
  }
12654
12679
  constructor(target, keyframe, options, isTemp) {
12655
12680
  super();
12681
+ if (keyframe) {
12682
+ if (keyframe.keyframes)
12683
+ options = keyframe, keyframe = keyframe.keyframes;
12684
+ else if (keyframe.style)
12685
+ options = keyframe, keyframe = keyframe.style;
12686
+ }
12656
12687
  this.init(target, keyframe, options, isTemp);
12657
12688
  }
12658
12689
  init(target, keyframe, options, isTemp) {
@@ -12668,16 +12699,14 @@ var LeaferUI = (function (exports) {
12668
12699
  break;
12669
12700
  case 'object': this.config = options, options.event && (this.event = options.event);
12670
12701
  }
12671
- if (!keyframe)
12672
- return;
12673
- this.keyframes = keyframe instanceof Array ? keyframe : [keyframe];
12702
+ this.keyframes = keyframe instanceof Array ? keyframe : (keyframe ? [keyframe] : []);
12674
12703
  const { easing, attrs } = this;
12675
12704
  this.easingFn = AnimateEasing.get(easing);
12676
12705
  if (attrs || this.attrsMap)
12677
12706
  this.attrsMap = attrs ? attrs.reduce((map, value) => { map[value] = true; return map; }, {}) : undefined;
12678
12707
  this.frames = [];
12679
12708
  this.create();
12680
- if (this.autoplay)
12709
+ if (this.autoplay && this.frames.length)
12681
12710
  this.timer = setTimeout(() => {
12682
12711
  this.timer = 0;
12683
12712
  this.play();
@@ -12726,7 +12755,7 @@ var LeaferUI = (function (exports) {
12726
12755
  }
12727
12756
  create() {
12728
12757
  const { target, frames, keyframes, config } = this, { length } = keyframes, joinBefore = length > 1 ? this.join : true;
12729
- let addedDuration = 0, totalAutoDuration = 0, before, keyframe, item, style;
12758
+ let totalTime = 0, totalAutoTime = 0, before, keyframe, item, style, times;
12730
12759
  if (length > 1)
12731
12760
  this.fromStyle = {}, this.toStyle = {};
12732
12761
  for (let i = 0; i < length; i++) {
@@ -12735,27 +12764,32 @@ var LeaferUI = (function (exports) {
12735
12764
  if (!before)
12736
12765
  before = joinBefore ? target : style;
12737
12766
  item = { style, beforeStyle: {} };
12767
+ times = 1;
12738
12768
  if (keyframe.style) {
12739
- const { duration, autoDuration, delay, autoDelay, easing } = keyframe;
12769
+ const { duration, autoDuration, delay, autoDelay, easing, swing, loop } = keyframe;
12770
+ if (swing)
12771
+ item.swing = typeof swing === 'number' ? swing : 2, times = item.swing * 2 - 1;
12772
+ if (loop)
12773
+ item.loop = times = typeof loop === 'number' ? loop : 2;
12740
12774
  if (duration) {
12741
- item.duration = duration, addedDuration += duration;
12775
+ item.duration = duration, totalTime += duration * times;
12742
12776
  if (delay)
12743
12777
  item.totalTime = duration + delay;
12744
12778
  }
12745
12779
  else {
12746
12780
  if (autoDuration)
12747
- item.autoDuration = autoDuration, totalAutoDuration += autoDuration;
12781
+ item.autoDuration = autoDuration, totalAutoTime += autoDuration * times;
12748
12782
  }
12749
12783
  if (delay)
12750
- item.delay = delay, addedDuration += delay;
12784
+ item.delay = delay, totalTime += delay * times;
12751
12785
  else if (autoDelay)
12752
- item.autoDelay = autoDelay, totalAutoDuration += autoDelay;
12786
+ item.autoDelay = autoDelay, totalAutoTime += autoDelay * times;
12753
12787
  if (easing)
12754
12788
  item.easingFn = AnimateEasing.get(easing);
12755
12789
  }
12756
12790
  if (!item.autoDuration && item.duration === undefined) {
12757
12791
  if (length > 1)
12758
- (i > 0 || joinBefore) ? totalAutoDuration++ : item.duration = 0;
12792
+ (i > 0 || joinBefore) ? totalAutoTime += times : item.duration = 0;
12759
12793
  else
12760
12794
  item.duration = this.duration;
12761
12795
  }
@@ -12771,14 +12805,14 @@ var LeaferUI = (function (exports) {
12771
12805
  before = style;
12772
12806
  frames.push(item);
12773
12807
  }
12774
- if (totalAutoDuration) {
12775
- if (this.duration <= addedDuration || !(config && config.duration))
12776
- this.changeDuration(addedDuration + frameDuration * totalAutoDuration);
12777
- this.allocateTime((this.duration - addedDuration) / totalAutoDuration);
12808
+ if (totalAutoTime) {
12809
+ if (this.duration <= totalTime || !(config && config.duration))
12810
+ this.changeDuration(totalTime + frameDuration * totalAutoTime);
12811
+ this.allocateTime((this.duration - totalTime) / totalAutoTime);
12778
12812
  }
12779
12813
  else {
12780
- if (addedDuration)
12781
- this.changeDuration(addedDuration);
12814
+ if (totalTime)
12815
+ this.changeDuration(totalTime);
12782
12816
  }
12783
12817
  this.emit(AnimateEvent.CREATED, this);
12784
12818
  }
@@ -12805,7 +12839,7 @@ var LeaferUI = (function (exports) {
12805
12839
  if (frame.autoDelay)
12806
12840
  frame.delay = frame.autoDelay * partTime;
12807
12841
  if (frame.delay)
12808
- frame.totalTime = frame.duration, frame.totalTime += frame.delay;
12842
+ frame.totalTime = frame.duration + frame.delay;
12809
12843
  }
12810
12844
  }
12811
12845
  }
@@ -12823,7 +12857,7 @@ var LeaferUI = (function (exports) {
12823
12857
  if (realTime < duration) {
12824
12858
  while (realTime - this.playedTotalTime > this.frameTotalTime) {
12825
12859
  this.transition(1);
12826
- this.nowReverse ? this.reverseNextFrame() : this.nextFrame();
12860
+ this.mainReverse ? this.reverseNextFrame() : this.nextFrame();
12827
12861
  }
12828
12862
  const itemDelay = this.nowReverse ? 0 : (this.frame.delay || 0);
12829
12863
  const itemPlayedTime = realTime - this.playedTotalTime - itemDelay;
@@ -12847,9 +12881,9 @@ var LeaferUI = (function (exports) {
12847
12881
  const { loop, loopDelay, swing } = this;
12848
12882
  if (loop !== false || swing) {
12849
12883
  this.looped ? this.looped++ : this.looped = 1;
12850
- if (!(typeof loop === 'number' && (!loop || this.looped >= loop))) {
12884
+ if (this.needLoop(this.looped, loop, swing)) {
12851
12885
  if (swing)
12852
- this.nowReverse = !this.nowReverse;
12886
+ this.mainReverse = !this.mainReverse;
12853
12887
  if (loopDelay)
12854
12888
  this.timer = setTimeout(() => { this.timer = 0, this.begin(); }, loopDelay / this.speed * 1000);
12855
12889
  else
@@ -12864,8 +12898,8 @@ var LeaferUI = (function (exports) {
12864
12898
  start(seek) {
12865
12899
  this.requestAnimateTime = 1;
12866
12900
  const { reverse } = this;
12867
- if (reverse || this.nowReverse)
12868
- this.nowReverse = reverse;
12901
+ if (reverse || this.mainReverse)
12902
+ this.mainReverse = reverse;
12869
12903
  if (this.looped)
12870
12904
  this.looped = 0;
12871
12905
  if (seek)
@@ -12883,12 +12917,12 @@ var LeaferUI = (function (exports) {
12883
12917
  }
12884
12918
  begin(seek) {
12885
12919
  this.playedTotalTime = this.time = 0;
12886
- this.nowReverse ? this.setTo() : this.setFrom();
12920
+ this.mainReverse ? this.setTo() : this.setFrom();
12887
12921
  if (!seek)
12888
12922
  this.requestAnimate();
12889
12923
  }
12890
12924
  end() {
12891
- this.nowReverse ? this.setFrom() : this.setTo();
12925
+ this.mainReverse ? this.setFrom() : this.setTo();
12892
12926
  }
12893
12927
  complete() {
12894
12928
  this.requestAnimateTime = 0;
@@ -12911,15 +12945,19 @@ var LeaferUI = (function (exports) {
12911
12945
  this.setStyle(this.toStyle);
12912
12946
  }
12913
12947
  nextFrame() {
12948
+ if (this.needLoopFrame())
12949
+ return this.increaseTime();
12914
12950
  if (this.nowIndex + 1 >= this.frames.length)
12915
12951
  return;
12916
- this.playedTotalTime += this.frameTotalTime;
12952
+ this.increaseTime();
12917
12953
  this.nowIndex++;
12918
12954
  }
12919
12955
  reverseNextFrame() {
12956
+ if (this.needLoopFrame())
12957
+ return this.increaseTime();
12920
12958
  if (this.nowIndex - 1 < 0)
12921
12959
  return;
12922
- this.playedTotalTime += this.frameTotalTime;
12960
+ this.increaseTime();
12923
12961
  this.nowIndex--;
12924
12962
  }
12925
12963
  transition(t) {
@@ -12955,6 +12993,27 @@ var LeaferUI = (function (exports) {
12955
12993
  target.__ ? target.set(style, this.isTemp ? 'temp' : false) : Object.assign(target, style);
12956
12994
  }
12957
12995
  }
12996
+ increaseTime() {
12997
+ this.playedTotalTime += this.frameTotalTime;
12998
+ }
12999
+ needLoop(looped, loop, swing) {
13000
+ return !(this.needStopLoop(looped, loop) || this.needStopLoop(looped, swing, true));
13001
+ }
13002
+ needStopLoop(looped, times, swing) {
13003
+ return typeof times === 'number' && (!times || looped >= (swing ? times * 2 - 1 : times));
13004
+ }
13005
+ needLoopFrame() {
13006
+ const { loop, swing } = this.frame;
13007
+ if (loop || swing) {
13008
+ this.frameLooped ? this.frameLooped++ : this.frameLooped = 1;
13009
+ if (swing)
13010
+ this.frameReverse = !this.frameReverse;
13011
+ if (this.needLoop(this.frameLooped, loop, swing))
13012
+ return true;
13013
+ this.frameLooped = this.frameReverse = undefined;
13014
+ }
13015
+ return false;
13016
+ }
12958
13017
  clearTimer(fn) {
12959
13018
  if (this.timer) {
12960
13019
  clearTimeout(this.timer), this.timer = 0;
@@ -12976,44 +13035,102 @@ var LeaferUI = (function (exports) {
12976
13035
  };
12977
13036
  __decorate([
12978
13037
  animateAttr('ease')
12979
- ], exports.Animate.prototype, "easing", void 0);
13038
+ ], exports.Animate.prototype, "easing", undefined);
12980
13039
  __decorate([
12981
13040
  animateAttr(0)
12982
- ], exports.Animate.prototype, "delay", void 0);
13041
+ ], exports.Animate.prototype, "delay", undefined);
12983
13042
  __decorate([
12984
13043
  animateAttr(frameDuration)
12985
- ], exports.Animate.prototype, "duration", void 0);
13044
+ ], exports.Animate.prototype, "duration", undefined);
12986
13045
  __decorate([
12987
13046
  animateAttr('auto')
12988
- ], exports.Animate.prototype, "ending", void 0);
13047
+ ], exports.Animate.prototype, "ending", undefined);
12989
13048
  __decorate([
12990
13049
  animateAttr(false)
12991
- ], exports.Animate.prototype, "reverse", void 0);
13050
+ ], exports.Animate.prototype, "reverse", undefined);
12992
13051
  __decorate([
12993
13052
  animateAttr(false)
12994
- ], exports.Animate.prototype, "swing", void 0);
13053
+ ], exports.Animate.prototype, "swing", undefined);
12995
13054
  __decorate([
12996
13055
  animateAttr(false)
12997
- ], exports.Animate.prototype, "loop", void 0);
13056
+ ], exports.Animate.prototype, "loop", undefined);
12998
13057
  __decorate([
12999
13058
  animateAttr(0)
13000
- ], exports.Animate.prototype, "loopDelay", void 0);
13059
+ ], exports.Animate.prototype, "loopDelay", undefined);
13001
13060
  __decorate([
13002
13061
  animateAttr(1)
13003
- ], exports.Animate.prototype, "speed", void 0);
13062
+ ], exports.Animate.prototype, "speed", undefined);
13004
13063
  __decorate([
13005
13064
  animateAttr(true)
13006
- ], exports.Animate.prototype, "autoplay", void 0);
13065
+ ], exports.Animate.prototype, "autoplay", undefined);
13007
13066
  __decorate([
13008
13067
  animateAttr()
13009
- ], exports.Animate.prototype, "join", void 0);
13068
+ ], exports.Animate.prototype, "join", undefined);
13010
13069
  __decorate([
13011
13070
  animateAttr()
13012
- ], exports.Animate.prototype, "attrs", void 0);
13071
+ ], exports.Animate.prototype, "attrs", undefined);
13013
13072
  exports.Animate = __decorate([
13014
13073
  useModule(LeafEventer)
13015
13074
  ], exports.Animate);
13016
13075
 
13076
+ exports.AnimateList = class AnimateList extends exports.Animate {
13077
+ get completed() { return this.list.every(item => item.completed); }
13078
+ get endingStyle() { return this._endingStyle; }
13079
+ constructor(target, animation, isTemp) {
13080
+ super(target, null);
13081
+ this.list = [];
13082
+ this.updateList(animation, isTemp);
13083
+ }
13084
+ updateList(animation, isTemp) {
13085
+ this.fromStyle = {};
13086
+ this.toStyle = {};
13087
+ this._endingStyle = {};
13088
+ if (!animation)
13089
+ animation = this.list.filter(item => {
13090
+ const { completed } = item;
13091
+ if (completed)
13092
+ item.destroy();
13093
+ return !completed;
13094
+ });
13095
+ this.list = animation.map(item => {
13096
+ const animate = item.target ? item : new exports.Animate(this.target, item, isTemp);
13097
+ Object.assign(this.fromStyle, animate.fromStyle);
13098
+ Object.assign(this.toStyle, animate.toStyle);
13099
+ Object.assign(this._endingStyle, animate.endingStyle);
13100
+ return animate;
13101
+ });
13102
+ }
13103
+ play() {
13104
+ this.each(item => item.play());
13105
+ }
13106
+ pause() {
13107
+ this.each(item => item.pause());
13108
+ }
13109
+ stop() {
13110
+ this.each(item => item.stop());
13111
+ }
13112
+ seek(time) {
13113
+ this.each(item => item.seek(time));
13114
+ }
13115
+ kill(complete, killStyle) {
13116
+ this.each(item => item.kill(complete, killStyle));
13117
+ this.destroy();
13118
+ }
13119
+ each(func) {
13120
+ this.list.forEach(func);
13121
+ }
13122
+ destroy(complete) {
13123
+ const { list } = this;
13124
+ if (list.length) {
13125
+ this.each(item => item.destroy(complete));
13126
+ list.length = 0;
13127
+ }
13128
+ }
13129
+ };
13130
+ exports.AnimateList = __decorate([
13131
+ useModule(LeafEventer)
13132
+ ], exports.AnimateList);
13133
+
13017
13134
  const colorNames = {
13018
13135
  transparent: 'FFF0',
13019
13136
  aliceblue: 'F0F8FF',
@@ -13350,7 +13467,8 @@ var LeaferUI = (function (exports) {
13350
13467
  return decimal ? decimal.length : 0;
13351
13468
  }
13352
13469
  function value(from, to, t) {
13353
- return (typeof from === 'number' && typeof to === 'number') ? from + (to - from) * t : to;
13470
+ const fromIsNumber = typeof from === 'number', toIsNumber = typeof to === 'number';
13471
+ return (fromIsNumber && toIsNumber) ? from + (to - from) * t : ((toIsNumber || fromIsNumber) ? number(from, to, t) : from);
13354
13472
  }
13355
13473
  function number(from, to, t, roundValue) {
13356
13474
  from || (from = 0), to || (to = 0);
@@ -13394,23 +13512,40 @@ var LeaferUI = (function (exports) {
13394
13512
  ui$2.animate = function (keyframe, options, kill, isTemp) {
13395
13513
  if (keyframe === undefined)
13396
13514
  return this.__animate;
13397
- if (typeof keyframe === 'object') {
13398
- if (keyframe.keyframes)
13399
- options = keyframe, keyframe = keyframe.keyframes;
13400
- else if (keyframe.style)
13401
- options = keyframe, keyframe = keyframe.style;
13402
- }
13403
- const animate = new exports.Animate(this, keyframe, options, isTemp);
13404
- this.killAnimate(kill, animate.toStyle);
13405
- return this.__animate = animate;
13515
+ const isAnimationList = keyframe instanceof Array && !options && kill;
13516
+ let nextAnimate = isAnimationList ? new exports.AnimateList(this, keyframe, isTemp) : new exports.Animate(this, keyframe, options, isTemp);
13517
+ this.killAnimate(kill, nextAnimate.toStyle);
13518
+ const animate = this.__animate;
13519
+ if (animate) {
13520
+ if (nextAnimate instanceof exports.AnimateList)
13521
+ nextAnimate.list.unshift(animate);
13522
+ else
13523
+ nextAnimate = new exports.AnimateList(this, [animate, nextAnimate]);
13524
+ }
13525
+ return this.__animate = nextAnimate;
13406
13526
  };
13407
- ui$2.killAnimate = function (_type, killStyle) {
13527
+ ui$2.killAnimate = function (_type, nextStyle) {
13408
13528
  const animate = this.__animate;
13409
- if (animate)
13410
- animate.kill(true, killStyle), this.__animate = null;
13529
+ if (animate) {
13530
+ let kill = false;
13531
+ if (nextStyle && !animate.completed) {
13532
+ if (animate instanceof exports.AnimateList)
13533
+ animate.updateList();
13534
+ const { toStyle } = animate;
13535
+ for (let key in nextStyle)
13536
+ if (key in toStyle) {
13537
+ kill = true;
13538
+ break;
13539
+ }
13540
+ }
13541
+ else
13542
+ kill = true;
13543
+ if (kill)
13544
+ animate.kill(true, nextStyle), this.__animate = null;
13545
+ }
13411
13546
  };
13412
13547
  ui$2.__runAnimation = function (type, complete) {
13413
- this.animate(type === 'in' ? this.animation : this.animationOut);
13548
+ this.animate(type === 'in' ? this.animation : this.animationOut, undefined, 'animation');
13414
13549
  if (complete)
13415
13550
  this.__animate.on(AnimateEvent.COMPLETED, complete);
13416
13551
  };
@@ -13704,12 +13839,12 @@ var LeaferUI = (function (exports) {
13704
13839
  data.__pathForMotion = undefined;
13705
13840
  if (this.motionPath) {
13706
13841
  let child;
13707
- const { children } = this.parent, { leaferIsReady } = this;
13842
+ const { children } = this.parent;
13708
13843
  for (let i = 0; i < children.length; i++) {
13709
13844
  child = children[i];
13710
13845
  if (!isNull(child.motion) && !child.__layout.matrixChanged) {
13711
- if (leaferIsReady && child !== this)
13712
- this.leafer.layouter.addExtra(child);
13846
+ if (child !== this)
13847
+ child.__extraUpdate();
13713
13848
  updateMotion(child);
13714
13849
  }
13715
13850
  }