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 - events - CJS
|
|
3
|
-
* @version v4.3.
|
|
3
|
+
* @version v4.3.4
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -223,6 +223,7 @@ class ScrollContainer {
|
|
|
223
223
|
this.updateBounds();
|
|
224
224
|
helpers.forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
225
225
|
child.refresh();
|
|
226
|
+
child.onResize(child);
|
|
226
227
|
if (child._debug) {
|
|
227
228
|
child.debug();
|
|
228
229
|
}
|
|
@@ -434,6 +435,8 @@ class ScrollObserver {
|
|
|
434
435
|
/** @type {Callback<ScrollObserver>} */
|
|
435
436
|
this.onUpdate = parameters.onUpdate || consts.noop;
|
|
436
437
|
/** @type {Callback<ScrollObserver>} */
|
|
438
|
+
this.onResize = parameters.onResize || consts.noop;
|
|
439
|
+
/** @type {Callback<ScrollObserver>} */
|
|
437
440
|
this.onSyncComplete = parameters.onSyncComplete || consts.noop;
|
|
438
441
|
/** @type {Boolean} */
|
|
439
442
|
this.reverted = false;
|
|
@@ -497,7 +500,9 @@ class ScrollObserver {
|
|
|
497
500
|
linked.pause();
|
|
498
501
|
this.linked = linked;
|
|
499
502
|
// Forces WAAPI Animation to persist; otherwise, they will stop syncing on finish.
|
|
500
|
-
if (!helpers.isUnd(
|
|
503
|
+
if (!helpers.isUnd(linked) && !helpers.isUnd(/** @type {WAAPIAnimation} */(linked).persist)) {
|
|
504
|
+
/** @type {WAAPIAnimation} */(linked).persist = true;
|
|
505
|
+
}
|
|
501
506
|
// Try to use a target of the linked object if no target parameters specified
|
|
502
507
|
if (!this._params.target) {
|
|
503
508
|
/** @type {HTMLElement} */
|
|
@@ -699,12 +704,11 @@ class ScrollObserver {
|
|
|
699
704
|
// let offsetX = 0;
|
|
700
705
|
// let offsetY = 0;
|
|
701
706
|
// let $offsetParent = $el;
|
|
702
|
-
/** @type {Element} */
|
|
703
707
|
if (linked) {
|
|
704
708
|
linkedTime = linked.currentTime;
|
|
705
709
|
linked.seek(0, true);
|
|
706
710
|
}
|
|
707
|
-
|
|
711
|
+
// Old implementation to get offset and targetSize before fixing https://github.com/juliangarnier/anime/issues/1021
|
|
708
712
|
// const isContainerStatic = get(container.element, 'position') === 'static' ? set(container.element, { position: 'relative '}) : false;
|
|
709
713
|
// while ($el && $el !== container.element && $el !== doc.body) {
|
|
710
714
|
// const isSticky = get($el, 'position') === 'sticky' ?
|
|
@@ -55,6 +55,8 @@ export class ScrollObserver {
|
|
|
55
55
|
/** @type {Callback<ScrollObserver>} */
|
|
56
56
|
onUpdate: Callback<ScrollObserver>;
|
|
57
57
|
/** @type {Callback<ScrollObserver>} */
|
|
58
|
+
onResize: Callback<ScrollObserver>;
|
|
59
|
+
/** @type {Callback<ScrollObserver>} */
|
|
58
60
|
onSyncComplete: Callback<ScrollObserver>;
|
|
59
61
|
/** @type {Boolean} */
|
|
60
62
|
reverted: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - events - ESM
|
|
3
|
-
* @version v4.3.
|
|
3
|
+
* @version v4.3.4
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -221,6 +221,7 @@ class ScrollContainer {
|
|
|
221
221
|
this.updateBounds();
|
|
222
222
|
forEachChildren(this, (/** @type {ScrollObserver} */child) => {
|
|
223
223
|
child.refresh();
|
|
224
|
+
child.onResize(child);
|
|
224
225
|
if (child._debug) {
|
|
225
226
|
child.debug();
|
|
226
227
|
}
|
|
@@ -432,6 +433,8 @@ class ScrollObserver {
|
|
|
432
433
|
/** @type {Callback<ScrollObserver>} */
|
|
433
434
|
this.onUpdate = parameters.onUpdate || noop;
|
|
434
435
|
/** @type {Callback<ScrollObserver>} */
|
|
436
|
+
this.onResize = parameters.onResize || noop;
|
|
437
|
+
/** @type {Callback<ScrollObserver>} */
|
|
435
438
|
this.onSyncComplete = parameters.onSyncComplete || noop;
|
|
436
439
|
/** @type {Boolean} */
|
|
437
440
|
this.reverted = false;
|
|
@@ -495,7 +498,9 @@ class ScrollObserver {
|
|
|
495
498
|
linked.pause();
|
|
496
499
|
this.linked = linked;
|
|
497
500
|
// Forces WAAPI Animation to persist; otherwise, they will stop syncing on finish.
|
|
498
|
-
if (!isUnd(
|
|
501
|
+
if (!isUnd(linked) && !isUnd(/** @type {WAAPIAnimation} */(linked).persist)) {
|
|
502
|
+
/** @type {WAAPIAnimation} */(linked).persist = true;
|
|
503
|
+
}
|
|
499
504
|
// Try to use a target of the linked object if no target parameters specified
|
|
500
505
|
if (!this._params.target) {
|
|
501
506
|
/** @type {HTMLElement} */
|
|
@@ -697,12 +702,11 @@ class ScrollObserver {
|
|
|
697
702
|
// let offsetX = 0;
|
|
698
703
|
// let offsetY = 0;
|
|
699
704
|
// let $offsetParent = $el;
|
|
700
|
-
/** @type {Element} */
|
|
701
705
|
if (linked) {
|
|
702
706
|
linkedTime = linked.currentTime;
|
|
703
707
|
linked.seek(0, true);
|
|
704
708
|
}
|
|
705
|
-
|
|
709
|
+
// Old implementation to get offset and targetSize before fixing https://github.com/juliangarnier/anime/issues/1021
|
|
706
710
|
// const isContainerStatic = get(container.element, 'position') === 'static' ? set(container.element, { position: 'relative '}) : false;
|
|
707
711
|
// while ($el && $el !== container.element && $el !== doc.body) {
|
|
708
712
|
// const isSticky = get($el, 'position') === 'sticky' ?
|
package/dist/modules/index.cjs
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - timeline - CJS
|
|
3
|
-
* @version v4.3.
|
|
3
|
+
* @version v4.3.4
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -220,6 +220,10 @@ class Timeline extends timer.Timer {
|
|
|
220
220
|
if (helpers.isUnd(synced) || synced && helpers.isUnd(synced.pause)) return this;
|
|
221
221
|
synced.pause();
|
|
222
222
|
const duration = +(/** @type {globalThis.Animation} */(synced).effect ? /** @type {globalThis.Animation} */(synced).effect.getTiming().duration : /** @type {Tickable} */(synced).duration);
|
|
223
|
+
// Forces WAAPI Animation to persist; otherwise, they will stop syncing on finish.
|
|
224
|
+
if (!helpers.isUnd(synced) && !helpers.isUnd(/** @type {WAAPIAnimation} */(synced).persist)) {
|
|
225
|
+
/** @type {WAAPIAnimation} */(synced).persist = true;
|
|
226
|
+
}
|
|
223
227
|
return this.add(synced, { currentTime: [0, duration], duration, delay: 0, ease: 'linear', playbackEase: 'linear' }, position);
|
|
224
228
|
}
|
|
225
229
|
|
|
@@ -286,8 +290,8 @@ class Timeline extends timer.Timer {
|
|
|
286
290
|
* @return {this}
|
|
287
291
|
*/
|
|
288
292
|
refresh() {
|
|
289
|
-
helpers.forEachChildren(this, (/** @type {JSAnimation} */child) => {
|
|
290
|
-
if (child.refresh) child.refresh();
|
|
293
|
+
helpers.forEachChildren(this, (/** @type {JSAnimation|Timer} */child) => {
|
|
294
|
+
if (/** @type {JSAnimation} */(child).refresh) /** @type {JSAnimation} */(child).refresh();
|
|
291
295
|
});
|
|
292
296
|
return this;
|
|
293
297
|
}
|
|
@@ -297,7 +301,7 @@ class Timeline extends timer.Timer {
|
|
|
297
301
|
*/
|
|
298
302
|
revert() {
|
|
299
303
|
super.revert();
|
|
300
|
-
helpers.forEachChildren(this, (/** @type {JSAnimation} */child) => child.revert, true);
|
|
304
|
+
helpers.forEachChildren(this, (/** @type {JSAnimation|Timer} */child) => child.revert, true);
|
|
301
305
|
return styles.cleanInlineStyles(this);
|
|
302
306
|
}
|
|
303
307
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anime.js - timeline - ESM
|
|
3
|
-
* @version v4.3.
|
|
3
|
+
* @version v4.3.4
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 - Julian Garnier
|
|
6
6
|
*/
|
|
@@ -218,6 +218,10 @@ class Timeline extends Timer {
|
|
|
218
218
|
if (isUnd(synced) || synced && isUnd(synced.pause)) return this;
|
|
219
219
|
synced.pause();
|
|
220
220
|
const duration = +(/** @type {globalThis.Animation} */(synced).effect ? /** @type {globalThis.Animation} */(synced).effect.getTiming().duration : /** @type {Tickable} */(synced).duration);
|
|
221
|
+
// Forces WAAPI Animation to persist; otherwise, they will stop syncing on finish.
|
|
222
|
+
if (!isUnd(synced) && !isUnd(/** @type {WAAPIAnimation} */(synced).persist)) {
|
|
223
|
+
/** @type {WAAPIAnimation} */(synced).persist = true;
|
|
224
|
+
}
|
|
221
225
|
return this.add(synced, { currentTime: [0, duration], duration, delay: 0, ease: 'linear', playbackEase: 'linear' }, position);
|
|
222
226
|
}
|
|
223
227
|
|
|
@@ -284,8 +288,8 @@ class Timeline extends Timer {
|
|
|
284
288
|
* @return {this}
|
|
285
289
|
*/
|
|
286
290
|
refresh() {
|
|
287
|
-
forEachChildren(this, (/** @type {JSAnimation} */child) => {
|
|
288
|
-
if (child.refresh) child.refresh();
|
|
291
|
+
forEachChildren(this, (/** @type {JSAnimation|Timer} */child) => {
|
|
292
|
+
if (/** @type {JSAnimation} */(child).refresh) /** @type {JSAnimation} */(child).refresh();
|
|
289
293
|
});
|
|
290
294
|
return this;
|
|
291
295
|
}
|
|
@@ -295,7 +299,7 @@ class Timeline extends Timer {
|
|
|
295
299
|
*/
|
|
296
300
|
revert() {
|
|
297
301
|
super.revert();
|
|
298
|
-
forEachChildren(this, (/** @type {JSAnimation} */child) => child.revert, true);
|
|
302
|
+
forEachChildren(this, (/** @type {JSAnimation|Timer} */child) => child.revert, true);
|
|
299
303
|
return cleanInlineStyles(this);
|
|
300
304
|
}
|
|
301
305
|
|
|
@@ -123,7 +123,8 @@ export type Tween = {
|
|
|
123
123
|
property: string;
|
|
124
124
|
target: Target;
|
|
125
125
|
_value: string | number;
|
|
126
|
-
|
|
126
|
+
_toFunc: Function | null;
|
|
127
|
+
_fromFunc: Function | null;
|
|
127
128
|
_ease: EasingFunction;
|
|
128
129
|
_fromNumbers: Array<number>;
|
|
129
130
|
_toNumbers: Array<number>;
|
|
@@ -328,6 +329,7 @@ export type ScrollObserverParams = {
|
|
|
328
329
|
onEnterBackward?: Callback<ScrollObserver>;
|
|
329
330
|
onLeaveBackward?: Callback<ScrollObserver>;
|
|
330
331
|
onUpdate?: Callback<ScrollObserver>;
|
|
332
|
+
onResize?: Callback<ScrollObserver>;
|
|
331
333
|
onSyncComplete?: Callback<ScrollObserver>;
|
|
332
334
|
};
|
|
333
335
|
export type DraggableAxisParam = {
|