@leafer-ui/miniapp 2.0.3 → 2.0.5

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.
@@ -5620,7 +5620,7 @@ class BoundsEvent extends Event {
5620
5620
  }
5621
5621
  }
5622
5622
  static emitWorld(leaf) {
5623
- if (leaf.leaferIsReady) leaf.emit(WORLD, this);
5623
+ if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
5624
5624
  }
5625
5625
  }
5626
5626
 
@@ -6581,14 +6581,16 @@ let Leaf = class Leaf {
6581
6581
  relative.innerToWorld(world, to, distance);
6582
6582
  world = to ? to : world;
6583
6583
  }
6584
- toInnerPoint(this.scrollWorldTransform, world, to, distance);
6584
+ toInnerPoint(this.worldTransform, world, to, distance);
6585
6585
  }
6586
6586
  innerToWorld(inner, to, distance, relative) {
6587
- toOuterPoint(this.scrollWorldTransform, inner, to, distance);
6587
+ toOuterPoint(this.worldTransform, inner, to, distance);
6588
6588
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6589
6589
  }
6590
6590
  getBoxPoint(world, relative, distance, change) {
6591
- return this.getBoxPointByInner(this.getInnerPoint(world, relative, distance, change), null, null, true);
6591
+ const inner = this.getInnerPoint(world, relative, distance, change);
6592
+ if (distance) return inner;
6593
+ return this.getBoxPointByInner(inner, null, null, true);
6592
6594
  }
6593
6595
  getBoxPointByInner(inner, _relative, _distance, change) {
6594
6596
  const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
@@ -7051,7 +7053,7 @@ class LeafLevelList {
7051
7053
  }
7052
7054
  }
7053
7055
 
7054
- const version = "2.0.3";
7056
+ const version = "2.0.5";
7055
7057
 
7056
7058
  class LeaferCanvas extends LeaferCanvasBase {
7057
7059
  get allowBackgroundColor() {
@@ -8393,7 +8395,11 @@ class EllipseData extends UIData {
8393
8395
 
8394
8396
  class PolygonData extends LineData {}
8395
8397
 
8396
- class StarData extends UIData {}
8398
+ class StarData extends UIData {
8399
+ get __boxStroke() {
8400
+ return !this.__pathInputed;
8401
+ }
8402
+ }
8397
8403
 
8398
8404
  class PathData extends UIData {
8399
8405
  get __pathInputed() {
@@ -9405,6 +9411,9 @@ let Box = class Box extends Group {
9405
9411
  get isBranchLeaf() {
9406
9412
  return true;
9407
9413
  }
9414
+ get __useSelfBox() {
9415
+ return this.pathInputed;
9416
+ }
9408
9417
  constructor(data) {
9409
9418
  super(data);
9410
9419
  this.__layout.renderChanged || this.__layout.renderChange();
@@ -9420,7 +9429,7 @@ let Box = class Box extends Group {
9420
9429
  }
9421
9430
  __updateRectBoxBounds() {}
9422
9431
  __updateBoxBounds(_secondLayout) {
9423
- if (this.children.length && !this.pathInputed) {
9432
+ if (this.children.length && !this.__useSelfBox) {
9424
9433
  const data = this.__;
9425
9434
  if (data.__autoSide) {
9426
9435
  if (data.__hasSurface) this.__extraUpdate();
@@ -11152,6 +11161,14 @@ class InteractionBase {
11152
11161
  stopDragAnimate() {
11153
11162
  this.dragger.stopAnimate();
11154
11163
  }
11164
+ replaceDownTarget(target) {
11165
+ const {downData: downData} = this;
11166
+ if (downData && target) {
11167
+ const {path: path} = downData;
11168
+ path.remove(path.list[0]);
11169
+ path.addAt(target, 0);
11170
+ }
11171
+ }
11155
11172
  updateDownData(data, options, merge) {
11156
11173
  const {downData: downData} = this;
11157
11174
  if (!data && downData) data = downData;
@@ -12350,7 +12367,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
12350
12367
  if (drawImage) {
12351
12368
  if (data.repeat) {
12352
12369
  drawImage = false;
12353
- } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
12370
+ } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
12354
12371
  drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
12355
12372
  }
12356
12373
  }
@@ -12903,7 +12920,7 @@ function createRows(drawData, content, style) {
12903
12920
  }, row = {
12904
12921
  words: []
12905
12922
  };
12906
- if (__letterSpacing) content = [ ...content ];
12923
+ content = [ ...content ];
12907
12924
  for (let i = 0, len = content.length; i < len; i++) {
12908
12925
  char = content[i];
12909
12926
  if (char === "\n") {