animejs 4.2.2 → 4.3.0-beta.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 (133) hide show
  1. package/README.md +82 -28
  2. package/dist/bundles/anime.esm.js +2705 -1303
  3. package/dist/bundles/anime.esm.min.js +2 -2
  4. package/dist/bundles/anime.umd.js +2710 -1306
  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 +18 -9
  13. package/dist/modules/animation/animation.js +19 -10
  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 +10 -10
  19. package/dist/modules/core/clock.d.ts +1 -1
  20. package/dist/modules/core/clock.js +10 -10
  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 +6 -4
  24. package/dist/modules/core/consts.d.ts +13 -5
  25. package/dist/modules/core/consts.js +6 -4
  26. package/dist/modules/core/globals.cjs +5 -2
  27. package/dist/modules/core/globals.d.ts +1 -0
  28. package/dist/modules/core/globals.js +5 -3
  29. package/dist/modules/core/helpers.cjs +1 -1
  30. package/dist/modules/core/helpers.js +1 -1
  31. package/dist/modules/core/render.cjs +1 -1
  32. package/dist/modules/core/render.js +1 -1
  33. package/dist/modules/core/styles.cjs +1 -1
  34. package/dist/modules/core/styles.js +1 -1
  35. package/dist/modules/core/targets.cjs +1 -1
  36. package/dist/modules/core/targets.js +1 -1
  37. package/dist/modules/core/transforms.cjs +1 -1
  38. package/dist/modules/core/transforms.js +1 -1
  39. package/dist/modules/core/units.cjs +1 -1
  40. package/dist/modules/core/units.js +1 -1
  41. package/dist/modules/core/values.cjs +1 -1
  42. package/dist/modules/core/values.js +1 -1
  43. package/dist/modules/draggable/draggable.cjs +1 -1
  44. package/dist/modules/draggable/draggable.js +1 -1
  45. package/dist/modules/draggable/index.cjs +1 -1
  46. package/dist/modules/draggable/index.js +1 -1
  47. package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
  48. package/dist/modules/easings/cubic-bezier/index.js +1 -1
  49. package/dist/modules/easings/eases/index.cjs +1 -1
  50. package/dist/modules/easings/eases/index.js +1 -1
  51. package/dist/modules/easings/eases/parser.cjs +1 -1
  52. package/dist/modules/easings/eases/parser.js +1 -1
  53. package/dist/modules/easings/index.cjs +1 -1
  54. package/dist/modules/easings/index.js +1 -1
  55. package/dist/modules/easings/irregular/index.cjs +1 -1
  56. package/dist/modules/easings/irregular/index.js +1 -1
  57. package/dist/modules/easings/linear/index.cjs +1 -1
  58. package/dist/modules/easings/linear/index.js +1 -1
  59. package/dist/modules/easings/none.cjs +1 -1
  60. package/dist/modules/easings/none.js +1 -1
  61. package/dist/modules/easings/spring/index.cjs +1 -1
  62. package/dist/modules/easings/spring/index.js +1 -1
  63. package/dist/modules/easings/steps/index.cjs +1 -1
  64. package/dist/modules/easings/steps/index.js +1 -1
  65. package/dist/modules/engine/engine.cjs +2 -2
  66. package/dist/modules/engine/engine.js +2 -2
  67. package/dist/modules/engine/index.cjs +1 -1
  68. package/dist/modules/engine/index.js +1 -1
  69. package/dist/modules/events/index.cjs +1 -1
  70. package/dist/modules/events/index.js +1 -1
  71. package/dist/modules/events/scroll.cjs +1 -1
  72. package/dist/modules/events/scroll.js +1 -1
  73. package/dist/modules/index.cjs +4 -1
  74. package/dist/modules/index.d.ts +1 -0
  75. package/dist/modules/index.js +2 -1
  76. package/dist/modules/layout/index.cjs +15 -0
  77. package/dist/modules/layout/index.d.ts +1 -0
  78. package/dist/modules/layout/index.js +8 -0
  79. package/dist/modules/layout/layout.cjs +1384 -0
  80. package/dist/modules/layout/layout.d.ts +211 -0
  81. package/dist/modules/layout/layout.js +1381 -0
  82. package/dist/modules/scope/index.cjs +1 -1
  83. package/dist/modules/scope/index.js +1 -1
  84. package/dist/modules/scope/scope.cjs +1 -1
  85. package/dist/modules/scope/scope.js +1 -1
  86. package/dist/modules/svg/drawable.cjs +1 -1
  87. package/dist/modules/svg/drawable.js +1 -1
  88. package/dist/modules/svg/helpers.cjs +1 -1
  89. package/dist/modules/svg/helpers.js +1 -1
  90. package/dist/modules/svg/index.cjs +1 -1
  91. package/dist/modules/svg/index.js +1 -1
  92. package/dist/modules/svg/morphto.cjs +1 -1
  93. package/dist/modules/svg/morphto.js +1 -1
  94. package/dist/modules/svg/motionpath.cjs +1 -1
  95. package/dist/modules/svg/motionpath.js +1 -1
  96. package/dist/modules/text/index.cjs +1 -1
  97. package/dist/modules/text/index.js +1 -1
  98. package/dist/modules/text/split.cjs +23 -9
  99. package/dist/modules/text/split.js +23 -9
  100. package/dist/modules/timeline/index.cjs +1 -1
  101. package/dist/modules/timeline/index.js +1 -1
  102. package/dist/modules/timeline/position.cjs +1 -1
  103. package/dist/modules/timeline/position.js +1 -1
  104. package/dist/modules/timeline/timeline.cjs +14 -6
  105. package/dist/modules/timeline/timeline.d.ts +2 -0
  106. package/dist/modules/timeline/timeline.js +15 -7
  107. package/dist/modules/timer/index.cjs +1 -1
  108. package/dist/modules/timer/index.js +1 -1
  109. package/dist/modules/timer/timer.cjs +26 -13
  110. package/dist/modules/timer/timer.d.ts +1 -0
  111. package/dist/modules/timer/timer.js +27 -14
  112. package/dist/modules/types/index.d.ts +3 -1
  113. package/dist/modules/utils/chainable.cjs +1 -1
  114. package/dist/modules/utils/chainable.js +1 -1
  115. package/dist/modules/utils/index.cjs +1 -1
  116. package/dist/modules/utils/index.js +1 -1
  117. package/dist/modules/utils/number.cjs +1 -1
  118. package/dist/modules/utils/number.js +1 -1
  119. package/dist/modules/utils/random.cjs +1 -1
  120. package/dist/modules/utils/random.js +1 -1
  121. package/dist/modules/utils/stagger.cjs +1 -1
  122. package/dist/modules/utils/stagger.js +1 -1
  123. package/dist/modules/utils/target.cjs +1 -1
  124. package/dist/modules/utils/target.js +1 -1
  125. package/dist/modules/utils/time.cjs +1 -1
  126. package/dist/modules/utils/time.js +1 -1
  127. package/dist/modules/waapi/composition.cjs +1 -1
  128. package/dist/modules/waapi/composition.js +1 -1
  129. package/dist/modules/waapi/index.cjs +1 -1
  130. package/dist/modules/waapi/index.js +1 -1
  131. package/dist/modules/waapi/waapi.cjs +15 -7
  132. package/dist/modules/waapi/waapi.js +16 -8
  133. package/package.json +8 -2
@@ -0,0 +1,211 @@
1
+ export class AutoLayout {
2
+ /**
3
+ * @param {DOMTargetSelector} root
4
+ * @param {AutoLayoutParams} [params]
5
+ */
6
+ constructor(root: DOMTargetSelector, params?: AutoLayoutParams);
7
+ /** @type {AutoLayoutParams} */
8
+ params: AutoLayoutParams;
9
+ /** @type {DOMTarget} */
10
+ root: DOMTarget;
11
+ /** @type {Number} */
12
+ id: number;
13
+ /** @type {LayoutChildrenParam} */
14
+ children: LayoutChildrenParam;
15
+ /** @type {Boolean} */
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
+ /** @type {LayoutStateParams} */
26
+ frozenParams: LayoutStateParams;
27
+ /** @type {LayoutStateParams} */
28
+ addedParams: LayoutStateParams;
29
+ /** @type {LayoutStateParams} */
30
+ removedParams: LayoutStateParams;
31
+ /** @type {Set<String>} */
32
+ properties: Set<string>;
33
+ /** @type {Set<String>} */
34
+ recordedProperties: Set<string>;
35
+ /** @type {WeakSet<DOMTarget>} */
36
+ pendingRemoved: WeakSet<DOMTarget>;
37
+ /** @type {Map<DOMTarget, String|null>} */
38
+ transitionMuteStore: Map<DOMTarget, string | null>;
39
+ /** @type {LayoutSnapshot} */
40
+ oldState: LayoutSnapshot;
41
+ /** @type {LayoutSnapshot} */
42
+ newState: LayoutSnapshot;
43
+ /** @type {Timeline|null} */
44
+ timeline: Timeline | null;
45
+ /** @type {WAAPIAnimation|null} */
46
+ transformAnimation: WAAPIAnimation | null;
47
+ /** @type {Array<DOMTarget>} */
48
+ frozen: Array<DOMTarget>;
49
+ /** @type {Array<DOMTarget>} */
50
+ removed: Array<DOMTarget>;
51
+ /** @type {Array<DOMTarget>} */
52
+ added: Array<DOMTarget>;
53
+ /**
54
+ * @return {this}
55
+ */
56
+ revert(): this;
57
+ /**
58
+ * @return {this}
59
+ */
60
+ record(): this;
61
+ /**
62
+ * @param {LayoutAnimationParams} [params]
63
+ * @return {Timeline}
64
+ */
65
+ animate(params?: LayoutAnimationParams): Timeline;
66
+ /**
67
+ * @param {(layout: this) => void} callback
68
+ * @param {LayoutAnimationParams} [params]
69
+ * @return {this}
70
+ */
71
+ update(callback: (layout: this) => void, params?: LayoutAnimationParams): this;
72
+ }
73
+ export function createLayout(root: DOMTargetSelector, params?: AutoLayoutParams): AutoLayout;
74
+ export type LayoutChildrenParam = DOMTargetSelector | Array<DOMTargetSelector>;
75
+ export type LayoutStateParams = Record<string, number | string>;
76
+ export type LayoutAnimationParams = {
77
+ delay?: number | FunctionValue;
78
+ duration?: number | FunctionValue;
79
+ ease?: EasingParam;
80
+ frozen?: LayoutStateParams;
81
+ added?: LayoutStateParams;
82
+ removed?: LayoutStateParams;
83
+ onComplete?: Callback<AutoLayout>;
84
+ };
85
+ export type AutoLayoutParams = LayoutAnimationParams & {
86
+ children?: LayoutChildrenParam;
87
+ properties?: Array<string>;
88
+ };
89
+ export type LayoutNodeProperties = Record<string, number | string> & {
90
+ transform: string;
91
+ x: number;
92
+ y: number;
93
+ left: number;
94
+ top: number;
95
+ clientLeft: number;
96
+ clientTop: number;
97
+ width: number;
98
+ height: number;
99
+ };
100
+ export type LayoutNode = {
101
+ id: string;
102
+ $el: DOMTarget;
103
+ index: number;
104
+ total: number;
105
+ delay: number;
106
+ duration: number;
107
+ $measure: DOMTarget;
108
+ state: LayoutSnapshot;
109
+ layout: AutoLayout;
110
+ parentNode: LayoutNode | null;
111
+ isTarget: boolean;
112
+ hasTransform: boolean;
113
+ isAnimated: boolean;
114
+ inlineStyles: Array<string>;
115
+ inlineTransforms: string | null;
116
+ inlineTransition: string | null;
117
+ branchAdded: boolean;
118
+ branchRemoved: boolean;
119
+ branchNotRendered: boolean;
120
+ sizeChanged: boolean;
121
+ isInlined: boolean;
122
+ hasVisibilitySwap: boolean;
123
+ hasDisplayNone: boolean;
124
+ hasVisibilityHidden: boolean;
125
+ measuredInlineTransform: string | null;
126
+ measuredInlineTransition: string | null;
127
+ measuredDisplay: string | null;
128
+ measuredVisibility: string | null;
129
+ measuredPosition: string | null;
130
+ measuredHasDisplayNone: boolean;
131
+ measuredHasVisibilityHidden: boolean;
132
+ measuredIsVisible: boolean;
133
+ measuredIsRemoved: boolean;
134
+ measuredIsInsideRoot: boolean;
135
+ properties: LayoutNodeProperties;
136
+ _head: LayoutNode | null;
137
+ _tail: LayoutNode | null;
138
+ _prev: LayoutNode | null;
139
+ _next: LayoutNode | null;
140
+ };
141
+ export type LayoutNodeIterator = (node: LayoutNode, index: number) => void;
142
+ 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
+ declare class LayoutSnapshot {
147
+ /**
148
+ * @param {AutoLayout} layout
149
+ */
150
+ constructor(layout: AutoLayout);
151
+ /** @type {AutoLayout} */
152
+ layout: AutoLayout;
153
+ /** @type {LayoutNode|null} */
154
+ rootNode: LayoutNode | null;
155
+ /** @type {Set<LayoutNode>} */
156
+ rootNodes: Set<LayoutNode>;
157
+ /** @type {Map<String, LayoutNode>} */
158
+ nodes: Map<string, LayoutNode>;
159
+ /** @type {Number} */
160
+ scrollX: number;
161
+ /** @type {Number} */
162
+ scrollY: number;
163
+ /**
164
+ * @return {this}
165
+ */
166
+ revert(): this;
167
+ /**
168
+ * @param {DOMTarget} $el
169
+ * @return {LayoutNodeProperties|undefined}
170
+ */
171
+ get($el: DOMTarget): LayoutNodeProperties | undefined;
172
+ /**
173
+ * @param {DOMTarget} $el
174
+ * @param {String} prop
175
+ * @return {Number|String|undefined}
176
+ */
177
+ getValue($el: DOMTarget, prop: string): number | string | undefined;
178
+ /**
179
+ * @param {LayoutNode|null} rootNode
180
+ * @param {LayoutNodeIterator} cb
181
+ */
182
+ forEach(rootNode: LayoutNode | null, cb: LayoutNodeIterator): void;
183
+ /**
184
+ * @param {LayoutNodeIterator} cb
185
+ */
186
+ forEachRootNode(cb: LayoutNodeIterator): void;
187
+ /**
188
+ * @param {LayoutNodeIterator} cb
189
+ */
190
+ forEachNode(cb: LayoutNodeIterator): void;
191
+ /**
192
+ * @param {DOMTarget} $el
193
+ * @param {LayoutNode|null} parentNode
194
+ * @return {LayoutNode|null}
195
+ */
196
+ registerElement($el: DOMTarget, parentNode: LayoutNode | null): LayoutNode | null;
197
+ /**
198
+ * @param {DOMTarget} $el
199
+ * @param {Set<DOMTarget>} candidates
200
+ * @return {LayoutNode|null}
201
+ */
202
+ ensureDetachedNode($el: DOMTarget, candidates: Set<DOMTarget>): LayoutNode | null;
203
+ /**
204
+ * @return {this}
205
+ */
206
+ record(): this;
207
+ }
208
+ import type { Timeline } from '../timeline/timeline.js';
209
+ import type { WAAPIAnimation } from '../waapi/waapi.js';
210
+ import type { DOMTargetSelector } from '../types/index.js';
211
+ export {};