animejs 4.3.0-beta.1 → 4.3.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 (127) hide show
  1. package/README.md +16 -17
  2. package/dist/bundles/anime.esm.js +456 -266
  3. package/dist/bundles/anime.esm.min.js +3 -3
  4. package/dist/bundles/anime.umd.js +456 -266
  5. package/dist/bundles/anime.umd.min.js +3 -3
  6. package/dist/modules/animatable/animatable.cjs +2 -2
  7. package/dist/modules/animatable/animatable.js +2 -2
  8. package/dist/modules/animatable/index.cjs +2 -2
  9. package/dist/modules/animatable/index.js +2 -2
  10. package/dist/modules/animation/additive.cjs +2 -2
  11. package/dist/modules/animation/additive.js +2 -2
  12. package/dist/modules/animation/animation.cjs +8 -5
  13. package/dist/modules/animation/animation.js +9 -6
  14. package/dist/modules/animation/composition.cjs +2 -2
  15. package/dist/modules/animation/composition.js +2 -2
  16. package/dist/modules/animation/index.cjs +2 -2
  17. package/dist/modules/animation/index.js +2 -2
  18. package/dist/modules/core/clock.cjs +2 -2
  19. package/dist/modules/core/clock.js +2 -2
  20. package/dist/modules/core/colors.cjs +2 -2
  21. package/dist/modules/core/colors.js +2 -2
  22. package/dist/modules/core/consts.cjs +2 -2
  23. package/dist/modules/core/consts.js +2 -2
  24. package/dist/modules/core/globals.cjs +3 -3
  25. package/dist/modules/core/globals.js +3 -3
  26. package/dist/modules/core/helpers.cjs +4 -4
  27. package/dist/modules/core/helpers.js +4 -4
  28. package/dist/modules/core/render.cjs +2 -2
  29. package/dist/modules/core/render.js +2 -2
  30. package/dist/modules/core/styles.cjs +2 -2
  31. package/dist/modules/core/styles.js +2 -2
  32. package/dist/modules/core/targets.cjs +2 -2
  33. package/dist/modules/core/targets.js +2 -2
  34. package/dist/modules/core/transforms.cjs +2 -2
  35. package/dist/modules/core/transforms.js +2 -2
  36. package/dist/modules/core/units.cjs +2 -2
  37. package/dist/modules/core/units.js +2 -2
  38. package/dist/modules/core/values.cjs +2 -2
  39. package/dist/modules/core/values.js +2 -2
  40. package/dist/modules/draggable/draggable.cjs +2 -2
  41. package/dist/modules/draggable/draggable.js +2 -2
  42. package/dist/modules/draggable/index.cjs +2 -2
  43. package/dist/modules/draggable/index.js +2 -2
  44. package/dist/modules/easings/cubic-bezier/index.cjs +2 -2
  45. package/dist/modules/easings/cubic-bezier/index.js +2 -2
  46. package/dist/modules/easings/eases/index.cjs +2 -2
  47. package/dist/modules/easings/eases/index.js +2 -2
  48. package/dist/modules/easings/eases/parser.cjs +2 -2
  49. package/dist/modules/easings/eases/parser.js +2 -2
  50. package/dist/modules/easings/index.cjs +2 -2
  51. package/dist/modules/easings/index.js +2 -2
  52. package/dist/modules/easings/irregular/index.cjs +2 -2
  53. package/dist/modules/easings/irregular/index.js +2 -2
  54. package/dist/modules/easings/linear/index.cjs +2 -2
  55. package/dist/modules/easings/linear/index.js +2 -2
  56. package/dist/modules/easings/none.cjs +2 -2
  57. package/dist/modules/easings/none.js +2 -2
  58. package/dist/modules/easings/spring/index.cjs +2 -2
  59. package/dist/modules/easings/spring/index.js +2 -2
  60. package/dist/modules/easings/steps/index.cjs +2 -2
  61. package/dist/modules/easings/steps/index.js +2 -2
  62. package/dist/modules/engine/engine.cjs +2 -2
  63. package/dist/modules/engine/engine.js +2 -2
  64. package/dist/modules/engine/index.cjs +2 -2
  65. package/dist/modules/engine/index.js +2 -2
  66. package/dist/modules/events/index.cjs +2 -2
  67. package/dist/modules/events/index.js +2 -2
  68. package/dist/modules/events/scroll.cjs +2 -2
  69. package/dist/modules/events/scroll.js +2 -2
  70. package/dist/modules/index.cjs +2 -2
  71. package/dist/modules/index.js +2 -2
  72. package/dist/modules/layout/index.cjs +2 -2
  73. package/dist/modules/layout/index.js +2 -2
  74. package/dist/modules/layout/layout.cjs +437 -249
  75. package/dist/modules/layout/layout.d.ts +44 -38
  76. package/dist/modules/layout/layout.js +439 -251
  77. package/dist/modules/scope/index.cjs +2 -2
  78. package/dist/modules/scope/index.js +2 -2
  79. package/dist/modules/scope/scope.cjs +2 -2
  80. package/dist/modules/scope/scope.js +2 -2
  81. package/dist/modules/svg/drawable.cjs +2 -2
  82. package/dist/modules/svg/drawable.js +2 -2
  83. package/dist/modules/svg/helpers.cjs +2 -2
  84. package/dist/modules/svg/helpers.js +2 -2
  85. package/dist/modules/svg/index.cjs +2 -2
  86. package/dist/modules/svg/index.js +2 -2
  87. package/dist/modules/svg/morphto.cjs +2 -2
  88. package/dist/modules/svg/morphto.js +2 -2
  89. package/dist/modules/svg/motionpath.cjs +2 -2
  90. package/dist/modules/svg/motionpath.js +2 -2
  91. package/dist/modules/text/index.cjs +2 -2
  92. package/dist/modules/text/index.js +2 -2
  93. package/dist/modules/text/split.cjs +2 -2
  94. package/dist/modules/text/split.js +2 -2
  95. package/dist/modules/timeline/index.cjs +2 -2
  96. package/dist/modules/timeline/index.js +2 -2
  97. package/dist/modules/timeline/position.cjs +2 -2
  98. package/dist/modules/timeline/position.js +2 -2
  99. package/dist/modules/timeline/timeline.cjs +2 -2
  100. package/dist/modules/timeline/timeline.js +2 -2
  101. package/dist/modules/timer/index.cjs +2 -2
  102. package/dist/modules/timer/index.js +2 -2
  103. package/dist/modules/timer/timer.cjs +5 -4
  104. package/dist/modules/timer/timer.d.ts +2 -1
  105. package/dist/modules/timer/timer.js +5 -4
  106. package/dist/modules/types/index.d.ts +6 -6
  107. package/dist/modules/utils/chainable.cjs +2 -2
  108. package/dist/modules/utils/chainable.js +2 -2
  109. package/dist/modules/utils/index.cjs +2 -2
  110. package/dist/modules/utils/index.js +2 -2
  111. package/dist/modules/utils/number.cjs +2 -2
  112. package/dist/modules/utils/number.js +2 -2
  113. package/dist/modules/utils/random.cjs +2 -2
  114. package/dist/modules/utils/random.js +2 -2
  115. package/dist/modules/utils/stagger.cjs +2 -2
  116. package/dist/modules/utils/stagger.js +2 -2
  117. package/dist/modules/utils/target.cjs +2 -2
  118. package/dist/modules/utils/target.js +2 -2
  119. package/dist/modules/utils/time.cjs +2 -2
  120. package/dist/modules/utils/time.js +2 -2
  121. package/dist/modules/waapi/composition.cjs +2 -2
  122. package/dist/modules/waapi/composition.js +2 -2
  123. package/dist/modules/waapi/index.cjs +2 -2
  124. package/dist/modules/waapi/index.js +2 -2
  125. package/dist/modules/waapi/waapi.cjs +12 -7
  126. package/dist/modules/waapi/waapi.js +12 -7
  127. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Anime.js - waapi - CJS
3
- * @version v4.3.0-beta.1
3
+ * @version v4.3.0
4
4
  * @license MIT
5
- * @copyright 2025 - Julian Garnier
5
+ * @copyright 2026 - Julian Garnier
6
6
  */
7
7
 
8
8
  'use strict';
@@ -190,8 +190,6 @@ class WAAPIAnimation {
190
190
  console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`);
191
191
  }
192
192
 
193
- const ease = values.setValue(params.ease, parseWAAPIEasing(globals.globals.defaults.ease));
194
- const spring = /** @type {Spring} */(ease).ease && ease;
195
193
  const autoplay = values.setValue(params.autoplay, globals.globals.defaults.autoplay);
196
194
  const scroll = autoplay && /** @type {ScrollObserver} */(autoplay).link ? autoplay : false;
197
195
  const alternate = params.alternate && /** @type {Boolean} */(params.alternate) === true;
@@ -202,8 +200,6 @@ class WAAPIAnimation {
202
200
  const direction = alternate ? reversed ? 'alternate-reverse' : 'alternate' : reversed ? 'reverse' : 'normal';
203
201
  /** @type {FillMode} */
204
202
  const fill = 'both'; // We use 'both' here because the animation can be reversed during playback
205
- /** @type {String} */
206
- const easing = parseWAAPIEasing(ease);
207
203
  const timeScale = (globals.globals.timeScale === 1 ? 1 : consts.K);
208
204
 
209
205
  /** @type {DOMTargetsArray}] */
@@ -244,6 +240,15 @@ class WAAPIAnimation {
244
240
  const elStyle = $el.style;
245
241
  const inlineStyles = this._inlineStyles[i] = {};
246
242
 
243
+ const easeToParse = values.setValue(params.ease, globals.globals.defaults.ease);
244
+
245
+ const easeFunctionResult = values.getFunctionValue(easeToParse, $el, i, targetsLength);
246
+ const keyEasing = helpers.isFnc(easeFunctionResult) || helpers.isStr(easeFunctionResult) ? easeFunctionResult : easeToParse;
247
+
248
+ const spring = /** @type {Spring} */(easeToParse).ease && easeToParse;
249
+ /** @type {String} */
250
+ const easing = parseWAAPIEasing(keyEasing);
251
+
247
252
  /** @type {Number} */
248
253
  const duration = (spring ? /** @type {Spring} */(spring).settlingDuration : values.getFunctionValue(values.setValue(params.duration, globals.globals.defaults.duration), $el, i, targetsLength)) * timeScale;
249
254
  /** @type {Number} */
@@ -268,7 +273,7 @@ class WAAPIAnimation {
268
273
  let parsedPropertyValue;
269
274
  if (helpers.isObj(propertyValue)) {
270
275
  const tweenOptions = /** @type {WAAPITweenOptions} */(propertyValue);
271
- const tweenOptionsEase = values.setValue(tweenOptions.ease, ease);
276
+ const tweenOptionsEase = values.setValue(tweenOptions.ease, easing);
272
277
  const tweenOptionsSpring = /** @type {Spring} */(tweenOptionsEase).ease && tweenOptionsEase;
273
278
  const to = /** @type {WAAPITweenOptions} */(tweenOptions).to;
274
279
  const from = /** @type {WAAPITweenOptions} */(tweenOptions).from;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Anime.js - waapi - ESM
3
- * @version v4.3.0-beta.1
3
+ * @version v4.3.0
4
4
  * @license MIT
5
- * @copyright 2025 - Julian Garnier
5
+ * @copyright 2026 - Julian Garnier
6
6
  */
7
7
 
8
8
  import { isNil, isUnd, stringStartsWith, isKey, isObj, isArr, isStr, toLowerCase, round, isFnc, isNum } from '../core/helpers.js';
@@ -188,8 +188,6 @@ class WAAPIAnimation {
188
188
  console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`);
189
189
  }
190
190
 
191
- const ease = setValue(params.ease, parseWAAPIEasing(globals.defaults.ease));
192
- const spring = /** @type {Spring} */(ease).ease && ease;
193
191
  const autoplay = setValue(params.autoplay, globals.defaults.autoplay);
194
192
  const scroll = autoplay && /** @type {ScrollObserver} */(autoplay).link ? autoplay : false;
195
193
  const alternate = params.alternate && /** @type {Boolean} */(params.alternate) === true;
@@ -200,8 +198,6 @@ class WAAPIAnimation {
200
198
  const direction = alternate ? reversed ? 'alternate-reverse' : 'alternate' : reversed ? 'reverse' : 'normal';
201
199
  /** @type {FillMode} */
202
200
  const fill = 'both'; // We use 'both' here because the animation can be reversed during playback
203
- /** @type {String} */
204
- const easing = parseWAAPIEasing(ease);
205
201
  const timeScale = (globals.timeScale === 1 ? 1 : K);
206
202
 
207
203
  /** @type {DOMTargetsArray}] */
@@ -242,6 +238,15 @@ class WAAPIAnimation {
242
238
  const elStyle = $el.style;
243
239
  const inlineStyles = this._inlineStyles[i] = {};
244
240
 
241
+ const easeToParse = setValue(params.ease, globals.defaults.ease);
242
+
243
+ const easeFunctionResult = getFunctionValue(easeToParse, $el, i, targetsLength);
244
+ const keyEasing = isFnc(easeFunctionResult) || isStr(easeFunctionResult) ? easeFunctionResult : easeToParse;
245
+
246
+ const spring = /** @type {Spring} */(easeToParse).ease && easeToParse;
247
+ /** @type {String} */
248
+ const easing = parseWAAPIEasing(keyEasing);
249
+
245
250
  /** @type {Number} */
246
251
  const duration = (spring ? /** @type {Spring} */(spring).settlingDuration : getFunctionValue(setValue(params.duration, globals.defaults.duration), $el, i, targetsLength)) * timeScale;
247
252
  /** @type {Number} */
@@ -266,7 +271,7 @@ class WAAPIAnimation {
266
271
  let parsedPropertyValue;
267
272
  if (isObj(propertyValue)) {
268
273
  const tweenOptions = /** @type {WAAPITweenOptions} */(propertyValue);
269
- const tweenOptionsEase = setValue(tweenOptions.ease, ease);
274
+ const tweenOptionsEase = setValue(tweenOptions.ease, easing);
270
275
  const tweenOptionsSpring = /** @type {Spring} */(tweenOptionsEase).ease && tweenOptionsEase;
271
276
  const to = /** @type {WAAPITweenOptions} */(tweenOptions).to;
272
277
  const from = /** @type {WAAPITweenOptions} */(tweenOptions).from;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "animejs",
3
- "version": "4.3.0-beta.1",
3
+ "version": "4.3.0",
4
4
  "description": "JavaScript animation engine",
5
5
  "homepage": "https://animejs.com",
6
6
  "author": "Julian Garnier <julian@animejs.com>",