@leafer-draw/miniapp 1.0.10 → 1.1.0
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.cjs +12 -0
- package/dist/miniapp.esm.js +12 -0
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.module.js +42 -29
- package/dist/miniapp.module.min.js +1 -1
- package/package.json +7 -7
package/dist/miniapp.module.js
CHANGED
|
@@ -108,7 +108,7 @@ const MathHelper = {
|
|
|
108
108
|
return rotation - oldRotation;
|
|
109
109
|
},
|
|
110
110
|
float(num, maxLength) {
|
|
111
|
-
const a = maxLength ? pow$1(10, maxLength) : 1000000000000;
|
|
111
|
+
const a = maxLength !== undefined ? pow$1(10, maxLength) : 1000000000000;
|
|
112
112
|
num = round(num * a) / a;
|
|
113
113
|
return num === -0 ? 0 : num;
|
|
114
114
|
},
|
|
@@ -4165,20 +4165,17 @@ const LeafHelper = {
|
|
|
4165
4165
|
}
|
|
4166
4166
|
return true;
|
|
4167
4167
|
},
|
|
4168
|
-
moveWorld(t, x, y = 0, isInnerPoint) {
|
|
4168
|
+
moveWorld(t, x, y = 0, isInnerPoint, transition) {
|
|
4169
4169
|
const local = typeof x === 'object' ? Object.assign({}, x) : { x, y };
|
|
4170
4170
|
isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : (t.parent && toInnerPoint$1(t.parent.worldTransform, local, local, true));
|
|
4171
|
-
L.moveLocal(t, local.x, local.y);
|
|
4171
|
+
L.moveLocal(t, local.x, local.y, transition);
|
|
4172
4172
|
},
|
|
4173
|
-
moveLocal(t, x, y = 0) {
|
|
4174
|
-
if (typeof x === 'object')
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
t.x += x;
|
|
4180
|
-
t.y += y;
|
|
4181
|
-
}
|
|
4173
|
+
moveLocal(t, x, y = 0, transition) {
|
|
4174
|
+
if (typeof x === 'object')
|
|
4175
|
+
y = x.y, x = x.x;
|
|
4176
|
+
x += t.x;
|
|
4177
|
+
y += t.y;
|
|
4178
|
+
transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
|
|
4182
4179
|
},
|
|
4183
4180
|
zoomOfWorld(t, origin, scaleX, scaleY, resize) {
|
|
4184
4181
|
L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
|
|
@@ -5558,11 +5555,11 @@ let Leaf = class Leaf {
|
|
|
5558
5555
|
transform(matrix, resize) {
|
|
5559
5556
|
transform(this, matrix, resize);
|
|
5560
5557
|
}
|
|
5561
|
-
move(x, y) {
|
|
5562
|
-
moveLocal(this, x, y);
|
|
5558
|
+
move(x, y, transition) {
|
|
5559
|
+
moveLocal(this, x, y, transition);
|
|
5563
5560
|
}
|
|
5564
|
-
moveInner(x, y) {
|
|
5565
|
-
moveWorld(this, x, y, true);
|
|
5561
|
+
moveInner(x, y, transition) {
|
|
5562
|
+
moveWorld(this, x, y, true, transition);
|
|
5566
5563
|
}
|
|
5567
5564
|
scaleOf(origin, scaleX, scaleY, resize) {
|
|
5568
5565
|
zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
|
|
@@ -5576,8 +5573,8 @@ let Leaf = class Leaf {
|
|
|
5576
5573
|
transformWorld(worldTransform, resize) {
|
|
5577
5574
|
transformWorld(this, worldTransform, resize);
|
|
5578
5575
|
}
|
|
5579
|
-
moveWorld(x, y) {
|
|
5580
|
-
moveWorld(this, x, y);
|
|
5576
|
+
moveWorld(x, y, transition) {
|
|
5577
|
+
moveWorld(this, x, y, false, transition);
|
|
5581
5578
|
}
|
|
5582
5579
|
scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
|
|
5583
5580
|
zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
|
|
@@ -5975,7 +5972,7 @@ class LeafLevelList {
|
|
|
5975
5972
|
}
|
|
5976
5973
|
}
|
|
5977
5974
|
|
|
5978
|
-
const version = "1.0
|
|
5975
|
+
const version = "1.1.0";
|
|
5979
5976
|
|
|
5980
5977
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
5981
5978
|
get allowBackgroundColor() { return false; }
|
|
@@ -7272,11 +7269,15 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7272
7269
|
super(data);
|
|
7273
7270
|
}
|
|
7274
7271
|
reset(_data) { }
|
|
7275
|
-
set(data,
|
|
7276
|
-
if (
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7272
|
+
set(data, transition) {
|
|
7273
|
+
if (transition) {
|
|
7274
|
+
if (transition === 'temp') {
|
|
7275
|
+
this.lockNormalStyle = true;
|
|
7276
|
+
Object.assign(this, data);
|
|
7277
|
+
this.lockNormalStyle = false;
|
|
7278
|
+
}
|
|
7279
|
+
else
|
|
7280
|
+
this.animate(data, transition);
|
|
7280
7281
|
}
|
|
7281
7282
|
else
|
|
7282
7283
|
Object.assign(this, data);
|
|
@@ -7586,17 +7587,17 @@ let Group = class Group extends UI {
|
|
|
7586
7587
|
if (!this.children)
|
|
7587
7588
|
this.children = [];
|
|
7588
7589
|
}
|
|
7589
|
-
set(data,
|
|
7590
|
+
set(data, transition) {
|
|
7590
7591
|
if (data.children) {
|
|
7591
7592
|
const { children } = data;
|
|
7592
7593
|
delete data.children;
|
|
7593
7594
|
this.children ? this.clear() : this.__setBranch();
|
|
7594
|
-
super.set(data,
|
|
7595
|
+
super.set(data, transition);
|
|
7595
7596
|
children.forEach(child => this.add(child));
|
|
7596
7597
|
data.children = children;
|
|
7597
7598
|
}
|
|
7598
7599
|
else
|
|
7599
|
-
super.set(data,
|
|
7600
|
+
super.set(data, transition);
|
|
7600
7601
|
}
|
|
7601
7602
|
toJSON(options) {
|
|
7602
7603
|
const data = super.toJSON(options);
|
|
@@ -7709,8 +7710,8 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7709
7710
|
}
|
|
7710
7711
|
onInit() { }
|
|
7711
7712
|
initType(_type) { }
|
|
7712
|
-
set(data) {
|
|
7713
|
-
this.waitInit(() => { super.set(data); });
|
|
7713
|
+
set(data, transition) {
|
|
7714
|
+
this.waitInit(() => { super.set(data, transition); });
|
|
7714
7715
|
}
|
|
7715
7716
|
start() {
|
|
7716
7717
|
clearTimeout(this.__startTimer);
|
|
@@ -8805,6 +8806,8 @@ function stroke(stroke, ui, canvas) {
|
|
|
8805
8806
|
case 'center':
|
|
8806
8807
|
canvas.setStroke(stroke, __strokeWidth, options);
|
|
8807
8808
|
canvas.stroke();
|
|
8809
|
+
if (options.__useArrow)
|
|
8810
|
+
strokeArrow(ui, canvas);
|
|
8808
8811
|
break;
|
|
8809
8812
|
case 'inside':
|
|
8810
8813
|
canvas.save();
|
|
@@ -8842,6 +8845,8 @@ function strokes(strokes, ui, canvas) {
|
|
|
8842
8845
|
case 'center':
|
|
8843
8846
|
canvas.setStroke(undefined, __strokeWidth, options);
|
|
8844
8847
|
drawStrokesStyle(strokes, false, ui, canvas);
|
|
8848
|
+
if (options.__useArrow)
|
|
8849
|
+
strokeArrow(ui, canvas);
|
|
8845
8850
|
break;
|
|
8846
8851
|
case 'inside':
|
|
8847
8852
|
canvas.save();
|
|
@@ -8867,6 +8872,14 @@ function strokes(strokes, ui, canvas) {
|
|
|
8867
8872
|
}
|
|
8868
8873
|
}
|
|
8869
8874
|
}
|
|
8875
|
+
function strokeArrow(ui, canvas) {
|
|
8876
|
+
if (ui.__.dashPattern) {
|
|
8877
|
+
canvas.beginPath();
|
|
8878
|
+
ui.__drawPathByData(canvas, ui.__.__pathForArrow);
|
|
8879
|
+
canvas.dashPattern = null;
|
|
8880
|
+
canvas.stroke();
|
|
8881
|
+
}
|
|
8882
|
+
}
|
|
8870
8883
|
|
|
8871
8884
|
const { getSpread, getOuterOf, getByMove, getIntersectData } = BoundsHelper;
|
|
8872
8885
|
function shape(ui, current, options) {
|