animejs 4.3.2 → 4.3.4
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/bundles/anime.esm.js +47 -23
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +47 -23
- package/dist/bundles/anime.umd.min.js +2 -2
- package/dist/modules/animatable/animatable.cjs +1 -1
- package/dist/modules/animatable/animatable.js +1 -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 +29 -15
- package/dist/modules/animation/animation.js +30 -16
- package/dist/modules/animation/composition.cjs +1 -1
- package/dist/modules/animation/composition.js +1 -1
- package/dist/modules/animation/index.cjs +1 -1
- package/dist/modules/animation/index.js +1 -1
- package/dist/modules/core/clock.cjs +1 -1
- package/dist/modules/core/clock.js +1 -1
- package/dist/modules/core/colors.cjs +1 -1
- package/dist/modules/core/colors.js +1 -1
- package/dist/modules/core/consts.cjs +1 -1
- package/dist/modules/core/consts.js +1 -1
- package/dist/modules/core/globals.cjs +2 -2
- package/dist/modules/core/globals.js +2 -2
- package/dist/modules/core/helpers.cjs +1 -1
- package/dist/modules/core/helpers.js +1 -1
- package/dist/modules/core/render.cjs +1 -1
- package/dist/modules/core/render.js +1 -1
- package/dist/modules/core/styles.cjs +1 -1
- package/dist/modules/core/styles.js +1 -1
- package/dist/modules/core/targets.cjs +1 -1
- package/dist/modules/core/targets.js +1 -1
- 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 +1 -1
- package/dist/modules/core/values.js +1 -1
- 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 +1 -1
- package/dist/modules/easings/eases/parser.js +1 -1
- 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 +1 -1
- package/dist/modules/engine/engine.js +1 -1
- 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 +8 -4
- package/dist/modules/events/scroll.d.ts +2 -0
- package/dist/modules/events/scroll.js +8 -4
- 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/split.cjs +1 -1
- package/dist/modules/text/split.js +1 -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 +8 -4
- package/dist/modules/timeline/timeline.js +8 -4
- 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 +3 -1
- 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 +1 -1
- package/dist/modules/utils/random.js +1 -1
- package/dist/modules/utils/stagger.cjs +1 -1
- package/dist/modules/utils/stagger.js +1 -1
- package/dist/modules/utils/target.cjs +1 -1
- package/dist/modules/utils/target.js +1 -1
- package/dist/modules/utils/time.cjs +1 -1
- package/dist/modules/utils/time.js +1 -1
- 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 +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - ESM bundle
|
|
3
|
-
* @version v4.3.
|
|
3
|
+
* @version v4.3.4
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -205,7 +205,8 @@
|
|
|
205
205
|
* @property {String} property
|
|
206
206
|
* @property {Target} target
|
|
207
207
|
* @property {String|Number} _value
|
|
208
|
-
* @property {Function|null}
|
|
208
|
+
* @property {Function|null} _toFunc
|
|
209
|
+
* @property {Function|null} _fromFunc
|
|
209
210
|
* @property {EasingFunction} _ease
|
|
210
211
|
* @property {Array.<Number>} _fromNumbers
|
|
211
212
|
* @property {Array.<Number>} _toNumbers
|
|
@@ -536,6 +537,7 @@
|
|
|
536
537
|
* @property {Callback<ScrollObserver>} [onEnterBackward]
|
|
537
538
|
* @property {Callback<ScrollObserver>} [onLeaveBackward]
|
|
538
539
|
* @property {Callback<ScrollObserver>} [onUpdate]
|
|
540
|
+
* @property {Callback<ScrollObserver>} [onResize]
|
|
539
541
|
* @property {Callback<ScrollObserver>} [onSyncComplete]
|
|
540
542
|
*/
|
|
541
543
|
|
|
@@ -801,7 +803,7 @@ const globals = {
|
|
|
801
803
|
|
|
802
804
|
const devTools = isBrowser && win.AnimeJSDevTools;
|
|
803
805
|
|
|
804
|
-
const globalVersions = { version: '4.3.
|
|
806
|
+
const globalVersions = { version: '4.3.4', engine: null };
|
|
805
807
|
|
|
806
808
|
if (isBrowser) {
|
|
807
809
|
if (!win.AnimeJS) win.AnimeJS = [];
|
|
@@ -3271,6 +3273,7 @@ const fromTargetObject = createDecomposedValueTargetObject();
|
|
|
3271
3273
|
const toTargetObject = createDecomposedValueTargetObject();
|
|
3272
3274
|
const inlineStylesStore = {};
|
|
3273
3275
|
const toFunctionStore = { func: null };
|
|
3276
|
+
const fromFunctionStore = { func: null };
|
|
3274
3277
|
const keyframesTargetArray = [null];
|
|
3275
3278
|
const fastSetValuesArray = [null, null];
|
|
3276
3279
|
/** @type {TweenKeyValue} */
|
|
@@ -3512,6 +3515,7 @@ class JSAnimation extends Timer {
|
|
|
3512
3515
|
}
|
|
3513
3516
|
|
|
3514
3517
|
toFunctionStore.func = null;
|
|
3518
|
+
fromFunctionStore.func = null;
|
|
3515
3519
|
|
|
3516
3520
|
const computedToValue = getFunctionValue(key.to, target, ti, tl, toFunctionStore);
|
|
3517
3521
|
|
|
@@ -3572,7 +3576,7 @@ class JSAnimation extends Timer {
|
|
|
3572
3576
|
|
|
3573
3577
|
// Decompose values
|
|
3574
3578
|
if (isFromToValue) {
|
|
3575
|
-
decomposeRawValue(isFromToArray ? getFunctionValue(tweenToValue[0], target, ti, tl) : tweenFromValue, fromTargetObject);
|
|
3579
|
+
decomposeRawValue(isFromToArray ? getFunctionValue(tweenToValue[0], target, ti, tl, fromFunctionStore) : tweenFromValue, fromTargetObject);
|
|
3576
3580
|
decomposeRawValue(isFromToArray ? getFunctionValue(tweenToValue[1], target, ti, tl, toFunctionStore) : tweenToValue, toTargetObject);
|
|
3577
3581
|
// Needed to force an inline style registration
|
|
3578
3582
|
const originalValue = getOriginalAnimatableValue(target, propName, tweenType, inlineStylesStore);
|
|
@@ -3689,7 +3693,8 @@ class JSAnimation extends Timer {
|
|
|
3689
3693
|
property: propName,
|
|
3690
3694
|
target: target,
|
|
3691
3695
|
_value: null,
|
|
3692
|
-
|
|
3696
|
+
_toFunc: toFunctionStore.func,
|
|
3697
|
+
_fromFunc: fromFunctionStore.func,
|
|
3693
3698
|
_ease: parseEase(tweenEasing),
|
|
3694
3699
|
_fromNumbers: cloneArray(fromTargetObject.d),
|
|
3695
3700
|
_toNumbers: cloneArray(toTargetObject.d),
|
|
@@ -3847,18 +3852,29 @@ class JSAnimation extends Timer {
|
|
|
3847
3852
|
*/
|
|
3848
3853
|
refresh() {
|
|
3849
3854
|
forEachChildren(this, (/** @type {Tween} */tween) => {
|
|
3850
|
-
const
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3855
|
+
const toFunc = tween._toFunc;
|
|
3856
|
+
const fromFunc = tween._fromFunc;
|
|
3857
|
+
if (toFunc || fromFunc) {
|
|
3858
|
+
if (fromFunc) {
|
|
3859
|
+
decomposeRawValue(fromFunc(), fromTargetObject);
|
|
3860
|
+
if (fromTargetObject.u !== tween._unit && tween.target[isDomSymbol]) {
|
|
3861
|
+
convertValueUnit(/** @type {DOMTarget} */(tween.target), fromTargetObject, tween._unit, true);
|
|
3862
|
+
}
|
|
3863
|
+
tween._fromNumbers = cloneArray(fromTargetObject.d);
|
|
3864
|
+
tween._fromNumber = fromTargetObject.n;
|
|
3865
|
+
} else if (toFunc) {
|
|
3866
|
+
// When only toFunc exists, get from value from target
|
|
3867
|
+
decomposeRawValue(getOriginalAnimatableValue(tween.target, tween.property, tween._tweenType), decomposedOriginalValue);
|
|
3868
|
+
tween._fromNumbers = cloneArray(decomposedOriginalValue.d);
|
|
3869
|
+
tween._fromNumber = decomposedOriginalValue.n;
|
|
3870
|
+
}
|
|
3871
|
+
if (toFunc) {
|
|
3872
|
+
decomposeRawValue(toFunc(), toTargetObject);
|
|
3873
|
+
tween._toNumbers = cloneArray(toTargetObject.d);
|
|
3874
|
+
tween._strings = cloneArray(toTargetObject.s);
|
|
3875
|
+
// Make sure to apply relative operators https://github.com/juliangarnier/anime/issues/1025
|
|
3876
|
+
tween._toNumber = toTargetObject.o ? getRelativeValue(tween._fromNumber, toTargetObject.n, toTargetObject.o) : toTargetObject.n;
|
|
3877
|
+
}
|
|
3862
3878
|
}
|
|
3863
3879
|
});
|
|
3864
3880
|
// This forces setter animations to render once
|
|
@@ -4291,6 +4307,10 @@ class Timeline extends Timer {
|
|
|
4291
4307
|
if (isUnd(synced) || synced && isUnd(synced.pause)) return this;
|
|
4292
4308
|
synced.pause();
|
|
4293
4309
|
const duration = +(/** @type {globalThis.Animation} */(synced).effect ? /** @type {globalThis.Animation} */(synced).effect.getTiming().duration : /** @type {Tickable} */(synced).duration);
|
|
4310
|
+
// Forces WAAPI Animation to persist; otherwise, they will stop syncing on finish.
|
|
4311
|
+
if (!isUnd(synced) && !isUnd(/** @type {WAAPIAnimation} */(synced).persist)) {
|
|
4312
|
+
/** @type {WAAPIAnimation} */(synced).persist = true;
|
|
4313
|
+
}
|
|
4294
4314
|
return this.add(synced, { currentTime: [0, duration], duration, delay: 0, ease: 'linear', playbackEase: 'linear' }, position);
|
|
4295
4315
|
}
|
|
4296
4316
|
|
|
@@ -4357,8 +4377,8 @@ class Timeline extends Timer {
|
|
|
4357
4377
|
* @return {this}
|
|
4358
4378
|
*/
|
|
4359
4379
|
refresh() {
|
|
4360
|
-
forEachChildren(this, (/** @type {JSAnimation} */child) => {
|
|
4361
|
-
if (child.refresh) child.refresh();
|
|
4380
|
+
forEachChildren(this, (/** @type {JSAnimation|Timer} */child) => {
|
|
4381
|
+
if (/** @type {JSAnimation} */(child).refresh) /** @type {JSAnimation} */(child).refresh();
|
|
4362
4382
|
});
|
|
4363
4383
|
return this;
|
|
4364
4384
|
}
|
|
@@ -4368,7 +4388,7 @@ class Timeline extends Timer {
|
|
|
4368
4388
|
*/
|
|
4369
4389
|
revert() {
|
|
4370
4390
|
super.revert();
|
|
4371
|
-
forEachChildren(this, (/** @type {JSAnimation} */child) => child.revert, true);
|
|
4391
|
+
forEachChildren(this, (/** @type {JSAnimation|Timer} */child) => child.revert, true);
|
|
4372
4392
|
return cleanInlineStyles(this);
|
|
4373
4393
|
}
|
|
4374
4394
|
|
|
@@ -6465,6 +6485,7 @@ class ScrollContainer {
|
|
|
6465
6485
|
this.updateBounds();
|
|
6466
6486
|
forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
6467
6487
|
child.refresh();
|
|
6488
|
+
child.onResize(child);
|
|
6468
6489
|
if (child._debug) {
|
|
6469
6490
|
child.debug();
|
|
6470
6491
|
}
|
|
@@ -6676,6 +6697,8 @@ class ScrollObserver {
|
|
|
6676
6697
|
/** @type {Callback<ScrollObserver>} */
|
|
6677
6698
|
this.onUpdate = parameters.onUpdate || noop;
|
|
6678
6699
|
/** @type {Callback<ScrollObserver>} */
|
|
6700
|
+
this.onResize = parameters.onResize || noop;
|
|
6701
|
+
/** @type {Callback<ScrollObserver>} */
|
|
6679
6702
|
this.onSyncComplete = parameters.onSyncComplete || noop;
|
|
6680
6703
|
/** @type {Boolean} */
|
|
6681
6704
|
this.reverted = false;
|
|
@@ -6739,7 +6762,9 @@ class ScrollObserver {
|
|
|
6739
6762
|
linked.pause();
|
|
6740
6763
|
this.linked = linked;
|
|
6741
6764
|
// Forces WAAPI Animation to persist; otherwise, they will stop syncing on finish.
|
|
6742
|
-
if (!isUnd(
|
|
6765
|
+
if (!isUnd(linked) && !isUnd(/** @type {WAAPIAnimation} */(linked).persist)) {
|
|
6766
|
+
/** @type {WAAPIAnimation} */(linked).persist = true;
|
|
6767
|
+
}
|
|
6743
6768
|
// Try to use a target of the linked object if no target parameters specified
|
|
6744
6769
|
if (!this._params.target) {
|
|
6745
6770
|
/** @type {HTMLElement} */
|
|
@@ -6941,12 +6966,11 @@ class ScrollObserver {
|
|
|
6941
6966
|
// let offsetX = 0;
|
|
6942
6967
|
// let offsetY = 0;
|
|
6943
6968
|
// let $offsetParent = $el;
|
|
6944
|
-
/** @type {Element} */
|
|
6945
6969
|
if (linked) {
|
|
6946
6970
|
linkedTime = linked.currentTime;
|
|
6947
6971
|
linked.seek(0, true);
|
|
6948
6972
|
}
|
|
6949
|
-
|
|
6973
|
+
// Old implementation to get offset and targetSize before fixing https://github.com/juliangarnier/anime/issues/1021
|
|
6950
6974
|
// const isContainerStatic = get(container.element, 'position') === 'static' ? set(container.element, { position: 'relative '}) : false;
|
|
6951
6975
|
// while ($el && $el !== container.element && $el !== doc.body) {
|
|
6952
6976
|
// const isSticky = get($el, 'position') === 'sticky' ?
|