@leafer/miniapp 2.0.4 → 2.0.6

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.
@@ -7053,7 +7053,7 @@ class LeafLevelList {
7053
7053
  }
7054
7054
  }
7055
7055
 
7056
- const version = "2.0.4";
7056
+ const version = "2.0.6";
7057
7057
 
7058
7058
  class LeaferCanvas extends LeaferCanvasBase {
7059
7059
  get allowBackgroundColor() {
@@ -8696,6 +8696,7 @@ let UI = UI_1 = class UI extends Leaf {
8696
8696
  createProxyData() {
8697
8697
  return undefined;
8698
8698
  }
8699
+ clearProxyData() {}
8699
8700
  find(_condition, _options) {
8700
8701
  return Plugin.need("find");
8701
8702
  }
@@ -12075,17 +12076,19 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
12075
12076
  }
12076
12077
 
12077
12078
  function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds) {
12079
+ let needUpdate = true;
12078
12080
  const data = ui.__;
12079
12081
  if (attrName === "fill" && !data.__naturalWidth) {
12080
12082
  data.__naturalWidth = image.width / data.pixelRatio;
12081
12083
  data.__naturalHeight = image.height / data.pixelRatio;
12082
12084
  if (data.__autoSide) {
12083
12085
  ui.forceUpdate("width");
12086
+ LeafHelper.updateBounds(ui);
12084
12087
  if (ui.__proxyData) {
12085
12088
  ui.setProxyAttr("width", data.width);
12086
12089
  ui.setProxyAttr("height", data.height);
12087
12090
  }
12088
- return false;
12091
+ needUpdate = false;
12089
12092
  }
12090
12093
  }
12091
12094
  if (!leafPaint.data) {
@@ -12095,7 +12098,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
12095
12098
  if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
12096
12099
  }
12097
12100
  if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
12098
- return true;
12101
+ return needUpdate;
12099
12102
  }
12100
12103
 
12101
12104
  function onLoad(ui, event) {
@@ -12545,10 +12548,10 @@ const realFrom = {};
12545
12548
  const realTo = {};
12546
12549
 
12547
12550
  function conicGradient(paint, box) {
12548
- let {from: from, to: to, type: type, opacity: opacity, stretch: stretch} = paint;
12551
+ let {from: from, to: to, type: type, opacity: opacity, rotation: rotation, stretch: stretch} = paint;
12549
12552
  toPoint$1(from || "center", box, realFrom);
12550
12553
  toPoint$1(to || "bottom", box, realTo);
12551
- const style = Platform.conicGradientSupport ? Platform.canvas.createConicGradient(0, realFrom.x, realFrom.y) : Platform.canvas.createRadialGradient(realFrom.x, realFrom.y, 0, realFrom.x, realFrom.y, getDistance$1(realFrom, realTo));
12554
+ const style = Platform.conicGradientSupport ? Platform.canvas.createConicGradient(rotation ? rotation * OneRadian : 0, realFrom.x, realFrom.y) : Platform.canvas.createRadialGradient(realFrom.x, realFrom.y, 0, realFrom.x, realFrom.y, getDistance$1(realFrom, realTo));
12552
12555
  const data = {
12553
12556
  type: type,
12554
12557
  style: style
@@ -13399,11 +13402,7 @@ function targetAttr(fn) {
13399
13402
  });
13400
13403
  if (isObject(check)) value = check; else if (check === false) return;
13401
13404
  }
13402
- if (t.hasDimOthers) {
13403
- t.setDimOthers(false);
13404
- t.setBright(false);
13405
- t.hasDimOthers = undefined;
13406
- }
13405
+ if (t.hasDimOthers) t.cancelDimOthers();
13407
13406
  if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
13408
13407
  if (t.single) {
13409
13408
  delete t.element.syncEventer;
@@ -14336,6 +14335,8 @@ class EditBox extends Group {
14336
14335
  editor.setDimOthers(dimOthers);
14337
14336
  editor.setBright(!!dimOthers || bright);
14338
14337
  editor.hasDimOthers = true;
14338
+ } else if (editor.hasDimOthers) {
14339
+ editor.cancelDimOthers();
14339
14340
  }
14340
14341
  if (spread) BoundsHelper.spread(bounds, spread);
14341
14342
  if (this.view.worldOpacity) {
@@ -15375,6 +15376,11 @@ let Editor = class Editor extends Group {
15375
15376
  setBright(value) {
15376
15377
  this.setDimOthers(value, "bright", this.list);
15377
15378
  }
15379
+ cancelDimOthers() {
15380
+ this.setDimOthers(false);
15381
+ this.setBright(false);
15382
+ this.hasDimOthers = undefined;
15383
+ }
15378
15384
  update() {
15379
15385
  if (this.editing) {
15380
15386
  if (!this.element.parent) return this.cancel();