@hanzogui/animations-css 8.3.1 → 8.3.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC"}
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
@@ -0,0 +1,627 @@
1
+ import { normalizeTransition, getAnimatedProperties, hasAnimation as hasNormalizedAnimation, getEffectiveAnimation, getAnimationConfigsForKeys, } from '@hanzogui/animation-helpers';
2
+ import { useIsomorphicLayoutEffect } from '@hanzogui/constants';
3
+ import { ResetPresence, usePresence } from '@hanzogui/use-presence';
4
+ import { transformsToString } from '@hanzogui/web';
5
+ import React from 'react'; // import { animate } from '@hanzogui/cubic-bezier-animator'
6
+ const EXTRACT_MS_REGEX = /(\d+(?:\.\d+)?)\s*ms/;
7
+ const EXTRACT_S_REGEX = /(\d+(?:\.\d+)?)\s*s/;
8
+ /**
9
+ * Helper function to extract duration from CSS animation string
10
+ * Examples: "ease-in 200ms" -> 200, "cubic-bezier(0.215, 0.610, 0.355, 1.000) 400ms" -> 400
11
+ * "ease-in 0.5s" -> 500, "slow 2s" -> 2000
12
+ */
13
+ function extractDuration(animation) {
14
+ // Try to match milliseconds first
15
+ const msMatch = animation.match(EXTRACT_MS_REGEX);
16
+ if (msMatch) {
17
+ return Number.parseInt(msMatch[1], 10);
18
+ }
19
+ // Try to match seconds and convert to milliseconds
20
+ const sMatch = animation.match(EXTRACT_S_REGEX);
21
+ if (sMatch) {
22
+ return Math.round(Number.parseFloat(sMatch[1]) * 1000);
23
+ }
24
+ // Default to 300ms if no duration found
25
+ return 300;
26
+ }
27
+ const MS_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*ms/;
28
+ const S_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*s(?!tiffness)/;
29
+ /**
30
+ * Apply duration override to a CSS animation string
31
+ * Replaces the existing duration with the override value
32
+ */
33
+ function applyDurationOverride(animation, durationMs) {
34
+ // Replace ms duration
35
+ const msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`);
36
+ if (msReplaced !== animation) {
37
+ return msReplaced;
38
+ }
39
+ // Replace seconds duration
40
+ const sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`);
41
+ if (sReplaced !== animation) {
42
+ return sReplaced;
43
+ }
44
+ // No duration found, prepend the duration
45
+ return `${durationMs}ms ${animation}`;
46
+ }
47
+ // transform keys that need special handling
48
+ const TRANSFORM_KEYS = [
49
+ 'x',
50
+ 'y',
51
+ 'scale',
52
+ 'scaleX',
53
+ 'scaleY',
54
+ 'rotate',
55
+ 'rotateX',
56
+ 'rotateY',
57
+ 'rotateZ',
58
+ 'skewX',
59
+ 'skewY',
60
+ ];
61
+ /**
62
+ * Build a CSS transform string from a style object containing transform properties
63
+ */
64
+ function buildTransformString(style) {
65
+ if (!style)
66
+ return '';
67
+ const parts = [];
68
+ if (style.x !== undefined || style.y !== undefined) {
69
+ const x = style.x ?? 0;
70
+ const y = style.y ?? 0;
71
+ parts.push(`translate(${x}px, ${y}px)`);
72
+ }
73
+ if (style.scale !== undefined) {
74
+ parts.push(`scale(${style.scale})`);
75
+ }
76
+ if (style.scaleX !== undefined) {
77
+ parts.push(`scaleX(${style.scaleX})`);
78
+ }
79
+ if (style.scaleY !== undefined) {
80
+ parts.push(`scaleY(${style.scaleY})`);
81
+ }
82
+ if (style.rotate !== undefined) {
83
+ const val = style.rotate;
84
+ const unit = typeof val === 'string' && val.includes('deg') ? '' : 'deg';
85
+ parts.push(`rotate(${val}${unit})`);
86
+ }
87
+ if (style.rotateX !== undefined) {
88
+ parts.push(`rotateX(${style.rotateX}deg)`);
89
+ }
90
+ if (style.rotateY !== undefined) {
91
+ parts.push(`rotateY(${style.rotateY}deg)`);
92
+ }
93
+ if (style.rotateZ !== undefined) {
94
+ parts.push(`rotateZ(${style.rotateZ}deg)`);
95
+ }
96
+ if (style.skewX !== undefined) {
97
+ parts.push(`skewX(${style.skewX}deg)`);
98
+ }
99
+ if (style.skewY !== undefined) {
100
+ parts.push(`skewY(${style.skewY}deg)`);
101
+ }
102
+ return parts.join(' ');
103
+ }
104
+ /**
105
+ * Apply a style object to a DOM node, handling transform keys specially
106
+ */
107
+ function applyStylesToNode(node, style) {
108
+ if (!style)
109
+ return;
110
+ // collect transform values
111
+ const transformStr = buildTransformString(style);
112
+ if (transformStr) {
113
+ node.style.transform = transformStr;
114
+ }
115
+ // apply non-transform properties
116
+ for (const [key, value] of Object.entries(style)) {
117
+ if (TRANSFORM_KEYS.includes(key))
118
+ continue;
119
+ if (value === undefined)
120
+ continue;
121
+ if (key === 'opacity') {
122
+ node.style.opacity = String(value);
123
+ }
124
+ else if (key === 'backgroundColor') {
125
+ node.style.backgroundColor = String(value);
126
+ }
127
+ else if (key === 'color') {
128
+ node.style.color = String(value);
129
+ }
130
+ else {
131
+ // generic fallback
132
+ node.style[key] = typeof value === 'number' ? `${value}px` : String(value);
133
+ }
134
+ }
135
+ }
136
+ export function createAnimations(animations) {
137
+ const reactionListeners = new WeakMap();
138
+ return {
139
+ animations,
140
+ usePresence,
141
+ ResetPresence,
142
+ inputStyle: 'css',
143
+ outputStyle: 'css',
144
+ useAnimatedNumber(initial) {
145
+ const [val, setVal] = React.useState(initial);
146
+ const finishTimerRef = React.useRef(null);
147
+ return {
148
+ getInstance() {
149
+ return setVal;
150
+ },
151
+ getValue() {
152
+ return val;
153
+ },
154
+ setValue(next, config, onFinish) {
155
+ setVal(next);
156
+ // clear any pending finish callback from a previous setValue
157
+ if (finishTimerRef.current) {
158
+ clearTimeout(finishTimerRef.current);
159
+ finishTimerRef.current = null;
160
+ }
161
+ if (onFinish) {
162
+ if (!config ||
163
+ config.type === 'direct' ||
164
+ (config.type === 'timing' && config.duration === 0)) {
165
+ onFinish();
166
+ }
167
+ else {
168
+ // estimate duration: use explicit duration, or fall back to
169
+ // default CSS transition duration for spring-type configs
170
+ const duration = config.type === 'timing' ? config.duration : 300;
171
+ finishTimerRef.current = setTimeout(onFinish, duration);
172
+ }
173
+ }
174
+ // call reaction listeners with the new value
175
+ const listeners = reactionListeners.get(setVal);
176
+ if (listeners) {
177
+ listeners.forEach((listener) => listener(next));
178
+ }
179
+ },
180
+ stop() {
181
+ if (finishTimerRef.current) {
182
+ clearTimeout(finishTimerRef.current);
183
+ finishTimerRef.current = null;
184
+ }
185
+ },
186
+ };
187
+ },
188
+ useAnimatedNumberReaction({ value }, onValue) {
189
+ React.useEffect(() => {
190
+ const instance = value.getInstance();
191
+ let queue = reactionListeners.get(instance);
192
+ if (!queue) {
193
+ const next = new Set();
194
+ reactionListeners.set(instance, next);
195
+ queue = next;
196
+ }
197
+ queue.add(onValue);
198
+ return () => {
199
+ queue?.delete(onValue);
200
+ };
201
+ }, []);
202
+ },
203
+ useAnimatedNumberStyle(val, getStyle) {
204
+ return getStyle(val.getValue());
205
+ },
206
+ useAnimatedNumbersStyle(vals, getStyle) {
207
+ return getStyle(...vals.map((v) => v.getValue()));
208
+ },
209
+ // @ts-ignore - styleState is added by createComponent
210
+ useAnimations: ({ props, presence, style, componentState, stateRef, styleState, }) => {
211
+ const isHydrating = componentState.unmounted === true;
212
+ const isEntering = !!componentState.unmounted;
213
+ const isExiting = presence?.[0] === false;
214
+ const sendExitComplete = presence?.[1];
215
+ // Track if we just finished entering (transition from entering to not entering)
216
+ // This is needed because the CSS transition happens on the render AFTER t_unmounted is removed
217
+ const wasEnteringRef = React.useRef(isEntering);
218
+ const justFinishedEntering = wasEnteringRef.current && !isEntering;
219
+ React.useEffect(() => {
220
+ wasEnteringRef.current = isEntering;
221
+ });
222
+ // exit cycle guards to prevent stale/duplicate completion
223
+ const exitCycleIdRef = React.useRef(0);
224
+ const exitCompletedRef = React.useRef(false);
225
+ const wasExitingRef = React.useRef(false);
226
+ const exitInterruptedRef = React.useRef(false);
227
+ const sendExitCompleteRef = React.useRef(sendExitComplete);
228
+ const lastNonExitingStyleRef = React.useRef({});
229
+ sendExitCompleteRef.current = sendExitComplete;
230
+ // detect transition into/out of exiting state
231
+ const justStartedExiting = isExiting && !wasExitingRef.current;
232
+ const justStoppedExiting = !isExiting && wasExitingRef.current;
233
+ // start new exit cycle only on transition INTO exiting
234
+ if (justStartedExiting) {
235
+ exitCycleIdRef.current++;
236
+ exitCompletedRef.current = false;
237
+ }
238
+ // track interruptions so we know to force-restart transitions
239
+ if (justStoppedExiting) {
240
+ exitCycleIdRef.current++;
241
+ exitInterruptedRef.current = true;
242
+ }
243
+ // track previous exiting state
244
+ React.useEffect(() => {
245
+ wasExitingRef.current = isExiting;
246
+ });
247
+ useIsomorphicLayoutEffect(() => {
248
+ const host = stateRef.current.host;
249
+ if (isExiting || !host)
250
+ return;
251
+ const computedStyle = getComputedStyle(host);
252
+ lastNonExitingStyleRef.current = {
253
+ opacity: computedStyle.opacity,
254
+ };
255
+ });
256
+ // use effectiveTransition computed by createComponent (single source of truth)
257
+ const effectiveTransition = styleState?.effectiveTransition ?? props.transition;
258
+ // Normalize the transition prop to a consistent format
259
+ const normalized = normalizeTransition(effectiveTransition);
260
+ // Determine animation state and get effective animation
261
+ // Use 'enter' if we're entering OR if we just finished entering (transition is happening)
262
+ const animationState = isExiting
263
+ ? 'exit'
264
+ : isEntering || justFinishedEntering
265
+ ? 'enter'
266
+ : 'default';
267
+ const effectiveAnimationKey = getEffectiveAnimation(normalized, animationState);
268
+ const defaultAnimation = effectiveAnimationKey
269
+ ? animations[effectiveAnimationKey]
270
+ : null;
271
+ const animatedProperties = getAnimatedProperties(normalized);
272
+ // Determine which properties to animate
273
+ // - animateOnly prop is an exclusive filter (only animate those properties)
274
+ // - per-property configs WITHOUT a default = only animate those specific properties
275
+ // - per-property configs WITH a default = per-property overrides + default for rest
276
+ const hasDefault = normalized.default !== null ||
277
+ normalized.enter !== null ||
278
+ normalized.exit !== null;
279
+ const hasPerPropertyConfigs = animatedProperties.length > 0;
280
+ let keys;
281
+ if (props.animateOnly) {
282
+ // animateOnly is explicit filter
283
+ keys = props.animateOnly;
284
+ }
285
+ else if (hasPerPropertyConfigs && !hasDefault) {
286
+ // object format without default: { opacity: '200ms' } = only animate opacity
287
+ keys = animatedProperties;
288
+ }
289
+ else if (hasPerPropertyConfigs && hasDefault) {
290
+ // array format or object with default: 'all' first, then per-property overrides
291
+ // CSS transition specificity: later declarations override earlier ones for the same property
292
+ keys = ['all', ...animatedProperties];
293
+ }
294
+ else {
295
+ // simple string format: 'quick' = animate all
296
+ keys = ['all'];
297
+ }
298
+ useIsomorphicLayoutEffect(() => {
299
+ const host = stateRef.current.host;
300
+ if (!sendExitComplete || !isExiting || !host)
301
+ return;
302
+ const node = host;
303
+ // capture current cycle id for this effect
304
+ const cycleId = exitCycleIdRef.current;
305
+ // helper to complete exit with guards
306
+ const completeExit = () => {
307
+ if (cycleId !== exitCycleIdRef.current)
308
+ return;
309
+ if (exitCompletedRef.current)
310
+ return;
311
+ exitCompletedRef.current = true;
312
+ sendExitCompleteRef.current?.();
313
+ };
314
+ // if no properties to animate (animateOnly=[]), complete immediately
315
+ if (keys.length === 0) {
316
+ completeExit();
317
+ return;
318
+ }
319
+ // Force transition restart for interrupted exits
320
+ // When an exit is interrupted and restarted, the element may already be at
321
+ // the exit style, so no CSS transition fires. We need to:
322
+ // 1. Reset to non-exit state
323
+ // 2. Force reflow
324
+ // 3. Re-apply exit state to trigger transition
325
+ let rafId;
326
+ const wasInterrupted = exitInterruptedRef.current;
327
+ // flag to ignore transitioncancel during reset (we intentionally cancel the old transition)
328
+ let ignoreCancelEvents = wasInterrupted;
329
+ // get enter/exit styles for potential restart
330
+ const enterStyle = props.enterStyle;
331
+ const exitStyle = props.exitStyle;
332
+ // Build the exit transition string - needed for both normal and interrupted exits
333
+ const delayStr = normalized.delay ? ` ${normalized.delay}ms` : '';
334
+ const durationOverride = normalized.config?.duration;
335
+ const exitTransitionString = keys
336
+ .map((key) => {
337
+ const propAnimation = normalized.properties[key];
338
+ let animationValue = null;
339
+ if (typeof propAnimation === 'string') {
340
+ animationValue = animations[propAnimation];
341
+ }
342
+ else if (propAnimation &&
343
+ typeof propAnimation === 'object' &&
344
+ propAnimation.type) {
345
+ animationValue = animations[propAnimation.type];
346
+ }
347
+ else if (defaultAnimation) {
348
+ animationValue = defaultAnimation;
349
+ }
350
+ if (animationValue && durationOverride) {
351
+ animationValue = applyDurationOverride(animationValue, durationOverride);
352
+ }
353
+ return animationValue ? `${key} ${animationValue}${delayStr}` : null;
354
+ })
355
+ .filter(Boolean)
356
+ .join(', ');
357
+ const getResetValue = (key) => {
358
+ if (key === 'opacity') {
359
+ return (style?.opacity ??
360
+ props.opacity ??
361
+ lastNonExitingStyleRef.current.opacity ??
362
+ 1);
363
+ }
364
+ if (TRANSFORM_KEYS.includes(key)) {
365
+ return key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0;
366
+ }
367
+ return enterStyle?.[key];
368
+ };
369
+ if (wasInterrupted) {
370
+ exitInterruptedRef.current = false;
371
+ // disable transition, reset to enter state
372
+ node.style.transition = 'none';
373
+ // reset: apply active/open state for each exit property (not enterStyle,
374
+ // which may equal exitStyle — see comment in the normal exit path below)
375
+ if (exitStyle) {
376
+ const resetStyle = {};
377
+ for (const key of Object.keys(exitStyle)) {
378
+ const resetValue = getResetValue(key);
379
+ if (resetValue !== undefined) {
380
+ resetStyle[key] = resetValue;
381
+ }
382
+ }
383
+ applyStylesToNode(node, resetStyle);
384
+ }
385
+ else {
386
+ // fallback if no exitStyle defined
387
+ node.style.opacity = '1';
388
+ node.style.transform = 'none';
389
+ }
390
+ // force reflow
391
+ void node.offsetHeight;
392
+ }
393
+ else if (exitStyle) {
394
+ // For normal (non-interrupted) exits, we need to ensure the CSS transition is
395
+ // processed by the browser BEFORE the exitStyle takes effect. The issue is that
396
+ // React may have already applied exitStyle in the same render batch. To fix this:
397
+ // 1. Disable transition and reset to non-exit state
398
+ // 2. Force reflow so browser processes the reset
399
+ // 3. Use RAF to ensure we're in a new frame
400
+ // 4. Re-enable transition and apply exitStyle
401
+ // This mirrors the interrupted exit handling approach (which also uses RAF).
402
+ ignoreCancelEvents = true;
403
+ node.style.transition = 'none';
404
+ // Reset to the active/open state (not enterStyle, which may equal exitStyle).
405
+ // enterStyle is the "unmounted" initial state and can share values with exitStyle
406
+ // (e.g., both have opacity: 0). resetting to enterStyle would mean no value change
407
+ // when exitStyle is applied, so the CSS transition wouldn't fire.
408
+ const resetStyle = {};
409
+ for (const key of Object.keys(exitStyle)) {
410
+ const resetValue = getResetValue(key);
411
+ if (resetValue !== undefined) {
412
+ resetStyle[key] = resetValue;
413
+ }
414
+ }
415
+ applyStylesToNode(node, resetStyle);
416
+ // Force reflow
417
+ void node.offsetHeight;
418
+ // Use RAF to ensure transition is applied in a new frame
419
+ rafId = requestAnimationFrame(() => {
420
+ if (cycleId !== exitCycleIdRef.current)
421
+ return;
422
+ // Re-enable transition
423
+ node.style.transition = exitTransitionString;
424
+ // Force reflow to ensure transition is active
425
+ void node.offsetHeight;
426
+ // Apply exit styles - this triggers the animation
427
+ applyStylesToNode(node, exitStyle);
428
+ // Re-enable cancel event handling
429
+ ignoreCancelEvents = false;
430
+ });
431
+ }
432
+ /**
433
+ * Exit animation handling for Dialog/Modal components
434
+ *
435
+ * The Challenge: When users close dialogs (via Escape key or clicking outside),
436
+ * the element can disappear from the DOM before CSS transitions finish, which causes:
437
+ * 1. Dialogs to stick around on screen
438
+ * 2. Event handlers to stop working
439
+ *
440
+ * Fix: Calculate the MAXIMUM duration across all animated properties, not just
441
+ * the default. With animateOnly and per-property configs, different properties
442
+ * can have different durations, and we need to wait for the LONGEST one.
443
+ */
444
+ // calculate max duration across all animated properties
445
+ let maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200;
446
+ // check per-property animation durations using shared helper
447
+ const animationConfigs = getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation);
448
+ for (const animationValue of animationConfigs.values()) {
449
+ if (animationValue) {
450
+ const duration = extractDuration(animationValue);
451
+ if (duration > maxDuration) {
452
+ maxDuration = duration;
453
+ }
454
+ }
455
+ }
456
+ const delay = normalized.delay ?? 0;
457
+ const fallbackTimeout = maxDuration + delay;
458
+ const timeoutId = setTimeout(() => {
459
+ completeExit();
460
+ }, fallbackTimeout);
461
+ // track number of transitioning properties to wait for all to finish
462
+ // (each property fires its own transitionend event)
463
+ const transitioningProps = new Set(keys);
464
+ let completedCount = 0;
465
+ const onFinishAnimation = (event) => {
466
+ // only count transitions on THIS element, not bubbled from children
467
+ if (event.target !== node)
468
+ return;
469
+ // map CSS property names to our key names
470
+ // e.g., transitionend fires with propertyName 'transform' for scale/x/y
471
+ const eventProp = event.propertyName;
472
+ if (transitioningProps.has(eventProp) || eventProp === 'all') {
473
+ completedCount++;
474
+ // wait for all properties to finish
475
+ if (completedCount >= transitioningProps.size) {
476
+ clearTimeout(timeoutId);
477
+ completeExit();
478
+ }
479
+ }
480
+ };
481
+ // on cancel, still complete (element is exiting and animation was interrupted)
482
+ // the guards prevent duplicate completion if this is a stale cycle
483
+ const onCancelAnimation = () => {
484
+ // ignore cancel events during reset phase (we intentionally cancel the old transition)
485
+ if (ignoreCancelEvents)
486
+ return;
487
+ clearTimeout(timeoutId);
488
+ completeExit();
489
+ };
490
+ node.addEventListener('transitionend', onFinishAnimation);
491
+ node.addEventListener('transitioncancel', onCancelAnimation);
492
+ // For interrupted exits, re-enable transition and re-apply exit styles
493
+ // This must happen AFTER listeners are set up so we catch the transitionend
494
+ if (wasInterrupted) {
495
+ rafId = requestAnimationFrame(() => {
496
+ if (cycleId !== exitCycleIdRef.current)
497
+ return;
498
+ // re-enable transition using the pre-built string
499
+ node.style.transition = exitTransitionString;
500
+ // force reflow again
501
+ void node.offsetHeight;
502
+ // now apply exit styles - this triggers the transition
503
+ applyStylesToNode(node, exitStyle);
504
+ // re-enable cancel event handling now that reset is complete
505
+ ignoreCancelEvents = false;
506
+ });
507
+ }
508
+ return () => {
509
+ clearTimeout(timeoutId);
510
+ if (rafId !== undefined)
511
+ cancelAnimationFrame(rafId);
512
+ node.removeEventListener('transitionend', onFinishAnimation);
513
+ node.removeEventListener('transitioncancel', onCancelAnimation);
514
+ // restore transition: the exit handling sets node.style.transition='none'
515
+ // directly on the DOM (bypassing React). if exit is interrupted (e.g. same-key
516
+ // re-entry in AnimatePresence), React won't re-apply its managed transition
517
+ // value because it hasn't changed in the virtual DOM. clearing the inline
518
+ // override lets React's value take effect again.
519
+ node.style.transition = '';
520
+ };
521
+ }, [isExiting]);
522
+ // hanzogui doesnt even use animation output during hydration
523
+ if (isHydrating) {
524
+ return null;
525
+ }
526
+ // Check if we have any animation to apply
527
+ if (!hasNormalizedAnimation(normalized)) {
528
+ return null;
529
+ }
530
+ if (Array.isArray(style.transform)) {
531
+ style.transform = transformsToString(style.transform);
532
+ }
533
+ // Build CSS transition string
534
+ // TODO: we disabled the transform transition, because it will create issue for inverse function and animate function
535
+ // for non layout transform properties either use animate function or find a workaround to do it with css
536
+ const delayStr = normalized.delay ? ` ${normalized.delay}ms` : '';
537
+ const durationOverride = normalized.config?.duration;
538
+ style.transition = keys
539
+ .map((key) => {
540
+ // Check for property-specific animation, fall back to default
541
+ const propAnimation = normalized.properties[key];
542
+ let animationValue = null;
543
+ if (typeof propAnimation === 'string') {
544
+ animationValue = animations[propAnimation];
545
+ }
546
+ else if (propAnimation &&
547
+ typeof propAnimation === 'object' &&
548
+ propAnimation.type) {
549
+ animationValue = animations[propAnimation.type];
550
+ }
551
+ else if (defaultAnimation) {
552
+ animationValue = defaultAnimation;
553
+ }
554
+ // Apply global duration override if specified
555
+ if (animationValue && durationOverride) {
556
+ animationValue = applyDurationOverride(animationValue, durationOverride);
557
+ }
558
+ return animationValue ? `${key} ${animationValue}${delayStr}` : null;
559
+ })
560
+ .filter(Boolean)
561
+ .join(', ');
562
+ if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {
563
+ console.info('CSS animation', {
564
+ props,
565
+ animations,
566
+ normalized,
567
+ defaultAnimation,
568
+ style,
569
+ isEntering,
570
+ isExiting,
571
+ });
572
+ }
573
+ return { style, className: isEntering ? 't_unmounted' : '' };
574
+ },
575
+ };
576
+ }
577
+ // layout animations
578
+ // useIsomorphicLayoutEffect(() => {
579
+ // if (!host || !props.layout) {
580
+ // return
581
+ // }
582
+ // // @ts-ignore
583
+ // const boundingBox = host?.getBoundingClientRect()
584
+ // if (isChanged(initialPositionRef.current, boundingBox)) {
585
+ // const transform = invert(
586
+ // host,
587
+ // boundingBox,
588
+ // initialPositionRef.current
589
+ // )
590
+ // animate({
591
+ // from: transform,
592
+ // to: { x: 0, y: 0, scaleX: 1, scaleY: 1 },
593
+ // duration: 1000,
594
+ // onUpdate: ({ x, y, scaleX, scaleY }) => {
595
+ // // @ts-ignore
596
+ // host.style.transform = `translate(${x}px, ${y}px) scaleX(${scaleX}) scaleY(${scaleY})`
597
+ // // TODO: handle childRef inverse scale
598
+ // // childRef.current.style.transform = `scaleX(${1 / scaleX}) scaleY(${
599
+ // // 1 / scaleY
600
+ // // })`
601
+ // },
602
+ // // TODO: extract ease-in from string and convert/map it to a cubicBezier array
603
+ // cubicBezier: [0, 1.38, 1, -0.41],
604
+ // })
605
+ // }
606
+ // initialPositionRef.current = boundingBox
607
+ // })
608
+ // style.transition = `${keys} ${animation}${
609
+ // props.layout ? ',width 0s, height 0s, margin 0s, padding 0s, transform' : ''
610
+ // }`
611
+ // const isChanged = (initialBox: any, finalBox: any) => {
612
+ // // we just mounted, so we don't have complete data yet
613
+ // if (!initialBox || !finalBox) return false
614
+ // // deep compare the two boxes
615
+ // return JSON.stringify(initialBox) !== JSON.stringify(finalBox)
616
+ // }
617
+ // const invert = (el, from, to) => {
618
+ // const { x: fromX, y: fromY, width: fromWidth, height: fromHeight } = from
619
+ // const { x, y, width, height } = to
620
+ // const transform = {
621
+ // x: x - fromX - (fromWidth - width) / 2,
622
+ // y: y - fromY - (fromHeight - height) / 2,
623
+ // scaleX: width / fromWidth,
624
+ // scaleY: height / fromHeight,
625
+ // }
626
+ // el.style.transform = `
627
+ //# sourceMappingURL=createAnimations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createAnimations.js","sourceRoot":"","sources":["../../src/createAnimations.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,IAAI,sBAAsB,EACtC,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAmB,MAAM,OAAO,CAAA,CAAC,4DAA4D;AAEpG,MAAM,gBAAgB,GAAG,sBAAsB,CAAA;AAC/C,MAAM,eAAe,GAAG,qBAAqB,CAAA;AAE7C;;;;GAIG;AACH,SAAS,eAAe,CAAC,SAAiB;IACxC,kCAAkC;IAClC,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;IACjD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACxC,CAAC;IAED,mDAAmD;IACnD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;IAC/C,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IACxD,CAAC;IAED,wCAAwC;IACxC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,iBAAiB,GAAG,sBAAsB,CAAA;AAChD,MAAM,gBAAgB,GAAG,iCAAiC,CAAA;AAE1D;;;GAGG;AACH,SAAS,qBAAqB,CA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