@leafer/miniapp 2.2.1 → 2.2.3
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/miniapp.module.js
CHANGED
|
@@ -4168,7 +4168,7 @@ const ImageManager = {
|
|
|
4168
4168
|
patternTasker: Resource.queue,
|
|
4169
4169
|
get(config, type) {
|
|
4170
4170
|
let image = Resource.get(config.url);
|
|
4171
|
-
if (!image) Resource.set(config.url, image = type
|
|
4171
|
+
if (!image) Resource.set(config.url, image = Creator[type || "image"](config));
|
|
4172
4172
|
image.use++;
|
|
4173
4173
|
return image;
|
|
4174
4174
|
},
|
|
@@ -6340,6 +6340,9 @@ let Leaf = class Leaf {
|
|
|
6340
6340
|
get isLeafer() {
|
|
6341
6341
|
return false;
|
|
6342
6342
|
}
|
|
6343
|
+
get isFrame() {
|
|
6344
|
+
return false;
|
|
6345
|
+
}
|
|
6343
6346
|
get isBranch() {
|
|
6344
6347
|
return false;
|
|
6345
6348
|
}
|
|
@@ -6481,6 +6484,16 @@ let Leaf = class Leaf {
|
|
|
6481
6484
|
}
|
|
6482
6485
|
}
|
|
6483
6486
|
}
|
|
6487
|
+
__bindFrame(frame) {
|
|
6488
|
+
if (this.isFrame && frame !== null) frame = this;
|
|
6489
|
+
this.frame = frame;
|
|
6490
|
+
if (this.isBranch) {
|
|
6491
|
+
const {children: children} = this;
|
|
6492
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
6493
|
+
children[i].__bindFrame(frame);
|
|
6494
|
+
}
|
|
6495
|
+
}
|
|
6496
|
+
}
|
|
6484
6497
|
setAttr(name, value) {
|
|
6485
6498
|
this[name] = value;
|
|
6486
6499
|
}
|
|
@@ -6793,6 +6806,7 @@ let Branch = class Branch extends Leaf {
|
|
|
6793
6806
|
child.__bindLeafer(this.leafer);
|
|
6794
6807
|
if (this.leafer.created) this.__emitChildEvent(ChildEvent.ADD, child);
|
|
6795
6808
|
}
|
|
6809
|
+
if (this.isFrame) child.__bindFrame(this);
|
|
6796
6810
|
this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
|
|
6797
6811
|
}
|
|
6798
6812
|
addMany(...children) {
|
|
@@ -6848,6 +6862,7 @@ let Branch = class Branch extends Leaf {
|
|
|
6848
6862
|
if (this.leafer.hitCanvasManager) this.leafer.hitCanvasManager.clear();
|
|
6849
6863
|
}
|
|
6850
6864
|
}
|
|
6865
|
+
if (this.isFrame) child.__bindFrame(null);
|
|
6851
6866
|
}
|
|
6852
6867
|
__emitChildEvent(type, child) {
|
|
6853
6868
|
const event = new ChildEvent(type, child, this);
|
|
@@ -7005,7 +7020,7 @@ class LeafLevelList {
|
|
|
7005
7020
|
}
|
|
7006
7021
|
}
|
|
7007
7022
|
|
|
7008
|
-
const version = "2.2.
|
|
7023
|
+
const version = "2.2.3";
|
|
7009
7024
|
|
|
7010
7025
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7011
7026
|
get allowBackgroundColor() {
|
|
@@ -8617,9 +8632,6 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8617
8632
|
get app() {
|
|
8618
8633
|
return this.leafer && this.leafer.app;
|
|
8619
8634
|
}
|
|
8620
|
-
get isFrame() {
|
|
8621
|
-
return false;
|
|
8622
|
-
}
|
|
8623
8635
|
set strokeWidthFixed(value) {
|
|
8624
8636
|
this.strokeScaleFixed = value;
|
|
8625
8637
|
}
|
|
@@ -13452,7 +13464,9 @@ function targetAttr(fn) {
|
|
|
13452
13464
|
if (isObject(check)) value = check; else if (check === false) return;
|
|
13453
13465
|
}
|
|
13454
13466
|
if (t.hasDimOthers) t.cancelDimOthers();
|
|
13455
|
-
if (isArray(value) && value.length > 1 && value
|
|
13467
|
+
if (isArray(value) && value.length > 1 && value.some(item => item.locked || item.editable === "single")) {
|
|
13468
|
+
value = value.filter(item => !(item.locked || item.editable === "single"));
|
|
13469
|
+
}
|
|
13456
13470
|
if (t.single) {
|
|
13457
13471
|
delete t.element.syncEventer;
|
|
13458
13472
|
delete t.element.__world.ignorePixelSnap;
|
|
@@ -15931,7 +15945,8 @@ let LineEditTool = class LineEditTool extends EditTool {
|
|
|
15931
15945
|
const {from: from, to: to} = fromTo;
|
|
15932
15946
|
line.innerToWorld(from, from, false, editBox);
|
|
15933
15947
|
line.innerToWorld(to, to, false, editBox);
|
|
15934
|
-
|
|
15948
|
+
const {x: x, y: y} = editBox.rectBounds;
|
|
15949
|
+
rect.pen.clearPath().moveTo(from.x - x, from.y - y).lineTo(to.x - x, to.y - y);
|
|
15935
15950
|
copy$2(resizePoints[7], from);
|
|
15936
15951
|
copy$2(rotatePoints[7], from);
|
|
15937
15952
|
copy$2(resizePoints[3], to);
|