animejs 4.4.1 → 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 +2 -3
- package/dist/bundles/anime.esm.js +462 -213
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +462 -213
- 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 +64 -14
- package/dist/modules/core/render.js +65 -15
- 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,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - core - ESM
|
|
3
|
-
* @version v4.
|
|
3
|
+
* @version v4.5.0
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { isUnd, isValidSVGAttribute, stringStartsWith,
|
|
8
|
+
import { valueTypes, unitsExecRgx, digitWithExponentRgx, tweenTypes, isDomSymbol, isSvgSymbol, validTransforms, shortTransforms, proxyTargetSymbol, cssVariableMatchRgx, emptyString, cssVarPrefix } from './consts.js';
|
|
9
|
+
import { isUnd, isCol, isValidSVGAttribute, stringStartsWith, isFnc, isStr, round, lerp, cloneArray } from './helpers.js';
|
|
10
10
|
import { parseInlineTransforms } from './transforms.js';
|
|
11
|
+
import { resolveAdapterEntry } from '../adapters/registry.js';
|
|
11
12
|
import { convertColorStringValuesToRgbaArray } from './colors.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -31,6 +32,21 @@ const setValue = (targetValue, defaultValue) => {
|
|
|
31
32
|
return isUnd(targetValue) ? defaultValue : targetValue;
|
|
32
33
|
};
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Resolve against the target when it's a DOM element, otherwise fall back to :root so non-DOM targets like three.js meshes and custom adapters still pick up CSS variables defined on the document.
|
|
37
|
+
*
|
|
38
|
+
* @param {String} value
|
|
39
|
+
* @param {Target} target
|
|
40
|
+
* @return {String|Number}
|
|
41
|
+
*/
|
|
42
|
+
const resolveCssVar = (value, target) => {
|
|
43
|
+
const match = value.match(cssVariableMatchRgx);
|
|
44
|
+
const el = target[isDomSymbol] ? target : document.documentElement;
|
|
45
|
+
let computed = getComputedStyle(/** @type {HTMLElement} */(el))?.getPropertyValue(match[1]);
|
|
46
|
+
if ((!computed || computed.trim() === emptyString) && match[2]) computed = match[2].trim();
|
|
47
|
+
return computed || 0;
|
|
48
|
+
};
|
|
49
|
+
|
|
34
50
|
/**
|
|
35
51
|
* @param {TweenPropValue} value
|
|
36
52
|
* @param {Target} target
|
|
@@ -41,30 +57,26 @@ const setValue = (targetValue, defaultValue) => {
|
|
|
41
57
|
* @return {any}
|
|
42
58
|
*/
|
|
43
59
|
const getFunctionValue = (value, target, index, targets, store, prevTween) => {
|
|
44
|
-
let func;
|
|
45
60
|
if (isFnc(value)) {
|
|
46
|
-
|
|
61
|
+
if (!store) {
|
|
62
|
+
const computed = /** @type {Function} */(value)(target, index, targets, prevTween);
|
|
63
|
+
// Fallback to 0 if the function returns undefined, NaN, null, false or 0
|
|
64
|
+
return !isNaN(+computed) ? +computed : computed || 0;
|
|
65
|
+
}
|
|
66
|
+
const func = () => {
|
|
47
67
|
const computed = /** @type {Function} */(value)(target, index, targets, prevTween);
|
|
48
|
-
// Fallback to 0 if the function returns undefined / NaN / null / false / 0
|
|
49
68
|
return !isNaN(+computed) ? +computed : computed || 0;
|
|
50
69
|
};
|
|
51
|
-
|
|
52
|
-
func
|
|
53
|
-
const match = value.match(cssVariableMatchRgx);
|
|
54
|
-
const cssVarName = match[1];
|
|
55
|
-
const fallbackValue = match[2];
|
|
56
|
-
let computed = getComputedStyle(/** @type {HTMLElement} */(target))?.getPropertyValue(cssVarName);
|
|
57
|
-
// Use fallback if CSS variable is not set or empty
|
|
58
|
-
if ((!computed || computed.trim() === emptyString) && fallbackValue) {
|
|
59
|
-
computed = fallbackValue.trim();
|
|
60
|
-
}
|
|
61
|
-
return computed || 0;
|
|
62
|
-
};
|
|
63
|
-
} else {
|
|
64
|
-
return value;
|
|
70
|
+
store.func = func;
|
|
71
|
+
return func();
|
|
65
72
|
}
|
|
66
|
-
if (
|
|
67
|
-
|
|
73
|
+
if (isStr(value) && stringStartsWith(value, cssVarPrefix)) {
|
|
74
|
+
if (!store) return resolveCssVar(/** @type {String} */(value), target);
|
|
75
|
+
const func = () => resolveCssVar(/** @type {String} */(value), target);
|
|
76
|
+
store.func = func;
|
|
77
|
+
return func();
|
|
78
|
+
}
|
|
79
|
+
return value;
|
|
68
80
|
};
|
|
69
81
|
|
|
70
82
|
/**
|
|
@@ -111,6 +123,12 @@ const getCSSValue = (target, propName, animationInlineStyles) => {
|
|
|
111
123
|
*/
|
|
112
124
|
const getOriginalAnimatableValue = (target, propName, tweenType, animationInlineStyles) => {
|
|
113
125
|
const type = !isUnd(tweenType) ? tweenType : getTweenType(target, propName);
|
|
126
|
+
const adapterProp = resolveAdapterEntry(target, propName);
|
|
127
|
+
if (adapterProp) {
|
|
128
|
+
const value = adapterProp.get(target);
|
|
129
|
+
if (value && animationInlineStyles) animationInlineStyles[propName] = value;
|
|
130
|
+
return value == null ? 0 : value;
|
|
131
|
+
}
|
|
114
132
|
if (type === tweenTypes.OBJECT) {
|
|
115
133
|
const value = target[propName];
|
|
116
134
|
if (value && animationInlineStyles) animationInlineStyles[propName] = value;
|
|
@@ -152,7 +170,7 @@ const createDecomposedValueTargetObject = () => {
|
|
|
152
170
|
};
|
|
153
171
|
|
|
154
172
|
/**
|
|
155
|
-
* @param {String|Number} rawValue
|
|
173
|
+
* @param {String|Number|Object} rawValue
|
|
156
174
|
* @param {TweenDecomposedValue} targetObject
|
|
157
175
|
* @return {TweenDecomposedValue}
|
|
158
176
|
*/
|
|
@@ -170,39 +188,38 @@ const decomposeRawValue = (rawValue, targetObject) => {
|
|
|
170
188
|
// It's a number
|
|
171
189
|
targetObject.n = num;
|
|
172
190
|
return targetObject;
|
|
191
|
+
}
|
|
192
|
+
// let str = /** @type {String} */(rawValue).trim();
|
|
193
|
+
let str = /** @type {String} */(rawValue);
|
|
194
|
+
// Parsing operators (+=, -=, *=) manually is much faster than using regex here
|
|
195
|
+
if (str[1] === '=') {
|
|
196
|
+
targetObject.o = str[0];
|
|
197
|
+
str = str.slice(2);
|
|
198
|
+
}
|
|
199
|
+
// Skip exec regex if the value type is complex or color to avoid long regex backtracking
|
|
200
|
+
const unitMatch = str.includes(' ') ? false : unitsExecRgx.exec(str);
|
|
201
|
+
if (unitMatch) {
|
|
202
|
+
// Has a number and a unit
|
|
203
|
+
targetObject.t = valueTypes.UNIT;
|
|
204
|
+
targetObject.n = +unitMatch[1];
|
|
205
|
+
targetObject.u = unitMatch[2];
|
|
206
|
+
return targetObject;
|
|
207
|
+
} else if (targetObject.o) {
|
|
208
|
+
// Has an operator (+=, -=, *=)
|
|
209
|
+
targetObject.n = +str;
|
|
210
|
+
return targetObject;
|
|
211
|
+
} else if (isCol(str)) {
|
|
212
|
+
// Color string
|
|
213
|
+
targetObject.t = valueTypes.COLOR;
|
|
214
|
+
targetObject.d = convertColorStringValuesToRgbaArray(str);
|
|
215
|
+
return targetObject;
|
|
173
216
|
} else {
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
// Skip exec regex if the value type is complex or color to avoid long regex backtracking
|
|
182
|
-
const unitMatch = str.includes(' ') ? false : unitsExecRgx.exec(str);
|
|
183
|
-
if (unitMatch) {
|
|
184
|
-
// Has a number and a unit
|
|
185
|
-
targetObject.t = valueTypes.UNIT;
|
|
186
|
-
targetObject.n = +unitMatch[1];
|
|
187
|
-
targetObject.u = unitMatch[2];
|
|
188
|
-
return targetObject;
|
|
189
|
-
} else if (targetObject.o) {
|
|
190
|
-
// Has an operator (+=, -=, *=)
|
|
191
|
-
targetObject.n = +str;
|
|
192
|
-
return targetObject;
|
|
193
|
-
} else if (isCol(str)) {
|
|
194
|
-
// Is a color
|
|
195
|
-
targetObject.t = valueTypes.COLOR;
|
|
196
|
-
targetObject.d = convertColorStringValuesToRgbaArray(str);
|
|
197
|
-
return targetObject;
|
|
198
|
-
} else {
|
|
199
|
-
// Is a more complex string (generally svg coords, calc() or filters CSS values)
|
|
200
|
-
const matchedNumbers = str.match(digitWithExponentRgx);
|
|
201
|
-
targetObject.t = valueTypes.COMPLEX;
|
|
202
|
-
targetObject.d = matchedNumbers ? matchedNumbers.map(Number) : [];
|
|
203
|
-
targetObject.s = str.split(digitWithExponentRgx) || [];
|
|
204
|
-
return targetObject;
|
|
205
|
-
}
|
|
217
|
+
// Is a more complex string (generally svg coords, calc() or filters CSS values)
|
|
218
|
+
const matchedNumbers = str.match(digitWithExponentRgx);
|
|
219
|
+
targetObject.t = valueTypes.COMPLEX;
|
|
220
|
+
targetObject.d = matchedNumbers ? matchedNumbers.map(Number) : [];
|
|
221
|
+
targetObject.s = str.split(digitWithExponentRgx) || [];
|
|
222
|
+
return targetObject;
|
|
206
223
|
}
|
|
207
224
|
};
|
|
208
225
|
|
|
@@ -223,30 +240,6 @@ const decomposeTweenValue = (tween, targetObject) => {
|
|
|
223
240
|
|
|
224
241
|
const decomposedOriginalValue = createDecomposedValueTargetObject();
|
|
225
242
|
|
|
226
|
-
/**
|
|
227
|
-
* @param {Tween} tween
|
|
228
|
-
* @param {Number} progress
|
|
229
|
-
* @param {Number} precision
|
|
230
|
-
* @return {String}
|
|
231
|
-
*/
|
|
232
|
-
const composeColorValue = (tween, progress, precision) => {
|
|
233
|
-
const mod = tween._modifier;
|
|
234
|
-
const fn = tween._fromNumbers;
|
|
235
|
-
const tn = tween._toNumbers;
|
|
236
|
-
const r = round(clamp(/** @type {Number} */(mod(lerp(fn[0], tn[0], progress))), 0, 255), 0);
|
|
237
|
-
const g = round(clamp(/** @type {Number} */(mod(lerp(fn[1], tn[1], progress))), 0, 255), 0);
|
|
238
|
-
const b = round(clamp(/** @type {Number} */(mod(lerp(fn[2], tn[2], progress))), 0, 255), 0);
|
|
239
|
-
const a = clamp(/** @type {Number} */(mod(round(lerp(fn[3], tn[3], progress), precision))), 0, 1);
|
|
240
|
-
if (tween._composition !== compositionTypes.none) {
|
|
241
|
-
const ns = tween._numbers;
|
|
242
|
-
ns[0] = r;
|
|
243
|
-
ns[1] = g;
|
|
244
|
-
ns[2] = b;
|
|
245
|
-
ns[3] = a;
|
|
246
|
-
}
|
|
247
|
-
return `rgba(${r},${g},${b},${a})`;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
243
|
/**
|
|
251
244
|
* @param {Tween} tween
|
|
252
245
|
* @param {Number} progress
|
|
@@ -258,17 +251,16 @@ const composeComplexValue = (tween, progress, precision) => {
|
|
|
258
251
|
const fn = tween._fromNumbers;
|
|
259
252
|
const tn = tween._toNumbers;
|
|
260
253
|
const ts = tween._strings;
|
|
261
|
-
const hasComposition = tween._composition !== compositionTypes.none;
|
|
262
254
|
let v = ts[0];
|
|
263
255
|
for (let j = 0, l = tn.length; j < l; j++) {
|
|
264
256
|
const n = /** @type {Number} */(mod(round(lerp(fn[j], tn[j], progress), precision)));
|
|
265
257
|
const s = ts[j + 1];
|
|
266
258
|
v += `${s ? n + s : n}`;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
259
|
+
// Keep _numbers fresh for every tween, not only composed ones, so a non-composition setter that reads the lerped triplet such as three transformOrigin still animates.
|
|
260
|
+
// Potential optimization, skip the write when nothing reads it: if (hasComposition || tween._setter) tween._numbers[j] = n;
|
|
261
|
+
tween._numbers[j] = n;
|
|
270
262
|
}
|
|
271
263
|
return v;
|
|
272
264
|
};
|
|
273
265
|
|
|
274
|
-
export {
|
|
266
|
+
export { composeComplexValue, createDecomposedValueTargetObject, decomposeRawValue, decomposeTweenValue, decomposedOriginalValue, getFunctionValue, getOriginalAnimatableValue, getRelativeValue, getTweenType, setValue };
|
|
@@ -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