leafer-draw 1.3.3 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1374,7 +1374,7 @@ function getNameList(name) {
1374
1374
  }
1375
1375
  const D$4 = Debug;
1376
1376
 
1377
- const debug$e = Debug.get('RunTime');
1377
+ const debug$f = Debug.get('RunTime');
1378
1378
  const Run = {
1379
1379
  currentId: 0,
1380
1380
  currentName: '',
@@ -1383,24 +1383,24 @@ const Run = {
1383
1383
  nameToIdMap: {},
1384
1384
  start(name, microsecond) {
1385
1385
  const id = IncrementId.create(IncrementId.RUNTIME);
1386
- R.currentId = R.idMap[id] = microsecond ? performance.now() : Date.now();
1387
- R.currentName = R.nameMap[id] = name;
1388
- R.nameToIdMap[name] = id;
1386
+ R$1.currentId = R$1.idMap[id] = microsecond ? performance.now() : Date.now();
1387
+ R$1.currentName = R$1.nameMap[id] = name;
1388
+ R$1.nameToIdMap[name] = id;
1389
1389
  return id;
1390
1390
  },
1391
1391
  end(id, microsecond) {
1392
- const time = R.idMap[id], name = R.nameMap[id];
1392
+ const time = R$1.idMap[id], name = R$1.nameMap[id];
1393
1393
  const duration = microsecond ? (performance.now() - time) / 1000 : Date.now() - time;
1394
- R.idMap[id] = R.nameMap[id] = R.nameToIdMap[name] = undefined;
1395
- debug$e.log(name, duration, 'ms');
1394
+ R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
1395
+ debug$f.log(name, duration, 'ms');
1396
1396
  },
1397
1397
  endOfName(name, microsecond) {
1398
- const id = R.nameToIdMap[name];
1398
+ const id = R$1.nameToIdMap[name];
1399
1399
  if (id !== undefined)
1400
- R.end(id, microsecond);
1400
+ R$1.end(id, microsecond);
1401
1401
  }
1402
1402
  };
1403
- const R = Run;
1403
+ const R$1 = Run;
1404
1404
 
1405
1405
  const check = [];
1406
1406
  const Plugin = {
@@ -1421,18 +1421,18 @@ const Plugin = {
1421
1421
  };
1422
1422
  setTimeout(() => check.forEach(name => Plugin.has(name, true)));
1423
1423
 
1424
- const debug$d = Debug.get('UICreator');
1424
+ const debug$e = Debug.get('UICreator');
1425
1425
  const UICreator = {
1426
1426
  list: {},
1427
1427
  register(UI) {
1428
1428
  const { __tag: tag } = UI.prototype;
1429
1429
  if (list$1[tag])
1430
- debug$d.repeat(tag);
1430
+ debug$e.repeat(tag);
1431
1431
  list$1[tag] = UI;
1432
1432
  },
1433
1433
  get(tag, data, x, y, width, height) {
1434
1434
  if (!list$1[tag])
1435
- debug$d.error('not register ' + tag);
1435
+ debug$e.error('not register ' + tag);
1436
1436
  const ui = new list$1[tag](data);
1437
1437
  if (x !== undefined) {
1438
1438
  ui.x = x;
@@ -1448,7 +1448,7 @@ const UICreator = {
1448
1448
  };
1449
1449
  const { list: list$1 } = UICreator;
1450
1450
 
1451
- const debug$c = Debug.get('EventCreator');
1451
+ const debug$d = Debug.get('EventCreator');
1452
1452
  const EventCreator = {
1453
1453
  nameList: {},
1454
1454
  register(Event) {
@@ -1456,7 +1456,7 @@ const EventCreator = {
1456
1456
  Object.keys(Event).forEach(key => {
1457
1457
  name = Event[key];
1458
1458
  if (typeof name === 'string')
1459
- nameList[name] && debug$c.repeat(name), nameList[name] = Event;
1459
+ nameList[name] && debug$d.repeat(name), nameList[name] = Event;
1460
1460
  });
1461
1461
  },
1462
1462
  changeName(oldName, newName) {
@@ -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 === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
1536
+ if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _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 === undefined ? undefined : _b.constructor) === Object)
1539
+ if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1540
1540
  assign(t[key] = {}, merge[key], exclude[key]);
1541
1541
  return;
1542
1542
  }
@@ -1660,7 +1660,7 @@ class LeafData {
1660
1660
  const t = this;
1661
1661
  if (t.blendMode === 'pass-through') {
1662
1662
  const leaf = this.__leaf;
1663
- if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser) {
1663
+ if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser || t.filter) {
1664
1664
  t.__single = true;
1665
1665
  }
1666
1666
  else if (t.__single) {
@@ -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 undefined; }
1776
+ getTransform() { return void 0; }
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 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; }
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; }
1837
1837
  fillText(_text, _x, _y, _maxWidth) { }
1838
- measureText(_text) { return undefined; }
1838
+ measureText(_text) { return void 0; }
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", undefined);
1846
+ ], Canvas$1.prototype, "smooth", void 0);
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingQuality')
1849
- ], Canvas$1.prototype, "smoothLevel", undefined);
1849
+ ], Canvas$1.prototype, "smoothLevel", void 0);
1850
1850
  __decorate([
1851
1851
  contextAttr('globalAlpha')
1852
- ], Canvas$1.prototype, "opacity", undefined);
1852
+ ], Canvas$1.prototype, "opacity", void 0);
1853
1853
  __decorate([
1854
1854
  contextAttr()
1855
- ], Canvas$1.prototype, "fillStyle", undefined);
1855
+ ], Canvas$1.prototype, "fillStyle", void 0);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas$1.prototype, "strokeStyle", undefined);
1858
+ ], Canvas$1.prototype, "strokeStyle", void 0);
1859
1859
  __decorate([
1860
1860
  contextAttr('lineWidth')
1861
- ], Canvas$1.prototype, "strokeWidth", undefined);
1861
+ ], Canvas$1.prototype, "strokeWidth", void 0);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineCap')
1864
- ], Canvas$1.prototype, "strokeCap", undefined);
1864
+ ], Canvas$1.prototype, "strokeCap", void 0);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineJoin')
1867
- ], Canvas$1.prototype, "strokeJoin", undefined);
1867
+ ], Canvas$1.prototype, "strokeJoin", void 0);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineDashOffset')
1870
- ], Canvas$1.prototype, "dashOffset", undefined);
1870
+ ], Canvas$1.prototype, "dashOffset", void 0);
1871
1871
  __decorate([
1872
1872
  contextAttr()
1873
- ], Canvas$1.prototype, "miterLimit", undefined);
1873
+ ], Canvas$1.prototype, "miterLimit", void 0);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas$1.prototype, "shadowBlur", undefined);
1876
+ ], Canvas$1.prototype, "shadowBlur", void 0);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas$1.prototype, "shadowColor", undefined);
1879
+ ], Canvas$1.prototype, "shadowColor", void 0);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas$1.prototype, "shadowOffsetX", undefined);
1882
+ ], Canvas$1.prototype, "shadowOffsetX", void 0);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas$1.prototype, "shadowOffsetY", undefined);
1885
+ ], Canvas$1.prototype, "shadowOffsetY", void 0);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas$1.prototype, "filter", undefined);
1888
+ ], Canvas$1.prototype, "filter", void 0);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas$1.prototype, "font", undefined);
1891
+ ], Canvas$1.prototype, "font", void 0);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas$1.prototype, "fontKerning", undefined);
1894
+ ], Canvas$1.prototype, "fontKerning", void 0);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas$1.prototype, "fontStretch", undefined);
1897
+ ], Canvas$1.prototype, "fontStretch", void 0);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas$1.prototype, "fontVariantCaps", undefined);
1900
+ ], Canvas$1.prototype, "fontVariantCaps", void 0);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas$1.prototype, "textAlign", undefined);
1903
+ ], Canvas$1.prototype, "textAlign", void 0);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas$1.prototype, "textBaseline", undefined);
1906
+ ], Canvas$1.prototype, "textBaseline", void 0);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas$1.prototype, "textRendering", undefined);
1909
+ ], Canvas$1.prototype, "textRendering", void 0);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas$1.prototype, "wordSpacing", undefined);
1912
+ ], Canvas$1.prototype, "wordSpacing", void 0);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas$1.prototype, "letterSpacing", undefined);
1915
+ ], Canvas$1.prototype, "letterSpacing", void 0);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas$1.prototype, "direction", undefined);
1918
+ ], Canvas$1.prototype, "direction", void 0);
1919
1919
  __decorate([
1920
1920
  contextMethod()
1921
1921
  ], Canvas$1.prototype, "setTransform", null);
@@ -2612,7 +2612,7 @@ const EllipseHelper = {
2612
2612
  const { M: M$4, m, L: L$5, l, H, h, V, v, C: C$4, c, S, s, Q: Q$3, q, T, t, A, a, Z: Z$4, z, N: N$3, D: D$3, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3 } = PathCommandMap;
2613
2613
  const { rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
2614
2614
  const { ellipticalArc } = EllipseHelper;
2615
- const debug$b = Debug.get('PathConvert');
2615
+ const debug$c = Debug.get('PathConvert');
2616
2616
  const setEndPoint$1 = {};
2617
2617
  const PathConvert = {
2618
2618
  current: { dot: 0 },
@@ -2853,7 +2853,7 @@ const PathConvert = {
2853
2853
  i += 6;
2854
2854
  break;
2855
2855
  default:
2856
- debug$b.error(`command: ${command} [index:${i}]`, old);
2856
+ debug$c.error(`command: ${command} [index:${i}]`, old);
2857
2857
  return data;
2858
2858
  }
2859
2859
  lastCommand = command;
@@ -2962,12 +2962,10 @@ const PathCommandDataHelper = {
2962
2962
  },
2963
2963
  arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
2964
2964
  if (lastX !== undefined) {
2965
- const maxRadius = tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2) * (getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / 2);
2966
- data.push(U$2, x1, y1, x2, y2, min(radius, abs$2(maxRadius)));
2967
- }
2968
- else {
2969
- data.push(U$2, x1, y1, x2, y2, radius);
2965
+ const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
2966
+ radius = min(radius, min(d / 2, d / 2 * abs$2(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
2970
2967
  }
2968
+ data.push(U$2, x1, y1, x2, y2, radius);
2971
2969
  },
2972
2970
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
2973
2971
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, rotation === undefined ? 0 : rotation, startAngle === undefined ? 0 : startAngle, endAngle === undefined ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3078,7 +3076,7 @@ class PathCreator {
3078
3076
  }
3079
3077
 
3080
3078
  const { M: M$2, L: L$3, C: C$2, Q: Q$1, Z: Z$2, N: N$1, D: D$1, X: X$1, G: G$1, F: F$2, O: O$1, P: P$1, U: U$1 } = PathCommandMap;
3081
- const debug$a = Debug.get('PathDrawer');
3079
+ const debug$b = Debug.get('PathDrawer');
3082
3080
  const PathDrawer = {
3083
3081
  drawPathByData(drawer, data) {
3084
3082
  if (!data)
@@ -3141,7 +3139,7 @@ const PathDrawer = {
3141
3139
  i += 6;
3142
3140
  break;
3143
3141
  default:
3144
- debug$a.error(`command: ${command} [index:${i}]`, data);
3142
+ debug$b.error(`command: ${command} [index:${i}]`, data);
3145
3143
  return;
3146
3144
  }
3147
3145
  }
@@ -3151,7 +3149,7 @@ const PathDrawer = {
3151
3149
  const { M: M$1, L: L$2, C: C$1, Q, Z: Z$1, N, D, X, G, F: F$1, O, P, U } = PathCommandMap;
3152
3150
  const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
3153
3151
  const { addPointBounds, copy: copy$7, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
3154
- const debug$9 = Debug.get('PathBounds');
3152
+ const debug$a = Debug.get('PathBounds');
3155
3153
  let radius, radiusX, radiusY;
3156
3154
  const tempPointBounds = {};
3157
3155
  const setPointBounds = {};
@@ -3259,7 +3257,7 @@ const PathBounds = {
3259
3257
  i += 6;
3260
3258
  break;
3261
3259
  default:
3262
- debug$9.error(`command: ${command} [index:${i}]`, data);
3260
+ debug$a.error(`command: ${command} [index:${i}]`, data);
3263
3261
  return;
3264
3262
  }
3265
3263
  }
@@ -3375,7 +3373,7 @@ const FileHelper = {
3375
3373
  const F = FileHelper;
3376
3374
  F.opacityTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
3377
3375
 
3378
- const debug$8 = Debug.get('TaskProcessor');
3376
+ const debug$9 = Debug.get('TaskProcessor');
3379
3377
  class TaskItem {
3380
3378
  constructor(task) {
3381
3379
  this.parallel = true;
@@ -3384,13 +3382,13 @@ class TaskItem {
3384
3382
  this.task = task;
3385
3383
  }
3386
3384
  run() {
3387
- return __awaiter(this, undefined, undefined, function* () {
3385
+ return __awaiter(this, void 0, void 0, function* () {
3388
3386
  try {
3389
3387
  if (this.task && !this.isComplete && this.parent.running)
3390
3388
  yield this.task();
3391
3389
  }
3392
3390
  catch (error) {
3393
- debug$8.error(error);
3391
+ debug$9.error(error);
3394
3392
  }
3395
3393
  });
3396
3394
  }
@@ -3623,18 +3621,52 @@ class TaskProcessor {
3623
3621
  }
3624
3622
  }
3625
3623
 
3626
- const ImageManager = {
3624
+ const debug$8 = Debug.get('Resource');
3625
+ const Resource = {
3626
+ tasker: new TaskProcessor(),
3627
3627
  map: {},
3628
+ get isComplete() { return R.tasker.isComplete; },
3629
+ set(key, value) {
3630
+ if (R.map[key])
3631
+ debug$8.repeat(key);
3632
+ R.map[key] = value;
3633
+ },
3634
+ get(key) {
3635
+ return R.map[key];
3636
+ },
3637
+ remove(key) {
3638
+ delete R.map[key];
3639
+ },
3640
+ loadImage(key, format) {
3641
+ return new Promise((resolve, reject) => {
3642
+ const image = this.setImage(key, key, format);
3643
+ image.load(() => resolve(image), (e) => reject(e));
3644
+ });
3645
+ },
3646
+ setImage(key, value, format) {
3647
+ let config;
3648
+ if (typeof value === 'string')
3649
+ config = { url: value };
3650
+ else if (!value.url)
3651
+ config = { url: key, view: value };
3652
+ if (config)
3653
+ format && (config.format = format), value = Creator.image(config);
3654
+ R.set(key, value);
3655
+ return value;
3656
+ },
3657
+ destroy() {
3658
+ R.map = {};
3659
+ }
3660
+ };
3661
+ const R = Resource;
3662
+
3663
+ const ImageManager = {
3628
3664
  recycledList: [],
3629
- tasker: new TaskProcessor(),
3630
3665
  patternTasker: new TaskProcessor(),
3631
- get isComplete() { return I.tasker.isComplete; },
3632
3666
  get(config) {
3633
- let image = I.map[config.url];
3634
- if (!image) {
3635
- image = Creator.image(config);
3636
- I.map[config.url] = image;
3637
- }
3667
+ let image = Resource.get(config.url);
3668
+ if (!image)
3669
+ Resource.set(config.url, image = Creator.image(config));
3638
3670
  image.use++;
3639
3671
  return image;
3640
3672
  },
@@ -3648,7 +3680,7 @@ const ImageManager = {
3648
3680
  if (list.length > 100) {
3649
3681
  list.forEach(image => {
3650
3682
  if (!image.use && image.url) {
3651
- delete I.map[image.url];
3683
+ Resource.remove(image.url);
3652
3684
  image.destroy();
3653
3685
  }
3654
3686
  });
@@ -3675,7 +3707,6 @@ const ImageManager = {
3675
3707
  return false;
3676
3708
  },
3677
3709
  destroy() {
3678
- I.map = {};
3679
3710
  I.recycledList = [];
3680
3711
  }
3681
3712
  };
@@ -3689,21 +3720,19 @@ class LeaferImage {
3689
3720
  this.use = 0;
3690
3721
  this.waitComplete = [];
3691
3722
  this.innerId = create$1(IMAGE);
3692
- this.config = config || { url: '' };
3693
- this.isSVG = ImageManager.isFormat('svg', config);
3694
- this.hasOpacityPixel = ImageManager.hasOpacityPixel(config);
3723
+ this.config = config || (config = { url: '' });
3724
+ if (config.view) {
3725
+ const { view } = config;
3726
+ this.setView(view.config ? view.view : view);
3727
+ }
3728
+ ImageManager.isFormat('svg', config) && (this.isSVG = true);
3729
+ ImageManager.hasOpacityPixel(config) && (this.hasOpacityPixel = true);
3695
3730
  }
3696
3731
  load(onSuccess, onError) {
3697
3732
  if (!this.loading) {
3698
3733
  this.loading = true;
3699
- ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3700
- return yield Platform.origin.loadImage(this.url).then((img) => {
3701
- this.ready = true;
3702
- this.width = img.naturalWidth || img.width;
3703
- this.height = img.naturalHeight || img.height;
3704
- this.view = img;
3705
- this.onComplete(true);
3706
- }).catch((e) => {
3734
+ Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3735
+ return yield Platform.origin.loadImage(this.url).then(img => this.setView(img)).catch((e) => {
3707
3736
  this.error = e;
3708
3737
  this.onComplete(false);
3709
3738
  });
@@ -3721,6 +3750,13 @@ class LeaferImage {
3721
3750
  }
3722
3751
  l[index] = l[index + 1] = undefined;
3723
3752
  }
3753
+ setView(img) {
3754
+ this.ready = true;
3755
+ this.width = img.naturalWidth || img.width;
3756
+ this.height = img.naturalHeight || img.height;
3757
+ this.view = img;
3758
+ this.onComplete(true);
3759
+ }
3724
3760
  onComplete(isSuccess) {
3725
3761
  let odd;
3726
3762
  this.waitComplete.forEach((item, index) => {
@@ -3739,6 +3775,9 @@ class LeaferImage {
3739
3775
  this.waitComplete.length = 0;
3740
3776
  this.loading = false;
3741
3777
  }
3778
+ getFull(_filters) {
3779
+ return this.view;
3780
+ }
3742
3781
  getCanvas(width, height, opacity, _filters) {
3743
3782
  width || (width = this.width);
3744
3783
  height || (height = this.height);
@@ -3821,10 +3860,10 @@ function autoLayoutType(defaultValue) {
3821
3860
  return decorateLeafAttr(defaultValue, (key) => attr({
3822
3861
  set(value) {
3823
3862
  if (this.__setAttr(key, value)) {
3824
- this.__layout.matrixChanged || this.__layout.matrixChange();
3825
3863
  this.__hasAutoLayout = !!(this.origin || this.around || this.flow);
3826
3864
  if (!this.__local)
3827
3865
  this.__layout.createLocal();
3866
+ doBoundsType(this);
3828
3867
  }
3829
3868
  }
3830
3869
  }));
@@ -4207,55 +4246,62 @@ const LeafHelper = {
4207
4246
  y += t.y;
4208
4247
  transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
4209
4248
  },
4210
- zoomOfWorld(t, origin, scaleX, scaleY, resize) {
4211
- L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
4249
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4250
+ L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4212
4251
  },
4213
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize) {
4214
- copy$6(matrix, t.__localMatrix);
4252
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4253
+ const o = t.__localMatrix;
4254
+ if (typeof scaleY !== 'number') {
4255
+ if (scaleY)
4256
+ transition = scaleY;
4257
+ scaleY = scaleX;
4258
+ }
4259
+ copy$6(matrix, o);
4215
4260
  scaleOfOuter$2(matrix, origin, scaleX, scaleY);
4216
4261
  if (t.origin || t.around) {
4217
- L.setTransform(t, matrix, resize);
4262
+ L.setTransform(t, matrix, resize, transition);
4218
4263
  }
4219
4264
  else {
4220
- moveByMatrix(t, matrix);
4221
- t.scaleResize(scaleX, scaleY, resize !== true);
4265
+ const x = t.x + matrix.e - o.e, y = t.y + matrix.f - o.f;
4266
+ if (transition && !resize)
4267
+ t.animate({ x, y, scaleX: t.scaleX * scaleX, scaleY: t.scaleY * scaleY }, transition);
4268
+ else
4269
+ t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4222
4270
  }
4223
4271
  },
4224
- rotateOfWorld(t, origin, angle) {
4225
- L.rotateOfLocal(t, getTempLocal(t, origin), angle);
4272
+ rotateOfWorld(t, origin, angle, transition) {
4273
+ L.rotateOfLocal(t, getTempLocal(t, origin), angle, transition);
4226
4274
  },
4227
- rotateOfLocal(t, origin, angle) {
4228
- copy$6(matrix, t.__localMatrix);
4275
+ rotateOfLocal(t, origin, angle, transition) {
4276
+ const o = t.__localMatrix;
4277
+ copy$6(matrix, o);
4229
4278
  rotateOfOuter$2(matrix, origin, angle);
4230
- if (t.origin || t.around) {
4231
- L.setTransform(t, matrix);
4232
- }
4233
- else {
4234
- moveByMatrix(t, matrix);
4235
- t.rotation = MathHelper.formatRotation(t.rotation + angle);
4236
- }
4279
+ if (t.origin || t.around)
4280
+ L.setTransform(t, matrix, false, transition);
4281
+ else
4282
+ t.set({ x: t.x + matrix.e - o.e, y: t.y + matrix.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition);
4237
4283
  },
4238
- skewOfWorld(t, origin, skewX, skewY, resize) {
4239
- L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
4284
+ skewOfWorld(t, origin, skewX, skewY, resize, transition) {
4285
+ L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
4240
4286
  },
4241
- skewOfLocal(t, origin, skewX, skewY = 0, resize) {
4287
+ skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
4242
4288
  copy$6(matrix, t.__localMatrix);
4243
4289
  skewOfOuter(matrix, origin, skewX, skewY);
4244
- L.setTransform(t, matrix, resize);
4290
+ L.setTransform(t, matrix, resize, transition);
4245
4291
  },
4246
- transformWorld(t, transform, resize) {
4292
+ transformWorld(t, transform, resize, transition) {
4247
4293
  copy$6(matrix, t.worldTransform);
4248
4294
  multiplyParent$2(matrix, transform);
4249
4295
  if (t.parent)
4250
4296
  divideParent(matrix, t.parent.worldTransform);
4251
- L.setTransform(t, matrix, resize);
4297
+ L.setTransform(t, matrix, resize, transition);
4252
4298
  },
4253
- transform(t, transform, resize) {
4299
+ transform(t, transform, resize, transition) {
4254
4300
  copy$6(matrix, t.localTransform);
4255
4301
  multiplyParent$2(matrix, transform);
4256
- L.setTransform(t, matrix, resize);
4302
+ L.setTransform(t, matrix, resize, transition);
4257
4303
  },
4258
- setTransform(t, transform, resize) {
4304
+ setTransform(t, transform, resize, transition) {
4259
4305
  const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
4260
4306
  const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
4261
4307
  if (resize) {
@@ -4270,7 +4316,7 @@ const LeafHelper = {
4270
4316
  t.scaleResize(scaleX, scaleY, false);
4271
4317
  }
4272
4318
  else
4273
- t.set(layout);
4319
+ t.set(layout, transition);
4274
4320
  },
4275
4321
  getFlipTransform(t, axis) {
4276
4322
  const m = getMatrixData();
@@ -4307,11 +4353,6 @@ const LeafHelper = {
4307
4353
  };
4308
4354
  const L = LeafHelper;
4309
4355
  const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$2, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L;
4310
- function moveByMatrix(t, matrix) {
4311
- const { e, f } = t.__localMatrix;
4312
- t.x += matrix.e - e;
4313
- t.y += matrix.f - f;
4314
- }
4315
4356
  function getTempLocal(t, world) {
4316
4357
  t.__layout.update();
4317
4358
  return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
@@ -5217,7 +5258,7 @@ const LeafRender = {
5217
5258
  if (this.__.eraser === 'path')
5218
5259
  return this.__renderEraser(canvas, options);
5219
5260
  const tempCanvas = canvas.getSameCanvas(true, true);
5220
- this.__draw(tempCanvas, options);
5261
+ this.__draw(tempCanvas, options, canvas);
5221
5262
  if (this.__worldFlipped) {
5222
5263
  canvas.copyWorldByReset(tempCanvas, this.__nowWorld, null, this.__.__blendMode, true);
5223
5264
  }
@@ -5585,11 +5626,11 @@ let Leaf = class Leaf {
5585
5626
  const layer = this.leafer ? this.leafer.zoomLayer : this;
5586
5627
  return layer.getWorldPoint(page, relative, distance, change);
5587
5628
  }
5588
- setTransform(matrix, resize) {
5589
- setTransform(this, matrix, resize);
5629
+ setTransform(matrix, resize, transition) {
5630
+ setTransform(this, matrix, resize, transition);
5590
5631
  }
5591
- transform(matrix, resize) {
5592
- transform(this, matrix, resize);
5632
+ transform(matrix, resize, transition) {
5633
+ transform(this, matrix, resize, transition);
5593
5634
  }
5594
5635
  move(x, y, transition) {
5595
5636
  moveLocal(this, x, y, transition);
@@ -5597,32 +5638,32 @@ let Leaf = class Leaf {
5597
5638
  moveInner(x, y, transition) {
5598
5639
  moveWorld(this, x, y, true, transition);
5599
5640
  }
5600
- scaleOf(origin, scaleX, scaleY, resize) {
5601
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
5641
+ scaleOf(origin, scaleX, scaleY, resize, transition) {
5642
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
5602
5643
  }
5603
- rotateOf(origin, rotation) {
5604
- rotateOfLocal(this, getLocalOrigin(this, origin), rotation);
5644
+ rotateOf(origin, rotation, transition) {
5645
+ rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
5605
5646
  }
5606
- skewOf(origin, skewX, skewY, resize) {
5607
- skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize);
5647
+ skewOf(origin, skewX, skewY, resize, transition) {
5648
+ skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
5608
5649
  }
5609
- transformWorld(worldTransform, resize) {
5610
- transformWorld(this, worldTransform, resize);
5650
+ transformWorld(worldTransform, resize, transition) {
5651
+ transformWorld(this, worldTransform, resize, transition);
5611
5652
  }
5612
5653
  moveWorld(x, y, transition) {
5613
5654
  moveWorld(this, x, y, false, transition);
5614
5655
  }
5615
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
5616
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
5656
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
5657
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
5617
5658
  }
5618
5659
  rotateOfWorld(worldOrigin, rotation) {
5619
5660
  rotateOfWorld(this, worldOrigin, rotation);
5620
5661
  }
5621
- skewOfWorld(worldOrigin, skewX, skewY, resize) {
5622
- skewOfWorld(this, worldOrigin, skewX, skewY, resize);
5662
+ skewOfWorld(worldOrigin, skewX, skewY, resize, transition) {
5663
+ skewOfWorld(this, worldOrigin, skewX, skewY, resize, transition);
5623
5664
  }
5624
- flip(axis) {
5625
- transform(this, getFlipTransform(this, axis));
5665
+ flip(axis, transition) {
5666
+ transform(this, getFlipTransform(this, axis), false, transition);
5626
5667
  }
5627
5668
  scaleResize(scaleX, scaleY = scaleX, _noResize) {
5628
5669
  this.scaleX *= scaleX;
@@ -6010,7 +6051,7 @@ class LeafLevelList {
6010
6051
  }
6011
6052
  }
6012
6053
 
6013
- const version = "1.3.3";
6054
+ const version = "1.4.1";
6014
6055
 
6015
6056
  const debug$4 = Debug.get('LeaferCanvas');
6016
6057
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6130,7 +6171,7 @@ class LeaferCanvas extends LeaferCanvasBase {
6130
6171
  }
6131
6172
  }
6132
6173
  else {
6133
- window.addEventListener('resize', () => {
6174
+ window.addEventListener('resize', this.windowListener = () => {
6134
6175
  const pixelRatio = Platform.devicePixelRatio;
6135
6176
  if (this.pixelRatio !== pixelRatio) {
6136
6177
  const { width, height } = this;
@@ -6159,11 +6200,9 @@ class LeaferCanvas extends LeaferCanvasBase {
6159
6200
  }
6160
6201
  stopAutoLayout() {
6161
6202
  this.autoLayout = false;
6162
- this.resizeListener = null;
6163
- if (this.resizeObserver) {
6203
+ if (this.resizeObserver)
6164
6204
  this.resizeObserver.disconnect();
6165
- this.resizeObserver = null;
6166
- }
6205
+ this.resizeListener = this.resizeObserver = null;
6167
6206
  }
6168
6207
  emitResize(size) {
6169
6208
  const oldSize = {};
@@ -6184,6 +6223,10 @@ class LeaferCanvas extends LeaferCanvasBase {
6184
6223
  destroy() {
6185
6224
  if (this.view) {
6186
6225
  this.stopAutoLayout();
6226
+ if (this.windowListener) {
6227
+ window.removeEventListener('resize', this.windowListener);
6228
+ this.windowListener = null;
6229
+ }
6187
6230
  if (!this.unreal) {
6188
6231
  const view = this.view;
6189
6232
  if (view.parentElement)
@@ -6210,7 +6253,10 @@ function useCanvas(_canvasType, _power) {
6210
6253
  canvas.height = height;
6211
6254
  return canvas;
6212
6255
  },
6213
- canvasToDataURL: (canvas, type, quality) => canvas.toDataURL(mineType(type), quality),
6256
+ canvasToDataURL: (canvas, type, quality) => {
6257
+ const imageType = mineType(type), url = canvas.toDataURL(imageType, quality);
6258
+ return imageType === 'image/bmp' ? url.replace('image/png;', 'image/bmp;') : url;
6259
+ },
6214
6260
  canvasToBolb: (canvas, type, quality) => new Promise((resolve) => canvas.toBlob(resolve, mineType(type), quality)),
6215
6261
  canvasSaveAs: (canvas, filename, quality) => {
6216
6262
  const url = canvas.toDataURL(mineType(fileType(filename)), quality);
@@ -6255,14 +6301,14 @@ function useCanvas(_canvasType, _power) {
6255
6301
  Platform.name = 'web';
6256
6302
  Platform.isMobile = 'ontouchstart' in window;
6257
6303
  Platform.requestRender = function (render) { window.requestAnimationFrame(render); };
6258
- defineKey(Platform, 'devicePixelRatio', { get() { return Math.max(1, devicePixelRatio); } });
6304
+ defineKey(Platform, 'devicePixelRatio', { get() { return devicePixelRatio; } });
6259
6305
  const { userAgent } = navigator;
6260
6306
  if (userAgent.indexOf("Firefox") > -1) {
6261
6307
  Platform.conicGradientRotate90 = true;
6262
6308
  Platform.intWheelDeltaY = true;
6263
6309
  Platform.syncDomFont = true;
6264
6310
  }
6265
- else if (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") === -1) {
6311
+ else if (userAgent.indexOf("AppleWebKit") > -1) {
6266
6312
  Platform.fullImageShadow = true;
6267
6313
  }
6268
6314
  if (userAgent.indexOf('Windows') > -1) {
@@ -6531,7 +6577,7 @@ class Layouter {
6531
6577
  }
6532
6578
  partLayout() {
6533
6579
  var _a;
6534
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6580
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6535
6581
  return;
6536
6582
  const t = Run.start('PartLayout');
6537
6583
  const { target, __updatedList: updateList } = this;
@@ -6900,9 +6946,7 @@ const TextConvert = {};
6900
6946
  const ColorConvert = {};
6901
6947
  const UnitConvert = {
6902
6948
  number(value, percentRefer) {
6903
- if (typeof value === 'object')
6904
- return value.type === 'percent' ? value.value * percentRefer : value.value;
6905
- return value;
6949
+ return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
6906
6950
  }
6907
6951
  };
6908
6952
  const PathArrow = {};
@@ -6910,16 +6954,15 @@ const Paint = {};
6910
6954
  const PaintImage = {};
6911
6955
  const PaintGradient = {};
6912
6956
  const Effect = {};
6957
+ const Filter = {
6958
+ apply() { Plugin.need('filter'); }
6959
+ };
6913
6960
  const Export = {};
6914
6961
  const State = {
6915
- setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
6916
- set(_leaf, _stateName) { return Plugin.need('state'); }
6917
- };
6918
- const Transition = {
6919
- list: {},
6920
- register(attrName, fn) { Transition.list[attrName] = fn; },
6921
- get(attrName) { return Transition.list[attrName]; }
6962
+ setStyleName() { return Plugin.need('state'); },
6963
+ set() { return Plugin.need('state'); }
6922
6964
  };
6965
+ const Transition = {};
6923
6966
 
6924
6967
  const { parse, objectToCanvasData } = PathConvert;
6925
6968
  const emptyPaint = {};
@@ -7026,24 +7069,13 @@ class UIData extends LeafData {
7026
7069
  }
7027
7070
  }
7028
7071
  setShadow(value) {
7029
- this.__setInput('shadow', value);
7030
- if (value instanceof Array) {
7031
- if (value.some((item) => item.visible === false))
7032
- value = value.filter((item) => item.visible !== false);
7033
- this._shadow = value.length ? value : null;
7034
- }
7035
- else
7036
- this._shadow = value && value.visible !== false ? [value] : null;
7072
+ setArray(this, 'shadow', value);
7037
7073
  }
7038
7074
  setInnerShadow(value) {
7039
- this.__setInput('innerShadow', value);
7040
- if (value instanceof Array) {
7041
- if (value.some((item) => item.visible === false))
7042
- value = value.filter((item) => item.visible !== false);
7043
- this._innerShadow = value.length ? value : null;
7044
- }
7045
- else
7046
- this._innerShadow = value && value.visible !== false ? [value] : null;
7075
+ setArray(this, 'innerShadow', value);
7076
+ }
7077
+ setFilter(value) {
7078
+ setArray(this, 'filter', value);
7047
7079
  }
7048
7080
  __computePaint() {
7049
7081
  const { fill, stroke } = this.__input;
@@ -7054,6 +7086,17 @@ class UIData extends LeafData {
7054
7086
  this.__needComputePaint = false;
7055
7087
  }
7056
7088
  }
7089
+ function setArray(data, key, value) {
7090
+ data.__setInput(key, value);
7091
+ if (value instanceof Array) {
7092
+ if (value.some((item) => item.visible === false))
7093
+ value = value.filter((item) => item.visible !== false);
7094
+ value.length || (value = null);
7095
+ }
7096
+ else
7097
+ value = value && value.visible !== false ? [value] : null;
7098
+ data['_' + key] = value;
7099
+ }
7057
7100
 
7058
7101
  class GroupData extends UIData {
7059
7102
  }
@@ -7176,11 +7219,13 @@ const UIBounds = {
7176
7219
  },
7177
7220
  __updateRenderSpread() {
7178
7221
  let width = 0;
7179
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7222
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7180
7223
  if (shadow)
7181
7224
  shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5));
7182
7225
  if (blur)
7183
7226
  width = Math.max(width, blur);
7227
+ if (filter)
7228
+ width += Filter.getSpread(filter);
7184
7229
  let shapeWidth = width = Math.ceil(width);
7185
7230
  if (innerShadow)
7186
7231
  innerShadow.forEach(item => shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5));
@@ -7195,8 +7240,8 @@ const UIRender = {
7195
7240
  __updateChange() {
7196
7241
  const data = this.__;
7197
7242
  if (data.__useEffect) {
7198
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7199
- data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
7243
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7244
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
7200
7245
  }
7201
7246
  data.__checkSingle();
7202
7247
  const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
@@ -7210,7 +7255,7 @@ const UIRender = {
7210
7255
  __drawFast(canvas, options) {
7211
7256
  drawFast(this, canvas, options);
7212
7257
  },
7213
- __draw(canvas, options) {
7258
+ __draw(canvas, options, originCanvas) {
7214
7259
  const data = this.__;
7215
7260
  if (data.__complex) {
7216
7261
  if (data.__needComputePaint)
@@ -7220,7 +7265,7 @@ const UIRender = {
7220
7265
  if (data.__useEffect) {
7221
7266
  const shape = Paint.shape(this, canvas, options);
7222
7267
  this.__nowWorld = this.__getNowWorld(options);
7223
- const { shadow, innerShadow } = data;
7268
+ const { shadow, innerShadow, filter } = data;
7224
7269
  if (shadow)
7225
7270
  Effect.shadow(this, canvas, shape);
7226
7271
  if (fill)
@@ -7231,6 +7276,8 @@ const UIRender = {
7231
7276
  Effect.innerShadow(this, canvas, shape);
7232
7277
  if (stroke)
7233
7278
  data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
7279
+ if (filter)
7280
+ Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
7234
7281
  if (shape.worldCanvas)
7235
7282
  shape.worldCanvas.recycle();
7236
7283
  shape.canvas.recycle();
@@ -7450,199 +7497,202 @@ let UI = UI_1 = class UI extends Leaf {
7450
7497
  };
7451
7498
  __decorate([
7452
7499
  dataProcessor(UIData)
7453
- ], UI.prototype, "__", undefined);
7500
+ ], UI.prototype, "__", void 0);
7454
7501
  __decorate([
7455
7502
  zoomLayerType()
7456
- ], UI.prototype, "zoomLayer", undefined);
7503
+ ], UI.prototype, "zoomLayer", void 0);
7457
7504
  __decorate([
7458
7505
  dataType('')
7459
- ], UI.prototype, "id", undefined);
7506
+ ], UI.prototype, "id", void 0);
7460
7507
  __decorate([
7461
7508
  dataType('')
7462
- ], UI.prototype, "name", undefined);
7509
+ ], UI.prototype, "name", void 0);
7463
7510
  __decorate([
7464
7511
  dataType('')
7465
- ], UI.prototype, "className", undefined);
7512
+ ], UI.prototype, "className", void 0);
7466
7513
  __decorate([
7467
7514
  surfaceType('pass-through')
7468
- ], UI.prototype, "blendMode", undefined);
7515
+ ], UI.prototype, "blendMode", void 0);
7469
7516
  __decorate([
7470
7517
  opacityType(1)
7471
- ], UI.prototype, "opacity", undefined);
7518
+ ], UI.prototype, "opacity", void 0);
7472
7519
  __decorate([
7473
7520
  visibleType(true)
7474
- ], UI.prototype, "visible", undefined);
7521
+ ], UI.prototype, "visible", void 0);
7475
7522
  __decorate([
7476
7523
  surfaceType(false)
7477
- ], UI.prototype, "locked", undefined);
7524
+ ], UI.prototype, "locked", void 0);
7478
7525
  __decorate([
7479
7526
  sortType(0)
7480
- ], UI.prototype, "zIndex", undefined);
7527
+ ], UI.prototype, "zIndex", void 0);
7481
7528
  __decorate([
7482
7529
  maskType(false)
7483
- ], UI.prototype, "mask", undefined);
7530
+ ], UI.prototype, "mask", void 0);
7484
7531
  __decorate([
7485
7532
  eraserType(false)
7486
- ], UI.prototype, "eraser", undefined);
7533
+ ], UI.prototype, "eraser", void 0);
7487
7534
  __decorate([
7488
7535
  positionType(0, true)
7489
- ], UI.prototype, "x", undefined);
7536
+ ], UI.prototype, "x", void 0);
7490
7537
  __decorate([
7491
7538
  positionType(0, true)
7492
- ], UI.prototype, "y", undefined);
7539
+ ], UI.prototype, "y", void 0);
7493
7540
  __decorate([
7494
7541
  boundsType(100, true)
7495
- ], UI.prototype, "width", undefined);
7542
+ ], UI.prototype, "width", void 0);
7496
7543
  __decorate([
7497
7544
  boundsType(100, true)
7498
- ], UI.prototype, "height", undefined);
7545
+ ], UI.prototype, "height", void 0);
7499
7546
  __decorate([
7500
7547
  scaleType(1, true)
7501
- ], UI.prototype, "scaleX", undefined);
7548
+ ], UI.prototype, "scaleX", void 0);
7502
7549
  __decorate([
7503
7550
  scaleType(1, true)
7504
- ], UI.prototype, "scaleY", undefined);
7551
+ ], UI.prototype, "scaleY", void 0);
7505
7552
  __decorate([
7506
7553
  rotationType(0, true)
7507
- ], UI.prototype, "rotation", undefined);
7554
+ ], UI.prototype, "rotation", void 0);
7508
7555
  __decorate([
7509
7556
  rotationType(0, true)
7510
- ], UI.prototype, "skewX", undefined);
7557
+ ], UI.prototype, "skewX", void 0);
7511
7558
  __decorate([
7512
7559
  rotationType(0, true)
7513
- ], UI.prototype, "skewY", undefined);
7560
+ ], UI.prototype, "skewY", void 0);
7514
7561
  __decorate([
7515
7562
  positionType(0, true)
7516
- ], UI.prototype, "offsetX", undefined);
7563
+ ], UI.prototype, "offsetX", void 0);
7517
7564
  __decorate([
7518
7565
  positionType(0, true)
7519
- ], UI.prototype, "offsetY", undefined);
7566
+ ], UI.prototype, "offsetY", void 0);
7520
7567
  __decorate([
7521
7568
  positionType(0, true)
7522
- ], UI.prototype, "scrollX", undefined);
7569
+ ], UI.prototype, "scrollX", void 0);
7523
7570
  __decorate([
7524
7571
  positionType(0, true)
7525
- ], UI.prototype, "scrollY", undefined);
7572
+ ], UI.prototype, "scrollY", void 0);
7526
7573
  __decorate([
7527
7574
  autoLayoutType()
7528
- ], UI.prototype, "origin", undefined);
7575
+ ], UI.prototype, "origin", void 0);
7529
7576
  __decorate([
7530
7577
  autoLayoutType()
7531
- ], UI.prototype, "around", undefined);
7578
+ ], UI.prototype, "around", void 0);
7532
7579
  __decorate([
7533
7580
  dataType(false)
7534
- ], UI.prototype, "lazy", undefined);
7581
+ ], UI.prototype, "lazy", void 0);
7535
7582
  __decorate([
7536
7583
  naturalBoundsType(1)
7537
- ], UI.prototype, "pixelRatio", undefined);
7584
+ ], UI.prototype, "pixelRatio", void 0);
7538
7585
  __decorate([
7539
7586
  pathInputType()
7540
- ], UI.prototype, "path", undefined);
7587
+ ], UI.prototype, "path", void 0);
7541
7588
  __decorate([
7542
7589
  pathType()
7543
- ], UI.prototype, "windingRule", undefined);
7590
+ ], UI.prototype, "windingRule", void 0);
7544
7591
  __decorate([
7545
7592
  pathType(true)
7546
- ], UI.prototype, "closed", undefined);
7593
+ ], UI.prototype, "closed", void 0);
7547
7594
  __decorate([
7548
7595
  boundsType(0)
7549
- ], UI.prototype, "padding", undefined);
7596
+ ], UI.prototype, "padding", void 0);
7550
7597
  __decorate([
7551
7598
  boundsType(false)
7552
- ], UI.prototype, "lockRatio", undefined);
7599
+ ], UI.prototype, "lockRatio", void 0);
7553
7600
  __decorate([
7554
7601
  boundsType()
7555
- ], UI.prototype, "widthRange", undefined);
7602
+ ], UI.prototype, "widthRange", void 0);
7556
7603
  __decorate([
7557
7604
  boundsType()
7558
- ], UI.prototype, "heightRange", undefined);
7605
+ ], UI.prototype, "heightRange", void 0);
7559
7606
  __decorate([
7560
7607
  dataType(false)
7561
- ], UI.prototype, "draggable", undefined);
7608
+ ], UI.prototype, "draggable", void 0);
7562
7609
  __decorate([
7563
7610
  dataType()
7564
- ], UI.prototype, "dragBounds", undefined);
7611
+ ], UI.prototype, "dragBounds", void 0);
7565
7612
  __decorate([
7566
7613
  dataType(false)
7567
- ], UI.prototype, "editable", undefined);
7614
+ ], UI.prototype, "editable", void 0);
7568
7615
  __decorate([
7569
7616
  hitType(true)
7570
- ], UI.prototype, "hittable", undefined);
7617
+ ], UI.prototype, "hittable", void 0);
7571
7618
  __decorate([
7572
7619
  hitType('path')
7573
- ], UI.prototype, "hitFill", undefined);
7620
+ ], UI.prototype, "hitFill", void 0);
7574
7621
  __decorate([
7575
7622
  strokeType('path')
7576
- ], UI.prototype, "hitStroke", undefined);
7623
+ ], UI.prototype, "hitStroke", void 0);
7577
7624
  __decorate([
7578
7625
  hitType(false)
7579
- ], UI.prototype, "hitBox", undefined);
7626
+ ], UI.prototype, "hitBox", void 0);
7580
7627
  __decorate([
7581
7628
  hitType(true)
7582
- ], UI.prototype, "hitChildren", undefined);
7629
+ ], UI.prototype, "hitChildren", void 0);
7583
7630
  __decorate([
7584
7631
  hitType(true)
7585
- ], UI.prototype, "hitSelf", undefined);
7632
+ ], UI.prototype, "hitSelf", void 0);
7586
7633
  __decorate([
7587
7634
  hitType()
7588
- ], UI.prototype, "hitRadius", undefined);
7635
+ ], UI.prototype, "hitRadius", void 0);
7589
7636
  __decorate([
7590
7637
  cursorType('')
7591
- ], UI.prototype, "cursor", undefined);
7638
+ ], UI.prototype, "cursor", void 0);
7592
7639
  __decorate([
7593
7640
  surfaceType()
7594
- ], UI.prototype, "fill", undefined);
7641
+ ], UI.prototype, "fill", void 0);
7595
7642
  __decorate([
7596
7643
  strokeType()
7597
- ], UI.prototype, "stroke", undefined);
7644
+ ], UI.prototype, "stroke", void 0);
7598
7645
  __decorate([
7599
7646
  strokeType('inside')
7600
- ], UI.prototype, "strokeAlign", undefined);
7647
+ ], UI.prototype, "strokeAlign", void 0);
7601
7648
  __decorate([
7602
7649
  strokeType(1)
7603
- ], UI.prototype, "strokeWidth", undefined);
7650
+ ], UI.prototype, "strokeWidth", void 0);
7604
7651
  __decorate([
7605
7652
  strokeType(false)
7606
- ], UI.prototype, "strokeWidthFixed", undefined);
7653
+ ], UI.prototype, "strokeWidthFixed", void 0);
7607
7654
  __decorate([
7608
7655
  strokeType('none')
7609
- ], UI.prototype, "strokeCap", undefined);
7656
+ ], UI.prototype, "strokeCap", void 0);
7610
7657
  __decorate([
7611
7658
  strokeType('miter')
7612
- ], UI.prototype, "strokeJoin", undefined);
7659
+ ], UI.prototype, "strokeJoin", void 0);
7613
7660
  __decorate([
7614
7661
  strokeType()
7615
- ], UI.prototype, "dashPattern", undefined);
7662
+ ], UI.prototype, "dashPattern", void 0);
7616
7663
  __decorate([
7617
7664
  strokeType()
7618
- ], UI.prototype, "dashOffset", undefined);
7665
+ ], UI.prototype, "dashOffset", void 0);
7619
7666
  __decorate([
7620
7667
  strokeType(10)
7621
- ], UI.prototype, "miterLimit", undefined);
7668
+ ], UI.prototype, "miterLimit", void 0);
7622
7669
  __decorate([
7623
7670
  pathType(0)
7624
- ], UI.prototype, "cornerRadius", undefined);
7671
+ ], UI.prototype, "cornerRadius", void 0);
7625
7672
  __decorate([
7626
7673
  pathType()
7627
- ], UI.prototype, "cornerSmoothing", undefined);
7674
+ ], UI.prototype, "cornerSmoothing", void 0);
7675
+ __decorate([
7676
+ effectType()
7677
+ ], UI.prototype, "shadow", void 0);
7628
7678
  __decorate([
7629
7679
  effectType()
7630
- ], UI.prototype, "shadow", undefined);
7680
+ ], UI.prototype, "innerShadow", void 0);
7631
7681
  __decorate([
7632
7682
  effectType()
7633
- ], UI.prototype, "innerShadow", undefined);
7683
+ ], UI.prototype, "blur", void 0);
7634
7684
  __decorate([
7635
7685
  effectType()
7636
- ], UI.prototype, "blur", undefined);
7686
+ ], UI.prototype, "backgroundBlur", void 0);
7637
7687
  __decorate([
7638
7688
  effectType()
7639
- ], UI.prototype, "backgroundBlur", undefined);
7689
+ ], UI.prototype, "grayscale", void 0);
7640
7690
  __decorate([
7641
7691
  effectType()
7642
- ], UI.prototype, "grayscale", undefined);
7692
+ ], UI.prototype, "filter", void 0);
7643
7693
  __decorate([
7644
7694
  dataType({})
7645
- ], UI.prototype, "data", undefined);
7695
+ ], UI.prototype, "data", void 0);
7646
7696
  __decorate([
7647
7697
  rewrite(Leaf.prototype.reset)
7648
7698
  ], UI.prototype, "reset", null);
@@ -7703,7 +7753,7 @@ let Group = class Group extends UI {
7703
7753
  };
7704
7754
  __decorate([
7705
7755
  dataProcessor(GroupData)
7706
- ], Group.prototype, "__", undefined);
7756
+ ], Group.prototype, "__", void 0);
7707
7757
  Group = __decorate([
7708
7758
  useModule(Branch),
7709
7759
  registerUI()
@@ -7716,7 +7766,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7716
7766
  get isApp() { return false; }
7717
7767
  get app() { return this.parent || this; }
7718
7768
  get isLeafer() { return true; }
7719
- get imageReady() { return this.viewReady && ImageManager.isComplete; }
7769
+ get imageReady() { return this.viewReady && Resource.isComplete; }
7720
7770
  get layoutLocked() { return !this.layouter.running; }
7721
7771
  get FPS() { return this.renderer ? this.renderer.FPS : 60; }
7722
7772
  get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
@@ -7927,13 +7977,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7927
7977
  WaitHelper.run(this.__viewReadyWait);
7928
7978
  }
7929
7979
  __onLayoutEnd() {
7930
- const { grow, growWidth, growHeight } = this.config;
7980
+ const { grow, width: fixedWidth, height: fixedHeight } = this.config;
7931
7981
  if (grow) {
7932
7982
  let { width, height, pixelRatio } = this;
7933
7983
  const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7934
- if (growWidth !== false)
7984
+ if (!fixedWidth)
7935
7985
  width = Math.max(1, bounds.x + bounds.width);
7936
- if (growHeight !== false)
7986
+ if (!fixedHeight)
7937
7987
  height = Math.max(1, bounds.y + bounds.height);
7938
7988
  this.__doResize({ width, height, pixelRatio });
7939
7989
  }
@@ -8011,7 +8061,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8011
8061
  list.push(item);
8012
8062
  this.requestRender();
8013
8063
  }
8014
- zoom(_zoomType, _padding, _fixedScale) {
8064
+ zoom(_zoomType, _padding, _fixedScale, _transition) {
8015
8065
  return Plugin.need('view');
8016
8066
  }
8017
8067
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
@@ -8076,10 +8126,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8076
8126
  Leafer.list = new LeafList();
8077
8127
  __decorate([
8078
8128
  dataProcessor(LeaferData)
8079
- ], Leafer.prototype, "__", undefined);
8129
+ ], Leafer.prototype, "__", void 0);
8080
8130
  __decorate([
8081
8131
  boundsType()
8082
- ], Leafer.prototype, "pixelRatio", undefined);
8132
+ ], Leafer.prototype, "pixelRatio", void 0);
8083
8133
  Leafer = Leafer_1 = __decorate([
8084
8134
  registerUI()
8085
8135
  ], Leafer);
@@ -8092,7 +8142,7 @@ let Rect = class Rect extends UI {
8092
8142
  };
8093
8143
  __decorate([
8094
8144
  dataProcessor(RectData)
8095
- ], Rect.prototype, "__", undefined);
8145
+ ], Rect.prototype, "__", void 0);
8096
8146
  Rect = __decorate([
8097
8147
  useModule(RectRender),
8098
8148
  rewriteAble(),
@@ -8183,13 +8233,13 @@ let Box = class Box extends Group {
8183
8233
  };
8184
8234
  __decorate([
8185
8235
  dataProcessor(BoxData)
8186
- ], Box.prototype, "__", undefined);
8236
+ ], Box.prototype, "__", void 0);
8187
8237
  __decorate([
8188
8238
  dataType(false)
8189
- ], Box.prototype, "resizeChildren", undefined);
8239
+ ], Box.prototype, "resizeChildren", void 0);
8190
8240
  __decorate([
8191
8241
  affectRenderBoundsType('show')
8192
- ], Box.prototype, "overflow", undefined);
8242
+ ], Box.prototype, "overflow", void 0);
8193
8243
  __decorate([
8194
8244
  rewrite(rect.__updateStrokeSpread)
8195
8245
  ], Box.prototype, "__updateStrokeSpread", null);
@@ -8228,13 +8278,13 @@ let Frame = class Frame extends Box {
8228
8278
  };
8229
8279
  __decorate([
8230
8280
  dataProcessor(FrameData)
8231
- ], Frame.prototype, "__", undefined);
8281
+ ], Frame.prototype, "__", void 0);
8232
8282
  __decorate([
8233
8283
  surfaceType('#FFFFFF')
8234
- ], Frame.prototype, "fill", undefined);
8284
+ ], Frame.prototype, "fill", void 0);
8235
8285
  __decorate([
8236
8286
  affectRenderBoundsType('hide')
8237
- ], Frame.prototype, "overflow", undefined);
8287
+ ], Frame.prototype, "overflow", void 0);
8238
8288
  Frame = __decorate([
8239
8289
  registerUI()
8240
8290
  ], Frame);
@@ -8281,16 +8331,16 @@ let Ellipse = class Ellipse extends UI {
8281
8331
  };
8282
8332
  __decorate([
8283
8333
  dataProcessor(EllipseData)
8284
- ], Ellipse.prototype, "__", undefined);
8334
+ ], Ellipse.prototype, "__", void 0);
8285
8335
  __decorate([
8286
8336
  pathType(0)
8287
- ], Ellipse.prototype, "innerRadius", undefined);
8337
+ ], Ellipse.prototype, "innerRadius", void 0);
8288
8338
  __decorate([
8289
8339
  pathType(0)
8290
- ], Ellipse.prototype, "startAngle", undefined);
8340
+ ], Ellipse.prototype, "startAngle", void 0);
8291
8341
  __decorate([
8292
8342
  pathType(0)
8293
- ], Ellipse.prototype, "endAngle", undefined);
8343
+ ], Ellipse.prototype, "endAngle", void 0);
8294
8344
  Ellipse = __decorate([
8295
8345
  registerUI()
8296
8346
  ], Ellipse);
@@ -8349,22 +8399,22 @@ let Line = class Line extends UI {
8349
8399
  };
8350
8400
  __decorate([
8351
8401
  dataProcessor(LineData)
8352
- ], Line.prototype, "__", undefined);
8402
+ ], Line.prototype, "__", void 0);
8353
8403
  __decorate([
8354
8404
  affectStrokeBoundsType('center')
8355
- ], Line.prototype, "strokeAlign", undefined);
8405
+ ], Line.prototype, "strokeAlign", void 0);
8356
8406
  __decorate([
8357
8407
  boundsType(0)
8358
- ], Line.prototype, "height", undefined);
8408
+ ], Line.prototype, "height", void 0);
8359
8409
  __decorate([
8360
8410
  pathType()
8361
- ], Line.prototype, "points", undefined);
8411
+ ], Line.prototype, "points", void 0);
8362
8412
  __decorate([
8363
8413
  pathType(0)
8364
- ], Line.prototype, "curve", undefined);
8414
+ ], Line.prototype, "curve", void 0);
8365
8415
  __decorate([
8366
8416
  pathType(false)
8367
- ], Line.prototype, "closed", undefined);
8417
+ ], Line.prototype, "closed", void 0);
8368
8418
  Line = __decorate([
8369
8419
  registerUI()
8370
8420
  ], Line);
@@ -8397,16 +8447,16 @@ let Polygon = class Polygon extends UI {
8397
8447
  };
8398
8448
  __decorate([
8399
8449
  dataProcessor(PolygonData)
8400
- ], Polygon.prototype, "__", undefined);
8450
+ ], Polygon.prototype, "__", void 0);
8401
8451
  __decorate([
8402
8452
  pathType(3)
8403
- ], Polygon.prototype, "sides", undefined);
8453
+ ], Polygon.prototype, "sides", void 0);
8404
8454
  __decorate([
8405
8455
  pathType()
8406
- ], Polygon.prototype, "points", undefined);
8456
+ ], Polygon.prototype, "points", void 0);
8407
8457
  __decorate([
8408
8458
  pathType(0)
8409
- ], Polygon.prototype, "curve", undefined);
8459
+ ], Polygon.prototype, "curve", void 0);
8410
8460
  __decorate([
8411
8461
  rewrite(line.__updateRenderPath)
8412
8462
  ], Polygon.prototype, "__updateRenderPath", null);
@@ -8438,13 +8488,13 @@ let Star = class Star extends UI {
8438
8488
  };
8439
8489
  __decorate([
8440
8490
  dataProcessor(StarData)
8441
- ], Star.prototype, "__", undefined);
8491
+ ], Star.prototype, "__", void 0);
8442
8492
  __decorate([
8443
8493
  pathType(5)
8444
- ], Star.prototype, "corners", undefined);
8494
+ ], Star.prototype, "corners", void 0);
8445
8495
  __decorate([
8446
8496
  pathType(0.382)
8447
- ], Star.prototype, "innerRadius", undefined);
8497
+ ], Star.prototype, "innerRadius", void 0);
8448
8498
  Star = __decorate([
8449
8499
  registerUI()
8450
8500
  ], Star);
@@ -8466,10 +8516,10 @@ let Image$1 = class Image extends Rect {
8466
8516
  };
8467
8517
  __decorate([
8468
8518
  dataProcessor(ImageData)
8469
- ], Image$1.prototype, "__", undefined);
8519
+ ], Image$1.prototype, "__", void 0);
8470
8520
  __decorate([
8471
8521
  boundsType('')
8472
- ], Image$1.prototype, "url", undefined);
8522
+ ], Image$1.prototype, "url", void 0);
8473
8523
  Image$1 = __decorate([
8474
8524
  registerUI()
8475
8525
  ], Image$1);
@@ -8532,25 +8582,25 @@ let Canvas = class Canvas extends Rect {
8532
8582
  };
8533
8583
  __decorate([
8534
8584
  dataProcessor(CanvasData)
8535
- ], Canvas.prototype, "__", undefined);
8585
+ ], Canvas.prototype, "__", void 0);
8536
8586
  __decorate([
8537
8587
  resizeType(100)
8538
- ], Canvas.prototype, "width", undefined);
8588
+ ], Canvas.prototype, "width", void 0);
8539
8589
  __decorate([
8540
8590
  resizeType(100)
8541
- ], Canvas.prototype, "height", undefined);
8591
+ ], Canvas.prototype, "height", void 0);
8542
8592
  __decorate([
8543
8593
  resizeType(1)
8544
- ], Canvas.prototype, "pixelRatio", undefined);
8594
+ ], Canvas.prototype, "pixelRatio", void 0);
8545
8595
  __decorate([
8546
8596
  resizeType(true)
8547
- ], Canvas.prototype, "smooth", undefined);
8597
+ ], Canvas.prototype, "smooth", void 0);
8548
8598
  __decorate([
8549
8599
  dataType(false)
8550
- ], Canvas.prototype, "safeResize", undefined);
8600
+ ], Canvas.prototype, "safeResize", void 0);
8551
8601
  __decorate([
8552
8602
  resizeType()
8553
- ], Canvas.prototype, "contextSettings", undefined);
8603
+ ], Canvas.prototype, "contextSettings", void 0);
8554
8604
  Canvas = __decorate([
8555
8605
  registerUI()
8556
8606
  ], Canvas);
@@ -8641,76 +8691,76 @@ let Text = class Text extends UI {
8641
8691
  };
8642
8692
  __decorate([
8643
8693
  dataProcessor(TextData)
8644
- ], Text.prototype, "__", undefined);
8694
+ ], Text.prototype, "__", void 0);
8645
8695
  __decorate([
8646
8696
  boundsType(0)
8647
- ], Text.prototype, "width", undefined);
8697
+ ], Text.prototype, "width", void 0);
8648
8698
  __decorate([
8649
8699
  boundsType(0)
8650
- ], Text.prototype, "height", undefined);
8700
+ ], Text.prototype, "height", void 0);
8651
8701
  __decorate([
8652
8702
  dataType(false)
8653
- ], Text.prototype, "resizeFontSize", undefined);
8703
+ ], Text.prototype, "resizeFontSize", void 0);
8654
8704
  __decorate([
8655
8705
  surfaceType('#000000')
8656
- ], Text.prototype, "fill", undefined);
8706
+ ], Text.prototype, "fill", void 0);
8657
8707
  __decorate([
8658
8708
  affectStrokeBoundsType('outside')
8659
- ], Text.prototype, "strokeAlign", undefined);
8709
+ ], Text.prototype, "strokeAlign", void 0);
8660
8710
  __decorate([
8661
8711
  hitType('all')
8662
- ], Text.prototype, "hitFill", undefined);
8712
+ ], Text.prototype, "hitFill", void 0);
8663
8713
  __decorate([
8664
8714
  boundsType('')
8665
- ], Text.prototype, "text", undefined);
8715
+ ], Text.prototype, "text", void 0);
8666
8716
  __decorate([
8667
8717
  boundsType('caption')
8668
- ], Text.prototype, "fontFamily", undefined);
8718
+ ], Text.prototype, "fontFamily", void 0);
8669
8719
  __decorate([
8670
8720
  boundsType(12)
8671
- ], Text.prototype, "fontSize", undefined);
8721
+ ], Text.prototype, "fontSize", void 0);
8672
8722
  __decorate([
8673
8723
  boundsType('normal')
8674
- ], Text.prototype, "fontWeight", undefined);
8724
+ ], Text.prototype, "fontWeight", void 0);
8675
8725
  __decorate([
8676
8726
  boundsType(false)
8677
- ], Text.prototype, "italic", undefined);
8727
+ ], Text.prototype, "italic", void 0);
8678
8728
  __decorate([
8679
8729
  boundsType('none')
8680
- ], Text.prototype, "textCase", undefined);
8730
+ ], Text.prototype, "textCase", void 0);
8681
8731
  __decorate([
8682
8732
  boundsType('none')
8683
- ], Text.prototype, "textDecoration", undefined);
8733
+ ], Text.prototype, "textDecoration", void 0);
8684
8734
  __decorate([
8685
8735
  boundsType(0)
8686
- ], Text.prototype, "letterSpacing", undefined);
8736
+ ], Text.prototype, "letterSpacing", void 0);
8687
8737
  __decorate([
8688
8738
  boundsType({ type: 'percent', value: 1.5 })
8689
- ], Text.prototype, "lineHeight", undefined);
8739
+ ], Text.prototype, "lineHeight", void 0);
8690
8740
  __decorate([
8691
8741
  boundsType(0)
8692
- ], Text.prototype, "paraIndent", undefined);
8742
+ ], Text.prototype, "paraIndent", void 0);
8693
8743
  __decorate([
8694
8744
  boundsType(0)
8695
- ], Text.prototype, "paraSpacing", undefined);
8745
+ ], Text.prototype, "paraSpacing", void 0);
8696
8746
  __decorate([
8697
8747
  boundsType('x')
8698
- ], Text.prototype, "writingMode", undefined);
8748
+ ], Text.prototype, "writingMode", void 0);
8699
8749
  __decorate([
8700
8750
  boundsType('left')
8701
- ], Text.prototype, "textAlign", undefined);
8751
+ ], Text.prototype, "textAlign", void 0);
8702
8752
  __decorate([
8703
8753
  boundsType('top')
8704
- ], Text.prototype, "verticalAlign", undefined);
8754
+ ], Text.prototype, "verticalAlign", void 0);
8705
8755
  __decorate([
8706
8756
  boundsType(true)
8707
- ], Text.prototype, "autoSizeAlign", undefined);
8757
+ ], Text.prototype, "autoSizeAlign", void 0);
8708
8758
  __decorate([
8709
8759
  boundsType('normal')
8710
- ], Text.prototype, "textWrap", undefined);
8760
+ ], Text.prototype, "textWrap", void 0);
8711
8761
  __decorate([
8712
8762
  boundsType('show')
8713
- ], Text.prototype, "textOverflow", undefined);
8763
+ ], Text.prototype, "textOverflow", void 0);
8714
8764
  Text = __decorate([
8715
8765
  registerUI()
8716
8766
  ], Text);
@@ -8723,10 +8773,10 @@ let Path = class Path extends UI {
8723
8773
  };
8724
8774
  __decorate([
8725
8775
  dataProcessor(PathData)
8726
- ], Path.prototype, "__", undefined);
8776
+ ], Path.prototype, "__", void 0);
8727
8777
  __decorate([
8728
8778
  affectStrokeBoundsType('center')
8729
- ], Path.prototype, "strokeAlign", undefined);
8779
+ ], Path.prototype, "strokeAlign", void 0);
8730
8780
  Path = __decorate([
8731
8781
  registerUI()
8732
8782
  ], Path);
@@ -8765,10 +8815,10 @@ let Pen = class Pen extends Group {
8765
8815
  };
8766
8816
  __decorate([
8767
8817
  dataProcessor(PenData)
8768
- ], Pen.prototype, "__", undefined);
8818
+ ], Pen.prototype, "__", void 0);
8769
8819
  __decorate([
8770
8820
  penPathType()
8771
- ], Pen.prototype, "path", undefined);
8821
+ ], Pen.prototype, "path", void 0);
8772
8822
  Pen = __decorate([
8773
8823
  useModule(PathCreator, ['set', 'path', 'paint']),
8774
8824
  registerUI()
@@ -9140,7 +9190,7 @@ function getPatternData(paint, box, image) {
9140
9190
  box = tempBox.set(box).shrink(paint.padding);
9141
9191
  if (paint.mode === 'strench')
9142
9192
  paint.mode = 'stretch';
9143
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
9193
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
9144
9194
  const sameBox = box.width === width && box.height === height;
9145
9195
  const data = { mode };
9146
9196
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -9203,6 +9253,8 @@ function getPatternData(paint, box, image) {
9203
9253
  data.height = height;
9204
9254
  if (opacity)
9205
9255
  data.opacity = opacity;
9256
+ if (filters)
9257
+ data.filters = filters;
9206
9258
  if (repeat)
9207
9259
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
9208
9260
  return data;
@@ -9305,7 +9357,7 @@ function createPattern(ui, paint, pixelRatio) {
9305
9357
  scaleX = abs$1(scaleX);
9306
9358
  scaleY = abs$1(scaleY);
9307
9359
  const { image, data } = paint;
9308
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
9360
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
9309
9361
  if (sx) {
9310
9362
  imageMatrix = get$1();
9311
9363
  copy$1(imageMatrix, transform);
@@ -9348,7 +9400,7 @@ function createPattern(ui, paint, pixelRatio) {
9348
9400
  }
9349
9401
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
9350
9402
  }
9351
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
9403
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
9352
9404
  const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
9353
9405
  paint.style = pattern;
9354
9406
  paint.patternId = id;
@@ -9392,7 +9444,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
9392
9444
  canvas.opacity *= data.opacity;
9393
9445
  if (data.transform)
9394
9446
  canvas.transform(data.transform);
9395
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
9447
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
9396
9448
  canvas.restore();
9397
9449
  return true;
9398
9450
  }
@@ -9402,7 +9454,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
9402
9454
  }
9403
9455
  else {
9404
9456
  if (!paint.patternTask) {
9405
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
9457
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9406
9458
  paint.patternTask = null;
9407
9459
  if (canvas.bounds.hit(ui.__nowWorld))
9408
9460
  createPattern(ui, paint, pixelRatio);
@@ -9992,11 +10044,11 @@ const TextMode = 2;
9992
10044
  function layoutChar(drawData, style, width, _height) {
9993
10045
  const { rows } = drawData;
9994
10046
  const { textAlign, paraIndent, letterSpacing } = style;
9995
- let charX, addWordWidth, indentWidth, mode, wordChar;
10047
+ let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
9996
10048
  rows.forEach(row => {
9997
10049
  if (row.words) {
9998
- indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
9999
- addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
10050
+ indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
10051
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
10000
10052
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
10001
10053
  if (row.isOverflow && !letterSpacing)
10002
10054
  row.textMode = true;
@@ -10008,7 +10060,7 @@ function layoutChar(drawData, style, width, _height) {
10008
10060
  row.x += indentWidth;
10009
10061
  charX = row.x;
10010
10062
  row.data = [];
10011
- row.words.forEach(word => {
10063
+ row.words.forEach((word, index) => {
10012
10064
  if (mode === WordMode) {
10013
10065
  wordChar = { char: '', x: charX };
10014
10066
  charX = toWordChar(word.data, charX, wordChar);
@@ -10018,7 +10070,7 @@ function layoutChar(drawData, style, width, _height) {
10018
10070
  else {
10019
10071
  charX = toChar(word.data, charX, row.data, row.isOverflow);
10020
10072
  }
10021
- if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
10073
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
10022
10074
  charX += addWordWidth;
10023
10075
  row.width += addWordWidth;
10024
10076
  }
@@ -10269,4 +10321,5 @@ Object.assign(Effect, EffectModule);
10269
10321
 
10270
10322
  useCanvas();
10271
10323
 
10272
- export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, Image$1 as Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
10324
+ export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, Image$1 as Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
10325
+ //# sourceMappingURL=web.module.js.map