@tamagui/animations-motion 3.0.0-beta.924.1 → 3.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"createAnimations.js","names":["animateMotionValue"],"sources":["esm/createAnimations.js"],"sourcesContent":["import { getEffectiveAnimation, normalizeTransition } from \"@tamagui/animation-helpers\";\nimport { ResetPresence, usePresence } from \"@tamagui/use-presence\";\nimport {\n getConfig,\n getSplitStyles,\n hooks,\n nonAnimatableStyleProps,\n Text,\n useComposedRefs,\n useIsomorphicLayoutEffect,\n View,\n createRefComponent\n} from \"@tamagui/web\";\nimport {\n fixStyles,\n normalizeValueWithProperty,\n styleToCSS,\n transformsToString,\n useThemeWithState\n} from \"@tamagui/web/internal-runtime\";\nimport {\n animate as animateMotionValue,\n motionValue,\n useAnimate,\n useMotionValue,\n useMotionValueEvent\n} from \"motion/react\";\nimport React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst isServer = typeof window === \"undefined\";\nfunction useAnimateSSRSafe() {\n if (isServer) {\n return [useRef(null), (() => {\n })];\n }\n return useAnimate();\n}\nconst asStyleRecord = (style) => style && typeof style === \"object\" && !Array.isArray(style) ? style : {};\nfunction assignInlineStyles(node, styles) {\n for (const key in styles) {\n node.style[key] = normalizeValueWithProperty(styles[key], key);\n }\n}\nconst MotionValueStrategy = /* @__PURE__ */ new WeakMap();\nconst PendingMotionOnFinish = /* @__PURE__ */ new WeakMap();\nfunction settlePendingMotionOnFinish(mv, controls) {\n const onFinish = PendingMotionOnFinish.get(mv);\n if (!onFinish) return;\n PendingMotionOnFinish.delete(mv);\n controls.then(() => onFinish()).catch(() => onFinish());\n}\nconst PopperPositionAnims = /* @__PURE__ */ new WeakMap();\nfunction parseTranslate(transform) {\n if (!transform || transform === \"none\") return { x: 0, y: 0 };\n try {\n const m = new DOMMatrixReadOnly(transform);\n if (!m.is2D || m.a !== 1 || m.b !== 0 || m.c !== 0 || m.d !== 1) return null;\n return { x: m.e, y: m.f };\n } catch {\n return null;\n }\n}\nfunction createAnimations(animations) {\n let isHydratingGlobal;\n const hydratingComponents = /* @__PURE__ */ new Set();\n return {\n View: MotionView,\n Text: MotionText,\n inputStyle: \"css\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n usePresence,\n ResetPresence,\n onMount() {\n isHydratingGlobal = false;\n hydratingComponents.forEach((cb) => cb());\n },\n useAnimations: (animationProps) => {\n if (isHydratingGlobal === void 0 && !getConfig().settings.disableSSR) {\n isHydratingGlobal = true;\n }\n const {\n props,\n style,\n componentState,\n stateRef,\n useStyleEmitter,\n presence,\n onTransition,\n styleProps\n } = animationProps;\n const animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition;\n const isComponentHydrating = componentState.unmounted === true;\n const isMounting = componentState.unmounted === \"should-enter\";\n const isEntering = !!componentState.unmounted;\n const isExiting = presence?.[0] === false;\n const sendExitComplete = presence?.[1];\n const refs = useRef(null);\n if (!refs.current) {\n refs.current = {\n isFirstRender: true,\n lastDoAnimate: null,\n lastDontAnimate: null,\n controls: null,\n lastAnimateAt: 0,\n disposed: false,\n wasExiting: false,\n isExiting: false,\n sendExitComplete: void 0,\n animationState: \"default\",\n frozenExitTarget: null,\n exitCompleteScheduled: false,\n enterCompleteScheduled: false,\n disableAnimation: true,\n wasEntering: false,\n wasDisabled: false,\n onTransition: void 0,\n enterStarted: false,\n exitStarted: false,\n updateInFlight: false,\n updateControls: null,\n wasNoClass: !!styleProps.noClass\n };\n }\n const emit = (phase, cause, finished) => {\n refs.current.onTransition?.(\n phase === \"end\" ? { phase, cause, finished } : { phase, cause }\n );\n };\n const justFinishedEntering = refs.current.wasEntering && !isEntering;\n useEffect(() => {\n refs.current.wasEntering = isEntering;\n });\n const animationState = isExiting ? \"exit\" : isMounting || justFinishedEntering ? \"enter\" : \"default\";\n const disableAnimation = isComponentHydrating || isMounting || !animationKey;\n const [scope] = useAnimateSSRSafe();\n refs.current.isExiting = isExiting;\n refs.current.sendExitComplete = sendExitComplete;\n refs.current.animationState = animationState;\n refs.current.disableAnimation = disableAnimation;\n refs.current.onTransition = onTransition;\n const justStartedExiting = isExiting && !refs.current.wasExiting;\n const justStoppedExiting = !isExiting && refs.current.wasExiting;\n if (justStartedExiting || justStoppedExiting) {\n refs.current.frozenExitTarget = null;\n refs.current.exitCompleteScheduled = false;\n refs.current.enterCompleteScheduled = false;\n }\n useEffect(() => {\n refs.current.wasExiting = isExiting;\n });\n useIsomorphicLayoutEffect(() => {\n if (justStoppedExiting && refs.current.exitStarted) {\n refs.current.exitStarted = false;\n emit(\"end\", \"exit\", false);\n }\n }, [justStoppedExiting]);\n const {\n dontAnimate = {},\n doAnimate,\n animationOptions\n } = getMotionAnimatedProps(props, style, disableAnimation, animationState);\n const [firstRenderStyle] = useState(style);\n if (refs.current.isFirstRender) {\n refs.current.lastDontAnimate = firstRenderStyle;\n }\n const [isHydrating, setIsHydrating] = useState(isHydratingGlobal);\n useLayoutEffect(() => {\n if (isHydratingGlobal) {\n hydratingComponents.add(() => {\n setIsHydrating(false);\n });\n }\n return () => {\n refs.current.disposed = true;\n };\n }, []);\n const flushAnimation = ({\n doAnimate: doAnimateRaw = {},\n animationOptions: passedOptions = {},\n dontAnimate: dontAnimate2\n }) => {\n let startedControls = null;\n const isCurrentlyExiting = refs.current.isExiting;\n const currentSendExitComplete = refs.current.sendExitComplete;\n const currentAnimationState = refs.current.animationState;\n let doAnimate2 = doAnimateRaw;\n if (isCurrentlyExiting && refs.current.frozenExitTarget) {\n doAnimate2 = refs.current.frozenExitTarget;\n }\n const animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions(props.transition ?? null, \"exit\") : passedOptions;\n try {\n const node = stateRef.current.host;\n if (refs.current.isFirstRender) {\n refs.current.lastDontAnimate = null;\n refs.current.lastDoAnimate = null;\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] && props[\"debug\"] !== \"profile\") {\n console.groupCollapsed(\n `[motion] animate (${JSON.stringify(getDiff(refs.current.lastDoAnimate, doAnimate2), null, 2)})`\n );\n console.info({\n props,\n componentState,\n doAnimate: doAnimate2,\n dontAnimate: dontAnimate2,\n animationOptions: animationOptions2,\n animationProps,\n lastDoAnimate: { ...refs.current.lastDoAnimate },\n lastDontAnimate: { ...refs.current.lastDontAnimate },\n isExiting,\n style,\n node\n });\n console.groupCollapsed(`trace >`);\n console.trace();\n console.groupEnd();\n console.groupEnd();\n }\n }\n if (!(node instanceof HTMLElement)) {\n return;\n }\n const prevDont = refs.current.lastDontAnimate;\n if (dontAnimate2) {\n if (prevDont) {\n removeRemovedStyles(prevDont, dontAnimate2, node, doAnimate2);\n const changed = getDiff(prevDont, dontAnimate2);\n if (changed) {\n assignInlineStyles(node, changed);\n }\n } else {\n assignInlineStyles(node, dontAnimate2);\n }\n } else if (prevDont) {\n removeRemovedStyles(prevDont, {}, node, doAnimate2);\n }\n if (doAnimate2) {\n if (prevDont) {\n for (const key in prevDont) {\n if (key in doAnimate2) {\n node.style[key] = normalizeValueWithProperty(prevDont[key], key);\n if (refs.current.lastDoAnimate) {\n refs.current.lastDoAnimate[key] = prevDont[key];\n }\n }\n }\n }\n const lastAnimated = refs.current.lastDoAnimate;\n if (lastAnimated) {\n removeRemovedStyles(lastAnimated, doAnimate2, node, dontAnimate2);\n }\n const diff = getDiff(refs.current.lastDoAnimate, doAnimate2);\n if (diff) {\n if (isCurrentlyExiting && !refs.current.frozenExitTarget) {\n refs.current.frozenExitTarget = { ...doAnimate2 };\n }\n const isPopperPosition = node.hasAttribute(\"data-popper-animate-position\");\n let popperHandledTransform = false;\n if (isPopperPosition && !isCurrentlyExiting && typeof diff.transform === \"string\") {\n const target = parseTranslate(diff.transform);\n if (target) {\n let entry = PopperPositionAnims.get(node);\n if (!entry) {\n let seed = target;\n try {\n seed = parseTranslate(getComputedStyle(node).transform) ?? target;\n } catch {\n }\n const x = motionValue(seed.x);\n const y = motionValue(seed.y);\n const write = () => {\n node.style.transform = `translate3d(${x.get()}px, ${y.get()}px, 0)`;\n };\n x.on(\"change\", write);\n y.on(\"change\", write);\n entry = { x, y, stop: null };\n PopperPositionAnims.set(node, entry);\n }\n if (!entry.stop) {\n try {\n const live = parseTranslate(getComputedStyle(node).transform);\n if (live) {\n entry.x.jump(live.x);\n entry.y.jump(live.y);\n }\n } catch {\n }\n }\n for (const anim of node.getAnimations()) {\n try {\n const kf = anim.effect?.getKeyframes?.();\n if (kf?.some((k) => \"transform\" in k)) {\n anim.cancel();\n }\n } catch {\n }\n }\n const opts = animationOptions2;\n const positionTransition = opts.transform ?? opts.default ?? animationOptions2;\n const cx = animateMotionValue(\n entry.x,\n target.x,\n positionTransition\n );\n const cy = animateMotionValue(\n entry.y,\n target.y,\n positionTransition\n );\n entry.stop = () => {\n cx.stop();\n cy.stop();\n };\n popperHandledTransform = true;\n }\n }\n if (isCurrentlyExiting) {\n const entry = PopperPositionAnims.get(node);\n if (entry?.stop) {\n entry.stop();\n entry.stop = null;\n }\n }\n let midFlightValues = null;\n if (refs.current.controls) {\n try {\n const computed = getComputedStyle(node);\n midFlightValues = {};\n for (const key in diff) {\n const val = computed[key];\n if (val !== void 0 && val !== \"\") {\n midFlightValues[key] = val;\n }\n }\n } catch {\n }\n if (isCurrentlyExiting) {\n refs.current.controls.stop();\n }\n if (midFlightValues) {\n for (const key in midFlightValues) {\n if (key === \"transform\" && popperHandledTransform) continue;\n node.style[key] = midFlightValues[key];\n }\n }\n if (isPopperPosition && !popperHandledTransform) {\n const anims = node.getAnimations();\n for (const anim of anims) {\n anim.cancel();\n }\n }\n }\n const fixedDiff = fixTransparentColors(\n diff,\n refs.current.lastDoAnimate,\n doAnimate2\n );\n let waapiDiff = Object.fromEntries(\n Object.entries(fixedDiff).map(([key, value]) => [\n key,\n Array.isArray(value) ? value.map((item) => normalizeValueWithProperty(item, key)) : normalizeValueWithProperty(value, key)\n ])\n );\n if (popperHandledTransform && \"transform\" in waapiDiff) {\n waapiDiff = { ...waapiDiff };\n delete waapiDiff.transform;\n }\n if ((isPopperPosition || isCurrentlyExiting) && midFlightValues?.transform && waapiDiff.transform) {\n waapiDiff.transform = [midFlightValues.transform, waapiDiff.transform];\n }\n if (Object.keys(waapiDiff).length > 0) {\n startedControls = animateMotionValue(\n node,\n waapiDiff,\n animationOptions2\n );\n refs.current.controls = startedControls;\n }\n refs.current.lastAnimateAt = Date.now();\n }\n }\n refs.current.lastDontAnimate = dontAnimate2 ? { ...dontAnimate2 } : {};\n refs.current.lastDoAnimate = doAnimate2 ? { ...doAnimate2 } : {};\n } finally {\n if (isCurrentlyExiting && currentSendExitComplete) {\n if (refs.current.enterStarted) {\n refs.current.enterStarted = false;\n emit(\"end\", \"enter\", false);\n }\n if (startedControls) {\n if (!refs.current.exitStarted) {\n refs.current.exitStarted = true;\n emit(\"start\", \"exit\");\n }\n refs.current.exitCompleteScheduled = true;\n const complete = (finished) => {\n if (!refs.current.isExiting) return;\n if (refs.current.exitStarted) {\n refs.current.exitStarted = false;\n emit(\"end\", \"exit\", finished);\n }\n currentSendExitComplete();\n };\n startedControls.finished.then(() => complete(true)).catch(() => complete(false));\n } else if (!refs.current.exitCompleteScheduled) {\n emit(\"start\", \"exit\");\n emit(\"end\", \"exit\", true);\n currentSendExitComplete();\n }\n } else if (currentAnimationState === \"enter\") {\n if (startedControls) {\n if (!refs.current.enterStarted) {\n refs.current.enterStarted = true;\n emit(\"start\", \"enter\");\n }\n refs.current.enterCompleteScheduled = true;\n const complete = (finished) => {\n if (refs.current.disposed || refs.current.animationState !== \"enter\")\n return;\n if (refs.current.enterStarted) {\n refs.current.enterStarted = false;\n emit(\"end\", \"enter\", finished);\n }\n };\n startedControls.finished.then(() => complete(true)).catch(() => complete(false));\n } else if (!refs.current.enterCompleteScheduled && !refs.current.disableAnimation) {\n emit(\"start\", \"enter\");\n emit(\"end\", \"enter\", true);\n }\n } else if (startedControls) {\n const controls = startedControls;\n if (refs.current.updateInFlight) {\n emit(\"end\", \"update\", false);\n }\n refs.current.updateInFlight = true;\n refs.current.updateControls = controls;\n emit(\"start\", \"update\");\n const settle = (finished) => {\n if (refs.current.updateControls !== controls) return;\n refs.current.updateInFlight = false;\n refs.current.updateControls = null;\n emit(\"end\", \"update\", finished);\n };\n controls.finished.then(() => settle(true)).catch(() => settle(false));\n }\n }\n };\n useStyleEmitter?.((nextStyle, effectiveTransition) => {\n const animationProps2 = getMotionAnimatedProps(\n props,\n nextStyle,\n disableAnimation,\n refs.current.animationState,\n effectiveTransition\n );\n flushAnimation(animationProps2);\n });\n useIsomorphicLayoutEffect(() => {\n if (refs.current.isFirstRender) {\n refs.current.isFirstRender = false;\n refs.current.wasDisabled = disableAnimation;\n if (isHydrating) {\n if (doAnimate && Object.keys(doAnimate).length > 0) {\n refs.current.lastDoAnimate = { ...doAnimate };\n } else {\n refs.current.lastDoAnimate = dontAnimate ? { ...dontAnimate } : {};\n }\n refs.current.lastDontAnimate = dontAnimate ? { ...dontAnimate } : {};\n refs.current.lastAnimateAt = Date.now();\n return;\n }\n refs.current.lastDontAnimate = dontAnimate ? { ...dontAnimate } : {};\n refs.current.lastDoAnimate = doAnimate ? { ...doAnimate } : {};\n return;\n }\n const justEnabled = refs.current.wasDisabled && !disableAnimation;\n refs.current.wasDisabled = disableAnimation;\n const justStrippedClasses = !refs.current.wasNoClass && !!styleProps.noClass;\n refs.current.wasNoClass = !!styleProps.noClass;\n if ((justEnabled || justStrippedClasses) && animationState !== \"enter\") {\n const node = stateRef.current.host;\n if (node instanceof HTMLElement) {\n if (dontAnimate) assignInlineStyles(node, dontAnimate);\n if (doAnimate) assignInlineStyles(node, doAnimate);\n const entry = PopperPositionAnims.get(node);\n if (entry) {\n const target = parseTranslate(\n doAnimate?.transform ?? dontAnimate?.transform\n );\n if (target) {\n entry.stop?.();\n entry.stop = null;\n entry.x.jump(target.x);\n entry.y.jump(target.y);\n }\n }\n }\n refs.current.lastDontAnimate = dontAnimate ? { ...dontAnimate } : {};\n refs.current.lastDoAnimate = doAnimate ? { ...doAnimate } : {};\n return;\n }\n flushAnimation({\n doAnimate,\n dontAnimate,\n animationOptions\n });\n }, [style, isExiting, disableAnimation, styleProps.noClass]);\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] && props[\"debug\"] !== \"profile\") {\n console.groupCollapsed(`[motion] render`);\n console.info({\n style,\n doAnimate,\n dontAnimate,\n scope,\n animationOptions,\n isExiting,\n isFirstRender: refs.current.isFirstRender,\n animationProps\n });\n console.groupEnd();\n }\n }\n return {\n style: firstRenderStyle,\n ref: scope,\n render: \"div\"\n };\n },\n useAnimatedNumber(initial) {\n const motionValue2 = useMotionValue(initial);\n return React.useMemo(\n () => ({\n getInstance() {\n return motionValue2;\n },\n getValue() {\n return motionValue2.get();\n },\n setValue(next, config = { type: \"spring\" }, onFinish) {\n if (config.type === \"direct\") {\n MotionValueStrategy.set(motionValue2, { type: \"direct\" });\n motionValue2.set(next);\n onFinish?.();\n return;\n }\n MotionValueStrategy.set(motionValue2, config);\n if (onFinish) {\n const prior = PendingMotionOnFinish.get(motionValue2);\n if (prior) {\n PendingMotionOnFinish.delete(motionValue2);\n prior();\n }\n PendingMotionOnFinish.set(motionValue2, onFinish);\n }\n motionValue2.set(next);\n },\n stop() {\n motionValue2.stop();\n }\n }),\n [motionValue2]\n );\n },\n useAnimatedNumberReaction({ value }, onValue) {\n const instance = value.getInstance();\n useMotionValueEvent(instance, \"change\", onValue);\n },\n useAnimatedNumberStyle(val, getStyleProp) {\n const motionValue2 = val.getInstance();\n const getStyleRef = useRef(getStyleProp);\n getStyleRef.current = getStyleProp;\n return useMemo(() => {\n return {\n getStyle: (cur) => {\n return getStyleRef.current(cur);\n },\n motionValue: motionValue2\n };\n }, []);\n },\n useAnimatedNumbersStyle(vals, getStyleProp) {\n const motionValues = vals.map((v) => v.getInstance());\n const getStyleRef = useRef(getStyleProp);\n getStyleRef.current = getStyleProp;\n return useMemo(() => {\n return {\n getStyle: (...currentValues) => getStyleRef.current(...currentValues),\n motionValues\n };\n }, []);\n }\n };\n function getMotionAnimatedProps(props, style, disable, animationState = \"default\", transitionOverride) {\n if (disable) {\n return {\n dontAnimate: style\n };\n }\n const animationOptions = getAnimationOptions(\n transitionOverride ?? props.transition ?? null,\n animationState\n );\n let dontAnimate;\n let doAnimate;\n const animateOnly = props.animateOnly;\n for (const key in style) {\n const value = style[key];\n if (disableAnimationProps.has(key) || animateOnly && !animateOnly.includes(key)) {\n dontAnimate ||= {};\n dontAnimate[key] = value;\n } else {\n doAnimate ||= {};\n doAnimate[key] = value;\n }\n }\n return {\n dontAnimate,\n doAnimate,\n animationOptions\n };\n }\n function getAnimationOptions(transitionProp, animationState = \"default\") {\n const normalized = normalizeTransition(transitionProp);\n let effectiveKey = getEffectiveAnimation(normalized, animationState);\n if (!effectiveKey && animationState === \"default\") {\n effectiveKey = normalized.enter || normalized.exit || null;\n }\n const globalConfigOverride = normalized.config ? { ...normalized.config } : void 0;\n if (!effectiveKey && Object.keys(normalized.properties).length === 0 && !globalConfigOverride) {\n return {};\n }\n const defaultConfig = effectiveKey ? withInferredType(animations[effectiveKey]) : null;\n const delay = normalized.delay;\n const result = {};\n if (defaultConfig) {\n Object.assign(result, defaultConfig);\n }\n if (globalConfigOverride) {\n Object.assign(result, globalConfigOverride);\n if (result.type === void 0 && result.duration !== void 0 && result.damping === void 0 && result.stiffness === void 0 && result.mass === void 0) {\n result.type = \"tween\";\n }\n }\n if (delay) {\n result.delay = delay;\n }\n if (defaultConfig || globalConfigOverride || delay) {\n result.default = {\n ...defaultConfig,\n ...globalConfigOverride,\n ...delay ? { delay } : null\n };\n }\n for (const [propName, animationNameOrConfig] of Object.entries(\n normalized.properties\n )) {\n if (typeof animationNameOrConfig === \"string\") {\n result[propName] = withInferredType(animations[animationNameOrConfig]);\n } else if (animationNameOrConfig && typeof animationNameOrConfig === \"object\") {\n const baseConfig = animationNameOrConfig.type ? withInferredType(animations[animationNameOrConfig.type]) : defaultConfig;\n result[propName] = {\n ...baseConfig,\n ...animationNameOrConfig\n };\n }\n }\n convertMsToS(result);\n convertMsToS(result.default);\n for (const key in result) {\n if (key !== \"default\" && typeof result[key] === \"object\") {\n convertMsToS(result[key]);\n }\n }\n return result;\n }\n}\nfunction withInferredType(config) {\n if (!config) {\n return { type: \"spring\" };\n }\n const isTimingBased = config.duration !== void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;\n return { type: isTimingBased ? \"tween\" : \"spring\", ...config };\n}\nfunction convertMsToS(config) {\n if (!config) return;\n if (typeof config.delay === \"number\") config.delay = config.delay / 1e3;\n if (typeof config.duration === \"number\") {\n const isTimingBased = config.type === \"tween\" || config.type === void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;\n if (isTimingBased) {\n config.duration = config.duration / 1e3;\n }\n }\n}\nfunction removeRemovedStyles(prev, next, node, dontClearIfIn) {\n for (const key in prev) {\n if (!(key in next)) {\n if (dontClearIfIn && key in dontClearIfIn) {\n continue;\n }\n node.style[key] = \"\";\n }\n }\n}\nconst disableAnimationProps = /* @__PURE__ */ new Set([\n ...Object.keys(nonAnimatableStyleProps),\n \"flexBasis\"\n]);\nfunction motionPropsEqual(a, b) {\n for (const key in a) {\n if (!(key in b)) return false;\n }\n for (const key in b) {\n if (key === \"children\") continue;\n const av = a[key];\n const bv = b[key];\n if (typeof bv === \"function\" && typeof av === \"function\") continue;\n if (!Object.is(av, bv)) return false;\n }\n return true;\n}\nfunction motionStylesEqual(a, b) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n const sa = a[i];\n const sb = b[i];\n if (sa === sb) continue;\n if (!sa || !sb) return false;\n let aCount = 0;\n for (const key in sa) {\n aCount++;\n if (!Object.is(sa[key], sb[key])) return false;\n }\n let bCount = 0;\n for (const _key in sb) {\n bCount++;\n }\n if (aCount !== bCount) return false;\n }\n return true;\n}\nconst MotionView = createMotionView(\"div\");\nconst MotionText = createMotionView(\"span\");\nconst transformAliases = {\n x: \"translateX\",\n y: \"translateY\",\n scale: \"scale\",\n scaleX: \"scaleX\",\n scaleY: \"scaleY\",\n rotate: \"rotate\",\n rotateX: \"rotateX\",\n rotateY: \"rotateY\",\n rotateZ: \"rotateZ\",\n skewX: \"skewX\",\n skewY: \"skewY\"\n};\nfunction compileAnimatedStyle(initialSource, initialResolved) {\n const shorthands = getConfig().shorthands;\n const entries = Object.keys(initialSource).map((source) => ({\n source,\n target: shorthands?.[source] ?? source,\n tokenValue: typeof initialSource[source] === \"string\" && initialResolved[shorthands?.[source] ?? source] !== initialSource[source] ? initialResolved[shorthands?.[source] ?? source] : void 0\n }));\n return (sourceStyle) => {\n const resolved = {};\n const transforms = [];\n for (const entry of entries) {\n const value = sourceStyle[entry.source];\n if (value === void 0) continue;\n if (entry.source === \"transform\" && Array.isArray(value)) {\n resolved.transform = transformsToString(value);\n } else if (entry.source in transformAliases) {\n transforms.push({ [transformAliases[entry.source]]: value });\n } else {\n resolved[entry.target] = entry.tokenValue ?? normalizeValueWithProperty(value, entry.target);\n }\n }\n if (transforms.length) resolved.transform = transformsToString(transforms);\n return resolved;\n };\n}\nfunction createMotionView(defaultTag) {\n const isText = defaultTag === \"span\";\n const Component = createRefComponent((propsIn, ref) => {\n const { forwardedRef, animation, render = defaultTag, style, ...propsRest } = propsIn;\n const [scope, animate] = useAnimateSSRSafe();\n const hostRef = useRef(null);\n const seededNode = useRef(null);\n const seededInCurrentFrame = useRef(false);\n const queuedAnimationFrames = useRef(/* @__PURE__ */ new WeakMap());\n const composedRefs = useComposedRefs(forwardedRef, ref, hostRef, scope);\n const stateRef = useRef(null);\n if (!stateRef.current) {\n stateRef.current = {\n get host() {\n return hostRef.current;\n }\n };\n }\n const [_, state] = useThemeWithState({});\n const styles = Array.isArray(style) ? style : [style];\n const [animatedStyle, nonAnimatedStyles] = (() => {\n let animatedStyle2;\n const nonAnimatedStyles2 = [];\n for (const style2 of styles) {\n if (style2.getStyle) {\n animatedStyle2 = style2;\n } else {\n nonAnimatedStyles2.push(style2);\n }\n }\n return [animatedStyle2, nonAnimatedStyles2];\n })();\n function getProps(props2) {\n if (process.env.NODE_ENV === \"development\" && propsIn.debug === \"profile\" && typeof performance !== \"undefined\") {\n performance.mark(\"tamagui-motion-style-split\");\n }\n const out = getSplitStyles(\n props2,\n isText ? Text.staticConfig : View.staticConfig,\n state?.theme,\n state?.name,\n {\n unmounted: false\n },\n {\n isAnimated: false,\n noClass: true,\n resolveValues: \"auto\"\n }\n );\n if (!out) {\n return {};\n }\n if (out.viewProps.style) {\n fixStyles(out.viewProps.style);\n styleToCSS(out.viewProps.style);\n }\n return out.viewProps;\n }\n const resolvedAnimatedStyle = useMemo(() => {\n if (!animatedStyle) return null;\n const currentValues = animatedStyle.motionValues ? animatedStyle.motionValues.map((value) => value.get()) : animatedStyle.motionValue ? [animatedStyle.motionValue.get()] : [];\n const initialSource = animatedStyle.getStyle(...currentValues);\n const initialResolved = asStyleRecord(getProps({ style: initialSource }).style);\n return {\n initial: initialResolved,\n resolve: compileAnimatedStyle(initialSource, initialResolved)\n };\n }, [animatedStyle, state?.theme, state?.name]);\n const memoRef = useRef(null);\n let props;\n const cached = memoRef.current;\n if (cached && cached.theme === state?.theme && cached.themeName === state?.name && motionStylesEqual(cached.styles, nonAnimatedStyles) && motionPropsEqual(cached.propsRest, propsRest)) {\n props = { ...cached.result };\n for (const key in propsRest) {\n const val = propsRest[key];\n if (key === \"children\" || typeof val === \"function\") {\n props[key] = val;\n }\n }\n } else {\n props = getProps({ ...propsRest, style: nonAnimatedStyles });\n memoRef.current = {\n propsRest,\n styles: nonAnimatedStyles,\n theme: state?.theme,\n themeName: state?.name,\n result: props\n };\n }\n if (resolvedAnimatedStyle) {\n props = {\n ...props,\n style: {\n ...asStyleRecord(props.style),\n ...resolvedAnimatedStyle.initial\n }\n };\n }\n const Element = render || \"div\";\n const transformedProps = hooks.usePropsTransform?.(render, props, stateRef, false);\n useIsomorphicLayoutEffect(() => {\n if (!animatedStyle) return;\n const node = hostRef.current;\n if (node instanceof HTMLElement && seededNode.current !== node) {\n const currentStyle = animatedStyle.motionValues ? animatedStyle.getStyle(\n ...animatedStyle.motionValues.map((value) => value.get())\n ) : animatedStyle.motionValue ? animatedStyle.getStyle(animatedStyle.motionValue.get()) : null;\n const webStyle = currentStyle && resolvedAnimatedStyle?.resolve(currentStyle);\n if (webStyle) {\n assignInlineStyles(node, webStyle);\n seededNode.current = node;\n seededInCurrentFrame.current = true;\n requestAnimationFrame(() => {\n if (seededNode.current === node) seededInCurrentFrame.current = false;\n });\n }\n }\n const toTransition = (animationConfig) => animationConfig?.type === \"timing\" ? { type: \"tween\", duration: (animationConfig.duration || 0) / 1e3 } : animationConfig?.type === \"direct\" ? { type: \"tween\", duration: 0 } : { type: \"spring\", ...animationConfig };\n const animateNodeTo = (nextStyle, transition, motionValue3) => {\n if (!(node instanceof HTMLElement) || hostRef.current !== node) return;\n const webStyle = resolvedAnimatedStyle?.resolve(nextStyle);\n if (!webStyle) return;\n settlePendingMotionOnFinish(\n motionValue3,\n animate(node, webStyle, transition)\n );\n };\n const animateChangedValue = (nextStyle, transition, motionValue3) => {\n if (seededInCurrentFrame.current && seededNode.current === node) {\n const queuedFrame = queuedAnimationFrames.current.get(motionValue3);\n if (queuedFrame !== void 0) cancelAnimationFrame(queuedFrame);\n const frame = requestAnimationFrame(() => {\n if (queuedAnimationFrames.current.get(motionValue3) !== frame) return;\n queuedAnimationFrames.current.delete(motionValue3);\n if (hostRef.current === node) {\n animateNodeTo(nextStyle, transition, motionValue3);\n } else {\n const onFinish = PendingMotionOnFinish.get(motionValue3);\n PendingMotionOnFinish.delete(motionValue3);\n onFinish?.();\n }\n });\n queuedAnimationFrames.current.set(motionValue3, frame);\n return;\n }\n animateNodeTo(nextStyle, transition, motionValue3);\n };\n if (animatedStyle.motionValues) {\n const mvs = animatedStyle.motionValues;\n const styleForAll = () => animatedStyle.getStyle(...mvs.map((value) => value.get()));\n const unsubs = mvs.map(\n (mv) => mv.on(\n \"change\",\n () => animateChangedValue(\n styleForAll(),\n toTransition(MotionValueStrategy.get(mv)),\n mv\n )\n )\n );\n return () => unsubs.forEach((fn) => fn());\n }\n const motionValue2 = animatedStyle.motionValue;\n if (!motionValue2) return;\n return motionValue2.on(\n \"change\",\n (value) => animateChangedValue(\n animatedStyle.getStyle(value),\n toTransition(MotionValueStrategy.get(motionValue2)),\n motionValue2\n )\n );\n }, [animatedStyle, resolvedAnimatedStyle]);\n return /* @__PURE__ */ jsx(Element, { ...transformedProps, ref: composedRefs });\n });\n Component[\"acceptRenderProp\"] = true;\n return Component;\n}\nfunction getDiff(previous, next) {\n if (!previous) {\n return next;\n }\n let diff = null;\n for (const key in next) {\n if (next[key] !== previous[key]) {\n diff ||= {};\n diff[key] = next[key];\n }\n }\n return diff;\n}\nfunction fixTransparentColors(diff, previous, next) {\n let result = diff;\n for (const key in diff) {\n if (diff[key] === \"transparent\") {\n let fixed = \"rgba(0, 0, 0, 0)\";\n const candidates = [previous?.[key], next?.[key]];\n for (const candidate of candidates) {\n if (typeof candidate === \"string\" && candidate !== \"transparent\") {\n const rgbaMatch = candidate.match(/^rgba?\\(([^,]+),\\s*([^,]+),\\s*([^,)]+)/);\n if (rgbaMatch) {\n fixed = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0)`;\n break;\n }\n }\n }\n if (result === diff) {\n result = { ...diff };\n }\n result[key] = fixed;\n }\n }\n return result;\n}\nexport {\n createAnimations,\n disableAnimationProps\n};\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;;;;;;AA6BA,MAAM,WAAW,OAAO,WAAW;AACnC,SAAS,oBAAoB;CAC3B,IAAI,UAAU;EACZ,OAAO,CAAC,OAAO,IAAI,UAAU,CAC7B,EAAE;CACJ;CACA,OAAO,WAAW;AACpB;AACA,MAAM,iBAAiB,UAAU,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC;AAC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":["animateMotionValue"],"sources":["esm/createAnimations.js"],"sourcesContent":["import {\n easingToBezier,\n forAnimationState,\n getTransitionForKey,\n hasTransition,\n resolveTransition,\n styleKeysForProperty\n} from \"@tamagui/animation-helpers\";\nimport { ResetPresence, usePresence } from \"@tamagui/use-presence\";\nimport {\n getConfig,\n getSplitStyles,\n hooks,\n nonAnimatableStyleProps,\n Text,\n useComposedRefs,\n useIsomorphicLayoutEffect,\n View,\n createRefComponent\n} from \"@tamagui/web\";\nimport {\n fixStyles,\n normalizeValueWithProperty,\n styleToCSS,\n transformsToString,\n useThemeWithState\n} from \"@tamagui/web/internal-runtime\";\nimport {\n animate as animateMotionValue,\n motionValue,\n useAnimate,\n useMotionValue,\n useMotionValueEvent\n} from \"motion/react\";\nimport React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst isServer = typeof window === \"undefined\";\nfunction useAnimateSSRSafe() {\n if (isServer) {\n return [useRef(null), (() => {\n })];\n }\n return useAnimate();\n}\nconst asStyleRecord = (style) => style && typeof style === \"object\" && !Array.isArray(style) ? style : {};\nfunction assignInlineStyles(node, styles) {\n for (const key in styles) {\n node.style[key] = normalizeValueWithProperty(styles[key], key);\n }\n}\nconst MotionValueStrategy = /* @__PURE__ */ new WeakMap();\nconst PendingMotionOnFinish = /* @__PURE__ */ new WeakMap();\nfunction settlePendingMotionOnFinish(mv, controls) {\n const onFinish = PendingMotionOnFinish.get(mv);\n if (!onFinish) return;\n PendingMotionOnFinish.delete(mv);\n controls.then(() => onFinish()).catch(() => onFinish());\n}\nconst PopperPositionAnims = /* @__PURE__ */ new WeakMap();\nfunction parseTranslate(transform) {\n if (!transform || transform === \"none\") return { x: 0, y: 0 };\n try {\n const m = new DOMMatrixReadOnly(transform);\n if (!m.is2D || m.a !== 1 || m.b !== 0 || m.c !== 0 || m.d !== 1) return null;\n return { x: m.e, y: m.f };\n } catch {\n return null;\n }\n}\nfunction createAnimations(animations) {\n let isHydratingGlobal;\n const hydratingComponents = /* @__PURE__ */ new Set();\n return {\n View: MotionView,\n Text: MotionText,\n inputStyle: \"css\",\n outputStyle: \"inline\",\n avoidReRenders: true,\n animations,\n usePresence,\n ResetPresence,\n onMount() {\n isHydratingGlobal = false;\n hydratingComponents.forEach((cb) => cb());\n },\n useAnimations: (animationProps) => {\n if (isHydratingGlobal === void 0 && !getConfig().settings.disableSSR) {\n isHydratingGlobal = true;\n }\n const {\n props,\n style,\n componentState,\n stateRef,\n useStyleEmitter,\n presence,\n onTransition,\n styleProps,\n styleState\n } = animationProps;\n const effectiveTransition = styleState?.effectiveTransition ?? props.transition;\n const isComponentHydrating = componentState.unmounted === true;\n const isMounting = componentState.unmounted === \"should-enter\";\n const isEntering = !!componentState.unmounted;\n const isExiting = presence?.[0] === false;\n const sendExitComplete = presence?.[1];\n const refs = useRef(null);\n if (!refs.current) {\n refs.current = {\n isFirstRender: true,\n lastDoAnimate: null,\n lastDontAnimate: null,\n controls: null,\n lastAnimateAt: 0,\n disposed: false,\n wasExiting: false,\n isExiting: false,\n sendExitComplete: void 0,\n animationState: \"default\",\n frozenExitTarget: null,\n exitCompleteScheduled: false,\n enterCompleteScheduled: false,\n disableAnimation: true,\n wasEntering: false,\n wasDisabled: false,\n onTransition: void 0,\n enterStarted: false,\n exitStarted: false,\n updateInFlight: false,\n updateControls: null,\n wasNoClass: !!styleProps.noClass\n };\n }\n const emit = (phase, cause, finished) => {\n refs.current.onTransition?.(\n phase === \"end\" ? { phase, cause, finished } : { phase, cause }\n );\n };\n const justFinishedEntering = refs.current.wasEntering && !isEntering;\n useEffect(() => {\n refs.current.wasEntering = isEntering;\n });\n const animationState = isExiting ? \"exit\" : isMounting || justFinishedEntering ? \"enter\" : \"default\";\n const disableAnimation = isComponentHydrating || isMounting || !effectiveTransition;\n const [scope] = useAnimateSSRSafe();\n refs.current.isExiting = isExiting;\n refs.current.sendExitComplete = sendExitComplete;\n refs.current.animationState = animationState;\n refs.current.disableAnimation = disableAnimation;\n refs.current.onTransition = onTransition;\n const justStartedExiting = isExiting && !refs.current.wasExiting;\n const justStoppedExiting = !isExiting && refs.current.wasExiting;\n if (justStartedExiting || justStoppedExiting) {\n refs.current.frozenExitTarget = null;\n refs.current.exitCompleteScheduled = false;\n refs.current.enterCompleteScheduled = false;\n }\n useEffect(() => {\n refs.current.wasExiting = isExiting;\n });\n useIsomorphicLayoutEffect(() => {\n if (justStoppedExiting && refs.current.exitStarted) {\n refs.current.exitStarted = false;\n emit(\"end\", \"exit\", false);\n }\n }, [justStoppedExiting]);\n const {\n dontAnimate = {},\n doAnimate,\n animationOptions\n } = getMotionAnimatedProps(\n props,\n style,\n disableAnimation,\n animationState,\n effectiveTransition\n );\n const [firstRenderStyle] = useState(style);\n if (refs.current.isFirstRender) {\n refs.current.lastDontAnimate = firstRenderStyle;\n }\n const [isHydrating, setIsHydrating] = useState(isHydratingGlobal);\n useLayoutEffect(() => {\n if (isHydratingGlobal) {\n hydratingComponents.add(() => {\n setIsHydrating(false);\n });\n }\n return () => {\n refs.current.disposed = true;\n };\n }, []);\n const flushAnimation = ({\n doAnimate: doAnimateRaw = {},\n animationOptions: passedOptions = {},\n dontAnimate: dontAnimate2\n }) => {\n let startedControls = null;\n const isCurrentlyExiting = refs.current.isExiting;\n const currentSendExitComplete = refs.current.sendExitComplete;\n const currentAnimationState = refs.current.animationState;\n let doAnimate2 = doAnimateRaw;\n if (isCurrentlyExiting && refs.current.frozenExitTarget) {\n doAnimate2 = refs.current.frozenExitTarget;\n }\n const animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions(\n forAnimationState(\n resolveTransition(effectiveTransition ?? null, {\n animations\n }),\n \"exit\"\n )\n ) : passedOptions;\n try {\n const node = stateRef.current.host;\n if (refs.current.isFirstRender) {\n refs.current.lastDontAnimate = null;\n refs.current.lastDoAnimate = null;\n }\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] && props[\"debug\"] !== \"profile\") {\n console.groupCollapsed(\n `[motion] animate (${JSON.stringify(getDiff(refs.current.lastDoAnimate, doAnimate2), null, 2)})`\n );\n console.info({\n props,\n componentState,\n doAnimate: doAnimate2,\n dontAnimate: dontAnimate2,\n animationOptions: animationOptions2,\n animationProps,\n lastDoAnimate: { ...refs.current.lastDoAnimate },\n lastDontAnimate: { ...refs.current.lastDontAnimate },\n isExiting,\n style,\n node\n });\n console.groupCollapsed(`trace >`);\n console.trace();\n console.groupEnd();\n console.groupEnd();\n }\n }\n if (!(node instanceof HTMLElement)) {\n return;\n }\n const prevDont = refs.current.lastDontAnimate;\n if (dontAnimate2) {\n if (prevDont) {\n removeRemovedStyles(prevDont, dontAnimate2, node, doAnimate2);\n const changed = getDiff(prevDont, dontAnimate2);\n if (changed) {\n assignInlineStyles(node, changed);\n }\n } else {\n assignInlineStyles(node, dontAnimate2);\n }\n } else if (prevDont) {\n removeRemovedStyles(prevDont, {}, node, doAnimate2);\n }\n if (doAnimate2) {\n if (prevDont) {\n for (const key in prevDont) {\n if (key in doAnimate2) {\n node.style[key] = normalizeValueWithProperty(prevDont[key], key);\n if (refs.current.lastDoAnimate) {\n refs.current.lastDoAnimate[key] = prevDont[key];\n }\n }\n }\n }\n const lastAnimated = refs.current.lastDoAnimate;\n if (lastAnimated) {\n removeRemovedStyles(lastAnimated, doAnimate2, node, dontAnimate2);\n }\n const diff = getDiff(refs.current.lastDoAnimate, doAnimate2);\n if (diff) {\n if (isCurrentlyExiting && !refs.current.frozenExitTarget) {\n refs.current.frozenExitTarget = { ...doAnimate2 };\n }\n const isPopperPosition = node.hasAttribute(\"data-popper-animate-position\");\n let popperHandledTransform = false;\n if (isPopperPosition && !isCurrentlyExiting && typeof diff.transform === \"string\") {\n const target = parseTranslate(diff.transform);\n if (target) {\n let entry = PopperPositionAnims.get(node);\n if (!entry) {\n let seed = target;\n try {\n seed = parseTranslate(getComputedStyle(node).transform) ?? target;\n } catch {\n }\n const x = motionValue(seed.x);\n const y = motionValue(seed.y);\n const write = () => {\n node.style.transform = `translate3d(${x.get()}px, ${y.get()}px, 0)`;\n };\n x.on(\"change\", write);\n y.on(\"change\", write);\n entry = { x, y, stop: null };\n PopperPositionAnims.set(node, entry);\n }\n if (!entry.stop) {\n try {\n const live = parseTranslate(getComputedStyle(node).transform);\n if (live) {\n entry.x.jump(live.x);\n entry.y.jump(live.y);\n }\n } catch {\n }\n }\n for (const anim of node.getAnimations()) {\n try {\n const kf = anim.effect?.getKeyframes?.();\n if (kf?.some((k) => \"transform\" in k)) {\n anim.cancel();\n }\n } catch {\n }\n }\n const opts = animationOptions2;\n const positionTransition = opts.x ?? opts.transform ?? opts.default ?? animationOptions2;\n const cx = animateMotionValue(\n entry.x,\n target.x,\n positionTransition\n );\n const cy = animateMotionValue(\n entry.y,\n target.y,\n positionTransition\n );\n entry.stop = () => {\n cx.stop();\n cy.stop();\n };\n popperHandledTransform = true;\n }\n }\n if (isCurrentlyExiting) {\n const entry = PopperPositionAnims.get(node);\n if (entry?.stop) {\n entry.stop();\n entry.stop = null;\n }\n }\n let midFlightValues = null;\n if (refs.current.controls) {\n try {\n const computed = getComputedStyle(node);\n midFlightValues = {};\n for (const key in diff) {\n const val = computed[key];\n if (val !== void 0 && val !== \"\") {\n midFlightValues[key] = val;\n }\n }\n } catch {\n }\n if (isCurrentlyExiting) {\n refs.current.controls.stop();\n }\n if (midFlightValues) {\n for (const key in midFlightValues) {\n if (key === \"transform\" && popperHandledTransform) continue;\n node.style[key] = midFlightValues[key];\n }\n }\n if (isPopperPosition && !popperHandledTransform) {\n const anims = node.getAnimations();\n for (const anim of anims) {\n anim.cancel();\n }\n }\n }\n const fixedDiff = fixTransparentColors(\n diff,\n refs.current.lastDoAnimate,\n doAnimate2\n );\n let waapiDiff = Object.fromEntries(\n Object.entries(fixedDiff).map(([key, value]) => [\n key,\n Array.isArray(value) ? value.map((item) => normalizeValueWithProperty(item, key)) : normalizeValueWithProperty(value, key)\n ])\n );\n if (popperHandledTransform && \"transform\" in waapiDiff) {\n waapiDiff = { ...waapiDiff };\n delete waapiDiff.transform;\n }\n if ((isPopperPosition || isCurrentlyExiting) && midFlightValues?.transform && waapiDiff.transform) {\n waapiDiff.transform = [midFlightValues.transform, waapiDiff.transform];\n }\n if (Object.keys(waapiDiff).length > 0) {\n startedControls = animateMotionValue(\n node,\n waapiDiff,\n animationOptions2\n );\n refs.current.controls = startedControls;\n }\n refs.current.lastAnimateAt = Date.now();\n }\n }\n refs.current.lastDontAnimate = dontAnimate2 ? { ...dontAnimate2 } : {};\n refs.current.lastDoAnimate = doAnimate2 ? { ...doAnimate2 } : {};\n } finally {\n if (isCurrentlyExiting && currentSendExitComplete) {\n if (refs.current.enterStarted) {\n refs.current.enterStarted = false;\n emit(\"end\", \"enter\", false);\n }\n if (startedControls) {\n if (!refs.current.exitStarted) {\n refs.current.exitStarted = true;\n emit(\"start\", \"exit\");\n }\n refs.current.exitCompleteScheduled = true;\n const complete = (finished) => {\n if (!refs.current.isExiting) return;\n if (refs.current.exitStarted) {\n refs.current.exitStarted = false;\n emit(\"end\", \"exit\", finished);\n }\n currentSendExitComplete();\n };\n startedControls.finished.then(() => complete(true)).catch(() => complete(false));\n } else if (!refs.current.exitCompleteScheduled) {\n emit(\"start\", \"exit\");\n emit(\"end\", \"exit\", true);\n currentSendExitComplete();\n }\n } else if (currentAnimationState === \"enter\") {\n if (startedControls) {\n if (!refs.current.enterStarted) {\n refs.current.enterStarted = true;\n emit(\"start\", \"enter\");\n }\n refs.current.enterCompleteScheduled = true;\n const complete = (finished) => {\n if (refs.current.disposed || refs.current.animationState !== \"enter\")\n return;\n if (refs.current.enterStarted) {\n refs.current.enterStarted = false;\n emit(\"end\", \"enter\", finished);\n }\n };\n startedControls.finished.then(() => complete(true)).catch(() => complete(false));\n } else if (!refs.current.enterCompleteScheduled && !refs.current.disableAnimation) {\n emit(\"start\", \"enter\");\n emit(\"end\", \"enter\", true);\n }\n } else if (startedControls) {\n const controls = startedControls;\n if (refs.current.updateInFlight) {\n emit(\"end\", \"update\", false);\n }\n refs.current.updateInFlight = true;\n refs.current.updateControls = controls;\n emit(\"start\", \"update\");\n const settle = (finished) => {\n if (refs.current.updateControls !== controls) return;\n refs.current.updateInFlight = false;\n refs.current.updateControls = null;\n emit(\"end\", \"update\", finished);\n };\n controls.finished.then(() => settle(true)).catch(() => settle(false));\n }\n }\n };\n useStyleEmitter?.((nextStyle, emittedTransition) => {\n const animationProps2 = getMotionAnimatedProps(\n props,\n nextStyle,\n disableAnimation,\n refs.current.animationState,\n emittedTransition ?? effectiveTransition\n );\n flushAnimation(animationProps2);\n });\n useIsomorphicLayoutEffect(() => {\n if (refs.current.isFirstRender) {\n refs.current.isFirstRender = false;\n refs.current.wasDisabled = disableAnimation;\n if (isHydrating) {\n if (doAnimate && Object.keys(doAnimate).length > 0) {\n refs.current.lastDoAnimate = { ...doAnimate };\n } else {\n refs.current.lastDoAnimate = dontAnimate ? { ...dontAnimate } : {};\n }\n refs.current.lastDontAnimate = dontAnimate ? { ...dontAnimate } : {};\n refs.current.lastAnimateAt = Date.now();\n return;\n }\n refs.current.lastDontAnimate = dontAnimate ? { ...dontAnimate } : {};\n refs.current.lastDoAnimate = doAnimate ? { ...doAnimate } : {};\n return;\n }\n const justEnabled = refs.current.wasDisabled && !disableAnimation;\n refs.current.wasDisabled = disableAnimation;\n const justStrippedClasses = !refs.current.wasNoClass && !!styleProps.noClass;\n refs.current.wasNoClass = !!styleProps.noClass;\n if ((justEnabled || justStrippedClasses) && animationState !== \"enter\") {\n const node = stateRef.current.host;\n if (node instanceof HTMLElement) {\n if (dontAnimate) assignInlineStyles(node, dontAnimate);\n if (doAnimate) assignInlineStyles(node, doAnimate);\n const entry = PopperPositionAnims.get(node);\n if (entry) {\n const target = parseTranslate(\n doAnimate?.transform ?? dontAnimate?.transform\n );\n if (target) {\n entry.stop?.();\n entry.stop = null;\n entry.x.jump(target.x);\n entry.y.jump(target.y);\n }\n }\n }\n refs.current.lastDontAnimate = dontAnimate ? { ...dontAnimate } : {};\n refs.current.lastDoAnimate = doAnimate ? { ...doAnimate } : {};\n return;\n }\n flushAnimation({\n doAnimate,\n dontAnimate,\n animationOptions\n });\n }, [style, isExiting, disableAnimation, styleProps.noClass]);\n if (process.env.NODE_ENV === \"development\") {\n if (props[\"debug\"] && props[\"debug\"] !== \"profile\") {\n console.groupCollapsed(`[motion] render`);\n console.info({\n style,\n doAnimate,\n dontAnimate,\n scope,\n animationOptions,\n isExiting,\n isFirstRender: refs.current.isFirstRender,\n animationProps\n });\n console.groupEnd();\n }\n }\n return {\n style: firstRenderStyle,\n ref: scope,\n render: \"div\"\n };\n },\n useAnimatedNumber(initial) {\n const motionValue2 = useMotionValue(initial);\n return React.useMemo(\n () => ({\n getInstance() {\n return motionValue2;\n },\n getValue() {\n return motionValue2.get();\n },\n setValue(next, config = { type: \"spring\" }, onFinish) {\n if (config.type === \"direct\") {\n MotionValueStrategy.set(motionValue2, { type: \"direct\" });\n motionValue2.set(next);\n onFinish?.();\n return;\n }\n MotionValueStrategy.set(motionValue2, config);\n if (onFinish) {\n const prior = PendingMotionOnFinish.get(motionValue2);\n if (prior) {\n PendingMotionOnFinish.delete(motionValue2);\n prior();\n }\n PendingMotionOnFinish.set(motionValue2, onFinish);\n }\n motionValue2.set(next);\n },\n stop() {\n motionValue2.stop();\n }\n }),\n [motionValue2]\n );\n },\n useAnimatedNumberReaction({ value }, onValue) {\n const instance = value.getInstance();\n useMotionValueEvent(instance, \"change\", onValue);\n },\n useAnimatedNumberStyle(val, getStyleProp) {\n const motionValue2 = val.getInstance();\n const getStyleRef = useRef(getStyleProp);\n getStyleRef.current = getStyleProp;\n return useMemo(() => {\n return {\n getStyle: (cur) => {\n return getStyleRef.current(cur);\n },\n motionValue: motionValue2\n };\n }, []);\n },\n useAnimatedNumbersStyle(vals, getStyleProp) {\n const motionValues = vals.map((v) => v.getInstance());\n const getStyleRef = useRef(getStyleProp);\n getStyleRef.current = getStyleProp;\n return useMemo(() => {\n return {\n getStyle: (...currentValues) => getStyleRef.current(...currentValues),\n motionValues\n };\n }, []);\n }\n };\n function getMotionAnimatedProps(props, style, disable, animationState = \"default\", transitionOverride) {\n if (disable) {\n return {\n dontAnimate: style\n };\n }\n const resolved = forAnimationState(\n resolveTransition(transitionOverride ?? props.transition ?? null, {\n animations\n }),\n animationState\n );\n const animationOptions = getAnimationOptions(resolved);\n let dontAnimate;\n let doAnimate;\n for (const key in style) {\n const value = style[key];\n if (disableAnimationProps.has(key) || !getTransitionForKey(resolved, key)) {\n dontAnimate ||= {};\n dontAnimate[key] = value;\n } else {\n doAnimate ||= {};\n doAnimate[key] = value;\n }\n }\n return {\n dontAnimate,\n doAnimate,\n animationOptions\n };\n }\n function getAnimationOptions(resolved) {\n if (!hasTransition(resolved)) return {};\n const result = {};\n if (resolved.all) {\n const base = entryToMotion(resolved.all);\n Object.assign(result, base);\n result.default = { ...base };\n }\n for (const entry of resolved.entries) {\n if (entry.property === \"all\") continue;\n const config = entryToMotion(entry);\n for (const key of styleKeysForProperty(entry.property)) {\n result[key] = { ...config };\n }\n }\n return result;\n }\n}\nfunction entryToMotion(entry) {\n const delay = entry.delayMs ? { delay: entry.delayMs / 1e3 } : null;\n if (entry.timing.kind === \"spring\") {\n return {\n type: \"spring\",\n stiffness: entry.timing.stiffness,\n damping: entry.timing.damping,\n mass: entry.timing.mass,\n ...delay\n };\n }\n const bezier = easingToBezier(entry.timing.easing);\n return {\n type: \"tween\",\n duration: entry.timing.durationMs / 1e3,\n ...bezier ? { ease: [bezier[0], bezier[1], bezier[2], bezier[3]] } : null,\n ...delay\n };\n}\nfunction removeRemovedStyles(prev, next, node, dontClearIfIn) {\n for (const key in prev) {\n if (!(key in next)) {\n if (dontClearIfIn && key in dontClearIfIn) {\n continue;\n }\n node.style[key] = \"\";\n }\n }\n}\nconst disableAnimationProps = /* @__PURE__ */ new Set([\n ...Object.keys(nonAnimatableStyleProps),\n \"flexBasis\"\n]);\nfunction motionPropsEqual(a, b) {\n for (const key in a) {\n if (!(key in b)) return false;\n }\n for (const key in b) {\n if (key === \"children\") continue;\n const av = a[key];\n const bv = b[key];\n if (typeof bv === \"function\" && typeof av === \"function\") continue;\n if (!Object.is(av, bv)) return false;\n }\n return true;\n}\nfunction motionStylesEqual(a, b) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n const sa = a[i];\n const sb = b[i];\n if (sa === sb) continue;\n if (!sa || !sb) return false;\n let aCount = 0;\n for (const key in sa) {\n aCount++;\n if (!Object.is(sa[key], sb[key])) return false;\n }\n let bCount = 0;\n for (const _key in sb) {\n bCount++;\n }\n if (aCount !== bCount) return false;\n }\n return true;\n}\nconst MotionView = createMotionView(\"div\");\nconst MotionText = createMotionView(\"span\");\nconst transformAliases = {\n x: \"translateX\",\n y: \"translateY\",\n scale: \"scale\",\n scaleX: \"scaleX\",\n scaleY: \"scaleY\",\n rotate: \"rotate\",\n rotateX: \"rotateX\",\n rotateY: \"rotateY\",\n rotateZ: \"rotateZ\",\n skewX: \"skewX\",\n skewY: \"skewY\"\n};\nfunction compileAnimatedStyle(initialSource, initialResolved) {\n const shorthands = getConfig().shorthands;\n const entries = Object.keys(initialSource).map((source) => ({\n source,\n target: shorthands?.[source] ?? source,\n tokenValue: typeof initialSource[source] === \"string\" && initialResolved[shorthands?.[source] ?? source] !== initialSource[source] ? initialResolved[shorthands?.[source] ?? source] : void 0\n }));\n return (sourceStyle) => {\n const resolved = {};\n const transforms = [];\n for (const entry of entries) {\n const value = sourceStyle[entry.source];\n if (value === void 0) continue;\n if (entry.source === \"transform\" && Array.isArray(value)) {\n resolved.transform = transformsToString(value);\n } else if (entry.source in transformAliases) {\n transforms.push({ [transformAliases[entry.source]]: value });\n } else {\n resolved[entry.target] = entry.tokenValue ?? normalizeValueWithProperty(value, entry.target);\n }\n }\n if (transforms.length) resolved.transform = transformsToString(transforms);\n return resolved;\n };\n}\nfunction createMotionView(defaultTag) {\n const isText = defaultTag === \"span\";\n const Component = createRefComponent((propsIn, ref) => {\n const { forwardedRef, animation, render = defaultTag, style, ...propsRest } = propsIn;\n const [scope, animate] = useAnimateSSRSafe();\n const hostRef = useRef(null);\n const seededNode = useRef(null);\n const seededInCurrentFrame = useRef(false);\n const queuedAnimationFrames = useRef(/* @__PURE__ */ new WeakMap());\n const composedRefs = useComposedRefs(forwardedRef, ref, hostRef, scope);\n const stateRef = useRef(null);\n if (!stateRef.current) {\n stateRef.current = {\n get host() {\n return hostRef.current;\n }\n };\n }\n const [_, state] = useThemeWithState({});\n const styles = Array.isArray(style) ? style : [style];\n const [animatedStyle, nonAnimatedStyles] = (() => {\n let animatedStyle2;\n const nonAnimatedStyles2 = [];\n for (const style2 of styles) {\n if (style2.getStyle) {\n animatedStyle2 = style2;\n } else {\n nonAnimatedStyles2.push(style2);\n }\n }\n return [animatedStyle2, nonAnimatedStyles2];\n })();\n function getProps(props2) {\n if (process.env.NODE_ENV === \"development\" && propsIn.debug === \"profile\" && typeof performance !== \"undefined\") {\n performance.mark(\"tamagui-motion-style-split\");\n }\n const out = getSplitStyles(\n props2,\n isText ? Text.staticConfig : View.staticConfig,\n state?.theme,\n state?.name,\n {\n unmounted: false\n },\n {\n isAnimated: false,\n noClass: true,\n resolveValues: \"auto\"\n }\n );\n if (!out) {\n return {};\n }\n if (out.viewProps.style) {\n fixStyles(out.viewProps.style);\n styleToCSS(out.viewProps.style);\n }\n return out.viewProps;\n }\n const resolvedAnimatedStyle = useMemo(() => {\n if (!animatedStyle) return null;\n const currentValues = animatedStyle.motionValues ? animatedStyle.motionValues.map((value) => value.get()) : animatedStyle.motionValue ? [animatedStyle.motionValue.get()] : [];\n const initialSource = animatedStyle.getStyle(...currentValues);\n const initialResolved = asStyleRecord(getProps({ style: initialSource }).style);\n return {\n initial: initialResolved,\n resolve: compileAnimatedStyle(initialSource, initialResolved)\n };\n }, [animatedStyle, state?.theme, state?.name]);\n const memoRef = useRef(null);\n let props;\n const cached = memoRef.current;\n if (cached && cached.theme === state?.theme && cached.themeName === state?.name && motionStylesEqual(cached.styles, nonAnimatedStyles) && motionPropsEqual(cached.propsRest, propsRest)) {\n props = { ...cached.result };\n for (const key in propsRest) {\n const val = propsRest[key];\n if (key === \"children\" || typeof val === \"function\") {\n props[key] = val;\n }\n }\n } else {\n props = getProps({ ...propsRest, style: nonAnimatedStyles });\n memoRef.current = {\n propsRest,\n styles: nonAnimatedStyles,\n theme: state?.theme,\n themeName: state?.name,\n result: props\n };\n }\n if (resolvedAnimatedStyle) {\n props = {\n ...props,\n style: {\n ...asStyleRecord(props.style),\n ...resolvedAnimatedStyle.initial\n }\n };\n }\n const Element = render || \"div\";\n const transformedProps = hooks.usePropsTransform?.(render, props, stateRef, false);\n useIsomorphicLayoutEffect(() => {\n if (!animatedStyle) return;\n const node = hostRef.current;\n if (node instanceof HTMLElement && seededNode.current !== node) {\n const currentStyle = animatedStyle.motionValues ? animatedStyle.getStyle(\n ...animatedStyle.motionValues.map((value) => value.get())\n ) : animatedStyle.motionValue ? animatedStyle.getStyle(animatedStyle.motionValue.get()) : null;\n const webStyle = currentStyle && resolvedAnimatedStyle?.resolve(currentStyle);\n if (webStyle) {\n assignInlineStyles(node, webStyle);\n seededNode.current = node;\n seededInCurrentFrame.current = true;\n requestAnimationFrame(() => {\n if (seededNode.current === node) seededInCurrentFrame.current = false;\n });\n }\n }\n const toTransition = (animationConfig) => animationConfig?.type === \"timing\" ? { type: \"tween\", duration: (animationConfig.duration || 0) / 1e3 } : animationConfig?.type === \"direct\" ? { type: \"tween\", duration: 0 } : { type: \"spring\", ...animationConfig };\n const animateNodeTo = (nextStyle, transition, motionValue3) => {\n if (!(node instanceof HTMLElement) || hostRef.current !== node) return;\n const webStyle = resolvedAnimatedStyle?.resolve(nextStyle);\n if (!webStyle) return;\n settlePendingMotionOnFinish(\n motionValue3,\n animate(node, webStyle, transition)\n );\n };\n const animateChangedValue = (nextStyle, transition, motionValue3) => {\n if (seededInCurrentFrame.current && seededNode.current === node) {\n const queuedFrame = queuedAnimationFrames.current.get(motionValue3);\n if (queuedFrame !== void 0) cancelAnimationFrame(queuedFrame);\n const frame = requestAnimationFrame(() => {\n if (queuedAnimationFrames.current.get(motionValue3) !== frame) return;\n queuedAnimationFrames.current.delete(motionValue3);\n if (hostRef.current === node) {\n animateNodeTo(nextStyle, transition, motionValue3);\n } else {\n const onFinish = PendingMotionOnFinish.get(motionValue3);\n PendingMotionOnFinish.delete(motionValue3);\n onFinish?.();\n }\n });\n queuedAnimationFrames.current.set(motionValue3, frame);\n return;\n }\n animateNodeTo(nextStyle, transition, motionValue3);\n };\n if (animatedStyle.motionValues) {\n const mvs = animatedStyle.motionValues;\n const styleForAll = () => animatedStyle.getStyle(...mvs.map((value) => value.get()));\n const unsubs = mvs.map(\n (mv) => mv.on(\n \"change\",\n () => animateChangedValue(\n styleForAll(),\n toTransition(MotionValueStrategy.get(mv)),\n mv\n )\n )\n );\n return () => unsubs.forEach((fn) => fn());\n }\n const motionValue2 = animatedStyle.motionValue;\n if (!motionValue2) return;\n return motionValue2.on(\n \"change\",\n (value) => animateChangedValue(\n animatedStyle.getStyle(value),\n toTransition(MotionValueStrategy.get(motionValue2)),\n motionValue2\n )\n );\n }, [animatedStyle, resolvedAnimatedStyle]);\n return /* @__PURE__ */ jsx(Element, { ...transformedProps, ref: composedRefs });\n });\n Component[\"acceptRenderProp\"] = true;\n return Component;\n}\nfunction getDiff(previous, next) {\n if (!previous) {\n return next;\n }\n let diff = null;\n for (const key in next) {\n if (next[key] !== previous[key]) {\n diff ||= {};\n diff[key] = next[key];\n }\n }\n return diff;\n}\nfunction fixTransparentColors(diff, previous, next) {\n let result = diff;\n for (const key in diff) {\n if (diff[key] === \"transparent\") {\n let fixed = \"rgba(0, 0, 0, 0)\";\n const candidates = [previous?.[key], next?.[key]];\n for (const candidate of candidates) {\n if (typeof candidate === \"string\" && candidate !== \"transparent\") {\n const rgbaMatch = candidate.match(/^rgba?\\(([^,]+),\\s*([^,]+),\\s*([^,)]+)/);\n if (rgbaMatch) {\n fixed = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0)`;\n break;\n }\n }\n }\n if (result === diff) {\n result = { ...diff };\n }\n result[key] = fixed;\n }\n }\n return result;\n}\nexport {\n createAnimations,\n disableAnimationProps\n};\n//# sourceMappingURL=createAnimations.js.map\n"],"mappings":";;;;;;;;;AAoCA,MAAM,WAAW,OAAO,WAAW;AACnC,SAAS,oBAAoB;CAC3B,IAAI,UAAU;EACZ,OAAO,CAAC,OAAO,IAAI,UAAU,CAC7B,EAAE;CACJ;CACA,OAAO,WAAW;AACpB;AACA,MAAM,iBAAiB,UAAU,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC;AACxG,SAAS,mBAAmB,MAAM,QAAQ;CACxC,KAAK,MAAM,OAAO,QAAQ;EACxB,KAAK,MAAM,OAAO,2BAA2B,OAAO,MAAM,GAAG;CAC/D;AACF;AACA,MAAM,sCAAsC,IAAI,QAAQ;AACxD,MAAM,wCAAwC,IAAI,QAAQ;AAC1D,SAAS,4BAA4B,IAAI,UAAU;CACjD,MAAM,WAAW,sBAAsB,IAAI,EAAE;CAC7C,IAAI,CAAC,UAAU;CACf,sBAAsB,OAAO,EAAE;CAC/B,SAAS,WAAW,SAAS,CAAC,CAAC,CAAC,YAAY,SAAS,CAAC;AACxD;AACA,MAAM,sCAAsC,IAAI,QAAQ;AACxD,SAAS,eAAe,WAAW;CACjC,IAAI,CAAC,aAAa,cAAc,QAAQ,OAAO;EAAE,GAAG;EAAG,GAAG;CAAE;CAC5D,IAAI;EACF,MAAM,IAAI,IAAI,kBAAkB,SAAS;EACzC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,EAAE,MAAM,GAAG,OAAO;EACxE,OAAO;GAAE,GAAG,EAAE;GAAG,GAAG,EAAE;EAAE;CAC1B,QAAQ;EACN,OAAO;CACT;AACF;AACA,SAAS,iBAAiB,YAAY;CACp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IAAI,KAAK,SAAS,SAAS,MAAM;GAC/B,SAAS,CAAC;GACV,KAAK,OAAO,KAAK;EACnB;CACF;CACA,OAAO;AACT;AACA,SAAS,qBAAqB,MAAM,UAAU,MAAM;CAClD,IAAI,SAAS;CACb,KAAK,MAAM,OAAO,MAAM;EACtB,IAAI,KAAK,SAAS,eAAe;GAC/B,IAAI,QAAQ;GACZ,MAAM,aAAa,CAAC,WAAW,MAAM,OAAO,IAAI;GAChD,KAAK,MAAM,aAAa,YAAY;IAClC,IAAI,OAAO,cAAc,YAAY,cAAc,eAAe;KAChE,MAAM,YAAY,UAAU,MAAM,wCAAwC;KAC1E,IAAI,WAAW;MACb,QAAQ,QAAQ,UAAU,GAAG,IAAI,UAAU,GAAG,IAAI,UAAU,GAAG;MAC/D;KACF;IACF;GACF;GACA,IAAI,WAAW,MAAM;IACnB,SAAS,EAAE,GAAG,KAAK;GACrB;GACA,OAAO,OAAO;EAChB;CACF;CACA,OAAO;AACT"}
@@ -1,22 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { getEffectiveAnimation, normalizeTransition } from "@tamagui/animation-helpers";
2
+ import { easingToBezier, forAnimationState, getTransitionForKey, hasTransition, resolveTransition, styleKeysForProperty } from "@tamagui/animation-helpers";
3
3
  import { ResetPresence, usePresence } from "@tamagui/use-presence";
4
4
  import { Text, View, createRefComponent, getConfig, getSplitStyles, hooks, nonAnimatableStyleProps, useComposedRefs, useIsomorphicLayoutEffect } from "@tamagui/web";
5
5
  import { fixStyles, normalizeValueWithProperty, styleToCSS, transformsToString, useThemeWithState } from "@tamagui/web/internal-runtime";
6
6
  import { animate, motionValue, useAnimate, useMotionValue, useMotionValueEvent } from "motion/react";
7
7
  import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
8
8
 
9
- function _instanceof(left, right) {
10
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
11
- return !!right[Symbol.hasInstance](left);
12
- } else {
13
- return left instanceof right;
14
- }
15
- }
16
- function _type_of(obj) {
17
- "@swc/helpers - typeof";
18
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
19
- }
20
9
  var isServer = typeof window === "undefined";
21
10
  function useAnimateSSRSafe() {
22
11
  if (isServer) {
@@ -25,7 +14,7 @@ function useAnimateSSRSafe() {
25
14
  return useAnimate();
26
15
  }
27
16
  var asStyleRecord = function(style) {
28
- return style && (typeof style === "undefined" ? "undefined" : _type_of(style)) === "object" && !Array.isArray(style) ? style : {};
17
+ return style && typeof style === "object" && !Array.isArray(style) ? style : {};
29
18
  };
30
19
  function assignInlineStyles(node, styles) {
31
20
  for (var key in styles) {
@@ -83,8 +72,9 @@ function createAnimations(animations) {
83
72
  if (isHydratingGlobal === void 0 && !getConfig().settings.disableSSR) {
84
73
  isHydratingGlobal = true;
85
74
  }
86
- var { props, style, componentState, stateRef, useStyleEmitter, presence, onTransition, styleProps } = animationProps;
87
- var animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition;
75
+ var { props, style, componentState, stateRef, useStyleEmitter, presence, onTransition, styleProps, styleState } = animationProps;
76
+ var _styleState_effectiveTransition;
77
+ var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
88
78
  var isComponentHydrating = componentState.unmounted === true;
89
79
  var isMounting = componentState.unmounted === "should-enter";
90
80
  var isEntering = !!componentState.unmounted;
@@ -133,7 +123,7 @@ function createAnimations(animations) {
133
123
  refs.current.wasEntering = isEntering;
134
124
  });
135
125
  var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
136
- var disableAnimation = isComponentHydrating || isMounting || !animationKey;
126
+ var disableAnimation = isComponentHydrating || isMounting || !effectiveTransition;
137
127
  var [scope] = useAnimateSSRSafe();
138
128
  refs.current.isExiting = isExiting;
139
129
  refs.current.sendExitComplete = sendExitComplete;
@@ -156,7 +146,7 @@ function createAnimations(animations) {
156
146
  emit("end", "exit", false);
157
147
  }
158
148
  }, [justStoppedExiting]);
159
- var { dontAnimate = {}, doAnimate, animationOptions } = getMotionAnimatedProps(props, style, disableAnimation, animationState);
149
+ var { dontAnimate = {}, doAnimate, animationOptions } = getMotionAnimatedProps(props, style, disableAnimation, animationState, effectiveTransition);
160
150
  var [firstRenderStyle] = useState(style);
161
151
  if (refs.current.isFirstRender) {
162
152
  refs.current.lastDontAnimate = firstRenderStyle;
@@ -182,8 +172,7 @@ function createAnimations(animations) {
182
172
  if (isCurrentlyExiting && refs.current.frozenExitTarget) {
183
173
  doAnimate2 = refs.current.frozenExitTarget;
184
174
  }
185
- var _props_transition;
186
- var animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions((_props_transition = props.transition) !== null && _props_transition !== void 0 ? _props_transition : null, "exit") : passedOptions;
175
+ var animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions(forAnimationState(resolveTransition(effectiveTransition !== null && effectiveTransition !== void 0 ? effectiveTransition : null, { animations }), "exit")) : passedOptions;
187
176
  try {
188
177
  var node = stateRef.current.host;
189
178
  if (refs.current.isFirstRender) {
@@ -212,7 +201,7 @@ function createAnimations(animations) {
212
201
  console.groupEnd();
213
202
  }
214
203
  }
215
- if (!_instanceof(node, HTMLElement)) {
204
+ if (!(node instanceof HTMLElement)) {
216
205
  return;
217
206
  }
218
207
  var prevDont = refs.current.lastDontAnimate;
@@ -313,8 +302,8 @@ function createAnimations(animations) {
313
302
  }
314
303
  }
315
304
  var opts = animationOptions2;
316
- var _opts_transform, _ref;
317
- var positionTransition = (_ref = (_opts_transform = opts.transform) !== null && _opts_transform !== void 0 ? _opts_transform : opts.default) !== null && _ref !== void 0 ? _ref : animationOptions2;
305
+ var _opts_x, _ref, _ref1;
306
+ var positionTransition = (_ref1 = (_ref = (_opts_x = opts.x) !== null && _opts_x !== void 0 ? _opts_x : opts.transform) !== null && _ref !== void 0 ? _ref : opts.default) !== null && _ref1 !== void 0 ? _ref1 : animationOptions2;
318
307
  var cx = animate(entry.x, target.x, positionTransition);
319
308
  var cy = animate(entry.y, target.y, positionTransition);
320
309
  entry.stop = function() {
@@ -474,8 +463,8 @@ function createAnimations(animations) {
474
463
  }
475
464
  }
476
465
  };
477
- useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, effectiveTransition) {
478
- var _$animationProps = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, effectiveTransition);
466
+ useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, emittedTransition) {
467
+ var _$animationProps = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, emittedTransition !== null && emittedTransition !== void 0 ? emittedTransition : effectiveTransition);
479
468
  flushAnimation(_$animationProps);
480
469
  });
481
470
  useIsomorphicLayoutEffect(function() {
@@ -502,7 +491,7 @@ function createAnimations(animations) {
502
491
  refs.current.wasNoClass = !!styleProps.noClass;
503
492
  if ((justEnabled || justStrippedClasses) && animationState !== "enter") {
504
493
  var node = stateRef.current.host;
505
- if (_instanceof(node, HTMLElement)) {
494
+ if (node instanceof HTMLElement) {
506
495
  if (dontAnimate) assignInlineStyles(node, dontAnimate);
507
496
  if (doAnimate) assignInlineStyles(node, doAnimate);
508
497
  var entry = PopperPositionAnims.get(node);
@@ -633,13 +622,13 @@ function createAnimations(animations) {
633
622
  return { dontAnimate: style };
634
623
  }
635
624
  var _ref;
636
- var animationOptions = getAnimationOptions((_ref = transitionOverride !== null && transitionOverride !== void 0 ? transitionOverride : props.transition) !== null && _ref !== void 0 ? _ref : null, animationState);
625
+ var resolved = forAnimationState(resolveTransition((_ref = transitionOverride !== null && transitionOverride !== void 0 ? transitionOverride : props.transition) !== null && _ref !== void 0 ? _ref : null, { animations }), animationState);
626
+ var animationOptions = getAnimationOptions(resolved);
637
627
  var dontAnimate;
638
628
  var doAnimate;
639
- var animateOnly = props.animateOnly;
640
629
  for (var key in style) {
641
630
  var value = style[key];
642
- if (disableAnimationProps.has(key) || animateOnly && !animateOnly.includes(key)) {
631
+ if (disableAnimationProps.has(key) || !getTransitionForKey(resolved, key)) {
643
632
  dontAnimate || (dontAnimate = {});
644
633
  dontAnimate[key] = value;
645
634
  } else {
@@ -653,51 +642,39 @@ function createAnimations(animations) {
653
642
  animationOptions
654
643
  };
655
644
  }
656
- function getAnimationOptions(transitionProp) {
657
- var animationState = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
658
- var normalized = normalizeTransition(transitionProp);
659
- var effectiveKey = getEffectiveAnimation(normalized, animationState);
660
- if (!effectiveKey && animationState === "default") {
661
- effectiveKey = normalized.enter || normalized.exit || null;
662
- }
663
- var globalConfigOverride = normalized.config ? { ...normalized.config } : void 0;
664
- if (!effectiveKey && Object.keys(normalized.properties).length === 0 && !globalConfigOverride) {
665
- return {};
666
- }
667
- var defaultConfig = effectiveKey ? withInferredType(animations[effectiveKey]) : null;
668
- var delay = normalized.delay;
645
+ function getAnimationOptions(resolved) {
646
+ if (!hasTransition(resolved)) return {};
669
647
  var result = {};
670
- if (defaultConfig) {
671
- Object.assign(result, defaultConfig);
672
- }
673
- if (globalConfigOverride) {
674
- Object.assign(result, globalConfigOverride);
675
- if (result.type === void 0 && result.duration !== void 0 && result.damping === void 0 && result.stiffness === void 0 && result.mass === void 0) {
676
- result.type = "tween";
677
- }
678
- }
679
- if (delay) {
680
- result.delay = delay;
681
- }
682
- if (defaultConfig || globalConfigOverride || delay) {
683
- result.default = {
684
- ...defaultConfig,
685
- ...globalConfigOverride,
686
- ...delay ? { delay } : null
687
- };
648
+ if (resolved.all) {
649
+ var base = entryToMotion(resolved.all);
650
+ Object.assign(result, base);
651
+ result.default = { ...base };
688
652
  }
689
653
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
690
654
  try {
691
- for (var _iterator = Object.entries(normalized.properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
692
- var [propName, animationNameOrConfig] = _step.value;
693
- if (typeof animationNameOrConfig === "string") {
694
- result[propName] = withInferredType(animations[animationNameOrConfig]);
695
- } else if (animationNameOrConfig && (typeof animationNameOrConfig === "undefined" ? "undefined" : _type_of(animationNameOrConfig)) === "object") {
696
- var baseConfig = animationNameOrConfig.type ? withInferredType(animations[animationNameOrConfig.type]) : defaultConfig;
697
- result[propName] = {
698
- ...baseConfig,
699
- ...animationNameOrConfig
700
- };
655
+ for (var _iterator = resolved.entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
656
+ var entry = _step.value;
657
+ if (entry.property === "all") continue;
658
+ var config = entryToMotion(entry);
659
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
660
+ try {
661
+ for (var _iterator1 = styleKeysForProperty(entry.property)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
662
+ var key = _step1.value;
663
+ result[key] = { ...config };
664
+ }
665
+ } catch (err) {
666
+ _didIteratorError1 = true;
667
+ _iteratorError1 = err;
668
+ } finally {
669
+ try {
670
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
671
+ _iterator1.return();
672
+ }
673
+ } finally {
674
+ if (_didIteratorError1) {
675
+ throw _iteratorError1;
676
+ }
677
+ }
701
678
  }
702
679
  }
703
680
  } catch (err) {
@@ -714,36 +691,33 @@ function createAnimations(animations) {
714
691
  }
715
692
  }
716
693
  }
717
- convertMsToS(result);
718
- convertMsToS(result.default);
719
- for (var key in result) {
720
- if (key !== "default" && _type_of(result[key]) === "object") {
721
- convertMsToS(result[key]);
722
- }
723
- }
724
694
  return result;
725
695
  }
726
696
  }
727
- function withInferredType(config) {
728
- if (!config) {
729
- return { type: "spring" };
697
+ function entryToMotion(entry) {
698
+ var delay = entry.delayMs ? { delay: entry.delayMs / 1e3 } : null;
699
+ if (entry.timing.kind === "spring") {
700
+ return {
701
+ type: "spring",
702
+ stiffness: entry.timing.stiffness,
703
+ damping: entry.timing.damping,
704
+ mass: entry.timing.mass,
705
+ ...delay
706
+ };
730
707
  }
731
- var isTimingBased = config.duration !== void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
708
+ var bezier = easingToBezier(entry.timing.easing);
732
709
  return {
733
- type: isTimingBased ? "tween" : "spring",
734
- ...config
710
+ type: "tween",
711
+ duration: entry.timing.durationMs / 1e3,
712
+ ...bezier ? { ease: [
713
+ bezier[0],
714
+ bezier[1],
715
+ bezier[2],
716
+ bezier[3]
717
+ ] } : null,
718
+ ...delay
735
719
  };
736
720
  }
737
- function convertMsToS(config) {
738
- if (!config) return;
739
- if (typeof config.delay === "number") config.delay = config.delay / 1e3;
740
- if (typeof config.duration === "number") {
741
- var isTimingBased = config.type === "tween" || config.type === void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
742
- if (isTimingBased) {
743
- config.duration = config.duration / 1e3;
744
- }
745
- }
746
- }
747
721
  function removeRemovedStyles(prev, next, node, dontClearIfIn) {
748
722
  for (var key in prev) {
749
723
  if (!(key in next)) {
@@ -969,7 +943,7 @@ function createMotionView(defaultTag) {
969
943
  useIsomorphicLayoutEffect(function() {
970
944
  if (!animatedStyle) return;
971
945
  var node = hostRef.current;
972
- if (_instanceof(node, HTMLElement) && seededNode.current !== node) {
946
+ if (node instanceof HTMLElement && seededNode.current !== node) {
973
947
  var currentStyle = animatedStyle.motionValues ? animatedStyle.getStyle(...animatedStyle.motionValues.map(function(value) {
974
948
  return value.get();
975
949
  })) : animatedStyle.motionValue ? animatedStyle.getStyle(animatedStyle.motionValue.get()) : null;
@@ -996,7 +970,7 @@ function createMotionView(defaultTag) {
996
970
  };
997
971
  };
998
972
  var animateNodeTo = function(nextStyle, transition, motionValue3) {
999
- if (!_instanceof(node, HTMLElement) || hostRef.current !== node) return;
973
+ if (!(node instanceof HTMLElement) || hostRef.current !== node) return;
1000
974
  var webStyle2 = resolvedAnimatedStyle === null || resolvedAnimatedStyle === void 0 ? void 0 : resolvedAnimatedStyle.resolve(nextStyle);
1001
975
  if (!webStyle2) return;
1002
976
  settlePendingMotionOnFinish(motionValue3, animate(node, webStyle2, transition));