animejs 4.4.0 → 4.5.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.
- package/README.md +4 -5
- package/dist/bundles/anime.esm.js +491 -272
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +491 -272
- package/dist/bundles/anime.umd.min.js +2 -2
- package/dist/modules/adapters/index.cjs +14 -0
- package/dist/modules/adapters/index.d.ts +1 -0
- package/dist/modules/adapters/index.js +8 -0
- package/dist/modules/adapters/registry.cjs +149 -0
- package/dist/modules/adapters/registry.d.ts +65 -0
- package/dist/modules/adapters/registry.js +146 -0
- package/dist/modules/adapters/three/adapter.cjs +26 -0
- package/dist/modules/adapters/three/adapter.d.ts +15 -0
- package/dist/modules/adapters/three/adapter.js +24 -0
- package/dist/modules/adapters/three/helpers.cjs +297 -0
- package/dist/modules/adapters/three/helpers.d.ts +89 -0
- package/dist/modules/adapters/three/helpers.js +280 -0
- package/dist/modules/adapters/three/index.cjs +20 -0
- package/dist/modules/adapters/three/index.d.ts +2 -0
- package/dist/modules/adapters/three/index.js +12 -0
- package/dist/modules/adapters/three/instance.cjs +368 -0
- package/dist/modules/adapters/three/instance.d.ts +133 -0
- package/dist/modules/adapters/three/instance.js +365 -0
- package/dist/modules/adapters/three/object3d.cjs +214 -0
- package/dist/modules/adapters/three/object3d.d.ts +1 -0
- package/dist/modules/adapters/three/object3d.js +212 -0
- package/dist/modules/adapters/three/resolvers.cjs +105 -0
- package/dist/modules/adapters/three/resolvers.d.ts +1 -0
- package/dist/modules/adapters/three/resolvers.js +103 -0
- package/dist/modules/adapters/three/uniform.cjs +41 -0
- package/dist/modules/adapters/three/uniform.d.ts +1 -0
- package/dist/modules/adapters/three/uniform.js +39 -0
- package/dist/modules/animatable/animatable.cjs +2 -1
- package/dist/modules/animatable/animatable.d.ts +2 -1
- package/dist/modules/animatable/animatable.js +2 -1
- package/dist/modules/animatable/index.cjs +1 -1
- package/dist/modules/animatable/index.js +1 -1
- package/dist/modules/animation/additive.cjs +1 -1
- package/dist/modules/animation/additive.js +1 -1
- package/dist/modules/animation/animation.cjs +43 -16
- package/dist/modules/animation/animation.d.ts +5 -0
- package/dist/modules/animation/animation.js +45 -18
- package/dist/modules/animation/composition.cjs +38 -35
- package/dist/modules/animation/composition.js +38 -35
- package/dist/modules/animation/index.cjs +1 -1
- package/dist/modules/animation/index.js +1 -1
- package/dist/modules/core/clock.cjs +11 -15
- package/dist/modules/core/clock.d.ts +0 -2
- package/dist/modules/core/clock.js +11 -15
- package/dist/modules/core/colors.cjs +1 -1
- package/dist/modules/core/colors.js +1 -1
- package/dist/modules/core/consts.cjs +15 -1
- package/dist/modules/core/consts.d.ts +2 -0
- package/dist/modules/core/consts.js +14 -2
- package/dist/modules/core/globals.cjs +7 -4
- package/dist/modules/core/globals.d.ts +8 -2
- package/dist/modules/core/globals.js +8 -5
- package/dist/modules/core/helpers.cjs +2 -2
- package/dist/modules/core/helpers.js +3 -3
- package/dist/modules/core/render.cjs +93 -73
- package/dist/modules/core/render.js +96 -76
- package/dist/modules/core/styles.cjs +16 -2
- package/dist/modules/core/styles.js +16 -2
- package/dist/modules/core/targets.cjs +11 -13
- package/dist/modules/core/targets.js +11 -13
- package/dist/modules/core/transforms.cjs +1 -1
- package/dist/modules/core/transforms.js +1 -1
- package/dist/modules/core/units.cjs +1 -1
- package/dist/modules/core/units.js +1 -1
- package/dist/modules/core/values.cjs +73 -82
- package/dist/modules/core/values.d.ts +1 -2
- package/dist/modules/core/values.js +76 -84
- package/dist/modules/draggable/draggable.cjs +1 -1
- package/dist/modules/draggable/draggable.js +1 -1
- package/dist/modules/draggable/index.cjs +1 -1
- package/dist/modules/draggable/index.js +1 -1
- package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
- package/dist/modules/easings/cubic-bezier/index.js +1 -1
- package/dist/modules/easings/eases/index.cjs +1 -1
- package/dist/modules/easings/eases/index.js +1 -1
- package/dist/modules/easings/eases/parser.cjs +3 -3
- package/dist/modules/easings/eases/parser.d.ts +4 -5
- package/dist/modules/easings/eases/parser.js +3 -3
- package/dist/modules/easings/index.cjs +1 -1
- package/dist/modules/easings/index.js +1 -1
- package/dist/modules/easings/irregular/index.cjs +1 -1
- package/dist/modules/easings/irregular/index.js +1 -1
- package/dist/modules/easings/linear/index.cjs +1 -1
- package/dist/modules/easings/linear/index.js +1 -1
- package/dist/modules/easings/none.cjs +1 -1
- package/dist/modules/easings/none.js +1 -1
- package/dist/modules/easings/spring/index.cjs +1 -1
- package/dist/modules/easings/spring/index.js +1 -1
- package/dist/modules/easings/steps/index.cjs +1 -1
- package/dist/modules/easings/steps/index.js +1 -1
- package/dist/modules/engine/engine.cjs +4 -2
- package/dist/modules/engine/engine.js +4 -2
- package/dist/modules/engine/index.cjs +1 -1
- package/dist/modules/engine/index.js +1 -1
- package/dist/modules/events/index.cjs +1 -1
- package/dist/modules/events/index.js +1 -1
- package/dist/modules/events/scroll.cjs +3 -1
- package/dist/modules/events/scroll.js +3 -1
- package/dist/modules/index.cjs +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/layout/index.cjs +1 -1
- package/dist/modules/layout/index.js +1 -1
- package/dist/modules/layout/layout.cjs +1 -1
- package/dist/modules/layout/layout.js +1 -1
- package/dist/modules/scope/index.cjs +1 -1
- package/dist/modules/scope/index.js +1 -1
- package/dist/modules/scope/scope.cjs +1 -1
- package/dist/modules/scope/scope.js +1 -1
- package/dist/modules/svg/drawable.cjs +1 -1
- package/dist/modules/svg/drawable.js +1 -1
- package/dist/modules/svg/helpers.cjs +1 -1
- package/dist/modules/svg/helpers.js +1 -1
- package/dist/modules/svg/index.cjs +1 -1
- package/dist/modules/svg/index.js +1 -1
- package/dist/modules/svg/morphto.cjs +1 -1
- package/dist/modules/svg/morphto.js +1 -1
- package/dist/modules/svg/motionpath.cjs +1 -1
- package/dist/modules/svg/motionpath.js +1 -1
- package/dist/modules/text/index.cjs +1 -1
- package/dist/modules/text/index.js +1 -1
- package/dist/modules/text/scramble.cjs +12 -2
- package/dist/modules/text/scramble.d.ts +9 -1
- package/dist/modules/text/scramble.js +12 -2
- package/dist/modules/text/split.cjs +2 -1
- package/dist/modules/text/split.js +2 -1
- package/dist/modules/timeline/index.cjs +1 -1
- package/dist/modules/timeline/index.js +1 -1
- package/dist/modules/timeline/position.cjs +1 -1
- package/dist/modules/timeline/position.js +1 -1
- package/dist/modules/timeline/timeline.cjs +14 -5
- package/dist/modules/timeline/timeline.d.ts +3 -3
- package/dist/modules/timeline/timeline.js +14 -5
- package/dist/modules/timer/index.cjs +1 -1
- package/dist/modules/timer/index.js +1 -1
- package/dist/modules/timer/timer.cjs +1 -1
- package/dist/modules/timer/timer.js +1 -1
- package/dist/modules/types/index.d.ts +36 -11
- package/dist/modules/utils/chainable.cjs +1 -1
- package/dist/modules/utils/chainable.js +1 -1
- package/dist/modules/utils/index.cjs +1 -1
- package/dist/modules/utils/index.js +1 -1
- package/dist/modules/utils/number.cjs +1 -1
- package/dist/modules/utils/number.js +1 -1
- package/dist/modules/utils/random.cjs +4 -3
- package/dist/modules/utils/random.d.ts +1 -1
- package/dist/modules/utils/random.js +4 -3
- package/dist/modules/utils/stagger.cjs +67 -13
- package/dist/modules/utils/stagger.js +69 -15
- package/dist/modules/utils/target.cjs +4 -1
- package/dist/modules/utils/target.js +4 -1
- package/dist/modules/utils/time.cjs +6 -5
- package/dist/modules/utils/time.d.ts +1 -1
- package/dist/modules/utils/time.js +6 -5
- package/dist/modules/waapi/composition.cjs +1 -1
- package/dist/modules/waapi/composition.js +1 -1
- package/dist/modules/waapi/index.cjs +1 -1
- package/dist/modules/waapi/index.js +1 -1
- package/dist/modules/waapi/waapi.cjs +1 -1
- package/dist/modules/waapi/waapi.js +1 -1
- package/package.json +38 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - easings - CJS
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -81,8 +81,8 @@ const easeInFunctions = {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* @typedef {Object} EasesFunctions
|
|
84
|
-
* @property {
|
|
85
|
-
* @property {
|
|
84
|
+
* @property {EasingFunction} linear
|
|
85
|
+
* @property {EasingFunction} none
|
|
86
86
|
* @property {PowerEasing} in
|
|
87
87
|
* @property {PowerEasing} out
|
|
88
88
|
* @property {PowerEasing} inOut
|
|
@@ -18,8 +18,8 @@ export const easeInPower: PowerEasing;
|
|
|
18
18
|
/** @type {Record<String, EaseType>} */
|
|
19
19
|
export const easeTypes: Record<string, EaseType>;
|
|
20
20
|
export namespace eases {
|
|
21
|
-
export let linear:
|
|
22
|
-
export let none:
|
|
21
|
+
export let linear: EasingFunction;
|
|
22
|
+
export let none: EasingFunction;
|
|
23
23
|
let _in: PowerEasing;
|
|
24
24
|
export { _in as in };
|
|
25
25
|
export let out: PowerEasing;
|
|
@@ -70,8 +70,8 @@ export function parseEaseString(string: string): EasingFunction;
|
|
|
70
70
|
export function parseEase(ease: EasingParam): EasingFunction;
|
|
71
71
|
export type EaseType = (Ease: EasingFunction) => EasingFunction;
|
|
72
72
|
export type EasesFunctions = {
|
|
73
|
-
linear:
|
|
74
|
-
none:
|
|
73
|
+
linear: EasingFunction;
|
|
74
|
+
none: EasingFunction;
|
|
75
75
|
in: PowerEasing;
|
|
76
76
|
out: PowerEasing;
|
|
77
77
|
inOut: PowerEasing;
|
|
@@ -122,4 +122,3 @@ import type { EasingFunction } from '../../types/index.js';
|
|
|
122
122
|
import type { BackEasing } from '../../types/index.js';
|
|
123
123
|
import type { ElasticEasing } from '../../types/index.js';
|
|
124
124
|
import type { EasingParam } from '../../types/index.js';
|
|
125
|
-
import { none as none_1 } from '../none.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - easings - ESM
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -79,8 +79,8 @@ const easeInFunctions = {
|
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* @typedef {Object} EasesFunctions
|
|
82
|
-
* @property {
|
|
83
|
-
* @property {
|
|
82
|
+
* @property {EasingFunction} linear
|
|
83
|
+
* @property {EasingFunction} none
|
|
84
84
|
* @property {PowerEasing} in
|
|
85
85
|
* @property {PowerEasing} out
|
|
86
86
|
* @property {PowerEasing} inOut
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - engine - CJS
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -103,7 +103,9 @@ class Engine extends clock.Clock {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
set speed(playbackRate) {
|
|
106
|
-
|
|
106
|
+
const speed = playbackRate * globals.globals.timeScale;
|
|
107
|
+
if (this._speed === speed) return;
|
|
108
|
+
this._speed = speed;
|
|
107
109
|
helpers.forEachChildren(this, (/** @type {Tickable} */child) => child.speed = child._speed);
|
|
108
110
|
}
|
|
109
111
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - engine - ESM
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -101,7 +101,9 @@ class Engine extends Clock {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
set speed(playbackRate) {
|
|
104
|
-
|
|
104
|
+
const speed = playbackRate * globals.timeScale;
|
|
105
|
+
if (this._speed === speed) return;
|
|
106
|
+
this._speed = speed;
|
|
105
107
|
forEachChildren(this, (/** @type {Tickable} */child) => child.speed = child._speed);
|
|
106
108
|
}
|
|
107
109
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - events - CJS
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -216,12 +216,14 @@ class ScrollContainer {
|
|
|
216
216
|
|
|
217
217
|
refreshScrollObservers() {
|
|
218
218
|
helpers.forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
219
|
+
if (!child.ready) return;
|
|
219
220
|
if (child._debug) {
|
|
220
221
|
child.removeDebug();
|
|
221
222
|
}
|
|
222
223
|
});
|
|
223
224
|
this.updateBounds();
|
|
224
225
|
helpers.forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
226
|
+
if (!child.ready) return;
|
|
225
227
|
child.refresh();
|
|
226
228
|
child.onResize(child);
|
|
227
229
|
if (child._debug) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - events - ESM
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -214,12 +214,14 @@ class ScrollContainer {
|
|
|
214
214
|
|
|
215
215
|
refreshScrollObservers() {
|
|
216
216
|
forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
217
|
+
if (!child.ready) return;
|
|
217
218
|
if (child._debug) {
|
|
218
219
|
child.removeDebug();
|
|
219
220
|
}
|
|
220
221
|
});
|
|
221
222
|
this.updateBounds();
|
|
222
223
|
forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
224
|
+
if (!child.ready) return;
|
|
223
225
|
child.refresh();
|
|
224
226
|
child.onResize(child);
|
|
225
227
|
if (child._debug) {
|
package/dist/modules/index.cjs
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - text - CJS
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -20,6 +20,16 @@ var consts = require('../core/consts.cjs');
|
|
|
20
20
|
* } from '../types/index.js'
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {Object} ScrambleTextTween
|
|
25
|
+
* @property {Number} from
|
|
26
|
+
* @property {Number} to
|
|
27
|
+
* @property {Number} duration
|
|
28
|
+
* @property {Number} delay
|
|
29
|
+
* @property {String} ease
|
|
30
|
+
* @property {(v: Number) => String} modifier
|
|
31
|
+
*/
|
|
32
|
+
|
|
23
33
|
/**
|
|
24
34
|
* '-' is the range operator; place it at the start or end of the string to use it as a literal (e.g. '-abc' or 'abc-')
|
|
25
35
|
* @param {String} str
|
|
@@ -57,7 +67,7 @@ const originalTexts = new WeakMap();
|
|
|
57
67
|
* progressively revealing the original text.
|
|
58
68
|
*
|
|
59
69
|
* @param {ScrambleTextParams} [params]
|
|
60
|
-
* @return {FunctionValue}
|
|
70
|
+
* @return {FunctionValue<ScrambleTextTween>}
|
|
61
71
|
*/
|
|
62
72
|
const scrambleText = (params = {}) => {
|
|
63
73
|
if (!params) params = {};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export function scrambleText(params?: ScrambleTextParams): FunctionValue
|
|
1
|
+
export function scrambleText(params?: ScrambleTextParams): FunctionValue<ScrambleTextTween>;
|
|
2
|
+
export type ScrambleTextTween = {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
delay: number;
|
|
7
|
+
ease: string;
|
|
8
|
+
modifier: (v: number) => string;
|
|
9
|
+
};
|
|
2
10
|
import type { ScrambleTextParams } from '../types/index.js';
|
|
3
11
|
import type { FunctionValue } from '../types/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - text - ESM
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -18,6 +18,16 @@ import { noop } from '../core/consts.js';
|
|
|
18
18
|
* } from '../types/index.js'
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} ScrambleTextTween
|
|
23
|
+
* @property {Number} from
|
|
24
|
+
* @property {Number} to
|
|
25
|
+
* @property {Number} duration
|
|
26
|
+
* @property {Number} delay
|
|
27
|
+
* @property {String} ease
|
|
28
|
+
* @property {(v: Number) => String} modifier
|
|
29
|
+
*/
|
|
30
|
+
|
|
21
31
|
/**
|
|
22
32
|
* '-' is the range operator; place it at the start or end of the string to use it as a literal (e.g. '-abc' or 'abc-')
|
|
23
33
|
* @param {String} str
|
|
@@ -55,7 +65,7 @@ const originalTexts = new WeakMap();
|
|
|
55
65
|
* progressively revealing the original text.
|
|
56
66
|
*
|
|
57
67
|
* @param {ScrambleTextParams} [params]
|
|
58
|
-
* @return {FunctionValue}
|
|
68
|
+
* @return {FunctionValue<ScrambleTextTween>}
|
|
59
69
|
*/
|
|
60
70
|
const scrambleText = (params = {}) => {
|
|
61
71
|
if (!params) params = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - text - CJS
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -118,6 +118,7 @@ const filterLineElements = ($el, lineIndex, bin) => {
|
|
|
118
118
|
*/
|
|
119
119
|
const generateTemplate = (type, params = {}) => {
|
|
120
120
|
let template = ``;
|
|
121
|
+
if (!params) params = {};
|
|
121
122
|
const classString = helpers.isStr(params.class) ? ` class="${params.class}"` : '';
|
|
122
123
|
const cloneType = values.setValue(params.clone, false);
|
|
123
124
|
const wrapType = values.setValue(params.wrap, false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - text - ESM
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -116,6 +116,7 @@ const filterLineElements = ($el, lineIndex, bin) => {
|
|
|
116
116
|
*/
|
|
117
117
|
const generateTemplate = (type, params = {}) => {
|
|
118
118
|
let template = ``;
|
|
119
|
+
if (!params) params = {};
|
|
119
120
|
const classString = isStr(params.class) ? ` class="${params.class}"` : '';
|
|
120
121
|
const cloneType = setValue(params.clone, false);
|
|
121
122
|
const wrapType = setValue(params.wrap, false);
|