@tamagui/animations-react-native 3.0.0-beta.669.1 → 3.0.0-beta.719.1
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 +0 -1
- package/dist/cjs/createAnimations.native.cjs +0 -1
- package/dist/cjs/createAnimations.native.js +0 -1
- package/dist/cjs/createAnimations.native.js.map +1 -1
- package/dist/cjs/index.cjs +0 -1
- package/dist/cjs/index.native.cjs +0 -1
- package/dist/cjs/index.native.js +0 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/polyfill.cjs +0 -1
- package/dist/cjs/polyfill.native.cjs +0 -1
- package/dist/cjs/polyfill.native.js +0 -1
- package/dist/cjs/polyfill.native.js.map +1 -1
- package/dist/esm/createAnimations.mjs.map +1 -1
- package/dist/esm/createAnimations.native.js.map +1 -1
- package/package.json +7 -7
- package/src/createAnimations.tsx +2 -2
- package/types/createAnimations.d.ts +2 -2
- package/types/createAnimations.d.ts.map +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnimations.native.js","names":[],"sources":["cjs/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 AnimatedText: () => AnimatedText,\n AnimatedView: () => AnimatedView,\n createAnimations: () => createAnimations,\n useAnimatedNumber: () => useAnimatedNumber,\n useAnimatedNumberReaction: () => useAnimatedNumberReaction,\n useAnimatedNumberStyle: () => useAnimatedNumberStyle,\n useAnimatedNumbersStyle: () => useAnimatedNumbersStyle\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);\nvar import_react_native = require(\"react-native\");\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar isFabric = !import_constants.isWeb && typeof global !== \"undefined\" && !!global.__nativeFabricUIManager;\nvar resolveDynamicValue = function(value, isDark) {\n if (value && (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) === \"object\" && \"dynamic\" in value) {\n var dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;\n return dynamicValue;\n }\n return value;\n};\nvar animatedStyleKey = {\n transform: true,\n opacity: true\n};\nvar colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true\n};\nvar layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true\n};\nfunction hasAnimatedLayoutKey(style, isDark, animateOnly) {\n for (var key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue;\n if (typeof resolveDynamicValue(style[key], isDark) === \"number\") return true;\n }\n return false;\n}\nfunction isAnimatableColor(value) {\n return typeof value === \"string\" && (0, import_react_native.processColor)(value) != null;\n}\nvar costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey\n};\nvar AnimatedView = import_react_native.Animated.View;\nvar AnimatedText = import_react_native.Animated.Text;\nfunction useAnimatedNumber(initial) {\n var state = import_react.default.useRef(null);\n if (!state.current) {\n state.current = {\n composite: null,\n val: new import_react_native.Animated.Value(initial),\n strategy: {\n type: \"spring\"\n }\n };\n }\n return {\n getInstance() {\n return state.current.val;\n },\n getValue() {\n return state.current.val[\"_value\"];\n },\n stop() {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n state.current.composite = null;\n },\n setValue(next) {\n var { type, ...config } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {\n type: \"spring\"\n }, onFinish = arguments.length > 2 ? arguments[2] : void 0;\n var val = state.current.val;\n var handleFinish = onFinish ? function(param) {\n var { finished } = param;\n return finished ? onFinish() : null;\n } : void 0;\n if (type === \"direct\") {\n val.setValue(next);\n } else if (type === \"spring\") {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n var composite = import_react_native.Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n } else {\n var _state_current_composite1;\n (_state_current_composite1 = state.current.composite) === null || _state_current_composite1 === void 0 ? void 0 : _state_current_composite1.stop();\n var composite1 = import_react_native.Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite1.start(handleFinish);\n state.current.composite = composite1;\n }\n }\n };\n}\nvar useAnimatedNumberReaction = function(param, onValue) {\n var { value } = param;\n var onChange = (0, import_web.useEvent)(function(current) {\n onValue(current.value);\n });\n import_react.default.useEffect(function() {\n var id = value.getInstance().addListener(onChange);\n return function() {\n value.getInstance().removeListener(id);\n };\n }, [\n value,\n onChange\n ]);\n};\nvar useAnimatedNumberStyle = function(value, getStyle) {\n var instance = value.getInstance();\n var animatedStyle = getStyle(instance);\n var usesAnimatedNode = hasAnimatedNode(animatedStyle);\n var [current, setCurrent] = import_react.default.useState(value.getValue());\n import_react.default.useEffect(function() {\n if (usesAnimatedNode) return;\n var id = instance.addListener(function(param) {\n var { value: next } = param;\n setCurrent(next);\n });\n return function() {\n instance.removeListener(id);\n };\n }, [\n instance,\n usesAnimatedNode\n ]);\n return usesAnimatedNode ? animatedStyle : getStyle(current);\n};\nfunction hasAnimatedNode(value) {\n if (!value || (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) !== \"object\") return false;\n if (typeof value.__getValue === \"function\") return true;\n if (Array.isArray(value)) return value.some(hasAnimatedNode);\n return Object.values(value).some(hasAnimatedNode);\n}\nvar useAnimatedNumbersStyle = function(vals, getStyle) {\n return getStyle(...vals.map(function(v) {\n return v.getInstance();\n }));\n};\nfunction createAnimations(animations, options) {\n var _options_useNativeDriver;\n var nativeDriver = (_options_useNativeDriver = options === null || options === void 0 ? void 0 : options.useNativeDriver) !== null && _options_useNativeDriver !== void 0 ? _options_useNativeDriver : isFabric;\n return {\n isReactNative: true,\n inputStyle: \"value\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence: import_use_presence.usePresence,\n ResetPresence: import_use_presence.ResetPresence,\n useAnimations: function(param) {\n var { props, onTransition, style, componentState, presence, stateRef, useStyleEmitter } = param;\n var _themeState_name;\n var isDisabled = import_constants.isWeb && componentState.unmounted === true;\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 onTransitionRef = import_react.default.useRef(onTransition);\n onTransitionRef.current = onTransition;\n var emit = function(phase, cause, finished) {\n var _onTransitionRef_current;\n (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === \"end\" ? {\n phase,\n cause,\n finished\n } : {\n phase,\n cause\n });\n };\n var [, themeState] = (0, import_web.useThemeWithState)({});\n var isDark = (themeState === null || themeState === void 0 ? void 0 : themeState.scheme) === \"dark\" || (themeState === null || themeState === void 0 ? void 0 : (_themeState_name = themeState.name) === null || _themeState_name === void 0 ? void 0 : _themeState_name.startsWith(\"dark\"));\n var animateStyles = import_react.default.useRef({});\n var animatedTranforms = import_react.default.useRef([]);\n var animationsState = import_react.default.useRef(/* @__PURE__ */ new WeakMap());\n var pseudoActiveRef = import_react.default.useRef(false);\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 enterStartedRef = import_react.default.useRef(false);\n var exitStartedRef = import_react.default.useRef(false);\n var updateInFlightRef = import_react.default.useRef(false);\n var updateCycleIdRef = import_react.default.useRef(0);\n var prevStyleSigRef = import_react.default.useRef(null);\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 }\n var animateOnly = props.animateOnly || [];\n var hasTransitionOnly = !!props.animateOnly;\n var isEntering = !!componentState.unmounted;\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 args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly\n ];\n var res = import_react.default.useMemo(function() {\n var runners = [];\n var completions = [];\n var animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n var nonAnimatedStyle = {};\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(style, isDark, hasTransitionOnly ? animateOnly : void 0);\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var sawTransform = false;\n var transformCount = 0;\n for (var key in style) {\n var rawVal = style[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (isDisabled) {\n continue;\n }\n if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key] && !layoutStyleKey[key]) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (layoutStyleKey[key] && typeof val !== \"number\") {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (key !== \"transform\") {\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n continue;\n }\n if (!val) continue;\n if (typeof val === \"string\") {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`);\n continue;\n }\n sawTransform = true;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n animatedTranforms.current = [\n ...animatedTranforms.current\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 }\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (var k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k];\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = [];\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n }\n }\n var animatedTransformStyle = animatedTranforms.current.length > 0 ? {\n transform: animatedTranforms.current.map(function(r) {\n var _animationsState_current_get;\n var key2 = Object.keys(r)[0];\n var val2 = ((_animationsState_current_get = animationsState.current.get(r[key2])) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || r[key2];\n return {\n [key2]: val2\n };\n })\n } : {};\n var animatedStyle = {\n ...Object.fromEntries(Object.entries(animateStyles.current).map(function(param2) {\n var [k2, v] = param2;\n var _animationsState_current_get;\n return [\n k2,\n ((_animationsState_current_get = animationsState.current.get(v)) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || v\n ];\n })),\n ...animatedTransformStyle\n };\n return {\n runners,\n completions,\n style: [\n nonAnimatedStyle,\n animatedStyle\n ]\n };\n function update(key2, animated, valIn) {\n var isColorStyleKey = colorStyleKey[key2];\n var [val2, type] = isColorStyleKey ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = val2;\n var value = animated || new import_react_native.Animated.Value(val2);\n var curInterpolation = animationsState.current.get(value);\n var interpolateArgs;\n if (type) {\n var _curInterpolation_current;\n interpolateArgs = getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], val2, type);\n animationsState.current.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val2\n });\n }\n if (isColorStyleKey) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n interpolateArgs = getColorInterpolated(\n curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current,\n // valIn is the next color\n valIn,\n animateToValue\n );\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n if (value) {\n var animationConfig = getAnimationConfig(key2, animations, props.transition, animationState);\n var resolve;\n var promise = new Promise(function(res2) {\n resolve = res2;\n });\n completions.push(promise);\n runners.push(function() {\n value.stopAnimation();\n function getAnimation() {\n return import_react_native.Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n }\n var animation = animationConfig.delay ? import_react_native.Animated.sequence([\n import_react_native.Animated.delay(animationConfig.delay),\n getAnimation()\n ]) : getAnimation();\n animation.start(function(param2) {\n var { finished } = param2;\n if (finished || isExiting) {\n resolve();\n }\n });\n });\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(\" \\u{1F4A0} animate\", key2, `from (${value[\"_value\"]}) to`, valIn, `(${val2})`, \"type\", type, \"interpolate\", interpolateArgs);\n }\n }\n return value;\n }\n }, args);\n import_react.default.useEffect(function() {\n wasExitingRef.current = isExiting;\n });\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", false);\n }\n }, [\n justStoppedExiting\n ]);\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n res.runners.forEach(function(r) {\n return r();\n });\n var cycleId = exitCycleIdRef.current;\n var cause = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"update\";\n if (cause === \"exit\") {\n if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", false);\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false;\n updateCycleIdRef.current++;\n emit(\"end\", \"update\", false);\n }\n }\n if (cause === \"update\") {\n var sig = args[0];\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig;\n return;\n }\n prevStyleSigRef.current = sig;\n if (res.completions.length === 0) return;\n if (updateInFlightRef.current) {\n emit(\"end\", \"update\", false);\n }\n updateInFlightRef.current = true;\n var uid = ++updateCycleIdRef.current;\n emit(\"start\", \"update\");\n Promise.all(res.completions).then(function() {\n if (uid !== updateCycleIdRef.current) return;\n updateInFlightRef.current = false;\n emit(\"end\", \"update\", true);\n });\n return;\n }\n prevStyleSigRef.current = args[0];\n if (res.completions.length === 0) {\n emit(\"start\", cause);\n emit(\"end\", cause, true);\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n }\n return;\n }\n if (cause === \"enter\" && !enterStartedRef.current) {\n enterStartedRef.current = true;\n emit(\"start\", \"enter\");\n }\n if (cause === \"exit\" && !exitStartedRef.current) {\n exitStartedRef.current = true;\n emit(\"start\", \"exit\");\n }\n Promise.all(res.completions).then(function() {\n if (isExiting && cycleId !== exitCycleIdRef.current) return;\n if (isExiting && exitCompletedRef.current) return;\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", true);\n }\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", true);\n }\n });\n }, args);\n useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, _effectiveTransition, pseudoActive) {\n pseudoActiveRef.current = pseudoActive === true;\n var runners = [];\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var transformCount = 0;\n var animatedShapeChanged = false;\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(nextStyle, isDark) && !Object.keys(animateStyles.current).some(function(key2) {\n return layoutStyleKey[key2];\n });\n for (var key in nextStyle) {\n var rawVal = nextStyle[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (key === \"transform\" && Array.isArray(val)) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n if (!currentTransform) animatedShapeChanged = true;\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\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 } else if (animatedStyleKey[key] != null || costlyToAnimateStyleKey[key] || layoutStyleKey[key]) {\n if (layoutStyleKey[key] && typeof val !== \"number\") continue;\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue;\n if (!animateStyles.current[key]) animatedShapeChanged = true;\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n }\n }\n for (var key1 in animateStyles.current) {\n if (!seenAnimateKeys.has(key1)) {\n delete animateStyles.current[key1];\n animatedShapeChanged = true;\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n animatedShapeChanged = true;\n }\n runners.forEach(function(r) {\n return r();\n });\n if (animatedShapeChanged && stateRef.current.nextState) {\n var _stateRef_current_baseSetStateShallow, _stateRef_current;\n (_stateRef_current_baseSetStateShallow = (_stateRef_current = stateRef.current).baseSetStateShallow) === null || _stateRef_current_baseSetStateShallow === void 0 ? void 0 : _stateRef_current_baseSetStateShallow.call(_stateRef_current, stateRef.current.nextState);\n }\n function update(key2, animated, valIn) {\n var isColor = colorStyleKey[key2];\n var [numVal, type] = isColor ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = numVal;\n var value = animated || new import_react_native.Animated.Value(numVal);\n var curInterpolation = animationsState.current.get(value);\n if (type) {\n var _curInterpolation_current;\n animationsState.current.set(value, {\n interpolation: value.interpolate(getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], numVal, type)),\n current: numVal\n });\n }\n if (isColor) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(getColorInterpolated(curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current, valIn, animateToValue)),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n var animationConfig = getAnimationConfig(key2, animations, props.transition, \"default\");\n runners.push(function() {\n value.stopAnimation();\n var anim = import_react_native.Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n (animationConfig.delay ? import_react_native.Animated.sequence([\n import_react_native.Animated.delay(animationConfig.delay),\n anim\n ]) : anim).start();\n });\n return value;\n }\n });\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(`Animated`, {\n response: res,\n inputStyle: style,\n isExiting\n });\n }\n }\n return res;\n }\n };\n}\nfunction getColorInterpolated(currentColor, nextColor, animateToValue) {\n var inputRange = [\n 0,\n 1\n ];\n var outputRange = [\n currentColor ? currentColor : nextColor,\n nextColor\n ];\n if (animateToValue === 0) {\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getInterpolated(current, next) {\n var postfix = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : \"deg\";\n if (next === current) {\n current = next - 1e-9;\n }\n var inputRange = [\n current,\n next\n ];\n var outputRange = [\n `${current}${postfix}`,\n `${next}${postfix}`\n ];\n if (next < current) {\n inputRange.reverse();\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getAnimationConfig(key, animations, transition) {\n var animationState = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"default\";\n var normalized = (0, import_animation_helpers.normalizeTransition)(transition);\n var shortKey = transformShorthands[key];\n var _normalized_properties_key;\n var propAnimation = (_normalized_properties_key = normalized.properties[key]) !== null && _normalized_properties_key !== void 0 ? _normalized_properties_key : normalized.properties[shortKey];\n var animationType = null;\n var extraConf = {};\n if (typeof propAnimation === \"string\") {\n animationType = propAnimation;\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\") {\n animationType = propAnimation.type || (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);\n extraConf = propAnimation;\n } else {\n animationType = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);\n }\n if (normalized.delay && !extraConf.delay) {\n extraConf = {\n ...extraConf,\n delay: normalized.delay\n };\n }\n var found = animationType ? animations[animationType] : {};\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf\n };\n}\nvar transformShorthands = {\n x: \"translateX\",\n y: \"translateY\",\n translateX: \"x\",\n translateY: \"y\"\n};\nfunction getValue(input) {\n var isColor = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n if (typeof input !== \"string\") {\n return [\n input\n ];\n }\n var _input_match;\n var [_, number, after] = (_input_match = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/)) !== null && _input_match !== void 0 ? _input_match : [];\n return [\n +number,\n after\n ];\n}\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,g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,KAAK;CACtF,IAAI,cAAc,GAAG,yBAAyB,qBAAqB,UAAU;CAC7E,IAAI,WAAW,oBAAoB;CACnC,IAAI;CACJ,IAAI,iBAAiB,6BAA6B,WAAW,WAAW,UAAU,QAAQ,+BAA+B,KAAK,IAAI,6BAA6B,WAAW,WAAW;CACrL,IAAI,gBAAgB;CACpB,IAAI,YAAY,CAAC;CACjB,IAAI,OAAO,kBAAkB,UAAU;EACrC,gBAAgB;CAClB,OAAO,IAAI,kBAAkB,OAAO,kBAAkB,cAAc,cAAc,SAAS,aAAa,OAAO,UAAU;EACvH,gBAAgB,cAAc,SAAS,GAAG,yBAAyB,uBAAuB,YAAY,cAAc;EACpH,YAAY;CACd,OAAO;EACL,iBAAiB,GAAG,yBAAyB,uBAAuB,YAAY,cAAc;CAChG;CACA,IAAI,WAAW,SAAS,CAAC,UAAU,OAAO;EACxC,YAAY;GACV,GAAG;GACH,OAAO,WAAW;EACpB;CACF;CACA,IAAI,QAAQ,gBAAgB,WAAW,iBAAiB,CAAC;CACzD,OAAO;EACL,GAAG;EAEH,GAAG,WAAW;EAEd,GAAG;CACL;AACF;AACA,IAAI,sBAAsB;CACxB,GAAG;CACH,GAAG;CACH,YAAY;CACZ,YAAY;AACd;AACA,SAAS,SAAS,OAAO;CACvB,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,IAAI,OAAO,UAAU,UAAU;EAC7B,OAAO,CACL,KACF;CACF;CACA,IAAI;CACJ,IAAI,CAAC,GAAG,QAAQ,UAAU,eAAe,MAAM,MAAM,oCAAoC,OAAO,QAAQ,iBAAiB,KAAK,IAAI,eAAe,CAAC;CAClJ,OAAO,CACL,CAAC,QACD,KACF;AACF"}
|
|
1
|
+
{"version":3,"file":"createAnimations.native.js","names":[],"sources":["cjs/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 AnimatedText: () => AnimatedText,\n AnimatedView: () => AnimatedView,\n createAnimations: () => createAnimations,\n useAnimatedNumber: () => useAnimatedNumber,\n useAnimatedNumberReaction: () => useAnimatedNumberReaction,\n useAnimatedNumberStyle: () => useAnimatedNumberStyle,\n useAnimatedNumbersStyle: () => useAnimatedNumbersStyle\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);\nvar import_react_native = require(\"react-native\");\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar isFabric = !import_constants.isWeb && typeof global !== \"undefined\" && !!global.__nativeFabricUIManager;\nvar resolveDynamicValue = function(value, isDark) {\n if (value && (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) === \"object\" && \"dynamic\" in value) {\n var dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;\n return dynamicValue;\n }\n return value;\n};\nvar animatedStyleKey = {\n transform: true,\n opacity: true\n};\nvar colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true\n};\nvar layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true\n};\nfunction hasAnimatedLayoutKey(style, isDark, animateOnly) {\n for (var key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue;\n if (typeof resolveDynamicValue(style[key], isDark) === \"number\") return true;\n }\n return false;\n}\nfunction isAnimatableColor(value) {\n return typeof value === \"string\" && (0, import_react_native.processColor)(value) != null;\n}\nvar costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey\n};\nvar AnimatedView = import_react_native.Animated.View;\nvar AnimatedText = import_react_native.Animated.Text;\nfunction useAnimatedNumber(initial) {\n var state = import_react.default.useRef(null);\n if (!state.current) {\n state.current = {\n composite: null,\n val: new import_react_native.Animated.Value(initial),\n strategy: {\n type: \"spring\"\n }\n };\n }\n return {\n getInstance() {\n return state.current.val;\n },\n getValue() {\n return state.current.val[\"_value\"];\n },\n stop() {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n state.current.composite = null;\n },\n setValue(next) {\n var { type, ...config } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {\n type: \"spring\"\n }, onFinish = arguments.length > 2 ? arguments[2] : void 0;\n var val = state.current.val;\n var handleFinish = onFinish ? function(param) {\n var { finished } = param;\n return finished ? onFinish() : null;\n } : void 0;\n if (type === \"direct\") {\n val.setValue(next);\n } else if (type === \"spring\") {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n var composite = import_react_native.Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n } else {\n var _state_current_composite1;\n (_state_current_composite1 = state.current.composite) === null || _state_current_composite1 === void 0 ? void 0 : _state_current_composite1.stop();\n var composite1 = import_react_native.Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite1.start(handleFinish);\n state.current.composite = composite1;\n }\n }\n };\n}\nvar useAnimatedNumberReaction = function(param, onValue) {\n var { value } = param;\n var onChange = (0, import_web.useEvent)(function(current) {\n onValue(current.value);\n });\n import_react.default.useEffect(function() {\n var id = value.getInstance().addListener(onChange);\n return function() {\n value.getInstance().removeListener(id);\n };\n }, [\n value,\n onChange\n ]);\n};\nvar useAnimatedNumberStyle = function(value, getStyle) {\n var instance = value.getInstance();\n var animatedStyle = getStyle(instance);\n var usesAnimatedNode = hasAnimatedNode(animatedStyle);\n var [current, setCurrent] = import_react.default.useState(value.getValue());\n import_react.default.useEffect(function() {\n if (usesAnimatedNode) return;\n var id = instance.addListener(function(param) {\n var { value: next } = param;\n setCurrent(next);\n });\n return function() {\n instance.removeListener(id);\n };\n }, [\n instance,\n usesAnimatedNode\n ]);\n return usesAnimatedNode ? animatedStyle : getStyle(current);\n};\nfunction hasAnimatedNode(value) {\n if (!value || (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) !== \"object\") return false;\n if (typeof value.__getValue === \"function\") return true;\n if (Array.isArray(value)) return value.some(hasAnimatedNode);\n return Object.values(value).some(hasAnimatedNode);\n}\nvar useAnimatedNumbersStyle = function(vals, getStyle) {\n return getStyle(...vals.map(function(v) {\n return v.getInstance();\n }));\n};\nfunction createAnimations(animations, options) {\n var _options_useNativeDriver;\n var nativeDriver = (_options_useNativeDriver = options === null || options === void 0 ? void 0 : options.useNativeDriver) !== null && _options_useNativeDriver !== void 0 ? _options_useNativeDriver : isFabric;\n return {\n isReactNative: true,\n inputStyle: \"value\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence: import_use_presence.usePresence,\n ResetPresence: import_use_presence.ResetPresence,\n useAnimations: function(param) {\n var { props, onTransition, style, componentState, presence, stateRef, useStyleEmitter } = param;\n var _themeState_name;\n var isDisabled = import_constants.isWeb && componentState.unmounted === true;\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 onTransitionRef = import_react.default.useRef(onTransition);\n onTransitionRef.current = onTransition;\n var emit = function(phase, cause, finished) {\n var _onTransitionRef_current;\n (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === \"end\" ? {\n phase,\n cause,\n finished\n } : {\n phase,\n cause\n });\n };\n var [, themeState] = (0, import_web.useThemeWithState)({});\n var isDark = (themeState === null || themeState === void 0 ? void 0 : themeState.scheme) === \"dark\" || (themeState === null || themeState === void 0 ? void 0 : (_themeState_name = themeState.name) === null || _themeState_name === void 0 ? void 0 : _themeState_name.startsWith(\"dark\"));\n var animateStyles = import_react.default.useRef({});\n var animatedTranforms = import_react.default.useRef([]);\n var animationsState = import_react.default.useRef(/* @__PURE__ */ new WeakMap());\n var pseudoActiveRef = import_react.default.useRef(false);\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 enterStartedRef = import_react.default.useRef(false);\n var exitStartedRef = import_react.default.useRef(false);\n var updateInFlightRef = import_react.default.useRef(false);\n var updateCycleIdRef = import_react.default.useRef(0);\n var prevStyleSigRef = import_react.default.useRef(null);\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 }\n var animateOnly = props.animateOnly || [];\n var hasTransitionOnly = !!props.animateOnly;\n var isEntering = !!componentState.unmounted;\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 args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly\n ];\n var res = import_react.default.useMemo(function() {\n var runners = [];\n var completions = [];\n var animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n var nonAnimatedStyle = {};\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(style, isDark, hasTransitionOnly ? animateOnly : void 0);\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var sawTransform = false;\n var transformCount = 0;\n for (var key in style) {\n var rawVal = style[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (isDisabled) {\n continue;\n }\n if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key] && !layoutStyleKey[key]) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (layoutStyleKey[key] && typeof val !== \"number\") {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (key !== \"transform\") {\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n continue;\n }\n if (!val) continue;\n if (typeof val === \"string\") {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`);\n continue;\n }\n sawTransform = true;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n animatedTranforms.current = [\n ...animatedTranforms.current\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 }\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (var k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k];\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = [];\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n }\n }\n var animatedTransformStyle = animatedTranforms.current.length > 0 ? {\n transform: animatedTranforms.current.map(function(r) {\n var _animationsState_current_get;\n var key2 = Object.keys(r)[0];\n var val2 = ((_animationsState_current_get = animationsState.current.get(r[key2])) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || r[key2];\n return {\n [key2]: val2\n };\n })\n } : {};\n var animatedStyle = {\n ...Object.fromEntries(Object.entries(animateStyles.current).map(function(param2) {\n var [k2, v] = param2;\n var _animationsState_current_get;\n return [\n k2,\n ((_animationsState_current_get = animationsState.current.get(v)) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || v\n ];\n })),\n ...animatedTransformStyle\n };\n return {\n runners,\n completions,\n style: [\n nonAnimatedStyle,\n animatedStyle\n ]\n };\n function update(key2, animated, valIn) {\n var isColorStyleKey = colorStyleKey[key2];\n var [val2, type] = isColorStyleKey ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = val2;\n var value = animated || new import_react_native.Animated.Value(val2);\n var curInterpolation = animationsState.current.get(value);\n var interpolateArgs;\n if (type) {\n var _curInterpolation_current;\n interpolateArgs = getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], val2, type);\n animationsState.current.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val2\n });\n }\n if (isColorStyleKey) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n interpolateArgs = getColorInterpolated(\n curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current,\n // valIn is the next color\n valIn,\n animateToValue\n );\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n if (value) {\n var animationConfig = getAnimationConfig(key2, animations, props.transition, animationState);\n var resolve;\n var promise = new Promise(function(res2) {\n resolve = res2;\n });\n completions.push(promise);\n runners.push(function() {\n value.stopAnimation();\n function getAnimation() {\n return import_react_native.Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n }\n var animation = animationConfig.delay ? import_react_native.Animated.sequence([\n import_react_native.Animated.delay(animationConfig.delay),\n getAnimation()\n ]) : getAnimation();\n animation.start(function(param2) {\n var { finished } = param2;\n if (finished || isExiting) {\n resolve();\n }\n });\n });\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(\" \\u{1F4A0} animate\", key2, `from (${value[\"_value\"]}) to`, valIn, `(${val2})`, \"type\", type, \"interpolate\", interpolateArgs);\n }\n }\n return value;\n }\n }, args);\n import_react.default.useEffect(function() {\n wasExitingRef.current = isExiting;\n });\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", false);\n }\n }, [\n justStoppedExiting\n ]);\n (0, import_constants.useIsomorphicLayoutEffect)(function() {\n res.runners.forEach(function(r) {\n return r();\n });\n var cycleId = exitCycleIdRef.current;\n var cause = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"update\";\n if (cause === \"exit\") {\n if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", false);\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false;\n updateCycleIdRef.current++;\n emit(\"end\", \"update\", false);\n }\n }\n if (cause === \"update\") {\n var sig = args[0];\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig;\n return;\n }\n prevStyleSigRef.current = sig;\n if (res.completions.length === 0) return;\n if (updateInFlightRef.current) {\n emit(\"end\", \"update\", false);\n }\n updateInFlightRef.current = true;\n var uid = ++updateCycleIdRef.current;\n emit(\"start\", \"update\");\n Promise.all(res.completions).then(function() {\n if (uid !== updateCycleIdRef.current) return;\n updateInFlightRef.current = false;\n emit(\"end\", \"update\", true);\n });\n return;\n }\n prevStyleSigRef.current = args[0];\n if (res.completions.length === 0) {\n emit(\"start\", cause);\n emit(\"end\", cause, true);\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n }\n return;\n }\n if (cause === \"enter\" && !enterStartedRef.current) {\n enterStartedRef.current = true;\n emit(\"start\", \"enter\");\n }\n if (cause === \"exit\" && !exitStartedRef.current) {\n exitStartedRef.current = true;\n emit(\"start\", \"exit\");\n }\n Promise.all(res.completions).then(function() {\n if (isExiting && cycleId !== exitCycleIdRef.current) return;\n if (isExiting && exitCompletedRef.current) return;\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", true);\n }\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", true);\n }\n });\n }, args);\n useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, _effectiveTransition, pseudoActive) {\n pseudoActiveRef.current = pseudoActive === true;\n var runners = [];\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var transformCount = 0;\n var animatedShapeChanged = false;\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(nextStyle, isDark) && !Object.keys(animateStyles.current).some(function(key2) {\n return layoutStyleKey[key2];\n });\n for (var key in nextStyle) {\n var rawVal = nextStyle[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (key === \"transform\" && Array.isArray(val)) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n if (!currentTransform) animatedShapeChanged = true;\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\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 } else if (animatedStyleKey[key] != null || costlyToAnimateStyleKey[key] || layoutStyleKey[key]) {\n if (layoutStyleKey[key] && typeof val !== \"number\") continue;\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue;\n if (!animateStyles.current[key]) animatedShapeChanged = true;\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n }\n }\n for (var key1 in animateStyles.current) {\n if (!seenAnimateKeys.has(key1)) {\n delete animateStyles.current[key1];\n animatedShapeChanged = true;\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n animatedShapeChanged = true;\n }\n runners.forEach(function(r) {\n return r();\n });\n if (animatedShapeChanged && stateRef.current.nextState) {\n var _stateRef_current_baseSetStateShallow, _stateRef_current;\n (_stateRef_current_baseSetStateShallow = (_stateRef_current = stateRef.current).baseSetStateShallow) === null || _stateRef_current_baseSetStateShallow === void 0 ? void 0 : _stateRef_current_baseSetStateShallow.call(_stateRef_current, stateRef.current.nextState);\n }\n function update(key2, animated, valIn) {\n var isColor = colorStyleKey[key2];\n var [numVal, type] = isColor ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = numVal;\n var value = animated || new import_react_native.Animated.Value(numVal);\n var curInterpolation = animationsState.current.get(value);\n if (type) {\n var _curInterpolation_current;\n animationsState.current.set(value, {\n interpolation: value.interpolate(getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], numVal, type)),\n current: numVal\n });\n }\n if (isColor) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(getColorInterpolated(curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current, valIn, animateToValue)),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n var animationConfig = getAnimationConfig(key2, animations, props.transition, \"default\");\n runners.push(function() {\n value.stopAnimation();\n var anim = import_react_native.Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n (animationConfig.delay ? import_react_native.Animated.sequence([\n import_react_native.Animated.delay(animationConfig.delay),\n anim\n ]) : anim).start();\n });\n return value;\n }\n });\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(`Animated`, {\n response: res,\n inputStyle: style,\n isExiting\n });\n }\n }\n return res;\n }\n };\n}\nfunction getColorInterpolated(currentColor, nextColor, animateToValue) {\n var inputRange = [\n 0,\n 1\n ];\n var outputRange = [\n currentColor ? currentColor : nextColor,\n nextColor\n ];\n if (animateToValue === 0) {\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getInterpolated(current, next) {\n var postfix = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : \"deg\";\n if (next === current) {\n current = next - 1e-9;\n }\n var inputRange = [\n current,\n next\n ];\n var outputRange = [\n `${current}${postfix}`,\n `${next}${postfix}`\n ];\n if (next < current) {\n inputRange.reverse();\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getAnimationConfig(key, animations, transition) {\n var animationState = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"default\";\n var normalized = (0, import_animation_helpers.normalizeTransition)(transition);\n var shortKey = transformShorthands[key];\n var _normalized_properties_key;\n var propAnimation = (_normalized_properties_key = normalized.properties[key]) !== null && _normalized_properties_key !== void 0 ? _normalized_properties_key : normalized.properties[shortKey];\n var animationType = null;\n var extraConf = {};\n if (typeof propAnimation === \"string\") {\n animationType = propAnimation;\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\") {\n animationType = propAnimation.type || (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);\n extraConf = propAnimation;\n } else {\n animationType = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);\n }\n if (normalized.delay && !extraConf.delay) {\n extraConf = {\n ...extraConf,\n delay: normalized.delay\n };\n }\n var found = animationType ? animations[animationType] : {};\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf\n };\n}\nvar transformShorthands = {\n x: \"translateX\",\n y: \"translateY\",\n translateX: \"x\",\n translateY: \"y\"\n};\nfunction getValue(input) {\n var isColor = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n if (typeof input !== \"string\") {\n return [\n input\n ];\n }\n var _input_match;\n var [_, number, after] = (_input_match = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/)) !== null && _input_match !== void 0 ? _input_match : [];\n return [\n +number,\n after\n ];\n}\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,k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GAAG;EAEH,GAAG,WAAW;EAEd,GAAG;CACL;AACF;AACA,IAAI,sBAAsB;CACxB,GAAG;CACH,GAAG;CACH,YAAY;CACZ,YAAY;AACd;AACA,SAAS,SAAS,OAAO;CACvB,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,IAAI,OAAO,UAAU,UAAU;EAC7B,OAAO,CACL,KACF;CACF;CACA,IAAI;CACJ,IAAI,CAAC,GAAG,QAAQ,UAAU,eAAe,MAAM,MAAM,oCAAoC,OAAO,QAAQ,iBAAiB,KAAK,IAAI,eAAe,CAAC;CAClJ,OAAO,CACL,CAAC,QACD,KACF;AACF"}
|
package/dist/cjs/index.cjs
CHANGED
package/dist/cjs/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/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);\nvar import_polyfill = require(\"./polyfill\");\n__reExport(index_exports, require(\"./createAnimations\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/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);\nvar import_polyfill = require(\"./polyfill\");\n__reExport(index_exports, require(\"./createAnimations\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,kBAAkB,QAAQ,sBAAY;AAC1C,WAAW,eAAe,QAAQ,8BAAoB,GAAG,OAAO,OAAO"}
|
package/dist/cjs/polyfill.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyfill.native.js","names":[],"sources":["cjs/polyfill.native.js"],"sourcesContent":["\"use strict\";\nif (typeof requestAnimationFrame === \"undefined\") {\n globalThis[\"requestAnimationFrame\"] = typeof setImmediate === \"undefined\" ? setTimeout : setImmediate;\n}\n//# sourceMappingURL=polyfill.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"polyfill.native.js","names":[],"sources":["cjs/polyfill.native.js"],"sourcesContent":["\"use strict\";\nif (typeof requestAnimationFrame === \"undefined\") {\n globalThis[\"requestAnimationFrame\"] = typeof setImmediate === \"undefined\" ? setTimeout : setImmediate;\n}\n//# sourceMappingURL=polyfill.js.map\n"],"mappings":";;;AACA,IAAI,OAAO,0BAA0B,aAAa;CAChD,WAAW,2BAA2B,OAAO,iBAAiB,cAAc,aAAa;AAC3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnimations.js","names":[],"sources":["esm/createAnimations.js"],"sourcesContent":["import { getEffectiveAnimation, normalizeTransition } from \"@tamagui/animation-helpers\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ResetPresence, usePresence } from \"@tamagui/use-presence\";\nimport { useEvent, useThemeWithState } from \"@tamagui/web\";\nimport React from \"react\";\nimport {\n Animated,\n processColor\n} from \"react-native-web\";\nconst isFabric = !isWeb && typeof global !== \"undefined\" && !!global.__nativeFabricUIManager;\nconst resolveDynamicValue = (value, isDark) => {\n if (value && typeof value === \"object\" && \"dynamic\" in value) {\n const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;\n return dynamicValue;\n }\n return value;\n};\nconst animatedStyleKey = {\n transform: true,\n opacity: true\n};\nconst colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true\n};\nconst layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true\n};\nfunction hasAnimatedLayoutKey(style, isDark, animateOnly) {\n for (const key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue;\n if (typeof resolveDynamicValue(style[key], isDark) === \"number\") return true;\n }\n return false;\n}\nfunction isAnimatableColor(value) {\n return typeof value === \"string\" && processColor(value) != null;\n}\nconst costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey\n};\nconst AnimatedView = Animated.View;\nconst AnimatedText = Animated.Text;\nfunction useAnimatedNumber(initial) {\n const state = React.useRef(\n null\n );\n if (!state.current) {\n state.current = {\n composite: null,\n val: new Animated.Value(initial),\n strategy: { type: \"spring\" }\n };\n }\n return {\n getInstance() {\n return state.current.val;\n },\n getValue() {\n return state.current.val[\"_value\"];\n },\n stop() {\n state.current.composite?.stop();\n state.current.composite = null;\n },\n setValue(next, { type, ...config } = { type: \"spring\" }, onFinish) {\n const val = state.current.val;\n const handleFinish = onFinish ? ({ finished }) => finished ? onFinish() : null : void 0;\n if (type === \"direct\") {\n val.setValue(next);\n } else if (type === \"spring\") {\n state.current.composite?.stop();\n const composite = Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n } else {\n state.current.composite?.stop();\n const composite = Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n }\n }\n };\n}\nconst useAnimatedNumberReaction = ({ value }, onValue) => {\n const onChange = useEvent((current) => {\n onValue(current.value);\n });\n React.useEffect(() => {\n const id = value.getInstance().addListener(onChange);\n return () => {\n value.getInstance().removeListener(id);\n };\n }, [value, onChange]);\n};\nconst useAnimatedNumberStyle = (value, getStyle) => {\n const instance = value.getInstance();\n const animatedStyle = getStyle(instance);\n const usesAnimatedNode = hasAnimatedNode(animatedStyle);\n const [current, setCurrent] = React.useState(value.getValue());\n React.useEffect(() => {\n if (usesAnimatedNode) return;\n const id = instance.addListener(({ value: next }) => {\n setCurrent(next);\n });\n return () => {\n instance.removeListener(id);\n };\n }, [instance, usesAnimatedNode]);\n return usesAnimatedNode ? animatedStyle : getStyle(current);\n};\nfunction hasAnimatedNode(value) {\n if (!value || typeof value !== \"object\") return false;\n if (typeof value.__getValue === \"function\") return true;\n if (Array.isArray(value)) return value.some(hasAnimatedNode);\n return Object.values(value).some(hasAnimatedNode);\n}\nconst useAnimatedNumbersStyle = (vals, getStyle) => {\n return getStyle(...vals.map((v) => v.getInstance()));\n};\nfunction createAnimations(animations, options) {\n const nativeDriver = options?.useNativeDriver ?? isFabric;\n return {\n isReactNative: true,\n inputStyle: \"value\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence,\n ResetPresence,\n useAnimations: ({\n props,\n onTransition,\n style,\n componentState,\n presence,\n stateRef,\n useStyleEmitter\n }) => {\n const isDisabled = isWeb && componentState.unmounted === true;\n const isExiting = presence?.[0] === false;\n const sendExitComplete = presence?.[1];\n const onTransitionRef = React.useRef(onTransition);\n onTransitionRef.current = onTransition;\n const emit = (phase, cause, finished) => {\n onTransitionRef.current?.(\n phase === \"end\" ? { phase, cause, finished } : { phase, cause }\n );\n };\n const [, themeState] = useThemeWithState({});\n const isDark = themeState?.scheme === \"dark\" || themeState?.name?.startsWith(\"dark\");\n const animateStyles = React.useRef({});\n const animatedTranforms = React.useRef([]);\n const animationsState = React.useRef(\n /* @__PURE__ */ new WeakMap()\n );\n const pseudoActiveRef = React.useRef(false);\n const exitCycleIdRef = React.useRef(0);\n const exitCompletedRef = React.useRef(false);\n const wasExitingRef = React.useRef(false);\n const enterStartedRef = React.useRef(false);\n const exitStartedRef = React.useRef(false);\n const updateInFlightRef = React.useRef(false);\n const updateCycleIdRef = React.useRef(0);\n const prevStyleSigRef = React.useRef(null);\n const justStartedExiting = isExiting && !wasExitingRef.current;\n const justStoppedExiting = !isExiting && wasExitingRef.current;\n if (justStartedExiting) {\n exitCycleIdRef.current++;\n exitCompletedRef.current = false;\n }\n if (justStoppedExiting) {\n exitCycleIdRef.current++;\n }\n const animateOnly = props.animateOnly || [];\n const hasTransitionOnly = !!props.animateOnly;\n const isEntering = !!componentState.unmounted;\n const wasEnteringRef = React.useRef(isEntering);\n const justFinishedEntering = wasEnteringRef.current && !isEntering;\n React.useEffect(() => {\n wasEnteringRef.current = isEntering;\n });\n const args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly\n ];\n const res = React.useMemo(() => {\n const runners = [];\n const completions = [];\n const animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n const nonAnimatedStyle = {};\n const useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(\n style,\n isDark,\n hasTransitionOnly ? animateOnly : void 0\n );\n const seenAnimateKeys = /* @__PURE__ */ new Set();\n let sawTransform = false;\n let transformCount = 0;\n for (const key in style) {\n const rawVal = style[key];\n const val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (isDisabled) {\n continue;\n }\n if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key] && !layoutStyleKey[key]) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (layoutStyleKey[key] && typeof val !== \"number\") {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (key !== \"transform\") {\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n continue;\n }\n if (!val) continue;\n if (typeof val === \"string\") {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`);\n continue;\n }\n sawTransform = true;\n for (const transform of val) {\n if (!transform) continue;\n const index = transformCount++;\n const tkey = Object.keys(transform)[0];\n const currentTransform = animatedTranforms.current[index]?.[tkey];\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n animatedTranforms.current = [...animatedTranforms.current];\n }\n }\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (const k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k];\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = [];\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n }\n }\n const animatedTransformStyle = animatedTranforms.current.length > 0 ? {\n transform: animatedTranforms.current.map((r) => {\n const key = Object.keys(r)[0];\n const val = animationsState.current.get(r[key])?.interpolation || r[key];\n return { [key]: val };\n })\n } : {};\n const animatedStyle = {\n ...Object.fromEntries(\n Object.entries(animateStyles.current).map(([k, v]) => [\n k,\n animationsState.current.get(v)?.interpolation || v\n ])\n ),\n ...animatedTransformStyle\n };\n return {\n runners,\n completions,\n style: [nonAnimatedStyle, animatedStyle]\n };\n function update(key, animated, valIn) {\n const isColorStyleKey = colorStyleKey[key];\n const [val, type] = isColorStyleKey ? [0, void 0] : getValue(valIn);\n let animateToValue = val;\n const value = animated || new Animated.Value(val);\n const curInterpolation = animationsState.current.get(value);\n let interpolateArgs;\n if (type) {\n interpolateArgs = getInterpolated(\n curInterpolation?.current ?? value[\"_value\"],\n val,\n type\n );\n animationsState.current.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val\n });\n }\n if (isColorStyleKey) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1;\n interpolateArgs = getColorInterpolated(\n curInterpolation?.current,\n // valIn is the next color\n valIn,\n animateToValue\n );\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1\n });\n }\n if (value) {\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n animationState\n );\n let resolve;\n const promise = new Promise((res2) => {\n resolve = res2;\n });\n completions.push(promise);\n runners.push(() => {\n value.stopAnimation();\n function getAnimation() {\n return Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n }\n const animation = animationConfig.delay ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n getAnimation()\n ]) : getAnimation();\n animation.start(({ finished }) => {\n if (finished || isExiting) {\n resolve();\n }\n });\n });\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(\n \" \\u{1F4A0} animate\",\n key,\n `from (${value[\"_value\"]}) to`,\n valIn,\n `(${val})`,\n \"type\",\n type,\n \"interpolate\",\n interpolateArgs\n );\n }\n }\n return value;\n }\n }, args);\n React.useEffect(() => {\n wasExitingRef.current = isExiting;\n });\n useIsomorphicLayoutEffect(() => {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", false);\n }\n }, [justStoppedExiting]);\n useIsomorphicLayoutEffect(() => {\n res.runners.forEach((r) => r());\n const cycleId = exitCycleIdRef.current;\n const cause = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"update\";\n if (cause === \"exit\") {\n if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", false);\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false;\n updateCycleIdRef.current++;\n emit(\"end\", \"update\", false);\n }\n }\n if (cause === \"update\") {\n const sig = args[0];\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig;\n return;\n }\n prevStyleSigRef.current = sig;\n if (res.completions.length === 0) return;\n if (updateInFlightRef.current) {\n emit(\"end\", \"update\", false);\n }\n updateInFlightRef.current = true;\n const uid = ++updateCycleIdRef.current;\n emit(\"start\", \"update\");\n Promise.all(res.completions).then(() => {\n if (uid !== updateCycleIdRef.current) return;\n updateInFlightRef.current = false;\n emit(\"end\", \"update\", true);\n });\n return;\n }\n prevStyleSigRef.current = args[0];\n if (res.completions.length === 0) {\n emit(\"start\", cause);\n emit(\"end\", cause, true);\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true;\n sendExitComplete?.();\n }\n return;\n }\n if (cause === \"enter\" && !enterStartedRef.current) {\n enterStartedRef.current = true;\n emit(\"start\", \"enter\");\n }\n if (cause === \"exit\" && !exitStartedRef.current) {\n exitStartedRef.current = true;\n emit(\"start\", \"exit\");\n }\n Promise.all(res.completions).then(() => {\n if (isExiting && cycleId !== exitCycleIdRef.current) return;\n if (isExiting && exitCompletedRef.current) return;\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", true);\n }\n exitCompletedRef.current = true;\n sendExitComplete?.();\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", true);\n }\n });\n }, args);\n useStyleEmitter?.((nextStyle, _effectiveTransition, pseudoActive) => {\n pseudoActiveRef.current = pseudoActive === true;\n const runners = [];\n const seenAnimateKeys = /* @__PURE__ */ new Set();\n let transformCount = 0;\n let animatedShapeChanged = false;\n const useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(nextStyle, isDark) && !Object.keys(animateStyles.current).some((key) => layoutStyleKey[key]);\n for (const key in nextStyle) {\n const rawVal = nextStyle[key];\n const val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (key === \"transform\" && Array.isArray(val)) {\n for (const transform of val) {\n if (!transform) continue;\n const index = transformCount++;\n const tkey = Object.keys(transform)[0];\n const currentTransform = animatedTranforms.current[index]?.[tkey];\n if (!currentTransform) animatedShapeChanged = true;\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n }\n } else if (animatedStyleKey[key] != null || costlyToAnimateStyleKey[key] || layoutStyleKey[key]) {\n if (layoutStyleKey[key] && typeof val !== \"number\") continue;\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue;\n if (!animateStyles.current[key]) animatedShapeChanged = true;\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n }\n }\n for (const key in animateStyles.current) {\n if (!seenAnimateKeys.has(key)) {\n delete animateStyles.current[key];\n animatedShapeChanged = true;\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n animatedShapeChanged = true;\n }\n runners.forEach((r) => r());\n if (animatedShapeChanged && stateRef.current.nextState) {\n stateRef.current.baseSetStateShallow?.(stateRef.current.nextState);\n }\n function update(key, animated, valIn) {\n const isColor = colorStyleKey[key];\n const [numVal, type] = isColor ? [0, void 0] : getValue(valIn);\n let animateToValue = numVal;\n const value = animated || new Animated.Value(numVal);\n const curInterpolation = animationsState.current.get(value);\n if (type) {\n animationsState.current.set(value, {\n interpolation: value.interpolate(\n getInterpolated(\n curInterpolation?.current ?? value[\"_value\"],\n numVal,\n type\n )\n ),\n current: numVal\n });\n }\n if (isColor) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1;\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(\n getColorInterpolated(\n curInterpolation?.current,\n valIn,\n animateToValue\n )\n ),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1\n });\n }\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n \"default\"\n );\n runners.push(() => {\n value.stopAnimation();\n const anim = Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n (animationConfig.delay ? Animated.sequence([Animated.delay(animationConfig.delay), anim]) : anim).start();\n });\n return value;\n }\n });\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(`Animated`, { response: res, inputStyle: style, isExiting });\n }\n }\n return res;\n }\n };\n}\nfunction getColorInterpolated(currentColor, nextColor, animateToValue) {\n const inputRange = [0, 1];\n const outputRange = [currentColor ? currentColor : nextColor, nextColor];\n if (animateToValue === 0) {\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getInterpolated(current, next, postfix = \"deg\") {\n if (next === current) {\n current = next - 1e-9;\n }\n const inputRange = [current, next];\n const outputRange = [`${current}${postfix}`, `${next}${postfix}`];\n if (next < current) {\n inputRange.reverse();\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getAnimationConfig(key, animations, transition, animationState = \"default\") {\n const normalized = normalizeTransition(transition);\n const shortKey = transformShorthands[key];\n const propAnimation = normalized.properties[key] ?? normalized.properties[shortKey];\n let animationType = null;\n let extraConf = {};\n if (typeof propAnimation === \"string\") {\n animationType = propAnimation;\n } else if (propAnimation && typeof propAnimation === \"object\") {\n animationType = propAnimation.type || getEffectiveAnimation(normalized, animationState);\n extraConf = propAnimation;\n } else {\n animationType = getEffectiveAnimation(normalized, animationState);\n }\n if (normalized.delay && !extraConf.delay) {\n extraConf = { ...extraConf, delay: normalized.delay };\n }\n const found = animationType ? animations[animationType] : {};\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf\n };\n}\nconst transformShorthands = {\n x: \"translateX\",\n y: \"translateY\",\n translateX: \"x\",\n translateY: \"y\"\n};\nfunction getValue(input, isColor = false) {\n if (typeof input !== \"string\") {\n return [input];\n }\n const [_, number, after] = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/) ?? [];\n return [+number, after];\n}\nexport {\n AnimatedText,\n AnimatedView,\n createAnimations,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle\n};\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;;;;;AASA,MAAM,WAAW,CAAC,SAAS,OAAO,WAAW,eAAe,CAAC,CAAC,OAAO;AACrE,MAAM,uBAAuB,OAAO,WAAW;CAC7C,IAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;EAC5D,MAAM,eAAe,SAAS,MAAM,QAAQ,OAAO,MAAM,QAAQ;EACjE,OAAO;CACT;CACA,OAAO;AACT;AACA,MAAM,mBAAmB;CACvB,WAAW;CACX,SAAS;AACX;AACA,MAAM,gBAAgB;CACpB,iBAAiB;CACjB,OAAO;CACP,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;AACrB;AACA,MAAM,iBAAiB;CACrB,QAAQ;CACR,OAAO;CACP,WAAW;CACX,WAAW;CACX,UAAU;CACV,UAAU;AACZ;AACA,SAAS,qBAAqB,OAAO,QAAQ,aAAa;CACxD,KAAK,MAAM,OAAO,gBAAgB;EAChC,IAAI,eAAe,CAAC,YAAY,SAAS,GAAG,GAAG;EAC/C,IAAI,OAAO,oBAAoB,MAAM,MAAM,MAAM,MAAM,UAAU,OAAO;CAC1E;CACA,OAAO;AACT;AACA,SAAS,kBAAkB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,aAAa,KAAK,KAAK;AAC7D;AACA,MAAM,0BAA0B;CAC9B,cAAc;CACd,qBAAqB;CACrB,sBAAsB;CACtB,wBAAwB;CACxB,yBAAyB;CACzB,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,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,QAAQ,WAAW,WAAW;CAC1E,IAAI,gBAAgB;CACpB,IAAI,YAAY,CAAC;CACjB,IAAI,OAAO,kBAAkB,UAAU;EACrC,gBAAgB;CAClB,OAAO,IAAI,iBAAiB,OAAO,kBAAkB,UAAU;EAC7D,gBAAgB,cAAc,QAAQ,sBAAsB,YAAY,cAAc;EACtF,YAAY;CACd,OAAO;EACL,gBAAgB,sBAAsB,YAAY,cAAc;CAClE;CACA,IAAI,WAAW,SAAS,CAAC,UAAU,OAAO;EACxC,YAAY;GAAE,GAAG;GAAW,OAAO,WAAW;EAAM;CACtD;CACA,MAAM,QAAQ,gBAAgB,WAAW,iBAAiB,CAAC;CAC3D,OAAO;EACL,GAAG;EAEH,GAAG,WAAW;EAEd,GAAG;CACL;AACF;AACA,MAAM,sBAAsB;CAC1B,GAAG;CACH,GAAG;CACH,YAAY;CACZ,YAAY;AACd;AACA,SAAS,SAAS,OAAO,UAAU,OAAO;CACxC,IAAI,OAAO,UAAU,UAAU;EAC7B,OAAO,CAAC,KAAK;CACf;CACA,MAAM,CAAC,GAAG,QAAQ,SAAS,MAAM,MAAM,oCAAoC,KAAK,CAAC;CACjF,OAAO,CAAC,CAAC,QAAQ,KAAK;AACxB"}
|
|
1
|
+
{"version":3,"file":"createAnimations.js","names":[],"sources":["esm/createAnimations.js"],"sourcesContent":["import { getEffectiveAnimation, normalizeTransition } from \"@tamagui/animation-helpers\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ResetPresence, usePresence } from \"@tamagui/use-presence\";\nimport { useEvent, useThemeWithState } from \"@tamagui/web\";\nimport React from \"react\";\nimport {\n Animated,\n processColor\n} from \"react-native-web\";\nconst isFabric = !isWeb && typeof global !== \"undefined\" && !!global.__nativeFabricUIManager;\nconst resolveDynamicValue = (value, isDark) => {\n if (value && typeof value === \"object\" && \"dynamic\" in value) {\n const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;\n return dynamicValue;\n }\n return value;\n};\nconst animatedStyleKey = {\n transform: true,\n opacity: true\n};\nconst colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true\n};\nconst layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true\n};\nfunction hasAnimatedLayoutKey(style, isDark, animateOnly) {\n for (const key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue;\n if (typeof resolveDynamicValue(style[key], isDark) === \"number\") return true;\n }\n return false;\n}\nfunction isAnimatableColor(value) {\n return typeof value === \"string\" && processColor(value) != null;\n}\nconst costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey\n};\nconst AnimatedView = Animated.View;\nconst AnimatedText = Animated.Text;\nfunction useAnimatedNumber(initial) {\n const state = React.useRef(\n null\n );\n if (!state.current) {\n state.current = {\n composite: null,\n val: new Animated.Value(initial),\n strategy: { type: \"spring\" }\n };\n }\n return {\n getInstance() {\n return state.current.val;\n },\n getValue() {\n return state.current.val[\"_value\"];\n },\n stop() {\n state.current.composite?.stop();\n state.current.composite = null;\n },\n setValue(next, { type, ...config } = { type: \"spring\" }, onFinish) {\n const val = state.current.val;\n const handleFinish = onFinish ? ({ finished }) => finished ? onFinish() : null : void 0;\n if (type === \"direct\") {\n val.setValue(next);\n } else if (type === \"spring\") {\n state.current.composite?.stop();\n const composite = Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n } else {\n state.current.composite?.stop();\n const composite = Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n }\n }\n };\n}\nconst useAnimatedNumberReaction = ({ value }, onValue) => {\n const onChange = useEvent((current) => {\n onValue(current.value);\n });\n React.useEffect(() => {\n const id = value.getInstance().addListener(onChange);\n return () => {\n value.getInstance().removeListener(id);\n };\n }, [value, onChange]);\n};\nconst useAnimatedNumberStyle = (value, getStyle) => {\n const instance = value.getInstance();\n const animatedStyle = getStyle(instance);\n const usesAnimatedNode = hasAnimatedNode(animatedStyle);\n const [current, setCurrent] = React.useState(value.getValue());\n React.useEffect(() => {\n if (usesAnimatedNode) return;\n const id = instance.addListener(({ value: next }) => {\n setCurrent(next);\n });\n return () => {\n instance.removeListener(id);\n };\n }, [instance, usesAnimatedNode]);\n return usesAnimatedNode ? animatedStyle : getStyle(current);\n};\nfunction hasAnimatedNode(value) {\n if (!value || typeof value !== \"object\") return false;\n if (typeof value.__getValue === \"function\") return true;\n if (Array.isArray(value)) return value.some(hasAnimatedNode);\n return Object.values(value).some(hasAnimatedNode);\n}\nconst useAnimatedNumbersStyle = (vals, getStyle) => {\n return getStyle(...vals.map((v) => v.getInstance()));\n};\nfunction createAnimations(animations, options) {\n const nativeDriver = options?.useNativeDriver ?? isFabric;\n return {\n isReactNative: true,\n inputStyle: \"value\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence,\n ResetPresence,\n useAnimations: ({\n props,\n onTransition,\n style,\n componentState,\n presence,\n stateRef,\n useStyleEmitter\n }) => {\n const isDisabled = isWeb && componentState.unmounted === true;\n const isExiting = presence?.[0] === false;\n const sendExitComplete = presence?.[1];\n const onTransitionRef = React.useRef(onTransition);\n onTransitionRef.current = onTransition;\n const emit = (phase, cause, finished) => {\n onTransitionRef.current?.(\n phase === \"end\" ? { phase, cause, finished } : { phase, cause }\n );\n };\n const [, themeState] = useThemeWithState({});\n const isDark = themeState?.scheme === \"dark\" || themeState?.name?.startsWith(\"dark\");\n const animateStyles = React.useRef({});\n const animatedTranforms = React.useRef([]);\n const animationsState = React.useRef(\n /* @__PURE__ */ new WeakMap()\n );\n const pseudoActiveRef = React.useRef(false);\n const exitCycleIdRef = React.useRef(0);\n const exitCompletedRef = React.useRef(false);\n const wasExitingRef = React.useRef(false);\n const enterStartedRef = React.useRef(false);\n const exitStartedRef = React.useRef(false);\n const updateInFlightRef = React.useRef(false);\n const updateCycleIdRef = React.useRef(0);\n const prevStyleSigRef = React.useRef(null);\n const justStartedExiting = isExiting && !wasExitingRef.current;\n const justStoppedExiting = !isExiting && wasExitingRef.current;\n if (justStartedExiting) {\n exitCycleIdRef.current++;\n exitCompletedRef.current = false;\n }\n if (justStoppedExiting) {\n exitCycleIdRef.current++;\n }\n const animateOnly = props.animateOnly || [];\n const hasTransitionOnly = !!props.animateOnly;\n const isEntering = !!componentState.unmounted;\n const wasEnteringRef = React.useRef(isEntering);\n const justFinishedEntering = wasEnteringRef.current && !isEntering;\n React.useEffect(() => {\n wasEnteringRef.current = isEntering;\n });\n const args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly\n ];\n const res = React.useMemo(() => {\n const runners = [];\n const completions = [];\n const animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n const nonAnimatedStyle = {};\n const useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(\n style,\n isDark,\n hasTransitionOnly ? animateOnly : void 0\n );\n const seenAnimateKeys = /* @__PURE__ */ new Set();\n let sawTransform = false;\n let transformCount = 0;\n for (const key in style) {\n const rawVal = style[key];\n const val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (isDisabled) {\n continue;\n }\n if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key] && !layoutStyleKey[key]) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (layoutStyleKey[key] && typeof val !== \"number\") {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (key !== \"transform\") {\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n continue;\n }\n if (!val) continue;\n if (typeof val === \"string\") {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`);\n continue;\n }\n sawTransform = true;\n for (const transform of val) {\n if (!transform) continue;\n const index = transformCount++;\n const tkey = Object.keys(transform)[0];\n const currentTransform = animatedTranforms.current[index]?.[tkey];\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n animatedTranforms.current = [...animatedTranforms.current];\n }\n }\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (const k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k];\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = [];\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n }\n }\n const animatedTransformStyle = animatedTranforms.current.length > 0 ? {\n transform: animatedTranforms.current.map((r) => {\n const key = Object.keys(r)[0];\n const val = animationsState.current.get(r[key])?.interpolation || r[key];\n return { [key]: val };\n })\n } : {};\n const animatedStyle = {\n ...Object.fromEntries(\n Object.entries(animateStyles.current).map(([k, v]) => [\n k,\n animationsState.current.get(v)?.interpolation || v\n ])\n ),\n ...animatedTransformStyle\n };\n return {\n runners,\n completions,\n style: [nonAnimatedStyle, animatedStyle]\n };\n function update(key, animated, valIn) {\n const isColorStyleKey = colorStyleKey[key];\n const [val, type] = isColorStyleKey ? [0, void 0] : getValue(valIn);\n let animateToValue = val;\n const value = animated || new Animated.Value(val);\n const curInterpolation = animationsState.current.get(value);\n let interpolateArgs;\n if (type) {\n interpolateArgs = getInterpolated(\n curInterpolation?.current ?? value[\"_value\"],\n val,\n type\n );\n animationsState.current.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val\n });\n }\n if (isColorStyleKey) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1;\n interpolateArgs = getColorInterpolated(\n curInterpolation?.current,\n // valIn is the next color\n valIn,\n animateToValue\n );\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1\n });\n }\n if (value) {\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n animationState\n );\n let resolve;\n const promise = new Promise((res2) => {\n resolve = res2;\n });\n completions.push(promise);\n runners.push(() => {\n value.stopAnimation();\n function getAnimation() {\n return Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n }\n const animation = animationConfig.delay ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n getAnimation()\n ]) : getAnimation();\n animation.start(({ finished }) => {\n if (finished || isExiting) {\n resolve();\n }\n });\n });\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(\n \" \\u{1F4A0} animate\",\n key,\n `from (${value[\"_value\"]}) to`,\n valIn,\n `(${val})`,\n \"type\",\n type,\n \"interpolate\",\n interpolateArgs\n );\n }\n }\n return value;\n }\n }, args);\n React.useEffect(() => {\n wasExitingRef.current = isExiting;\n });\n useIsomorphicLayoutEffect(() => {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", false);\n }\n }, [justStoppedExiting]);\n useIsomorphicLayoutEffect(() => {\n res.runners.forEach((r) => r());\n const cycleId = exitCycleIdRef.current;\n const cause = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"update\";\n if (cause === \"exit\") {\n if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", false);\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false;\n updateCycleIdRef.current++;\n emit(\"end\", \"update\", false);\n }\n }\n if (cause === \"update\") {\n const sig = args[0];\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig;\n return;\n }\n prevStyleSigRef.current = sig;\n if (res.completions.length === 0) return;\n if (updateInFlightRef.current) {\n emit(\"end\", \"update\", false);\n }\n updateInFlightRef.current = true;\n const uid = ++updateCycleIdRef.current;\n emit(\"start\", \"update\");\n Promise.all(res.completions).then(() => {\n if (uid !== updateCycleIdRef.current) return;\n updateInFlightRef.current = false;\n emit(\"end\", \"update\", true);\n });\n return;\n }\n prevStyleSigRef.current = args[0];\n if (res.completions.length === 0) {\n emit(\"start\", cause);\n emit(\"end\", cause, true);\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true;\n sendExitComplete?.();\n }\n return;\n }\n if (cause === \"enter\" && !enterStartedRef.current) {\n enterStartedRef.current = true;\n emit(\"start\", \"enter\");\n }\n if (cause === \"exit\" && !exitStartedRef.current) {\n exitStartedRef.current = true;\n emit(\"start\", \"exit\");\n }\n Promise.all(res.completions).then(() => {\n if (isExiting && cycleId !== exitCycleIdRef.current) return;\n if (isExiting && exitCompletedRef.current) return;\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", true);\n }\n exitCompletedRef.current = true;\n sendExitComplete?.();\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", true);\n }\n });\n }, args);\n useStyleEmitter?.((nextStyle, _effectiveTransition, pseudoActive) => {\n pseudoActiveRef.current = pseudoActive === true;\n const runners = [];\n const seenAnimateKeys = /* @__PURE__ */ new Set();\n let transformCount = 0;\n let animatedShapeChanged = false;\n const useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(nextStyle, isDark) && !Object.keys(animateStyles.current).some((key) => layoutStyleKey[key]);\n for (const key in nextStyle) {\n const rawVal = nextStyle[key];\n const val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (key === \"transform\" && Array.isArray(val)) {\n for (const transform of val) {\n if (!transform) continue;\n const index = transformCount++;\n const tkey = Object.keys(transform)[0];\n const currentTransform = animatedTranforms.current[index]?.[tkey];\n if (!currentTransform) animatedShapeChanged = true;\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n }\n } else if (animatedStyleKey[key] != null || costlyToAnimateStyleKey[key] || layoutStyleKey[key]) {\n if (layoutStyleKey[key] && typeof val !== \"number\") continue;\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue;\n if (!animateStyles.current[key]) animatedShapeChanged = true;\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n }\n }\n for (const key in animateStyles.current) {\n if (!seenAnimateKeys.has(key)) {\n delete animateStyles.current[key];\n animatedShapeChanged = true;\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n animatedShapeChanged = true;\n }\n runners.forEach((r) => r());\n if (animatedShapeChanged && stateRef.current.nextState) {\n stateRef.current.baseSetStateShallow?.(stateRef.current.nextState);\n }\n function update(key, animated, valIn) {\n const isColor = colorStyleKey[key];\n const [numVal, type] = isColor ? [0, void 0] : getValue(valIn);\n let animateToValue = numVal;\n const value = animated || new Animated.Value(numVal);\n const curInterpolation = animationsState.current.get(value);\n if (type) {\n animationsState.current.set(value, {\n interpolation: value.interpolate(\n getInterpolated(\n curInterpolation?.current ?? value[\"_value\"],\n numVal,\n type\n )\n ),\n current: numVal\n });\n }\n if (isColor) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1;\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(\n getColorInterpolated(\n curInterpolation?.current,\n valIn,\n animateToValue\n )\n ),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1\n });\n }\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n \"default\"\n );\n runners.push(() => {\n value.stopAnimation();\n const anim = Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n (animationConfig.delay ? Animated.sequence([Animated.delay(animationConfig.delay), anim]) : anim).start();\n });\n return value;\n }\n });\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(`Animated`, { response: res, inputStyle: style, isExiting });\n }\n }\n return res;\n }\n };\n}\nfunction getColorInterpolated(currentColor, nextColor, animateToValue) {\n const inputRange = [0, 1];\n const outputRange = [currentColor ? currentColor : nextColor, nextColor];\n if (animateToValue === 0) {\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getInterpolated(current, next, postfix = \"deg\") {\n if (next === current) {\n current = next - 1e-9;\n }\n const inputRange = [current, next];\n const outputRange = [`${current}${postfix}`, `${next}${postfix}`];\n if (next < current) {\n inputRange.reverse();\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getAnimationConfig(key, animations, transition, animationState = \"default\") {\n const normalized = normalizeTransition(transition);\n const shortKey = transformShorthands[key];\n const propAnimation = normalized.properties[key] ?? normalized.properties[shortKey];\n let animationType = null;\n let extraConf = {};\n if (typeof propAnimation === \"string\") {\n animationType = propAnimation;\n } else if (propAnimation && typeof propAnimation === \"object\") {\n animationType = propAnimation.type || getEffectiveAnimation(normalized, animationState);\n extraConf = propAnimation;\n } else {\n animationType = getEffectiveAnimation(normalized, animationState);\n }\n if (normalized.delay && !extraConf.delay) {\n extraConf = { ...extraConf, delay: normalized.delay };\n }\n const found = animationType ? animations[animationType] : {};\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf\n };\n}\nconst transformShorthands = {\n x: \"translateX\",\n y: \"translateY\",\n translateX: \"x\",\n translateY: \"y\"\n};\nfunction getValue(input, isColor = false) {\n if (typeof input !== \"string\") {\n return [input];\n }\n const [_, number, after] = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/) ?? [];\n return [+number, after];\n}\nexport {\n AnimatedText,\n AnimatedView,\n createAnimations,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle\n};\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;;;;;AASA,MAAM,WAAW,CAAC,SAAS,OAAO,WAAW,eAAe,CAAC,CAAC,OAAO;AACrE,MAAM,uBAAuB,OAAO,WAAW;CAC7C,IAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;EAC5D,MAAM,eAAe,SAAS,MAAM,QAAQ,OAAO,MAAM,QAAQ;EACjE,OAAO;CACT;CACA,OAAO;AACT;AACA,MAAM,mBAAmB;CACvB,WAAW;CACX,SAAS;AACX;AACA,MAAM,gBAAgB;CACpB,iBAAiB;CACjB,OAAO;CACP,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;AACrB;AACA,MAAM,iBAAiB;CACrB,QAAQ;CACR,OAAO;CACP,WAAW;CACX,WAAW;CACX,UAAU;CACV,UAAU;AACZ;AACA,SAAS,qBAAqB,OAAO,QAAQ,aAAa;CACxD,KAAK,MAAM,OAAO,gBAAgB;EAChC,IAAI,eAAe,CAAC,YAAY,SAAS,GAAG,GAAG;EAC/C,IAAI,OAAO,oBAAoB,MAAM,MAAM,MAAM,MAAM,UAAU,OAAO;CAC1E;CACA,OAAO;AACT;AACA,SAAS,kBAAkB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,aAAa,KAAK,KAAK;AAC7D;AACA,MAAM,0BAA0B;CAC9B,cAAc;CACd,qBAAqB;CACrB,sBAAsB;CACtB,wBAAwB;CACxB,yBAAyB;CACzB,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB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BAAiB,WAAW;CACnF,MAAM,aAAa,oBAAoB,UAAU;CACjD,MAAM,WAAW,oBAAoB;CACrC,MAAM,gBAAgB,WAAW,WAAW,QAAQ,WAAW,WAAW;CAC1E,IAAI,gBAAgB;CACpB,IAAI,YAAY,CAAC;CACjB,IAAI,OAAO,kBAAkB,UAAU;EACrC,gBAAgB;CAClB,OAAO,IAAI,iBAAiB,OAAO,kBAAkB,UAAU;EAC7D,gBAAgB,cAAc,QAAQ,sBAAsB,YAAY,cAAc;EACtF,YAAY;CACd,OAAO;EACL,gBAAgB,sBAAsB,YAAY,cAAc;CAClE;CACA,IAAI,WAAW,SAAS,CAAC,UAAU,OAAO;EACxC,YAAY;GAAE,GAAG;GAAW,OAAO,WAAW;EAAM;CACtD;CACA,MAAM,QAAQ,gBAAgB,WAAW,iBAAiB,CAAC;CAC3D,OAAO;EACL,GAAG;EAEH,GAAG,WAAW;EAEd,GAAG;CACL;AACF;AACA,MAAM,sBAAsB;CAC1B,GAAG;CACH,GAAG;CACH,YAAY;CACZ,YAAY;AACd;AACA,SAAS,SAAS,OAAO,UAAU,OAAO;CACxC,IAAI,OAAO,UAAU,UAAU;EAC7B,OAAO,CAAC,KAAK;CACf;CACA,MAAM,CAAC,GAAG,QAAQ,SAAS,MAAM,MAAM,oCAAoC,KAAK,CAAC;CACjF,OAAO,CAAC,CAAC,QAAQ,KAAK;AACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnimations.native.js","names":[],"sources":["esm/createAnimations.native.js"],"sourcesContent":["import { getEffectiveAnimation, normalizeTransition } from \"@tamagui/animation-helpers\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ResetPresence, usePresence } from \"@tamagui/use-presence\";\nimport { useEvent, useThemeWithState } from \"@tamagui/web\";\nimport React from \"react\";\nimport { Animated, processColor } from \"react-native\";\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar isFabric = !isWeb && typeof global !== \"undefined\" && !!global.__nativeFabricUIManager;\nvar resolveDynamicValue = function(value, isDark) {\n if (value && (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) === \"object\" && \"dynamic\" in value) {\n var dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;\n return dynamicValue;\n }\n return value;\n};\nvar animatedStyleKey = {\n transform: true,\n opacity: true\n};\nvar colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true\n};\nvar layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true\n};\nfunction hasAnimatedLayoutKey(style, isDark, animateOnly) {\n for (var key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue;\n if (typeof resolveDynamicValue(style[key], isDark) === \"number\") return true;\n }\n return false;\n}\nfunction isAnimatableColor(value) {\n return typeof value === \"string\" && processColor(value) != null;\n}\nvar costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey\n};\nvar AnimatedView = Animated.View;\nvar AnimatedText = Animated.Text;\nfunction useAnimatedNumber(initial) {\n var state = React.useRef(null);\n if (!state.current) {\n state.current = {\n composite: null,\n val: new Animated.Value(initial),\n strategy: {\n type: \"spring\"\n }\n };\n }\n return {\n getInstance() {\n return state.current.val;\n },\n getValue() {\n return state.current.val[\"_value\"];\n },\n stop() {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n state.current.composite = null;\n },\n setValue(next) {\n var { type, ...config } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {\n type: \"spring\"\n }, onFinish = arguments.length > 2 ? arguments[2] : void 0;\n var val = state.current.val;\n var handleFinish = onFinish ? function(param) {\n var { finished } = param;\n return finished ? onFinish() : null;\n } : void 0;\n if (type === \"direct\") {\n val.setValue(next);\n } else if (type === \"spring\") {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n var composite = Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n } else {\n var _state_current_composite1;\n (_state_current_composite1 = state.current.composite) === null || _state_current_composite1 === void 0 ? void 0 : _state_current_composite1.stop();\n var composite1 = Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite1.start(handleFinish);\n state.current.composite = composite1;\n }\n }\n };\n}\nvar useAnimatedNumberReaction = function(param, onValue) {\n var { value } = param;\n var onChange = useEvent(function(current) {\n onValue(current.value);\n });\n React.useEffect(function() {\n var id = value.getInstance().addListener(onChange);\n return function() {\n value.getInstance().removeListener(id);\n };\n }, [\n value,\n onChange\n ]);\n};\nvar useAnimatedNumberStyle = function(value, getStyle) {\n var instance = value.getInstance();\n var animatedStyle = getStyle(instance);\n var usesAnimatedNode = hasAnimatedNode(animatedStyle);\n var [current, setCurrent] = React.useState(value.getValue());\n React.useEffect(function() {\n if (usesAnimatedNode) return;\n var id = instance.addListener(function(param) {\n var { value: next } = param;\n setCurrent(next);\n });\n return function() {\n instance.removeListener(id);\n };\n }, [\n instance,\n usesAnimatedNode\n ]);\n return usesAnimatedNode ? animatedStyle : getStyle(current);\n};\nfunction hasAnimatedNode(value) {\n if (!value || (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) !== \"object\") return false;\n if (typeof value.__getValue === \"function\") return true;\n if (Array.isArray(value)) return value.some(hasAnimatedNode);\n return Object.values(value).some(hasAnimatedNode);\n}\nvar useAnimatedNumbersStyle = function(vals, getStyle) {\n return getStyle(...vals.map(function(v) {\n return v.getInstance();\n }));\n};\nfunction createAnimations(animations, options) {\n var _options_useNativeDriver;\n var nativeDriver = (_options_useNativeDriver = options === null || options === void 0 ? void 0 : options.useNativeDriver) !== null && _options_useNativeDriver !== void 0 ? _options_useNativeDriver : isFabric;\n return {\n isReactNative: true,\n inputStyle: \"value\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence,\n ResetPresence,\n useAnimations: function(param) {\n var { props, onTransition, style, componentState, presence, stateRef, useStyleEmitter } = param;\n var _themeState_name;\n var isDisabled = isWeb && componentState.unmounted === true;\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 onTransitionRef = React.useRef(onTransition);\n onTransitionRef.current = onTransition;\n var emit = function(phase, cause, finished) {\n var _onTransitionRef_current;\n (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === \"end\" ? {\n phase,\n cause,\n finished\n } : {\n phase,\n cause\n });\n };\n var [, themeState] = useThemeWithState({});\n var isDark = (themeState === null || themeState === void 0 ? void 0 : themeState.scheme) === \"dark\" || (themeState === null || themeState === void 0 ? void 0 : (_themeState_name = themeState.name) === null || _themeState_name === void 0 ? void 0 : _themeState_name.startsWith(\"dark\"));\n var animateStyles = React.useRef({});\n var animatedTranforms = React.useRef([]);\n var animationsState = React.useRef(/* @__PURE__ */ new WeakMap());\n var pseudoActiveRef = React.useRef(false);\n var exitCycleIdRef = React.useRef(0);\n var exitCompletedRef = React.useRef(false);\n var wasExitingRef = React.useRef(false);\n var enterStartedRef = React.useRef(false);\n var exitStartedRef = React.useRef(false);\n var updateInFlightRef = React.useRef(false);\n var updateCycleIdRef = React.useRef(0);\n var prevStyleSigRef = React.useRef(null);\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 }\n var animateOnly = props.animateOnly || [];\n var hasTransitionOnly = !!props.animateOnly;\n var isEntering = !!componentState.unmounted;\n var wasEnteringRef = React.useRef(isEntering);\n var justFinishedEntering = wasEnteringRef.current && !isEntering;\n React.useEffect(function() {\n wasEnteringRef.current = isEntering;\n });\n var args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly\n ];\n var res = React.useMemo(function() {\n var runners = [];\n var completions = [];\n var animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n var nonAnimatedStyle = {};\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(style, isDark, hasTransitionOnly ? animateOnly : void 0);\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var sawTransform = false;\n var transformCount = 0;\n for (var key in style) {\n var rawVal = style[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (isDisabled) {\n continue;\n }\n if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key] && !layoutStyleKey[key]) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (layoutStyleKey[key] && typeof val !== \"number\") {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (key !== \"transform\") {\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n continue;\n }\n if (!val) continue;\n if (typeof val === \"string\") {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`);\n continue;\n }\n sawTransform = true;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n animatedTranforms.current = [\n ...animatedTranforms.current\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 }\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (var k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k];\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = [];\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n }\n }\n var animatedTransformStyle = animatedTranforms.current.length > 0 ? {\n transform: animatedTranforms.current.map(function(r) {\n var _animationsState_current_get;\n var key2 = Object.keys(r)[0];\n var val2 = ((_animationsState_current_get = animationsState.current.get(r[key2])) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || r[key2];\n return {\n [key2]: val2\n };\n })\n } : {};\n var animatedStyle = {\n ...Object.fromEntries(Object.entries(animateStyles.current).map(function(param2) {\n var [k2, v] = param2;\n var _animationsState_current_get;\n return [\n k2,\n ((_animationsState_current_get = animationsState.current.get(v)) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || v\n ];\n })),\n ...animatedTransformStyle\n };\n return {\n runners,\n completions,\n style: [\n nonAnimatedStyle,\n animatedStyle\n ]\n };\n function update(key2, animated, valIn) {\n var isColorStyleKey = colorStyleKey[key2];\n var [val2, type] = isColorStyleKey ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = val2;\n var value = animated || new Animated.Value(val2);\n var curInterpolation = animationsState.current.get(value);\n var interpolateArgs;\n if (type) {\n var _curInterpolation_current;\n interpolateArgs = getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], val2, type);\n animationsState.current.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val2\n });\n }\n if (isColorStyleKey) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n interpolateArgs = getColorInterpolated(\n curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current,\n // valIn is the next color\n valIn,\n animateToValue\n );\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n if (value) {\n var animationConfig = getAnimationConfig(key2, animations, props.transition, animationState);\n var resolve;\n var promise = new Promise(function(res2) {\n resolve = res2;\n });\n completions.push(promise);\n runners.push(function() {\n value.stopAnimation();\n function getAnimation() {\n return Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n }\n var animation = animationConfig.delay ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n getAnimation()\n ]) : getAnimation();\n animation.start(function(param2) {\n var { finished } = param2;\n if (finished || isExiting) {\n resolve();\n }\n });\n });\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(\" \\u{1F4A0} animate\", key2, `from (${value[\"_value\"]}) to`, valIn, `(${val2})`, \"type\", type, \"interpolate\", interpolateArgs);\n }\n }\n return value;\n }\n }, args);\n React.useEffect(function() {\n wasExitingRef.current = isExiting;\n });\n useIsomorphicLayoutEffect(function() {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", false);\n }\n }, [\n justStoppedExiting\n ]);\n useIsomorphicLayoutEffect(function() {\n res.runners.forEach(function(r) {\n return r();\n });\n var cycleId = exitCycleIdRef.current;\n var cause = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"update\";\n if (cause === \"exit\") {\n if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", false);\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false;\n updateCycleIdRef.current++;\n emit(\"end\", \"update\", false);\n }\n }\n if (cause === \"update\") {\n var sig = args[0];\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig;\n return;\n }\n prevStyleSigRef.current = sig;\n if (res.completions.length === 0) return;\n if (updateInFlightRef.current) {\n emit(\"end\", \"update\", false);\n }\n updateInFlightRef.current = true;\n var uid = ++updateCycleIdRef.current;\n emit(\"start\", \"update\");\n Promise.all(res.completions).then(function() {\n if (uid !== updateCycleIdRef.current) return;\n updateInFlightRef.current = false;\n emit(\"end\", \"update\", true);\n });\n return;\n }\n prevStyleSigRef.current = args[0];\n if (res.completions.length === 0) {\n emit(\"start\", cause);\n emit(\"end\", cause, true);\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n }\n return;\n }\n if (cause === \"enter\" && !enterStartedRef.current) {\n enterStartedRef.current = true;\n emit(\"start\", \"enter\");\n }\n if (cause === \"exit\" && !exitStartedRef.current) {\n exitStartedRef.current = true;\n emit(\"start\", \"exit\");\n }\n Promise.all(res.completions).then(function() {\n if (isExiting && cycleId !== exitCycleIdRef.current) return;\n if (isExiting && exitCompletedRef.current) return;\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", true);\n }\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", true);\n }\n });\n }, args);\n useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, _effectiveTransition, pseudoActive) {\n pseudoActiveRef.current = pseudoActive === true;\n var runners = [];\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var transformCount = 0;\n var animatedShapeChanged = false;\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(nextStyle, isDark) && !Object.keys(animateStyles.current).some(function(key2) {\n return layoutStyleKey[key2];\n });\n for (var key in nextStyle) {\n var rawVal = nextStyle[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (key === \"transform\" && Array.isArray(val)) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n if (!currentTransform) animatedShapeChanged = true;\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\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 } else if (animatedStyleKey[key] != null || costlyToAnimateStyleKey[key] || layoutStyleKey[key]) {\n if (layoutStyleKey[key] && typeof val !== \"number\") continue;\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue;\n if (!animateStyles.current[key]) animatedShapeChanged = true;\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n }\n }\n for (var key1 in animateStyles.current) {\n if (!seenAnimateKeys.has(key1)) {\n delete animateStyles.current[key1];\n animatedShapeChanged = true;\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n animatedShapeChanged = true;\n }\n runners.forEach(function(r) {\n return r();\n });\n if (animatedShapeChanged && stateRef.current.nextState) {\n var _stateRef_current_baseSetStateShallow, _stateRef_current;\n (_stateRef_current_baseSetStateShallow = (_stateRef_current = stateRef.current).baseSetStateShallow) === null || _stateRef_current_baseSetStateShallow === void 0 ? void 0 : _stateRef_current_baseSetStateShallow.call(_stateRef_current, stateRef.current.nextState);\n }\n function update(key2, animated, valIn) {\n var isColor = colorStyleKey[key2];\n var [numVal, type] = isColor ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = numVal;\n var value = animated || new Animated.Value(numVal);\n var curInterpolation = animationsState.current.get(value);\n if (type) {\n var _curInterpolation_current;\n animationsState.current.set(value, {\n interpolation: value.interpolate(getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], numVal, type)),\n current: numVal\n });\n }\n if (isColor) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(getColorInterpolated(curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current, valIn, animateToValue)),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n var animationConfig = getAnimationConfig(key2, animations, props.transition, \"default\");\n runners.push(function() {\n value.stopAnimation();\n var anim = Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n (animationConfig.delay ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n anim\n ]) : anim).start();\n });\n return value;\n }\n });\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(`Animated`, {\n response: res,\n inputStyle: style,\n isExiting\n });\n }\n }\n return res;\n }\n };\n}\nfunction getColorInterpolated(currentColor, nextColor, animateToValue) {\n var inputRange = [\n 0,\n 1\n ];\n var outputRange = [\n currentColor ? currentColor : nextColor,\n nextColor\n ];\n if (animateToValue === 0) {\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getInterpolated(current, next) {\n var postfix = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : \"deg\";\n if (next === current) {\n current = next - 1e-9;\n }\n var inputRange = [\n current,\n next\n ];\n var outputRange = [\n `${current}${postfix}`,\n `${next}${postfix}`\n ];\n if (next < current) {\n inputRange.reverse();\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getAnimationConfig(key, animations, transition) {\n var animationState = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"default\";\n var normalized = normalizeTransition(transition);\n var shortKey = transformShorthands[key];\n var _normalized_properties_key;\n var propAnimation = (_normalized_properties_key = normalized.properties[key]) !== null && _normalized_properties_key !== void 0 ? _normalized_properties_key : normalized.properties[shortKey];\n var animationType = null;\n var extraConf = {};\n if (typeof propAnimation === \"string\") {\n animationType = propAnimation;\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\") {\n animationType = propAnimation.type || getEffectiveAnimation(normalized, animationState);\n extraConf = propAnimation;\n } else {\n animationType = getEffectiveAnimation(normalized, animationState);\n }\n if (normalized.delay && !extraConf.delay) {\n extraConf = {\n ...extraConf,\n delay: normalized.delay\n };\n }\n var found = animationType ? animations[animationType] : {};\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf\n };\n}\nvar transformShorthands = {\n x: \"translateX\",\n y: \"translateY\",\n translateX: \"x\",\n translateY: \"y\"\n};\nfunction getValue(input) {\n var isColor = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n if (typeof input !== \"string\") {\n return [\n input\n ];\n }\n var _input_match;\n var [_, number, after] = (_input_match = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/)) !== null && _input_match !== void 0 ? _input_match : [];\n return [\n +number,\n after\n ];\n}\nexport {\n AnimatedText,\n AnimatedView,\n createAnimations,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle\n};\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;;;;;AAMA,SAAS,SAAS,KAAK;CACrB;CACA,OAAO,OAAO,OAAO,WAAW,eAAe,IAAI,gBAAgB,SAAS,WAAW,OAAO;AAChG;AACA,IAAI,WAAW,CAAC,SAAS,OAAO,WAAW,eAAe,CAAC,CAAC,OAAO;AACnE,IAAI,sBAAsB,SAAS,OAAO,QAAQ;CAChD,IAAI,UAAU,OAAO,UAAU,cAAc,cAAc,SAAS,KAAK,OAAO,YAAY,aAAa,OAAO;EAC9G,IAAI,eAAe,SAAS,MAAM,QAAQ,OAAO,MAAM,QAAQ;EAC/D,OAAO;CACT;CACA,OAAO;AACT;AACA,IAAI,mBAAmB;CACrB,WAAW;CACX,SAAS;AACX;AACA,IAAI,gBAAgB;CAClB,iBAAiB;CACjB,OAAO;CACP,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;AACrB;AACA,IAAI,iBAAiB;CACnB,QAAQ;CACR,OAAO;CACP,WAAW;CACX,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C,gBAAgB;CAClB,OAAO,IAAI,kBAAkB,OAAO,kBAAkB,cAAc,cAAc,SAAS,aAAa,OAAO,UAAU;EACvH,gBAAgB,cAAc,QAAQ,sBAAsB,YAAY,cAAc;EACtF,YAAY;CACd,OAAO;EACL,gBAAgB,sBAAsB,YAAY,cAAc;CAClE;CACA,IAAI,WAAW,SAAS,CAAC,UAAU,OAAO;EACxC,YAAY;GACV,GAAG;GACH,OAAO,WAAW;EACpB;CACF;CACA,IAAI,QAAQ,gBAAgB,WAAW,iBAAiB,CAAC;CACzD,OAAO;EACL,GAAG;EAEH,GAAG,WAAW;EAEd,GAAG;CACL;AACF;AACA,IAAI,sBAAsB;CACxB,GAAG;CACH,GAAG;CACH,YAAY;CACZ,YAAY;AACd;AACA,SAAS,SAAS,OAAO;CACvB,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,IAAI,OAAO,UAAU,UAAU;EAC7B,OAAO,CACL,KACF;CACF;CACA,IAAI;CACJ,IAAI,CAAC,GAAG,QAAQ,UAAU,eAAe,MAAM,MAAM,oCAAoC,OAAO,QAAQ,iBAAiB,KAAK,IAAI,eAAe,CAAC;CAClJ,OAAO,CACL,CAAC,QACD,KACF;AACF"}
|
|
1
|
+
{"version":3,"file":"createAnimations.native.js","names":[],"sources":["esm/createAnimations.native.js"],"sourcesContent":["import { getEffectiveAnimation, normalizeTransition } from \"@tamagui/animation-helpers\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ResetPresence, usePresence } from \"@tamagui/use-presence\";\nimport { useEvent, useThemeWithState } from \"@tamagui/web\";\nimport React from \"react\";\nimport { Animated, processColor } from \"react-native\";\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar isFabric = !isWeb && typeof global !== \"undefined\" && !!global.__nativeFabricUIManager;\nvar resolveDynamicValue = function(value, isDark) {\n if (value && (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) === \"object\" && \"dynamic\" in value) {\n var dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;\n return dynamicValue;\n }\n return value;\n};\nvar animatedStyleKey = {\n transform: true,\n opacity: true\n};\nvar colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true\n};\nvar layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true\n};\nfunction hasAnimatedLayoutKey(style, isDark, animateOnly) {\n for (var key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue;\n if (typeof resolveDynamicValue(style[key], isDark) === \"number\") return true;\n }\n return false;\n}\nfunction isAnimatableColor(value) {\n return typeof value === \"string\" && processColor(value) != null;\n}\nvar costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey\n};\nvar AnimatedView = Animated.View;\nvar AnimatedText = Animated.Text;\nfunction useAnimatedNumber(initial) {\n var state = React.useRef(null);\n if (!state.current) {\n state.current = {\n composite: null,\n val: new Animated.Value(initial),\n strategy: {\n type: \"spring\"\n }\n };\n }\n return {\n getInstance() {\n return state.current.val;\n },\n getValue() {\n return state.current.val[\"_value\"];\n },\n stop() {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n state.current.composite = null;\n },\n setValue(next) {\n var { type, ...config } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {\n type: \"spring\"\n }, onFinish = arguments.length > 2 ? arguments[2] : void 0;\n var val = state.current.val;\n var handleFinish = onFinish ? function(param) {\n var { finished } = param;\n return finished ? onFinish() : null;\n } : void 0;\n if (type === \"direct\") {\n val.setValue(next);\n } else if (type === \"spring\") {\n var _state_current_composite;\n (_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 ? void 0 : _state_current_composite.stop();\n var composite = Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite.start(handleFinish);\n state.current.composite = composite;\n } else {\n var _state_current_composite1;\n (_state_current_composite1 = state.current.composite) === null || _state_current_composite1 === void 0 ? void 0 : _state_current_composite1.stop();\n var composite1 = Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric\n });\n composite1.start(handleFinish);\n state.current.composite = composite1;\n }\n }\n };\n}\nvar useAnimatedNumberReaction = function(param, onValue) {\n var { value } = param;\n var onChange = useEvent(function(current) {\n onValue(current.value);\n });\n React.useEffect(function() {\n var id = value.getInstance().addListener(onChange);\n return function() {\n value.getInstance().removeListener(id);\n };\n }, [\n value,\n onChange\n ]);\n};\nvar useAnimatedNumberStyle = function(value, getStyle) {\n var instance = value.getInstance();\n var animatedStyle = getStyle(instance);\n var usesAnimatedNode = hasAnimatedNode(animatedStyle);\n var [current, setCurrent] = React.useState(value.getValue());\n React.useEffect(function() {\n if (usesAnimatedNode) return;\n var id = instance.addListener(function(param) {\n var { value: next } = param;\n setCurrent(next);\n });\n return function() {\n instance.removeListener(id);\n };\n }, [\n instance,\n usesAnimatedNode\n ]);\n return usesAnimatedNode ? animatedStyle : getStyle(current);\n};\nfunction hasAnimatedNode(value) {\n if (!value || (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) !== \"object\") return false;\n if (typeof value.__getValue === \"function\") return true;\n if (Array.isArray(value)) return value.some(hasAnimatedNode);\n return Object.values(value).some(hasAnimatedNode);\n}\nvar useAnimatedNumbersStyle = function(vals, getStyle) {\n return getStyle(...vals.map(function(v) {\n return v.getInstance();\n }));\n};\nfunction createAnimations(animations, options) {\n var _options_useNativeDriver;\n var nativeDriver = (_options_useNativeDriver = options === null || options === void 0 ? void 0 : options.useNativeDriver) !== null && _options_useNativeDriver !== void 0 ? _options_useNativeDriver : isFabric;\n return {\n isReactNative: true,\n inputStyle: \"value\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence,\n ResetPresence,\n useAnimations: function(param) {\n var { props, onTransition, style, componentState, presence, stateRef, useStyleEmitter } = param;\n var _themeState_name;\n var isDisabled = isWeb && componentState.unmounted === true;\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 onTransitionRef = React.useRef(onTransition);\n onTransitionRef.current = onTransition;\n var emit = function(phase, cause, finished) {\n var _onTransitionRef_current;\n (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === \"end\" ? {\n phase,\n cause,\n finished\n } : {\n phase,\n cause\n });\n };\n var [, themeState] = useThemeWithState({});\n var isDark = (themeState === null || themeState === void 0 ? void 0 : themeState.scheme) === \"dark\" || (themeState === null || themeState === void 0 ? void 0 : (_themeState_name = themeState.name) === null || _themeState_name === void 0 ? void 0 : _themeState_name.startsWith(\"dark\"));\n var animateStyles = React.useRef({});\n var animatedTranforms = React.useRef([]);\n var animationsState = React.useRef(/* @__PURE__ */ new WeakMap());\n var pseudoActiveRef = React.useRef(false);\n var exitCycleIdRef = React.useRef(0);\n var exitCompletedRef = React.useRef(false);\n var wasExitingRef = React.useRef(false);\n var enterStartedRef = React.useRef(false);\n var exitStartedRef = React.useRef(false);\n var updateInFlightRef = React.useRef(false);\n var updateCycleIdRef = React.useRef(0);\n var prevStyleSigRef = React.useRef(null);\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 }\n var animateOnly = props.animateOnly || [];\n var hasTransitionOnly = !!props.animateOnly;\n var isEntering = !!componentState.unmounted;\n var wasEnteringRef = React.useRef(isEntering);\n var justFinishedEntering = wasEnteringRef.current && !isEntering;\n React.useEffect(function() {\n wasEnteringRef.current = isEntering;\n });\n var args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly\n ];\n var res = React.useMemo(function() {\n var runners = [];\n var completions = [];\n var animationState = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"default\";\n var nonAnimatedStyle = {};\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(style, isDark, hasTransitionOnly ? animateOnly : void 0);\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var sawTransform = false;\n var transformCount = 0;\n for (var key in style) {\n var rawVal = style[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (isDisabled) {\n continue;\n }\n if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key] && !layoutStyleKey[key]) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (layoutStyleKey[key] && typeof val !== \"number\") {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val;\n continue;\n }\n if (key !== \"transform\") {\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n continue;\n }\n if (!val) continue;\n if (typeof val === \"string\") {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`);\n continue;\n }\n sawTransform = true;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\n };\n animatedTranforms.current = [\n ...animatedTranforms.current\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 }\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (var k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k];\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = [];\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n }\n }\n var animatedTransformStyle = animatedTranforms.current.length > 0 ? {\n transform: animatedTranforms.current.map(function(r) {\n var _animationsState_current_get;\n var key2 = Object.keys(r)[0];\n var val2 = ((_animationsState_current_get = animationsState.current.get(r[key2])) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || r[key2];\n return {\n [key2]: val2\n };\n })\n } : {};\n var animatedStyle = {\n ...Object.fromEntries(Object.entries(animateStyles.current).map(function(param2) {\n var [k2, v] = param2;\n var _animationsState_current_get;\n return [\n k2,\n ((_animationsState_current_get = animationsState.current.get(v)) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || v\n ];\n })),\n ...animatedTransformStyle\n };\n return {\n runners,\n completions,\n style: [\n nonAnimatedStyle,\n animatedStyle\n ]\n };\n function update(key2, animated, valIn) {\n var isColorStyleKey = colorStyleKey[key2];\n var [val2, type] = isColorStyleKey ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = val2;\n var value = animated || new Animated.Value(val2);\n var curInterpolation = animationsState.current.get(value);\n var interpolateArgs;\n if (type) {\n var _curInterpolation_current;\n interpolateArgs = getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], val2, type);\n animationsState.current.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val2\n });\n }\n if (isColorStyleKey) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n interpolateArgs = getColorInterpolated(\n curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current,\n // valIn is the next color\n valIn,\n animateToValue\n );\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n if (value) {\n var animationConfig = getAnimationConfig(key2, animations, props.transition, animationState);\n var resolve;\n var promise = new Promise(function(res2) {\n resolve = res2;\n });\n completions.push(promise);\n runners.push(function() {\n value.stopAnimation();\n function getAnimation() {\n return Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n }\n var animation = animationConfig.delay ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n getAnimation()\n ]) : getAnimation();\n animation.start(function(param2) {\n var { finished } = param2;\n if (finished || isExiting) {\n resolve();\n }\n });\n });\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(\" \\u{1F4A0} animate\", key2, `from (${value[\"_value\"]}) to`, valIn, `(${val2})`, \"type\", type, \"interpolate\", interpolateArgs);\n }\n }\n return value;\n }\n }, args);\n React.useEffect(function() {\n wasExitingRef.current = isExiting;\n });\n useIsomorphicLayoutEffect(function() {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", false);\n }\n }, [\n justStoppedExiting\n ]);\n useIsomorphicLayoutEffect(function() {\n res.runners.forEach(function(r) {\n return r();\n });\n var cycleId = exitCycleIdRef.current;\n var cause = isExiting ? \"exit\" : isEntering || justFinishedEntering ? \"enter\" : \"update\";\n if (cause === \"exit\") {\n if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", false);\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false;\n updateCycleIdRef.current++;\n emit(\"end\", \"update\", false);\n }\n }\n if (cause === \"update\") {\n var sig = args[0];\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig;\n return;\n }\n prevStyleSigRef.current = sig;\n if (res.completions.length === 0) return;\n if (updateInFlightRef.current) {\n emit(\"end\", \"update\", false);\n }\n updateInFlightRef.current = true;\n var uid = ++updateCycleIdRef.current;\n emit(\"start\", \"update\");\n Promise.all(res.completions).then(function() {\n if (uid !== updateCycleIdRef.current) return;\n updateInFlightRef.current = false;\n emit(\"end\", \"update\", true);\n });\n return;\n }\n prevStyleSigRef.current = args[0];\n if (res.completions.length === 0) {\n emit(\"start\", cause);\n emit(\"end\", cause, true);\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n }\n return;\n }\n if (cause === \"enter\" && !enterStartedRef.current) {\n enterStartedRef.current = true;\n emit(\"start\", \"enter\");\n }\n if (cause === \"exit\" && !exitStartedRef.current) {\n exitStartedRef.current = true;\n emit(\"start\", \"exit\");\n }\n Promise.all(res.completions).then(function() {\n if (isExiting && cycleId !== exitCycleIdRef.current) return;\n if (isExiting && exitCompletedRef.current) return;\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false;\n emit(\"end\", \"exit\", true);\n }\n exitCompletedRef.current = true;\n sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false;\n emit(\"end\", \"enter\", true);\n }\n });\n }, args);\n useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, _effectiveTransition, pseudoActive) {\n pseudoActiveRef.current = pseudoActive === true;\n var runners = [];\n var seenAnimateKeys = /* @__PURE__ */ new Set();\n var transformCount = 0;\n var animatedShapeChanged = false;\n var useNativeDriverForNode = nativeDriver && !hasAnimatedLayoutKey(nextStyle, isDark) && !Object.keys(animateStyles.current).some(function(key2) {\n return layoutStyleKey[key2];\n });\n for (var key in nextStyle) {\n var rawVal = nextStyle[key];\n var val = resolveDynamicValue(rawVal, isDark);\n if (val === void 0) continue;\n if (key === \"transform\" && Array.isArray(val)) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var transform = _step.value;\n var _animatedTranforms_current_index;\n if (!transform) continue;\n var index = transformCount++;\n var tkey = Object.keys(transform)[0];\n var currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];\n if (!currentTransform) animatedShapeChanged = true;\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey])\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 } else if (animatedStyleKey[key] != null || costlyToAnimateStyleKey[key] || layoutStyleKey[key]) {\n if (layoutStyleKey[key] && typeof val !== \"number\") continue;\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue;\n if (!animateStyles.current[key]) animatedShapeChanged = true;\n animateStyles.current[key] = update(key, animateStyles.current[key], val);\n seenAnimateKeys.add(key);\n }\n }\n for (var key1 in animateStyles.current) {\n if (!seenAnimateKeys.has(key1)) {\n delete animateStyles.current[key1];\n animatedShapeChanged = true;\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount);\n animatedShapeChanged = true;\n }\n runners.forEach(function(r) {\n return r();\n });\n if (animatedShapeChanged && stateRef.current.nextState) {\n var _stateRef_current_baseSetStateShallow, _stateRef_current;\n (_stateRef_current_baseSetStateShallow = (_stateRef_current = stateRef.current).baseSetStateShallow) === null || _stateRef_current_baseSetStateShallow === void 0 ? void 0 : _stateRef_current_baseSetStateShallow.call(_stateRef_current, stateRef.current.nextState);\n }\n function update(key2, animated, valIn) {\n var isColor = colorStyleKey[key2];\n var [numVal, type] = isColor ? [\n 0,\n void 0\n ] : getValue(valIn);\n var animateToValue = numVal;\n var value = animated || new Animated.Value(numVal);\n var curInterpolation = animationsState.current.get(value);\n if (type) {\n var _curInterpolation_current;\n animationsState.current.set(value, {\n interpolation: value.interpolate(getInterpolated((_curInterpolation_current = curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value[\"_value\"], numVal, type)),\n current: numVal\n });\n }\n if (isColor) {\n animateToValue = (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1;\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(getColorInterpolated(curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.current, valIn, animateToValue)),\n animateToValue: (curInterpolation === null || curInterpolation === void 0 ? void 0 : curInterpolation.animateToValue) ? 0 : 1\n });\n }\n var animationConfig = getAnimationConfig(key2, animations, props.transition, \"default\");\n runners.push(function() {\n value.stopAnimation();\n var anim = Animated[animationConfig.type || \"spring\"](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode\n });\n (animationConfig.delay ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n anim\n ]) : anim).start();\n });\n return value;\n }\n });\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] === \"verbose\") {\n console.info(`Animated`, {\n response: res,\n inputStyle: style,\n isExiting\n });\n }\n }\n return res;\n }\n };\n}\nfunction getColorInterpolated(currentColor, nextColor, animateToValue) {\n var inputRange = [\n 0,\n 1\n ];\n var outputRange = [\n currentColor ? currentColor : nextColor,\n nextColor\n ];\n if (animateToValue === 0) {\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getInterpolated(current, next) {\n var postfix = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : \"deg\";\n if (next === current) {\n current = next - 1e-9;\n }\n var inputRange = [\n current,\n next\n ];\n var outputRange = [\n `${current}${postfix}`,\n `${next}${postfix}`\n ];\n if (next < current) {\n inputRange.reverse();\n outputRange.reverse();\n }\n return {\n inputRange,\n outputRange\n };\n}\nfunction getAnimationConfig(key, animations, transition) {\n var animationState = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"default\";\n var normalized = normalizeTransition(transition);\n var shortKey = transformShorthands[key];\n var _normalized_properties_key;\n var propAnimation = (_normalized_properties_key = normalized.properties[key]) !== null && _normalized_properties_key !== void 0 ? _normalized_properties_key : normalized.properties[shortKey];\n var animationType = null;\n var extraConf = {};\n if (typeof propAnimation === \"string\") {\n animationType = propAnimation;\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\") {\n animationType = propAnimation.type || getEffectiveAnimation(normalized, animationState);\n extraConf = propAnimation;\n } else {\n animationType = getEffectiveAnimation(normalized, animationState);\n }\n if (normalized.delay && !extraConf.delay) {\n extraConf = {\n ...extraConf,\n delay: normalized.delay\n };\n }\n var found = animationType ? animations[animationType] : {};\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf\n };\n}\nvar transformShorthands = {\n x: \"translateX\",\n y: \"translateY\",\n translateX: \"x\",\n translateY: \"y\"\n};\nfunction getValue(input) {\n var isColor = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n if (typeof input !== \"string\") {\n return [\n input\n ];\n }\n var _input_match;\n var [_, number, after] = (_input_match = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/)) !== null && _input_match !== void 0 ? _input_match : [];\n return [\n +number,\n after\n ];\n}\nexport {\n AnimatedText,\n AnimatedView,\n createAnimations,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle\n};\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;;;;;AAMA,SAAS,SAAS,KAAK;CACrB;CACA,OAAO,OAAO,OAAO,WAAW,eAAe,IAAI,gBAAgB,SAAS,WAAW,OAAO;AAChG;AACA,IAAI,WAAW,CAAC,SAAS,OAAO,WAAW,eAAe,CAAC,CAAC,OAAO;AACnE,IAAI,sBAAsB,SAAS,OAAO,QAAQ;CAChD,IAAI,UAAU,OAAO,UAAU,cAAc,cAAc,SAAS,KAAK,OAAO,YAAY,aAAa,OAAO;EAC9G,IAAI,eAAe,SAAS,MAAM,QAAQ,OAAO,MAAM,QAAQ;EAC/D,OAAO;CACT;CACA,OAAO;AACT;AACA,IAAI,mBAAmB;CACrB,WAAW;CACX,SAAS;AACX;AACA,IAAI,gBAAgB;CAClB,iBAAiB;CACjB,OAAO;CACP,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;AACrB;AACA,IAAI,iBAAiB;CACnB,QAAQ;CACR,OAAO;CACP,WAAW;CACX,WAAW;CACX,UAAU;CACV,UAAU;AACZ;AACA,SAAS,qBAAqB,OAAO,QAAQ,aAAa;CACxD,KAAK,IAAI,OAAO,gB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UAAU;EACrC,gBAAgB;CAClB,OAAO,IAAI,kBAAkB,OAAO,kBAAkB,cAAc,cAAc,SAAS,aAAa,OAAO,UAAU;EACvH,gBAAgB,cAAc,QAAQ,sBAAsB,YAAY,cAAc;EACtF,YAAY;CACd,OAAO;EACL,gBAAgB,sBAAsB,YAAY,cAAc;CAClE;CACA,IAAI,WAAW,SAAS,CAAC,UAAU,OAAO;EACxC,YAAY;GACV,GAAG;GACH,OAAO,WAAW;EACpB;CACF;CACA,IAAI,QAAQ,gBAAgB,WAAW,iBAAiB,CAAC;CACzD,OAAO;EACL,GAAG;EAEH,GAAG,WAAW;EAEd,GAAG;CACL;AACF;AACA,IAAI,sBAAsB;CACxB,GAAG;CACH,GAAG;CACH,YAAY;CACZ,YAAY;AACd;AACA,SAAS,SAAS,OAAO;CACvB,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,IAAI,OAAO,UAAU,UAAU;EAC7B,OAAO,CACL,KACF;CACF;CACA,IAAI;CACJ,IAAI,CAAC,GAAG,QAAQ,UAAU,eAAe,MAAM,MAAM,oCAAoC,OAAO,QAAQ,iBAAiB,KAAK,IAAI,eAAe,CAAC;CAClJ,OAAO,CACL,CAAC,QACD,KACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/animations-react-native",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.719.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"clean:build": "tamagui-build clean:build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tamagui/animation-helpers": "3.0.0-beta.
|
|
42
|
-
"@tamagui/constants": "3.0.0-beta.
|
|
43
|
-
"@tamagui/use-presence": "3.0.0-beta.
|
|
44
|
-
"@tamagui/web": "3.0.0-beta.
|
|
41
|
+
"@tamagui/animation-helpers": "3.0.0-beta.719.1",
|
|
42
|
+
"@tamagui/constants": "3.0.0-beta.719.1",
|
|
43
|
+
"@tamagui/use-presence": "3.0.0-beta.719.1",
|
|
44
|
+
"@tamagui/web": "3.0.0-beta.719.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@tamagui/build": "3.0.0-beta.
|
|
48
|
-
"react": "
|
|
47
|
+
"@tamagui/build": "3.0.0-beta.719.1",
|
|
48
|
+
"react": "19.2.3",
|
|
49
49
|
"react-native": "0.86.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
package/src/createAnimations.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
|
3
3
|
import { ResetPresence, usePresence } from '@tamagui/use-presence'
|
|
4
4
|
import type {
|
|
5
5
|
AnimatedNumberStrategy,
|
|
6
|
-
|
|
6
|
+
AnimationDriverWithAnimatedNumbers,
|
|
7
7
|
TransitionProp,
|
|
8
8
|
UniversalAnimatedNumber,
|
|
9
9
|
UseAnimatedNumberReaction,
|
|
@@ -245,7 +245,7 @@ export const useAnimatedNumbersStyle = (
|
|
|
245
245
|
export function createAnimations<A extends AnimationsConfig>(
|
|
246
246
|
animations: A,
|
|
247
247
|
options?: CreateAnimationsOptions
|
|
248
|
-
):
|
|
248
|
+
): AnimationDriverWithAnimatedNumbers<A> {
|
|
249
249
|
const nativeDriver = options?.useNativeDriver ?? isFabric
|
|
250
250
|
|
|
251
251
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnimationDriverWithAnimatedNumbers, UniversalAnimatedNumber, UseAnimatedNumberReaction, UseAnimatedNumberStyle } from "@tamagui/web";
|
|
2
2
|
import { Animated, type Text, type View } from "react-native";
|
|
3
3
|
type AnimationsConfig<A extends object = any> = { [Key in keyof A] : AnimationConfig };
|
|
4
4
|
type SpringConfig = {
|
|
@@ -18,7 +18,7 @@ type RNAnimatedNum = UniversalAnimatedNumber<Animated.Value>;
|
|
|
18
18
|
export declare const useAnimatedNumberReaction: UseAnimatedNumberReaction<RNAnimatedNum>;
|
|
19
19
|
export declare const useAnimatedNumberStyle: UseAnimatedNumberStyle<RNAnimatedNum>;
|
|
20
20
|
export declare const useAnimatedNumbersStyle: (vals: RNAnimatedNum[], getStyle: (...currentValues: any[]) => any) => any;
|
|
21
|
-
export declare function createAnimations<A extends AnimationsConfig>(animations: A, options?: CreateAnimationsOptions):
|
|
21
|
+
export declare function createAnimations<A extends AnimationsConfig>(animations: A, options?: CreateAnimationsOptions): AnimationDriverWithAnimatedNumbers<A>;
|
|
22
22
|
export {};
|
|
23
23
|
|
|
24
24
|
//# sourceMappingURL=createAnimations.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAGA,cAEE,
|
|
2
|
+
"mappings": "AAGA,cAEE,oCAEA,yBACA,2BACA,8BACK;AAGP,SACE,eAGK,WACA,YACA;KAeF,iBAAiB,6BAA6B,aAAa,KAAI;KAE/D,eAAe;CAAE,OAAO;IAAa,QACxC,KACE,SAAS,uBACP,UACA,eACA,YACA,aACA,SACA,sBACA,UACA,cACA,YACA;KAID,eAAe;CAAE,MAAM;IAAa,QAAQ,SAAS;KAErD,kBAAkB,eAAe;KA+DjC,0BAA0B;CAE7B;;AAGF,OAAO,cAAM,cAAc,SAAS,yBAAyB;AAC7D,OAAO,cAAM,cAAc,SAAS,yBAAyB;AAE7D,OAAO,iBAAS,kBACd,kBACC,wBAAwB,SAAS;KA2D/B,gBAAgB,wBAAwB,SAAS;AAEtD,OAAO,cAAM,2BAA2B,0BAA0B;AAgBlE,OAAO,cAAM,wBAAwB,uBAAuB;AAiC5D,OAAO,cAAM,0BACX,MAAM,iBACN,WAAW,GAAG;AAKhB,OAAO,iBAAS,iBAAiB,UAAU,kBACzC,YAAY,GACZ,UAAU,0BACT,mCAAmC",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/createAnimations.tsx"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"import { getEffectiveAnimation, normalizeTransition } from '@tamagui/animation-helpers'\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { ResetPresence, usePresence } from '@tamagui/use-presence'\nimport type {\n AnimatedNumberStrategy,\n AnimationDriver,\n TransitionProp,\n UniversalAnimatedNumber,\n UseAnimatedNumberReaction,\n UseAnimatedNumberStyle,\n} from '@tamagui/web'\nimport { useEvent, useThemeWithState } from '@tamagui/web'\nimport React from 'react'\nimport {\n Animated,\n processColor,\n type ColorValue,\n type Text,\n type View,\n} from 'react-native'\n\n// detect Fabric (New Architecture) — Paper doesn't support native driver for all style keys\nconst isFabric =\n !isWeb && typeof global !== 'undefined' && !!global.__nativeFabricUIManager\n\n// Helper to resolve dynamic theme values like {dynamic: {dark: \"value\", light: undefined}}\nconst resolveDynamicValue = (value: any, isDark: boolean): any => {\n if (value && typeof value === 'object' && 'dynamic' in value) {\n const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light\n return dynamicValue\n }\n return value\n}\n\ntype AnimationsConfig<A extends object = any> = { [Key in keyof A]: AnimationConfig }\n\ntype SpringConfig = { type?: 'spring' } & Partial<\n Pick<\n Animated.SpringAnimationConfig,\n | 'delay'\n | 'bounciness'\n | 'damping'\n | 'friction'\n | 'mass'\n | 'overshootClamping'\n | 'speed'\n | 'stiffness'\n | 'tension'\n | 'velocity'\n >\n>\n\ntype TimingConfig = { type: 'timing' } & Partial<Animated.TimingAnimationConfig>\n\ntype AnimationConfig = SpringConfig | TimingConfig\n\nconst animatedStyleKey = {\n transform: true,\n opacity: true,\n}\n\nconst colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true,\n}\n\n// layout dimension keys. these must run on the JS driver (useNativeDriver:false)\n// because the native animated module can't drive layout props.\nconst layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true,\n}\n\nfunction hasAnimatedLayoutKey(\n style: Record<string, any>,\n isDark: boolean,\n animateOnly?: string[]\n) {\n for (const key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue\n if (typeof resolveDynamicValue(style[key], isDark) === 'number') return true\n }\n return false\n}\n\n// Only colors accepted by RN's own parser can enter interpolation. CSS-wide\n// keywords, unresolved tokens, var()/calc(), and empty strings otherwise reach\n// createInterpolationFromStringOutputRange / mapStringToNumericComponents and\n// throw. Those values must be applied as static styles.\nfunction isAnimatableColor(value: unknown): value is string {\n return typeof value === 'string' && processColor(value as ColorValue) != null\n}\n\n// these style keys are costly to animate and only work with native driver on Fabric\nconst costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey,\n}\n\ntype CreateAnimationsOptions = {\n // override native driver detection (default: auto-detect Fabric)\n useNativeDriver?: boolean\n}\n\nexport const AnimatedView: Animated.AnimatedComponent<typeof View> = Animated.View\nexport const AnimatedText: Animated.AnimatedComponent<typeof Text> = Animated.Text\n\nexport function useAnimatedNumber(\n initial: number\n): UniversalAnimatedNumber<Animated.Value> {\n const state = React.useRef(\n null as any as {\n val: Animated.Value\n composite: Animated.CompositeAnimation | null\n strategy: AnimatedNumberStrategy\n }\n )\n if (!state.current) {\n state.current = {\n composite: null,\n val: new Animated.Value(initial),\n strategy: { type: 'spring' },\n }\n }\n\n return {\n getInstance() {\n return state.current.val\n },\n getValue() {\n return state.current.val['_value']\n },\n stop() {\n state.current.composite?.stop()\n state.current.composite = null\n },\n setValue(next: number, { type, ...config } = { type: 'spring' }, onFinish) {\n const val = state.current.val\n\n const handleFinish = onFinish\n ? ({ finished }) => (finished ? onFinish() : null)\n : undefined\n\n if (type === 'direct') {\n val.setValue(next)\n } else if (type === 'spring') {\n state.current.composite?.stop()\n const composite = Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric,\n })\n composite.start(handleFinish)\n state.current.composite = composite\n } else {\n state.current.composite?.stop()\n const composite = Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric,\n })\n composite.start(handleFinish)\n state.current.composite = composite\n }\n },\n }\n}\n\ntype RNAnimatedNum = UniversalAnimatedNumber<Animated.Value>\n\nexport const useAnimatedNumberReaction: UseAnimatedNumberReaction<RNAnimatedNum> = (\n { value },\n onValue\n) => {\n const onChange = useEvent((current) => {\n onValue(current.value)\n })\n\n React.useEffect(() => {\n const id = value.getInstance().addListener(onChange)\n return () => {\n value.getInstance().removeListener(id)\n }\n }, [value, onChange])\n}\n\nexport const useAnimatedNumberStyle: UseAnimatedNumberStyle<RNAnimatedNum> = (\n value,\n getStyle\n) => {\n const instance = value.getInstance()\n const animatedStyle = getStyle(instance)\n const usesAnimatedNode = hasAnimatedNode(animatedStyle)\n const [current, setCurrent] = React.useState(value.getValue())\n\n // preserve the native animated-node path for direct mappings. callbacks\n // that do arithmetic require numeric values, so drive those through the\n // value listener and render the computed style.\n React.useEffect(() => {\n if (usesAnimatedNode) return\n\n const id = instance.addListener(({ value: next }) => {\n setCurrent(next)\n })\n return () => {\n instance.removeListener(id)\n }\n }, [instance, usesAnimatedNode])\n\n return usesAnimatedNode ? animatedStyle : getStyle(current)\n}\n\nfunction hasAnimatedNode(value: unknown): boolean {\n if (!value || typeof value !== 'object') return false\n if (typeof (value as any).__getValue === 'function') return true\n if (Array.isArray(value)) return value.some(hasAnimatedNode)\n return Object.values(value).some(hasAnimatedNode)\n}\n\nexport const useAnimatedNumbersStyle = (\n vals: RNAnimatedNum[],\n getStyle: (...currentValues: any[]) => any\n): any => {\n return getStyle(...vals.map((v) => v.getInstance()))\n}\n\nexport function createAnimations<A extends AnimationsConfig>(\n animations: A,\n options?: CreateAnimationsOptions\n): AnimationDriver<A> {\n const nativeDriver = options?.useNativeDriver ?? isFabric\n\n return {\n isReactNative: true,\n inputStyle: 'value',\n outputStyle: 'inline',\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence,\n ResetPresence,\n useAnimations: ({\n props,\n onTransition,\n style,\n componentState,\n presence,\n stateRef,\n useStyleEmitter,\n }) => {\n const isDisabled = isWeb && componentState.unmounted === true\n const isExiting = presence?.[0] === false\n const sendExitComplete = presence?.[1]\n const onTransitionRef = React.useRef(onTransition)\n onTransitionRef.current = onTransition\n const emit = (\n phase: 'start' | 'end',\n cause: 'enter' | 'exit' | 'update',\n finished?: boolean\n ) => {\n onTransitionRef.current?.(\n phase === 'end' ? { phase, cause, finished } : { phase, cause }\n )\n }\n const [, themeState] = useThemeWithState({})\n // Check scheme first, then fall back to checking theme name for 'dark'\n const isDark = themeState?.scheme === 'dark' || themeState?.name?.startsWith('dark')\n\n /** store Animated value of each key e.g: color: AnimatedValue */\n const animateStyles = React.useRef<Record<string, Animated.Value>>({})\n const animatedTranforms = React.useRef<{ [key: string]: Animated.Value }[]>([])\n const animationsState = React.useRef(\n new WeakMap<\n Animated.Value,\n {\n interpolation: Animated.AnimatedInterpolation<any>\n current?: number | string | undefined\n // only for colors\n animateToValue?: number\n }\n >()\n )\n const pseudoActiveRef = React.useRef(false)\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\n // onTransition lifecycle bookkeeping\n const enterStartedRef = React.useRef(false)\n const exitStartedRef = React.useRef(false)\n const updateInFlightRef = React.useRef(false)\n const updateCycleIdRef = React.useRef(0)\n const prevStyleSigRef = React.useRef<string | null>(null)\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 // invalidate pending callbacks when exit is canceled/interrupted\n if (justStoppedExiting) {\n exitCycleIdRef.current++\n }\n\n const animateOnly = (props.animateOnly as string[]) || []\n const hasTransitionOnly = !!props.animateOnly\n\n // Track if we just finished entering (transition from entering to not entering)\n // must be declared before args array that uses justFinishedEntering\n const isEntering = !!componentState.unmounted\n const wasEnteringRef = React.useRef(isEntering)\n const justFinishedEntering = wasEnteringRef.current && !isEntering\n React.useEffect(() => {\n wasEnteringRef.current = isEntering\n })\n\n const args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly,\n ]\n\n const res = React.useMemo(() => {\n const runners: Function[] = []\n const completions: Promise<void>[] = []\n\n // Determine animation state for enter/exit transitions\n // Use 'enter' if we're entering OR if we just finished entering\n const animationState: 'enter' | 'exit' | 'default' = isExiting\n ? 'exit'\n : isEntering || justFinishedEntering\n ? 'enter'\n : 'default'\n\n const nonAnimatedStyle = {}\n // animatedStyle owns every Animated.Value on the node. Fabric cannot mix\n // native- and JS-driven values inside that shared graph, so one layout\n // animation makes the whole node use the JS driver.\n const useNativeDriverForNode =\n nativeDriver &&\n !hasAnimatedLayoutKey(\n style,\n isDark,\n hasTransitionOnly ? animateOnly : undefined\n )\n\n // track which animated keys/transforms the incoming style actually\n // carries this pass, so entries that left the style can be dropped\n // below (an Animated.Value that persisted forever would keep painting\n // a stale pixel value, e.g. a released-to-auto accordion height)\n const seenAnimateKeys = new Set<string>()\n let sawTransform = false\n let transformCount = 0\n\n for (const key in style) {\n const rawVal = style[key]\n // Resolve dynamic theme values from flat theme clauses.\n const val = resolveDynamicValue(rawVal, isDark)\n if (val === undefined) continue\n\n if (isDisabled) {\n continue\n }\n\n if (\n animatedStyleKey[key] == null &&\n !costlyToAnimateStyleKey[key] &&\n !layoutStyleKey[key]\n ) {\n nonAnimatedStyle[key] = val\n continue\n }\n\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val\n continue\n }\n\n // layout dimension keys only animate numbers — 'auto' (an open\n // accordion at rest) and percent strings apply as static styles\n if (layoutStyleKey[key] && typeof val !== 'number') {\n nonAnimatedStyle[key] = val\n continue\n }\n\n // unparseable colors crash RN\n // interpolation — apply them as a static style instead\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val\n continue\n }\n\n if (key !== 'transform') {\n animateStyles.current[key] = update(key, animateStyles.current[key], val)\n seenAnimateKeys.add(key)\n continue\n }\n // key: 'transform'\n // for now just support one transform key\n if (!val) continue\n if (typeof val === 'string') {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`)\n continue\n }\n\n sawTransform = true\n for (const transform of val) {\n if (!transform) continue\n const index = transformCount++\n // tkey: e.g: 'translateX'\n const tkey = Object.keys(transform)[0]\n const currentTransform = animatedTranforms.current[index]?.[tkey]\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey]),\n }\n animatedTranforms.current = [...animatedTranforms.current]\n }\n }\n\n // drop stale Animated.Values whose keys left the incoming style, so the\n // key genuinely leaves the rendered style object (a released height goes\n // back to auto instead of staying pinned at its last pixel value). skip\n // while exiting (presence still animates the leaving keys) and while\n // disabled (the loop above intentionally skips every key). an active\n // pseudo owns the current emitted style until its matching release.\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (const k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k]\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = []\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount)\n }\n }\n\n const animatedTransformStyle =\n animatedTranforms.current.length > 0\n ? {\n transform: animatedTranforms.current.map((r) => {\n const key = Object.keys(r)[0]\n const val =\n animationsState.current!.get(r[key])?.interpolation || r[key]\n return { [key]: val }\n }),\n }\n : {}\n\n const animatedStyle = {\n ...Object.fromEntries(\n Object.entries(animateStyles.current).map(([k, v]) => [\n k,\n animationsState.current!.get(v)?.interpolation || v,\n ])\n ),\n ...animatedTransformStyle,\n }\n\n return {\n runners,\n completions,\n style: [nonAnimatedStyle, animatedStyle],\n }\n\n function update(\n key: string,\n animated: Animated.Value | undefined,\n valIn: string | number\n ) {\n const isColorStyleKey = colorStyleKey[key]\n const [val, type] = isColorStyleKey ? [0, undefined] : getValue(valIn)\n let animateToValue = val\n const value = animated || new Animated.Value(val)\n const curInterpolation = animationsState.current.get(value)\n\n let interpolateArgs: any\n if (type) {\n interpolateArgs = getInterpolated(\n curInterpolation?.current ?? value['_value'],\n val,\n type\n )\n animationsState.current!.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val,\n })\n }\n\n if (isColorStyleKey) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1\n interpolateArgs = getColorInterpolated(\n curInterpolation?.current as string,\n // valIn is the next color\n valIn as string,\n animateToValue\n )\n animationsState.current!.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1,\n })\n }\n\n if (value) {\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n animationState\n )\n\n let resolve\n const promise = new Promise<void>((res) => {\n resolve = res\n })\n completions.push(promise)\n\n runners.push(() => {\n value.stopAnimation()\n\n function getAnimation() {\n return Animated[animationConfig.type || 'spring'](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode,\n })\n }\n\n const animation = animationConfig.delay\n ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n getAnimation(),\n ])\n : getAnimation()\n\n animation.start(({ finished }) => {\n // always resolve during exit (element is leaving anyway)\n // for non-exit, only resolve on successful completion\n if (finished || isExiting) {\n resolve()\n }\n })\n })\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug'] === 'verbose') {\n // prettier-ignore\n console.info(\n ' 💠 animate',\n key,\n `from (${value['_value']}) to`,\n valIn,\n `(${val})`,\n 'type',\n type,\n 'interpolate',\n interpolateArgs\n )\n }\n }\n return value\n }\n }, args)\n\n // track previous exiting state\n React.useEffect(() => {\n wasExitingRef.current = isExiting\n })\n\n // exit interrupted by a re-enter: report the exit as finished:false\n useIsomorphicLayoutEffect(() => {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false\n emit('end', 'exit', false)\n }\n }, [justStoppedExiting])\n\n useIsomorphicLayoutEffect(() => {\n res.runners.forEach((r) => r())\n\n // capture current cycle id\n const cycleId = exitCycleIdRef.current\n\n const cause: 'enter' | 'exit' | 'update' = isExiting\n ? 'exit'\n : isEntering || justFinishedEntering\n ? 'enter'\n : 'update'\n\n // interruptions: an enter or update still in flight when exit begins is\n // reported as finished:false (its own completion promise won't resolve\n // because the animation was stopped, not finished).\n if (cause === 'exit') {\n if (enterStartedRef.current) {\n enterStartedRef.current = false\n emit('end', 'enter', false)\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false\n updateCycleIdRef.current++\n emit('end', 'update', false)\n }\n }\n\n // in-place update: a genuine style change while mounted (not entering or\n // exiting). guard on the style signature so lifecycle-only re-renders\n // don't register as updates.\n if (cause === 'update') {\n const sig = args[0] as string\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig\n return\n }\n prevStyleSigRef.current = sig\n if (res.completions.length === 0) return\n if (updateInFlightRef.current) {\n // superseded before finishing\n emit('end', 'update', false)\n }\n updateInFlightRef.current = true\n const uid = ++updateCycleIdRef.current\n emit('start', 'update')\n Promise.all(res.completions).then(() => {\n if (uid !== updateCycleIdRef.current) return\n updateInFlightRef.current = false\n emit('end', 'update', true)\n })\n return\n }\n\n // keep the update signature current while entering/exiting\n prevStyleSigRef.current = args[0] as string\n\n // handle zero-completion case immediately (enter/exit report a pair)\n if (res.completions.length === 0) {\n emit('start', cause)\n emit('end', cause, true)\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true\n sendExitComplete?.()\n }\n return\n }\n\n // enter/exit start (once per cycle; re-runs continue the same animation)\n if (cause === 'enter' && !enterStartedRef.current) {\n enterStartedRef.current = true\n emit('start', 'enter')\n }\n if (cause === 'exit' && !exitStartedRef.current) {\n exitStartedRef.current = true\n emit('start', 'exit')\n }\n\n Promise.all(res.completions).then(() => {\n // guard against stale cycle completion\n if (isExiting && cycleId !== exitCycleIdRef.current) return\n if (isExiting && exitCompletedRef.current) return\n\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false\n // exit 'end' fires immediately before presence safeToRemove\n emit('end', 'exit', true)\n }\n exitCompletedRef.current = true\n sendExitComplete?.()\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false\n emit('end', 'enter', true)\n }\n })\n }, args)\n\n // avoidReRenders: receive style changes imperatively from tamagui\n // and update Animated.Values directly without React re-renders\n // reuses the same update() + runner pattern as the useMemo path\n useStyleEmitter?.((nextStyle, _effectiveTransition, pseudoActive) => {\n pseudoActiveRef.current = pseudoActive === true\n const runners: Function[] = []\n const seenAnimateKeys = new Set<string>()\n let transformCount = 0\n let animatedShapeChanged = false\n // nextStyle is the complete style for this node, so the emitter makes\n // the same single driver decision as the render path. include the\n // currently rendered graph because its stale keys are not removed until\n // the structural-change commit below.\n const useNativeDriverForNode =\n nativeDriver &&\n !hasAnimatedLayoutKey(nextStyle, isDark) &&\n !Object.keys(animateStyles.current).some((key) => layoutStyleKey[key])\n\n for (const key in nextStyle) {\n const rawVal = nextStyle[key]\n const val = resolveDynamicValue(rawVal, isDark)\n if (val === undefined) continue\n\n if (key === 'transform' && Array.isArray(val)) {\n for (const transform of val) {\n if (!transform) continue\n const index = transformCount++\n const tkey = Object.keys(transform)[0]\n const currentTransform = animatedTranforms.current[index]?.[tkey]\n if (!currentTransform) animatedShapeChanged = true\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey]),\n }\n }\n } else if (\n animatedStyleKey[key] != null ||\n costlyToAnimateStyleKey[key] ||\n layoutStyleKey[key]\n ) {\n // layout keys only animate numbers ('auto'/percents are static);\n // unparseable themed colors can't be interpolated — skip both and\n // let the next render apply them statically\n if (layoutStyleKey[key] && typeof val !== 'number') continue\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue\n if (!animateStyles.current[key]) animatedShapeChanged = true\n animateStyles.current[key] = update(key, animateStyles.current[key], val)\n seenAnimateKeys.add(key)\n }\n }\n\n // the emitter receives a complete style. keep the Animated style graph\n // equally complete, including a pseudo release that omits a pseudo-only\n // key. React Native needs a commit when that graph's shape changes.\n for (const key in animateStyles.current) {\n if (!seenAnimateKeys.has(key)) {\n delete animateStyles.current[key]\n animatedShapeChanged = true\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount)\n animatedShapeChanged = true\n }\n\n // run the queued animations immediately\n runners.forEach((r) => r())\n\n // pseudo state normally stays on the avoidReRenders path. adding or\n // removing a style key cannot be expressed by an existing Animated.Value,\n // so commit the pending state only for that structural change.\n if (animatedShapeChanged && stateRef.current.nextState) {\n stateRef.current.baseSetStateShallow?.(stateRef.current.nextState)\n }\n\n function update(\n key: string,\n animated: Animated.Value | undefined,\n valIn: string | number\n ) {\n const isColor = colorStyleKey[key]\n const [numVal, type] = isColor ? [0, undefined] : getValue(valIn)\n let animateToValue = numVal\n const value = animated || new Animated.Value(numVal)\n const curInterpolation = animationsState.current.get(value)\n\n if (type) {\n animationsState.current.set(value, {\n interpolation: value.interpolate(\n getInterpolated(\n curInterpolation?.current ?? value['_value'],\n numVal,\n type\n )\n ),\n current: numVal,\n })\n }\n\n if (isColor) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(\n getColorInterpolated(\n curInterpolation?.current as string,\n valIn as string,\n animateToValue\n )\n ),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1,\n })\n }\n\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n 'default'\n )\n runners.push(() => {\n value.stopAnimation()\n const anim = Animated[animationConfig.type || 'spring'](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode,\n })\n ;(animationConfig.delay\n ? Animated.sequence([Animated.delay(animationConfig.delay), anim])\n : anim\n ).start()\n })\n\n return value\n }\n })\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug'] === 'verbose') {\n console.info(`Animated`, { response: res, inputStyle: style, isExiting })\n }\n }\n\n return res\n },\n }\n}\n\nfunction getColorInterpolated(\n currentColor: string | undefined,\n nextColor: string,\n animateToValue: number\n) {\n const inputRange = [0, 1]\n const outputRange = [currentColor ? currentColor : nextColor, nextColor]\n if (animateToValue === 0) {\n // because we are animating from value 1 to 0, we need to put target color at the beginning\n outputRange.reverse()\n }\n return {\n inputRange,\n outputRange,\n }\n}\n\nfunction getInterpolated(current: number, next: number, postfix = 'deg') {\n if (next === current) {\n current = next - 0.000000001\n }\n const inputRange = [current, next]\n const outputRange = [`${current}${postfix}`, `${next}${postfix}`]\n if (next < current) {\n inputRange.reverse()\n outputRange.reverse()\n }\n return {\n inputRange,\n outputRange,\n }\n}\n\nfunction getAnimationConfig(\n key: string,\n animations: AnimationsConfig,\n transition?: TransitionProp,\n animationState: 'enter' | 'exit' | 'default' = 'default'\n): AnimationConfig {\n const normalized = normalizeTransition(transition)\n const shortKey = transformShorthands[key]\n\n // Check for property-specific animation\n const propAnimation = normalized.properties[key] ?? normalized.properties[shortKey]\n\n let animationType: string | null = null\n let extraConf: any = {}\n\n if (typeof propAnimation === 'string') {\n // Direct animation name: { x: 'quick' }\n animationType = propAnimation\n } else if (propAnimation && typeof propAnimation === 'object') {\n // Config object: { x: { type: 'quick', delay: 100 } }\n // Use effective animation based on state if no explicit type in config\n animationType =\n propAnimation.type || getEffectiveAnimation(normalized, animationState)\n extraConf = propAnimation\n } else {\n // Fall back to effective animation based on state (enter/exit/default)\n animationType = getEffectiveAnimation(normalized, animationState)\n }\n\n // Apply global delay if no property-specific delay\n if (normalized.delay && !extraConf.delay) {\n extraConf = { ...extraConf, delay: normalized.delay }\n }\n\n const found = animationType ? animations[animationType] : {}\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf,\n }\n}\n\n// try both combos\nconst transformShorthands = {\n x: 'translateX',\n y: 'translateY',\n translateX: 'x',\n translateY: 'y',\n}\n\nfunction getValue(input: number | string, isColor = false) {\n if (typeof input !== 'string') {\n return [input] as const\n }\n // the unit is optional: unitless numbers reach here as strings (scale, and\n // any bare token value), and the number may be fractional. matching only\n // `[-0-9]+` followed by a required unit read \"1.5deg\" as 5 and gave NaN for\n // \"0.95\", and an Animated animation toward NaN never calls its completion\n // callback, which strands whatever waits on it.\n const [_, number, after] = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/) ?? []\n return [+number, after] as const\n}\n"
|
|
9
|
+
"import { getEffectiveAnimation, normalizeTransition } from '@tamagui/animation-helpers'\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { ResetPresence, usePresence } from '@tamagui/use-presence'\nimport type {\n AnimatedNumberStrategy,\n AnimationDriverWithAnimatedNumbers,\n TransitionProp,\n UniversalAnimatedNumber,\n UseAnimatedNumberReaction,\n UseAnimatedNumberStyle,\n} from '@tamagui/web'\nimport { useEvent, useThemeWithState } from '@tamagui/web'\nimport React from 'react'\nimport {\n Animated,\n processColor,\n type ColorValue,\n type Text,\n type View,\n} from 'react-native'\n\n// detect Fabric (New Architecture) — Paper doesn't support native driver for all style keys\nconst isFabric =\n !isWeb && typeof global !== 'undefined' && !!global.__nativeFabricUIManager\n\n// Helper to resolve dynamic theme values like {dynamic: {dark: \"value\", light: undefined}}\nconst resolveDynamicValue = (value: any, isDark: boolean): any => {\n if (value && typeof value === 'object' && 'dynamic' in value) {\n const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light\n return dynamicValue\n }\n return value\n}\n\ntype AnimationsConfig<A extends object = any> = { [Key in keyof A]: AnimationConfig }\n\ntype SpringConfig = { type?: 'spring' } & Partial<\n Pick<\n Animated.SpringAnimationConfig,\n | 'delay'\n | 'bounciness'\n | 'damping'\n | 'friction'\n | 'mass'\n | 'overshootClamping'\n | 'speed'\n | 'stiffness'\n | 'tension'\n | 'velocity'\n >\n>\n\ntype TimingConfig = { type: 'timing' } & Partial<Animated.TimingAnimationConfig>\n\ntype AnimationConfig = SpringConfig | TimingConfig\n\nconst animatedStyleKey = {\n transform: true,\n opacity: true,\n}\n\nconst colorStyleKey = {\n backgroundColor: true,\n color: true,\n borderColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderBottomColor: true,\n}\n\n// layout dimension keys. these must run on the JS driver (useNativeDriver:false)\n// because the native animated module can't drive layout props.\nconst layoutStyleKey = {\n height: true,\n width: true,\n minHeight: true,\n maxHeight: true,\n minWidth: true,\n maxWidth: true,\n}\n\nfunction hasAnimatedLayoutKey(\n style: Record<string, any>,\n isDark: boolean,\n animateOnly?: string[]\n) {\n for (const key in layoutStyleKey) {\n if (animateOnly && !animateOnly.includes(key)) continue\n if (typeof resolveDynamicValue(style[key], isDark) === 'number') return true\n }\n return false\n}\n\n// Only colors accepted by RN's own parser can enter interpolation. CSS-wide\n// keywords, unresolved tokens, var()/calc(), and empty strings otherwise reach\n// createInterpolationFromStringOutputRange / mapStringToNumericComponents and\n// throw. Those values must be applied as static styles.\nfunction isAnimatableColor(value: unknown): value is string {\n return typeof value === 'string' && processColor(value as ColorValue) != null\n}\n\n// these style keys are costly to animate and only work with native driver on Fabric\nconst costlyToAnimateStyleKey = {\n borderRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderTopWidth: true,\n borderBottomWidth: true,\n ...colorStyleKey,\n}\n\ntype CreateAnimationsOptions = {\n // override native driver detection (default: auto-detect Fabric)\n useNativeDriver?: boolean\n}\n\nexport const AnimatedView: Animated.AnimatedComponent<typeof View> = Animated.View\nexport const AnimatedText: Animated.AnimatedComponent<typeof Text> = Animated.Text\n\nexport function useAnimatedNumber(\n initial: number\n): UniversalAnimatedNumber<Animated.Value> {\n const state = React.useRef(\n null as any as {\n val: Animated.Value\n composite: Animated.CompositeAnimation | null\n strategy: AnimatedNumberStrategy\n }\n )\n if (!state.current) {\n state.current = {\n composite: null,\n val: new Animated.Value(initial),\n strategy: { type: 'spring' },\n }\n }\n\n return {\n getInstance() {\n return state.current.val\n },\n getValue() {\n return state.current.val['_value']\n },\n stop() {\n state.current.composite?.stop()\n state.current.composite = null\n },\n setValue(next: number, { type, ...config } = { type: 'spring' }, onFinish) {\n const val = state.current.val\n\n const handleFinish = onFinish\n ? ({ finished }) => (finished ? onFinish() : null)\n : undefined\n\n if (type === 'direct') {\n val.setValue(next)\n } else if (type === 'spring') {\n state.current.composite?.stop()\n const composite = Animated.spring(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric,\n })\n composite.start(handleFinish)\n state.current.composite = composite\n } else {\n state.current.composite?.stop()\n const composite = Animated.timing(val, {\n ...config,\n toValue: next,\n useNativeDriver: isFabric,\n })\n composite.start(handleFinish)\n state.current.composite = composite\n }\n },\n }\n}\n\ntype RNAnimatedNum = UniversalAnimatedNumber<Animated.Value>\n\nexport const useAnimatedNumberReaction: UseAnimatedNumberReaction<RNAnimatedNum> = (\n { value },\n onValue\n) => {\n const onChange = useEvent((current) => {\n onValue(current.value)\n })\n\n React.useEffect(() => {\n const id = value.getInstance().addListener(onChange)\n return () => {\n value.getInstance().removeListener(id)\n }\n }, [value, onChange])\n}\n\nexport const useAnimatedNumberStyle: UseAnimatedNumberStyle<RNAnimatedNum> = (\n value,\n getStyle\n) => {\n const instance = value.getInstance()\n const animatedStyle = getStyle(instance)\n const usesAnimatedNode = hasAnimatedNode(animatedStyle)\n const [current, setCurrent] = React.useState(value.getValue())\n\n // preserve the native animated-node path for direct mappings. callbacks\n // that do arithmetic require numeric values, so drive those through the\n // value listener and render the computed style.\n React.useEffect(() => {\n if (usesAnimatedNode) return\n\n const id = instance.addListener(({ value: next }) => {\n setCurrent(next)\n })\n return () => {\n instance.removeListener(id)\n }\n }, [instance, usesAnimatedNode])\n\n return usesAnimatedNode ? animatedStyle : getStyle(current)\n}\n\nfunction hasAnimatedNode(value: unknown): boolean {\n if (!value || typeof value !== 'object') return false\n if (typeof (value as any).__getValue === 'function') return true\n if (Array.isArray(value)) return value.some(hasAnimatedNode)\n return Object.values(value).some(hasAnimatedNode)\n}\n\nexport const useAnimatedNumbersStyle = (\n vals: RNAnimatedNum[],\n getStyle: (...currentValues: any[]) => any\n): any => {\n return getStyle(...vals.map((v) => v.getInstance()))\n}\n\nexport function createAnimations<A extends AnimationsConfig>(\n animations: A,\n options?: CreateAnimationsOptions\n): AnimationDriverWithAnimatedNumbers<A> {\n const nativeDriver = options?.useNativeDriver ?? isFabric\n\n return {\n isReactNative: true,\n inputStyle: 'value',\n outputStyle: 'inline',\n avoidReRenders: true,\n animations,\n needsCustomComponent: true,\n View: AnimatedView,\n Text: AnimatedText,\n useAnimatedNumber,\n useAnimatedNumberReaction,\n useAnimatedNumberStyle,\n useAnimatedNumbersStyle,\n usePresence,\n ResetPresence,\n useAnimations: ({\n props,\n onTransition,\n style,\n componentState,\n presence,\n stateRef,\n useStyleEmitter,\n }) => {\n const isDisabled = isWeb && componentState.unmounted === true\n const isExiting = presence?.[0] === false\n const sendExitComplete = presence?.[1]\n const onTransitionRef = React.useRef(onTransition)\n onTransitionRef.current = onTransition\n const emit = (\n phase: 'start' | 'end',\n cause: 'enter' | 'exit' | 'update',\n finished?: boolean\n ) => {\n onTransitionRef.current?.(\n phase === 'end' ? { phase, cause, finished } : { phase, cause }\n )\n }\n const [, themeState] = useThemeWithState({})\n // Check scheme first, then fall back to checking theme name for 'dark'\n const isDark = themeState?.scheme === 'dark' || themeState?.name?.startsWith('dark')\n\n /** store Animated value of each key e.g: color: AnimatedValue */\n const animateStyles = React.useRef<Record<string, Animated.Value>>({})\n const animatedTranforms = React.useRef<{ [key: string]: Animated.Value }[]>([])\n const animationsState = React.useRef(\n new WeakMap<\n Animated.Value,\n {\n interpolation: Animated.AnimatedInterpolation<any>\n current?: number | string | undefined\n // only for colors\n animateToValue?: number\n }\n >()\n )\n const pseudoActiveRef = React.useRef(false)\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\n // onTransition lifecycle bookkeeping\n const enterStartedRef = React.useRef(false)\n const exitStartedRef = React.useRef(false)\n const updateInFlightRef = React.useRef(false)\n const updateCycleIdRef = React.useRef(0)\n const prevStyleSigRef = React.useRef<string | null>(null)\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 // invalidate pending callbacks when exit is canceled/interrupted\n if (justStoppedExiting) {\n exitCycleIdRef.current++\n }\n\n const animateOnly = (props.animateOnly as string[]) || []\n const hasTransitionOnly = !!props.animateOnly\n\n // Track if we just finished entering (transition from entering to not entering)\n // must be declared before args array that uses justFinishedEntering\n const isEntering = !!componentState.unmounted\n const wasEnteringRef = React.useRef(isEntering)\n const justFinishedEntering = wasEnteringRef.current && !isEntering\n React.useEffect(() => {\n wasEnteringRef.current = isEntering\n })\n\n const args = [\n JSON.stringify(style),\n componentState,\n isExiting,\n !!onTransition,\n isDark,\n justFinishedEntering,\n hasTransitionOnly,\n ]\n\n const res = React.useMemo(() => {\n const runners: Function[] = []\n const completions: Promise<void>[] = []\n\n // Determine animation state for enter/exit transitions\n // Use 'enter' if we're entering OR if we just finished entering\n const animationState: 'enter' | 'exit' | 'default' = isExiting\n ? 'exit'\n : isEntering || justFinishedEntering\n ? 'enter'\n : 'default'\n\n const nonAnimatedStyle = {}\n // animatedStyle owns every Animated.Value on the node. Fabric cannot mix\n // native- and JS-driven values inside that shared graph, so one layout\n // animation makes the whole node use the JS driver.\n const useNativeDriverForNode =\n nativeDriver &&\n !hasAnimatedLayoutKey(\n style,\n isDark,\n hasTransitionOnly ? animateOnly : undefined\n )\n\n // track which animated keys/transforms the incoming style actually\n // carries this pass, so entries that left the style can be dropped\n // below (an Animated.Value that persisted forever would keep painting\n // a stale pixel value, e.g. a released-to-auto accordion height)\n const seenAnimateKeys = new Set<string>()\n let sawTransform = false\n let transformCount = 0\n\n for (const key in style) {\n const rawVal = style[key]\n // Resolve dynamic theme values from flat theme clauses.\n const val = resolveDynamicValue(rawVal, isDark)\n if (val === undefined) continue\n\n if (isDisabled) {\n continue\n }\n\n if (\n animatedStyleKey[key] == null &&\n !costlyToAnimateStyleKey[key] &&\n !layoutStyleKey[key]\n ) {\n nonAnimatedStyle[key] = val\n continue\n }\n\n if (hasTransitionOnly && !animateOnly.includes(key)) {\n nonAnimatedStyle[key] = val\n continue\n }\n\n // layout dimension keys only animate numbers — 'auto' (an open\n // accordion at rest) and percent strings apply as static styles\n if (layoutStyleKey[key] && typeof val !== 'number') {\n nonAnimatedStyle[key] = val\n continue\n }\n\n // unparseable colors crash RN\n // interpolation — apply them as a static style instead\n if (colorStyleKey[key] && !isAnimatableColor(val)) {\n nonAnimatedStyle[key] = val\n continue\n }\n\n if (key !== 'transform') {\n animateStyles.current[key] = update(key, animateStyles.current[key], val)\n seenAnimateKeys.add(key)\n continue\n }\n // key: 'transform'\n // for now just support one transform key\n if (!val) continue\n if (typeof val === 'string') {\n console.warn(`Warning: Tamagui can't animate string transforms yet!`)\n continue\n }\n\n sawTransform = true\n for (const transform of val) {\n if (!transform) continue\n const index = transformCount++\n // tkey: e.g: 'translateX'\n const tkey = Object.keys(transform)[0]\n const currentTransform = animatedTranforms.current[index]?.[tkey]\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey]),\n }\n animatedTranforms.current = [...animatedTranforms.current]\n }\n }\n\n // drop stale Animated.Values whose keys left the incoming style, so the\n // key genuinely leaves the rendered style object (a released height goes\n // back to auto instead of staying pinned at its last pixel value). skip\n // while exiting (presence still animates the leaving keys) and while\n // disabled (the loop above intentionally skips every key). an active\n // pseudo owns the current emitted style until its matching release.\n if (!isExiting && !isDisabled && !pseudoActiveRef.current) {\n for (const k in animateStyles.current) {\n if (!seenAnimateKeys.has(k)) delete animateStyles.current[k]\n }\n if (!sawTransform) {\n if (animatedTranforms.current.length) animatedTranforms.current = []\n } else if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount)\n }\n }\n\n const animatedTransformStyle =\n animatedTranforms.current.length > 0\n ? {\n transform: animatedTranforms.current.map((r) => {\n const key = Object.keys(r)[0]\n const val =\n animationsState.current!.get(r[key])?.interpolation || r[key]\n return { [key]: val }\n }),\n }\n : {}\n\n const animatedStyle = {\n ...Object.fromEntries(\n Object.entries(animateStyles.current).map(([k, v]) => [\n k,\n animationsState.current!.get(v)?.interpolation || v,\n ])\n ),\n ...animatedTransformStyle,\n }\n\n return {\n runners,\n completions,\n style: [nonAnimatedStyle, animatedStyle],\n }\n\n function update(\n key: string,\n animated: Animated.Value | undefined,\n valIn: string | number\n ) {\n const isColorStyleKey = colorStyleKey[key]\n const [val, type] = isColorStyleKey ? [0, undefined] : getValue(valIn)\n let animateToValue = val\n const value = animated || new Animated.Value(val)\n const curInterpolation = animationsState.current.get(value)\n\n let interpolateArgs: any\n if (type) {\n interpolateArgs = getInterpolated(\n curInterpolation?.current ?? value['_value'],\n val,\n type\n )\n animationsState.current!.set(value, {\n interpolation: value.interpolate(interpolateArgs),\n current: val,\n })\n }\n\n if (isColorStyleKey) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1\n interpolateArgs = getColorInterpolated(\n curInterpolation?.current as string,\n // valIn is the next color\n valIn as string,\n animateToValue\n )\n animationsState.current!.set(value, {\n current: valIn,\n interpolation: value.interpolate(interpolateArgs),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1,\n })\n }\n\n if (value) {\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n animationState\n )\n\n let resolve\n const promise = new Promise<void>((res) => {\n resolve = res\n })\n completions.push(promise)\n\n runners.push(() => {\n value.stopAnimation()\n\n function getAnimation() {\n return Animated[animationConfig.type || 'spring'](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode,\n })\n }\n\n const animation = animationConfig.delay\n ? Animated.sequence([\n Animated.delay(animationConfig.delay),\n getAnimation(),\n ])\n : getAnimation()\n\n animation.start(({ finished }) => {\n // always resolve during exit (element is leaving anyway)\n // for non-exit, only resolve on successful completion\n if (finished || isExiting) {\n resolve()\n }\n })\n })\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug'] === 'verbose') {\n // prettier-ignore\n console.info(\n ' 💠 animate',\n key,\n `from (${value['_value']}) to`,\n valIn,\n `(${val})`,\n 'type',\n type,\n 'interpolate',\n interpolateArgs\n )\n }\n }\n return value\n }\n }, args)\n\n // track previous exiting state\n React.useEffect(() => {\n wasExitingRef.current = isExiting\n })\n\n // exit interrupted by a re-enter: report the exit as finished:false\n useIsomorphicLayoutEffect(() => {\n if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {\n exitStartedRef.current = false\n emit('end', 'exit', false)\n }\n }, [justStoppedExiting])\n\n useIsomorphicLayoutEffect(() => {\n res.runners.forEach((r) => r())\n\n // capture current cycle id\n const cycleId = exitCycleIdRef.current\n\n const cause: 'enter' | 'exit' | 'update' = isExiting\n ? 'exit'\n : isEntering || justFinishedEntering\n ? 'enter'\n : 'update'\n\n // interruptions: an enter or update still in flight when exit begins is\n // reported as finished:false (its own completion promise won't resolve\n // because the animation was stopped, not finished).\n if (cause === 'exit') {\n if (enterStartedRef.current) {\n enterStartedRef.current = false\n emit('end', 'enter', false)\n }\n if (updateInFlightRef.current) {\n updateInFlightRef.current = false\n updateCycleIdRef.current++\n emit('end', 'update', false)\n }\n }\n\n // in-place update: a genuine style change while mounted (not entering or\n // exiting). guard on the style signature so lifecycle-only re-renders\n // don't register as updates.\n if (cause === 'update') {\n const sig = args[0] as string\n if (prevStyleSigRef.current === null || prevStyleSigRef.current === sig) {\n prevStyleSigRef.current = sig\n return\n }\n prevStyleSigRef.current = sig\n if (res.completions.length === 0) return\n if (updateInFlightRef.current) {\n // superseded before finishing\n emit('end', 'update', false)\n }\n updateInFlightRef.current = true\n const uid = ++updateCycleIdRef.current\n emit('start', 'update')\n Promise.all(res.completions).then(() => {\n if (uid !== updateCycleIdRef.current) return\n updateInFlightRef.current = false\n emit('end', 'update', true)\n })\n return\n }\n\n // keep the update signature current while entering/exiting\n prevStyleSigRef.current = args[0] as string\n\n // handle zero-completion case immediately (enter/exit report a pair)\n if (res.completions.length === 0) {\n emit('start', cause)\n emit('end', cause, true)\n if (isExiting && !exitCompletedRef.current) {\n exitCompletedRef.current = true\n sendExitComplete?.()\n }\n return\n }\n\n // enter/exit start (once per cycle; re-runs continue the same animation)\n if (cause === 'enter' && !enterStartedRef.current) {\n enterStartedRef.current = true\n emit('start', 'enter')\n }\n if (cause === 'exit' && !exitStartedRef.current) {\n exitStartedRef.current = true\n emit('start', 'exit')\n }\n\n Promise.all(res.completions).then(() => {\n // guard against stale cycle completion\n if (isExiting && cycleId !== exitCycleIdRef.current) return\n if (isExiting && exitCompletedRef.current) return\n\n if (isExiting) {\n if (exitStartedRef.current) {\n exitStartedRef.current = false\n // exit 'end' fires immediately before presence safeToRemove\n emit('end', 'exit', true)\n }\n exitCompletedRef.current = true\n sendExitComplete?.()\n } else if (enterStartedRef.current) {\n enterStartedRef.current = false\n emit('end', 'enter', true)\n }\n })\n }, args)\n\n // avoidReRenders: receive style changes imperatively from tamagui\n // and update Animated.Values directly without React re-renders\n // reuses the same update() + runner pattern as the useMemo path\n useStyleEmitter?.((nextStyle, _effectiveTransition, pseudoActive) => {\n pseudoActiveRef.current = pseudoActive === true\n const runners: Function[] = []\n const seenAnimateKeys = new Set<string>()\n let transformCount = 0\n let animatedShapeChanged = false\n // nextStyle is the complete style for this node, so the emitter makes\n // the same single driver decision as the render path. include the\n // currently rendered graph because its stale keys are not removed until\n // the structural-change commit below.\n const useNativeDriverForNode =\n nativeDriver &&\n !hasAnimatedLayoutKey(nextStyle, isDark) &&\n !Object.keys(animateStyles.current).some((key) => layoutStyleKey[key])\n\n for (const key in nextStyle) {\n const rawVal = nextStyle[key]\n const val = resolveDynamicValue(rawVal, isDark)\n if (val === undefined) continue\n\n if (key === 'transform' && Array.isArray(val)) {\n for (const transform of val) {\n if (!transform) continue\n const index = transformCount++\n const tkey = Object.keys(transform)[0]\n const currentTransform = animatedTranforms.current[index]?.[tkey]\n if (!currentTransform) animatedShapeChanged = true\n animatedTranforms.current[index] = {\n [tkey]: update(tkey, currentTransform, transform[tkey]),\n }\n }\n } else if (\n animatedStyleKey[key] != null ||\n costlyToAnimateStyleKey[key] ||\n layoutStyleKey[key]\n ) {\n // layout keys only animate numbers ('auto'/percents are static);\n // unparseable themed colors can't be interpolated — skip both and\n // let the next render apply them statically\n if (layoutStyleKey[key] && typeof val !== 'number') continue\n if (colorStyleKey[key] && !isAnimatableColor(val)) continue\n if (!animateStyles.current[key]) animatedShapeChanged = true\n animateStyles.current[key] = update(key, animateStyles.current[key], val)\n seenAnimateKeys.add(key)\n }\n }\n\n // the emitter receives a complete style. keep the Animated style graph\n // equally complete, including a pseudo release that omits a pseudo-only\n // key. React Native needs a commit when that graph's shape changes.\n for (const key in animateStyles.current) {\n if (!seenAnimateKeys.has(key)) {\n delete animateStyles.current[key]\n animatedShapeChanged = true\n }\n }\n if (animatedTranforms.current.length > transformCount) {\n animatedTranforms.current = animatedTranforms.current.slice(0, transformCount)\n animatedShapeChanged = true\n }\n\n // run the queued animations immediately\n runners.forEach((r) => r())\n\n // pseudo state normally stays on the avoidReRenders path. adding or\n // removing a style key cannot be expressed by an existing Animated.Value,\n // so commit the pending state only for that structural change.\n if (animatedShapeChanged && stateRef.current.nextState) {\n stateRef.current.baseSetStateShallow?.(stateRef.current.nextState)\n }\n\n function update(\n key: string,\n animated: Animated.Value | undefined,\n valIn: string | number\n ) {\n const isColor = colorStyleKey[key]\n const [numVal, type] = isColor ? [0, undefined] : getValue(valIn)\n let animateToValue = numVal\n const value = animated || new Animated.Value(numVal)\n const curInterpolation = animationsState.current.get(value)\n\n if (type) {\n animationsState.current.set(value, {\n interpolation: value.interpolate(\n getInterpolated(\n curInterpolation?.current ?? value['_value'],\n numVal,\n type\n )\n ),\n current: numVal,\n })\n }\n\n if (isColor) {\n animateToValue = curInterpolation?.animateToValue ? 0 : 1\n animationsState.current.set(value, {\n current: valIn,\n interpolation: value.interpolate(\n getColorInterpolated(\n curInterpolation?.current as string,\n valIn as string,\n animateToValue\n )\n ),\n animateToValue: curInterpolation?.animateToValue ? 0 : 1,\n })\n }\n\n const animationConfig = getAnimationConfig(\n key,\n animations,\n props.transition,\n 'default'\n )\n runners.push(() => {\n value.stopAnimation()\n const anim = Animated[animationConfig.type || 'spring'](value, {\n toValue: animateToValue,\n ...animationConfig,\n useNativeDriver: useNativeDriverForNode,\n })\n ;(animationConfig.delay\n ? Animated.sequence([Animated.delay(animationConfig.delay), anim])\n : anim\n ).start()\n })\n\n return value\n }\n })\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug'] === 'verbose') {\n console.info(`Animated`, { response: res, inputStyle: style, isExiting })\n }\n }\n\n return res\n },\n }\n}\n\nfunction getColorInterpolated(\n currentColor: string | undefined,\n nextColor: string,\n animateToValue: number\n) {\n const inputRange = [0, 1]\n const outputRange = [currentColor ? currentColor : nextColor, nextColor]\n if (animateToValue === 0) {\n // because we are animating from value 1 to 0, we need to put target color at the beginning\n outputRange.reverse()\n }\n return {\n inputRange,\n outputRange,\n }\n}\n\nfunction getInterpolated(current: number, next: number, postfix = 'deg') {\n if (next === current) {\n current = next - 0.000000001\n }\n const inputRange = [current, next]\n const outputRange = [`${current}${postfix}`, `${next}${postfix}`]\n if (next < current) {\n inputRange.reverse()\n outputRange.reverse()\n }\n return {\n inputRange,\n outputRange,\n }\n}\n\nfunction getAnimationConfig(\n key: string,\n animations: AnimationsConfig,\n transition?: TransitionProp,\n animationState: 'enter' | 'exit' | 'default' = 'default'\n): AnimationConfig {\n const normalized = normalizeTransition(transition)\n const shortKey = transformShorthands[key]\n\n // Check for property-specific animation\n const propAnimation = normalized.properties[key] ?? normalized.properties[shortKey]\n\n let animationType: string | null = null\n let extraConf: any = {}\n\n if (typeof propAnimation === 'string') {\n // Direct animation name: { x: 'quick' }\n animationType = propAnimation\n } else if (propAnimation && typeof propAnimation === 'object') {\n // Config object: { x: { type: 'quick', delay: 100 } }\n // Use effective animation based on state if no explicit type in config\n animationType =\n propAnimation.type || getEffectiveAnimation(normalized, animationState)\n extraConf = propAnimation\n } else {\n // Fall back to effective animation based on state (enter/exit/default)\n animationType = getEffectiveAnimation(normalized, animationState)\n }\n\n // Apply global delay if no property-specific delay\n if (normalized.delay && !extraConf.delay) {\n extraConf = { ...extraConf, delay: normalized.delay }\n }\n\n const found = animationType ? animations[animationType] : {}\n return {\n ...found,\n // Apply global spring config overrides (from transition={['bouncy', { stiffness: 1000 }]})\n ...normalized.config,\n // Property-specific config takes highest precedence\n ...extraConf,\n }\n}\n\n// try both combos\nconst transformShorthands = {\n x: 'translateX',\n y: 'translateY',\n translateX: 'x',\n translateY: 'y',\n}\n\nfunction getValue(input: number | string, isColor = false) {\n if (typeof input !== 'string') {\n return [input] as const\n }\n // the unit is optional: unitless numbers reach here as strings (scale, and\n // any bare token value), and the number may be fractional. matching only\n // `[-0-9]+` followed by a required unit read \"1.5deg\" as 5 and gave NaN for\n // \"0.95\", and an Animated animation toward NaN never calls its completion\n // callback, which strands whatever waits on it.\n const [_, number, after] = input.match(/(-?(?:\\d+\\.?\\d*|\\.\\d+))(deg|%|px)?/) ?? []\n return [+number, after] as const\n}\n"
|
|
10
10
|
]
|
|
11
11
|
}
|