@hanzogui/animations-css 8.3.1 → 8.3.3

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