@tamagui/animations-motion 3.0.18 → 3.1.0
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 +26 -7
- package/dist/cjs/createAnimations.native.cjs +26 -7
- package/dist/cjs/createAnimations.native.js +26 -7
- package/dist/cjs/createAnimations.native.js.map +1 -1
- package/dist/esm/createAnimations.mjs +26 -7
- package/dist/esm/createAnimations.mjs.map +1 -1
- package/dist/esm/createAnimations.native.js +26 -7
- package/dist/esm/createAnimations.native.js.map +1 -1
- package/package.json +7 -7
- package/src/createAnimations.tsx +32 -11
- package/types/createAnimations.d.ts.map +2 -2
|
@@ -21,6 +21,7 @@ function assignInlineStyles(node, styles) {
|
|
|
21
21
|
}
|
|
22
22
|
const MotionValueStrategy = /* @__PURE__ */ new WeakMap();
|
|
23
23
|
const PendingMotionOnFinish = /* @__PURE__ */ new WeakMap();
|
|
24
|
+
const pendingDirectStyles = /* @__PURE__ */ new WeakMap();
|
|
24
25
|
function settlePendingMotionOnFinish(mv, controls) {
|
|
25
26
|
const onFinish = PendingMotionOnFinish.get(mv);
|
|
26
27
|
if (!onFinish) return;
|
|
@@ -808,13 +809,31 @@ function createMotionView(defaultTag) {
|
|
|
808
809
|
type: "spring",
|
|
809
810
|
...animationConfig
|
|
810
811
|
};
|
|
811
|
-
const animateNodeTo = (nextStyle,
|
|
812
|
+
const animateNodeTo = (nextStyle, strategy, motionValue3) => {
|
|
812
813
|
if (!(node instanceof HTMLElement) || hostRef.current !== node) return;
|
|
813
814
|
const webStyle = resolvedAnimatedStyle?.resolve(nextStyle);
|
|
814
815
|
if (!webStyle) return;
|
|
815
|
-
|
|
816
|
+
const directStyle = pendingDirectStyles.get(node);
|
|
817
|
+
const isDirect = strategy?.type === "direct";
|
|
818
|
+
let target = webStyle;
|
|
819
|
+
if (directStyle && !isDirect) {
|
|
820
|
+
target = { ...webStyle };
|
|
821
|
+
for (const key in directStyle) {
|
|
822
|
+
if (key in webStyle) target[key] = [directStyle[key], webStyle[key]];
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (isDirect) {
|
|
826
|
+
assignInlineStyles(node, webStyle);
|
|
827
|
+
pendingDirectStyles.set(node, webStyle);
|
|
828
|
+
requestAnimationFrame(() => {
|
|
829
|
+
if (pendingDirectStyles.get(node) === webStyle) {
|
|
830
|
+
pendingDirectStyles.delete(node);
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
settlePendingMotionOnFinish(motionValue3, animate(node, target, toTransition(strategy)));
|
|
816
835
|
};
|
|
817
|
-
const animateChangedValue = (nextStyle,
|
|
836
|
+
const animateChangedValue = (nextStyle, strategy, motionValue3) => {
|
|
818
837
|
if (seededInCurrentFrame.current && seededNode.current === node) {
|
|
819
838
|
const queuedFrame = queuedAnimationFrames.current.get(motionValue3);
|
|
820
839
|
if (queuedFrame !== void 0) cancelAnimationFrame(queuedFrame);
|
|
@@ -822,7 +841,7 @@ function createMotionView(defaultTag) {
|
|
|
822
841
|
if (queuedAnimationFrames.current.get(motionValue3) !== frame) return;
|
|
823
842
|
queuedAnimationFrames.current.delete(motionValue3);
|
|
824
843
|
if (hostRef.current === node) {
|
|
825
|
-
animateNodeTo(nextStyle,
|
|
844
|
+
animateNodeTo(nextStyle, strategy, motionValue3);
|
|
826
845
|
} else {
|
|
827
846
|
const onFinish = PendingMotionOnFinish.get(motionValue3);
|
|
828
847
|
PendingMotionOnFinish.delete(motionValue3);
|
|
@@ -832,17 +851,17 @@ function createMotionView(defaultTag) {
|
|
|
832
851
|
queuedAnimationFrames.current.set(motionValue3, frame);
|
|
833
852
|
return;
|
|
834
853
|
}
|
|
835
|
-
animateNodeTo(nextStyle,
|
|
854
|
+
animateNodeTo(nextStyle, strategy, motionValue3);
|
|
836
855
|
};
|
|
837
856
|
if (animatedStyle.motionValues) {
|
|
838
857
|
const mvs = animatedStyle.motionValues;
|
|
839
858
|
const styleForAll = () => animatedStyle.getStyle(...mvs.map((value) => value.get()));
|
|
840
|
-
const unsubs = mvs.map((mv) => mv.on("change", () => animateChangedValue(styleForAll(),
|
|
859
|
+
const unsubs = mvs.map((mv) => mv.on("change", () => animateChangedValue(styleForAll(), MotionValueStrategy.get(mv), mv)));
|
|
841
860
|
return () => unsubs.forEach((fn) => fn());
|
|
842
861
|
}
|
|
843
862
|
const motionValue2 = animatedStyle.motionValue;
|
|
844
863
|
if (!motionValue2) return;
|
|
845
|
-
return motionValue2.on("change", (value) => animateChangedValue(animatedStyle.getStyle(value),
|
|
864
|
+
return motionValue2.on("change", (value) => animateChangedValue(animatedStyle.getStyle(value), MotionValueStrategy.get(motionValue2), motionValue2));
|
|
846
865
|
}, [animatedStyle, resolvedAnimatedStyle]);
|
|
847
866
|
return /* @__PURE__ */ jsx(Element, {
|
|
848
867
|
...transformedProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnimations.js","names":["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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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();\nconst pendingDirectStyles = /* @__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, strategy, motionValue3) => {\n if (!(node instanceof HTMLElement) || hostRef.current !== node) return;\n const webStyle = resolvedAnimatedStyle?.resolve(nextStyle);\n if (!webStyle) return;\n const directStyle = pendingDirectStyles.get(node);\n const isDirect = strategy?.type === \"direct\";\n let target = webStyle;\n if (directStyle && !isDirect) {\n target = { ...webStyle };\n for (const key in directStyle) {\n if (key in webStyle) target[key] = [directStyle[key], webStyle[key]];\n }\n }\n if (isDirect) {\n assignInlineStyles(node, webStyle);\n pendingDirectStyles.set(node, webStyle);\n requestAnimationFrame(() => {\n if (pendingDirectStyles.get(node) === webStyle) {\n pendingDirectStyles.delete(node);\n }\n });\n }\n settlePendingMotionOnFinish(\n motionValue3,\n animate(node, target, toTransition(strategy))\n );\n };\n const animateChangedValue = (nextStyle, strategy, 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, strategy, 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, strategy, 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(styleForAll(), MotionValueStrategy.get(mv), mv)\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 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,MAAM,sCAAsC,IAAI,QAAQ;AACxD,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,WAA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G,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"}
|
|
@@ -23,6 +23,7 @@ function assignInlineStyles(node, styles) {
|
|
|
23
23
|
}
|
|
24
24
|
var MotionValueStrategy = /* @__PURE__ */ new WeakMap();
|
|
25
25
|
var PendingMotionOnFinish = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
var pendingDirectStyles = /* @__PURE__ */ new WeakMap();
|
|
26
27
|
function settlePendingMotionOnFinish(mv, controls) {
|
|
27
28
|
var onFinish = PendingMotionOnFinish.get(mv);
|
|
28
29
|
if (!onFinish) return;
|
|
@@ -969,13 +970,31 @@ function createMotionView(defaultTag) {
|
|
|
969
970
|
...animationConfig
|
|
970
971
|
};
|
|
971
972
|
};
|
|
972
|
-
var animateNodeTo = function animateNodeTo2(nextStyle,
|
|
973
|
+
var animateNodeTo = function animateNodeTo2(nextStyle, strategy, motionValue3) {
|
|
973
974
|
if (!(node instanceof HTMLElement) || hostRef.current !== node) return;
|
|
974
975
|
var webStyle2 = resolvedAnimatedStyle === null || resolvedAnimatedStyle === void 0 ? void 0 : resolvedAnimatedStyle.resolve(nextStyle);
|
|
975
976
|
if (!webStyle2) return;
|
|
976
|
-
|
|
977
|
+
var directStyle = pendingDirectStyles.get(node);
|
|
978
|
+
var isDirect = (strategy === null || strategy === void 0 ? void 0 : strategy.type) === "direct";
|
|
979
|
+
var target = webStyle2;
|
|
980
|
+
if (directStyle && !isDirect) {
|
|
981
|
+
target = { ...webStyle2 };
|
|
982
|
+
for (var key2 in directStyle) {
|
|
983
|
+
if (key2 in webStyle2) target[key2] = [directStyle[key2], webStyle2[key2]];
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if (isDirect) {
|
|
987
|
+
assignInlineStyles(node, webStyle2);
|
|
988
|
+
pendingDirectStyles.set(node, webStyle2);
|
|
989
|
+
requestAnimationFrame(function() {
|
|
990
|
+
if (pendingDirectStyles.get(node) === webStyle2) {
|
|
991
|
+
pendingDirectStyles.delete(node);
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
settlePendingMotionOnFinish(motionValue3, animate(node, target, toTransition(strategy)));
|
|
977
996
|
};
|
|
978
|
-
var animateChangedValue = function animateChangedValue2(nextStyle,
|
|
997
|
+
var animateChangedValue = function animateChangedValue2(nextStyle, strategy, motionValue3) {
|
|
979
998
|
if (seededInCurrentFrame.current && seededNode.current === node) {
|
|
980
999
|
var queuedFrame = queuedAnimationFrames.current.get(motionValue3);
|
|
981
1000
|
if (queuedFrame !== void 0) cancelAnimationFrame(queuedFrame);
|
|
@@ -983,7 +1002,7 @@ function createMotionView(defaultTag) {
|
|
|
983
1002
|
if (queuedAnimationFrames.current.get(motionValue3) !== frame) return;
|
|
984
1003
|
queuedAnimationFrames.current.delete(motionValue3);
|
|
985
1004
|
if (hostRef.current === node) {
|
|
986
|
-
animateNodeTo(nextStyle,
|
|
1005
|
+
animateNodeTo(nextStyle, strategy, motionValue3);
|
|
987
1006
|
} else {
|
|
988
1007
|
var onFinish = PendingMotionOnFinish.get(motionValue3);
|
|
989
1008
|
PendingMotionOnFinish.delete(motionValue3);
|
|
@@ -993,7 +1012,7 @@ function createMotionView(defaultTag) {
|
|
|
993
1012
|
queuedAnimationFrames.current.set(motionValue3, frame);
|
|
994
1013
|
return;
|
|
995
1014
|
}
|
|
996
|
-
animateNodeTo(nextStyle,
|
|
1015
|
+
animateNodeTo(nextStyle, strategy, motionValue3);
|
|
997
1016
|
};
|
|
998
1017
|
if (animatedStyle.motionValues) {
|
|
999
1018
|
var mvs = animatedStyle.motionValues;
|
|
@@ -1004,7 +1023,7 @@ function createMotionView(defaultTag) {
|
|
|
1004
1023
|
};
|
|
1005
1024
|
var unsubs = mvs.map(function(mv) {
|
|
1006
1025
|
return mv.on("change", function() {
|
|
1007
|
-
return animateChangedValue(styleForAll(),
|
|
1026
|
+
return animateChangedValue(styleForAll(), MotionValueStrategy.get(mv), mv);
|
|
1008
1027
|
});
|
|
1009
1028
|
});
|
|
1010
1029
|
return function() {
|
|
@@ -1016,7 +1035,7 @@ function createMotionView(defaultTag) {
|
|
|
1016
1035
|
var motionValue2 = animatedStyle.motionValue;
|
|
1017
1036
|
if (!motionValue2) return;
|
|
1018
1037
|
return motionValue2.on("change", function(value) {
|
|
1019
|
-
return animateChangedValue(animatedStyle.getStyle(value),
|
|
1038
|
+
return animateChangedValue(animatedStyle.getStyle(value), MotionValueStrategy.get(motionValue2), motionValue2);
|
|
1020
1039
|
});
|
|
1021
1040
|
}, [animatedStyle, resolvedAnimatedStyle]);
|
|
1022
1041
|
return /* @__PURE__ */ jsx(Element, {
|