@rootnative/inertia 0.0.0-alpha.6 → 0.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { SharedValue, AnimatedStyle } from 'react-native-reanimated';
2
- import { U as UseGestureHandlers } from '../useGesture-C0GBS7d2.mjs';
3
- import { T as TransitionInput, n as GestureLayerTransitions } from '../types-BzEgiUdJ.mjs';
2
+ import { U as UseGestureHandlers } from '../useGesture-RFY6kTL3.mjs';
3
+ import { a as TransitionInput, G as GestureLayerTransitions } from '../types-G1dBU2IQ.mjs';
4
4
  import 'react';
5
5
  import 'react-native';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { SharedValue, AnimatedStyle } from 'react-native-reanimated';
2
- import { U as UseGestureHandlers } from '../useGesture-BRLgiNOC.js';
3
- import { T as TransitionInput, n as GestureLayerTransitions } from '../types-BzEgiUdJ.js';
2
+ import { U as UseGestureHandlers } from '../useGesture-D1e4ixJo.js';
3
+ import { a as TransitionInput, G as GestureLayerTransitions } from '../types-G1dBU2IQ.js';
4
4
  import 'react';
5
5
  import 'react-native';
6
6
 
package/dist/index.d.mts CHANGED
@@ -2,10 +2,11 @@ import * as react from 'react';
2
2
  import { ComponentType, ReactNode } from 'react';
3
3
  import * as react_native from 'react-native';
4
4
  import { NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
5
- import { M as MotionComponent, N as NamedTransitions, T as TransitionInput, a as TransitionConfig, A as AnimatableValue, E as EasingInput, S as SpringTransition, b as TransitionName, V as VariantController } from './types-BzEgiUdJ.mjs';
6
- export { c as AnimateStyle, d as AnimationCallbackInfo, D as DecayTransition, e as EasingFunction, f as EasingFunctionFactory, G as GestureSubStates, g as MotionProps, h as NoAnimationTransition, P as PerPropertyTransition, R as RegisteredTransitions, i as RepeatConfig, j as SequenceStep, k as TimingTransition, l as Transition, m as VariantsMap } from './types-BzEgiUdJ.mjs';
5
+ import { M as MotionComponent, N as NamedTransitions, a as TransitionInput, T as TransitionConfig, A as AnimatableValue, E as EasingInput, S as SpringTransition, b as TransitionName, V as VariantController } from './types-G1dBU2IQ.mjs';
6
+ export { c as AnimateStyle, d as AnimationCallbackInfo, D as DecayTransition, e as EasingFunction, f as EasingFunctionFactory, g as GestureSubStates, h as MotionProps, i as NoAnimationTransition, P as PerPropertyTransition, R as RegisteredTransitions, j as RepeatConfig, k as SequenceStep, l as TimingTransition, m as Transition, n as VariantsMap } from './types-G1dBU2IQ.mjs';
7
7
  import { SharedValue, useAnimatedStyle } from 'react-native-reanimated';
8
- export { U as UseGestureHandlers, a as UseGestureResult, u as useGesture } from './useGesture-C0GBS7d2.mjs';
8
+ export { SharedValue } from 'react-native-reanimated';
9
+ export { U as UseGestureHandlers, a as UseGestureResult, u as useGesture } from './useGesture-RFY6kTL3.mjs';
9
10
  export { MotionImage } from './motion/Image.mjs';
10
11
  export { MotionPressable } from './motion/Pressable.mjs';
11
12
  export { MotionScrollView } from './motion/ScrollView.mjs';
package/dist/index.d.ts CHANGED
@@ -2,10 +2,11 @@ import * as react from 'react';
2
2
  import { ComponentType, ReactNode } from 'react';
3
3
  import * as react_native from 'react-native';
4
4
  import { NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
5
- import { M as MotionComponent, N as NamedTransitions, T as TransitionInput, a as TransitionConfig, A as AnimatableValue, E as EasingInput, S as SpringTransition, b as TransitionName, V as VariantController } from './types-BzEgiUdJ.js';
6
- export { c as AnimateStyle, d as AnimationCallbackInfo, D as DecayTransition, e as EasingFunction, f as EasingFunctionFactory, G as GestureSubStates, g as MotionProps, h as NoAnimationTransition, P as PerPropertyTransition, R as RegisteredTransitions, i as RepeatConfig, j as SequenceStep, k as TimingTransition, l as Transition, m as VariantsMap } from './types-BzEgiUdJ.js';
5
+ import { M as MotionComponent, N as NamedTransitions, a as TransitionInput, T as TransitionConfig, A as AnimatableValue, E as EasingInput, S as SpringTransition, b as TransitionName, V as VariantController } from './types-G1dBU2IQ.js';
6
+ export { c as AnimateStyle, d as AnimationCallbackInfo, D as DecayTransition, e as EasingFunction, f as EasingFunctionFactory, g as GestureSubStates, h as MotionProps, i as NoAnimationTransition, P as PerPropertyTransition, R as RegisteredTransitions, j as RepeatConfig, k as SequenceStep, l as TimingTransition, m as Transition, n as VariantsMap } from './types-G1dBU2IQ.js';
7
7
  import { SharedValue, useAnimatedStyle } from 'react-native-reanimated';
8
- export { U as UseGestureHandlers, a as UseGestureResult, u as useGesture } from './useGesture-BRLgiNOC.js';
8
+ export { SharedValue } from 'react-native-reanimated';
9
+ export { U as UseGestureHandlers, a as UseGestureResult, u as useGesture } from './useGesture-D1e4ixJo.js';
9
10
  export { MotionImage } from './motion/Image.js';
10
11
  export { MotionPressable } from './motion/Pressable.js';
11
12
  export { MotionScrollView } from './motion/ScrollView.js';
@@ -1,5 +1,5 @@
1
1
  import { Image } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.mjs';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Image } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.js';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import * as react_native from 'react-native';
3
- import { M as MotionComponent } from '../types-BzEgiUdJ.mjs';
3
+ import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
4
4
 
5
5
  /**
6
6
  * Animatable `Pressable`. The `gesture` prop's `pressed` sub-state hooks into
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import * as react_native from 'react-native';
3
- import { M as MotionComponent } from '../types-BzEgiUdJ.js';
3
+ import { M as MotionComponent } from '../types-G1dBU2IQ.js';
4
4
 
5
5
  /**
6
6
  * Animatable `Pressable`. The `gesture` prop's `pressed` sub-state hooks into
@@ -1,5 +1,5 @@
1
1
  import { ScrollView } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.mjs';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { ScrollView } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.js';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Text } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.mjs';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Text } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.js';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { View } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.mjs';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { View } from 'react-native';
2
- import { M as MotionComponent } from '../types-BzEgiUdJ.js';
2
+ import { M as MotionComponent } from '../types-G1dBU2IQ.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -0,0 +1 @@
1
+ export { default as Animated, AnimatedProps, AnimatedStyle, DerivedValue, Extrapolation, SharedValue, cancelAnimation, createAnimatedComponent, interpolate, interpolateColor, useAnimatedProps, useAnimatedStyle, useDerivedValue } from 'react-native-reanimated';
@@ -0,0 +1 @@
1
+ export { default as Animated, AnimatedProps, AnimatedStyle, DerivedValue, Extrapolation, SharedValue, cancelAnimation, createAnimatedComponent, interpolate, interpolateColor, useAnimatedProps, useAnimatedStyle, useDerivedValue } from 'react-native-reanimated';
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var reactNativeReanimated = require('react-native-reanimated');
4
+
5
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
+
7
+ var reactNativeReanimated__default = /*#__PURE__*/_interopDefault(reactNativeReanimated);
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "Animated", {
12
+ enumerable: true,
13
+ get: function () { return reactNativeReanimated__default.default; }
14
+ });
15
+ Object.defineProperty(exports, "Extrapolation", {
16
+ enumerable: true,
17
+ get: function () { return reactNativeReanimated.Extrapolation; }
18
+ });
19
+ Object.defineProperty(exports, "cancelAnimation", {
20
+ enumerable: true,
21
+ get: function () { return reactNativeReanimated.cancelAnimation; }
22
+ });
23
+ Object.defineProperty(exports, "createAnimatedComponent", {
24
+ enumerable: true,
25
+ get: function () { return reactNativeReanimated.createAnimatedComponent; }
26
+ });
27
+ Object.defineProperty(exports, "interpolate", {
28
+ enumerable: true,
29
+ get: function () { return reactNativeReanimated.interpolate; }
30
+ });
31
+ Object.defineProperty(exports, "interpolateColor", {
32
+ enumerable: true,
33
+ get: function () { return reactNativeReanimated.interpolateColor; }
34
+ });
35
+ Object.defineProperty(exports, "useAnimatedProps", {
36
+ enumerable: true,
37
+ get: function () { return reactNativeReanimated.useAnimatedProps; }
38
+ });
39
+ Object.defineProperty(exports, "useAnimatedStyle", {
40
+ enumerable: true,
41
+ get: function () { return reactNativeReanimated.useAnimatedStyle; }
42
+ });
43
+ Object.defineProperty(exports, "useDerivedValue", {
44
+ enumerable: true,
45
+ get: function () { return reactNativeReanimated.useDerivedValue; }
46
+ });
@@ -0,0 +1 @@
1
+ export { default as Animated, Extrapolation, cancelAnimation, createAnimatedComponent, interpolate, interpolateColor, useAnimatedProps, useAnimatedStyle, useDerivedValue } from 'react-native-reanimated';
@@ -1,6 +1,6 @@
1
1
  import { PanResponderInstance } from 'react-native';
2
2
  import { useAnimatedStyle, SharedValue } from 'react-native-reanimated';
3
- import { a as TransitionConfig } from '../types-BzEgiUdJ.mjs';
3
+ import { T as TransitionConfig } from '../types-G1dBU2IQ.mjs';
4
4
  import 'react';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { PanResponderInstance } from 'react-native';
2
2
  import { useAnimatedStyle, SharedValue } from 'react-native-reanimated';
3
- import { a as TransitionConfig } from '../types-BzEgiUdJ.js';
3
+ import { T as TransitionConfig } from '../types-G1dBU2IQ.js';
4
4
  import 'react';
5
5
 
6
6
  /**
@@ -385,4 +385,4 @@ interface MotionComponent<C extends ComponentType<any>> {
385
385
  displayName?: string;
386
386
  }
387
387
 
388
- export type { AnimatableValue as A, DecayTransition as D, EasingInput as E, GestureSubStates as G, MotionComponent as M, NamedTransitions as N, PerPropertyTransition as P, RegisteredTransitions as R, SpringTransition as S, TransitionInput as T, VariantController as V, TransitionConfig as a, TransitionName as b, AnimateStyle as c, AnimationCallbackInfo as d, EasingFunction as e, EasingFunctionFactory as f, MotionProps as g, NoAnimationTransition as h, RepeatConfig as i, SequenceStep as j, TimingTransition as k, Transition as l, VariantsMap as m, GestureLayerTransitions as n };
388
+ export type { AnimatableValue as A, DecayTransition as D, EasingInput as E, GestureLayerTransitions as G, MotionComponent as M, NamedTransitions as N, PerPropertyTransition as P, RegisteredTransitions as R, SpringTransition as S, TransitionConfig as T, VariantController as V, TransitionInput as a, TransitionName as b, AnimateStyle as c, AnimationCallbackInfo as d, EasingFunction as e, EasingFunctionFactory as f, GestureSubStates as g, MotionProps as h, NoAnimationTransition as i, RepeatConfig as j, SequenceStep as k, TimingTransition as l, Transition as m, VariantsMap as n };
@@ -385,4 +385,4 @@ interface MotionComponent<C extends ComponentType<any>> {
385
385
  displayName?: string;
386
386
  }
387
387
 
388
- export type { AnimatableValue as A, DecayTransition as D, EasingInput as E, GestureSubStates as G, MotionComponent as M, NamedTransitions as N, PerPropertyTransition as P, RegisteredTransitions as R, SpringTransition as S, TransitionInput as T, VariantController as V, TransitionConfig as a, TransitionName as b, AnimateStyle as c, AnimationCallbackInfo as d, EasingFunction as e, EasingFunctionFactory as f, MotionProps as g, NoAnimationTransition as h, RepeatConfig as i, SequenceStep as j, TimingTransition as k, Transition as l, VariantsMap as m, GestureLayerTransitions as n };
388
+ export type { AnimatableValue as A, DecayTransition as D, EasingInput as E, GestureLayerTransitions as G, MotionComponent as M, NamedTransitions as N, PerPropertyTransition as P, RegisteredTransitions as R, SpringTransition as S, TransitionConfig as T, VariantController as V, TransitionInput as a, TransitionName as b, AnimateStyle as c, AnimationCallbackInfo as d, EasingFunction as e, EasingFunctionFactory as f, GestureSubStates as g, MotionProps as h, NoAnimationTransition as i, RepeatConfig as j, SequenceStep as k, TimingTransition as l, Transition as m, VariantsMap as n };
@@ -1,5 +1,5 @@
1
1
  import { SharedValue } from 'react-native-reanimated';
2
- import { T as TransitionInput, n as GestureLayerTransitions } from './types-BzEgiUdJ.js';
2
+ import { a as TransitionInput, G as GestureLayerTransitions } from './types-G1dBU2IQ.js';
3
3
 
4
4
  /**
5
5
  * Handler bag returned by `useGesture`. Spread on a `Pressable` to drive the
@@ -1,5 +1,5 @@
1
1
  import { SharedValue } from 'react-native-reanimated';
2
- import { T as TransitionInput, n as GestureLayerTransitions } from './types-BzEgiUdJ.mjs';
2
+ import { a as TransitionInput, G as GestureLayerTransitions } from './types-G1dBU2IQ.mjs';
3
3
 
4
4
  /**
5
5
  * Handler bag returned by `useGesture`. Spread on a `Pressable` to drive the
package/llms.txt CHANGED
@@ -30,6 +30,8 @@ import {
30
30
  } from '@rootnative/inertia'
31
31
  // Opt-in MD3 / iOS state-layer overlay helper:
32
32
  import { useGestureLayer } from '@rootnative/inertia/gesture-layer'
33
+ // Render-layer Reanimated interop for custom animated components:
34
+ import { Animated, useAnimatedStyle } from '@rootnative/inertia/reanimated'
33
35
  // or for tree-shaking the primitives:
34
36
  import { MotionView } from '@rootnative/inertia/view'
35
37
  import { MotionText } from '@rootnative/inertia/text'
@@ -60,6 +62,8 @@ import { MotionScrollView } from '@rootnative/inertia/scroll-view'
60
62
  - `resolveAnimatableValue(value, base, factory?)` — one level up: resolves a full per-property `animate` value (plain target, `{ to, ...override }` step, or keyframe array → `withSequence` with sequence-level `repeat`) into one animation. Gives custom components the complete `animate` grammar.
61
63
  - `cubicBezier(x1, y1, x2, y2)` / `cubicBezier(css)` — builds a `timing.easing` value from cubic-bezier control points: four numbers, a W3C CSS `cubic-bezier(0.2, 0, 0, 1)` string (design-token form), or a CSS keyword (`'linear'` | `'ease'` | `'ease-in'` | `'ease-out'` | `'ease-in-out'`). Makes CSS-format easing tokens directly consumable — pair with named transitions to feed a theme's motion tokens into the registry. Invalid input throws (`x1`/`x2` must be within [0, 1]; `step-*` and `linear(...)` unsupported).
62
64
  - `ensureWorkletEasing(easing)` — normalizes any accepted easing input (plain function, worklet, or Reanimated 4 `EasingFunctionFactory`) into a worklet `withTiming` can consume. Only needed for manual `withTiming` calls — the resolvers and primitives apply it automatically.
65
+ - `SharedValue<T>` (type) — re-exported from the root entry so props/refs that carry a value-layer hook result can be typed without importing from `react-native-reanimated`.
66
+ - `@rootnative/inertia/reanimated` — render-layer interop subpath: pure re-exports of `Animated`, `createAnimatedComponent`, `useAnimatedStyle`, `useAnimatedProps`, `useDerivedValue`, `interpolate`, `interpolateColor`, `Extrapolation`, `cancelAnimation` (plus `SharedValue` / `DerivedValue` / `AnimatedStyle` / `AnimatedProps` types) under their original Reanimated names, for components that own their own `useAnimatedStyle` worklet over Inertia-driven shared values. Names must stay original — the Reanimated Babel plugin auto-workletizes callbacks by callee name. The `with*` animation factories are deliberately not re-exported; start animations with `useAnimation` / `resolveTransition` / `buildReleaseAnimation`.
63
67
 
64
68
  ## Motion props
65
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rootnative/inertia",
3
- "version": "0.0.0-alpha.6",
3
+ "version": "0.0.0-alpha.7",
4
4
  "description": "Declarative animation primitives for React Native, built on react-native-reanimated.",
5
5
  "license": "MIT",
6
6
  "author": "RootNative",
@@ -93,6 +93,13 @@
93
93
  "import": "./dist/gestureLayer/index.mjs",
94
94
  "require": "./dist/gestureLayer/index.js"
95
95
  },
96
+ "./reanimated": {
97
+ "types": "./dist/reanimated/index.d.ts",
98
+ "react-native": "./src/reanimated/index.ts",
99
+ "source": "./src/reanimated/index.ts",
100
+ "import": "./dist/reanimated/index.mjs",
101
+ "require": "./dist/reanimated/index.js"
102
+ },
96
103
  "./jest-preset": "./jest-preset.js",
97
104
  "./jest-setup": "./jest-setup.js",
98
105
  "./package.json": "./package.json"
package/src/index.ts CHANGED
@@ -51,6 +51,11 @@ export {
51
51
  useTransform,
52
52
  useVariants,
53
53
  } from './values'
54
+ // The value-layer hooks above all return Reanimated `SharedValue`s — export
55
+ // the type so consumers can annotate props/refs that carry one (e.g. a
56
+ // scroll-offset prop) without importing from `react-native-reanimated`.
57
+ // Runtime render-layer interop lives in `@rootnative/inertia/reanimated`.
58
+ export type { SharedValue } from 'react-native-reanimated'
54
59
  export type {
55
60
  BoxShadowLayer,
56
61
  ColorStyleKey,
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `@rootnative/inertia/reanimated` — the render-layer interop surface for
3
+ * building custom animated components on top of Inertia's value layer
4
+ * (`useMotionValue` / `useSpring` / `useGesture` / `useScroll` / …).
5
+ *
6
+ * Inertia's contract is that consumers should not need to import from
7
+ * `react-native-reanimated` directly. Most of the time the declarative
8
+ * `Motion.*` primitives cover that; when they don't — a component that owns
9
+ * its own `useAnimatedStyle` worklet over Inertia-driven shared values —
10
+ * this subpath provides the remaining rendering primitives so the consumer's
11
+ * animation dependency stays `@rootnative/inertia` alone.
12
+ *
13
+ * Scope is deliberately render-layer only: animated host components, the
14
+ * animated style/props hooks, worklet-safe interpolators, and cancellation.
15
+ * Starting animations stays in Inertia's transition vocabulary —
16
+ * `useAnimation` / `useSpring` declaratively, `resolveTransition` /
17
+ * `buildReleaseAnimation` imperatively — so the `with*` animation factories
18
+ * are intentionally not re-exported here.
19
+ *
20
+ * Everything is re-exported under its original Reanimated name. That is a
21
+ * hard constraint, not a style choice: the Reanimated Babel plugin
22
+ * auto-workletizes the callbacks passed to `useAnimatedStyle` /
23
+ * `useAnimatedProps` / `useDerivedValue` by callee *name*, so a renamed
24
+ * wrapper would silently stop workletizing consumer callbacks. Re-exports
25
+ * keep the name and the behavior from any import path.
26
+ */
27
+ export {
28
+ default as Animated,
29
+ Extrapolation,
30
+ cancelAnimation,
31
+ createAnimatedComponent,
32
+ interpolate,
33
+ interpolateColor,
34
+ useAnimatedProps,
35
+ useAnimatedStyle,
36
+ useDerivedValue,
37
+ } from 'react-native-reanimated'
38
+ export type {
39
+ AnimatedProps,
40
+ AnimatedStyle,
41
+ DerivedValue,
42
+ SharedValue,
43
+ } from 'react-native-reanimated'