@leafer-game/miniapp 1.12.2 → 1.12.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 +35 -10
- 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
|
@@ -4117,6 +4117,10 @@ class LeaferImage {
|
|
|
4117
4117
|
get url() {
|
|
4118
4118
|
return this.config.url;
|
|
4119
4119
|
}
|
|
4120
|
+
get crossOrigin() {
|
|
4121
|
+
const {crossOrigin: crossOrigin} = this.config;
|
|
4122
|
+
return isUndefined(crossOrigin) ? Platform.image.crossOrigin : crossOrigin;
|
|
4123
|
+
}
|
|
4120
4124
|
get completed() {
|
|
4121
4125
|
return this.ready || !!this.error;
|
|
4122
4126
|
}
|
|
@@ -4134,12 +4138,14 @@ class LeaferImage {
|
|
|
4134
4138
|
ImageManager.isFormat("svg", config) && (this.isSVG = true);
|
|
4135
4139
|
ImageManager.hasAlphaPixel(config) && (this.hasAlphaPixel = true);
|
|
4136
4140
|
}
|
|
4137
|
-
load(onSuccess, onError) {
|
|
4141
|
+
load(onSuccess, onError, thumbSize) {
|
|
4138
4142
|
if (!this.loading) {
|
|
4139
4143
|
this.loading = true;
|
|
4140
|
-
const {crossOrigin: crossOrigin} = this.config;
|
|
4141
4144
|
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
4142
|
-
return yield Platform.origin.loadImage(this.
|
|
4145
|
+
return yield Platform.origin.loadImage(this.getLoadUrl(thumbSize), this.crossOrigin, this).then(img => {
|
|
4146
|
+
if (thumbSize) this.setThumbView(img);
|
|
4147
|
+
this.setView(img);
|
|
4148
|
+
}).catch(e => {
|
|
4143
4149
|
this.error = e;
|
|
4144
4150
|
this.onComplete(false);
|
|
4145
4151
|
});
|
|
@@ -4160,9 +4166,11 @@ class LeaferImage {
|
|
|
4160
4166
|
}
|
|
4161
4167
|
setView(img) {
|
|
4162
4168
|
this.ready = true;
|
|
4163
|
-
this.width
|
|
4164
|
-
|
|
4165
|
-
|
|
4169
|
+
if (!this.width) {
|
|
4170
|
+
this.width = img.width;
|
|
4171
|
+
this.height = img.height;
|
|
4172
|
+
this.view = img;
|
|
4173
|
+
}
|
|
4166
4174
|
this.onComplete(true);
|
|
4167
4175
|
}
|
|
4168
4176
|
onComplete(isSuccess) {
|
|
@@ -4208,6 +4216,19 @@ class LeaferImage {
|
|
|
4208
4216
|
Platform.image.setPatternTransform(pattern, transform, paint);
|
|
4209
4217
|
return pattern;
|
|
4210
4218
|
}
|
|
4219
|
+
getLoadUrl(_thumbSize) {
|
|
4220
|
+
return this.url;
|
|
4221
|
+
}
|
|
4222
|
+
setThumbView(_view) {}
|
|
4223
|
+
getThumbSize() {
|
|
4224
|
+
return undefined;
|
|
4225
|
+
}
|
|
4226
|
+
getMinLevel() {
|
|
4227
|
+
return undefined;
|
|
4228
|
+
}
|
|
4229
|
+
getLevelData(_level) {
|
|
4230
|
+
return undefined;
|
|
4231
|
+
}
|
|
4211
4232
|
clearLevels(_checkUse) {}
|
|
4212
4233
|
destroy() {
|
|
4213
4234
|
this.clearLevels();
|
|
@@ -6937,7 +6958,7 @@ class LeafLevelList {
|
|
|
6937
6958
|
}
|
|
6938
6959
|
}
|
|
6939
6960
|
|
|
6940
|
-
const version = "1.12.
|
|
6961
|
+
const version = "1.12.3";
|
|
6941
6962
|
|
|
6942
6963
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6943
6964
|
get allowBackgroundColor() {
|
|
@@ -10313,6 +10334,10 @@ MoveEvent.DRAG_ANIMATE = "move.drag_animate";
|
|
|
10313
10334
|
|
|
10314
10335
|
MoveEvent.END = "move.end";
|
|
10315
10336
|
|
|
10337
|
+
MoveEvent.PULL_DOWN = "move.pull_down";
|
|
10338
|
+
|
|
10339
|
+
MoveEvent.REACH_BOTTOM = "move.reach_bottom";
|
|
10340
|
+
|
|
10316
10341
|
MoveEvent = __decorate([ registerUIEvent() ], MoveEvent);
|
|
10317
10342
|
|
|
10318
10343
|
let TouchEvent = class TouchEvent extends UIEvent {};
|
|
@@ -11894,7 +11919,7 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
11894
11919
|
ignoreRender(ui, false);
|
|
11895
11920
|
onLoadError(ui, event, error);
|
|
11896
11921
|
leafPaint.loadId = undefined;
|
|
11897
|
-
});
|
|
11922
|
+
}, paint.lod && image.getThumbSize());
|
|
11898
11923
|
if (ui.placeholderColor) {
|
|
11899
11924
|
if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
|
|
11900
11925
|
if (!image.ready) {
|
|
@@ -14279,8 +14304,8 @@ let AnimateList = class AnimateList extends Animate {
|
|
|
14279
14304
|
this.each(item => item.stop());
|
|
14280
14305
|
this.emitType(AnimateEvent.STOP);
|
|
14281
14306
|
}
|
|
14282
|
-
seek(time) {
|
|
14283
|
-
this.each(item => item.seek(time));
|
|
14307
|
+
seek(time, includeDelay) {
|
|
14308
|
+
this.each(item => item.seek(time, includeDelay));
|
|
14284
14309
|
this.emitType(AnimateEvent.SEEK);
|
|
14285
14310
|
}
|
|
14286
14311
|
kill(complete, killStyle) {
|