@next2d/ui 1.18.11 → 2.0.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.
Files changed (91) hide show
  1. package/package.json +10 -19
  2. package/src/Easing/service/EasingInBackService.d.ts +12 -0
  3. package/src/Easing/service/EasingInBackService.js +14 -0
  4. package/src/Easing/service/EasingInBounceService.d.ts +12 -0
  5. package/src/Easing/service/EasingInBounceService.js +15 -0
  6. package/src/Easing/service/EasingInCircService.d.ts +12 -0
  7. package/src/Easing/service/EasingInCircService.js +14 -0
  8. package/src/Easing/service/EasingInCubicService.d.ts +12 -0
  9. package/src/Easing/service/EasingInCubicService.js +14 -0
  10. package/src/Easing/service/EasingInElasticService.d.ts +12 -0
  11. package/src/Easing/service/EasingInElasticService.js +20 -0
  12. package/src/Easing/service/EasingInExpoService.d.ts +12 -0
  13. package/src/Easing/service/EasingInExpoService.js +14 -0
  14. package/src/Easing/service/EasingInOutBackService.d.ts +12 -0
  15. package/src/Easing/service/EasingInOutBackService.js +17 -0
  16. package/src/Easing/service/EasingInOutBounceService.d.ts +12 -0
  17. package/src/Easing/service/EasingInOutBounceService.js +17 -0
  18. package/src/Easing/service/EasingInOutCircService.d.ts +12 -0
  19. package/src/Easing/service/EasingInOutCircService.js +16 -0
  20. package/src/Easing/service/EasingInOutCubicService.d.ts +12 -0
  21. package/src/Easing/service/EasingInOutCubicService.js +16 -0
  22. package/src/Easing/service/EasingInOutElasticService.d.ts +12 -0
  23. package/src/Easing/service/EasingInOutElasticService.js +20 -0
  24. package/src/Easing/service/EasingInOutExpoService.d.ts +12 -0
  25. package/src/Easing/service/EasingInOutExpoService.js +16 -0
  26. package/src/Easing/service/EasingInOutQuadService.d.ts +12 -0
  27. package/src/Easing/service/EasingInOutQuadService.js +16 -0
  28. package/src/Easing/service/EasingInOutQuartService.d.ts +12 -0
  29. package/src/Easing/service/EasingInOutQuartService.js +16 -0
  30. package/src/Easing/service/EasingInOutQuintService.d.ts +12 -0
  31. package/src/Easing/service/EasingInOutQuintService.js +16 -0
  32. package/src/Easing/service/EasingInOutSineService.d.ts +12 -0
  33. package/src/Easing/service/EasingInOutSineService.js +14 -0
  34. package/src/Easing/service/EasingInQuadService.d.ts +12 -0
  35. package/src/Easing/service/EasingInQuadService.js +14 -0
  36. package/src/Easing/service/EasingInQuartService.d.ts +12 -0
  37. package/src/Easing/service/EasingInQuartService.js +14 -0
  38. package/src/Easing/service/EasingInQuintService.d.ts +12 -0
  39. package/src/Easing/service/EasingInQuintService.js +14 -0
  40. package/src/Easing/service/EasingInSineService.d.ts +12 -0
  41. package/src/Easing/service/EasingInSineService.js +14 -0
  42. package/src/Easing/service/EasingLinearService.d.ts +12 -0
  43. package/src/Easing/service/EasingLinearService.js +14 -0
  44. package/src/Easing/service/EasingOutBackService.d.ts +12 -0
  45. package/src/Easing/service/EasingOutBackService.js +16 -0
  46. package/src/Easing/service/EasingOutBounceService.d.ts +12 -0
  47. package/src/Easing/service/EasingOutBounceService.js +23 -0
  48. package/src/Easing/service/EasingOutCircService.d.ts +12 -0
  49. package/src/Easing/service/EasingOutCircService.js +15 -0
  50. package/src/Easing/service/EasingOutCubicService.d.ts +12 -0
  51. package/src/Easing/service/EasingOutCubicService.js +15 -0
  52. package/src/Easing/service/EasingOutElasticService.d.ts +12 -0
  53. package/src/Easing/service/EasingOutElasticService.js +20 -0
  54. package/src/Easing/service/EasingOutExpoService.d.ts +12 -0
  55. package/src/Easing/service/EasingOutExpoService.js +14 -0
  56. package/src/Easing/service/EasingOutQuadService.d.ts +12 -0
  57. package/src/Easing/service/EasingOutQuadService.js +14 -0
  58. package/src/Easing/service/EasingOutQuartService.d.ts +12 -0
  59. package/src/Easing/service/EasingOutQuartService.js +15 -0
  60. package/src/Easing/service/EasingOutQuintService.d.ts +12 -0
  61. package/src/Easing/service/EasingOutQuintService.js +15 -0
  62. package/src/Easing/service/EasingOutSineService.d.ts +12 -0
  63. package/src/Easing/service/EasingOutSineService.js +14 -0
  64. package/{dist → src}/Easing.d.ts +2 -42
  65. package/{dist → src}/Easing.js +64 -133
  66. package/src/Job/service/JobEntriesService.d.ts +12 -0
  67. package/src/Job/service/JobEntriesService.js +19 -0
  68. package/src/Job/service/JobStopService.d.ts +11 -0
  69. package/src/Job/service/JobStopService.js +18 -0
  70. package/src/Job/service/JobUpdateFrameService.d.ts +12 -0
  71. package/src/Job/service/JobUpdateFrameService.js +40 -0
  72. package/src/Job/service/JobUpdatePropertyService.d.ts +17 -0
  73. package/src/Job/service/JobUpdatePropertyService.js +38 -0
  74. package/src/Job/usecase/JobBootUseCase.d.ts +11 -0
  75. package/src/Job/usecase/JobBootUseCase.js +25 -0
  76. package/src/Job/usecase/JobStartUseCase.d.ts +11 -0
  77. package/src/Job/usecase/JobStartUseCase.js +25 -0
  78. package/src/Job.d.ts +157 -0
  79. package/src/Job.js +240 -0
  80. package/src/Tween.d.ts +23 -0
  81. package/src/Tween.js +24 -0
  82. package/src/interface/IEntriesObject.d.ts +4 -0
  83. package/src/interface/IEntriesObject.js +1 -0
  84. package/src/interface/IObject.d.ts +3 -0
  85. package/src/interface/IObject.js +1 -0
  86. package/dist/Job.d.ts +0 -164
  87. package/dist/Job.js +0 -362
  88. package/dist/Tween.d.ts +0 -62
  89. package/dist/Tween.js +0 -72
  90. package/{dist → src}/index.d.ts +1 -1
  91. package/{dist → src}/index.js +1 -1
@@ -1,60 +1,42 @@
1
- import { $Math } from "@next2d/share";
1
+ import { execute as easingLinearService } from "./Easing/service/EasingLinearService";
2
+ import { execute as easingInQuadService } from "./Easing/service/EasingInQuadService";
3
+ import { execute as easingOutQuadService } from "./Easing/service/EasingOutQuadService";
4
+ import { execute as easingInOutQuadService } from "./Easing/service/EasingInOutQuadService";
5
+ import { execute as easingInCubicService } from "./Easing/service/EasingInCubicService";
6
+ import { execute as easingOutCubicService } from "./Easing/service/EasingOutCubicService";
7
+ import { execute as easingInOutCubicService } from "./Easing/service/EasingInOutCubicService";
8
+ import { execute as easingInQuartService } from "./Easing/service/EasingInQuartService";
9
+ import { execute as easingOutQuartService } from "./Easing/service/EasingOutQuartService";
10
+ import { execute as easingInOutQuartService } from "./Easing/service/EasingInOutQuartService";
11
+ import { execute as easingInQuintService } from "./Easing/service/EasingInQuintService";
12
+ import { execute as easingOutQuintService } from "./Easing/service/EasingOutQuintService";
13
+ import { execute as easingInOutQuintService } from "./Easing/service/EasingInOutQuintService";
14
+ import { execute as easingInSineService } from "./Easing/service/EasingInSineService";
15
+ import { execute as easingOutSineService } from "./Easing/service/EasingOutSineService";
16
+ import { execute as easingInOutSineService } from "./Easing/service/EasingInOutSineService";
17
+ import { execute as easingInExpoService } from "./Easing/service/EasingInExpoService";
18
+ import { execute as easingOutExpoService } from "./Easing/service/EasingOutExpoService";
19
+ import { execute as easingInOutExpoService } from "./Easing/service/EasingInOutExpoService";
20
+ import { execute as easingInCircService } from "./Easing/service/EasingInCircService";
21
+ import { execute as easingOutCircService } from "./Easing/service/EasingOutCircService";
22
+ import { execute as easingInOutCircService } from "./Easing/service/EasingInOutCircService";
23
+ import { execute as easingInBackService } from "./Easing/service/EasingInBackService";
24
+ import { execute as easingOutBackService } from "./Easing/service/EasingOutBackService";
25
+ import { execute as easingInOutBackService } from "./Easing/service/EasingInOutBackService";
26
+ import { execute as easingInElasticService } from "./Easing/service/EasingInElasticService";
27
+ import { execute as easingOutElasticService } from "./Easing/service/EasingOutElasticService";
28
+ import { execute as easingInOutElasticService } from "./Easing/service/EasingInOutElasticService";
29
+ import { execute as easingOutBounceService } from "./Easing/service/EasingOutBounceService";
30
+ import { execute as easingInBounceService } from "./Easing/service/EasingInBounceService";
31
+ import { execute as easingInOutBounceService } from "./Easing/service/EasingInOutBounceService";
2
32
  /**
3
- * Easeクラスは、イージング機能の関数を提供します。
4
- * The Ease class provides a collection of easing functions
33
+ * @description Easeクラスは、イージング機能の関数を提供します。
34
+ * The Ease class provides a collection of easing functions
5
35
  *
6
36
  * @class
7
37
  * @memberOf next2d.ui
8
38
  */
9
39
  export class Easing {
10
- /**
11
- * @description 指定されたクラスのストリングを返します。
12
- * Returns the string representation of the specified class.
13
- *
14
- * @return {string}
15
- * @default [class Easing]
16
- * @method
17
- * @static
18
- */
19
- static toString() {
20
- return "[class Easing]";
21
- }
22
- /**
23
- * @description 指定されたクラスの空間名を返します。
24
- * Returns the space name of the specified class.
25
- *
26
- * @return {string}
27
- * @default next2d.ui.Easing
28
- * @const
29
- * @static
30
- */
31
- static get namespace() {
32
- return "next2d.ui.Easing";
33
- }
34
- /**
35
- * @description 指定されたオブジェクトのストリングを返します。
36
- * Returns the string representation of the specified object.
37
- *
38
- * @return {string}
39
- * @default [object Easing]
40
- * @method
41
- * @public
42
- */
43
- toString() {
44
- return "[object Easing]";
45
- }
46
- /**
47
- * @description 指定されたオブジェクトの空間名を返します。
48
- * Returns the space name of the specified object.
49
- *
50
- * @return {string}
51
- * @default next2d.ui.Easing
52
- * @const
53
- * @public
54
- */
55
- get namespace() {
56
- return "next2d.ui.Easing";
57
- }
58
40
  /**
59
41
  * @param {number} t
60
42
  * @param {number} b
@@ -65,7 +47,7 @@ export class Easing {
65
47
  * @static
66
48
  */
67
49
  static linear(t, b, c, d) {
68
- return t / d * c + b;
50
+ return easingLinearService(t, b, c, d);
69
51
  }
70
52
  /**
71
53
  * @param {number} t
@@ -77,7 +59,7 @@ export class Easing {
77
59
  * @static
78
60
  */
79
61
  static inQuad(t, b, c, d) {
80
- return (t /= d) * t * c + b;
62
+ return easingInQuadService(t, b, c, d);
81
63
  }
82
64
  /**
83
65
  * @param {number} t
@@ -89,7 +71,7 @@ export class Easing {
89
71
  * @static
90
72
  */
91
73
  static outQuad(t, b, c, d) {
92
- return -(t /= d) * (t - 2) * c + b;
74
+ return easingOutQuadService(t, b, c, d);
93
75
  }
94
76
  /**
95
77
  * @param {number} t
@@ -101,9 +83,7 @@ export class Easing {
101
83
  * @static
102
84
  */
103
85
  static inOutQuad(t, b, c, d) {
104
- return (t /= d / 2) < 1
105
- ? t * t * c / 2 + b
106
- : -((t -= 1) * (t - 2) - 1) * c / 2 + b;
86
+ return easingInOutQuadService(t, b, c, d);
107
87
  }
108
88
  /**
109
89
  * @param {number} t
@@ -115,7 +95,7 @@ export class Easing {
115
95
  * @static
116
96
  */
117
97
  static inCubic(t, b, c, d) {
118
- return (t /= d) * t * t * c + b;
98
+ return easingInCubicService(t, b, c, d);
119
99
  }
120
100
  /**
121
101
  * @param {number} t
@@ -127,8 +107,7 @@ export class Easing {
127
107
  * @static
128
108
  */
129
109
  static outCubic(t, b, c, d) {
130
- t /= d;
131
- return (--t * t * t + 1) * c + b;
110
+ return easingOutCubicService(t, b, c, d);
132
111
  }
133
112
  /**
134
113
  * @param {number} t
@@ -140,9 +119,7 @@ export class Easing {
140
119
  * @static
141
120
  */
142
121
  static inOutCubic(t, b, c, d) {
143
- return (t /= d / 2) < 1
144
- ? t * t * t * c / 2 + b
145
- : ((t -= 2) * t * t + 2) * c / 2 + b;
122
+ return easingInOutCubicService(t, b, c, d);
146
123
  }
147
124
  /**
148
125
  * @param {number} t
@@ -154,7 +131,7 @@ export class Easing {
154
131
  * @static
155
132
  */
156
133
  static inQuart(t, b, c, d) {
157
- return (t /= d) * t * t * t * c + b;
134
+ return easingInQuartService(t, b, c, d);
158
135
  }
159
136
  /**
160
137
  * @param {number} t
@@ -166,8 +143,7 @@ export class Easing {
166
143
  * @static
167
144
  */
168
145
  static outQuart(t, b, c, d) {
169
- t /= d;
170
- return (--t * t * t * t - 1) * -c + b;
146
+ return easingOutQuartService(t, b, c, d);
171
147
  }
172
148
  /**
173
149
  * @param {number} t
@@ -179,9 +155,7 @@ export class Easing {
179
155
  * @static
180
156
  */
181
157
  static inOutQuart(t, b, c, d) {
182
- return (t /= d / 2) < 1
183
- ? t * t * t * t * c / 2 + b
184
- : ((t -= 2) * t * t * t - 2) * -c / 2 + b;
158
+ return easingInOutQuartService(t, b, c, d);
185
159
  }
186
160
  /**
187
161
  * @param {number} t
@@ -193,7 +167,7 @@ export class Easing {
193
167
  * @static
194
168
  */
195
169
  static inQuint(t, b, c, d) {
196
- return (t /= d) * t * t * t * t * c + b;
170
+ return easingInQuintService(t, b, c, d);
197
171
  }
198
172
  /**
199
173
  * @param {number} t
@@ -205,8 +179,7 @@ export class Easing {
205
179
  * @static
206
180
  */
207
181
  static outQuint(t, b, c, d) {
208
- t /= d;
209
- return (--t * t * t * t * t + 1) * c + b;
182
+ return easingOutQuintService(t, b, c, d);
210
183
  }
211
184
  /**
212
185
  * @param {number} t
@@ -218,9 +191,7 @@ export class Easing {
218
191
  * @static
219
192
  */
220
193
  static inOutQuint(t, b, c, d) {
221
- return (t /= d / 2) < 1
222
- ? t * t * t * t * t * c / 2 + b
223
- : ((t -= 2) * t * t * t * t + 2) * c / 2 + b;
194
+ return easingInOutQuintService(t, b, c, d);
224
195
  }
225
196
  /**
226
197
  * @param {number} t
@@ -232,7 +203,7 @@ export class Easing {
232
203
  * @static
233
204
  */
234
205
  static inSine(t, b, c, d) {
235
- return -c * $Math.cos(t / d * ($Math.PI / 2)) + c + b;
206
+ return easingInSineService(t, b, c, d);
236
207
  }
237
208
  /**
238
209
  * @param {number} t
@@ -244,7 +215,7 @@ export class Easing {
244
215
  * @static
245
216
  */
246
217
  static outSine(t, b, c, d) {
247
- return c * $Math.sin(t / d * ($Math.PI / 2)) + b;
218
+ return easingOutSineService(t, b, c, d);
248
219
  }
249
220
  /**
250
221
  * @param {number} t
@@ -256,7 +227,7 @@ export class Easing {
256
227
  * @static
257
228
  */
258
229
  static inOutSine(t, b, c, d) {
259
- return -c / 2 * ($Math.cos($Math.PI * t / d) - 1) + b;
230
+ return easingInOutSineService(t, b, c, d);
260
231
  }
261
232
  /**
262
233
  * @param {number} t
@@ -268,7 +239,7 @@ export class Easing {
268
239
  * @static
269
240
  */
270
241
  static inExpo(t, b, c, d) {
271
- return c * $Math.pow(2, 10 * (t / d - 1)) + b;
242
+ return easingInExpoService(t, b, c, d);
272
243
  }
273
244
  /**
274
245
  * @param {number} t
@@ -280,7 +251,7 @@ export class Easing {
280
251
  * @static
281
252
  */
282
253
  static outExpo(t, b, c, d) {
283
- return c * (-$Math.pow(2, -10 * t / d) + 1) + b;
254
+ return easingOutExpoService(t, b, c, d);
284
255
  }
285
256
  /**
286
257
  * @param {number} t
@@ -292,9 +263,7 @@ export class Easing {
292
263
  * @static
293
264
  */
294
265
  static inOutExpo(t, b, c, d) {
295
- return (t /= d / 2) < 1
296
- ? c / 2 * $Math.pow(2, 10 * (t - 1)) + b
297
- : c / 2 * (-$Math.pow(2, -10 * (t - 1)) + 2) + b;
266
+ return easingInOutExpoService(t, b, c, d);
298
267
  }
299
268
  /**
300
269
  * @param {number} t
@@ -306,7 +275,7 @@ export class Easing {
306
275
  * @static
307
276
  */
308
277
  static inCirc(t, b, c, d) {
309
- return (1 - $Math.sqrt(1 - (t /= d) * t)) * c + b;
278
+ return easingInCircService(t, b, c, d);
310
279
  }
311
280
  /**
312
281
  * @param {number} t
@@ -318,8 +287,7 @@ export class Easing {
318
287
  * @static
319
288
  */
320
289
  static outCirc(t, b, c, d) {
321
- t /= d;
322
- return $Math.sqrt(1 - --t * t) * c + b;
290
+ return easingOutCircService(t, b, c, d);
323
291
  }
324
292
  /**
325
293
  * @param {number} t
@@ -331,9 +299,7 @@ export class Easing {
331
299
  * @static
332
300
  */
333
301
  static inOutCirc(t, b, c, d) {
334
- return (t /= d * 2) < 1
335
- ? ($Math.sqrt(1 - t * t) - 1) / -2 * c + b
336
- : ($Math.sqrt(1 - (t -= 2) * t) + 1) / 2 * c + b;
302
+ return easingInOutCircService(t, b, c, d);
337
303
  }
338
304
  /**
339
305
  * @param {number} t
@@ -345,7 +311,7 @@ export class Easing {
345
311
  * @static
346
312
  */
347
313
  static inBack(t, b, c, d) {
348
- return (2.70158 * (t /= d) * t * t - 1.70158 * t * t) * c + b;
314
+ return easingInBackService(t, b, c, d);
349
315
  }
350
316
  /**
351
317
  * @param {number} t
@@ -357,9 +323,7 @@ export class Easing {
357
323
  * @static
358
324
  */
359
325
  static outBack(t, b, c, d) {
360
- return (1 + 2.70158
361
- * $Math.pow((t /= d) - 1, 3) + 1.70158
362
- * $Math.pow(t - 1, 2)) * c + b;
326
+ return easingOutBackService(t, b, c, d);
363
327
  }
364
328
  /**
365
329
  * @param {number} t
@@ -371,11 +335,7 @@ export class Easing {
371
335
  * @static
372
336
  */
373
337
  static inOutBack(t, b, c, d) {
374
- let s = 1.70158;
375
- if ((t /= d / 2) < 1) {
376
- return t * t * (((s *= 1.525) + 1) * t - s) * c / 2 + b;
377
- }
378
- return ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) * c / 2 + b;
338
+ return easingInOutBackService(t, b, c, d);
379
339
  }
380
340
  /**
381
341
  * @param {number} t
@@ -387,13 +347,7 @@ export class Easing {
387
347
  * @static
388
348
  */
389
349
  static inElastic(t, b, c, d) {
390
- return (t /= d) === 0
391
- ? b
392
- : t === 1
393
- ? c + b
394
- : -$Math.pow(2, (t *= 10) - 10)
395
- * $Math.sin((t - 10.75) * (2 * $Math.PI / 3))
396
- * c + b;
350
+ return easingInElasticService(t, b, c, d);
397
351
  }
398
352
  /**
399
353
  * @param {number} t
@@ -405,13 +359,7 @@ export class Easing {
405
359
  * @static
406
360
  */
407
361
  static outElastic(t, b, c, d) {
408
- return (t /= d) === 0
409
- ? b
410
- : t === 1
411
- ? c + b
412
- : ($Math.pow(2, -10 * t)
413
- * $Math.sin((t * 10 - 0.75) * (2 * $Math.PI / 3)) + 1)
414
- * c + b;
362
+ return easingOutElasticService(t, b, c, d);
415
363
  }
416
364
  /**
417
365
  * @param {number} t
@@ -423,13 +371,7 @@ export class Easing {
423
371
  * @static
424
372
  */
425
373
  static inOutElastic(t, b, c, d) {
426
- return (t /= d) === 0
427
- ? b
428
- : t === 1
429
- ? c + b
430
- : t < 0.5
431
- ? -($Math.pow(2, 20 * t - 10) * $Math.sin((20 * t - 11.125) * (2 * $Math.PI / 4.5))) / 2 * c + b
432
- : ($Math.pow(2, -20 * t + 10) * $Math.sin((20 * t - 11.125) * (2 * $Math.PI / 4.5)) / 2 + 1) * c + b;
374
+ return easingInOutElasticService(t, b, c, d);
433
375
  }
434
376
  /**
435
377
  * @param {number} t
@@ -441,16 +383,7 @@ export class Easing {
441
383
  * @static
442
384
  */
443
385
  static outBounce(t, b, c, d) {
444
- if ((t /= d) < 1 / 2.75) {
445
- return 7.5625 * t * t * c + b;
446
- }
447
- if (t < 2 / 2.75) {
448
- return (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) * c + b;
449
- }
450
- if (t < 2.5 / 2.75) {
451
- return (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) * c + b;
452
- }
453
- return (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) * c + b;
386
+ return easingOutBounceService(t, b, c, d);
454
387
  }
455
388
  /**
456
389
  * @param {number} t
@@ -462,7 +395,7 @@ export class Easing {
462
395
  * @static
463
396
  */
464
397
  static inBounce(t, b, c, d) {
465
- return c - Easing.outBounce(d - t, 0, c, d) + b;
398
+ return easingInBounceService(t, b, c, d);
466
399
  }
467
400
  /**
468
401
  * @param {number} t
@@ -474,8 +407,6 @@ export class Easing {
474
407
  * @static
475
408
  */
476
409
  static inOutBounce(t, b, c, d) {
477
- return t < d / 2
478
- ? Easing.inBounce(t * 2, b, c / 2, d)
479
- : Easing.outBounce(t * 2 - d, b + c / 2, c / 2, d);
410
+ return easingInOutBounceService(t, b, c, d);
480
411
  }
481
412
  }
@@ -0,0 +1,12 @@
1
+ import type { IEntriesObject } from "../../interface/IEntriesObject";
2
+ import type { IObject } from "../../interface/IObject";
3
+ /**
4
+ * @description Tweenの開始/終了のオブジェクトを配列に変換
5
+ * Convert tween start/end objects to arrays
6
+ *
7
+ * @param {object} object
8
+ * @return {array}
9
+ * @method
10
+ * @private
11
+ */
12
+ export declare const execute: (object: IObject) => IEntriesObject[];
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @description Tweenの開始/終了のオブジェクトを配列に変換
3
+ * Convert tween start/end objects to arrays
4
+ *
5
+ * @param {object} object
6
+ * @return {array}
7
+ * @method
8
+ * @private
9
+ */
10
+ export const execute = (object) => {
11
+ const entries = [];
12
+ for (const [name, value] of Object.entries(object)) {
13
+ entries.push({
14
+ "name": name,
15
+ "value": typeof value === "number" ? value : execute(value)
16
+ });
17
+ }
18
+ return entries;
19
+ };
@@ -0,0 +1,11 @@
1
+ import type { Job } from "../../Job";
2
+ /**
3
+ * @description ジョブの停止処理関数
4
+ * Stop process function
5
+ *
6
+ * @param {Job} job
7
+ * @return {void}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export declare const execute: (job: Job) => void;
@@ -0,0 +1,18 @@
1
+ import { JobEvent } from "@next2d/events";
2
+ /**
3
+ * @description ジョブの停止処理関数
4
+ * Stop process function
5
+ *
6
+ * @param {Job} job
7
+ * @return {void}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export const execute = (job) => {
12
+ cancelAnimationFrame(job.$timerId);
13
+ if (job.hasEventListener(JobEvent.STOP)) {
14
+ job.dispatchEvent(new JobEvent(JobEvent.STOP));
15
+ }
16
+ job.entries = null;
17
+ job.stopFlag = true;
18
+ };
@@ -0,0 +1,12 @@
1
+ import type { Job } from "../../Job";
2
+ /**
3
+ * @description 繰り返しのアップデート処理関数
4
+ * Update process function
5
+ *
6
+ * @param {Job} job
7
+ * @param {number} timestamp
8
+ * @return {array}
9
+ * @method
10
+ * @private
11
+ */
12
+ export declare const execute: (job: Job, timestamp: number) => number;
@@ -0,0 +1,40 @@
1
+ import { execute as jobUpdatePropertyService } from "./JobUpdatePropertyService";
2
+ import { JobEvent } from "@next2d/events";
3
+ /**
4
+ * @description 繰り返しのアップデート処理関数
5
+ * Update process function
6
+ *
7
+ * @param {Job} job
8
+ * @param {number} timestamp
9
+ * @return {array}
10
+ * @method
11
+ * @private
12
+ */
13
+ export const execute = (job, timestamp) => {
14
+ if (job.stopFlag || !job.entries) {
15
+ return -1;
16
+ }
17
+ // update current time
18
+ job.currentTime = (timestamp - job.startTime) / 1000;
19
+ // update property
20
+ jobUpdatePropertyService(job, job.target, job.from, job.to, job.entries);
21
+ // update event
22
+ if (job.hasEventListener(JobEvent.UPDATE)) {
23
+ job.dispatchEvent(new JobEvent(JobEvent.UPDATE));
24
+ }
25
+ // complete logic
26
+ if (job.currentTime >= job.duration) {
27
+ // complete event
28
+ if (job.hasEventListener(JobEvent.COMPLETE)) {
29
+ job.dispatchEvent(new JobEvent(JobEvent.COMPLETE));
30
+ }
31
+ // next job
32
+ if (job.nextJob) {
33
+ job.nextJob.start();
34
+ }
35
+ return -1;
36
+ }
37
+ return requestAnimationFrame((timestamp) => {
38
+ execute(job, timestamp);
39
+ });
40
+ };
@@ -0,0 +1,17 @@
1
+ import type { IEntriesObject } from "../../interface/IEntriesObject";
2
+ import type { IObject } from "../../interface/IObject";
3
+ import type { Job } from "../../Job";
4
+ /**
5
+ * @description fromのオブジェクトのプロパティを元に、targetのプロパティの値を更新
6
+ * Update the value of the target property based on the properties of the from object
7
+ *
8
+ * @param {Job} job
9
+ * @param {object} target
10
+ * @param {object} from
11
+ * @param {object} to
12
+ * @param {array} entries
13
+ * @return {void}
14
+ * @method
15
+ * @private
16
+ */
17
+ export declare const execute: (job: Job, target: any, from: IObject, to: IObject, entries: IEntriesObject[]) => void;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @description fromのオブジェクトのプロパティを元に、targetのプロパティの値を更新
3
+ * Update the value of the target property based on the properties of the from object
4
+ *
5
+ * @param {Job} job
6
+ * @param {object} target
7
+ * @param {object} from
8
+ * @param {object} to
9
+ * @param {array} entries
10
+ * @return {void}
11
+ * @method
12
+ * @private
13
+ */
14
+ export const execute = (job, target, from, to, entries) => {
15
+ for (let idx = 0; idx < entries.length; ++idx) {
16
+ const entry = entries[idx];
17
+ if (!entry) {
18
+ continue;
19
+ }
20
+ const name = entry.name;
21
+ if (!(name in target) || !(name in to)) {
22
+ continue;
23
+ }
24
+ if (typeof entry.value !== "number") {
25
+ execute(job, target[name], from[name], to[name], entry.value);
26
+ continue;
27
+ }
28
+ // update
29
+ const fromValue = from[name];
30
+ if (job.duration > job.currentTime) {
31
+ target[name] = job.ease(job.currentTime, fromValue, to[name] - fromValue, job.duration);
32
+ }
33
+ else {
34
+ // Easing end
35
+ target[name] = to[name];
36
+ }
37
+ }
38
+ };
@@ -0,0 +1,11 @@
1
+ import type { Job } from "../../Job";
2
+ /**
3
+ * @description ジョブの実行処理関数
4
+ * Execution process function
5
+ *
6
+ * @param {Job} job
7
+ * @return {void}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export declare const execute: (job: Job) => void;
@@ -0,0 +1,25 @@
1
+ import { execute as jobEntriesService } from "../service/JobEntriesService";
2
+ import { execute as jobUpdateFrameService } from "../service/JobUpdateFrameService";
3
+ /**
4
+ * @description ジョブの実行処理関数
5
+ * Execution process function
6
+ *
7
+ * @param {Job} job
8
+ * @return {void}
9
+ * @method
10
+ * @protected
11
+ */
12
+ export const execute = (job) => {
13
+ if (job.stopFlag) {
14
+ return;
15
+ }
16
+ // create entries
17
+ job.entries = jobEntriesService(job.from);
18
+ if (!job.entries) {
19
+ return;
20
+ }
21
+ // setup
22
+ job.startTime = performance.now();
23
+ // start
24
+ job.$timerId = jobUpdateFrameService(job, job.startTime);
25
+ };
@@ -0,0 +1,11 @@
1
+ import type { Job } from "../../Job";
2
+ /**
3
+ * @description ジョブの開始処理関数
4
+ * Start process function
5
+ *
6
+ * @param {Job} job
7
+ * @return {void}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export declare const execute: (job: Job) => void;
@@ -0,0 +1,25 @@
1
+ import { execute as jobBootUseCase } from "./JobBootUseCase";
2
+ /**
3
+ * @description ジョブの開始処理関数
4
+ * Start process function
5
+ *
6
+ * @param {Job} job
7
+ * @return {void}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export const execute = (job) => {
12
+ // stop job
13
+ cancelAnimationFrame(job.$timerId);
14
+ // reset
15
+ job.stopFlag = false;
16
+ // delayed start
17
+ if (job.delay) {
18
+ setTimeout(() => {
19
+ jobBootUseCase(job);
20
+ }, job.delay * 1000);
21
+ }
22
+ else {
23
+ jobBootUseCase(job);
24
+ }
25
+ };