react-native-gesture-handler 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/README.md +3 -2
  2. package/android/build.gradle +4 -3
  3. package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandler.kt +42 -11
  4. package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.kt +36 -2
  5. package/android/lib/src/main/java/com/swmansion/gesturehandler/PanGestureHandler.kt +7 -4
  6. package/android/lib/src/main/java/com/swmansion/gesturehandler/PinchGestureHandler.kt +6 -4
  7. package/android/lib/src/main/java/com/swmansion/gesturehandler/RotationGestureHandler.kt +6 -4
  8. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +8 -8
  9. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  10. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  11. package/lib/commonjs/handlers/createHandler.js +13 -1
  12. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  13. package/lib/commonjs/index.js +0 -106
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  16. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  17. package/lib/module/handlers/createHandler.js +14 -1
  18. package/lib/module/handlers/createHandler.js.map +1 -1
  19. package/lib/module/index.js +0 -11
  20. package/lib/module/index.js.map +1 -1
  21. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +2 -2
  22. package/lib/typescript/handlers/PanGestureHandler.d.ts +2 -2
  23. package/lib/typescript/index.d.ts +11 -11
  24. package/package.json +1 -1
  25. package/src/handlers/LongPressGestureHandler.ts +2 -2
  26. package/src/handlers/PanGestureHandler.ts +2 -2
  27. package/src/handlers/createHandler.ts +13 -0
  28. package/src/index.ts +11 -11
@@ -122,6 +122,16 @@ type InternalEventHandlers = {
122
122
  onGestureHandlerStateChange?: (event: any) => void;
123
123
  };
124
124
 
125
+ let showedRngh2Notice = false;
126
+ function showRngh2NoticeIfNeeded() {
127
+ if (!showedRngh2Notice) {
128
+ console.warn(
129
+ "[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!"
130
+ );
131
+ showedRngh2Notice = true;
132
+ }
133
+ }
134
+
125
135
  // TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.
126
136
  export default function createHandler<
127
137
  T extends BaseGestureHandlerProps<U>,
@@ -162,6 +172,9 @@ export default function createHandler<
162
172
  }
163
173
  handlerIDToTag[props.id] = this.handlerTag;
164
174
  }
175
+ if (__DEV__) {
176
+ showRngh2NoticeIfNeeded();
177
+ }
165
178
  }
166
179
 
167
180
  componentDidMount() {
package/src/index.ts CHANGED
@@ -61,22 +61,22 @@ export type {
61
61
  } from './handlers/NativeViewGestureHandler';
62
62
  export { GestureDetector } from './handlers/gestures/GestureDetector';
63
63
  export { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';
64
- export { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';
65
- export { PanGestureType as PanGesture } from './handlers/gestures/panGesture';
66
- export { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';
67
- export { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';
68
- export { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';
69
- export { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';
70
- export { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';
71
- export { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';
72
- export { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';
73
- export {
64
+ export type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';
65
+ export type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';
66
+ export type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';
67
+ export type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';
68
+ export type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';
69
+ export type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';
70
+ export type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';
71
+ export type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';
72
+ export type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';
73
+ export type {
74
74
  ComposedGestureType as ComposedGesture,
75
75
  RaceGestureType as RaceGesture,
76
76
  SimultaneousGestureType as SimultaneousGesture,
77
77
  ExclusiveGestureType as ExclusiveGesture,
78
78
  } from './handlers/gestures/gestureComposition';
79
- export { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';
79
+ export type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';
80
80
  export { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';
81
81
  export type {
82
82
  RawButtonProps,