animejs 4.3.6 → 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 (142) hide show
  1. package/README.md +6 -9
  2. package/dist/bundles/anime.esm.js +973 -391
  3. package/dist/bundles/anime.esm.min.js +2 -2
  4. package/dist/bundles/anime.umd.js +977 -390
  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 +2 -2
  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 +38 -16
  13. package/dist/modules/animation/animation.d.ts +2 -2
  14. package/dist/modules/animation/animation.js +42 -20
  15. package/dist/modules/animation/composition.cjs +1 -1
  16. package/dist/modules/animation/composition.js +3 -3
  17. package/dist/modules/animation/index.cjs +1 -1
  18. package/dist/modules/animation/index.js +1 -1
  19. package/dist/modules/core/clock.cjs +1 -1
  20. package/dist/modules/core/clock.js +1 -1
  21. package/dist/modules/core/colors.cjs +1 -1
  22. package/dist/modules/core/colors.js +1 -1
  23. package/dist/modules/core/consts.cjs +3 -9
  24. package/dist/modules/core/consts.d.ts +1 -5
  25. package/dist/modules/core/consts.js +4 -8
  26. package/dist/modules/core/globals.cjs +16 -5
  27. package/dist/modules/core/globals.d.ts +22 -1
  28. package/dist/modules/core/globals.js +18 -6
  29. package/dist/modules/core/helpers.cjs +7 -10
  30. package/dist/modules/core/helpers.js +8 -11
  31. package/dist/modules/core/render.cjs +7 -34
  32. package/dist/modules/core/render.js +8 -35
  33. package/dist/modules/core/styles.cjs +53 -32
  34. package/dist/modules/core/styles.d.ts +1 -0
  35. package/dist/modules/core/styles.js +55 -35
  36. package/dist/modules/core/targets.cjs +1 -1
  37. package/dist/modules/core/targets.js +1 -1
  38. package/dist/modules/core/transforms.cjs +129 -13
  39. package/dist/modules/core/transforms.d.ts +1 -0
  40. package/dist/modules/core/transforms.js +130 -15
  41. package/dist/modules/core/units.cjs +1 -1
  42. package/dist/modules/core/units.js +1 -1
  43. package/dist/modules/core/values.cjs +68 -8
  44. package/dist/modules/core/values.d.ts +5 -2
  45. package/dist/modules/core/values.js +69 -11
  46. package/dist/modules/draggable/draggable.cjs +1 -1
  47. package/dist/modules/draggable/draggable.js +1 -1
  48. package/dist/modules/draggable/index.cjs +1 -1
  49. package/dist/modules/draggable/index.js +1 -1
  50. package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
  51. package/dist/modules/easings/cubic-bezier/index.js +1 -1
  52. package/dist/modules/easings/eases/index.cjs +1 -1
  53. package/dist/modules/easings/eases/index.js +1 -1
  54. package/dist/modules/easings/eases/parser.cjs +1 -1
  55. package/dist/modules/easings/eases/parser.js +1 -1
  56. package/dist/modules/easings/index.cjs +1 -1
  57. package/dist/modules/easings/index.js +1 -1
  58. package/dist/modules/easings/irregular/index.cjs +1 -1
  59. package/dist/modules/easings/irregular/index.js +1 -1
  60. package/dist/modules/easings/linear/index.cjs +1 -1
  61. package/dist/modules/easings/linear/index.js +1 -1
  62. package/dist/modules/easings/none.cjs +1 -1
  63. package/dist/modules/easings/none.js +1 -1
  64. package/dist/modules/easings/spring/index.cjs +1 -1
  65. package/dist/modules/easings/spring/index.js +1 -1
  66. package/dist/modules/easings/steps/index.cjs +1 -1
  67. package/dist/modules/easings/steps/index.js +1 -1
  68. package/dist/modules/engine/engine.cjs +1 -1
  69. package/dist/modules/engine/engine.js +1 -1
  70. package/dist/modules/engine/index.cjs +1 -1
  71. package/dist/modules/engine/index.js +1 -1
  72. package/dist/modules/events/index.cjs +1 -1
  73. package/dist/modules/events/index.js +1 -1
  74. package/dist/modules/events/scroll.cjs +1 -1
  75. package/dist/modules/events/scroll.js +1 -1
  76. package/dist/modules/index.cjs +9 -1
  77. package/dist/modules/index.d.ts +1 -0
  78. package/dist/modules/index.js +4 -1
  79. package/dist/modules/layout/index.cjs +1 -1
  80. package/dist/modules/layout/index.js +1 -1
  81. package/dist/modules/layout/layout.cjs +29 -25
  82. package/dist/modules/layout/layout.d.ts +4 -3
  83. package/dist/modules/layout/layout.js +30 -26
  84. package/dist/modules/scope/index.cjs +1 -1
  85. package/dist/modules/scope/index.js +1 -1
  86. package/dist/modules/scope/scope.cjs +1 -1
  87. package/dist/modules/scope/scope.js +1 -1
  88. package/dist/modules/svg/drawable.cjs +1 -1
  89. package/dist/modules/svg/drawable.js +1 -1
  90. package/dist/modules/svg/helpers.cjs +1 -1
  91. package/dist/modules/svg/helpers.js +1 -1
  92. package/dist/modules/svg/index.cjs +1 -1
  93. package/dist/modules/svg/index.js +1 -1
  94. package/dist/modules/svg/morphto.cjs +3 -6
  95. package/dist/modules/svg/morphto.js +3 -6
  96. package/dist/modules/svg/motionpath.cjs +1 -1
  97. package/dist/modules/svg/motionpath.js +1 -1
  98. package/dist/modules/text/index.cjs +3 -1
  99. package/dist/modules/text/index.d.ts +1 -0
  100. package/dist/modules/text/index.js +2 -1
  101. package/dist/modules/text/scramble.cjs +272 -0
  102. package/dist/modules/text/scramble.d.ts +3 -0
  103. package/dist/modules/text/scramble.js +270 -0
  104. package/dist/modules/text/split.cjs +5 -5
  105. package/dist/modules/text/split.d.ts +5 -5
  106. package/dist/modules/text/split.js +5 -5
  107. package/dist/modules/timeline/index.cjs +1 -1
  108. package/dist/modules/timeline/index.js +1 -1
  109. package/dist/modules/timeline/position.cjs +1 -1
  110. package/dist/modules/timeline/position.js +1 -1
  111. package/dist/modules/timeline/timeline.cjs +36 -18
  112. package/dist/modules/timeline/timeline.d.ts +6 -5
  113. package/dist/modules/timeline/timeline.js +37 -19
  114. package/dist/modules/timer/index.cjs +1 -1
  115. package/dist/modules/timer/index.js +1 -1
  116. package/dist/modules/timer/timer.cjs +8 -12
  117. package/dist/modules/timer/timer.d.ts +2 -0
  118. package/dist/modules/timer/timer.js +9 -13
  119. package/dist/modules/types/index.d.ts +76 -8
  120. package/dist/modules/utils/chainable.cjs +8 -5
  121. package/dist/modules/utils/chainable.js +8 -5
  122. package/dist/modules/utils/index.cjs +5 -1
  123. package/dist/modules/utils/index.d.ts +1 -0
  124. package/dist/modules/utils/index.js +2 -1
  125. package/dist/modules/utils/number.cjs +1 -1
  126. package/dist/modules/utils/number.js +1 -1
  127. package/dist/modules/utils/random.cjs +1 -1
  128. package/dist/modules/utils/random.js +1 -1
  129. package/dist/modules/utils/stagger.cjs +117 -20
  130. package/dist/modules/utils/stagger.js +118 -21
  131. package/dist/modules/utils/target.cjs +1 -1
  132. package/dist/modules/utils/target.js +1 -1
  133. package/dist/modules/utils/time.cjs +5 -3
  134. package/dist/modules/utils/time.d.ts +1 -1
  135. package/dist/modules/utils/time.js +5 -3
  136. package/dist/modules/waapi/composition.cjs +1 -1
  137. package/dist/modules/waapi/composition.js +1 -1
  138. package/dist/modules/waapi/index.cjs +1 -1
  139. package/dist/modules/waapi/index.js +1 -1
  140. package/dist/modules/waapi/waapi.cjs +19 -20
  141. package/dist/modules/waapi/waapi.js +20 -21
  142. package/package.json +2 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - easings - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - engine - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - engine - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - engine - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - engine - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - events - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - events - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - events - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - events - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -21,12 +21,14 @@ var index$1 = require('./utils/index.cjs');
21
21
  var index$2 = require('./svg/index.cjs');
22
22
  var index$3 = require('./text/index.cjs');
23
23
  var waapi = require('./waapi/waapi.cjs');
24
+ var globals = require('./core/globals.cjs');
24
25
  var index$4 = require('./easings/cubic-bezier/index.cjs');
25
26
  var index$5 = require('./easings/steps/index.cjs');
26
27
  var index$6 = require('./easings/linear/index.cjs');
27
28
  var index$7 = require('./easings/irregular/index.cjs');
28
29
  var index$8 = require('./easings/spring/index.cjs');
29
30
  var parser = require('./easings/eases/parser.cjs');
31
+ var helpers = require('./core/helpers.cjs');
30
32
  var chainable = require('./utils/chainable.cjs');
31
33
  var random = require('./utils/random.cjs');
32
34
  var time = require('./utils/time.cjs');
@@ -38,6 +40,7 @@ var motionpath = require('./svg/motionpath.cjs');
38
40
  var drawable = require('./svg/drawable.cjs');
39
41
  var morphto = require('./svg/morphto.cjs');
40
42
  var split = require('./text/split.cjs');
43
+ var scramble = require('./text/scramble.cjs');
41
44
 
42
45
 
43
46
 
@@ -65,6 +68,7 @@ exports.svg = index$2;
65
68
  exports.text = index$3;
66
69
  exports.WAAPIAnimation = waapi.WAAPIAnimation;
67
70
  exports.waapi = waapi.waapi;
71
+ exports.globals = globals.globals;
68
72
  exports.cubicBezier = index$4.cubicBezier;
69
73
  exports.steps = index$5.steps;
70
74
  exports.linear = index$6.linear;
@@ -73,6 +77,9 @@ exports.Spring = index$8.Spring;
73
77
  exports.createSpring = index$8.createSpring;
74
78
  exports.spring = index$8.spring;
75
79
  exports.eases = parser.eases;
80
+ exports.addChild = helpers.addChild;
81
+ exports.forEachChildren = helpers.forEachChildren;
82
+ exports.removeChild = helpers.removeChild;
76
83
  exports.clamp = chainable.clamp;
77
84
  exports.damp = chainable.damp;
78
85
  exports.degToRad = chainable.degToRad;
@@ -103,3 +110,4 @@ exports.morphTo = morphto.morphTo;
103
110
  exports.TextSplitter = split.TextSplitter;
104
111
  exports.split = split.split;
105
112
  exports.splitText = split.splitText;
113
+ exports.scrambleText = scramble.scrambleText;
@@ -17,3 +17,4 @@ export * as easings from "./easings/index.js";
17
17
  export * as utils from "./utils/index.js";
18
18
  export * as svg from "./svg/index.js";
19
19
  export * as text from "./text/index.js";
20
+ export { globals } from "./core/globals.js";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -23,12 +23,14 @@ export { index$2 as svg };
23
23
  import * as index$3 from './text/index.js';
24
24
  export { index$3 as text };
25
25
  export { WAAPIAnimation, waapi } from './waapi/waapi.js';
26
+ export { globals } from './core/globals.js';
26
27
  export { cubicBezier } from './easings/cubic-bezier/index.js';
27
28
  export { steps } from './easings/steps/index.js';
28
29
  export { linear } from './easings/linear/index.js';
29
30
  export { irregular } from './easings/irregular/index.js';
30
31
  export { Spring, createSpring, spring } from './easings/spring/index.js';
31
32
  export { eases } from './easings/eases/parser.js';
33
+ export { addChild, forEachChildren, removeChild } from './core/helpers.js';
32
34
  export { clamp, damp, degToRad, lerp, mapRange, padEnd, padStart, radToDeg, round, roundPad, snap, wrap } from './utils/chainable.js';
33
35
  export { createSeededRandom, random, randomPick, shuffle } from './utils/random.js';
34
36
  export { keepTime, sync } from './utils/time.js';
@@ -40,3 +42,4 @@ export { createMotionPath } from './svg/motionpath.js';
40
42
  export { createDrawable } from './svg/drawable.js';
41
43
  export { morphTo } from './svg/morphto.js';
42
44
  export { TextSplitter, split, splitText } from './text/split.js';
45
+ export { scrambleText } from './text/scramble.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - layout - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - layout - ESM
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Anime.js - layout - CJS
3
- * @version v4.3.6
3
+ * @version v4.4.1
4
4
  * @license MIT
5
5
  * @copyright 2026 - Julian Garnier
6
6
  */
@@ -79,6 +79,7 @@ var globals = require('../core/globals.cjs');
79
79
 
80
80
  /**
81
81
  * @typedef {Object} LayoutSpecificAnimationParams
82
+ * @property {Number|String} [id]
82
83
  * @property {Number|FunctionValue} [delay]
83
84
  * @property {Number|FunctionValue} [duration]
84
85
  * @property {EasingParam|FunctionValue} [ease]
@@ -121,7 +122,7 @@ var globals = require('../core/globals.cjs');
121
122
  * @property {String} id
122
123
  * @property {DOMTarget} $el
123
124
  * @property {Number} index
124
- * @property {Number} total
125
+ * @property {Array<DOMTarget>} targets
125
126
  * @property {Number} delay
126
127
  * @property {Number} duration
127
128
  * @property {EasingParam} ease
@@ -265,7 +266,7 @@ const createNode = ($el, parentNode, state, recycledNode) => {
265
266
  node.$measure = $el;
266
267
  node.id = dataId;
267
268
  node.index = 0;
268
- node.total = 1;
269
+ node.targets = null;
269
270
  node.delay = 0;
270
271
  node.duration = 0;
271
272
  node.ease = null;
@@ -451,12 +452,12 @@ const updateNodeProperties = (node, props) => {
451
452
  * @param {LayoutAnimationTimingsParams} params
452
453
  */
453
454
  const updateNodeTimingParams = (node, params) => {
454
- const easeFunctionResult = values.getFunctionValue(params.ease, node.$el, node.index, node.total);
455
+ const easeFunctionResult = values.getFunctionValue(params.ease, node.$el, node.index, node.targets, null, null);
455
456
  const keyEasing = helpers.isFnc(easeFunctionResult) ? easeFunctionResult : params.ease;
456
457
  const hasSpring = !helpers.isUnd(keyEasing) && !helpers.isUnd(/** @type {Spring} */(keyEasing).ease);
457
458
  node.ease = hasSpring ? /** @type {Spring} */(keyEasing).ease : keyEasing;
458
- node.duration = hasSpring ? /** @type {Spring} */(keyEasing).settlingDuration : values.getFunctionValue(params.duration, node.$el, node.index, node.total);
459
- node.delay = values.getFunctionValue(params.delay, node.$el, node.index, node.total);
459
+ node.duration = hasSpring ? /** @type {Spring} */(keyEasing).settlingDuration : values.getFunctionValue(params.duration, node.$el, node.index, node.targets, null, null);
460
+ node.delay = values.getFunctionValue(params.delay, node.$el, node.index, node.targets, null, null);
460
461
  };
461
462
 
462
463
  /**
@@ -829,10 +830,12 @@ class LayoutSnapshot {
829
830
 
830
831
  const inRootNodeIds = new Set();
831
832
  // Update index and total for inital timing calculation
832
- let index = 0, total = this.nodes.size;
833
+ let index = 0;
834
+ const allNodeTargets = [];
835
+ this.nodes.forEach((node) => { allNodeTargets.push(node.$el); });
833
836
  this.nodes.forEach((node, id) => {
834
837
  node.index = index++;
835
- node.total = total;
838
+ node.targets = allNodeTargets;
836
839
  // Track ids of nodes that belong to the current root to filter detached matches
837
840
  if (node && node.measuredIsInsideRoot) {
838
841
  inRootNodeIds.add(id);
@@ -944,8 +947,8 @@ class AutoLayout {
944
947
  this.params = params;
945
948
  /** @type {DOMTarget} */
946
949
  this.root = /** @type {DOMTarget} */(targets.registerTargets(root)[0]);
947
- /** @type {Number} */
948
- this.id = layoutId++;
950
+ /** @type {Number|String} */
951
+ this.id = params.id || layoutId++;
949
952
  /** @type {LayoutChildrenParam} */
950
953
  this.children = params.children || '*';
951
954
  /** @type {Boolean} */
@@ -1068,7 +1071,9 @@ class AutoLayout {
1068
1071
  duration: values.setValue(params.duration, this.params.duration),
1069
1072
  };
1070
1073
  /** @type {TimelineParams} */
1071
- const tlParams = {};
1074
+ const tlParams = {
1075
+ id: this.id
1076
+ };
1072
1077
  const onComplete = values.setValue(params.onComplete, this.params.onComplete);
1073
1078
  const onPause = values.setValue(params.onPause, this.params.onPause);
1074
1079
  for (let name in globals.defaults) {
@@ -1082,7 +1087,8 @@ class AutoLayout {
1082
1087
  }
1083
1088
  tlParams.onComplete = () => {
1084
1089
  const ap = /** @type {ScrollObserver} */(params.autoplay);
1085
- const isScrollControled = ap && ap.linked;
1090
+ const ed = globals.globals.editor;
1091
+ const isScrollControled = (ap && ap.linked) || (ed && ed.showPanel);
1086
1092
  if (isScrollControled) {
1087
1093
  if (onComplete) onComplete(this.timeline);
1088
1094
  return;
@@ -1281,41 +1287,39 @@ class AutoLayout {
1281
1287
  animatedParent = animatedParent.parentNode;
1282
1288
  }
1283
1289
 
1284
- const animatingTotal = animating.length;
1285
-
1286
1290
  // Root is always animated first in sync with the first child (animating.length is the total of children)
1287
1291
  if (node === rootNode) {
1288
1292
  node.index = 0;
1289
- node.total = animatingTotal;
1293
+ node.targets = animating;
1290
1294
  updateNodeTimingParams(node, animationTimings);
1291
1295
  } else if (node.isEntering) {
1292
1296
  node.index = animatedParent ? animatedParent.index : enteringIndex;
1293
- node.total = animatedParent ? animatingTotal : entering.length;
1297
+ node.targets = animatedParent ? animating : entering;
1294
1298
  updateNodeTimingParams(node, enterFromTimings);
1295
1299
  enteringIndex++;
1296
1300
  } else if (node.isLeaving) {
1297
1301
  node.index = animatedParent ? animatedParent.index : leavingIndex;
1298
- node.total = animatedParent ? animatingTotal : leaving.length;
1302
+ node.targets = animatedParent ? animating : leaving;
1299
1303
  leavingIndex++;
1300
1304
  updateNodeTimingParams(node, leaveToTimings);
1301
1305
  } else if (node.isTarget) {
1302
1306
  node.index = animatingIndex++;
1303
- node.total = animatingTotal;
1307
+ node.targets = animating;
1304
1308
  updateNodeTimingParams(node, animationTimings);
1305
1309
  } else {
1306
1310
  node.index = animatedParent ? animatedParent.index : 0;
1307
- node.total = animatingTotal;
1311
+ node.targets = animating;
1308
1312
  updateNodeTimingParams(node, swapAtTimings);
1309
1313
  }
1310
1314
 
1311
1315
  // Make sure the old state node has its inex and total values up to date for valid "from" function values calculation
1312
1316
  oldStateNode.index = node.index;
1313
- oldStateNode.total = node.total;
1317
+ oldStateNode.targets = node.targets;
1314
1318
 
1315
1319
  // Computes all values up front so we can check for changes and we don't have to re-compute them inside the animation props
1316
1320
  for (let prop in nodeProperties) {
1317
- nodeProperties[prop] = values.getFunctionValue(nodeProperties[prop], $el, node.index, node.total);
1318
- oldStateNodeProperties[prop] = values.getFunctionValue(oldStateNodeProperties[prop], $el, oldStateNode.index, oldStateNode.total);
1321
+ nodeProperties[prop] = values.getFunctionValue(nodeProperties[prop], $el, node.index, node.targets, null, null);
1322
+ oldStateNodeProperties[prop] = values.getFunctionValue(oldStateNodeProperties[prop], $el, oldStateNode.index, oldStateNode.targets, null, null);
1319
1323
  }
1320
1324
 
1321
1325
  // Use a 1px tolerance to detect dimensions changes to prevent width / height animations on barelly visible elements
@@ -1541,8 +1545,8 @@ class AutoLayout {
1541
1545
  }
1542
1546
  $el.style.transform = oldState.getComputedValue($el, 'transform');
1543
1547
  if (animatedSwap.includes($el)) {
1544
- node.ease = values.getFunctionValue(swapAtParams.ease, $el, node.index, node.total);
1545
- node.duration = values.getFunctionValue(swapAtParams.duration, $el, node.index, node.total);
1548
+ node.ease = values.getFunctionValue(swapAtParams.ease, $el, node.index, node.targets, null, null);
1549
+ node.duration = values.getFunctionValue(swapAtParams.duration, $el, node.index, node.targets, null, null);
1546
1550
  }
1547
1551
  }
1548
1552
  this.transformAnimation = waapi.waapi.animate(transformed, {
@@ -1557,7 +1561,7 @@ class AutoLayout {
1557
1561
  if (!animatedSwap.includes($el)) return newValue;
1558
1562
  const oldValue = oldState.getComputedValue($el, 'transform');
1559
1563
  const node = newState.getNode($el);
1560
- return [oldValue, values.getFunctionValue(swapAtProps.transform, $el, node.index, node.total), newValue]
1564
+ return [oldValue, values.getFunctionValue(swapAtProps.transform, $el, node.index, node.targets, null, null), newValue]
1561
1565
  },
1562
1566
  autoplay: false,
1563
1567
  // persist: true,
@@ -8,8 +8,8 @@ export class AutoLayout {
8
8
  params: AutoLayoutParams;
9
9
  /** @type {DOMTarget} */
10
10
  root: DOMTarget;
11
- /** @type {Number} */
12
- id: number;
11
+ /** @type {Number|String} */
12
+ id: number | string;
13
13
  /** @type {LayoutChildrenParam} */
14
14
  children: LayoutChildrenParam;
15
15
  /** @type {Boolean} */
@@ -74,6 +74,7 @@ export type LayoutAnimationTimingsParams = {
74
74
  export type LayoutStateAnimationProperties = Record<string, number | string | FunctionValue>;
75
75
  export type LayoutStateParams = LayoutStateAnimationProperties & LayoutAnimationTimingsParams;
76
76
  export type LayoutSpecificAnimationParams = {
77
+ id?: number | string;
77
78
  delay?: number | FunctionValue;
78
79
  duration?: number | FunctionValue;
79
80
  ease?: EasingParam | FunctionValue;
@@ -103,7 +104,7 @@ export type LayoutNode = {
103
104
  id: string;
104
105
  $el: DOMTarget;
105
106
  index: number;
106
- total: number;
107
+ targets: Array<DOMTarget>;
107
108
  delay: number;
108
109
  duration: number;
109
110
  ease: EasingParam;