animejs 4.4.0 → 4.4.1

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 (126) hide show
  1. package/README.md +2 -2
  2. package/dist/bundles/anime.esm.js +31 -61
  3. package/dist/bundles/anime.esm.min.js +2 -2
  4. package/dist/bundles/anime.umd.js +31 -61
  5. package/dist/bundles/anime.umd.min.js +2 -2
  6. package/dist/modules/animatable/animatable.cjs +1 -1
  7. package/dist/modules/animatable/animatable.js +1 -1
  8. package/dist/modules/animatable/index.cjs +1 -1
  9. package/dist/modules/animatable/index.js +1 -1
  10. package/dist/modules/animation/additive.cjs +1 -1
  11. package/dist/modules/animation/additive.js +1 -1
  12. package/dist/modules/animation/animation.cjs +1 -1
  13. package/dist/modules/animation/animation.js +1 -1
  14. package/dist/modules/animation/composition.cjs +1 -1
  15. package/dist/modules/animation/composition.js +1 -1
  16. package/dist/modules/animation/index.cjs +1 -1
  17. package/dist/modules/animation/index.js +1 -1
  18. package/dist/modules/core/clock.cjs +1 -1
  19. package/dist/modules/core/clock.js +1 -1
  20. package/dist/modules/core/colors.cjs +1 -1
  21. package/dist/modules/core/colors.js +1 -1
  22. package/dist/modules/core/consts.cjs +1 -1
  23. package/dist/modules/core/consts.js +1 -1
  24. package/dist/modules/core/globals.cjs +2 -2
  25. package/dist/modules/core/globals.js +2 -2
  26. package/dist/modules/core/helpers.cjs +1 -1
  27. package/dist/modules/core/helpers.js +1 -1
  28. package/dist/modules/core/render.cjs +30 -60
  29. package/dist/modules/core/render.js +32 -62
  30. package/dist/modules/core/styles.cjs +1 -1
  31. package/dist/modules/core/styles.js +1 -1
  32. package/dist/modules/core/targets.cjs +1 -1
  33. package/dist/modules/core/targets.js +1 -1
  34. package/dist/modules/core/transforms.cjs +1 -1
  35. package/dist/modules/core/transforms.js +1 -1
  36. package/dist/modules/core/units.cjs +1 -1
  37. package/dist/modules/core/units.js +1 -1
  38. package/dist/modules/core/values.cjs +1 -1
  39. package/dist/modules/core/values.js +1 -1
  40. package/dist/modules/draggable/draggable.cjs +1 -1
  41. package/dist/modules/draggable/draggable.js +1 -1
  42. package/dist/modules/draggable/index.cjs +1 -1
  43. package/dist/modules/draggable/index.js +1 -1
  44. package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
  45. package/dist/modules/easings/cubic-bezier/index.js +1 -1
  46. package/dist/modules/easings/eases/index.cjs +1 -1
  47. package/dist/modules/easings/eases/index.js +1 -1
  48. package/dist/modules/easings/eases/parser.cjs +1 -1
  49. package/dist/modules/easings/eases/parser.js +1 -1
  50. package/dist/modules/easings/index.cjs +1 -1
  51. package/dist/modules/easings/index.js +1 -1
  52. package/dist/modules/easings/irregular/index.cjs +1 -1
  53. package/dist/modules/easings/irregular/index.js +1 -1
  54. package/dist/modules/easings/linear/index.cjs +1 -1
  55. package/dist/modules/easings/linear/index.js +1 -1
  56. package/dist/modules/easings/none.cjs +1 -1
  57. package/dist/modules/easings/none.js +1 -1
  58. package/dist/modules/easings/spring/index.cjs +1 -1
  59. package/dist/modules/easings/spring/index.js +1 -1
  60. package/dist/modules/easings/steps/index.cjs +1 -1
  61. package/dist/modules/easings/steps/index.js +1 -1
  62. package/dist/modules/engine/engine.cjs +1 -1
  63. package/dist/modules/engine/engine.js +1 -1
  64. package/dist/modules/engine/index.cjs +1 -1
  65. package/dist/modules/engine/index.js +1 -1
  66. package/dist/modules/events/index.cjs +1 -1
  67. package/dist/modules/events/index.js +1 -1
  68. package/dist/modules/events/scroll.cjs +1 -1
  69. package/dist/modules/events/scroll.js +1 -1
  70. package/dist/modules/index.cjs +1 -1
  71. package/dist/modules/index.js +1 -1
  72. package/dist/modules/layout/index.cjs +1 -1
  73. package/dist/modules/layout/index.js +1 -1
  74. package/dist/modules/layout/layout.cjs +1 -1
  75. package/dist/modules/layout/layout.js +1 -1
  76. package/dist/modules/scope/index.cjs +1 -1
  77. package/dist/modules/scope/index.js +1 -1
  78. package/dist/modules/scope/scope.cjs +1 -1
  79. package/dist/modules/scope/scope.js +1 -1
  80. package/dist/modules/svg/drawable.cjs +1 -1
  81. package/dist/modules/svg/drawable.js +1 -1
  82. package/dist/modules/svg/helpers.cjs +1 -1
  83. package/dist/modules/svg/helpers.js +1 -1
  84. package/dist/modules/svg/index.cjs +1 -1
  85. package/dist/modules/svg/index.js +1 -1
  86. package/dist/modules/svg/morphto.cjs +1 -1
  87. package/dist/modules/svg/morphto.js +1 -1
  88. package/dist/modules/svg/motionpath.cjs +1 -1
  89. package/dist/modules/svg/motionpath.js +1 -1
  90. package/dist/modules/text/index.cjs +1 -1
  91. package/dist/modules/text/index.js +1 -1
  92. package/dist/modules/text/scramble.cjs +1 -1
  93. package/dist/modules/text/scramble.js +1 -1
  94. package/dist/modules/text/split.cjs +1 -1
  95. package/dist/modules/text/split.js +1 -1
  96. package/dist/modules/timeline/index.cjs +1 -1
  97. package/dist/modules/timeline/index.js +1 -1
  98. package/dist/modules/timeline/position.cjs +1 -1
  99. package/dist/modules/timeline/position.js +1 -1
  100. package/dist/modules/timeline/timeline.cjs +1 -1
  101. package/dist/modules/timeline/timeline.js +1 -1
  102. package/dist/modules/timer/index.cjs +1 -1
  103. package/dist/modules/timer/index.js +1 -1
  104. package/dist/modules/timer/timer.cjs +1 -1
  105. package/dist/modules/timer/timer.js +1 -1
  106. package/dist/modules/utils/chainable.cjs +1 -1
  107. package/dist/modules/utils/chainable.js +1 -1
  108. package/dist/modules/utils/index.cjs +1 -1
  109. package/dist/modules/utils/index.js +1 -1
  110. package/dist/modules/utils/number.cjs +1 -1
  111. package/dist/modules/utils/number.js +1 -1
  112. package/dist/modules/utils/random.cjs +1 -1
  113. package/dist/modules/utils/random.js +1 -1
  114. package/dist/modules/utils/stagger.cjs +1 -1
  115. package/dist/modules/utils/stagger.js +1 -1
  116. package/dist/modules/utils/target.cjs +1 -1
  117. package/dist/modules/utils/target.js +1 -1
  118. package/dist/modules/utils/time.cjs +1 -1
  119. package/dist/modules/utils/time.js +1 -1
  120. package/dist/modules/waapi/composition.cjs +1 -1
  121. package/dist/modules/waapi/composition.js +1 -1
  122. package/dist/modules/waapi/index.cjs +1 -1
  123. package/dist/modules/waapi/index.js +1 -1
  124. package/dist/modules/waapi/waapi.cjs +1 -1
  125. package/dist/modules/waapi/waapi.js +1 -1
  126. package/package.json +1 -1
package/README.md CHANGED
@@ -69,14 +69,14 @@ Help the project become sustainable by sponsoring us on <a target="_blank" href=
69
69
  </picture>
70
70
  </a>
71
71
  </td>
72
- </td>
72
+ <td>
73
73
  <a target="_blank" href="https://github.com/sponsors/juliangarnier">
74
74
  <picture>
75
75
  <img align="center" src="./assets/sponsors/placeholder-small.png?v=200126" width="141">
76
76
  </picture>
77
77
  </a>
78
78
  </td>
79
- </td>
79
+ <td>
80
80
  <a target="_blank" href="https://github.com/sponsors/juliangarnier">
81
81
  <picture>
82
82
  <img align="center" src="./assets/sponsors/placeholder-small.png?v=200126" width="141">
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - ESM bundle
3
- * @version v4.4.0
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -835,7 +835,7 @@ const globals = {
835
835
  editor: null,
836
836
  };
837
837
 
838
- const globalVersions = { version: '4.4.0', engine: null };
838
+ const globalVersions = { version: '4.4.1', engine: null };
839
839
 
840
840
  if (isBrowser) {
841
841
  if (!win.AnimeJS) win.AnimeJS = [];
@@ -1830,50 +1830,6 @@ const render = (tickable, time, muteCallbacks, internalRender, tickMode) => {
1830
1830
  return hasRendered;
1831
1831
  };
1832
1832
 
1833
- // Shared context for extracted forEachChildren callbacks in tick()
1834
- // Avoids closure allocation every frame
1835
-
1836
- let renderCtxChildrenTime = 0;
1837
- let renderCtxTlFps = 0;
1838
- let renderCtxTickTime = 0;
1839
- let renderCtxTickMode = 0;
1840
- let renderCtxMuteCallbacks = 0;
1841
- let renderCtxInternalRender = 0;
1842
- let renderCtxChildrenHasRendered = 0;
1843
- let renderCtxChildrenHaveCompleted = true;
1844
- let loopCtxIsRunningBackwards = false;
1845
- let loopCtxIterationDuration = 0;
1846
- let loopCtxMuteCallbacks = 0;
1847
-
1848
- /** @param {JSAnimation} child */
1849
- const tickLoopChild = (child) => {
1850
- if (!loopCtxIsRunningBackwards) {
1851
- // Force an internal render to trigger the callbacks if the child has not completed on loop
1852
- if (!child.completed && !child.backwards && child._currentTime < child.iterationDuration) {
1853
- render(child, loopCtxIterationDuration, loopCtxMuteCallbacks, 1, tickModes.FORCE);
1854
- }
1855
- // Reset their began and completed flags to allow retrigering callbacks on the next iteration
1856
- child.began = false;
1857
- child.completed = false;
1858
- } else {
1859
- const childDuration = child.duration;
1860
- const childStartTime = child._offset + child._delay;
1861
- const childEndTime = childStartTime + childDuration;
1862
- // Triggers the onComplete callback on reverse for children on the edges of the timeline
1863
- if (!loopCtxMuteCallbacks && childDuration <= minValue && (!childStartTime || childEndTime === loopCtxIterationDuration)) {
1864
- child.onComplete(child);
1865
- }
1866
- }
1867
- };
1868
-
1869
- /** @param {JSAnimation} child */
1870
- const tickRenderChild = (child) => {
1871
- const childTime = round$1((renderCtxChildrenTime - child._offset) * child._speed, 12); // Rounding is needed when using seconds
1872
- const childTickMode = child._fps < renderCtxTlFps ? child.requestTick(renderCtxTickTime) : renderCtxTickMode;
1873
- renderCtxChildrenHasRendered += render(child, childTime, renderCtxMuteCallbacks, renderCtxInternalRender, childTickMode);
1874
- if (!child.completed && renderCtxChildrenHaveCompleted) renderCtxChildrenHaveCompleted = false;
1875
- };
1876
-
1877
1833
  /**
1878
1834
  * @param {Tickable} tickable
1879
1835
  * @param {Number} time
@@ -1890,28 +1846,42 @@ const tick = (tickable, time, muteCallbacks, internalRender, tickMode) => {
1890
1846
  const tlIsRunningBackwards = tl.backwards;
1891
1847
  const tlChildrenTime = internalRender ? time : tl._iterationTime;
1892
1848
  const tlCildrenTickTime = now();
1849
+
1893
1850
  let tlChildrenHasRendered = 0;
1894
1851
  let tlChildrenHaveCompleted = true;
1852
+
1895
1853
  // If the timeline has looped forward, we need to manually triggers children skipped callbacks
1896
1854
  if (!internalRender && tl._currentIteration !== _currentIteration) {
1897
1855
  const tlIterationDuration = tl.iterationDuration;
1898
- loopCtxIsRunningBackwards = tlIsRunningBackwards;
1899
- loopCtxIterationDuration = tlIterationDuration;
1900
- loopCtxMuteCallbacks = muteCallbacks;
1901
- forEachChildren(tl, tickLoopChild);
1856
+ forEachChildren(tl, (/** @type {JSAnimation} */child) => {
1857
+ if (!tlIsRunningBackwards) {
1858
+ // Force an internal render to trigger the callbacks if the child has not completed on loop
1859
+ if (!child.completed && !child.backwards && child._currentTime < child.iterationDuration) {
1860
+ render(child, tlIterationDuration, muteCallbacks, 1, tickModes.FORCE);
1861
+ }
1862
+ // Reset their began and completed flags to allow retrigering callbacks on the next iteration
1863
+ child.began = false;
1864
+ child.completed = false;
1865
+ } else {
1866
+ const childDuration = child.duration;
1867
+ const childStartTime = child._offset + child._delay;
1868
+ const childEndTime = childStartTime + childDuration;
1869
+ // Triggers the onComplete callback on reverse for children on the edges of the timeline
1870
+ if (!muteCallbacks && childDuration <= minValue && (!childStartTime || childEndTime === tlIterationDuration)) {
1871
+ child.onComplete(child);
1872
+ }
1873
+ }
1874
+ });
1902
1875
  if (!muteCallbacks) tl.onLoop(/** @type {CallbackArgument} */(tl));
1903
1876
  }
1904
- renderCtxChildrenTime = tlChildrenTime;
1905
- renderCtxTlFps = tl._fps;
1906
- renderCtxTickTime = tlCildrenTickTime;
1907
- renderCtxTickMode = tickMode;
1908
- renderCtxMuteCallbacks = muteCallbacks;
1909
- renderCtxInternalRender = internalRender;
1910
- renderCtxChildrenHasRendered = 0;
1911
- renderCtxChildrenHaveCompleted = true;
1912
- forEachChildren(tl, tickRenderChild, tlIsRunningBackwards);
1913
- tlChildrenHasRendered = renderCtxChildrenHasRendered;
1914
- tlChildrenHaveCompleted = renderCtxChildrenHaveCompleted;
1877
+
1878
+ forEachChildren(tl, (/** @type {JSAnimation} */child) => {
1879
+ const childTime = round$1((tlChildrenTime - child._offset) * child._speed, 12); // Rounding is needed when using seconds
1880
+ const childTickMode = child._fps < tl._fps ? child.requestTick(tlCildrenTickTime) : tickMode;
1881
+ tlChildrenHasRendered += render(child, childTime, muteCallbacks, internalRender, childTickMode);
1882
+ if (!child.completed && tlChildrenHaveCompleted) tlChildrenHaveCompleted = false;
1883
+ }, tlIsRunningBackwards);
1884
+
1915
1885
  // Renders on timeline are triggered by its children so it needs to be set after rendering the children
1916
1886
  if (!muteCallbacks && tlChildrenHasRendered) tl.onRender(/** @type {CallbackArgument} */(tl));
1917
1887
  // Triggers the timeline onComplete() once all chindren all completed and the current time has reached the end