@next2d/ui 1.18.7 → 1.18.8
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/Job.d.ts +6 -7
- package/dist/Job.js +26 -33
- package/package.json +3 -3
package/dist/Job.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventDispatcher
|
|
1
|
+
import { EventDispatcher } from "@next2d/events";
|
|
2
2
|
/**
|
|
3
3
|
* @class
|
|
4
4
|
* @memberOf next2d.ui
|
|
@@ -119,15 +119,15 @@ export declare class Job extends EventDispatcher {
|
|
|
119
119
|
* @param {object} object
|
|
120
120
|
* @return {array}
|
|
121
121
|
* @method
|
|
122
|
-
* @
|
|
122
|
+
* @private
|
|
123
123
|
*/
|
|
124
|
-
entries(object: any): any[];
|
|
124
|
+
_$entries(object: any): any[];
|
|
125
125
|
/**
|
|
126
|
-
* @return {
|
|
126
|
+
* @return {void}
|
|
127
127
|
* @method
|
|
128
128
|
* @public
|
|
129
129
|
*/
|
|
130
|
-
start():
|
|
130
|
+
start(): void;
|
|
131
131
|
/**
|
|
132
132
|
* @return {void}
|
|
133
133
|
* @method
|
|
@@ -135,12 +135,11 @@ export declare class Job extends EventDispatcher {
|
|
|
135
135
|
*/
|
|
136
136
|
stop(): void;
|
|
137
137
|
/**
|
|
138
|
-
* @param {Event} event
|
|
139
138
|
* @return {void}
|
|
140
139
|
* @method
|
|
141
140
|
* @private
|
|
142
141
|
*/
|
|
143
|
-
_$update(
|
|
142
|
+
_$update(): void;
|
|
144
143
|
/**
|
|
145
144
|
* @param {object} target
|
|
146
145
|
* @param {object} from
|
package/dist/Job.js
CHANGED
|
@@ -211,50 +211,40 @@ export class Job extends EventDispatcher {
|
|
|
211
211
|
// setup
|
|
212
212
|
this._$stopFlag = false;
|
|
213
213
|
this._$startTime = $performance.now();
|
|
214
|
-
this._$names = this.entries(this._$from);
|
|
215
|
-
//
|
|
216
|
-
this.
|
|
217
|
-
this._$update(event);
|
|
218
|
-
});
|
|
214
|
+
this._$names = this._$entries(this._$from);
|
|
215
|
+
// start
|
|
216
|
+
this._$update();
|
|
219
217
|
}
|
|
220
218
|
/**
|
|
221
219
|
* @param {object} object
|
|
222
220
|
* @return {array}
|
|
223
221
|
* @method
|
|
224
|
-
* @
|
|
222
|
+
* @private
|
|
225
223
|
*/
|
|
226
|
-
entries(object) {
|
|
224
|
+
_$entries(object) {
|
|
227
225
|
const entries = Object.entries(object);
|
|
228
226
|
for (let idx = 0; idx < entries.length; ++idx) {
|
|
229
227
|
const values = entries[idx];
|
|
230
228
|
const value = values[1];
|
|
231
229
|
if (value && typeof value === "object") {
|
|
232
|
-
values[1] = this.entries(value);
|
|
230
|
+
values[1] = this._$entries(value);
|
|
233
231
|
}
|
|
234
232
|
}
|
|
235
233
|
return entries;
|
|
236
234
|
}
|
|
237
235
|
/**
|
|
238
|
-
* @return {
|
|
236
|
+
* @return {void}
|
|
239
237
|
* @method
|
|
240
238
|
* @public
|
|
241
239
|
*/
|
|
242
240
|
start() {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
this.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (this._$delay) {
|
|
251
|
-
$setTimeout(() => {
|
|
252
|
-
this.initialize();
|
|
253
|
-
}, this._$delay * 1000);
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
this.initialize();
|
|
257
|
-
});
|
|
241
|
+
if (this._$delay) {
|
|
242
|
+
$setTimeout(() => {
|
|
243
|
+
this.initialize();
|
|
244
|
+
}, this._$delay * 1000);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.initialize();
|
|
258
248
|
}
|
|
259
249
|
/**
|
|
260
250
|
* @return {void}
|
|
@@ -264,9 +254,7 @@ export class Job extends EventDispatcher {
|
|
|
264
254
|
stop() {
|
|
265
255
|
if (this.hasEventListener(Event.STOP)) {
|
|
266
256
|
this.dispatchEvent(new Event(Event.STOP));
|
|
267
|
-
|
|
268
|
-
if (this.hasEventListener(Event.ENTER_FRAME)) {
|
|
269
|
-
this.removeAllEventListener(Event.ENTER_FRAME);
|
|
257
|
+
this.removeAllEventListener(Event.STOP);
|
|
270
258
|
}
|
|
271
259
|
if (this.hasEventListener(Event.UPDATE)) {
|
|
272
260
|
this.removeAllEventListener(Event.UPDATE);
|
|
@@ -278,28 +266,33 @@ export class Job extends EventDispatcher {
|
|
|
278
266
|
this._$stopFlag = true;
|
|
279
267
|
}
|
|
280
268
|
/**
|
|
281
|
-
* @param {Event} event
|
|
282
269
|
* @return {void}
|
|
283
270
|
* @method
|
|
284
271
|
* @private
|
|
285
272
|
*/
|
|
286
|
-
_$update(
|
|
273
|
+
_$update() {
|
|
287
274
|
if (this._$stopFlag) {
|
|
288
275
|
return;
|
|
289
276
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
this._$updateProperty(this._$target, this._$from, this._$to, this._$names);
|
|
277
|
+
if (!this._$names) {
|
|
278
|
+
return this.stop();
|
|
293
279
|
}
|
|
280
|
+
// update current time
|
|
281
|
+
this._$currentTime = ($performance.now() - this._$startTime) * 0.001;
|
|
282
|
+
this._$updateProperty(this._$target, this._$from, this._$to, this._$names);
|
|
294
283
|
if (this.hasEventListener(Event.UPDATE)) {
|
|
295
284
|
this.dispatchEvent(new Event(Event.UPDATE));
|
|
296
285
|
}
|
|
297
286
|
if (this._$currentTime >= this._$duration) {
|
|
298
|
-
this.removeEventListener(Event.ENTER_FRAME, event.listener);
|
|
299
287
|
if (this.hasEventListener(Event.COMPLETE)) {
|
|
300
288
|
this.dispatchEvent(new Event(Event.COMPLETE));
|
|
301
289
|
}
|
|
302
290
|
}
|
|
291
|
+
else {
|
|
292
|
+
requestAnimationFrame(() => {
|
|
293
|
+
this._$update();
|
|
294
|
+
});
|
|
295
|
+
}
|
|
303
296
|
}
|
|
304
297
|
/**
|
|
305
298
|
* @param {object} target
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next2d/ui",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.8",
|
|
4
4
|
"description": "Next2D UI Packages",
|
|
5
5
|
"author": "Toshiyuki Ienaga<ienaga@tvon.jp> (https://github.com/ienaga/)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "git+https://github.com/Next2D/Player.git"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@next2d/events": "1.18.
|
|
36
|
-
"@next2d/share": "1.18.
|
|
35
|
+
"@next2d/events": "1.18.8",
|
|
36
|
+
"@next2d/share": "1.18.8"
|
|
37
37
|
}
|
|
38
38
|
}
|