@mks2508/waapi-animation-primitives 0.1.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 +164 -0
- package/dist/index.cjs +74 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +502 -0
- package/dist/index.d.ts +502 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface FormatOptions {
|
|
5
|
+
style?: "decimal" | "currency" | "percent";
|
|
6
|
+
currency?: string;
|
|
7
|
+
locale?: string;
|
|
8
|
+
minimumFractionDigits?: number;
|
|
9
|
+
maximumFractionDigits?: number;
|
|
10
|
+
useGrouping?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface SlidingNumberProps {
|
|
13
|
+
value: number;
|
|
14
|
+
duration?: number;
|
|
15
|
+
fontSize?: string;
|
|
16
|
+
fontWeight?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
digitHeight?: number;
|
|
19
|
+
stagger?: number;
|
|
20
|
+
motionBlur?: boolean;
|
|
21
|
+
format?: FormatOptions;
|
|
22
|
+
trend?: -1 | 0 | 1;
|
|
23
|
+
animationConfig?: {
|
|
24
|
+
overshoot?: number;
|
|
25
|
+
mass?: number;
|
|
26
|
+
stiffness?: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
declare function SlidingNumber({ value, duration, fontSize, fontWeight, color, digitHeight, stagger, motionBlur, format, trend, animationConfig, }: SlidingNumberProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
interface SlidingTextProps {
|
|
32
|
+
text: string;
|
|
33
|
+
mode?: 'word' | 'character' | 'none';
|
|
34
|
+
direction?: 'vertical' | 'horizontal';
|
|
35
|
+
staggerDelay?: number;
|
|
36
|
+
duration?: number;
|
|
37
|
+
easing?: string;
|
|
38
|
+
blur?: boolean;
|
|
39
|
+
widthAnimation?: boolean;
|
|
40
|
+
initial?: 'initial' | false;
|
|
41
|
+
animate?: 'animate';
|
|
42
|
+
exit?: 'exit';
|
|
43
|
+
onAnimationComplete?: () => void;
|
|
44
|
+
className?: string;
|
|
45
|
+
style?: React.CSSProperties;
|
|
46
|
+
}
|
|
47
|
+
declare const SlidingText: React.FC<SlidingTextProps>;
|
|
48
|
+
|
|
49
|
+
interface Token {
|
|
50
|
+
id: string;
|
|
51
|
+
text: string;
|
|
52
|
+
}
|
|
53
|
+
interface AnimatedTokensProps {
|
|
54
|
+
tokens: Token[];
|
|
55
|
+
placeholder?: string;
|
|
56
|
+
maxVisible?: number;
|
|
57
|
+
textAnimationMode?: 'character' | 'word';
|
|
58
|
+
textDirection?: 'vertical' | 'horizontal';
|
|
59
|
+
textStaggerDelay?: number;
|
|
60
|
+
separator?: string;
|
|
61
|
+
enableWidthAnimation?: boolean;
|
|
62
|
+
className?: string;
|
|
63
|
+
tokenClassName?: string;
|
|
64
|
+
placeholderClassName?: string;
|
|
65
|
+
separatorClassName?: string;
|
|
66
|
+
}
|
|
67
|
+
declare const AnimatedTokens: React.FC<AnimatedTokensProps>;
|
|
68
|
+
|
|
69
|
+
interface AnimationConfig {
|
|
70
|
+
onComplete: (id: string) => void;
|
|
71
|
+
exitDuration?: number;
|
|
72
|
+
flipDuration?: number;
|
|
73
|
+
exitEasing?: string;
|
|
74
|
+
flipEasing?: string;
|
|
75
|
+
}
|
|
76
|
+
declare const useWAAPIAnimations: (config: AnimationConfig) => {
|
|
77
|
+
registerElement: (id: string, el: HTMLElement | null) => void;
|
|
78
|
+
startExit: (id: string) => Promise<void>;
|
|
79
|
+
isAnimating: (id?: string) => boolean;
|
|
80
|
+
cancelAnimations: (id: string) => void;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Obtiene duración de animación responsiva para el dispositivo actual
|
|
85
|
+
* @param baseDuration - Duración base en ms
|
|
86
|
+
* @returns Duración ajustada para dispositivo actual
|
|
87
|
+
*/
|
|
88
|
+
declare const getResponsiveDuration: (baseDuration: number) => number;
|
|
89
|
+
/**
|
|
90
|
+
* Obtiene stagger delay responsivo
|
|
91
|
+
* @param baseDelay - Delay base en ms
|
|
92
|
+
* @returns Delay ajustado para dispositivo actual
|
|
93
|
+
*/
|
|
94
|
+
declare const getResponsiveStagger: (baseDelay: number) => number;
|
|
95
|
+
declare const TIMING: {
|
|
96
|
+
readonly ENTER_DURATION: 200;
|
|
97
|
+
readonly EXIT_DURATION: 180;
|
|
98
|
+
readonly COLLAPSE_DURATION: 200;
|
|
99
|
+
readonly FLIP_DURATION: 300;
|
|
100
|
+
readonly ENTER_STAGGER: 15;
|
|
101
|
+
readonly EXIT_STAGGER: 0;
|
|
102
|
+
readonly COLLAPSE_DELAY: 30;
|
|
103
|
+
readonly FLIP_DELAY_PERCENT: 0.25;
|
|
104
|
+
readonly MIN_DELTA_PX: 1;
|
|
105
|
+
};
|
|
106
|
+
declare const TRANSFORMS: {
|
|
107
|
+
readonly OFFSET_Y_ENTER: 8;
|
|
108
|
+
readonly OFFSET_Y_EXIT: -8;
|
|
109
|
+
readonly OFFSET_X: 16;
|
|
110
|
+
readonly SCALE_EXIT: 0.95;
|
|
111
|
+
readonly ROTATE_EXIT: 0;
|
|
112
|
+
};
|
|
113
|
+
declare const EFFECTS: {
|
|
114
|
+
readonly BLUR_ENTER: 4;
|
|
115
|
+
readonly BLUR_EXIT: 2;
|
|
116
|
+
};
|
|
117
|
+
declare const EASINGS: {
|
|
118
|
+
readonly EASE_OUT_CUBIC: "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
119
|
+
readonly EASE_IN_CUBIC: "cubic-bezier(0.32, 0, 0.67, 0)";
|
|
120
|
+
readonly EASE_IN_OUT: "cubic-bezier(0.42, 0, 0.58, 1)";
|
|
121
|
+
readonly EASE_OUT_EXPO: "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
122
|
+
readonly EASE_FLIP: "cubic-bezier(0.2, 0, 0.2, 1)";
|
|
123
|
+
readonly SPRING_GENTLE: "linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)";
|
|
124
|
+
readonly SPRING_SNAPPY: "linear(0, 0.006, 0.024 2%, 0.096 4.2%, 0.397 9.3%, 0.861 15.8%, 1.002 18.7%, 1.093 21.4%, 1.143 24%, 1.156, 1.149 28.3%, 1.115 31.5%, 1.022 40%, 0.988 47.1%, 0.984 55.1%, 0.998 72.3%, 1.001 85.4%, 1)";
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Configuración de animación responsiva con accessibility
|
|
128
|
+
*/
|
|
129
|
+
declare const RESPONSIVE_CONFIGS: {
|
|
130
|
+
readonly tokenEnter: {
|
|
131
|
+
readonly duration: number;
|
|
132
|
+
readonly stagger: number;
|
|
133
|
+
readonly easing: "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
134
|
+
readonly blur: 4;
|
|
135
|
+
readonly offsetY: 8;
|
|
136
|
+
};
|
|
137
|
+
readonly tokenExit: {
|
|
138
|
+
readonly duration: number;
|
|
139
|
+
readonly stagger: number;
|
|
140
|
+
readonly easing: "cubic-bezier(0.32, 0, 0.67, 0)";
|
|
141
|
+
readonly blur: 2;
|
|
142
|
+
readonly offsetY: -8;
|
|
143
|
+
readonly scale: 0.95;
|
|
144
|
+
};
|
|
145
|
+
readonly collapse: {
|
|
146
|
+
readonly duration: number;
|
|
147
|
+
readonly delay: 30;
|
|
148
|
+
readonly easing: "cubic-bezier(0.42, 0, 0.58, 1)";
|
|
149
|
+
};
|
|
150
|
+
readonly flip: {
|
|
151
|
+
readonly duration: number;
|
|
152
|
+
readonly delayPercent: 0.25;
|
|
153
|
+
readonly easing: "linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
declare const ANIMATION_DEFAULTS: {
|
|
157
|
+
DURATION_ENTER: 200;
|
|
158
|
+
DURATION_EXIT: 180;
|
|
159
|
+
DURATION_FLIP: 300;
|
|
160
|
+
STAGGER_DELAY: 15;
|
|
161
|
+
OFFSET_VERTICAL: 8;
|
|
162
|
+
OFFSET_HORIZONTAL: 16;
|
|
163
|
+
BLUR_AMOUNT: 4;
|
|
164
|
+
EASING_ENTER: "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
165
|
+
EASING_EXIT: "cubic-bezier(0.32, 0, 0.67, 0)";
|
|
166
|
+
EASING_FLIP: "linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)";
|
|
167
|
+
SPRING_EASING: "linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)";
|
|
168
|
+
};
|
|
169
|
+
declare const ANIMATION_CONFIGS: {
|
|
170
|
+
readonly tokenEnter: {
|
|
171
|
+
readonly duration: 200;
|
|
172
|
+
readonly stagger: 15;
|
|
173
|
+
readonly easing: "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
174
|
+
readonly blur: 4;
|
|
175
|
+
readonly offsetY: 8;
|
|
176
|
+
};
|
|
177
|
+
readonly tokenExit: {
|
|
178
|
+
readonly duration: 180;
|
|
179
|
+
readonly stagger: 0;
|
|
180
|
+
readonly easing: "cubic-bezier(0.32, 0, 0.67, 0)";
|
|
181
|
+
readonly blur: 2;
|
|
182
|
+
readonly offsetY: -8;
|
|
183
|
+
readonly scale: 0.95;
|
|
184
|
+
};
|
|
185
|
+
readonly collapse: {
|
|
186
|
+
readonly duration: 200;
|
|
187
|
+
readonly delay: 30;
|
|
188
|
+
readonly easing: "cubic-bezier(0.42, 0, 0.58, 1)";
|
|
189
|
+
};
|
|
190
|
+
readonly flip: {
|
|
191
|
+
readonly duration: 300;
|
|
192
|
+
readonly delayPercent: 0.25;
|
|
193
|
+
readonly easing: "linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)";
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
declare const PRESETS: {
|
|
197
|
+
newToken: {
|
|
198
|
+
mode: "character";
|
|
199
|
+
direction: "vertical";
|
|
200
|
+
staggerDelay: number;
|
|
201
|
+
blur: boolean;
|
|
202
|
+
widthAnimation: boolean;
|
|
203
|
+
duration: number;
|
|
204
|
+
initial: "initial";
|
|
205
|
+
};
|
|
206
|
+
existingToken: {
|
|
207
|
+
mode: "none";
|
|
208
|
+
blur: boolean;
|
|
209
|
+
widthAnimation: boolean;
|
|
210
|
+
initial: false;
|
|
211
|
+
};
|
|
212
|
+
placeholder: {
|
|
213
|
+
mode: "word";
|
|
214
|
+
direction: "vertical";
|
|
215
|
+
blur: boolean;
|
|
216
|
+
widthAnimation: boolean;
|
|
217
|
+
duration: number;
|
|
218
|
+
};
|
|
219
|
+
separator: {
|
|
220
|
+
duration: number;
|
|
221
|
+
widthAnimation: boolean;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
declare const slidingTextStyles: {
|
|
226
|
+
readonly container: React.CSSProperties;
|
|
227
|
+
readonly content: React.CSSProperties;
|
|
228
|
+
readonly token: React.CSSProperties;
|
|
229
|
+
readonly enterFrom: React.CSSProperties;
|
|
230
|
+
readonly enterTo: React.CSSProperties;
|
|
231
|
+
readonly exitActive: React.CSSProperties;
|
|
232
|
+
readonly verticalEnterFrom: React.CSSProperties;
|
|
233
|
+
readonly verticalExitActive: React.CSSProperties;
|
|
234
|
+
readonly horizontalEnterFrom: React.CSSProperties;
|
|
235
|
+
readonly horizontalExitActive: React.CSSProperties;
|
|
236
|
+
};
|
|
237
|
+
declare const getSlidingTextTokenStyle: (state: "enter-from" | "enter-to" | "exit-active", direction: "vertical" | "horizontal") => React.CSSProperties;
|
|
238
|
+
|
|
239
|
+
declare const animatedTokensStyles: {
|
|
240
|
+
readonly container: React.CSSProperties;
|
|
241
|
+
readonly placeholder: React.CSSProperties;
|
|
242
|
+
readonly tokenWrapper: React.CSSProperties;
|
|
243
|
+
readonly tokenWrapperLast: React.CSSProperties;
|
|
244
|
+
readonly tokenWrapperExitCompleted: React.CSSProperties;
|
|
245
|
+
readonly separator: React.CSSProperties;
|
|
246
|
+
readonly separatorExitActive: React.CSSProperties;
|
|
247
|
+
readonly overflow: React.CSSProperties;
|
|
248
|
+
readonly overflowExiting: React.CSSProperties;
|
|
249
|
+
};
|
|
250
|
+
declare const getResponsiveAnimatedTokensStyle: () => React.CSSProperties;
|
|
251
|
+
|
|
252
|
+
interface TimingData {
|
|
253
|
+
startTime: number;
|
|
254
|
+
endTime?: number;
|
|
255
|
+
expectedDuration: number;
|
|
256
|
+
actualDuration?: number;
|
|
257
|
+
deviation?: number;
|
|
258
|
+
deviationPercent?: number;
|
|
259
|
+
}
|
|
260
|
+
interface StyleData {
|
|
261
|
+
property: string;
|
|
262
|
+
expected: string;
|
|
263
|
+
actual: string;
|
|
264
|
+
matches: boolean;
|
|
265
|
+
}
|
|
266
|
+
interface PositionData {
|
|
267
|
+
element: string;
|
|
268
|
+
x: number;
|
|
269
|
+
y: number;
|
|
270
|
+
width: number;
|
|
271
|
+
height: number;
|
|
272
|
+
delta?: {
|
|
273
|
+
x: number;
|
|
274
|
+
y: number;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
interface AnimationData {
|
|
278
|
+
name: string;
|
|
279
|
+
phase: 'start' | 'running' | 'complete' | 'cancelled';
|
|
280
|
+
progress?: number;
|
|
281
|
+
easing?: string;
|
|
282
|
+
fill?: string;
|
|
283
|
+
}
|
|
284
|
+
type DebugEventType = 'token-add' | 'token-remove' | 'token-reorder' | 'token-exit-start' | 'token-exit-complete' | 'token-dom-remove' | 'overflow-token-remove' | 'flip-animation' | 'flip-animation-complete' | 'flip-all-animations-complete' | 'flip-executing-callback' | 'flip-measure-start' | 'flip-position-measured' | 'flip-invalid-rect' | 'flip-invalid-delta' | 'flip-manual-trigger' | 'flip-capture-positions' | 'flip-position-captured' | 'waapi-exit-start' | 'waapi-exit-complete' | 'waapi-flip-animation' | 'exit-fade-complete' | 'orchestration-complete' | 'animation-start-detailed' | 'animation-complete-detailed' | 'animation-timing' | 'style-capture' | 'style-mismatch' | 'position-capture' | 'position-delta' | 'choreography-overlap' | 'choreography-sequence' | 'text-enter-start' | 'text-enter-complete' | 'triggering-flip-before-absolute' | 'state-change' | 'render' | 'animation-complete-called' | 'scheduling-raf' | 'raf-executed' | 'component-unmounted' | 'token-removing-from-layout' | 'exit-completed-ids-updated' | 'exit-completed-change' | 'registering-callback' | 'callback-fired';
|
|
285
|
+
interface DebugEvent {
|
|
286
|
+
timestamp: number;
|
|
287
|
+
type: DebugEventType;
|
|
288
|
+
source: string;
|
|
289
|
+
message: string;
|
|
290
|
+
timing?: TimingData;
|
|
291
|
+
styles?: StyleData[];
|
|
292
|
+
position?: PositionData;
|
|
293
|
+
animation?: AnimationData;
|
|
294
|
+
data?: Record<string, unknown>;
|
|
295
|
+
}
|
|
296
|
+
interface DebugContextValue {
|
|
297
|
+
events: DebugEvent[];
|
|
298
|
+
isEnabled: boolean;
|
|
299
|
+
enableDebug: () => void;
|
|
300
|
+
disableDebug: () => void;
|
|
301
|
+
toggleDebug: () => void;
|
|
302
|
+
logEvent: (event: Omit<DebugEvent, 'timestamp'>) => void;
|
|
303
|
+
clearEvents: () => void;
|
|
304
|
+
getEventLog: () => string;
|
|
305
|
+
exportToCSV: () => string;
|
|
306
|
+
}
|
|
307
|
+
declare const useDebug: () => DebugContextValue;
|
|
308
|
+
declare const DebugProvider: React.FC<{
|
|
309
|
+
children: React.ReactNode;
|
|
310
|
+
}>;
|
|
311
|
+
|
|
312
|
+
interface AnimationInfo {
|
|
313
|
+
id: string;
|
|
314
|
+
type: 'exit-fade' | 'exit-collapse' | 'flip' | 'enter' | 'width-collapse';
|
|
315
|
+
elementId: string;
|
|
316
|
+
startTime: number;
|
|
317
|
+
expectedDuration: number;
|
|
318
|
+
endTime?: number;
|
|
319
|
+
actualDuration?: number;
|
|
320
|
+
}
|
|
321
|
+
interface TimelineEvent {
|
|
322
|
+
time: number;
|
|
323
|
+
event: 'animation-start' | 'animation-end' | 'overlap-detected';
|
|
324
|
+
animationId: string;
|
|
325
|
+
type?: string;
|
|
326
|
+
overlappingWith?: string[];
|
|
327
|
+
expectedDuration?: number;
|
|
328
|
+
actualDuration?: number;
|
|
329
|
+
deviation?: number;
|
|
330
|
+
}
|
|
331
|
+
interface OverlapInfo {
|
|
332
|
+
animation1: string;
|
|
333
|
+
animation2: string;
|
|
334
|
+
overlapStart: number;
|
|
335
|
+
overlapDuration: number;
|
|
336
|
+
}
|
|
337
|
+
interface ChoreographySummary {
|
|
338
|
+
totalAnimations: number;
|
|
339
|
+
totalDuration: number;
|
|
340
|
+
overlaps: OverlapInfo[];
|
|
341
|
+
timeline: TimelineEvent[];
|
|
342
|
+
activeAnimations: AnimationInfo[];
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* ChoreographyTracker - Singleton for tracking animation choreography
|
|
346
|
+
* Detects overlaps, generates timeline, measures actual vs expected timing
|
|
347
|
+
*/
|
|
348
|
+
declare class ChoreographyTrackerClass {
|
|
349
|
+
private activeAnimations;
|
|
350
|
+
private timeline;
|
|
351
|
+
private completedAnimations;
|
|
352
|
+
private sessionStartTime;
|
|
353
|
+
/**
|
|
354
|
+
* Start a new tracking session (call when debug panel is cleared)
|
|
355
|
+
*/
|
|
356
|
+
startSession(): void;
|
|
357
|
+
/**
|
|
358
|
+
* Get relative time since session start
|
|
359
|
+
*/
|
|
360
|
+
private getRelativeTime;
|
|
361
|
+
/**
|
|
362
|
+
* Start tracking an animation
|
|
363
|
+
*/
|
|
364
|
+
startAnimation(id: string, type: AnimationInfo['type'], elementId: string, expectedDuration: number): void;
|
|
365
|
+
/**
|
|
366
|
+
* End tracking an animation
|
|
367
|
+
*/
|
|
368
|
+
endAnimation(id: string): AnimationInfo | undefined;
|
|
369
|
+
/**
|
|
370
|
+
* Detect which animations are overlapping with the given animation
|
|
371
|
+
*/
|
|
372
|
+
private detectOverlaps;
|
|
373
|
+
/**
|
|
374
|
+
* Get all overlap pairs with duration
|
|
375
|
+
*/
|
|
376
|
+
getOverlaps(): OverlapInfo[];
|
|
377
|
+
/**
|
|
378
|
+
* Get current timeline
|
|
379
|
+
*/
|
|
380
|
+
getTimeline(): TimelineEvent[];
|
|
381
|
+
/**
|
|
382
|
+
* Get active animation count
|
|
383
|
+
*/
|
|
384
|
+
getActiveCount(): number;
|
|
385
|
+
/**
|
|
386
|
+
* Get active animations
|
|
387
|
+
*/
|
|
388
|
+
getActiveAnimations(): AnimationInfo[];
|
|
389
|
+
/**
|
|
390
|
+
* Get completed animations
|
|
391
|
+
*/
|
|
392
|
+
getCompletedAnimations(): AnimationInfo[];
|
|
393
|
+
/**
|
|
394
|
+
* Get full choreography summary
|
|
395
|
+
*/
|
|
396
|
+
getSummary(): ChoreographySummary;
|
|
397
|
+
/**
|
|
398
|
+
* Get timeline for visualization (normalized to 0-100%)
|
|
399
|
+
*/
|
|
400
|
+
getTimelineForVisualization(): Array<{
|
|
401
|
+
id: string;
|
|
402
|
+
type: string;
|
|
403
|
+
elementId: string;
|
|
404
|
+
startPercent: number;
|
|
405
|
+
widthPercent: number;
|
|
406
|
+
duration: number;
|
|
407
|
+
isActive: boolean;
|
|
408
|
+
}>;
|
|
409
|
+
}
|
|
410
|
+
declare const choreographyTracker: ChoreographyTrackerClass;
|
|
411
|
+
|
|
412
|
+
interface StyleCapture {
|
|
413
|
+
opacity: string;
|
|
414
|
+
transform: string;
|
|
415
|
+
filter: string;
|
|
416
|
+
width: string;
|
|
417
|
+
height: string;
|
|
418
|
+
marginRight: string;
|
|
419
|
+
marginLeft: string;
|
|
420
|
+
position: string;
|
|
421
|
+
visibility: string;
|
|
422
|
+
pointerEvents: string;
|
|
423
|
+
}
|
|
424
|
+
interface PositionCapture {
|
|
425
|
+
x: number;
|
|
426
|
+
y: number;
|
|
427
|
+
width: number;
|
|
428
|
+
height: number;
|
|
429
|
+
top: number;
|
|
430
|
+
left: number;
|
|
431
|
+
right: number;
|
|
432
|
+
bottom: number;
|
|
433
|
+
}
|
|
434
|
+
interface StyleComparison {
|
|
435
|
+
property: string;
|
|
436
|
+
expected: string;
|
|
437
|
+
actual: string;
|
|
438
|
+
matches: boolean;
|
|
439
|
+
}
|
|
440
|
+
interface TimingResult {
|
|
441
|
+
startTime: number;
|
|
442
|
+
endTime: number;
|
|
443
|
+
expectedDuration: number;
|
|
444
|
+
actualDuration: number;
|
|
445
|
+
deviation: number;
|
|
446
|
+
deviationPercent: number;
|
|
447
|
+
}
|
|
448
|
+
interface AnimationTimer {
|
|
449
|
+
start: number;
|
|
450
|
+
expectedDuration: number;
|
|
451
|
+
end: () => TimingResult;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Capture relevant computed styles from an element
|
|
455
|
+
* These are the styles we animate and need to verify
|
|
456
|
+
*/
|
|
457
|
+
declare function captureComputedStyles(el: HTMLElement): StyleCapture;
|
|
458
|
+
/**
|
|
459
|
+
* Capture styles as a simple key-value object for logging
|
|
460
|
+
*/
|
|
461
|
+
declare function captureStylesForLog(el: HTMLElement): Record<string, string>;
|
|
462
|
+
/**
|
|
463
|
+
* Capture complete position information from DOMRect
|
|
464
|
+
*/
|
|
465
|
+
declare function capturePosition(el: HTMLElement): PositionCapture;
|
|
466
|
+
/**
|
|
467
|
+
* Capture position as simple object for logging
|
|
468
|
+
*/
|
|
469
|
+
declare function capturePositionForLog(el: HTMLElement): Record<string, number>;
|
|
470
|
+
/**
|
|
471
|
+
* Calculate delta between two positions
|
|
472
|
+
*/
|
|
473
|
+
declare function calculatePositionDelta(before: PositionCapture, after: PositionCapture): {
|
|
474
|
+
deltaX: number;
|
|
475
|
+
deltaY: number;
|
|
476
|
+
deltaWidth: number;
|
|
477
|
+
deltaHeight: number;
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* Compare expected styles vs actual computed styles
|
|
481
|
+
* Used to verify animations applied correctly
|
|
482
|
+
*/
|
|
483
|
+
declare function compareStyles(expected: Record<string, string>, el: HTMLElement): StyleComparison[];
|
|
484
|
+
/**
|
|
485
|
+
* Create a timer for measuring actual animation duration
|
|
486
|
+
* Uses performance.now() for high precision
|
|
487
|
+
*/
|
|
488
|
+
declare function createAnimationTimer(expectedDuration: number): AnimationTimer;
|
|
489
|
+
/**
|
|
490
|
+
* Format timing result for display
|
|
491
|
+
*/
|
|
492
|
+
declare function formatTimingResult(timing: TimingResult): string;
|
|
493
|
+
/**
|
|
494
|
+
* Extract animation info from WAAPI Animation object
|
|
495
|
+
*/
|
|
496
|
+
declare function captureAnimationInfo(animation: Animation): Record<string, unknown>;
|
|
497
|
+
/**
|
|
498
|
+
* Capture all active animations on an element
|
|
499
|
+
*/
|
|
500
|
+
declare function captureElementAnimations(el: HTMLElement): Record<string, unknown>[];
|
|
501
|
+
|
|
502
|
+
export { ANIMATION_CONFIGS, ANIMATION_DEFAULTS, AnimatedTokens, type AnimatedTokensProps, type AnimationData, type AnimationInfo, type AnimationTimer, type ChoreographySummary, ChoreographyTrackerClass, type DebugEvent, type DebugEventType, DebugProvider, EASINGS, EFFECTS, type FormatOptions, type OverlapInfo, PRESETS, type PositionCapture, type PositionData, RESPONSIVE_CONFIGS, SlidingNumber, type SlidingNumberProps, SlidingText, type SlidingTextProps, type StyleCapture, type StyleComparison, type StyleData, TIMING, TRANSFORMS, type TimelineEvent, type TimingData, type TimingResult, type Token, animatedTokensStyles, calculatePositionDelta, captureAnimationInfo, captureComputedStyles, captureElementAnimations, capturePosition, capturePositionForLog, captureStylesForLog, choreographyTracker, compareStyles, createAnimationTimer, formatTimingResult, getResponsiveAnimatedTokensStyle, getResponsiveDuration, getResponsiveStagger, getSlidingTextTokenStyle, slidingTextStyles, useDebug, useWAAPIAnimations };
|