@leafer-draw/worker 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(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(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 true; }
@@ -6352,7 +6355,7 @@ class Layouter {
6352
6355
  }
6353
6356
  partLayout() {
6354
6357
  var _a;
6355
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6358
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6356
6359
  return;
6357
6360
  const t = Run.start('PartLayout');
6358
6361
  const { target, __updatedList: updateList } = this;
@@ -6539,7 +6542,7 @@ class Renderer {
6539
6542
  partRender() {
6540
6543
  const { canvas, updateBlocks: list } = this;
6541
6544
  if (!list)
6542
- return debug$2.warn('PartRender: need update attr');
6545
+ return;
6543
6546
  this.mergeBlocks();
6544
6547
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6545
6548
  this.clipRender(block); });
@@ -6767,6 +6770,7 @@ class UIData extends LeafData {
6767
6770
  return t.fill && this.__hasStroke;
6768
6771
  }
6769
6772
  get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
6773
+ get __hasSurface() { const t = this; return (t.fill || t.stroke); }
6770
6774
  get __autoWidth() { return !this._width; }
6771
6775
  get __autoHeight() { return !this._height; }
6772
6776
  get __autoSide() { return !this._width || !this._height; }
@@ -7239,7 +7243,7 @@ let UI = UI_1 = class UI extends Leaf {
7239
7243
  animate(_keyframe, _options, _type, _isTemp) {
7240
7244
  return Plugin.need('animate');
7241
7245
  }
7242
- killAnimate(_type, _killStyle) { }
7246
+ killAnimate(_type, _nextStyle) { }
7243
7247
  export(_filename, _options) {
7244
7248
  return Plugin.need('export');
7245
7249
  }
@@ -7270,199 +7274,199 @@ let UI = UI_1 = class UI extends Leaf {
7270
7274
  };
7271
7275
  __decorate([
7272
7276
  dataProcessor(UIData)
7273
- ], UI.prototype, "__", void 0);
7277
+ ], UI.prototype, "__", undefined);
7274
7278
  __decorate([
7275
7279
  zoomLayerType()
7276
- ], UI.prototype, "zoomLayer", void 0);
7280
+ ], UI.prototype, "zoomLayer", undefined);
7277
7281
  __decorate([
7278
7282
  dataType('')
7279
- ], UI.prototype, "id", void 0);
7283
+ ], UI.prototype, "id", undefined);
7280
7284
  __decorate([
7281
7285
  dataType('')
7282
- ], UI.prototype, "name", void 0);
7286
+ ], UI.prototype, "name", undefined);
7283
7287
  __decorate([
7284
7288
  dataType('')
7285
- ], UI.prototype, "className", void 0);
7289
+ ], UI.prototype, "className", undefined);
7286
7290
  __decorate([
7287
7291
  surfaceType('pass-through')
7288
- ], UI.prototype, "blendMode", void 0);
7292
+ ], UI.prototype, "blendMode", undefined);
7289
7293
  __decorate([
7290
7294
  opacityType(1)
7291
- ], UI.prototype, "opacity", void 0);
7295
+ ], UI.prototype, "opacity", undefined);
7292
7296
  __decorate([
7293
7297
  visibleType(true)
7294
- ], UI.prototype, "visible", void 0);
7298
+ ], UI.prototype, "visible", undefined);
7295
7299
  __decorate([
7296
7300
  surfaceType(false)
7297
- ], UI.prototype, "locked", void 0);
7301
+ ], UI.prototype, "locked", undefined);
7298
7302
  __decorate([
7299
7303
  sortType(0)
7300
- ], UI.prototype, "zIndex", void 0);
7304
+ ], UI.prototype, "zIndex", undefined);
7301
7305
  __decorate([
7302
7306
  maskType(false)
7303
- ], UI.prototype, "mask", void 0);
7307
+ ], UI.prototype, "mask", undefined);
7304
7308
  __decorate([
7305
7309
  eraserType(false)
7306
- ], UI.prototype, "eraser", void 0);
7310
+ ], UI.prototype, "eraser", undefined);
7307
7311
  __decorate([
7308
7312
  positionType(0, true)
7309
- ], UI.prototype, "x", void 0);
7313
+ ], UI.prototype, "x", undefined);
7310
7314
  __decorate([
7311
7315
  positionType(0, true)
7312
- ], UI.prototype, "y", void 0);
7316
+ ], UI.prototype, "y", undefined);
7313
7317
  __decorate([
7314
7318
  boundsType(100, true)
7315
- ], UI.prototype, "width", void 0);
7319
+ ], UI.prototype, "width", undefined);
7316
7320
  __decorate([
7317
7321
  boundsType(100, true)
7318
- ], UI.prototype, "height", void 0);
7322
+ ], UI.prototype, "height", undefined);
7319
7323
  __decorate([
7320
7324
  scaleType(1, true)
7321
- ], UI.prototype, "scaleX", void 0);
7325
+ ], UI.prototype, "scaleX", undefined);
7322
7326
  __decorate([
7323
7327
  scaleType(1, true)
7324
- ], UI.prototype, "scaleY", void 0);
7328
+ ], UI.prototype, "scaleY", undefined);
7325
7329
  __decorate([
7326
7330
  rotationType(0, true)
7327
- ], UI.prototype, "rotation", void 0);
7331
+ ], UI.prototype, "rotation", undefined);
7328
7332
  __decorate([
7329
7333
  rotationType(0, true)
7330
- ], UI.prototype, "skewX", void 0);
7334
+ ], UI.prototype, "skewX", undefined);
7331
7335
  __decorate([
7332
7336
  rotationType(0, true)
7333
- ], UI.prototype, "skewY", void 0);
7337
+ ], UI.prototype, "skewY", undefined);
7334
7338
  __decorate([
7335
7339
  positionType(0, true)
7336
- ], UI.prototype, "offsetX", void 0);
7340
+ ], UI.prototype, "offsetX", undefined);
7337
7341
  __decorate([
7338
7342
  positionType(0, true)
7339
- ], UI.prototype, "offsetY", void 0);
7343
+ ], UI.prototype, "offsetY", undefined);
7340
7344
  __decorate([
7341
7345
  positionType(0, true)
7342
- ], UI.prototype, "scrollX", void 0);
7346
+ ], UI.prototype, "scrollX", undefined);
7343
7347
  __decorate([
7344
7348
  positionType(0, true)
7345
- ], UI.prototype, "scrollY", void 0);
7349
+ ], UI.prototype, "scrollY", undefined);
7346
7350
  __decorate([
7347
7351
  autoLayoutType()
7348
- ], UI.prototype, "origin", void 0);
7352
+ ], UI.prototype, "origin", undefined);
7349
7353
  __decorate([
7350
7354
  autoLayoutType()
7351
- ], UI.prototype, "around", void 0);
7355
+ ], UI.prototype, "around", undefined);
7352
7356
  __decorate([
7353
7357
  dataType(false)
7354
- ], UI.prototype, "lazy", void 0);
7358
+ ], UI.prototype, "lazy", undefined);
7355
7359
  __decorate([
7356
7360
  naturalBoundsType(1)
7357
- ], UI.prototype, "pixelRatio", void 0);
7361
+ ], UI.prototype, "pixelRatio", undefined);
7358
7362
  __decorate([
7359
7363
  pathInputType()
7360
- ], UI.prototype, "path", void 0);
7364
+ ], UI.prototype, "path", undefined);
7361
7365
  __decorate([
7362
7366
  pathType()
7363
- ], UI.prototype, "windingRule", void 0);
7367
+ ], UI.prototype, "windingRule", undefined);
7364
7368
  __decorate([
7365
7369
  pathType(true)
7366
- ], UI.prototype, "closed", void 0);
7370
+ ], UI.prototype, "closed", undefined);
7367
7371
  __decorate([
7368
7372
  boundsType(0)
7369
- ], UI.prototype, "padding", void 0);
7373
+ ], UI.prototype, "padding", undefined);
7370
7374
  __decorate([
7371
7375
  boundsType(false)
7372
- ], UI.prototype, "lockRatio", void 0);
7376
+ ], UI.prototype, "lockRatio", undefined);
7373
7377
  __decorate([
7374
7378
  boundsType()
7375
- ], UI.prototype, "widthRange", void 0);
7379
+ ], UI.prototype, "widthRange", undefined);
7376
7380
  __decorate([
7377
7381
  boundsType()
7378
- ], UI.prototype, "heightRange", void 0);
7382
+ ], UI.prototype, "heightRange", undefined);
7379
7383
  __decorate([
7380
7384
  dataType(false)
7381
- ], UI.prototype, "draggable", void 0);
7385
+ ], UI.prototype, "draggable", undefined);
7382
7386
  __decorate([
7383
7387
  dataType()
7384
- ], UI.prototype, "dragBounds", void 0);
7388
+ ], UI.prototype, "dragBounds", undefined);
7385
7389
  __decorate([
7386
7390
  dataType(false)
7387
- ], UI.prototype, "editable", void 0);
7391
+ ], UI.prototype, "editable", undefined);
7388
7392
  __decorate([
7389
7393
  hitType(true)
7390
- ], UI.prototype, "hittable", void 0);
7394
+ ], UI.prototype, "hittable", undefined);
7391
7395
  __decorate([
7392
7396
  hitType('path')
7393
- ], UI.prototype, "hitFill", void 0);
7397
+ ], UI.prototype, "hitFill", undefined);
7394
7398
  __decorate([
7395
7399
  strokeType('path')
7396
- ], UI.prototype, "hitStroke", void 0);
7400
+ ], UI.prototype, "hitStroke", undefined);
7397
7401
  __decorate([
7398
7402
  hitType(false)
7399
- ], UI.prototype, "hitBox", void 0);
7403
+ ], UI.prototype, "hitBox", undefined);
7400
7404
  __decorate([
7401
7405
  hitType(true)
7402
- ], UI.prototype, "hitChildren", void 0);
7406
+ ], UI.prototype, "hitChildren", undefined);
7403
7407
  __decorate([
7404
7408
  hitType(true)
7405
- ], UI.prototype, "hitSelf", void 0);
7409
+ ], UI.prototype, "hitSelf", undefined);
7406
7410
  __decorate([
7407
7411
  hitType()
7408
- ], UI.prototype, "hitRadius", void 0);
7412
+ ], UI.prototype, "hitRadius", undefined);
7409
7413
  __decorate([
7410
7414
  cursorType('')
7411
- ], UI.prototype, "cursor", void 0);
7415
+ ], UI.prototype, "cursor", undefined);
7412
7416
  __decorate([
7413
7417
  surfaceType()
7414
- ], UI.prototype, "fill", void 0);
7418
+ ], UI.prototype, "fill", undefined);
7415
7419
  __decorate([
7416
7420
  strokeType()
7417
- ], UI.prototype, "stroke", void 0);
7421
+ ], UI.prototype, "stroke", undefined);
7418
7422
  __decorate([
7419
7423
  strokeType('inside')
7420
- ], UI.prototype, "strokeAlign", void 0);
7424
+ ], UI.prototype, "strokeAlign", undefined);
7421
7425
  __decorate([
7422
7426
  strokeType(1)
7423
- ], UI.prototype, "strokeWidth", void 0);
7427
+ ], UI.prototype, "strokeWidth", undefined);
7424
7428
  __decorate([
7425
7429
  strokeType(false)
7426
- ], UI.prototype, "strokeWidthFixed", void 0);
7430
+ ], UI.prototype, "strokeWidthFixed", undefined);
7427
7431
  __decorate([
7428
7432
  strokeType('none')
7429
- ], UI.prototype, "strokeCap", void 0);
7433
+ ], UI.prototype, "strokeCap", undefined);
7430
7434
  __decorate([
7431
7435
  strokeType('miter')
7432
- ], UI.prototype, "strokeJoin", void 0);
7436
+ ], UI.prototype, "strokeJoin", undefined);
7433
7437
  __decorate([
7434
7438
  strokeType()
7435
- ], UI.prototype, "dashPattern", void 0);
7439
+ ], UI.prototype, "dashPattern", undefined);
7436
7440
  __decorate([
7437
7441
  strokeType()
7438
- ], UI.prototype, "dashOffset", void 0);
7442
+ ], UI.prototype, "dashOffset", undefined);
7439
7443
  __decorate([
7440
7444
  strokeType(10)
7441
- ], UI.prototype, "miterLimit", void 0);
7445
+ ], UI.prototype, "miterLimit", undefined);
7442
7446
  __decorate([
7443
7447
  pathType(0)
7444
- ], UI.prototype, "cornerRadius", void 0);
7448
+ ], UI.prototype, "cornerRadius", undefined);
7445
7449
  __decorate([
7446
7450
  pathType()
7447
- ], UI.prototype, "cornerSmoothing", void 0);
7451
+ ], UI.prototype, "cornerSmoothing", undefined);
7448
7452
  __decorate([
7449
7453
  effectType()
7450
- ], UI.prototype, "shadow", void 0);
7454
+ ], UI.prototype, "shadow", undefined);
7451
7455
  __decorate([
7452
7456
  effectType()
7453
- ], UI.prototype, "innerShadow", void 0);
7457
+ ], UI.prototype, "innerShadow", undefined);
7454
7458
  __decorate([
7455
7459
  effectType()
7456
- ], UI.prototype, "blur", void 0);
7460
+ ], UI.prototype, "blur", undefined);
7457
7461
  __decorate([
7458
7462
  effectType()
7459
- ], UI.prototype, "backgroundBlur", void 0);
7463
+ ], UI.prototype, "backgroundBlur", undefined);
7460
7464
  __decorate([
7461
7465
  effectType()
7462
- ], UI.prototype, "grayscale", void 0);
7466
+ ], UI.prototype, "grayscale", undefined);
7463
7467
  __decorate([
7464
7468
  dataType({})
7465
- ], UI.prototype, "data", void 0);
7469
+ ], UI.prototype, "data", undefined);
7466
7470
  __decorate([
7467
7471
  rewrite(Leaf.prototype.reset)
7468
7472
  ], UI.prototype, "reset", null);
@@ -7523,7 +7527,7 @@ let Group = class Group extends UI {
7523
7527
  };
7524
7528
  __decorate([
7525
7529
  dataProcessor(GroupData)
7526
- ], Group.prototype, "__", void 0);
7530
+ ], Group.prototype, "__", undefined);
7527
7531
  Group = __decorate([
7528
7532
  useModule(Branch),
7529
7533
  registerUI()
@@ -7694,8 +7698,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7694
7698
  __setAttr(attrName, newValue) {
7695
7699
  if (this.canvas) {
7696
7700
  if (canvasSizeAttrs.includes(attrName)) {
7697
- if (!newValue)
7698
- debug.warn(attrName + ' is 0');
7699
7701
  this.__changeCanvasSize(attrName, newValue);
7700
7702
  }
7701
7703
  else if (attrName === 'fill') {
@@ -7735,8 +7737,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7735
7737
  this.created = true;
7736
7738
  }
7737
7739
  __onReady() {
7738
- if (this.ready)
7739
- return;
7740
7740
  this.ready = true;
7741
7741
  this.emitLeafer(LeaferEvent.BEFORE_READY);
7742
7742
  this.emitLeafer(LeaferEvent.READY);
@@ -7750,6 +7750,20 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7750
7750
  this.emitLeafer(LeaferEvent.VIEW_READY);
7751
7751
  WaitHelper.run(this.__viewReadyWait);
7752
7752
  }
7753
+ __onLayoutEnd() {
7754
+ const { grow, growWidth, growHeight } = this.config;
7755
+ if (grow) {
7756
+ let { width, height, pixelRatio } = this;
7757
+ const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7758
+ if (growWidth !== false)
7759
+ width = Math.max(1, bounds.x + bounds.width);
7760
+ if (growHeight !== false)
7761
+ height = Math.max(1, bounds.y + bounds.height);
7762
+ this.__doResize({ width, height, pixelRatio });
7763
+ }
7764
+ if (!this.ready)
7765
+ this.__onReady();
7766
+ }
7753
7767
  __onNextRender() {
7754
7768
  if (this.viewReady) {
7755
7769
  WaitHelper.run(this.__nextRenderWait);
@@ -7843,10 +7857,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7843
7857
  const runId = Run.start('FirstCreate ' + this.innerName);
7844
7858
  this.once(LeaferEvent.START, () => Run.end(runId));
7845
7859
  this.once(LayoutEvent.START, () => this.updateLazyBounds());
7846
- this.once(LayoutEvent.END, () => this.__onReady());
7847
7860
  this.once(RenderEvent.START, () => this.__onCreated());
7848
7861
  this.once(RenderEvent.END, () => this.__onViewReady());
7849
- this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
7862
+ this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
7850
7863
  }
7851
7864
  __removeListenEvents() {
7852
7865
  this.off_(this.__eventIds);
@@ -7887,10 +7900,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7887
7900
  Leafer.list = new LeafList();
7888
7901
  __decorate([
7889
7902
  dataProcessor(LeaferData)
7890
- ], Leafer.prototype, "__", void 0);
7903
+ ], Leafer.prototype, "__", undefined);
7891
7904
  __decorate([
7892
7905
  boundsType()
7893
- ], Leafer.prototype, "pixelRatio", void 0);
7906
+ ], Leafer.prototype, "pixelRatio", undefined);
7894
7907
  Leafer = Leafer_1 = __decorate([
7895
7908
  registerUI()
7896
7909
  ], Leafer);
@@ -7903,7 +7916,7 @@ let Rect = class Rect extends UI {
7903
7916
  };
7904
7917
  __decorate([
7905
7918
  dataProcessor(RectData)
7906
- ], Rect.prototype, "__", void 0);
7919
+ ], Rect.prototype, "__", undefined);
7907
7920
  Rect = __decorate([
7908
7921
  useModule(RectRender),
7909
7922
  rewriteAble(),
@@ -7928,6 +7941,8 @@ let Box = class Box extends Group {
7928
7941
  const data = this.__;
7929
7942
  if (this.children.length) {
7930
7943
  if (data.__autoSide) {
7944
+ if (data.__hasSurface)
7945
+ this.__extraUpdate();
7931
7946
  super.__updateBoxBounds();
7932
7947
  const { boxBounds } = this.__layout;
7933
7948
  if (!data.__autoSize) {
@@ -7992,13 +8007,13 @@ let Box = class Box extends Group {
7992
8007
  };
7993
8008
  __decorate([
7994
8009
  dataProcessor(BoxData)
7995
- ], Box.prototype, "__", void 0);
8010
+ ], Box.prototype, "__", undefined);
7996
8011
  __decorate([
7997
8012
  dataType(false)
7998
- ], Box.prototype, "resizeChildren", void 0);
8013
+ ], Box.prototype, "resizeChildren", undefined);
7999
8014
  __decorate([
8000
8015
  affectRenderBoundsType('show')
8001
- ], Box.prototype, "overflow", void 0);
8016
+ ], Box.prototype, "overflow", undefined);
8002
8017
  __decorate([
8003
8018
  rewrite(rect.__updateStrokeSpread)
8004
8019
  ], Box.prototype, "__updateStrokeSpread", null);
@@ -8037,13 +8052,13 @@ let Frame = class Frame extends Box {
8037
8052
  };
8038
8053
  __decorate([
8039
8054
  dataProcessor(FrameData)
8040
- ], Frame.prototype, "__", void 0);
8055
+ ], Frame.prototype, "__", undefined);
8041
8056
  __decorate([
8042
8057
  surfaceType('#FFFFFF')
8043
- ], Frame.prototype, "fill", void 0);
8058
+ ], Frame.prototype, "fill", undefined);
8044
8059
  __decorate([
8045
8060
  affectRenderBoundsType('hide')
8046
- ], Frame.prototype, "overflow", void 0);
8061
+ ], Frame.prototype, "overflow", undefined);
8047
8062
  Frame = __decorate([
8048
8063
  registerUI()
8049
8064
  ], Frame);
@@ -8090,16 +8105,16 @@ let Ellipse = class Ellipse extends UI {
8090
8105
  };
8091
8106
  __decorate([
8092
8107
  dataProcessor(EllipseData)
8093
- ], Ellipse.prototype, "__", void 0);
8108
+ ], Ellipse.prototype, "__", undefined);
8094
8109
  __decorate([
8095
8110
  pathType(0)
8096
- ], Ellipse.prototype, "innerRadius", void 0);
8111
+ ], Ellipse.prototype, "innerRadius", undefined);
8097
8112
  __decorate([
8098
8113
  pathType(0)
8099
- ], Ellipse.prototype, "startAngle", void 0);
8114
+ ], Ellipse.prototype, "startAngle", undefined);
8100
8115
  __decorate([
8101
8116
  pathType(0)
8102
- ], Ellipse.prototype, "endAngle", void 0);
8117
+ ], Ellipse.prototype, "endAngle", undefined);
8103
8118
  Ellipse = __decorate([
8104
8119
  registerUI()
8105
8120
  ], Ellipse);
@@ -8158,22 +8173,22 @@ let Line = class Line extends UI {
8158
8173
  };
8159
8174
  __decorate([
8160
8175
  dataProcessor(LineData)
8161
- ], Line.prototype, "__", void 0);
8176
+ ], Line.prototype, "__", undefined);
8162
8177
  __decorate([
8163
8178
  affectStrokeBoundsType('center')
8164
- ], Line.prototype, "strokeAlign", void 0);
8179
+ ], Line.prototype, "strokeAlign", undefined);
8165
8180
  __decorate([
8166
8181
  boundsType(0)
8167
- ], Line.prototype, "height", void 0);
8182
+ ], Line.prototype, "height", undefined);
8168
8183
  __decorate([
8169
8184
  pathType()
8170
- ], Line.prototype, "points", void 0);
8185
+ ], Line.prototype, "points", undefined);
8171
8186
  __decorate([
8172
8187
  pathType(0)
8173
- ], Line.prototype, "curve", void 0);
8188
+ ], Line.prototype, "curve", undefined);
8174
8189
  __decorate([
8175
8190
  pathType(false)
8176
- ], Line.prototype, "closed", void 0);
8191
+ ], Line.prototype, "closed", undefined);
8177
8192
  Line = __decorate([
8178
8193
  registerUI()
8179
8194
  ], Line);
@@ -8206,16 +8221,16 @@ let Polygon = class Polygon extends UI {
8206
8221
  };
8207
8222
  __decorate([
8208
8223
  dataProcessor(PolygonData)
8209
- ], Polygon.prototype, "__", void 0);
8224
+ ], Polygon.prototype, "__", undefined);
8210
8225
  __decorate([
8211
8226
  pathType(3)
8212
- ], Polygon.prototype, "sides", void 0);
8227
+ ], Polygon.prototype, "sides", undefined);
8213
8228
  __decorate([
8214
8229
  pathType()
8215
- ], Polygon.prototype, "points", void 0);
8230
+ ], Polygon.prototype, "points", undefined);
8216
8231
  __decorate([
8217
8232
  pathType(0)
8218
- ], Polygon.prototype, "curve", void 0);
8233
+ ], Polygon.prototype, "curve", undefined);
8219
8234
  __decorate([
8220
8235
  rewrite(line.__updateRenderPath)
8221
8236
  ], Polygon.prototype, "__updateRenderPath", null);
@@ -8247,13 +8262,13 @@ let Star = class Star extends UI {
8247
8262
  };
8248
8263
  __decorate([
8249
8264
  dataProcessor(StarData)
8250
- ], Star.prototype, "__", void 0);
8265
+ ], Star.prototype, "__", undefined);
8251
8266
  __decorate([
8252
8267
  pathType(5)
8253
- ], Star.prototype, "corners", void 0);
8268
+ ], Star.prototype, "corners", undefined);
8254
8269
  __decorate([
8255
8270
  pathType(0.382)
8256
- ], Star.prototype, "innerRadius", void 0);
8271
+ ], Star.prototype, "innerRadius", undefined);
8257
8272
  Star = __decorate([
8258
8273
  registerUI()
8259
8274
  ], Star);
@@ -8275,10 +8290,10 @@ let Image = class Image extends Rect {
8275
8290
  };
8276
8291
  __decorate([
8277
8292
  dataProcessor(ImageData)
8278
- ], Image.prototype, "__", void 0);
8293
+ ], Image.prototype, "__", undefined);
8279
8294
  __decorate([
8280
8295
  boundsType('')
8281
- ], Image.prototype, "url", void 0);
8296
+ ], Image.prototype, "url", undefined);
8282
8297
  Image = __decorate([
8283
8298
  registerUI()
8284
8299
  ], Image);
@@ -8341,25 +8356,25 @@ let Canvas = class Canvas extends Rect {
8341
8356
  };
8342
8357
  __decorate([
8343
8358
  dataProcessor(CanvasData)
8344
- ], Canvas.prototype, "__", void 0);
8359
+ ], Canvas.prototype, "__", undefined);
8345
8360
  __decorate([
8346
8361
  resizeType(100)
8347
- ], Canvas.prototype, "width", void 0);
8362
+ ], Canvas.prototype, "width", undefined);
8348
8363
  __decorate([
8349
8364
  resizeType(100)
8350
- ], Canvas.prototype, "height", void 0);
8365
+ ], Canvas.prototype, "height", undefined);
8351
8366
  __decorate([
8352
8367
  resizeType(1)
8353
- ], Canvas.prototype, "pixelRatio", void 0);
8368
+ ], Canvas.prototype, "pixelRatio", undefined);
8354
8369
  __decorate([
8355
8370
  resizeType(true)
8356
- ], Canvas.prototype, "smooth", void 0);
8371
+ ], Canvas.prototype, "smooth", undefined);
8357
8372
  __decorate([
8358
8373
  dataType(false)
8359
- ], Canvas.prototype, "safeResize", void 0);
8374
+ ], Canvas.prototype, "safeResize", undefined);
8360
8375
  __decorate([
8361
8376
  resizeType()
8362
- ], Canvas.prototype, "contextSettings", void 0);
8377
+ ], Canvas.prototype, "contextSettings", undefined);
8363
8378
  Canvas = __decorate([
8364
8379
  registerUI()
8365
8380
  ], Canvas);
@@ -8450,76 +8465,76 @@ let Text = class Text extends UI {
8450
8465
  };
8451
8466
  __decorate([
8452
8467
  dataProcessor(TextData)
8453
- ], Text.prototype, "__", void 0);
8468
+ ], Text.prototype, "__", undefined);
8454
8469
  __decorate([
8455
8470
  boundsType(0)
8456
- ], Text.prototype, "width", void 0);
8471
+ ], Text.prototype, "width", undefined);
8457
8472
  __decorate([
8458
8473
  boundsType(0)
8459
- ], Text.prototype, "height", void 0);
8474
+ ], Text.prototype, "height", undefined);
8460
8475
  __decorate([
8461
8476
  dataType(false)
8462
- ], Text.prototype, "resizeFontSize", void 0);
8477
+ ], Text.prototype, "resizeFontSize", undefined);
8463
8478
  __decorate([
8464
8479
  surfaceType('#000000')
8465
- ], Text.prototype, "fill", void 0);
8480
+ ], Text.prototype, "fill", undefined);
8466
8481
  __decorate([
8467
8482
  affectStrokeBoundsType('outside')
8468
- ], Text.prototype, "strokeAlign", void 0);
8483
+ ], Text.prototype, "strokeAlign", undefined);
8469
8484
  __decorate([
8470
8485
  hitType('all')
8471
- ], Text.prototype, "hitFill", void 0);
8486
+ ], Text.prototype, "hitFill", undefined);
8472
8487
  __decorate([
8473
8488
  boundsType('')
8474
- ], Text.prototype, "text", void 0);
8489
+ ], Text.prototype, "text", undefined);
8475
8490
  __decorate([
8476
- boundsType('L')
8477
- ], Text.prototype, "fontFamily", void 0);
8491
+ boundsType('caption')
8492
+ ], Text.prototype, "fontFamily", undefined);
8478
8493
  __decorate([
8479
8494
  boundsType(12)
8480
- ], Text.prototype, "fontSize", void 0);
8495
+ ], Text.prototype, "fontSize", undefined);
8481
8496
  __decorate([
8482
8497
  boundsType('normal')
8483
- ], Text.prototype, "fontWeight", void 0);
8498
+ ], Text.prototype, "fontWeight", undefined);
8484
8499
  __decorate([
8485
8500
  boundsType(false)
8486
- ], Text.prototype, "italic", void 0);
8501
+ ], Text.prototype, "italic", undefined);
8487
8502
  __decorate([
8488
8503
  boundsType('none')
8489
- ], Text.prototype, "textCase", void 0);
8504
+ ], Text.prototype, "textCase", undefined);
8490
8505
  __decorate([
8491
8506
  boundsType('none')
8492
- ], Text.prototype, "textDecoration", void 0);
8507
+ ], Text.prototype, "textDecoration", undefined);
8493
8508
  __decorate([
8494
8509
  boundsType(0)
8495
- ], Text.prototype, "letterSpacing", void 0);
8510
+ ], Text.prototype, "letterSpacing", undefined);
8496
8511
  __decorate([
8497
8512
  boundsType({ type: 'percent', value: 1.5 })
8498
- ], Text.prototype, "lineHeight", void 0);
8513
+ ], Text.prototype, "lineHeight", undefined);
8499
8514
  __decorate([
8500
8515
  boundsType(0)
8501
- ], Text.prototype, "paraIndent", void 0);
8516
+ ], Text.prototype, "paraIndent", undefined);
8502
8517
  __decorate([
8503
8518
  boundsType(0)
8504
- ], Text.prototype, "paraSpacing", void 0);
8519
+ ], Text.prototype, "paraSpacing", undefined);
8505
8520
  __decorate([
8506
8521
  boundsType('x')
8507
- ], Text.prototype, "writingMode", void 0);
8522
+ ], Text.prototype, "writingMode", undefined);
8508
8523
  __decorate([
8509
8524
  boundsType('left')
8510
- ], Text.prototype, "textAlign", void 0);
8525
+ ], Text.prototype, "textAlign", undefined);
8511
8526
  __decorate([
8512
8527
  boundsType('top')
8513
- ], Text.prototype, "verticalAlign", void 0);
8528
+ ], Text.prototype, "verticalAlign", undefined);
8514
8529
  __decorate([
8515
8530
  boundsType(true)
8516
- ], Text.prototype, "autoSizeAlign", void 0);
8531
+ ], Text.prototype, "autoSizeAlign", undefined);
8517
8532
  __decorate([
8518
8533
  boundsType('normal')
8519
- ], Text.prototype, "textWrap", void 0);
8534
+ ], Text.prototype, "textWrap", undefined);
8520
8535
  __decorate([
8521
8536
  boundsType('show')
8522
- ], Text.prototype, "textOverflow", void 0);
8537
+ ], Text.prototype, "textOverflow", undefined);
8523
8538
  Text = __decorate([
8524
8539
  registerUI()
8525
8540
  ], Text);
@@ -8532,10 +8547,10 @@ let Path = class Path extends UI {
8532
8547
  };
8533
8548
  __decorate([
8534
8549
  dataProcessor(PathData)
8535
- ], Path.prototype, "__", void 0);
8550
+ ], Path.prototype, "__", undefined);
8536
8551
  __decorate([
8537
8552
  affectStrokeBoundsType('center')
8538
- ], Path.prototype, "strokeAlign", void 0);
8553
+ ], Path.prototype, "strokeAlign", undefined);
8539
8554
  Path = __decorate([
8540
8555
  registerUI()
8541
8556
  ], Path);
@@ -8574,10 +8589,10 @@ let Pen = class Pen extends Group {
8574
8589
  };
8575
8590
  __decorate([
8576
8591
  dataProcessor(PenData)
8577
- ], Pen.prototype, "__", void 0);
8592
+ ], Pen.prototype, "__", undefined);
8578
8593
  __decorate([
8579
8594
  penPathType()
8580
- ], Pen.prototype, "path", void 0);
8595
+ ], Pen.prototype, "path", undefined);
8581
8596
  Pen = __decorate([
8582
8597
  useModule(PathCreator, ['set', 'path', 'paint']),
8583
8598
  registerUI()
@@ -9211,7 +9226,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
9211
9226
  }
9212
9227
  else {
9213
9228
  if (!paint.patternTask) {
9214
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9229
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
9215
9230
  paint.patternTask = null;
9216
9231
  if (canvas.bounds.hit(ui.__nowWorld))
9217
9232
  createPattern(ui, paint, pixelRatio);
@@ -9367,7 +9382,7 @@ function shadow(ui, current, shape) {
9367
9382
  const end = shadow.length - 1;
9368
9383
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
9369
9384
  shadow.forEach((item, index) => {
9370
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
9385
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
9371
9386
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
9372
9387
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
9373
9388
  copyBounds = bounds;
@@ -9443,7 +9458,7 @@ function innerShadow(ui, current, shape) {
9443
9458
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
9444
9459
  copyBounds = bounds;
9445
9460
  }
9446
- other.fillWorld(copyBounds, item.color, 'source-in');
9461
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
9447
9462
  if (ui.__worldFlipped) {
9448
9463
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
9449
9464
  }
@@ -9805,7 +9820,7 @@ function layoutChar(drawData, style, width, _height) {
9805
9820
  rows.forEach(row => {
9806
9821
  if (row.words) {
9807
9822
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
9808
- addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
9823
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
9809
9824
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
9810
9825
  if (row.isOverflow && !letterSpacing)
9811
9826
  row.textMode = true;
@@ -9827,7 +9842,7 @@ function layoutChar(drawData, style, width, _height) {
9827
9842
  else {
9828
9843
  charX = toChar(word.data, charX, row.data, row.isOverflow);
9829
9844
  }
9830
- if (!row.paraEnd && addWordWidth) {
9845
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
9831
9846
  charX += addWordWidth;
9832
9847
  row.width += addWordWidth;
9833
9848
  }