leafer-ui 1.4.0 → 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.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Debug, LeaferCanvasBase, Platform, DataHelper, canvasSizeAttrs, ResizeEvent, canvasPatch, Creator, LeaferImage, defineKey, FileHelper, LeafList, RenderEvent, ChildEvent, WatchEvent, PropertyEvent, LeafHelper, BranchHelper, Bounds, LeafBoundsHelper, LeafLevelList, LayoutEvent, Run, ImageManager, BoundsHelper, Plugin, MathHelper, MatrixHelper, AlignHelper, ImageEvent, AroundHelper, PointHelper, Direction4 } from '@leafer/core';
1
+ import { Debug, LeaferCanvasBase, Platform, DataHelper, canvasSizeAttrs, ResizeEvent, canvasPatch, FileHelper, Creator, LeaferImage, defineKey, LeafList, RenderEvent, ChildEvent, WatchEvent, PropertyEvent, LeafHelper, BranchHelper, LeafBoundsHelper, Bounds, LeafLevelList, LayoutEvent, Run, ImageManager, BoundsHelper, Plugin, MathHelper, MatrixHelper, AlignHelper, ImageEvent, AroundHelper, PointHelper, Direction4 } from '@leafer/core';
2
2
  export * from '@leafer/core';
3
3
  export { LeaferImage } from '@leafer/core';
4
4
  import { InteractionHelper, InteractionBase, Cursor, HitCanvasManager } from '@leafer-ui/core';
@@ -260,7 +260,7 @@ if (userAgent.indexOf("Firefox") > -1) {
260
260
  Platform.intWheelDeltaY = true;
261
261
  Platform.syncDomFont = true;
262
262
  }
263
- else if (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") === -1) {
263
+ else if (userAgent.indexOf("AppleWebKit") > -1) {
264
264
  Platform.fullImageShadow = true;
265
265
  }
266
266
  if (userAgent.indexOf('Windows') > -1) {
@@ -529,7 +529,7 @@ class Layouter {
529
529
  }
530
530
  partLayout() {
531
531
  var _a;
532
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
532
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
533
533
  return;
534
534
  const t = Run.start('PartLayout');
535
535
  const { target, __updatedList: updateList } = this;
@@ -994,9 +994,10 @@ class Selector {
994
994
  this.finder = Creator.finder && Creator.finder();
995
995
  }
996
996
  getByPoint(hitPoint, hitRadius, options) {
997
- if (Platform.backgrounder && this.target)
998
- this.target.updateLayout();
999
- return this.picker.getByPoint(hitPoint, hitRadius, options);
997
+ const { target, picker } = this;
998
+ if (Platform.backgrounder)
999
+ target && target.updateLayout();
1000
+ return picker.getByPoint(hitPoint, hitRadius, options);
1000
1001
  }
1001
1002
  getBy(condition, branch, one, options) {
1002
1003
  return this.finder ? this.finder.getBy(condition, branch, one, options) : Plugin.need('find');
@@ -1684,7 +1685,7 @@ function getPatternData(paint, box, image) {
1684
1685
  box = tempBox.set(box).shrink(paint.padding);
1685
1686
  if (paint.mode === 'strench')
1686
1687
  paint.mode = 'stretch';
1687
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
1688
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
1688
1689
  const sameBox = box.width === width && box.height === height;
1689
1690
  const data = { mode };
1690
1691
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -1747,6 +1748,8 @@ function getPatternData(paint, box, image) {
1747
1748
  data.height = height;
1748
1749
  if (opacity)
1749
1750
  data.opacity = opacity;
1751
+ if (filters)
1752
+ data.filters = filters;
1750
1753
  if (repeat)
1751
1754
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
1752
1755
  return data;
@@ -1849,7 +1852,7 @@ function createPattern(ui, paint, pixelRatio) {
1849
1852
  scaleX = abs$1(scaleX);
1850
1853
  scaleY = abs$1(scaleY);
1851
1854
  const { image, data } = paint;
1852
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
1855
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
1853
1856
  if (sx) {
1854
1857
  imageMatrix = get$1();
1855
1858
  copy$1(imageMatrix, transform);
@@ -1892,7 +1895,7 @@ function createPattern(ui, paint, pixelRatio) {
1892
1895
  }
1893
1896
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
1894
1897
  }
1895
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
1898
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
1896
1899
  const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
1897
1900
  paint.style = pattern;
1898
1901
  paint.patternId = id;
@@ -1968,7 +1971,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
1968
1971
  canvas.opacity *= data.opacity;
1969
1972
  if (data.transform)
1970
1973
  canvas.transform(data.transform);
1971
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
1974
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
1972
1975
  canvas.restore();
1973
1976
  return true;
1974
1977
  }
@@ -1978,7 +1981,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
1978
1981
  }
1979
1982
  else {
1980
1983
  if (!paint.patternTask) {
1981
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
1984
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
1982
1985
  paint.patternTask = null;
1983
1986
  if (canvas.bounds.hit(ui.__nowWorld))
1984
1987
  createPattern(ui, paint, pixelRatio);