motion-on-native 1.2.7 → 1.2.8

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/lib/index.d.ts CHANGED
@@ -92,6 +92,11 @@ export declare const NativeMotion: {
92
92
  View: (props: MotionComponentProps & import("react-native").ViewProps) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
93
93
  Text: (props: MotionComponentProps & import("react-native").TextProps) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
94
94
  Image: (props: MotionComponentProps & import("react-native").ImageProps) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
95
+ ImageBackground: (props: MotionComponentProps & import("react-native").ImageBackgroundProps) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
95
96
  TextInput: (props: MotionComponentProps & import("react-native").TextInputProps) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
96
97
  TouchableOpacity: (props: MotionComponentProps & import("react-native").TouchableOpacityProps & React.RefAttributes<View>) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
98
+ ScrollView: (props: MotionComponentProps & import("react-native").ScrollViewProps) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
99
+ FlatList: (props: MotionComponentProps & import("react-native").FlatListProps<unknown>) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
100
+ SectionList: (props: MotionComponentProps & import("react-native").SectionListProps<unknown, unknown>) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
101
+ Pressable: (props: MotionComponentProps & import("react-native").PressableProps & React.RefAttributes<View>) => React.ReactElement<import("react-native-reanimated").AnimateProps<any>, string | React.JSXElementConstructor<any>> | null;
97
102
  };
package/lib/index.js CHANGED
@@ -293,24 +293,16 @@ function createMotionComponent(Component) {
293
293
  // Handle shouldExit
294
294
  (0, react_1.useEffect)(() => {
295
295
  var _a;
296
- if (shouldExit && !isExitingRef.current) {
296
+ if (shouldExit && !isExitingRef.current && exit && Object.keys(exit).length > 0) {
297
297
  isExitingRef.current = true;
298
- if (exit && Object.keys(exit).length > 0) {
299
- animateToValues(exit, transition);
300
- const exitDuration = (_a = transition.duration) !== null && _a !== void 0 ? _a : 300;
301
- setTimeout(() => {
302
- setIsPresent(false);
303
- if (onExitComplete) {
304
- onExitComplete();
305
- }
306
- }, exitDuration);
307
- }
308
- else {
298
+ animateToValues(exit, transition);
299
+ const exitDuration = (_a = transition.duration) !== null && _a !== void 0 ? _a : 300;
300
+ setTimeout(() => {
309
301
  setIsPresent(false);
310
302
  if (onExitComplete) {
311
303
  onExitComplete();
312
304
  }
313
- }
305
+ }, exitDuration);
314
306
  }
315
307
  else if (!shouldExit && isExitingRef.current) {
316
308
  // Re-entering: reset everything
@@ -512,6 +504,11 @@ exports.NativeMotion = {
512
504
  View: createMotionComponent(react_native_1.View),
513
505
  Text: createMotionComponent(react_native_1.Text),
514
506
  Image: createMotionComponent(react_native_1.Image),
507
+ ImageBackground: createMotionComponent(react_native_1.ImageBackground),
515
508
  TextInput: createMotionComponent(react_native_1.TextInput),
516
509
  TouchableOpacity: createMotionComponent(react_native_1.TouchableOpacity),
510
+ ScrollView: createMotionComponent(react_native_1.ScrollView),
511
+ FlatList: createMotionComponent(react_native_1.FlatList),
512
+ SectionList: createMotionComponent(react_native_1.SectionList),
513
+ Pressable: createMotionComponent(react_native_1.Pressable),
517
514
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-on-native",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Framer Motion-inspired animation library for React Native with Reanimated. Easy spring animations, gestures, and transitions for mobile apps.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",