@leafer-ui/worker 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.
package/dist/worker.js CHANGED
@@ -1377,7 +1377,7 @@ var LeaferUI = (function (exports) {
1377
1377
  }
1378
1378
  const D$4 = Debug;
1379
1379
 
1380
- const debug$e = Debug.get('RunTime');
1380
+ const debug$f = Debug.get('RunTime');
1381
1381
  const Run = {
1382
1382
  currentId: 0,
1383
1383
  currentName: '',
@@ -1386,24 +1386,24 @@ var LeaferUI = (function (exports) {
1386
1386
  nameToIdMap: {},
1387
1387
  start(name, microsecond) {
1388
1388
  const id = IncrementId.create(IncrementId.RUNTIME);
1389
- R.currentId = R.idMap[id] = microsecond ? performance.now() : Date.now();
1390
- R.currentName = R.nameMap[id] = name;
1391
- R.nameToIdMap[name] = id;
1389
+ R$1.currentId = R$1.idMap[id] = microsecond ? performance.now() : Date.now();
1390
+ R$1.currentName = R$1.nameMap[id] = name;
1391
+ R$1.nameToIdMap[name] = id;
1392
1392
  return id;
1393
1393
  },
1394
1394
  end(id, microsecond) {
1395
- const time = R.idMap[id], name = R.nameMap[id];
1395
+ const time = R$1.idMap[id], name = R$1.nameMap[id];
1396
1396
  const duration = microsecond ? (performance.now() - time) / 1000 : Date.now() - time;
1397
- R.idMap[id] = R.nameMap[id] = R.nameToIdMap[name] = undefined;
1398
- debug$e.log(name, duration, 'ms');
1397
+ R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
1398
+ debug$f.log(name, duration, 'ms');
1399
1399
  },
1400
1400
  endOfName(name, microsecond) {
1401
- const id = R.nameToIdMap[name];
1401
+ const id = R$1.nameToIdMap[name];
1402
1402
  if (id !== undefined)
1403
- R.end(id, microsecond);
1403
+ R$1.end(id, microsecond);
1404
1404
  }
1405
1405
  };
1406
- const R = Run;
1406
+ const R$1 = Run;
1407
1407
 
1408
1408
  const check = [];
1409
1409
  const Plugin = {
@@ -1424,18 +1424,18 @@ var LeaferUI = (function (exports) {
1424
1424
  };
1425
1425
  setTimeout(() => check.forEach(name => Plugin.has(name, true)));
1426
1426
 
1427
- const debug$d = Debug.get('UICreator');
1427
+ const debug$e = Debug.get('UICreator');
1428
1428
  const UICreator = {
1429
1429
  list: {},
1430
1430
  register(UI) {
1431
1431
  const { __tag: tag } = UI.prototype;
1432
1432
  if (list$1[tag])
1433
- debug$d.repeat(tag);
1433
+ debug$e.repeat(tag);
1434
1434
  list$1[tag] = UI;
1435
1435
  },
1436
1436
  get(tag, data, x, y, width, height) {
1437
1437
  if (!list$1[tag])
1438
- debug$d.error('not register ' + tag);
1438
+ debug$e.error('not register ' + tag);
1439
1439
  const ui = new list$1[tag](data);
1440
1440
  if (x !== undefined) {
1441
1441
  ui.x = x;
@@ -1451,7 +1451,7 @@ var LeaferUI = (function (exports) {
1451
1451
  };
1452
1452
  const { list: list$1 } = UICreator;
1453
1453
 
1454
- const debug$c = Debug.get('EventCreator');
1454
+ const debug$d = Debug.get('EventCreator');
1455
1455
  const EventCreator = {
1456
1456
  nameList: {},
1457
1457
  register(Event) {
@@ -1459,7 +1459,7 @@ var LeaferUI = (function (exports) {
1459
1459
  Object.keys(Event).forEach(key => {
1460
1460
  name = Event[key];
1461
1461
  if (typeof name === 'string')
1462
- nameList[name] && debug$c.repeat(name), nameList[name] = Event;
1462
+ nameList[name] && debug$d.repeat(name), nameList[name] = Event;
1463
1463
  });
1464
1464
  },
1465
1465
  changeName(oldName, newName) {
@@ -1536,10 +1536,10 @@ var LeaferUI = (function (exports) {
1536
1536
  Object.keys(merge).forEach(key => {
1537
1537
  var _a, _b;
1538
1538
  value = merge[key];
1539
- if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
1539
+ if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1540
1540
  return assign(t[key], merge[key], exclude && exclude[key]);
1541
1541
  if (exclude && (key in exclude)) {
1542
- if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
1542
+ if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1543
1543
  assign(t[key] = {}, merge[key], exclude[key]);
1544
1544
  return;
1545
1545
  }
@@ -1663,7 +1663,7 @@ var LeaferUI = (function (exports) {
1663
1663
  const t = this;
1664
1664
  if (t.blendMode === 'pass-through') {
1665
1665
  const leaf = this.__leaf;
1666
- if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser) {
1666
+ if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser || t.filter) {
1667
1667
  t.__single = true;
1668
1668
  }
1669
1669
  else if (t.__single) {
@@ -1776,7 +1776,7 @@ var LeaferUI = (function (exports) {
1776
1776
  }
1777
1777
  setTransform(_a, _b, _c, _d, _e, _f) { }
1778
1778
  resetTransform() { }
1779
- getTransform() { return undefined; }
1779
+ getTransform() { return void 0; }
1780
1780
  save() { }
1781
1781
  restore() { }
1782
1782
  transform(a, b, c, d, e, f) {
@@ -1833,12 +1833,12 @@ var LeaferUI = (function (exports) {
1833
1833
  ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
1834
1834
  rect(_x, _y, _width, _height) { }
1835
1835
  roundRect(_x, _y, _width, _height, _radius) { }
1836
- createConicGradient(_startAngle, _x, _y) { return undefined; }
1837
- createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
1838
- createPattern(_image, _repetition) { return undefined; }
1839
- createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
1836
+ createConicGradient(_startAngle, _x, _y) { return void 0; }
1837
+ createLinearGradient(_x0, _y0, _x1, _y1) { return void 0; }
1838
+ createPattern(_image, _repetition) { return void 0; }
1839
+ createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return void 0; }
1840
1840
  fillText(_text, _x, _y, _maxWidth) { }
1841
- measureText(_text) { return undefined; }
1841
+ measureText(_text) { return void 0; }
1842
1842
  strokeText(_text, _x, _y, _maxWidth) { }
1843
1843
  destroy() {
1844
1844
  this.context = null;
@@ -1846,79 +1846,79 @@ var LeaferUI = (function (exports) {
1846
1846
  }
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingEnabled')
1849
- ], Canvas.prototype, "smooth", undefined);
1849
+ ], Canvas.prototype, "smooth", void 0);
1850
1850
  __decorate([
1851
1851
  contextAttr('imageSmoothingQuality')
1852
- ], Canvas.prototype, "smoothLevel", undefined);
1852
+ ], Canvas.prototype, "smoothLevel", void 0);
1853
1853
  __decorate([
1854
1854
  contextAttr('globalAlpha')
1855
- ], Canvas.prototype, "opacity", undefined);
1855
+ ], Canvas.prototype, "opacity", void 0);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas.prototype, "fillStyle", undefined);
1858
+ ], Canvas.prototype, "fillStyle", void 0);
1859
1859
  __decorate([
1860
1860
  contextAttr()
1861
- ], Canvas.prototype, "strokeStyle", undefined);
1861
+ ], Canvas.prototype, "strokeStyle", void 0);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineWidth')
1864
- ], Canvas.prototype, "strokeWidth", undefined);
1864
+ ], Canvas.prototype, "strokeWidth", void 0);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineCap')
1867
- ], Canvas.prototype, "strokeCap", undefined);
1867
+ ], Canvas.prototype, "strokeCap", void 0);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineJoin')
1870
- ], Canvas.prototype, "strokeJoin", undefined);
1870
+ ], Canvas.prototype, "strokeJoin", void 0);
1871
1871
  __decorate([
1872
1872
  contextAttr('lineDashOffset')
1873
- ], Canvas.prototype, "dashOffset", undefined);
1873
+ ], Canvas.prototype, "dashOffset", void 0);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas.prototype, "miterLimit", undefined);
1876
+ ], Canvas.prototype, "miterLimit", void 0);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas.prototype, "shadowBlur", undefined);
1879
+ ], Canvas.prototype, "shadowBlur", void 0);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas.prototype, "shadowColor", undefined);
1882
+ ], Canvas.prototype, "shadowColor", void 0);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas.prototype, "shadowOffsetX", undefined);
1885
+ ], Canvas.prototype, "shadowOffsetX", void 0);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas.prototype, "shadowOffsetY", undefined);
1888
+ ], Canvas.prototype, "shadowOffsetY", void 0);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas.prototype, "filter", undefined);
1891
+ ], Canvas.prototype, "filter", void 0);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas.prototype, "font", undefined);
1894
+ ], Canvas.prototype, "font", void 0);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas.prototype, "fontKerning", undefined);
1897
+ ], Canvas.prototype, "fontKerning", void 0);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas.prototype, "fontStretch", undefined);
1900
+ ], Canvas.prototype, "fontStretch", void 0);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas.prototype, "fontVariantCaps", undefined);
1903
+ ], Canvas.prototype, "fontVariantCaps", void 0);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas.prototype, "textAlign", undefined);
1906
+ ], Canvas.prototype, "textAlign", void 0);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas.prototype, "textBaseline", undefined);
1909
+ ], Canvas.prototype, "textBaseline", void 0);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas.prototype, "textRendering", undefined);
1912
+ ], Canvas.prototype, "textRendering", void 0);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas.prototype, "wordSpacing", undefined);
1915
+ ], Canvas.prototype, "wordSpacing", void 0);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas.prototype, "letterSpacing", undefined);
1918
+ ], Canvas.prototype, "letterSpacing", void 0);
1919
1919
  __decorate([
1920
1920
  contextAttr()
1921
- ], Canvas.prototype, "direction", undefined);
1921
+ ], Canvas.prototype, "direction", void 0);
1922
1922
  __decorate([
1923
1923
  contextMethod()
1924
1924
  ], Canvas.prototype, "setTransform", null);
@@ -2615,7 +2615,7 @@ var LeaferUI = (function (exports) {
2615
2615
  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;
2616
2616
  const { rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
2617
2617
  const { ellipticalArc } = EllipseHelper;
2618
- const debug$b = Debug.get('PathConvert');
2618
+ const debug$c = Debug.get('PathConvert');
2619
2619
  const setEndPoint$1 = {};
2620
2620
  const PathConvert = {
2621
2621
  current: { dot: 0 },
@@ -2856,7 +2856,7 @@ var LeaferUI = (function (exports) {
2856
2856
  i += 6;
2857
2857
  break;
2858
2858
  default:
2859
- debug$b.error(`command: ${command} [index:${i}]`, old);
2859
+ debug$c.error(`command: ${command} [index:${i}]`, old);
2860
2860
  return data;
2861
2861
  }
2862
2862
  lastCommand = command;
@@ -2965,12 +2965,10 @@ var LeaferUI = (function (exports) {
2965
2965
  },
2966
2966
  arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
2967
2967
  if (lastX !== undefined) {
2968
- const maxRadius = tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2) * (getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / 2);
2969
- data.push(U$2, x1, y1, x2, y2, min(radius, abs$2(maxRadius)));
2970
- }
2971
- else {
2972
- data.push(U$2, x1, y1, x2, y2, radius);
2968
+ const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
2969
+ radius = min(radius, min(d / 2, d / 2 * abs$2(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
2973
2970
  }
2971
+ data.push(U$2, x1, y1, x2, y2, radius);
2974
2972
  },
2975
2973
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
2976
2974
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, rotation === undefined ? 0 : rotation, startAngle === undefined ? 0 : startAngle, endAngle === undefined ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3081,7 +3079,7 @@ var LeaferUI = (function (exports) {
3081
3079
  }
3082
3080
 
3083
3081
  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;
3084
- const debug$a = Debug.get('PathDrawer');
3082
+ const debug$b = Debug.get('PathDrawer');
3085
3083
  const PathDrawer = {
3086
3084
  drawPathByData(drawer, data) {
3087
3085
  if (!data)
@@ -3144,7 +3142,7 @@ var LeaferUI = (function (exports) {
3144
3142
  i += 6;
3145
3143
  break;
3146
3144
  default:
3147
- debug$a.error(`command: ${command} [index:${i}]`, data);
3145
+ debug$b.error(`command: ${command} [index:${i}]`, data);
3148
3146
  return;
3149
3147
  }
3150
3148
  }
@@ -3154,7 +3152,7 @@ var LeaferUI = (function (exports) {
3154
3152
  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;
3155
3153
  const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
3156
3154
  const { addPointBounds, copy: copy$8, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
3157
- const debug$9 = Debug.get('PathBounds');
3155
+ const debug$a = Debug.get('PathBounds');
3158
3156
  let radius, radiusX, radiusY;
3159
3157
  const tempPointBounds = {};
3160
3158
  const setPointBounds = {};
@@ -3262,7 +3260,7 @@ var LeaferUI = (function (exports) {
3262
3260
  i += 6;
3263
3261
  break;
3264
3262
  default:
3265
- debug$9.error(`command: ${command} [index:${i}]`, data);
3263
+ debug$a.error(`command: ${command} [index:${i}]`, data);
3266
3264
  return;
3267
3265
  }
3268
3266
  }
@@ -3378,7 +3376,7 @@ var LeaferUI = (function (exports) {
3378
3376
  const F = FileHelper;
3379
3377
  F.opacityTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
3380
3378
 
3381
- const debug$8 = Debug.get('TaskProcessor');
3379
+ const debug$9 = Debug.get('TaskProcessor');
3382
3380
  class TaskItem {
3383
3381
  constructor(task) {
3384
3382
  this.parallel = true;
@@ -3387,13 +3385,13 @@ var LeaferUI = (function (exports) {
3387
3385
  this.task = task;
3388
3386
  }
3389
3387
  run() {
3390
- return __awaiter(this, undefined, undefined, function* () {
3388
+ return __awaiter(this, void 0, void 0, function* () {
3391
3389
  try {
3392
3390
  if (this.task && !this.isComplete && this.parent.running)
3393
3391
  yield this.task();
3394
3392
  }
3395
3393
  catch (error) {
3396
- debug$8.error(error);
3394
+ debug$9.error(error);
3397
3395
  }
3398
3396
  });
3399
3397
  }
@@ -3626,18 +3624,52 @@ var LeaferUI = (function (exports) {
3626
3624
  }
3627
3625
  }
3628
3626
 
3629
- const ImageManager = {
3627
+ const debug$8 = Debug.get('Resource');
3628
+ const Resource = {
3629
+ tasker: new TaskProcessor(),
3630
3630
  map: {},
3631
+ get isComplete() { return R.tasker.isComplete; },
3632
+ set(key, value) {
3633
+ if (R.map[key])
3634
+ debug$8.repeat(key);
3635
+ R.map[key] = value;
3636
+ },
3637
+ get(key) {
3638
+ return R.map[key];
3639
+ },
3640
+ remove(key) {
3641
+ delete R.map[key];
3642
+ },
3643
+ loadImage(key, format) {
3644
+ return new Promise((resolve, reject) => {
3645
+ const image = this.setImage(key, key, format);
3646
+ image.load(() => resolve(image), (e) => reject(e));
3647
+ });
3648
+ },
3649
+ setImage(key, value, format) {
3650
+ let config;
3651
+ if (typeof value === 'string')
3652
+ config = { url: value };
3653
+ else if (!value.url)
3654
+ config = { url: key, view: value };
3655
+ if (config)
3656
+ format && (config.format = format), value = Creator.image(config);
3657
+ R.set(key, value);
3658
+ return value;
3659
+ },
3660
+ destroy() {
3661
+ R.map = {};
3662
+ }
3663
+ };
3664
+ const R = Resource;
3665
+
3666
+ const ImageManager = {
3631
3667
  recycledList: [],
3632
- tasker: new TaskProcessor(),
3633
3668
  patternTasker: new TaskProcessor(),
3634
- get isComplete() { return I$1.tasker.isComplete; },
3635
3669
  get(config) {
3636
- let image = I$1.map[config.url];
3637
- if (!image) {
3638
- image = Creator.image(config);
3639
- I$1.map[config.url] = image;
3640
- }
3670
+ let image = Resource.get(config.url);
3671
+ if (!image)
3672
+ Resource.set(config.url, image = Creator.image(config));
3641
3673
  image.use++;
3642
3674
  return image;
3643
3675
  },
@@ -3651,7 +3683,7 @@ var LeaferUI = (function (exports) {
3651
3683
  if (list.length > 100) {
3652
3684
  list.forEach(image => {
3653
3685
  if (!image.use && image.url) {
3654
- delete I$1.map[image.url];
3686
+ Resource.remove(image.url);
3655
3687
  image.destroy();
3656
3688
  }
3657
3689
  });
@@ -3678,7 +3710,6 @@ var LeaferUI = (function (exports) {
3678
3710
  return false;
3679
3711
  },
3680
3712
  destroy() {
3681
- I$1.map = {};
3682
3713
  I$1.recycledList = [];
3683
3714
  }
3684
3715
  };
@@ -3692,21 +3723,19 @@ var LeaferUI = (function (exports) {
3692
3723
  this.use = 0;
3693
3724
  this.waitComplete = [];
3694
3725
  this.innerId = create$1(IMAGE);
3695
- this.config = config || { url: '' };
3696
- this.isSVG = ImageManager.isFormat('svg', config);
3697
- this.hasOpacityPixel = ImageManager.hasOpacityPixel(config);
3726
+ this.config = config || (config = { url: '' });
3727
+ if (config.view) {
3728
+ const { view } = config;
3729
+ this.setView(view.config ? view.view : view);
3730
+ }
3731
+ ImageManager.isFormat('svg', config) && (this.isSVG = true);
3732
+ ImageManager.hasOpacityPixel(config) && (this.hasOpacityPixel = true);
3698
3733
  }
3699
3734
  load(onSuccess, onError) {
3700
3735
  if (!this.loading) {
3701
3736
  this.loading = true;
3702
- ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3703
- return yield Platform.origin.loadImage(this.url).then((img) => {
3704
- this.ready = true;
3705
- this.width = img.naturalWidth || img.width;
3706
- this.height = img.naturalHeight || img.height;
3707
- this.view = img;
3708
- this.onComplete(true);
3709
- }).catch((e) => {
3737
+ Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3738
+ return yield Platform.origin.loadImage(this.url).then(img => this.setView(img)).catch((e) => {
3710
3739
  this.error = e;
3711
3740
  this.onComplete(false);
3712
3741
  });
@@ -3724,6 +3753,13 @@ var LeaferUI = (function (exports) {
3724
3753
  }
3725
3754
  l[index] = l[index + 1] = undefined;
3726
3755
  }
3756
+ setView(img) {
3757
+ this.ready = true;
3758
+ this.width = img.naturalWidth || img.width;
3759
+ this.height = img.naturalHeight || img.height;
3760
+ this.view = img;
3761
+ this.onComplete(true);
3762
+ }
3727
3763
  onComplete(isSuccess) {
3728
3764
  let odd;
3729
3765
  this.waitComplete.forEach((item, index) => {
@@ -3742,6 +3778,9 @@ var LeaferUI = (function (exports) {
3742
3778
  this.waitComplete.length = 0;
3743
3779
  this.loading = false;
3744
3780
  }
3781
+ getFull(_filters) {
3782
+ return this.view;
3783
+ }
3745
3784
  getCanvas(width, height, opacity, _filters) {
3746
3785
  width || (width = this.width);
3747
3786
  height || (height = this.height);
@@ -3824,10 +3863,10 @@ var LeaferUI = (function (exports) {
3824
3863
  return decorateLeafAttr(defaultValue, (key) => attr({
3825
3864
  set(value) {
3826
3865
  if (this.__setAttr(key, value)) {
3827
- this.__layout.matrixChanged || this.__layout.matrixChange();
3828
3866
  this.__hasAutoLayout = !!(this.origin || this.around || this.flow);
3829
3867
  if (!this.__local)
3830
3868
  this.__layout.createLocal();
3869
+ doBoundsType(this);
3831
3870
  }
3832
3871
  }
3833
3872
  }));
@@ -4210,55 +4249,62 @@ var LeaferUI = (function (exports) {
4210
4249
  y += t.y;
4211
4250
  transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
4212
4251
  },
4213
- zoomOfWorld(t, origin, scaleX, scaleY, resize) {
4214
- L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
4252
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4253
+ L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4215
4254
  },
4216
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize) {
4217
- copy$7(matrix$1, t.__localMatrix);
4255
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4256
+ const o = t.__localMatrix;
4257
+ if (typeof scaleY !== 'number') {
4258
+ if (scaleY)
4259
+ transition = scaleY;
4260
+ scaleY = scaleX;
4261
+ }
4262
+ copy$7(matrix$1, o);
4218
4263
  scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
4219
4264
  if (t.origin || t.around) {
4220
- L.setTransform(t, matrix$1, resize);
4265
+ L.setTransform(t, matrix$1, resize, transition);
4221
4266
  }
4222
4267
  else {
4223
- moveByMatrix(t, matrix$1);
4224
- t.scaleResize(scaleX, scaleY, resize !== true);
4268
+ const x = t.x + matrix$1.e - o.e, y = t.y + matrix$1.f - o.f;
4269
+ if (transition && !resize)
4270
+ t.animate({ x, y, scaleX: t.scaleX * scaleX, scaleY: t.scaleY * scaleY }, transition);
4271
+ else
4272
+ t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4225
4273
  }
4226
4274
  },
4227
- rotateOfWorld(t, origin, angle) {
4228
- L.rotateOfLocal(t, getTempLocal(t, origin), angle);
4275
+ rotateOfWorld(t, origin, angle, transition) {
4276
+ L.rotateOfLocal(t, getTempLocal(t, origin), angle, transition);
4229
4277
  },
4230
- rotateOfLocal(t, origin, angle) {
4231
- copy$7(matrix$1, t.__localMatrix);
4278
+ rotateOfLocal(t, origin, angle, transition) {
4279
+ const o = t.__localMatrix;
4280
+ copy$7(matrix$1, o);
4232
4281
  rotateOfOuter$2(matrix$1, origin, angle);
4233
- if (t.origin || t.around) {
4234
- L.setTransform(t, matrix$1);
4235
- }
4236
- else {
4237
- moveByMatrix(t, matrix$1);
4238
- t.rotation = MathHelper.formatRotation(t.rotation + angle);
4239
- }
4282
+ if (t.origin || t.around)
4283
+ L.setTransform(t, matrix$1, false, transition);
4284
+ else
4285
+ t.set({ x: t.x + matrix$1.e - o.e, y: t.y + matrix$1.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition);
4240
4286
  },
4241
- skewOfWorld(t, origin, skewX, skewY, resize) {
4242
- L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
4287
+ skewOfWorld(t, origin, skewX, skewY, resize, transition) {
4288
+ L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
4243
4289
  },
4244
- skewOfLocal(t, origin, skewX, skewY = 0, resize) {
4290
+ skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
4245
4291
  copy$7(matrix$1, t.__localMatrix);
4246
4292
  skewOfOuter(matrix$1, origin, skewX, skewY);
4247
- L.setTransform(t, matrix$1, resize);
4293
+ L.setTransform(t, matrix$1, resize, transition);
4248
4294
  },
4249
- transformWorld(t, transform, resize) {
4295
+ transformWorld(t, transform, resize, transition) {
4250
4296
  copy$7(matrix$1, t.worldTransform);
4251
4297
  multiplyParent$2(matrix$1, transform);
4252
4298
  if (t.parent)
4253
4299
  divideParent(matrix$1, t.parent.worldTransform);
4254
- L.setTransform(t, matrix$1, resize);
4300
+ L.setTransform(t, matrix$1, resize, transition);
4255
4301
  },
4256
- transform(t, transform, resize) {
4302
+ transform(t, transform, resize, transition) {
4257
4303
  copy$7(matrix$1, t.localTransform);
4258
4304
  multiplyParent$2(matrix$1, transform);
4259
- L.setTransform(t, matrix$1, resize);
4305
+ L.setTransform(t, matrix$1, resize, transition);
4260
4306
  },
4261
- setTransform(t, transform, resize) {
4307
+ setTransform(t, transform, resize, transition) {
4262
4308
  const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
4263
4309
  const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
4264
4310
  if (resize) {
@@ -4273,7 +4319,7 @@ var LeaferUI = (function (exports) {
4273
4319
  t.scaleResize(scaleX, scaleY, false);
4274
4320
  }
4275
4321
  else
4276
- t.set(layout);
4322
+ t.set(layout, transition);
4277
4323
  },
4278
4324
  getFlipTransform(t, axis) {
4279
4325
  const m = getMatrixData();
@@ -4310,11 +4356,6 @@ var LeaferUI = (function (exports) {
4310
4356
  };
4311
4357
  const L = LeafHelper;
4312
4358
  const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$2, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L;
4313
- function moveByMatrix(t, matrix) {
4314
- const { e, f } = t.__localMatrix;
4315
- t.x += matrix.e - e;
4316
- t.y += matrix.f - f;
4317
- }
4318
4359
  function getTempLocal(t, world) {
4319
4360
  t.__layout.update();
4320
4361
  return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
@@ -5220,7 +5261,7 @@ var LeaferUI = (function (exports) {
5220
5261
  if (this.__.eraser === 'path')
5221
5262
  return this.__renderEraser(canvas, options);
5222
5263
  const tempCanvas = canvas.getSameCanvas(true, true);
5223
- this.__draw(tempCanvas, options);
5264
+ this.__draw(tempCanvas, options, canvas);
5224
5265
  if (this.__worldFlipped) {
5225
5266
  canvas.copyWorldByReset(tempCanvas, this.__nowWorld, null, this.__.__blendMode, true);
5226
5267
  }
@@ -5588,11 +5629,11 @@ var LeaferUI = (function (exports) {
5588
5629
  const layer = this.leafer ? this.leafer.zoomLayer : this;
5589
5630
  return layer.getWorldPoint(page, relative, distance, change);
5590
5631
  }
5591
- setTransform(matrix, resize) {
5592
- setTransform(this, matrix, resize);
5632
+ setTransform(matrix, resize, transition) {
5633
+ setTransform(this, matrix, resize, transition);
5593
5634
  }
5594
- transform(matrix, resize) {
5595
- transform(this, matrix, resize);
5635
+ transform(matrix, resize, transition) {
5636
+ transform(this, matrix, resize, transition);
5596
5637
  }
5597
5638
  move(x, y, transition) {
5598
5639
  moveLocal(this, x, y, transition);
@@ -5600,32 +5641,32 @@ var LeaferUI = (function (exports) {
5600
5641
  moveInner(x, y, transition) {
5601
5642
  moveWorld(this, x, y, true, transition);
5602
5643
  }
5603
- scaleOf(origin, scaleX, scaleY, resize) {
5604
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
5644
+ scaleOf(origin, scaleX, scaleY, resize, transition) {
5645
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
5605
5646
  }
5606
- rotateOf(origin, rotation) {
5607
- rotateOfLocal(this, getLocalOrigin(this, origin), rotation);
5647
+ rotateOf(origin, rotation, transition) {
5648
+ rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
5608
5649
  }
5609
- skewOf(origin, skewX, skewY, resize) {
5610
- skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize);
5650
+ skewOf(origin, skewX, skewY, resize, transition) {
5651
+ skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
5611
5652
  }
5612
- transformWorld(worldTransform, resize) {
5613
- transformWorld(this, worldTransform, resize);
5653
+ transformWorld(worldTransform, resize, transition) {
5654
+ transformWorld(this, worldTransform, resize, transition);
5614
5655
  }
5615
5656
  moveWorld(x, y, transition) {
5616
5657
  moveWorld(this, x, y, false, transition);
5617
5658
  }
5618
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
5619
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
5659
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
5660
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
5620
5661
  }
5621
5662
  rotateOfWorld(worldOrigin, rotation) {
5622
5663
  rotateOfWorld(this, worldOrigin, rotation);
5623
5664
  }
5624
- skewOfWorld(worldOrigin, skewX, skewY, resize) {
5625
- skewOfWorld(this, worldOrigin, skewX, skewY, resize);
5665
+ skewOfWorld(worldOrigin, skewX, skewY, resize, transition) {
5666
+ skewOfWorld(this, worldOrigin, skewX, skewY, resize, transition);
5626
5667
  }
5627
- flip(axis) {
5628
- transform(this, getFlipTransform(this, axis));
5668
+ flip(axis, transition) {
5669
+ transform(this, getFlipTransform(this, axis), false, transition);
5629
5670
  }
5630
5671
  scaleResize(scaleX, scaleY = scaleX, _noResize) {
5631
5672
  this.scaleX *= scaleX;
@@ -6013,7 +6054,7 @@ var LeaferUI = (function (exports) {
6013
6054
  }
6014
6055
  }
6015
6056
 
6016
- const version = "1.3.3";
6057
+ const version = "1.4.1";
6017
6058
 
6018
6059
  class LeaferCanvas extends LeaferCanvasBase {
6019
6060
  get allowBackgroundColor() { return true; }
@@ -6358,7 +6399,7 @@ var LeaferUI = (function (exports) {
6358
6399
  }
6359
6400
  partLayout() {
6360
6401
  var _a;
6361
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6402
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6362
6403
  return;
6363
6404
  const t = Run.start('PartLayout');
6364
6405
  const { target, __updatedList: updateList } = this;
@@ -6823,9 +6864,10 @@ var LeaferUI = (function (exports) {
6823
6864
  this.finder = Creator.finder && Creator.finder();
6824
6865
  }
6825
6866
  getByPoint(hitPoint, hitRadius, options) {
6826
- if (Platform.backgrounder && this.target)
6827
- this.target.updateLayout();
6828
- return this.picker.getByPoint(hitPoint, hitRadius, options);
6867
+ const { target, picker } = this;
6868
+ if (Platform.backgrounder)
6869
+ target && target.updateLayout();
6870
+ return picker.getByPoint(hitPoint, hitRadius, options);
6829
6871
  }
6830
6872
  getBy(condition, branch, one, options) {
6831
6873
  return this.finder ? this.finder.getBy(condition, branch, one, options) : Plugin.need('find');
@@ -6883,9 +6925,7 @@ var LeaferUI = (function (exports) {
6883
6925
  const ColorConvert = {};
6884
6926
  const UnitConvert = {
6885
6927
  number(value, percentRefer) {
6886
- if (typeof value === 'object')
6887
- return value.type === 'percent' ? value.value * percentRefer : value.value;
6888
- return value;
6928
+ return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
6889
6929
  }
6890
6930
  };
6891
6931
  const PathArrow = {};
@@ -6893,16 +6933,15 @@ var LeaferUI = (function (exports) {
6893
6933
  const PaintImage = {};
6894
6934
  const PaintGradient = {};
6895
6935
  const Effect = {};
6936
+ const Filter = {
6937
+ apply() { Plugin.need('filter'); }
6938
+ };
6896
6939
  const Export = {};
6897
6940
  const State = {
6898
- setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
6899
- set(_leaf, _stateName) { return Plugin.need('state'); }
6900
- };
6901
- const Transition = {
6902
- list: {},
6903
- register(attrName, fn) { Transition.list[attrName] = fn; },
6904
- get(attrName) { return Transition.list[attrName]; }
6941
+ setStyleName() { return Plugin.need('state'); },
6942
+ set() { return Plugin.need('state'); }
6905
6943
  };
6944
+ const Transition = {};
6906
6945
 
6907
6946
  const { parse, objectToCanvasData } = PathConvert;
6908
6947
  const emptyPaint = {};
@@ -7009,24 +7048,13 @@ var LeaferUI = (function (exports) {
7009
7048
  }
7010
7049
  }
7011
7050
  setShadow(value) {
7012
- this.__setInput('shadow', value);
7013
- if (value instanceof Array) {
7014
- if (value.some((item) => item.visible === false))
7015
- value = value.filter((item) => item.visible !== false);
7016
- this._shadow = value.length ? value : null;
7017
- }
7018
- else
7019
- this._shadow = value && value.visible !== false ? [value] : null;
7051
+ setArray(this, 'shadow', value);
7020
7052
  }
7021
7053
  setInnerShadow(value) {
7022
- this.__setInput('innerShadow', value);
7023
- if (value instanceof Array) {
7024
- if (value.some((item) => item.visible === false))
7025
- value = value.filter((item) => item.visible !== false);
7026
- this._innerShadow = value.length ? value : null;
7027
- }
7028
- else
7029
- this._innerShadow = value && value.visible !== false ? [value] : null;
7054
+ setArray(this, 'innerShadow', value);
7055
+ }
7056
+ setFilter(value) {
7057
+ setArray(this, 'filter', value);
7030
7058
  }
7031
7059
  __computePaint() {
7032
7060
  const { fill, stroke } = this.__input;
@@ -7037,6 +7065,17 @@ var LeaferUI = (function (exports) {
7037
7065
  this.__needComputePaint = false;
7038
7066
  }
7039
7067
  }
7068
+ function setArray(data, key, value) {
7069
+ data.__setInput(key, value);
7070
+ if (value instanceof Array) {
7071
+ if (value.some((item) => item.visible === false))
7072
+ value = value.filter((item) => item.visible !== false);
7073
+ value.length || (value = null);
7074
+ }
7075
+ else
7076
+ value = value && value.visible !== false ? [value] : null;
7077
+ data['_' + key] = value;
7078
+ }
7040
7079
 
7041
7080
  class GroupData extends UIData {
7042
7081
  }
@@ -7159,11 +7198,13 @@ var LeaferUI = (function (exports) {
7159
7198
  },
7160
7199
  __updateRenderSpread() {
7161
7200
  let width = 0;
7162
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7201
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7163
7202
  if (shadow)
7164
7203
  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));
7165
7204
  if (blur)
7166
7205
  width = Math.max(width, blur);
7206
+ if (filter)
7207
+ width += Filter.getSpread(filter);
7167
7208
  let shapeWidth = width = Math.ceil(width);
7168
7209
  if (innerShadow)
7169
7210
  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));
@@ -7178,8 +7219,8 @@ var LeaferUI = (function (exports) {
7178
7219
  __updateChange() {
7179
7220
  const data = this.__;
7180
7221
  if (data.__useEffect) {
7181
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7182
- data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
7222
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7223
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
7183
7224
  }
7184
7225
  data.__checkSingle();
7185
7226
  const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
@@ -7193,7 +7234,7 @@ var LeaferUI = (function (exports) {
7193
7234
  __drawFast(canvas, options) {
7194
7235
  drawFast(this, canvas, options);
7195
7236
  },
7196
- __draw(canvas, options) {
7237
+ __draw(canvas, options, originCanvas) {
7197
7238
  const data = this.__;
7198
7239
  if (data.__complex) {
7199
7240
  if (data.__needComputePaint)
@@ -7203,7 +7244,7 @@ var LeaferUI = (function (exports) {
7203
7244
  if (data.__useEffect) {
7204
7245
  const shape = Paint.shape(this, canvas, options);
7205
7246
  this.__nowWorld = this.__getNowWorld(options);
7206
- const { shadow, innerShadow } = data;
7247
+ const { shadow, innerShadow, filter } = data;
7207
7248
  if (shadow)
7208
7249
  Effect.shadow(this, canvas, shape);
7209
7250
  if (fill)
@@ -7214,6 +7255,8 @@ var LeaferUI = (function (exports) {
7214
7255
  Effect.innerShadow(this, canvas, shape);
7215
7256
  if (stroke)
7216
7257
  data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
7258
+ if (filter)
7259
+ Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
7217
7260
  if (shape.worldCanvas)
7218
7261
  shape.worldCanvas.recycle();
7219
7262
  shape.canvas.recycle();
@@ -7433,199 +7476,202 @@ var LeaferUI = (function (exports) {
7433
7476
  };
7434
7477
  __decorate([
7435
7478
  dataProcessor(UIData)
7436
- ], exports.UI.prototype, "__", undefined);
7479
+ ], exports.UI.prototype, "__", void 0);
7437
7480
  __decorate([
7438
7481
  zoomLayerType()
7439
- ], exports.UI.prototype, "zoomLayer", undefined);
7482
+ ], exports.UI.prototype, "zoomLayer", void 0);
7440
7483
  __decorate([
7441
7484
  dataType('')
7442
- ], exports.UI.prototype, "id", undefined);
7485
+ ], exports.UI.prototype, "id", void 0);
7443
7486
  __decorate([
7444
7487
  dataType('')
7445
- ], exports.UI.prototype, "name", undefined);
7488
+ ], exports.UI.prototype, "name", void 0);
7446
7489
  __decorate([
7447
7490
  dataType('')
7448
- ], exports.UI.prototype, "className", undefined);
7491
+ ], exports.UI.prototype, "className", void 0);
7449
7492
  __decorate([
7450
7493
  surfaceType('pass-through')
7451
- ], exports.UI.prototype, "blendMode", undefined);
7494
+ ], exports.UI.prototype, "blendMode", void 0);
7452
7495
  __decorate([
7453
7496
  opacityType(1)
7454
- ], exports.UI.prototype, "opacity", undefined);
7497
+ ], exports.UI.prototype, "opacity", void 0);
7455
7498
  __decorate([
7456
7499
  visibleType(true)
7457
- ], exports.UI.prototype, "visible", undefined);
7500
+ ], exports.UI.prototype, "visible", void 0);
7458
7501
  __decorate([
7459
7502
  surfaceType(false)
7460
- ], exports.UI.prototype, "locked", undefined);
7503
+ ], exports.UI.prototype, "locked", void 0);
7461
7504
  __decorate([
7462
7505
  sortType(0)
7463
- ], exports.UI.prototype, "zIndex", undefined);
7506
+ ], exports.UI.prototype, "zIndex", void 0);
7464
7507
  __decorate([
7465
7508
  maskType(false)
7466
- ], exports.UI.prototype, "mask", undefined);
7509
+ ], exports.UI.prototype, "mask", void 0);
7467
7510
  __decorate([
7468
7511
  eraserType(false)
7469
- ], exports.UI.prototype, "eraser", undefined);
7512
+ ], exports.UI.prototype, "eraser", void 0);
7470
7513
  __decorate([
7471
7514
  positionType(0, true)
7472
- ], exports.UI.prototype, "x", undefined);
7515
+ ], exports.UI.prototype, "x", void 0);
7473
7516
  __decorate([
7474
7517
  positionType(0, true)
7475
- ], exports.UI.prototype, "y", undefined);
7518
+ ], exports.UI.prototype, "y", void 0);
7476
7519
  __decorate([
7477
7520
  boundsType(100, true)
7478
- ], exports.UI.prototype, "width", undefined);
7521
+ ], exports.UI.prototype, "width", void 0);
7479
7522
  __decorate([
7480
7523
  boundsType(100, true)
7481
- ], exports.UI.prototype, "height", undefined);
7524
+ ], exports.UI.prototype, "height", void 0);
7482
7525
  __decorate([
7483
7526
  scaleType(1, true)
7484
- ], exports.UI.prototype, "scaleX", undefined);
7527
+ ], exports.UI.prototype, "scaleX", void 0);
7485
7528
  __decorate([
7486
7529
  scaleType(1, true)
7487
- ], exports.UI.prototype, "scaleY", undefined);
7530
+ ], exports.UI.prototype, "scaleY", void 0);
7488
7531
  __decorate([
7489
7532
  rotationType(0, true)
7490
- ], exports.UI.prototype, "rotation", undefined);
7533
+ ], exports.UI.prototype, "rotation", void 0);
7491
7534
  __decorate([
7492
7535
  rotationType(0, true)
7493
- ], exports.UI.prototype, "skewX", undefined);
7536
+ ], exports.UI.prototype, "skewX", void 0);
7494
7537
  __decorate([
7495
7538
  rotationType(0, true)
7496
- ], exports.UI.prototype, "skewY", undefined);
7539
+ ], exports.UI.prototype, "skewY", void 0);
7497
7540
  __decorate([
7498
7541
  positionType(0, true)
7499
- ], exports.UI.prototype, "offsetX", undefined);
7542
+ ], exports.UI.prototype, "offsetX", void 0);
7500
7543
  __decorate([
7501
7544
  positionType(0, true)
7502
- ], exports.UI.prototype, "offsetY", undefined);
7545
+ ], exports.UI.prototype, "offsetY", void 0);
7503
7546
  __decorate([
7504
7547
  positionType(0, true)
7505
- ], exports.UI.prototype, "scrollX", undefined);
7548
+ ], exports.UI.prototype, "scrollX", void 0);
7506
7549
  __decorate([
7507
7550
  positionType(0, true)
7508
- ], exports.UI.prototype, "scrollY", undefined);
7551
+ ], exports.UI.prototype, "scrollY", void 0);
7509
7552
  __decorate([
7510
7553
  autoLayoutType()
7511
- ], exports.UI.prototype, "origin", undefined);
7554
+ ], exports.UI.prototype, "origin", void 0);
7512
7555
  __decorate([
7513
7556
  autoLayoutType()
7514
- ], exports.UI.prototype, "around", undefined);
7557
+ ], exports.UI.prototype, "around", void 0);
7515
7558
  __decorate([
7516
7559
  dataType(false)
7517
- ], exports.UI.prototype, "lazy", undefined);
7560
+ ], exports.UI.prototype, "lazy", void 0);
7518
7561
  __decorate([
7519
7562
  naturalBoundsType(1)
7520
- ], exports.UI.prototype, "pixelRatio", undefined);
7563
+ ], exports.UI.prototype, "pixelRatio", void 0);
7521
7564
  __decorate([
7522
7565
  pathInputType()
7523
- ], exports.UI.prototype, "path", undefined);
7566
+ ], exports.UI.prototype, "path", void 0);
7524
7567
  __decorate([
7525
7568
  pathType()
7526
- ], exports.UI.prototype, "windingRule", undefined);
7569
+ ], exports.UI.prototype, "windingRule", void 0);
7527
7570
  __decorate([
7528
7571
  pathType(true)
7529
- ], exports.UI.prototype, "closed", undefined);
7572
+ ], exports.UI.prototype, "closed", void 0);
7530
7573
  __decorate([
7531
7574
  boundsType(0)
7532
- ], exports.UI.prototype, "padding", undefined);
7575
+ ], exports.UI.prototype, "padding", void 0);
7533
7576
  __decorate([
7534
7577
  boundsType(false)
7535
- ], exports.UI.prototype, "lockRatio", undefined);
7578
+ ], exports.UI.prototype, "lockRatio", void 0);
7536
7579
  __decorate([
7537
7580
  boundsType()
7538
- ], exports.UI.prototype, "widthRange", undefined);
7581
+ ], exports.UI.prototype, "widthRange", void 0);
7539
7582
  __decorate([
7540
7583
  boundsType()
7541
- ], exports.UI.prototype, "heightRange", undefined);
7584
+ ], exports.UI.prototype, "heightRange", void 0);
7542
7585
  __decorate([
7543
7586
  dataType(false)
7544
- ], exports.UI.prototype, "draggable", undefined);
7587
+ ], exports.UI.prototype, "draggable", void 0);
7545
7588
  __decorate([
7546
7589
  dataType()
7547
- ], exports.UI.prototype, "dragBounds", undefined);
7590
+ ], exports.UI.prototype, "dragBounds", void 0);
7548
7591
  __decorate([
7549
7592
  dataType(false)
7550
- ], exports.UI.prototype, "editable", undefined);
7593
+ ], exports.UI.prototype, "editable", void 0);
7551
7594
  __decorate([
7552
7595
  hitType(true)
7553
- ], exports.UI.prototype, "hittable", undefined);
7596
+ ], exports.UI.prototype, "hittable", void 0);
7554
7597
  __decorate([
7555
7598
  hitType('path')
7556
- ], exports.UI.prototype, "hitFill", undefined);
7599
+ ], exports.UI.prototype, "hitFill", void 0);
7557
7600
  __decorate([
7558
7601
  strokeType('path')
7559
- ], exports.UI.prototype, "hitStroke", undefined);
7602
+ ], exports.UI.prototype, "hitStroke", void 0);
7560
7603
  __decorate([
7561
7604
  hitType(false)
7562
- ], exports.UI.prototype, "hitBox", undefined);
7605
+ ], exports.UI.prototype, "hitBox", void 0);
7563
7606
  __decorate([
7564
7607
  hitType(true)
7565
- ], exports.UI.prototype, "hitChildren", undefined);
7608
+ ], exports.UI.prototype, "hitChildren", void 0);
7566
7609
  __decorate([
7567
7610
  hitType(true)
7568
- ], exports.UI.prototype, "hitSelf", undefined);
7611
+ ], exports.UI.prototype, "hitSelf", void 0);
7569
7612
  __decorate([
7570
7613
  hitType()
7571
- ], exports.UI.prototype, "hitRadius", undefined);
7614
+ ], exports.UI.prototype, "hitRadius", void 0);
7572
7615
  __decorate([
7573
7616
  cursorType('')
7574
- ], exports.UI.prototype, "cursor", undefined);
7617
+ ], exports.UI.prototype, "cursor", void 0);
7575
7618
  __decorate([
7576
7619
  surfaceType()
7577
- ], exports.UI.prototype, "fill", undefined);
7620
+ ], exports.UI.prototype, "fill", void 0);
7578
7621
  __decorate([
7579
7622
  strokeType()
7580
- ], exports.UI.prototype, "stroke", undefined);
7623
+ ], exports.UI.prototype, "stroke", void 0);
7581
7624
  __decorate([
7582
7625
  strokeType('inside')
7583
- ], exports.UI.prototype, "strokeAlign", undefined);
7626
+ ], exports.UI.prototype, "strokeAlign", void 0);
7584
7627
  __decorate([
7585
7628
  strokeType(1)
7586
- ], exports.UI.prototype, "strokeWidth", undefined);
7629
+ ], exports.UI.prototype, "strokeWidth", void 0);
7587
7630
  __decorate([
7588
7631
  strokeType(false)
7589
- ], exports.UI.prototype, "strokeWidthFixed", undefined);
7632
+ ], exports.UI.prototype, "strokeWidthFixed", void 0);
7590
7633
  __decorate([
7591
7634
  strokeType('none')
7592
- ], exports.UI.prototype, "strokeCap", undefined);
7635
+ ], exports.UI.prototype, "strokeCap", void 0);
7593
7636
  __decorate([
7594
7637
  strokeType('miter')
7595
- ], exports.UI.prototype, "strokeJoin", undefined);
7638
+ ], exports.UI.prototype, "strokeJoin", void 0);
7596
7639
  __decorate([
7597
7640
  strokeType()
7598
- ], exports.UI.prototype, "dashPattern", undefined);
7641
+ ], exports.UI.prototype, "dashPattern", void 0);
7599
7642
  __decorate([
7600
7643
  strokeType()
7601
- ], exports.UI.prototype, "dashOffset", undefined);
7644
+ ], exports.UI.prototype, "dashOffset", void 0);
7602
7645
  __decorate([
7603
7646
  strokeType(10)
7604
- ], exports.UI.prototype, "miterLimit", undefined);
7647
+ ], exports.UI.prototype, "miterLimit", void 0);
7605
7648
  __decorate([
7606
7649
  pathType(0)
7607
- ], exports.UI.prototype, "cornerRadius", undefined);
7650
+ ], exports.UI.prototype, "cornerRadius", void 0);
7608
7651
  __decorate([
7609
7652
  pathType()
7610
- ], exports.UI.prototype, "cornerSmoothing", undefined);
7653
+ ], exports.UI.prototype, "cornerSmoothing", void 0);
7611
7654
  __decorate([
7612
7655
  effectType()
7613
- ], exports.UI.prototype, "shadow", undefined);
7656
+ ], exports.UI.prototype, "shadow", void 0);
7614
7657
  __decorate([
7615
7658
  effectType()
7616
- ], exports.UI.prototype, "innerShadow", undefined);
7659
+ ], exports.UI.prototype, "innerShadow", void 0);
7617
7660
  __decorate([
7618
7661
  effectType()
7619
- ], exports.UI.prototype, "blur", undefined);
7662
+ ], exports.UI.prototype, "blur", void 0);
7620
7663
  __decorate([
7621
7664
  effectType()
7622
- ], exports.UI.prototype, "backgroundBlur", undefined);
7665
+ ], exports.UI.prototype, "backgroundBlur", void 0);
7623
7666
  __decorate([
7624
7667
  effectType()
7625
- ], exports.UI.prototype, "grayscale", undefined);
7668
+ ], exports.UI.prototype, "grayscale", void 0);
7669
+ __decorate([
7670
+ effectType()
7671
+ ], exports.UI.prototype, "filter", void 0);
7626
7672
  __decorate([
7627
7673
  dataType({})
7628
- ], exports.UI.prototype, "data", undefined);
7674
+ ], exports.UI.prototype, "data", void 0);
7629
7675
  __decorate([
7630
7676
  rewrite(exports.Leaf.prototype.reset)
7631
7677
  ], exports.UI.prototype, "reset", null);
@@ -7686,7 +7732,7 @@ var LeaferUI = (function (exports) {
7686
7732
  };
7687
7733
  __decorate([
7688
7734
  dataProcessor(GroupData)
7689
- ], exports.Group.prototype, "__", undefined);
7735
+ ], exports.Group.prototype, "__", void 0);
7690
7736
  exports.Group = __decorate([
7691
7737
  useModule(exports.Branch),
7692
7738
  registerUI()
@@ -7699,7 +7745,7 @@ var LeaferUI = (function (exports) {
7699
7745
  get isApp() { return false; }
7700
7746
  get app() { return this.parent || this; }
7701
7747
  get isLeafer() { return true; }
7702
- get imageReady() { return this.viewReady && ImageManager.isComplete; }
7748
+ get imageReady() { return this.viewReady && Resource.isComplete; }
7703
7749
  get layoutLocked() { return !this.layouter.running; }
7704
7750
  get FPS() { return this.renderer ? this.renderer.FPS : 60; }
7705
7751
  get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
@@ -7910,13 +7956,13 @@ var LeaferUI = (function (exports) {
7910
7956
  WaitHelper.run(this.__viewReadyWait);
7911
7957
  }
7912
7958
  __onLayoutEnd() {
7913
- const { grow, growWidth, growHeight } = this.config;
7959
+ const { grow, width: fixedWidth, height: fixedHeight } = this.config;
7914
7960
  if (grow) {
7915
7961
  let { width, height, pixelRatio } = this;
7916
7962
  const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7917
- if (growWidth !== false)
7963
+ if (!fixedWidth)
7918
7964
  width = Math.max(1, bounds.x + bounds.width);
7919
- if (growHeight !== false)
7965
+ if (!fixedHeight)
7920
7966
  height = Math.max(1, bounds.y + bounds.height);
7921
7967
  this.__doResize({ width, height, pixelRatio });
7922
7968
  }
@@ -7994,7 +8040,7 @@ var LeaferUI = (function (exports) {
7994
8040
  list.push(item);
7995
8041
  this.requestRender();
7996
8042
  }
7997
- zoom(_zoomType, _padding, _fixedScale) {
8043
+ zoom(_zoomType, _padding, _fixedScale, _transition) {
7998
8044
  return Plugin.need('view');
7999
8045
  }
8000
8046
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
@@ -8059,10 +8105,10 @@ var LeaferUI = (function (exports) {
8059
8105
  exports.Leafer.list = new LeafList();
8060
8106
  __decorate([
8061
8107
  dataProcessor(LeaferData)
8062
- ], exports.Leafer.prototype, "__", undefined);
8108
+ ], exports.Leafer.prototype, "__", void 0);
8063
8109
  __decorate([
8064
8110
  boundsType()
8065
- ], exports.Leafer.prototype, "pixelRatio", undefined);
8111
+ ], exports.Leafer.prototype, "pixelRatio", void 0);
8066
8112
  exports.Leafer = Leafer_1 = __decorate([
8067
8113
  registerUI()
8068
8114
  ], exports.Leafer);
@@ -8075,7 +8121,7 @@ var LeaferUI = (function (exports) {
8075
8121
  };
8076
8122
  __decorate([
8077
8123
  dataProcessor(RectData)
8078
- ], exports.Rect.prototype, "__", undefined);
8124
+ ], exports.Rect.prototype, "__", void 0);
8079
8125
  exports.Rect = __decorate([
8080
8126
  useModule(RectRender),
8081
8127
  rewriteAble(),
@@ -8166,13 +8212,13 @@ var LeaferUI = (function (exports) {
8166
8212
  };
8167
8213
  __decorate([
8168
8214
  dataProcessor(BoxData)
8169
- ], exports.Box.prototype, "__", undefined);
8215
+ ], exports.Box.prototype, "__", void 0);
8170
8216
  __decorate([
8171
8217
  dataType(false)
8172
- ], exports.Box.prototype, "resizeChildren", undefined);
8218
+ ], exports.Box.prototype, "resizeChildren", void 0);
8173
8219
  __decorate([
8174
8220
  affectRenderBoundsType('show')
8175
- ], exports.Box.prototype, "overflow", undefined);
8221
+ ], exports.Box.prototype, "overflow", void 0);
8176
8222
  __decorate([
8177
8223
  rewrite(rect$1.__updateStrokeSpread)
8178
8224
  ], exports.Box.prototype, "__updateStrokeSpread", null);
@@ -8211,13 +8257,13 @@ var LeaferUI = (function (exports) {
8211
8257
  };
8212
8258
  __decorate([
8213
8259
  dataProcessor(FrameData)
8214
- ], exports.Frame.prototype, "__", undefined);
8260
+ ], exports.Frame.prototype, "__", void 0);
8215
8261
  __decorate([
8216
8262
  surfaceType('#FFFFFF')
8217
- ], exports.Frame.prototype, "fill", undefined);
8263
+ ], exports.Frame.prototype, "fill", void 0);
8218
8264
  __decorate([
8219
8265
  affectRenderBoundsType('hide')
8220
- ], exports.Frame.prototype, "overflow", undefined);
8266
+ ], exports.Frame.prototype, "overflow", void 0);
8221
8267
  exports.Frame = __decorate([
8222
8268
  registerUI()
8223
8269
  ], exports.Frame);
@@ -8264,16 +8310,16 @@ var LeaferUI = (function (exports) {
8264
8310
  };
8265
8311
  __decorate([
8266
8312
  dataProcessor(EllipseData)
8267
- ], exports.Ellipse.prototype, "__", undefined);
8313
+ ], exports.Ellipse.prototype, "__", void 0);
8268
8314
  __decorate([
8269
8315
  pathType(0)
8270
- ], exports.Ellipse.prototype, "innerRadius", undefined);
8316
+ ], exports.Ellipse.prototype, "innerRadius", void 0);
8271
8317
  __decorate([
8272
8318
  pathType(0)
8273
- ], exports.Ellipse.prototype, "startAngle", undefined);
8319
+ ], exports.Ellipse.prototype, "startAngle", void 0);
8274
8320
  __decorate([
8275
8321
  pathType(0)
8276
- ], exports.Ellipse.prototype, "endAngle", undefined);
8322
+ ], exports.Ellipse.prototype, "endAngle", void 0);
8277
8323
  exports.Ellipse = __decorate([
8278
8324
  registerUI()
8279
8325
  ], exports.Ellipse);
@@ -8332,22 +8378,22 @@ var LeaferUI = (function (exports) {
8332
8378
  };
8333
8379
  __decorate([
8334
8380
  dataProcessor(LineData)
8335
- ], exports.Line.prototype, "__", undefined);
8381
+ ], exports.Line.prototype, "__", void 0);
8336
8382
  __decorate([
8337
8383
  affectStrokeBoundsType('center')
8338
- ], exports.Line.prototype, "strokeAlign", undefined);
8384
+ ], exports.Line.prototype, "strokeAlign", void 0);
8339
8385
  __decorate([
8340
8386
  boundsType(0)
8341
- ], exports.Line.prototype, "height", undefined);
8387
+ ], exports.Line.prototype, "height", void 0);
8342
8388
  __decorate([
8343
8389
  pathType()
8344
- ], exports.Line.prototype, "points", undefined);
8390
+ ], exports.Line.prototype, "points", void 0);
8345
8391
  __decorate([
8346
8392
  pathType(0)
8347
- ], exports.Line.prototype, "curve", undefined);
8393
+ ], exports.Line.prototype, "curve", void 0);
8348
8394
  __decorate([
8349
8395
  pathType(false)
8350
- ], exports.Line.prototype, "closed", undefined);
8396
+ ], exports.Line.prototype, "closed", void 0);
8351
8397
  exports.Line = __decorate([
8352
8398
  registerUI()
8353
8399
  ], exports.Line);
@@ -8380,16 +8426,16 @@ var LeaferUI = (function (exports) {
8380
8426
  };
8381
8427
  __decorate([
8382
8428
  dataProcessor(PolygonData)
8383
- ], exports.Polygon.prototype, "__", undefined);
8429
+ ], exports.Polygon.prototype, "__", void 0);
8384
8430
  __decorate([
8385
8431
  pathType(3)
8386
- ], exports.Polygon.prototype, "sides", undefined);
8432
+ ], exports.Polygon.prototype, "sides", void 0);
8387
8433
  __decorate([
8388
8434
  pathType()
8389
- ], exports.Polygon.prototype, "points", undefined);
8435
+ ], exports.Polygon.prototype, "points", void 0);
8390
8436
  __decorate([
8391
8437
  pathType(0)
8392
- ], exports.Polygon.prototype, "curve", undefined);
8438
+ ], exports.Polygon.prototype, "curve", void 0);
8393
8439
  __decorate([
8394
8440
  rewrite(line.__updateRenderPath)
8395
8441
  ], exports.Polygon.prototype, "__updateRenderPath", null);
@@ -8421,13 +8467,13 @@ var LeaferUI = (function (exports) {
8421
8467
  };
8422
8468
  __decorate([
8423
8469
  dataProcessor(StarData)
8424
- ], exports.Star.prototype, "__", undefined);
8470
+ ], exports.Star.prototype, "__", void 0);
8425
8471
  __decorate([
8426
8472
  pathType(5)
8427
- ], exports.Star.prototype, "corners", undefined);
8473
+ ], exports.Star.prototype, "corners", void 0);
8428
8474
  __decorate([
8429
8475
  pathType(0.382)
8430
- ], exports.Star.prototype, "innerRadius", undefined);
8476
+ ], exports.Star.prototype, "innerRadius", void 0);
8431
8477
  exports.Star = __decorate([
8432
8478
  registerUI()
8433
8479
  ], exports.Star);
@@ -8449,10 +8495,10 @@ var LeaferUI = (function (exports) {
8449
8495
  };
8450
8496
  __decorate([
8451
8497
  dataProcessor(ImageData)
8452
- ], exports.Image.prototype, "__", undefined);
8498
+ ], exports.Image.prototype, "__", void 0);
8453
8499
  __decorate([
8454
8500
  boundsType('')
8455
- ], exports.Image.prototype, "url", undefined);
8501
+ ], exports.Image.prototype, "url", void 0);
8456
8502
  exports.Image = __decorate([
8457
8503
  registerUI()
8458
8504
  ], exports.Image);
@@ -8515,25 +8561,25 @@ var LeaferUI = (function (exports) {
8515
8561
  };
8516
8562
  __decorate([
8517
8563
  dataProcessor(CanvasData)
8518
- ], exports.Canvas.prototype, "__", undefined);
8564
+ ], exports.Canvas.prototype, "__", void 0);
8519
8565
  __decorate([
8520
8566
  resizeType(100)
8521
- ], exports.Canvas.prototype, "width", undefined);
8567
+ ], exports.Canvas.prototype, "width", void 0);
8522
8568
  __decorate([
8523
8569
  resizeType(100)
8524
- ], exports.Canvas.prototype, "height", undefined);
8570
+ ], exports.Canvas.prototype, "height", void 0);
8525
8571
  __decorate([
8526
8572
  resizeType(1)
8527
- ], exports.Canvas.prototype, "pixelRatio", undefined);
8573
+ ], exports.Canvas.prototype, "pixelRatio", void 0);
8528
8574
  __decorate([
8529
8575
  resizeType(true)
8530
- ], exports.Canvas.prototype, "smooth", undefined);
8576
+ ], exports.Canvas.prototype, "smooth", void 0);
8531
8577
  __decorate([
8532
8578
  dataType(false)
8533
- ], exports.Canvas.prototype, "safeResize", undefined);
8579
+ ], exports.Canvas.prototype, "safeResize", void 0);
8534
8580
  __decorate([
8535
8581
  resizeType()
8536
- ], exports.Canvas.prototype, "contextSettings", undefined);
8582
+ ], exports.Canvas.prototype, "contextSettings", void 0);
8537
8583
  exports.Canvas = __decorate([
8538
8584
  registerUI()
8539
8585
  ], exports.Canvas);
@@ -8624,76 +8670,76 @@ var LeaferUI = (function (exports) {
8624
8670
  };
8625
8671
  __decorate([
8626
8672
  dataProcessor(TextData)
8627
- ], exports.Text.prototype, "__", undefined);
8673
+ ], exports.Text.prototype, "__", void 0);
8628
8674
  __decorate([
8629
8675
  boundsType(0)
8630
- ], exports.Text.prototype, "width", undefined);
8676
+ ], exports.Text.prototype, "width", void 0);
8631
8677
  __decorate([
8632
8678
  boundsType(0)
8633
- ], exports.Text.prototype, "height", undefined);
8679
+ ], exports.Text.prototype, "height", void 0);
8634
8680
  __decorate([
8635
8681
  dataType(false)
8636
- ], exports.Text.prototype, "resizeFontSize", undefined);
8682
+ ], exports.Text.prototype, "resizeFontSize", void 0);
8637
8683
  __decorate([
8638
8684
  surfaceType('#000000')
8639
- ], exports.Text.prototype, "fill", undefined);
8685
+ ], exports.Text.prototype, "fill", void 0);
8640
8686
  __decorate([
8641
8687
  affectStrokeBoundsType('outside')
8642
- ], exports.Text.prototype, "strokeAlign", undefined);
8688
+ ], exports.Text.prototype, "strokeAlign", void 0);
8643
8689
  __decorate([
8644
8690
  hitType('all')
8645
- ], exports.Text.prototype, "hitFill", undefined);
8691
+ ], exports.Text.prototype, "hitFill", void 0);
8646
8692
  __decorate([
8647
8693
  boundsType('')
8648
- ], exports.Text.prototype, "text", undefined);
8694
+ ], exports.Text.prototype, "text", void 0);
8649
8695
  __decorate([
8650
8696
  boundsType('caption')
8651
- ], exports.Text.prototype, "fontFamily", undefined);
8697
+ ], exports.Text.prototype, "fontFamily", void 0);
8652
8698
  __decorate([
8653
8699
  boundsType(12)
8654
- ], exports.Text.prototype, "fontSize", undefined);
8700
+ ], exports.Text.prototype, "fontSize", void 0);
8655
8701
  __decorate([
8656
8702
  boundsType('normal')
8657
- ], exports.Text.prototype, "fontWeight", undefined);
8703
+ ], exports.Text.prototype, "fontWeight", void 0);
8658
8704
  __decorate([
8659
8705
  boundsType(false)
8660
- ], exports.Text.prototype, "italic", undefined);
8706
+ ], exports.Text.prototype, "italic", void 0);
8661
8707
  __decorate([
8662
8708
  boundsType('none')
8663
- ], exports.Text.prototype, "textCase", undefined);
8709
+ ], exports.Text.prototype, "textCase", void 0);
8664
8710
  __decorate([
8665
8711
  boundsType('none')
8666
- ], exports.Text.prototype, "textDecoration", undefined);
8712
+ ], exports.Text.prototype, "textDecoration", void 0);
8667
8713
  __decorate([
8668
8714
  boundsType(0)
8669
- ], exports.Text.prototype, "letterSpacing", undefined);
8715
+ ], exports.Text.prototype, "letterSpacing", void 0);
8670
8716
  __decorate([
8671
8717
  boundsType({ type: 'percent', value: 1.5 })
8672
- ], exports.Text.prototype, "lineHeight", undefined);
8718
+ ], exports.Text.prototype, "lineHeight", void 0);
8673
8719
  __decorate([
8674
8720
  boundsType(0)
8675
- ], exports.Text.prototype, "paraIndent", undefined);
8721
+ ], exports.Text.prototype, "paraIndent", void 0);
8676
8722
  __decorate([
8677
8723
  boundsType(0)
8678
- ], exports.Text.prototype, "paraSpacing", undefined);
8724
+ ], exports.Text.prototype, "paraSpacing", void 0);
8679
8725
  __decorate([
8680
8726
  boundsType('x')
8681
- ], exports.Text.prototype, "writingMode", undefined);
8727
+ ], exports.Text.prototype, "writingMode", void 0);
8682
8728
  __decorate([
8683
8729
  boundsType('left')
8684
- ], exports.Text.prototype, "textAlign", undefined);
8730
+ ], exports.Text.prototype, "textAlign", void 0);
8685
8731
  __decorate([
8686
8732
  boundsType('top')
8687
- ], exports.Text.prototype, "verticalAlign", undefined);
8733
+ ], exports.Text.prototype, "verticalAlign", void 0);
8688
8734
  __decorate([
8689
8735
  boundsType(true)
8690
- ], exports.Text.prototype, "autoSizeAlign", undefined);
8736
+ ], exports.Text.prototype, "autoSizeAlign", void 0);
8691
8737
  __decorate([
8692
8738
  boundsType('normal')
8693
- ], exports.Text.prototype, "textWrap", undefined);
8739
+ ], exports.Text.prototype, "textWrap", void 0);
8694
8740
  __decorate([
8695
8741
  boundsType('show')
8696
- ], exports.Text.prototype, "textOverflow", undefined);
8742
+ ], exports.Text.prototype, "textOverflow", void 0);
8697
8743
  exports.Text = __decorate([
8698
8744
  registerUI()
8699
8745
  ], exports.Text);
@@ -8706,10 +8752,10 @@ var LeaferUI = (function (exports) {
8706
8752
  };
8707
8753
  __decorate([
8708
8754
  dataProcessor(PathData)
8709
- ], exports.Path.prototype, "__", undefined);
8755
+ ], exports.Path.prototype, "__", void 0);
8710
8756
  __decorate([
8711
8757
  affectStrokeBoundsType('center')
8712
- ], exports.Path.prototype, "strokeAlign", undefined);
8758
+ ], exports.Path.prototype, "strokeAlign", void 0);
8713
8759
  exports.Path = __decorate([
8714
8760
  registerUI()
8715
8761
  ], exports.Path);
@@ -8748,10 +8794,10 @@ var LeaferUI = (function (exports) {
8748
8794
  };
8749
8795
  __decorate([
8750
8796
  dataProcessor(PenData)
8751
- ], exports.Pen.prototype, "__", undefined);
8797
+ ], exports.Pen.prototype, "__", void 0);
8752
8798
  __decorate([
8753
8799
  penPathType()
8754
- ], exports.Pen.prototype, "path", undefined);
8800
+ ], exports.Pen.prototype, "path", void 0);
8755
8801
  exports.Pen = __decorate([
8756
8802
  useModule(PathCreator, ['set', 'path', 'paint']),
8757
8803
  registerUI()
@@ -8987,7 +9033,7 @@ var LeaferUI = (function (exports) {
8987
9033
  const { draggable, dragBounds } = leaf, move = leaf.getLocalPoint(total, null, true);
8988
9034
  PointHelper.move(move, start.x - leaf.x, start.y - leaf.y);
8989
9035
  if (dragBounds)
8990
- this.getMoveInDragBounds(leaf.__local, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
9036
+ this.getMoveInDragBounds(leaf.__localBoxBounds, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
8991
9037
  if (draggable === 'x')
8992
9038
  move.y = 0;
8993
9039
  if (draggable === 'y')
@@ -9518,10 +9564,9 @@ var LeaferUI = (function (exports) {
9518
9564
  }
9519
9565
  }
9520
9566
  pointerMoveReal(data) {
9521
- const { dragHover, dragDistance } = this.p;
9522
9567
  this.emit(exports.PointerEvent.BEFORE_MOVE, data, this.defaultPath);
9523
9568
  if (this.downData) {
9524
- const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
9569
+ const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
9525
9570
  if (canDrag) {
9526
9571
  if (this.waitTap)
9527
9572
  this.pointerWaitCancel();
@@ -9533,9 +9578,8 @@ var LeaferUI = (function (exports) {
9533
9578
  this.updateHoverData(data);
9534
9579
  this.checkPath(data);
9535
9580
  this.emit(exports.PointerEvent.MOVE, data);
9536
- if (!(this.dragging && !dragHover))
9537
- this.pointerHover(data);
9538
- if (this.dragger.dragging) {
9581
+ this.pointerHover(data);
9582
+ if (this.dragging) {
9539
9583
  this.dragger.dragOverOrOut(data);
9540
9584
  this.dragger.dragEnterOrLeave(data);
9541
9585
  }
@@ -9616,7 +9660,8 @@ var LeaferUI = (function (exports) {
9616
9660
  this.updateCursor();
9617
9661
  }
9618
9662
  pointerHover(data) {
9619
- if (this.canHover) {
9663
+ if (this.canHover && !(this.dragging && !this.p.dragHover)) {
9664
+ data.path || (data.path = new LeafList());
9620
9665
  this.pointerOverOrOut(data);
9621
9666
  this.pointerEnterOrLeave(data);
9622
9667
  }
@@ -9691,7 +9736,9 @@ var LeaferUI = (function (exports) {
9691
9736
  }
9692
9737
  findPath(data, options) {
9693
9738
  const { hitRadius, through } = this.p;
9694
- const { bottomList } = this;
9739
+ const { bottomList, target } = this;
9740
+ if (!Platform.backgrounder && !data.origin)
9741
+ target && target.updateLayout();
9695
9742
  const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
9696
9743
  if (find.throughPath)
9697
9744
  data.throughPath = find.throughPath;
@@ -9936,9 +9983,9 @@ var LeaferUI = (function (exports) {
9936
9983
  }
9937
9984
  return this.__hit(inner);
9938
9985
  };
9939
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
9940
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
9941
- leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
9986
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
9987
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
9988
+ leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
9942
9989
  leaf.__drawHitPath = function (canvas) { if (canvas)
9943
9990
  this.__drawRenderPath(canvas); };
9944
9991
 
@@ -10026,8 +10073,8 @@ var LeaferUI = (function (exports) {
10026
10073
  return ui.leafer ? ui.leafer.selector : (Platform.selector || (Platform.selector = Creator.selector()));
10027
10074
  }
10028
10075
  exports.Group.prototype.pick = function (hitPoint, options) {
10029
- this.leafer || this.updateLayout();
10030
10076
  options || (options = emptyData);
10077
+ this.updateLayout();
10031
10078
  return getSelector(this).getByPoint(hitPoint, options.hitRadius || 0, Object.assign(Object.assign({}, options), { target: this }));
10032
10079
  };
10033
10080
 
@@ -10411,7 +10458,7 @@ var LeaferUI = (function (exports) {
10411
10458
  box = tempBox.set(box).shrink(paint.padding);
10412
10459
  if (paint.mode === 'strench')
10413
10460
  paint.mode = 'stretch';
10414
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
10461
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
10415
10462
  const sameBox = box.width === width && box.height === height;
10416
10463
  const data = { mode };
10417
10464
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -10474,6 +10521,8 @@ var LeaferUI = (function (exports) {
10474
10521
  data.height = height;
10475
10522
  if (opacity)
10476
10523
  data.opacity = opacity;
10524
+ if (filters)
10525
+ data.filters = filters;
10477
10526
  if (repeat)
10478
10527
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
10479
10528
  return data;
@@ -10576,7 +10625,7 @@ var LeaferUI = (function (exports) {
10576
10625
  scaleX = abs$1(scaleX);
10577
10626
  scaleY = abs$1(scaleY);
10578
10627
  const { image, data } = paint;
10579
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
10628
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
10580
10629
  if (sx) {
10581
10630
  imageMatrix = get$1();
10582
10631
  copy$1(imageMatrix, transform);
@@ -10619,7 +10668,7 @@ var LeaferUI = (function (exports) {
10619
10668
  }
10620
10669
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
10621
10670
  }
10622
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
10671
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
10623
10672
  const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
10624
10673
  paint.style = pattern;
10625
10674
  paint.patternId = id;
@@ -10663,7 +10712,7 @@ var LeaferUI = (function (exports) {
10663
10712
  canvas.opacity *= data.opacity;
10664
10713
  if (data.transform)
10665
10714
  canvas.transform(data.transform);
10666
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
10715
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
10667
10716
  canvas.restore();
10668
10717
  return true;
10669
10718
  }
@@ -10673,7 +10722,7 @@ var LeaferUI = (function (exports) {
10673
10722
  }
10674
10723
  else {
10675
10724
  if (!paint.patternTask) {
10676
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
10725
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
10677
10726
  paint.patternTask = null;
10678
10727
  if (canvas.bounds.hit(ui.__nowWorld))
10679
10728
  createPattern(ui, paint, pixelRatio);
@@ -11263,11 +11312,11 @@ var LeaferUI = (function (exports) {
11263
11312
  function layoutChar(drawData, style, width, _height) {
11264
11313
  const { rows } = drawData;
11265
11314
  const { textAlign, paraIndent, letterSpacing } = style;
11266
- let charX, addWordWidth, indentWidth, mode, wordChar;
11315
+ let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
11267
11316
  rows.forEach(row => {
11268
11317
  if (row.words) {
11269
- indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
11270
- addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11318
+ indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
11319
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
11271
11320
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
11272
11321
  if (row.isOverflow && !letterSpacing)
11273
11322
  row.textMode = true;
@@ -11279,7 +11328,7 @@ var LeaferUI = (function (exports) {
11279
11328
  row.x += indentWidth;
11280
11329
  charX = row.x;
11281
11330
  row.data = [];
11282
- row.words.forEach(word => {
11331
+ row.words.forEach((word, index) => {
11283
11332
  if (mode === WordMode) {
11284
11333
  wordChar = { char: '', x: charX };
11285
11334
  charX = toWordChar(word.data, charX, wordChar);
@@ -11289,7 +11338,7 @@ var LeaferUI = (function (exports) {
11289
11338
  else {
11290
11339
  charX = toChar(word.data, charX, row.data, row.isOverflow);
11291
11340
  }
11292
- if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
11341
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
11293
11342
  charX += addWordWidth;
11294
11343
  row.width += addWordWidth;
11295
11344
  }
@@ -11571,6 +11620,7 @@ var LeaferUI = (function (exports) {
11571
11620
  exports.Eventer = Eventer;
11572
11621
  exports.Export = Export;
11573
11622
  exports.FileHelper = FileHelper;
11623
+ exports.Filter = Filter;
11574
11624
  exports.FrameData = FrameData;
11575
11625
  exports.GroupData = GroupData;
11576
11626
  exports.HitCanvasManager = HitCanvasManager;
@@ -11640,6 +11690,7 @@ var LeaferUI = (function (exports) {
11640
11690
  exports.RenderEvent = RenderEvent;
11641
11691
  exports.Renderer = Renderer;
11642
11692
  exports.ResizeEvent = ResizeEvent;
11693
+ exports.Resource = Resource;
11643
11694
  exports.Run = Run;
11644
11695
  exports.Selector = Selector;
11645
11696
  exports.StarData = StarData;
@@ -11715,3 +11766,4 @@ var LeaferUI = (function (exports) {
11715
11766
  return exports;
11716
11767
 
11717
11768
  })({});
11769
+ //# sourceMappingURL=worker.js.map