react-native-gesture-handler 2.25.0 → 2.27.0
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/README.md +2 -4
- package/RNGestureHandler.podspec +1 -0
- package/android/build.gradle +41 -42
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +1 -1
- package/android/gradle.properties +1 -1
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -2
- package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +4 -1
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +1 -1
- package/android/{package77/src → src}/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +14 -19
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +29 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +229 -114
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +4 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +91 -49
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +13 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +20 -6
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +52 -21
- package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +12 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +65 -35
- package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +3 -3
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +187 -92
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +12 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +3 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +12 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/StylusData.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +55 -33
- package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +13 -18
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +27 -21
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +7 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +13 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDispatcher.kt +189 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerFactoryUtil.kt +34 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +7 -11
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +29 -590
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +8 -14
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +26 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +15 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +2 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +17 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +6 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +7 -5
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/jni/CMakeLists.txt +8 -18
- package/android/svg/src/main/java/com/swmansion/gesturehandler/RNSVGHitTester.kt +1 -3
- package/apple/RNGestureHandlerButton.mm +6 -2
- package/package.json +29 -47
- package/src/components/DrawerLayout.tsx +5 -2
- package/src/components/GestureButtons.tsx +2 -2
- package/src/components/GestureComponents.web.tsx +1 -1
- package/src/components/GestureHandlerButton.web.tsx +3 -3
- package/src/components/Pressable/Pressable.tsx +362 -425
- package/src/components/Pressable/PressableProps.tsx +34 -0
- package/src/components/Pressable/StateMachine.tsx +49 -0
- package/src/components/Pressable/stateDefinitions.ts +125 -0
- package/src/components/Pressable/utils.ts +11 -7
- package/src/components/ReanimatedSwipeable.tsx +55 -33
- package/src/components/Swipeable.tsx +3 -0
- package/src/components/Text.tsx +5 -2
- package/src/components/utils.ts +26 -0
- package/src/getShadowNodeFromRef.ts +2 -2
- package/src/handlers/GestureHandlerEventPayload.ts +3 -0
- package/src/handlers/createHandler.tsx +1 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +9 -0
- package/src/handlers/gestures/forceTouchGesture.ts +9 -0
- package/src/handlers/gestures/gestureObjects.ts +3 -1
- package/src/handlers/gestures/reanimatedWrapper.ts +0 -1
- package/src/handlers/utils.ts +1 -1
- package/src/utils.ts +0 -1
- package/src/web/detectors/RotationGestureDetector.ts +4 -0
- package/src/web/handlers/FlingGestureHandler.ts +4 -0
- package/src/web/handlers/GestureHandler.ts +9 -3
- package/src/web/handlers/PanGestureHandler.ts +25 -36
- package/src/web/handlers/TapGestureHandler.ts +14 -19
- package/src/web/tools/GestureHandlerOrchestrator.ts +1 -0
- package/src/web/tools/PointerEventManager.ts +1 -1
- package/src/web/tools/PointerTracker.ts +17 -15
- package/src/web/tools/Vector.ts +1 -1
- package/src/web_hammer/DiscreteGestureHandler.ts +1 -1
- package/src/web_hammer/DraggingGestureHandler.ts +1 -1
- package/src/web_hammer/FlingGestureHandler.ts +1 -1
- package/src/web_hammer/GestureHandler.ts +2 -1
- package/src/web_hammer/LongPressGestureHandler.ts +1 -1
- package/android/packageDeprecated/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +0 -85
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -60
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -26
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -26
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -16
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +0 -67
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -13
- package/lib/commonjs/ActionType.js +0 -15
- package/lib/commonjs/ActionType.js.map +0 -1
- package/lib/commonjs/Directions.js +0 -28
- package/lib/commonjs/Directions.js.map +0 -1
- package/lib/commonjs/EnableNewWebImplementation.js +0 -48
- package/lib/commonjs/EnableNewWebImplementation.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +0 -15
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +0 -1
- package/lib/commonjs/PlatformConstants.js +0 -15
- package/lib/commonjs/PlatformConstants.js.map +0 -1
- package/lib/commonjs/PlatformConstants.web.js +0 -14
- package/lib/commonjs/PlatformConstants.web.js.map +0 -1
- package/lib/commonjs/PointerType.js +0 -17
- package/lib/commonjs/PointerType.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.js +0 -16
- package/lib/commonjs/RNGestureHandlerModule.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +0 -122
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +0 -66
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +0 -1
- package/lib/commonjs/RNRenderer.js +0 -16
- package/lib/commonjs/RNRenderer.js.map +0 -1
- package/lib/commonjs/RNRenderer.web.js +0 -11
- package/lib/commonjs/RNRenderer.web.js.map +0 -1
- package/lib/commonjs/State.js +0 -18
- package/lib/commonjs/State.js.map +0 -1
- package/lib/commonjs/TouchEventType.js +0 -16
- package/lib/commonjs/TouchEventType.js.map +0 -1
- package/lib/commonjs/components/DrawerLayout.js +0 -574
- package/lib/commonjs/components/DrawerLayout.js.map +0 -1
- package/lib/commonjs/components/GestureButtons.js +0 -269
- package/lib/commonjs/components/GestureButtons.js.map +0 -1
- package/lib/commonjs/components/GestureButtonsProps.js +0 -6
- package/lib/commonjs/components/GestureButtonsProps.js.map +0 -1
- package/lib/commonjs/components/GestureComponents.js +0 -115
- package/lib/commonjs/components/GestureComponents.js.map +0 -1
- package/lib/commonjs/components/GestureComponents.web.js +0 -52
- package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.js +0 -14
- package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +0 -46
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +0 -44
- package/lib/commonjs/components/GestureHandlerRootView.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +0 -38
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
- package/lib/commonjs/components/Pressable/Pressable.js +0 -370
- package/lib/commonjs/components/Pressable/Pressable.js.map +0 -1
- package/lib/commonjs/components/Pressable/PressableProps.js +0 -6
- package/lib/commonjs/components/Pressable/PressableProps.js.map +0 -1
- package/lib/commonjs/components/Pressable/index.js +0 -16
- package/lib/commonjs/components/Pressable/index.js.map +0 -1
- package/lib/commonjs/components/Pressable/utils.js +0 -114
- package/lib/commonjs/components/Pressable/utils.js.map +0 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +0 -393
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +0 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +0 -367
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +0 -1
- package/lib/commonjs/components/Swipeable.js +0 -415
- package/lib/commonjs/components/Swipeable.js.map +0 -1
- package/lib/commonjs/components/Text.js +0 -71
- package/lib/commonjs/components/Text.js.map +0 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +0 -40
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +0 -1
- package/lib/commonjs/components/touchables/ExtraButtonProps.js +0 -2
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +0 -290
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js +0 -6
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +0 -111
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +0 -102
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +0 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +0 -6
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -79
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -37
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/index.js +0 -40
- package/lib/commonjs/components/touchables/index.js.map +0 -1
- package/lib/commonjs/findNodeHandle.js +0 -12
- package/lib/commonjs/findNodeHandle.js.map +0 -1
- package/lib/commonjs/findNodeHandle.web.js +0 -48
- package/lib/commonjs/findNodeHandle.web.js.map +0 -1
- package/lib/commonjs/getShadowNodeFromRef.js +0 -52
- package/lib/commonjs/getShadowNodeFromRef.js.map +0 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
- package/lib/commonjs/ghQueueMicrotask.js +0 -11
- package/lib/commonjs/ghQueueMicrotask.js.map +0 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +0 -33
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +0 -53
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js +0 -6
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +0 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +0 -35
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -35
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +0 -131
- package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +0 -31
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +0 -14
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +0 -31
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +0 -35
- package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/createHandler.js +0 -494
- package/lib/commonjs/handlers/createHandler.js.map +0 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +0 -87
- package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +0 -14
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +0 -11
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -28
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +0 -6
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +0 -42
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +0 -49
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +0 -87
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +0 -29
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +0 -148
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -25
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js +0 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +0 -77
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -180
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -57
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +0 -48
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -49
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +0 -172
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +0 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +0 -147
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +0 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +0 -47
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +0 -82
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gesture.js +0 -381
- package/lib/commonjs/handlers/gestures/gesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +0 -107
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +0 -156
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +0 -75
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +0 -32
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +0 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +0 -74
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +0 -57
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +0 -31
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +0 -44
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +0 -225
- package/lib/commonjs/handlers/gestures/panGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +0 -45
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +0 -37
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +0 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +0 -45
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +0 -102
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +0 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +0 -12
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +0 -1
- package/lib/commonjs/handlers/handlersRegistry.js +0 -66
- package/lib/commonjs/handlers/handlersRegistry.js.map +0 -1
- package/lib/commonjs/handlers/utils.js +0 -92
- package/lib/commonjs/handlers/utils.js.map +0 -1
- package/lib/commonjs/index.js +0 -298
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/init.js +0 -32
- package/lib/commonjs/init.js.map +0 -1
- package/lib/commonjs/jestUtils/index.js +0 -20
- package/lib/commonjs/jestUtils/index.js.map +0 -1
- package/lib/commonjs/jestUtils/jestUtils.js +0 -383
- package/lib/commonjs/jestUtils/jestUtils.js.map +0 -1
- package/lib/commonjs/mocks.js +0 -81
- package/lib/commonjs/mocks.js.map +0 -1
- package/lib/commonjs/mountRegistry.js +0 -49
- package/lib/commonjs/mountRegistry.js.map +0 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +0 -13
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +0 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +0 -15
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +0 -15
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
- package/lib/commonjs/typeUtils.js +0 -2
- package/lib/commonjs/typeUtils.js.map +0 -1
- package/lib/commonjs/utils.js +0 -116
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/commonjs/web/Gestures.js +0 -66
- package/lib/commonjs/web/Gestures.js.map +0 -1
- package/lib/commonjs/web/constants.js +0 -11
- package/lib/commonjs/web/constants.js.map +0 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +0 -163
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +0 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +0 -155
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +0 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -190
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +0 -821
- package/lib/commonjs/web/handlers/GestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +0 -65
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js +0 -2
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +0 -194
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -48
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -189
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +0 -530
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -165
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -173
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -286
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/web/interfaces.js +0 -40
- package/lib/commonjs/web/interfaces.js.map +0 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +0 -59
- package/lib/commonjs/web/tools/CircularBuffer.js.map +0 -1
- package/lib/commonjs/web/tools/EventManager.js +0 -133
- package/lib/commonjs/web/tools/EventManager.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +0 -6
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +0 -340
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +0 -217
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +0 -1
- package/lib/commonjs/web/tools/InteractionManager.js +0 -119
- package/lib/commonjs/web/tools/InteractionManager.js.map +0 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +0 -110
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +0 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +0 -204
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +0 -1
- package/lib/commonjs/web/tools/NodeManager.js +0 -49
- package/lib/commonjs/web/tools/NodeManager.js.map +0 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +0 -229
- package/lib/commonjs/web/tools/PointerEventManager.js.map +0 -1
- package/lib/commonjs/web/tools/PointerTracker.js +0 -234
- package/lib/commonjs/web/tools/PointerTracker.js.map +0 -1
- package/lib/commonjs/web/tools/Vector.js +0 -61
- package/lib/commonjs/web/tools/Vector.js.map +0 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +0 -111
- package/lib/commonjs/web/tools/VelocityTracker.js.map +0 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +0 -74
- package/lib/commonjs/web/tools/WheelEventManager.js.map +0 -1
- package/lib/commonjs/web/utils.js +0 -270
- package/lib/commonjs/web/utils.js.map +0 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +0 -105
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +0 -53
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/Errors.js +0 -16
- package/lib/commonjs/web_hammer/Errors.js.map +0 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +0 -170
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +0 -579
- package/lib/commonjs/web_hammer/GestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +0 -54
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +0 -71
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +0 -66
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/NodeManager.js +0 -48
- package/lib/commonjs/web_hammer/NodeManager.js.map +0 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +0 -208
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +0 -40
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +0 -188
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +0 -44
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +0 -192
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/constants.js +0 -64
- package/lib/commonjs/web_hammer/constants.js.map +0 -1
- package/lib/commonjs/web_hammer/utils.js +0 -42
- package/lib/commonjs/web_hammer/utils.js.map +0 -1
- package/lib/module/ActionType.js +0 -7
- package/lib/module/ActionType.js.map +0 -1
- package/lib/module/Directions.js +0 -19
- package/lib/module/Directions.js.map +0 -1
- package/lib/module/EnableNewWebImplementation.js +0 -35
- package/lib/module/EnableNewWebImplementation.js.map +0 -1
- package/lib/module/GestureHandlerRootViewContext.js +0 -3
- package/lib/module/GestureHandlerRootViewContext.js.map +0 -1
- package/lib/module/PlatformConstants.js +0 -5
- package/lib/module/PlatformConstants.js.map +0 -1
- package/lib/module/PlatformConstants.web.js +0 -7
- package/lib/module/PlatformConstants.web.js.map +0 -1
- package/lib/module/PointerType.js +0 -10
- package/lib/module/PointerType.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.js +0 -5
- package/lib/module/RNGestureHandlerModule.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.web.js +0 -98
- package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.windows.js +0 -47
- package/lib/module/RNGestureHandlerModule.windows.js.map +0 -1
- package/lib/module/RNRenderer.js +0 -4
- package/lib/module/RNRenderer.js.map +0 -1
- package/lib/module/RNRenderer.web.js +0 -4
- package/lib/module/RNRenderer.web.js.map +0 -1
- package/lib/module/State.js +0 -10
- package/lib/module/State.js.map +0 -1
- package/lib/module/TouchEventType.js +0 -8
- package/lib/module/TouchEventType.js.map +0 -1
- package/lib/module/components/DrawerLayout.js +0 -560
- package/lib/module/components/DrawerLayout.js.map +0 -1
- package/lib/module/components/GestureButtons.js +0 -237
- package/lib/module/components/GestureButtons.js.map +0 -1
- package/lib/module/components/GestureButtonsProps.js +0 -2
- package/lib/module/components/GestureButtonsProps.js.map +0 -1
- package/lib/module/components/GestureComponents.js +0 -90
- package/lib/module/components/GestureComponents.js.map +0 -1
- package/lib/module/components/GestureComponents.web.js +0 -28
- package/lib/module/components/GestureComponents.web.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.js +0 -3
- package/lib/module/components/GestureHandlerButton.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.web.js +0 -9
- package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.android.js +0 -27
- package/lib/module/components/GestureHandlerRootView.android.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.js +0 -26
- package/lib/module/components/GestureHandlerRootView.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.web.js +0 -21
- package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
- package/lib/module/components/Pressable/Pressable.js +0 -346
- package/lib/module/components/Pressable/Pressable.js.map +0 -1
- package/lib/module/components/Pressable/PressableProps.js +0 -2
- package/lib/module/components/Pressable/PressableProps.js.map +0 -1
- package/lib/module/components/Pressable/index.js +0 -2
- package/lib/module/components/Pressable/index.js.map +0 -1
- package/lib/module/components/Pressable/utils.js +0 -99
- package/lib/module/components/Pressable/utils.js.map +0 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +0 -369
- package/lib/module/components/ReanimatedDrawerLayout.js.map +0 -1
- package/lib/module/components/ReanimatedSwipeable.js +0 -350
- package/lib/module/components/ReanimatedSwipeable.js.map +0 -1
- package/lib/module/components/Swipeable.js +0 -398
- package/lib/module/components/Swipeable.js.map +0 -1
- package/lib/module/components/Text.js +0 -53
- package/lib/module/components/Text.js.map +0 -1
- package/lib/module/components/gestureHandlerRootHOC.js +0 -22
- package/lib/module/components/gestureHandlerRootHOC.js.map +0 -1
- package/lib/module/components/touchables/ExtraButtonProps.js +0 -2
- package/lib/module/components/touchables/ExtraButtonProps.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchable.js +0 -274
- package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchableProps.js +0 -2
- package/lib/module/components/touchables/GenericTouchableProps.js.map +0 -1
- package/lib/module/components/touchables/TouchableHighlight.js +0 -97
- package/lib/module/components/touchables/TouchableHighlight.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +0 -86
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +0 -8
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +0 -2
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
- package/lib/module/components/touchables/TouchableOpacity.js +0 -68
- package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -22
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/module/components/touchables/index.js +0 -5
- package/lib/module/components/touchables/index.js.map +0 -1
- package/lib/module/findNodeHandle.js +0 -3
- package/lib/module/findNodeHandle.js.map +0 -1
- package/lib/module/findNodeHandle.web.js +0 -39
- package/lib/module/findNodeHandle.web.js.map +0 -1
- package/lib/module/getShadowNodeFromRef.js +0 -45
- package/lib/module/getShadowNodeFromRef.js.map +0 -1
- package/lib/module/getShadowNodeFromRef.web.js +0 -8
- package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
- package/lib/module/ghQueueMicrotask.js +0 -4
- package/lib/module/ghQueueMicrotask.js.map +0 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -18
- package/lib/module/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +0 -35
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +0 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js +0 -2
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +0 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -20
- package/lib/module/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -19
- package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/handlers/PanGestureHandler.js +0 -114
- package/lib/module/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -21
- package/lib/module/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/module/handlers/PressabilityDebugView.js +0 -3
- package/lib/module/handlers/PressabilityDebugView.js.map +0 -1
- package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
- package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -21
- package/lib/module/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -20
- package/lib/module/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/handlers/createHandler.js +0 -460
- package/lib/module/handlers/createHandler.js.map +0 -1
- package/lib/module/handlers/createNativeWrapper.js +0 -75
- package/lib/module/handlers/createNativeWrapper.js.map +0 -1
- package/lib/module/handlers/customDirectEventTypes.js +0 -3
- package/lib/module/handlers/customDirectEventTypes.js.map +0 -1
- package/lib/module/handlers/customDirectEventTypes.web.js +0 -5
- package/lib/module/handlers/customDirectEventTypes.web.js.map +0 -1
- package/lib/module/handlers/gestureHandlerCommon.js +0 -19
- package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js +0 -2
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +0 -26
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +0 -32
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +0 -68
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -14
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +0 -118
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -18
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js +0 -2
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +0 -61
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -165
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -41
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +0 -39
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -36
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +0 -139
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +0 -1
- package/lib/module/handlers/gestures/eventReceiver.js +0 -131
- package/lib/module/handlers/gestures/eventReceiver.js.map +0 -1
- package/lib/module/handlers/gestures/flingGesture.js +0 -37
- package/lib/module/handlers/gestures/flingGesture.js.map +0 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +0 -73
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +0 -1
- package/lib/module/handlers/gestures/gesture.js +0 -362
- package/lib/module/handlers/gestures/gesture.js.map +0 -1
- package/lib/module/handlers/gestures/gestureComposition.js +0 -92
- package/lib/module/handlers/gestures/gestureComposition.js.map +0 -1
- package/lib/module/handlers/gestures/gestureObjects.js +0 -138
- package/lib/module/handlers/gestures/gestureObjects.js.map +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +0 -64
- package/lib/module/handlers/gestures/gestureStateManager.js.map +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -21
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +0 -1
- package/lib/module/handlers/gestures/hoverGesture.js +0 -62
- package/lib/module/handlers/gestures/hoverGesture.js.map +0 -1
- package/lib/module/handlers/gestures/longPressGesture.js +0 -47
- package/lib/module/handlers/gestures/longPressGesture.js.map +0 -1
- package/lib/module/handlers/gestures/manualGesture.js +0 -22
- package/lib/module/handlers/gestures/manualGesture.js.map +0 -1
- package/lib/module/handlers/gestures/nativeGesture.js +0 -34
- package/lib/module/handlers/gestures/nativeGesture.js.map +0 -1
- package/lib/module/handlers/gestures/panGesture.js +0 -216
- package/lib/module/handlers/gestures/panGesture.js.map +0 -1
- package/lib/module/handlers/gestures/pinchGesture.js +0 -36
- package/lib/module/handlers/gestures/pinchGesture.js.map +0 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -30
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +0 -1
- package/lib/module/handlers/gestures/rotationGesture.js +0 -36
- package/lib/module/handlers/gestures/rotationGesture.js.map +0 -1
- package/lib/module/handlers/gestures/tapGesture.js +0 -92
- package/lib/module/handlers/gestures/tapGesture.js.map +0 -1
- package/lib/module/handlers/getNextHandlerTag.js +0 -5
- package/lib/module/handlers/getNextHandlerTag.js.map +0 -1
- package/lib/module/handlers/handlersRegistry.js +0 -43
- package/lib/module/handlers/handlersRegistry.js.map +0 -1
- package/lib/module/handlers/utils.js +0 -71
- package/lib/module/handlers/utils.js.map +0 -1
- package/lib/module/index.js +0 -29
- package/lib/module/index.js.map +0 -1
- package/lib/module/init.js +0 -16
- package/lib/module/init.js.map +0 -1
- package/lib/module/jestUtils/index.js +0 -2
- package/lib/module/jestUtils/index.js.map +0 -1
- package/lib/module/jestUtils/jestUtils.js +0 -358
- package/lib/module/jestUtils/jestUtils.js.map +0 -1
- package/lib/module/mocks.js +0 -68
- package/lib/module/mocks.js.map +0 -1
- package/lib/module/mountRegistry.js +0 -40
- package/lib/module/mountRegistry.js.map +0 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js +0 -3
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +0 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +0 -3
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +0 -3
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
- package/lib/module/typeUtils.js +0 -2
- package/lib/module/typeUtils.js.map +0 -1
- package/lib/module/utils.js +0 -87
- package/lib/module/utils.js.map +0 -1
- package/lib/module/web/Gestures.js +0 -39
- package/lib/module/web/Gestures.js.map +0 -1
- package/lib/module/web/constants.js +0 -3
- package/lib/module/web/constants.js.map +0 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +0 -153
- package/lib/module/web/detectors/RotationGestureDetector.js.map +0 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +0 -144
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +0 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +0 -173
- package/lib/module/web/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/GestureHandler.js +0 -801
- package/lib/module/web/handlers/GestureHandler.js.map +0 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +0 -50
- package/lib/module/web/handlers/HoverGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/IGestureHandler.js +0 -2
- package/lib/module/web/handlers/IGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +0 -180
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -36
- package/lib/module/web/handlers/ManualGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -174
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/PanGestureHandler.js +0 -514
- package/lib/module/web/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +0 -150
- package/lib/module/web/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +0 -158
- package/lib/module/web/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/TapGestureHandler.js +0 -271
- package/lib/module/web/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/web/interfaces.js +0 -31
- package/lib/module/web/interfaces.js.map +0 -1
- package/lib/module/web/tools/CircularBuffer.js +0 -50
- package/lib/module/web/tools/CircularBuffer.js.map +0 -1
- package/lib/module/web/tools/EventManager.js +0 -124
- package/lib/module/web/tools/EventManager.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js +0 -2
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +0 -326
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +0 -199
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +0 -1
- package/lib/module/web/tools/InteractionManager.js +0 -110
- package/lib/module/web/tools/InteractionManager.js.map +0 -1
- package/lib/module/web/tools/KeyboardEventManager.js +0 -96
- package/lib/module/web/tools/KeyboardEventManager.js.map +0 -1
- package/lib/module/web/tools/LeastSquareSolver.js +0 -195
- package/lib/module/web/tools/LeastSquareSolver.js.map +0 -1
- package/lib/module/web/tools/NodeManager.js +0 -40
- package/lib/module/web/tools/NodeManager.js.map +0 -1
- package/lib/module/web/tools/PointerEventManager.js +0 -212
- package/lib/module/web/tools/PointerEventManager.js.map +0 -1
- package/lib/module/web/tools/PointerTracker.js +0 -221
- package/lib/module/web/tools/PointerTracker.js.map +0 -1
- package/lib/module/web/tools/Vector.js +0 -50
- package/lib/module/web/tools/Vector.js.map +0 -1
- package/lib/module/web/tools/VelocityTracker.js +0 -98
- package/lib/module/web/tools/VelocityTracker.js.map +0 -1
- package/lib/module/web/tools/WheelEventManager.js +0 -60
- package/lib/module/web/tools/WheelEventManager.js.map +0 -1
- package/lib/module/web/utils.js +0 -243
- package/lib/module/web/utils.js.map +0 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +0 -94
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +0 -40
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/Errors.js +0 -7
- package/lib/module/web_hammer/Errors.js.map +0 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +0 -156
- package/lib/module/web_hammer/FlingGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/GestureHandler.js +0 -563
- package/lib/module/web_hammer/GestureHandler.js.map +0 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +0 -44
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +0 -58
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +0 -49
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/NodeManager.js +0 -33
- package/lib/module/web_hammer/NodeManager.js.map +0 -1
- package/lib/module/web_hammer/PanGestureHandler.js +0 -194
- package/lib/module/web_hammer/PanGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +0 -29
- package/lib/module/web_hammer/PinchGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/PressGestureHandler.js +0 -174
- package/lib/module/web_hammer/PressGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +0 -32
- package/lib/module/web_hammer/RotationGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/TapGestureHandler.js +0 -180
- package/lib/module/web_hammer/TapGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/constants.js +0 -43
- package/lib/module/web_hammer/constants.js.map +0 -1
- package/lib/module/web_hammer/utils.js +0 -19
- package/lib/module/web_hammer/utils.js.map +0 -1
- package/lib/typescript/ActionType.d.ts +0 -7
- package/lib/typescript/Directions.d.ts +0 -14
- package/lib/typescript/EnableNewWebImplementation.d.ts +0 -9
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +0 -3
- package/lib/typescript/PlatformConstants.d.ts +0 -5
- package/lib/typescript/PlatformConstants.web.d.ts +0 -4
- package/lib/typescript/PointerType.d.ts +0 -7
- package/lib/typescript/RNGestureHandlerModule.d.ts +0 -2
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -15
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +0 -32
- package/lib/typescript/RNRenderer.d.ts +0 -1
- package/lib/typescript/RNRenderer.web.d.ts +0 -3
- package/lib/typescript/State.d.ts +0 -9
- package/lib/typescript/TouchEventType.d.ts +0 -8
- package/lib/typescript/components/DrawerLayout.d.ts +0 -185
- package/lib/typescript/components/GestureButtons.d.ts +0 -7
- package/lib/typescript/components/GestureButtonsProps.d.ts +0 -115
- package/lib/typescript/components/GestureComponents.d.ts +0 -22
- package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
- package/lib/typescript/components/GestureHandlerButton.d.ts +0 -4
- package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +0 -6
- package/lib/typescript/components/GestureHandlerRootView.d.ts +0 -6
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +0 -6
- package/lib/typescript/components/Pressable/Pressable.d.ts +0 -5
- package/lib/typescript/components/Pressable/PressableProps.d.ts +0 -109
- package/lib/typescript/components/Pressable/index.d.ts +0 -2
- package/lib/typescript/components/Pressable/utils.d.ts +0 -13
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +0 -167
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +0 -137
- package/lib/typescript/components/Swipeable.d.ts +0 -183
- package/lib/typescript/components/Text.d.ts +0 -4
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +0 -3
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +0 -7
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -55
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +0 -16
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +0 -41
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +0 -40
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +0 -6
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +0 -8
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -30
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -14
- package/lib/typescript/components/touchables/index.d.ts +0 -7
- package/lib/typescript/findNodeHandle.d.ts +0 -2
- package/lib/typescript/findNodeHandle.web.d.ts +0 -2
- package/lib/typescript/getShadowNodeFromRef.d.ts +0 -1
- package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
- package/lib/typescript/ghQueueMicrotask.d.ts +0 -1
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +0 -39
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +0 -44
- package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +0 -194
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +0 -36
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -33
- package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -100
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +0 -17
- package/lib/typescript/handlers/PressabilityDebugView.d.ts +0 -1
- package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +0 -17
- package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -62
- package/lib/typescript/handlers/createHandler.d.ts +0 -11
- package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -3
- package/lib/typescript/handlers/customDirectEventTypes.d.ts +0 -1
- package/lib/typescript/handlers/customDirectEventTypes.web.d.ts +0 -2
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -78
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +0 -43
- package/lib/typescript/handlers/gestures/GestureDetector/Wrap.d.ts +0 -13
- package/lib/typescript/handlers/gestures/GestureDetector/Wrap.web.d.ts +0 -7
- package/lib/typescript/handlers/gestures/GestureDetector/attachHandlers.d.ts +0 -13
- package/lib/typescript/handlers/gestures/GestureDetector/dropHandlers.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/index.d.ts +0 -49
- package/lib/typescript/handlers/gestures/GestureDetector/needsToReattach.d.ts +0 -3
- package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +0 -21
- package/lib/typescript/handlers/gestures/GestureDetector/updateHandlers.d.ts +0 -4
- package/lib/typescript/handlers/gestures/GestureDetector/useAnimatedGesture.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/useDetectorUpdater.d.ts +0 -5
- package/lib/typescript/handlers/gestures/GestureDetector/useMountReactions.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/useViewRefHandler.d.ts +0 -3
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +0 -13
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +0 -4
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +0 -21
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +0 -30
- package/lib/typescript/handlers/gestures/gesture.d.ts +0 -218
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +0 -21
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +0 -98
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +0 -11
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +0 -4
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +0 -27
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +0 -25
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +0 -7
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +0 -18
- package/lib/typescript/handlers/gestures/panGesture.d.ts +0 -90
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +0 -11
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +0 -14
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +0 -12
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +0 -50
- package/lib/typescript/handlers/getNextHandlerTag.d.ts +0 -1
- package/lib/typescript/handlers/handlersRegistry.d.ts +0 -14
- package/lib/typescript/handlers/utils.d.ts +0 -7
- package/lib/typescript/index.d.ts +0 -58
- package/lib/typescript/init.d.ts +0 -2
- package/lib/typescript/jestUtils/index.d.ts +0 -1
- package/lib/typescript/jestUtils/jestUtils.d.ts +0 -30
- package/lib/typescript/mocks.d.ts +0 -46
- package/lib/typescript/mountRegistry.d.ts +0 -17
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +0 -14
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +0 -17
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +0 -6
- package/lib/typescript/typeUtils.d.ts +0 -1
- package/lib/typescript/utils.d.ts +0 -20
- package/lib/typescript/web/Gestures.d.ts +0 -36
- package/lib/typescript/web/constants.d.ts +0 -2
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +0 -30
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +0 -29
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -26
- package/lib/typescript/web/handlers/GestureHandler.d.ts +0 -103
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +0 -10
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +0 -37
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +0 -31
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -10
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -26
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -61
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -28
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -28
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -38
- package/lib/typescript/web/interfaces.d.ts +0 -157
- package/lib/typescript/web/tools/CircularBuffer.d.ts +0 -11
- package/lib/typescript/web/tools/EventManager.d.ts +0 -39
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +0 -24
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +0 -31
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +0 -35
- package/lib/typescript/web/tools/InteractionManager.d.ts +0 -17
- package/lib/typescript/web/tools/KeyboardEventManager.d.ts +0 -13
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +0 -12
- package/lib/typescript/web/tools/NodeManager.d.ts +0 -12
- package/lib/typescript/web/tools/PointerEventManager.d.ts +0 -19
- package/lib/typescript/web/tools/PointerTracker.d.ts +0 -50
- package/lib/typescript/web/tools/Vector.d.ts +0 -15
- package/lib/typescript/web/tools/VelocityTracker.d.ts +0 -13
- package/lib/typescript/web/tools/WheelEventManager.d.ts +0 -11
- package/lib/typescript/web/utils.d.ts +0 -14
- package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +0 -20
- package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +0 -15
- package/lib/typescript/web_hammer/Errors.d.ts +0 -3
- package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +0 -43
- package/lib/typescript/web_hammer/GestureHandler.d.ts +0 -145
- package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +0 -40
- package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +0 -38
- package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +0 -7
- package/lib/typescript/web_hammer/NodeManager.d.ts +0 -7
- package/lib/typescript/web_hammer/PanGestureHandler.d.ts +0 -56
- package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +0 -13
- package/lib/typescript/web_hammer/PressGestureHandler.d.ts +0 -83
- package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +0 -13
- package/lib/typescript/web_hammer/TapGestureHandler.d.ts +0 -57
- package/lib/typescript/web_hammer/constants.d.ts +0 -39
- package/lib/typescript/web_hammer/utils.d.ts +0 -9
- /package/android/{common → noreanimated}/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +0 -0
@@ -1,460 +0,0 @@
|
|
1
|
-
var _UIManagerAny$getView;
|
2
|
-
|
3
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
-
|
5
|
-
import * as React from 'react';
|
6
|
-
import { Platform, UIManager, DeviceEventEmitter } from 'react-native';
|
7
|
-
import { customDirectEventTypes } from './customDirectEventTypes';
|
8
|
-
import RNGestureHandlerModule from '../RNGestureHandlerModule';
|
9
|
-
import { State } from '../State';
|
10
|
-
import { handlerIDToTag, registerOldGestureHandler, unregisterOldGestureHandler } from './handlersRegistry';
|
11
|
-
import { getNextHandlerTag } from './getNextHandlerTag';
|
12
|
-
import { filterConfig, scheduleFlushOperations } from './utils';
|
13
|
-
import findNodeHandle from '../findNodeHandle';
|
14
|
-
import { deepEqual, isFabric, isReact19, isTestEnv, tagMessage } from '../utils';
|
15
|
-
import { ActionType } from '../ActionType';
|
16
|
-
import { PressabilityDebugView } from './PressabilityDebugView';
|
17
|
-
import GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';
|
18
|
-
import { ghQueueMicrotask } from '../ghQueueMicrotask';
|
19
|
-
import { MountRegistry } from '../mountRegistry';
|
20
|
-
const UIManagerAny = UIManager;
|
21
|
-
customDirectEventTypes.topGestureHandlerEvent = {
|
22
|
-
registrationName: 'onGestureHandlerEvent'
|
23
|
-
};
|
24
|
-
const customGHEventsConfigFabricAndroid = {
|
25
|
-
topOnGestureHandlerEvent: {
|
26
|
-
registrationName: 'onGestureHandlerEvent'
|
27
|
-
},
|
28
|
-
topOnGestureHandlerStateChange: {
|
29
|
-
registrationName: 'onGestureHandlerStateChange'
|
30
|
-
}
|
31
|
-
};
|
32
|
-
const customGHEventsConfig = {
|
33
|
-
onGestureHandlerEvent: {
|
34
|
-
registrationName: 'onGestureHandlerEvent'
|
35
|
-
},
|
36
|
-
onGestureHandlerStateChange: {
|
37
|
-
registrationName: 'onGestureHandlerStateChange'
|
38
|
-
},
|
39
|
-
// When using React Native Gesture Handler for Animated.event with useNativeDriver: true
|
40
|
-
// on Android with Fabric enabled, the native part still sends the native events to JS
|
41
|
-
// but prefixed with "top". We cannot simply rename the events above so they are prefixed
|
42
|
-
// with "top" instead of "on" because in such case Animated.events would not be registered.
|
43
|
-
// That's why we need to register another pair of event names.
|
44
|
-
// The incoming events will be queued but never handled.
|
45
|
-
// Without this piece of code below, you'll get the following JS error:
|
46
|
-
// Unsupported top level event type "topOnGestureHandlerEvent" dispatched
|
47
|
-
...(isFabric() && Platform.OS === 'android' && customGHEventsConfigFabricAndroid)
|
48
|
-
}; // Add gesture specific events to genericDirectEventTypes object exported from UIManager
|
49
|
-
// native module.
|
50
|
-
// Once new event types are registered with react it is possible to dispatch these
|
51
|
-
// events to all kind of native views.
|
52
|
-
|
53
|
-
UIManagerAny.genericDirectEventTypes = { ...UIManagerAny.genericDirectEventTypes,
|
54
|
-
...customGHEventsConfig
|
55
|
-
};
|
56
|
-
const UIManagerConstants = (_UIManagerAny$getView = UIManagerAny.getViewManagerConfig) === null || _UIManagerAny$getView === void 0 ? void 0 : _UIManagerAny$getView.call(UIManagerAny, 'getConstants');
|
57
|
-
|
58
|
-
if (UIManagerConstants) {
|
59
|
-
UIManagerConstants.genericDirectEventTypes = { ...UIManagerConstants.genericDirectEventTypes,
|
60
|
-
...customGHEventsConfig
|
61
|
-
};
|
62
|
-
} // Wrap JS responder calls and notify gesture handler manager
|
63
|
-
|
64
|
-
|
65
|
-
const {
|
66
|
-
setJSResponder: oldSetJSResponder = () => {// no-op
|
67
|
-
},
|
68
|
-
clearJSResponder: oldClearJSResponder = () => {// no-op
|
69
|
-
}
|
70
|
-
} = UIManagerAny;
|
71
|
-
|
72
|
-
UIManagerAny.setJSResponder = (tag, blockNativeResponder) => {
|
73
|
-
RNGestureHandlerModule.handleSetJSResponder(tag, blockNativeResponder);
|
74
|
-
oldSetJSResponder(tag, blockNativeResponder);
|
75
|
-
};
|
76
|
-
|
77
|
-
UIManagerAny.clearJSResponder = () => {
|
78
|
-
RNGestureHandlerModule.handleClearJSResponder();
|
79
|
-
oldClearJSResponder();
|
80
|
-
};
|
81
|
-
|
82
|
-
let allowTouches = true;
|
83
|
-
const DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android'; // Toggled inspector blocks touch events in order to allow inspecting on Android
|
84
|
-
// This needs to be a global variable in order to set initial state for `allowTouches` property in Handler component
|
85
|
-
|
86
|
-
if (DEV_ON_ANDROID) {
|
87
|
-
DeviceEventEmitter.addListener('toggleElementInspector', () => {
|
88
|
-
allowTouches = !allowTouches;
|
89
|
-
});
|
90
|
-
}
|
91
|
-
|
92
|
-
function hasUnresolvedRefs(props) {
|
93
|
-
// TODO(TS) - add type for extract arg
|
94
|
-
const extract = refs => {
|
95
|
-
if (!Array.isArray(refs)) {
|
96
|
-
return refs && refs.current === null;
|
97
|
-
}
|
98
|
-
|
99
|
-
return refs.some(r => r && r.current === null);
|
100
|
-
};
|
101
|
-
|
102
|
-
return extract(props['simultaneousHandlers']) || extract(props['waitFor']);
|
103
|
-
}
|
104
|
-
|
105
|
-
const stateToPropMappings = {
|
106
|
-
[State.UNDETERMINED]: undefined,
|
107
|
-
[State.BEGAN]: 'onBegan',
|
108
|
-
[State.FAILED]: 'onFailed',
|
109
|
-
[State.CANCELLED]: 'onCancelled',
|
110
|
-
[State.ACTIVE]: 'onActivated',
|
111
|
-
[State.END]: 'onEnded'
|
112
|
-
};
|
113
|
-
const UNRESOLVED_REFS_RETRY_LIMIT = 1; // TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.
|
114
|
-
|
115
|
-
export default function createHandler({
|
116
|
-
name,
|
117
|
-
allowedProps = [],
|
118
|
-
config = {},
|
119
|
-
transformProps,
|
120
|
-
customNativeProps = []
|
121
|
-
}) {
|
122
|
-
class Handler extends React.Component {
|
123
|
-
constructor(props) {
|
124
|
-
super(props);
|
125
|
-
|
126
|
-
_defineProperty(this, "handlerTag", -1);
|
127
|
-
|
128
|
-
_defineProperty(this, "config", void 0);
|
129
|
-
|
130
|
-
_defineProperty(this, "propsRef", void 0);
|
131
|
-
|
132
|
-
_defineProperty(this, "isMountedRef", void 0);
|
133
|
-
|
134
|
-
_defineProperty(this, "viewNode", void 0);
|
135
|
-
|
136
|
-
_defineProperty(this, "viewTag", void 0);
|
137
|
-
|
138
|
-
_defineProperty(this, "inspectorToggleListener", void 0);
|
139
|
-
|
140
|
-
_defineProperty(this, "onGestureHandlerEvent", event => {
|
141
|
-
if (event.nativeEvent.handlerTag === this.handlerTag) {
|
142
|
-
if (typeof this.props.onGestureEvent === 'function') {
|
143
|
-
var _this$props$onGesture, _this$props;
|
144
|
-
|
145
|
-
(_this$props$onGesture = (_this$props = this.props).onGestureEvent) === null || _this$props$onGesture === void 0 ? void 0 : _this$props$onGesture.call(_this$props, event);
|
146
|
-
}
|
147
|
-
} else {
|
148
|
-
var _this$props$onGesture2, _this$props2;
|
149
|
-
|
150
|
-
(_this$props$onGesture2 = (_this$props2 = this.props).onGestureHandlerEvent) === null || _this$props$onGesture2 === void 0 ? void 0 : _this$props$onGesture2.call(_this$props2, event);
|
151
|
-
}
|
152
|
-
});
|
153
|
-
|
154
|
-
_defineProperty(this, "onGestureHandlerStateChange", event => {
|
155
|
-
if (event.nativeEvent.handlerTag === this.handlerTag) {
|
156
|
-
if (typeof this.props.onHandlerStateChange === 'function') {
|
157
|
-
var _this$props$onHandler, _this$props3;
|
158
|
-
|
159
|
-
(_this$props$onHandler = (_this$props3 = this.props).onHandlerStateChange) === null || _this$props$onHandler === void 0 ? void 0 : _this$props$onHandler.call(_this$props3, event);
|
160
|
-
}
|
161
|
-
|
162
|
-
const state = event.nativeEvent.state;
|
163
|
-
const stateEventName = stateToPropMappings[state];
|
164
|
-
const eventHandler = stateEventName && this.props[stateEventName];
|
165
|
-
|
166
|
-
if (eventHandler && typeof eventHandler === 'function') {
|
167
|
-
eventHandler(event);
|
168
|
-
}
|
169
|
-
} else {
|
170
|
-
var _this$props$onGesture3, _this$props4;
|
171
|
-
|
172
|
-
(_this$props$onGesture3 = (_this$props4 = this.props).onGestureHandlerStateChange) === null || _this$props$onGesture3 === void 0 ? void 0 : _this$props$onGesture3.call(_this$props4, event);
|
173
|
-
}
|
174
|
-
});
|
175
|
-
|
176
|
-
_defineProperty(this, "refHandler", node => {
|
177
|
-
var _props;
|
178
|
-
|
179
|
-
this.viewNode = node;
|
180
|
-
const child = React.Children.only(this.props.children); // @ts-ignore Since React 19 ref is accessible as standard prop
|
181
|
-
// https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref
|
182
|
-
|
183
|
-
const ref = isReact19() ? (_props = child.props) === null || _props === void 0 ? void 0 : _props.ref : child === null || child === void 0 ? void 0 : child.ref;
|
184
|
-
|
185
|
-
if (!ref) {
|
186
|
-
return;
|
187
|
-
}
|
188
|
-
|
189
|
-
if (typeof ref === 'function') {
|
190
|
-
ref(node);
|
191
|
-
} else {
|
192
|
-
ref.current = node;
|
193
|
-
}
|
194
|
-
});
|
195
|
-
|
196
|
-
_defineProperty(this, "createGestureHandler", newConfig => {
|
197
|
-
this.handlerTag = getNextHandlerTag();
|
198
|
-
this.config = newConfig;
|
199
|
-
RNGestureHandlerModule.createGestureHandler(name, this.handlerTag, newConfig);
|
200
|
-
});
|
201
|
-
|
202
|
-
_defineProperty(this, "attachGestureHandler", newViewTag => {
|
203
|
-
this.viewTag = newViewTag;
|
204
|
-
|
205
|
-
if (Platform.OS === 'web') {
|
206
|
-
// Typecast due to dynamic resolution, attachGestureHandler should have web version signature in this branch
|
207
|
-
RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, ActionType.JS_FUNCTION_OLD_API, // ignored on web
|
208
|
-
this.propsRef);
|
209
|
-
} else {
|
210
|
-
registerOldGestureHandler(this.handlerTag, {
|
211
|
-
onGestureEvent: this.onGestureHandlerEvent,
|
212
|
-
onGestureStateChange: this.onGestureHandlerStateChange
|
213
|
-
});
|
214
|
-
|
215
|
-
const actionType = (() => {
|
216
|
-
var _this$props5, _this$props6;
|
217
|
-
|
218
|
-
const onGestureEvent = (_this$props5 = this.props) === null || _this$props5 === void 0 ? void 0 : _this$props5.onGestureEvent;
|
219
|
-
const isGestureHandlerWorklet = onGestureEvent && ('current' in onGestureEvent || 'workletEventHandler' in onGestureEvent);
|
220
|
-
const onHandlerStateChange = (_this$props6 = this.props) === null || _this$props6 === void 0 ? void 0 : _this$props6.onHandlerStateChange;
|
221
|
-
const isStateChangeHandlerWorklet = onHandlerStateChange && ('current' in onHandlerStateChange || 'workletEventHandler' in onHandlerStateChange);
|
222
|
-
const isReanimatedHandler = isGestureHandlerWorklet || isStateChangeHandlerWorklet;
|
223
|
-
|
224
|
-
if (isReanimatedHandler) {
|
225
|
-
// Reanimated worklet
|
226
|
-
return ActionType.REANIMATED_WORKLET;
|
227
|
-
} else if (onGestureEvent && '__isNative' in onGestureEvent) {
|
228
|
-
// Animated.event with useNativeDriver: true
|
229
|
-
return ActionType.NATIVE_ANIMATED_EVENT;
|
230
|
-
} else {
|
231
|
-
// JS callback or Animated.event with useNativeDriver: false
|
232
|
-
return ActionType.JS_FUNCTION_OLD_API;
|
233
|
-
}
|
234
|
-
})();
|
235
|
-
|
236
|
-
RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, actionType);
|
237
|
-
}
|
238
|
-
|
239
|
-
scheduleFlushOperations();
|
240
|
-
ghQueueMicrotask(() => {
|
241
|
-
MountRegistry.gestureHandlerWillMount(this);
|
242
|
-
});
|
243
|
-
});
|
244
|
-
|
245
|
-
_defineProperty(this, "updateGestureHandler", newConfig => {
|
246
|
-
this.config = newConfig;
|
247
|
-
RNGestureHandlerModule.updateGestureHandler(this.handlerTag, newConfig);
|
248
|
-
scheduleFlushOperations();
|
249
|
-
});
|
250
|
-
|
251
|
-
this.config = {};
|
252
|
-
this.propsRef = /*#__PURE__*/React.createRef();
|
253
|
-
this.isMountedRef = /*#__PURE__*/React.createRef();
|
254
|
-
this.state = {
|
255
|
-
allowTouches
|
256
|
-
};
|
257
|
-
|
258
|
-
if (props.id) {
|
259
|
-
if (handlerIDToTag[props.id] !== undefined) {
|
260
|
-
throw new Error(`Handler with ID "${props.id}" already registered`);
|
261
|
-
}
|
262
|
-
|
263
|
-
handlerIDToTag[props.id] = this.handlerTag;
|
264
|
-
}
|
265
|
-
}
|
266
|
-
|
267
|
-
componentDidMount() {
|
268
|
-
const props = this.props;
|
269
|
-
this.isMountedRef.current = true;
|
270
|
-
|
271
|
-
if (DEV_ON_ANDROID) {
|
272
|
-
this.inspectorToggleListener = DeviceEventEmitter.addListener('toggleElementInspector', () => {
|
273
|
-
this.setState(_ => ({
|
274
|
-
allowTouches
|
275
|
-
}));
|
276
|
-
this.update(UNRESOLVED_REFS_RETRY_LIMIT);
|
277
|
-
});
|
278
|
-
}
|
279
|
-
|
280
|
-
if (hasUnresolvedRefs(props)) {
|
281
|
-
// If there are unresolved refs (e.g. ".current" has not yet been set)
|
282
|
-
// passed as `simultaneousHandlers` or `waitFor`, we enqueue a call to
|
283
|
-
// _update method that will try to update native handler props using
|
284
|
-
// queueMicrotask. This makes it so update() function gets called after all
|
285
|
-
// react components are mounted and we expect the missing ref object to
|
286
|
-
// be resolved by then.
|
287
|
-
ghQueueMicrotask(() => {
|
288
|
-
this.update(UNRESOLVED_REFS_RETRY_LIMIT);
|
289
|
-
});
|
290
|
-
}
|
291
|
-
|
292
|
-
this.createGestureHandler(filterConfig(transformProps ? transformProps(this.props) : this.props, [...allowedProps, ...customNativeProps], config));
|
293
|
-
|
294
|
-
if (!this.viewNode) {
|
295
|
-
throw new Error(`[Gesture Handler] Failed to obtain view for ${Handler.displayName}. Note that old API doesn't support functional components.`);
|
296
|
-
}
|
297
|
-
|
298
|
-
this.attachGestureHandler(findNodeHandle(this.viewNode)); // TODO(TS) - check if this can be null
|
299
|
-
}
|
300
|
-
|
301
|
-
componentDidUpdate() {
|
302
|
-
const viewTag = findNodeHandle(this.viewNode);
|
303
|
-
|
304
|
-
if (this.viewTag !== viewTag) {
|
305
|
-
this.attachGestureHandler(viewTag); // TODO(TS) - check interaction between _viewTag & findNodeHandle
|
306
|
-
}
|
307
|
-
|
308
|
-
this.update(UNRESOLVED_REFS_RETRY_LIMIT);
|
309
|
-
}
|
310
|
-
|
311
|
-
componentWillUnmount() {
|
312
|
-
var _this$inspectorToggle;
|
313
|
-
|
314
|
-
(_this$inspectorToggle = this.inspectorToggleListener) === null || _this$inspectorToggle === void 0 ? void 0 : _this$inspectorToggle.remove();
|
315
|
-
this.isMountedRef.current = false;
|
316
|
-
|
317
|
-
if (Platform.OS !== 'web') {
|
318
|
-
unregisterOldGestureHandler(this.handlerTag);
|
319
|
-
}
|
320
|
-
|
321
|
-
RNGestureHandlerModule.dropGestureHandler(this.handlerTag);
|
322
|
-
scheduleFlushOperations(); // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context
|
323
|
-
|
324
|
-
const handlerID = this.props.id;
|
325
|
-
|
326
|
-
if (handlerID) {
|
327
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
328
|
-
delete handlerIDToTag[handlerID];
|
329
|
-
}
|
330
|
-
|
331
|
-
MountRegistry.gestureHandlerWillUnmount(this);
|
332
|
-
}
|
333
|
-
|
334
|
-
update(remainingTries) {
|
335
|
-
if (!this.isMountedRef.current) {
|
336
|
-
return;
|
337
|
-
}
|
338
|
-
|
339
|
-
const props = this.props; // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of
|
340
|
-
// `ref={refObject}` it's possible that it won't be resolved in time. Seems like trying
|
341
|
-
// again is easy enough fix.
|
342
|
-
|
343
|
-
if (hasUnresolvedRefs(props) && remainingTries > 0) {
|
344
|
-
ghQueueMicrotask(() => {
|
345
|
-
this.update(remainingTries - 1);
|
346
|
-
});
|
347
|
-
} else {
|
348
|
-
const newConfig = filterConfig(transformProps ? transformProps(this.props) : this.props, [...allowedProps, ...customNativeProps], config);
|
349
|
-
|
350
|
-
if (!deepEqual(this.config, newConfig)) {
|
351
|
-
this.updateGestureHandler(newConfig);
|
352
|
-
}
|
353
|
-
}
|
354
|
-
}
|
355
|
-
|
356
|
-
setNativeProps(updates) {
|
357
|
-
const mergedProps = { ...this.props,
|
358
|
-
...updates
|
359
|
-
};
|
360
|
-
const newConfig = filterConfig(transformProps ? transformProps(mergedProps) : mergedProps, [...allowedProps, ...customNativeProps], config);
|
361
|
-
this.updateGestureHandler(newConfig);
|
362
|
-
}
|
363
|
-
|
364
|
-
render() {
|
365
|
-
var _this$props$testID;
|
366
|
-
|
367
|
-
if (__DEV__ && !this.context && !isTestEnv() && Platform.OS !== 'web') {
|
368
|
-
throw new Error(name + ' must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.');
|
369
|
-
}
|
370
|
-
|
371
|
-
let gestureEventHandler = this.onGestureHandlerEvent; // Another instance of https://github.com/microsoft/TypeScript/issues/13995
|
372
|
-
|
373
|
-
const {
|
374
|
-
onGestureEvent,
|
375
|
-
onGestureHandlerEvent
|
376
|
-
} = this.props;
|
377
|
-
|
378
|
-
if (onGestureEvent && typeof onGestureEvent !== 'function') {
|
379
|
-
// If it's not a method it should be an native Animated.event
|
380
|
-
// object. We set it directly as the handler for the view
|
381
|
-
// In this case nested handlers are not going to be supported
|
382
|
-
if (onGestureHandlerEvent) {
|
383
|
-
throw new Error('Nesting touch handlers with native animated driver is not supported yet');
|
384
|
-
}
|
385
|
-
|
386
|
-
gestureEventHandler = onGestureEvent;
|
387
|
-
} else {
|
388
|
-
if (onGestureHandlerEvent && typeof onGestureHandlerEvent !== 'function') {
|
389
|
-
throw new Error('Nesting touch handlers with native animated driver is not supported yet');
|
390
|
-
}
|
391
|
-
}
|
392
|
-
|
393
|
-
let gestureStateEventHandler = this.onGestureHandlerStateChange; // Another instance of https://github.com/microsoft/TypeScript/issues/13995
|
394
|
-
|
395
|
-
const {
|
396
|
-
onHandlerStateChange,
|
397
|
-
onGestureHandlerStateChange
|
398
|
-
} = this.props;
|
399
|
-
|
400
|
-
if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') {
|
401
|
-
// If it's not a method it should be an native Animated.event
|
402
|
-
// object. We set it directly as the handler for the view
|
403
|
-
// In this case nested handlers are not going to be supported
|
404
|
-
if (onGestureHandlerStateChange) {
|
405
|
-
throw new Error('Nesting touch handlers with native animated driver is not supported yet');
|
406
|
-
}
|
407
|
-
|
408
|
-
gestureStateEventHandler = onHandlerStateChange;
|
409
|
-
} else {
|
410
|
-
if (onGestureHandlerStateChange && typeof onGestureHandlerStateChange !== 'function') {
|
411
|
-
throw new Error('Nesting touch handlers with native animated driver is not supported yet');
|
412
|
-
}
|
413
|
-
}
|
414
|
-
|
415
|
-
const events = {
|
416
|
-
onGestureHandlerEvent: this.state.allowTouches ? gestureEventHandler : undefined,
|
417
|
-
onGestureHandlerStateChange: this.state.allowTouches ? gestureStateEventHandler : undefined
|
418
|
-
};
|
419
|
-
this.propsRef.current = events;
|
420
|
-
let child = null;
|
421
|
-
|
422
|
-
try {
|
423
|
-
child = React.Children.only(this.props.children);
|
424
|
-
} catch (e) {
|
425
|
-
throw new Error(tagMessage(`${name} got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
|
426
|
-
}
|
427
|
-
|
428
|
-
let grandChildren = child.props.children;
|
429
|
-
|
430
|
-
if (__DEV__ && child.type && (child.type === 'RNGestureHandlerButton' || child.type.name === 'View' || child.type.displayName === 'View')) {
|
431
|
-
grandChildren = React.Children.toArray(grandChildren);
|
432
|
-
grandChildren.push( /*#__PURE__*/React.createElement(PressabilityDebugView, {
|
433
|
-
key: "pressabilityDebugView",
|
434
|
-
color: "mediumspringgreen",
|
435
|
-
hitSlop: child.props.hitSlop
|
436
|
-
}));
|
437
|
-
}
|
438
|
-
|
439
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
440
|
-
ref: this.refHandler,
|
441
|
-
collapsable: false,
|
442
|
-
...(isTestEnv() ? {
|
443
|
-
handlerType: name,
|
444
|
-
handlerTag: this.handlerTag,
|
445
|
-
enabled: this.props.enabled
|
446
|
-
} : {}),
|
447
|
-
testID: (_this$props$testID = this.props.testID) !== null && _this$props$testID !== void 0 ? _this$props$testID : child.props.testID,
|
448
|
-
...events
|
449
|
-
}, grandChildren);
|
450
|
-
}
|
451
|
-
|
452
|
-
}
|
453
|
-
|
454
|
-
_defineProperty(Handler, "displayName", name);
|
455
|
-
|
456
|
-
_defineProperty(Handler, "contextType", GestureHandlerRootViewContext);
|
457
|
-
|
458
|
-
return Handler;
|
459
|
-
}
|
460
|
-
//# sourceMappingURL=createHandler.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["createHandler.tsx"],"names":["React","Platform","UIManager","DeviceEventEmitter","customDirectEventTypes","RNGestureHandlerModule","State","handlerIDToTag","registerOldGestureHandler","unregisterOldGestureHandler","getNextHandlerTag","filterConfig","scheduleFlushOperations","findNodeHandle","deepEqual","isFabric","isReact19","isTestEnv","tagMessage","ActionType","PressabilityDebugView","GestureHandlerRootViewContext","ghQueueMicrotask","MountRegistry","UIManagerAny","topGestureHandlerEvent","registrationName","customGHEventsConfigFabricAndroid","topOnGestureHandlerEvent","topOnGestureHandlerStateChange","customGHEventsConfig","onGestureHandlerEvent","onGestureHandlerStateChange","OS","genericDirectEventTypes","UIManagerConstants","getViewManagerConfig","setJSResponder","oldSetJSResponder","clearJSResponder","oldClearJSResponder","tag","blockNativeResponder","handleSetJSResponder","handleClearJSResponder","allowTouches","DEV_ON_ANDROID","__DEV__","addListener","hasUnresolvedRefs","props","extract","refs","Array","isArray","current","some","r","stateToPropMappings","UNDETERMINED","undefined","BEGAN","FAILED","CANCELLED","ACTIVE","END","UNRESOLVED_REFS_RETRY_LIMIT","createHandler","name","allowedProps","config","transformProps","customNativeProps","Handler","Component","constructor","event","nativeEvent","handlerTag","onGestureEvent","onHandlerStateChange","state","stateEventName","eventHandler","node","viewNode","child","Children","only","children","ref","newConfig","createGestureHandler","newViewTag","viewTag","attachGestureHandler","JS_FUNCTION_OLD_API","propsRef","onGestureStateChange","actionType","isGestureHandlerWorklet","isStateChangeHandlerWorklet","isReanimatedHandler","REANIMATED_WORKLET","NATIVE_ANIMATED_EVENT","gestureHandlerWillMount","updateGestureHandler","createRef","isMountedRef","id","Error","componentDidMount","inspectorToggleListener","setState","_","update","displayName","componentDidUpdate","componentWillUnmount","remove","dropGestureHandler","handlerID","gestureHandlerWillUnmount","remainingTries","setNativeProps","updates","mergedProps","render","context","gestureEventHandler","gestureStateEventHandler","events","e","grandChildren","type","toArray","push","hitSlop","cloneElement","refHandler","collapsable","handlerType","enabled","testID"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,SAFF,EAGEC,kBAHF,QAKO,cALP;AAMA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,OAAOC,sBAAP,MAAmC,2BAAnC;AACA,SAASC,KAAT,QAAsB,UAAtB;AACA,SACEC,cADF,EAEEC,yBAFF,EAGEC,2BAHF,QAIO,oBAJP;AAKA,SAASC,iBAAT,QAAkC,qBAAlC;AAOA,SAASC,YAAT,EAAuBC,uBAAvB,QAAsD,SAAtD;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AAEA,SACEC,SADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,SAJF,EAKEC,UALF,QAMO,UANP;AAOA,SAASC,UAAT,QAA2B,eAA3B;AACA,SAASC,qBAAT,QAAsC,yBAAtC;AACA,OAAOC,6BAAP,MAA0C,kCAA1C;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,aAAT,Q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AAIiE,aAAa,GAAG/C,KAAK,CAACpC,KAAN,CAAYuC,QAAhC;;AACA,UACE1C,OAAO,IACPuC,KAAK,CAACgD,IADN,KAEChD,KAAK,CAACgD,IAAN,KAAe,wBAAf,IACChD,KAAK,CAACgD,IAAN,CAAWlE,IAAX,KAAoB,MADrB,IAECkB,KAAK,CAACgD,IAAN,CAAWlB,WAAX,KAA2B,MAJ7B,CADF,EAME;AACAiB,QAAAA,aAAa,GAAGrI,KAAK,CAACuF,QAAN,CAAegD,OAAf,CAAuBF,aAAvB,CAAhB;AACAA,QAAAA,aAAa,CAACG,IAAd,eACE,oBAAC,qBAAD;AACE,UAAA,GAAG,EAAC,uBADN;AAEE,UAAA,KAAK,EAAC,mBAFR;AAGE,UAAA,OAAO,EAAElD,KAAK,CAACpC,KAAN,CAAYuF;AAHvB,UADF;AAOD;;AAED,0BAAOzI,KAAK,CAAC0I,YAAN,CACLpD,KADK,EAEL;AACEI,QAAAA,GAAG,EAAE,KAAKiD,UADZ;AAEEC,QAAAA,WAAW,EAAE,KAFf;AAGE,YAAI3H,SAAS,KACT;AACE4H,UAAAA,WAAW,EAAEzE,IADf;AAEEU,UAAAA,UAAU,EAAE,KAAKA,UAFnB;AAGEgE,UAAAA,OAAO,EAAE,KAAK5F,KAAL,CAAW4F;AAHtB,SADS,GAMT,EANJ,CAHF;AAUEC,QAAAA,MAAM,wBAAE,KAAK7F,KAAL,CAAW6F,MAAb,mEAAuBzD,KAAK,CAACpC,KAAN,CAAY6F,MAV3C;AAWE,WAAGZ;AAXL,OAFK,EAeLE,aAfK,CAAP;AAiBD;;AA/XD;;AAPwE,kBAIpE5D,OAJoE,iBAQnDL,IARmD;;AAAA,kBAIpEK,OAJoE,iBASnDpD,6BATmD;;AAwY1E,SAAOoD,OAAP;AACD","sourcesContent":["import * as React from 'react';\nimport {\n Platform,\n UIManager,\n DeviceEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { customDirectEventTypes } from './customDirectEventTypes';\nimport RNGestureHandlerModule from '../RNGestureHandlerModule';\nimport { State } from '../State';\nimport {\n handlerIDToTag,\n registerOldGestureHandler,\n unregisterOldGestureHandler,\n} from './handlersRegistry';\nimport { getNextHandlerTag } from './getNextHandlerTag';\n\nimport {\n BaseGestureHandlerProps,\n GestureEvent,\n HandlerStateChangeEvent,\n} from './gestureHandlerCommon';\nimport { filterConfig, scheduleFlushOperations } from './utils';\nimport findNodeHandle from '../findNodeHandle';\nimport { ValueOf } from '../typeUtils';\nimport {\n deepEqual,\n isFabric,\n isReact19,\n isTestEnv,\n tagMessage,\n} from '../utils';\nimport { ActionType } from '../ActionType';\nimport { PressabilityDebugView } from './PressabilityDebugView';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\nimport { ghQueueMicrotask } from '../ghQueueMicrotask';\nimport { MountRegistry } from '../mountRegistry';\nimport { ReactElement } from 'react';\n\nconst UIManagerAny = UIManager as any;\n\ncustomDirectEventTypes.topGestureHandlerEvent = {\n registrationName: 'onGestureHandlerEvent',\n};\n\nconst customGHEventsConfigFabricAndroid = {\n topOnGestureHandlerEvent: { registrationName: 'onGestureHandlerEvent' },\n topOnGestureHandlerStateChange: {\n registrationName: 'onGestureHandlerStateChange',\n },\n};\n\nconst customGHEventsConfig = {\n onGestureHandlerEvent: { registrationName: 'onGestureHandlerEvent' },\n onGestureHandlerStateChange: {\n registrationName: 'onGestureHandlerStateChange',\n },\n\n // When using React Native Gesture Handler for Animated.event with useNativeDriver: true\n // on Android with Fabric enabled, the native part still sends the native events to JS\n // but prefixed with \"top\". We cannot simply rename the events above so they are prefixed\n // with \"top\" instead of \"on\" because in such case Animated.events would not be registered.\n // That's why we need to register another pair of event names.\n // The incoming events will be queued but never handled.\n // Without this piece of code below, you'll get the following JS error:\n // Unsupported top level event type \"topOnGestureHandlerEvent\" dispatched\n ...(isFabric() &&\n Platform.OS === 'android' &&\n customGHEventsConfigFabricAndroid),\n};\n\n// Add gesture specific events to genericDirectEventTypes object exported from UIManager\n// native module.\n// Once new event types are registered with react it is possible to dispatch these\n// events to all kind of native views.\nUIManagerAny.genericDirectEventTypes = {\n ...UIManagerAny.genericDirectEventTypes,\n ...customGHEventsConfig,\n};\n\nconst UIManagerConstants = UIManagerAny.getViewManagerConfig?.('getConstants');\n\nif (UIManagerConstants) {\n UIManagerConstants.genericDirectEventTypes = {\n ...UIManagerConstants.genericDirectEventTypes,\n ...customGHEventsConfig,\n };\n}\n\n// Wrap JS responder calls and notify gesture handler manager\nconst {\n setJSResponder: oldSetJSResponder = () => {\n // no-op\n },\n clearJSResponder: oldClearJSResponder = () => {\n // no-op\n },\n} = UIManagerAny;\nUIManagerAny.setJSResponder = (tag: number, blockNativeResponder: boolean) => {\n RNGestureHandlerModule.handleSetJSResponder(tag, blockNativeResponder);\n oldSetJSResponder(tag, blockNativeResponder);\n};\nUIManagerAny.clearJSResponder = () => {\n RNGestureHandlerModule.handleClearJSResponder();\n oldClearJSResponder();\n};\n\nlet allowTouches = true;\nconst DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android';\n// Toggled inspector blocks touch events in order to allow inspecting on Android\n// This needs to be a global variable in order to set initial state for `allowTouches` property in Handler component\nif (DEV_ON_ANDROID) {\n DeviceEventEmitter.addListener('toggleElementInspector', () => {\n allowTouches = !allowTouches;\n });\n}\n\ntype HandlerProps<T extends Record<string, unknown>> = Readonly<\n React.PropsWithChildren<BaseGestureHandlerProps<T>>\n>;\nfunction hasUnresolvedRefs<T extends Record<string, unknown>>(\n props: HandlerProps<T>\n) {\n // TODO(TS) - add type for extract arg\n const extract = (refs: any | any[]) => {\n if (!Array.isArray(refs)) {\n return refs && refs.current === null;\n }\n return refs.some((r) => r && r.current === null);\n };\n return extract(props['simultaneousHandlers']) || extract(props['waitFor']);\n}\n\nconst stateToPropMappings = {\n [State.UNDETERMINED]: undefined,\n [State.BEGAN]: 'onBegan',\n [State.FAILED]: 'onFailed',\n [State.CANCELLED]: 'onCancelled',\n [State.ACTIVE]: 'onActivated',\n [State.END]: 'onEnded',\n} as const;\n\ntype CreateHandlerArgs<HandlerPropsT extends Record<string, unknown>> =\n Readonly<{\n name: string;\n allowedProps: Readonly<Extract<keyof HandlerPropsT, string>[]>;\n config: Readonly<Record<string, unknown>>;\n transformProps?: (props: HandlerPropsT) => HandlerPropsT;\n customNativeProps?: Readonly<string[]>;\n }>;\n\n// TODO(TS) fix event types\ntype InternalEventHandlers = {\n onGestureHandlerEvent?: (event: any) => void;\n onGestureHandlerStateChange?: (event: any) => void;\n};\n\ntype AttachGestureHandlerWeb = (\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n) => void;\n\nconst UNRESOLVED_REFS_RETRY_LIMIT = 1;\n\n// TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.\nexport default function createHandler<\n T extends BaseGestureHandlerProps<U>,\n U extends Record<string, unknown>,\n>({\n name,\n allowedProps = [],\n config = {},\n transformProps,\n customNativeProps = [],\n}: CreateHandlerArgs<T>): React.ComponentType<T & React.RefAttributes<any>> {\n interface HandlerState {\n allowTouches: boolean;\n }\n class Handler extends React.Component<\n T & InternalEventHandlers,\n HandlerState\n > {\n static displayName = name;\n static contextType = GestureHandlerRootViewContext;\n\n private handlerTag = -1;\n private config: Record<string, unknown>;\n private propsRef: React.MutableRefObject<unknown>;\n private isMountedRef: React.MutableRefObject<boolean | null>;\n private viewNode: any;\n private viewTag?: number;\n private inspectorToggleListener?: EmitterSubscription;\n\n constructor(props: T & InternalEventHandlers) {\n super(props);\n this.config = {};\n this.propsRef = React.createRef();\n this.isMountedRef = React.createRef();\n this.state = { allowTouches };\n if (props.id) {\n if (handlerIDToTag[props.id] !== undefined) {\n throw new Error(`Handler with ID \"${props.id}\" already registered`);\n }\n handlerIDToTag[props.id] = this.handlerTag;\n }\n }\n\n componentDidMount() {\n const props: HandlerProps<U> = this.props;\n this.isMountedRef.current = true;\n\n if (DEV_ON_ANDROID) {\n this.inspectorToggleListener = DeviceEventEmitter.addListener(\n 'toggleElementInspector',\n () => {\n this.setState((_) => ({ allowTouches }));\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n }\n );\n }\n if (hasUnresolvedRefs(props)) {\n // If there are unresolved refs (e.g. \".current\" has not yet been set)\n // passed as `simultaneousHandlers` or `waitFor`, we enqueue a call to\n // _update method that will try to update native handler props using\n // queueMicrotask. This makes it so update() function gets called after all\n // react components are mounted and we expect the missing ref object to\n // be resolved by then.\n ghQueueMicrotask(() => {\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n });\n }\n\n this.createGestureHandler(\n filterConfig(\n transformProps ? transformProps(this.props) : this.props,\n [...allowedProps, ...customNativeProps],\n config\n )\n );\n\n if (!this.viewNode) {\n throw new Error(\n `[Gesture Handler] Failed to obtain view for ${Handler.displayName}. Note that old API doesn't support functional components.`\n );\n }\n\n this.attachGestureHandler(findNodeHandle(this.viewNode) as number); // TODO(TS) - check if this can be null\n }\n\n componentDidUpdate() {\n const viewTag = findNodeHandle(this.viewNode);\n if (this.viewTag !== viewTag) {\n this.attachGestureHandler(viewTag as number); // TODO(TS) - check interaction between _viewTag & findNodeHandle\n }\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n }\n\n componentWillUnmount() {\n this.inspectorToggleListener?.remove();\n this.isMountedRef.current = false;\n if (Platform.OS !== 'web') {\n unregisterOldGestureHandler(this.handlerTag);\n }\n RNGestureHandlerModule.dropGestureHandler(this.handlerTag);\n scheduleFlushOperations();\n // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context\n const handlerID: string | undefined = this.props.id;\n if (handlerID) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete handlerIDToTag[handlerID];\n }\n\n MountRegistry.gestureHandlerWillUnmount(this);\n }\n\n private onGestureHandlerEvent = (event: GestureEvent<U>) => {\n if (event.nativeEvent.handlerTag === this.handlerTag) {\n if (typeof this.props.onGestureEvent === 'function') {\n this.props.onGestureEvent?.(event);\n }\n } else {\n this.props.onGestureHandlerEvent?.(event);\n }\n };\n\n // TODO(TS) - make sure this is right type for event\n private onGestureHandlerStateChange = (\n event: HandlerStateChangeEvent<U>\n ) => {\n if (event.nativeEvent.handlerTag === this.handlerTag) {\n if (typeof this.props.onHandlerStateChange === 'function') {\n this.props.onHandlerStateChange?.(event);\n }\n\n const state: ValueOf<typeof State> = event.nativeEvent.state;\n const stateEventName = stateToPropMappings[state];\n const eventHandler = stateEventName && this.props[stateEventName];\n if (eventHandler && typeof eventHandler === 'function') {\n eventHandler(event);\n }\n } else {\n this.props.onGestureHandlerStateChange?.(event);\n }\n };\n\n private refHandler = (node: any) => {\n this.viewNode = node;\n\n const child = React.Children.only(this.props.children);\n // @ts-ignore Since React 19 ref is accessible as standard prop\n // https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref\n const ref = isReact19() ? (child as ReactElement).props?.ref : child?.ref;\n\n if (!ref) {\n return;\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n };\n\n private createGestureHandler = (\n newConfig: Readonly<Record<string, unknown>>\n ) => {\n this.handlerTag = getNextHandlerTag();\n this.config = newConfig;\n\n RNGestureHandlerModule.createGestureHandler(\n name,\n this.handlerTag,\n newConfig\n );\n };\n\n private attachGestureHandler = (newViewTag: number) => {\n this.viewTag = newViewTag;\n\n if (Platform.OS === 'web') {\n // Typecast due to dynamic resolution, attachGestureHandler should have web version signature in this branch\n (\n RNGestureHandlerModule.attachGestureHandler as AttachGestureHandlerWeb\n )(\n this.handlerTag,\n newViewTag,\n ActionType.JS_FUNCTION_OLD_API, // ignored on web\n this.propsRef\n );\n } else {\n registerOldGestureHandler(this.handlerTag, {\n onGestureEvent: this.onGestureHandlerEvent,\n onGestureStateChange: this.onGestureHandlerStateChange,\n });\n\n const actionType = (() => {\n const onGestureEvent = this.props?.onGestureEvent;\n const isGestureHandlerWorklet =\n onGestureEvent &&\n ('current' in onGestureEvent ||\n 'workletEventHandler' in onGestureEvent);\n const onHandlerStateChange = this.props?.onHandlerStateChange;\n const isStateChangeHandlerWorklet =\n onHandlerStateChange &&\n ('current' in onHandlerStateChange ||\n 'workletEventHandler' in onHandlerStateChange);\n const isReanimatedHandler =\n isGestureHandlerWorklet || isStateChangeHandlerWorklet;\n if (isReanimatedHandler) {\n // Reanimated worklet\n return ActionType.REANIMATED_WORKLET;\n } else if (onGestureEvent && '__isNative' in onGestureEvent) {\n // Animated.event with useNativeDriver: true\n return ActionType.NATIVE_ANIMATED_EVENT;\n } else {\n // JS callback or Animated.event with useNativeDriver: false\n return ActionType.JS_FUNCTION_OLD_API;\n }\n })();\n\n RNGestureHandlerModule.attachGestureHandler(\n this.handlerTag,\n newViewTag,\n actionType\n );\n }\n\n scheduleFlushOperations();\n\n ghQueueMicrotask(() => {\n MountRegistry.gestureHandlerWillMount(this);\n });\n };\n\n private updateGestureHandler = (\n newConfig: Readonly<Record<string, unknown>>\n ) => {\n this.config = newConfig;\n\n RNGestureHandlerModule.updateGestureHandler(this.handlerTag, newConfig);\n scheduleFlushOperations();\n };\n\n private update(remainingTries: number) {\n if (!this.isMountedRef.current) {\n return;\n }\n\n const props: HandlerProps<U> = this.props;\n\n // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of\n // `ref={refObject}` it's possible that it won't be resolved in time. Seems like trying\n // again is easy enough fix.\n if (hasUnresolvedRefs(props) && remainingTries > 0) {\n ghQueueMicrotask(() => {\n this.update(remainingTries - 1);\n });\n } else {\n const newConfig = filterConfig(\n transformProps ? transformProps(this.props) : this.props,\n [...allowedProps, ...customNativeProps],\n config\n );\n if (!deepEqual(this.config, newConfig)) {\n this.updateGestureHandler(newConfig);\n }\n }\n }\n\n setNativeProps(updates: any) {\n const mergedProps = { ...this.props, ...updates };\n const newConfig = filterConfig(\n transformProps ? transformProps(mergedProps) : mergedProps,\n [...allowedProps, ...customNativeProps],\n config\n );\n this.updateGestureHandler(newConfig);\n }\n\n render() {\n if (__DEV__ && !this.context && !isTestEnv() && Platform.OS !== 'web') {\n throw new Error(\n name +\n ' must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.'\n );\n }\n\n let gestureEventHandler = this.onGestureHandlerEvent;\n // Another instance of https://github.com/microsoft/TypeScript/issues/13995\n type OnGestureEventHandlers = {\n onGestureEvent?: BaseGestureHandlerProps<U>['onGestureEvent'];\n onGestureHandlerEvent?: InternalEventHandlers['onGestureHandlerEvent'];\n };\n const { onGestureEvent, onGestureHandlerEvent }: OnGestureEventHandlers =\n this.props;\n if (onGestureEvent && typeof onGestureEvent !== 'function') {\n // If it's not a method it should be an native Animated.event\n // object. We set it directly as the handler for the view\n // In this case nested handlers are not going to be supported\n if (onGestureHandlerEvent) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n gestureEventHandler = onGestureEvent;\n } else {\n if (\n onGestureHandlerEvent &&\n typeof onGestureHandlerEvent !== 'function'\n ) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n }\n\n let gestureStateEventHandler = this.onGestureHandlerStateChange;\n // Another instance of https://github.com/microsoft/TypeScript/issues/13995\n type OnGestureStateChangeHandlers = {\n onHandlerStateChange?: BaseGestureHandlerProps<U>['onHandlerStateChange'];\n onGestureHandlerStateChange?: InternalEventHandlers['onGestureHandlerStateChange'];\n };\n const {\n onHandlerStateChange,\n onGestureHandlerStateChange,\n }: OnGestureStateChangeHandlers = this.props;\n if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') {\n // If it's not a method it should be an native Animated.event\n // object. We set it directly as the handler for the view\n // In this case nested handlers are not going to be supported\n if (onGestureHandlerStateChange) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n gestureStateEventHandler = onHandlerStateChange;\n } else {\n if (\n onGestureHandlerStateChange &&\n typeof onGestureHandlerStateChange !== 'function'\n ) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n }\n const events = {\n onGestureHandlerEvent: this.state.allowTouches\n ? gestureEventHandler\n : undefined,\n onGestureHandlerStateChange: this.state.allowTouches\n ? gestureStateEventHandler\n : undefined,\n };\n\n this.propsRef.current = events;\n\n let child: any = null;\n try {\n child = React.Children.only(this.props.children);\n } catch (e) {\n throw new Error(\n tagMessage(\n `${name} got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n\n let grandChildren = child.props.children;\n if (\n __DEV__ &&\n child.type &&\n (child.type === 'RNGestureHandlerButton' ||\n child.type.name === 'View' ||\n child.type.displayName === 'View')\n ) {\n grandChildren = React.Children.toArray(grandChildren);\n grandChildren.push(\n <PressabilityDebugView\n key=\"pressabilityDebugView\"\n color=\"mediumspringgreen\"\n hitSlop={child.props.hitSlop}\n />\n );\n }\n\n return React.cloneElement(\n child,\n {\n ref: this.refHandler,\n collapsable: false,\n ...(isTestEnv()\n ? {\n handlerType: name,\n handlerTag: this.handlerTag,\n enabled: this.props.enabled,\n }\n : {}),\n testID: this.props.testID ?? child.props.testID,\n ...events,\n },\n grandChildren\n );\n }\n }\n return Handler;\n}\n"]}
|
@@ -1,75 +0,0 @@
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
-
|
3
|
-
import * as React from 'react';
|
4
|
-
import { useImperativeHandle, useRef } from 'react';
|
5
|
-
import { NativeViewGestureHandler, nativeViewProps } from './NativeViewGestureHandler';
|
6
|
-
/*
|
7
|
-
* This array should consist of:
|
8
|
-
* - All keys in propTypes from NativeGestureHandler
|
9
|
-
* (and all keys in GestureHandlerPropTypes)
|
10
|
-
* - 'onGestureHandlerEvent'
|
11
|
-
* - 'onGestureHandlerStateChange'
|
12
|
-
*/
|
13
|
-
|
14
|
-
const NATIVE_WRAPPER_PROPS_FILTER = [...nativeViewProps, 'onGestureHandlerEvent', 'onGestureHandlerStateChange'];
|
15
|
-
export default function createNativeWrapper(Component, config = {}) {
|
16
|
-
var _Component$render;
|
17
|
-
|
18
|
-
const ComponentWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
19
|
-
// Filter out props that should be passed to gesture handler wrapper
|
20
|
-
const {
|
21
|
-
gestureHandlerProps,
|
22
|
-
childProps
|
23
|
-
} = Object.keys(props).reduce((res, key) => {
|
24
|
-
// TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
|
25
|
-
const allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
|
26
|
-
|
27
|
-
if (allowedKeys.includes(key)) {
|
28
|
-
// @ts-ignore FIXME(TS)
|
29
|
-
res.gestureHandlerProps[key] = props[key];
|
30
|
-
} else {
|
31
|
-
// @ts-ignore FIXME(TS)
|
32
|
-
res.childProps[key] = props[key];
|
33
|
-
}
|
34
|
-
|
35
|
-
return res;
|
36
|
-
}, {
|
37
|
-
gestureHandlerProps: { ...config
|
38
|
-
},
|
39
|
-
// Watch out not to modify config
|
40
|
-
childProps: {
|
41
|
-
enabled: props.enabled,
|
42
|
-
hitSlop: props.hitSlop,
|
43
|
-
testID: props.testID
|
44
|
-
}
|
45
|
-
});
|
46
|
-
|
47
|
-
const _ref = useRef(null);
|
48
|
-
|
49
|
-
const _gestureHandlerRef = useRef(null);
|
50
|
-
|
51
|
-
useImperativeHandle(ref, // @ts-ignore TODO(TS) decide how nulls work in this context
|
52
|
-
() => {
|
53
|
-
const node = _gestureHandlerRef.current; // Add handlerTag for relations config
|
54
|
-
|
55
|
-
if (_ref.current && node) {
|
56
|
-
// @ts-ignore FIXME(TS) think about createHandler return type
|
57
|
-
_ref.current.handlerTag = node.handlerTag;
|
58
|
-
return _ref.current;
|
59
|
-
}
|
60
|
-
|
61
|
-
return null;
|
62
|
-
}, [_ref, _gestureHandlerRef]);
|
63
|
-
return /*#__PURE__*/React.createElement(NativeViewGestureHandler, _extends({}, gestureHandlerProps, {
|
64
|
-
// @ts-ignore TODO(TS)
|
65
|
-
ref: _gestureHandlerRef
|
66
|
-
}), /*#__PURE__*/React.createElement(Component, _extends({}, childProps, {
|
67
|
-
ref: _ref
|
68
|
-
})));
|
69
|
-
}); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
70
|
-
|
71
|
-
ComponentWrapper.displayName = (Component === null || Component === void 0 ? void 0 : Component.displayName) || ( // @ts-ignore if render doesn't exist it will return undefined and go further
|
72
|
-
Component === null || Component === void 0 ? void 0 : (_Component$render = Component.render) === null || _Component$render === void 0 ? void 0 : _Component$render.name) || typeof Component === 'string' && Component || 'ComponentWrapper';
|
73
|
-
return ComponentWrapper;
|
74
|
-
}
|
75
|
-
//# sourceMappingURL=createNativeWrapper.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["createNativeWrapper.tsx"],"names":["React","useImperativeHandle","useRef","NativeViewGestureHandler","nativeViewProps","NATIVE_WRAPPER_PROPS_FILTER","createNativeWrapper","Component","config","ComponentWrapper","forwardRef","props","ref","gestureHandlerProps","childProps","Object","keys","reduce","res","key","allowedKeys","includes","enabled","hitSlop","testID","_ref","_gestureHandlerRef","node","current","handlerTag","displayName","render","name"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,mBAAT,EAA8BC,MAA9B,QAA4C,OAA5C;AAEA,SACEC,wBADF,EAGEC,eAHF,QAIO,4BAJP;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,2BAA2B,GAAG,CAClC,GAAGD,eAD+B,EAElC,uBAFkC,EAGlC,6BAHkC,CAApC;AAMA,eAAe,SAASE,mBAAT,CACbC,SADa,EAEbC,MAA+C,GAAG,EAFrC,EAGb;AAAA;;AACA,QAAMC,gBAAgB,gBAAGT,KAAK,CAAC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AD,EAAOC,kBAAP,CAbiB,CAAnB;AAeA,wBACE,oBAAC,wBAAD,eACMb,mBADN;AAEE;AACA,MAAA,GAAG,EAAEa;AAHP,qBAIE,oBAAC,SAAD,eAAeZ,UAAf;AAA2B,MAAA,GAAG,EAAEW;AAAhC,OAJF,CADF;AAQD,GApDwB,CAAzB,CADA,CAuDA;;AACAhB,EAAAA,gBAAgB,CAACqB,WAAjB,GACE,CAAAvB,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEuB,WAAX,OACA;AACAvB,EAAAA,SAFA,aAEAA,SAFA,4CAEAA,SAAS,CAAEwB,MAFX,sDAEA,kBAAmBC,IAFnB,KAGC,OAAOzB,SAAP,KAAqB,QAArB,IAAiCA,SAHlC,IAIA,kBALF;AAOA,SAAOE,gBAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { useImperativeHandle, useRef } from 'react';\n\nimport {\n NativeViewGestureHandler,\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from './NativeViewGestureHandler';\n\n/*\n * This array should consist of:\n * - All keys in propTypes from NativeGestureHandler\n * (and all keys in GestureHandlerPropTypes)\n * - 'onGestureHandlerEvent'\n * - 'onGestureHandlerStateChange'\n */\nconst NATIVE_WRAPPER_PROPS_FILTER = [\n ...nativeViewProps,\n 'onGestureHandlerEvent',\n 'onGestureHandlerStateChange',\n] as const;\n\nexport default function createNativeWrapper<P>(\n Component: React.ComponentType<P>,\n config: Readonly<NativeViewGestureHandlerProps> = {}\n) {\n const ComponentWrapper = React.forwardRef<\n React.ComponentType<any>,\n P & NativeViewGestureHandlerProps\n >((props, ref) => {\n // Filter out props that should be passed to gesture handler wrapper\n const { gestureHandlerProps, childProps } = Object.keys(props).reduce(\n (res, key) => {\n // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info\n const allowedKeys: readonly string[] = NATIVE_WRAPPER_PROPS_FILTER;\n if (allowedKeys.includes(key)) {\n // @ts-ignore FIXME(TS)\n res.gestureHandlerProps[key] = props[key];\n } else {\n // @ts-ignore FIXME(TS)\n res.childProps[key] = props[key];\n }\n return res;\n },\n {\n gestureHandlerProps: { ...config }, // Watch out not to modify config\n childProps: {\n enabled: props.enabled,\n hitSlop: props.hitSlop,\n testID: props.testID,\n } as P,\n }\n );\n const _ref = useRef<React.ComponentType<P>>(null);\n const _gestureHandlerRef = useRef<React.ComponentType<P>>(null);\n useImperativeHandle(\n ref,\n // @ts-ignore TODO(TS) decide how nulls work in this context\n () => {\n const node = _gestureHandlerRef.current;\n // Add handlerTag for relations config\n if (_ref.current && node) {\n // @ts-ignore FIXME(TS) think about createHandler return type\n _ref.current.handlerTag = node.handlerTag;\n return _ref.current;\n }\n return null;\n },\n [_ref, _gestureHandlerRef]\n );\n return (\n <NativeViewGestureHandler\n {...gestureHandlerProps}\n // @ts-ignore TODO(TS)\n ref={_gestureHandlerRef}>\n <Component {...childProps} ref={_ref} />\n </NativeViewGestureHandler>\n );\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ComponentWrapper.displayName =\n Component?.displayName ||\n // @ts-ignore if render doesn't exist it will return undefined and go further\n Component?.render?.name ||\n (typeof Component === 'string' && Component) ||\n 'ComponentWrapper';\n\n return ComponentWrapper;\n}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["customDirectEventTypes.ts"],"names":["customDirectEventTypes"],"mappings":"AAAA;AACA,SAASA,sBAAT,QAAuC,qEAAvC","sourcesContent":["// @ts-ignore - its taken straight from RN\nexport { customDirectEventTypes } from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry';\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["customDirectEventTypes.web.ts"],"names":["customDirectEventTypes"],"mappings":"AAAA;AACA;AACA,MAAMA,sBAAsB,GAAG,EAA/B;AAEA,SAASA,sBAAT","sourcesContent":["// customDirectEventTypes doesn't exist in react-native-web, therefore importing it\n// directly in createHandler.tsx would end in crash.\nconst customDirectEventTypes = {};\n\nexport { customDirectEventTypes };\n"]}
|