@tamagui/animations-css 2.0.0-rc.4 → 2.0.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createAnimations.cjs +353 -82
- package/dist/cjs/createAnimations.native.js +452 -100
- package/dist/cjs/createAnimations.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/createAnimations.mjs +326 -57
- package/dist/esm/createAnimations.mjs.map +1 -1
- package/dist/esm/createAnimations.native.js +425 -75
- package/dist/esm/createAnimations.native.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -6
- package/package.json +10 -13
- package/src/createAnimations.tsx +427 -28
- package/types/createAnimations.d.ts.map +4 -4
- package/types/index.d.ts.map +2 -2
- package/dist/cjs/createAnimations.js +0 -120
- package/dist/cjs/createAnimations.js.map +0 -6
- package/dist/cjs/index.js +0 -15
- package/dist/cjs/index.js.map +0 -6
- package/dist/esm/createAnimations.js +0 -105
- package/dist/esm/createAnimations.js.map +0 -6
|
@@ -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","extractDuration","animation","msMatch","match","Number","parseInt","sMatch","Math","round","parseFloat","animations","reactionListeners","WeakMap","usePresence","ResetPresence","supportsCSS","inputStyle","outputStyle","classNameAnimation","useAnimatedNumber","initial","val","setVal","default","useState","onFinish","setOnFinish","useIsomorphicLayoutEffect","getInstance","getValue","setValue","next","config","onFinish2","listeners","get","forEach","listener","stop","useAnimatedNumberReaction","param","onValue","useEffect","instance","queue","Set","set","add","delete","useAnimatedNumberStyle","getStyle","useAnimations","props","presence","style","componentState","stateRef","isEntering","unmounted","isExiting","sendExitComplete","wasEnteringRef","useRef","justFinishedEntering","current","normalized","normalizeTransition","transition","animationState","effectiveAnimationKey","getEffectiveAnimation","defaultAnimation","animatedProperties","getAnimatedProperties","hasDefault","enter","exit","hasPerPropertyConfigs","length","keys","animateOnly","host","node","animationDuration","_normalized_delay","delay","fallbackTimeout","timeoutId","setTimeout","onFinishAnimation","clearTimeout","addEventListener","removeEventListener","hasAnimation","Array","isArray","transform","transformsToString"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAA,CAAAK,wBAKO;AAYP,IAAAK,wBAAyB,GAAAC,OAA2B;EAAAC,gBAAA,GAAAD,OAAA;EAAAE,mBAAA,GAAAF,OAAA;EAAAG,UAAA,GAAAH,OAAA;EAAAI,YAAA,GAAAC,OAAA,CAAAL,OAAA;AAElD,SAAMM,SAAUC,GAAA;EAChB,uBAAI;;EACF,OAAAA,GAAO,WAAOC,MAAS,MAAQ,IAAID,GAAE,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAIvC;AACA,SAAIG,eACUA,CAAAC,SAAM,EAAO;EAK7B,IAAAC,OAAA,GAAAD,SAAA,CAAAE,KAAA;EAEO,IAAAD,OAAS,EACd,OAAME,MAAA,CAAAC,QAAA,CAAAH,OAAoB;EAE1B,IAAAI,MAAO,GAAAL,SAAA,CAAAE,KAAA;EAAA,OACLG,MAAA,GAAAC,IAAA,CAAAC,KAAA,CAAAJ,MAAA,CAAAK,UAAA,CAAAH,MAAA;AAAA;AACA,SACApB,iBAAAwB,UAAA;EAAA,IACAC,iBAAa,sBAAAC,OAAA;EAAA,OACb;IACAF,U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ropNames","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","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","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 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 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 if (cycleId !== exitCycleIdRef.current) return;\n if (exitCompletedRef.current) return;\n exitCompletedRef.current = true;\n sendExitComplete();\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 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 if (key === \"opacity\") {\n resetStyle[key] = 1;\n } else if (TRANSFORM_KEYS.includes(key)) {\n resetStyle[key] = key === \"scale\" || key === \"scaleX\" || key === \"scaleY\" ? 1 : 0;\n } else if ((enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key]) !== void 0) {\n resetStyle[key] = enterStyle[key];\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 if (key1 === \"opacity\") {\n resetStyle1[key1] = 1;\n } else if (TRANSFORM_KEYS.includes(key1)) {\n resetStyle1[key1] = key1 === \"scale\" || key1 === \"scaleX\" || key1 === \"scaleY\" ? 1 : 0;\n } else if ((enterStyle === null || enterStyle === void 0 ? void 0 : enterStyle[key1]) !== void 0) {\n resetStyle1[key1] = enterStyle[key1];\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 sendExitComplete,\n isExiting,\n stateRef,\n keys,\n normalized,\n defaultAnimation,\n props.enterStyle,\n props.exitStyle\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,mBAAmB;AAClD,IAAIC,YAAY,GAAGR,MAAM,CAACS,cAAc;AACxC,IAAIC,YAAY,GAAGV,MAAM,CAACW,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBb,SAAS,CAACY,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,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AC1EqG,OAAO,CAACC,IAAI,CAAC,eAAe,EAAE;UAC5BtG,KAAK;UACL7C,UAAU;UACVmE,UAAU;UACVK,gBAAgB;UAChB/G,KAAK;UACL4F,UAAU;UACVC;QACF,CAAC,CAAC;MACJ;MACA,OAAO;QACL7F,KAAK;QACL2L,SAAS,EAAE/F,UAAU,GAAG,aAAa,GAAG;MAC1C,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,15 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
7
8
|
get: () => from[key],
|
|
8
9
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
15
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
-
value:
|
|
16
|
+
value: true
|
|
15
17
|
}), mod);
|
|
16
18
|
var index_exports = {};
|
|
17
19
|
module.exports = __toCommonJS(index_exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
10
|
get: () => from[key],
|
|
10
11
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
17
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value:
|
|
18
|
+
value: true
|
|
17
19
|
}), mod);
|
|
18
20
|
var index_exports = {};
|
|
19
21
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
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,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIV,iBAAiB,CAACO,IAAI,CAAC,EACrC,IAAI,CAACL,YAAY,CAACS,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/Cb,SAAS,CAACW,EAAE,EAAEI,GAAG,EAAE;MAAEE,GAAG,EAAEA,CAAA,KAAML,IAAI,CAACG,GAAG,CAAC;MAAEG,UAAU,EAAE,EAAEJ,IAAI,GAAGX,gBAAgB,CAACS,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACI;IAAW,CAAC,CAAC;EACxH;EACA,OAAOP,EAAE;AACX,CAAC;AACD,IAAIQ,UAAU,GAAGA,CAACC,MAAM,EAAEC,GAAG,EAAEC,YAAY,MAAMZ,WAAW,CAACU,MAAM,EAAEC,GAAG,EAAE,SAAS,CAAC,EAAEC,YAAY,IAAIZ,WAAW,CAACY,YAAY,EAAED,GAAG,EAAE,SAAS,CAAC,CAAC;AAChJ,IAAIE,YAAY,GAAIF,GAAG,IAAKX,WAAW,CAACV,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEwB,KAAK,EAAE;AAAK,CAAC,CAAC,EAAEH,GAAG,CAAC;AAC1F,IAAII,aAAa,GAAG,CAAC,CAAC;AACtBC,MAAM,CAACC,OAAO,GAAGJ,YAAY,CAACE,aAAa,CAAC;AAC5CN,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,8BAAoB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC","ignoreList":[]}
|
|
@@ -1,13 +1,93 @@
|
|
|
1
|
-
import { normalizeTransition, getAnimatedProperties, hasAnimation as hasNormalizedAnimation, getEffectiveAnimation } from "@tamagui/animation-helpers";
|
|
1
|
+
import { normalizeTransition, getAnimatedProperties, hasAnimation as hasNormalizedAnimation, getEffectiveAnimation, getAnimationConfigsForKeys } from "@tamagui/animation-helpers";
|
|
2
2
|
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
3
3
|
import { ResetPresence, usePresence } from "@tamagui/use-presence";
|
|
4
4
|
import { transformsToString } from "@tamagui/web";
|
|
5
|
-
import React
|
|
5
|
+
import React from "react";
|
|
6
|
+
const EXTRACT_MS_REGEX = /(\d+(?:\.\d+)?)\s*ms/;
|
|
7
|
+
const EXTRACT_S_REGEX = /(\d+(?:\.\d+)?)\s*s/;
|
|
6
8
|
function extractDuration(animation) {
|
|
7
|
-
const msMatch = animation.match(
|
|
8
|
-
if (msMatch)
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const msMatch = animation.match(EXTRACT_MS_REGEX);
|
|
10
|
+
if (msMatch) {
|
|
11
|
+
return Number.parseInt(msMatch[1], 10);
|
|
12
|
+
}
|
|
13
|
+
const sMatch = animation.match(EXTRACT_S_REGEX);
|
|
14
|
+
if (sMatch) {
|
|
15
|
+
return Math.round(Number.parseFloat(sMatch[1]) * 1e3);
|
|
16
|
+
}
|
|
17
|
+
return 300;
|
|
18
|
+
}
|
|
19
|
+
const MS_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*ms/;
|
|
20
|
+
const S_DURATION_REGEX = /(\d+(?:\.\d+)?)\s*s(?!tiffness)/;
|
|
21
|
+
function applyDurationOverride(animation, durationMs) {
|
|
22
|
+
const msReplaced = animation.replace(MS_DURATION_REGEX, `${durationMs}ms`);
|
|
23
|
+
if (msReplaced !== animation) {
|
|
24
|
+
return msReplaced;
|
|
25
|
+
}
|
|
26
|
+
const sReplaced = animation.replace(S_DURATION_REGEX, `${durationMs}ms`);
|
|
27
|
+
if (sReplaced !== animation) {
|
|
28
|
+
return sReplaced;
|
|
29
|
+
}
|
|
30
|
+
return `${durationMs}ms ${animation}`;
|
|
31
|
+
}
|
|
32
|
+
const TRANSFORM_KEYS = ["x", "y", "scale", "scaleX", "scaleY", "rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY"];
|
|
33
|
+
function buildTransformString(style) {
|
|
34
|
+
if (!style) return "";
|
|
35
|
+
const parts = [];
|
|
36
|
+
if (style.x !== void 0 || style.y !== void 0) {
|
|
37
|
+
const x = style.x ?? 0;
|
|
38
|
+
const y = style.y ?? 0;
|
|
39
|
+
parts.push(`translate(${x}px, ${y}px)`);
|
|
40
|
+
}
|
|
41
|
+
if (style.scale !== void 0) {
|
|
42
|
+
parts.push(`scale(${style.scale})`);
|
|
43
|
+
}
|
|
44
|
+
if (style.scaleX !== void 0) {
|
|
45
|
+
parts.push(`scaleX(${style.scaleX})`);
|
|
46
|
+
}
|
|
47
|
+
if (style.scaleY !== void 0) {
|
|
48
|
+
parts.push(`scaleY(${style.scaleY})`);
|
|
49
|
+
}
|
|
50
|
+
if (style.rotate !== void 0) {
|
|
51
|
+
const val = style.rotate;
|
|
52
|
+
const unit = typeof val === "string" && val.includes("deg") ? "" : "deg";
|
|
53
|
+
parts.push(`rotate(${val}${unit})`);
|
|
54
|
+
}
|
|
55
|
+
if (style.rotateX !== void 0) {
|
|
56
|
+
parts.push(`rotateX(${style.rotateX}deg)`);
|
|
57
|
+
}
|
|
58
|
+
if (style.rotateY !== void 0) {
|
|
59
|
+
parts.push(`rotateY(${style.rotateY}deg)`);
|
|
60
|
+
}
|
|
61
|
+
if (style.rotateZ !== void 0) {
|
|
62
|
+
parts.push(`rotateZ(${style.rotateZ}deg)`);
|
|
63
|
+
}
|
|
64
|
+
if (style.skewX !== void 0) {
|
|
65
|
+
parts.push(`skewX(${style.skewX}deg)`);
|
|
66
|
+
}
|
|
67
|
+
if (style.skewY !== void 0) {
|
|
68
|
+
parts.push(`skewY(${style.skewY}deg)`);
|
|
69
|
+
}
|
|
70
|
+
return parts.join(" ");
|
|
71
|
+
}
|
|
72
|
+
function applyStylesToNode(node, style) {
|
|
73
|
+
if (!style) return;
|
|
74
|
+
const transformStr = buildTransformString(style);
|
|
75
|
+
if (transformStr) {
|
|
76
|
+
node.style.transform = transformStr;
|
|
77
|
+
}
|
|
78
|
+
for (const [key, value] of Object.entries(style)) {
|
|
79
|
+
if (TRANSFORM_KEYS.includes(key)) continue;
|
|
80
|
+
if (value === void 0) continue;
|
|
81
|
+
if (key === "opacity") {
|
|
82
|
+
node.style.opacity = String(value);
|
|
83
|
+
} else if (key === "backgroundColor") {
|
|
84
|
+
node.style.backgroundColor = String(value);
|
|
85
|
+
} else if (key === "color") {
|
|
86
|
+
node.style.color = String(value);
|
|
87
|
+
} else {
|
|
88
|
+
node.style[key] = typeof value === "number" ? `${value}px` : String(value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
11
91
|
}
|
|
12
92
|
function createAnimations(animations) {
|
|
13
93
|
const reactionListeners = /* @__PURE__ */new WeakMap();
|
|
@@ -15,28 +95,43 @@ function createAnimations(animations) {
|
|
|
15
95
|
animations,
|
|
16
96
|
usePresence,
|
|
17
97
|
ResetPresence,
|
|
18
|
-
supportsCSS: !0,
|
|
19
98
|
inputStyle: "css",
|
|
20
99
|
outputStyle: "css",
|
|
21
|
-
classNameAnimation: !0,
|
|
22
100
|
useAnimatedNumber(initial) {
|
|
23
|
-
const [val, setVal] = React.useState(initial)
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
onFinish && (onFinish?.(), setOnFinish(void 0));
|
|
27
|
-
}, [onFinish]), {
|
|
101
|
+
const [val, setVal] = React.useState(initial);
|
|
102
|
+
const finishTimerRef = React.useRef(null);
|
|
103
|
+
return {
|
|
28
104
|
getInstance() {
|
|
29
105
|
return setVal;
|
|
30
106
|
},
|
|
31
107
|
getValue() {
|
|
32
108
|
return val;
|
|
33
109
|
},
|
|
34
|
-
setValue(next, config,
|
|
35
|
-
setVal(next)
|
|
110
|
+
setValue(next, config, onFinish) {
|
|
111
|
+
setVal(next);
|
|
112
|
+
if (finishTimerRef.current) {
|
|
113
|
+
clearTimeout(finishTimerRef.current);
|
|
114
|
+
finishTimerRef.current = null;
|
|
115
|
+
}
|
|
116
|
+
if (onFinish) {
|
|
117
|
+
if (!config || config.type === "direct" || config.type === "timing" && config.duration === 0) {
|
|
118
|
+
onFinish();
|
|
119
|
+
} else {
|
|
120
|
+
const duration = config.type === "timing" ? config.duration : 300;
|
|
121
|
+
finishTimerRef.current = setTimeout(onFinish, duration);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
36
124
|
const listeners = reactionListeners.get(setVal);
|
|
37
|
-
|
|
125
|
+
if (listeners) {
|
|
126
|
+
listeners.forEach(listener => listener(next));
|
|
127
|
+
}
|
|
38
128
|
},
|
|
39
|
-
stop() {
|
|
129
|
+
stop() {
|
|
130
|
+
if (finishTimerRef.current) {
|
|
131
|
+
clearTimeout(finishTimerRef.current);
|
|
132
|
+
finishTimerRef.current = null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
40
135
|
};
|
|
41
136
|
},
|
|
42
137
|
useAnimatedNumberReaction({
|
|
@@ -47,9 +142,11 @@ function createAnimations(animations) {
|
|
|
47
142
|
let queue = reactionListeners.get(instance);
|
|
48
143
|
if (!queue) {
|
|
49
144
|
const next = /* @__PURE__ */new Set();
|
|
50
|
-
reactionListeners.set(instance, next)
|
|
145
|
+
reactionListeners.set(instance, next);
|
|
146
|
+
queue = next;
|
|
51
147
|
}
|
|
52
|
-
|
|
148
|
+
queue.add(onValue);
|
|
149
|
+
return () => {
|
|
53
150
|
queue?.delete(onValue);
|
|
54
151
|
};
|
|
55
152
|
}, []);
|
|
@@ -57,60 +154,232 @@ function createAnimations(animations) {
|
|
|
57
154
|
useAnimatedNumberStyle(val, getStyle) {
|
|
58
155
|
return getStyle(val.getValue());
|
|
59
156
|
},
|
|
157
|
+
useAnimatedNumbersStyle(vals, getStyle) {
|
|
158
|
+
return getStyle(...vals.map(v => v.getValue()));
|
|
159
|
+
},
|
|
160
|
+
// @ts-ignore - styleState is added by createComponent
|
|
60
161
|
useAnimations: ({
|
|
61
162
|
props,
|
|
62
163
|
presence,
|
|
63
164
|
style,
|
|
64
165
|
componentState,
|
|
65
|
-
stateRef
|
|
166
|
+
stateRef,
|
|
167
|
+
styleState
|
|
66
168
|
}) => {
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
169
|
+
const isHydrating = componentState.unmounted === true;
|
|
170
|
+
const isEntering = !!componentState.unmounted;
|
|
171
|
+
const isExiting = presence?.[0] === false;
|
|
172
|
+
const sendExitComplete = presence?.[1];
|
|
173
|
+
const wasEnteringRef = React.useRef(isEntering);
|
|
174
|
+
const justFinishedEntering = wasEnteringRef.current && !isEntering;
|
|
72
175
|
React.useEffect(() => {
|
|
73
176
|
wasEnteringRef.current = isEntering;
|
|
74
177
|
});
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
178
|
+
const exitCycleIdRef = React.useRef(0);
|
|
179
|
+
const exitCompletedRef = React.useRef(false);
|
|
180
|
+
const wasExitingRef = React.useRef(false);
|
|
181
|
+
const exitInterruptedRef = React.useRef(false);
|
|
182
|
+
const justStartedExiting = isExiting && !wasExitingRef.current;
|
|
183
|
+
const justStoppedExiting = !isExiting && wasExitingRef.current;
|
|
184
|
+
if (justStartedExiting) {
|
|
185
|
+
exitCycleIdRef.current++;
|
|
186
|
+
exitCompletedRef.current = false;
|
|
187
|
+
}
|
|
188
|
+
if (justStoppedExiting) {
|
|
189
|
+
exitCycleIdRef.current++;
|
|
190
|
+
exitInterruptedRef.current = true;
|
|
191
|
+
}
|
|
192
|
+
React.useEffect(() => {
|
|
193
|
+
wasExitingRef.current = isExiting;
|
|
194
|
+
});
|
|
195
|
+
const effectiveTransition = styleState?.effectiveTransition ?? props.transition;
|
|
196
|
+
const normalized = normalizeTransition(effectiveTransition);
|
|
197
|
+
const animationState = isExiting ? "exit" : isEntering || justFinishedEntering ? "enter" : "default";
|
|
198
|
+
const effectiveAnimationKey = getEffectiveAnimation(normalized, animationState);
|
|
199
|
+
const defaultAnimation = effectiveAnimationKey ? animations[effectiveAnimationKey] : null;
|
|
200
|
+
const animatedProperties = getAnimatedProperties(normalized);
|
|
201
|
+
const hasDefault = normalized.default !== null || normalized.enter !== null || normalized.exit !== null;
|
|
202
|
+
const hasPerPropertyConfigs = animatedProperties.length > 0;
|
|
81
203
|
let keys;
|
|
82
|
-
if (props.animateOnly
|
|
204
|
+
if (props.animateOnly) {
|
|
205
|
+
keys = props.animateOnly;
|
|
206
|
+
} else if (hasPerPropertyConfigs && !hasDefault) {
|
|
207
|
+
keys = animatedProperties;
|
|
208
|
+
} else if (hasPerPropertyConfigs && hasDefault) {
|
|
209
|
+
keys = ["all", ...animatedProperties];
|
|
210
|
+
} else {
|
|
211
|
+
keys = ["all"];
|
|
212
|
+
}
|
|
213
|
+
useIsomorphicLayoutEffect(() => {
|
|
83
214
|
const host = stateRef.current.host;
|
|
84
215
|
if (!sendExitComplete || !isExiting || !host) return;
|
|
85
|
-
const node = host
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
216
|
+
const node = host;
|
|
217
|
+
const cycleId = exitCycleIdRef.current;
|
|
218
|
+
const completeExit = () => {
|
|
219
|
+
if (cycleId !== exitCycleIdRef.current) return;
|
|
220
|
+
if (exitCompletedRef.current) return;
|
|
221
|
+
exitCompletedRef.current = true;
|
|
222
|
+
sendExitComplete();
|
|
223
|
+
};
|
|
224
|
+
if (keys.length === 0) {
|
|
225
|
+
completeExit();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
let rafId;
|
|
229
|
+
const wasInterrupted = exitInterruptedRef.current;
|
|
230
|
+
let ignoreCancelEvents = wasInterrupted;
|
|
231
|
+
const enterStyle = props.enterStyle;
|
|
232
|
+
const exitStyle = props.exitStyle;
|
|
233
|
+
const delayStr2 = normalized.delay ? ` ${normalized.delay}ms` : "";
|
|
234
|
+
const durationOverride2 = normalized.config?.duration;
|
|
235
|
+
const exitTransitionString = keys.map(key => {
|
|
236
|
+
const propAnimation = normalized.properties[key];
|
|
237
|
+
let animationValue = null;
|
|
238
|
+
if (typeof propAnimation === "string") {
|
|
239
|
+
animationValue = animations[propAnimation];
|
|
240
|
+
} else if (propAnimation && typeof propAnimation === "object" && propAnimation.type) {
|
|
241
|
+
animationValue = animations[propAnimation.type];
|
|
242
|
+
} else if (defaultAnimation) {
|
|
243
|
+
animationValue = defaultAnimation;
|
|
244
|
+
}
|
|
245
|
+
if (animationValue && durationOverride2) {
|
|
246
|
+
animationValue = applyDurationOverride(animationValue, durationOverride2);
|
|
247
|
+
}
|
|
248
|
+
return animationValue ? `${key} ${animationValue}${delayStr2}` : null;
|
|
249
|
+
}).filter(Boolean).join(", ");
|
|
250
|
+
if (wasInterrupted) {
|
|
251
|
+
exitInterruptedRef.current = false;
|
|
252
|
+
node.style.transition = "none";
|
|
253
|
+
if (exitStyle) {
|
|
254
|
+
const resetStyle = {};
|
|
255
|
+
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];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
applyStylesToNode(node, resetStyle);
|
|
265
|
+
} else {
|
|
266
|
+
node.style.opacity = "1";
|
|
267
|
+
node.style.transform = "none";
|
|
268
|
+
}
|
|
269
|
+
void node.offsetHeight;
|
|
270
|
+
} else if (exitStyle) {
|
|
271
|
+
ignoreCancelEvents = true;
|
|
272
|
+
node.style.transition = "none";
|
|
273
|
+
const resetStyle = {};
|
|
274
|
+
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];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
applyStylesToNode(node, resetStyle);
|
|
284
|
+
void node.offsetHeight;
|
|
285
|
+
rafId = requestAnimationFrame(() => {
|
|
286
|
+
if (cycleId !== exitCycleIdRef.current) return;
|
|
287
|
+
node.style.transition = exitTransitionString;
|
|
288
|
+
void node.offsetHeight;
|
|
289
|
+
applyStylesToNode(node, exitStyle);
|
|
290
|
+
ignoreCancelEvents = false;
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
let maxDuration = defaultAnimation ? extractDuration(defaultAnimation) : 200;
|
|
294
|
+
const animationConfigs = getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation);
|
|
295
|
+
for (const animationValue of animationConfigs.values()) {
|
|
296
|
+
if (animationValue) {
|
|
297
|
+
const duration = extractDuration(animationValue);
|
|
298
|
+
if (duration > maxDuration) {
|
|
299
|
+
maxDuration = duration;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
const delay = normalized.delay ?? 0;
|
|
304
|
+
const fallbackTimeout = maxDuration + delay;
|
|
305
|
+
const timeoutId = setTimeout(() => {
|
|
306
|
+
completeExit();
|
|
307
|
+
}, fallbackTimeout);
|
|
308
|
+
const transitioningProps = new Set(keys);
|
|
309
|
+
let completedCount = 0;
|
|
310
|
+
const onFinishAnimation = event => {
|
|
311
|
+
if (event.target !== node) return;
|
|
312
|
+
const eventProp = event.propertyName;
|
|
313
|
+
if (transitioningProps.has(eventProp) || eventProp === "all") {
|
|
314
|
+
completedCount++;
|
|
315
|
+
if (completedCount >= transitioningProps.size) {
|
|
316
|
+
clearTimeout(timeoutId);
|
|
317
|
+
completeExit();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
97
320
|
};
|
|
98
|
-
|
|
99
|
-
|
|
321
|
+
const onCancelAnimation = () => {
|
|
322
|
+
if (ignoreCancelEvents) return;
|
|
323
|
+
clearTimeout(timeoutId);
|
|
324
|
+
completeExit();
|
|
325
|
+
};
|
|
326
|
+
node.addEventListener("transitionend", onFinishAnimation);
|
|
327
|
+
node.addEventListener("transitioncancel", onCancelAnimation);
|
|
328
|
+
if (wasInterrupted) {
|
|
329
|
+
rafId = requestAnimationFrame(() => {
|
|
330
|
+
if (cycleId !== exitCycleIdRef.current) return;
|
|
331
|
+
node.style.transition = exitTransitionString;
|
|
332
|
+
void node.offsetHeight;
|
|
333
|
+
applyStylesToNode(node, exitStyle);
|
|
334
|
+
ignoreCancelEvents = false;
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
return () => {
|
|
338
|
+
clearTimeout(timeoutId);
|
|
339
|
+
if (rafId !== void 0) cancelAnimationFrame(rafId);
|
|
340
|
+
node.removeEventListener("transitionend", onFinishAnimation);
|
|
341
|
+
node.removeEventListener("transitioncancel", onCancelAnimation);
|
|
342
|
+
node.style.transition = "";
|
|
343
|
+
};
|
|
344
|
+
}, [sendExitComplete, isExiting, stateRef, keys, normalized, defaultAnimation, props.enterStyle, props.exitStyle]);
|
|
345
|
+
if (isHydrating) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
if (!hasNormalizedAnimation(normalized)) {
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
if (Array.isArray(style.transform)) {
|
|
352
|
+
style.transform = transformsToString(style.transform);
|
|
353
|
+
}
|
|
100
354
|
const delayStr = normalized.delay ? ` ${normalized.delay}ms` : "";
|
|
101
|
-
|
|
355
|
+
const durationOverride = normalized.config?.duration;
|
|
356
|
+
style.transition = keys.map(key => {
|
|
102
357
|
const propAnimation = normalized.properties[key];
|
|
103
358
|
let animationValue = null;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
359
|
+
if (typeof propAnimation === "string") {
|
|
360
|
+
animationValue = animations[propAnimation];
|
|
361
|
+
} else if (propAnimation && typeof propAnimation === "object" && propAnimation.type) {
|
|
362
|
+
animationValue = animations[propAnimation.type];
|
|
363
|
+
} else if (defaultAnimation) {
|
|
364
|
+
animationValue = defaultAnimation;
|
|
365
|
+
}
|
|
366
|
+
if (animationValue && durationOverride) {
|
|
367
|
+
animationValue = applyDurationOverride(animationValue, durationOverride);
|
|
368
|
+
}
|
|
369
|
+
return animationValue ? `${key} ${animationValue}${delayStr}` : null;
|
|
370
|
+
}).filter(Boolean).join(", ");
|
|
371
|
+
if (process.env.NODE_ENV === "development" && props["debug"] === "verbose") {
|
|
372
|
+
console.info("CSS animation", {
|
|
373
|
+
props,
|
|
374
|
+
animations,
|
|
375
|
+
normalized,
|
|
376
|
+
defaultAnimation,
|
|
377
|
+
style,
|
|
378
|
+
isEntering,
|
|
379
|
+
isExiting
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
114
383
|
style,
|
|
115
384
|
className: isEntering ? "t_unmounted" : ""
|
|
116
385
|
};
|