@amazon-devices/react-native-gesture-handler 2.0.1758683737
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DrawerLayout/package.json +6 -0
- package/LICENSE +7 -0
- package/README.kepler.md +167 -0
- package/RNGestureHandler.podspec +41 -0
- package/Swipeable/package.json +6 -0
- package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.bundle +67466 -0
- package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.map +1 -0
- package/SystemModules/amzn__react-native-gesture-handler-2.modules.txt +338 -0
- package/SystemModules/amzn__react-native-gesture-handler-2.private.modules.txt +96 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +578 -0
- package/android/build.gradle +205 -0
- package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
- package/android/gradle.properties +19 -0
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
- package/android/src/fabric/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +29 -0
- package/android/src/fabric/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +12 -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 +707 -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 +419 -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 +77 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +67 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +756 -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 +72 -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/jni/CMakeLists.txt +25 -0
- package/android/src/main/jni/cpp-adapter.cpp +44 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +50 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +23 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/src/paper/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -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 +152 -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 +482 -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 +62 -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/kepler-compatibility.json +8 -0
- package/kepler-transformed-package-info.json +3 -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 +29 -0
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js +10 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/commonjs/PlatformConstants.js +10 -0
- package/lib/commonjs/PlatformConstants.js.map +1 -0
- package/lib/commonjs/PlatformConstants.web.js +12 -0
- package/lib/commonjs/PlatformConstants.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.js +23 -0
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.kepler.js +33 -0
- package/lib/commonjs/RNGestureHandlerModule.kepler.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js +113 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js +123 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js +121 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/commonjs/RNRenderer.js +14 -0
- package/lib/commonjs/RNRenderer.js.map +1 -0
- package/lib/commonjs/RNRenderer.web.js +10 -0
- package/lib/commonjs/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/State.js +19 -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 +512 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -0
- package/lib/commonjs/components/GestureButtons.js +194 -0
- package/lib/commonjs/components/GestureButtons.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.js +104 -0
- package/lib/commonjs/components/GestureComponents.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.web.js +38 -0
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.js +10 -0
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js +16 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js +23 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.js +23 -0
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.kepler.js +18 -0
- package/lib/commonjs/components/GestureHandlerRootView.kepler.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js +18 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +345 -0
- package/lib/commonjs/components/Swipeable.js.map +1 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js +31 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +253 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js +90 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +84 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +9 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js +64 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +18 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/index.js +35 -0
- package/lib/commonjs/components/touchables/index.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 +14 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js +18 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +37 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js +20 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +19 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PanGestureHandler.js +99 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js +17 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js +13 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +11 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js +17 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/TapGestureHandler.js +20 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/createHandler.js +402 -0
- package/lib/commonjs/handlers/createHandler.js.map +1 -0
- package/lib/commonjs/handlers/createNativeWrapper.js +63 -0
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +86 -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 +548 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js +125 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js +27 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +54 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gesture.js +196 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js +90 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js +73 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +60 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +27 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js +60 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js +28 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js +25 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js +27 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/panGesture.js +124 -0
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js +38 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +30 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js +38 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js +48 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/commonjs/handlers/handlersRegistry.js +52 -0
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
- package/lib/commonjs/index.js +241 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/init.js +25 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/jestUtils/index.js +19 -0
- package/lib/commonjs/jestUtils/index.js.map +1 -0
- package/lib/commonjs/jestUtils/jestUtils.js +312 -0
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
- package/lib/commonjs/mocks.js +61 -0
- package/lib/commonjs/mocks.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js +20 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -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 +64 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/constants.js +14 -0
- package/lib/commonjs/web/constants.js.map +1 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +129 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +127 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +127 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/GestureHandler.js +668 -0
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +48 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +119 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +49 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +140 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js +347 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +136 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +146 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js +219 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web/interfaces.js +44 -0
- package/lib/commonjs/web/interfaces.js.map +1 -0
- package/lib/commonjs/web/tools/CircularBuffer.js +47 -0
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
- package/lib/commonjs/web/tools/EventManager.js +95 -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 +305 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +93 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/InteractionManager.js +99 -0
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js +167 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/commonjs/web/tools/NodeManager.js +41 -0
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +171 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerTracker.js +202 -0
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -0
- package/lib/commonjs/web/tools/TouchEventManager.js +126 -0
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/VelocityTracker.js +89 -0
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
- package/lib/commonjs/web/utils.js +14 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +93 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +43 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/Errors.js +13 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +139 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/GestureHandler.js +491 -0
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +45 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +57 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +58 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NodeManager.js +40 -0
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js +167 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +31 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js +160 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +33 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js +173 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/constants.js +51 -0
- package/lib/commonjs/web_hammer/constants.js.map +1 -0
- package/lib/commonjs/web_hammer/utils.js +32 -0
- package/lib/commonjs/web_hammer/utils.js.map +1 -0
- package/lib/module/ActionType.js +9 -0
- package/lib/module/ActionType.js.map +1 -0
- package/lib/module/Directions.js +9 -0
- package/lib/module/Directions.js.map +1 -0
- package/lib/module/EnableNewWebImplementation.js +21 -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 +4 -0
- package/lib/module/PlatformConstants.js.map +1 -0
- package/lib/module/PlatformConstants.web.js +6 -0
- package/lib/module/PlatformConstants.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +17 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.kepler.js +24 -0
- package/lib/module/RNGestureHandlerModule.kepler.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.macos.js +104 -0
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.web.js +114 -0
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.windows.js +112 -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 +13 -0
- package/lib/module/State.js.map +1 -0
- package/lib/module/TouchEventType.js +10 -0
- package/lib/module/TouchEventType.js.map +1 -0
- package/lib/module/components/DrawerLayout.js +504 -0
- package/lib/module/components/DrawerLayout.js.map +1 -0
- package/lib/module/components/GestureButtons.js +176 -0
- package/lib/module/components/GestureButtons.js.map +1 -0
- package/lib/module/components/GestureComponents.js +95 -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 +8 -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.kepler.js +9 -0
- package/lib/module/components/GestureHandlerRootView.kepler.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 +338 -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 +244 -0
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/module/components/touchables/TouchableHighlight.js +81 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +74 -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 +55 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -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/getShadowNodeFromRef.js +21 -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/handlers/FlingGestureHandler.js +11 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js +30 -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 +90 -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 +395 -0
- package/lib/module/handlers/createHandler.js.map +1 -0
- package/lib/module/handlers/createNativeWrapper.js +56 -0
- package/lib/module/handlers/createNativeWrapper.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +76 -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 +538 -0
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/module/handlers/gestures/eventReceiver.js +116 -0
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/module/handlers/gestures/flingGesture.js +20 -0
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js +47 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/gesture.js +188 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -0
- package/lib/module/handlers/gestures/gestureComposition.js +81 -0
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/module/handlers/gestures/gestureObjects.js +67 -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 +20 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/module/handlers/gestures/hoverGesture.js +53 -0
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/module/handlers/gestures/longPressGesture.js +21 -0
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/module/handlers/gestures/manualGesture.js +18 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/module/handlers/gestures/nativeGesture.js +20 -0
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/module/handlers/gestures/panGesture.js +117 -0
- package/lib/module/handlers/gestures/panGesture.js.map +1 -0
- package/lib/module/handlers/gestures/pinchGesture.js +31 -0
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js +25 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/module/handlers/gestures/rotationGesture.js +31 -0
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/module/handlers/gestures/tapGesture.js +41 -0
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/module/handlers/handlersRegistry.js +39 -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 +17 -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 +305 -0
- package/lib/module/jestUtils/jestUtils.js.map +1 -0
- package/lib/module/mocks.js +55 -0
- package/lib/module/mocks.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +4 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js +12 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +4 -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 +50 -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 +122 -0
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js +120 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/module/web/handlers/FlingGestureHandler.js +119 -0
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/GestureHandler.js +661 -0
- package/lib/module/web/handlers/GestureHandler.js.map +1 -0
- package/lib/module/web/handlers/HoverGestureHandler.js +40 -0
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js +111 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/ManualGestureHandler.js +41 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js +132 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PanGestureHandler.js +339 -0
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PinchGestureHandler.js +128 -0
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/RotationGestureHandler.js +138 -0
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/TapGestureHandler.js +211 -0
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/web/interfaces.js +38 -0
- package/lib/module/web/interfaces.js.map +1 -0
- package/lib/module/web/tools/CircularBuffer.js +40 -0
- package/lib/module/web/tools/CircularBuffer.js.map +1 -0
- package/lib/module/web/tools/EventManager.js +88 -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 +297 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +85 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/module/web/tools/InteractionManager.js +92 -0
- package/lib/module/web/tools/InteractionManager.js.map +1 -0
- package/lib/module/web/tools/LeastSquareSolver.js +160 -0
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/module/web/tools/NodeManager.js +34 -0
- package/lib/module/web/tools/NodeManager.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +163 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -0
- package/lib/module/web/tools/PointerTracker.js +194 -0
- package/lib/module/web/tools/PointerTracker.js.map +1 -0
- package/lib/module/web/tools/TouchEventManager.js +118 -0
- package/lib/module/web/tools/TouchEventManager.js.map +1 -0
- package/lib/module/web/tools/VelocityTracker.js +81 -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 +85 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js +35 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/Errors.js +6 -0
- package/lib/module/web_hammer/Errors.js.map +1 -0
- package/lib/module/web_hammer/FlingGestureHandler.js +131 -0
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/GestureHandler.js +485 -0
- package/lib/module/web_hammer/GestureHandler.js.map +1 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +39 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js +49 -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 +31 -0
- package/lib/module/web_hammer/NodeManager.js.map +1 -0
- package/lib/module/web_hammer/PanGestureHandler.js +160 -0
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PinchGestureHandler.js +24 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PressGestureHandler.js +153 -0
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/RotationGestureHandler.js +26 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/TapGestureHandler.js +166 -0
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/constants.js +44 -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.kepler.d.ts +17 -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.kepler.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +6 -0
- package/lib/typescript/components/Swipeable.d.ts +170 -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/getShadowNodeFromRef.d.ts +1 -0
- package/lib/typescript/getShadowNodeFromRef.web.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 +67 -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 +108 -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/RNGestureHandlerButtonNativeComponent.kepler.d.ts +7 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -0
- package/lib/typescript/typeUtils.d.ts +1 -0
- package/lib/typescript/utils.d.ts +12 -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 +140 -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 +30 -0
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
- package/lib/typescript/web/tools/InteractionManager.d.ts +16 -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 +1 -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.kepler.ts +64 -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 +334 -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.kepler.tsx +17 -0
- package/src/components/GestureHandlerRootView.tsx +23 -0
- package/src/components/GestureHandlerRootView.web.tsx +17 -0
- package/src/components/Swipeable.tsx +551 -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/getShadowNodeFromRef.ts +22 -0
- package/src/getShadowNodeFromRef.web.ts +7 -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 +547 -0
- package/src/handlers/createNativeWrapper.tsx +80 -0
- package/src/handlers/gestureHandlerCommon.ts +244 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +106 -0
- package/src/handlers/gestures/GestureDetector.tsx +818 -0
- package/src/handlers/gestures/eventReceiver.ts +172 -0
- package/src/handlers/gestures/flingGesture.ts +27 -0
- package/src/handlers/gestures/forceTouchGesture.ts +74 -0
- package/src/handlers/gestures/gesture.ts +341 -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.kepler.ts +27 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +20 -0
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +7 -0
- package/src/typeUtils.ts +1 -0
- package/src/utils.ts +62 -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 +850 -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 +166 -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 +398 -0
- package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
- package/src/web/tools/InteractionManager.ts +123 -0
- package/src/web/tools/LeastSquareSolver.ts +182 -0
- package/src/web/tools/NodeManager.ts +43 -0
- package/src/web/tools/PointerEventManager.ts +193 -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 +598 -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,31 @@
|
|
|
1
|
+
import { ContinousBaseGesture } from './gesture';
|
|
2
|
+
function changeEventCalculator(current, previous) {
|
|
3
|
+
'worklet';
|
|
4
|
+
|
|
5
|
+
let changePayload;
|
|
6
|
+
if (previous === undefined) {
|
|
7
|
+
changePayload = {
|
|
8
|
+
rotationChange: current.rotation
|
|
9
|
+
};
|
|
10
|
+
} else {
|
|
11
|
+
changePayload = {
|
|
12
|
+
rotationChange: current.rotation - previous.rotation
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...current,
|
|
17
|
+
...changePayload
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export class RotationGesture extends ContinousBaseGesture {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.handlerName = 'RotationGestureHandler';
|
|
24
|
+
}
|
|
25
|
+
onChange(callback) {
|
|
26
|
+
// @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record
|
|
27
|
+
this.handlers.changeEventCalculator = changeEventCalculator;
|
|
28
|
+
return super.onChange(callback);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=rotationGesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","rotationChange","rotation","RotationGesture","constructor","handlerName","onChange","callback","handlers"],"sources":["rotationGesture.ts"],"sourcesContent":["import { ContinousBaseGesture } from './gesture';\nimport { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\n\ntype RotationGestureChangeEventPayload = {\n rotationChange: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<RotationGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<RotationGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: RotationGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n rotationChange: current.rotation,\n };\n } else {\n changePayload = {\n rotationChange: current.rotation - previous.rotation,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class RotationGesture extends ContinousBaseGesture<\n RotationGestureHandlerEventPayload,\n RotationGestureChangeEventPayload\n> {\n constructor() {\n super();\n\n this.handlerName = 'RotationGestureHandler';\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n RotationGestureHandlerEventPayload & RotationGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type RotationGestureType = InstanceType<typeof RotationGesture>;\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,WAAW;AAQhD,SAASC,qBAAqBA,CAC5BC,OAA+D,EAC/DC,QAAiE,EACjE;EACA,SAAS;;EACT,IAAIC,aAAgD;EACpD,IAAID,QAAQ,KAAKE,SAAS,EAAE;IAC1BD,aAAa,GAAG;MACdE,cAAc,EAAEJ,OAAO,CAACK;IAC1B,CAAC;EACH,CAAC,MAAM;IACLH,aAAa,GAAG;MACdE,cAAc,EAAEJ,OAAO,CAACK,QAAQ,GAAGJ,QAAQ,CAACI;IAC9C,CAAC;EACH;EAEA,OAAO;IAAE,GAAGL,OAAO;IAAE,GAAGE;EAAc,CAAC;AACzC;AAEA,OAAO,MAAMI,eAAe,SAASR,oBAAoB,CAGvD;EACAS,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,WAAW,GAAG,wBAAwB;EAC7C;EAEAC,QAAQA,CACNC,QAIS,EACT;IACA;IACA,IAAI,CAACC,QAAQ,CAACZ,qBAAqB,GAAGA,qBAAqB;IAC3D,OAAO,KAAK,CAACU,QAAQ,CAACC,QAAQ,CAAC;EACjC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { BaseGesture } from './gesture';
|
|
5
|
+
export class TapGesture extends BaseGesture {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
_defineProperty(this, "config", {});
|
|
9
|
+
this.handlerName = 'TapGestureHandler';
|
|
10
|
+
this.shouldCancelWhenOutside(true);
|
|
11
|
+
}
|
|
12
|
+
minPointers(minPointers) {
|
|
13
|
+
this.config.minPointers = minPointers;
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
numberOfTaps(count) {
|
|
17
|
+
this.config.numberOfTaps = count;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
maxDistance(maxDist) {
|
|
21
|
+
this.config.maxDist = maxDist;
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
maxDuration(duration) {
|
|
25
|
+
this.config.maxDurationMs = duration;
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
maxDelay(delay) {
|
|
29
|
+
this.config.maxDelayMs = delay;
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
maxDeltaX(delta) {
|
|
33
|
+
this.config.maxDeltaX = delta;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
maxDeltaY(delta) {
|
|
37
|
+
this.config.maxDeltaY = delta;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=tapGesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BaseGesture","TapGesture","constructor","_defineProperty","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"sources":["tapGesture.ts"],"sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\nimport {\n TapGestureConfig,\n TapGestureHandlerEventPayload,\n} from '../TapGestureHandler';\n\nexport class TapGesture extends BaseGesture<TapGestureHandlerEventPayload> {\n public config: BaseGestureConfig & TapGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'TapGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n numberOfTaps(count: number) {\n this.config.numberOfTaps = count;\n return this;\n }\n\n maxDistance(maxDist: number) {\n this.config.maxDist = maxDist;\n return this;\n }\n\n maxDuration(duration: number) {\n this.config.maxDurationMs = duration;\n return this;\n }\n\n maxDelay(delay: number) {\n this.config.maxDelayMs = delay;\n return this;\n }\n\n maxDeltaX(delta: number) {\n this.config.maxDeltaX = delta;\n return this;\n }\n\n maxDeltaY(delta: number) {\n this.config.maxDeltaY = delta;\n return this;\n }\n}\n\nexport type TapGestureType = InstanceType<typeof TapGesture>;\n"],"mappings":";;;AAAA,SAA4BA,WAAW,QAAQ,WAAW;AAM1D,OAAO,MAAMC,UAAU,SAASD,WAAW,CAAgC;EAGzEE,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAACC,eAAA,iBAH4C,CAAC,CAAC;IAKtD,IAAI,CAACC,WAAW,GAAG,mBAAmB;IACtC,IAAI,CAACC,uBAAuB,CAAC,IAAI,CAAC;EACpC;EAEAC,WAAWA,CAACA,WAAmB,EAAE;IAC/B,IAAI,CAACC,MAAM,CAACD,WAAW,GAAGA,WAAW;IACrC,OAAO,IAAI;EACb;EAEAE,YAAYA,CAACC,KAAa,EAAE;IAC1B,IAAI,CAACF,MAAM,CAACC,YAAY,GAAGC,KAAK;IAChC,OAAO,IAAI;EACb;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,IAAI,CAACJ,MAAM,CAACI,OAAO,GAAGA,OAAO;IAC7B,OAAO,IAAI;EACb;EAEAC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACN,MAAM,CAACO,aAAa,GAAGD,QAAQ;IACpC,OAAO,IAAI;EACb;EAEAE,QAAQA,CAACC,KAAa,EAAE;IACtB,IAAI,CAACT,MAAM,CAACU,UAAU,GAAGD,KAAK;IAC9B,OAAO,IAAI;EACb;EAEAE,SAASA,CAACC,KAAa,EAAE;IACvB,IAAI,CAACZ,MAAM,CAACW,SAAS,GAAGC,KAAK;IAC7B,OAAO,IAAI;EACb;EAEAC,SAASA,CAACD,KAAa,EAAE;IACvB,IAAI,CAACZ,MAAM,CAACa,SAAS,GAAGD,KAAK;IAC7B,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isJestEnv } from '../utils';
|
|
2
|
+
export const handlerIDToTag = {};
|
|
3
|
+
const gestures = new Map();
|
|
4
|
+
const oldHandlers = new Map();
|
|
5
|
+
const testIDs = new Map();
|
|
6
|
+
let handlerTag = 1;
|
|
7
|
+
export function getNextHandlerTag() {
|
|
8
|
+
return handlerTag++;
|
|
9
|
+
}
|
|
10
|
+
export function registerHandler(handlerTag, handler, testID) {
|
|
11
|
+
gestures.set(handlerTag, handler);
|
|
12
|
+
if (isJestEnv() && testID) {
|
|
13
|
+
testIDs.set(testID, handlerTag);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function registerOldGestureHandler(handlerTag, handler) {
|
|
17
|
+
oldHandlers.set(handlerTag, handler);
|
|
18
|
+
}
|
|
19
|
+
export function unregisterHandler(handlerTag, testID) {
|
|
20
|
+
gestures.delete(handlerTag);
|
|
21
|
+
if (isJestEnv() && testID) {
|
|
22
|
+
testIDs.delete(testID);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function findHandler(handlerTag) {
|
|
26
|
+
return gestures.get(handlerTag);
|
|
27
|
+
}
|
|
28
|
+
export function findOldGestureHandler(handlerTag) {
|
|
29
|
+
return oldHandlers.get(handlerTag);
|
|
30
|
+
}
|
|
31
|
+
export function findHandlerByTestID(testID) {
|
|
32
|
+
const handlerTag = testIDs.get(testID);
|
|
33
|
+
if (handlerTag !== undefined) {
|
|
34
|
+
var _findHandler;
|
|
35
|
+
return (_findHandler = findHandler(handlerTag)) !== null && _findHandler !== void 0 ? _findHandler : null;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=handlersRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isJestEnv","handlerIDToTag","gestures","Map","oldHandlers","testIDs","handlerTag","getNextHandlerTag","registerHandler","handler","testID","set","registerOldGestureHandler","unregisterHandler","delete","findHandler","get","findOldGestureHandler","findHandlerByTestID","undefined","_findHandler"],"sources":["handlersRegistry.ts"],"sourcesContent":["import { isJestEnv } from '../utils';\nimport { GestureType } from './gestures/gesture';\nimport { GestureEvent, HandlerStateChangeEvent } from './gestureHandlerCommon';\n\nexport const handlerIDToTag: Record<string, number> = {};\nconst gestures = new Map<number, GestureType>();\nconst oldHandlers = new Map<number, GestureHandlerCallbacks>();\nconst testIDs = new Map<string, number>();\n\nlet handlerTag = 1;\n\nexport function getNextHandlerTag(): number {\n return handlerTag++;\n}\n\nexport function registerHandler(\n handlerTag: number,\n handler: GestureType,\n testID?: string\n) {\n gestures.set(handlerTag, handler);\n if (isJestEnv() && testID) {\n testIDs.set(testID, handlerTag);\n }\n}\n\nexport function registerOldGestureHandler(\n handlerTag: number,\n handler: GestureHandlerCallbacks\n) {\n oldHandlers.set(handlerTag, handler);\n}\n\nexport function unregisterHandler(handlerTag: number, testID?: string) {\n gestures.delete(handlerTag);\n if (isJestEnv() && testID) {\n testIDs.delete(testID);\n }\n}\n\nexport function findHandler(handlerTag: number) {\n return gestures.get(handlerTag);\n}\n\nexport function findOldGestureHandler(handlerTag: number) {\n return oldHandlers.get(handlerTag);\n}\n\nexport function findHandlerByTestID(testID: string) {\n const handlerTag = testIDs.get(testID);\n if (handlerTag !== undefined) {\n return findHandler(handlerTag) ?? null;\n }\n return null;\n}\n\nexport interface GestureHandlerCallbacks {\n onGestureEvent: (event: GestureEvent<any>) => void;\n onGestureStateChange: (event: HandlerStateChangeEvent<any>) => void;\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,UAAU;AAIpC,OAAO,MAAMC,cAAsC,GAAG,CAAC,CAAC;AACxD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAsB,CAAC;AAC/C,MAAMC,WAAW,GAAG,IAAID,GAAG,CAAkC,CAAC;AAC9D,MAAME,OAAO,GAAG,IAAIF,GAAG,CAAiB,CAAC;AAEzC,IAAIG,UAAU,GAAG,CAAC;AAElB,OAAO,SAASC,iBAAiBA,CAAA,EAAW;EAC1C,OAAOD,UAAU,EAAE;AACrB;AAEA,OAAO,SAASE,eAAeA,CAC7BF,UAAkB,EAClBG,OAAoB,EACpBC,MAAe,EACf;EACAR,QAAQ,CAACS,GAAG,CAACL,UAAU,EAAEG,OAAO,CAAC;EACjC,IAAIT,SAAS,CAAC,CAAC,IAAIU,MAAM,EAAE;IACzBL,OAAO,CAACM,GAAG,CAACD,MAAM,EAAEJ,UAAU,CAAC;EACjC;AACF;AAEA,OAAO,SAASM,yBAAyBA,CACvCN,UAAkB,EAClBG,OAAgC,EAChC;EACAL,WAAW,CAACO,GAAG,CAACL,UAAU,EAAEG,OAAO,CAAC;AACtC;AAEA,OAAO,SAASI,iBAAiBA,CAACP,UAAkB,EAAEI,MAAe,EAAE;EACrER,QAAQ,CAACY,MAAM,CAACR,UAAU,CAAC;EAC3B,IAAIN,SAAS,CAAC,CAAC,IAAIU,MAAM,EAAE;IACzBL,OAAO,CAACS,MAAM,CAACJ,MAAM,CAAC;EACxB;AACF;AAEA,OAAO,SAASK,WAAWA,CAACT,UAAkB,EAAE;EAC9C,OAAOJ,QAAQ,CAACc,GAAG,CAACV,UAAU,CAAC;AACjC;AAEA,OAAO,SAASW,qBAAqBA,CAACX,UAAkB,EAAE;EACxD,OAAOF,WAAW,CAACY,GAAG,CAACV,UAAU,CAAC;AACpC;AAEA,OAAO,SAASY,mBAAmBA,CAACR,MAAc,EAAE;EAClD,MAAMJ,UAAU,GAAGD,OAAO,CAACW,GAAG,CAACN,MAAM,CAAC;EACtC,IAAIJ,UAAU,KAAKa,SAAS,EAAE;IAAA,IAAAC,YAAA;IAC5B,QAAAA,YAAA,GAAOL,WAAW,CAACT,UAAU,CAAC,cAAAc,YAAA,cAAAA,YAAA,GAAI,IAAI;EACxC;EACA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { initialize } from './init';
|
|
2
|
+
export { Directions } from './Directions';
|
|
3
|
+
export { State } from './State';
|
|
4
|
+
export { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';
|
|
5
|
+
export { default as GestureHandlerRootView } from './components/GestureHandlerRootView';
|
|
6
|
+
export { TapGestureHandler } from './handlers/TapGestureHandler';
|
|
7
|
+
export { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';
|
|
8
|
+
export { LongPressGestureHandler } from './handlers/LongPressGestureHandler';
|
|
9
|
+
export { PanGestureHandler } from './handlers/PanGestureHandler';
|
|
10
|
+
export { PinchGestureHandler } from './handlers/PinchGestureHandler';
|
|
11
|
+
export { RotationGestureHandler } from './handlers/RotationGestureHandler';
|
|
12
|
+
export { FlingGestureHandler } from './handlers/FlingGestureHandler';
|
|
13
|
+
export { default as createNativeWrapper } from './handlers/createNativeWrapper';
|
|
14
|
+
export { GestureDetector } from './handlers/gestures/GestureDetector';
|
|
15
|
+
export { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';
|
|
16
|
+
export { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';
|
|
17
|
+
export { RawButton, BaseButton, RectButton, BorderlessButton, PureNativeButton } from './components/GestureButtons';
|
|
18
|
+
export { TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback } from './components/touchables';
|
|
19
|
+
export { ScrollView, Switch, TextInput, DrawerLayoutAndroid, FlatList, RefreshControl } from './components/GestureComponents';
|
|
20
|
+
export { HoverEffect } from './handlers/gestures/hoverGesture';
|
|
21
|
+
export { default as Swipeable } from './components/Swipeable';
|
|
22
|
+
export { default as DrawerLayout } from './components/DrawerLayout';
|
|
23
|
+
export { enableExperimentalWebImplementation, enableLegacyWebImplementation } from './EnableNewWebImplementation';
|
|
24
|
+
initialize();
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["initialize","Directions","State","default","gestureHandlerRootHOC","GestureHandlerRootView","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PanGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","createNativeWrapper","GestureDetector","GestureObjects","Gesture","NativeViewGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton","PureNativeButton","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","Switch","TextInput","DrawerLayoutAndroid","FlatList","RefreshControl","HoverEffect","Swipeable","DrawerLayout","enableExperimentalWebImplementation","enableLegacyWebImplementation"],"sources":["index.ts"],"sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './components/GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type { HoverGestureType as HoverGesture } from './handlers/gestures/hoverGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PureNativeButton,\n} from './components/GestureButtons';\nexport type {\n TouchableHighlightProps,\n TouchableOpacityProps,\n TouchableWithoutFeedbackProps,\n} from './components/touchables';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n RefreshControl,\n} from './components/GestureComponents';\nexport { HoverEffect } from './handlers/gestures/hoverGesture';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport type { SwipeableProps } from './components/Swipeable';\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\nexport {\n enableExperimentalWebImplementation,\n enableLegacyWebImplementation,\n} from './EnableNewWebImplementation';\n\ninitialize();\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,OAAO,IAAIC,qBAAqB,QAAQ,oCAAoC;AACrF,SAASD,OAAO,IAAIE,sBAAsB,QAAQ,qCAAqC;AA+CvF,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAASC,uBAAuB,QAAQ,oCAAoC;AAC5E,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,sBAAsB,QAAQ,mCAAmC;AAC1E,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAAST,OAAO,IAAIU,mBAAmB,QAAQ,gCAAgC;AAK/E,SAASC,eAAe,QAAQ,qCAAqC;AACrE,SAASC,cAAc,IAAIC,OAAO,QAAQ,oCAAoC;AAkB9E,SAASC,wBAAwB,QAAQ,qCAAqC;AAO9E,SACEC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,gBAAgB,EAChBC,gBAAgB,QACX,6BAA6B;AAMpC,SACEC,kBAAkB,EAClBC,uBAAuB,EACvBC,gBAAgB,EAChBC,wBAAwB,QACnB,yBAAyB;AAChC,SACEC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,mBAAmB,EACnBC,QAAQ,EACRC,cAAc,QACT,gCAAgC;AACvC,SAASC,WAAW,QAAQ,kCAAkC;AAyC9D,SAAS9B,OAAO,IAAI+B,SAAS,QAAQ,wBAAwB;AAS7D,SAAS/B,OAAO,IAAIgC,YAAY,QAAQ,2BAA2B;AAEnE,SACEC,mCAAmC,EACnCC,6BAA6B,QACxB,8BAA8B;AAErCrC,UAAU,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { startListening } from './handlers/gestures/eventReceiver';
|
|
2
|
+
import RNGestureHandlerModule from './RNGestureHandlerModule';
|
|
3
|
+
import { isFabric } from './utils';
|
|
4
|
+
let fabricInitialized = false;
|
|
5
|
+
export function initialize() {
|
|
6
|
+
startListening();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// since isFabric() may give wrong results before the first render, we call this
|
|
10
|
+
// method during render of GestureHandlerRootView
|
|
11
|
+
export function maybeInitializeFabric() {
|
|
12
|
+
if (isFabric() && !fabricInitialized) {
|
|
13
|
+
RNGestureHandlerModule.install();
|
|
14
|
+
fabricInitialized = true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["startListening","RNGestureHandlerModule","isFabric","fabricInitialized","initialize","maybeInitializeFabric","install"],"sources":["init.ts"],"sourcesContent":["import { startListening } from './handlers/gestures/eventReceiver';\nimport RNGestureHandlerModule from './RNGestureHandlerModule';\nimport { isFabric } from './utils';\n\nlet fabricInitialized = false;\n\nexport function initialize() {\n startListening();\n}\n\n// since isFabric() may give wrong results before the first render, we call this\n// method during render of GestureHandlerRootView\nexport function maybeInitializeFabric() {\n if (isFabric() && !fabricInitialized) {\n RNGestureHandlerModule.install();\n fabricInitialized = true;\n }\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mCAAmC;AAClE,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,QAAQ,QAAQ,SAAS;AAElC,IAAIC,iBAAiB,GAAG,KAAK;AAE7B,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC3BJ,cAAc,CAAC,CAAC;AAClB;;AAEA;AACA;AACA,OAAO,SAASK,qBAAqBA,CAAA,EAAG;EACtC,IAAIH,QAAQ,CAAC,CAAC,IAAI,CAACC,iBAAiB,EAAE;IACpCF,sBAAsB,CAACK,OAAO,CAAC,CAAC;IAChCH,iBAAiB,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getByGestureTestId","fireGestureHandler"],"sources":["index.ts"],"sourcesContent":["export { getByGestureTestId, fireGestureHandler } from './jestUtils';\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,kBAAkB,QAAQ,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import invariant from 'invariant';
|
|
2
|
+
import { DeviceEventEmitter } from 'react-native';
|
|
3
|
+
import { flingHandlerName } from '../handlers/FlingGestureHandler';
|
|
4
|
+
import { forceTouchHandlerName } from '../handlers/ForceTouchGestureHandler';
|
|
5
|
+
import { BaseGesture } from '../handlers/gestures/gesture';
|
|
6
|
+
import { findHandlerByTestID } from '../handlers/handlersRegistry';
|
|
7
|
+
import { longPressHandlerName } from '../handlers/LongPressGestureHandler';
|
|
8
|
+
import { nativeViewHandlerName } from '../handlers/NativeViewGestureHandler';
|
|
9
|
+
import { panHandlerName } from '../handlers/PanGestureHandler';
|
|
10
|
+
import { pinchHandlerName } from '../handlers/PinchGestureHandler';
|
|
11
|
+
import { rotationHandlerName } from '../handlers/RotationGestureHandler';
|
|
12
|
+
import { tapHandlerName } from '../handlers/TapGestureHandler';
|
|
13
|
+
import { State } from '../State';
|
|
14
|
+
import { hasProperty, withPrevAndCurrent } from '../utils';
|
|
15
|
+
|
|
16
|
+
// load fireEvent conditionally, so RNGH may be used in setups without testing-library
|
|
17
|
+
let fireEvent = (_element, _name, ..._data) => {
|
|
18
|
+
// NOOP
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
22
|
+
fireEvent = require('@testing-library/react-native').fireEvent;
|
|
23
|
+
} catch (_e) {
|
|
24
|
+
// do nothing if not available
|
|
25
|
+
}
|
|
26
|
+
const handlersDefaultEvents = {
|
|
27
|
+
[flingHandlerName]: {
|
|
28
|
+
x: 0,
|
|
29
|
+
y: 0,
|
|
30
|
+
absoluteX: 0,
|
|
31
|
+
absoluteY: 0,
|
|
32
|
+
numberOfPointers: 1
|
|
33
|
+
},
|
|
34
|
+
[forceTouchHandlerName]: {
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0,
|
|
37
|
+
absoluteX: 0,
|
|
38
|
+
absoluteY: 0,
|
|
39
|
+
force: 1,
|
|
40
|
+
numberOfPointers: 1
|
|
41
|
+
},
|
|
42
|
+
[longPressHandlerName]: {
|
|
43
|
+
x: 0,
|
|
44
|
+
y: 0,
|
|
45
|
+
absoluteX: 0,
|
|
46
|
+
absoluteY: 0,
|
|
47
|
+
duration: 100,
|
|
48
|
+
numberOfPointers: 1
|
|
49
|
+
},
|
|
50
|
+
[nativeViewHandlerName]: {
|
|
51
|
+
pointerInside: true,
|
|
52
|
+
numberOfPointers: 1
|
|
53
|
+
},
|
|
54
|
+
[panHandlerName]: {
|
|
55
|
+
x: 0,
|
|
56
|
+
y: 0,
|
|
57
|
+
absoluteX: 0,
|
|
58
|
+
absoluteY: 0,
|
|
59
|
+
translationX: 100,
|
|
60
|
+
translationY: 0,
|
|
61
|
+
velocityX: 3,
|
|
62
|
+
velocityY: 0,
|
|
63
|
+
numberOfPointers: 1
|
|
64
|
+
},
|
|
65
|
+
[pinchHandlerName]: {
|
|
66
|
+
focalX: 0,
|
|
67
|
+
focalY: 0,
|
|
68
|
+
scale: 2,
|
|
69
|
+
velocity: 1,
|
|
70
|
+
numberOfPointers: 2
|
|
71
|
+
},
|
|
72
|
+
[rotationHandlerName]: {
|
|
73
|
+
anchorX: 0,
|
|
74
|
+
anchorY: 0,
|
|
75
|
+
rotation: 3.14,
|
|
76
|
+
velocity: 2,
|
|
77
|
+
numberOfPointers: 2
|
|
78
|
+
},
|
|
79
|
+
[tapHandlerName]: {
|
|
80
|
+
x: 0,
|
|
81
|
+
y: 0,
|
|
82
|
+
absoluteX: 0,
|
|
83
|
+
absoluteY: 0,
|
|
84
|
+
numberOfPointers: 1
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
function isGesture(componentOrGesture) {
|
|
88
|
+
return componentOrGesture instanceof BaseGesture;
|
|
89
|
+
}
|
|
90
|
+
function wrapWithNativeEvent(event) {
|
|
91
|
+
return {
|
|
92
|
+
nativeEvent: event
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function fillOldStateChanges(previousEvent, currentEvent) {
|
|
96
|
+
const isFirstEvent = previousEvent === null;
|
|
97
|
+
if (isFirstEvent) {
|
|
98
|
+
return {
|
|
99
|
+
oldState: State.UNDETERMINED,
|
|
100
|
+
...currentEvent
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const isGestureStateEvent = previousEvent.state !== currentEvent.state;
|
|
104
|
+
if (isGestureStateEvent) {
|
|
105
|
+
return {
|
|
106
|
+
oldState: previousEvent === null || previousEvent === void 0 ? void 0 : previousEvent.state,
|
|
107
|
+
...currentEvent
|
|
108
|
+
};
|
|
109
|
+
} else {
|
|
110
|
+
return currentEvent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function validateStateTransitions(previousEvent, currentEvent) {
|
|
114
|
+
function stringify(event) {
|
|
115
|
+
return JSON.stringify(event, null, 2);
|
|
116
|
+
}
|
|
117
|
+
function errorMsgWithBothEvents(description) {
|
|
118
|
+
return `${description}, invalid event: ${stringify(currentEvent)}, previous event: ${stringify(previousEvent)}`;
|
|
119
|
+
}
|
|
120
|
+
function errorMsgWithCurrentEvent(description) {
|
|
121
|
+
return `${description}, invalid event: ${stringify(currentEvent)}`;
|
|
122
|
+
}
|
|
123
|
+
invariant(hasProperty(currentEvent, 'state'), errorMsgWithCurrentEvent('every event must have state'));
|
|
124
|
+
const isFirstEvent = previousEvent === null;
|
|
125
|
+
if (isFirstEvent) {
|
|
126
|
+
invariant(currentEvent.state === State.BEGAN, errorMsgWithCurrentEvent('first event must have BEGAN state'));
|
|
127
|
+
}
|
|
128
|
+
if (previousEvent !== null) {
|
|
129
|
+
if (previousEvent.state !== currentEvent.state) {
|
|
130
|
+
invariant(hasProperty(currentEvent, 'oldState'), errorMsgWithCurrentEvent('when state changes, oldState field should be present'));
|
|
131
|
+
invariant(currentEvent.oldState === previousEvent.state, errorMsgWithBothEvents("when state changes, oldState should be the same as previous event' state"));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return currentEvent;
|
|
135
|
+
}
|
|
136
|
+
function fillMissingDefaultsFor({
|
|
137
|
+
handlerType,
|
|
138
|
+
handlerTag
|
|
139
|
+
}) {
|
|
140
|
+
return event => {
|
|
141
|
+
return {
|
|
142
|
+
...handlersDefaultEvents[handlerType],
|
|
143
|
+
...event,
|
|
144
|
+
handlerTag
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function isDiscreteHandler(handlerType) {
|
|
149
|
+
return handlerType === 'TapGestureHandler' || handlerType === 'LongPressGestureHandler';
|
|
150
|
+
}
|
|
151
|
+
function fillMissingStatesTransitions(events, isDiscreteHandler) {
|
|
152
|
+
var _events2, _events$;
|
|
153
|
+
const _events = [...events];
|
|
154
|
+
const lastEvent = (_events2 = _events[_events.length - 1]) !== null && _events2 !== void 0 ? _events2 : null;
|
|
155
|
+
const firstEvent = (_events$ = _events[0]) !== null && _events$ !== void 0 ? _events$ : null;
|
|
156
|
+
const shouldDuplicateFirstEvent = !isDiscreteHandler && !hasState(State.BEGAN)(firstEvent);
|
|
157
|
+
if (shouldDuplicateFirstEvent) {
|
|
158
|
+
const duplicated = {
|
|
159
|
+
...firstEvent,
|
|
160
|
+
state: State.BEGAN
|
|
161
|
+
};
|
|
162
|
+
// @ts-ignore badly typed, property may exist and we don't want to copy it
|
|
163
|
+
delete duplicated.oldState;
|
|
164
|
+
_events.unshift(duplicated);
|
|
165
|
+
}
|
|
166
|
+
const shouldDuplicateLastEvent = !hasState(State.END)(lastEvent) || !hasState(State.FAILED)(lastEvent) || !hasState(State.CANCELLED)(lastEvent);
|
|
167
|
+
if (shouldDuplicateLastEvent) {
|
|
168
|
+
const duplicated = {
|
|
169
|
+
...lastEvent,
|
|
170
|
+
state: State.END
|
|
171
|
+
};
|
|
172
|
+
// @ts-ignore badly typed, property may exist and we don't want to copy it
|
|
173
|
+
delete duplicated.oldState;
|
|
174
|
+
_events.push(duplicated);
|
|
175
|
+
}
|
|
176
|
+
function isWithoutState(event) {
|
|
177
|
+
return event !== null && !hasProperty(event, 'state');
|
|
178
|
+
}
|
|
179
|
+
function hasState(state) {
|
|
180
|
+
return event => event !== null && event.state === state;
|
|
181
|
+
}
|
|
182
|
+
function noEventsLeft(event) {
|
|
183
|
+
return event === null;
|
|
184
|
+
}
|
|
185
|
+
function trueFn() {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
function fillEventsForCurrentState({
|
|
189
|
+
shouldConsumeEvent = trueFn,
|
|
190
|
+
shouldTransitionToNextState = trueFn
|
|
191
|
+
}) {
|
|
192
|
+
function peekCurrentEvent() {
|
|
193
|
+
var _events$2;
|
|
194
|
+
return (_events$2 = _events[0]) !== null && _events$2 !== void 0 ? _events$2 : null;
|
|
195
|
+
}
|
|
196
|
+
function peekNextEvent() {
|
|
197
|
+
var _events$3;
|
|
198
|
+
return (_events$3 = _events[1]) !== null && _events$3 !== void 0 ? _events$3 : null;
|
|
199
|
+
}
|
|
200
|
+
function consumeCurrentEvent() {
|
|
201
|
+
_events.shift();
|
|
202
|
+
}
|
|
203
|
+
const currentEvent = peekCurrentEvent();
|
|
204
|
+
const nextEvent = peekNextEvent();
|
|
205
|
+
const currentRequiredState = REQUIRED_EVENTS[currentStateIdx];
|
|
206
|
+
let eventData = {};
|
|
207
|
+
const shouldUseEvent = shouldConsumeEvent(currentEvent);
|
|
208
|
+
if (shouldUseEvent) {
|
|
209
|
+
eventData = currentEvent;
|
|
210
|
+
consumeCurrentEvent();
|
|
211
|
+
}
|
|
212
|
+
transformedEvents.push({
|
|
213
|
+
state: currentRequiredState,
|
|
214
|
+
...eventData
|
|
215
|
+
});
|
|
216
|
+
if (shouldTransitionToNextState(nextEvent)) {
|
|
217
|
+
currentStateIdx++;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const REQUIRED_EVENTS = [State.BEGAN, State.ACTIVE, State.END];
|
|
221
|
+
let currentStateIdx = 0;
|
|
222
|
+
const transformedEvents = [];
|
|
223
|
+
let hasAllStates;
|
|
224
|
+
let iterations = 0;
|
|
225
|
+
do {
|
|
226
|
+
const nextRequiredState = REQUIRED_EVENTS[currentStateIdx];
|
|
227
|
+
if (nextRequiredState === State.BEGAN) {
|
|
228
|
+
fillEventsForCurrentState({
|
|
229
|
+
shouldConsumeEvent: e => isWithoutState(e) || hasState(State.BEGAN)(e)
|
|
230
|
+
});
|
|
231
|
+
} else if (nextRequiredState === State.ACTIVE) {
|
|
232
|
+
const shouldConsumeEvent = e => isWithoutState(e) || hasState(State.ACTIVE)(e);
|
|
233
|
+
const shouldTransitionToNextState = nextEvent => noEventsLeft(nextEvent) || hasState(State.END)(nextEvent) || hasState(State.FAILED)(nextEvent) || hasState(State.CANCELLED)(nextEvent);
|
|
234
|
+
fillEventsForCurrentState({
|
|
235
|
+
shouldConsumeEvent,
|
|
236
|
+
shouldTransitionToNextState
|
|
237
|
+
});
|
|
238
|
+
} else if (nextRequiredState === State.END) {
|
|
239
|
+
fillEventsForCurrentState({});
|
|
240
|
+
}
|
|
241
|
+
hasAllStates = currentStateIdx === REQUIRED_EVENTS.length;
|
|
242
|
+
invariant(iterations++ <= 500, 'exceeded max number of iterations, please report a bug in RNGH repository with your test case');
|
|
243
|
+
} while (!hasAllStates);
|
|
244
|
+
return transformedEvents;
|
|
245
|
+
}
|
|
246
|
+
function getHandlerData(componentOrGesture) {
|
|
247
|
+
if (isGesture(componentOrGesture)) {
|
|
248
|
+
const gesture = componentOrGesture;
|
|
249
|
+
return {
|
|
250
|
+
emitEvent: (eventName, args) => {
|
|
251
|
+
DeviceEventEmitter.emit(eventName, args.nativeEvent);
|
|
252
|
+
},
|
|
253
|
+
handlerType: gesture.handlerName,
|
|
254
|
+
handlerTag: gesture.handlerTag
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
const gestureHandlerComponent = componentOrGesture;
|
|
258
|
+
return {
|
|
259
|
+
emitEvent: (eventName, args) => {
|
|
260
|
+
fireEvent(gestureHandlerComponent, eventName, args);
|
|
261
|
+
},
|
|
262
|
+
handlerType: gestureHandlerComponent.props.handlerType,
|
|
263
|
+
handlerTag: gestureHandlerComponent.props.handlerTag
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// prettier-ignore
|
|
268
|
+
|
|
269
|
+
export function fireGestureHandler(componentOrGesture, eventList = []) {
|
|
270
|
+
const {
|
|
271
|
+
emitEvent,
|
|
272
|
+
handlerType,
|
|
273
|
+
handlerTag
|
|
274
|
+
} = getHandlerData(componentOrGesture);
|
|
275
|
+
let _ = fillMissingStatesTransitions(eventList, isDiscreteHandler(handlerType));
|
|
276
|
+
_ = _.map(fillMissingDefaultsFor({
|
|
277
|
+
handlerTag,
|
|
278
|
+
handlerType
|
|
279
|
+
}));
|
|
280
|
+
_ = withPrevAndCurrent(_, fillOldStateChanges);
|
|
281
|
+
_ = withPrevAndCurrent(_, validateStateTransitions);
|
|
282
|
+
// @ts-ignore TODO
|
|
283
|
+
_ = _.map(wrapWithNativeEvent);
|
|
284
|
+
const events = _;
|
|
285
|
+
const firstEvent = events.shift();
|
|
286
|
+
emitEvent('onGestureHandlerStateChange', firstEvent);
|
|
287
|
+
let lastSentEvent = firstEvent;
|
|
288
|
+
for (const event of events) {
|
|
289
|
+
const hasChangedState = lastSentEvent.nativeEvent.state !== event.nativeEvent.state;
|
|
290
|
+
if (hasChangedState) {
|
|
291
|
+
emitEvent('onGestureHandlerStateChange', event);
|
|
292
|
+
} else {
|
|
293
|
+
emitEvent('onGestureHandlerEvent', event);
|
|
294
|
+
}
|
|
295
|
+
lastSentEvent = event;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export function getByGestureTestId(testID) {
|
|
299
|
+
const handler = findHandlerByTestID(testID);
|
|
300
|
+
if (handler === null) {
|
|
301
|
+
throw new Error(`Handler with id: '${testID}' cannot be found`);
|
|
302
|
+
}
|
|
303
|
+
return handler;
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=jestUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["invariant","DeviceEventEmitter","flingHandlerName","forceTouchHandlerName","BaseGesture","findHandlerByTestID","longPressHandlerName","nativeViewHandlerName","panHandlerName","pinchHandlerName","rotationHandlerName","tapHandlerName","State","hasProperty","withPrevAndCurrent","fireEvent","_element","_name","_data","require","_e","handlersDefaultEvents","x","y","absoluteX","absoluteY","numberOfPointers","force","duration","pointerInside","translationX","translationY","velocityX","velocityY","focalX","focalY","scale","velocity","anchorX","anchorY","rotation","isGesture","componentOrGesture","wrapWithNativeEvent","event","nativeEvent","fillOldStateChanges","previousEvent","currentEvent","isFirstEvent","oldState","UNDETERMINED","isGestureStateEvent","state","validateStateTransitions","stringify","JSON","errorMsgWithBothEvents","description","errorMsgWithCurrentEvent","BEGAN","fillMissingDefaultsFor","handlerType","handlerTag","isDiscreteHandler","fillMissingStatesTransitions","events","_events2","_events$","_events","lastEvent","length","firstEvent","shouldDuplicateFirstEvent","hasState","duplicated","unshift","shouldDuplicateLastEvent","END","FAILED","CANCELLED","push","isWithoutState","noEventsLeft","trueFn","fillEventsForCurrentState","shouldConsumeEvent","shouldTransitionToNextState","peekCurrentEvent","_events$2","peekNextEvent","_events$3","consumeCurrentEvent","shift","nextEvent","currentRequiredState","REQUIRED_EVENTS","currentStateIdx","eventData","shouldUseEvent","transformedEvents","ACTIVE","hasAllStates","iterations","nextRequiredState","e","getHandlerData","gesture","emitEvent","eventName","args","emit","handlerName","gestureHandlerComponent","props","fireGestureHandler","eventList","_","map","lastSentEvent","hasChangedState","getByGestureTestId","testID","handler","Error"],"sources":["jestUtils.ts"],"sourcesContent":["import invariant from 'invariant';\nimport { DeviceEventEmitter } from 'react-native';\nimport { ReactTestInstance } from 'react-test-renderer';\nimport {\n FlingGestureHandler,\n FlingGestureHandlerEventPayload,\n flingHandlerName,\n} from '../handlers/FlingGestureHandler';\nimport {\n ForceTouchGestureHandler,\n ForceTouchGestureHandlerEventPayload,\n forceTouchHandlerName,\n} from '../handlers/ForceTouchGestureHandler';\nimport {\n BaseGestureHandlerProps,\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../handlers/gestureHandlerCommon';\nimport { FlingGesture } from '../handlers/gestures/flingGesture';\nimport { ForceTouchGesture } from '../handlers/gestures/forceTouchGesture';\nimport { BaseGesture, GestureType } from '../handlers/gestures/gesture';\nimport { LongPressGesture } from '../handlers/gestures/longPressGesture';\nimport { NativeGesture } from '../handlers/gestures/nativeGesture';\nimport { PanGesture } from '../handlers/gestures/panGesture';\nimport { PinchGesture } from '../handlers/gestures/pinchGesture';\nimport { RotationGesture } from '../handlers/gestures/rotationGesture';\nimport { TapGesture } from '../handlers/gestures/tapGesture';\nimport { findHandlerByTestID } from '../handlers/handlersRegistry';\nimport {\n LongPressGestureHandler,\n LongPressGestureHandlerEventPayload,\n longPressHandlerName,\n} from '../handlers/LongPressGestureHandler';\nimport {\n NativeViewGestureHandler,\n NativeViewGestureHandlerPayload,\n nativeViewHandlerName,\n} from '../handlers/NativeViewGestureHandler';\nimport {\n PanGestureHandler,\n PanGestureHandlerEventPayload,\n panHandlerName,\n} from '../handlers/PanGestureHandler';\nimport {\n PinchGestureHandler,\n PinchGestureHandlerEventPayload,\n pinchHandlerName,\n} from '../handlers/PinchGestureHandler';\nimport {\n RotationGestureHandler,\n RotationGestureHandlerEventPayload,\n rotationHandlerName,\n} from '../handlers/RotationGestureHandler';\nimport {\n TapGestureHandler,\n TapGestureHandlerEventPayload,\n tapHandlerName,\n} from '../handlers/TapGestureHandler';\nimport { State } from '../State';\nimport { hasProperty, withPrevAndCurrent } from '../utils';\n\n// load fireEvent conditionally, so RNGH may be used in setups without testing-library\nlet fireEvent = (\n _element: ReactTestInstance,\n _name: string,\n ..._data: any[]\n) => {\n // NOOP\n};\n\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n fireEvent = require('@testing-library/react-native').fireEvent;\n} catch (_e) {\n // do nothing if not available\n}\n\ntype GestureHandlerTestEvent<\n TEventPayload extends Record<string, unknown> = Record<string, unknown>\n> = (\n | GestureEvent<TEventPayload>\n | HandlerStateChangeEvent<TEventPayload>\n)['nativeEvent'];\n\ntype HandlerNames = keyof DefaultEventsMapping;\n\ntype WithNumberOfPointers<T> = {\n [P in keyof T]: T[P] & { numberOfPointers: number };\n};\ntype DefaultEventsMapping = WithNumberOfPointers<{\n [flingHandlerName]: FlingGestureHandlerEventPayload;\n [forceTouchHandlerName]: ForceTouchGestureHandlerEventPayload;\n [longPressHandlerName]: LongPressGestureHandlerEventPayload;\n [nativeViewHandlerName]: NativeViewGestureHandlerPayload;\n [panHandlerName]: PanGestureHandlerEventPayload;\n [pinchHandlerName]: PinchGestureHandlerEventPayload;\n [rotationHandlerName]: RotationGestureHandlerEventPayload;\n [tapHandlerName]: TapGestureHandlerEventPayload;\n}>;\n\nconst handlersDefaultEvents: DefaultEventsMapping = {\n [flingHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n numberOfPointers: 1,\n },\n [forceTouchHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n force: 1,\n numberOfPointers: 1,\n },\n [longPressHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n duration: 100,\n numberOfPointers: 1,\n },\n [nativeViewHandlerName]: {\n pointerInside: true,\n numberOfPointers: 1,\n },\n [panHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n translationX: 100,\n translationY: 0,\n velocityX: 3,\n velocityY: 0,\n numberOfPointers: 1,\n },\n [pinchHandlerName]: {\n focalX: 0,\n focalY: 0,\n scale: 2,\n velocity: 1,\n numberOfPointers: 2,\n },\n [rotationHandlerName]: {\n anchorX: 0,\n anchorY: 0,\n rotation: 3.14,\n velocity: 2,\n numberOfPointers: 2,\n },\n [tapHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n numberOfPointers: 1,\n },\n};\n\nfunction isGesture(\n componentOrGesture: ReactTestInstance | GestureType\n): componentOrGesture is GestureType {\n return componentOrGesture instanceof BaseGesture;\n}\n\ninterface WrappedGestureHandlerTestEvent {\n nativeEvent: GestureHandlerTestEvent;\n}\nfunction wrapWithNativeEvent(\n event: GestureHandlerTestEvent\n): WrappedGestureHandlerTestEvent {\n return { nativeEvent: event };\n}\n\nfunction fillOldStateChanges(\n previousEvent: GestureHandlerTestEvent | null,\n currentEvent: Omit<GestureHandlerTestEvent, 'oldState'>\n): GestureHandlerTestEvent {\n const isFirstEvent = previousEvent === null;\n if (isFirstEvent) {\n return {\n oldState: State.UNDETERMINED,\n ...currentEvent,\n } as GestureHandlerTestEvent;\n }\n\n const isGestureStateEvent = previousEvent.state !== currentEvent.state;\n if (isGestureStateEvent) {\n return {\n oldState: previousEvent?.state,\n ...currentEvent,\n } as GestureHandlerTestEvent;\n } else {\n return currentEvent as GestureHandlerTestEvent;\n }\n}\n\ntype EventWithStates = Partial<\n Pick<GestureHandlerTestEvent, 'oldState' | 'state'>\n>;\nfunction validateStateTransitions(\n previousEvent: EventWithStates | null,\n currentEvent: EventWithStates\n) {\n function stringify(event: Record<string, unknown> | null) {\n return JSON.stringify(event, null, 2);\n }\n function errorMsgWithBothEvents(description: string) {\n return `${description}, invalid event: ${stringify(\n currentEvent\n )}, previous event: ${stringify(previousEvent)}`;\n }\n\n function errorMsgWithCurrentEvent(description: string) {\n return `${description}, invalid event: ${stringify(currentEvent)}`;\n }\n\n invariant(\n hasProperty(currentEvent, 'state'),\n errorMsgWithCurrentEvent('every event must have state')\n );\n\n const isFirstEvent = previousEvent === null;\n if (isFirstEvent) {\n invariant(\n currentEvent.state === State.BEGAN,\n errorMsgWithCurrentEvent('first event must have BEGAN state')\n );\n }\n\n if (previousEvent !== null) {\n if (previousEvent.state !== currentEvent.state) {\n invariant(\n hasProperty(currentEvent, 'oldState'),\n errorMsgWithCurrentEvent(\n 'when state changes, oldState field should be present'\n )\n );\n invariant(\n currentEvent.oldState === previousEvent.state,\n errorMsgWithBothEvents(\n \"when state changes, oldState should be the same as previous event' state\"\n )\n );\n }\n }\n\n return currentEvent;\n}\n\ntype EventWithoutStates = Omit<GestureHandlerTestEvent, 'oldState' | 'state'>;\ninterface HandlerInfo {\n handlerType: HandlerNames;\n handlerTag: number;\n}\nfunction fillMissingDefaultsFor({\n handlerType,\n handlerTag,\n}: HandlerInfo): (\n event: Partial<GestureHandlerTestEvent>\n) => EventWithoutStates {\n return (event) => {\n return {\n ...handlersDefaultEvents[handlerType],\n ...event,\n handlerTag,\n };\n };\n}\n\nfunction isDiscreteHandler(handlerType: HandlerNames) {\n return (\n handlerType === 'TapGestureHandler' ||\n handlerType === 'LongPressGestureHandler'\n );\n}\n\nfunction fillMissingStatesTransitions(\n events: EventWithoutStates[],\n isDiscreteHandler: boolean\n): EventWithoutStates[] {\n type Event = EventWithoutStates | null;\n const _events = [...events];\n const lastEvent = _events[_events.length - 1] ?? null;\n const firstEvent = _events[0] ?? null;\n\n const shouldDuplicateFirstEvent =\n !isDiscreteHandler && !hasState(State.BEGAN)(firstEvent);\n if (shouldDuplicateFirstEvent) {\n const duplicated = { ...firstEvent, state: State.BEGAN };\n // @ts-ignore badly typed, property may exist and we don't want to copy it\n delete duplicated.oldState;\n _events.unshift(duplicated);\n }\n\n const shouldDuplicateLastEvent =\n !hasState(State.END)(lastEvent) ||\n !hasState(State.FAILED)(lastEvent) ||\n !hasState(State.CANCELLED)(lastEvent);\n\n if (shouldDuplicateLastEvent) {\n const duplicated = { ...lastEvent, state: State.END };\n // @ts-ignore badly typed, property may exist and we don't want to copy it\n delete duplicated.oldState;\n _events.push(duplicated);\n }\n\n function isWithoutState(event: Event) {\n return event !== null && !hasProperty(event, 'state');\n }\n function hasState(state: State) {\n return (event: Event) => event !== null && event.state === state;\n }\n function noEventsLeft(event: Event) {\n return event === null;\n }\n\n function trueFn() {\n return true;\n }\n interface Args {\n shouldConsumeEvent?: (event: Event) => boolean;\n shouldTransitionToNextState?: (nextEvent: Event) => boolean;\n }\n function fillEventsForCurrentState({\n shouldConsumeEvent = trueFn,\n shouldTransitionToNextState = trueFn,\n }: Args) {\n function peekCurrentEvent(): Event {\n return _events[0] ?? null;\n }\n function peekNextEvent(): Event {\n return _events[1] ?? null;\n }\n function consumeCurrentEvent() {\n _events.shift();\n }\n const currentEvent = peekCurrentEvent();\n const nextEvent = peekNextEvent();\n const currentRequiredState = REQUIRED_EVENTS[currentStateIdx];\n\n let eventData = {};\n const shouldUseEvent = shouldConsumeEvent(currentEvent);\n if (shouldUseEvent) {\n eventData = currentEvent!;\n consumeCurrentEvent();\n }\n transformedEvents.push({ state: currentRequiredState, ...eventData });\n if (shouldTransitionToNextState(nextEvent)) {\n currentStateIdx++;\n }\n }\n\n const REQUIRED_EVENTS = [State.BEGAN, State.ACTIVE, State.END];\n\n let currentStateIdx = 0;\n const transformedEvents: EventWithoutStates[] = [];\n let hasAllStates;\n let iterations = 0;\n do {\n const nextRequiredState = REQUIRED_EVENTS[currentStateIdx];\n if (nextRequiredState === State.BEGAN) {\n fillEventsForCurrentState({\n shouldConsumeEvent: (e: Event) =>\n isWithoutState(e) || hasState(State.BEGAN)(e),\n });\n } else if (nextRequiredState === State.ACTIVE) {\n const shouldConsumeEvent = (e: Event) =>\n isWithoutState(e) || hasState(State.ACTIVE)(e);\n const shouldTransitionToNextState = (nextEvent: Event) =>\n noEventsLeft(nextEvent) ||\n hasState(State.END)(nextEvent) ||\n hasState(State.FAILED)(nextEvent) ||\n hasState(State.CANCELLED)(nextEvent);\n\n fillEventsForCurrentState({\n shouldConsumeEvent,\n shouldTransitionToNextState,\n });\n } else if (nextRequiredState === State.END) {\n fillEventsForCurrentState({});\n }\n hasAllStates = currentStateIdx === REQUIRED_EVENTS.length;\n\n invariant(\n iterations++ <= 500,\n 'exceeded max number of iterations, please report a bug in RNGH repository with your test case'\n );\n } while (!hasAllStates);\n\n return transformedEvents;\n}\n\ntype EventEmitter = (\n eventName: string,\n args: { nativeEvent: GestureHandlerTestEvent }\n) => void;\ninterface HandlerData {\n emitEvent: EventEmitter;\n handlerType: HandlerNames;\n handlerTag: number;\n}\nfunction getHandlerData(\n componentOrGesture: ReactTestInstance | GestureType\n): HandlerData {\n if (isGesture(componentOrGesture)) {\n const gesture = componentOrGesture;\n return {\n emitEvent: (eventName, args) => {\n DeviceEventEmitter.emit(eventName, args.nativeEvent);\n },\n handlerType: gesture.handlerName as HandlerNames,\n handlerTag: gesture.handlerTag,\n };\n }\n const gestureHandlerComponent = componentOrGesture;\n return {\n emitEvent: (eventName, args) => {\n fireEvent(gestureHandlerComponent, eventName, args);\n },\n handlerType: gestureHandlerComponent.props.handlerType as HandlerNames,\n handlerTag: gestureHandlerComponent.props.handlerTag as number,\n };\n}\ntype AllGestures =\n | TapGesture\n | PanGesture\n | LongPressGesture\n | RotationGesture\n | PinchGesture\n | FlingGesture\n | ForceTouchGesture\n | NativeGesture;\n\ntype AllHandlers =\n | TapGestureHandler\n | PanGestureHandler\n | LongPressGestureHandler\n | RotationGestureHandler\n | PinchGestureHandler\n | FlingGestureHandler\n | ForceTouchGestureHandler\n | NativeViewGestureHandler;\n\n// prettier-ignore\ntype ClassComponentConstructor<P> = new (props: P) => React.Component<P, any, any>;\n\ntype ExtractPayloadFromProps<T> = T extends BaseGestureHandlerProps<\n infer TPayload\n>\n ? TPayload\n : never;\n\ntype ExtractConfig<T> = T extends BaseGesture<infer TGesturePayload>\n ? TGesturePayload\n : T extends ClassComponentConstructor<infer THandlerProps>\n ? ExtractPayloadFromProps<THandlerProps>\n : Record<string, unknown>;\n\nexport function fireGestureHandler<THandler extends AllGestures | AllHandlers>(\n componentOrGesture: ReactTestInstance | GestureType,\n eventList: Partial<GestureHandlerTestEvent<ExtractConfig<THandler>>>[] = []\n): void {\n const { emitEvent, handlerType, handlerTag } =\n getHandlerData(componentOrGesture);\n\n let _ = fillMissingStatesTransitions(\n eventList,\n isDiscreteHandler(handlerType)\n );\n _ = _.map(fillMissingDefaultsFor({ handlerTag, handlerType }));\n _ = withPrevAndCurrent(_, fillOldStateChanges);\n _ = withPrevAndCurrent(_, validateStateTransitions);\n // @ts-ignore TODO\n _ = _.map(wrapWithNativeEvent);\n\n const events = _ as unknown as WrappedGestureHandlerTestEvent[];\n\n const firstEvent = events.shift()!;\n\n emitEvent('onGestureHandlerStateChange', firstEvent);\n let lastSentEvent = firstEvent;\n for (const event of events) {\n const hasChangedState =\n lastSentEvent.nativeEvent.state !== event.nativeEvent.state;\n\n if (hasChangedState) {\n emitEvent('onGestureHandlerStateChange', event);\n } else {\n emitEvent('onGestureHandlerEvent', event);\n }\n lastSentEvent = event;\n }\n}\n\nexport function getByGestureTestId(testID: string) {\n const handler = findHandlerByTestID(testID);\n if (handler === null) {\n throw new Error(`Handler with id: '${testID}' cannot be found`);\n }\n return handler;\n}\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,WAAW;AACjC,SAASC,kBAAkB,QAAQ,cAAc;AAEjD,SAGEC,gBAAgB,QACX,iCAAiC;AACxC,SAGEC,qBAAqB,QAChB,sCAAsC;AAQ7C,SAASC,WAAW,QAAqB,8BAA8B;AAOvE,SAASC,mBAAmB,QAAQ,8BAA8B;AAClE,SAGEC,oBAAoB,QACf,qCAAqC;AAC5C,SAGEC,qBAAqB,QAChB,sCAAsC;AAC7C,SAGEC,cAAc,QACT,+BAA+B;AACtC,SAGEC,gBAAgB,QACX,iCAAiC;AACxC,SAGEC,mBAAmB,QACd,oCAAoC;AAC3C,SAGEC,cAAc,QACT,+BAA+B;AACtC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,UAAU;;AAE1D;AACA,IAAIC,SAAS,GAAGA,CACdC,QAA2B,EAC3BC,KAAa,EACb,GAAGC,KAAY,KACZ;EACH;AAAA,CACD;AAED,IAAI;EACF;EACAH,SAAS,GAAGI,OAAO,CAAC,+BAA+B,CAAC,CAACJ,SAAS;AAChE,CAAC,CAAC,OAAOK,EAAE,EAAE;EACX;AAAA;AA0BF,MAAMC,qBAA2C,GAAG;EAClD,CAACnB,gBAAgB,GAAG;IAClBoB,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJC,SAAS,EAAE,CAAC;IACZC,SAAS,EAAE,CAAC;IACZC,gBAAgB,EAAE;EACpB,CAAC;EACD,CAACvB,qBAAqB,GAAG;IACvBmB,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJC,SAAS,EAAE,CAAC;IACZC,SAAS,EAA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MACLgE,SAAS,CAAC,uBAAuB,EAAEhE,KAAK,CAAC;IAC3C;IACA2E,aAAa,GAAG3E,KAAK;EACvB;AACF;AAEA,OAAO,SAAS6E,kBAAkBA,CAACC,MAAc,EAAE;EACjD,MAAMC,OAAO,GAAGtH,mBAAmB,CAACqH,MAAM,CAAC;EAC3C,IAAIC,OAAO,KAAK,IAAI,EAAE;IACpB,MAAM,IAAIC,KAAK,CAAC,qBAAqBF,MAAM,mBAAmB,CAAC;EACjE;EACA,OAAOC,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, ScrollView, FlatList, Switch, TextInput, DrawerLayoutAndroid, View } from 'react-native';
|
|
2
|
+
import { State } from './State';
|
|
3
|
+
import { Directions } from './Directions';
|
|
4
|
+
const NOOP = () => {
|
|
5
|
+
// do nothing
|
|
6
|
+
};
|
|
7
|
+
const PanGestureHandler = View;
|
|
8
|
+
const attachGestureHandler = NOOP;
|
|
9
|
+
const createGestureHandler = NOOP;
|
|
10
|
+
const dropGestureHandler = NOOP;
|
|
11
|
+
const updateGestureHandler = NOOP;
|
|
12
|
+
const flushOperations = NOOP;
|
|
13
|
+
const NativeViewGestureHandler = View;
|
|
14
|
+
const TapGestureHandler = View;
|
|
15
|
+
const ForceTouchGestureHandler = View;
|
|
16
|
+
const LongPressGestureHandler = View;
|
|
17
|
+
const PinchGestureHandler = View;
|
|
18
|
+
const RotationGestureHandler = View;
|
|
19
|
+
const FlingGestureHandler = View;
|
|
20
|
+
const RawButton = TouchableNativeFeedback;
|
|
21
|
+
const BaseButton = TouchableNativeFeedback;
|
|
22
|
+
const RectButton = TouchableNativeFeedback;
|
|
23
|
+
const BorderlessButton = TouchableNativeFeedback;
|
|
24
|
+
export default {
|
|
25
|
+
TouchableHighlight,
|
|
26
|
+
TouchableNativeFeedback,
|
|
27
|
+
TouchableOpacity,
|
|
28
|
+
TouchableWithoutFeedback,
|
|
29
|
+
ScrollView,
|
|
30
|
+
FlatList,
|
|
31
|
+
Switch,
|
|
32
|
+
TextInput,
|
|
33
|
+
DrawerLayoutAndroid,
|
|
34
|
+
NativeViewGestureHandler,
|
|
35
|
+
TapGestureHandler,
|
|
36
|
+
ForceTouchGestureHandler,
|
|
37
|
+
LongPressGestureHandler,
|
|
38
|
+
PinchGestureHandler,
|
|
39
|
+
RotationGestureHandler,
|
|
40
|
+
FlingGestureHandler,
|
|
41
|
+
RawButton,
|
|
42
|
+
BaseButton,
|
|
43
|
+
RectButton,
|
|
44
|
+
BorderlessButton,
|
|
45
|
+
PanGestureHandler,
|
|
46
|
+
attachGestureHandler,
|
|
47
|
+
createGestureHandler,
|
|
48
|
+
dropGestureHandler,
|
|
49
|
+
updateGestureHandler,
|
|
50
|
+
flushOperations,
|
|
51
|
+
// probably can be removed
|
|
52
|
+
Directions,
|
|
53
|
+
State
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","View","State","Directions","NOOP","PanGestureHandler","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton"],"sources":["mocks.ts"],"sourcesContent":["import {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n View,\n} from 'react-native';\nimport { State } from './State';\nimport { Directions } from './Directions';\n\nconst NOOP = () => {\n // do nothing\n};\nconst PanGestureHandler = View;\nconst attachGestureHandler = NOOP;\nconst createGestureHandler = NOOP;\nconst dropGestureHandler = NOOP;\nconst updateGestureHandler = NOOP;\nconst flushOperations = NOOP;\nconst NativeViewGestureHandler = View;\nconst TapGestureHandler = View;\nconst ForceTouchGestureHandler = View;\nconst LongPressGestureHandler = View;\nconst PinchGestureHandler = View;\nconst RotationGestureHandler = View;\nconst FlingGestureHandler = View;\nconst RawButton = TouchableNativeFeedback;\nconst BaseButton = TouchableNativeFeedback;\nconst RectButton = TouchableNativeFeedback;\nconst BorderlessButton = TouchableNativeFeedback;\n\nexport default {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n NativeViewGestureHandler,\n TapGestureHandler,\n ForceTouchGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PanGestureHandler,\n attachGestureHandler,\n createGestureHandler,\n dropGestureHandler,\n updateGestureHandler,\n flushOperations,\n // probably can be removed\n Directions,\n State,\n} as const;\n"],"mappings":"AAAA,SACEA,kBAAkB,EAClBC,uBAAuB,EACvBC,gBAAgB,EAChBC,wBAAwB,EACxBC,UAAU,EACVC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,mBAAmB,EACnBC,IAAI,QACC,cAAc;AACrB,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,UAAU,QAAQ,cAAc;AAEzC,MAAMC,IAAI,GAAGA,CAAA,KAAM;EACjB;AAAA,CACD;AACD,MAAMC,iBAAiB,GAAGJ,IAAI;AAC9B,MAAMK,oBAAoB,GAAGF,IAAI;AACjC,MAAMG,oBAAoB,GAAGH,IAAI;AACjC,MAAMI,kBAAkB,GAAGJ,IAAI;AAC/B,MAAMK,oBAAoB,GAAGL,IAAI;AACjC,MAAMM,eAAe,GAAGN,IAAI;AAC5B,MAAMO,wBAAwB,GAAGV,IAAI;AACrC,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