@tamagui/animations-css 2.1.0 → 2.2.0-1781071309197

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.
@@ -217,6 +217,9 @@ function createAnimations(animations) {
217
217
  const exitCompletedRef = import_react.default.useRef(false);
218
218
  const wasExitingRef = import_react.default.useRef(false);
219
219
  const exitInterruptedRef = import_react.default.useRef(false);
220
+ const sendExitCompleteRef = import_react.default.useRef(sendExitComplete);
221
+ const lastNonExitingStyleRef = import_react.default.useRef({});
222
+ sendExitCompleteRef.current = sendExitComplete;
220
223
  const justStartedExiting = isExiting && !wasExitingRef.current;
221
224
  const justStoppedExiting = !isExiting && wasExitingRef.current;
222
225
  if (justStartedExiting) {
@@ -230,6 +233,14 @@ function createAnimations(animations) {
230
233
  import_react.default.useEffect(() => {
231
234
  wasExitingRef.current = isExiting;
232
235
  });
236
+ (0, import_constants.useIsomorphicLayoutEffect)(() => {
237
+ const host = stateRef.current.host;
238
+ if (isExiting || !host) return;
239
+ const computedStyle = getComputedStyle(host);
240
+ lastNonExitingStyleRef.current = {
241
+ opacity: computedStyle.opacity
242
+ };
243
+ });
233
244
  const effectiveTransition = styleState?.effectiveTransition ?? props.transition;
234
245
  const normalized = (0, import_animation_helpers.normalizeTransition)(effectiveTransition);
235
246
  const animationState = isExiting ? "exit" : isEntering || justFinishedEntering ? "enter" : "default";
@@ -257,7 +268,7 @@ function createAnimations(animations) {
257
268
  if (cycleId !== exitCycleIdRef.current) return;
258
269
  if (exitCompletedRef.current) return;
259
270
  exitCompletedRef.current = true;
260
- sendExitComplete();
271
+ sendExitCompleteRef.current?.();
261
272
  };
262
273
  if (keys.length === 0) {
263
274
  completeExit();
@@ -285,18 +296,24 @@ function createAnimations(animations) {
285
296
  }
286
297
  return animationValue ? `${key} ${animationValue}${delayStr2}` : null;
287
298
  }).filter(Boolean).join(", ");
299
+ const getResetValue = key => {
300
+ if (key === "opacity") {
301
+ return style?.opacity ?? props.opacity ?? lastNonExitingStyleRef.current.opacity ?? 1;
302
+ }
303
+ if (TRANSFORM_KEYS.includes(key)) {
304
+ return key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
305
+ }
306
+ return enterStyle?.[key];
307
+ };
288
308
  if (wasInterrupted) {
289
309
  exitInterruptedRef.current = false;
290
310
  node.style.transition = "none";
291
311
  if (exitStyle) {
292
312
  const resetStyle = {};
293
313
  for (const key of Object.keys(exitStyle)) {
294
- if (key === "opacity") {
295
- resetStyle[key] = 1;
296
- } else if (TRANSFORM_KEYS.includes(key)) {
297
- resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
298
- } else if (enterStyle?.[key] !== void 0) {
299
- resetStyle[key] = enterStyle[key];
314
+ const resetValue = getResetValue(key);
315
+ if (resetValue !== void 0) {
316
+ resetStyle[key] = resetValue;
300
317
  }
301
318
  }
302
319
  applyStylesToNode(node, resetStyle);
@@ -310,12 +327,9 @@ function createAnimations(animations) {
310
327
  node.style.transition = "none";
311
328
  const resetStyle = {};
312
329
  for (const key of Object.keys(exitStyle)) {
313
- if (key === "opacity") {
314
- resetStyle[key] = 1;
315
- } else if (TRANSFORM_KEYS.includes(key)) {
316
- resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
317
- } else if (enterStyle?.[key] !== void 0) {
318
- resetStyle[key] = enterStyle[key];
330
+ const resetValue = getResetValue(key);
331
+ if (resetValue !== void 0) {
332
+ resetStyle[key] = resetValue;
319
333
  }
320
334
  }
321
335
  applyStylesToNode(node, resetStyle);
@@ -379,7 +393,7 @@ function createAnimations(animations) {
379
393
  node.removeEventListener("transitioncancel", onCancelAnimation);
380
394
  node.style.transition = "";
381
395
  };
382
- }, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]);
396
+ }, [isExiting]);
383
397
  if (isHydrating) {
384
398
  return null;
385
399
  }
@@ -252,6 +252,9 @@ function createAnimations(animations) {
252
252
  var exitCompletedRef = import_react.default.useRef(false);
253
253
  var wasExitingRef = import_react.default.useRef(false);
254
254
  var exitInterruptedRef = import_react.default.useRef(false);
255
+ var sendExitCompleteRef = import_react.default.useRef(sendExitComplete);
256
+ var lastNonExitingStyleRef = import_react.default.useRef({});
257
+ sendExitCompleteRef.current = sendExitComplete;
255
258
  var justStartedExiting = isExiting && !wasExitingRef.current;
256
259
  var justStoppedExiting = !isExiting && wasExitingRef.current;
257
260
  if (justStartedExiting) {
@@ -265,6 +268,14 @@ function createAnimations(animations) {
265
268
  import_react.default.useEffect(function () {
266
269
  wasExitingRef.current = isExiting;
267
270
  });
271
+ (0, import_constants.useIsomorphicLayoutEffect)(function () {
272
+ var host = stateRef.current.host;
273
+ if (isExiting || !host) return;
274
+ var computedStyle = getComputedStyle(host);
275
+ lastNonExitingStyleRef.current = {
276
+ opacity: computedStyle.opacity
277
+ };
278
+ });
268
279
  var _styleState_effectiveTransition;
269
280
  var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
270
281
  var normalized = (0, import_animation_helpers.normalizeTransition)(effectiveTransition);
@@ -291,10 +302,11 @@ function createAnimations(animations) {
291
302
  var node = host;
292
303
  var cycleId = exitCycleIdRef.current;
293
304
  var completeExit = function () {
305
+ var _sendExitCompleteRef_current;
294
306
  if (cycleId !== exitCycleIdRef.current) return;
295
307
  if (exitCompletedRef.current) return;
296
308
  exitCompletedRef.current = true;
297
- sendExitComplete();
309
+ (_sendExitCompleteRef_current = sendExitCompleteRef.current) === null || _sendExitCompleteRef_current === void 0 ? void 0 : _sendExitCompleteRef_current.call(sendExitCompleteRef);
298
310
  };
299
311
  if (keys.length === 0) {
300
312
  completeExit();
@@ -322,6 +334,16 @@ function createAnimations(animations) {
322
334
  }
323
335
  return animationValue2 ? `${key2} ${animationValue2}${delayStr2}` : null;
324
336
  }).filter(Boolean).join(", ");
337
+ var getResetValue = function (key2) {
338
+ if (key2 === "opacity") {
339
+ var _style_opacity, _ref, _ref1;
340
+ return (_ref1 = (_ref = (_style_opacity = style === null || style === void 0 ? void 0 : style.opacity) !== null && _style_opacity !== void 0 ? _style_opacity : props.opacity) !== null && _ref !== void 0 ? _ref : lastNonExitingStyleRef.current.opacity) !== null && _ref1 !== void 0 ? _ref1 : 1;
341
+ }
342
+ if (TRANSFORM_KEYS.includes(key2)) {
343
+ return key2 === "scale" || key2 === "scaleX" || key2 === "scaleY" ? 1 : 0;
344
+ }
345
+ return enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key2];
346
+ };
325
347
  if (wasInterrupted) {
326
348
  exitInterruptedRef.current = false;
327
349
  node.style.transition = "none";
@@ -333,12 +355,9 @@ function createAnimations(animations) {
333
355
  try {
334
356
  for (var _iterator = Object.keys(exitStyle)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
335
357
  var key = _step.value;
336
- if (key === "opacity") {
337
- resetStyle[key] = 1;
338
- } else if (TRANSFORM_KEYS.includes(key)) {
339
- resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
340
- } else if ((enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key]) !== void 0) {
341
- resetStyle[key] = enterStyle[key];
358
+ var resetValue = getResetValue(key);
359
+ if (resetValue !== void 0) {
360
+ resetStyle[key] = resetValue;
342
361
  }
343
362
  }
344
363
  } catch (err) {
@@ -371,12 +390,9 @@ function createAnimations(animations) {
371
390
  try {
372
391
  for (var _iterator1 = Object.keys(exitStyle)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
373
392
  var key1 = _step1.value;
374
- if (key1 === "opacity") {
375
- resetStyle1[key1] = 1;
376
- } else if (TRANSFORM_KEYS.includes(key1)) {
377
- resetStyle1[key1] = key1 === "scale" || key1 === "scaleX" || key1 === "scaleY" ? 1 : 0;
378
- } else if ((enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key1]) !== void 0) {
379
- resetStyle1[key1] = enterStyle[key1];
393
+ var resetValue1 = getResetValue(key1);
394
+ if (resetValue1 !== void 0) {
395
+ resetStyle1[key1] = resetValue1;
380
396
  }
381
397
  }
382
398
  } catch (err) {
@@ -474,7 +490,7 @@ function createAnimations(animations) {
474
490
  node.removeEventListener("transitioncancel", onCancelAnimation);
475
491
  node.style.transition = "";
476
492
  };
477
- }, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]);
493
+ }, [isExiting]);
478
494
  if (isHydrating) {
479
495
  return null;
480
496
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","createAnimations_exports","__export","createAnimations","module","exports","import_animation_helpers","require","import_constants","import_use_presence","import_web","import_react","__toESM","_type_of","obj","Symbol","constructor","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","_style_x","_style_y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","key","opacity","String","backgroundColor","color","err","return","animations","reactionListeners","WeakMap","usePresence","ResetPresence","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","default","useState","finishTimerRef","useRef","getInstance","getValue","setValue","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","param","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimatedNumbersStyle","vals","map","v","useAnimations","props","presence","componentState","stateRef","styleState","_normalized_config","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","justStartedExiting","justStoppedExiting","_styleState_effectiveTransition","effectiveTransition","transition","normalized","normalizeTransition","animationState","effectiveAnimationKey","getEffectiveAnimation","defaultAnimation","animatedProperties","getAnimatedProperties","hasDefault","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","useIsomorphicLayoutEffect","_normalized_config2","host","cycleId","completeExit","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","key2","propAnimation","properties","animationValue2","filter","Boolean","resetStyle","offsetHeight","resetStyle1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","requestAnimationFrame","maxDuration","animationConfigs","getAnimationConfigsForKeys","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_iterator2","values","_step2","animationValue","_normalized_delay","fallbackTimeout","timeoutId","transitioningProps","completedCount","onFinishAnimation","event","target","eventProp","propertyName","has","size"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAA,CAAAK,wBAMO;AACP,IAAAK,wBAA0C,GAAAC,OAAA;AAC1C,IAAAC,gBAAA,GAAAD,OAA2C;AAE3C,IAAAE,mBAAmC,GAAAF,OAAA;AACnC,IAAAG,UAAA,GAAAH,OAAgC;AAEhC,IAAAI,YAAM,GAAAC,OAAmB,CAAAL,OAAA;AACzB,SAAMM,SAAAC,GAAA;EAON,uBAAyB;;EAEvB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AhI,IAAA,IAAAC,IAAA,GAAA4H,0BAAA;YACvC,IAAOM,cAAA,GAAAD,MAAA,CAAAxM,KAAA;YACT,IAAAyM,cAAA;cAEI,IAAMpG,QAAQ,GAAAlF,eAAkB,CAAAsL,cAAA;cAC5B,IAAApG,QAAA,GAAA2F,WAAY;gBACpBA,WAAA,GAAA3F,QAAA;cAKM;YACA;UACN;QAGI,SAAMxB,GAAA;UACNuH,kBAAI,GAAgC;UAEpCC,eAAW,GAAAxH,GAAA;QACT;UACF;YAKE,KAAAsH,0BAA4B,IAAAG,UAAkB,CAAAxH,MAAA;cAChDwH,UAAW,CAAAxH,MAAA;YACT;UACF;YAGI,IAAAsH,kBAAkB;cACpB,MAAAC,eAAiB;YACnB;UAEA;QACD;QAIH,IAAIK,iBAAY;QACd,IAAA7B,KAAQ,IAAK6B,iBAAiB,GAAAvD,UAAA,CAAA0B,KAAA,cAAA6B,iBAAA,cAAAA,iBAAA;QAAA,IAC5BC,eAAA,GAAAX,WAAA,GAAAnB,KAAA;QAAA,IACA+B,SAAA,GAAAtG,UAAA;UACAgE,YAAA;QAAA,GACAqC,eAAA;QAAA,IACAE,kBAAA,OAAA3F,GAAA,CAAA8C,IAAA;QAAA,IACA8C,cAAA;QAAA,IACAC,iBAAA,YAAAA,CAAAC,KAAA;UACD,IAAAA,KAAA,CAAAC,MAAA,KAAAtJ,IAAA;UACH,IAAAuJ,SAAA,GAAAF,KAAA,CAAAG,YAAA;UAEA,IAAON,kBAAS,CAAWO,GAAA,CAAAF,SAAa,KAAAA,SAAA,KAAmB;YAC7DJ,cAAA;YACF,IAAAA,cAAA,IAAAD,kBAAA,CAAAQ,IAAA;cACFlH,YAAA,CAAAyG,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","createAnimations_exports","createAnimations","module","exports","import_animation_helpers","require","import_constants","import_use_presence","import_web","import_react","_type_of","obj","Symbol","constructor","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","_style_x","_style_y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","entries","iterator","_step","next","done","opacity","String","backgroundColor","color","err","return","animations","reactionListeners","WeakMap","usePresence","ResetPresence","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","default","useState","finishTimerRef","useRef","getInstance","getValue","setValue","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","forEach","listener","stop","useAnimatedNumberReaction","param","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimatedNumbersStyle","vals","map","v","useAnimations","props","presence","componentState","stateRef","styleState","_normalized_config","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","sendExitCompleteRef","lastNonExitingStyleRef","justStartedExiting","justStoppedExiting","useIsomorphicLayoutEffect","host","computedStyle","getComputedStyle","_styleState_effectiveTransition","effectiveTransition","transition","normalized","normalizeTransition","animationState","effectiveAnimationKey","getEffectiveAnimation","defaultAnimation","animatedProperties","getAnimatedProperties","hasDefault","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","_normalized_config2","cycleId","completeExit","_sendExitCompleteRef_current","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","key2","propAnimation","properties","animationValue2","filter","Boolean","getResetValue","_style_opacity","_ref","_ref1","resetStyle","resetValue","offsetHeight","resetStyle1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","resetValue1","requestAnimationFrame","maxDuration","animationConfigs","getAnimationConfigsForKeys","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_iterator2","values","_step2","animationValue","_normalized_delay","fallbackTimeout","timeoutId","transitioningProps","completedCount","onFinishAnimation","event","eventProp","propertyName","has","size","onCancelAnimation","addEventListener","cancelAnimationFrame","removeEventListener","hasAnimation","Array","isArray","transformsToString","delayStr","durationOverride","process","env","NODE_ENV","console","info","className"],"sources":["createAnimations.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createAnimations_exports = {};\n__export(createAnimations_exports, {\n createAnimations: () => createAnimations\n});\nmodule.exports = __toCommonJS(createAnimations_exports);\nvar import_animation_helpers = require(\"@tamagui/animation-helpers\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_use_presence = require(\"@tamagui/use-presence\");\nvar import_web = require(\"@tamagui/web\");\nvar import_react = __toESM(require(\"react\"), 1);\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar EXTRACT_MS_REGEX = /(\\d+(?:\\.\\d+)?)\\s*ms/;\nvar EXTRACT_S_REGEX = /(\\d+(?:\\.\\d+)?)\\s*s/;\nfunction extractDuration(animation) {\n var msMatch = animation.match(EXTRACT_MS_REGEX);\n if (msMatch) {\n return Number.parseInt(msMatch[1], 10);\n }\n var sMatch = animation.match(EXTRACT_S_REGEX);\n if (sMatch) {\n return Math.round(Number.parseFloat(sMatch[1]) * 1e3);\n }\n return 300;\n}\nvar MS_DURATION_REGEX = /(\\d+(?:\\.\\d+)?)\\s*ms/;\nvar S_DURATION_REGEX = /(\\d+(?:\\.\\d+)?)\\s*s(?!tiffness)/;\nfunction applyDurationOverride(animation, durationMs) {\n var msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`);\n if (msReplaced !== animation) {\n return msReplaced;\n }\n var sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`);\n if (sReplaced !== animation) {\n return sReplaced;\n }\n return `${durationMs}ms ${animation}`;\n}\nvar TRANSFORM_KEYS = [\n \"x\",\n \"y\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skewX\",\n \"skewY\"\n];\nfunction buildTransformString(style) {\n if (!style) return \"\";\n var parts = [];\n if (style.x !== void 0 || style.y !== void 0) {\n var _style_x;\n var x = (_style_x = style.x) !== null && _style_x !== void 0 ? _style_x : 0;\n var _style_y;\n var y = (_style_y = style.y) !== null && _style_y !== void 0 ? _style_y : 0;\n parts.push(`translate(${x}px, ${y}px)`);\n }\n if (style.scale !== void 0) {\n parts.push(`scale(${style.scale})`);\n }\n if (style.scaleX !== void 0) {\n parts.push(`scaleX(${style.scaleX})`);\n }\n if (style.scaleY !== void 0) {\n parts.push(`scaleY(${style.scaleY})`);\n }\n if (style.rotate !== void 0) {\n var val = style.rotate;\n var unit = typeof val === \"string\" && val.includes(\"deg\") ? \"\" : \"deg\";\n parts.push(`rotate(${val}${unit})`);\n }\n if (style.rotateX !== void 0) {\n parts.push(`rotateX(${style.rotateX}deg)`);\n }\n if (style.rotateY !== void 0) {\n parts.push(`rotateY(${style.rotateY}deg)`);\n }\n if (style.rotateZ !== void 0) {\n parts.push(`rotateZ(${style.rotateZ}deg)`);\n }\n if (style.skewX !== void 0) {\n parts.push(`skewX(${style.skewX}deg)`);\n }\n if (style.skewY !== void 0) {\n parts.push(`skewY(${style.skewY}deg)`);\n }\n return parts.join(\" \");\n}\nfunction applyStylesToNode(node, style) {\n if (!style) return;\n var transformStr = buildTransformString(style);\n if (transformStr) {\n node.style.transform = transformStr;\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(style)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, value] = _step.value;\n if (TRANSFORM_KEYS.includes(key)) continue;\n if (value === void 0) continue;\n if (key === \"opacity\") {\n node.style.opacity = String(value);\n } else if (key === \"backgroundColor\") {\n node.style.backgroundColor = String(value);\n } else if (key === \"color\") {\n node.style.color = String(value);\n } else {\n node.style[key] = typeof value === \"number\" ? `${value}px` : String(value);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction createAnimations(animations) {\n var reactionListeners = /* @__PURE__ */ new WeakMap();\n return {\n animations,\n usePresence: import_use_presence.usePresence,\n ResetPresence: import_use_presence.ResetPresence,\n inputStyle: \"css\",\n outputStyle: \"css\",\n useAnimatedNumber(initial) {\n var [val, setVal] = import_react.default.useState(initial);\n var finishTimerRef = import_react.default.useRef(null);\n return {\n getInstance() {\n return setVal;\n },\n getValue() {\n return val;\n },\n setValue(next, config, onFinish) {\n setVal(next);\n if (finishTimerRef.current) {\n clearTimeout(finishTimerRef.current);\n finishTimerRef.current = null;\n }\n if (onFinish) {\n if (!config || config.type === \"direct\" || config.type === \"timing\" && config.duration === 0) {\n onFinish();\n } else {\n var duration = config.type === \"timing\" ? config.duration : 300;\n finishTimerRef.current = setTimeout(onFinish, duration);\n }\n }\n var listeners = reactionListeners.get(setVal);\n if (listeners) {\n listeners.forEach(function(listener) {\n return listener(next);\n });\n }\n },\n stop() {\n if (finishTimerRef.current) {\n clearTimeout(finishTimerRef.current);\n finishTimerRef.current = null;\n }\n }\n };\n },\n useAnimatedNumberReaction(param, onValue) {\n var { value } = param;\n import_react.default.useEffect(function() {\n var instance = value.getInstance();\n var queue = reactionListeners.get(instance);\n if (!queue) {\n var next = /* @__PURE__ */ new Set();\n reactionListeners.set(instance, next);\n queue = next;\n }\n queue.add(onValue);\n return function() {\n queue === null || queue === void 0 ? void 0 : queue.delete(onValue);\n };\n }, []);\n },\n useAnimatedNumberStyle(val, getStyle) {\n return getStyle(val.getValue());\n },\n useAnimatedNumbersStyle(vals, getStyle) {\n return getStyle(...vals.map(function(v) {\n return v.getValue();\n }));\n },\n // @ts-ignore - styleState is added by createComponent\n useAnimations: function(param) {\n var { props, presence, style, componentState, stateRef, styleState } = param;\n var _normalized_config;\n var isHydrating = componentState.unmounted === true;\n var isEntering = !!componentState.unmounted;\n var isExiting = (presence === null || presence === void 0 ? void 0 : presence[0]) === false;\n var sendExitComplete = presence === null || presence === void 0 ? void 0 : presence[1];\n var wasEnteringRef = import_react.default.useRef(isEntering);\n var justFinishedEntering = wasEnteringRef.current && !isEntering;\n import_react.default.useEffect(function() {\n wasEnteringRef.current = isEntering;\n });\n var exitCycleIdRef = import_react.default.useRef(0);\n var exitCompletedRef = import_react.default.useRef(false);\n var wasExitingRef = import_react.default.useRef(false);\n var exitInterruptedRef = import_react.default.useRef(false);\n var sendExitCompleteRef = import_react.default.useRef(sendExitComplete);\n var lastNonExitingStyleRef = import_react.default.useRef({});\n sendExitCompleteRef.current = sendExitComplete;\n var justStartedExiting = isExiting && !wasExitingRef.current;\n var justStoppedExiting = !isExiting && wasExitingRef.current;\n if (justStartedExiting) {\n exitCycleIdRef.current++;\n exitCompletedRef.current = false;\n }\n if (justStoppedExiting) {\n exitCycleIdRef.current++;\n exitInterruptedRef.current = true;\n }\n import_react.default.useEffect(function() {\n wasExitingRef.current = isExiting;\n });\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n var host = stateRef.current.host;\n if (isExiting || !host) return;\n var computedStyle = getComputedStyle(host);\n lastNonExitingStyleRef.current = {\n opacity: computedStyle.opacity\n };\n });\n var _styleState_effectiveTransition;\n var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;\n var normalized = (0, import_animation_helpers.normalizeTransition)(effectiveTransition);\n var animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n var effectiveAnimationKey = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);\n var defaultAnimation = effectiveAnimationKey ? animations[effectiveAnimationKey] : null;\n var animatedProperties = (0, import_animation_helpers.getAnimatedProperties)(normalized);\n var hasDefault = normalized.default !== null || normalized.enter !== null || normalized.exit !== null;\n var hasPerPropertyConfigs = animatedProperties.length > 0;\n var keys;\n if (props.animateOnly) {\n keys = props.animateOnly;\n } else if (hasPerPropertyConfigs && !hasDefault) {\n keys = animatedProperties;\n } else if (hasPerPropertyConfigs && hasDefault) {\n keys = [\n \"all\",\n ...animatedProperties\n ];\n } else {\n keys = [\n \"all\"\n ];\n }\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n var _normalized_config2;\n var host = stateRef.current.host;\n if (!sendExitComplete || !isExiting || !host) return;\n var node = host;\n var cycleId = exitCycleIdRef.current;\n var completeExit = function() {\n var _sendExitCompleteRef_current;\n if (cycleId !== exitCycleIdRef.current) return;\n if (exitCompletedRef.current) return;\n exitCompletedRef.current = true;\n (_sendExitCompleteRef_current = sendExitCompleteRef.current) === null || _sendExitCompleteRef_current === void 0 ? void 0 : _sendExitCompleteRef_current.call(sendExitCompleteRef);\n };\n if (keys.length === 0) {\n completeExit();\n return;\n }\n var rafId;\n var wasInterrupted = exitInterruptedRef.current;\n var ignoreCancelEvents = wasInterrupted;\n var enterStyle = props.enterStyle;\n var exitStyle = props.exitStyle;\n var delayStr2 = normalized.delay ? ` ${normalized.delay}ms` : \"\";\n var durationOverride2 = (_normalized_config2 = normalized.config) === null || _normalized_config2 === void 0 ? void 0 : _normalized_config2.duration;\n var exitTransitionString = keys.map(function(key2) {\n var propAnimation = normalized.properties[key2];\n var animationValue2 = null;\n if (typeof propAnimation === \"string\") {\n animationValue2 = animations[propAnimation];\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\" && propAnimation.type) {\n animationValue2 = animations[propAnimation.type];\n } else if (defaultAnimation) {\n animationValue2 = defaultAnimation;\n }\n if (animationValue2 && durationOverride2) {\n animationValue2 = applyDurationOverride(animationValue2, durationOverride2);\n }\n return animationValue2 ? `${key2} ${animationValue2}${delayStr2}` : null;\n }).filter(Boolean).join(\", \");\n var getResetValue = function(key2) {\n if (key2 === \"opacity\") {\n var _style_opacity, _ref, _ref1;\n return (_ref1 = (_ref = (_style_opacity = style === null || style === void 0 ? void 0 : style.opacity) !== null && _style_opacity !== void 0 ? _style_opacity : props.opacity) !== null && _ref !== void 0 ? _ref : lastNonExitingStyleRef.current.opacity) !== null && _ref1 !== void 0 ? _ref1 : 1;\n }\n if (TRANSFORM_KEYS.includes(key2)) {\n return key2 === \"scale\" || key2 === \"scaleX\" || key2 === \"scaleY\" ? 1 : 0;\n }\n return enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key2];\n };\n if (wasInterrupted) {\n exitInterruptedRef.current = false;\n node.style.transition = \"none\";\n if (exitStyle) {\n var resetStyle = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.keys(exitStyle)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n var resetValue = getResetValue(key);\n if (resetValue !== void 0) {\n resetStyle[key] = resetValue;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n applyStylesToNode(node, resetStyle);\n } else {\n node.style.opacity = \"1\";\n node.style.transform = \"none\";\n }\n void node.offsetHeight;\n } else if (exitStyle) {\n ignoreCancelEvents = true;\n node.style.transition = \"none\";\n var resetStyle1 = {};\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = Object.keys(exitStyle)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var key1 = _step1.value;\n var resetValue1 = getResetValue(key1);\n if (resetValue1 !== void 0) {\n resetStyle1[key1] = resetValue1;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n applyStylesToNode(node, resetStyle1);\n void node.offsetHeight;\n rafId = requestAnimationFrame(function() {\n if (cycleId !== exitCycleIdRef.current) return;\n node.style.transition = exitTransitionString;\n void node.offsetHeight;\n applyStylesToNode(node, exitStyle);\n ignoreCancelEvents = false;\n });\n }\n var maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200;\n var animationConfigs = (0, import_animation_helpers.getAnimationConfigsForKeys)(normalized, animations, keys, defaultAnimation);\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = animationConfigs.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var animationValue = _step2.value;\n if (animationValue) {\n var duration = extractDuration(animationValue);\n if (duration > maxDuration) {\n maxDuration = duration;\n }\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n var _normalized_delay;\n var delay = (_normalized_delay = normalized.delay) !== null && _normalized_delay !== void 0 ? _normalized_delay : 0;\n var fallbackTimeout = maxDuration + delay;\n var timeoutId = setTimeout(function() {\n completeExit();\n }, fallbackTimeout);\n var transitioningProps = new Set(keys);\n var completedCount = 0;\n var onFinishAnimation = function(event) {\n if (event.target !== node) return;\n var eventProp = event.propertyName;\n if (transitioningProps.has(eventProp) || eventProp === \"all\") {\n completedCount++;\n if (completedCount >= transitioningProps.size) {\n clearTimeout(timeoutId);\n completeExit();\n }\n }\n };\n var onCancelAnimation = function() {\n if (ignoreCancelEvents) return;\n clearTimeout(timeoutId);\n completeExit();\n };\n node.addEventListener(\"transitionend\", onFinishAnimation);\n node.addEventListener(\"transitioncancel\", onCancelAnimation);\n if (wasInterrupted) {\n rafId = requestAnimationFrame(function() {\n if (cycleId !== exitCycleIdRef.current) return;\n node.style.transition = exitTransitionString;\n void node.offsetHeight;\n applyStylesToNode(node, exitStyle);\n ignoreCancelEvents = false;\n });\n }\n return function() {\n clearTimeout(timeoutId);\n if (rafId !== void 0) cancelAnimationFrame(rafId);\n node.removeEventListener(\"transitionend\", onFinishAnimation);\n node.removeEventListener(\"transitioncancel\", onCancelAnimation);\n node.style.transition = \"\";\n };\n }, [\n isExiting\n ]);\n if (isHydrating) {\n return null;\n }\n if (!(0, import_animation_helpers.hasAnimation)(normalized)) {\n return null;\n }\n if (Array.isArray(style.transform)) {\n style.transform = (0, import_web.transformsToString)(style.transform);\n }\n var delayStr = normalized.delay ? ` ${normalized.delay}ms` : \"\";\n var durationOverride = (_normalized_config = normalized.config) === null || _normalized_config === void 0 ? void 0 : _normalized_config.duration;\n style.transition = keys.map(function(key) {\n var propAnimation = normalized.properties[key];\n var animationValue = null;\n if (typeof propAnimation === \"string\") {\n animationValue = animations[propAnimation];\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\" && propAnimation.type) {\n animationValue = animations[propAnimation.type];\n } else if (defaultAnimation) {\n animationValue = defaultAnimation;\n }\n if (animationValue && durationOverride) {\n animationValue = applyDurationOverride(animationValue, durationOverride);\n }\n return animationValue ? `${key} ${animationValue}${delayStr}` : null;\n }).filter(Boolean).join(\", \");\n if (process.env.NODE_ENV === \"development\" && props[\"debug\"] === \"verbose\") {\n console.info(\"CSS animation\", {\n props,\n animations,\n normalized,\n defaultAnimation,\n style,\n isEntering,\n isExiting\n });\n }\n return {\n style,\n className: isEntering ? \"t_unmounted\" : \"\"\n };\n }\n };\n}\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,QAAQ,GAAGC,MAAM,CAACC,MAAM;AAC5B,IAAIC,SAAS,GAAGF,MAAM,CAACG,cAAc;AACrC,IAAIC,gBAAgB,GAAGJ,MAAM,CAACK,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGN,MAAM,CAACO,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LsM,SAAS,EAAE1G,UAAU,GAAG,aAAa,GAAG;MAC1C,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__reExport","target","mod","secondTarget","__toCommonJS","value","index_exports","module","exports","require"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./createAnimations\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MA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,EAAEG,OAAO,CAAC,8BAAoB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC","ignoreList":[]}
@@ -179,6 +179,9 @@ function createAnimations(animations) {
179
179
  const exitCompletedRef = React.useRef(false);
180
180
  const wasExitingRef = React.useRef(false);
181
181
  const exitInterruptedRef = React.useRef(false);
182
+ const sendExitCompleteRef = React.useRef(sendExitComplete);
183
+ const lastNonExitingStyleRef = React.useRef({});
184
+ sendExitCompleteRef.current = sendExitComplete;
182
185
  const justStartedExiting = isExiting && !wasExitingRef.current;
183
186
  const justStoppedExiting = !isExiting && wasExitingRef.current;
184
187
  if (justStartedExiting) {
@@ -192,6 +195,14 @@ function createAnimations(animations) {
192
195
  React.useEffect(() => {
193
196
  wasExitingRef.current = isExiting;
194
197
  });
198
+ useIsomorphicLayoutEffect(() => {
199
+ const host = stateRef.current.host;
200
+ if (isExiting || !host) return;
201
+ const computedStyle = getComputedStyle(host);
202
+ lastNonExitingStyleRef.current = {
203
+ opacity: computedStyle.opacity
204
+ };
205
+ });
195
206
  const effectiveTransition = styleState?.effectiveTransition ?? props.transition;
196
207
  const normalized = normalizeTransition(effectiveTransition);
197
208
  const animationState = isExiting ? "exit" : isEntering || justFinishedEntering ? "enter" : "default";
@@ -219,7 +230,7 @@ function createAnimations(animations) {
219
230
  if (cycleId !== exitCycleIdRef.current) return;
220
231
  if (exitCompletedRef.current) return;
221
232
  exitCompletedRef.current = true;
222
- sendExitComplete();
233
+ sendExitCompleteRef.current?.();
223
234
  };
224
235
  if (keys.length === 0) {
225
236
  completeExit();
@@ -247,18 +258,24 @@ function createAnimations(animations) {
247
258
  }
248
259
  return animationValue ? `${key} ${animationValue}${delayStr2}` : null;
249
260
  }).filter(Boolean).join(", ");
261
+ const getResetValue = key => {
262
+ if (key === "opacity") {
263
+ return style?.opacity ?? props.opacity ?? lastNonExitingStyleRef.current.opacity ?? 1;
264
+ }
265
+ if (TRANSFORM_KEYS.includes(key)) {
266
+ return key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
267
+ }
268
+ return enterStyle?.[key];
269
+ };
250
270
  if (wasInterrupted) {
251
271
  exitInterruptedRef.current = false;
252
272
  node.style.transition = "none";
253
273
  if (exitStyle) {
254
274
  const resetStyle = {};
255
275
  for (const key of Object.keys(exitStyle)) {
256
- if (key === "opacity") {
257
- resetStyle[key] = 1;
258
- } else if (TRANSFORM_KEYS.includes(key)) {
259
- resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
260
- } else if (enterStyle?.[key] !== void 0) {
261
- resetStyle[key] = enterStyle[key];
276
+ const resetValue = getResetValue(key);
277
+ if (resetValue !== void 0) {
278
+ resetStyle[key] = resetValue;
262
279
  }
263
280
  }
264
281
  applyStylesToNode(node, resetStyle);
@@ -272,12 +289,9 @@ function createAnimations(animations) {
272
289
  node.style.transition = "none";
273
290
  const resetStyle = {};
274
291
  for (const key of Object.keys(exitStyle)) {
275
- if (key === "opacity") {
276
- resetStyle[key] = 1;
277
- } else if (TRANSFORM_KEYS.includes(key)) {
278
- resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
279
- } else if (enterStyle?.[key] !== void 0) {
280
- resetStyle[key] = enterStyle[key];
292
+ const resetValue = getResetValue(key);
293
+ if (resetValue !== void 0) {
294
+ resetStyle[key] = resetValue;
281
295
  }
282
296
  }
283
297
  applyStylesToNode(node, resetStyle);
@@ -341,7 +355,7 @@ function createAnimations(animations) {
341
355
  node.removeEventListener("transitioncancel", onCancelAnimation);
342
356
  node.style.transition = "";
343
357
  };
344
- }, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]);
358
+ }, [isExiting]);
345
359
  if (isHydrating) {
346
360
  return null;
347
361
  }
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeTransition","getAnimatedProperties","hasAnimation","hasNormalizedAnimation","getEffectiveAnimation","getAnimationConfigsForKeys","useIsomorphicLayoutEffect","ResetPresence","usePresence","transformsToString","React","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","key","value","Object","entries","opacity","String","backgroundColor","color","createAnimations","animations","reactionListeners","WeakMap","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","useState","finishTimerRef","useRef","getInstance","getValue","setValue","next","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimatedNumbersStyle","vals","map","v","useAnimations","props","presence","componentState","stateRef","styleState","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","justStartedExiting","justStoppedExiting","effectiveTransition","transition","normalized","animationState","effectiveAnimationKey","defaultAnimation","animatedProperties","hasDefault","default","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","host","cycleId","completeExit","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","propAnimation","properties","animationValue","filter","Boolean","resetStyle","offsetHeight","requestAnimationFrame","maxDuration","animationConfigs","values","fallbackTimeout","timeoutId","transitioningProps","completedCount","onFinishAnimation","event","target","eventProp","propertyName","has","size","onCancelAnimation","addEventListener","cancelAnimationFrame","removeEventListener","Array","isArray","delayStr","durationOverride","process","env","NODE_ENV","console","info","className"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AAAA,SACEA,mBAAA,EACAC,qBAAA,EACAC,YAAA,IAAgBC,sBAAA,EAChBC,qBAAA,EACAC,0BAA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A,CAAW0B,UAAA,CAAWlG,GAAG;QAC/C,IAAImG,cAAA,GAAgC;QAEpC,IAAI,OAAOF,aAAA,KAAkB,UAAU;UACrCE,cAAA,GAAiB1F,UAAA,CAAWwF,aAAa;QAC3C,WACEA,aAAA,IACA,OAAOA,aAAA,KAAkB,YACzBA,aAAA,CAAcrE,IAAA,EACd;UACAuE,cAAA,GAAiB1F,UAAA,CAAWwF,aAAA,CAAcrE,IAAI;QAChD,WAAW+C,gBAAA,EAAkB;UAC3BwB,cAAA,GAAiBxB,gBAAA;QACnB;QAGA,IAAIwB,cAAA,IAAkB2B,gBAAA,EAAkB;UACtC3B,cAAA,GAAiBhI,qBAAA,CAAsBgI,cAAA,EAAgB2B,gBAAgB;QACzE;QAEA,OAAO3B,cAAA,GAAiB,GAAGnG,GAAG,IAAImG,cAAc,GAAG0B,QAAQ,KAAK;MAClE,CAAC,EACAzB,MAAA,CAAOC,OAAO,EACd1G,IAAA,CAAK,IAAI;MAEZ,IAAIoI,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBAAiB7E,KAAA,CAAM,OAAO,MAAM,WAAW;QAC1E8E,OAAA,CAAQC,IAAA,CAAK,iBAAiB;UAC5B/E,KAAA;UACA3C,UAAA;UACA+D,UAAA;UACAG,gBAAA;UACAjG,KAAA;UACAiF,UAAA;UACAC;QACF,CAAC;MACH;MAEA,OAAO;QAAElF,KAAA;QAAO0J,SAAA,EAAWzE,UAAA,GAAa,gBAAgB;MAAG;IAC7D;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["normalizeTransition","getAnimatedProperties","hasAnimation","hasNormalizedAnimation","getEffectiveAnimation","getAnimationConfigsForKeys","useIsomorphicLayoutEffect","ResetPresence","usePresence","transformsToString","React","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","key","value","Object","entries","opacity","String","backgroundColor","color","createAnimations","animations","reactionListeners","WeakMap","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","useState","finishTimerRef","useRef","getInstance","getValue","setValue","next","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimatedNumbersStyle","vals","map","v","useAnimations","props","presence","componentState","stateRef","styleState","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","sendExitCompleteRef","lastNonExitingStyleRef","justStartedExiting","justStoppedExiting","host","computedStyle","getComputedStyle","effectiveTransition","transition","normalized","animationState","effectiveAnimationKey","defaultAnimation","animatedProperties","hasDefault","default","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","cycleId","completeExit","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","propAnimation","properties","animationValue","filter","Boolean","getResetValue","resetStyle","resetValue","offsetHeight","requestAnimationFrame","maxDuration","animationConfigs","values","fallbackTimeout","timeoutId","transitioningProps","completedCount","onFinishAnimation","event","target","eventProp","propertyName","has","size","onCancelAnimation","addEventListener","cancelAnimationFrame","removeEventListener","Array","isArray","delayStr","durationOverride","process","env","NODE_ENV","console","info","className"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AAAA,SACEA,mBAAA,EACAC,qBAAA,EACAC,YAAA,IAAgBC,sBAAA,EAChBC,qBAAA,EACAC,0BAAA,QACK;AACP,SAASC,yBAAA,QAAiC;AAC1C,SAASC,aAAA,EAAeC,WAAA,QAAmB;AAE3C,SAASC,kBAAA,QAA0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itCompletedRef = React.useRef(false);
213
213
  var wasExitingRef = React.useRef(false);
214
214
  var exitInterruptedRef = React.useRef(false);
215
+ var sendExitCompleteRef = React.useRef(sendExitComplete);
216
+ var lastNonExitingStyleRef = React.useRef({});
217
+ sendExitCompleteRef.current = sendExitComplete;
215
218
  var justStartedExiting = isExiting && !wasExitingRef.current;
216
219
  var justStoppedExiting = !isExiting && wasExitingRef.current;
217
220
  if (justStartedExiting) {
@@ -225,6 +228,14 @@ function createAnimations(animations) {
225
228
  React.useEffect(function () {
226
229
  wasExitingRef.current = isExiting;
227
230
  });
231
+ useIsomorphicLayoutEffect(function () {
232
+ var host = stateRef.current.host;
233
+ if (isExiting || !host) return;
234
+ var computedStyle = getComputedStyle(host);
235
+ lastNonExitingStyleRef.current = {
236
+ opacity: computedStyle.opacity
237
+ };
238
+ });
228
239
  var _styleState_effectiveTransition;
229
240
  var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
230
241
  var normalized = normalizeTransition(effectiveTransition);
@@ -251,10 +262,11 @@ function createAnimations(animations) {
251
262
  var node = host;
252
263
  var cycleId = exitCycleIdRef.current;
253
264
  var completeExit = function () {
265
+ var _sendExitCompleteRef_current;
254
266
  if (cycleId !== exitCycleIdRef.current) return;
255
267
  if (exitCompletedRef.current) return;
256
268
  exitCompletedRef.current = true;
257
- sendExitComplete();
269
+ (_sendExitCompleteRef_current = sendExitCompleteRef.current) === null || _sendExitCompleteRef_current === void 0 ? void 0 : _sendExitCompleteRef_current.call(sendExitCompleteRef);
258
270
  };
259
271
  if (keys.length === 0) {
260
272
  completeExit();
@@ -282,6 +294,16 @@ function createAnimations(animations) {
282
294
  }
283
295
  return animationValue2 ? `${key2} ${animationValue2}${delayStr2}` : null;
284
296
  }).filter(Boolean).join(", ");
297
+ var getResetValue = function (key2) {
298
+ if (key2 === "opacity") {
299
+ var _style_opacity, _ref, _ref1;
300
+ return (_ref1 = (_ref = (_style_opacity = style === null || style === void 0 ? void 0 : style.opacity) !== null && _style_opacity !== void 0 ? _style_opacity : props.opacity) !== null && _ref !== void 0 ? _ref : lastNonExitingStyleRef.current.opacity) !== null && _ref1 !== void 0 ? _ref1 : 1;
301
+ }
302
+ if (TRANSFORM_KEYS.includes(key2)) {
303
+ return key2 === "scale" || key2 === "scaleX" || key2 === "scaleY" ? 1 : 0;
304
+ }
305
+ return enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key2];
306
+ };
285
307
  if (wasInterrupted) {
286
308
  exitInterruptedRef.current = false;
287
309
  node.style.transition = "none";
@@ -293,12 +315,9 @@ function createAnimations(animations) {
293
315
  try {
294
316
  for (var _iterator = Object.keys(exitStyle)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
295
317
  var key = _step.value;
296
- if (key === "opacity") {
297
- resetStyle[key] = 1;
298
- } else if (TRANSFORM_KEYS.includes(key)) {
299
- resetStyle[key] = key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
300
- } else if ((enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key]) !== void 0) {
301
- resetStyle[key] = enterStyle[key];
318
+ var resetValue = getResetValue(key);
319
+ if (resetValue !== void 0) {
320
+ resetStyle[key] = resetValue;
302
321
  }
303
322
  }
304
323
  } catch (err) {
@@ -331,12 +350,9 @@ function createAnimations(animations) {
331
350
  try {
332
351
  for (var _iterator1 = Object.keys(exitStyle)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
333
352
  var key1 = _step1.value;
334
- if (key1 === "opacity") {
335
- resetStyle1[key1] = 1;
336
- } else if (TRANSFORM_KEYS.includes(key1)) {
337
- resetStyle1[key1] = key1 === "scale" || key1 === "scaleX" || key1 === "scaleY" ? 1 : 0;
338
- } else if ((enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key1]) !== void 0) {
339
- resetStyle1[key1] = enterStyle[key1];
353
+ var resetValue1 = getResetValue(key1);
354
+ if (resetValue1 !== void 0) {
355
+ resetStyle1[key1] = resetValue1;
340
356
  }
341
357
  }
342
358
  } catch (err) {
@@ -434,7 +450,7 @@ function createAnimations(animations) {
434
450
  node.removeEventListener("transitioncancel", onCancelAnimation);
435
451
  node.style.transition = "";
436
452
  };
437
- }, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]);
453
+ }, [isExiting]);
438
454
  if (isHydrating) {
439
455
  return null;
440
456
  }
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeTransition","getAnimatedProperties","hasAnimation","hasNormalizedAnimation","getEffectiveAnimation","getAnimationConfigsForKeys","useIsomorphicLayoutEffect","ResetPresence","usePresence","transformsToString","React","_type_of","obj","Symbol","constructor","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","_style_x","_style_y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","key","value","opacity","String","backgroundColor","color","err","return","createAnimations","animations","reactionListeners","WeakMap","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","useState","finishTimerRef","useRef","getInstance","getValue","setValue","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","param","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimatedNumbersStyle","vals","map","v","useAnimations","props","presence","componentState","stateRef","styleState","_normalized_config","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","justStartedExiting","justStoppedExiting","_styleState_effectiveTransition","effectiveTransition","transition","normalized","animationState","effectiveAnimationKey","defaultAnimation","animatedProperties","hasDefault","default","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","_normalized_config2","host","cycleId","completeExit","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","key2","propAnimation","properties","animationValue2","filter","Boolean","resetStyle","offsetHeight","resetStyle1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","requestAnimationFrame","maxDuration","animationConfigs","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_iterator2","values","_step2","animationValue","_normalized_delay","fallbackTimeout","timeoutId","transitioningProps","completedCount","onFinishAnimation","event","target","eventProp","propertyName","has","size","onCancelAnimation"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,mBAAA,EAAAC,qBAAA,EAAAC,YAAA,IAAAC,sBAAA,EAAAC,qBAAA,EAAAC,0BAAA;AAAA,SACEC,yBAAA;AAAA,SACAC,aAAA,EAAAC,WAAA;AAAA,SACAC,kBAAgB;AAAA,OAChBC,KAAA;AAAA,SACAC,SAAAC,GAAA;EAAA,uBACK;;EACP,OAASA,GAAA,WAAAC,MAAA,gBAAiC,IAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAC1C;AAEA,IAAAG,gBAAS,yBAA0B;AACnC,IAAAC,eAAgC;AAEhC,SAAMC,gBAAmBC,SAAA;EACzB,IAAMC,OAAA,GAAAD,SAAkB,CAAAE,KAAA,CAAAL,gBAAA;EAOxB,IAAAI,OAAS;IAEP,OAAME,MAAA,CAAUC,QAAA,CAAAH,OAAgB;EAChC;EACE,IAAAI,MAAO,GAAAL,SAAO,CAAAE,KAAS,CAAAJ,eAAc;EACvC,IAAAO,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A,IAAM;YACA,KAAAgH,0BAA8B,IAAAG,UAAQ,CAAAlH,MAAA;cACtCkH,UAAA,CAAalH,MAChB;YAEC;UACA,UAAI;YAEA,IAAAgH,kBAAO;cACT,MAAAC,eAAiB;YACnB;UAKE;QACF;QACE,IAAAK,iBAAiB;QACnB,IAAA5B,KAAA,IAAA4B,iBAAA,GAAAnD,UAAA,CAAAuB,KAAA,cAAA4B,iBAAA,cAAAA,iBAAA;QAGA,IAAIC,eAAA,GAAkBV,WAAA,GAAAnB,KAAkB;QACtC,IAAA8B,SAAA,GAAAlG,UAAiB;UACnB6D,YAAA;QAEA,GAAAoC,eAAO;QACR,IACAE,kBACK,OAAIvF,GAAA,CAAA4C,IAAA;QAEZ,IAAI4C,cAAY;QACd,IAAAC,iBAAa,YAAAA,CAAiBC,KAAA;UAC5B,IAAAA,KAAA,CAAAC,MAAA,KAAAjJ,IAAA;UACA,IAAAkJ,SAAA,GAAAF,KAAA,CAAAG,YAAA;UACA,IAAAN,kBAAA,CAAAO,GAAA,CAAAF,SAAA,KAAAA,SAAA;YACAJ,cAAA;YACA,IAAAA,cAAA,IAAAD,kBAAA,CAAAQ,IAAA;cACA9G,YAAA,CAAAqG,SAAA;cACArC,YAAA;YACD;UACH;QAEA;QACF,IAAA+C,iBAAA,YAAAA,CAAA;UACF,IAAA5C,kBAAA;UACFnE,YAAA,CAAAqG,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["normalizeTransition","getAnimatedProperties","hasAnimation","hasNormalizedAnimation","getEffectiveAnimation","getAnimationConfigsForKeys","useIsomorphicLayoutEffect","ResetPresence","usePresence","transformsToString","React","_type_of","obj","Symbol","constructor","EXTRACT_MS_REGEX","EXTRACT_S_REGEX","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","MS_DURATION_REGEX","S_DURATION_REGEX","applyDurationOverride","durationMs","msReplaced","replace","sReplaced","TRANSFORM_KEYS","buildTransformString","style","parts","x","y","_style_x","_style_y","push","scale","scaleX","scaleY","rotate","val","unit","includes","rotateX","rotateY","rotateZ","skewX","skewY","join","applyStylesToNode","node","transformStr","transform","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","key","value","opacity","String","backgroundColor","color","err","return","createAnimations","animations","reactionListeners","WeakMap","inputStyle","outputStyle","useAnimatedNumber","initial","setVal","useState","finishTimerRef","useRef","getInstance","getValue","setValue","config","onFinish","current","clearTimeout","type","duration","setTimeout","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","param","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimatedNumbersStyle","vals","map","v","useAnimations","props","presence","componentState","stateRef","styleState","_normalized_config","isHydrating","unmounted","isEntering","isExiting","sendExitComplete","wasEnteringRef","justFinishedEntering","exitCycleIdRef","exitCompletedRef","wasExitingRef","exitInterruptedRef","sendExitCompleteRef","lastNonExitingStyleRef","justStartedExiting","justStoppedExiting","host","computedStyle","getComputedStyle","_styleState_effectiveTransition","effectiveTransition","transition","normalized","animationState","effectiveAnimationKey","defaultAnimation","animatedProperties","hasDefault","default","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","_normalized_config2","cycleId","completeExit","_sendExitCompleteRef_current","call","rafId","wasInterrupted","ignoreCancelEvents","enterStyle","exitStyle","delayStr2","delay","durationOverride2","exitTransitionString","key2","propAnimation","properties","animationValue2","filter","Boolean","getResetValue","_style_opacity","_ref","_ref1","resetStyle","resetValue","offsetHeight","resetStyle1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","resetValue1","requestAnimationFrame","maxDuration","animationConfigs","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_iterator2","values","_step2","animationValue","_normalized_delay","fallbackTimeout","timeoutId","transitioningProps","completedCount","onFinishAnimation","event","target","eventProp","propertyName"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,mBAAA,EAAAC,qBAAA,EAAAC,YAA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4H,0BAAkB,IAAAG,UAAkB,CAAA9H,MAAA;cACtC8H,UAAA,CAAA9H,MAAiB;YACnB;UAEA,UAAO;YAER,IAAO4H,kBACE;cAER,MAAQC,eAAiB;YAC3B;UACE;QAAA;QACA,IACAK,iBAAA;QAAA,IACAlC,KAAA,IAAAkC,iBAAA,GAAA1D,UAAA,CAAAwB,KAAA,cAAAkC,iBAAA,cAAAA,iBAAA;QAAA,IACAC,eAAA,GAAAV,WAAA,GAAAzB,KAAA;QAAA,IACAoC,SAAA,GAAA9G,UAAA;UACAiE,YAAA;QACF,CAAC,EAAA4C,eAAA;QACH,IAAAE,kBAAA,OAAAnG,GAAA,CAAAiD,IAAA;QAEA,IAAAmD,cAAgB;QAClB,IAAAC,iBAAA,YAAAA,CAAAC,KAAA;UACF,IAAAA,KAAA,CAAAC,MAAA,KAAA7J,IAAA;UACF,IAAA8J,SAAA,GAAAF,KAAA,CAAAG,YAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/animations-css",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-1781071309197",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",
@@ -36,14 +36,14 @@
36
36
  "clean:build": "tamagui-build clean:build"
37
37
  },
38
38
  "dependencies": {
39
- "@tamagui/animation-helpers": "2.1.0",
40
- "@tamagui/constants": "2.1.0",
41
- "@tamagui/cubic-bezier-animator": "2.1.0",
42
- "@tamagui/use-presence": "2.1.0",
43
- "@tamagui/web": "2.1.0"
39
+ "@tamagui/animation-helpers": "2.2.0-1781071309197",
40
+ "@tamagui/constants": "2.2.0-1781071309197",
41
+ "@tamagui/cubic-bezier-animator": "2.2.0-1781071309197",
42
+ "@tamagui/use-presence": "2.2.0-1781071309197",
43
+ "@tamagui/web": "2.2.0-1781071309197"
44
44
  },
45
45
  "devDependencies": {
46
- "@tamagui/build": "2.1.0",
46
+ "@tamagui/build": "2.2.0-1781071309197",
47
47
  "react": ">=19",
48
48
  "react-dom": "*"
49
49
  },
@@ -265,6 +265,9 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
265
265
  const exitCompletedRef = React.useRef(false)
266
266
  const wasExitingRef = React.useRef(false)
267
267
  const exitInterruptedRef = React.useRef(false)
268
+ const sendExitCompleteRef = React.useRef(sendExitComplete)
269
+ const lastNonExitingStyleRef = React.useRef<Record<string, string>>({})
270
+ sendExitCompleteRef.current = sendExitComplete
268
271
 
269
272
  // detect transition into/out of exiting state
270
273
  const justStartedExiting = isExiting && !wasExitingRef.current
@@ -286,6 +289,15 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
286
289
  wasExitingRef.current = isExiting
287
290
  })
288
291
 
292
+ useIsomorphicLayoutEffect(() => {
293
+ const host = stateRef.current.host
294
+ if (isExiting || !host) return
295
+ const computedStyle = getComputedStyle(host as HTMLElement)
296
+ lastNonExitingStyleRef.current = {
297
+ opacity: computedStyle.opacity,
298
+ }
299
+ })
300
+
289
301
  // use effectiveTransition computed by createComponent (single source of truth)
290
302
  const effectiveTransition = styleState?.effectiveTransition ?? props.transition
291
303
 
@@ -344,7 +356,7 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
344
356
  if (cycleId !== exitCycleIdRef.current) return
345
357
  if (exitCompletedRef.current) return
346
358
  exitCompletedRef.current = true
347
- sendExitComplete()
359
+ sendExitCompleteRef.current?.()
348
360
  }
349
361
 
350
362
  // if no properties to animate (animateOnly=[]), complete immediately
@@ -393,6 +405,21 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
393
405
  .filter(Boolean)
394
406
  .join(', ')
395
407
 
408
+ const getResetValue = (key: string) => {
409
+ if (key === 'opacity') {
410
+ return (
411
+ style?.opacity ??
412
+ props.opacity ??
413
+ lastNonExitingStyleRef.current.opacity ??
414
+ 1
415
+ )
416
+ }
417
+ if (TRANSFORM_KEYS.includes(key as any)) {
418
+ return key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0
419
+ }
420
+ return enterStyle?.[key]
421
+ }
422
+
396
423
  if (wasInterrupted) {
397
424
  exitInterruptedRef.current = false
398
425
  // disable transition, reset to enter state
@@ -403,13 +430,9 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
403
430
  if (exitStyle) {
404
431
  const resetStyle: Record<string, unknown> = {}
405
432
  for (const key of Object.keys(exitStyle)) {
406
- if (key === 'opacity') {
407
- resetStyle[key] = 1
408
- } else if (TRANSFORM_KEYS.includes(key as any)) {
409
- resetStyle[key] =
410
- key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0
411
- } else if (enterStyle?.[key] !== undefined) {
412
- resetStyle[key] = enterStyle[key]
433
+ const resetValue = getResetValue(key)
434
+ if (resetValue !== undefined) {
435
+ resetStyle[key] = resetValue
413
436
  }
414
437
  }
415
438
  applyStylesToNode(node, resetStyle)
@@ -439,13 +462,9 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
439
462
  // when exitStyle is applied, so the CSS transition wouldn't fire.
440
463
  const resetStyle: Record<string, unknown> = {}
441
464
  for (const key of Object.keys(exitStyle)) {
442
- if (key === 'opacity') {
443
- resetStyle[key] = 1
444
- } else if (TRANSFORM_KEYS.includes(key as any)) {
445
- resetStyle[key] =
446
- key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0
447
- } else if (enterStyle?.[key] !== undefined) {
448
- resetStyle[key] = enterStyle[key]
465
+ const resetValue = getResetValue(key)
466
+ if (resetValue !== undefined) {
467
+ resetStyle[key] = resetValue
449
468
  }
450
469
  }
451
470
  applyStylesToNode(node, resetStyle)
@@ -568,16 +587,7 @@ export function createAnimations<A extends object>(animations: A): AnimationDriv
568
587
  // override lets React's value take effect again.
569
588
  node.style.transition = ''
570
589
  }
571
- }, [
572
- sendExitComplete,
573
- isExiting,
574
- stateRef,
575
- keys,
576
- normalized,
577
- defaultAnimation,
578
- props.enterStyle,
579
- props.exitStyle,
580
- ])
590
+ }, [isExiting])
581
591
 
582
592
  // tamagui doesnt even use animation output during hydration
583
593
  if (isHydrating) {
@@ -6,6 +6,6 @@
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
9
- "import {\n normalizeTransition,\n getAnimatedProperties,\n hasAnimation as hasNormalizedAnimation,\n getEffectiveAnimation,\n getAnimationConfigsForKeys,\n} from '@tamagui/animation-helpers'\nimport { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { ResetPresence, usePresence } from '@tamagui/use-presence'\nimport type { AnimationDriver, UniversalAnimatedNumber } from '@tamagui/web'\nimport { transformsToString } from '@tamagui/web'\nimport React, { useState } from 'react' // import { animate } from '@tamagui/cubic-bezier-animator'\n\nconst EXTRACT_MS_REGEX = /(\\d+(?:\\.\\d+)?)\\s*ms/\nconst EXTRACT_S_REGEX = /(\\d+(?:\\.\\d+)?)\\s*s/\n\n/**\n * Helper function to extract duration from CSS animation string\n * Examples: \"ease-in 200ms\" -> 200, \"cubic-bezier(0.215, 0.610, 0.355, 1.000) 400ms\" -> 400\n * \"ease-in 0.5s\" -> 500, \"slow 2s\" -> 2000\n */\nfunction extractDuration(animation: string): number {\n // Try to match milliseconds first\n const msMatch = animation.match(EXTRACT_MS_REGEX)\n if (msMatch) {\n return Number.parseInt(msMatch[1], 10)\n }\n\n // Try to match seconds and convert to milliseconds\n const sMatch = animation.match(EXTRACT_S_REGEX)\n if (sMatch) {\n return Math.round(Number.parseFloat(sMatch[1]) * 1000)\n }\n\n // Default to 300ms if no duration found\n return 300\n}\n\nconst MS_DURATION_REGEX = /(\\d+(?:\\.\\d+)?)\\s*ms/\nconst S_DURATION_REGEX = /(\\d+(?:\\.\\d+)?)\\s*s(?!tiffness)/\n\n/**\n * Apply duration override to a CSS animation string\n * Replaces the existing duration with the override value\n */\nfunction applyDurationOverride(animation: string, durationMs: number): string {\n // Replace ms duration\n const msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`)\n if (msReplaced !== animation) {\n return msReplaced\n }\n\n // Replace seconds duration\n const sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`)\n if (sReplaced !== animation) {\n return sReplaced\n }\n\n // No duration found, prepend the duration\n return `${durationMs}ms ${animation}`\n}\n\n// transform keys that need special handling\nconst TRANSFORM_KEYS = [\n 'x',\n 'y',\n 'scale',\n 'scaleX',\n 'scaleY',\n 'rotate',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'skewX',\n 'skewY',\n] as const\n\n/**\n * Build a CSS transform string from a style object containing transform properties\n */\nfunction buildTransformString(style: Record<string, unknown> | undefined): string {\n if (!style) return ''\n\n const parts: string[] = []\n\n if (style.x !== undefined || style.y !== undefined) {\n const x = style.x ?? 0\n const y = style.y ?? 0\n parts.push(`translate(${x}px, ${y}px)`)\n }\n if (style.scale !== undefined) {\n parts.push(`scale(${style.scale})`)\n }\n if (style.scaleX !== undefined) {\n parts.push(`scaleX(${style.scaleX})`)\n }\n if (style.scaleY !== undefined) {\n parts.push(`scaleY(${style.scaleY})`)\n }\n if (style.rotate !== undefined) {\n const val = style.rotate\n const unit = typeof val === 'string' && val.includes('deg') ? '' : 'deg'\n parts.push(`rotate(${val}${unit})`)\n }\n if (style.rotateX !== undefined) {\n parts.push(`rotateX(${style.rotateX}deg)`)\n }\n if (style.rotateY !== undefined) {\n parts.push(`rotateY(${style.rotateY}deg)`)\n }\n if (style.rotateZ !== undefined) {\n parts.push(`rotateZ(${style.rotateZ}deg)`)\n }\n if (style.skewX !== undefined) {\n parts.push(`skewX(${style.skewX}deg)`)\n }\n if (style.skewY !== undefined) {\n parts.push(`skewY(${style.skewY}deg)`)\n }\n\n return parts.join(' ')\n}\n\n/**\n * Apply a style object to a DOM node, handling transform keys specially\n */\nfunction applyStylesToNode(\n node: HTMLElement,\n style: Record<string, unknown> | undefined\n): void {\n if (!style) return\n\n // collect transform values\n const transformStr = buildTransformString(style)\n if (transformStr) {\n node.style.transform = transformStr\n }\n\n // apply non-transform properties\n for (const [key, value] of Object.entries(style)) {\n if (TRANSFORM_KEYS.includes(key as any)) continue\n if (value === undefined) continue\n\n if (key === 'opacity') {\n node.style.opacity = String(value)\n } else if (key === 'backgroundColor') {\n node.style.backgroundColor = String(value)\n } else if (key === 'color') {\n node.style.color = String(value)\n } else {\n // generic fallback\n node.style[key as any] = typeof value === 'number' ? `${value}px` : String(value)\n }\n }\n}\n\nexport function createAnimations<A extends object>(animations: A): AnimationDriver<A> {\n const reactionListeners = new WeakMap<any, Set<Function>>()\n\n return {\n animations,\n usePresence,\n ResetPresence,\n inputStyle: 'css',\n outputStyle: 'css',\n\n useAnimatedNumber(initial): UniversalAnimatedNumber<Function> {\n const [val, setVal] = React.useState(initial)\n const finishTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null)\n\n return {\n getInstance() {\n return setVal\n },\n getValue() {\n return val\n },\n setValue(next, config, onFinish) {\n setVal(next)\n\n // clear any pending finish callback from a previous setValue\n if (finishTimerRef.current) {\n clearTimeout(finishTimerRef.current)\n finishTimerRef.current = null\n }\n\n if (onFinish) {\n if (\n !config ||\n config.type === 'direct' ||\n (config.type === 'timing' && config.duration === 0)\n ) {\n onFinish()\n } else {\n // estimate duration: use explicit duration, or fall back to\n // default CSS transition duration for spring-type configs\n const duration = config.type === 'timing' ? config.duration : 300\n finishTimerRef.current = setTimeout(onFinish, duration)\n }\n }\n\n // call reaction listeners with the new value\n const listeners = reactionListeners.get(setVal)\n if (listeners) {\n listeners.forEach((listener) => listener(next))\n }\n },\n stop() {\n if (finishTimerRef.current) {\n clearTimeout(finishTimerRef.current)\n finishTimerRef.current = null\n }\n },\n }\n },\n\n useAnimatedNumberReaction({ value }, onValue) {\n React.useEffect(() => {\n const instance = value.getInstance()\n let queue = reactionListeners.get(instance)\n if (!queue) {\n const next = new Set<Function>()\n reactionListeners.set(instance, next)\n queue = next!\n }\n queue.add(onValue)\n return () => {\n queue?.delete(onValue)\n }\n }, [])\n },\n\n useAnimatedNumberStyle(val, getStyle) {\n return getStyle(val.getValue())\n },\n\n useAnimatedNumbersStyle(vals, getStyle) {\n return getStyle(...vals.map((v) => v.getValue()))\n },\n\n // @ts-ignore - styleState is added by createComponent\n useAnimations: ({\n props,\n presence,\n style,\n componentState,\n stateRef,\n styleState,\n }: any) => {\n const isHydrating = componentState.unmounted === true\n const isEntering = !!componentState.unmounted\n const isExiting = presence?.[0] === false\n const sendExitComplete = presence?.[1]\n\n // Track if we just finished entering (transition from entering to not entering)\n // This is needed because the CSS transition happens on the render AFTER t_unmounted is removed\n const wasEnteringRef = React.useRef(isEntering)\n const justFinishedEntering = wasEnteringRef.current && !isEntering\n React.useEffect(() => {\n wasEnteringRef.current = isEntering\n })\n\n // exit cycle guards to prevent stale/duplicate completion\n const exitCycleIdRef = React.useRef(0)\n const exitCompletedRef = React.useRef(false)\n const wasExitingRef = React.useRef(false)\n const exitInterruptedRef = React.useRef(false)\n\n // detect transition into/out of exiting state\n const justStartedExiting = isExiting && !wasExitingRef.current\n const justStoppedExiting = !isExiting && wasExitingRef.current\n\n // start new exit cycle only on transition INTO exiting\n if (justStartedExiting) {\n exitCycleIdRef.current++\n exitCompletedRef.current = false\n }\n // track interruptions so we know to force-restart transitions\n if (justStoppedExiting) {\n exitCycleIdRef.current++\n exitInterruptedRef.current = true\n }\n\n // track previous exiting state\n React.useEffect(() => {\n wasExitingRef.current = isExiting\n })\n\n // use effectiveTransition computed by createComponent (single source of truth)\n const effectiveTransition = styleState?.effectiveTransition ?? props.transition\n\n // Normalize the transition prop to a consistent format\n const normalized = normalizeTransition(effectiveTransition)\n\n // Determine animation state and get effective animation\n // Use 'enter' if we're entering OR if we just finished entering (transition is happening)\n const animationState = isExiting\n ? 'exit'\n : isEntering || justFinishedEntering\n ? 'enter'\n : 'default'\n const effectiveAnimationKey = getEffectiveAnimation(normalized, animationState)\n const defaultAnimation = effectiveAnimationKey\n ? animations[effectiveAnimationKey]\n : null\n const animatedProperties = getAnimatedProperties(normalized)\n\n // Determine which properties to animate\n // - animateOnly prop is an exclusive filter (only animate those properties)\n // - per-property configs WITHOUT a default = only animate those specific properties\n // - per-property configs WITH a default = per-property overrides + default for rest\n const hasDefault =\n normalized.default !== null ||\n normalized.enter !== null ||\n normalized.exit !== null\n const hasPerPropertyConfigs = animatedProperties.length > 0\n\n let keys: string[]\n if (props.animateOnly) {\n // animateOnly is explicit filter\n keys = props.animateOnly\n } else if (hasPerPropertyConfigs && !hasDefault) {\n // object format without default: { opacity: '200ms' } = only animate opacity\n keys = animatedProperties\n } else if (hasPerPropertyConfigs && hasDefault) {\n // array format or object with default: 'all' first, then per-property overrides\n // CSS transition specificity: later declarations override earlier ones for the same property\n keys = ['all', ...animatedProperties]\n } else {\n // simple string format: 'quick' = animate all\n keys = ['all']\n }\n\n useIsomorphicLayoutEffect(() => {\n const host = stateRef.current.host\n if (!sendExitComplete || !isExiting || !host) return\n const node = host as HTMLElement\n\n // capture current cycle id for this effect\n const cycleId = exitCycleIdRef.current\n\n // helper to complete exit with guards\n const completeExit = () => {\n if (cycleId !== exitCycleIdRef.current) return\n if (exitCompletedRef.current) return\n exitCompletedRef.current = true\n sendExitComplete()\n }\n\n // if no properties to animate (animateOnly=[]), complete immediately\n if (keys.length === 0) {\n completeExit()\n return\n }\n\n // Force transition restart for interrupted exits\n // When an exit is interrupted and restarted, the element may already be at\n // the exit style, so no CSS transition fires. We need to:\n // 1. Reset to non-exit state\n // 2. Force reflow\n // 3. Re-apply exit state to trigger transition\n let rafId: number | undefined\n const wasInterrupted = exitInterruptedRef.current\n // flag to ignore transitioncancel during reset (we intentionally cancel the old transition)\n let ignoreCancelEvents = wasInterrupted\n // get enter/exit styles for potential restart\n const enterStyle = props.enterStyle as Record<string, unknown> | undefined\n const exitStyle = props.exitStyle as Record<string, unknown> | undefined\n\n // Build the exit transition string - needed for both normal and interrupted exits\n const delayStr = normalized.delay ? ` ${normalized.delay}ms` : ''\n const durationOverride = normalized.config?.duration\n const exitTransitionString = keys\n .map((key) => {\n const propAnimation = normalized.properties[key]\n let animationValue: string | null = null\n if (typeof propAnimation === 'string') {\n animationValue = animations[propAnimation]\n } else if (\n propAnimation &&\n typeof propAnimation === 'object' &&\n propAnimation.type\n ) {\n animationValue = animations[propAnimation.type]\n } else if (defaultAnimation) {\n animationValue = defaultAnimation\n }\n if (animationValue && durationOverride) {\n animationValue = applyDurationOverride(animationValue, durationOverride)\n }\n return animationValue ? `${key} ${animationValue}${delayStr}` : null\n })\n .filter(Boolean)\n .join(', ')\n\n if (wasInterrupted) {\n exitInterruptedRef.current = false\n // disable transition, reset to enter state\n node.style.transition = 'none'\n\n // reset: apply active/open state for each exit property (not enterStyle,\n // which may equal exitStyle — see comment in the normal exit path below)\n if (exitStyle) {\n const resetStyle: Record<string, unknown> = {}\n for (const key of Object.keys(exitStyle)) {\n if (key === 'opacity') {\n resetStyle[key] = 1\n } else if (TRANSFORM_KEYS.includes(key as any)) {\n resetStyle[key] =\n key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0\n } else if (enterStyle?.[key] !== undefined) {\n resetStyle[key] = enterStyle[key]\n }\n }\n applyStylesToNode(node, resetStyle)\n } else {\n // fallback if no exitStyle defined\n node.style.opacity = '1'\n node.style.transform = 'none'\n }\n\n // force reflow\n void node.offsetHeight\n } else if (exitStyle) {\n // For normal (non-interrupted) exits, we need to ensure the CSS transition is\n // processed by the browser BEFORE the exitStyle takes effect. The issue is that\n // React may have already applied exitStyle in the same render batch. To fix this:\n // 1. Disable transition and reset to non-exit state\n // 2. Force reflow so browser processes the reset\n // 3. Use RAF to ensure we're in a new frame\n // 4. Re-enable transition and apply exitStyle\n // This mirrors the interrupted exit handling approach (which also uses RAF).\n ignoreCancelEvents = true\n node.style.transition = 'none'\n\n // Reset to the active/open state (not enterStyle, which may equal exitStyle).\n // enterStyle is the \"unmounted\" initial state and can share values with exitStyle\n // (e.g., both have opacity: 0). resetting to enterStyle would mean no value change\n // when exitStyle is applied, so the CSS transition wouldn't fire.\n const resetStyle: Record<string, unknown> = {}\n for (const key of Object.keys(exitStyle)) {\n if (key === 'opacity') {\n resetStyle[key] = 1\n } else if (TRANSFORM_KEYS.includes(key as any)) {\n resetStyle[key] =\n key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0\n } else if (enterStyle?.[key] !== undefined) {\n resetStyle[key] = enterStyle[key]\n }\n }\n applyStylesToNode(node, resetStyle)\n\n // Force reflow\n void node.offsetHeight\n\n // Use RAF to ensure transition is applied in a new frame\n rafId = requestAnimationFrame(() => {\n if (cycleId !== exitCycleIdRef.current) return\n // Re-enable transition\n node.style.transition = exitTransitionString\n // Force reflow to ensure transition is active\n void node.offsetHeight\n // Apply exit styles - this triggers the animation\n applyStylesToNode(node, exitStyle)\n // Re-enable cancel event handling\n ignoreCancelEvents = false\n })\n }\n\n /**\n * Exit animation handling for Dialog/Modal components\n *\n * The Challenge: When users close dialogs (via Escape key or clicking outside),\n * the element can disappear from the DOM before CSS transitions finish, which causes:\n * 1. Dialogs to stick around on screen\n * 2. Event handlers to stop working\n *\n * Fix: Calculate the MAXIMUM duration across all animated properties, not just\n * the default. With animateOnly and per-property configs, different properties\n * can have different durations, and we need to wait for the LONGEST one.\n */\n\n // calculate max duration across all animated properties\n let maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200\n\n // check per-property animation durations using shared helper\n const animationConfigs = getAnimationConfigsForKeys(\n normalized,\n animations as Record<string, string>,\n keys,\n defaultAnimation\n )\n for (const animationValue of animationConfigs.values()) {\n if (animationValue) {\n const duration = extractDuration(animationValue)\n if (duration > maxDuration) {\n maxDuration = duration\n }\n }\n }\n\n const delay = normalized.delay ?? 0\n const fallbackTimeout = maxDuration + delay\n\n const timeoutId = setTimeout(() => {\n completeExit()\n }, fallbackTimeout)\n\n // track number of transitioning properties to wait for all to finish\n // (each property fires its own transitionend event)\n const transitioningProps = new Set(keys)\n let completedCount = 0\n\n const onFinishAnimation = (event: TransitionEvent) => {\n // only count transitions on THIS element, not bubbled from children\n if (event.target !== node) return\n\n // map CSS property names to our key names\n // e.g., transitionend fires with propertyName 'transform' for scale/x/y\n const eventProp = event.propertyName\n if (transitioningProps.has(eventProp) || eventProp === 'all') {\n completedCount++\n // wait for all properties to finish\n if (completedCount >= transitioningProps.size) {\n clearTimeout(timeoutId)\n completeExit()\n }\n }\n }\n\n // on cancel, still complete (element is exiting and animation was interrupted)\n // the guards prevent duplicate completion if this is a stale cycle\n const onCancelAnimation = () => {\n // ignore cancel events during reset phase (we intentionally cancel the old transition)\n if (ignoreCancelEvents) return\n clearTimeout(timeoutId)\n completeExit()\n }\n\n node.addEventListener('transitionend', onFinishAnimation)\n node.addEventListener('transitioncancel', onCancelAnimation)\n\n // For interrupted exits, re-enable transition and re-apply exit styles\n // This must happen AFTER listeners are set up so we catch the transitionend\n if (wasInterrupted) {\n rafId = requestAnimationFrame(() => {\n if (cycleId !== exitCycleIdRef.current) return\n // re-enable transition using the pre-built string\n node.style.transition = exitTransitionString\n // force reflow again\n void node.offsetHeight\n // now apply exit styles - this triggers the transition\n applyStylesToNode(node, exitStyle)\n // re-enable cancel event handling now that reset is complete\n ignoreCancelEvents = false\n })\n }\n\n return () => {\n clearTimeout(timeoutId)\n if (rafId !== undefined) cancelAnimationFrame(rafId)\n node.removeEventListener('transitionend', onFinishAnimation)\n node.removeEventListener('transitioncancel', onCancelAnimation)\n // restore transition: the exit handling sets node.style.transition='none'\n // directly on the DOM (bypassing React). if exit is interrupted (e.g. same-key\n // re-entry in AnimatePresence), React won't re-apply its managed transition\n // value because it hasn't changed in the virtual DOM. clearing the inline\n // override lets React's value take effect again.\n node.style.transition = ''\n }\n }, [\n sendExitComplete,\n isExiting,\n stateRef,\n keys,\n normalized,\n defaultAnimation,\n props.enterStyle,\n props.exitStyle,\n ])\n\n // tamagui doesnt even use animation output during hydration\n if (isHydrating) {\n return null\n }\n\n // Check if we have any animation to apply\n if (!hasNormalizedAnimation(normalized)) {\n return null\n }\n\n if (Array.isArray(style.transform)) {\n style.transform = transformsToString(style.transform)\n }\n\n // Build CSS transition string\n // TODO: we disabled the transform transition, because it will create issue for inverse function and animate function\n // for non layout transform properties either use animate function or find a workaround to do it with css\n const delayStr = normalized.delay ? ` ${normalized.delay}ms` : ''\n const durationOverride = normalized.config?.duration\n style.transition = keys\n .map((key) => {\n // Check for property-specific animation, fall back to default\n const propAnimation = normalized.properties[key]\n let animationValue: string | null = null\n\n if (typeof propAnimation === 'string') {\n animationValue = animations[propAnimation]\n } else if (\n propAnimation &&\n typeof propAnimation === 'object' &&\n propAnimation.type\n ) {\n animationValue = animations[propAnimation.type]\n } else if (defaultAnimation) {\n animationValue = defaultAnimation\n }\n\n // Apply global duration override if specified\n if (animationValue && durationOverride) {\n animationValue = applyDurationOverride(animationValue, durationOverride)\n }\n\n return animationValue ? `${key} ${animationValue}${delayStr}` : null\n })\n .filter(Boolean)\n .join(', ')\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n console.info('CSS animation', {\n props,\n animations,\n normalized,\n defaultAnimation,\n style,\n isEntering,\n isExiting,\n })\n }\n\n return { style, className: isEntering ? 't_unmounted' : '' }\n },\n }\n}\n\n// layout animations\n// useIsomorphicLayoutEffect(() => {\n// if (!host || !props.layout) {\n// return\n// }\n// // @ts-ignore\n// const boundingBox = host?.getBoundingClientRect()\n// if (isChanged(initialPositionRef.current, boundingBox)) {\n// const transform = invert(\n// host,\n// boundingBox,\n// initialPositionRef.current\n// )\n\n// animate({\n// from: transform,\n// to: { x: 0, y: 0, scaleX: 1, scaleY: 1 },\n// duration: 1000,\n// onUpdate: ({ x, y, scaleX, scaleY }) => {\n// // @ts-ignore\n// host.style.transform = `translate(${x}px, ${y}px) scaleX(${scaleX}) scaleY(${scaleY})`\n// // TODO: handle childRef inverse scale\n// // childRef.current.style.transform = `scaleX(${1 / scaleX}) scaleY(${\n// // 1 / scaleY\n// // })`\n// },\n// // TODO: extract ease-in from string and convert/map it to a cubicBezier array\n// cubicBezier: [0, 1.38, 1, -0.41],\n// })\n// }\n// initialPositionRef.current = boundingBox\n// })\n\n// style.transition = `${keys} ${animation}${\n// props.layout ? ',width 0s, height 0s, margin 0s, padding 0s, transform' : ''\n// }`\n\n// const isChanged = (initialBox: any, finalBox: any) => {\n// // we just mounted, so we don't have complete data yet\n// if (!initialBox || !finalBox) return false\n\n// // deep compare the two boxes\n// return JSON.stringify(initialBox) !== JSON.stringify(finalBox)\n// }\n\n// const invert = (el, from, to) => {\n// const { x: fromX, y: fromY, width: fromWidth, height: fromHeight } = from\n// const { x, y, width, height } = to\n\n// const transform = {\n// x: x - fromX - (fromWidth - width) / 2,\n// y: y - fromY - (fromHeight - height) / 2,\n// scaleX: width / fromWidth,\n// scaleY: height / fromHeight,\n// }\n\n// el.style.transform = `\n"
9
+ "import {\n normalizeTransition,\n getAnimatedProperties,\n hasAnimation as hasNormalizedAnimation,\n getEffectiveAnimation,\n getAnimationConfigsForKeys,\n} from '@tamagui/animation-helpers'\nimport { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { ResetPresence, usePresence } from '@tamagui/use-presence'\nimport type { AnimationDriver, UniversalAnimatedNumber } from '@tamagui/web'\nimport { transformsToString } from '@tamagui/web'\nimport React, { useState } from 'react' // import { animate } from '@tamagui/cubic-bezier-animator'\n\nconst EXTRACT_MS_REGEX = /(\\d+(?:\\.\\d+)?)\\s*ms/\nconst EXTRACT_S_REGEX = /(\\d+(?:\\.\\d+)?)\\s*s/\n\n/**\n * Helper function to extract duration from CSS animation string\n * Examples: \"ease-in 200ms\" -> 200, \"cubic-bezier(0.215, 0.610, 0.355, 1.000) 400ms\" -> 400\n * \"ease-in 0.5s\" -> 500, \"slow 2s\" -> 2000\n */\nfunction extractDuration(animation: string): number {\n // Try to match milliseconds first\n const msMatch = animation.match(EXTRACT_MS_REGEX)\n if (msMatch) {\n return Number.parseInt(msMatch[1], 10)\n }\n\n // Try to match seconds and convert to milliseconds\n const sMatch = animation.match(EXTRACT_S_REGEX)\n if (sMatch) {\n return Math.round(Number.parseFloat(sMatch[1]) * 1000)\n }\n\n // Default to 300ms if no duration found\n return 300\n}\n\nconst MS_DURATION_REGEX = /(\\d+(?:\\.\\d+)?)\\s*ms/\nconst S_DURATION_REGEX = /(\\d+(?:\\.\\d+)?)\\s*s(?!tiffness)/\n\n/**\n * Apply duration override to a CSS animation string\n * Replaces the existing duration with the override value\n */\nfunction applyDurationOverride(animation: string, durationMs: number): string {\n // Replace ms duration\n const msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`)\n if (msReplaced !== animation) {\n return msReplaced\n }\n\n // Replace seconds duration\n const sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`)\n if (sReplaced !== animation) {\n return sReplaced\n }\n\n // No duration found, prepend the duration\n return `${durationMs}ms ${animation}`\n}\n\n// transform keys that need special handling\nconst TRANSFORM_KEYS = [\n 'x',\n 'y',\n 'scale',\n 'scaleX',\n 'scaleY',\n 'rotate',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'skewX',\n 'skewY',\n] as const\n\n/**\n * Build a CSS transform string from a style object containing transform properties\n */\nfunction buildTransformString(style: Record<string, unknown> | undefined): string {\n if (!style) return ''\n\n const parts: string[] = []\n\n if (style.x !== undefined || style.y !== undefined) {\n const x = style.x ?? 0\n const y = style.y ?? 0\n parts.push(`translate(${x}px, ${y}px)`)\n }\n if (style.scale !== undefined) {\n parts.push(`scale(${style.scale})`)\n }\n if (style.scaleX !== undefined) {\n parts.push(`scaleX(${style.scaleX})`)\n }\n if (style.scaleY !== undefined) {\n parts.push(`scaleY(${style.scaleY})`)\n }\n if (style.rotate !== undefined) {\n const val = style.rotate\n const unit = typeof val === 'string' && val.includes('deg') ? '' : 'deg'\n parts.push(`rotate(${val}${unit})`)\n }\n if (style.rotateX !== undefined) {\n parts.push(`rotateX(${style.rotateX}deg)`)\n }\n if (style.rotateY !== undefined) {\n parts.push(`rotateY(${style.rotateY}deg)`)\n }\n if (style.rotateZ !== undefined) {\n parts.push(`rotateZ(${style.rotateZ}deg)`)\n }\n if (style.skewX !== undefined) {\n parts.push(`skewX(${style.skewX}deg)`)\n }\n if (style.skewY !== undefined) {\n parts.push(`skewY(${style.skewY}deg)`)\n }\n\n return parts.join(' ')\n}\n\n/**\n * Apply a style object to a DOM node, handling transform keys specially\n */\nfunction applyStylesToNode(\n node: HTMLElement,\n style: Record<string, unknown> | undefined\n): void {\n if (!style) return\n\n // collect transform values\n const transformStr = buildTransformString(style)\n if (transformStr) {\n node.style.transform = transformStr\n }\n\n // apply non-transform properties\n for (const [key, value] of Object.entries(style)) {\n if (TRANSFORM_KEYS.includes(key as any)) continue\n if (value === undefined) continue\n\n if (key === 'opacity') {\n node.style.opacity = String(value)\n } else if (key === 'backgroundColor') {\n node.style.backgroundColor = String(value)\n } else if (key === 'color') {\n node.style.color = String(value)\n } else {\n // generic fallback\n node.style[key as any] = typeof value === 'number' ? `${value}px` : String(value)\n }\n }\n}\n\nexport function createAnimations<A extends object>(animations: A): AnimationDriver<A> {\n const reactionListeners = new WeakMap<any, Set<Function>>()\n\n return {\n animations,\n usePresence,\n ResetPresence,\n inputStyle: 'css',\n outputStyle: 'css',\n\n useAnimatedNumber(initial): UniversalAnimatedNumber<Function> {\n const [val, setVal] = React.useState(initial)\n const finishTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null)\n\n return {\n getInstance() {\n return setVal\n },\n getValue() {\n return val\n },\n setValue(next, config, onFinish) {\n setVal(next)\n\n // clear any pending finish callback from a previous setValue\n if (finishTimerRef.current) {\n clearTimeout(finishTimerRef.current)\n finishTimerRef.current = null\n }\n\n if (onFinish) {\n if (\n !config ||\n config.type === 'direct' ||\n (config.type === 'timing' && config.duration === 0)\n ) {\n onFinish()\n } else {\n // estimate duration: use explicit duration, or fall back to\n // default CSS transition duration for spring-type configs\n const duration = config.type === 'timing' ? config.duration : 300\n finishTimerRef.current = setTimeout(onFinish, duration)\n }\n }\n\n // call reaction listeners with the new value\n const listeners = reactionListeners.get(setVal)\n if (listeners) {\n listeners.forEach((listener) => listener(next))\n }\n },\n stop() {\n if (finishTimerRef.current) {\n clearTimeout(finishTimerRef.current)\n finishTimerRef.current = null\n }\n },\n }\n },\n\n useAnimatedNumberReaction({ value }, onValue) {\n React.useEffect(() => {\n const instance = value.getInstance()\n let queue = reactionListeners.get(instance)\n if (!queue) {\n const next = new Set<Function>()\n reactionListeners.set(instance, next)\n queue = next!\n }\n queue.add(onValue)\n return () => {\n queue?.delete(onValue)\n }\n }, [])\n },\n\n useAnimatedNumberStyle(val, getStyle) {\n return getStyle(val.getValue())\n },\n\n useAnimatedNumbersStyle(vals, getStyle) {\n return getStyle(...vals.map((v) => v.getValue()))\n },\n\n // @ts-ignore - styleState is added by createComponent\n useAnimations: ({\n props,\n presence,\n style,\n componentState,\n stateRef,\n styleState,\n }: any) => {\n const isHydrating = componentState.unmounted === true\n const isEntering = !!componentState.unmounted\n const isExiting = presence?.[0] === false\n const sendExitComplete = presence?.[1]\n\n // Track if we just finished entering (transition from entering to not entering)\n // This is needed because the CSS transition happens on the render AFTER t_unmounted is removed\n const wasEnteringRef = React.useRef(isEntering)\n const justFinishedEntering = wasEnteringRef.current && !isEntering\n React.useEffect(() => {\n wasEnteringRef.current = isEntering\n })\n\n // exit cycle guards to prevent stale/duplicate completion\n const exitCycleIdRef = React.useRef(0)\n const exitCompletedRef = React.useRef(false)\n const wasExitingRef = React.useRef(false)\n const exitInterruptedRef = React.useRef(false)\n const sendExitCompleteRef = React.useRef(sendExitComplete)\n const lastNonExitingStyleRef = React.useRef<Record<string, string>>({})\n sendExitCompleteRef.current = sendExitComplete\n\n // detect transition into/out of exiting state\n const justStartedExiting = isExiting && !wasExitingRef.current\n const justStoppedExiting = !isExiting && wasExitingRef.current\n\n // start new exit cycle only on transition INTO exiting\n if (justStartedExiting) {\n exitCycleIdRef.current++\n exitCompletedRef.current = false\n }\n // track interruptions so we know to force-restart transitions\n if (justStoppedExiting) {\n exitCycleIdRef.current++\n exitInterruptedRef.current = true\n }\n\n // track previous exiting state\n React.useEffect(() => {\n wasExitingRef.current = isExiting\n })\n\n useIsomorphicLayoutEffect(() => {\n const host = stateRef.current.host\n if (isExiting || !host) return\n const computedStyle = getComputedStyle(host as HTMLElement)\n lastNonExitingStyleRef.current = {\n opacity: computedStyle.opacity,\n }\n })\n\n // use effectiveTransition computed by createComponent (single source of truth)\n const effectiveTransition = styleState?.effectiveTransition ?? props.transition\n\n // Normalize the transition prop to a consistent format\n const normalized = normalizeTransition(effectiveTransition)\n\n // Determine animation state and get effective animation\n // Use 'enter' if we're entering OR if we just finished entering (transition is happening)\n const animationState = isExiting\n ? 'exit'\n : isEntering || justFinishedEntering\n ? 'enter'\n : 'default'\n const effectiveAnimationKey = getEffectiveAnimation(normalized, animationState)\n const defaultAnimation = effectiveAnimationKey\n ? animations[effectiveAnimationKey]\n : null\n const animatedProperties = getAnimatedProperties(normalized)\n\n // Determine which properties to animate\n // - animateOnly prop is an exclusive filter (only animate those properties)\n // - per-property configs WITHOUT a default = only animate those specific properties\n // - per-property configs WITH a default = per-property overrides + default for rest\n const hasDefault =\n normalized.default !== null ||\n normalized.enter !== null ||\n normalized.exit !== null\n const hasPerPropertyConfigs = animatedProperties.length > 0\n\n let keys: string[]\n if (props.animateOnly) {\n // animateOnly is explicit filter\n keys = props.animateOnly\n } else if (hasPerPropertyConfigs && !hasDefault) {\n // object format without default: { opacity: '200ms' } = only animate opacity\n keys = animatedProperties\n } else if (hasPerPropertyConfigs && hasDefault) {\n // array format or object with default: 'all' first, then per-property overrides\n // CSS transition specificity: later declarations override earlier ones for the same property\n keys = ['all', ...animatedProperties]\n } else {\n // simple string format: 'quick' = animate all\n keys = ['all']\n }\n\n useIsomorphicLayoutEffect(() => {\n const host = stateRef.current.host\n if (!sendExitComplete || !isExiting || !host) return\n const node = host as HTMLElement\n\n // capture current cycle id for this effect\n const cycleId = exitCycleIdRef.current\n\n // helper to complete exit with guards\n const completeExit = () => {\n if (cycleId !== exitCycleIdRef.current) return\n if (exitCompletedRef.current) return\n exitCompletedRef.current = true\n sendExitCompleteRef.current?.()\n }\n\n // if no properties to animate (animateOnly=[]), complete immediately\n if (keys.length === 0) {\n completeExit()\n return\n }\n\n // Force transition restart for interrupted exits\n // When an exit is interrupted and restarted, the element may already be at\n // the exit style, so no CSS transition fires. We need to:\n // 1. Reset to non-exit state\n // 2. Force reflow\n // 3. Re-apply exit state to trigger transition\n let rafId: number | undefined\n const wasInterrupted = exitInterruptedRef.current\n // flag to ignore transitioncancel during reset (we intentionally cancel the old transition)\n let ignoreCancelEvents = wasInterrupted\n // get enter/exit styles for potential restart\n const enterStyle = props.enterStyle as Record<string, unknown> | undefined\n const exitStyle = props.exitStyle as Record<string, unknown> | undefined\n\n // Build the exit transition string - needed for both normal and interrupted exits\n const delayStr = normalized.delay ? ` ${normalized.delay}ms` : ''\n const durationOverride = normalized.config?.duration\n const exitTransitionString = keys\n .map((key) => {\n const propAnimation = normalized.properties[key]\n let animationValue: string | null = null\n if (typeof propAnimation === 'string') {\n animationValue = animations[propAnimation]\n } else if (\n propAnimation &&\n typeof propAnimation === 'object' &&\n propAnimation.type\n ) {\n animationValue = animations[propAnimation.type]\n } else if (defaultAnimation) {\n animationValue = defaultAnimation\n }\n if (animationValue && durationOverride) {\n animationValue = applyDurationOverride(animationValue, durationOverride)\n }\n return animationValue ? `${key} ${animationValue}${delayStr}` : null\n })\n .filter(Boolean)\n .join(', ')\n\n const getResetValue = (key: string) => {\n if (key === 'opacity') {\n return (\n style?.opacity ??\n props.opacity ??\n lastNonExitingStyleRef.current.opacity ??\n 1\n )\n }\n if (TRANSFORM_KEYS.includes(key as any)) {\n return key === 'scale' || key === 'scaleX' || key === 'scaleY' ? 1 : 0\n }\n return enterStyle?.[key]\n }\n\n if (wasInterrupted) {\n exitInterruptedRef.current = false\n // disable transition, reset to enter state\n node.style.transition = 'none'\n\n // reset: apply active/open state for each exit property (not enterStyle,\n // which may equal exitStyle — see comment in the normal exit path below)\n if (exitStyle) {\n const resetStyle: Record<string, unknown> = {}\n for (const key of Object.keys(exitStyle)) {\n const resetValue = getResetValue(key)\n if (resetValue !== undefined) {\n resetStyle[key] = resetValue\n }\n }\n applyStylesToNode(node, resetStyle)\n } else {\n // fallback if no exitStyle defined\n node.style.opacity = '1'\n node.style.transform = 'none'\n }\n\n // force reflow\n void node.offsetHeight\n } else if (exitStyle) {\n // For normal (non-interrupted) exits, we need to ensure the CSS transition is\n // processed by the browser BEFORE the exitStyle takes effect. The issue is that\n // React may have already applied exitStyle in the same render batch. To fix this:\n // 1. Disable transition and reset to non-exit state\n // 2. Force reflow so browser processes the reset\n // 3. Use RAF to ensure we're in a new frame\n // 4. Re-enable transition and apply exitStyle\n // This mirrors the interrupted exit handling approach (which also uses RAF).\n ignoreCancelEvents = true\n node.style.transition = 'none'\n\n // Reset to the active/open state (not enterStyle, which may equal exitStyle).\n // enterStyle is the \"unmounted\" initial state and can share values with exitStyle\n // (e.g., both have opacity: 0). resetting to enterStyle would mean no value change\n // when exitStyle is applied, so the CSS transition wouldn't fire.\n const resetStyle: Record<string, unknown> = {}\n for (const key of Object.keys(exitStyle)) {\n const resetValue = getResetValue(key)\n if (resetValue !== undefined) {\n resetStyle[key] = resetValue\n }\n }\n applyStylesToNode(node, resetStyle)\n\n // Force reflow\n void node.offsetHeight\n\n // Use RAF to ensure transition is applied in a new frame\n rafId = requestAnimationFrame(() => {\n if (cycleId !== exitCycleIdRef.current) return\n // Re-enable transition\n node.style.transition = exitTransitionString\n // Force reflow to ensure transition is active\n void node.offsetHeight\n // Apply exit styles - this triggers the animation\n applyStylesToNode(node, exitStyle)\n // Re-enable cancel event handling\n ignoreCancelEvents = false\n })\n }\n\n /**\n * Exit animation handling for Dialog/Modal components\n *\n * The Challenge: When users close dialogs (via Escape key or clicking outside),\n * the element can disappear from the DOM before CSS transitions finish, which causes:\n * 1. Dialogs to stick around on screen\n * 2. Event handlers to stop working\n *\n * Fix: Calculate the MAXIMUM duration across all animated properties, not just\n * the default. With animateOnly and per-property configs, different properties\n * can have different durations, and we need to wait for the LONGEST one.\n */\n\n // calculate max duration across all animated properties\n let maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200\n\n // check per-property animation durations using shared helper\n const animationConfigs = getAnimationConfigsForKeys(\n normalized,\n animations as Record<string, string>,\n keys,\n defaultAnimation\n )\n for (const animationValue of animationConfigs.values()) {\n if (animationValue) {\n const duration = extractDuration(animationValue)\n if (duration > maxDuration) {\n maxDuration = duration\n }\n }\n }\n\n const delay = normalized.delay ?? 0\n const fallbackTimeout = maxDuration + delay\n\n const timeoutId = setTimeout(() => {\n completeExit()\n }, fallbackTimeout)\n\n // track number of transitioning properties to wait for all to finish\n // (each property fires its own transitionend event)\n const transitioningProps = new Set(keys)\n let completedCount = 0\n\n const onFinishAnimation = (event: TransitionEvent) => {\n // only count transitions on THIS element, not bubbled from children\n if (event.target !== node) return\n\n // map CSS property names to our key names\n // e.g., transitionend fires with propertyName 'transform' for scale/x/y\n const eventProp = event.propertyName\n if (transitioningProps.has(eventProp) || eventProp === 'all') {\n completedCount++\n // wait for all properties to finish\n if (completedCount >= transitioningProps.size) {\n clearTimeout(timeoutId)\n completeExit()\n }\n }\n }\n\n // on cancel, still complete (element is exiting and animation was interrupted)\n // the guards prevent duplicate completion if this is a stale cycle\n const onCancelAnimation = () => {\n // ignore cancel events during reset phase (we intentionally cancel the old transition)\n if (ignoreCancelEvents) return\n clearTimeout(timeoutId)\n completeExit()\n }\n\n node.addEventListener('transitionend', onFinishAnimation)\n node.addEventListener('transitioncancel', onCancelAnimation)\n\n // For interrupted exits, re-enable transition and re-apply exit styles\n // This must happen AFTER listeners are set up so we catch the transitionend\n if (wasInterrupted) {\n rafId = requestAnimationFrame(() => {\n if (cycleId !== exitCycleIdRef.current) return\n // re-enable transition using the pre-built string\n node.style.transition = exitTransitionString\n // force reflow again\n void node.offsetHeight\n // now apply exit styles - this triggers the transition\n applyStylesToNode(node, exitStyle)\n // re-enable cancel event handling now that reset is complete\n ignoreCancelEvents = false\n })\n }\n\n return () => {\n clearTimeout(timeoutId)\n if (rafId !== undefined) cancelAnimationFrame(rafId)\n node.removeEventListener('transitionend', onFinishAnimation)\n node.removeEventListener('transitioncancel', onCancelAnimation)\n // restore transition: the exit handling sets node.style.transition='none'\n // directly on the DOM (bypassing React). if exit is interrupted (e.g. same-key\n // re-entry in AnimatePresence), React won't re-apply its managed transition\n // value because it hasn't changed in the virtual DOM. clearing the inline\n // override lets React's value take effect again.\n node.style.transition = ''\n }\n }, [isExiting])\n\n // tamagui doesnt even use animation output during hydration\n if (isHydrating) {\n return null\n }\n\n // Check if we have any animation to apply\n if (!hasNormalizedAnimation(normalized)) {\n return null\n }\n\n if (Array.isArray(style.transform)) {\n style.transform = transformsToString(style.transform)\n }\n\n // Build CSS transition string\n // TODO: we disabled the transform transition, because it will create issue for inverse function and animate function\n // for non layout transform properties either use animate function or find a workaround to do it with css\n const delayStr = normalized.delay ? ` ${normalized.delay}ms` : ''\n const durationOverride = normalized.config?.duration\n style.transition = keys\n .map((key) => {\n // Check for property-specific animation, fall back to default\n const propAnimation = normalized.properties[key]\n let animationValue: string | null = null\n\n if (typeof propAnimation === 'string') {\n animationValue = animations[propAnimation]\n } else if (\n propAnimation &&\n typeof propAnimation === 'object' &&\n propAnimation.type\n ) {\n animationValue = animations[propAnimation.type]\n } else if (defaultAnimation) {\n animationValue = defaultAnimation\n }\n\n // Apply global duration override if specified\n if (animationValue && durationOverride) {\n animationValue = applyDurationOverride(animationValue, durationOverride)\n }\n\n return animationValue ? `${key} ${animationValue}${delayStr}` : null\n })\n .filter(Boolean)\n .join(', ')\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n console.info('CSS animation', {\n props,\n animations,\n normalized,\n defaultAnimation,\n style,\n isEntering,\n isExiting,\n })\n }\n\n return { style, className: isEntering ? 't_unmounted' : '' }\n },\n }\n}\n\n// layout animations\n// useIsomorphicLayoutEffect(() => {\n// if (!host || !props.layout) {\n// return\n// }\n// // @ts-ignore\n// const boundingBox = host?.getBoundingClientRect()\n// if (isChanged(initialPositionRef.current, boundingBox)) {\n// const transform = invert(\n// host,\n// boundingBox,\n// initialPositionRef.current\n// )\n\n// animate({\n// from: transform,\n// to: { x: 0, y: 0, scaleX: 1, scaleY: 1 },\n// duration: 1000,\n// onUpdate: ({ x, y, scaleX, scaleY }) => {\n// // @ts-ignore\n// host.style.transform = `translate(${x}px, ${y}px) scaleX(${scaleX}) scaleY(${scaleY})`\n// // TODO: handle childRef inverse scale\n// // childRef.current.style.transform = `scaleX(${1 / scaleX}) scaleY(${\n// // 1 / scaleY\n// // })`\n// },\n// // TODO: extract ease-in from string and convert/map it to a cubicBezier array\n// cubicBezier: [0, 1.38, 1, -0.41],\n// })\n// }\n// initialPositionRef.current = boundingBox\n// })\n\n// style.transition = `${keys} ${animation}${\n// props.layout ? ',width 0s, height 0s, margin 0s, padding 0s, transform' : ''\n// }`\n\n// const isChanged = (initialBox: any, finalBox: any) => {\n// // we just mounted, so we don't have complete data yet\n// if (!initialBox || !finalBox) return false\n\n// // deep compare the two boxes\n// return JSON.stringify(initialBox) !== JSON.stringify(finalBox)\n// }\n\n// const invert = (el, from, to) => {\n// const { x: fromX, y: fromY, width: fromWidth, height: fromHeight } = from\n// const { x, y, width, height } = to\n\n// const transform = {\n// x: x - fromX - (fromWidth - width) / 2,\n// y: y - fromY - (fromHeight - height) / 2,\n// scaleX: width / fromWidth,\n// scaleY: height / fromHeight,\n// }\n\n// el.style.transform = `\n"
10
10
  ]
11
11
  }