@rootnative/inertia 0.0.3 → 0.0.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.
- package/CHANGELOG.md +41 -5
- package/README.md +5 -3
- package/dist/{chunk-SGUHE5CX.mjs → chunk-4ASOELLA.mjs} +1 -1
- package/dist/{chunk-CSODMRJ7.mjs → chunk-55W7BNO2.mjs} +475 -83
- package/dist/chunk-5SRD2WCO.js +8 -0
- package/dist/{chunk-PTRF47DA.js → chunk-7A6WTXNK.js} +10 -3
- package/dist/{chunk-3XTVY34H.js → chunk-CENTULW6.js} +2 -2
- package/dist/{chunk-4PEHWDAZ.js → chunk-D5KAHWMC.js} +7 -7
- package/dist/{chunk-O22NXXCZ.mjs → chunk-J5Q46OPW.mjs} +1 -1
- package/dist/{chunk-RGNX6UZN.mjs → chunk-K3CLP74S.mjs} +2 -2
- package/dist/{chunk-BP3Y2SHQ.js → chunk-MYE5NMXW.js} +495 -101
- package/dist/{chunk-OQV66TBQ.mjs → chunk-NAOXQJ7U.mjs} +1 -1
- package/dist/{chunk-R63GIUNU.mjs → chunk-QKC3APP4.mjs} +1 -1
- package/dist/{chunk-46P57VMY.mjs → chunk-RF7J5FRM.mjs} +1 -1
- package/dist/{chunk-CY7Y64C3.mjs → chunk-TU2XFPAK.mjs} +10 -4
- package/dist/chunk-TVFNJ25Z.js +8 -0
- package/dist/chunk-VLDIFL3F.js +8 -0
- package/dist/{chunk-7AOERN53.js → chunk-WVRCKOPO.js} +3 -3
- package/dist/{chunk-W5MC3P4N.js → chunk-XMEVPEMH.js} +2 -2
- package/dist/{chunk-BQQTHG2V.mjs → chunk-YKGY22SB.mjs} +1 -1
- package/dist/gestureLayer/index.d.mts +2 -2
- package/dist/gestureLayer/index.d.ts +2 -2
- package/dist/gestureLayer/index.js +10 -10
- package/dist/gestureLayer/index.mjs +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +48 -169
- package/dist/index.mjs +17 -137
- package/dist/motion/Image.d.mts +1 -1
- package/dist/motion/Image.d.ts +1 -1
- package/dist/motion/Image.js +5 -5
- package/dist/motion/Image.mjs +4 -4
- package/dist/motion/Pressable.d.mts +1 -1
- package/dist/motion/Pressable.d.ts +1 -1
- package/dist/motion/Pressable.js +5 -5
- package/dist/motion/Pressable.mjs +4 -4
- package/dist/motion/ScrollView.d.mts +1 -1
- package/dist/motion/ScrollView.d.ts +1 -1
- package/dist/motion/ScrollView.js +5 -5
- package/dist/motion/ScrollView.mjs +4 -4
- package/dist/motion/Text.d.mts +1 -1
- package/dist/motion/Text.d.ts +1 -1
- package/dist/motion/Text.js +5 -5
- package/dist/motion/Text.mjs +4 -4
- package/dist/motion/View.d.mts +1 -1
- package/dist/motion/View.d.ts +1 -1
- package/dist/motion/View.js +5 -5
- package/dist/motion/View.mjs +4 -4
- package/dist/touch/index.d.mts +1 -1
- package/dist/touch/index.d.ts +1 -1
- package/dist/touch/index.js +3 -3
- package/dist/touch/index.mjs +1 -1
- package/dist/{types-G1dBU2IQ.d.mts → types-37pN82yh.d.mts} +49 -14
- package/dist/{types-G1dBU2IQ.d.ts → types-37pN82yh.d.ts} +49 -14
- package/dist/{useGesture-D1e4ixJo.d.ts → useGesture-Cl4uzZIr.d.ts} +1 -1
- package/dist/{useGesture-RFY6kTL3.d.mts → useGesture-_IKkS8Dv.d.mts} +1 -1
- package/llms.txt +3 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/internal/boxShadow.ts +177 -6
- package/src/internal/nonWorkletWarning.ts +4 -6
- package/src/internal/warnOnce.ts +28 -0
- package/src/layout/index.ts +10 -0
- package/src/layout/measureWindow.ts +135 -0
- package/src/layout/sharedRegistry.ts +107 -18
- package/src/layout/useSharedLayout.ts +256 -91
- package/src/motion/createMotionComponent.tsx +378 -39
- package/src/motion/installCheck.ts +1 -1
- package/src/transitions/index.ts +1 -1
- package/src/types.ts +52 -12
- package/src/values/useColorTransition.ts +1 -1
- package/dist/chunk-FNVFV4EY.js +0 -8
- package/dist/chunk-FWQOXA43.js +0 -8
- package/dist/chunk-KBP4LR75.js +0 -8
|
@@ -5,16 +5,22 @@ var reactNativeReanimated = require('react-native-reanimated');
|
|
|
5
5
|
|
|
6
6
|
// src/transitions/easing.ts
|
|
7
7
|
|
|
8
|
-
// src/internal/
|
|
8
|
+
// src/internal/warnOnce.ts
|
|
9
9
|
var warned = /* @__PURE__ */ new Set();
|
|
10
|
-
function
|
|
10
|
+
function warnOnce(key, message) {
|
|
11
11
|
if (!__DEV__) return;
|
|
12
|
-
if (typeof process !== "undefined" && process.env?.JEST_WORKER_ID) return;
|
|
13
12
|
if (warned.has(key)) return;
|
|
14
13
|
warned.add(key);
|
|
15
14
|
console.warn(message);
|
|
16
15
|
}
|
|
17
16
|
|
|
17
|
+
// src/internal/nonWorkletWarning.ts
|
|
18
|
+
function warnNonWorkletOnce(key, message) {
|
|
19
|
+
if (!__DEV__) return;
|
|
20
|
+
if (typeof process !== "undefined" && process.env?.JEST_WORKER_ID) return;
|
|
21
|
+
warnOnce(key, message);
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
// src/transitions/easing.ts
|
|
19
25
|
function ensureWorkletEasing(easing) {
|
|
20
26
|
if (!easing) return void 0;
|
|
@@ -282,3 +288,4 @@ exports.resolveTransition = resolveTransition;
|
|
|
282
288
|
exports.springToReanimated = springToReanimated;
|
|
283
289
|
exports.stableSig = stableSig;
|
|
284
290
|
exports.warnNonWorkletOnce = warnNonWorkletOnce;
|
|
291
|
+
exports.warnOnce = warnOnce;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMYE5NMXW_js = require('./chunk-MYE5NMXW.js');
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
5
|
|
|
6
|
-
var MotionPressable =
|
|
6
|
+
var MotionPressable = chunkMYE5NMXW_js.createMotionComponent(reactNative.Pressable);
|
|
7
7
|
|
|
8
8
|
exports.MotionPressable = MotionPressable;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkWVRCKOPO_js = require('./chunk-WVRCKOPO.js');
|
|
4
|
+
var chunk7A6WTXNK_js = require('./chunk-7A6WTXNK.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 =
|
|
14
|
-
const resolved =
|
|
13
|
+
const shouldReduceMotion = chunkWVRCKOPO_js.useShouldReduceMotion();
|
|
14
|
+
const resolved = chunkWVRCKOPO_js.resolveNamedTransitionProp(transition, chunkWVRCKOPO_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 =
|
|
18
|
+
sv.value = chunk7A6WTXNK_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 (
|
|
37
|
+
if (chunkWVRCKOPO_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 (
|
|
50
|
+
if (chunk7A6WTXNK_js.isTopLevelTransition(transition)) return transition;
|
|
51
51
|
return transition[layer];
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions, isFocusVisible } from './chunk-
|
|
2
|
-
import { resolveTransition, isTopLevelTransition } from './chunk-
|
|
1
|
+
import { useShouldReduceMotion, resolveNamedTransitionProp, useNamedTransitions, isFocusVisible } from './chunk-QKC3APP4.mjs';
|
|
2
|
+
import { resolveTransition, isTopLevelTransition } from './chunk-TU2XFPAK.mjs';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
4
|
import { useSharedValue } from 'react-native-reanimated';
|
|
5
5
|
|