@onlynative/inertia 0.0.1-alpha.0 → 0.0.1-alpha.2
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/README.md +7 -7
- package/dist/index.d.mts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +84 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -11
- package/dist/index.mjs.map +1 -1
- package/dist/motion/Image.d.mts +1 -1
- package/dist/motion/Image.d.ts +1 -1
- package/dist/motion/Image.js +84 -10
- package/dist/motion/Image.js.map +1 -1
- package/dist/motion/Image.mjs +85 -11
- package/dist/motion/Image.mjs.map +1 -1
- package/dist/motion/Pressable.d.mts +1 -1
- package/dist/motion/Pressable.d.ts +1 -1
- package/dist/motion/Pressable.js +84 -10
- package/dist/motion/Pressable.js.map +1 -1
- package/dist/motion/Pressable.mjs +85 -11
- package/dist/motion/Pressable.mjs.map +1 -1
- package/dist/motion/ScrollView.d.mts +1 -1
- package/dist/motion/ScrollView.d.ts +1 -1
- package/dist/motion/ScrollView.js +84 -10
- package/dist/motion/ScrollView.js.map +1 -1
- package/dist/motion/ScrollView.mjs +85 -11
- package/dist/motion/ScrollView.mjs.map +1 -1
- package/dist/motion/Text.d.mts +1 -1
- package/dist/motion/Text.d.ts +1 -1
- package/dist/motion/Text.js +84 -10
- package/dist/motion/Text.js.map +1 -1
- package/dist/motion/Text.mjs +85 -11
- package/dist/motion/Text.mjs.map +1 -1
- package/dist/motion/View.d.mts +1 -1
- package/dist/motion/View.d.ts +1 -1
- package/dist/motion/View.js +84 -10
- package/dist/motion/View.js.map +1 -1
- package/dist/motion/View.mjs +85 -11
- package/dist/motion/View.mjs.map +1 -1
- package/dist/testing/index.d.mts +57 -0
- package/dist/testing/index.d.ts +57 -0
- package/dist/testing/index.js +19 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/index.mjs +16 -0
- package/dist/testing/index.mjs.map +1 -0
- package/dist/{types-CmbXx-G3.d.mts → types-DeZZzE_e.d.mts} +20 -3
- package/dist/{types-CmbXx-G3.d.ts → types-DeZZzE_e.d.ts} +20 -3
- package/llms.txt +5 -1
- package/package.json +19 -12
- package/src/gestures/focusVisibility.ts +61 -0
- package/src/gestures/index.ts +1 -0
- package/src/motion/createMotionComponent.tsx +132 -47
- package/src/testing/index.ts +78 -0
- package/src/types.ts +20 -3
package/dist/motion/Image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/MotionConfigContext.ts","../../src/presence/PresenceContext.ts","../../src/transitions/easing.ts","../../src/transitions/resolve.ts","../../src/motion/createMotionComponent.tsx","../../src/motion/Image.tsx"],"names":["createContext","useContext","useReducedMotion","isWorkletFunction","withSpring","withTiming","Easing","withDecay","withRepeat","withDelay","step","withSequence","Animated","forwardRef","Motion","useRef","useState","useEffect","useAnimatedStyle","useMemo","jsx","useSharedValue","runOnJS","Image"],"mappings":";;;;;;;;;;;;AAwBO,IAAM,qBAAA,GAA2C;AAAA,EACtD,aAAA,EAAe;AACjB,CAAA;AAEO,IAAM,mBAAA,GAAsBA,mBAAA;AAAA,EACjC;AACF,CAAA;AAMO,SAAS,eAAA,GAAqC;AACnD,EAAA,OAAOC,iBAAW,mBAAmB,CAAA;AACvC;AAQO,SAAS,qBAAA,GAAiC;AAC/C,EAAA,MAAM,EAAE,aAAA,EAAc,GAAI,eAAA,EAAgB;AAC1C,EAAA,MAAM,YAAYC,yBAAA,EAAiB;AACnC,EAAA,IAAI,aAAA,KAAkB,SAAS,OAAO,KAAA;AACtC,EAAA,IAAI,aAAA,KAAkB,UAAU,OAAO,IAAA;AACvC,EAAA,OAAO,SAAA;AACT;AClCO,IAAM,eAAA,GAAkBF,oBAA2C,IAAI,CAAA;AAOvE,SAAS,WAAA,GAA2C;AACzD,EAAA,OAAOC,iBAAW,eAAe,CAAA;AACnC;ACTO,SAAS,oBACd,MAAA,EACqC;AACrC,EAAA,IAAI,CAAC,QAAQ,OAAO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,sBAAsBI,iBAAK","file":"Image.js","sourcesContent":["import { createContext, useContext } from 'react'\nimport { useReducedMotion } from 'react-native-reanimated'\n\n/**\n * How descendant Motion primitives should treat reduced-motion preferences.\n *\n * - `'user'` (default): defer to the OS accessibility setting via\n * Reanimated's `useReducedMotion()`. This is the only value that respects\n * user choice and is the right default for app-level wrappers.\n * - `'never'`: animate regardless of OS setting. Use sparingly — e.g. for\n * onboarding transitions you've decided are essential.\n * - `'always'`: never animate, regardless of OS setting. Useful for tests\n * and snapshots.\n */\nexport type ReducedMotion = 'user' | 'never' | 'always'\n\nexport interface MotionConfigValue {\n reducedMotion: ReducedMotion\n}\n\n/**\n * Default config used when a Motion primitive is rendered without a\n * `<MotionConfig>` ancestor. `'user'` means respect the OS setting.\n */\nexport const DEFAULT_MOTION_CONFIG: MotionConfigValue = {\n reducedMotion: 'user',\n}\n\nexport const MotionConfigContext = createContext<MotionConfigValue>(\n DEFAULT_MOTION_CONFIG,\n)\n\n/**\n * Read the active `<MotionConfig>` from a descendant. Returns the default\n * (`'user'`) when no provider is present.\n */\nexport function useMotionConfig(): MotionConfigValue {\n return useContext(MotionConfigContext)\n}\n\n/**\n * Resolve the active reduced-motion mode to a boolean. `'user'` consults\n * Reanimated's OS-backed hook; `'always'` / `'never'` shortcut. Motion\n * primitives call this to decide whether to swap transitions for\n * `no-animation`.\n */\nexport function useShouldReduceMotion(): boolean {\n const { reducedMotion } = useMotionConfig()\n const osReduced = useReducedMotion()\n if (reducedMotion === 'never') return false\n if (reducedMotion === 'always') return true\n return osReduced\n}\n","import { createContext, useContext } from 'react'\n\n/**\n * Per-child contract between `<Presence>` and its descendant Motion\n * primitives. `<Presence>` provides a fresh value to each rendered child;\n * Motion primitives consume it to gate exit animations.\n *\n * - `isPresent`: `true` while the child is in the incoming children list.\n * Flips to `false` when the parent removes it; the child remains rendered\n * until `safeToRemove` is called.\n * - `safeToRemove`: callback the child invokes when its exit animation has\n * settled. `<Presence>` then drops the snapshot entry and unmounts.\n */\nexport interface PresenceContextValue {\n isPresent: boolean\n safeToRemove: () => void\n}\n\nexport const PresenceContext = createContext<PresenceContextValue | null>(null)\n\n/**\n * Read the surrounding `<Presence>` contract from a child component. Returns\n * `null` when there is no `<Presence>` ancestor — useful for components that\n * want to support both standalone and Presence-wrapped use without branching.\n */\nexport function usePresence(): PresenceContextValue | null {\n return useContext(PresenceContext)\n}\n","import { isWorkletFunction } from 'react-native-reanimated'\n\n/**\n * Reanimated 3.9+ validates that easing functions used in nested-transition\n * contexts (variants, sequences, per-property maps) are worklets, and crashes\n * with `[Reanimated] The easing function is not a worklet` otherwise. The\n * library accepts plain functions on the public surface; this helper wraps\n * them so consumers don't have to think about the worklet boundary.\n *\n * If the input is already a worklet (has been processed by the worklets babel\n * plugin), it's returned as-is. Otherwise it's wrapped in a function whose\n * body declares the `'worklet'` directive — when our source is processed by\n * the consumer's worklets babel plugin (the default Expo/RN setup), the\n * wrapper becomes a real worklet that captures the user fn via closure.\n *\n * The user fn must be pure: no JS-thread captured refs, no shared mutable\n * state, no calls to non-worklet APIs.\n */\nexport function ensureWorkletEasing(\n easing: ((t: number) => number) | undefined,\n): ((t: number) => number) | undefined {\n if (!easing) return undefined\n if (isWorkletFunction(easing)) return easing\n const wrapped = (t: number) => {\n 'worklet'\n return easing(t)\n }\n return wrapped\n}\n","import {\n Easing,\n withDecay,\n withDelay,\n withRepeat,\n withSequence,\n withSpring,\n withTiming,\n} from 'react-native-reanimated'\nimport { ensureWorkletEasing } from './easing'\nimport {\n type AnimatableValue,\n type DecayTransition,\n type RepeatConfig,\n type SequenceStep,\n type SpringTransition,\n type TimingTransition,\n type TransitionConfig,\n} from '../types'\n\n/**\n * UI-thread callback Reanimated invokes when an animation settles. Must be a\n * worklet — callers either author one with `'worklet'` or build one via\n * `runOnJS(...)` to bridge to JS-thread code.\n */\nexport type AnimationCallback = (\n finished?: boolean,\n current?: number | string,\n) => void\n\n/**\n * Per-step callback factory. Resolvers call this with the step's phase and\n * sequence index (or `undefined` for non-sequence animations) and attach the\n * resulting callback to the underlying `withSpring` / `withTiming` /\n * `withDecay` call.\n */\nexport type CallbackFactory = (\n phase: 'step' | 'animation',\n step: number | undefined,\n) => AnimationCallback | undefined\n\n/**\n * Default spring physics, expressed in react-spring vocabulary. Conversion\n * to Reanimated's raw `stiffness` / `damping` lives below; raw config never\n * leaks past this module.\n */\nconst DEFAULT_SPRING: Required<\n Pick<SpringTransition, 'tension' | 'friction' | 'mass'>\n> = {\n tension: 170,\n friction: 26,\n mass: 1,\n}\n\nconst DEFAULT_TIMING_DURATION = 250\n\nfunction springToReanimated(t: SpringTransition) {\n return {\n stiffness: t.tension ?? DEFAULT_SPRING.tension,\n damping: t.friction ?? DEFAULT_SPRING.friction,\n mass: t.mass ?? DEFAULT_SPRING.mass,\n velocity: t.velocity,\n restSpeedThreshold: t.restSpeedThreshold,\n restDisplacementThreshold: t.restDisplacementThreshold,\n }\n}\n\nfunction buildSpring(\n cfg: SpringTransition,\n toValue: number | string,\n cb?: AnimationCallback,\n) {\n return withSpring(toValue as number, springToReanimated(cfg), cb as never)\n}\n\nfunction buildTiming(\n cfg: TimingTransition,\n toValue: number | string,\n cb?: AnimationCallback,\n) {\n return withTiming(\n toValue as number,\n {\n duration: cfg.duration ?? DEFAULT_TIMING_DURATION,\n easing: ensureWorkletEasing(cfg.easing) ?? Easing.inOut(Easing.ease),\n },\n cb as never,\n )\n}\n\nfunction buildDecay(cfg: DecayTransition, cb?: AnimationCallback) {\n return withDecay(\n {\n velocity: cfg.velocity ?? 0,\n deceleration: cfg.deceleration,\n clamp: cfg.clamp,\n },\n cb as never,\n )\n}\n\n/**\n * Build a single-step animation (no repeat / no delay / no sequence) for a\n * given config + target. Pulled out so sequence steps can compose without\n * recursing into repeat/delay handling per step. The callback is forwarded\n * to Reanimated; for `no-animation` the callback is fired synchronously\n * since there's nothing to wait for.\n */\nfunction buildOne(\n cfg: TransitionConfig,\n toValue: number | string,\n cb?: AnimationCallback,\n): unknown {\n if (cfg.type === 'no-animation') {\n if (cb) cb(true, toValue)\n return toValue\n }\n if (cfg.type === 'decay') return buildDecay(cfg, cb)\n if (cfg.type === 'timing') return buildTiming(cfg, toValue, cb)\n return buildSpring(cfg as SpringTransition, toValue, cb)\n}\n\n/**\n * Wrap an animation in `withRepeat` per the unified `repeat` shape:\n * - `number` → finite count, alternating direction\n * - `'infinite'` → endless, alternating direction\n * - `{ count, alternate }`→ explicit; `alternate` defaults to `true`\n */\nfunction applyRepeat(animation: unknown, repeat: RepeatConfig | undefined) {\n if (repeat === undefined) return animation\n if (repeat === 'infinite') {\n return withRepeat(animation as never, -1, true)\n }\n if (typeof repeat === 'number') {\n return withRepeat(animation as never, repeat, true)\n }\n const count = repeat.count === 'infinite' ? -1 : repeat.count\n const alternate = repeat.alternate ?? true\n return withRepeat(animation as never, count, alternate)\n}\n\nfunction applyDelay(animation: unknown, delay: number | undefined) {\n if (!delay || delay <= 0) return animation\n return withDelay(delay, animation as never)\n}\n\n/**\n * Build a Reanimated animation for a single property. Runs on the JS thread\n * once per change and produces a baked `withSpring` / `withTiming` /\n * `withDecay` (optionally wrapped in `withDelay` / `withRepeat`) call. The\n * worklet body only consumes the result.\n *\n * `callback`, when provided, fires once when the underlying single-shot\n * animation settles. Repeat-wrapped animations forward the callback to\n * `withRepeat`, so it fires once per iteration as Reanimated does.\n */\nexport function resolveTransition(\n config: TransitionConfig | undefined,\n toValue: number | string,\n callback?: AnimationCallback,\n): unknown {\n const cfg = config ?? ({ type: 'spring' } as SpringTransition)\n const base = buildOne(cfg, toValue, callback)\n const repeated = applyRepeat(base, repeatOf(cfg))\n return applyDelay(repeated, delayOf(cfg))\n}\n\nfunction repeatOf(cfg: TransitionConfig): RepeatConfig | undefined {\n if (cfg.type === 'no-animation' || cfg.type === 'decay') return undefined\n return cfg.repeat\n}\n\n/**\n * Return `cfg` minus its `repeat` field. Used when peeling top-level repeat\n * off a base transition before passing it down to per-sequence-step\n * resolution — the sequence as a whole is what should repeat, not each step.\n */\nfunction stripRepeat(\n cfg: TransitionConfig | undefined,\n): TransitionConfig | undefined {\n if (!cfg) return cfg\n if (cfg.type === 'no-animation' || cfg.type === 'decay') return cfg\n if (cfg.repeat === undefined) return cfg\n const next = { ...cfg }\n delete next.repeat\n return next\n}\n\nfunction delayOf(cfg: TransitionConfig): number | undefined {\n if (cfg.type === 'no-animation') return undefined\n return cfg.delay\n}\n\n/**\n * True when the value is a `{ to, ...transitionOverride }` sequence step.\n * Plain numbers and plain transition objects fail this check.\n */\nfunction isStepObject<V>(\n v: SequenceStep<V> | V,\n): v is Extract<SequenceStep<V>, { to: V }> {\n return (\n typeof v === 'object' &&\n v !== null &&\n !Array.isArray(v) &&\n 'to' in (v as object)\n )\n}\n\n/**\n * Resolve a per-property `animate` value into a Reanimated animation.\n *\n * Handles the three shapes of `AnimatableValue`:\n * 1. plain value → single `resolveTransition` call\n * 2. `{ to, ...over }` → single step with the override merged into `base`\n * 3. array of either → `withSequence` of resolved steps, with the\n * top-level `repeat` applied at the **sequence level** (not per step).\n * Per-step `repeat` overrides remain step-local.\n */\nexport function resolveAnimatableValue<V extends number | string>(\n value: AnimatableValue<V>,\n base: TransitionConfig | undefined,\n factory?: CallbackFactory,\n): unknown {\n if (Array.isArray(value)) {\n const steps = value as ReadonlyArray<SequenceStep<V>>\n const stepBase = stripRepeat(base)\n const animations = steps.map((step, i) =>\n resolveStep(step, stepBase, factory?.('step', i)),\n )\n const seq = withSequence(...(animations as never[]))\n return applyRepeat(seq, base ? repeatOf(base) : undefined)\n }\n const step = value as SequenceStep<V>\n const cb = factory?.('animation', undefined)\n if (isStepObject<V>(step)) {\n return resolveStep(step, base, cb)\n }\n return resolveTransition(base, step as V, cb)\n}\n\nfunction resolveStep<V extends number | string>(\n step: SequenceStep<V>,\n base: TransitionConfig | undefined,\n cb?: AnimationCallback,\n): unknown {\n if (isStepObject<V>(step)) {\n const { to, ...override } = step as { to: V } & Partial<TransitionConfig>\n const merged = mergeTransition(base, override as Partial<TransitionConfig>)\n return resolveTransition(merged, to, cb)\n }\n return resolveTransition(base, step as V, cb)\n}\n\nfunction mergeTransition(\n base: TransitionConfig | undefined,\n override: Partial<TransitionConfig>,\n): TransitionConfig {\n // If the override declares a `type`, it wins outright — mixing fields from\n // a spring base into a timing override produces garbage. Otherwise inherit\n // the base's type and shallow-merge the rest.\n if (override.type && base && override.type !== base.type) {\n return override as TransitionConfig\n }\n return { ...(base ?? { type: 'spring' }), ...override } as TransitionConfig\n}\n","import {\n type ComponentType,\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n type SharedValue,\n} from 'react-native-reanimated'\nimport { useShouldReduceMotion } from '../config'\nimport { usePresence } from '../presence'\nimport { resolveAnimatableValue } from '../transitions'\nimport {\n type AnimatableValue,\n type AnimateStyle,\n type AnimationCallbackInfo,\n type GestureSubStates,\n type MotionComponent,\n type MotionProps,\n type PerPropertyTransition,\n type Transition,\n type TransitionConfig,\n type VariantController,\n type VariantsMap,\n} from '../types'\n\n/**\n * Animatable properties supported in the alpha. Expanding this set is a\n * mechanical change — add the key here, decide whether it lives inside\n * `transform`, and wire it through `buildAnimatedStyle` below.\n */\nconst TRANSFORM_KEYS = [\n 'translateX',\n 'translateY',\n 'scale',\n 'scaleX',\n 'scaleY',\n 'rotate',\n] as const\n\nconst TOP_LEVEL_KEYS = ['opacity', 'width', 'height', 'borderRadius'] as const\n\n/**\n * Per-effect transform-group coordinator. Counts how many transform-axis\n * terminal callbacks are still pending; when the last one fires, the\n * factory emits a single coalesced `onAnimationEnd({ key: 'transform' })`\n * instead of N per-axis callbacks. Mutated by the dispatch closure.\n */\ntype TransformGroup = { remaining: number }\n\nconst ALL_KEYS = [...TRANSFORM_KEYS, ...TOP_LEVEL_KEYS] as const\ntype AnimatableKey = (typeof ALL_KEYS)[number]\ntype TransformKey = (typeof TRANSFORM_KEYS)[number]\n\nconst TRANSFORM_KEY_SET = new Set<AnimatableKey>(TRANSFORM_KEYS)\n\n// Stable style object applied while a Motion primitive is mid-exit so taps\n// fall through. Hoisted so every render shares the same reference and\n// Reanimated's style merging treats it as a no-op when present.\nconst EXITING_POINTER_EVENTS_STYLE = { pointerEvents: 'none' } as const\n\nconst DEFAULT_RESTING: Record<AnimatableKey, number> = {\n translateX: 0,\n translateY: 0,\n scale: 1,\n scaleX: 1,\n scaleY: 1,\n rotate: 0,\n opacity: 1,\n width: 0,\n height: 0,\n borderRadius: 0,\n}\n\nconst TRANSITION_KEYS = new Set([\n 'type',\n 'tension',\n 'friction',\n 'mass',\n 'velocity',\n 'restSpeedThreshold',\n 'restDisplacementThreshold',\n 'duration',\n 'easing',\n 'delay',\n 'repeat',\n 'deceleration',\n 'clamp',\n])\n\nfunction isTopLevelTransition(t: unknown): t is TransitionConfig {\n if (t === null || typeof t !== 'object') return false\n const keys = Object.keys(t as object)\n if (keys.length === 0) return false\n return keys.every((k) => TRANSITION_KEYS.has(k))\n}\n\nfunction transitionFor<S>(\n prop: keyof S,\n transition: Transition<S> | undefined,\n): TransitionConfig | undefined {\n if (!transition) return undefined\n if (isTopLevelTransition(transition)) return transition\n return (transition as PerPropertyTransition<S>)[prop]\n}\n\n/**\n * Factory that wraps a React Native primitive as a `Motion.*` component.\n *\n * The generic `C` flows through `MotionProps`, so `animate` / `initial` /\n * `exit` / `transition` all infer from `C`'s `style` prop. There is no\n * shared `ViewStyle & TextStyle & ImageStyle` fallback.\n *\n * Alpha scope: numeric properties listed in `ALL_KEYS`, applied via\n * Reanimated shared values + `useAnimatedStyle`. Sequences, variants,\n * gestures, color animation, and the cross-render memoization optimization\n * land in later phases.\n */\nexport function createMotionComponent<C extends ComponentType<any>>(\n Component: C,\n): MotionComponent<C> {\n const AnimatedComponent = Animated.createAnimatedComponent(\n Component as ComponentType<any>,\n )\n\n type Props = React.ComponentProps<C> & MotionProps<React.ComponentProps<C>>\n\n const Motion = forwardRef<unknown, Props>(function Motion(props, ref) {\n const {\n initial,\n animate,\n exit,\n transition,\n variants,\n controller,\n gesture,\n onAnimationEnd,\n style,\n ...rest\n } = props as Props & { style?: unknown }\n\n // <Presence> contract: when an ancestor flips `isPresent` to false the\n // child stays rendered until `safeToRemove` is called, giving the exit\n // animation time to play. `null` when there is no <Presence> ancestor.\n const presence = usePresence()\n const isExiting = presence !== null && presence.isPresent === false\n\n // Resolved reduced-motion preference for this subtree. When true, every\n // per-key transition is replaced with `no-animation` below, so values\n // snap to target without interpolation. The hook also subscribes to OS\n // changes (via Reanimated's `useReducedMotion`), so toggling the\n // accessibility setting at runtime re-renders this component.\n const shouldReduceMotion = useShouldReduceMotion()\n\n // Pin the latest `onAnimationEnd` in a ref so the worklet callback always\n // dispatches against the current closure without re-resolving the\n // animation graph. Worklets can read refs via `runOnJS`.\n const onAnimationEndRef = useRef(onAnimationEnd)\n onAnimationEndRef.current = onAnimationEnd\n\n // Resolve `animate` against `variants` / `controller`. The controller's\n // `current` wins when both are set (typed contract: don't mix\n // `controller` and `animate` — controller drives the animation in that\n // mode). When `animate` is a string and `variants` exist, look it up.\n const variantKey = useControllerKey(controller)\n const resolvedAnimate = resolveAnimateInput(\n animate as AnimateStyle<unknown> | string | undefined,\n variants as VariantsMap<unknown> | undefined,\n variantKey,\n )\n\n const animateRecord = (resolvedAnimate ?? {}) as Partial<\n Record<AnimatableKey, AnimatableValue<number>>\n >\n const initialRecord =\n initial && initial !== false\n ? (initial as Partial<Record<AnimatableKey, number>>)\n : undefined\n const exitRecord = exit\n ? (exit as Partial<Record<AnimatableKey, AnimatableValue<number>>>)\n : undefined\n\n // Gesture sub-state activation tracked as JS state so changes invalidate\n // the merged-target signature and re-run the animation effect. The cost\n // is three useState slots regardless of whether `gesture` is set; that's\n // tiny and lets us stay rules-of-hooks-clean.\n const [pressed, setPressed] = useState(false)\n const [focused, setFocused] = useState(false)\n const [hovered, setHovered] = useState(false)\n\n // The set of keys this instance animates is locked at first render. With\n // variants in play the union across all variants is what matters — a key\n // touched by any variant must be active so the worklet picks it up when\n // the controller transitions. Gesture sub-states join the same union so\n // pressed/focused/hovered targets can drive any key they declare.\n const activeKeysRef = useRef<readonly AnimatableKey[] | null>(null)\n if (activeKeysRef.current === null) {\n const touched = new Set<AnimatableKey>()\n for (const k of ALL_KEYS) {\n if (k in animateRecord) touched.add(k)\n if (initialRecord && k in initialRecord) touched.add(k)\n }\n if (variants) {\n for (const variant of Object.values(variants) as object[]) {\n if (!variant) continue\n for (const k of ALL_KEYS) {\n if (k in variant) touched.add(k)\n }\n }\n }\n if (gesture) {\n for (const subState of [\n gesture.pressed,\n gesture.focused,\n gesture.hovered,\n ] as Array<object | undefined>) {\n if (!subState) continue\n for (const k of ALL_KEYS) {\n if (k in subState) touched.add(k)\n }\n }\n }\n if (exitRecord) {\n for (const k of ALL_KEYS) {\n if (k in exitRecord) touched.add(k)\n }\n }\n activeKeysRef.current = ALL_KEYS.filter((k) => touched.has(k))\n }\n const hasTransformRef = useRef<boolean>(\n activeKeysRef.current.some((k) => TRANSFORM_KEY_SET.has(k)),\n )\n\n const sharedValues = useAnimatableSharedValues((key) => {\n if (initial === false) {\n const a = animateRecord[key]\n return restValue(a) ?? DEFAULT_RESTING[key]\n }\n return (\n initialRecord?.[key] ??\n restValue(animateRecord[key]) ??\n DEFAULT_RESTING[key]\n )\n })\n\n // Merge gesture sub-state targets over the base `animate` record. Keys\n // touched by any sub-state always appear in the merged record (falling\n // back to `animateRecord` or `DEFAULT_RESTING`) so releasing a gesture\n // animates back to a defined value rather than getting skipped.\n //\n // While exiting, exit values override everything — gesture / animate\n // targets are inert because the component is on its way out.\n const mergedRecord =\n isExiting && exitRecord\n ? { ...animateRecord, ...exitRecord }\n : mergeGestureTargets(animateRecord, gesture, {\n pressed,\n focused,\n hovered,\n })\n const mergedSig =\n stableSig(mergedRecord) +\n (isExiting ? '|exit' : '') +\n (shouldReduceMotion ? '|rm' : '')\n const transitionSig = stableSig(transition)\n\n // Stable ref to the live `safeToRemove` so the effect's settle-counter\n // closure can reach the latest <Presence> binding without retriggering.\n const safeToRemoveRef = useRef<(() => void) | undefined>(undefined)\n safeToRemoveRef.current = presence?.safeToRemove\n\n useEffect(() => {\n // Exit fast-path: nothing to animate (or no exit prop), tell <Presence>\n // immediately so the unmount isn't gated on a phantom animation.\n if (isExiting && (!exitRecord || Object.keys(exitRecord).length === 0)) {\n safeToRemoveRef.current?.()\n return\n }\n\n let pending = 0\n let done = false\n const onSettle = () => {\n if (done) return\n pending--\n if (pending <= 0) {\n done = true\n if (isExiting) safeToRemoveRef.current?.()\n }\n }\n\n // Count transform axes participating in this effect run so the factory\n // can coalesce their terminal callbacks into a single transform-group\n // event. `undefined` when no transform axis is animating, which lets\n // the factory skip the coalescing branch entirely.\n let transformPending = 0\n for (const k of ALL_KEYS) {\n if (TRANSFORM_KEY_SET.has(k) && mergedRecord[k] !== undefined) {\n transformPending++\n }\n }\n const transformGroup: TransformGroup | undefined =\n transformPending > 0 ? { remaining: transformPending } : undefined\n\n for (const key of ALL_KEYS) {\n const target = mergedRecord[key]\n if (target === undefined) continue\n // Reduced-motion overrides every per-key transition (and any nested\n // sequence-step transition) with `no-animation`, which the resolver\n // turns into a direct value assignment. Sequences still iterate but\n // each step settles instantly, which matches the \"snap to final\n // state\" expectation.\n const cfg = shouldReduceMotion\n ? ({ type: 'no-animation' } as const)\n : transitionFor(key, transition)\n if (isExiting) pending++\n const factory = makeKeyCallbackFactory(\n key,\n sharedValues[key],\n targetEndValue(target),\n onAnimationEndRef,\n {\n stepCount: stepCountOf(target),\n totalIterations: totalIterationsOf(cfg),\n },\n isExiting ? onSettle : undefined,\n TRANSFORM_KEY_SET.has(key) ? transformGroup : undefined,\n )\n sharedValues[key].value = resolveAnimatableValue(\n target,\n cfg,\n factory,\n ) as never\n }\n\n // No exit-targeted keys (only `animate` keys present, no `exit`)\n // → release immediately rather than wait for animations that aren't\n // headed toward an exit value.\n if (isExiting && pending === 0) {\n safeToRemoveRef.current?.()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [mergedSig, transitionSig])\n\n const animatedStyle = useAnimatedStyle(() => {\n const activeKeys = activeKeysRef.current!\n const hasTransform = hasTransformRef.current\n const out: Record<string, unknown> = {}\n const transform: Array<Record<string, unknown>> = []\n for (const key of activeKeys) {\n const v = sharedValues[key].value\n if (TRANSFORM_KEY_SET.has(key)) {\n transform.push(\n key === 'rotate' ? { rotate: `${v}deg` } : { [key]: v },\n )\n } else {\n out[key] = v\n }\n }\n if (hasTransform) out.transform = transform\n return out\n })\n\n // Exiting children are tap-deaf: the next press should fall through to\n // whatever is underneath, not re-trigger a soon-to-unmount node. This is\n // the moti #297 fix and a v0.1 acceptance criterion. RN 0.71+ deprecates\n // `pointerEvents` as a prop in favor of the style key, so we merge it\n // alongside the animated style instead of spreading as a prop.\n const mergedStyle = useMemo(\n () =>\n (isExiting\n ? [style, animatedStyle, EXITING_POINTER_EVENTS_STYLE]\n : [style, animatedStyle]) as unknown,\n [style, animatedStyle, isExiting],\n )\n\n const gestureHandlers = useGestureHandlers(\n gesture,\n rest as Record<string, unknown>,\n setPressed,\n setFocused,\n setHovered,\n )\n\n return (\n <AnimatedComponent\n ref={ref as never}\n {...(rest as object)}\n {...gestureHandlers}\n style={mergedStyle}\n />\n )\n })\n\n Motion.displayName = `Motion(${Component.displayName ?? Component.name ?? 'Component'})`\n\n return Motion as unknown as MotionComponent<C>\n}\n\ntype SharedValueMap = Record<AnimatableKey, SharedValue<number>>\n\n/**\n * Allocate one shared value per animatable key in `ALL_KEYS` and return a\n * **stable** map — same object reference across every render.\n *\n * Stability matters: `useAnimatedStyle` derives its dep array from\n * `Object.values(updater.__closure)`. Our worklet captures `sharedValues`,\n * so a fresh object literal each render would change that dep, fire\n * Reanimated's effect, and re-bind the worklet on the UI thread on every\n * render — the exact cost design principle 8 calls out. The shared values themselves\n * are stable across renders (Reanimated's `useSharedValue` is a `useRef`\n * under the hood), so snapshotting the wrapping object once is safe.\n *\n * Hooks are called in a stable, lexical order — fine for rules-of-hooks.\n * Unused shared values are cheap; the worklet skips them via\n * `activeKeysRef`.\n */\nfunction useAnimatableSharedValues(\n init: (key: AnimatableKey) => number,\n): SharedValueMap {\n const translateX = useSharedValue(init('translateX'))\n const translateY = useSharedValue(init('translateY'))\n const scale = useSharedValue(init('scale'))\n const scaleX = useSharedValue(init('scaleX'))\n const scaleY = useSharedValue(init('scaleY'))\n const rotate = useSharedValue(init('rotate'))\n const opacity = useSharedValue(init('opacity'))\n const width = useSharedValue(init('width'))\n const height = useSharedValue(init('height'))\n const borderRadius = useSharedValue(init('borderRadius'))\n\n const ref = useRef<SharedValueMap | null>(null)\n if (ref.current === null) {\n ref.current = {\n translateX,\n translateY,\n scale,\n scaleX,\n scaleY,\n rotate,\n opacity,\n width,\n height,\n borderRadius,\n }\n }\n return ref.current\n}\n\n/**\n * Build a per-key `CallbackFactory` for the resolver. Each step in a sequence\n * (or the single animation, when `value` isn't an array) gets its own\n * Reanimated callback; when it settles on the UI thread, the callback bridges\n * to JS via `runOnJS` and invokes the user's `onAnimationEnd` with a fully\n * populated `AnimationCallbackInfo`.\n *\n * Phase resolution lives here, on the JS thread. The resolver hands us a\n * coarse rawPhase (`'step'` for any sequence step, `'animation'` for a\n * single-shot terminal); we map that onto the public phase set\n * (`'step' | 'sequence' | 'repeat' | 'animation'`) using `meta` and the\n * iteration counter. `iteration` resets per effect run because the factory\n * is constructed fresh inside the effect.\n */\nfunction makeKeyCallbackFactory(\n key: string,\n sharedValue: SharedValue<number>,\n target: number | string | undefined,\n onAnimationEndRef: {\n current: ((info: AnimationCallbackInfo<unknown>) => void) | undefined\n },\n meta: { stepCount: number; totalIterations: number },\n onSettle?: () => void,\n transformGroup?: TransformGroup,\n) {\n if (!onAnimationEndRef.current && !onSettle) return undefined\n\n // Shared across this animation graph's callbacks (one per sequence step,\n // or one for a single-shot). Mutated when a full pass completes.\n const state = { iteration: 0 }\n\n const isTransformKey = TRANSFORM_KEY_SET.has(key as AnimatableKey)\n\n const dispatch = (\n rawPhase: 'step' | 'animation',\n step: number | undefined,\n finished: boolean,\n value: number | string | undefined,\n ) => {\n const isLastIteration = state.iteration >= meta.totalIterations - 1\n let phase: 'step' | 'sequence' | 'repeat' | 'animation'\n let isTerminal = false\n\n if (rawPhase === 'step') {\n const isLastInPass = step !== undefined && step === meta.stepCount - 1\n if (!isLastInPass) {\n phase = 'step'\n } else if (isLastIteration) {\n phase = 'animation'\n isTerminal = true\n } else {\n phase = 'sequence'\n }\n } else if (isLastIteration) {\n phase = 'animation'\n isTerminal = true\n } else {\n phase = 'repeat'\n }\n\n const reportedIteration = state.iteration\n if (phase === 'sequence' || phase === 'repeat') state.iteration++\n\n const fn = onAnimationEndRef.current\n if (fn) {\n // Transform-group coalescing: a multi-axis translate / scale /\n // rotate animation should fire onAnimationEnd ONCE for the logical\n // transform, not once per axis. We only coalesce the terminal\n // `'animation'` phase — `step`/`sequence`/`repeat` events fire\n // per-axis since each is its own logical event. Released per-axis\n // for a single-axis case too, with `key: 'transform'` for\n // consistency.\n if (isTransformKey && transformGroup && phase === 'animation') {\n transformGroup.remaining--\n if (transformGroup.remaining <= 0) {\n fn({\n key: 'transform' as never,\n finished,\n value,\n target,\n phase,\n step,\n iteration: reportedIteration,\n })\n }\n } else {\n fn({\n key: key as never,\n finished,\n value,\n target,\n phase,\n step,\n iteration: reportedIteration,\n })\n }\n }\n // Settle hooks fire per-axis on the terminal phase — <Presence> waits\n // for *every* exiting property to settle before unmounting, so we\n // intentionally do not coalesce these (the transform-group coalesce\n // is purely a user-callback ergonomic).\n if (onSettle && isTerminal) onSettle()\n }\n\n return (rawPhase: 'step' | 'animation', step: number | undefined) => {\n // Reanimated invokes the callback with only `finished` (see\n // valueSetter.js:24,40,51 in 4.x) — `current` is never passed. Read the\n // shared value inside the worklet; by the time the callback fires the\n // final/clamped value has already been written to it.\n const cb = (finished?: boolean) => {\n 'worklet'\n runOnJS(dispatch)(rawPhase, step, !!finished, sharedValue.value)\n }\n return cb\n }\n}\n\n/**\n * Number of sequence steps in an animatable value. `1` for plain values and\n * single-step `{ to }` objects; the array length for keyframe arrays.\n */\nfunction stepCountOf(v: AnimatableValue<number> | undefined): number {\n if (Array.isArray(v)) return v.length\n return 1\n}\n\n/**\n * Total number of iterations the animation will run, including the initial\n * pass. `1` when there is no `repeat`; `Number.POSITIVE_INFINITY` for\n * `'infinite'`. Decay and `no-animation` configs cannot repeat — both return\n * `1` so the iteration counter stays at 0.\n */\nfunction totalIterationsOf(cfg: TransitionConfig | undefined): number {\n if (!cfg || cfg.type === 'no-animation' || cfg.type === 'decay') return 1\n const r = cfg.repeat\n if (r === undefined) return 1\n if (r === 'infinite') return Number.POSITIVE_INFINITY\n if (typeof r === 'number') return r\n if (r.count === 'infinite') return Number.POSITIVE_INFINITY\n return r.count\n}\n\n/**\n * Pull a single end-value out of an `AnimatableValue` for the\n * `AnimationCallbackInfo.target` field. Plain numbers/strings come through;\n * the last sequence step's `to`/value is used for arrays; `{ to }` step\n * objects use `to`. Returns `undefined` for unrecognized shapes.\n */\nfunction targetEndValue(\n v: AnimatableValue<number> | undefined,\n): number | string | undefined {\n if (v === undefined) return undefined\n if (typeof v === 'number' || typeof v === 'string') return v\n if (Array.isArray(v)) {\n return v.length > 0\n ? targetEndValue(v[v.length - 1] as AnimatableValue<number>)\n : undefined\n }\n if (typeof v === 'object' && v !== null && 'to' in v) {\n const to = (v as { to: unknown }).to\n return typeof to === 'number' || typeof to === 'string' ? to : undefined\n }\n return undefined\n}\n\n/**\n * Subscribe to a `VariantController` and return its `current` key. Returns\n * `undefined` when no controller is provided so callers can fall back to a\n * literal `animate` value.\n */\nfunction useControllerKey(\n controller: VariantController | undefined,\n): string | undefined {\n const [, setTick] = useState(0)\n useEffect(() => {\n if (!controller) return\n const unsub = controller.subscribe(() => setTick((n) => n + 1))\n return unsub\n }, [controller])\n return controller?.current\n}\n\n/**\n * Resolve the effective `animate` target from the public-prop tuple.\n *\n * Precedence: `controller.current` (when controller is set) > string-keyed\n * `animate` looked up in `variants` > literal `animate` object > `undefined`.\n */\nfunction resolveAnimateInput(\n animate: AnimateStyle<unknown> | string | undefined,\n variants: VariantsMap<unknown> | undefined,\n controllerKey: string | undefined,\n): AnimateStyle<unknown> | undefined {\n if (controllerKey !== undefined && variants && controllerKey in variants) {\n return variants[controllerKey]\n }\n if (typeof animate === 'string') {\n if (variants && animate in variants) return variants[animate]\n if (__DEV__) {\n console.warn(\n `[inertia] animate=\"${animate}\" but no matching variant. Did you forget to pass \\`variants\\`?`,\n )\n }\n return undefined\n }\n return animate as AnimateStyle<unknown> | undefined\n}\n\ndeclare const __DEV__: boolean\n\n/**\n * Pick the resting/initial-frame number out of an `AnimatableValue`. Plain\n * numbers come through unchanged; sequence arrays use their first element;\n * `{ to }` step objects use `to`. Non-numeric or unresolvable shapes return\n * `undefined` so the caller can fall back to `DEFAULT_RESTING`.\n */\nfunction restValue(v: AnimatableValue<number> | undefined): number | undefined {\n if (v === undefined) return undefined\n if (typeof v === 'number') return v\n if (Array.isArray(v)) {\n return v.length > 0 ? restValue(v[0] as AnimatableValue<number>) : undefined\n }\n if (typeof v === 'object' && v !== null && 'to' in v) {\n const to = (v as { to: unknown }).to\n return typeof to === 'number' ? to : undefined\n }\n return undefined\n}\n\nfunction stableSig(value: unknown): string {\n if (value === undefined) return ''\n try {\n return stableStringify(value)\n } catch {\n return String(value)\n }\n}\n\n/**\n * JSON.stringify with keys sorted at every level — gives a stable signature\n * regardless of property declaration order. Functions serialize as `null` so a\n * change in easing-fn reference is invisible here; that's fine for v0.1\n * (easing swaps are rare and the worklet wrapper handles correctness).\n */\nfunction stableStringify(v: unknown): string {\n if (v === null || typeof v !== 'object') {\n if (typeof v === 'function' || v === undefined) return 'null'\n return JSON.stringify(v)\n }\n if (Array.isArray(v)) {\n return '[' + v.map(stableStringify).join(',') + ']'\n }\n const obj = v as Record<string, unknown>\n const keys = Object.keys(obj).sort()\n return (\n '{' +\n keys\n .map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k]))\n .join(',') +\n '}'\n )\n}\n\n/**\n * Merge gesture sub-state targets over the base `animate` record. Keys touched\n * by any declared sub-state are always present in the result so releasing a\n * gesture animates the property back to a defined value (the base `animate`\n * value when present, otherwise `DEFAULT_RESTING`). Sub-states layer in\n * priority order: `hovered` < `focused` < `pressed`.\n */\nfunction mergeGestureTargets(\n base: Partial<Record<AnimatableKey, AnimatableValue<number>>>,\n gesture: GestureSubStates<unknown> | undefined,\n active: { pressed: boolean; focused: boolean; hovered: boolean },\n): Partial<Record<AnimatableKey, AnimatableValue<number>>> {\n if (!gesture) return base\n const merged: Partial<Record<AnimatableKey, AnimatableValue<number>>> = {\n ...base,\n }\n const subStates = [\n gesture.hovered,\n gesture.focused,\n gesture.pressed,\n ] as Array<\n Partial<Record<AnimatableKey, AnimatableValue<number>>> | undefined\n >\n for (const sub of subStates) {\n if (!sub) continue\n for (const k of ALL_KEYS) {\n if (k in sub && !(k in merged)) {\n merged[k] = DEFAULT_RESTING[k]\n }\n }\n }\n if (active.hovered && gesture.hovered) {\n Object.assign(\n merged,\n gesture.hovered as Partial<\n Record<AnimatableKey, AnimatableValue<number>>\n >,\n )\n }\n if (active.focused && gesture.focused) {\n Object.assign(\n merged,\n gesture.focused as Partial<\n Record<AnimatableKey, AnimatableValue<number>>\n >,\n )\n }\n if (active.pressed && gesture.pressed) {\n Object.assign(\n merged,\n gesture.pressed as Partial<\n Record<AnimatableKey, AnimatableValue<number>>\n >,\n )\n }\n return merged\n}\n\ntype GestureHandlers = Record<string, (event: unknown) => void>\n\n/**\n * Build the touch / focus / hover handler props for a gesture-enabled Motion\n * primitive. Returns an empty object when `gesture` is undefined so the\n * component renders identically to the gesture-less path (zero overhead).\n *\n * Existing user-supplied handlers on the same events are composed: the user's\n * handler runs first, then the internal state setter. We pull user handlers\n * out of `rest` rather than overwriting them.\n */\nfunction useGestureHandlers(\n gesture: GestureSubStates<unknown> | undefined,\n rest: Record<string, unknown>,\n setPressed: (next: boolean) => void,\n setFocused: (next: boolean) => void,\n setHovered: (next: boolean) => void,\n): GestureHandlers {\n return useMemo(() => {\n if (!gesture) return {}\n const handlers: GestureHandlers = {}\n if (gesture.pressed) {\n handlers.onTouchStart = compose(rest.onTouchStart, () => setPressed(true))\n handlers.onTouchEnd = compose(rest.onTouchEnd, () => setPressed(false))\n handlers.onTouchCancel = compose(rest.onTouchCancel, () =>\n setPressed(false),\n )\n // Pressable / TouchableOpacity expose press hooks above the touch layer;\n // forward to those when present so wrapping consumers stay consistent.\n handlers.onPressIn = compose(rest.onPressIn, () => setPressed(true))\n handlers.onPressOut = compose(rest.onPressOut, () => setPressed(false))\n }\n if (gesture.focused) {\n handlers.onFocus = compose(rest.onFocus, () => setFocused(true))\n handlers.onBlur = compose(rest.onBlur, () => setFocused(false))\n }\n if (gesture.hovered) {\n // Web-only events. RN-Web 0.72+ accepts these on View; native ignores\n // them so the cost is zero on iOS / Android.\n handlers.onMouseEnter = compose(rest.onMouseEnter, () => setHovered(true))\n handlers.onMouseLeave = compose(rest.onMouseLeave, () =>\n setHovered(false),\n )\n }\n return handlers\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n gesture?.pressed ? 1 : 0,\n gesture?.focused ? 1 : 0,\n gesture?.hovered ? 1 : 0,\n rest.onTouchStart,\n rest.onTouchEnd,\n rest.onTouchCancel,\n rest.onPressIn,\n rest.onPressOut,\n rest.onFocus,\n rest.onBlur,\n rest.onMouseEnter,\n rest.onMouseLeave,\n ])\n}\n\nfunction compose(\n user: unknown,\n ours: (event: unknown) => void,\n): (event: unknown) => void {\n if (typeof user !== 'function') return ours\n return (event: unknown) => {\n ;(user as (event: unknown) => void)(event)\n ours(event)\n }\n}\n\n// Suppress the implicit any-return of the rotate ternary's union shape.\n// `TransformKey` is exported only to keep the type readable in d.ts.\nexport type { TransformKey }\n","import { Image } from 'react-native'\nimport { createMotionComponent } from './createMotionComponent'\n\n/**\n * Animatable `Image`. Inherits `Image`'s prop surface, with `animate` /\n * `initial` / `exit` / `transition` typed against `ImageStyle` (so\n * `tintColor` is accepted on `animate` here, but rejected on `Motion.View`).\n */\nexport const MotionImage = createMotionComponent(Image)\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/config/MotionConfigContext.ts","../../src/gestures/focusVisibility.ts","../../src/presence/PresenceContext.ts","../../src/transitions/easing.ts","../../src/transitions/resolve.ts","../../src/motion/createMotionComponent.tsx","../../src/motion/Image.tsx"],"names":["createContext","useContext","useReducedMotion","Platform","isWorkletFunction","withSpring","withTiming","Easing","withDecay","withRepeat","withDelay","step","withSequence","Animated","forwardRef","Motion","useRef","useState","useEffect","useAnimatedStyle","useMemo","jsx","useSharedValue","runOnJS","Image"],"mappings":";;;;;;;;;;;;AAwBO,IAAM,qBAAA,GAA2C;AAAA,EACtD,aAAA,EAAe;AACjB,CAAA;AAEO,IAAM,mBAAA,GAAsBA,mBAAA;AAAA,EACjC;AACF,CAAA;AAMO,SAAS,eAAA,GAAqC;AACnD,EAAA,OAAOC,iBAAW,mBAAmB,CAAA;AACvC;AAQO,SAAS,qBAAA,GAAiC;AAC/C,EAAA,MAAM,EAAE,aAAA,EAAc,GAAI,eAAA,EAAgB;AAC1C,EAAA,MAAM,YAAYC,yBAAA,EAAiB;AACnC,EAAA,IAAI,aAAA,KAAkB,SAAS,OAAO,KAAA;AACtC,EAAA,IAAI,aAAA,KAAkB,UAAU,OAAO,IAAA;AACvC,EAAA,OAAO,SAAA;AACT;AC5BA,IAAI,QAAA,GAA0B,UAAA;AAC9B,IAAI,SAAA,GAAY,KAAA;AAEhB,SAAS,WAAA,GAAc;AACrB,EAAA,QAAA,GAAW,UAAA;AACb;AAEA,SAAS,UAAA,GAAa;AACpB,EAAA,QAAA,GAAW,SAAA;AACb;AAEA,SAAS,eAAA,GAAwB;AAC/B,EAAA,IAAI,SAAA,EAAW;AACf,EAAA,IAAIC,oBAAA,CAAS,OAAO,KAAA,EAAO;AAC3B,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,EAAA,QAAA,CAAS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GAAe,OAAA;AAAA,QAAQ,IAAA,CAAK,YAAA;AAAA,QAAc,MACjD,WAAW,KAAK;AAAA,OAClB;AAAA,IACF;AACA,IAAA,OAAO,QAAA;AAAA,EAET,CAAA,EAAG;AAAA,IACD,OAAA,EAAS,UAAU,CAAA,GAAI,CAAA;AAAA,IACvB,OAAA,EAAS,UAAU,CAAA,GAAI,CAAA;AAAA,IACvB,OAAA,EAAS,eAAe,CAAA,GAAI,CAAA;AAAA,IAC5B,OAAA,EAAS,UAAU,CAAA,GAAI,CAAA;AAAA,IACvB,IAAA,CAAK,YAAA;AAAA,IACL,IAAA,CAAK,UAAA;AAAA,IACL,IAAA,CAAK,aAAA;AAAA,IACL,IAAA,CAAK,SAAA;AAAA,IACL,IAAA,CAAK,UAAA;AAAA,IACL,IAAA,CAAK,OAAA;AAAA,IACL,IAAA,CAAK,MAAA;AAAA,IACL,IAAA,CAAK,YAAA;AAAA,IACL,IAAA,CAAK;AAAA,GACN,CAAA;AACH;AAEA,SAAS,OAAA,CACP,MACA,IAAA,EAC0B;AAC1B,EAAA,IAAI,OAAO,IAAA,KAAS,UAAA,EAAY,OAAO,IAAA;AACvC,EAAA,OAAO,CAAC,KAAA,KAAmB;AACxB,IAAC,KAAkC,KAAK,CAAA;AACzC,IAAA,IAAA,CAAK,KAAK,CAAA;AAAA,EACZ,CAAA;AACF;;;AC15BO,IAAM,WAAA,GAAc,sBAAsBI,iBAAK","file":"Image.js","sourcesContent":["import { createContext, useContext } from 'react'\nimport { useReducedMotion } from 'react-native-reanimated'\n\n/**\n * How descendant Motion primitives should treat reduced-motion preferences.\n *\n * - `'user'` (default): defer to the OS accessibility setting via\n * Reanimated's `useReducedMotion()`. This is the only value that respects\n * user choice and is the right default for app-level wrappers.\n * - `'never'`: animate regardless of OS setting. Use sparingly — e.g. for\n * onboarding transitions you've decided are essential.\n * - `'always'`: never animate, regardless of OS setting. Useful for tests\n * and snapshots.\n */\nexport type ReducedMotion = 'user' | 'never' | 'always'\n\nexport interface MotionConfigValue {\n reducedMotion: ReducedMotion\n}\n\n/**\n * Default config used when a Motion primitive is rendered without a\n * `<MotionConfig>` ancestor. `'user'` means respect the OS setting.\n */\nexport const DEFAULT_MOTION_CONFIG: MotionConfigValue = {\n reducedMotion: 'user',\n}\n\nexport const MotionConfigContext = createContext<MotionConfigValue>(\n DEFAULT_MOTION_CONFIG,\n)\n\n/**\n * Read the active `<MotionConfig>` from a descendant. Returns the default\n * (`'user'`) when no provider is present.\n */\nexport function useMotionConfig(): MotionConfigValue {\n return useContext(MotionConfigContext)\n}\n\n/**\n * Resolve the active reduced-motion mode to a boolean. `'user'` consults\n * Reanimated's OS-backed hook; `'always'` / `'never'` shortcut. Motion\n * primitives call this to decide whether to swap transitions for\n * `no-animation`.\n */\nexport function useShouldReduceMotion(): boolean {\n const { reducedMotion } = useMotionConfig()\n const osReduced = useReducedMotion()\n if (reducedMotion === 'never') return false\n if (reducedMotion === 'always') return true\n return osReduced\n}\n","import { Platform } from 'react-native'\n\n/**\n * Input-modality tracker for the `focusVisible` gesture sub-state.\n *\n * Implements the W3C `:focus-visible` heuristic: a focus event counts as\n * \"visible\" only when the most recent user input was keyboard-driven. Mouse,\n * pointer, and touch events flip the modality to `'pointer'`; keyboard events\n * flip it back to `'keyboard'`.\n *\n * On native platforms there is no pointer-vs-keyboard distinction — focus\n * arrives via D-pad, screen reader, or hardware keyboard, all of which are\n * keyboard-equivalent — so `isFocusVisible()` is unconditionally `true`.\n *\n * The web listeners attach lazily on first call (capture phase, so they run\n * before the focus event reaches the focused element) and stay installed for\n * the lifetime of the document. They are passive and idle-cheap; the cost is\n * one boolean read per `onFocus` dispatch.\n */\n\ntype InputModality = 'keyboard' | 'pointer'\n\n// Default to `'keyboard'` so a programmatic / autofocus that happens before\n// any user input still draws a focus ring — matches the W3C polyfill default.\nlet modality: InputModality = 'keyboard'\nlet installed = false\n\nfunction setKeyboard() {\n modality = 'keyboard'\n}\n\nfunction setPointer() {\n modality = 'pointer'\n}\n\nfunction ensureInstalled(): void {\n if (installed) return\n if (Platform.OS !== 'web') return\n if (typeof document === 'undefined') return\n document.addEventListener('keydown', setKeyboard, true)\n document.addEventListener('mousedown', setPointer, true)\n document.addEventListener('pointerdown', setPointer, true)\n document.addEventListener('touchstart', setPointer, true)\n installed = true\n}\n\n/**\n * `true` if the next `onFocus` should be treated as \"focus-visible\" (keyboard\n * focus). On native, always `true`. On web, reflects the most recent user\n * input modality.\n */\nexport function isFocusVisible(): boolean {\n if (Platform.OS !== 'web') return true\n ensureInstalled()\n return modality === 'keyboard'\n}\n\n/** @internal — test-only hook to reset module state between cases. */\nexport function __resetFocusVisibilityForTests(next: InputModality): void {\n modality = next\n}\n","import { createContext, useContext } from 'react'\n\n/**\n * Per-child contract between `<Presence>` and its descendant Motion\n * primitives. `<Presence>` provides a fresh value to each rendered child;\n * Motion primitives consume it to gate exit animations.\n *\n * - `isPresent`: `true` while the child is in the incoming children list.\n * Flips to `false` when the parent removes it; the child remains rendered\n * until `safeToRemove` is called.\n * - `safeToRemove`: callback the child invokes when its exit animation has\n * settled. `<Presence>` then drops the snapshot entry and unmounts.\n */\nexport interface PresenceContextValue {\n isPresent: boolean\n safeToRemove: () => void\n}\n\nexport const PresenceContext = createContext<PresenceContextValue | null>(null)\n\n/**\n * Read the surrounding `<Presence>` contract from a child component. Returns\n * `null` when there is no `<Presence>` ancestor — useful for components that\n * want to support both standalone and Presence-wrapped use without branching.\n */\nexport function usePresence(): PresenceContextValue | null {\n return useContext(PresenceContext)\n}\n","import { isWorkletFunction } from 'react-native-reanimated'\n\n/**\n * Reanimated 3.9+ validates that easing functions used in nested-transition\n * contexts (variants, sequences, per-property maps) are worklets, and crashes\n * with `[Reanimated] The easing function is not a worklet` otherwise. The\n * library accepts plain functions on the public surface; this helper wraps\n * them so consumers don't have to think about the worklet boundary.\n *\n * If the input is already a worklet (has been processed by the worklets babel\n * plugin), it's returned as-is. Otherwise it's wrapped in a function whose\n * body declares the `'worklet'` directive — when our source is processed by\n * the consumer's worklets babel plugin (the default Expo/RN setup), the\n * wrapper becomes a real worklet that captures the user fn via closure.\n *\n * The user fn must be pure: no JS-thread captured refs, no shared mutable\n * state, no calls to non-worklet APIs.\n */\nexport function ensureWorkletEasing(\n easing: ((t: number) => number) | undefined,\n): ((t: number) => number) | undefined {\n if (!easing) return undefined\n if (isWorkletFunction(easing)) return easing\n const wrapped = (t: number) => {\n 'worklet'\n return easing(t)\n }\n return wrapped\n}\n","import {\n Easing,\n withDecay,\n withDelay,\n withRepeat,\n withSequence,\n withSpring,\n withTiming,\n} from 'react-native-reanimated'\nimport { ensureWorkletEasing } from './easing'\nimport {\n type AnimatableValue,\n type DecayTransition,\n type RepeatConfig,\n type SequenceStep,\n type SpringTransition,\n type TimingTransition,\n type TransitionConfig,\n} from '../types'\n\n/**\n * UI-thread callback Reanimated invokes when an animation settles. Must be a\n * worklet — callers either author one with `'worklet'` or build one via\n * `runOnJS(...)` to bridge to JS-thread code.\n */\nexport type AnimationCallback = (\n finished?: boolean,\n current?: number | string,\n) => void\n\n/**\n * Per-step callback factory. Resolvers call this with the step's phase and\n * sequence index (or `undefined` for non-sequence animations) and attach the\n * resulting callback to the underlying `withSpring` / `withTiming` /\n * `withDecay` call.\n */\nexport type CallbackFactory = (\n phase: 'step' | 'animation',\n step: number | undefined,\n) => AnimationCallback | undefined\n\n/**\n * Default spring physics, expressed in react-spring vocabulary. Conversion\n * to Reanimated's raw `stiffness` / `damping` lives below; raw config never\n * leaks past this module.\n */\nconst DEFAULT_SPRING: Required<\n Pick<SpringTransition, 'tension' | 'friction' | 'mass'>\n> = {\n tension: 170,\n friction: 26,\n mass: 1,\n}\n\nconst DEFAULT_TIMING_DURATION = 250\n\nfunction springToReanimated(t: SpringTransition) {\n return {\n stiffness: t.tension ?? DEFAULT_SPRING.tension,\n damping: t.friction ?? DEFAULT_SPRING.friction,\n mass: t.mass ?? DEFAULT_SPRING.mass,\n velocity: t.velocity,\n restSpeedThreshold: t.restSpeedThreshold,\n restDisplacementThreshold: t.restDisplacementThreshold,\n }\n}\n\nfunction buildSpring(\n cfg: SpringTransition,\n toValue: number | string,\n cb?: AnimationCallback,\n) {\n return withSpring(toValue as number, springToReanimated(cfg), cb as never)\n}\n\nfunction buildTiming(\n cfg: TimingTransition,\n toValue: number | string,\n cb?: AnimationCallback,\n) {\n return withTiming(\n toValue as number,\n {\n duration: cfg.duration ?? DEFAULT_TIMING_DURATION,\n easing: ensureWorkletEasing(cfg.easing) ?? Easing.inOut(Easing.ease),\n },\n cb as never,\n )\n}\n\nfunction buildDecay(cfg: DecayTransition, cb?: AnimationCallback) {\n return withDecay(\n {\n velocity: cfg.velocity ?? 0,\n deceleration: cfg.deceleration,\n clamp: cfg.clamp,\n },\n cb as never,\n )\n}\n\n/**\n * Build a single-step animation (no repeat / no delay / no sequence) for a\n * given config + target. Pulled out so sequence steps can compose without\n * recursing into repeat/delay handling per step. The callback is forwarded\n * to Reanimated; for `no-animation` the callback is fired synchronously\n * since there's nothing to wait for.\n */\nfunction buildOne(\n cfg: TransitionConfig,\n toValue: number | string,\n cb?: AnimationCallback,\n): unknown {\n if (cfg.type === 'no-animation') {\n if (cb) cb(true, toValue)\n return toValue\n }\n if (cfg.type === 'decay') return buildDecay(cfg, cb)\n if (cfg.type === 'timing') return buildTiming(cfg, toValue, cb)\n return buildSpring(cfg as SpringTransition, toValue, cb)\n}\n\n/**\n * Wrap an animation in `withRepeat` per the unified `repeat` shape:\n * - `number` → finite count, alternating direction\n * - `'infinite'` → endless, alternating direction\n * - `{ count, alternate }`→ explicit; `alternate` defaults to `true`\n */\nfunction applyRepeat(animation: unknown, repeat: RepeatConfig | undefined) {\n if (repeat === undefined) return animation\n if (repeat === 'infinite') {\n return withRepeat(animation as never, -1, true)\n }\n if (typeof repeat === 'number') {\n return withRepeat(animation as never, repeat, true)\n }\n const count = repeat.count === 'infinite' ? -1 : repeat.count\n const alternate = repeat.alternate ?? true\n return withRepeat(animation as never, count, alternate)\n}\n\nfunction applyDelay(animation: unknown, delay: number | undefined) {\n if (!delay || delay <= 0) return animation\n return withDelay(delay, animation as never)\n}\n\n/**\n * Build a Reanimated animation for a single property. Runs on the JS thread\n * once per change and produces a baked `withSpring` / `withTiming` /\n * `withDecay` (optionally wrapped in `withDelay` / `withRepeat`) call. The\n * worklet body only consumes the result.\n *\n * `callback`, when provided, fires once when the underlying single-shot\n * animation settles. Repeat-wrapped animations forward the callback to\n * `withRepeat`, so it fires once per iteration as Reanimated does.\n */\nexport function resolveTransition(\n config: TransitionConfig | undefined,\n toValue: number | string,\n callback?: AnimationCallback,\n): unknown {\n const cfg = config ?? ({ type: 'spring' } as SpringTransition)\n const base = buildOne(cfg, toValue, callback)\n const repeated = applyRepeat(base, repeatOf(cfg))\n return applyDelay(repeated, delayOf(cfg))\n}\n\nfunction repeatOf(cfg: TransitionConfig): RepeatConfig | undefined {\n if (cfg.type === 'no-animation' || cfg.type === 'decay') return undefined\n return cfg.repeat\n}\n\n/**\n * Return `cfg` minus its `repeat` field. Used when peeling top-level repeat\n * off a base transition before passing it down to per-sequence-step\n * resolution — the sequence as a whole is what should repeat, not each step.\n */\nfunction stripRepeat(\n cfg: TransitionConfig | undefined,\n): TransitionConfig | undefined {\n if (!cfg) return cfg\n if (cfg.type === 'no-animation' || cfg.type === 'decay') return cfg\n if (cfg.repeat === undefined) return cfg\n const next = { ...cfg }\n delete next.repeat\n return next\n}\n\nfunction delayOf(cfg: TransitionConfig): number | undefined {\n if (cfg.type === 'no-animation') return undefined\n return cfg.delay\n}\n\n/**\n * True when the value is a `{ to, ...transitionOverride }` sequence step.\n * Plain numbers and plain transition objects fail this check.\n */\nfunction isStepObject<V>(\n v: SequenceStep<V> | V,\n): v is Extract<SequenceStep<V>, { to: V }> {\n return (\n typeof v === 'object' &&\n v !== null &&\n !Array.isArray(v) &&\n 'to' in (v as object)\n )\n}\n\n/**\n * Resolve a per-property `animate` value into a Reanimated animation.\n *\n * Handles the three shapes of `AnimatableValue`:\n * 1. plain value → single `resolveTransition` call\n * 2. `{ to, ...over }` → single step with the override merged into `base`\n * 3. array of either → `withSequence` of resolved steps, with the\n * top-level `repeat` applied at the **sequence level** (not per step).\n * Per-step `repeat` overrides remain step-local.\n */\nexport function resolveAnimatableValue<V extends number | string>(\n value: AnimatableValue<V>,\n base: TransitionConfig | undefined,\n factory?: CallbackFactory,\n): unknown {\n if (Array.isArray(value)) {\n const steps = value as ReadonlyArray<SequenceStep<V>>\n const stepBase = stripRepeat(base)\n const animations = steps.map((step, i) =>\n resolveStep(step, stepBase, factory?.('step', i)),\n )\n const seq = withSequence(...(animations as never[]))\n return applyRepeat(seq, base ? repeatOf(base) : undefined)\n }\n const step = value as SequenceStep<V>\n const cb = factory?.('animation', undefined)\n if (isStepObject<V>(step)) {\n return resolveStep(step, base, cb)\n }\n return resolveTransition(base, step as V, cb)\n}\n\nfunction resolveStep<V extends number | string>(\n step: SequenceStep<V>,\n base: TransitionConfig | undefined,\n cb?: AnimationCallback,\n): unknown {\n if (isStepObject<V>(step)) {\n const { to, ...override } = step as { to: V } & Partial<TransitionConfig>\n const merged = mergeTransition(base, override as Partial<TransitionConfig>)\n return resolveTransition(merged, to, cb)\n }\n return resolveTransition(base, step as V, cb)\n}\n\nfunction mergeTransition(\n base: TransitionConfig | undefined,\n override: Partial<TransitionConfig>,\n): TransitionConfig {\n // If the override declares a `type`, it wins outright — mixing fields from\n // a spring base into a timing override produces garbage. Otherwise inherit\n // the base's type and shallow-merge the rest.\n if (override.type && base && override.type !== base.type) {\n return override as TransitionConfig\n }\n return { ...(base ?? { type: 'spring' }), ...override } as TransitionConfig\n}\n","import {\n type ComponentType,\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n type SharedValue,\n} from 'react-native-reanimated'\nimport { useShouldReduceMotion } from '../config'\nimport { isFocusVisible } from '../gestures'\nimport { usePresence } from '../presence'\nimport { resolveAnimatableValue } from '../transitions'\nimport {\n type AnimatableValue,\n type AnimateStyle,\n type AnimationCallbackInfo,\n type GestureSubStates,\n type MotionComponent,\n type MotionProps,\n type PerPropertyTransition,\n type Transition,\n type TransitionConfig,\n type VariantController,\n type VariantsMap,\n} from '../types'\n\n/**\n * Animatable properties supported in the alpha. Expanding this set is a\n * mechanical change — add the key here, decide whether it lives inside\n * `transform`, and wire it through `buildAnimatedStyle` below.\n */\nconst TRANSFORM_KEYS = [\n 'translateX',\n 'translateY',\n 'scale',\n 'scaleX',\n 'scaleY',\n 'rotate',\n] as const\n\nconst NUMERIC_TOP_LEVEL_KEYS = [\n 'opacity',\n 'width',\n 'height',\n 'borderRadius',\n] as const\n\n// Color-valued keys. Reanimated's value setter detects color strings and\n// interpolates between their packed RGBA representations natively in\n// `withSpring` / `withTiming` — so the resolver path is identical to numeric\n// keys; only the shared-value seed and the resting default differ.\n//\n// `tintColor` is Image-only, but allocated unconditionally here: the\n// per-primitive type system (`AnimateStyle<C>`) is what gates which keys\n// `animate` accepts at compile time. An unused shared value is a single ref;\n// allocating it everywhere keeps hook order stable and the factory generic.\nconst COLOR_KEYS = [\n 'backgroundColor',\n 'borderColor',\n 'color',\n 'tintColor',\n] as const\n\n/**\n * Per-effect transform-group coordinator. Counts how many transform-axis\n * terminal callbacks are still pending; when the last one fires, the\n * factory emits a single coalesced `onAnimationEnd({ key: 'transform' })`\n * instead of N per-axis callbacks. Mutated by the dispatch closure.\n */\ntype TransformGroup = { remaining: number }\n\nconst ALL_KEYS = [\n ...TRANSFORM_KEYS,\n ...NUMERIC_TOP_LEVEL_KEYS,\n ...COLOR_KEYS,\n] as const\ntype AnimatableKey = (typeof ALL_KEYS)[number]\ntype TransformKey = (typeof TRANSFORM_KEYS)[number]\n\nconst TRANSFORM_KEY_SET = new Set<AnimatableKey>(TRANSFORM_KEYS)\n\n// Stable style object applied while a Motion primitive is mid-exit so taps\n// fall through. Hoisted so every render shares the same reference and\n// Reanimated's style merging treats it as a no-op when present.\nconst EXITING_POINTER_EVENTS_STYLE = { pointerEvents: 'none' } as const\n\nconst DEFAULT_RESTING: Record<AnimatableKey, number | string> = {\n translateX: 0,\n translateY: 0,\n scale: 1,\n scaleX: 1,\n scaleY: 1,\n rotate: 0,\n opacity: 1,\n width: 0,\n height: 0,\n borderRadius: 0,\n // 'transparent' is the only safe universal default for colors: it works as\n // an initial seed for any color animation (no jarring opaque flash on mount\n // when `initial` is omitted) and rgba(0,0,0,0) interpolates cleanly into\n // any opaque target via Reanimated's color util.\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n color: 'transparent',\n tintColor: 'transparent',\n}\n\nconst TRANSITION_KEYS = new Set([\n 'type',\n 'tension',\n 'friction',\n 'mass',\n 'velocity',\n 'restSpeedThreshold',\n 'restDisplacementThreshold',\n 'duration',\n 'easing',\n 'delay',\n 'repeat',\n 'deceleration',\n 'clamp',\n])\n\nfunction isTopLevelTransition(t: unknown): t is TransitionConfig {\n if (t === null || typeof t !== 'object') return false\n const keys = Object.keys(t as object)\n if (keys.length === 0) return false\n return keys.every((k) => TRANSITION_KEYS.has(k))\n}\n\nfunction transitionFor<S>(\n prop: keyof S,\n transition: Transition<S> | undefined,\n): TransitionConfig | undefined {\n if (!transition) return undefined\n if (isTopLevelTransition(transition)) return transition\n return (transition as PerPropertyTransition<S>)[prop]\n}\n\n/**\n * Factory that wraps a React Native primitive as a `Motion.*` component.\n *\n * The generic `C` flows through `MotionProps`, so `animate` / `initial` /\n * `exit` / `transition` all infer from `C`'s `style` prop. There is no\n * shared `ViewStyle & TextStyle & ImageStyle` fallback.\n *\n * Alpha scope: numeric properties (transforms, opacity, width, height,\n * borderRadius) and color properties (backgroundColor, borderColor, color,\n * tintColor) applied via Reanimated shared values + `useAnimatedStyle`.\n */\nexport function createMotionComponent<C extends ComponentType<any>>(\n Component: C,\n): MotionComponent<C> {\n const AnimatedComponent = Animated.createAnimatedComponent(\n Component as ComponentType<any>,\n )\n\n type Props = React.ComponentProps<C> & MotionProps<React.ComponentProps<C>>\n\n const Motion = forwardRef<unknown, Props>(function Motion(props, ref) {\n const {\n initial,\n animate,\n exit,\n transition,\n variants,\n controller,\n gesture,\n onAnimationEnd,\n style,\n ...rest\n } = props as Props & { style?: unknown }\n\n // <Presence> contract: when an ancestor flips `isPresent` to false the\n // child stays rendered until `safeToRemove` is called, giving the exit\n // animation time to play. `null` when there is no <Presence> ancestor.\n const presence = usePresence()\n const isExiting = presence !== null && presence.isPresent === false\n\n // Resolved reduced-motion preference for this subtree. When true, every\n // per-key transition is replaced with `no-animation` below, so values\n // snap to target without interpolation. The hook also subscribes to OS\n // changes (via Reanimated's `useReducedMotion`), so toggling the\n // accessibility setting at runtime re-renders this component.\n const shouldReduceMotion = useShouldReduceMotion()\n\n // Pin the latest `onAnimationEnd` in a ref so the worklet callback always\n // dispatches against the current closure without re-resolving the\n // animation graph. Worklets can read refs via `runOnJS`.\n const onAnimationEndRef = useRef(onAnimationEnd)\n onAnimationEndRef.current = onAnimationEnd\n\n // Resolve `animate` against `variants` / `controller`. The controller's\n // `current` wins when both are set (typed contract: don't mix\n // `controller` and `animate` — controller drives the animation in that\n // mode). When `animate` is a string and `variants` exist, look it up.\n const variantKey = useControllerKey(controller)\n const resolvedAnimate = resolveAnimateInput(\n animate as AnimateStyle<unknown> | string | undefined,\n variants as VariantsMap<unknown> | undefined,\n variantKey,\n )\n\n const animateRecord = (resolvedAnimate ?? {}) as Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n >\n const initialRecord =\n initial && initial !== false\n ? (initial as Partial<Record<AnimatableKey, number | string>>)\n : undefined\n const exitRecord = exit\n ? (exit as Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n >)\n : undefined\n\n // Gesture sub-state activation tracked as JS state so changes invalidate\n // the merged-target signature and re-run the animation effect. The cost\n // is four useState slots regardless of whether `gesture` is set; that's\n // tiny and lets us stay rules-of-hooks-clean.\n const [pressed, setPressed] = useState(false)\n const [focused, setFocused] = useState(false)\n const [focusVisible, setFocusVisible] = useState(false)\n const [hovered, setHovered] = useState(false)\n\n // The set of keys this instance animates is locked at first render. With\n // variants in play the union across all variants is what matters — a key\n // touched by any variant must be active so the worklet picks it up when\n // the controller transitions. Gesture sub-states join the same union so\n // pressed/focused/hovered targets can drive any key they declare.\n const activeKeysRef = useRef<readonly AnimatableKey[] | null>(null)\n if (activeKeysRef.current === null) {\n const touched = new Set<AnimatableKey>()\n for (const k of ALL_KEYS) {\n if (k in animateRecord) touched.add(k)\n if (initialRecord && k in initialRecord) touched.add(k)\n }\n if (variants) {\n for (const variant of Object.values(variants) as object[]) {\n if (!variant) continue\n for (const k of ALL_KEYS) {\n if (k in variant) touched.add(k)\n }\n }\n }\n if (gesture) {\n for (const subState of [\n gesture.pressed,\n gesture.focused,\n gesture.focusVisible,\n gesture.hovered,\n ] as Array<object | undefined>) {\n if (!subState) continue\n for (const k of ALL_KEYS) {\n if (k in subState) touched.add(k)\n }\n }\n }\n if (exitRecord) {\n for (const k of ALL_KEYS) {\n if (k in exitRecord) touched.add(k)\n }\n }\n activeKeysRef.current = ALL_KEYS.filter((k) => touched.has(k))\n }\n const hasTransformRef = useRef<boolean>(\n activeKeysRef.current.some((k) => TRANSFORM_KEY_SET.has(k)),\n )\n\n const sharedValues = useAnimatableSharedValues((key) => {\n if (initial === false) {\n const a = animateRecord[key]\n return restValue(a) ?? DEFAULT_RESTING[key]\n }\n return (\n initialRecord?.[key] ??\n restValue(animateRecord[key]) ??\n DEFAULT_RESTING[key]\n )\n })\n\n // Merge gesture sub-state targets over the base `animate` record. Keys\n // touched by any sub-state always appear in the merged record (falling\n // back to `animateRecord` or `DEFAULT_RESTING`) so releasing a gesture\n // animates back to a defined value rather than getting skipped.\n //\n // While exiting, exit values override everything — gesture / animate\n // targets are inert because the component is on its way out.\n const mergedRecord =\n isExiting && exitRecord\n ? { ...animateRecord, ...exitRecord }\n : mergeGestureTargets(animateRecord, gesture, {\n pressed,\n focused,\n focusVisible,\n hovered,\n })\n const mergedSig =\n stableSig(mergedRecord) +\n (isExiting ? '|exit' : '') +\n (shouldReduceMotion ? '|rm' : '')\n const transitionSig = stableSig(transition)\n\n // Stable ref to the live `safeToRemove` so the effect's settle-counter\n // closure can reach the latest <Presence> binding without retriggering.\n const safeToRemoveRef = useRef<(() => void) | undefined>(undefined)\n safeToRemoveRef.current = presence?.safeToRemove\n\n useEffect(() => {\n // Exit fast-path: nothing to animate (or no exit prop), tell <Presence>\n // immediately so the unmount isn't gated on a phantom animation.\n if (isExiting && (!exitRecord || Object.keys(exitRecord).length === 0)) {\n safeToRemoveRef.current?.()\n return\n }\n\n let pending = 0\n let done = false\n const onSettle = () => {\n if (done) return\n pending--\n if (pending <= 0) {\n done = true\n if (isExiting) safeToRemoveRef.current?.()\n }\n }\n\n // Count transform axes participating in this effect run so the factory\n // can coalesce their terminal callbacks into a single transform-group\n // event. `undefined` when no transform axis is animating, which lets\n // the factory skip the coalescing branch entirely.\n let transformPending = 0\n for (const k of ALL_KEYS) {\n if (TRANSFORM_KEY_SET.has(k) && mergedRecord[k] !== undefined) {\n transformPending++\n }\n }\n const transformGroup: TransformGroup | undefined =\n transformPending > 0 ? { remaining: transformPending } : undefined\n\n for (const key of ALL_KEYS) {\n const target = mergedRecord[key]\n if (target === undefined) continue\n // Reduced-motion overrides every per-key transition (and any nested\n // sequence-step transition) with `no-animation`, which the resolver\n // turns into a direct value assignment. Sequences still iterate but\n // each step settles instantly, which matches the \"snap to final\n // state\" expectation.\n const cfg = shouldReduceMotion\n ? ({ type: 'no-animation' } as const)\n : transitionFor(key, transition)\n if (isExiting) pending++\n const factory = makeKeyCallbackFactory(\n key,\n sharedValues[key],\n targetEndValue(target),\n onAnimationEndRef,\n {\n stepCount: stepCountOf(target),\n totalIterations: totalIterationsOf(cfg),\n },\n isExiting ? onSettle : undefined,\n TRANSFORM_KEY_SET.has(key) ? transformGroup : undefined,\n )\n sharedValues[key].value = resolveAnimatableValue(\n target,\n cfg,\n factory,\n ) as never\n }\n\n // No exit-targeted keys (only `animate` keys present, no `exit`)\n // → release immediately rather than wait for animations that aren't\n // headed toward an exit value.\n if (isExiting && pending === 0) {\n safeToRemoveRef.current?.()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [mergedSig, transitionSig])\n\n const animatedStyle = useAnimatedStyle(() => {\n const activeKeys = activeKeysRef.current!\n const hasTransform = hasTransformRef.current\n const out: Record<string, unknown> = {}\n const transform: Array<Record<string, unknown>> = []\n for (const key of activeKeys) {\n const v = sharedValues[key].value\n if (TRANSFORM_KEY_SET.has(key)) {\n transform.push(\n key === 'rotate' ? { rotate: `${v}deg` } : { [key]: v },\n )\n } else {\n out[key] = v\n }\n }\n if (hasTransform) out.transform = transform\n return out\n })\n\n // Exiting children are tap-deaf: the next press should fall through to\n // whatever is underneath, not re-trigger a soon-to-unmount node. This is\n // the moti #297 fix and a v0.1 acceptance criterion. RN 0.71+ deprecates\n // `pointerEvents` as a prop in favor of the style key, so we merge it\n // alongside the animated style instead of spreading as a prop.\n const mergedStyle = useMemo(\n () =>\n (isExiting\n ? [style, animatedStyle, EXITING_POINTER_EVENTS_STYLE]\n : [style, animatedStyle]) as unknown,\n [style, animatedStyle, isExiting],\n )\n\n const gestureHandlers = useGestureHandlers(\n gesture,\n rest as Record<string, unknown>,\n setPressed,\n setFocused,\n setFocusVisible,\n setHovered,\n )\n\n return (\n <AnimatedComponent\n ref={ref as never}\n {...(rest as object)}\n {...gestureHandlers}\n style={mergedStyle}\n />\n )\n })\n\n Motion.displayName = `Motion(${Component.displayName ?? Component.name ?? 'Component'})`\n\n return Motion as unknown as MotionComponent<C>\n}\n\ntype SharedValueMap = Record<AnimatableKey, SharedValue<number | string>>\n\n/**\n * Allocate one shared value per animatable key in `ALL_KEYS` and return a\n * **stable** map — same object reference across every render.\n *\n * Stability matters: `useAnimatedStyle` derives its dep array from\n * `Object.values(updater.__closure)`. Our worklet captures `sharedValues`,\n * so a fresh object literal each render would change that dep, fire\n * Reanimated's effect, and re-bind the worklet on the UI thread on every\n * render — the exact cost design principle 8 calls out. The shared values themselves\n * are stable across renders (Reanimated's `useSharedValue` is a `useRef`\n * under the hood), so snapshotting the wrapping object once is safe.\n *\n * Hooks are called in a stable, lexical order — fine for rules-of-hooks.\n * Unused shared values are cheap; the worklet skips them via\n * `activeKeysRef`. Color keys are seeded with the initial color string so\n * Reanimated's value setter recognizes the slot as a color from the first\n * `withSpring` / `withTiming` call.\n */\nfunction useAnimatableSharedValues(\n init: (key: AnimatableKey) => number | string,\n): SharedValueMap {\n const translateX = useSharedValue<number | string>(init('translateX'))\n const translateY = useSharedValue<number | string>(init('translateY'))\n const scale = useSharedValue<number | string>(init('scale'))\n const scaleX = useSharedValue<number | string>(init('scaleX'))\n const scaleY = useSharedValue<number | string>(init('scaleY'))\n const rotate = useSharedValue<number | string>(init('rotate'))\n const opacity = useSharedValue<number | string>(init('opacity'))\n const width = useSharedValue<number | string>(init('width'))\n const height = useSharedValue<number | string>(init('height'))\n const borderRadius = useSharedValue<number | string>(init('borderRadius'))\n const backgroundColor = useSharedValue<number | string>(\n init('backgroundColor'),\n )\n const borderColor = useSharedValue<number | string>(init('borderColor'))\n const color = useSharedValue<number | string>(init('color'))\n const tintColor = useSharedValue<number | string>(init('tintColor'))\n\n const ref = useRef<SharedValueMap | null>(null)\n if (ref.current === null) {\n ref.current = {\n translateX,\n translateY,\n scale,\n scaleX,\n scaleY,\n rotate,\n opacity,\n width,\n height,\n borderRadius,\n backgroundColor,\n borderColor,\n color,\n tintColor,\n }\n }\n return ref.current\n}\n\n/**\n * Build a per-key `CallbackFactory` for the resolver. Each step in a sequence\n * (or the single animation, when `value` isn't an array) gets its own\n * Reanimated callback; when it settles on the UI thread, the callback bridges\n * to JS via `runOnJS` and invokes the user's `onAnimationEnd` with a fully\n * populated `AnimationCallbackInfo`.\n *\n * Phase resolution lives here, on the JS thread. The resolver hands us a\n * coarse rawPhase (`'step'` for any sequence step, `'animation'` for a\n * single-shot terminal); we map that onto the public phase set\n * (`'step' | 'sequence' | 'repeat' | 'animation'`) using `meta` and the\n * iteration counter. `iteration` resets per effect run because the factory\n * is constructed fresh inside the effect.\n */\nfunction makeKeyCallbackFactory(\n key: string,\n sharedValue: SharedValue<number | string>,\n target: number | string | undefined,\n onAnimationEndRef: {\n current: ((info: AnimationCallbackInfo<unknown>) => void) | undefined\n },\n meta: { stepCount: number; totalIterations: number },\n onSettle?: () => void,\n transformGroup?: TransformGroup,\n) {\n if (!onAnimationEndRef.current && !onSettle) return undefined\n\n // Shared across this animation graph's callbacks (one per sequence step,\n // or one for a single-shot). Mutated when a full pass completes.\n const state = { iteration: 0 }\n\n const isTransformKey = TRANSFORM_KEY_SET.has(key as AnimatableKey)\n\n const dispatch = (\n rawPhase: 'step' | 'animation',\n step: number | undefined,\n finished: boolean,\n value: number | string | undefined,\n ) => {\n const isLastIteration = state.iteration >= meta.totalIterations - 1\n let phase: 'step' | 'sequence' | 'repeat' | 'animation'\n let isTerminal = false\n\n if (rawPhase === 'step') {\n const isLastInPass = step !== undefined && step === meta.stepCount - 1\n if (!isLastInPass) {\n phase = 'step'\n } else if (isLastIteration) {\n phase = 'animation'\n isTerminal = true\n } else {\n phase = 'sequence'\n }\n } else if (isLastIteration) {\n phase = 'animation'\n isTerminal = true\n } else {\n phase = 'repeat'\n }\n\n const reportedIteration = state.iteration\n if (phase === 'sequence' || phase === 'repeat') state.iteration++\n\n const fn = onAnimationEndRef.current\n if (fn) {\n // Transform-group coalescing: a multi-axis translate / scale /\n // rotate animation should fire onAnimationEnd ONCE for the logical\n // transform, not once per axis. We only coalesce the terminal\n // `'animation'` phase — `step`/`sequence`/`repeat` events fire\n // per-axis since each is its own logical event. Released per-axis\n // for a single-axis case too, with `key: 'transform'` for\n // consistency.\n if (isTransformKey && transformGroup && phase === 'animation') {\n transformGroup.remaining--\n if (transformGroup.remaining <= 0) {\n fn({\n key: 'transform' as never,\n finished,\n value,\n target,\n phase,\n step,\n iteration: reportedIteration,\n })\n }\n } else {\n fn({\n key: key as never,\n finished,\n value,\n target,\n phase,\n step,\n iteration: reportedIteration,\n })\n }\n }\n // Settle hooks fire per-axis on the terminal phase — <Presence> waits\n // for *every* exiting property to settle before unmounting, so we\n // intentionally do not coalesce these (the transform-group coalesce\n // is purely a user-callback ergonomic).\n if (onSettle && isTerminal) onSettle()\n }\n\n return (rawPhase: 'step' | 'animation', step: number | undefined) => {\n // Reanimated invokes the callback with only `finished` (see\n // valueSetter.js:24,40,51 in 4.x) — `current` is never passed. Read the\n // shared value inside the worklet; by the time the callback fires the\n // final/clamped value has already been written to it.\n const cb = (finished?: boolean) => {\n 'worklet'\n runOnJS(dispatch)(rawPhase, step, !!finished, sharedValue.value)\n }\n return cb\n }\n}\n\n/**\n * Number of sequence steps in an animatable value. `1` for plain values and\n * single-step `{ to }` objects; the array length for keyframe arrays.\n */\nfunction stepCountOf(v: AnimatableValue<number | string> | undefined): number {\n if (Array.isArray(v)) return v.length\n return 1\n}\n\n/**\n * Total number of iterations the animation will run, including the initial\n * pass. `1` when there is no `repeat`; `Number.POSITIVE_INFINITY` for\n * `'infinite'`. Decay and `no-animation` configs cannot repeat — both return\n * `1` so the iteration counter stays at 0.\n */\nfunction totalIterationsOf(cfg: TransitionConfig | undefined): number {\n if (!cfg || cfg.type === 'no-animation' || cfg.type === 'decay') return 1\n const r = cfg.repeat\n if (r === undefined) return 1\n if (r === 'infinite') return Number.POSITIVE_INFINITY\n if (typeof r === 'number') return r\n if (r.count === 'infinite') return Number.POSITIVE_INFINITY\n return r.count\n}\n\n/**\n * Pull a single end-value out of an `AnimatableValue` for the\n * `AnimationCallbackInfo.target` field. Plain numbers/strings come through;\n * the last sequence step's `to`/value is used for arrays; `{ to }` step\n * objects use `to`. Returns `undefined` for unrecognized shapes.\n */\nfunction targetEndValue(\n v: AnimatableValue<number | string> | undefined,\n): number | string | undefined {\n if (v === undefined) return undefined\n if (typeof v === 'number' || typeof v === 'string') return v\n if (Array.isArray(v)) {\n return v.length > 0\n ? targetEndValue(v[v.length - 1] as AnimatableValue<number | string>)\n : undefined\n }\n if (typeof v === 'object' && v !== null && 'to' in v) {\n const to = (v as { to: unknown }).to\n return typeof to === 'number' || typeof to === 'string' ? to : undefined\n }\n return undefined\n}\n\n/**\n * Subscribe to a `VariantController` and return its `current` key. Returns\n * `undefined` when no controller is provided so callers can fall back to a\n * literal `animate` value.\n */\nfunction useControllerKey(\n controller: VariantController | undefined,\n): string | undefined {\n const [, setTick] = useState(0)\n useEffect(() => {\n if (!controller) return\n const unsub = controller.subscribe(() => setTick((n) => n + 1))\n return unsub\n }, [controller])\n return controller?.current\n}\n\n/**\n * Resolve the effective `animate` target from the public-prop tuple.\n *\n * Precedence: `controller.current` (when controller is set) > string-keyed\n * `animate` looked up in `variants` > literal `animate` object > `undefined`.\n */\nfunction resolveAnimateInput(\n animate: AnimateStyle<unknown> | string | undefined,\n variants: VariantsMap<unknown> | undefined,\n controllerKey: string | undefined,\n): AnimateStyle<unknown> | undefined {\n if (controllerKey !== undefined && variants && controllerKey in variants) {\n return variants[controllerKey]\n }\n if (typeof animate === 'string') {\n if (variants && animate in variants) return variants[animate]\n if (__DEV__) {\n console.warn(\n `[inertia] animate=\"${animate}\" but no matching variant. Did you forget to pass \\`variants\\`?`,\n )\n }\n return undefined\n }\n return animate as AnimateStyle<unknown> | undefined\n}\n\ndeclare const __DEV__: boolean\n\n/**\n * Pick the resting/initial-frame value out of an `AnimatableValue`. Plain\n * numbers and color strings come through unchanged; sequence arrays use their\n * first element; `{ to }` step objects use `to`. Unresolvable shapes return\n * `undefined` so the caller can fall back to `DEFAULT_RESTING`.\n */\nfunction restValue(\n v: AnimatableValue<number | string> | undefined,\n): number | string | undefined {\n if (v === undefined) return undefined\n if (typeof v === 'number' || typeof v === 'string') return v\n if (Array.isArray(v)) {\n return v.length > 0\n ? restValue(v[0] as AnimatableValue<number | string>)\n : undefined\n }\n if (typeof v === 'object' && v !== null && 'to' in v) {\n const to = (v as { to: unknown }).to\n return typeof to === 'number' || typeof to === 'string' ? to : undefined\n }\n return undefined\n}\n\nfunction stableSig(value: unknown): string {\n if (value === undefined) return ''\n try {\n return stableStringify(value)\n } catch {\n return String(value)\n }\n}\n\n/**\n * JSON.stringify with keys sorted at every level — gives a stable signature\n * regardless of property declaration order. Functions serialize as `null` so a\n * change in easing-fn reference is invisible here; that's fine for v0.1\n * (easing swaps are rare and the worklet wrapper handles correctness).\n */\nfunction stableStringify(v: unknown): string {\n if (v === null || typeof v !== 'object') {\n if (typeof v === 'function' || v === undefined) return 'null'\n return JSON.stringify(v)\n }\n if (Array.isArray(v)) {\n return '[' + v.map(stableStringify).join(',') + ']'\n }\n const obj = v as Record<string, unknown>\n const keys = Object.keys(obj).sort()\n return (\n '{' +\n keys\n .map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k]))\n .join(',') +\n '}'\n )\n}\n\n/**\n * Merge gesture sub-state targets over the base `animate` record. Keys touched\n * by any declared sub-state are always present in the result so releasing a\n * gesture animates the property back to a defined value (the base `animate`\n * value when present, otherwise `DEFAULT_RESTING`). Sub-states layer in\n * priority order (lowest first):\n * `hovered` < `focused` < `focusVisible` < `pressed`.\n */\nfunction mergeGestureTargets(\n base: Partial<Record<AnimatableKey, AnimatableValue<number | string>>>,\n gesture: GestureSubStates<unknown> | undefined,\n active: {\n pressed: boolean\n focused: boolean\n focusVisible: boolean\n hovered: boolean\n },\n): Partial<Record<AnimatableKey, AnimatableValue<number | string>>> {\n if (!gesture) return base\n const merged: Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n > = {\n ...base,\n }\n const subStates = [\n gesture.hovered,\n gesture.focused,\n gesture.focusVisible,\n gesture.pressed,\n ] as Array<\n Partial<Record<AnimatableKey, AnimatableValue<number | string>>> | undefined\n >\n for (const sub of subStates) {\n if (!sub) continue\n for (const k of ALL_KEYS) {\n if (k in sub && !(k in merged)) {\n merged[k] = DEFAULT_RESTING[k]\n }\n }\n }\n if (active.hovered && gesture.hovered) {\n Object.assign(\n merged,\n gesture.hovered as Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n >,\n )\n }\n if (active.focused && gesture.focused) {\n Object.assign(\n merged,\n gesture.focused as Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n >,\n )\n }\n if (active.focusVisible && gesture.focusVisible) {\n Object.assign(\n merged,\n gesture.focusVisible as Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n >,\n )\n }\n if (active.pressed && gesture.pressed) {\n Object.assign(\n merged,\n gesture.pressed as Partial<\n Record<AnimatableKey, AnimatableValue<number | string>>\n >,\n )\n }\n return merged\n}\n\ntype GestureHandlers = Record<string, (event: unknown) => void>\n\n/**\n * Build the touch / focus / hover handler props for a gesture-enabled Motion\n * primitive. Returns an empty object when `gesture` is undefined so the\n * component renders identically to the gesture-less path (zero overhead).\n *\n * Existing user-supplied handlers on the same events are composed: the user's\n * handler runs first, then the internal state setter. We pull user handlers\n * out of `rest` rather than overwriting them.\n */\nfunction useGestureHandlers(\n gesture: GestureSubStates<unknown> | undefined,\n rest: Record<string, unknown>,\n setPressed: (next: boolean) => void,\n setFocused: (next: boolean) => void,\n setFocusVisible: (next: boolean) => void,\n setHovered: (next: boolean) => void,\n): GestureHandlers {\n return useMemo(() => {\n if (!gesture) return {}\n const handlers: GestureHandlers = {}\n if (gesture.pressed) {\n handlers.onTouchStart = compose(rest.onTouchStart, () => setPressed(true))\n handlers.onTouchEnd = compose(rest.onTouchEnd, () => setPressed(false))\n handlers.onTouchCancel = compose(rest.onTouchCancel, () =>\n setPressed(false),\n )\n // Pressable / TouchableOpacity expose press hooks above the touch layer;\n // forward to those when present so wrapping consumers stay consistent.\n handlers.onPressIn = compose(rest.onPressIn, () => setPressed(true))\n handlers.onPressOut = compose(rest.onPressOut, () => setPressed(false))\n }\n // Mount onFocus/onBlur if either focus sub-state is declared. The two flags\n // are independent: `focused` always tracks focus; `focusVisible` only\n // engages when the most recent input was keyboard (W3C `:focus-visible`\n // semantics). On native the modality is always `'keyboard'`, so the two\n // flags move together.\n if (gesture.focused || gesture.focusVisible) {\n handlers.onFocus = compose(rest.onFocus, () => {\n if (gesture.focused) setFocused(true)\n if (gesture.focusVisible && isFocusVisible()) setFocusVisible(true)\n })\n handlers.onBlur = compose(rest.onBlur, () => {\n if (gesture.focused) setFocused(false)\n if (gesture.focusVisible) setFocusVisible(false)\n })\n }\n if (gesture.hovered) {\n // Web-only events. RN-Web 0.72+ accepts these on View; native ignores\n // them so the cost is zero on iOS / Android.\n handlers.onMouseEnter = compose(rest.onMouseEnter, () => setHovered(true))\n handlers.onMouseLeave = compose(rest.onMouseLeave, () =>\n setHovered(false),\n )\n }\n return handlers\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n gesture?.pressed ? 1 : 0,\n gesture?.focused ? 1 : 0,\n gesture?.focusVisible ? 1 : 0,\n gesture?.hovered ? 1 : 0,\n rest.onTouchStart,\n rest.onTouchEnd,\n rest.onTouchCancel,\n rest.onPressIn,\n rest.onPressOut,\n rest.onFocus,\n rest.onBlur,\n rest.onMouseEnter,\n rest.onMouseLeave,\n ])\n}\n\nfunction compose(\n user: unknown,\n ours: (event: unknown) => void,\n): (event: unknown) => void {\n if (typeof user !== 'function') return ours\n return (event: unknown) => {\n ;(user as (event: unknown) => void)(event)\n ours(event)\n }\n}\n\n// Suppress the implicit any-return of the rotate ternary's union shape.\n// `TransformKey` is exported only to keep the type readable in d.ts.\nexport type { TransformKey }\n","import { Image } from 'react-native'\nimport { createMotionComponent } from './createMotionComponent'\n\n/**\n * Animatable `Image`. Inherits `Image`'s prop surface, with `animate` /\n * `initial` / `exit` / `transition` typed against `ImageStyle` (so\n * `tintColor` is accepted on `animate` here, but rejected on `Motion.View`).\n */\nexport const MotionImage = createMotionComponent(Image)\n"]}
|
package/dist/motion/Image.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Image } from 'react-native';
|
|
1
|
+
import { Image, Platform } from 'react-native';
|
|
2
2
|
import { createContext, forwardRef, useRef, useState, useEffect, useMemo, useContext } from 'react';
|
|
3
3
|
import Animated, { useAnimatedStyle, useReducedMotion, useSharedValue, withSequence, runOnJS, withRepeat, withDelay, withDecay, withTiming, Easing, withSpring, isWorkletFunction } from 'react-native-reanimated';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -20,6 +20,29 @@ function useShouldReduceMotion() {
|
|
|
20
20
|
if (reducedMotion === "always") return true;
|
|
21
21
|
return osReduced;
|
|
22
22
|
}
|
|
23
|
+
var modality = "keyboard";
|
|
24
|
+
var installed = false;
|
|
25
|
+
function setKeyboard() {
|
|
26
|
+
modality = "keyboard";
|
|
27
|
+
}
|
|
28
|
+
function setPointer() {
|
|
29
|
+
modality = "pointer";
|
|
30
|
+
}
|
|
31
|
+
function ensureInstalled() {
|
|
32
|
+
if (installed) return;
|
|
33
|
+
if (Platform.OS !== "web") return;
|
|
34
|
+
if (typeof document === "undefined") return;
|
|
35
|
+
document.addEventListener("keydown", setKeyboard, true);
|
|
36
|
+
document.addEventListener("mousedown", setPointer, true);
|
|
37
|
+
document.addEventListener("pointerdown", setPointer, true);
|
|
38
|
+
document.addEventListener("touchstart", setPointer, true);
|
|
39
|
+
installed = true;
|
|
40
|
+
}
|
|
41
|
+
function isFocusVisible() {
|
|
42
|
+
if (Platform.OS !== "web") return true;
|
|
43
|
+
ensureInstalled();
|
|
44
|
+
return modality === "keyboard";
|
|
45
|
+
}
|
|
23
46
|
var PresenceContext = createContext(null);
|
|
24
47
|
function usePresence() {
|
|
25
48
|
return useContext(PresenceContext);
|
|
@@ -163,8 +186,23 @@ var TRANSFORM_KEYS = [
|
|
|
163
186
|
"scaleY",
|
|
164
187
|
"rotate"
|
|
165
188
|
];
|
|
166
|
-
var
|
|
167
|
-
|
|
189
|
+
var NUMERIC_TOP_LEVEL_KEYS = [
|
|
190
|
+
"opacity",
|
|
191
|
+
"width",
|
|
192
|
+
"height",
|
|
193
|
+
"borderRadius"
|
|
194
|
+
];
|
|
195
|
+
var COLOR_KEYS = [
|
|
196
|
+
"backgroundColor",
|
|
197
|
+
"borderColor",
|
|
198
|
+
"color",
|
|
199
|
+
"tintColor"
|
|
200
|
+
];
|
|
201
|
+
var ALL_KEYS = [
|
|
202
|
+
...TRANSFORM_KEYS,
|
|
203
|
+
...NUMERIC_TOP_LEVEL_KEYS,
|
|
204
|
+
...COLOR_KEYS
|
|
205
|
+
];
|
|
168
206
|
var TRANSFORM_KEY_SET = new Set(TRANSFORM_KEYS);
|
|
169
207
|
var EXITING_POINTER_EVENTS_STYLE = { pointerEvents: "none" };
|
|
170
208
|
var DEFAULT_RESTING = {
|
|
@@ -177,7 +215,15 @@ var DEFAULT_RESTING = {
|
|
|
177
215
|
opacity: 1,
|
|
178
216
|
width: 0,
|
|
179
217
|
height: 0,
|
|
180
|
-
borderRadius: 0
|
|
218
|
+
borderRadius: 0,
|
|
219
|
+
// 'transparent' is the only safe universal default for colors: it works as
|
|
220
|
+
// an initial seed for any color animation (no jarring opaque flash on mount
|
|
221
|
+
// when `initial` is omitted) and rgba(0,0,0,0) interpolates cleanly into
|
|
222
|
+
// any opaque target via Reanimated's color util.
|
|
223
|
+
backgroundColor: "transparent",
|
|
224
|
+
borderColor: "transparent",
|
|
225
|
+
color: "transparent",
|
|
226
|
+
tintColor: "transparent"
|
|
181
227
|
};
|
|
182
228
|
var TRANSITION_KEYS = /* @__PURE__ */ new Set([
|
|
183
229
|
"type",
|
|
@@ -238,6 +284,7 @@ function createMotionComponent(Component) {
|
|
|
238
284
|
const exitRecord = exit ? exit : void 0;
|
|
239
285
|
const [pressed, setPressed] = useState(false);
|
|
240
286
|
const [focused, setFocused] = useState(false);
|
|
287
|
+
const [focusVisible, setFocusVisible] = useState(false);
|
|
241
288
|
const [hovered, setHovered] = useState(false);
|
|
242
289
|
const activeKeysRef = useRef(null);
|
|
243
290
|
if (activeKeysRef.current === null) {
|
|
@@ -258,6 +305,7 @@ function createMotionComponent(Component) {
|
|
|
258
305
|
for (const subState of [
|
|
259
306
|
gesture.pressed,
|
|
260
307
|
gesture.focused,
|
|
308
|
+
gesture.focusVisible,
|
|
261
309
|
gesture.hovered
|
|
262
310
|
]) {
|
|
263
311
|
if (!subState) continue;
|
|
@@ -286,6 +334,7 @@ function createMotionComponent(Component) {
|
|
|
286
334
|
const mergedRecord = isExiting && exitRecord ? { ...animateRecord, ...exitRecord } : mergeGestureTargets(animateRecord, gesture, {
|
|
287
335
|
pressed,
|
|
288
336
|
focused,
|
|
337
|
+
focusVisible,
|
|
289
338
|
hovered
|
|
290
339
|
});
|
|
291
340
|
const mergedSig = stableSig(mergedRecord) + (isExiting ? "|exit" : "") + (shouldReduceMotion ? "|rm" : "");
|
|
@@ -368,6 +417,7 @@ function createMotionComponent(Component) {
|
|
|
368
417
|
rest,
|
|
369
418
|
setPressed,
|
|
370
419
|
setFocused,
|
|
420
|
+
setFocusVisible,
|
|
371
421
|
setHovered
|
|
372
422
|
);
|
|
373
423
|
return /* @__PURE__ */ jsx(
|
|
@@ -394,6 +444,12 @@ function useAnimatableSharedValues(init) {
|
|
|
394
444
|
const width = useSharedValue(init("width"));
|
|
395
445
|
const height = useSharedValue(init("height"));
|
|
396
446
|
const borderRadius = useSharedValue(init("borderRadius"));
|
|
447
|
+
const backgroundColor = useSharedValue(
|
|
448
|
+
init("backgroundColor")
|
|
449
|
+
);
|
|
450
|
+
const borderColor = useSharedValue(init("borderColor"));
|
|
451
|
+
const color = useSharedValue(init("color"));
|
|
452
|
+
const tintColor = useSharedValue(init("tintColor"));
|
|
397
453
|
const ref = useRef(null);
|
|
398
454
|
if (ref.current === null) {
|
|
399
455
|
ref.current = {
|
|
@@ -406,7 +462,11 @@ function useAnimatableSharedValues(init) {
|
|
|
406
462
|
opacity,
|
|
407
463
|
width,
|
|
408
464
|
height,
|
|
409
|
-
borderRadius
|
|
465
|
+
borderRadius,
|
|
466
|
+
backgroundColor,
|
|
467
|
+
borderColor,
|
|
468
|
+
color,
|
|
469
|
+
tintColor
|
|
410
470
|
};
|
|
411
471
|
}
|
|
412
472
|
return ref.current;
|
|
@@ -525,13 +585,13 @@ function resolveAnimateInput(animate, variants, controllerKey) {
|
|
|
525
585
|
}
|
|
526
586
|
function restValue(v) {
|
|
527
587
|
if (v === void 0) return void 0;
|
|
528
|
-
if (typeof v === "number") return v;
|
|
588
|
+
if (typeof v === "number" || typeof v === "string") return v;
|
|
529
589
|
if (Array.isArray(v)) {
|
|
530
590
|
return v.length > 0 ? restValue(v[0]) : void 0;
|
|
531
591
|
}
|
|
532
592
|
if (typeof v === "object" && v !== null && "to" in v) {
|
|
533
593
|
const to = v.to;
|
|
534
|
-
return typeof to === "number" ? to : void 0;
|
|
594
|
+
return typeof to === "number" || typeof to === "string" ? to : void 0;
|
|
535
595
|
}
|
|
536
596
|
return void 0;
|
|
537
597
|
}
|
|
@@ -563,6 +623,7 @@ function mergeGestureTargets(base, gesture, active) {
|
|
|
563
623
|
const subStates = [
|
|
564
624
|
gesture.hovered,
|
|
565
625
|
gesture.focused,
|
|
626
|
+
gesture.focusVisible,
|
|
566
627
|
gesture.pressed
|
|
567
628
|
];
|
|
568
629
|
for (const sub of subStates) {
|
|
@@ -585,6 +646,12 @@ function mergeGestureTargets(base, gesture, active) {
|
|
|
585
646
|
gesture.focused
|
|
586
647
|
);
|
|
587
648
|
}
|
|
649
|
+
if (active.focusVisible && gesture.focusVisible) {
|
|
650
|
+
Object.assign(
|
|
651
|
+
merged,
|
|
652
|
+
gesture.focusVisible
|
|
653
|
+
);
|
|
654
|
+
}
|
|
588
655
|
if (active.pressed && gesture.pressed) {
|
|
589
656
|
Object.assign(
|
|
590
657
|
merged,
|
|
@@ -593,7 +660,7 @@ function mergeGestureTargets(base, gesture, active) {
|
|
|
593
660
|
}
|
|
594
661
|
return merged;
|
|
595
662
|
}
|
|
596
|
-
function useGestureHandlers(gesture, rest, setPressed, setFocused, setHovered) {
|
|
663
|
+
function useGestureHandlers(gesture, rest, setPressed, setFocused, setFocusVisible, setHovered) {
|
|
597
664
|
return useMemo(() => {
|
|
598
665
|
if (!gesture) return {};
|
|
599
666
|
const handlers = {};
|
|
@@ -607,9 +674,15 @@ function useGestureHandlers(gesture, rest, setPressed, setFocused, setHovered) {
|
|
|
607
674
|
handlers.onPressIn = compose(rest.onPressIn, () => setPressed(true));
|
|
608
675
|
handlers.onPressOut = compose(rest.onPressOut, () => setPressed(false));
|
|
609
676
|
}
|
|
610
|
-
if (gesture.focused) {
|
|
611
|
-
handlers.onFocus = compose(rest.onFocus, () =>
|
|
612
|
-
|
|
677
|
+
if (gesture.focused || gesture.focusVisible) {
|
|
678
|
+
handlers.onFocus = compose(rest.onFocus, () => {
|
|
679
|
+
if (gesture.focused) setFocused(true);
|
|
680
|
+
if (gesture.focusVisible && isFocusVisible()) setFocusVisible(true);
|
|
681
|
+
});
|
|
682
|
+
handlers.onBlur = compose(rest.onBlur, () => {
|
|
683
|
+
if (gesture.focused) setFocused(false);
|
|
684
|
+
if (gesture.focusVisible) setFocusVisible(false);
|
|
685
|
+
});
|
|
613
686
|
}
|
|
614
687
|
if (gesture.hovered) {
|
|
615
688
|
handlers.onMouseEnter = compose(rest.onMouseEnter, () => setHovered(true));
|
|
@@ -622,6 +695,7 @@ function useGestureHandlers(gesture, rest, setPressed, setFocused, setHovered) {
|
|
|
622
695
|
}, [
|
|
623
696
|
gesture?.pressed ? 1 : 0,
|
|
624
697
|
gesture?.focused ? 1 : 0,
|
|
698
|
+
gesture?.focusVisible ? 1 : 0,
|
|
625
699
|
gesture?.hovered ? 1 : 0,
|
|
626
700
|
rest.onTouchStart,
|
|
627
701
|
rest.onTouchEnd,
|