animejs 4.3.0-beta.2 → 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 +446 -245
  3. package/dist/bundles/anime.esm.min.js +3 -3
  4. package/dist/bundles/anime.umd.js +446 -245
  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 +427 -228
  75. package/dist/modules/layout/layout.d.ts +44 -38
  76. package/dist/modules/layout/layout.js +429 -230
  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
@@ -14,42 +14,36 @@ export class AutoLayout {
14
14
  children: LayoutChildrenParam;
15
15
  /** @type {Boolean} */
16
16
  absoluteCoords: boolean;
17
- /** @type {Number|FunctionValue} */
18
- duration: number | FunctionValue;
19
- /** @type {Number|FunctionValue} */
20
- delay: number | FunctionValue;
21
- /** @type {EasingParam} */
22
- ease: EasingParam;
23
- /** @type {Callback<this>} */
24
- onComplete: Callback<this>;
25
17
  /** @type {LayoutStateParams} */
26
- frozenParams: LayoutStateParams;
18
+ swapAtParams: LayoutStateParams;
27
19
  /** @type {LayoutStateParams} */
28
- addedParams: LayoutStateParams;
20
+ enterFromParams: LayoutStateParams;
29
21
  /** @type {LayoutStateParams} */
30
- removedParams: LayoutStateParams;
22
+ leaveToParams: LayoutStateParams;
31
23
  /** @type {Set<String>} */
32
24
  properties: Set<string>;
33
25
  /** @type {Set<String>} */
34
26
  recordedProperties: Set<string>;
35
27
  /** @type {WeakSet<DOMTarget>} */
36
- pendingRemoved: WeakSet<DOMTarget>;
28
+ pendingRemoval: WeakSet<DOMTarget>;
37
29
  /** @type {Map<DOMTarget, String|null>} */
38
30
  transitionMuteStore: Map<DOMTarget, string | null>;
39
31
  /** @type {LayoutSnapshot} */
40
32
  oldState: LayoutSnapshot;
41
33
  /** @type {LayoutSnapshot} */
42
34
  newState: LayoutSnapshot;
43
- /** @type {Timeline|null} */
44
- timeline: Timeline | null;
45
- /** @type {WAAPIAnimation|null} */
46
- transformAnimation: WAAPIAnimation | null;
35
+ /** @type {Timeline} */
36
+ timeline: Timeline;
37
+ /** @type {WAAPIAnimation} */
38
+ transformAnimation: WAAPIAnimation;
39
+ /** @type {Array<DOMTarget>} */
40
+ animating: Array<DOMTarget>;
47
41
  /** @type {Array<DOMTarget>} */
48
- frozen: Array<DOMTarget>;
42
+ swapping: Array<DOMTarget>;
49
43
  /** @type {Array<DOMTarget>} */
50
- removed: Array<DOMTarget>;
44
+ leaving: Array<DOMTarget>;
51
45
  /** @type {Array<DOMTarget>} */
52
- added: Array<DOMTarget>;
46
+ entering: Array<DOMTarget>;
53
47
  /**
54
48
  * @return {this}
55
49
  */
@@ -66,27 +60,35 @@ export class AutoLayout {
66
60
  /**
67
61
  * @param {(layout: this) => void} callback
68
62
  * @param {LayoutAnimationParams} [params]
69
- * @return {this}
63
+ * @return {Timeline}
70
64
  */
71
- update(callback: (layout: this) => void, params?: LayoutAnimationParams): this;
65
+ update(callback: (layout: this) => void, params?: LayoutAnimationParams): Timeline;
72
66
  }
73
67
  export function createLayout(root: DOMTargetSelector, params?: AutoLayoutParams): AutoLayout;
74
68
  export type LayoutChildrenParam = DOMTargetSelector | Array<DOMTargetSelector>;
75
- export type LayoutStateParams = Record<string, number | string>;
76
- export type LayoutAnimationParams = {
69
+ export type LayoutAnimationTimingsParams = {
70
+ delay?: number | FunctionValue;
71
+ duration?: number | FunctionValue;
72
+ ease?: EasingParam | FunctionValue;
73
+ };
74
+ export type LayoutStateAnimationProperties = Record<string, number | string | FunctionValue>;
75
+ export type LayoutStateParams = LayoutStateAnimationProperties & LayoutAnimationTimingsParams;
76
+ export type LayoutSpecificAnimationParams = {
77
77
  delay?: number | FunctionValue;
78
78
  duration?: number | FunctionValue;
79
- ease?: EasingParam;
80
- frozen?: LayoutStateParams;
81
- added?: LayoutStateParams;
82
- removed?: LayoutStateParams;
83
- onComplete?: Callback<AutoLayout>;
79
+ ease?: EasingParam | FunctionValue;
80
+ playbackEase?: EasingParam;
81
+ swapAt?: LayoutStateParams;
82
+ enterFrom?: LayoutStateParams;
83
+ leaveTo?: LayoutStateParams;
84
84
  };
85
- export type AutoLayoutParams = LayoutAnimationParams & {
85
+ export type LayoutAnimationParams = LayoutSpecificAnimationParams & TimerParams & TickableCallbacks<Timeline> & RenderableCallbacks<Timeline>;
86
+ export type LayoutOptions = {
86
87
  children?: LayoutChildrenParam;
87
88
  properties?: Array<string>;
88
89
  };
89
- export type LayoutNodeProperties = Record<string, number | string> & {
90
+ export type AutoLayoutParams = LayoutAnimationParams & LayoutOptions;
91
+ export type LayoutNodeProperties = Record<string, number | string | FunctionValue> & {
90
92
  transform: string;
91
93
  x: number;
92
94
  y: number;
@@ -104,13 +106,15 @@ export type LayoutNode = {
104
106
  total: number;
105
107
  delay: number;
106
108
  duration: number;
109
+ ease: EasingParam;
107
110
  $measure: DOMTarget;
108
111
  state: LayoutSnapshot;
109
112
  layout: AutoLayout;
110
113
  parentNode: LayoutNode | null;
111
114
  isTarget: boolean;
115
+ isEntering: boolean;
116
+ isLeaving: boolean;
112
117
  hasTransform: boolean;
113
- isAnimated: boolean;
114
118
  inlineStyles: Array<string>;
115
119
  inlineTransforms: string | null;
116
120
  inlineTransition: string | null;
@@ -140,9 +144,6 @@ export type LayoutNode = {
140
144
  };
141
145
  export type LayoutNodeIterator = (node: LayoutNode, index: number) => void;
142
146
  import type { DOMTarget } from '../types/index.js';
143
- import type { FunctionValue } from '../types/index.js';
144
- import type { EasingParam } from '../types/index.js';
145
- import type { Callback } from '../types/index.js';
146
147
  declare class LayoutSnapshot {
147
148
  /**
148
149
  * @param {AutoLayout} layout
@@ -166,15 +167,15 @@ declare class LayoutSnapshot {
166
167
  revert(): this;
167
168
  /**
168
169
  * @param {DOMTarget} $el
169
- * @return {LayoutNodeProperties|undefined}
170
+ * @return {LayoutNode}
170
171
  */
171
- get($el: DOMTarget): LayoutNodeProperties | undefined;
172
+ getNode($el: DOMTarget): LayoutNode;
172
173
  /**
173
174
  * @param {DOMTarget} $el
174
175
  * @param {String} prop
175
- * @return {Number|String|undefined}
176
+ * @return {Number|String}
176
177
  */
177
- getValue($el: DOMTarget, prop: string): number | string | undefined;
178
+ getComputedValue($el: DOMTarget, prop: string): number | string;
178
179
  /**
179
180
  * @param {LayoutNode|null} rootNode
180
181
  * @param {LayoutNodeIterator} cb
@@ -208,4 +209,9 @@ declare class LayoutSnapshot {
208
209
  import type { Timeline } from '../timeline/timeline.js';
209
210
  import type { WAAPIAnimation } from '../waapi/waapi.js';
210
211
  import type { DOMTargetSelector } from '../types/index.js';
212
+ import type { FunctionValue } from '../types/index.js';
213
+ import type { EasingParam } from '../types/index.js';
214
+ import type { TimerParams } from '../types/index.js';
215
+ import type { TickableCallbacks } from '../types/index.js';
216
+ import type { RenderableCallbacks } from '../types/index.js';
211
217
  export {};