@rootnative/inertia 0.0.4 → 0.0.5

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/README.md +5 -1
  3. package/dist/{chunk-NAOXQJ7U.mjs → chunk-27MKBTSG.mjs} +1 -1
  4. package/dist/{chunk-CENTULW6.js → chunk-27U6766G.js} +2 -2
  5. package/dist/{chunk-D5KAHWMC.js → chunk-4NAMD62I.js} +7 -7
  6. package/dist/chunk-67GHRCF6.js +8 -0
  7. package/dist/{chunk-4ASOELLA.mjs → chunk-COEJVWRZ.mjs} +1 -1
  8. package/dist/chunk-GPOMFIIU.js +8 -0
  9. package/dist/{chunk-YKGY22SB.mjs → chunk-GTJ6VAH5.mjs} +1 -1
  10. package/dist/chunk-K63LXGKS.js +8 -0
  11. package/dist/{chunk-RF7J5FRM.mjs → chunk-OAUWLPQH.mjs} +1 -1
  12. package/dist/{chunk-WVRCKOPO.js → chunk-OBRGJAST.js} +3 -3
  13. package/dist/{chunk-K3CLP74S.mjs → chunk-OW5XTGVN.mjs} +2 -2
  14. package/dist/{chunk-7A6WTXNK.js → chunk-PM6CVGXJ.js} +1 -0
  15. package/dist/{chunk-XMEVPEMH.js → chunk-QQVDZKSD.js} +2 -2
  16. package/dist/{chunk-TU2XFPAK.mjs → chunk-REYL77RE.mjs} +1 -0
  17. package/dist/{chunk-55W7BNO2.mjs → chunk-RIVVBABB.mjs} +130 -59
  18. package/dist/{chunk-MYE5NMXW.js → chunk-VQ5D35UA.js} +154 -83
  19. package/dist/{chunk-J5Q46OPW.mjs → chunk-XSK5MNUH.mjs} +1 -1
  20. package/dist/{chunk-QKC3APP4.mjs → chunk-Z3HCJ43H.mjs} +1 -1
  21. package/dist/gestureLayer/index.d.mts +2 -2
  22. package/dist/gestureLayer/index.d.ts +2 -2
  23. package/dist/gestureLayer/index.js +10 -10
  24. package/dist/gestureLayer/index.mjs +3 -3
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +48 -48
  28. package/dist/index.mjs +17 -17
  29. package/dist/motion/Image.d.mts +1 -1
  30. package/dist/motion/Image.d.ts +1 -1
  31. package/dist/motion/Image.js +5 -5
  32. package/dist/motion/Image.mjs +4 -4
  33. package/dist/motion/Pressable.d.mts +1 -1
  34. package/dist/motion/Pressable.d.ts +1 -1
  35. package/dist/motion/Pressable.js +5 -5
  36. package/dist/motion/Pressable.mjs +4 -4
  37. package/dist/motion/ScrollView.d.mts +1 -1
  38. package/dist/motion/ScrollView.d.ts +1 -1
  39. package/dist/motion/ScrollView.js +5 -5
  40. package/dist/motion/ScrollView.mjs +4 -4
  41. package/dist/motion/Text.d.mts +1 -1
  42. package/dist/motion/Text.d.ts +1 -1
  43. package/dist/motion/Text.js +5 -5
  44. package/dist/motion/Text.mjs +4 -4
  45. package/dist/motion/View.d.mts +1 -1
  46. package/dist/motion/View.d.ts +1 -1
  47. package/dist/motion/View.js +5 -5
  48. package/dist/motion/View.mjs +4 -4
  49. package/dist/touch/index.d.mts +1 -1
  50. package/dist/touch/index.d.ts +1 -1
  51. package/dist/touch/index.js +3 -3
  52. package/dist/touch/index.mjs +1 -1
  53. package/dist/{types-37pN82yh.d.mts → types-BQgLJeQG.d.mts} +39 -3
  54. package/dist/{types-37pN82yh.d.ts → types-BQgLJeQG.d.ts} +39 -3
  55. package/dist/{useGesture-Cl4uzZIr.d.ts → useGesture-B0_CzOUz.d.ts} +1 -1
  56. package/dist/{useGesture-_IKkS8Dv.d.mts → useGesture-DfaTx-3t.d.mts} +1 -1
  57. package/package.json +1 -1
  58. package/src/motion/createMotionComponent.tsx +145 -61
  59. package/src/transitions/resolveSequence.ts +12 -0
  60. package/src/types.ts +106 -3
  61. package/dist/chunk-5SRD2WCO.js +0 -8
  62. package/dist/chunk-TVFNJ25Z.js +0 -8
  63. package/dist/chunk-VLDIFL3F.js +0 -8
package/CHANGELOG.md CHANGED
@@ -4,6 +4,56 @@ All notable changes to `@rootnative/inertia` are documented here. The format fol
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.0.5] - 2026-07-31
8
+
9
+ **Correctness release for the `animate` type surface.** The 40 layout and text-metric style keys that typechecked but were silently dropped at runtime now either animate or fail to compile. No API removals; the type narrowing is technically breaking for code that passed a never-driven key, but that code was already a no-op.
10
+
11
+ ### Added
12
+
13
+ - **Layout numerics are animatable.** Forty keys join the `animate` surface, all riding the existing generic numeric path — one shared value each, resolved on the JS thread, emitted through the same branch as `opacity`:
14
+
15
+ | Group | Keys |
16
+ | ----------------- | --------------------------------------------------------------------------------------------------------------- |
17
+ | Per-corner radius | `borderTopLeftRadius`, `borderTopRightRadius`, `borderBottomLeftRadius`, `borderBottomRightRadius` |
18
+ | Border width | `borderWidth`, `borderTopWidth`, `borderRightWidth`, `borderBottomWidth`, `borderLeftWidth` |
19
+ | Absolute inset | `top`, `right`, `bottom`, `left` |
20
+ | Padding | `padding`, `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft`, `paddingHorizontal`, `paddingVertical` |
21
+ | Margin | `margin`, `marginTop`, `marginRight`, `marginBottom`, `marginLeft`, `marginHorizontal`, `marginVertical` |
22
+ | Flex sizing | `flex`, `flexGrow`, `flexShrink` |
23
+ | Gap | `gap`, `rowGap`, `columnGap` |
24
+ | Stacking | `zIndex` |
25
+ | Text metrics | `fontSize`, `letterSpacing`, `lineHeight` — `Motion.Text` only, since they live on `TextStyle` |
26
+
27
+ Every one of these previously **typechecked and then did nothing**: `AnimateStyle<C>` mapped over the component's entire inferred style, so `animate={{ paddingTop: 40 }}` compiled cleanly, allocated nothing, and never appeared in the rendered style. The `Motion.Text` case was the sharpest — the docs told consumers to hand-roll `useAnimatedStyle` for `fontSize` while the type-test asserted `fontSize` was accepted, so the two halves of the contract actively disagreed. Sequences, `{ to }` step objects, per-property transitions, `gesture` sub-states, `exit`, variants, and the `layoutId` resting logic all work on the new keys with no special-casing.
28
+
29
+ **These drive real layout, so they reflow every frame.** Prefer `scale` / `translate*` for pure motion — those composite without touching layout. Reach for these when the layout genuinely changes: a drawer sliding via `left`, a card squaring off one corner as it expands, a pane resize via `flex`. The Fabric jitter caveat that has always applied to `width` / `height` on non-`flex: 1` containers applies here too.
30
+
31
+ **Resting values behave as they have since `0.0.3`.** A key declared only in a `gesture` sub-state, an `exit` target, or a non-active variant joins the active set, so the worklet emits it every frame including at rest — and since the animated style merges _after_ `style`, a non-identity resting default would silently stomp the consumer's layout. The existing style-scan handles this: such a key rests at whatever `StyleSheet.flatten(style)` says, falling back to the type default only when the style is silent. All 40 defaults are `0`, which is RN's own unset value for each, so a key that does fall back lands where the element already was. Guarded by four dedicated cases in `animatable-keys.test.tsx` alongside the existing `style-resting.test.tsx`.
32
+
33
+ **Bundle cost: +0.11 kB (+1.3%) per primitive subpath**, 8.80 → 8.91 kB brotlied, +0.08 kB on the root entry. No `size-limit` cap moved. Nearly free because the factory's per-key machinery was already generic: the only structural change was replacing 23 hand-written `useSharedValue` calls in `useAnimatableSharedValues` with a loop over `ALL_KEYS`, which offset almost the entire cost of the 40 new table entries. Hook order stays stable because `ALL_KEYS` is a module-level `as const` whose length is fixed at module evaluation.
34
+
35
+ ### Changed
36
+
37
+ - **`animate` now rejects style keys Inertia doesn't drive, at compile time.** `AnimateStyle<C>` is narrowed to an intersection of the component's style keys and the set the runtime actually animates, so `animate={{ alignItems: 'center' }}` is a type error instead of a silent no-op. This restores the library's headline differentiator — the first row of the sharp-edges table promises that wrong props error rather than going unnoticed — which the previous whole-style mapping had quietly broken for every non-animatable key.
38
+
39
+ **Technically breaking, practically not:** code that passed one of these keys stops compiling, but it was already doing nothing at runtime, so nothing that worked before stops working. Fixing a break means either deleting the key or moving it to the static `style` prop, which is where it belonged.
40
+
41
+ Two categories are rejected on purpose. **Enum-valued keys** (`position`, `overflow`, `alignItems`, `flexDirection`, `display`) have no interpolable midpoint. **`minWidth` / `maxWidth` / `minHeight` / `maxHeight` / `aspectRatio`** are excluded for a subtler reason worth recording: their unset state isn't a number, so there is no value they could rest at when declared only in a `gesture` sub-state or a non-active variant — any numeric default would change the layout the instant the key activated, which is exactly the `0.0.3` resting-value regression. Animate `width` / `height` instead, or drop to the value-layer hooks. Per-primitive gating is unchanged and still enforced: `tintColor` stays Image-only, and the text metrics are rejected on `Motion.View` and `Motion.Image`.
42
+
43
+ `AnimatableStyleKey` (the new type) and `ALL_KEYS` (the runtime array) are necessarily separate declarations — one is a type, the other a value in a module that imports it — so the pairing is pinned by tests on both sides: `__type-tests__/animate-keys.test-d.tsx` (23 compile-time assertions) proves the type accepts and rejects the right keys, and `__tests__/animatable-keys.test.tsx` (17 cases) proves every accepted key reaches the rendered style. A key added to one but not the other fails one of the two.
44
+
45
+ ### Fixed
46
+
47
+ - **Reduced motion is no longer bypassed by a sequence step that declares its own `type`.** `<MotionConfig reducedMotion="always">` (and the `'user'` default under an OS reduce-motion setting) swaps every per-key transition for `{ type: 'no-animation' }`, but `mergeTransition` in `resolveSequence.ts` let a step-declared `type` win outright over the base whenever the two differed — so `animate={{ translateX: [0, { to: 100, type: 'timing', duration: 200 }, 0] }}` still called `withTiming` for a user who had asked the OS for no motion. Both sequence arrays and the single `{ to, ...override }` form were affected, for every step type.
48
+
49
+ A `no-animation` base is now treated as a **ceiling rather than a default**: it short-circuits the merge before the step-type rule runs. That rule is unchanged and still correct for ordinary bases — mixing a spring base's `tension` into a timing override produces garbage, which is why it exists.
50
+
51
+ This contradicted the contract stated in `createMotionComponent.tsx`, which had promised since the gate was written that reduced motion "overrides every per-key transition (and any nested sequence-step transition)". The code was the half that was wrong.
52
+
53
+ **Why it went unnoticed:** `reduced-motion.test.tsx` asserted only on per-key transitions, where the base reaches Reanimated unmodified — sequence steps were the one path that could talk its way past the gate, and nothing covered them. Three cases now do, including a `reducedMotion="never"` positive control so a future regression can't pass by asserting nothing. Dropping a step `delay` alongside the type matches how the rest of the resolver already treats this transition type (`delayOf` and `repeatOf` both return `undefined` for `no-animation`), so a snap is never deferred or repeated anywhere in the library.
54
+
55
+ Surfaced by the `@rootnative/ui` validation consumer, whose `LinearProgress` / `CircularProgress` both use an inline-typed snap-back step inside an infinite keyframe loop. Their local workaround — not mounting the `Motion.View` at all under reduced motion — remains the better render and is unaffected. No bundle-size change (one early-return branch; primitives stay at 8.9 kB against the 10.3 kB cap).
56
+
7
57
  ## [0.0.4] - 2026-07-29
8
58
 
9
59
  **Feature release.** The three deferred items the `0.0.3` audit left on the roadmap land together: `boxShadow` joins the declarative `animate` surface, and `layoutId` shared-element transitions gain window-coordinate measurement and a style carry. No breaking changes; the three adapters are lockstep-bumped with no runtime changes of their own.
@@ -141,7 +191,8 @@ Initial alpha publish. The full initial surface is in place; APIs are still subj
141
191
  - SVG path morphing, gradient interpolation, and shared-element transitions across screens are out of scope until `0.2.x` / `1.x` per the roadmap.
142
192
  - `react-native-gesture-handler` integration (drag, pan, swipe sub-states) lands in `0.2` via the optional `@rootnative/inertia-gestures` adapter.
143
193
 
144
- [unreleased]: https://github.com/rootnative/inertia/compare/core+gestures+gradients+svg@0.0.4...HEAD
194
+ [unreleased]: https://github.com/rootnative/inertia/compare/core+gestures+gradients+svg@0.0.5...HEAD
195
+ [0.0.5]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.5
145
196
  [0.0.4]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.4
146
197
  [0.0.3]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.3
147
198
  [0.0.2]: https://github.com/rootnative/inertia/releases/tag/core+gestures+gradients+svg@0.0.2
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Declarative animation primitives for React Native, built as a thin wrapper around [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/). Inspired by Framer Motion (web) and react-spring (cross-platform).
8
8
 
9
- > **Status:** `0.0.4` — stable. Pre-`1.0.0` minor versions may break — see the root [README](https://github.com/rootnative/inertia#versioning--release).
9
+ > **Status:** `0.0.5` — stable. Pre-`1.0.0` minor versions may break — see the root [README](https://github.com/rootnative/inertia#versioning--release).
10
10
 
11
11
  ## Install
12
12
 
@@ -88,6 +88,10 @@ Plus, on any transition: `delay`, `repeat`. Per-property transitions take preced
88
88
 
89
89
  Numeric: `opacity`, `translateX`, `translateY`, `scale`, `scaleX`, `scaleY`, `rotate`, `rotateX`, `rotateY`, `width`, `height`, `borderRadius`, `shadowOpacity`, `shadowRadius`, `elevation`. Color: `backgroundColor`, `borderColor`, `color`, `shadowColor`, `tintColor` (Image only — `Motion.View` rejects it at compile time). Layout transforms via `transform: [...]`. Color targets are forwarded straight through `withSpring` / `withTiming`; Reanimated's value setter packs the string to RGBA and interpolates on the UI thread.
90
90
 
91
+ Layout numerics (since `0.0.5`): per-corner radii (`borderTopLeftRadius` …), border widths (`borderWidth`, `borderTopWidth` …), absolute insets (`top` / `right` / `bottom` / `left`), padding and margin including the `*Horizontal` / `*Vertical` shorthands, `flex` / `flexGrow` / `flexShrink`, `gap` / `rowGap` / `columnGap`, `zIndex`, and the `Motion.Text`-only metrics `fontSize` / `letterSpacing` / `lineHeight`. These drive real layout, so they reflow each frame — prefer `scale` / `translate*` for pure motion.
92
+
93
+ `animate` is narrowed to the keys Inertia actually drives, so an unsupported style key (`alignItems`, `position`, `minWidth`, …) is a compile error instead of a silent no-op.
94
+
91
95
  Nested object: `shadowOffset: { width, height }` — single-value form only (no sequences, no array keyframes). Structured: `boxShadow` — the cross-platform CSS shadow, as a string (`'0px 4px 8px rgba(0,0,0,0.3)'`) or RN's `BoxShadowValue[]`. Endpoints are padded to a common layer count, so layer counts may differ between `initial` and `animate`; sequences and `gesture` sub-states are not supported on this key.
92
96
 
93
97
  SVG path morphing ships in the [`@rootnative/inertia-svg`](../svg) adapter (`MotionPath`). Shared-element transitions across screens are wired through the `layoutId` prop — pair the same id on a source and target `Motion.*` and Inertia FLIPs between them on mount, carrying `opacity`, `borderRadius`, and the color keys across alongside the rect.
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-55W7BNO2.mjs';
1
+ import { createMotionComponent } from './chunk-RIVVBABB.mjs';
2
2
  import { ScrollView } from 'react-native';
3
3
 
4
4
  var MotionScrollView = createMotionComponent(ScrollView);
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkMYE5NMXW_js = require('./chunk-MYE5NMXW.js');
3
+ var chunkVQ5D35UA_js = require('./chunk-VQ5D35UA.js');
4
4
  var reactNative = require('react-native');
5
5
 
6
- var MotionPressable = chunkMYE5NMXW_js.createMotionComponent(reactNative.Pressable);
6
+ var MotionPressable = chunkVQ5D35UA_js.createMotionComponent(reactNative.Pressable);
7
7
 
8
8
  exports.MotionPressable = MotionPressable;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkWVRCKOPO_js = require('./chunk-WVRCKOPO.js');
4
- var chunk7A6WTXNK_js = require('./chunk-7A6WTXNK.js');
3
+ var chunkOBRGJAST_js = require('./chunk-OBRGJAST.js');
4
+ var chunkPM6CVGXJ_js = require('./chunk-PM6CVGXJ.js');
5
5
  var react = require('react');
6
6
  var reactNativeReanimated = require('react-native-reanimated');
7
7
 
@@ -10,12 +10,12 @@ function useGesture(transition) {
10
10
  const focused = reactNativeReanimated.useSharedValue(0);
11
11
  const focusVisible = reactNativeReanimated.useSharedValue(0);
12
12
  const hovered = reactNativeReanimated.useSharedValue(0);
13
- const shouldReduceMotion = chunkWVRCKOPO_js.useShouldReduceMotion();
14
- const resolved = chunkWVRCKOPO_js.resolveNamedTransitionProp(transition, chunkWVRCKOPO_js.useNamedTransitions());
13
+ const shouldReduceMotion = chunkOBRGJAST_js.useShouldReduceMotion();
14
+ const resolved = chunkOBRGJAST_js.resolveNamedTransitionProp(transition, chunkOBRGJAST_js.useNamedTransitions());
15
15
  const setLayer = react.useCallback(
16
16
  (sv, layer, target) => {
17
17
  const cfg = shouldReduceMotion ? { type: "no-animation" } : layerTransition(layer, resolved) ?? { type: "spring" };
18
- sv.value = chunk7A6WTXNK_js.resolveTransition(cfg, target);
18
+ sv.value = chunkPM6CVGXJ_js.resolveTransition(cfg, target);
19
19
  },
20
20
  // The transition is intentionally read on every call rather than cooked
21
21
  // into the dep array — a fresh literal each render would otherwise
@@ -34,7 +34,7 @@ function useGesture(transition) {
34
34
  onHoverOut: () => setLayer(hovered, "hovered", 0),
35
35
  onFocus: () => {
36
36
  setLayer(focused, "focused", 1);
37
- if (chunkWVRCKOPO_js.isFocusVisible()) setLayer(focusVisible, "focusVisible", 1);
37
+ if (chunkOBRGJAST_js.isFocusVisible()) setLayer(focusVisible, "focusVisible", 1);
38
38
  },
39
39
  onBlur: () => {
40
40
  setLayer(focused, "focused", 0);
@@ -47,7 +47,7 @@ function useGesture(transition) {
47
47
  }
48
48
  function layerTransition(layer, transition) {
49
49
  if (!transition) return void 0;
50
- if (chunk7A6WTXNK_js.isTopLevelTransition(transition)) return transition;
50
+ if (chunkPM6CVGXJ_js.isTopLevelTransition(transition)) return transition;
51
51
  return transition[layer];
52
52
  }
53
53
 
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var chunkVQ5D35UA_js = require('./chunk-VQ5D35UA.js');
4
+ var reactNative = require('react-native');
5
+
6
+ var MotionText = chunkVQ5D35UA_js.createMotionComponent(reactNative.Text);
7
+
8
+ exports.MotionText = MotionText;
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-55W7BNO2.mjs';
1
+ import { createMotionComponent } from './chunk-RIVVBABB.mjs';
2
2
  import { Text } from 'react-native';
3
3
 
4
4
  var MotionText = createMotionComponent(Text);
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var chunkVQ5D35UA_js = require('./chunk-VQ5D35UA.js');
4
+ var reactNative = require('react-native');
5
+
6
+ var MotionImage = chunkVQ5D35UA_js.createMotionComponent(reactNative.Image);
7
+
8
+ exports.MotionImage = MotionImage;
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-55W7BNO2.mjs';
1
+ import { createMotionComponent } from './chunk-RIVVBABB.mjs';
2
2
  import { View } from 'react-native';
3
3
 
4
4
  var MotionView = createMotionComponent(View);
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var chunkVQ5D35UA_js = require('./chunk-VQ5D35UA.js');
4
+ var reactNative = require('react-native');
5
+
6
+ var MotionView = chunkVQ5D35UA_js.createMotionComponent(reactNative.View);
7
+
8
+ exports.MotionView = MotionView;
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-55W7BNO2.mjs';
1
+ import { createMotionComponent } from './chunk-RIVVBABB.mjs';
2
2
  import { Pressable } from 'react-native';
3
3
 
4
4
  var MotionPressable = createMotionComponent(Pressable);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk7A6WTXNK_js = require('./chunk-7A6WTXNK.js');
3
+ var chunkPM6CVGXJ_js = require('./chunk-PM6CVGXJ.js');
4
4
  var react = require('react');
5
5
  var reactNativeReanimated = require('react-native-reanimated');
6
6
  var jsxRuntime = require('react/jsx-runtime');
@@ -32,7 +32,7 @@ function MotionConfig({
32
32
  children
33
33
  }) {
34
34
  const parent = useMotionConfig();
35
- const transitionsSig = chunk7A6WTXNK_js.stableSig(transitions);
35
+ const transitionsSig = chunkPM6CVGXJ_js.stableSig(transitions);
36
36
  const value = react.useMemo(
37
37
  () => ({
38
38
  reducedMotion: reducedMotion ?? parent.reducedMotion,
@@ -66,7 +66,7 @@ function resolveNamedTransitionProp(transition, registry) {
66
66
  if (typeof transition === "string") {
67
67
  return lookupNamedTransition(transition, registry);
68
68
  }
69
- if (chunk7A6WTXNK_js.isTopLevelTransition(transition)) return transition;
69
+ if (chunkPM6CVGXJ_js.isTopLevelTransition(transition)) return transition;
70
70
  const map = transition;
71
71
  let out = null;
72
72
  for (const key in map) {
@@ -1,5 +1,5 @@
1
- import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions, isFocusVisible } from './chunk-QKC3APP4.mjs';
2
- import { resolveTransition, isTopLevelTransition } from './chunk-TU2XFPAK.mjs';
1
+ import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions, isFocusVisible } from './chunk-Z3HCJ43H.mjs';
2
+ import { resolveTransition, isTopLevelTransition } from './chunk-REYL77RE.mjs';
3
3
  import { useCallback, useMemo } from 'react';
4
4
  import { useSharedValue } from 'react-native-reanimated';
5
5
 
@@ -159,6 +159,7 @@ function resolveStep(step, base, cb) {
159
159
  return resolveTransition(base, step, cb);
160
160
  }
161
161
  function mergeTransition(base, override) {
162
+ if (base?.type === "no-animation") return base;
162
163
  if (override.type && base && override.type !== base.type) {
163
164
  return override;
164
165
  }
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkMYE5NMXW_js = require('./chunk-MYE5NMXW.js');
3
+ var chunkVQ5D35UA_js = require('./chunk-VQ5D35UA.js');
4
4
  var reactNative = require('react-native');
5
5
 
6
- var MotionScrollView = chunkMYE5NMXW_js.createMotionComponent(reactNative.ScrollView);
6
+ var MotionScrollView = chunkVQ5D35UA_js.createMotionComponent(reactNative.ScrollView);
7
7
 
8
8
  exports.MotionScrollView = MotionScrollView;
@@ -157,6 +157,7 @@ function resolveStep(step, base, cb) {
157
157
  return resolveTransition(base, step, cb);
158
158
  }
159
159
  function mergeTransition(base, override) {
160
+ if (base?.type === "no-animation") return base;
160
161
  if (override.type && base && override.type !== base.type) {
161
162
  return override;
162
163
  }
@@ -1,5 +1,5 @@
1
- import { useNamedTransitions, resolveNamedTransitionProp, lookupNamedTransition, useShouldReduceMotion, isFocusVisible } from './chunk-QKC3APP4.mjs';
2
- import { warnOnce, stableSig, resolveAnimatableValue, isTopLevelTransition, resolveTransition, ensureWorkletEasing, springToReanimated, DEFAULT_SPRING } from './chunk-TU2XFPAK.mjs';
1
+ import { useNamedTransitions, resolveNamedTransitionProp, lookupNamedTransition, useShouldReduceMotion, isFocusVisible } from './chunk-Z3HCJ43H.mjs';
2
+ import { warnOnce, stableSig, resolveAnimatableValue, isTopLevelTransition, resolveTransition, ensureWorkletEasing, springToReanimated, DEFAULT_SPRING } from './chunk-REYL77RE.mjs';
3
3
  import { createContext, useContext, useMemo, Children, isValidElement, useState, useRef, useCallback, forwardRef, useEffect } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
  import Animated, { useSharedValue, cancelAnimation, useAnimatedStyle, interpolateColor, reanimatedVersion, runOnJS, LinearTransition, withSequence, withTiming, withSpring } from 'react-native-reanimated';
@@ -594,7 +594,79 @@ var NUMERIC_TOP_LEVEL_KEYS = [
594
594
  "borderRadius",
595
595
  "shadowOpacity",
596
596
  "shadowRadius",
597
- "elevation"
597
+ "elevation",
598
+ // ─── Added in 0.0.5 ──────────────────────────────────────────────────────
599
+ //
600
+ // Every key below rides the generic numeric path: one shared value, resolved
601
+ // on the JS thread, emitted by the worklet through the same `out[key] = v`
602
+ // branch as `opacity`. None needs a new interpolation mode, so the cost is
603
+ // the shared value plus a `DEFAULT_RESTING` entry.
604
+ //
605
+ // The load-bearing constraint is the resting default, not the plumbing. A
606
+ // key declared only in `gesture` / `exit` / a non-active variant rests at
607
+ // `DEFAULT_RESTING` unless the static `style` names it, and the animated
608
+ // style merges *after* `style` — so a non-identity default silently stomps
609
+ // the layout. That is the `0.0.3` P0 class, and it is why the sizing and
610
+ // spacing keys below default to `0` only in the sense RN itself does (an
611
+ // unset `padding` *is* 0); `minWidth`/`maxWidth`/`aspectRatio` are
612
+ // deliberately excluded — their "unset" is not a number, so no default can
613
+ // stand in for it without changing layout on activation.
614
+ //
615
+ // Per-corner radii. Animating one corner is common (a card expanding into a
616
+ // sheet keeps its top corners and squares off the bottom); `borderRadius`
617
+ // alone can't express it.
618
+ "borderTopLeftRadius",
619
+ "borderTopRightRadius",
620
+ "borderBottomLeftRadius",
621
+ "borderBottomRightRadius",
622
+ // Border widths. `borderWidth` is the common case; the per-edge keys matter
623
+ // for underline-style focus affordances (`borderBottomWidth` on a field).
624
+ "borderWidth",
625
+ "borderTopWidth",
626
+ "borderRightWidth",
627
+ "borderBottomWidth",
628
+ "borderLeftWidth",
629
+ // Absolute-position insets. Bread-and-butter for drawers, tooltips, and
630
+ // anything pinned to an edge that slides in.
631
+ "top",
632
+ "right",
633
+ "bottom",
634
+ "left",
635
+ // Spacing. Padding animates the box from the inside (a button growing its
636
+ // hit area on press); margin shifts it within its parent's flow.
637
+ "padding",
638
+ "paddingTop",
639
+ "paddingRight",
640
+ "paddingBottom",
641
+ "paddingLeft",
642
+ "paddingHorizontal",
643
+ "paddingVertical",
644
+ "margin",
645
+ "marginTop",
646
+ "marginRight",
647
+ "marginBottom",
648
+ "marginLeft",
649
+ "marginHorizontal",
650
+ "marginVertical",
651
+ // Flex sizing. `flex` / `flexGrow` interpolate the split between siblings —
652
+ // the idiomatic RN way to animate a pane resize without measuring.
653
+ "flex",
654
+ "flexGrow",
655
+ "flexShrink",
656
+ // Text metrics. `TextStyle`-only at the type level (`AnimateStyle<C>` gates
657
+ // them per primitive), but the runtime table is shared across primitives —
658
+ // an unused slot is one ref, same as `tintColor` has always been.
659
+ "fontSize",
660
+ "letterSpacing",
661
+ "lineHeight",
662
+ // Stacking. Integer-valued in practice, and interpolating it mid-flight is
663
+ // rarely what you want, but a `no-animation` transition on `zIndex` is the
664
+ // clean way to reorder at a step boundary in a sequence.
665
+ "zIndex",
666
+ // Gap. Row/column gaps animate a list's density without touching children.
667
+ "gap",
668
+ "rowGap",
669
+ "columnGap"
598
670
  ];
599
671
  var COLOR_KEYS = [
600
672
  "backgroundColor",
@@ -650,6 +722,54 @@ var DEFAULT_RESTING = {
650
722
  shadowOpacity: 0,
651
723
  shadowRadius: 0,
652
724
  elevation: 0,
725
+ // 0.0.5 keys. Every one of these is 0 because that is RN's own unset value
726
+ // for it — an element with no `paddingTop` has 0 padding, no `borderWidth`
727
+ // has none, no `top` is unpinned at 0 within its positioning context. So a
728
+ // key that reaches its resting default lands where the element already was.
729
+ //
730
+ // The exception worth naming: `flex` / `flexGrow` / `flexShrink` do NOT have
731
+ // 0 as a universal identity (`flexShrink` defaults to 1 on the web, and RN's
732
+ // own default differs by axis). They are still 0 here, because the style-scan
733
+ // in the resting pass reads the real value off the static `style` whenever it
734
+ // is declared — and a consumer animating flex without declaring it is asking
735
+ // for the from-0 growth, which is the readable interpretation.
736
+ borderTopLeftRadius: 0,
737
+ borderTopRightRadius: 0,
738
+ borderBottomLeftRadius: 0,
739
+ borderBottomRightRadius: 0,
740
+ borderWidth: 0,
741
+ borderTopWidth: 0,
742
+ borderRightWidth: 0,
743
+ borderBottomWidth: 0,
744
+ borderLeftWidth: 0,
745
+ top: 0,
746
+ right: 0,
747
+ bottom: 0,
748
+ left: 0,
749
+ padding: 0,
750
+ paddingTop: 0,
751
+ paddingRight: 0,
752
+ paddingBottom: 0,
753
+ paddingLeft: 0,
754
+ paddingHorizontal: 0,
755
+ paddingVertical: 0,
756
+ margin: 0,
757
+ marginTop: 0,
758
+ marginRight: 0,
759
+ marginBottom: 0,
760
+ marginLeft: 0,
761
+ marginHorizontal: 0,
762
+ marginVertical: 0,
763
+ flex: 0,
764
+ flexGrow: 0,
765
+ flexShrink: 0,
766
+ fontSize: 0,
767
+ letterSpacing: 0,
768
+ lineHeight: 0,
769
+ zIndex: 0,
770
+ gap: 0,
771
+ rowGap: 0,
772
+ columnGap: 0,
653
773
  // 'transparent' is the only safe universal default for colors: it works as
654
774
  // an initial seed for any color animation (no jarring opaque flash on mount
655
775
  // when `initial` is omitted) and rgba(0,0,0,0) interpolates cleanly into
@@ -1202,64 +1322,15 @@ function hasMotionProps(props) {
1202
1322
  return false;
1203
1323
  }
1204
1324
  function useAnimatableSharedValues(init) {
1205
- const translateX = useSharedValue(init("translateX"));
1206
- const translateY = useSharedValue(init("translateY"));
1207
- const scale = useSharedValue(init("scale"));
1208
- const scaleX = useSharedValue(init("scaleX"));
1209
- const scaleY = useSharedValue(init("scaleY"));
1210
- const rotate = useSharedValue(init("rotate"));
1211
- const rotateX = useSharedValue(init("rotateX"));
1212
- const rotateY = useSharedValue(init("rotateY"));
1213
- const opacity = useSharedValue(init("opacity"));
1214
- const width = useSharedValue(init("width"));
1215
- const height = useSharedValue(init("height"));
1216
- const borderRadius = useSharedValue(init("borderRadius"));
1217
- const shadowOpacity = useSharedValue(
1218
- init("shadowOpacity")
1219
- );
1220
- const shadowRadius = useSharedValue(init("shadowRadius"));
1221
- const elevation = useSharedValue(init("elevation"));
1222
- const backgroundColor = useSharedValue(
1223
- init("backgroundColor")
1224
- );
1225
- const borderColor = useSharedValue(init("borderColor"));
1226
- const color = useSharedValue(init("color"));
1227
- const tintColor = useSharedValue(init("tintColor"));
1228
- const shadowColor = useSharedValue(init("shadowColor"));
1229
- const shadowOffsetWidth = useSharedValue(
1230
- init("shadowOffsetWidth")
1231
- );
1232
- const shadowOffsetHeight = useSharedValue(
1233
- init("shadowOffsetHeight")
1234
- );
1235
- const boxShadow = useSharedValue(init("boxShadow"));
1325
+ const entries = [];
1326
+ for (const key of ALL_KEYS) {
1327
+ entries.push([key, useSharedValue(init(key))]);
1328
+ }
1236
1329
  const ref = useRef(null);
1237
1330
  if (ref.current === null) {
1238
- ref.current = {
1239
- translateX,
1240
- translateY,
1241
- scale,
1242
- scaleX,
1243
- scaleY,
1244
- rotate,
1245
- rotateX,
1246
- rotateY,
1247
- opacity,
1248
- width,
1249
- height,
1250
- borderRadius,
1251
- shadowOpacity,
1252
- shadowRadius,
1253
- elevation,
1254
- backgroundColor,
1255
- borderColor,
1256
- color,
1257
- tintColor,
1258
- shadowColor,
1259
- shadowOffsetWidth,
1260
- shadowOffsetHeight,
1261
- boxShadow
1262
- };
1331
+ const map2 = {};
1332
+ for (const [key, sv] of entries) map2[key] = sv;
1333
+ ref.current = map2;
1263
1334
  }
1264
1335
  const map = ref.current;
1265
1336
  useEffect(