animejs 4.2.1 → 4.3.0-beta.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.
- package/README.md +82 -28
- package/dist/bundles/anime.esm.js +2707 -1301
- package/dist/bundles/anime.esm.min.js +2 -2
- package/dist/bundles/anime.umd.js +2717 -1309
- package/dist/bundles/anime.umd.min.js +2 -2
- package/dist/modules/animatable/animatable.cjs +1 -1
- package/dist/modules/animatable/animatable.js +1 -1
- package/dist/modules/animatable/index.cjs +1 -1
- package/dist/modules/animatable/index.js +1 -1
- package/dist/modules/animation/additive.cjs +1 -1
- package/dist/modules/animation/additive.js +1 -1
- package/dist/modules/animation/animation.cjs +18 -9
- package/dist/modules/animation/animation.js +19 -10
- package/dist/modules/animation/composition.cjs +1 -1
- package/dist/modules/animation/composition.js +1 -1
- package/dist/modules/animation/index.cjs +1 -1
- package/dist/modules/animation/index.js +1 -1
- package/dist/modules/core/clock.cjs +10 -10
- package/dist/modules/core/clock.d.ts +1 -1
- package/dist/modules/core/clock.js +10 -10
- package/dist/modules/core/colors.cjs +1 -1
- package/dist/modules/core/colors.js +1 -1
- package/dist/modules/core/consts.cjs +6 -4
- package/dist/modules/core/consts.d.ts +13 -5
- package/dist/modules/core/consts.js +6 -4
- package/dist/modules/core/globals.cjs +5 -2
- package/dist/modules/core/globals.d.ts +1 -0
- package/dist/modules/core/globals.js +5 -3
- package/dist/modules/core/helpers.cjs +1 -1
- package/dist/modules/core/helpers.js +1 -1
- package/dist/modules/core/render.cjs +1 -1
- package/dist/modules/core/render.js +1 -1
- package/dist/modules/core/styles.cjs +1 -1
- package/dist/modules/core/styles.js +1 -1
- package/dist/modules/core/targets.cjs +1 -1
- package/dist/modules/core/targets.js +1 -1
- package/dist/modules/core/transforms.cjs +1 -1
- package/dist/modules/core/transforms.js +1 -1
- package/dist/modules/core/units.cjs +1 -1
- package/dist/modules/core/units.js +1 -1
- package/dist/modules/core/values.cjs +1 -1
- package/dist/modules/core/values.js +1 -1
- package/dist/modules/draggable/draggable.cjs +1 -1
- package/dist/modules/draggable/draggable.js +1 -1
- package/dist/modules/draggable/index.cjs +1 -1
- package/dist/modules/draggable/index.js +1 -1
- package/dist/modules/easings/cubic-bezier/index.cjs +1 -1
- package/dist/modules/easings/cubic-bezier/index.js +1 -1
- package/dist/modules/easings/eases/index.cjs +1 -1
- package/dist/modules/easings/eases/index.js +1 -1
- package/dist/modules/easings/eases/parser.cjs +1 -1
- package/dist/modules/easings/eases/parser.js +1 -1
- package/dist/modules/easings/index.cjs +1 -1
- package/dist/modules/easings/index.js +1 -1
- package/dist/modules/easings/irregular/index.cjs +1 -1
- package/dist/modules/easings/irregular/index.js +1 -1
- package/dist/modules/easings/linear/index.cjs +1 -1
- package/dist/modules/easings/linear/index.js +1 -1
- package/dist/modules/easings/none.cjs +1 -1
- package/dist/modules/easings/none.js +1 -1
- package/dist/modules/easings/spring/index.cjs +1 -1
- package/dist/modules/easings/spring/index.js +1 -1
- package/dist/modules/easings/steps/index.cjs +1 -1
- package/dist/modules/easings/steps/index.js +1 -1
- package/dist/modules/engine/engine.cjs +2 -2
- package/dist/modules/engine/engine.js +2 -2
- package/dist/modules/engine/index.cjs +1 -1
- package/dist/modules/engine/index.js +1 -1
- package/dist/modules/events/index.cjs +1 -1
- package/dist/modules/events/index.js +1 -1
- package/dist/modules/events/scroll.cjs +1 -1
- package/dist/modules/events/scroll.js +1 -1
- package/dist/modules/index.cjs +4 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +2 -1
- package/dist/modules/layout/index.cjs +15 -0
- package/dist/modules/layout/index.d.ts +1 -0
- package/dist/modules/layout/index.js +8 -0
- package/dist/modules/layout/layout.cjs +1384 -0
- package/dist/modules/layout/layout.d.ts +211 -0
- package/dist/modules/layout/layout.js +1381 -0
- package/dist/modules/scope/index.cjs +1 -1
- package/dist/modules/scope/index.js +1 -1
- package/dist/modules/scope/scope.cjs +1 -1
- package/dist/modules/scope/scope.js +1 -1
- package/dist/modules/svg/drawable.cjs +1 -1
- package/dist/modules/svg/drawable.js +1 -1
- package/dist/modules/svg/helpers.cjs +1 -1
- package/dist/modules/svg/helpers.js +1 -1
- package/dist/modules/svg/index.cjs +1 -1
- package/dist/modules/svg/index.js +1 -1
- package/dist/modules/svg/morphto.cjs +1 -1
- package/dist/modules/svg/morphto.js +1 -1
- package/dist/modules/svg/motionpath.cjs +11 -7
- package/dist/modules/svg/motionpath.js +11 -7
- package/dist/modules/text/index.cjs +1 -1
- package/dist/modules/text/index.js +1 -1
- package/dist/modules/text/split.cjs +23 -9
- package/dist/modules/text/split.js +23 -9
- package/dist/modules/timeline/index.cjs +1 -1
- package/dist/modules/timeline/index.js +1 -1
- package/dist/modules/timeline/position.cjs +1 -1
- package/dist/modules/timeline/position.js +1 -1
- package/dist/modules/timeline/timeline.cjs +14 -6
- package/dist/modules/timeline/timeline.d.ts +2 -0
- package/dist/modules/timeline/timeline.js +15 -7
- package/dist/modules/timer/index.cjs +1 -1
- package/dist/modules/timer/index.js +1 -1
- package/dist/modules/timer/timer.cjs +26 -13
- package/dist/modules/timer/timer.d.ts +1 -0
- package/dist/modules/timer/timer.js +27 -14
- package/dist/modules/types/index.d.ts +3 -1
- package/dist/modules/utils/chainable.cjs +1 -1
- package/dist/modules/utils/chainable.js +1 -1
- package/dist/modules/utils/index.cjs +1 -1
- package/dist/modules/utils/index.js +1 -1
- package/dist/modules/utils/number.cjs +1 -1
- package/dist/modules/utils/number.js +1 -1
- package/dist/modules/utils/random.cjs +1 -1
- package/dist/modules/utils/random.js +1 -1
- package/dist/modules/utils/stagger.cjs +1 -1
- package/dist/modules/utils/stagger.js +1 -1
- package/dist/modules/utils/target.cjs +1 -1
- package/dist/modules/utils/target.js +1 -1
- package/dist/modules/utils/time.cjs +1 -1
- package/dist/modules/utils/time.js +1 -1
- package/dist/modules/waapi/composition.cjs +1 -1
- package/dist/modules/waapi/composition.js +1 -1
- package/dist/modules/waapi/index.cjs +1 -1
- package/dist/modules/waapi/index.js +1 -1
- package/dist/modules/waapi/waapi.cjs +15 -7
- package/dist/modules/waapi/waapi.js +16 -8
- 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} */
|
|
18
|
+
duration: number;
|
|
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
|
+
duration?: number;
|
|
78
|
+
delay?: 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 {};
|