@rootnative/inertia 0.0.0-alpha.3 → 0.0.0-alpha.4

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 (35) hide show
  1. package/dist/{chunk-S4AEU72O.js → chunk-5I3G43XA.js} +2 -2
  2. package/dist/{chunk-JWHKMNYA.js → chunk-6EP3S2PN.js} +1 -0
  3. package/dist/{chunk-KVSJWO5X.js → chunk-6UQ4KA6V.js} +6 -6
  4. package/dist/{chunk-UXK4YCT6.mjs → chunk-I76OC6RX.mjs} +1 -1
  5. package/dist/{chunk-FSPQVLBF.mjs → chunk-IJNVUM5U.mjs} +1 -1
  6. package/dist/{chunk-UM3WVSKQ.mjs → chunk-K4KR5BIS.mjs} +1 -1
  7. package/dist/{chunk-GJD4VVAS.mjs → chunk-L2EVRKSC.mjs} +1 -0
  8. package/dist/chunk-NDKVHL3N.js +8 -0
  9. package/dist/{chunk-E4MDU4YV.mjs → chunk-OBE7KTMK.mjs} +1 -1
  10. package/dist/{chunk-5RCMIJGZ.js → chunk-OM5FXU4I.js} +2 -2
  11. package/dist/{chunk-K7ICHCTZ.js → chunk-Q6ZTMLTI.js} +4 -4
  12. package/dist/{chunk-KARV7QKF.mjs → chunk-QQJSBIXV.mjs} +1 -1
  13. package/dist/chunk-SCTX5Z7I.js +8 -0
  14. package/dist/{chunk-RJNR7CFN.mjs → chunk-WPPLZNM4.mjs} +1 -1
  15. package/dist/chunk-WZGMAXKC.js +8 -0
  16. package/dist/{chunk-W6IS4HAK.mjs → chunk-ZQUCQRZT.mjs} +1 -1
  17. package/dist/gestureLayer/index.js +6 -6
  18. package/dist/gestureLayer/index.mjs +2 -2
  19. package/dist/index.js +31 -31
  20. package/dist/index.mjs +14 -14
  21. package/dist/motion/Image.js +4 -4
  22. package/dist/motion/Image.mjs +3 -3
  23. package/dist/motion/Pressable.js +4 -4
  24. package/dist/motion/Pressable.mjs +3 -3
  25. package/dist/motion/ScrollView.js +4 -4
  26. package/dist/motion/ScrollView.mjs +3 -3
  27. package/dist/motion/Text.js +4 -4
  28. package/dist/motion/Text.mjs +3 -3
  29. package/dist/motion/View.js +4 -4
  30. package/dist/motion/View.mjs +3 -3
  31. package/package.json +1 -1
  32. package/src/gestures/focusVisibility.ts +15 -4
  33. package/dist/chunk-NJYRN3WG.js +0 -8
  34. package/dist/chunk-R3ODWDTI.js +0 -8
  35. package/dist/chunk-UMFBAFZP.js +0 -8
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkKVSJWO5X_js = require('./chunk-KVSJWO5X.js');
3
+ var chunk6UQ4KA6V_js = require('./chunk-6UQ4KA6V.js');
4
4
  var reactNative = require('react-native');
5
5
 
6
- var MotionScrollView = chunkKVSJWO5X_js.createMotionComponent(reactNative.ScrollView);
6
+ var MotionScrollView = chunk6UQ4KA6V_js.createMotionComponent(reactNative.ScrollView);
7
7
 
8
8
  exports.MotionScrollView = MotionScrollView;
@@ -96,6 +96,7 @@ function ensureInstalled() {
96
96
  document.addEventListener("touchstart", setPointer, true);
97
97
  installed = true;
98
98
  }
99
+ ensureInstalled();
99
100
  function isFocusVisible() {
100
101
  if (reactNative.Platform.OS !== "web") return true;
101
102
  ensureInstalled();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJWHKMNYA_js = require('./chunk-JWHKMNYA.js');
3
+ var chunk6EP3S2PN_js = require('./chunk-6EP3S2PN.js');
4
4
  var chunkSFRNO6AW_js = require('./chunk-SFRNO6AW.js');
5
5
  var react = require('react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
@@ -411,12 +411,12 @@ function createMotionComponent(Component) {
411
411
  onLayout: userOnLayout,
412
412
  ...rest
413
413
  } = props;
414
- const namedTransitions = chunkJWHKMNYA_js.useNamedTransitions();
415
- const transition = chunkJWHKMNYA_js.resolveNamedTransitionProp(
414
+ const namedTransitions = chunk6EP3S2PN_js.useNamedTransitions();
415
+ const transition = chunk6EP3S2PN_js.resolveNamedTransitionProp(
416
416
  transitionProp,
417
417
  namedTransitions
418
418
  );
419
- const layout = typeof layoutProp === "string" ? chunkJWHKMNYA_js.lookupNamedTransition(layoutProp, namedTransitions) : layoutProp;
419
+ const layout = typeof layoutProp === "string" ? chunk6EP3S2PN_js.lookupNamedTransition(layoutProp, namedTransitions) : layoutProp;
420
420
  if (__DEV__ && typeof style === "function") {
421
421
  throw new Error(
422
422
  "[inertia] `style` must be a style object or array of style objects, not a function. The function-form `style={(state) => ...}` Pressable API is not supported \u2014 use `gesture.pressed` (or `gesture.focused`, etc.) to drive state-dependent styling instead."
@@ -424,7 +424,7 @@ function createMotionComponent(Component) {
424
424
  }
425
425
  const presence = usePresence();
426
426
  const isExiting = presence !== null && presence.isPresent === false;
427
- const shouldReduceMotion = chunkJWHKMNYA_js.useShouldReduceMotion();
427
+ const shouldReduceMotion = chunk6EP3S2PN_js.useShouldReduceMotion();
428
428
  const onAnimationEndRef = react.useRef(onAnimationEnd);
429
429
  onAnimationEndRef.current = onAnimationEnd;
430
430
  const variantKey = useControllerKey(controller);
@@ -967,7 +967,7 @@ function useGestureHandlers(gesture, rest, setPressed, setFocused, setFocusVisib
967
967
  if (gesture.focused || gesture.focusVisible) {
968
968
  handlers.onFocus = compose(rest.onFocus, () => {
969
969
  if (gesture.focused) setFocused(true);
970
- if (gesture.focusVisible && chunkJWHKMNYA_js.isFocusVisible()) setFocusVisible(true);
970
+ if (gesture.focusVisible && chunk6EP3S2PN_js.isFocusVisible()) setFocusVisible(true);
971
971
  });
972
972
  handlers.onBlur = compose(rest.onBlur, () => {
973
973
  if (gesture.focused) setFocused(false);
@@ -1,4 +1,4 @@
1
- import { useNamedTransitions, resolveNamedTransitionProp, lookupNamedTransition, useShouldReduceMotion, isFocusVisible } from './chunk-GJD4VVAS.mjs';
1
+ import { useNamedTransitions, resolveNamedTransitionProp, lookupNamedTransition, useShouldReduceMotion, isFocusVisible } from './chunk-L2EVRKSC.mjs';
2
2
  import { stableSig, resolveAnimatableValue, isTopLevelTransition, resolveTransition, ensureWorkletEasing, springToReanimated, DEFAULT_SPRING } from './chunk-6FENLMCA.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';
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-UXK4YCT6.mjs';
1
+ import { createMotionComponent } from './chunk-I76OC6RX.mjs';
2
2
  import { Text } from 'react-native';
3
3
 
4
4
  var MotionText = createMotionComponent(Text);
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-UXK4YCT6.mjs';
1
+ import { createMotionComponent } from './chunk-I76OC6RX.mjs';
2
2
  import { Image } from 'react-native';
3
3
 
4
4
  var MotionImage = createMotionComponent(Image);
@@ -94,6 +94,7 @@ function ensureInstalled() {
94
94
  document.addEventListener("touchstart", setPointer, true);
95
95
  installed = true;
96
96
  }
97
+ ensureInstalled();
97
98
  function isFocusVisible() {
98
99
  if (Platform.OS !== "web") return true;
99
100
  ensureInstalled();
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var chunk6UQ4KA6V_js = require('./chunk-6UQ4KA6V.js');
4
+ var reactNative = require('react-native');
5
+
6
+ var MotionImage = chunk6UQ4KA6V_js.createMotionComponent(reactNative.Image);
7
+
8
+ exports.MotionImage = MotionImage;
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-UXK4YCT6.mjs';
1
+ import { createMotionComponent } from './chunk-I76OC6RX.mjs';
2
2
  import { Pressable } from 'react-native';
3
3
 
4
4
  var MotionPressable = createMotionComponent(Pressable);
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkKVSJWO5X_js = require('./chunk-KVSJWO5X.js');
3
+ var chunk6UQ4KA6V_js = require('./chunk-6UQ4KA6V.js');
4
4
  var reactNative = require('react-native');
5
5
 
6
- var MotionPressable = chunkKVSJWO5X_js.createMotionComponent(reactNative.Pressable);
6
+ var MotionPressable = chunk6UQ4KA6V_js.createMotionComponent(reactNative.Pressable);
7
7
 
8
8
  exports.MotionPressable = MotionPressable;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJWHKMNYA_js = require('./chunk-JWHKMNYA.js');
3
+ var chunk6EP3S2PN_js = require('./chunk-6EP3S2PN.js');
4
4
  var chunkSFRNO6AW_js = require('./chunk-SFRNO6AW.js');
5
5
  var react = require('react');
6
6
  var reactNativeReanimated = require('react-native-reanimated');
@@ -10,8 +10,8 @@ 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 = chunkJWHKMNYA_js.useShouldReduceMotion();
14
- const resolved = chunkJWHKMNYA_js.resolveNamedTransitionProp(transition, chunkJWHKMNYA_js.useNamedTransitions());
13
+ const shouldReduceMotion = chunk6EP3S2PN_js.useShouldReduceMotion();
14
+ const resolved = chunk6EP3S2PN_js.resolveNamedTransitionProp(transition, chunk6EP3S2PN_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" };
@@ -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 (chunkJWHKMNYA_js.isFocusVisible()) setLayer(focusVisible, "focusVisible", 1);
37
+ if (chunk6EP3S2PN_js.isFocusVisible()) setLayer(focusVisible, "focusVisible", 1);
38
38
  },
39
39
  onBlur: () => {
40
40
  setLayer(focused, "focused", 0);
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-UXK4YCT6.mjs';
1
+ import { createMotionComponent } from './chunk-I76OC6RX.mjs';
2
2
  import { ScrollView } from 'react-native';
3
3
 
4
4
  var MotionScrollView = createMotionComponent(ScrollView);
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var chunk6UQ4KA6V_js = require('./chunk-6UQ4KA6V.js');
4
+ var reactNative = require('react-native');
5
+
6
+ var MotionView = chunk6UQ4KA6V_js.createMotionComponent(reactNative.View);
7
+
8
+ exports.MotionView = MotionView;
@@ -1,4 +1,4 @@
1
- import { createMotionComponent } from './chunk-UXK4YCT6.mjs';
1
+ import { createMotionComponent } from './chunk-I76OC6RX.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 chunk6UQ4KA6V_js = require('./chunk-6UQ4KA6V.js');
4
+ var reactNative = require('react-native');
5
+
6
+ var MotionText = chunk6UQ4KA6V_js.createMotionComponent(reactNative.Text);
7
+
8
+ exports.MotionText = MotionText;
@@ -1,4 +1,4 @@
1
- import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions, isFocusVisible } from './chunk-GJD4VVAS.mjs';
1
+ import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions, isFocusVisible } from './chunk-L2EVRKSC.mjs';
2
2
  import { resolveTransition, isTopLevelTransition } from './chunk-6FENLMCA.mjs';
3
3
  import { useCallback, useMemo } from 'react';
4
4
  import { useSharedValue } from 'react-native-reanimated';
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunkK7ICHCTZ_js = require('../chunk-K7ICHCTZ.js');
4
- var chunkJWHKMNYA_js = require('../chunk-JWHKMNYA.js');
3
+ var chunkQ6ZTMLTI_js = require('../chunk-Q6ZTMLTI.js');
4
+ var chunk6EP3S2PN_js = require('../chunk-6EP3S2PN.js');
5
5
  var chunkSFRNO6AW_js = require('../chunk-SFRNO6AW.js');
6
6
  var react = require('react');
7
7
  var reactNativeReanimated = require('react-native-reanimated');
8
8
 
9
9
  function useGestureLayer(states, options = {}) {
10
10
  const { disabled: isDisabled = false, transition: transitionInput } = options;
11
- const shouldReduceMotion = chunkJWHKMNYA_js.useShouldReduceMotion();
12
- const transition = chunkJWHKMNYA_js.resolveNamedTransitionProp(
11
+ const shouldReduceMotion = chunk6EP3S2PN_js.useShouldReduceMotion();
12
+ const transition = chunk6EP3S2PN_js.resolveNamedTransitionProp(
13
13
  transitionInput,
14
- chunkJWHKMNYA_js.useNamedTransitions()
14
+ chunk6EP3S2PN_js.useNamedTransitions()
15
15
  );
16
- const gesture = chunkK7ICHCTZ_js.useGesture(transition);
16
+ const gesture = chunkQ6ZTMLTI_js.useGesture(transition);
17
17
  const disabledProgress = reactNativeReanimated.useSharedValue(0);
18
18
  const transitionSig = chunkSFRNO6AW_js.stableSig(transition);
19
19
  react.useEffect(() => {
@@ -1,5 +1,5 @@
1
- import { useGesture } from '../chunk-W6IS4HAK.mjs';
2
- import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions } from '../chunk-GJD4VVAS.mjs';
1
+ import { useGesture } from '../chunk-ZQUCQRZT.mjs';
2
+ import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions } from '../chunk-L2EVRKSC.mjs';
3
3
  import { stableSig, resolveTransition, isTopLevelTransition } from '../chunk-6FENLMCA.mjs';
4
4
  import { useEffect, useMemo } from 'react';
5
5
  import { useSharedValue, useAnimatedStyle, interpolateColor } from 'react-native-reanimated';
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkK7ICHCTZ_js = require('./chunk-K7ICHCTZ.js');
4
- var chunkNJYRN3WG_js = require('./chunk-NJYRN3WG.js');
5
- var chunkUMFBAFZP_js = require('./chunk-UMFBAFZP.js');
6
- var chunkR3ODWDTI_js = require('./chunk-R3ODWDTI.js');
7
- var chunk5RCMIJGZ_js = require('./chunk-5RCMIJGZ.js');
8
- var chunkS4AEU72O_js = require('./chunk-S4AEU72O.js');
9
- var chunkKVSJWO5X_js = require('./chunk-KVSJWO5X.js');
10
- var chunkJWHKMNYA_js = require('./chunk-JWHKMNYA.js');
3
+ var chunkQ6ZTMLTI_js = require('./chunk-Q6ZTMLTI.js');
4
+ var chunkSCTX5Z7I_js = require('./chunk-SCTX5Z7I.js');
5
+ var chunkWZGMAXKC_js = require('./chunk-WZGMAXKC.js');
6
+ var chunkNDKVHL3N_js = require('./chunk-NDKVHL3N.js');
7
+ var chunkOM5FXU4I_js = require('./chunk-OM5FXU4I.js');
8
+ var chunk5I3G43XA_js = require('./chunk-5I3G43XA.js');
9
+ var chunk6UQ4KA6V_js = require('./chunk-6UQ4KA6V.js');
10
+ var chunk6EP3S2PN_js = require('./chunk-6EP3S2PN.js');
11
11
  var chunkSFRNO6AW_js = require('./chunk-SFRNO6AW.js');
12
12
  var react = require('react');
13
13
  var reactNativeReanimated = require('react-native-reanimated');
@@ -15,16 +15,16 @@ var reactNativeWorklets = require('react-native-worklets');
15
15
 
16
16
  // src/motion/index.ts
17
17
  var Motion = {
18
- View: chunkNJYRN3WG_js.MotionView,
19
- Text: chunkUMFBAFZP_js.MotionText,
20
- Image: chunkR3ODWDTI_js.MotionImage,
21
- Pressable: chunk5RCMIJGZ_js.MotionPressable,
22
- ScrollView: chunkS4AEU72O_js.MotionScrollView
18
+ View: chunkSCTX5Z7I_js.MotionView,
19
+ Text: chunkWZGMAXKC_js.MotionText,
20
+ Image: chunkNDKVHL3N_js.MotionImage,
21
+ Pressable: chunkOM5FXU4I_js.MotionPressable,
22
+ ScrollView: chunk5I3G43XA_js.MotionScrollView
23
23
  };
24
24
  function useAnimation(target, transition) {
25
25
  const output = reactNativeReanimated.useSharedValue(target);
26
- const shouldReduceMotion = chunkJWHKMNYA_js.useShouldReduceMotion();
27
- const resolved = chunkJWHKMNYA_js.resolveNamedTransition(transition, chunkJWHKMNYA_js.useNamedTransitions());
26
+ const shouldReduceMotion = chunk6EP3S2PN_js.useShouldReduceMotion();
27
+ const resolved = chunk6EP3S2PN_js.resolveNamedTransition(transition, chunk6EP3S2PN_js.useNamedTransitions());
28
28
  const cfgSig = chunkSFRNO6AW_js.stableSig(resolved);
29
29
  react.useEffect(() => {
30
30
  const cfg = shouldReduceMotion ? { type: "no-animation" } : resolved ?? { type: "spring" };
@@ -33,7 +33,7 @@ function useAnimation(target, transition) {
33
33
  return output;
34
34
  }
35
35
  function useSpring(target, config) {
36
- const spring = resolveSpringInput(config, chunkJWHKMNYA_js.useNamedTransitions());
36
+ const spring = resolveSpringInput(config, chunk6EP3S2PN_js.useNamedTransitions());
37
37
  const reanimConfig = react.useMemo(
38
38
  () => chunkSFRNO6AW_js.springToReanimated(spring ?? {}),
39
39
  // Keyed on the resolved primitive fields rather than the `config` object
@@ -74,7 +74,7 @@ function useSpring(target, config) {
74
74
  }
75
75
  function resolveSpringInput(config, registry) {
76
76
  if (typeof config !== "string") return config;
77
- const cfg = chunkJWHKMNYA_js.lookupNamedTransition(config, registry);
77
+ const cfg = chunk6EP3S2PN_js.lookupNamedTransition(config, registry);
78
78
  if (cfg.type === void 0 || cfg.type === "spring") return cfg;
79
79
  if (__DEV__) {
80
80
  console.warn(
@@ -240,59 +240,59 @@ function useVariants(variants, initial) {
240
240
 
241
241
  Object.defineProperty(exports, "useGesture", {
242
242
  enumerable: true,
243
- get: function () { return chunkK7ICHCTZ_js.useGesture; }
243
+ get: function () { return chunkQ6ZTMLTI_js.useGesture; }
244
244
  });
245
245
  Object.defineProperty(exports, "MotionView", {
246
246
  enumerable: true,
247
- get: function () { return chunkNJYRN3WG_js.MotionView; }
247
+ get: function () { return chunkSCTX5Z7I_js.MotionView; }
248
248
  });
249
249
  Object.defineProperty(exports, "MotionText", {
250
250
  enumerable: true,
251
- get: function () { return chunkUMFBAFZP_js.MotionText; }
251
+ get: function () { return chunkWZGMAXKC_js.MotionText; }
252
252
  });
253
253
  Object.defineProperty(exports, "MotionImage", {
254
254
  enumerable: true,
255
- get: function () { return chunkR3ODWDTI_js.MotionImage; }
255
+ get: function () { return chunkNDKVHL3N_js.MotionImage; }
256
256
  });
257
257
  Object.defineProperty(exports, "MotionPressable", {
258
258
  enumerable: true,
259
- get: function () { return chunk5RCMIJGZ_js.MotionPressable; }
259
+ get: function () { return chunkOM5FXU4I_js.MotionPressable; }
260
260
  });
261
261
  Object.defineProperty(exports, "MotionScrollView", {
262
262
  enumerable: true,
263
- get: function () { return chunkS4AEU72O_js.MotionScrollView; }
263
+ get: function () { return chunk5I3G43XA_js.MotionScrollView; }
264
264
  });
265
265
  Object.defineProperty(exports, "Presence", {
266
266
  enumerable: true,
267
- get: function () { return chunkKVSJWO5X_js.Presence; }
267
+ get: function () { return chunk6UQ4KA6V_js.Presence; }
268
268
  });
269
269
  Object.defineProperty(exports, "createMotionComponent", {
270
270
  enumerable: true,
271
- get: function () { return chunkKVSJWO5X_js.createMotionComponent; }
271
+ get: function () { return chunk6UQ4KA6V_js.createMotionComponent; }
272
272
  });
273
273
  Object.defineProperty(exports, "usePresence", {
274
274
  enumerable: true,
275
- get: function () { return chunkKVSJWO5X_js.usePresence; }
275
+ get: function () { return chunk6UQ4KA6V_js.usePresence; }
276
276
  });
277
277
  Object.defineProperty(exports, "MotionConfig", {
278
278
  enumerable: true,
279
- get: function () { return chunkJWHKMNYA_js.MotionConfig; }
279
+ get: function () { return chunk6EP3S2PN_js.MotionConfig; }
280
280
  });
281
281
  Object.defineProperty(exports, "resolveNamedTransition", {
282
282
  enumerable: true,
283
- get: function () { return chunkJWHKMNYA_js.resolveNamedTransition; }
283
+ get: function () { return chunk6EP3S2PN_js.resolveNamedTransition; }
284
284
  });
285
285
  Object.defineProperty(exports, "useMotionConfig", {
286
286
  enumerable: true,
287
- get: function () { return chunkJWHKMNYA_js.useMotionConfig; }
287
+ get: function () { return chunk6EP3S2PN_js.useMotionConfig; }
288
288
  });
289
289
  Object.defineProperty(exports, "useNamedTransitions", {
290
290
  enumerable: true,
291
- get: function () { return chunkJWHKMNYA_js.useNamedTransitions; }
291
+ get: function () { return chunk6EP3S2PN_js.useNamedTransitions; }
292
292
  });
293
293
  Object.defineProperty(exports, "useShouldReduceMotion", {
294
294
  enumerable: true,
295
- get: function () { return chunkJWHKMNYA_js.useShouldReduceMotion; }
295
+ get: function () { return chunk6EP3S2PN_js.useShouldReduceMotion; }
296
296
  });
297
297
  Object.defineProperty(exports, "buildReleaseAnimation", {
298
298
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
- export { useGesture } from './chunk-W6IS4HAK.mjs';
2
- import { MotionView } from './chunk-RJNR7CFN.mjs';
3
- export { MotionView } from './chunk-RJNR7CFN.mjs';
4
- import { MotionText } from './chunk-FSPQVLBF.mjs';
5
- export { MotionText } from './chunk-FSPQVLBF.mjs';
6
- import { MotionImage } from './chunk-UM3WVSKQ.mjs';
7
- export { MotionImage } from './chunk-UM3WVSKQ.mjs';
8
- import { MotionPressable } from './chunk-E4MDU4YV.mjs';
9
- export { MotionPressable } from './chunk-E4MDU4YV.mjs';
10
- import { MotionScrollView } from './chunk-KARV7QKF.mjs';
11
- export { MotionScrollView } from './chunk-KARV7QKF.mjs';
12
- export { Presence, createMotionComponent, usePresence } from './chunk-UXK4YCT6.mjs';
13
- import { useShouldReduceMotion, resolveNamedTransition, useNamedTransitions, lookupNamedTransition } from './chunk-GJD4VVAS.mjs';
14
- export { MotionConfig, resolveNamedTransition, useMotionConfig, useNamedTransitions, useShouldReduceMotion } from './chunk-GJD4VVAS.mjs';
1
+ export { useGesture } from './chunk-ZQUCQRZT.mjs';
2
+ import { MotionView } from './chunk-WPPLZNM4.mjs';
3
+ export { MotionView } from './chunk-WPPLZNM4.mjs';
4
+ import { MotionText } from './chunk-IJNVUM5U.mjs';
5
+ export { MotionText } from './chunk-IJNVUM5U.mjs';
6
+ import { MotionImage } from './chunk-K4KR5BIS.mjs';
7
+ export { MotionImage } from './chunk-K4KR5BIS.mjs';
8
+ import { MotionPressable } from './chunk-OBE7KTMK.mjs';
9
+ export { MotionPressable } from './chunk-OBE7KTMK.mjs';
10
+ import { MotionScrollView } from './chunk-QQJSBIXV.mjs';
11
+ export { MotionScrollView } from './chunk-QQJSBIXV.mjs';
12
+ export { Presence, createMotionComponent, usePresence } from './chunk-I76OC6RX.mjs';
13
+ import { useShouldReduceMotion, resolveNamedTransition, useNamedTransitions, lookupNamedTransition } from './chunk-L2EVRKSC.mjs';
14
+ export { MotionConfig, resolveNamedTransition, useMotionConfig, useNamedTransitions, useShouldReduceMotion } from './chunk-L2EVRKSC.mjs';
15
15
  import { stableSig, resolveTransition, springToReanimated } from './chunk-6FENLMCA.mjs';
16
16
  export { buildReleaseAnimation, cubicBezier, ensureWorkletEasing, resolveAnimatableValue, resolveTransition } from './chunk-6FENLMCA.mjs';
17
17
  import { useEffect, useMemo, useRef } from 'react';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkR3ODWDTI_js = require('../chunk-R3ODWDTI.js');
4
- require('../chunk-KVSJWO5X.js');
5
- require('../chunk-JWHKMNYA.js');
3
+ var chunkNDKVHL3N_js = require('../chunk-NDKVHL3N.js');
4
+ require('../chunk-6UQ4KA6V.js');
5
+ require('../chunk-6EP3S2PN.js');
6
6
  require('../chunk-SFRNO6AW.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionImage", {
11
11
  enumerable: true,
12
- get: function () { return chunkR3ODWDTI_js.MotionImage; }
12
+ get: function () { return chunkNDKVHL3N_js.MotionImage; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionImage } from '../chunk-UM3WVSKQ.mjs';
2
- import '../chunk-UXK4YCT6.mjs';
3
- import '../chunk-GJD4VVAS.mjs';
1
+ export { MotionImage } from '../chunk-K4KR5BIS.mjs';
2
+ import '../chunk-I76OC6RX.mjs';
3
+ import '../chunk-L2EVRKSC.mjs';
4
4
  import '../chunk-6FENLMCA.mjs';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk5RCMIJGZ_js = require('../chunk-5RCMIJGZ.js');
4
- require('../chunk-KVSJWO5X.js');
5
- require('../chunk-JWHKMNYA.js');
3
+ var chunkOM5FXU4I_js = require('../chunk-OM5FXU4I.js');
4
+ require('../chunk-6UQ4KA6V.js');
5
+ require('../chunk-6EP3S2PN.js');
6
6
  require('../chunk-SFRNO6AW.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionPressable", {
11
11
  enumerable: true,
12
- get: function () { return chunk5RCMIJGZ_js.MotionPressable; }
12
+ get: function () { return chunkOM5FXU4I_js.MotionPressable; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionPressable } from '../chunk-E4MDU4YV.mjs';
2
- import '../chunk-UXK4YCT6.mjs';
3
- import '../chunk-GJD4VVAS.mjs';
1
+ export { MotionPressable } from '../chunk-OBE7KTMK.mjs';
2
+ import '../chunk-I76OC6RX.mjs';
3
+ import '../chunk-L2EVRKSC.mjs';
4
4
  import '../chunk-6FENLMCA.mjs';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkS4AEU72O_js = require('../chunk-S4AEU72O.js');
4
- require('../chunk-KVSJWO5X.js');
5
- require('../chunk-JWHKMNYA.js');
3
+ var chunk5I3G43XA_js = require('../chunk-5I3G43XA.js');
4
+ require('../chunk-6UQ4KA6V.js');
5
+ require('../chunk-6EP3S2PN.js');
6
6
  require('../chunk-SFRNO6AW.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionScrollView", {
11
11
  enumerable: true,
12
- get: function () { return chunkS4AEU72O_js.MotionScrollView; }
12
+ get: function () { return chunk5I3G43XA_js.MotionScrollView; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionScrollView } from '../chunk-KARV7QKF.mjs';
2
- import '../chunk-UXK4YCT6.mjs';
3
- import '../chunk-GJD4VVAS.mjs';
1
+ export { MotionScrollView } from '../chunk-QQJSBIXV.mjs';
2
+ import '../chunk-I76OC6RX.mjs';
3
+ import '../chunk-L2EVRKSC.mjs';
4
4
  import '../chunk-6FENLMCA.mjs';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkUMFBAFZP_js = require('../chunk-UMFBAFZP.js');
4
- require('../chunk-KVSJWO5X.js');
5
- require('../chunk-JWHKMNYA.js');
3
+ var chunkWZGMAXKC_js = require('../chunk-WZGMAXKC.js');
4
+ require('../chunk-6UQ4KA6V.js');
5
+ require('../chunk-6EP3S2PN.js');
6
6
  require('../chunk-SFRNO6AW.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionText", {
11
11
  enumerable: true,
12
- get: function () { return chunkUMFBAFZP_js.MotionText; }
12
+ get: function () { return chunkWZGMAXKC_js.MotionText; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionText } from '../chunk-FSPQVLBF.mjs';
2
- import '../chunk-UXK4YCT6.mjs';
3
- import '../chunk-GJD4VVAS.mjs';
1
+ export { MotionText } from '../chunk-IJNVUM5U.mjs';
2
+ import '../chunk-I76OC6RX.mjs';
3
+ import '../chunk-L2EVRKSC.mjs';
4
4
  import '../chunk-6FENLMCA.mjs';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkNJYRN3WG_js = require('../chunk-NJYRN3WG.js');
4
- require('../chunk-KVSJWO5X.js');
5
- require('../chunk-JWHKMNYA.js');
3
+ var chunkSCTX5Z7I_js = require('../chunk-SCTX5Z7I.js');
4
+ require('../chunk-6UQ4KA6V.js');
5
+ require('../chunk-6EP3S2PN.js');
6
6
  require('../chunk-SFRNO6AW.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionView", {
11
11
  enumerable: true,
12
- get: function () { return chunkNJYRN3WG_js.MotionView; }
12
+ get: function () { return chunkSCTX5Z7I_js.MotionView; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionView } from '../chunk-RJNR7CFN.mjs';
2
- import '../chunk-UXK4YCT6.mjs';
3
- import '../chunk-GJD4VVAS.mjs';
1
+ export { MotionView } from '../chunk-WPPLZNM4.mjs';
2
+ import '../chunk-I76OC6RX.mjs';
3
+ import '../chunk-L2EVRKSC.mjs';
4
4
  import '../chunk-6FENLMCA.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rootnative/inertia",
3
- "version": "0.0.0-alpha.3",
3
+ "version": "0.0.0-alpha.4",
4
4
  "description": "Declarative animation primitives for React Native, built on react-native-reanimated.",
5
5
  "license": "MIT",
6
6
  "author": "RootNative",
@@ -12,10 +12,15 @@ import { Platform } from 'react-native'
12
12
  * arrives via D-pad, screen reader, or hardware keyboard, all of which are
13
13
  * keyboard-equivalent — so `isFocusVisible()` is unconditionally `true`.
14
14
  *
15
- * The web listeners attach lazily on first call (capture phase, so they run
16
- * before the focus event reaches the focused element) and stay installed for
17
- * the lifetime of the document. They are passive and idle-cheap; the cost is
18
- * one boolean read per `onFocus` dispatch.
15
+ * The web listeners attach eagerly at module import (capture phase, so they
16
+ * run before the focus event reaches the focused element) and stay installed
17
+ * for the lifetime of the document. Eager installation matters: the very
18
+ * first interaction with a page can be the mouse click that focuses a
19
+ * gesture-wired element, and if the listeners only attached during that
20
+ * focus dispatch the mousedown would already have passed unobserved —
21
+ * leaving the default `'keyboard'` modality and drawing a focus ring for a
22
+ * pointer interaction. They are passive and idle-cheap; the cost is one
23
+ * boolean read per `onFocus` dispatch.
19
24
  */
20
25
 
21
26
  type InputModality = 'keyboard' | 'pointer'
@@ -44,6 +49,12 @@ function ensureInstalled(): void {
44
49
  installed = true
45
50
  }
46
51
 
52
+ // Install at import time so the pointer event that precedes the first focus
53
+ // is observed (see module doc above). `ensureInstalled` stays in
54
+ // `isFocusVisible` as a safety net for environments where `document` appears
55
+ // after import.
56
+ ensureInstalled()
57
+
47
58
  /**
48
59
  * `true` if the next `onFocus` should be treated as "focus-visible" (keyboard
49
60
  * focus). On native, always `true`. On web, reflects the most recent user
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkKVSJWO5X_js = require('./chunk-KVSJWO5X.js');
4
- var reactNative = require('react-native');
5
-
6
- var MotionView = chunkKVSJWO5X_js.createMotionComponent(reactNative.View);
7
-
8
- exports.MotionView = MotionView;
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkKVSJWO5X_js = require('./chunk-KVSJWO5X.js');
4
- var reactNative = require('react-native');
5
-
6
- var MotionImage = chunkKVSJWO5X_js.createMotionComponent(reactNative.Image);
7
-
8
- exports.MotionImage = MotionImage;
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkKVSJWO5X_js = require('./chunk-KVSJWO5X.js');
4
- var reactNative = require('react-native');
5
-
6
- var MotionText = chunkKVSJWO5X_js.createMotionComponent(reactNative.Text);
7
-
8
- exports.MotionText = MotionText;