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
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - UMD bundle
3
- * @version v4.4.0
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -841,7 +841,7 @@
841
841
  editor: null,
842
842
  };
843
843
 
844
- const globalVersions = { version: '4.4.0', engine: null };
844
+ const globalVersions = { version: '4.4.1', engine: null };
845
845
 
846
846
  if (isBrowser) {
847
847
  if (!win.AnimeJS) win.AnimeJS = [];
@@ -1836,50 +1836,6 @@
1836
1836
  return hasRendered;
1837
1837
  };
1838
1838
 
1839
- // Shared context for extracted forEachChildren callbacks in tick()
1840
- // Avoids closure allocation every frame
1841
-
1842
- let renderCtxChildrenTime = 0;
1843
- let renderCtxTlFps = 0;
1844
- let renderCtxTickTime = 0;
1845
- let renderCtxTickMode = 0;
1846
- let renderCtxMuteCallbacks = 0;
1847
- let renderCtxInternalRender = 0;
1848
- let renderCtxChildrenHasRendered = 0;
1849
- let renderCtxChildrenHaveCompleted = true;
1850
- let loopCtxIsRunningBackwards = false;
1851
- let loopCtxIterationDuration = 0;
1852
- let loopCtxMuteCallbacks = 0;
1853
-
1854
- /** @param {JSAnimation} child */
1855
- const tickLoopChild = (child) => {
1856
- if (!loopCtxIsRunningBackwards) {
1857
- // Force an internal render to trigger the callbacks if the child has not completed on loop
1858
- if (!child.completed && !child.backwards && child._currentTime < child.iterationDuration) {
1859
- render(child, loopCtxIterationDuration, loopCtxMuteCallbacks, 1, tickModes.FORCE);
1860
- }
1861
- // Reset their began and completed flags to allow retrigering callbacks on the next iteration
1862
- child.began = false;
1863
- child.completed = false;
1864
- } else {
1865
- const childDuration = child.duration;
1866
- const childStartTime = child._offset + child._delay;
1867
- const childEndTime = childStartTime + childDuration;
1868
- // Triggers the onComplete callback on reverse for children on the edges of the timeline
1869
- if (!loopCtxMuteCallbacks && childDuration <= minValue && (!childStartTime || childEndTime === loopCtxIterationDuration)) {
1870
- child.onComplete(child);
1871
- }
1872
- }
1873
- };
1874
-
1875
- /** @param {JSAnimation} child */
1876
- const tickRenderChild = (child) => {
1877
- const childTime = round$1((renderCtxChildrenTime - child._offset) * child._speed, 12); // Rounding is needed when using seconds
1878
- const childTickMode = child._fps < renderCtxTlFps ? child.requestTick(renderCtxTickTime) : renderCtxTickMode;
1879
- renderCtxChildrenHasRendered += render(child, childTime, renderCtxMuteCallbacks, renderCtxInternalRender, childTickMode);
1880
- if (!child.completed && renderCtxChildrenHaveCompleted) renderCtxChildrenHaveCompleted = false;
1881
- };
1882
-
1883
1839
  /**
1884
1840
  * @param {Tickable} tickable
1885
1841
  * @param {Number} time
@@ -1896,28 +1852,42 @@
1896
1852
  const tlIsRunningBackwards = tl.backwards;
1897
1853
  const tlChildrenTime = internalRender ? time : tl._iterationTime;
1898
1854
  const tlCildrenTickTime = now();
1855
+
1899
1856
  let tlChildrenHasRendered = 0;
1900
1857
  let tlChildrenHaveCompleted = true;
1858
+
1901
1859
  // If the timeline has looped forward, we need to manually triggers children skipped callbacks
1902
1860
  if (!internalRender && tl._currentIteration !== _currentIteration) {
1903
1861
  const tlIterationDuration = tl.iterationDuration;
1904
- loopCtxIsRunningBackwards = tlIsRunningBackwards;
1905
- loopCtxIterationDuration = tlIterationDuration;
1906
- loopCtxMuteCallbacks = muteCallbacks;
1907
- forEachChildren(tl, tickLoopChild);
1862
+ forEachChildren(tl, (/** @type {JSAnimation} */child) => {
1863
+ if (!tlIsRunningBackwards) {
1864
+ // Force an internal render to trigger the callbacks if the child has not completed on loop
1865
+ if (!child.completed && !child.backwards && child._currentTime < child.iterationDuration) {
1866
+ render(child, tlIterationDuration, muteCallbacks, 1, tickModes.FORCE);
1867
+ }
1868
+ // Reset their began and completed flags to allow retrigering callbacks on the next iteration
1869
+ child.began = false;
1870
+ child.completed = false;
1871
+ } else {
1872
+ const childDuration = child.duration;
1873
+ const childStartTime = child._offset + child._delay;
1874
+ const childEndTime = childStartTime + childDuration;
1875
+ // Triggers the onComplete callback on reverse for children on the edges of the timeline
1876
+ if (!muteCallbacks && childDuration <= minValue && (!childStartTime || childEndTime === tlIterationDuration)) {
1877
+ child.onComplete(child);
1878
+ }
1879
+ }
1880
+ });
1908
1881
  if (!muteCallbacks) tl.onLoop(/** @type {CallbackArgument} */(tl));
1909
1882
  }
1910
- renderCtxChildrenTime = tlChildrenTime;
1911
- renderCtxTlFps = tl._fps;
1912
- renderCtxTickTime = tlCildrenTickTime;
1913
- renderCtxTickMode = tickMode;
1914
- renderCtxMuteCallbacks = muteCallbacks;
1915
- renderCtxInternalRender = internalRender;
1916
- renderCtxChildrenHasRendered = 0;
1917
- renderCtxChildrenHaveCompleted = true;
1918
- forEachChildren(tl, tickRenderChild, tlIsRunningBackwards);
1919
- tlChildrenHasRendered = renderCtxChildrenHasRendered;
1920
- tlChildrenHaveCompleted = renderCtxChildrenHaveCompleted;
1883
+
1884
+ forEachChildren(tl, (/** @type {JSAnimation} */child) => {
1885
+ const childTime = round$1((tlChildrenTime - child._offset) * child._speed, 12); // Rounding is needed when using seconds
1886
+ const childTickMode = child._fps < tl._fps ? child.requestTick(tlCildrenTickTime) : tickMode;
1887
+ tlChildrenHasRendered += render(child, childTime, muteCallbacks, internalRender, childTickMode);
1888
+ if (!child.completed && tlChildrenHaveCompleted) tlChildrenHaveCompleted = false;
1889
+ }, tlIsRunningBackwards);
1890
+
1921
1891
  // Renders on timeline are triggered by its children so it needs to be set after rendering the children
1922
1892
  if (!muteCallbacks && tlChildrenHasRendered) tl.onRender(/** @type {CallbackArgument} */(tl));
1923
1893
  // Triggers the timeline onComplete() once all chindren all completed and the current time has reached the end