@leafer-ui/miniapp 1.9.10 → 1.9.12
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 +2 -2
- package/dist/miniapp.esm.js +2 -2
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +33 -25
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/miniapp.module.js
CHANGED
|
@@ -3840,7 +3840,12 @@ class TaskProcessor {
|
|
|
3840
3840
|
runTask() {
|
|
3841
3841
|
const task = this.list[this.index];
|
|
3842
3842
|
if (!task) {
|
|
3843
|
-
this.nextTask();
|
|
3843
|
+
this.timer = setTimeout(() => this.nextTask());
|
|
3844
|
+
return;
|
|
3845
|
+
}
|
|
3846
|
+
if (task.isCancel) {
|
|
3847
|
+
this.index++;
|
|
3848
|
+
this.runTask();
|
|
3844
3849
|
return;
|
|
3845
3850
|
}
|
|
3846
3851
|
task.run().then(() => {
|
|
@@ -3871,16 +3876,15 @@ class TaskProcessor {
|
|
|
3871
3876
|
}
|
|
3872
3877
|
setParallelList() {
|
|
3873
3878
|
let task;
|
|
3879
|
+
const {config: config, list: list, index: index} = this;
|
|
3874
3880
|
this.parallelList = [];
|
|
3875
3881
|
this.parallelSuccessNumber = 0;
|
|
3876
|
-
let end =
|
|
3877
|
-
if (end >
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
this.parallelList.push(task);
|
|
3882
|
-
} else {
|
|
3883
|
-
break;
|
|
3882
|
+
let end = index + config.parallel;
|
|
3883
|
+
if (end > list.length) end = list.length;
|
|
3884
|
+
if (config.parallel > 1) {
|
|
3885
|
+
for (let i = index; i < end; i++) {
|
|
3886
|
+
task = list[i];
|
|
3887
|
+
if (task.parallel) this.parallelList.push(task); else break;
|
|
3884
3888
|
}
|
|
3885
3889
|
}
|
|
3886
3890
|
}
|
|
@@ -6815,7 +6819,7 @@ class LeafLevelList {
|
|
|
6815
6819
|
}
|
|
6816
6820
|
}
|
|
6817
6821
|
|
|
6818
|
-
const version = "1.9.
|
|
6822
|
+
const version = "1.9.12";
|
|
6819
6823
|
|
|
6820
6824
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6821
6825
|
get allowBackgroundColor() {
|
|
@@ -9925,7 +9929,7 @@ class UIEvent extends Event {
|
|
|
9925
9929
|
}
|
|
9926
9930
|
}
|
|
9927
9931
|
|
|
9928
|
-
const {float: float, sign: sign} = MathHelper, {
|
|
9932
|
+
const {min: min, max: max$2, abs: abs$2} = Math, {float: float, sign: sign} = MathHelper, {minX: minX, maxX: maxX, minY: minY, maxY: maxY} = BoundsHelper;
|
|
9929
9933
|
|
|
9930
9934
|
const tempContent = new Bounds, tempDragBounds = new Bounds;
|
|
9931
9935
|
|
|
@@ -9975,26 +9979,27 @@ const DragBoundsHelper = {
|
|
|
9975
9979
|
tempContent.set(content).scaleOf(origin, scale.x, scale.y);
|
|
9976
9980
|
const originLeftScale = (origin.x - content.x) / content.width, originRightScale = 1 - originLeftScale;
|
|
9977
9981
|
const originTopScale = (origin.y - content.y) / content.height, originBottomScale = 1 - originTopScale;
|
|
9978
|
-
let correctScaleX, correctScaleY, aScale, bScale, aSize, bSize;
|
|
9982
|
+
let correctScaleX = 1, correctScaleY = 1, aScale, bScale, aSize, bSize;
|
|
9979
9983
|
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
9980
|
-
|
|
9981
|
-
if (scale.x < 0) tempContent.scaleOf(origin, correctScaleX, 1);
|
|
9984
|
+
if (scale.x < 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
9982
9985
|
aSize = float(tempContent.minX - tempDragBounds.minX);
|
|
9983
9986
|
bSize = float(tempDragBounds.maxX - tempContent.maxX);
|
|
9984
9987
|
aScale = originLeftScale && aSize > 0 ? 1 + aSize / (originLeftScale * tempContent.width) : 1;
|
|
9985
9988
|
bScale = originRightScale && bSize > 0 ? 1 + bSize / (originRightScale * tempContent.width) : 1;
|
|
9986
9989
|
correctScaleX *= max$2(aScale, bScale);
|
|
9987
9990
|
} else {
|
|
9988
|
-
if (scale.x < 0)
|
|
9991
|
+
if (scale.x < 0) {
|
|
9992
|
+
if (float(minX(content) - minX(dragBounds)) <= 0 || float(maxX(dragBounds) - maxX(content)) <= 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
9993
|
+
tempContent.unsign();
|
|
9994
|
+
}
|
|
9989
9995
|
aSize = float(tempDragBounds.minX - tempContent.minX);
|
|
9990
9996
|
bSize = float(tempContent.maxX - tempDragBounds.maxX);
|
|
9991
9997
|
aScale = originLeftScale && aSize > 0 ? 1 - aSize / (originLeftScale * tempContent.width) : 1;
|
|
9992
9998
|
bScale = originRightScale && bSize > 0 ? 1 - bSize / (originRightScale * tempContent.width) : 1;
|
|
9993
|
-
correctScaleX
|
|
9999
|
+
correctScaleX *= min(aScale, bScale);
|
|
9994
10000
|
}
|
|
9995
10001
|
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
9996
|
-
|
|
9997
|
-
if (scale.y < 0) tempContent.scaleOf(origin, 1, correctScaleY);
|
|
10002
|
+
if (scale.y < 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
9998
10003
|
aSize = float(tempContent.minY - tempDragBounds.minY);
|
|
9999
10004
|
bSize = float(tempDragBounds.maxY - tempContent.maxY);
|
|
10000
10005
|
aScale = originTopScale && aSize > 0 ? 1 + aSize / (originTopScale * tempContent.height) : 1;
|
|
@@ -10006,12 +10011,15 @@ const DragBoundsHelper = {
|
|
|
10006
10011
|
correctScaleY = sign(correctScaleY) * aScale;
|
|
10007
10012
|
}
|
|
10008
10013
|
} else {
|
|
10009
|
-
if (scale.y < 0)
|
|
10014
|
+
if (scale.y < 0) {
|
|
10015
|
+
if (float(minY(content) - minY(dragBounds)) <= 0 || float(maxY(dragBounds) - maxY(content)) <= 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
10016
|
+
tempContent.unsign();
|
|
10017
|
+
}
|
|
10010
10018
|
aSize = float(tempDragBounds.minY - tempContent.minY);
|
|
10011
10019
|
bSize = float(tempContent.maxY - tempDragBounds.maxY);
|
|
10012
10020
|
aScale = originTopScale && aSize > 0 ? 1 - aSize / (originTopScale * tempContent.height) : 1;
|
|
10013
10021
|
bScale = originBottomScale && bSize > 0 ? 1 - bSize / (originBottomScale * tempContent.height) : 1;
|
|
10014
|
-
correctScaleY
|
|
10022
|
+
correctScaleY *= min(aScale, bScale);
|
|
10015
10023
|
}
|
|
10016
10024
|
scale.x *= isFinite(correctScaleX) ? correctScaleX : 1;
|
|
10017
10025
|
scale.y *= isFinite(correctScaleY) ? correctScaleY : 1;
|
|
@@ -11091,9 +11099,9 @@ const ui$1 = UI.prototype;
|
|
|
11091
11099
|
|
|
11092
11100
|
ui$1.__updateHitCanvas = function() {
|
|
11093
11101
|
if (this.__box) this.__box.__updateHitCanvas();
|
|
11094
|
-
const
|
|
11095
|
-
if (!
|
|
11096
|
-
const data = this.__
|
|
11102
|
+
const {hitCanvasManager: hitCanvasManager} = this.leafer || this.parent && this.parent.leafer || {};
|
|
11103
|
+
if (!hitCanvasManager) return;
|
|
11104
|
+
const data = this.__;
|
|
11097
11105
|
const isHitPixelFill = (data.__isAlphaPixelFill || data.__isCanvas) && data.hitFill === "pixel";
|
|
11098
11106
|
const isHitPixelStroke = data.__isAlphaPixelStroke && data.hitStroke === "pixel";
|
|
11099
11107
|
const isHitPixel = isHitPixelFill || isHitPixelStroke;
|
|
@@ -12289,11 +12297,11 @@ function getShadowRenderSpread(_ui, shadow) {
|
|
|
12289
12297
|
|
|
12290
12298
|
function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
|
|
12291
12299
|
if (shadow.spread) {
|
|
12292
|
-
const
|
|
12300
|
+
const spread = shadow.spread * 2 * otherScale * (isInnerShaodw ? -1 : 1), {width: width, height: height} = ui.__layout.strokeBounds;
|
|
12293
12301
|
tempMatrix.set().scaleOfOuter({
|
|
12294
12302
|
x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
|
|
12295
12303
|
y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
|
|
12296
|
-
},
|
|
12304
|
+
}, 1 + spread / width, 1 + spread / height);
|
|
12297
12305
|
return tempMatrix;
|
|
12298
12306
|
}
|
|
12299
12307
|
return undefined;
|