leafer-ui 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/web.js CHANGED
@@ -1377,7 +1377,7 @@ var LeaferUI = (function (exports) {
1377
1377
  }
1378
1378
  const D$4 = Debug;
1379
1379
 
1380
- const debug$f = Debug.get('RunTime');
1380
+ const debug$g = 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$f.log(name, duration, 'ms');
1397
+ R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
1398
+ debug$g.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$e = Debug.get('UICreator');
1427
+ const debug$f = 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$e.repeat(tag);
1433
+ debug$f.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$e.error('not register ' + tag);
1438
+ debug$f.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$d = Debug.get('EventCreator');
1454
+ const debug$e = 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$d.repeat(name), nameList[name] = Event;
1462
+ nameList[name] && debug$e.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$c = Debug.get('PathConvert');
2618
+ const debug$d = 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$c.error(`command: ${command} [index:${i}]`, old);
2859
+ debug$d.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$b = Debug.get('PathDrawer');
3082
+ const debug$c = 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$b.error(`command: ${command} [index:${i}]`, data);
3145
+ debug$c.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$a = Debug.get('PathBounds');
3155
+ const debug$b = 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$a.error(`command: ${command} [index:${i}]`, data);
3263
+ debug$b.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$9 = Debug.get('TaskProcessor');
3379
+ const debug$a = 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$9.error(error);
3394
+ debug$a.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$9 = 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$9.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
  const debug$5 = Debug.get('LeaferCanvas');
6019
6060
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6133,7 +6174,7 @@ var LeaferUI = (function (exports) {
6133
6174
  }
6134
6175
  }
6135
6176
  else {
6136
- window.addEventListener('resize', () => {
6177
+ window.addEventListener('resize', this.windowListener = () => {
6137
6178
  const pixelRatio = Platform.devicePixelRatio;
6138
6179
  if (this.pixelRatio !== pixelRatio) {
6139
6180
  const { width, height } = this;
@@ -6162,11 +6203,9 @@ var LeaferUI = (function (exports) {
6162
6203
  }
6163
6204
  stopAutoLayout() {
6164
6205
  this.autoLayout = false;
6165
- this.resizeListener = null;
6166
- if (this.resizeObserver) {
6206
+ if (this.resizeObserver)
6167
6207
  this.resizeObserver.disconnect();
6168
- this.resizeObserver = null;
6169
- }
6208
+ this.resizeListener = this.resizeObserver = null;
6170
6209
  }
6171
6210
  emitResize(size) {
6172
6211
  const oldSize = {};
@@ -6187,6 +6226,10 @@ var LeaferUI = (function (exports) {
6187
6226
  destroy() {
6188
6227
  if (this.view) {
6189
6228
  this.stopAutoLayout();
6229
+ if (this.windowListener) {
6230
+ window.removeEventListener('resize', this.windowListener);
6231
+ this.windowListener = null;
6232
+ }
6190
6233
  if (!this.unreal) {
6191
6234
  const view = this.view;
6192
6235
  if (view.parentElement)
@@ -6213,7 +6256,10 @@ var LeaferUI = (function (exports) {
6213
6256
  canvas.height = height;
6214
6257
  return canvas;
6215
6258
  },
6216
- canvasToDataURL: (canvas, type, quality) => canvas.toDataURL(mineType(type), quality),
6259
+ canvasToDataURL: (canvas, type, quality) => {
6260
+ const imageType = mineType(type), url = canvas.toDataURL(imageType, quality);
6261
+ return imageType === 'image/bmp' ? url.replace('image/png;', 'image/bmp;') : url;
6262
+ },
6217
6263
  canvasToBolb: (canvas, type, quality) => new Promise((resolve) => canvas.toBlob(resolve, mineType(type), quality)),
6218
6264
  canvasSaveAs: (canvas, filename, quality) => {
6219
6265
  const url = canvas.toDataURL(mineType(fileType(filename)), quality);
@@ -6258,14 +6304,14 @@ var LeaferUI = (function (exports) {
6258
6304
  Platform.name = 'web';
6259
6305
  Platform.isMobile = 'ontouchstart' in window;
6260
6306
  Platform.requestRender = function (render) { window.requestAnimationFrame(render); };
6261
- defineKey(Platform, 'devicePixelRatio', { get() { return Math.max(1, devicePixelRatio); } });
6307
+ defineKey(Platform, 'devicePixelRatio', { get() { return devicePixelRatio; } });
6262
6308
  const { userAgent } = navigator;
6263
6309
  if (userAgent.indexOf("Firefox") > -1) {
6264
6310
  Platform.conicGradientRotate90 = true;
6265
6311
  Platform.intWheelDeltaY = true;
6266
6312
  Platform.syncDomFont = true;
6267
6313
  }
6268
- else if (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") === -1) {
6314
+ else if (userAgent.indexOf("AppleWebKit") > -1) {
6269
6315
  Platform.fullImageShadow = true;
6270
6316
  }
6271
6317
  if (userAgent.indexOf('Windows') > -1) {
@@ -6534,7 +6580,7 @@ var LeaferUI = (function (exports) {
6534
6580
  }
6535
6581
  partLayout() {
6536
6582
  var _a;
6537
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6583
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6538
6584
  return;
6539
6585
  const t = Run.start('PartLayout');
6540
6586
  const { target, __updatedList: updateList } = this;
@@ -6999,9 +7045,10 @@ var LeaferUI = (function (exports) {
6999
7045
  this.finder = Creator.finder && Creator.finder();
7000
7046
  }
7001
7047
  getByPoint(hitPoint, hitRadius, options) {
7002
- if (Platform.backgrounder && this.target)
7003
- this.target.updateLayout();
7004
- return this.picker.getByPoint(hitPoint, hitRadius, options);
7048
+ const { target, picker } = this;
7049
+ if (Platform.backgrounder)
7050
+ target && target.updateLayout();
7051
+ return picker.getByPoint(hitPoint, hitRadius, options);
7005
7052
  }
7006
7053
  getBy(condition, branch, one, options) {
7007
7054
  return this.finder ? this.finder.getBy(condition, branch, one, options) : Plugin.need('find');
@@ -7059,9 +7106,7 @@ var LeaferUI = (function (exports) {
7059
7106
  const ColorConvert = {};
7060
7107
  const UnitConvert = {
7061
7108
  number(value, percentRefer) {
7062
- if (typeof value === 'object')
7063
- return value.type === 'percent' ? value.value * percentRefer : value.value;
7064
- return value;
7109
+ return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
7065
7110
  }
7066
7111
  };
7067
7112
  const PathArrow = {};
@@ -7069,16 +7114,15 @@ var LeaferUI = (function (exports) {
7069
7114
  const PaintImage = {};
7070
7115
  const PaintGradient = {};
7071
7116
  const Effect = {};
7117
+ const Filter = {
7118
+ apply() { Plugin.need('filter'); }
7119
+ };
7072
7120
  const Export = {};
7073
7121
  const State = {
7074
- setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
7075
- set(_leaf, _stateName) { return Plugin.need('state'); }
7076
- };
7077
- const Transition = {
7078
- list: {},
7079
- register(attrName, fn) { Transition.list[attrName] = fn; },
7080
- get(attrName) { return Transition.list[attrName]; }
7122
+ setStyleName() { return Plugin.need('state'); },
7123
+ set() { return Plugin.need('state'); }
7081
7124
  };
7125
+ const Transition = {};
7082
7126
 
7083
7127
  const { parse, objectToCanvasData } = PathConvert;
7084
7128
  const emptyPaint = {};
@@ -7185,24 +7229,13 @@ var LeaferUI = (function (exports) {
7185
7229
  }
7186
7230
  }
7187
7231
  setShadow(value) {
7188
- this.__setInput('shadow', value);
7189
- if (value instanceof Array) {
7190
- if (value.some((item) => item.visible === false))
7191
- value = value.filter((item) => item.visible !== false);
7192
- this._shadow = value.length ? value : null;
7193
- }
7194
- else
7195
- this._shadow = value && value.visible !== false ? [value] : null;
7232
+ setArray(this, 'shadow', value);
7196
7233
  }
7197
7234
  setInnerShadow(value) {
7198
- this.__setInput('innerShadow', value);
7199
- if (value instanceof Array) {
7200
- if (value.some((item) => item.visible === false))
7201
- value = value.filter((item) => item.visible !== false);
7202
- this._innerShadow = value.length ? value : null;
7203
- }
7204
- else
7205
- this._innerShadow = value && value.visible !== false ? [value] : null;
7235
+ setArray(this, 'innerShadow', value);
7236
+ }
7237
+ setFilter(value) {
7238
+ setArray(this, 'filter', value);
7206
7239
  }
7207
7240
  __computePaint() {
7208
7241
  const { fill, stroke } = this.__input;
@@ -7213,6 +7246,17 @@ var LeaferUI = (function (exports) {
7213
7246
  this.__needComputePaint = false;
7214
7247
  }
7215
7248
  }
7249
+ function setArray(data, key, value) {
7250
+ data.__setInput(key, value);
7251
+ if (value instanceof Array) {
7252
+ if (value.some((item) => item.visible === false))
7253
+ value = value.filter((item) => item.visible !== false);
7254
+ value.length || (value = null);
7255
+ }
7256
+ else
7257
+ value = value && value.visible !== false ? [value] : null;
7258
+ data['_' + key] = value;
7259
+ }
7216
7260
 
7217
7261
  class GroupData extends UIData {
7218
7262
  }
@@ -7335,11 +7379,13 @@ var LeaferUI = (function (exports) {
7335
7379
  },
7336
7380
  __updateRenderSpread() {
7337
7381
  let width = 0;
7338
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7382
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7339
7383
  if (shadow)
7340
7384
  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));
7341
7385
  if (blur)
7342
7386
  width = Math.max(width, blur);
7387
+ if (filter)
7388
+ width += Filter.getSpread(filter);
7343
7389
  let shapeWidth = width = Math.ceil(width);
7344
7390
  if (innerShadow)
7345
7391
  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));
@@ -7354,8 +7400,8 @@ var LeaferUI = (function (exports) {
7354
7400
  __updateChange() {
7355
7401
  const data = this.__;
7356
7402
  if (data.__useEffect) {
7357
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7358
- data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
7403
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7404
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
7359
7405
  }
7360
7406
  data.__checkSingle();
7361
7407
  const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
@@ -7369,7 +7415,7 @@ var LeaferUI = (function (exports) {
7369
7415
  __drawFast(canvas, options) {
7370
7416
  drawFast(this, canvas, options);
7371
7417
  },
7372
- __draw(canvas, options) {
7418
+ __draw(canvas, options, originCanvas) {
7373
7419
  const data = this.__;
7374
7420
  if (data.__complex) {
7375
7421
  if (data.__needComputePaint)
@@ -7379,7 +7425,7 @@ var LeaferUI = (function (exports) {
7379
7425
  if (data.__useEffect) {
7380
7426
  const shape = Paint.shape(this, canvas, options);
7381
7427
  this.__nowWorld = this.__getNowWorld(options);
7382
- const { shadow, innerShadow } = data;
7428
+ const { shadow, innerShadow, filter } = data;
7383
7429
  if (shadow)
7384
7430
  Effect.shadow(this, canvas, shape);
7385
7431
  if (fill)
@@ -7390,6 +7436,8 @@ var LeaferUI = (function (exports) {
7390
7436
  Effect.innerShadow(this, canvas, shape);
7391
7437
  if (stroke)
7392
7438
  data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
7439
+ if (filter)
7440
+ Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
7393
7441
  if (shape.worldCanvas)
7394
7442
  shape.worldCanvas.recycle();
7395
7443
  shape.canvas.recycle();
@@ -7609,199 +7657,202 @@ var LeaferUI = (function (exports) {
7609
7657
  };
7610
7658
  __decorate([
7611
7659
  dataProcessor(UIData)
7612
- ], exports.UI.prototype, "__", undefined);
7660
+ ], exports.UI.prototype, "__", void 0);
7613
7661
  __decorate([
7614
7662
  zoomLayerType()
7615
- ], exports.UI.prototype, "zoomLayer", undefined);
7663
+ ], exports.UI.prototype, "zoomLayer", void 0);
7616
7664
  __decorate([
7617
7665
  dataType('')
7618
- ], exports.UI.prototype, "id", undefined);
7666
+ ], exports.UI.prototype, "id", void 0);
7619
7667
  __decorate([
7620
7668
  dataType('')
7621
- ], exports.UI.prototype, "name", undefined);
7669
+ ], exports.UI.prototype, "name", void 0);
7622
7670
  __decorate([
7623
7671
  dataType('')
7624
- ], exports.UI.prototype, "className", undefined);
7672
+ ], exports.UI.prototype, "className", void 0);
7625
7673
  __decorate([
7626
7674
  surfaceType('pass-through')
7627
- ], exports.UI.prototype, "blendMode", undefined);
7675
+ ], exports.UI.prototype, "blendMode", void 0);
7628
7676
  __decorate([
7629
7677
  opacityType(1)
7630
- ], exports.UI.prototype, "opacity", undefined);
7678
+ ], exports.UI.prototype, "opacity", void 0);
7631
7679
  __decorate([
7632
7680
  visibleType(true)
7633
- ], exports.UI.prototype, "visible", undefined);
7681
+ ], exports.UI.prototype, "visible", void 0);
7634
7682
  __decorate([
7635
7683
  surfaceType(false)
7636
- ], exports.UI.prototype, "locked", undefined);
7684
+ ], exports.UI.prototype, "locked", void 0);
7637
7685
  __decorate([
7638
7686
  sortType(0)
7639
- ], exports.UI.prototype, "zIndex", undefined);
7687
+ ], exports.UI.prototype, "zIndex", void 0);
7640
7688
  __decorate([
7641
7689
  maskType(false)
7642
- ], exports.UI.prototype, "mask", undefined);
7690
+ ], exports.UI.prototype, "mask", void 0);
7643
7691
  __decorate([
7644
7692
  eraserType(false)
7645
- ], exports.UI.prototype, "eraser", undefined);
7693
+ ], exports.UI.prototype, "eraser", void 0);
7646
7694
  __decorate([
7647
7695
  positionType(0, true)
7648
- ], exports.UI.prototype, "x", undefined);
7696
+ ], exports.UI.prototype, "x", void 0);
7649
7697
  __decorate([
7650
7698
  positionType(0, true)
7651
- ], exports.UI.prototype, "y", undefined);
7699
+ ], exports.UI.prototype, "y", void 0);
7652
7700
  __decorate([
7653
7701
  boundsType(100, true)
7654
- ], exports.UI.prototype, "width", undefined);
7702
+ ], exports.UI.prototype, "width", void 0);
7655
7703
  __decorate([
7656
7704
  boundsType(100, true)
7657
- ], exports.UI.prototype, "height", undefined);
7705
+ ], exports.UI.prototype, "height", void 0);
7658
7706
  __decorate([
7659
7707
  scaleType(1, true)
7660
- ], exports.UI.prototype, "scaleX", undefined);
7708
+ ], exports.UI.prototype, "scaleX", void 0);
7661
7709
  __decorate([
7662
7710
  scaleType(1, true)
7663
- ], exports.UI.prototype, "scaleY", undefined);
7711
+ ], exports.UI.prototype, "scaleY", void 0);
7664
7712
  __decorate([
7665
7713
  rotationType(0, true)
7666
- ], exports.UI.prototype, "rotation", undefined);
7714
+ ], exports.UI.prototype, "rotation", void 0);
7667
7715
  __decorate([
7668
7716
  rotationType(0, true)
7669
- ], exports.UI.prototype, "skewX", undefined);
7717
+ ], exports.UI.prototype, "skewX", void 0);
7670
7718
  __decorate([
7671
7719
  rotationType(0, true)
7672
- ], exports.UI.prototype, "skewY", undefined);
7720
+ ], exports.UI.prototype, "skewY", void 0);
7673
7721
  __decorate([
7674
7722
  positionType(0, true)
7675
- ], exports.UI.prototype, "offsetX", undefined);
7723
+ ], exports.UI.prototype, "offsetX", void 0);
7676
7724
  __decorate([
7677
7725
  positionType(0, true)
7678
- ], exports.UI.prototype, "offsetY", undefined);
7726
+ ], exports.UI.prototype, "offsetY", void 0);
7679
7727
  __decorate([
7680
7728
  positionType(0, true)
7681
- ], exports.UI.prototype, "scrollX", undefined);
7729
+ ], exports.UI.prototype, "scrollX", void 0);
7682
7730
  __decorate([
7683
7731
  positionType(0, true)
7684
- ], exports.UI.prototype, "scrollY", undefined);
7732
+ ], exports.UI.prototype, "scrollY", void 0);
7685
7733
  __decorate([
7686
7734
  autoLayoutType()
7687
- ], exports.UI.prototype, "origin", undefined);
7735
+ ], exports.UI.prototype, "origin", void 0);
7688
7736
  __decorate([
7689
7737
  autoLayoutType()
7690
- ], exports.UI.prototype, "around", undefined);
7738
+ ], exports.UI.prototype, "around", void 0);
7691
7739
  __decorate([
7692
7740
  dataType(false)
7693
- ], exports.UI.prototype, "lazy", undefined);
7741
+ ], exports.UI.prototype, "lazy", void 0);
7694
7742
  __decorate([
7695
7743
  naturalBoundsType(1)
7696
- ], exports.UI.prototype, "pixelRatio", undefined);
7744
+ ], exports.UI.prototype, "pixelRatio", void 0);
7697
7745
  __decorate([
7698
7746
  pathInputType()
7699
- ], exports.UI.prototype, "path", undefined);
7747
+ ], exports.UI.prototype, "path", void 0);
7700
7748
  __decorate([
7701
7749
  pathType()
7702
- ], exports.UI.prototype, "windingRule", undefined);
7750
+ ], exports.UI.prototype, "windingRule", void 0);
7703
7751
  __decorate([
7704
7752
  pathType(true)
7705
- ], exports.UI.prototype, "closed", undefined);
7753
+ ], exports.UI.prototype, "closed", void 0);
7706
7754
  __decorate([
7707
7755
  boundsType(0)
7708
- ], exports.UI.prototype, "padding", undefined);
7756
+ ], exports.UI.prototype, "padding", void 0);
7709
7757
  __decorate([
7710
7758
  boundsType(false)
7711
- ], exports.UI.prototype, "lockRatio", undefined);
7759
+ ], exports.UI.prototype, "lockRatio", void 0);
7712
7760
  __decorate([
7713
7761
  boundsType()
7714
- ], exports.UI.prototype, "widthRange", undefined);
7762
+ ], exports.UI.prototype, "widthRange", void 0);
7715
7763
  __decorate([
7716
7764
  boundsType()
7717
- ], exports.UI.prototype, "heightRange", undefined);
7765
+ ], exports.UI.prototype, "heightRange", void 0);
7718
7766
  __decorate([
7719
7767
  dataType(false)
7720
- ], exports.UI.prototype, "draggable", undefined);
7768
+ ], exports.UI.prototype, "draggable", void 0);
7721
7769
  __decorate([
7722
7770
  dataType()
7723
- ], exports.UI.prototype, "dragBounds", undefined);
7771
+ ], exports.UI.prototype, "dragBounds", void 0);
7724
7772
  __decorate([
7725
7773
  dataType(false)
7726
- ], exports.UI.prototype, "editable", undefined);
7774
+ ], exports.UI.prototype, "editable", void 0);
7727
7775
  __decorate([
7728
7776
  hitType(true)
7729
- ], exports.UI.prototype, "hittable", undefined);
7777
+ ], exports.UI.prototype, "hittable", void 0);
7730
7778
  __decorate([
7731
7779
  hitType('path')
7732
- ], exports.UI.prototype, "hitFill", undefined);
7780
+ ], exports.UI.prototype, "hitFill", void 0);
7733
7781
  __decorate([
7734
7782
  strokeType('path')
7735
- ], exports.UI.prototype, "hitStroke", undefined);
7783
+ ], exports.UI.prototype, "hitStroke", void 0);
7736
7784
  __decorate([
7737
7785
  hitType(false)
7738
- ], exports.UI.prototype, "hitBox", undefined);
7786
+ ], exports.UI.prototype, "hitBox", void 0);
7739
7787
  __decorate([
7740
7788
  hitType(true)
7741
- ], exports.UI.prototype, "hitChildren", undefined);
7789
+ ], exports.UI.prototype, "hitChildren", void 0);
7742
7790
  __decorate([
7743
7791
  hitType(true)
7744
- ], exports.UI.prototype, "hitSelf", undefined);
7792
+ ], exports.UI.prototype, "hitSelf", void 0);
7745
7793
  __decorate([
7746
7794
  hitType()
7747
- ], exports.UI.prototype, "hitRadius", undefined);
7795
+ ], exports.UI.prototype, "hitRadius", void 0);
7748
7796
  __decorate([
7749
7797
  cursorType('')
7750
- ], exports.UI.prototype, "cursor", undefined);
7798
+ ], exports.UI.prototype, "cursor", void 0);
7751
7799
  __decorate([
7752
7800
  surfaceType()
7753
- ], exports.UI.prototype, "fill", undefined);
7801
+ ], exports.UI.prototype, "fill", void 0);
7754
7802
  __decorate([
7755
7803
  strokeType()
7756
- ], exports.UI.prototype, "stroke", undefined);
7804
+ ], exports.UI.prototype, "stroke", void 0);
7757
7805
  __decorate([
7758
7806
  strokeType('inside')
7759
- ], exports.UI.prototype, "strokeAlign", undefined);
7807
+ ], exports.UI.prototype, "strokeAlign", void 0);
7760
7808
  __decorate([
7761
7809
  strokeType(1)
7762
- ], exports.UI.prototype, "strokeWidth", undefined);
7810
+ ], exports.UI.prototype, "strokeWidth", void 0);
7763
7811
  __decorate([
7764
7812
  strokeType(false)
7765
- ], exports.UI.prototype, "strokeWidthFixed", undefined);
7813
+ ], exports.UI.prototype, "strokeWidthFixed", void 0);
7766
7814
  __decorate([
7767
7815
  strokeType('none')
7768
- ], exports.UI.prototype, "strokeCap", undefined);
7816
+ ], exports.UI.prototype, "strokeCap", void 0);
7769
7817
  __decorate([
7770
7818
  strokeType('miter')
7771
- ], exports.UI.prototype, "strokeJoin", undefined);
7819
+ ], exports.UI.prototype, "strokeJoin", void 0);
7772
7820
  __decorate([
7773
7821
  strokeType()
7774
- ], exports.UI.prototype, "dashPattern", undefined);
7822
+ ], exports.UI.prototype, "dashPattern", void 0);
7775
7823
  __decorate([
7776
7824
  strokeType()
7777
- ], exports.UI.prototype, "dashOffset", undefined);
7825
+ ], exports.UI.prototype, "dashOffset", void 0);
7778
7826
  __decorate([
7779
7827
  strokeType(10)
7780
- ], exports.UI.prototype, "miterLimit", undefined);
7828
+ ], exports.UI.prototype, "miterLimit", void 0);
7781
7829
  __decorate([
7782
7830
  pathType(0)
7783
- ], exports.UI.prototype, "cornerRadius", undefined);
7831
+ ], exports.UI.prototype, "cornerRadius", void 0);
7784
7832
  __decorate([
7785
7833
  pathType()
7786
- ], exports.UI.prototype, "cornerSmoothing", undefined);
7834
+ ], exports.UI.prototype, "cornerSmoothing", void 0);
7835
+ __decorate([
7836
+ effectType()
7837
+ ], exports.UI.prototype, "shadow", void 0);
7787
7838
  __decorate([
7788
7839
  effectType()
7789
- ], exports.UI.prototype, "shadow", undefined);
7840
+ ], exports.UI.prototype, "innerShadow", void 0);
7790
7841
  __decorate([
7791
7842
  effectType()
7792
- ], exports.UI.prototype, "innerShadow", undefined);
7843
+ ], exports.UI.prototype, "blur", void 0);
7793
7844
  __decorate([
7794
7845
  effectType()
7795
- ], exports.UI.prototype, "blur", undefined);
7846
+ ], exports.UI.prototype, "backgroundBlur", void 0);
7796
7847
  __decorate([
7797
7848
  effectType()
7798
- ], exports.UI.prototype, "backgroundBlur", undefined);
7849
+ ], exports.UI.prototype, "grayscale", void 0);
7799
7850
  __decorate([
7800
7851
  effectType()
7801
- ], exports.UI.prototype, "grayscale", undefined);
7852
+ ], exports.UI.prototype, "filter", void 0);
7802
7853
  __decorate([
7803
7854
  dataType({})
7804
- ], exports.UI.prototype, "data", undefined);
7855
+ ], exports.UI.prototype, "data", void 0);
7805
7856
  __decorate([
7806
7857
  rewrite(exports.Leaf.prototype.reset)
7807
7858
  ], exports.UI.prototype, "reset", null);
@@ -7862,7 +7913,7 @@ var LeaferUI = (function (exports) {
7862
7913
  };
7863
7914
  __decorate([
7864
7915
  dataProcessor(GroupData)
7865
- ], exports.Group.prototype, "__", undefined);
7916
+ ], exports.Group.prototype, "__", void 0);
7866
7917
  exports.Group = __decorate([
7867
7918
  useModule(exports.Branch),
7868
7919
  registerUI()
@@ -7875,7 +7926,7 @@ var LeaferUI = (function (exports) {
7875
7926
  get isApp() { return false; }
7876
7927
  get app() { return this.parent || this; }
7877
7928
  get isLeafer() { return true; }
7878
- get imageReady() { return this.viewReady && ImageManager.isComplete; }
7929
+ get imageReady() { return this.viewReady && Resource.isComplete; }
7879
7930
  get layoutLocked() { return !this.layouter.running; }
7880
7931
  get FPS() { return this.renderer ? this.renderer.FPS : 60; }
7881
7932
  get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
@@ -8086,13 +8137,13 @@ var LeaferUI = (function (exports) {
8086
8137
  WaitHelper.run(this.__viewReadyWait);
8087
8138
  }
8088
8139
  __onLayoutEnd() {
8089
- const { grow, growWidth, growHeight } = this.config;
8140
+ const { grow, width: fixedWidth, height: fixedHeight } = this.config;
8090
8141
  if (grow) {
8091
8142
  let { width, height, pixelRatio } = this;
8092
8143
  const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
8093
- if (growWidth !== false)
8144
+ if (!fixedWidth)
8094
8145
  width = Math.max(1, bounds.x + bounds.width);
8095
- if (growHeight !== false)
8146
+ if (!fixedHeight)
8096
8147
  height = Math.max(1, bounds.y + bounds.height);
8097
8148
  this.__doResize({ width, height, pixelRatio });
8098
8149
  }
@@ -8170,7 +8221,7 @@ var LeaferUI = (function (exports) {
8170
8221
  list.push(item);
8171
8222
  this.requestRender();
8172
8223
  }
8173
- zoom(_zoomType, _padding, _fixedScale) {
8224
+ zoom(_zoomType, _padding, _fixedScale, _transition) {
8174
8225
  return Plugin.need('view');
8175
8226
  }
8176
8227
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
@@ -8235,10 +8286,10 @@ var LeaferUI = (function (exports) {
8235
8286
  exports.Leafer.list = new LeafList();
8236
8287
  __decorate([
8237
8288
  dataProcessor(LeaferData)
8238
- ], exports.Leafer.prototype, "__", undefined);
8289
+ ], exports.Leafer.prototype, "__", void 0);
8239
8290
  __decorate([
8240
8291
  boundsType()
8241
- ], exports.Leafer.prototype, "pixelRatio", undefined);
8292
+ ], exports.Leafer.prototype, "pixelRatio", void 0);
8242
8293
  exports.Leafer = Leafer_1 = __decorate([
8243
8294
  registerUI()
8244
8295
  ], exports.Leafer);
@@ -8251,7 +8302,7 @@ var LeaferUI = (function (exports) {
8251
8302
  };
8252
8303
  __decorate([
8253
8304
  dataProcessor(RectData)
8254
- ], exports.Rect.prototype, "__", undefined);
8305
+ ], exports.Rect.prototype, "__", void 0);
8255
8306
  exports.Rect = __decorate([
8256
8307
  useModule(RectRender),
8257
8308
  rewriteAble(),
@@ -8342,13 +8393,13 @@ var LeaferUI = (function (exports) {
8342
8393
  };
8343
8394
  __decorate([
8344
8395
  dataProcessor(BoxData)
8345
- ], exports.Box.prototype, "__", undefined);
8396
+ ], exports.Box.prototype, "__", void 0);
8346
8397
  __decorate([
8347
8398
  dataType(false)
8348
- ], exports.Box.prototype, "resizeChildren", undefined);
8399
+ ], exports.Box.prototype, "resizeChildren", void 0);
8349
8400
  __decorate([
8350
8401
  affectRenderBoundsType('show')
8351
- ], exports.Box.prototype, "overflow", undefined);
8402
+ ], exports.Box.prototype, "overflow", void 0);
8352
8403
  __decorate([
8353
8404
  rewrite(rect$1.__updateStrokeSpread)
8354
8405
  ], exports.Box.prototype, "__updateStrokeSpread", null);
@@ -8387,13 +8438,13 @@ var LeaferUI = (function (exports) {
8387
8438
  };
8388
8439
  __decorate([
8389
8440
  dataProcessor(FrameData)
8390
- ], exports.Frame.prototype, "__", undefined);
8441
+ ], exports.Frame.prototype, "__", void 0);
8391
8442
  __decorate([
8392
8443
  surfaceType('#FFFFFF')
8393
- ], exports.Frame.prototype, "fill", undefined);
8444
+ ], exports.Frame.prototype, "fill", void 0);
8394
8445
  __decorate([
8395
8446
  affectRenderBoundsType('hide')
8396
- ], exports.Frame.prototype, "overflow", undefined);
8447
+ ], exports.Frame.prototype, "overflow", void 0);
8397
8448
  exports.Frame = __decorate([
8398
8449
  registerUI()
8399
8450
  ], exports.Frame);
@@ -8440,16 +8491,16 @@ var LeaferUI = (function (exports) {
8440
8491
  };
8441
8492
  __decorate([
8442
8493
  dataProcessor(EllipseData)
8443
- ], exports.Ellipse.prototype, "__", undefined);
8494
+ ], exports.Ellipse.prototype, "__", void 0);
8444
8495
  __decorate([
8445
8496
  pathType(0)
8446
- ], exports.Ellipse.prototype, "innerRadius", undefined);
8497
+ ], exports.Ellipse.prototype, "innerRadius", void 0);
8447
8498
  __decorate([
8448
8499
  pathType(0)
8449
- ], exports.Ellipse.prototype, "startAngle", undefined);
8500
+ ], exports.Ellipse.prototype, "startAngle", void 0);
8450
8501
  __decorate([
8451
8502
  pathType(0)
8452
- ], exports.Ellipse.prototype, "endAngle", undefined);
8503
+ ], exports.Ellipse.prototype, "endAngle", void 0);
8453
8504
  exports.Ellipse = __decorate([
8454
8505
  registerUI()
8455
8506
  ], exports.Ellipse);
@@ -8508,22 +8559,22 @@ var LeaferUI = (function (exports) {
8508
8559
  };
8509
8560
  __decorate([
8510
8561
  dataProcessor(LineData)
8511
- ], exports.Line.prototype, "__", undefined);
8562
+ ], exports.Line.prototype, "__", void 0);
8512
8563
  __decorate([
8513
8564
  affectStrokeBoundsType('center')
8514
- ], exports.Line.prototype, "strokeAlign", undefined);
8565
+ ], exports.Line.prototype, "strokeAlign", void 0);
8515
8566
  __decorate([
8516
8567
  boundsType(0)
8517
- ], exports.Line.prototype, "height", undefined);
8568
+ ], exports.Line.prototype, "height", void 0);
8518
8569
  __decorate([
8519
8570
  pathType()
8520
- ], exports.Line.prototype, "points", undefined);
8571
+ ], exports.Line.prototype, "points", void 0);
8521
8572
  __decorate([
8522
8573
  pathType(0)
8523
- ], exports.Line.prototype, "curve", undefined);
8574
+ ], exports.Line.prototype, "curve", void 0);
8524
8575
  __decorate([
8525
8576
  pathType(false)
8526
- ], exports.Line.prototype, "closed", undefined);
8577
+ ], exports.Line.prototype, "closed", void 0);
8527
8578
  exports.Line = __decorate([
8528
8579
  registerUI()
8529
8580
  ], exports.Line);
@@ -8556,16 +8607,16 @@ var LeaferUI = (function (exports) {
8556
8607
  };
8557
8608
  __decorate([
8558
8609
  dataProcessor(PolygonData)
8559
- ], exports.Polygon.prototype, "__", undefined);
8610
+ ], exports.Polygon.prototype, "__", void 0);
8560
8611
  __decorate([
8561
8612
  pathType(3)
8562
- ], exports.Polygon.prototype, "sides", undefined);
8613
+ ], exports.Polygon.prototype, "sides", void 0);
8563
8614
  __decorate([
8564
8615
  pathType()
8565
- ], exports.Polygon.prototype, "points", undefined);
8616
+ ], exports.Polygon.prototype, "points", void 0);
8566
8617
  __decorate([
8567
8618
  pathType(0)
8568
- ], exports.Polygon.prototype, "curve", undefined);
8619
+ ], exports.Polygon.prototype, "curve", void 0);
8569
8620
  __decorate([
8570
8621
  rewrite(line.__updateRenderPath)
8571
8622
  ], exports.Polygon.prototype, "__updateRenderPath", null);
@@ -8597,13 +8648,13 @@ var LeaferUI = (function (exports) {
8597
8648
  };
8598
8649
  __decorate([
8599
8650
  dataProcessor(StarData)
8600
- ], exports.Star.prototype, "__", undefined);
8651
+ ], exports.Star.prototype, "__", void 0);
8601
8652
  __decorate([
8602
8653
  pathType(5)
8603
- ], exports.Star.prototype, "corners", undefined);
8654
+ ], exports.Star.prototype, "corners", void 0);
8604
8655
  __decorate([
8605
8656
  pathType(0.382)
8606
- ], exports.Star.prototype, "innerRadius", undefined);
8657
+ ], exports.Star.prototype, "innerRadius", void 0);
8607
8658
  exports.Star = __decorate([
8608
8659
  registerUI()
8609
8660
  ], exports.Star);
@@ -8625,10 +8676,10 @@ var LeaferUI = (function (exports) {
8625
8676
  };
8626
8677
  __decorate([
8627
8678
  dataProcessor(ImageData)
8628
- ], exports.Image.prototype, "__", undefined);
8679
+ ], exports.Image.prototype, "__", void 0);
8629
8680
  __decorate([
8630
8681
  boundsType('')
8631
- ], exports.Image.prototype, "url", undefined);
8682
+ ], exports.Image.prototype, "url", void 0);
8632
8683
  exports.Image = __decorate([
8633
8684
  registerUI()
8634
8685
  ], exports.Image);
@@ -8691,25 +8742,25 @@ var LeaferUI = (function (exports) {
8691
8742
  };
8692
8743
  __decorate([
8693
8744
  dataProcessor(CanvasData)
8694
- ], exports.Canvas.prototype, "__", undefined);
8745
+ ], exports.Canvas.prototype, "__", void 0);
8695
8746
  __decorate([
8696
8747
  resizeType(100)
8697
- ], exports.Canvas.prototype, "width", undefined);
8748
+ ], exports.Canvas.prototype, "width", void 0);
8698
8749
  __decorate([
8699
8750
  resizeType(100)
8700
- ], exports.Canvas.prototype, "height", undefined);
8751
+ ], exports.Canvas.prototype, "height", void 0);
8701
8752
  __decorate([
8702
8753
  resizeType(1)
8703
- ], exports.Canvas.prototype, "pixelRatio", undefined);
8754
+ ], exports.Canvas.prototype, "pixelRatio", void 0);
8704
8755
  __decorate([
8705
8756
  resizeType(true)
8706
- ], exports.Canvas.prototype, "smooth", undefined);
8757
+ ], exports.Canvas.prototype, "smooth", void 0);
8707
8758
  __decorate([
8708
8759
  dataType(false)
8709
- ], exports.Canvas.prototype, "safeResize", undefined);
8760
+ ], exports.Canvas.prototype, "safeResize", void 0);
8710
8761
  __decorate([
8711
8762
  resizeType()
8712
- ], exports.Canvas.prototype, "contextSettings", undefined);
8763
+ ], exports.Canvas.prototype, "contextSettings", void 0);
8713
8764
  exports.Canvas = __decorate([
8714
8765
  registerUI()
8715
8766
  ], exports.Canvas);
@@ -8800,76 +8851,76 @@ var LeaferUI = (function (exports) {
8800
8851
  };
8801
8852
  __decorate([
8802
8853
  dataProcessor(TextData)
8803
- ], exports.Text.prototype, "__", undefined);
8854
+ ], exports.Text.prototype, "__", void 0);
8804
8855
  __decorate([
8805
8856
  boundsType(0)
8806
- ], exports.Text.prototype, "width", undefined);
8857
+ ], exports.Text.prototype, "width", void 0);
8807
8858
  __decorate([
8808
8859
  boundsType(0)
8809
- ], exports.Text.prototype, "height", undefined);
8860
+ ], exports.Text.prototype, "height", void 0);
8810
8861
  __decorate([
8811
8862
  dataType(false)
8812
- ], exports.Text.prototype, "resizeFontSize", undefined);
8863
+ ], exports.Text.prototype, "resizeFontSize", void 0);
8813
8864
  __decorate([
8814
8865
  surfaceType('#000000')
8815
- ], exports.Text.prototype, "fill", undefined);
8866
+ ], exports.Text.prototype, "fill", void 0);
8816
8867
  __decorate([
8817
8868
  affectStrokeBoundsType('outside')
8818
- ], exports.Text.prototype, "strokeAlign", undefined);
8869
+ ], exports.Text.prototype, "strokeAlign", void 0);
8819
8870
  __decorate([
8820
8871
  hitType('all')
8821
- ], exports.Text.prototype, "hitFill", undefined);
8872
+ ], exports.Text.prototype, "hitFill", void 0);
8822
8873
  __decorate([
8823
8874
  boundsType('')
8824
- ], exports.Text.prototype, "text", undefined);
8875
+ ], exports.Text.prototype, "text", void 0);
8825
8876
  __decorate([
8826
8877
  boundsType('caption')
8827
- ], exports.Text.prototype, "fontFamily", undefined);
8878
+ ], exports.Text.prototype, "fontFamily", void 0);
8828
8879
  __decorate([
8829
8880
  boundsType(12)
8830
- ], exports.Text.prototype, "fontSize", undefined);
8881
+ ], exports.Text.prototype, "fontSize", void 0);
8831
8882
  __decorate([
8832
8883
  boundsType('normal')
8833
- ], exports.Text.prototype, "fontWeight", undefined);
8884
+ ], exports.Text.prototype, "fontWeight", void 0);
8834
8885
  __decorate([
8835
8886
  boundsType(false)
8836
- ], exports.Text.prototype, "italic", undefined);
8887
+ ], exports.Text.prototype, "italic", void 0);
8837
8888
  __decorate([
8838
8889
  boundsType('none')
8839
- ], exports.Text.prototype, "textCase", undefined);
8890
+ ], exports.Text.prototype, "textCase", void 0);
8840
8891
  __decorate([
8841
8892
  boundsType('none')
8842
- ], exports.Text.prototype, "textDecoration", undefined);
8893
+ ], exports.Text.prototype, "textDecoration", void 0);
8843
8894
  __decorate([
8844
8895
  boundsType(0)
8845
- ], exports.Text.prototype, "letterSpacing", undefined);
8896
+ ], exports.Text.prototype, "letterSpacing", void 0);
8846
8897
  __decorate([
8847
8898
  boundsType({ type: 'percent', value: 1.5 })
8848
- ], exports.Text.prototype, "lineHeight", undefined);
8899
+ ], exports.Text.prototype, "lineHeight", void 0);
8849
8900
  __decorate([
8850
8901
  boundsType(0)
8851
- ], exports.Text.prototype, "paraIndent", undefined);
8902
+ ], exports.Text.prototype, "paraIndent", void 0);
8852
8903
  __decorate([
8853
8904
  boundsType(0)
8854
- ], exports.Text.prototype, "paraSpacing", undefined);
8905
+ ], exports.Text.prototype, "paraSpacing", void 0);
8855
8906
  __decorate([
8856
8907
  boundsType('x')
8857
- ], exports.Text.prototype, "writingMode", undefined);
8908
+ ], exports.Text.prototype, "writingMode", void 0);
8858
8909
  __decorate([
8859
8910
  boundsType('left')
8860
- ], exports.Text.prototype, "textAlign", undefined);
8911
+ ], exports.Text.prototype, "textAlign", void 0);
8861
8912
  __decorate([
8862
8913
  boundsType('top')
8863
- ], exports.Text.prototype, "verticalAlign", undefined);
8914
+ ], exports.Text.prototype, "verticalAlign", void 0);
8864
8915
  __decorate([
8865
8916
  boundsType(true)
8866
- ], exports.Text.prototype, "autoSizeAlign", undefined);
8917
+ ], exports.Text.prototype, "autoSizeAlign", void 0);
8867
8918
  __decorate([
8868
8919
  boundsType('normal')
8869
- ], exports.Text.prototype, "textWrap", undefined);
8920
+ ], exports.Text.prototype, "textWrap", void 0);
8870
8921
  __decorate([
8871
8922
  boundsType('show')
8872
- ], exports.Text.prototype, "textOverflow", undefined);
8923
+ ], exports.Text.prototype, "textOverflow", void 0);
8873
8924
  exports.Text = __decorate([
8874
8925
  registerUI()
8875
8926
  ], exports.Text);
@@ -8882,10 +8933,10 @@ var LeaferUI = (function (exports) {
8882
8933
  };
8883
8934
  __decorate([
8884
8935
  dataProcessor(PathData)
8885
- ], exports.Path.prototype, "__", undefined);
8936
+ ], exports.Path.prototype, "__", void 0);
8886
8937
  __decorate([
8887
8938
  affectStrokeBoundsType('center')
8888
- ], exports.Path.prototype, "strokeAlign", undefined);
8939
+ ], exports.Path.prototype, "strokeAlign", void 0);
8889
8940
  exports.Path = __decorate([
8890
8941
  registerUI()
8891
8942
  ], exports.Path);
@@ -8924,10 +8975,10 @@ var LeaferUI = (function (exports) {
8924
8975
  };
8925
8976
  __decorate([
8926
8977
  dataProcessor(PenData)
8927
- ], exports.Pen.prototype, "__", undefined);
8978
+ ], exports.Pen.prototype, "__", void 0);
8928
8979
  __decorate([
8929
8980
  penPathType()
8930
- ], exports.Pen.prototype, "path", undefined);
8981
+ ], exports.Pen.prototype, "path", void 0);
8931
8982
  exports.Pen = __decorate([
8932
8983
  useModule(PathCreator, ['set', 'path', 'paint']),
8933
8984
  registerUI()
@@ -9163,7 +9214,7 @@ var LeaferUI = (function (exports) {
9163
9214
  const { draggable, dragBounds } = leaf, move = leaf.getLocalPoint(total, null, true);
9164
9215
  PointHelper.move(move, start.x - leaf.x, start.y - leaf.y);
9165
9216
  if (dragBounds)
9166
- this.getMoveInDragBounds(leaf.__local, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
9217
+ this.getMoveInDragBounds(leaf.__localBoxBounds, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
9167
9218
  if (draggable === 'x')
9168
9219
  move.y = 0;
9169
9220
  if (draggable === 'y')
@@ -9694,10 +9745,9 @@ var LeaferUI = (function (exports) {
9694
9745
  }
9695
9746
  }
9696
9747
  pointerMoveReal(data) {
9697
- const { dragHover, dragDistance } = this.p;
9698
9748
  this.emit(exports.PointerEvent.BEFORE_MOVE, data, this.defaultPath);
9699
9749
  if (this.downData) {
9700
- const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
9750
+ const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
9701
9751
  if (canDrag) {
9702
9752
  if (this.waitTap)
9703
9753
  this.pointerWaitCancel();
@@ -9709,9 +9759,8 @@ var LeaferUI = (function (exports) {
9709
9759
  this.updateHoverData(data);
9710
9760
  this.checkPath(data);
9711
9761
  this.emit(exports.PointerEvent.MOVE, data);
9712
- if (!(this.dragging && !dragHover))
9713
- this.pointerHover(data);
9714
- if (this.dragger.dragging) {
9762
+ this.pointerHover(data);
9763
+ if (this.dragging) {
9715
9764
  this.dragger.dragOverOrOut(data);
9716
9765
  this.dragger.dragEnterOrLeave(data);
9717
9766
  }
@@ -9792,7 +9841,8 @@ var LeaferUI = (function (exports) {
9792
9841
  this.updateCursor();
9793
9842
  }
9794
9843
  pointerHover(data) {
9795
- if (this.canHover) {
9844
+ if (this.canHover && !(this.dragging && !this.p.dragHover)) {
9845
+ data.path || (data.path = new LeafList());
9796
9846
  this.pointerOverOrOut(data);
9797
9847
  this.pointerEnterOrLeave(data);
9798
9848
  }
@@ -9867,7 +9917,9 @@ var LeaferUI = (function (exports) {
9867
9917
  }
9868
9918
  findPath(data, options) {
9869
9919
  const { hitRadius, through } = this.p;
9870
- const { bottomList } = this;
9920
+ const { bottomList, target } = this;
9921
+ if (!Platform.backgrounder && !data.origin)
9922
+ target && target.updateLayout();
9871
9923
  const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
9872
9924
  if (find.throughPath)
9873
9925
  data.throughPath = find.throughPath;
@@ -10112,9 +10164,9 @@ var LeaferUI = (function (exports) {
10112
10164
  }
10113
10165
  return this.__hit(inner);
10114
10166
  };
10115
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
10116
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
10117
- leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
10167
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
10168
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
10169
+ 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); };
10118
10170
  leaf.__drawHitPath = function (canvas) { if (canvas)
10119
10171
  this.__drawRenderPath(canvas); };
10120
10172
 
@@ -10202,8 +10254,8 @@ var LeaferUI = (function (exports) {
10202
10254
  return ui.leafer ? ui.leafer.selector : (Platform.selector || (Platform.selector = Creator.selector()));
10203
10255
  }
10204
10256
  exports.Group.prototype.pick = function (hitPoint, options) {
10205
- this.leafer || this.updateLayout();
10206
10257
  options || (options = emptyData);
10258
+ this.updateLayout();
10207
10259
  return getSelector(this).getByPoint(hitPoint, options.hitRadius || 0, Object.assign(Object.assign({}, options), { target: this }));
10208
10260
  };
10209
10261
 
@@ -10271,6 +10323,7 @@ var LeaferUI = (function (exports) {
10271
10323
  'pointerdown': this.onPointerDown,
10272
10324
  'mousedown': this.onMouseDown,
10273
10325
  'touchstart': this.onTouchStart,
10326
+ 'pointerleave': this.onPointerLeave,
10274
10327
  'contextmenu': this.onContextMenu,
10275
10328
  'wheel': this.onWheel,
10276
10329
  'gesturestart': this.onGesturestart,
@@ -10353,11 +10406,15 @@ var LeaferUI = (function (exports) {
10353
10406
  this.usePointer || (this.usePointer = true);
10354
10407
  this.pointerDown(PointerEventHelper.convert(e, this.getLocal(e)));
10355
10408
  }
10356
- onPointerMove(e) {
10409
+ onPointerMove(e, isLeave) {
10357
10410
  if (this.config.pointer.touch || this.useMultiTouch || this.preventWindowPointer(e))
10358
10411
  return;
10359
10412
  this.usePointer || (this.usePointer = true);
10360
- this.pointerMove(PointerEventHelper.convert(e, this.getLocal(e, true)));
10413
+ const data = PointerEventHelper.convert(e, this.getLocal(e, true));
10414
+ isLeave ? this.pointerHover(data) : this.pointerMove(data);
10415
+ }
10416
+ onPointerLeave(e) {
10417
+ this.onPointerMove(e, true);
10361
10418
  }
10362
10419
  onPointerUp(e) {
10363
10420
  if (this.downData)
@@ -10891,7 +10948,7 @@ var LeaferUI = (function (exports) {
10891
10948
  box = tempBox.set(box).shrink(paint.padding);
10892
10949
  if (paint.mode === 'strench')
10893
10950
  paint.mode = 'stretch';
10894
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
10951
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
10895
10952
  const sameBox = box.width === width && box.height === height;
10896
10953
  const data = { mode };
10897
10954
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -10954,6 +11011,8 @@ var LeaferUI = (function (exports) {
10954
11011
  data.height = height;
10955
11012
  if (opacity)
10956
11013
  data.opacity = opacity;
11014
+ if (filters)
11015
+ data.filters = filters;
10957
11016
  if (repeat)
10958
11017
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
10959
11018
  return data;
@@ -11056,7 +11115,7 @@ var LeaferUI = (function (exports) {
11056
11115
  scaleX = abs$1(scaleX);
11057
11116
  scaleY = abs$1(scaleY);
11058
11117
  const { image, data } = paint;
11059
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
11118
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
11060
11119
  if (sx) {
11061
11120
  imageMatrix = get$1();
11062
11121
  copy$1(imageMatrix, transform);
@@ -11099,7 +11158,7 @@ var LeaferUI = (function (exports) {
11099
11158
  }
11100
11159
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
11101
11160
  }
11102
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
11161
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
11103
11162
  const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
11104
11163
  paint.style = pattern;
11105
11164
  paint.patternId = id;
@@ -11143,7 +11202,7 @@ var LeaferUI = (function (exports) {
11143
11202
  canvas.opacity *= data.opacity;
11144
11203
  if (data.transform)
11145
11204
  canvas.transform(data.transform);
11146
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
11205
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
11147
11206
  canvas.restore();
11148
11207
  return true;
11149
11208
  }
@@ -11153,7 +11212,7 @@ var LeaferUI = (function (exports) {
11153
11212
  }
11154
11213
  else {
11155
11214
  if (!paint.patternTask) {
11156
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
11215
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
11157
11216
  paint.patternTask = null;
11158
11217
  if (canvas.bounds.hit(ui.__nowWorld))
11159
11218
  createPattern(ui, paint, pixelRatio);
@@ -11743,11 +11802,11 @@ var LeaferUI = (function (exports) {
11743
11802
  function layoutChar(drawData, style, width, _height) {
11744
11803
  const { rows } = drawData;
11745
11804
  const { textAlign, paraIndent, letterSpacing } = style;
11746
- let charX, addWordWidth, indentWidth, mode, wordChar;
11805
+ let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
11747
11806
  rows.forEach(row => {
11748
11807
  if (row.words) {
11749
- indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
11750
- addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11808
+ indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
11809
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
11751
11810
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
11752
11811
  if (row.isOverflow && !letterSpacing)
11753
11812
  row.textMode = true;
@@ -11759,7 +11818,7 @@ var LeaferUI = (function (exports) {
11759
11818
  row.x += indentWidth;
11760
11819
  charX = row.x;
11761
11820
  row.data = [];
11762
- row.words.forEach(word => {
11821
+ row.words.forEach((word, index) => {
11763
11822
  if (mode === WordMode) {
11764
11823
  wordChar = { char: '', x: charX };
11765
11824
  charX = toWordChar(word.data, charX, wordChar);
@@ -11769,7 +11828,7 @@ var LeaferUI = (function (exports) {
11769
11828
  else {
11770
11829
  charX = toChar(word.data, charX, row.data, row.isOverflow);
11771
11830
  }
11772
- if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
11831
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
11773
11832
  charX += addWordWidth;
11774
11833
  row.width += addWordWidth;
11775
11834
  }
@@ -12051,6 +12110,7 @@ var LeaferUI = (function (exports) {
12051
12110
  exports.Eventer = Eventer;
12052
12111
  exports.Export = Export;
12053
12112
  exports.FileHelper = FileHelper;
12113
+ exports.Filter = Filter;
12054
12114
  exports.FrameData = FrameData;
12055
12115
  exports.GroupData = GroupData;
12056
12116
  exports.HitCanvasManager = HitCanvasManager;
@@ -12121,6 +12181,7 @@ var LeaferUI = (function (exports) {
12121
12181
  exports.RenderEvent = RenderEvent;
12122
12182
  exports.Renderer = Renderer;
12123
12183
  exports.ResizeEvent = ResizeEvent;
12184
+ exports.Resource = Resource;
12124
12185
  exports.Run = Run;
12125
12186
  exports.Selector = Selector;
12126
12187
  exports.StarData = StarData;
@@ -12196,3 +12257,4 @@ var LeaferUI = (function (exports) {
12196
12257
  return exports;
12197
12258
 
12198
12259
  })({});
12260
+ //# sourceMappingURL=web.js.map