@react-native-oh-tpl/react-native-gesture-handler 2.12.1-0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/DrawerLayout/package.json +6 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/RNGestureHandler.podspec +44 -0
- package/Swipeable/package.json +6 -0
- package/android/build.gradle +209 -0
- package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +29 -0
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +12 -0
- package/android/gradle.properties +19 -0
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +50 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +23 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +25 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +21 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +807 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +671 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +47 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +11 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +257 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +9 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +322 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +103 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +23 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +125 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +93 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ScaleGestureDetector.java +558 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +168 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt +10 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +16 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +423 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +15 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +75 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +74 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +702 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +142 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +78 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +51 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +78 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +69 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +51 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +22 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +33 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +18 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +42 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/jni/CMakeLists.txt +37 -0
- package/android/src/main/jni/cpp-adapter.cpp +44 -0
- package/ios/Handlers/RNFlingHandler.h +4 -0
- package/ios/Handlers/RNFlingHandler.m +152 -0
- package/ios/Handlers/RNForceTouchHandler.h +4 -0
- package/ios/Handlers/RNForceTouchHandler.m +175 -0
- package/ios/Handlers/RNHoverHandler.h +12 -0
- package/ios/Handlers/RNHoverHandler.m +153 -0
- package/ios/Handlers/RNLongPressHandler.h +12 -0
- package/ios/Handlers/RNLongPressHandler.m +183 -0
- package/ios/Handlers/RNManualHandler.h +4 -0
- package/ios/Handlers/RNManualHandler.m +88 -0
- package/ios/Handlers/RNNativeViewHandler.h +15 -0
- package/ios/Handlers/RNNativeViewHandler.mm +193 -0
- package/ios/Handlers/RNPanHandler.h +12 -0
- package/ios/Handlers/RNPanHandler.m +331 -0
- package/ios/Handlers/RNPinchHandler.h +12 -0
- package/ios/Handlers/RNPinchHandler.m +95 -0
- package/ios/Handlers/RNRotationHandler.h +12 -0
- package/ios/Handlers/RNRotationHandler.m +93 -0
- package/ios/Handlers/RNTapHandler.h +12 -0
- package/ios/Handlers/RNTapHandler.m +265 -0
- package/ios/RNGHTouchEventType.h +9 -0
- package/ios/RNGestureHandler.h +90 -0
- package/ios/RNGestureHandler.m +493 -0
- package/ios/RNGestureHandler.xcodeproj/project.pbxproj +690 -0
- package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNGestureHandlerActionType.h +10 -0
- package/ios/RNGestureHandlerButton.h +19 -0
- package/ios/RNGestureHandlerButton.m +77 -0
- package/ios/RNGestureHandlerButtonComponentView.h +17 -0
- package/ios/RNGestureHandlerButtonComponentView.mm +64 -0
- package/ios/RNGestureHandlerButtonManager.h +5 -0
- package/ios/RNGestureHandlerButtonManager.m +34 -0
- package/ios/RNGestureHandlerDirection.h +8 -0
- package/ios/RNGestureHandlerEvents.h +65 -0
- package/ios/RNGestureHandlerEvents.m +260 -0
- package/ios/RNGestureHandlerManager.h +35 -0
- package/ios/RNGestureHandlerManager.mm +367 -0
- package/ios/RNGestureHandlerModule.h +7 -0
- package/ios/RNGestureHandlerModule.mm +320 -0
- package/ios/RNGestureHandlerPointerTracker.h +25 -0
- package/ios/RNGestureHandlerPointerTracker.m +243 -0
- package/ios/RNGestureHandlerRegistry.h +21 -0
- package/ios/RNGestureHandlerRegistry.m +63 -0
- package/ios/RNGestureHandlerRootViewComponentView.mm +21 -0
- package/ios/RNGestureHandlerState.h +10 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/RNManualActivationRecognizer.h +10 -0
- package/ios/RNManualActivationRecognizer.m +88 -0
- package/ios/RNRootViewGestureRecognizer.h +17 -0
- package/ios/RNRootViewGestureRecognizer.m +106 -0
- package/jest-utils/package.json +6 -0
- package/jestSetup.js +7 -0
- package/lib/commonjs/ActionType.js +15 -0
- package/lib/commonjs/ActionType.js.map +1 -0
- package/lib/commonjs/Directions.js +15 -0
- package/lib/commonjs/Directions.js.map +1 -0
- package/lib/commonjs/EnableNewWebImplementation.js +35 -0
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js +15 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/commonjs/PlatformConstants.js +15 -0
- package/lib/commonjs/PlatformConstants.js.map +1 -0
- package/lib/commonjs/PlatformConstants.web.js +14 -0
- package/lib/commonjs/PlatformConstants.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.js +29 -0
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js +149 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js +163 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js +158 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/commonjs/RNRenderer.js +16 -0
- package/lib/commonjs/RNRenderer.js.map +1 -0
- package/lib/commonjs/RNRenderer.web.js +11 -0
- package/lib/commonjs/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/State.js +18 -0
- package/lib/commonjs/State.js.map +1 -0
- package/lib/commonjs/TouchEventType.js +16 -0
- package/lib/commonjs/TouchEventType.js.map +1 -0
- package/lib/commonjs/components/DrawerLayout.js +566 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -0
- package/lib/commonjs/components/GestureButtons.js +240 -0
- package/lib/commonjs/components/GestureButtons.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.js +115 -0
- package/lib/commonjs/components/GestureComponents.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.web.js +52 -0
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.js +14 -0
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js +24 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js +31 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.js +31 -0
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js +25 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +408 -0
- package/lib/commonjs/components/Swipeable.js.map +1 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js +40 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +289 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js +109 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +100 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +12 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js +77 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +26 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/index.js +40 -0
- package/lib/commonjs/components/touchables/index.js.map +1 -0
- package/lib/commonjs/getReactNativeVersion.js +22 -0
- package/lib/commonjs/getReactNativeVersion.js.map +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js +11 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -0
- package/lib/commonjs/getShadowNodeFromRef.js +27 -0
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js +15 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/commonjs/ghQueueMicrotask.js +12 -0
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js +25 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +49 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js +27 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +27 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PanGestureHandler.js +123 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js +23 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js +14 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +12 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js +23 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/TapGestureHandler.js +27 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/createHandler.js +464 -0
- package/lib/commonjs/handlers/createHandler.js.map +1 -0
- package/lib/commonjs/handlers/createNativeWrapper.js +74 -0
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +103 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +6 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js +669 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js +147 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +65 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gesture.js +241 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js +105 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js +90 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +65 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +32 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js +74 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js +35 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js +31 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/panGesture.js +149 -0
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js +45 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +37 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js +45 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js +60 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/commonjs/handlers/handlersRegistry.js +67 -0
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
- package/lib/commonjs/index.js +266 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/init.js +32 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/jestUtils/index.js +20 -0
- package/lib/commonjs/jestUtils/index.js.map +1 -0
- package/lib/commonjs/jestUtils/jestUtils.js +375 -0
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
- package/lib/commonjs/mocks.js +66 -0
- package/lib/commonjs/mocks.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +15 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +15 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/commonjs/typeUtils.js +2 -0
- package/lib/commonjs/typeUtils.js.map +1 -0
- package/lib/commonjs/utils.js +63 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/constants.js +16 -0
- package/lib/commonjs/web/constants.js.map +1 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +165 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +156 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +167 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/GestureHandler.js +794 -0
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +62 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +151 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +61 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +178 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js +448 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +174 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +186 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js +280 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web/interfaces.js +55 -0
- package/lib/commonjs/web/interfaces.js.map +1 -0
- package/lib/commonjs/web/tools/CircularBuffer.js +59 -0
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
- package/lib/commonjs/web/tools/EventManager.js +127 -0
- package/lib/commonjs/web/tools/EventManager.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +349 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +118 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/InteractionManager.js +114 -0
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js +204 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/commonjs/web/tools/NodeManager.js +48 -0
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +198 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerTracker.js +226 -0
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -0
- package/lib/commonjs/web/tools/TouchEventManager.js +138 -0
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/VelocityTracker.js +111 -0
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
- package/lib/commonjs/web/utils.js +15 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +105 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +53 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/Errors.js +16 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +170 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/GestureHandler.js +579 -0
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +54 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +71 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +66 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NodeManager.js +46 -0
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js +208 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +40 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js +188 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +44 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js +192 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/constants.js +64 -0
- package/lib/commonjs/web_hammer/constants.js.map +1 -0
- package/lib/commonjs/web_hammer/utils.js +42 -0
- package/lib/commonjs/web_hammer/utils.js.map +1 -0
- package/lib/module/ActionType.js +7 -0
- package/lib/module/ActionType.js.map +1 -0
- package/lib/module/Directions.js +7 -0
- package/lib/module/Directions.js.map +1 -0
- package/lib/module/EnableNewWebImplementation.js +22 -0
- package/lib/module/EnableNewWebImplementation.js.map +1 -0
- package/lib/module/GestureHandlerRootViewContext.js +3 -0
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/module/PlatformConstants.js +5 -0
- package/lib/module/PlatformConstants.js.map +1 -0
- package/lib/module/PlatformConstants.web.js +7 -0
- package/lib/module/PlatformConstants.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +19 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.macos.js +110 -0
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.web.js +122 -0
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.windows.js +118 -0
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/module/RNRenderer.js +4 -0
- package/lib/module/RNRenderer.js.map +1 -0
- package/lib/module/RNRenderer.web.js +4 -0
- package/lib/module/RNRenderer.web.js.map +1 -0
- package/lib/module/State.js +10 -0
- package/lib/module/State.js.map +1 -0
- package/lib/module/TouchEventType.js +8 -0
- package/lib/module/TouchEventType.js.map +1 -0
- package/lib/module/components/DrawerLayout.js +551 -0
- package/lib/module/components/DrawerLayout.js.map +1 -0
- package/lib/module/components/GestureButtons.js +206 -0
- package/lib/module/components/GestureButtons.js.map +1 -0
- package/lib/module/components/GestureComponents.js +90 -0
- package/lib/module/components/GestureComponents.js.map +1 -0
- package/lib/module/components/GestureComponents.web.js +28 -0
- package/lib/module/components/GestureComponents.web.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.js +3 -0
- package/lib/module/components/GestureHandlerButton.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.web.js +9 -0
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.android.js +14 -0
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.js +14 -0
- package/lib/module/components/GestureHandlerRootView.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.web.js +9 -0
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/module/components/Swipeable.js +390 -0
- package/lib/module/components/Swipeable.js.map +1 -0
- package/lib/module/components/gestureHandlerRootHOC.js +22 -0
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +273 -0
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/module/components/touchables/TouchableHighlight.js +95 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +84 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js +3 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/module/components/touchables/TouchableOpacity.js +63 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +10 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/module/components/touchables/index.js +5 -0
- package/lib/module/components/touchables/index.js.map +1 -0
- package/lib/module/getReactNativeVersion.js +10 -0
- package/lib/module/getReactNativeVersion.js.map +1 -0
- package/lib/module/getReactNativeVersion.web.js +4 -0
- package/lib/module/getReactNativeVersion.web.js.map +1 -0
- package/lib/module/getShadowNodeFromRef.js +20 -0
- package/lib/module/getShadowNodeFromRef.js.map +1 -0
- package/lib/module/getShadowNodeFromRef.web.js +8 -0
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/module/ghQueueMicrotask.js +5 -0
- package/lib/module/ghQueueMicrotask.js.map +1 -0
- package/lib/module/handlers/FlingGestureHandler.js +11 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js +31 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/module/handlers/LongPressGestureHandler.js +13 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/handlers/NativeViewGestureHandler.js +12 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/handlers/PanGestureHandler.js +107 -0
- package/lib/module/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/handlers/PinchGestureHandler.js +10 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/handlers/PressabilityDebugView.js +3 -0
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/module/handlers/PressabilityDebugView.web.js +5 -0
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/module/handlers/RotationGestureHandler.js +10 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/handlers/TapGestureHandler.js +13 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/handlers/createHandler.js +433 -0
- package/lib/module/handlers/createHandler.js.map +1 -0
- package/lib/module/handlers/createNativeWrapper.js +62 -0
- package/lib/module/handlers/createNativeWrapper.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +81 -0
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -0
- package/lib/module/handlers/gestures/GestureDetector.js +619 -0
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/module/handlers/gestures/eventReceiver.js +131 -0
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/module/handlers/gestures/flingGesture.js +24 -0
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js +56 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/gesture.js +222 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -0
- package/lib/module/handlers/gestures/gestureComposition.js +90 -0
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/module/handlers/gestures/gestureObjects.js +71 -0
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.js +54 -0
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js +21 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/module/handlers/gestures/hoverGesture.js +62 -0
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/module/handlers/gestures/longPressGesture.js +25 -0
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/module/handlers/gestures/manualGesture.js +22 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/module/handlers/gestures/nativeGesture.js +24 -0
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/module/handlers/gestures/panGesture.js +140 -0
- package/lib/module/handlers/gestures/panGesture.js.map +1 -0
- package/lib/module/handlers/gestures/pinchGesture.js +36 -0
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js +30 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/module/handlers/gestures/rotationGesture.js +36 -0
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/module/handlers/gestures/tapGesture.js +50 -0
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/module/handlers/handlersRegistry.js +44 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -0
- package/lib/module/index.js +25 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/init.js +16 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/jestUtils/index.js +2 -0
- package/lib/module/jestUtils/index.js.map +1 -0
- package/lib/module/jestUtils/jestUtils.js +350 -0
- package/lib/module/jestUtils/jestUtils.js.map +1 -0
- package/lib/module/mocks.js +56 -0
- package/lib/module/mocks.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/module/typeUtils.js +2 -0
- package/lib/module/typeUtils.js.map +1 -0
- package/lib/module/utils.js +44 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/constants.js +8 -0
- package/lib/module/web/constants.js.map +1 -0
- package/lib/module/web/detectors/RotationGestureDetector.js +155 -0
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js +145 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/module/web/handlers/FlingGestureHandler.js +152 -0
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/GestureHandler.js +776 -0
- package/lib/module/web/handlers/GestureHandler.js.map +1 -0
- package/lib/module/web/handlers/HoverGestureHandler.js +47 -0
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js +136 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/ManualGestureHandler.js +49 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js +163 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PanGestureHandler.js +433 -0
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PinchGestureHandler.js +159 -0
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/RotationGestureHandler.js +171 -0
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/TapGestureHandler.js +265 -0
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/web/interfaces.js +45 -0
- package/lib/module/web/interfaces.js.map +1 -0
- package/lib/module/web/tools/CircularBuffer.js +50 -0
- package/lib/module/web/tools/CircularBuffer.js.map +1 -0
- package/lib/module/web/tools/EventManager.js +118 -0
- package/lib/module/web/tools/EventManager.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +335 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +102 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/module/web/tools/InteractionManager.js +105 -0
- package/lib/module/web/tools/InteractionManager.js.map +1 -0
- package/lib/module/web/tools/LeastSquareSolver.js +195 -0
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/module/web/tools/NodeManager.js +39 -0
- package/lib/module/web/tools/NodeManager.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +184 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -0
- package/lib/module/web/tools/PointerTracker.js +213 -0
- package/lib/module/web/tools/PointerTracker.js.map +1 -0
- package/lib/module/web/tools/TouchEventManager.js +124 -0
- package/lib/module/web/tools/TouchEventManager.js.map +1 -0
- package/lib/module/web/tools/VelocityTracker.js +98 -0
- package/lib/module/web/tools/VelocityTracker.js.map +1 -0
- package/lib/module/web/utils.js +8 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js +94 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js +40 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/Errors.js +7 -0
- package/lib/module/web_hammer/Errors.js.map +1 -0
- package/lib/module/web_hammer/FlingGestureHandler.js +156 -0
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/GestureHandler.js +563 -0
- package/lib/module/web_hammer/GestureHandler.js.map +1 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +44 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js +58 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/NativeViewGestureHandler.js +49 -0
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/NodeManager.js +33 -0
- package/lib/module/web_hammer/NodeManager.js.map +1 -0
- package/lib/module/web_hammer/PanGestureHandler.js +194 -0
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PinchGestureHandler.js +29 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PressGestureHandler.js +174 -0
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/RotationGestureHandler.js +32 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/TapGestureHandler.js +180 -0
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/constants.js +43 -0
- package/lib/module/web_hammer/constants.js.map +1 -0
- package/lib/module/web_hammer/utils.js +19 -0
- package/lib/module/web_hammer/utils.js.map +1 -0
- package/lib/typescript/ActionType.d.ts +7 -0
- package/lib/typescript/Directions.d.ts +7 -0
- package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
- package/lib/typescript/PlatformConstants.d.ts +5 -0
- package/lib/typescript/PlatformConstants.web.d.ts +4 -0
- package/lib/typescript/RNGestureHandlerModule.d.ts +13 -0
- package/lib/typescript/RNGestureHandlerModule.macos.d.ts +47 -0
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +50 -0
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +48 -0
- package/lib/typescript/RNRenderer.d.ts +1 -0
- package/lib/typescript/RNRenderer.web.d.ts +3 -0
- package/lib/typescript/State.d.ts +9 -0
- package/lib/typescript/TouchEventType.d.ts +8 -0
- package/lib/typescript/components/DrawerLayout.d.ts +148 -0
- package/lib/typescript/components/GestureButtons.d.ts +121 -0
- package/lib/typescript/components/GestureComponents.d.ts +22 -0
- package/lib/typescript/components/GestureComponents.web.d.ts +8 -0
- package/lib/typescript/components/GestureHandlerButton.d.ts +4 -0
- package/lib/typescript/components/GestureHandlerButton.web.d.ts +4 -0
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +6 -0
- package/lib/typescript/components/Swipeable.d.ts +178 -0
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +3 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +68 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +36 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +45 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +25 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +7 -0
- package/lib/typescript/components/touchables/index.d.ts +7 -0
- package/lib/typescript/getReactNativeVersion.d.ts +4 -0
- package/lib/typescript/getReactNativeVersion.web.d.ts +1 -0
- package/lib/typescript/getShadowNodeFromRef.d.ts +1 -0
- package/lib/typescript/getShadowNodeFromRef.web.d.ts +1 -0
- package/lib/typescript/ghQueueMicrotask.d.ts +1 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +34 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +44 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +56 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +28 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +139 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +29 -0
- package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -0
- package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +1 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +29 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +57 -0
- package/lib/typescript/handlers/createHandler.d.ts +11 -0
- package/lib/typescript/handlers/createNativeWrapper.d.ts +3 -0
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +68 -0
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +42 -0
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +19 -0
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +4 -0
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +15 -0
- package/lib/typescript/handlers/gestures/gesture.d.ts +110 -0
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +41 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +9 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +7 -0
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/panGesture.d.ts +26 -0
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +11 -0
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +12 -0
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +14 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +14 -0
- package/lib/typescript/index.d.ts +52 -0
- package/lib/typescript/init.d.ts +2 -0
- package/lib/typescript/jestUtils/index.d.ts +1 -0
- package/lib/typescript/jestUtils/jestUtils.d.ts +28 -0
- package/lib/typescript/mocks.d.ts +44 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -0
- package/lib/typescript/typeUtils.d.ts +1 -0
- package/lib/typescript/utils.d.ts +8 -0
- package/lib/typescript/web/constants.d.ts +7 -0
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +30 -0
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +29 -0
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +27 -0
- package/lib/typescript/web/handlers/GestureHandler.d.ts +90 -0
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +26 -0
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +12 -0
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +24 -0
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +55 -0
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +28 -0
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +29 -0
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +39 -0
- package/lib/typescript/web/interfaces.d.ts +141 -0
- package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
- package/lib/typescript/web/tools/EventManager.d.ts +34 -0
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +29 -0
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
- package/lib/typescript/web/tools/InteractionManager.d.ts +17 -0
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
- package/lib/typescript/web/tools/NodeManager.d.ts +11 -0
- package/lib/typescript/web/tools/PointerEventManager.d.ts +8 -0
- package/lib/typescript/web/tools/PointerTracker.d.ts +53 -0
- package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
- package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
- package/lib/typescript/web/utils.d.ts +4 -0
- package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +20 -0
- package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +15 -0
- package/lib/typescript/web_hammer/Errors.d.ts +3 -0
- package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +43 -0
- package/lib/typescript/web_hammer/GestureHandler.d.ts +145 -0
- package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +40 -0
- package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +38 -0
- package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +7 -0
- package/lib/typescript/web_hammer/NodeManager.d.ts +8 -0
- package/lib/typescript/web_hammer/PanGestureHandler.d.ts +56 -0
- package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +13 -0
- package/lib/typescript/web_hammer/PressGestureHandler.d.ts +83 -0
- package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +13 -0
- package/lib/typescript/web_hammer/TapGestureHandler.d.ts +57 -0
- package/lib/typescript/web_hammer/constants.d.ts +39 -0
- package/lib/typescript/web_hammer/utils.d.ts +9 -0
- package/package.json +156 -0
- package/src/ActionType.ts +9 -0
- package/src/Directions.ts +9 -0
- package/src/EnableNewWebImplementation.ts +35 -0
- package/src/GestureHandlerRootViewContext.ts +3 -0
- package/src/PlatformConstants.ts +8 -0
- package/src/PlatformConstants.web.ts +5 -0
- package/src/RNGestureHandlerModule.macos.ts +133 -0
- package/src/RNGestureHandlerModule.ts +50 -0
- package/src/RNGestureHandlerModule.web.ts +146 -0
- package/src/RNGestureHandlerModule.windows.ts +144 -0
- package/src/RNRenderer.ts +3 -0
- package/src/RNRenderer.web.ts +3 -0
- package/src/State.ts +13 -0
- package/src/TouchEventType.ts +10 -0
- package/src/components/DrawerLayout.tsx +743 -0
- package/src/components/GestureButtons.tsx +332 -0
- package/src/components/GestureComponents.tsx +148 -0
- package/src/components/GestureComponents.web.tsx +41 -0
- package/src/components/GestureHandlerButton.tsx +5 -0
- package/src/components/GestureHandlerButton.web.tsx +6 -0
- package/src/components/GestureHandlerRootView.android.tsx +24 -0
- package/src/components/GestureHandlerRootView.tsx +23 -0
- package/src/components/GestureHandlerRootView.web.tsx +17 -0
- package/src/components/Swipeable.tsx +584 -0
- package/src/components/gestureHandlerRootHOC.tsx +32 -0
- package/src/components/touchables/GenericTouchable.tsx +301 -0
- package/src/components/touchables/TouchableHighlight.tsx +115 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +91 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +75 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -0
- package/src/components/touchables/index.ts +7 -0
- package/src/getReactNativeVersion.ts +11 -0
- package/src/getReactNativeVersion.web.ts +3 -0
- package/src/getShadowNodeFromRef.ts +22 -0
- package/src/getShadowNodeFromRef.web.ts +7 -0
- package/src/ghQueueMicrotask.ts +5 -0
- package/src/handlers/FlingGestureHandler.ts +59 -0
- package/src/handlers/ForceTouchGestureHandler.ts +90 -0
- package/src/handlers/LongPressGestureHandler.ts +88 -0
- package/src/handlers/NativeViewGestureHandler.ts +55 -0
- package/src/handlers/PanGestureHandler.ts +325 -0
- package/src/handlers/PinchGestureHandler.ts +48 -0
- package/src/handlers/PressabilityDebugView.tsx +2 -0
- package/src/handlers/PressabilityDebugView.web.tsx +4 -0
- package/src/handlers/RotationGestureHandler.ts +48 -0
- package/src/handlers/TapGestureHandler.ts +94 -0
- package/src/handlers/createHandler.tsx +533 -0
- package/src/handlers/createNativeWrapper.tsx +80 -0
- package/src/handlers/gestureHandlerCommon.ts +250 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +106 -0
- package/src/handlers/gestures/GestureDetector.tsx +822 -0
- package/src/handlers/gestures/eventReceiver.ts +155 -0
- package/src/handlers/gestures/flingGesture.ts +27 -0
- package/src/handlers/gestures/forceTouchGesture.ts +74 -0
- package/src/handlers/gestures/gesture.ts +349 -0
- package/src/handlers/gestures/gestureComposition.ts +122 -0
- package/src/handlers/gestures/gestureObjects.ts +84 -0
- package/src/handlers/gestures/gestureStateManager.ts +62 -0
- package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
- package/src/handlers/gestures/hoverGesture.ts +83 -0
- package/src/handlers/gestures/longPressGesture.ts +28 -0
- package/src/handlers/gestures/manualGesture.ts +31 -0
- package/src/handlers/gestures/nativeGesture.ts +27 -0
- package/src/handlers/gestures/panGesture.ts +152 -0
- package/src/handlers/gestures/pinchGesture.ts +51 -0
- package/src/handlers/gestures/reanimatedWrapper.ts +56 -0
- package/src/handlers/gestures/rotationGesture.ts +51 -0
- package/src/handlers/gestures/tapGesture.ts +53 -0
- package/src/handlers/handlersRegistry.ts +60 -0
- package/src/index.ts +174 -0
- package/src/init.ts +18 -0
- package/src/jestUtils/index.ts +1 -0
- package/src/jestUtils/jestUtils.ts +505 -0
- package/src/mocks.ts +67 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -0
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
- package/src/typeUtils.ts +1 -0
- package/src/utils.ts +54 -0
- package/src/web/constants.ts +8 -0
- package/src/web/detectors/RotationGestureDetector.ts +168 -0
- package/src/web/detectors/ScaleGestureDetector.ts +172 -0
- package/src/web/handlers/FlingGestureHandler.ts +161 -0
- package/src/web/handlers/GestureHandler.ts +849 -0
- package/src/web/handlers/HoverGestureHandler.ts +43 -0
- package/src/web/handlers/LongPressGestureHandler.ts +125 -0
- package/src/web/handlers/ManualGestureHandler.ts +43 -0
- package/src/web/handlers/NativeViewGestureHandler.ts +167 -0
- package/src/web/handlers/PanGestureHandler.ts +485 -0
- package/src/web/handlers/PinchGestureHandler.ts +158 -0
- package/src/web/handlers/RotationGestureHandler.ts +172 -0
- package/src/web/handlers/TapGestureHandler.ts +273 -0
- package/src/web/interfaces.ts +167 -0
- package/src/web/tools/CircularBuffer.ts +42 -0
- package/src/web/tools/EventManager.ts +104 -0
- package/src/web/tools/GestureHandlerDelegate.ts +23 -0
- package/src/web/tools/GestureHandlerOrchestrator.ts +389 -0
- package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
- package/src/web/tools/InteractionManager.ts +130 -0
- package/src/web/tools/LeastSquareSolver.ts +182 -0
- package/src/web/tools/NodeManager.ts +43 -0
- package/src/web/tools/PointerEventManager.ts +202 -0
- package/src/web/tools/PointerTracker.ts +240 -0
- package/src/web/tools/TouchEventManager.ts +167 -0
- package/src/web/tools/VelocityTracker.ts +98 -0
- package/src/web/utils.ts +8 -0
- package/src/web_hammer/DiscreteGestureHandler.ts +82 -0
- package/src/web_hammer/DraggingGestureHandler.ts +34 -0
- package/src/web_hammer/Errors.ts +7 -0
- package/src/web_hammer/FlingGestureHandler.ts +134 -0
- package/src/web_hammer/GestureHandler.ts +599 -0
- package/src/web_hammer/IndiscreteGestureHandler.ts +33 -0
- package/src/web_hammer/LongPressGestureHandler.ts +56 -0
- package/src/web_hammer/NativeViewGestureHandler.ts +47 -0
- package/src/web_hammer/NodeManager.ts +42 -0
- package/src/web_hammer/PanGestureHandler.ts +226 -0
- package/src/web_hammer/PinchGestureHandler.ts +25 -0
- package/src/web_hammer/PressGestureHandler.ts +167 -0
- package/src/web_hammer/RotationGestureHandler.ts +25 -0
- package/src/web_hammer/TapGestureHandler.ts +172 -0
- package/src/web_hammer/constants.ts +48 -0
- package/src/web_hammer/utils.ts +24 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["GestureDetector.tsx"],"names":["ALLOWED_PROPS","baseGestureHandlerWithMonitorProps","tapGestureHandlerProps","panGestureHandlerProps","panGestureHandlerCustomNativeProps","longPressGestureHandlerProps","forceTouchGestureHandlerProps","flingGestureHandlerProps","hoverGestureHandlerProps","nativeViewGestureHandlerProps","convertToHandlerTag","ref","BaseGesture","handlerTag","current","extractValidHandlerTags","interactionGroup","map","filter","tag","dropHandlers","preparedGesture","handler","config","RNGestureHandlerModule","dropGestureHandler","testId","checkGestureCallbacksForWorklets","gesture","runOnJS","areSomeNotWorklets","handlers","isWorklet","includes","areSomeWorklets","console","error","attachHandlers","gestureConfig","viewTag","webEventHandlersRef","mountedRef","firstExecution","initialize","prepare","createGestureHandler","handlerName","requireToFail","simultaneousWith","blocksHandlers","updateGestureHandler","simultaneousHandlers","waitFor","actionType","shouldUseReanimated","ActionType","REANIMATED_WORKLET","JS_FUNCTION_NEW_API","Platform","OS","attachGestureHandler","JS_FUNCTION_OLD_API","animatedHandlers","isAnimatedGesture","g","value","updateHandlers","i","length","previousHandlersValue","newHandlersValue","shouldUpdateSharedValue","gestureId","needsToReattach","isStateChangeEvent","event","oldState","isTouchEvent","eventType","getHandler","type","CALLBACK_TYPE","BEGAN","onBegin","START","onStart","UPDATE","onUpdate","CHANGE","onChange","END","onEnd","FINALIZE","onFinalize","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","touchEventTypeToCallbackType","TouchEventType","UNDEFINED","runWorklet","args","warn","useAnimatedGesture","needsRebuild","Reanimated","sharedHandlersCallbacks","useSharedValue","lastUpdateEvent","stateControllers","callback","currentCallback","State","UNDETERMINED","state","ACTIVE","undefined","FAILED","CANCELLED","GestureStateManager","create","changeEventCalculator","useEvent","animatedEventHandler","validateDetectorChildren","__DEV__","REACT_NATIVE_VERSION","wrapType","minor","major","_reactInternals","elementType","_reactInternalFiber","instance","RNRenderer","findHostInstance_DEPRECATED","_internalFiberInstanceHandleDEV","sibling","Error","return","applyUserSelectProp","userSelect","toGestureArray","GestureDetector","props","rootViewContext","GestureHandlerRootViewContext","useReanimatedHook","some","firstRender","viewRef","previousViewTag","forceReattach","onGestureHandlerEvent","e","nativeEvent","onGestureHandlerStateChange","renderState","setRenderState","forceRender","React","useRef","onHandlersUpdate","skipConfigUpdate","needsToRebuildReanimatedEvent","refFunction","node","global","isFormsStackingContext","children","Wrap","Component","render","child","Children","only","cloneElement","collapsable","AnimatedWrap","default","createAnimatedComponent"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAWA;;AAIA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAMA,MAAMA,aAAa,GAAG,CACpB,GAAGC,wDADiB,EAEpB,GAAGC,yCAFiB,EAGpB,GAAGC,yCAHiB,EAIpB,GAAGC,qDAJiB,EAKpB,GAAGC,qDALiB,EAMpB,GAAGC,uDANiB,EAOpB,GAAGC,6CAPiB,EAQpB,GAAGC,sCARiB,EASpB,GAAGC,uDATiB,CAAtB;;AAsBA,SAASC,mBAAT,CAA6BC,GAA7B,EAAsD;AACpD,MAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AAC3B,WAAOA,GAAP;AACD,GAFD,MAEO,IAAIA,GAAG,YAAYC,oBAAnB,EAAgC;AACrC,WAAOD,GAAG,CAACE,UAAX;AACD,GAFM,MAEA;AAAA;;AACL;AACA;AACA,oDAAOF,GAAG,CAACG,OAAX,iDAAO,aAAaD,UAApB,yEAAkC,CAAC,CAAnC;AACD;AACF;;AAED,SAASE,uBAAT,CAAiCC,gBAAjC,EAA6E;AAAA;;AAC3E,kCACEA,gBADF,aACEA,gBADF,iDACEA,gBA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uBAArB,CAA6CV,IAA7C,CAAH,yEAAyDA,IAA3E","sourcesContent":["import React, { useContext, useEffect, useRef, useState } from 'react';\r\nimport {\r\n GestureType,\r\n HandlerCallbacks,\r\n BaseGesture,\r\n GestureRef,\r\n CALLBACK_TYPE,\r\n} from './gesture';\r\nimport { Reanimated, SharedValue } from './reanimatedWrapper';\r\nimport { registerHandler, unregisterHandler } from '../handlersRegistry';\r\nimport RNGestureHandlerModule from '../../RNGestureHandlerModule';\r\nimport {\r\n baseGestureHandlerWithMonitorProps,\r\n filterConfig,\r\n findNodeHandle,\r\n GestureTouchEvent,\r\n GestureUpdateEvent,\r\n GestureStateChangeEvent,\r\n HandlerStateChangeEvent,\r\n scheduleFlushOperations,\r\n UserSelect,\r\n} from '../gestureHandlerCommon';\r\nimport {\r\n GestureStateManager,\r\n GestureStateManagerType,\r\n} from './gestureStateManager';\r\nimport { flingGestureHandlerProps } from '../FlingGestureHandler';\r\nimport { forceTouchGestureHandlerProps } from '../ForceTouchGestureHandler';\r\nimport { longPressGestureHandlerProps } from '../LongPressGestureHandler';\r\nimport {\r\n panGestureHandlerProps,\r\n panGestureHandlerCustomNativeProps,\r\n} from '../PanGestureHandler';\r\nimport { tapGestureHandlerProps } from '../TapGestureHandler';\r\nimport { hoverGestureHandlerProps } from './hoverGesture';\r\nimport { State } from '../../State';\r\nimport { TouchEventType } from '../../TouchEventType';\r\nimport { ComposedGesture } from './gestureComposition';\r\nimport { ActionType } from '../../ActionType';\r\nimport { isFabric, isJestEnv, tagMessage } from '../../utils';\r\nimport { getReactNativeVersion } from '../../getReactNativeVersion';\r\nimport { getShadowNodeFromRef } from '../../getShadowNodeFromRef';\r\nimport { Platform } from 'react-native';\r\nimport type RNGestureHandlerModuleWeb from '../../RNGestureHandlerModule.web';\r\nimport { onGestureHandlerEvent } from './eventReceiver';\r\nimport { RNRenderer } from '../../RNRenderer';\r\nimport { isNewWebImplementationEnabled } from '../../EnableNewWebImplementation';\r\nimport { nativeViewGestureHandlerProps } from '../NativeViewGestureHandler';\r\nimport GestureHandlerRootViewContext from '../../GestureHandlerRootViewContext';\r\nimport { ghQueueMicrotask } from '../../ghQueueMicrotask';\r\n\r\ndeclare const global: {\r\n isFormsStackingContext: (node: unknown) => boolean | null; // JSI function\r\n};\r\n\r\nconst ALLOWED_PROPS = [\r\n ...baseGestureHandlerWithMonitorProps,\r\n ...tapGestureHandlerProps,\r\n ...panGestureHandlerProps,\r\n ...panGestureHandlerCustomNativeProps,\r\n ...longPressGestureHandlerProps,\r\n ...forceTouchGestureHandlerProps,\r\n ...flingGestureHandlerProps,\r\n ...hoverGestureHandlerProps,\r\n ...nativeViewGestureHandlerProps,\r\n];\r\n\r\nexport type GestureConfigReference = {\r\n config: GestureType[];\r\n animatedEventHandler: unknown;\r\n animatedHandlers: SharedValue<\r\n HandlerCallbacks<Record<string, unknown>>[] | null\r\n > | null;\r\n firstExecution: boolean;\r\n useReanimatedHook: boolean;\r\n};\r\n\r\nfunction convertToHandlerTag(ref: GestureRef): number {\r\n if (typeof ref === 'number') {\r\n return ref;\r\n } else if (ref instanceof BaseGesture) {\r\n return ref.handlerTag;\r\n } else {\r\n // @ts-ignore in this case it should be a ref either to gesture object or\r\n // a gesture handler component, in both cases handlerTag property exists\r\n return ref.current?.handlerTag ?? -1;\r\n }\r\n}\r\n\r\nfunction extractValidHandlerTags(interactionGroup: GestureRef[] | undefined) {\r\n return (\r\n interactionGroup?.map(convertToHandlerTag)?.filter((tag) => tag > 0) ?? []\r\n );\r\n}\r\n\r\nfunction dropHandlers(preparedGesture: GestureConfigReference) {\r\n for (const handler of preparedGesture.config) {\r\n RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);\r\n\r\n unregisterHandler(handler.handlerTag, handler.config.testId);\r\n }\r\n\r\n scheduleFlushOperations();\r\n}\r\n\r\nfunction checkGestureCallbacksForWorklets(gesture: GestureType) {\r\n // if a gesture is explicitly marked to run on the JS thread there is no need to check\r\n // if callbacks are worklets as the user is aware they will be ran on the JS thread\r\n if (gesture.config.runOnJS) {\r\n return;\r\n }\r\n\r\n const areSomeNotWorklets = gesture.handlers.isWorklet.includes(false);\r\n const areSomeWorklets = gesture.handlers.isWorklet.includes(true);\r\n\r\n // if some of the callbacks are worklets and some are not, and the gesture is not\r\n // explicitly marked with `.runOnJS(true)` show an error\r\n if (areSomeNotWorklets && areSomeWorklets) {\r\n console.error(\r\n tagMessage(\r\n `Some of the callbacks in the gesture are worklets and some are not. Either make sure that all calbacks are marked as 'worklet' if you wish to run them on the UI thread or use '.runOnJS(true)' modifier on the gesture explicitly to run all callbacks on the JS thread.`\r\n )\r\n );\r\n }\r\n}\r\n\r\ninterface WebEventHandler {\r\n onGestureHandlerEvent: (event: HandlerStateChangeEvent<unknown>) => void;\r\n onGestureHandlerStateChange?: (\r\n event: HandlerStateChangeEvent<unknown>\r\n ) => void;\r\n}\r\n\r\ninterface AttachHandlersConfig {\r\n preparedGesture: GestureConfigReference;\r\n gestureConfig: ComposedGesture | GestureType;\r\n gesture: GestureType[];\r\n viewTag: number;\r\n webEventHandlersRef: React.RefObject<WebEventHandler>;\r\n mountedRef: React.RefObject<boolean>;\r\n}\r\n\r\nfunction attachHandlers({\r\n preparedGesture,\r\n gestureConfig,\r\n gesture,\r\n viewTag,\r\n webEventHandlersRef,\r\n mountedRef,\r\n}: AttachHandlersConfig) {\r\n if (!preparedGesture.firstExecution) {\r\n gestureConfig.initialize();\r\n } else {\r\n preparedGesture.firstExecution = false;\r\n }\r\n\r\n // use queueMicrotask to extract handlerTags, because all refs should be initialized\r\n // when it's ran\r\n ghQueueMicrotask(() => {\r\n if (!mountedRef.current) {\r\n return;\r\n }\r\n gestureConfig.prepare();\r\n });\r\n\r\n for (const handler of gesture) {\r\n checkGestureCallbacksForWorklets(handler);\r\n RNGestureHandlerModule.createGestureHandler(\r\n handler.handlerName,\r\n handler.handlerTag,\r\n filterConfig(handler.config, ALLOWED_PROPS)\r\n );\r\n\r\n registerHandler(handler.handlerTag, handler, handler.config.testId);\r\n }\r\n\r\n // use queueMicrotask to extract handlerTags, because all refs should be initialized\r\n // when it's ran\r\n ghQueueMicrotask(() => {\r\n if (!mountedRef.current) {\r\n return;\r\n }\r\n for (const handler of gesture) {\r\n let requireToFail: number[] = [];\r\n if (handler.config.requireToFail) {\r\n requireToFail = extractValidHandlerTags(handler.config.requireToFail);\r\n }\r\n\r\n let simultaneousWith: number[] = [];\r\n if (handler.config.simultaneousWith) {\r\n simultaneousWith = extractValidHandlerTags(\r\n handler.config.simultaneousWith\r\n );\r\n }\r\n\r\n let blocksHandlers: number[] = [];\r\n if (handler.config.blocksHandlers) {\r\n blocksHandlers = extractValidHandlerTags(handler.config.blocksHandlers);\r\n }\r\n\r\n RNGestureHandlerModule.updateGestureHandler(\r\n handler.handlerTag,\r\n filterConfig(handler.config, ALLOWED_PROPS, {\r\n simultaneousHandlers: simultaneousWith,\r\n waitFor: requireToFail,\r\n blocksHandlers: blocksHandlers,\r\n })\r\n );\r\n }\r\n\r\n scheduleFlushOperations();\r\n });\r\n\r\n preparedGesture.config = gesture;\r\n\r\n for (const gesture of preparedGesture.config) {\r\n const actionType = gesture.shouldUseReanimated\r\n ? ActionType.REANIMATED_WORKLET\r\n : ActionType.JS_FUNCTION_NEW_API;\r\n\r\n if (Platform.OS === 'web') {\r\n (\r\n RNGestureHandlerModule.attachGestureHandler as typeof RNGestureHandlerModuleWeb.attachGestureHandler\r\n )(\r\n gesture.handlerTag,\r\n viewTag,\r\n ActionType.JS_FUNCTION_OLD_API, // ignored on web\r\n webEventHandlersRef\r\n );\r\n } else {\r\n RNGestureHandlerModule.attachGestureHandler(\r\n gesture.handlerTag,\r\n viewTag,\r\n actionType\r\n );\r\n }\r\n }\r\n\r\n if (preparedGesture.animatedHandlers) {\r\n const isAnimatedGesture = (g: GestureType) => g.shouldUseReanimated;\r\n\r\n preparedGesture.animatedHandlers.value = gesture\r\n .filter(isAnimatedGesture)\r\n .map((g) => g.handlers) as unknown as HandlerCallbacks<\r\n Record<string, unknown>\r\n >[];\r\n }\r\n}\r\n\r\nfunction updateHandlers(\r\n preparedGesture: GestureConfigReference,\r\n gestureConfig: ComposedGesture | GestureType,\r\n gesture: GestureType[],\r\n mountedRef: React.RefObject<boolean>\r\n) {\r\n gestureConfig.prepare();\r\n\r\n for (let i = 0; i < gesture.length; i++) {\r\n const handler = preparedGesture.config[i];\r\n checkGestureCallbacksForWorklets(handler);\r\n\r\n // only update handlerTag when it's actually different, it may be the same\r\n // if gesture config object is wrapped with useMemo\r\n if (gesture[i].handlerTag !== handler.handlerTag) {\r\n gesture[i].handlerTag = handler.handlerTag;\r\n gesture[i].handlers.handlerTag = handler.handlerTag;\r\n }\r\n }\r\n\r\n // use queueMicrotask to extract handlerTags, because when it's ran, all refs should be updated\r\n // and handlerTags in BaseGesture references should be updated in the loop above (we need to wait\r\n // in case of external relations)\r\n ghQueueMicrotask(() => {\r\n if (!mountedRef.current) {\r\n return;\r\n }\r\n for (let i = 0; i < gesture.length; i++) {\r\n const handler = preparedGesture.config[i];\r\n\r\n handler.config = gesture[i].config;\r\n handler.handlers = gesture[i].handlers;\r\n\r\n const requireToFail = extractValidHandlerTags(\r\n handler.config.requireToFail\r\n );\r\n\r\n const simultaneousWith = extractValidHandlerTags(\r\n handler.config.simultaneousWith\r\n );\r\n\r\n RNGestureHandlerModule.updateGestureHandler(\r\n handler.handlerTag,\r\n filterConfig(handler.config, ALLOWED_PROPS, {\r\n simultaneousHandlers: simultaneousWith,\r\n waitFor: requireToFail,\r\n })\r\n );\r\n\r\n registerHandler(handler.handlerTag, handler, handler.config.testId);\r\n }\r\n\r\n if (preparedGesture.animatedHandlers) {\r\n const previousHandlersValue =\r\n preparedGesture.animatedHandlers.value ?? [];\r\n const newHandlersValue = preparedGesture.config\r\n .filter((g) => g.shouldUseReanimated) // ignore gestures that shouldn't run on UI\r\n .map((g) => g.handlers) as unknown as HandlerCallbacks<\r\n Record<string, unknown>\r\n >[];\r\n\r\n // if amount of gesture configs changes, we need to update the callbacks in shared value\r\n let shouldUpdateSharedValue =\r\n previousHandlersValue.length !== newHandlersValue.length;\r\n\r\n if (!shouldUpdateSharedValue) {\r\n // if the amount is the same, we need to check if any of the configs inside has changed\r\n for (let i = 0; i < newHandlersValue.length; i++) {\r\n if (\r\n // we can use the `gestureId` prop as it's unique for every config instance\r\n newHandlersValue[i].gestureId !== previousHandlersValue[i].gestureId\r\n ) {\r\n shouldUpdateSharedValue = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (shouldUpdateSharedValue) {\r\n preparedGesture.animatedHandlers.value = newHandlersValue;\r\n }\r\n }\r\n\r\n scheduleFlushOperations();\r\n });\r\n}\r\n\r\nfunction needsToReattach(\r\n preparedGesture: GestureConfigReference,\r\n gesture: GestureType[]\r\n) {\r\n if (gesture.length !== preparedGesture.config.length) {\r\n return true;\r\n }\r\n for (let i = 0; i < gesture.length; i++) {\r\n if (\r\n gesture[i].handlerName !== preparedGesture.config[i].handlerName ||\r\n gesture[i].shouldUseReanimated !==\r\n preparedGesture.config[i].shouldUseReanimated\r\n ) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction isStateChangeEvent(\r\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\r\n): event is GestureStateChangeEvent {\r\n 'worklet';\r\n // @ts-ignore Yes, the oldState prop is missing on GestureTouchEvent, that's the point\r\n return event.oldState != null;\r\n}\r\n\r\nfunction isTouchEvent(\r\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\r\n): event is GestureTouchEvent {\r\n 'worklet';\r\n return event.eventType != null;\r\n}\r\n\r\nfunction getHandler(\r\n type: CALLBACK_TYPE,\r\n gesture: HandlerCallbacks<Record<string, unknown>>\r\n) {\r\n 'worklet';\r\n switch (type) {\r\n case CALLBACK_TYPE.BEGAN:\r\n return gesture.onBegin;\r\n case CALLBACK_TYPE.START:\r\n return gesture.onStart;\r\n case CALLBACK_TYPE.UPDATE:\r\n return gesture.onUpdate;\r\n case CALLBACK_TYPE.CHANGE:\r\n return gesture.onChange;\r\n case CALLBACK_TYPE.END:\r\n return gesture.onEnd;\r\n case CALLBACK_TYPE.FINALIZE:\r\n return gesture.onFinalize;\r\n case CALLBACK_TYPE.TOUCHES_DOWN:\r\n return gesture.onTouchesDown;\r\n case CALLBACK_TYPE.TOUCHES_MOVE:\r\n return gesture.onTouchesMove;\r\n case CALLBACK_TYPE.TOUCHES_UP:\r\n return gesture.onTouchesUp;\r\n case CALLBACK_TYPE.TOUCHES_CANCELLED:\r\n return gesture.onTouchesCancelled;\r\n }\r\n}\r\n\r\nfunction touchEventTypeToCallbackType(\r\n eventType: TouchEventType\r\n): CALLBACK_TYPE {\r\n 'worklet';\r\n switch (eventType) {\r\n case TouchEventType.TOUCHES_DOWN:\r\n return CALLBACK_TYPE.TOUCHES_DOWN;\r\n case TouchEventType.TOUCHES_MOVE:\r\n return CALLBACK_TYPE.TOUCHES_MOVE;\r\n case TouchEventType.TOUCHES_UP:\r\n return CALLBACK_TYPE.TOUCHES_UP;\r\n case TouchEventType.TOUCHES_CANCELLED:\r\n return CALLBACK_TYPE.TOUCHES_CANCELLED;\r\n }\r\n return CALLBACK_TYPE.UNDEFINED;\r\n}\r\n\r\nfunction runWorklet(\r\n type: CALLBACK_TYPE,\r\n gesture: HandlerCallbacks<Record<string, unknown>>,\r\n event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent,\r\n ...args: any[]\r\n) {\r\n 'worklet';\r\n const handler = getHandler(type, gesture);\r\n if (gesture.isWorklet[type]) {\r\n // @ts-ignore Logic below makes sure the correct event is send to the\r\n // correct handler.\r\n handler?.(event, ...args);\r\n } else if (handler) {\r\n console.warn(tagMessage('Animated gesture callback must be a worklet'));\r\n }\r\n}\r\n\r\nfunction useAnimatedGesture(\r\n preparedGesture: GestureConfigReference,\r\n needsRebuild: boolean\r\n) {\r\n if (!Reanimated) {\r\n return;\r\n }\r\n\r\n // Hooks are called conditionally, but the condition is whether the\r\n // react-native-reanimated is installed, which shouldn't change while running\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n const sharedHandlersCallbacks = Reanimated.useSharedValue<\r\n HandlerCallbacks<Record<string, unknown>>[] | null\r\n >(null);\r\n\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n const lastUpdateEvent = Reanimated.useSharedValue<\r\n (GestureUpdateEvent | undefined)[]\r\n >([]);\r\n\r\n // not every gesture needs a state controller, init them lazily\r\n const stateControllers: GestureStateManagerType[] = [];\r\n\r\n const callback = (\r\n event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent\r\n ) => {\r\n 'worklet';\r\n\r\n const currentCallback = sharedHandlersCallbacks.value;\r\n if (!currentCallback) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < currentCallback.length; i++) {\r\n const gesture = currentCallback[i];\r\n\r\n if (event.handlerTag === gesture.handlerTag) {\r\n if (isStateChangeEvent(event)) {\r\n if (\r\n event.oldState === State.UNDETERMINED &&\r\n event.state === State.BEGAN\r\n ) {\r\n runWorklet(CALLBACK_TYPE.BEGAN, gesture, event);\r\n } else if (\r\n (event.oldState === State.BEGAN ||\r\n event.oldState === State.UNDETERMINED) &&\r\n event.state === State.ACTIVE\r\n ) {\r\n runWorklet(CALLBACK_TYPE.START, gesture, event);\r\n lastUpdateEvent.value[gesture.handlerTag] = undefined;\r\n } else if (\r\n event.oldState !== event.state &&\r\n event.state === State.END\r\n ) {\r\n if (event.oldState === State.ACTIVE) {\r\n runWorklet(CALLBACK_TYPE.END, gesture, event, true);\r\n }\r\n runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, true);\r\n } else if (\r\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\r\n event.state !== event.oldState\r\n ) {\r\n if (event.oldState === State.ACTIVE) {\r\n runWorklet(CALLBACK_TYPE.END, gesture, event, false);\r\n }\r\n runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, false);\r\n }\r\n } else if (isTouchEvent(event)) {\r\n if (!stateControllers[i]) {\r\n stateControllers[i] = GestureStateManager.create(event.handlerTag);\r\n }\r\n\r\n if (event.eventType !== TouchEventType.UNDETERMINED) {\r\n runWorklet(\r\n touchEventTypeToCallbackType(event.eventType),\r\n gesture,\r\n event,\r\n stateControllers[i]\r\n );\r\n }\r\n } else {\r\n runWorklet(CALLBACK_TYPE.UPDATE, gesture, event);\r\n\r\n if (gesture.onChange && gesture.changeEventCalculator) {\r\n runWorklet(\r\n CALLBACK_TYPE.CHANGE,\r\n gesture,\r\n gesture.changeEventCalculator?.(\r\n event,\r\n lastUpdateEvent.value[gesture.handlerTag]\r\n )\r\n );\r\n\r\n lastUpdateEvent.value[gesture.handlerTag] = event;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n const event = Reanimated.useEvent(\r\n callback,\r\n ['onGestureHandlerStateChange', 'onGestureHandlerEvent'],\r\n needsRebuild\r\n );\r\n\r\n preparedGesture.animatedEventHandler = event;\r\n preparedGesture.animatedHandlers = sharedHandlersCallbacks;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nfunction validateDetectorChildren(ref: any) {\r\n // finds the first native view under the Wrap component and traverses the fiber tree upwards\r\n // to check whether there is more than one native view as a pseudo-direct child of GestureDetector\r\n // i.e. this is not ok:\r\n // Wrap\r\n // |\r\n // / \\\r\n // / \\\r\n // / \\\r\n // / \\\r\n // NativeView NativeView\r\n //\r\n // but this is fine:\r\n // Wrap\r\n // |\r\n // NativeView\r\n // |\r\n // / \\\r\n // / \\\r\n // / \\\r\n // / \\\r\n // NativeView NativeView\r\n if (__DEV__ && Platform.OS !== 'web') {\r\n const REACT_NATIVE_VERSION = getReactNativeVersion();\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\r\n const wrapType =\r\n REACT_NATIVE_VERSION.minor > 63 || REACT_NATIVE_VERSION.major > 0\r\n ? // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\r\n ref._reactInternals.elementType\r\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\r\n ref._reactInternalFiber.elementType;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\r\n let instance =\r\n RNRenderer.findHostInstance_DEPRECATED(\r\n ref\r\n )._internalFiberInstanceHandleDEV;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\r\n while (instance && instance.elementType !== wrapType) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\r\n if (instance.sibling) {\r\n throw new Error(\r\n 'GestureDetector has more than one native view as its children. This can happen if you are using a custom component that renders multiple views, like React.Fragment. You should wrap content of GestureDetector with a <View> or <Animated.View>.'\r\n );\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\r\n instance = instance.return;\r\n }\r\n }\r\n}\r\n\r\nconst applyUserSelectProp = (\r\n userSelect: UserSelect,\r\n gesture: ComposedGesture | GestureType\r\n): void => {\r\n for (const g of gesture.toGestureArray()) {\r\n g.config.userSelect = userSelect;\r\n }\r\n};\r\n\r\ninterface GestureDetectorProps {\r\n gesture: ComposedGesture | GestureType;\r\n userSelect?: UserSelect;\r\n children?: React.ReactNode;\r\n}\r\ninterface GestureDetectorState {\r\n firstRender: boolean;\r\n viewRef: React.Component | null;\r\n previousViewTag: number;\r\n forceReattach: boolean;\r\n}\r\nexport const GestureDetector = (props: GestureDetectorProps) => {\r\n const rootViewContext = useContext(GestureHandlerRootViewContext);\r\n if (__DEV__ && !rootViewContext && !isJestEnv() && Platform.OS !== 'web') {\r\n throw new Error(\r\n 'GestureDetector 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.'\r\n );\r\n }\r\n\r\n const gestureConfig = props.gesture;\r\n\r\n if (props.userSelect) {\r\n applyUserSelectProp(props.userSelect, gestureConfig);\r\n }\r\n\r\n const gesture = gestureConfig.toGestureArray();\r\n const useReanimatedHook = gesture.some((g) => g.shouldUseReanimated);\r\n\r\n // store state in ref to prevent unnecessary renders\r\n const state = useRef<GestureDetectorState>({\r\n firstRender: true,\r\n viewRef: null,\r\n previousViewTag: -1,\r\n forceReattach: false,\r\n }).current;\r\n const mountedRef = useRef(false);\r\n const webEventHandlersRef = useRef<WebEventHandler>({\r\n onGestureHandlerEvent: (e: HandlerStateChangeEvent<unknown>) => {\r\n onGestureHandlerEvent(e.nativeEvent);\r\n },\r\n onGestureHandlerStateChange: isNewWebImplementationEnabled()\r\n ? (e: HandlerStateChangeEvent<unknown>) => {\r\n onGestureHandlerEvent(e.nativeEvent);\r\n }\r\n : undefined,\r\n });\r\n\r\n const [renderState, setRenderState] = useState(false);\r\n function forceRender() {\r\n setRenderState(!renderState);\r\n }\r\n\r\n const preparedGesture = React.useRef<GestureConfigReference>({\r\n config: gesture,\r\n animatedEventHandler: null,\r\n animatedHandlers: null,\r\n firstExecution: true,\r\n useReanimatedHook: useReanimatedHook,\r\n }).current;\r\n\r\n if (useReanimatedHook !== preparedGesture.useReanimatedHook) {\r\n throw new Error(\r\n tagMessage(\r\n 'You cannot change the thread the callbacks are ran on while the app is running'\r\n )\r\n );\r\n }\r\n\r\n function onHandlersUpdate(skipConfigUpdate?: boolean) {\r\n // if the underlying view has changed we need to reattach handlers to the new view\r\n const viewTag = findNodeHandle(state.viewRef) as number;\r\n const forceReattach = viewTag !== state.previousViewTag;\r\n\r\n if (forceReattach || needsToReattach(preparedGesture, gesture)) {\r\n validateDetectorChildren(state.viewRef);\r\n dropHandlers(preparedGesture);\r\n attachHandlers({\r\n preparedGesture,\r\n gestureConfig,\r\n gesture,\r\n webEventHandlersRef,\r\n viewTag,\r\n mountedRef,\r\n });\r\n\r\n state.previousViewTag = viewTag;\r\n state.forceReattach = forceReattach;\r\n if (forceReattach) {\r\n forceRender();\r\n }\r\n } else if (!skipConfigUpdate) {\r\n updateHandlers(preparedGesture, gestureConfig, gesture, mountedRef);\r\n }\r\n }\r\n\r\n // Reanimated event should be rebuilt only when gestures are reattached, otherwise\r\n // config update will be enough as all necessary items are stored in shared values anyway\r\n const needsToRebuildReanimatedEvent =\r\n preparedGesture.firstExecution ||\r\n needsToReattach(preparedGesture, gesture) ||\r\n state.forceReattach;\r\n\r\n state.forceReattach = false;\r\n\r\n if (preparedGesture.firstExecution) {\r\n gestureConfig.initialize();\r\n }\r\n\r\n if (useReanimatedHook) {\r\n // Whether animatedGesture or gesture is used shouldn't change while the app is running\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);\r\n }\r\n\r\n useEffect(() => {\r\n const viewTag = findNodeHandle(state.viewRef) as number;\r\n state.firstRender = true;\r\n mountedRef.current = true;\r\n\r\n validateDetectorChildren(state.viewRef);\r\n\r\n attachHandlers({\r\n preparedGesture,\r\n gestureConfig,\r\n gesture,\r\n webEventHandlersRef,\r\n viewTag,\r\n mountedRef,\r\n });\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n dropHandlers(preparedGesture);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!state.firstRender) {\r\n onHandlersUpdate();\r\n } else {\r\n state.firstRender = false;\r\n }\r\n }, [props]);\r\n\r\n const refFunction = (ref: unknown) => {\r\n if (ref !== null) {\r\n // @ts-ignore Just setting the view ref\r\n state.viewRef = ref;\r\n\r\n // if it's the first render, also set the previousViewTag to prevent reattaching gestures when not needed\r\n if (state.previousViewTag === -1) {\r\n state.previousViewTag = findNodeHandle(state.viewRef) as number;\r\n }\r\n\r\n // pass true as `skipConfigUpdate`, here we only want to trigger the eventual reattaching of handlers\r\n // in case the view has changed, while config update would be handled be the `useEffect` above\r\n onHandlersUpdate(true);\r\n\r\n if (isFabric()) {\r\n const node = getShadowNodeFromRef(ref);\r\n if (global.isFormsStackingContext(node) === false) {\r\n console.error(\r\n tagMessage(\r\n 'GestureDetector has received a child that may get view-flattened. ' +\r\n '\\nTo prevent it from misbehaving you need to wrap the child with a `<View collapsable={false}>`.'\r\n )\r\n );\r\n }\r\n }\r\n }\r\n };\r\n\r\n if (useReanimatedHook) {\r\n return (\r\n <AnimatedWrap\r\n ref={refFunction}\r\n onGestureHandlerEvent={preparedGesture.animatedEventHandler}>\r\n {props.children}\r\n </AnimatedWrap>\r\n );\r\n } else {\r\n return <Wrap ref={refFunction}>{props.children}</Wrap>;\r\n }\r\n};\r\n\r\nclass Wrap extends React.Component<{\r\n onGestureHandlerEvent?: unknown;\r\n // implicit `children` prop has been removed in @types/react^18.0.0\r\n children?: React.ReactNode;\r\n}> {\r\n render() {\r\n try {\r\n // I don't think that fighting with types over such a simple function is worth it\r\n // The only thing it does is add 'collapsable: false' to the child component\r\n // to make sure it is in the native view hierarchy so the detector can find\r\n // correct viewTag to attach to.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const child: any = React.Children.only(this.props.children);\r\n return React.cloneElement(\r\n child,\r\n { collapsable: false },\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\r\n child.props.children\r\n );\r\n } catch (e) {\r\n throw new Error(\r\n tagMessage(\r\n `GestureDetector 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.`\r\n )\r\n );\r\n }\r\n }\r\n}\r\n\r\nconst AnimatedWrap = Reanimated?.default?.createAnimatedComponent(Wrap) ?? Wrap;\r\n"]}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.onGestureHandlerEvent = onGestureHandlerEvent;
|
7
|
+
exports.startListening = startListening;
|
8
|
+
exports.stopListening = stopListening;
|
9
|
+
|
10
|
+
var _reactNative = require("react-native");
|
11
|
+
|
12
|
+
var _State = require("../../State");
|
13
|
+
|
14
|
+
var _TouchEventType = require("../../TouchEventType");
|
15
|
+
|
16
|
+
var _handlersRegistry = require("../handlersRegistry");
|
17
|
+
|
18
|
+
var _gestureStateManager = require("./gestureStateManager");
|
19
|
+
|
20
|
+
let gestureHandlerEventSubscription = null;
|
21
|
+
let gestureHandlerStateChangeEventSubscription = null;
|
22
|
+
const gestureStateManagers = new Map();
|
23
|
+
const lastUpdateEvent = [];
|
24
|
+
|
25
|
+
function isStateChangeEvent(event) {
|
26
|
+
// @ts-ignore oldState doesn't exist on GestureTouchEvent and that's the point
|
27
|
+
return event.oldState != null;
|
28
|
+
}
|
29
|
+
|
30
|
+
function isTouchEvent(event) {
|
31
|
+
return event.eventType != null;
|
32
|
+
}
|
33
|
+
|
34
|
+
function onGestureHandlerEvent(event) {
|
35
|
+
var _handler$handlers7, _handler$handlers7$on, _handler$handlers8, _handler$handlers8$on, _handler$handlers9, _handler$handlers9$on, _handler$handlers10, _handler$handlers10$o;
|
36
|
+
|
37
|
+
const handler = (0, _handlersRegistry.findHandler)(event.handlerTag);
|
38
|
+
|
39
|
+
if (handler) {
|
40
|
+
if (isStateChangeEvent(event)) {
|
41
|
+
if (event.oldState === _State.State.UNDETERMINED && event.state === _State.State.BEGAN) {
|
42
|
+
var _handler$handlers$onB, _handler$handlers;
|
43
|
+
|
44
|
+
(_handler$handlers$onB = (_handler$handlers = handler.handlers).onBegin) === null || _handler$handlers$onB === void 0 ? void 0 : _handler$handlers$onB.call(_handler$handlers, event);
|
45
|
+
} else if ((event.oldState === _State.State.BEGAN || event.oldState === _State.State.UNDETERMINED) && event.state === _State.State.ACTIVE) {
|
46
|
+
var _handler$handlers$onS, _handler$handlers2;
|
47
|
+
|
48
|
+
(_handler$handlers$onS = (_handler$handlers2 = handler.handlers).onStart) === null || _handler$handlers$onS === void 0 ? void 0 : _handler$handlers$onS.call(_handler$handlers2, event);
|
49
|
+
lastUpdateEvent[handler.handlers.handlerTag] = event;
|
50
|
+
} else if (event.oldState !== event.state && event.state === _State.State.END) {
|
51
|
+
var _handler$handlers$onF, _handler$handlers4;
|
52
|
+
|
53
|
+
if (event.oldState === _State.State.ACTIVE) {
|
54
|
+
var _handler$handlers$onE, _handler$handlers3;
|
55
|
+
|
56
|
+
(_handler$handlers$onE = (_handler$handlers3 = handler.handlers).onEnd) === null || _handler$handlers$onE === void 0 ? void 0 : _handler$handlers$onE.call(_handler$handlers3, event, true);
|
57
|
+
}
|
58
|
+
|
59
|
+
(_handler$handlers$onF = (_handler$handlers4 = handler.handlers).onFinalize) === null || _handler$handlers$onF === void 0 ? void 0 : _handler$handlers$onF.call(_handler$handlers4, event, true);
|
60
|
+
lastUpdateEvent[handler.handlers.handlerTag] = undefined;
|
61
|
+
} else if ((event.state === _State.State.FAILED || event.state === _State.State.CANCELLED) && event.oldState !== event.state) {
|
62
|
+
var _handler$handlers$onF2, _handler$handlers6;
|
63
|
+
|
64
|
+
if (event.oldState === _State.State.ACTIVE) {
|
65
|
+
var _handler$handlers$onE2, _handler$handlers5;
|
66
|
+
|
67
|
+
(_handler$handlers$onE2 = (_handler$handlers5 = handler.handlers).onEnd) === null || _handler$handlers$onE2 === void 0 ? void 0 : _handler$handlers$onE2.call(_handler$handlers5, event, false);
|
68
|
+
}
|
69
|
+
|
70
|
+
(_handler$handlers$onF2 = (_handler$handlers6 = handler.handlers).onFinalize) === null || _handler$handlers$onF2 === void 0 ? void 0 : _handler$handlers$onF2.call(_handler$handlers6, event, false);
|
71
|
+
gestureStateManagers.delete(event.handlerTag);
|
72
|
+
lastUpdateEvent[handler.handlers.handlerTag] = undefined;
|
73
|
+
}
|
74
|
+
} else if (isTouchEvent(event)) {
|
75
|
+
if (!gestureStateManagers.has(event.handlerTag)) {
|
76
|
+
gestureStateManagers.set(event.handlerTag, _gestureStateManager.GestureStateManager.create(event.handlerTag));
|
77
|
+
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
78
|
+
|
79
|
+
|
80
|
+
const manager = gestureStateManagers.get(event.handlerTag);
|
81
|
+
|
82
|
+
switch (event.eventType) {
|
83
|
+
case _TouchEventType.TouchEventType.TOUCHES_DOWN:
|
84
|
+
(_handler$handlers7 = handler.handlers) === null || _handler$handlers7 === void 0 ? void 0 : (_handler$handlers7$on = _handler$handlers7.onTouchesDown) === null || _handler$handlers7$on === void 0 ? void 0 : _handler$handlers7$on.call(_handler$handlers7, event, manager);
|
85
|
+
break;
|
86
|
+
|
87
|
+
case _TouchEventType.TouchEventType.TOUCHES_MOVE:
|
88
|
+
(_handler$handlers8 = handler.handlers) === null || _handler$handlers8 === void 0 ? void 0 : (_handler$handlers8$on = _handler$handlers8.onTouchesMove) === null || _handler$handlers8$on === void 0 ? void 0 : _handler$handlers8$on.call(_handler$handlers8, event, manager);
|
89
|
+
break;
|
90
|
+
|
91
|
+
case _TouchEventType.TouchEventType.TOUCHES_UP:
|
92
|
+
(_handler$handlers9 = handler.handlers) === null || _handler$handlers9 === void 0 ? void 0 : (_handler$handlers9$on = _handler$handlers9.onTouchesUp) === null || _handler$handlers9$on === void 0 ? void 0 : _handler$handlers9$on.call(_handler$handlers9, event, manager);
|
93
|
+
break;
|
94
|
+
|
95
|
+
case _TouchEventType.TouchEventType.TOUCHES_CANCELLED:
|
96
|
+
(_handler$handlers10 = handler.handlers) === null || _handler$handlers10 === void 0 ? void 0 : (_handler$handlers10$o = _handler$handlers10.onTouchesCancelled) === null || _handler$handlers10$o === void 0 ? void 0 : _handler$handlers10$o.call(_handler$handlers10, event, manager);
|
97
|
+
break;
|
98
|
+
}
|
99
|
+
} else {
|
100
|
+
var _handler$handlers$onU, _handler$handlers11;
|
101
|
+
|
102
|
+
(_handler$handlers$onU = (_handler$handlers11 = handler.handlers).onUpdate) === null || _handler$handlers$onU === void 0 ? void 0 : _handler$handlers$onU.call(_handler$handlers11, event);
|
103
|
+
|
104
|
+
if (handler.handlers.onChange && handler.handlers.changeEventCalculator) {
|
105
|
+
var _handler$handlers$onC, _handler$handlers12, _handler$handlers$cha, _handler$handlers13;
|
106
|
+
|
107
|
+
(_handler$handlers$onC = (_handler$handlers12 = handler.handlers).onChange) === null || _handler$handlers$onC === void 0 ? void 0 : _handler$handlers$onC.call(_handler$handlers12, (_handler$handlers$cha = (_handler$handlers13 = handler.handlers).changeEventCalculator) === null || _handler$handlers$cha === void 0 ? void 0 : _handler$handlers$cha.call(_handler$handlers13, event, lastUpdateEvent[handler.handlers.handlerTag]));
|
108
|
+
lastUpdateEvent[handler.handlers.handlerTag] = event;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
} else {
|
112
|
+
const oldHandler = (0, _handlersRegistry.findOldGestureHandler)(event.handlerTag);
|
113
|
+
|
114
|
+
if (oldHandler) {
|
115
|
+
const nativeEvent = {
|
116
|
+
nativeEvent: event
|
117
|
+
};
|
118
|
+
|
119
|
+
if (isStateChangeEvent(event)) {
|
120
|
+
oldHandler.onGestureStateChange(nativeEvent);
|
121
|
+
} else {
|
122
|
+
oldHandler.onGestureEvent(nativeEvent);
|
123
|
+
}
|
124
|
+
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
function startListening() {
|
131
|
+
stopListening();
|
132
|
+
gestureHandlerEventSubscription = _reactNative.DeviceEventEmitter.addListener('onGestureHandlerEvent', onGestureHandlerEvent);
|
133
|
+
gestureHandlerStateChangeEventSubscription = _reactNative.DeviceEventEmitter.addListener('onGestureHandlerStateChange', onGestureHandlerEvent);
|
134
|
+
}
|
135
|
+
|
136
|
+
function stopListening() {
|
137
|
+
if (gestureHandlerEventSubscription) {
|
138
|
+
gestureHandlerEventSubscription.remove();
|
139
|
+
gestureHandlerEventSubscription = null;
|
140
|
+
}
|
141
|
+
|
142
|
+
if (gestureHandlerStateChangeEventSubscription) {
|
143
|
+
gestureHandlerStateChangeEventSubscription.remove();
|
144
|
+
gestureHandlerStateChangeEventSubscription = null;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
//# sourceMappingURL=eventReceiver.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["eventReceiver.ts"],"names":["gestureHandlerEventSubscription","gestureHandlerStateChangeEventSubscription","gestureStateManagers","Map","lastUpdateEvent","isStateChangeEvent","event","oldState","isTouchEvent","eventType","onGestureHandlerEvent","handler","handlerTag","State","UNDETERMINED","state","BEGAN","handlers","onBegin","ACTIVE","onStart","END","onEnd","onFinalize","undefined","FAILED","CANCELLED","delete","has","set","GestureStateManager","create","manager","get","TouchEventType","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","onUpdate","onChange","changeEventCalculator","oldHandler","nativeEvent","onGestureStateChange","onGestureEvent","startListening","stopListening","DeviceEventEmitter","addListener","remove"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAMA;;AAEA;;AAKA,IAAIA,+BAA2D,GAAG,IAAlE;AACA,IAAIC,0CAAsE,GACxE,IADF;AAGA,MAAMC,oBAA0D,GAAG,IAAIC,GAAJ,EAAnE;AAKA,MAAMC,eAAmD,GAAG,EAA5D;;AAEA,SAASC,kBAAT,CACEC,KADF,EAEoC;AAClC;AACA,SAAOA,KAAK,CAACC,QAAN,IAAkB,IAAzB;AACD;;AAED,SAASC,YAAT,CACEF,KADF,EAE8B;AAC5B,SAAOA,KAAK,CAACG,SAAN,IAAmB,IAA1B;AACD;;AAEM,SAASC,qBAAT,CACLJ,KADK,EAEL;AAAA;;AACA,QAAMK,OAAO,GAAG,mCAAYL,KAAK,CAACM,UAAlB,CAAhB;;AAIA,MAAID,OAAJ,EAAa;AACX,QAAIN,kBAAkB,CAACC,KAAD,CAAtB,EAA+B;AAC7B,UACEA,KAAK,CAACC,QAAN,KAAmBM,aAAMC,YAAzB,IACAR,KAAK,CAACS,KAAN,KAAgBF,aAAMG,KAFxB,EAGE;AAAA;;AACA,sDAAAL,OAAO,CAACM,QAAR,EAAiBC,OAAjB,wGAA2BZ,KAA3B;AACD,OALD,MAKO,IACL,CAACA,KAAK,CAACC,QAAN,KAAmBM,aAAMG,KAAzB,IACCV,KAAK,CAACC,QAAN,KAAmB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AACO,OAAO,CAACM,QAAR,CAAiBL,UAAlB,CAFjB,CADF;AAOAR,QAAAA,eAAe,CAACO,OAAO,CAACM,QAAR,CAAiBL,UAAlB,CAAf,GAA+CN,KAA/C;AACD;AACF;AACF,GAtED,MAsEO;AACL,UAAMwC,UAAU,GAAG,6CAAsBxC,KAAK,CAACM,UAA5B,CAAnB;;AACA,QAAIkC,UAAJ,EAAgB;AACd,YAAMC,WAAW,GAAG;AAAEA,QAAAA,WAAW,EAAEzC;AAAf,OAApB;;AACA,UAAID,kBAAkB,CAACC,KAAD,CAAtB,EAA+B;AAC7BwC,QAAAA,UAAU,CAACE,oBAAX,CAAgCD,WAAhC;AACD,OAFD,MAEO;AACLD,QAAAA,UAAU,CAACG,cAAX,CAA0BF,WAA1B;AACD;;AACD;AACD;AACF;AACF;;AAEM,SAASG,cAAT,GAA0B;AAC/BC,EAAAA,aAAa;AAEbnD,EAAAA,+BAA+B,GAAGoD,gCAAmBC,WAAnB,CAChC,uBADgC,EAEhC3C,qBAFgC,CAAlC;AAKAT,EAAAA,0CAA0C,GAAGmD,gCAAmBC,WAAnB,CAC3C,6BAD2C,EAE3C3C,qBAF2C,CAA7C;AAID;;AAEM,SAASyC,aAAT,GAAyB;AAC9B,MAAInD,+BAAJ,EAAqC;AACnCA,IAAAA,+BAA+B,CAACsD,MAAhC;AACAtD,IAAAA,+BAA+B,GAAG,IAAlC;AACD;;AAED,MAAIC,0CAAJ,EAAgD;AAC9CA,IAAAA,0CAA0C,CAACqD,MAA3C;AACArD,IAAAA,0CAA0C,GAAG,IAA7C;AACD;AACF","sourcesContent":["import { DeviceEventEmitter, EmitterSubscription } from 'react-native';\r\nimport { State } from '../../State';\r\nimport { TouchEventType } from '../../TouchEventType';\r\nimport {\r\n GestureTouchEvent,\r\n GestureUpdateEvent,\r\n GestureStateChangeEvent,\r\n} from '../gestureHandlerCommon';\r\nimport { findHandler, findOldGestureHandler } from '../handlersRegistry';\r\nimport { BaseGesture } from './gesture';\r\nimport {\r\n GestureStateManager,\r\n GestureStateManagerType,\r\n} from './gestureStateManager';\r\n\r\nlet gestureHandlerEventSubscription: EmitterSubscription | null = null;\r\nlet gestureHandlerStateChangeEventSubscription: EmitterSubscription | null =\r\n null;\r\n\r\nconst gestureStateManagers: Map<number, GestureStateManagerType> = new Map<\r\n number,\r\n GestureStateManagerType\r\n>();\r\n\r\nconst lastUpdateEvent: (GestureUpdateEvent | undefined)[] = [];\r\n\r\nfunction isStateChangeEvent(\r\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\r\n): event is GestureStateChangeEvent {\r\n // @ts-ignore oldState doesn't exist on GestureTouchEvent and that's the point\r\n return event.oldState != null;\r\n}\r\n\r\nfunction isTouchEvent(\r\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\r\n): event is GestureTouchEvent {\r\n return event.eventType != null;\r\n}\r\n\r\nexport function onGestureHandlerEvent(\r\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\r\n) {\r\n const handler = findHandler(event.handlerTag) as BaseGesture<\r\n Record<string, unknown>\r\n >;\r\n\r\n if (handler) {\r\n if (isStateChangeEvent(event)) {\r\n if (\r\n event.oldState === State.UNDETERMINED &&\r\n event.state === State.BEGAN\r\n ) {\r\n handler.handlers.onBegin?.(event);\r\n } else if (\r\n (event.oldState === State.BEGAN ||\r\n event.oldState === State.UNDETERMINED) &&\r\n event.state === State.ACTIVE\r\n ) {\r\n handler.handlers.onStart?.(event);\r\n lastUpdateEvent[handler.handlers.handlerTag] = event;\r\n } else if (event.oldState !== event.state && event.state === State.END) {\r\n if (event.oldState === State.ACTIVE) {\r\n handler.handlers.onEnd?.(event, true);\r\n }\r\n handler.handlers.onFinalize?.(event, true);\r\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\r\n } else if (\r\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\r\n event.oldState !== event.state\r\n ) {\r\n if (event.oldState === State.ACTIVE) {\r\n handler.handlers.onEnd?.(event, false);\r\n }\r\n handler.handlers.onFinalize?.(event, false);\r\n gestureStateManagers.delete(event.handlerTag);\r\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\r\n }\r\n } else if (isTouchEvent(event)) {\r\n if (!gestureStateManagers.has(event.handlerTag)) {\r\n gestureStateManagers.set(\r\n event.handlerTag,\r\n GestureStateManager.create(event.handlerTag)\r\n );\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n const manager = gestureStateManagers.get(event.handlerTag)!;\r\n\r\n switch (event.eventType) {\r\n case TouchEventType.TOUCHES_DOWN:\r\n handler.handlers?.onTouchesDown?.(event, manager);\r\n break;\r\n case TouchEventType.TOUCHES_MOVE:\r\n handler.handlers?.onTouchesMove?.(event, manager);\r\n break;\r\n case TouchEventType.TOUCHES_UP:\r\n handler.handlers?.onTouchesUp?.(event, manager);\r\n break;\r\n case TouchEventType.TOUCHES_CANCELLED:\r\n handler.handlers?.onTouchesCancelled?.(event, manager);\r\n break;\r\n }\r\n } else {\r\n handler.handlers.onUpdate?.(event);\r\n\r\n if (handler.handlers.onChange && handler.handlers.changeEventCalculator) {\r\n handler.handlers.onChange?.(\r\n handler.handlers.changeEventCalculator?.(\r\n event,\r\n lastUpdateEvent[handler.handlers.handlerTag]\r\n )\r\n );\r\n\r\n lastUpdateEvent[handler.handlers.handlerTag] = event;\r\n }\r\n }\r\n } else {\r\n const oldHandler = findOldGestureHandler(event.handlerTag);\r\n if (oldHandler) {\r\n const nativeEvent = { nativeEvent: event };\r\n if (isStateChangeEvent(event)) {\r\n oldHandler.onGestureStateChange(nativeEvent);\r\n } else {\r\n oldHandler.onGestureEvent(nativeEvent);\r\n }\r\n return;\r\n }\r\n }\r\n}\r\n\r\nexport function startListening() {\r\n stopListening();\r\n\r\n gestureHandlerEventSubscription = DeviceEventEmitter.addListener(\r\n 'onGestureHandlerEvent',\r\n onGestureHandlerEvent\r\n );\r\n\r\n gestureHandlerStateChangeEventSubscription = DeviceEventEmitter.addListener(\r\n 'onGestureHandlerStateChange',\r\n onGestureHandlerEvent\r\n );\r\n}\r\n\r\nexport function stopListening() {\r\n if (gestureHandlerEventSubscription) {\r\n gestureHandlerEventSubscription.remove();\r\n gestureHandlerEventSubscription = null;\r\n }\r\n\r\n if (gestureHandlerStateChangeEventSubscription) {\r\n gestureHandlerStateChangeEventSubscription.remove();\r\n gestureHandlerStateChangeEventSubscription = null;\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.FlingGesture = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
class FlingGesture extends _gesture.BaseGesture {
|
13
|
+
constructor() {
|
14
|
+
super();
|
15
|
+
|
16
|
+
_defineProperty(this, "config", {});
|
17
|
+
|
18
|
+
this.handlerName = 'FlingGestureHandler';
|
19
|
+
}
|
20
|
+
|
21
|
+
numberOfPointers(pointers) {
|
22
|
+
this.config.numberOfPointers = pointers;
|
23
|
+
return this;
|
24
|
+
}
|
25
|
+
|
26
|
+
direction(direction) {
|
27
|
+
this.config.direction = direction;
|
28
|
+
return this;
|
29
|
+
}
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
exports.FlingGesture = FlingGesture;
|
34
|
+
//# sourceMappingURL=flingGesture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["flingGesture.ts"],"names":["FlingGesture","BaseGesture","constructor","handlerName","numberOfPointers","pointers","config","direction"],"mappings":";;;;;;;AAAA;;;;AAMO,MAAMA,YAAN,SAA2BC,oBAA3B,CAAwE;AAG7EC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF0C,EAE1C;;AAGZ,SAAKC,WAAL,GAAmB,qBAAnB;AACD;;AAEDC,EAAAA,gBAAgB,CAACC,QAAD,EAAmB;AACjC,SAAKC,MAAL,CAAYF,gBAAZ,GAA+BC,QAA/B;AACA,WAAO,IAAP;AACD;;AAEDE,EAAAA,SAAS,CAACA,SAAD,EAAoB;AAC3B,SAAKD,MAAL,CAAYC,SAAZ,GAAwBA,SAAxB;AACA,WAAO,IAAP;AACD;;AAjB4E","sourcesContent":["import { BaseGesture, BaseGestureConfig } from './gesture';\r\nimport {\r\n FlingGestureConfig,\r\n FlingGestureHandlerEventPayload,\r\n} from '../FlingGestureHandler';\r\n\r\nexport class FlingGesture extends BaseGesture<FlingGestureHandlerEventPayload> {\r\n public config: BaseGestureConfig & FlingGestureConfig = {};\r\n\r\n constructor() {\r\n super();\r\n\r\n this.handlerName = 'FlingGestureHandler';\r\n }\r\n\r\n numberOfPointers(pointers: number) {\r\n this.config.numberOfPointers = pointers;\r\n return this;\r\n }\r\n\r\n direction(direction: number) {\r\n this.config.direction = direction;\r\n return this;\r\n }\r\n}\r\n\r\nexport type FlingGestureType = InstanceType<typeof FlingGesture>;\r\n"]}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ForceTouchGesture = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
function changeEventCalculator(current, previous) {
|
13
|
+
'worklet';
|
14
|
+
|
15
|
+
let changePayload;
|
16
|
+
|
17
|
+
if (previous === undefined) {
|
18
|
+
changePayload = {
|
19
|
+
forceChange: current.force
|
20
|
+
};
|
21
|
+
} else {
|
22
|
+
changePayload = {
|
23
|
+
forceChange: current.force - previous.force
|
24
|
+
};
|
25
|
+
}
|
26
|
+
|
27
|
+
return { ...current,
|
28
|
+
...changePayload
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
32
|
+
class ForceTouchGesture extends _gesture.ContinousBaseGesture {
|
33
|
+
constructor() {
|
34
|
+
super();
|
35
|
+
|
36
|
+
_defineProperty(this, "config", {});
|
37
|
+
|
38
|
+
this.handlerName = 'ForceTouchGestureHandler';
|
39
|
+
}
|
40
|
+
|
41
|
+
minForce(force) {
|
42
|
+
this.config.minForce = force;
|
43
|
+
return this;
|
44
|
+
}
|
45
|
+
|
46
|
+
maxForce(force) {
|
47
|
+
this.config.maxForce = force;
|
48
|
+
return this;
|
49
|
+
}
|
50
|
+
|
51
|
+
feedbackOnActivation(value) {
|
52
|
+
this.config.feedbackOnActivation = value;
|
53
|
+
return this;
|
54
|
+
}
|
55
|
+
|
56
|
+
onChange(callback) {
|
57
|
+
// @ts-ignore TS being overprotective, ForceTouchGestureHandlerEventPayload is Record
|
58
|
+
this.handlers.changeEventCalculator = changeEventCalculator;
|
59
|
+
return super.onChange(callback);
|
60
|
+
}
|
61
|
+
|
62
|
+
}
|
63
|
+
|
64
|
+
exports.ForceTouchGesture = ForceTouchGesture;
|
65
|
+
//# sourceMappingURL=forceTouchGesture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["forceTouchGesture.ts"],"names":["changeEventCalculator","current","previous","changePayload","undefined","forceChange","force","ForceTouchGesture","ContinousBaseGesture","constructor","handlerName","minForce","config","maxForce","feedbackOnActivation","value","onChange","callback","handlers"],"mappings":";;;;;;;AAAA;;;;AAWA,SAASA,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,WAAW,EAAEJ,OAAO,CAACK;AADP,KAAhB;AAGD,GAJD,MAIO;AACLH,IAAAA,aAAa,GAAG;AACdE,MAAAA,WAAW,EAAEJ,OAAO,CAACK,KAAR,GAAgBJ,QAAQ,CAACI;AADxB,KAAhB;AAGD;;AAED,SAAO,EAAE,GAAGL,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAEM,MAAMI,iBAAN,SAAgCC,6BAAhC,CAGL;AAGAC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF+C,EAE/C;;AAGZ,SAAKC,WAAL,GAAmB,0BAAnB;AACD;;AAEDC,EAAAA,QAAQ,CAACL,KAAD,EAAgB;AACtB,SAAKM,MAAL,CAAYD,QAAZ,GAAuBL,KAAvB;AACA,WAAO,IAAP;AACD;;AAEDO,EAAAA,QAAQ,CAACP,KAAD,EAAgB;AACtB,SAAKM,MAAL,CAAYC,QAAZ,GAAuBP,KAAvB;AACA,WAAO,IAAP;AACD;;AAEDQ,EAAAA,oBAAoB,CAACC,KAAD,EAAiB;AACnC,SAAKH,MAAL,CAAYE,oBAAZ,GAAmCC,KAAnC;AACA,WAAO,IAAP;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EASN;AACA;AACA,SAAKC,QAAL,CAAclB,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMgB,QAAN,CAAeC,QAAf,CAAP;AACD;;AArCD","sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\r\nimport {\r\n ForceTouchGestureConfig,\r\n ForceTouchGestureHandlerEventPayload,\r\n} from '../ForceTouchGestureHandler';\r\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\r\n\r\nexport type ForceTouchGestureChangeEventPayload = {\r\n forceChange: number;\r\n};\r\n\r\nfunction changeEventCalculator(\r\n current: GestureUpdateEvent<ForceTouchGestureHandlerEventPayload>,\r\n previous?: GestureUpdateEvent<ForceTouchGestureHandlerEventPayload>\r\n) {\r\n 'worklet';\r\n let changePayload: ForceTouchGestureChangeEventPayload;\r\n if (previous === undefined) {\r\n changePayload = {\r\n forceChange: current.force,\r\n };\r\n } else {\r\n changePayload = {\r\n forceChange: current.force - previous.force,\r\n };\r\n }\r\n\r\n return { ...current, ...changePayload };\r\n}\r\n\r\nexport class ForceTouchGesture extends ContinousBaseGesture<\r\n ForceTouchGestureHandlerEventPayload,\r\n ForceTouchGestureChangeEventPayload\r\n> {\r\n public config: BaseGestureConfig & ForceTouchGestureConfig = {};\r\n\r\n constructor() {\r\n super();\r\n\r\n this.handlerName = 'ForceTouchGestureHandler';\r\n }\r\n\r\n minForce(force: number) {\r\n this.config.minForce = force;\r\n return this;\r\n }\r\n\r\n maxForce(force: number) {\r\n this.config.maxForce = force;\r\n return this;\r\n }\r\n\r\n feedbackOnActivation(value: boolean) {\r\n this.config.feedbackOnActivation = value;\r\n return this;\r\n }\r\n\r\n onChange(\r\n callback: (\r\n event: GestureUpdateEvent<\r\n GestureUpdateEvent<\r\n ForceTouchGestureHandlerEventPayload &\r\n ForceTouchGestureChangeEventPayload\r\n >\r\n >\r\n ) => void\r\n ) {\r\n // @ts-ignore TS being overprotective, ForceTouchGestureHandlerEventPayload is Record\r\n this.handlers.changeEventCalculator = changeEventCalculator;\r\n return super.onChange(callback);\r\n }\r\n}\r\n\r\nexport type ForceTouchGestureType = InstanceType<typeof ForceTouchGesture>;\r\n"]}
|
@@ -0,0 +1,241 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ContinousBaseGesture = exports.BaseGesture = exports.Gesture = exports.CALLBACK_TYPE = void 0;
|
7
|
+
|
8
|
+
var _handlersRegistry = require("../handlersRegistry");
|
9
|
+
|
10
|
+
var _utils = require("../../utils");
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
const CALLBACK_TYPE = {
|
15
|
+
UNDEFINED: 0,
|
16
|
+
BEGAN: 1,
|
17
|
+
START: 2,
|
18
|
+
UPDATE: 3,
|
19
|
+
CHANGE: 4,
|
20
|
+
END: 5,
|
21
|
+
FINALIZE: 6,
|
22
|
+
TOUCHES_DOWN: 7,
|
23
|
+
TOUCHES_MOVE: 8,
|
24
|
+
TOUCHES_UP: 9,
|
25
|
+
TOUCHES_CANCELLED: 10
|
26
|
+
}; // Allow using CALLBACK_TYPE as object and type
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
28
|
+
|
29
|
+
exports.CALLBACK_TYPE = CALLBACK_TYPE;
|
30
|
+
|
31
|
+
class Gesture {}
|
32
|
+
|
33
|
+
exports.Gesture = Gesture;
|
34
|
+
let nextGestureId = 0;
|
35
|
+
|
36
|
+
class BaseGesture extends Gesture {
|
37
|
+
constructor() {
|
38
|
+
super(); // Used to check whether the gesture config has been updated when wrapping it
|
39
|
+
// with `useMemo`. Since every config will have a unique id, when the dependencies
|
40
|
+
// don't change, the config won't be recreated and the id will stay the same.
|
41
|
+
// If the id is different, it means that the config has changed and the gesture
|
42
|
+
// needs to be updated.
|
43
|
+
|
44
|
+
_defineProperty(this, "gestureId", -1);
|
45
|
+
|
46
|
+
_defineProperty(this, "handlerTag", -1);
|
47
|
+
|
48
|
+
_defineProperty(this, "handlerName", '');
|
49
|
+
|
50
|
+
_defineProperty(this, "config", {});
|
51
|
+
|
52
|
+
_defineProperty(this, "handlers", {
|
53
|
+
gestureId: -1,
|
54
|
+
handlerTag: -1,
|
55
|
+
isWorklet: []
|
56
|
+
});
|
57
|
+
|
58
|
+
this.gestureId = nextGestureId++;
|
59
|
+
this.handlers.gestureId = this.gestureId;
|
60
|
+
}
|
61
|
+
|
62
|
+
addDependency(key, gesture) {
|
63
|
+
const value = this.config[key];
|
64
|
+
this.config[key] = value ? Array().concat(value, gesture) : [gesture];
|
65
|
+
}
|
66
|
+
|
67
|
+
withRef(ref) {
|
68
|
+
this.config.ref = ref;
|
69
|
+
return this;
|
70
|
+
} // eslint-disable-next-line @typescript-eslint/ban-types
|
71
|
+
|
72
|
+
|
73
|
+
isWorklet(callback) {
|
74
|
+
//@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
|
75
|
+
return callback.__workletHash !== undefined;
|
76
|
+
}
|
77
|
+
|
78
|
+
onBegin(callback) {
|
79
|
+
this.handlers.onBegin = callback;
|
80
|
+
this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);
|
81
|
+
return this;
|
82
|
+
}
|
83
|
+
|
84
|
+
onStart(callback) {
|
85
|
+
this.handlers.onStart = callback;
|
86
|
+
this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);
|
87
|
+
return this;
|
88
|
+
}
|
89
|
+
|
90
|
+
onEnd(callback) {
|
91
|
+
this.handlers.onEnd = callback; //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
|
92
|
+
|
93
|
+
this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);
|
94
|
+
return this;
|
95
|
+
}
|
96
|
+
|
97
|
+
onFinalize(callback) {
|
98
|
+
this.handlers.onFinalize = callback; //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
|
99
|
+
|
100
|
+
this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);
|
101
|
+
return this;
|
102
|
+
}
|
103
|
+
|
104
|
+
onTouchesDown(callback) {
|
105
|
+
this.config.needsPointerData = true;
|
106
|
+
this.handlers.onTouchesDown = callback;
|
107
|
+
this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] = this.isWorklet(callback);
|
108
|
+
return this;
|
109
|
+
}
|
110
|
+
|
111
|
+
onTouchesMove(callback) {
|
112
|
+
this.config.needsPointerData = true;
|
113
|
+
this.handlers.onTouchesMove = callback;
|
114
|
+
this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] = this.isWorklet(callback);
|
115
|
+
return this;
|
116
|
+
}
|
117
|
+
|
118
|
+
onTouchesUp(callback) {
|
119
|
+
this.config.needsPointerData = true;
|
120
|
+
this.handlers.onTouchesUp = callback;
|
121
|
+
this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] = this.isWorklet(callback);
|
122
|
+
return this;
|
123
|
+
}
|
124
|
+
|
125
|
+
onTouchesCancelled(callback) {
|
126
|
+
this.config.needsPointerData = true;
|
127
|
+
this.handlers.onTouchesCancelled = callback;
|
128
|
+
this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] = this.isWorklet(callback);
|
129
|
+
return this;
|
130
|
+
}
|
131
|
+
|
132
|
+
enabled(enabled) {
|
133
|
+
this.config.enabled = enabled;
|
134
|
+
return this;
|
135
|
+
}
|
136
|
+
|
137
|
+
shouldCancelWhenOutside(value) {
|
138
|
+
this.config.shouldCancelWhenOutside = value;
|
139
|
+
return this;
|
140
|
+
}
|
141
|
+
|
142
|
+
hitSlop(hitSlop) {
|
143
|
+
this.config.hitSlop = hitSlop;
|
144
|
+
return this;
|
145
|
+
}
|
146
|
+
|
147
|
+
activeCursor(activeCursor) {
|
148
|
+
this.config.activeCursor = activeCursor;
|
149
|
+
return this;
|
150
|
+
}
|
151
|
+
|
152
|
+
runOnJS(runOnJS) {
|
153
|
+
this.config.runOnJS = runOnJS;
|
154
|
+
return this;
|
155
|
+
}
|
156
|
+
|
157
|
+
simultaneousWithExternalGesture(...gestures) {
|
158
|
+
for (const gesture of gestures) {
|
159
|
+
this.addDependency('simultaneousWith', gesture);
|
160
|
+
}
|
161
|
+
|
162
|
+
return this;
|
163
|
+
}
|
164
|
+
|
165
|
+
requireExternalGestureToFail(...gestures) {
|
166
|
+
for (const gesture of gestures) {
|
167
|
+
this.addDependency('requireToFail', gesture);
|
168
|
+
}
|
169
|
+
|
170
|
+
return this;
|
171
|
+
}
|
172
|
+
|
173
|
+
blocksExternalGesture(...gestures) {
|
174
|
+
for (const gesture of gestures) {
|
175
|
+
this.addDependency('blocksHandlers', gesture);
|
176
|
+
}
|
177
|
+
|
178
|
+
return this;
|
179
|
+
}
|
180
|
+
|
181
|
+
withTestId(id) {
|
182
|
+
this.config.testId = id;
|
183
|
+
return this;
|
184
|
+
}
|
185
|
+
|
186
|
+
cancelsTouchesInView(value) {
|
187
|
+
this.config.cancelsTouchesInView = value;
|
188
|
+
return this;
|
189
|
+
}
|
190
|
+
|
191
|
+
initialize() {
|
192
|
+
this.handlerTag = (0, _handlersRegistry.getNextHandlerTag)();
|
193
|
+
this.handlers = { ...this.handlers,
|
194
|
+
handlerTag: this.handlerTag
|
195
|
+
};
|
196
|
+
|
197
|
+
if (this.config.ref) {
|
198
|
+
this.config.ref.current = this;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
toGestureArray() {
|
203
|
+
return [this];
|
204
|
+
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
205
|
+
|
206
|
+
|
207
|
+
prepare() {}
|
208
|
+
|
209
|
+
get shouldUseReanimated() {
|
210
|
+
// use Reanimated when runOnJS isn't set explicitly,
|
211
|
+
// and all defined callbacks are worklets,
|
212
|
+
// and remote debugging is disabled
|
213
|
+
return this.config.runOnJS !== true && !this.handlers.isWorklet.includes(false) && !(0, _utils.isRemoteDebuggingEnabled)();
|
214
|
+
}
|
215
|
+
|
216
|
+
}
|
217
|
+
|
218
|
+
exports.BaseGesture = BaseGesture;
|
219
|
+
|
220
|
+
class ContinousBaseGesture extends BaseGesture {
|
221
|
+
onUpdate(callback) {
|
222
|
+
this.handlers.onUpdate = callback;
|
223
|
+
this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);
|
224
|
+
return this;
|
225
|
+
}
|
226
|
+
|
227
|
+
onChange(callback) {
|
228
|
+
this.handlers.onChange = callback;
|
229
|
+
this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);
|
230
|
+
return this;
|
231
|
+
}
|
232
|
+
|
233
|
+
manualActivation(manualActivation) {
|
234
|
+
this.config.manualActivation = manualActivation;
|
235
|
+
return this;
|
236
|
+
}
|
237
|
+
|
238
|
+
}
|
239
|
+
|
240
|
+
exports.ContinousBaseGesture = ContinousBaseGesture;
|
241
|
+
//# sourceMappingURL=gesture.js.map
|