@leafer-game/worker 1.3.1 → 1.3.2
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/worker.js +178 -52
- package/dist/worker.min.js +1 -1
- package/dist/worker.module.js +179 -53
- package/dist/worker.module.min.js +1 -1
- package/package.json +10 -10
package/dist/worker.module.js
CHANGED
|
@@ -6007,7 +6007,7 @@ class LeafLevelList {
|
|
|
6007
6007
|
}
|
|
6008
6008
|
}
|
|
6009
6009
|
|
|
6010
|
-
const version = "1.3.
|
|
6010
|
+
const version = "1.3.2";
|
|
6011
6011
|
|
|
6012
6012
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6013
6013
|
get allowBackgroundColor() { return true; }
|
|
@@ -6539,7 +6539,7 @@ class Renderer {
|
|
|
6539
6539
|
partRender() {
|
|
6540
6540
|
const { canvas, updateBlocks: list } = this;
|
|
6541
6541
|
if (!list)
|
|
6542
|
-
return
|
|
6542
|
+
return;
|
|
6543
6543
|
this.mergeBlocks();
|
|
6544
6544
|
list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
|
|
6545
6545
|
this.clipRender(block); });
|
|
@@ -7395,7 +7395,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7395
7395
|
animate(_keyframe, _options, _type, _isTemp) {
|
|
7396
7396
|
return Plugin.need('animate');
|
|
7397
7397
|
}
|
|
7398
|
-
killAnimate(_type,
|
|
7398
|
+
killAnimate(_type, _nextStyle) { }
|
|
7399
7399
|
export(_filename, _options) {
|
|
7400
7400
|
return Plugin.need('export');
|
|
7401
7401
|
}
|
|
@@ -7891,8 +7891,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7891
7891
|
this.created = true;
|
|
7892
7892
|
}
|
|
7893
7893
|
__onReady() {
|
|
7894
|
-
if (this.ready)
|
|
7895
|
-
return;
|
|
7896
7894
|
this.ready = true;
|
|
7897
7895
|
this.emitLeafer(LeaferEvent.BEFORE_READY);
|
|
7898
7896
|
this.emitLeafer(LeaferEvent.READY);
|
|
@@ -7906,6 +7904,20 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7906
7904
|
this.emitLeafer(LeaferEvent.VIEW_READY);
|
|
7907
7905
|
WaitHelper.run(this.__viewReadyWait);
|
|
7908
7906
|
}
|
|
7907
|
+
__onLayoutEnd() {
|
|
7908
|
+
const { grow, growWidth, growHeight } = this.config;
|
|
7909
|
+
if (grow) {
|
|
7910
|
+
let { width, height, pixelRatio } = this;
|
|
7911
|
+
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
|
|
7912
|
+
if (growWidth !== false)
|
|
7913
|
+
width = Math.max(1, bounds.x + bounds.width);
|
|
7914
|
+
if (growHeight !== false)
|
|
7915
|
+
height = Math.max(1, bounds.y + bounds.height);
|
|
7916
|
+
this.__doResize({ width, height, pixelRatio });
|
|
7917
|
+
}
|
|
7918
|
+
if (!this.ready)
|
|
7919
|
+
this.__onReady();
|
|
7920
|
+
}
|
|
7909
7921
|
__onNextRender() {
|
|
7910
7922
|
if (this.viewReady) {
|
|
7911
7923
|
WaitHelper.run(this.__nextRenderWait);
|
|
@@ -7999,10 +8011,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7999
8011
|
const runId = Run.start('FirstCreate ' + this.innerName);
|
|
8000
8012
|
this.once(LeaferEvent.START, () => Run.end(runId));
|
|
8001
8013
|
this.once(LayoutEvent.START, () => this.updateLazyBounds());
|
|
8002
|
-
this.once(LayoutEvent.END, () => this.__onReady());
|
|
8003
8014
|
this.once(RenderEvent.START, () => this.__onCreated());
|
|
8004
8015
|
this.once(RenderEvent.END, () => this.__onViewReady());
|
|
8005
|
-
this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
|
|
8016
|
+
this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
|
|
8006
8017
|
}
|
|
8007
8018
|
__removeListenEvents() {
|
|
8008
8019
|
this.off_(this.__eventIds);
|
|
@@ -11249,7 +11260,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11249
11260
|
rows.forEach(row => {
|
|
11250
11261
|
if (row.words) {
|
|
11251
11262
|
indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
|
|
11252
|
-
addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
|
|
11263
|
+
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
|
|
11253
11264
|
mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
|
|
11254
11265
|
if (row.isOverflow && !letterSpacing)
|
|
11255
11266
|
row.textMode = true;
|
|
@@ -11271,7 +11282,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11271
11282
|
else {
|
|
11272
11283
|
charX = toChar(word.data, charX, row.data, row.isOverflow);
|
|
11273
11284
|
}
|
|
11274
|
-
if (!row.paraEnd
|
|
11285
|
+
if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
|
|
11275
11286
|
charX += addWordWidth;
|
|
11276
11287
|
row.width += addWordWidth;
|
|
11277
11288
|
}
|
|
@@ -11746,7 +11757,9 @@ function updateStyle(leaf, style, type) {
|
|
|
11746
11757
|
type = null;
|
|
11747
11758
|
let transition = type ? getTransition(type, style, leaf) : false;
|
|
11748
11759
|
const fromStyle = transition ? getFromStyle(leaf, style) : undefined;
|
|
11749
|
-
|
|
11760
|
+
const nextStyle = State.canAnimate && getStyle(leaf);
|
|
11761
|
+
if (nextStyle)
|
|
11762
|
+
leaf.killAnimate('transition');
|
|
11750
11763
|
if (normalStyle)
|
|
11751
11764
|
leaf.set(normalStyle, 'temp');
|
|
11752
11765
|
const statesStyle = getStyle(leaf);
|
|
@@ -12119,8 +12132,11 @@ function animationType(defaultValue) {
|
|
|
12119
12132
|
return decorateLeafAttr(defaultValue, (key) => attr({
|
|
12120
12133
|
set(value) {
|
|
12121
12134
|
this.__setAttr(key, value);
|
|
12122
|
-
if (this.leafer)
|
|
12123
|
-
|
|
12135
|
+
if (this.leafer) {
|
|
12136
|
+
this.killAnimate('animation');
|
|
12137
|
+
if (value)
|
|
12138
|
+
this.animate(value, undefined, 'animation');
|
|
12139
|
+
}
|
|
12124
12140
|
}
|
|
12125
12141
|
}));
|
|
12126
12142
|
}
|
|
@@ -12157,6 +12173,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12157
12173
|
get completed() { return this.time >= this.duration && !this.started; }
|
|
12158
12174
|
get frame() { return this.frames[this.nowIndex]; }
|
|
12159
12175
|
get frameTotalTime() { return this.frame.totalTime || this.frame.duration || 0; }
|
|
12176
|
+
get nowReverse() { return (this.mainReverse ? 1 : 0) + (this.frameReverse ? 1 : 0) === 1; }
|
|
12160
12177
|
get realEnding() {
|
|
12161
12178
|
let count;
|
|
12162
12179
|
const { ending, reverse, loop } = this;
|
|
@@ -12173,6 +12190,12 @@ let Animate = class Animate extends Eventer {
|
|
|
12173
12190
|
}
|
|
12174
12191
|
constructor(target, keyframe, options, isTemp) {
|
|
12175
12192
|
super();
|
|
12193
|
+
if (keyframe) {
|
|
12194
|
+
if (keyframe.keyframes)
|
|
12195
|
+
options = keyframe, keyframe = keyframe.keyframes;
|
|
12196
|
+
else if (keyframe.style)
|
|
12197
|
+
options = keyframe, keyframe = keyframe.style;
|
|
12198
|
+
}
|
|
12176
12199
|
this.init(target, keyframe, options, isTemp);
|
|
12177
12200
|
}
|
|
12178
12201
|
init(target, keyframe, options, isTemp) {
|
|
@@ -12188,16 +12211,14 @@ let Animate = class Animate extends Eventer {
|
|
|
12188
12211
|
break;
|
|
12189
12212
|
case 'object': this.config = options, options.event && (this.event = options.event);
|
|
12190
12213
|
}
|
|
12191
|
-
|
|
12192
|
-
return;
|
|
12193
|
-
this.keyframes = keyframe instanceof Array ? keyframe : [keyframe];
|
|
12214
|
+
this.keyframes = keyframe instanceof Array ? keyframe : (keyframe ? [keyframe] : []);
|
|
12194
12215
|
const { easing, attrs } = this;
|
|
12195
12216
|
this.easingFn = AnimateEasing.get(easing);
|
|
12196
12217
|
if (attrs || this.attrsMap)
|
|
12197
12218
|
this.attrsMap = attrs ? attrs.reduce((map, value) => { map[value] = true; return map; }, {}) : undefined;
|
|
12198
12219
|
this.frames = [];
|
|
12199
12220
|
this.create();
|
|
12200
|
-
if (this.autoplay)
|
|
12221
|
+
if (this.autoplay && this.frames.length)
|
|
12201
12222
|
this.timer = setTimeout(() => {
|
|
12202
12223
|
this.timer = 0;
|
|
12203
12224
|
this.play();
|
|
@@ -12246,7 +12267,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12246
12267
|
}
|
|
12247
12268
|
create() {
|
|
12248
12269
|
const { target, frames, keyframes, config } = this, { length } = keyframes, joinBefore = length > 1 ? this.join : true;
|
|
12249
|
-
let
|
|
12270
|
+
let totalTime = 0, totalAutoTime = 0, before, keyframe, item, style, times;
|
|
12250
12271
|
if (length > 1)
|
|
12251
12272
|
this.fromStyle = {}, this.toStyle = {};
|
|
12252
12273
|
for (let i = 0; i < length; i++) {
|
|
@@ -12255,27 +12276,32 @@ let Animate = class Animate extends Eventer {
|
|
|
12255
12276
|
if (!before)
|
|
12256
12277
|
before = joinBefore ? target : style;
|
|
12257
12278
|
item = { style, beforeStyle: {} };
|
|
12279
|
+
times = 1;
|
|
12258
12280
|
if (keyframe.style) {
|
|
12259
|
-
const { duration, autoDuration, delay, autoDelay, easing } = keyframe;
|
|
12281
|
+
const { duration, autoDuration, delay, autoDelay, easing, swing, loop } = keyframe;
|
|
12282
|
+
if (swing)
|
|
12283
|
+
item.swing = typeof swing === 'number' ? swing : 2, times = item.swing * 2 - 1;
|
|
12284
|
+
if (loop)
|
|
12285
|
+
item.loop = times = typeof loop === 'number' ? loop : 2;
|
|
12260
12286
|
if (duration) {
|
|
12261
|
-
item.duration = duration,
|
|
12287
|
+
item.duration = duration, totalTime += duration * times;
|
|
12262
12288
|
if (delay)
|
|
12263
12289
|
item.totalTime = duration + delay;
|
|
12264
12290
|
}
|
|
12265
12291
|
else {
|
|
12266
12292
|
if (autoDuration)
|
|
12267
|
-
item.autoDuration = autoDuration,
|
|
12293
|
+
item.autoDuration = autoDuration, totalAutoTime += autoDuration * times;
|
|
12268
12294
|
}
|
|
12269
12295
|
if (delay)
|
|
12270
|
-
item.delay = delay,
|
|
12296
|
+
item.delay = delay, totalTime += delay * times;
|
|
12271
12297
|
else if (autoDelay)
|
|
12272
|
-
item.autoDelay = autoDelay,
|
|
12298
|
+
item.autoDelay = autoDelay, totalAutoTime += autoDelay * times;
|
|
12273
12299
|
if (easing)
|
|
12274
12300
|
item.easingFn = AnimateEasing.get(easing);
|
|
12275
12301
|
}
|
|
12276
12302
|
if (!item.autoDuration && item.duration === undefined) {
|
|
12277
12303
|
if (length > 1)
|
|
12278
|
-
(i > 0 || joinBefore) ?
|
|
12304
|
+
(i > 0 || joinBefore) ? totalAutoTime += times : item.duration = 0;
|
|
12279
12305
|
else
|
|
12280
12306
|
item.duration = this.duration;
|
|
12281
12307
|
}
|
|
@@ -12291,14 +12317,14 @@ let Animate = class Animate extends Eventer {
|
|
|
12291
12317
|
before = style;
|
|
12292
12318
|
frames.push(item);
|
|
12293
12319
|
}
|
|
12294
|
-
if (
|
|
12295
|
-
if (this.duration <=
|
|
12296
|
-
this.changeDuration(
|
|
12297
|
-
this.allocateTime((this.duration -
|
|
12320
|
+
if (totalAutoTime) {
|
|
12321
|
+
if (this.duration <= totalTime || !(config && config.duration))
|
|
12322
|
+
this.changeDuration(totalTime + frameDuration * totalAutoTime);
|
|
12323
|
+
this.allocateTime((this.duration - totalTime) / totalAutoTime);
|
|
12298
12324
|
}
|
|
12299
12325
|
else {
|
|
12300
|
-
if (
|
|
12301
|
-
this.changeDuration(
|
|
12326
|
+
if (totalTime)
|
|
12327
|
+
this.changeDuration(totalTime);
|
|
12302
12328
|
}
|
|
12303
12329
|
this.emit(AnimateEvent.CREATED, this);
|
|
12304
12330
|
}
|
|
@@ -12325,7 +12351,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12325
12351
|
if (frame.autoDelay)
|
|
12326
12352
|
frame.delay = frame.autoDelay * partTime;
|
|
12327
12353
|
if (frame.delay)
|
|
12328
|
-
frame.totalTime = frame.duration
|
|
12354
|
+
frame.totalTime = frame.duration + frame.delay;
|
|
12329
12355
|
}
|
|
12330
12356
|
}
|
|
12331
12357
|
}
|
|
@@ -12343,7 +12369,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12343
12369
|
if (realTime < duration) {
|
|
12344
12370
|
while (realTime - this.playedTotalTime > this.frameTotalTime) {
|
|
12345
12371
|
this.transition(1);
|
|
12346
|
-
this.
|
|
12372
|
+
this.mainReverse ? this.reverseNextFrame() : this.nextFrame();
|
|
12347
12373
|
}
|
|
12348
12374
|
const itemDelay = this.nowReverse ? 0 : (this.frame.delay || 0);
|
|
12349
12375
|
const itemPlayedTime = realTime - this.playedTotalTime - itemDelay;
|
|
@@ -12367,9 +12393,9 @@ let Animate = class Animate extends Eventer {
|
|
|
12367
12393
|
const { loop, loopDelay, swing } = this;
|
|
12368
12394
|
if (loop !== false || swing) {
|
|
12369
12395
|
this.looped ? this.looped++ : this.looped = 1;
|
|
12370
|
-
if (
|
|
12396
|
+
if (this.needLoop(this.looped, loop, swing)) {
|
|
12371
12397
|
if (swing)
|
|
12372
|
-
this.
|
|
12398
|
+
this.mainReverse = !this.mainReverse;
|
|
12373
12399
|
if (loopDelay)
|
|
12374
12400
|
this.timer = setTimeout(() => { this.timer = 0, this.begin(); }, loopDelay / this.speed * 1000);
|
|
12375
12401
|
else
|
|
@@ -12384,8 +12410,8 @@ let Animate = class Animate extends Eventer {
|
|
|
12384
12410
|
start(seek) {
|
|
12385
12411
|
this.requestAnimateTime = 1;
|
|
12386
12412
|
const { reverse } = this;
|
|
12387
|
-
if (reverse || this.
|
|
12388
|
-
this.
|
|
12413
|
+
if (reverse || this.mainReverse)
|
|
12414
|
+
this.mainReverse = reverse;
|
|
12389
12415
|
if (this.looped)
|
|
12390
12416
|
this.looped = 0;
|
|
12391
12417
|
if (seek)
|
|
@@ -12403,12 +12429,12 @@ let Animate = class Animate extends Eventer {
|
|
|
12403
12429
|
}
|
|
12404
12430
|
begin(seek) {
|
|
12405
12431
|
this.playedTotalTime = this.time = 0;
|
|
12406
|
-
this.
|
|
12432
|
+
this.mainReverse ? this.setTo() : this.setFrom();
|
|
12407
12433
|
if (!seek)
|
|
12408
12434
|
this.requestAnimate();
|
|
12409
12435
|
}
|
|
12410
12436
|
end() {
|
|
12411
|
-
this.
|
|
12437
|
+
this.mainReverse ? this.setFrom() : this.setTo();
|
|
12412
12438
|
}
|
|
12413
12439
|
complete() {
|
|
12414
12440
|
this.requestAnimateTime = 0;
|
|
@@ -12431,15 +12457,19 @@ let Animate = class Animate extends Eventer {
|
|
|
12431
12457
|
this.setStyle(this.toStyle);
|
|
12432
12458
|
}
|
|
12433
12459
|
nextFrame() {
|
|
12460
|
+
if (this.needLoopFrame())
|
|
12461
|
+
return this.increaseTime();
|
|
12434
12462
|
if (this.nowIndex + 1 >= this.frames.length)
|
|
12435
12463
|
return;
|
|
12436
|
-
this.
|
|
12464
|
+
this.increaseTime();
|
|
12437
12465
|
this.nowIndex++;
|
|
12438
12466
|
}
|
|
12439
12467
|
reverseNextFrame() {
|
|
12468
|
+
if (this.needLoopFrame())
|
|
12469
|
+
return this.increaseTime();
|
|
12440
12470
|
if (this.nowIndex - 1 < 0)
|
|
12441
12471
|
return;
|
|
12442
|
-
this.
|
|
12472
|
+
this.increaseTime();
|
|
12443
12473
|
this.nowIndex--;
|
|
12444
12474
|
}
|
|
12445
12475
|
transition(t) {
|
|
@@ -12475,6 +12505,27 @@ let Animate = class Animate extends Eventer {
|
|
|
12475
12505
|
target.__ ? target.set(style, this.isTemp ? 'temp' : false) : Object.assign(target, style);
|
|
12476
12506
|
}
|
|
12477
12507
|
}
|
|
12508
|
+
increaseTime() {
|
|
12509
|
+
this.playedTotalTime += this.frameTotalTime;
|
|
12510
|
+
}
|
|
12511
|
+
needLoop(looped, loop, swing) {
|
|
12512
|
+
return !(this.needStopLoop(looped, loop) || this.needStopLoop(looped, swing, true));
|
|
12513
|
+
}
|
|
12514
|
+
needStopLoop(looped, times, swing) {
|
|
12515
|
+
return typeof times === 'number' && (!times || looped >= (swing ? times * 2 - 1 : times));
|
|
12516
|
+
}
|
|
12517
|
+
needLoopFrame() {
|
|
12518
|
+
const { loop, swing } = this.frame;
|
|
12519
|
+
if (loop || swing) {
|
|
12520
|
+
this.frameLooped ? this.frameLooped++ : this.frameLooped = 1;
|
|
12521
|
+
if (swing)
|
|
12522
|
+
this.frameReverse = !this.frameReverse;
|
|
12523
|
+
if (this.needLoop(this.frameLooped, loop, swing))
|
|
12524
|
+
return true;
|
|
12525
|
+
this.frameLooped = this.frameReverse = undefined;
|
|
12526
|
+
}
|
|
12527
|
+
return false;
|
|
12528
|
+
}
|
|
12478
12529
|
clearTimer(fn) {
|
|
12479
12530
|
if (this.timer) {
|
|
12480
12531
|
clearTimeout(this.timer), this.timer = 0;
|
|
@@ -12534,6 +12585,64 @@ Animate = __decorate([
|
|
|
12534
12585
|
useModule(LeafEventer)
|
|
12535
12586
|
], Animate);
|
|
12536
12587
|
|
|
12588
|
+
let AnimateList = class AnimateList extends Animate {
|
|
12589
|
+
get completed() { return this.list.every(item => item.completed); }
|
|
12590
|
+
get endingStyle() { return this._endingStyle; }
|
|
12591
|
+
constructor(target, animation, isTemp) {
|
|
12592
|
+
super(target, null);
|
|
12593
|
+
this.list = [];
|
|
12594
|
+
this.updateList(animation, isTemp);
|
|
12595
|
+
}
|
|
12596
|
+
updateList(animation, isTemp) {
|
|
12597
|
+
this.fromStyle = {};
|
|
12598
|
+
this.toStyle = {};
|
|
12599
|
+
this._endingStyle = {};
|
|
12600
|
+
if (!animation)
|
|
12601
|
+
animation = this.list.filter(item => {
|
|
12602
|
+
const { completed } = item;
|
|
12603
|
+
if (completed)
|
|
12604
|
+
item.destroy();
|
|
12605
|
+
return !completed;
|
|
12606
|
+
});
|
|
12607
|
+
this.list = animation.map(item => {
|
|
12608
|
+
const animate = item.target ? item : new Animate(this.target, item, isTemp);
|
|
12609
|
+
Object.assign(this.fromStyle, animate.fromStyle);
|
|
12610
|
+
Object.assign(this.toStyle, animate.toStyle);
|
|
12611
|
+
Object.assign(this._endingStyle, animate.endingStyle);
|
|
12612
|
+
return animate;
|
|
12613
|
+
});
|
|
12614
|
+
}
|
|
12615
|
+
play() {
|
|
12616
|
+
this.each(item => item.play());
|
|
12617
|
+
}
|
|
12618
|
+
pause() {
|
|
12619
|
+
this.each(item => item.pause());
|
|
12620
|
+
}
|
|
12621
|
+
stop() {
|
|
12622
|
+
this.each(item => item.stop());
|
|
12623
|
+
}
|
|
12624
|
+
seek(time) {
|
|
12625
|
+
this.each(item => item.seek(time));
|
|
12626
|
+
}
|
|
12627
|
+
kill(complete, killStyle) {
|
|
12628
|
+
this.each(item => item.kill(complete, killStyle));
|
|
12629
|
+
this.destroy();
|
|
12630
|
+
}
|
|
12631
|
+
each(func) {
|
|
12632
|
+
this.list.forEach(func);
|
|
12633
|
+
}
|
|
12634
|
+
destroy(complete) {
|
|
12635
|
+
const { list } = this;
|
|
12636
|
+
if (list.length) {
|
|
12637
|
+
this.each(item => item.destroy(complete));
|
|
12638
|
+
list.length = 0;
|
|
12639
|
+
}
|
|
12640
|
+
}
|
|
12641
|
+
};
|
|
12642
|
+
AnimateList = __decorate([
|
|
12643
|
+
useModule(LeafEventer)
|
|
12644
|
+
], AnimateList);
|
|
12645
|
+
|
|
12537
12646
|
const colorNames = {
|
|
12538
12647
|
transparent: 'FFF0',
|
|
12539
12648
|
aliceblue: 'F0F8FF',
|
|
@@ -12914,23 +13023,40 @@ dataType()(ui$2, 'transitionOut');
|
|
|
12914
13023
|
ui$2.animate = function (keyframe, options, kill, isTemp) {
|
|
12915
13024
|
if (keyframe === undefined)
|
|
12916
13025
|
return this.__animate;
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
13026
|
+
const isAnimationList = keyframe instanceof Array && !options && kill;
|
|
13027
|
+
let nextAnimate = isAnimationList ? new AnimateList(this, keyframe, isTemp) : new Animate(this, keyframe, options, isTemp);
|
|
13028
|
+
this.killAnimate(kill, nextAnimate.toStyle);
|
|
13029
|
+
const animate = this.__animate;
|
|
13030
|
+
if (animate) {
|
|
13031
|
+
if (nextAnimate instanceof AnimateList)
|
|
13032
|
+
nextAnimate.list.unshift(animate);
|
|
13033
|
+
else
|
|
13034
|
+
nextAnimate = new AnimateList(this, [animate, nextAnimate]);
|
|
13035
|
+
}
|
|
13036
|
+
return this.__animate = nextAnimate;
|
|
12926
13037
|
};
|
|
12927
|
-
ui$2.killAnimate = function (_type,
|
|
13038
|
+
ui$2.killAnimate = function (_type, nextStyle) {
|
|
12928
13039
|
const animate = this.__animate;
|
|
12929
|
-
if (animate)
|
|
12930
|
-
|
|
13040
|
+
if (animate) {
|
|
13041
|
+
let kill = false;
|
|
13042
|
+
if (nextStyle && !animate.completed) {
|
|
13043
|
+
if (animate instanceof AnimateList)
|
|
13044
|
+
animate.updateList();
|
|
13045
|
+
const { toStyle } = animate;
|
|
13046
|
+
for (let key in nextStyle)
|
|
13047
|
+
if (key in toStyle) {
|
|
13048
|
+
kill = true;
|
|
13049
|
+
break;
|
|
13050
|
+
}
|
|
13051
|
+
}
|
|
13052
|
+
else
|
|
13053
|
+
kill = true;
|
|
13054
|
+
if (kill)
|
|
13055
|
+
animate.kill(true, nextStyle), this.__animate = null;
|
|
13056
|
+
}
|
|
12931
13057
|
};
|
|
12932
13058
|
ui$2.__runAnimation = function (type, complete) {
|
|
12933
|
-
this.animate(type === 'in' ? this.animation : this.animationOut);
|
|
13059
|
+
this.animate(type === 'in' ? this.animation : this.animationOut, undefined, 'animation');
|
|
12934
13060
|
if (complete)
|
|
12935
13061
|
this.__animate.on(AnimateEvent.COMPLETED, complete);
|
|
12936
13062
|
};
|
|
@@ -13424,4 +13550,4 @@ Creator.finder = function (target) {
|
|
|
13424
13550
|
return new Finder(target);
|
|
13425
13551
|
};
|
|
13426
13552
|
|
|
13427
|
-
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
13553
|
+
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|