@react-native-oh-tpl/react-native-gesture-handler 2.12.1-0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/DrawerLayout/package.json +6 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/RNGestureHandler.podspec +44 -0
- package/Swipeable/package.json +6 -0
- package/android/build.gradle +209 -0
- package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +29 -0
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +12 -0
- package/android/gradle.properties +19 -0
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +50 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +23 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +25 -0
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +21 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +807 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +671 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +47 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +11 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +257 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +9 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +322 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +103 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +23 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +125 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +93 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ScaleGestureDetector.java +558 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +168 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt +10 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +16 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +423 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +15 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +75 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +74 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +702 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +142 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +78 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +51 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +78 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +69 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +51 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +22 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +33 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +18 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +42 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/jni/CMakeLists.txt +37 -0
- package/android/src/main/jni/cpp-adapter.cpp +44 -0
- package/ios/Handlers/RNFlingHandler.h +4 -0
- package/ios/Handlers/RNFlingHandler.m +152 -0
- package/ios/Handlers/RNForceTouchHandler.h +4 -0
- package/ios/Handlers/RNForceTouchHandler.m +175 -0
- package/ios/Handlers/RNHoverHandler.h +12 -0
- package/ios/Handlers/RNHoverHandler.m +153 -0
- package/ios/Handlers/RNLongPressHandler.h +12 -0
- package/ios/Handlers/RNLongPressHandler.m +183 -0
- package/ios/Handlers/RNManualHandler.h +4 -0
- package/ios/Handlers/RNManualHandler.m +88 -0
- package/ios/Handlers/RNNativeViewHandler.h +15 -0
- package/ios/Handlers/RNNativeViewHandler.mm +193 -0
- package/ios/Handlers/RNPanHandler.h +12 -0
- package/ios/Handlers/RNPanHandler.m +331 -0
- package/ios/Handlers/RNPinchHandler.h +12 -0
- package/ios/Handlers/RNPinchHandler.m +95 -0
- package/ios/Handlers/RNRotationHandler.h +12 -0
- package/ios/Handlers/RNRotationHandler.m +93 -0
- package/ios/Handlers/RNTapHandler.h +12 -0
- package/ios/Handlers/RNTapHandler.m +265 -0
- package/ios/RNGHTouchEventType.h +9 -0
- package/ios/RNGestureHandler.h +90 -0
- package/ios/RNGestureHandler.m +493 -0
- package/ios/RNGestureHandler.xcodeproj/project.pbxproj +690 -0
- package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNGestureHandlerActionType.h +10 -0
- package/ios/RNGestureHandlerButton.h +19 -0
- package/ios/RNGestureHandlerButton.m +77 -0
- package/ios/RNGestureHandlerButtonComponentView.h +17 -0
- package/ios/RNGestureHandlerButtonComponentView.mm +64 -0
- package/ios/RNGestureHandlerButtonManager.h +5 -0
- package/ios/RNGestureHandlerButtonManager.m +34 -0
- package/ios/RNGestureHandlerDirection.h +8 -0
- package/ios/RNGestureHandlerEvents.h +65 -0
- package/ios/RNGestureHandlerEvents.m +260 -0
- package/ios/RNGestureHandlerManager.h +35 -0
- package/ios/RNGestureHandlerManager.mm +367 -0
- package/ios/RNGestureHandlerModule.h +7 -0
- package/ios/RNGestureHandlerModule.mm +320 -0
- package/ios/RNGestureHandlerPointerTracker.h +25 -0
- package/ios/RNGestureHandlerPointerTracker.m +243 -0
- package/ios/RNGestureHandlerRegistry.h +21 -0
- package/ios/RNGestureHandlerRegistry.m +63 -0
- package/ios/RNGestureHandlerRootViewComponentView.mm +21 -0
- package/ios/RNGestureHandlerState.h +10 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/RNManualActivationRecognizer.h +10 -0
- package/ios/RNManualActivationRecognizer.m +88 -0
- package/ios/RNRootViewGestureRecognizer.h +17 -0
- package/ios/RNRootViewGestureRecognizer.m +106 -0
- package/jest-utils/package.json +6 -0
- package/jestSetup.js +7 -0
- package/lib/commonjs/ActionType.js +15 -0
- package/lib/commonjs/ActionType.js.map +1 -0
- package/lib/commonjs/Directions.js +15 -0
- package/lib/commonjs/Directions.js.map +1 -0
- package/lib/commonjs/EnableNewWebImplementation.js +35 -0
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js +15 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/commonjs/PlatformConstants.js +15 -0
- package/lib/commonjs/PlatformConstants.js.map +1 -0
- package/lib/commonjs/PlatformConstants.web.js +14 -0
- package/lib/commonjs/PlatformConstants.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.js +29 -0
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js +149 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js +163 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js +158 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/commonjs/RNRenderer.js +16 -0
- package/lib/commonjs/RNRenderer.js.map +1 -0
- package/lib/commonjs/RNRenderer.web.js +11 -0
- package/lib/commonjs/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/State.js +18 -0
- package/lib/commonjs/State.js.map +1 -0
- package/lib/commonjs/TouchEventType.js +16 -0
- package/lib/commonjs/TouchEventType.js.map +1 -0
- package/lib/commonjs/components/DrawerLayout.js +566 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -0
- package/lib/commonjs/components/GestureButtons.js +240 -0
- package/lib/commonjs/components/GestureButtons.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.js +115 -0
- package/lib/commonjs/components/GestureComponents.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.web.js +52 -0
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.js +14 -0
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js +24 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js +31 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.js +31 -0
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js +25 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +408 -0
- package/lib/commonjs/components/Swipeable.js.map +1 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js +40 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +289 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js +109 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +100 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +12 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js +77 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +26 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/index.js +40 -0
- package/lib/commonjs/components/touchables/index.js.map +1 -0
- package/lib/commonjs/getReactNativeVersion.js +22 -0
- package/lib/commonjs/getReactNativeVersion.js.map +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js +11 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -0
- package/lib/commonjs/getShadowNodeFromRef.js +27 -0
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js +15 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/commonjs/ghQueueMicrotask.js +12 -0
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js +25 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +49 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js +27 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +27 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PanGestureHandler.js +123 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js +23 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js +14 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +12 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js +23 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/TapGestureHandler.js +27 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/createHandler.js +464 -0
- package/lib/commonjs/handlers/createHandler.js.map +1 -0
- package/lib/commonjs/handlers/createNativeWrapper.js +74 -0
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +103 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +6 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js +669 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js +147 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +65 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gesture.js +241 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js +105 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js +90 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +65 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +32 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js +74 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js +35 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js +31 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/panGesture.js +149 -0
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js +45 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +37 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js +45 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js +60 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/commonjs/handlers/handlersRegistry.js +67 -0
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
- package/lib/commonjs/index.js +266 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/init.js +32 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/jestUtils/index.js +20 -0
- package/lib/commonjs/jestUtils/index.js.map +1 -0
- package/lib/commonjs/jestUtils/jestUtils.js +375 -0
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
- package/lib/commonjs/mocks.js +66 -0
- package/lib/commonjs/mocks.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +15 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +15 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/commonjs/typeUtils.js +2 -0
- package/lib/commonjs/typeUtils.js.map +1 -0
- package/lib/commonjs/utils.js +63 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/constants.js +16 -0
- package/lib/commonjs/web/constants.js.map +1 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +165 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +156 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +167 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/GestureHandler.js +794 -0
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +62 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +151 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +61 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +178 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js +448 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +174 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +186 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js +280 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web/interfaces.js +55 -0
- package/lib/commonjs/web/interfaces.js.map +1 -0
- package/lib/commonjs/web/tools/CircularBuffer.js +59 -0
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
- package/lib/commonjs/web/tools/EventManager.js +127 -0
- package/lib/commonjs/web/tools/EventManager.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +349 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +118 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/InteractionManager.js +114 -0
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js +204 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/commonjs/web/tools/NodeManager.js +48 -0
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +198 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerTracker.js +226 -0
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -0
- package/lib/commonjs/web/tools/TouchEventManager.js +138 -0
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/VelocityTracker.js +111 -0
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
- package/lib/commonjs/web/utils.js +15 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +105 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +53 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/Errors.js +16 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +170 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/GestureHandler.js +579 -0
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +54 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +71 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +66 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NodeManager.js +46 -0
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js +208 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +40 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js +188 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +44 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js +192 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/constants.js +64 -0
- package/lib/commonjs/web_hammer/constants.js.map +1 -0
- package/lib/commonjs/web_hammer/utils.js +42 -0
- package/lib/commonjs/web_hammer/utils.js.map +1 -0
- package/lib/module/ActionType.js +7 -0
- package/lib/module/ActionType.js.map +1 -0
- package/lib/module/Directions.js +7 -0
- package/lib/module/Directions.js.map +1 -0
- package/lib/module/EnableNewWebImplementation.js +22 -0
- package/lib/module/EnableNewWebImplementation.js.map +1 -0
- package/lib/module/GestureHandlerRootViewContext.js +3 -0
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/module/PlatformConstants.js +5 -0
- package/lib/module/PlatformConstants.js.map +1 -0
- package/lib/module/PlatformConstants.web.js +7 -0
- package/lib/module/PlatformConstants.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +19 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.macos.js +110 -0
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.web.js +122 -0
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.windows.js +118 -0
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/module/RNRenderer.js +4 -0
- package/lib/module/RNRenderer.js.map +1 -0
- package/lib/module/RNRenderer.web.js +4 -0
- package/lib/module/RNRenderer.web.js.map +1 -0
- package/lib/module/State.js +10 -0
- package/lib/module/State.js.map +1 -0
- package/lib/module/TouchEventType.js +8 -0
- package/lib/module/TouchEventType.js.map +1 -0
- package/lib/module/components/DrawerLayout.js +551 -0
- package/lib/module/components/DrawerLayout.js.map +1 -0
- package/lib/module/components/GestureButtons.js +206 -0
- package/lib/module/components/GestureButtons.js.map +1 -0
- package/lib/module/components/GestureComponents.js +90 -0
- package/lib/module/components/GestureComponents.js.map +1 -0
- package/lib/module/components/GestureComponents.web.js +28 -0
- package/lib/module/components/GestureComponents.web.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.js +3 -0
- package/lib/module/components/GestureHandlerButton.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.web.js +9 -0
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.android.js +14 -0
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.js +14 -0
- package/lib/module/components/GestureHandlerRootView.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.web.js +9 -0
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/module/components/Swipeable.js +390 -0
- package/lib/module/components/Swipeable.js.map +1 -0
- package/lib/module/components/gestureHandlerRootHOC.js +22 -0
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +273 -0
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/module/components/touchables/TouchableHighlight.js +95 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +84 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js +3 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/module/components/touchables/TouchableOpacity.js +63 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +10 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/module/components/touchables/index.js +5 -0
- package/lib/module/components/touchables/index.js.map +1 -0
- package/lib/module/getReactNativeVersion.js +10 -0
- package/lib/module/getReactNativeVersion.js.map +1 -0
- package/lib/module/getReactNativeVersion.web.js +4 -0
- package/lib/module/getReactNativeVersion.web.js.map +1 -0
- package/lib/module/getShadowNodeFromRef.js +20 -0
- package/lib/module/getShadowNodeFromRef.js.map +1 -0
- package/lib/module/getShadowNodeFromRef.web.js +8 -0
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/module/ghQueueMicrotask.js +5 -0
- package/lib/module/ghQueueMicrotask.js.map +1 -0
- package/lib/module/handlers/FlingGestureHandler.js +11 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js +31 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/module/handlers/LongPressGestureHandler.js +13 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/handlers/NativeViewGestureHandler.js +12 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/handlers/PanGestureHandler.js +107 -0
- package/lib/module/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/handlers/PinchGestureHandler.js +10 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/handlers/PressabilityDebugView.js +3 -0
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/module/handlers/PressabilityDebugView.web.js +5 -0
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/module/handlers/RotationGestureHandler.js +10 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/handlers/TapGestureHandler.js +13 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/handlers/createHandler.js +433 -0
- package/lib/module/handlers/createHandler.js.map +1 -0
- package/lib/module/handlers/createNativeWrapper.js +62 -0
- package/lib/module/handlers/createNativeWrapper.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +81 -0
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -0
- package/lib/module/handlers/gestures/GestureDetector.js +619 -0
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/module/handlers/gestures/eventReceiver.js +131 -0
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/module/handlers/gestures/flingGesture.js +24 -0
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js +56 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/gesture.js +222 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -0
- package/lib/module/handlers/gestures/gestureComposition.js +90 -0
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/module/handlers/gestures/gestureObjects.js +71 -0
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.js +54 -0
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js +21 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/module/handlers/gestures/hoverGesture.js +62 -0
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/module/handlers/gestures/longPressGesture.js +25 -0
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/module/handlers/gestures/manualGesture.js +22 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/module/handlers/gestures/nativeGesture.js +24 -0
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/module/handlers/gestures/panGesture.js +140 -0
- package/lib/module/handlers/gestures/panGesture.js.map +1 -0
- package/lib/module/handlers/gestures/pinchGesture.js +36 -0
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js +30 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/module/handlers/gestures/rotationGesture.js +36 -0
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/module/handlers/gestures/tapGesture.js +50 -0
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/module/handlers/handlersRegistry.js +44 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -0
- package/lib/module/index.js +25 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/init.js +16 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/jestUtils/index.js +2 -0
- package/lib/module/jestUtils/index.js.map +1 -0
- package/lib/module/jestUtils/jestUtils.js +350 -0
- package/lib/module/jestUtils/jestUtils.js.map +1 -0
- package/lib/module/mocks.js +56 -0
- package/lib/module/mocks.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/module/typeUtils.js +2 -0
- package/lib/module/typeUtils.js.map +1 -0
- package/lib/module/utils.js +44 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/constants.js +8 -0
- package/lib/module/web/constants.js.map +1 -0
- package/lib/module/web/detectors/RotationGestureDetector.js +155 -0
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js +145 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/module/web/handlers/FlingGestureHandler.js +152 -0
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/GestureHandler.js +776 -0
- package/lib/module/web/handlers/GestureHandler.js.map +1 -0
- package/lib/module/web/handlers/HoverGestureHandler.js +47 -0
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js +136 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/ManualGestureHandler.js +49 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js +163 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PanGestureHandler.js +433 -0
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PinchGestureHandler.js +159 -0
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/RotationGestureHandler.js +171 -0
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/TapGestureHandler.js +265 -0
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/web/interfaces.js +45 -0
- package/lib/module/web/interfaces.js.map +1 -0
- package/lib/module/web/tools/CircularBuffer.js +50 -0
- package/lib/module/web/tools/CircularBuffer.js.map +1 -0
- package/lib/module/web/tools/EventManager.js +118 -0
- package/lib/module/web/tools/EventManager.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +335 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +102 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/module/web/tools/InteractionManager.js +105 -0
- package/lib/module/web/tools/InteractionManager.js.map +1 -0
- package/lib/module/web/tools/LeastSquareSolver.js +195 -0
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/module/web/tools/NodeManager.js +39 -0
- package/lib/module/web/tools/NodeManager.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +184 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -0
- package/lib/module/web/tools/PointerTracker.js +213 -0
- package/lib/module/web/tools/PointerTracker.js.map +1 -0
- package/lib/module/web/tools/TouchEventManager.js +124 -0
- package/lib/module/web/tools/TouchEventManager.js.map +1 -0
- package/lib/module/web/tools/VelocityTracker.js +98 -0
- package/lib/module/web/tools/VelocityTracker.js.map +1 -0
- package/lib/module/web/utils.js +8 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js +94 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js +40 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/Errors.js +7 -0
- package/lib/module/web_hammer/Errors.js.map +1 -0
- package/lib/module/web_hammer/FlingGestureHandler.js +156 -0
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/GestureHandler.js +563 -0
- package/lib/module/web_hammer/GestureHandler.js.map +1 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +44 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js +58 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/NativeViewGestureHandler.js +49 -0
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/NodeManager.js +33 -0
- package/lib/module/web_hammer/NodeManager.js.map +1 -0
- package/lib/module/web_hammer/PanGestureHandler.js +194 -0
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PinchGestureHandler.js +29 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PressGestureHandler.js +174 -0
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/RotationGestureHandler.js +32 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/TapGestureHandler.js +180 -0
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/constants.js +43 -0
- package/lib/module/web_hammer/constants.js.map +1 -0
- package/lib/module/web_hammer/utils.js +19 -0
- package/lib/module/web_hammer/utils.js.map +1 -0
- package/lib/typescript/ActionType.d.ts +7 -0
- package/lib/typescript/Directions.d.ts +7 -0
- package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
- package/lib/typescript/PlatformConstants.d.ts +5 -0
- package/lib/typescript/PlatformConstants.web.d.ts +4 -0
- package/lib/typescript/RNGestureHandlerModule.d.ts +13 -0
- package/lib/typescript/RNGestureHandlerModule.macos.d.ts +47 -0
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +50 -0
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +48 -0
- package/lib/typescript/RNRenderer.d.ts +1 -0
- package/lib/typescript/RNRenderer.web.d.ts +3 -0
- package/lib/typescript/State.d.ts +9 -0
- package/lib/typescript/TouchEventType.d.ts +8 -0
- package/lib/typescript/components/DrawerLayout.d.ts +148 -0
- package/lib/typescript/components/GestureButtons.d.ts +121 -0
- package/lib/typescript/components/GestureComponents.d.ts +22 -0
- package/lib/typescript/components/GestureComponents.web.d.ts +8 -0
- package/lib/typescript/components/GestureHandlerButton.d.ts +4 -0
- package/lib/typescript/components/GestureHandlerButton.web.d.ts +4 -0
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +6 -0
- package/lib/typescript/components/Swipeable.d.ts +178 -0
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +3 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +68 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +36 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +45 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +25 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +7 -0
- package/lib/typescript/components/touchables/index.d.ts +7 -0
- package/lib/typescript/getReactNativeVersion.d.ts +4 -0
- package/lib/typescript/getReactNativeVersion.web.d.ts +1 -0
- package/lib/typescript/getShadowNodeFromRef.d.ts +1 -0
- package/lib/typescript/getShadowNodeFromRef.web.d.ts +1 -0
- package/lib/typescript/ghQueueMicrotask.d.ts +1 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +34 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +44 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +56 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +28 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +139 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +29 -0
- package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -0
- package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +1 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +29 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +57 -0
- package/lib/typescript/handlers/createHandler.d.ts +11 -0
- package/lib/typescript/handlers/createNativeWrapper.d.ts +3 -0
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +68 -0
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +42 -0
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +19 -0
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +4 -0
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +15 -0
- package/lib/typescript/handlers/gestures/gesture.d.ts +110 -0
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +41 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +9 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +7 -0
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/panGesture.d.ts +26 -0
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +11 -0
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +12 -0
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +14 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +14 -0
- package/lib/typescript/index.d.ts +52 -0
- package/lib/typescript/init.d.ts +2 -0
- package/lib/typescript/jestUtils/index.d.ts +1 -0
- package/lib/typescript/jestUtils/jestUtils.d.ts +28 -0
- package/lib/typescript/mocks.d.ts +44 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -0
- package/lib/typescript/typeUtils.d.ts +1 -0
- package/lib/typescript/utils.d.ts +8 -0
- package/lib/typescript/web/constants.d.ts +7 -0
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +30 -0
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +29 -0
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +27 -0
- package/lib/typescript/web/handlers/GestureHandler.d.ts +90 -0
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +26 -0
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +12 -0
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +24 -0
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +55 -0
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +28 -0
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +29 -0
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +39 -0
- package/lib/typescript/web/interfaces.d.ts +141 -0
- package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
- package/lib/typescript/web/tools/EventManager.d.ts +34 -0
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +29 -0
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
- package/lib/typescript/web/tools/InteractionManager.d.ts +17 -0
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
- package/lib/typescript/web/tools/NodeManager.d.ts +11 -0
- package/lib/typescript/web/tools/PointerEventManager.d.ts +8 -0
- package/lib/typescript/web/tools/PointerTracker.d.ts +53 -0
- package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
- package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
- package/lib/typescript/web/utils.d.ts +4 -0
- package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +20 -0
- package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +15 -0
- package/lib/typescript/web_hammer/Errors.d.ts +3 -0
- package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +43 -0
- package/lib/typescript/web_hammer/GestureHandler.d.ts +145 -0
- package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +40 -0
- package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +38 -0
- package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +7 -0
- package/lib/typescript/web_hammer/NodeManager.d.ts +8 -0
- package/lib/typescript/web_hammer/PanGestureHandler.d.ts +56 -0
- package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +13 -0
- package/lib/typescript/web_hammer/PressGestureHandler.d.ts +83 -0
- package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +13 -0
- package/lib/typescript/web_hammer/TapGestureHandler.d.ts +57 -0
- package/lib/typescript/web_hammer/constants.d.ts +39 -0
- package/lib/typescript/web_hammer/utils.d.ts +9 -0
- package/package.json +156 -0
- package/src/ActionType.ts +9 -0
- package/src/Directions.ts +9 -0
- package/src/EnableNewWebImplementation.ts +35 -0
- package/src/GestureHandlerRootViewContext.ts +3 -0
- package/src/PlatformConstants.ts +8 -0
- package/src/PlatformConstants.web.ts +5 -0
- package/src/RNGestureHandlerModule.macos.ts +133 -0
- package/src/RNGestureHandlerModule.ts +50 -0
- package/src/RNGestureHandlerModule.web.ts +146 -0
- package/src/RNGestureHandlerModule.windows.ts +144 -0
- package/src/RNRenderer.ts +3 -0
- package/src/RNRenderer.web.ts +3 -0
- package/src/State.ts +13 -0
- package/src/TouchEventType.ts +10 -0
- package/src/components/DrawerLayout.tsx +743 -0
- package/src/components/GestureButtons.tsx +332 -0
- package/src/components/GestureComponents.tsx +148 -0
- package/src/components/GestureComponents.web.tsx +41 -0
- package/src/components/GestureHandlerButton.tsx +5 -0
- package/src/components/GestureHandlerButton.web.tsx +6 -0
- package/src/components/GestureHandlerRootView.android.tsx +24 -0
- package/src/components/GestureHandlerRootView.tsx +23 -0
- package/src/components/GestureHandlerRootView.web.tsx +17 -0
- package/src/components/Swipeable.tsx +584 -0
- package/src/components/gestureHandlerRootHOC.tsx +32 -0
- package/src/components/touchables/GenericTouchable.tsx +301 -0
- package/src/components/touchables/TouchableHighlight.tsx +115 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +91 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +75 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -0
- package/src/components/touchables/index.ts +7 -0
- package/src/getReactNativeVersion.ts +11 -0
- package/src/getReactNativeVersion.web.ts +3 -0
- package/src/getShadowNodeFromRef.ts +22 -0
- package/src/getShadowNodeFromRef.web.ts +7 -0
- package/src/ghQueueMicrotask.ts +5 -0
- package/src/handlers/FlingGestureHandler.ts +59 -0
- package/src/handlers/ForceTouchGestureHandler.ts +90 -0
- package/src/handlers/LongPressGestureHandler.ts +88 -0
- package/src/handlers/NativeViewGestureHandler.ts +55 -0
- package/src/handlers/PanGestureHandler.ts +325 -0
- package/src/handlers/PinchGestureHandler.ts +48 -0
- package/src/handlers/PressabilityDebugView.tsx +2 -0
- package/src/handlers/PressabilityDebugView.web.tsx +4 -0
- package/src/handlers/RotationGestureHandler.ts +48 -0
- package/src/handlers/TapGestureHandler.ts +94 -0
- package/src/handlers/createHandler.tsx +533 -0
- package/src/handlers/createNativeWrapper.tsx +80 -0
- package/src/handlers/gestureHandlerCommon.ts +250 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +106 -0
- package/src/handlers/gestures/GestureDetector.tsx +822 -0
- package/src/handlers/gestures/eventReceiver.ts +155 -0
- package/src/handlers/gestures/flingGesture.ts +27 -0
- package/src/handlers/gestures/forceTouchGesture.ts +74 -0
- package/src/handlers/gestures/gesture.ts +349 -0
- package/src/handlers/gestures/gestureComposition.ts +122 -0
- package/src/handlers/gestures/gestureObjects.ts +84 -0
- package/src/handlers/gestures/gestureStateManager.ts +62 -0
- package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
- package/src/handlers/gestures/hoverGesture.ts +83 -0
- package/src/handlers/gestures/longPressGesture.ts +28 -0
- package/src/handlers/gestures/manualGesture.ts +31 -0
- package/src/handlers/gestures/nativeGesture.ts +27 -0
- package/src/handlers/gestures/panGesture.ts +152 -0
- package/src/handlers/gestures/pinchGesture.ts +51 -0
- package/src/handlers/gestures/reanimatedWrapper.ts +56 -0
- package/src/handlers/gestures/rotationGesture.ts +51 -0
- package/src/handlers/gestures/tapGesture.ts +53 -0
- package/src/handlers/handlersRegistry.ts +60 -0
- package/src/index.ts +174 -0
- package/src/init.ts +18 -0
- package/src/jestUtils/index.ts +1 -0
- package/src/jestUtils/jestUtils.ts +505 -0
- package/src/mocks.ts +67 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -0
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
- package/src/typeUtils.ts +1 -0
- package/src/utils.ts +54 -0
- package/src/web/constants.ts +8 -0
- package/src/web/detectors/RotationGestureDetector.ts +168 -0
- package/src/web/detectors/ScaleGestureDetector.ts +172 -0
- package/src/web/handlers/FlingGestureHandler.ts +161 -0
- package/src/web/handlers/GestureHandler.ts +849 -0
- package/src/web/handlers/HoverGestureHandler.ts +43 -0
- package/src/web/handlers/LongPressGestureHandler.ts +125 -0
- package/src/web/handlers/ManualGestureHandler.ts +43 -0
- package/src/web/handlers/NativeViewGestureHandler.ts +167 -0
- package/src/web/handlers/PanGestureHandler.ts +485 -0
- package/src/web/handlers/PinchGestureHandler.ts +158 -0
- package/src/web/handlers/RotationGestureHandler.ts +172 -0
- package/src/web/handlers/TapGestureHandler.ts +273 -0
- package/src/web/interfaces.ts +167 -0
- package/src/web/tools/CircularBuffer.ts +42 -0
- package/src/web/tools/EventManager.ts +104 -0
- package/src/web/tools/GestureHandlerDelegate.ts +23 -0
- package/src/web/tools/GestureHandlerOrchestrator.ts +389 -0
- package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
- package/src/web/tools/InteractionManager.ts +130 -0
- package/src/web/tools/LeastSquareSolver.ts +182 -0
- package/src/web/tools/NodeManager.ts +43 -0
- package/src/web/tools/PointerEventManager.ts +202 -0
- package/src/web/tools/PointerTracker.ts +240 -0
- package/src/web/tools/TouchEventManager.ts +167 -0
- package/src/web/tools/VelocityTracker.ts +98 -0
- package/src/web/utils.ts +8 -0
- package/src/web_hammer/DiscreteGestureHandler.ts +82 -0
- package/src/web_hammer/DraggingGestureHandler.ts +34 -0
- package/src/web_hammer/Errors.ts +7 -0
- package/src/web_hammer/FlingGestureHandler.ts +134 -0
- package/src/web_hammer/GestureHandler.ts +599 -0
- package/src/web_hammer/IndiscreteGestureHandler.ts +33 -0
- package/src/web_hammer/LongPressGestureHandler.ts +56 -0
- package/src/web_hammer/NativeViewGestureHandler.ts +47 -0
- package/src/web_hammer/NodeManager.ts +42 -0
- package/src/web_hammer/PanGestureHandler.ts +226 -0
- package/src/web_hammer/PinchGestureHandler.ts +25 -0
- package/src/web_hammer/PressGestureHandler.ts +167 -0
- package/src/web_hammer/RotationGestureHandler.ts +25 -0
- package/src/web_hammer/TapGestureHandler.ts +172 -0
- package/src/web_hammer/constants.ts +48 -0
- package/src/web_hammer/utils.ts +24 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["gesture.ts"],"names":["CALLBACK_TYPE","UNDEFINED","BEGAN","START","UPDATE","CHANGE","END","FINALIZE","TOUCHES_DOWN","TOUCHES_MOVE","TOUCHES_UP","TOUCHES_CANCELLED","Gesture","nextGestureId","BaseGesture","constructor","gestureId","handlerTag","isWorklet","handlers","addDependency","key","gesture","value","config","Array","concat","withRef","ref","callback","__workletHash","undefined","onBegin","onStart","onEnd","onFinalize","onTouchesDown","needsPointerData","onTouchesMove","onTouchesUp","onTouchesCancelled","enabled","shouldCancelWhenOutside","hitSlop","activeCursor","runOnJS","simultaneousWithExternalGesture","gestures","requireExternalGestureToFail","blocksExternalGesture","withTestId","id","testId","cancelsTouchesInView","initialize","current","toGestureArray","prepare","shouldUseReanimated","includes","ContinousBaseGesture","onUpdate","onChange","manualActivation"],"mappings":";;;;;;;AAUA;;AAQA;;;;AAgEO,MAAMA,aAAa,GAAG;AAC3BC,EAAAA,SAAS,EAAE,CADgB;AAE3BC,EAAAA,KAAK,EAAE,CAFoB;AAG3BC,EAAAA,KAAK,EAAE,CAHoB;AAI3BC,EAAAA,MAAM,EAAE,CAJmB;AAK3BC,EAAAA,MAAM,EAAE,CALmB;AAM3BC,EAAAA,GAAG,EAAE,CANsB;AAO3BC,EAAAA,QAAQ,EAAE,CAPiB;AAQ3BC,EAAAA,YAAY,EAAE,CARa;AAS3BC,EAAAA,YAAY,EAAE,CATa;AAU3BC,EAAAA,UAAU,EAAE,CAVe;AAW3BC,EAAAA,iBAAiB,EAAE;AAXQ,CAAtB,C,CAcP;AACA;;;;AAGO,MAAeC,OAAf,CAAuB;;;AAoB9B,IAAIC,aAAa,GAAG,CAApB;;AACO,MAAeC,WAAf,SAEGF,OAFH,CAEW;AAWhBG,EAAAA,WAAW,GAAG;AACZ,YADY,CAGZ;AACA;AACA;AACA;AACA;;AAPY,uCAVM,CAAC,CAUP;;AAAA,wCATM,C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AQ,CACNjC,QADM,EAIN;AACA,SAAKV,QAAL,CAAc2C,QAAd,GAAyBjC,QAAzB;AACA,SAAKV,QAAL,CAAcD,SAAd,CAAwBlB,aAAa,CAACK,MAAtC,IAAgD,KAAKa,SAAL,CAAeW,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;;AAEDkC,EAAAA,gBAAgB,CAACA,gBAAD,EAA4B;AAC1C,SAAKvC,MAAL,CAAYuC,gBAAZ,GAA+BA,gBAA/B;AACA,WAAO,IAAP;AACD;;AApBkC","sourcesContent":["import { FlingGestureHandlerEventPayload } from '../FlingGestureHandler';\r\nimport { ForceTouchGestureHandlerEventPayload } from '../ForceTouchGestureHandler';\r\nimport {\r\n HitSlop,\r\n CommonGestureConfig,\r\n GestureTouchEvent,\r\n GestureStateChangeEvent,\r\n GestureUpdateEvent,\r\n ActiveCursor,\r\n} from '../gestureHandlerCommon';\r\nimport { getNextHandlerTag } from '../handlersRegistry';\r\nimport { GestureStateManagerType } from './gestureStateManager';\r\nimport { LongPressGestureHandlerEventPayload } from '../LongPressGestureHandler';\r\nimport { PanGestureHandlerEventPayload } from '../PanGestureHandler';\r\nimport { PinchGestureHandlerEventPayload } from '../PinchGestureHandler';\r\nimport { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';\r\nimport { TapGestureHandlerEventPayload } from '../TapGestureHandler';\r\nimport { NativeViewGestureHandlerPayload } from '../NativeViewGestureHandler';\r\nimport { isRemoteDebuggingEnabled } from '../../utils';\r\n\r\nexport type GestureType =\r\n | BaseGesture<Record<string, unknown>>\r\n | BaseGesture<Record<string, never>>\r\n | BaseGesture<TapGestureHandlerEventPayload>\r\n | BaseGesture<PanGestureHandlerEventPayload>\r\n | BaseGesture<LongPressGestureHandlerEventPayload>\r\n | BaseGesture<RotationGestureHandlerEventPayload>\r\n | BaseGesture<PinchGestureHandlerEventPayload>\r\n | BaseGesture<FlingGestureHandlerEventPayload>\r\n | BaseGesture<ForceTouchGestureHandlerEventPayload>\r\n | BaseGesture<NativeViewGestureHandlerPayload>;\r\n\r\nexport type GestureRef =\r\n | number\r\n | GestureType\r\n | React.RefObject<GestureType | undefined>\r\n | React.RefObject<React.ComponentType | undefined>; // allow adding a ref to a gesture handler\r\nexport interface BaseGestureConfig\r\n extends CommonGestureConfig,\r\n Record<string, unknown> {\r\n ref?: React.MutableRefObject<GestureType | undefined>;\r\n requireToFail?: GestureRef[];\r\n simultaneousWith?: GestureRef[];\r\n blocksHandlers?: GestureRef[];\r\n needsPointerData?: boolean;\r\n manualActivation?: boolean;\r\n runOnJS?: boolean;\r\n testId?: string;\r\n cancelsTouchesInView?: boolean;\r\n}\r\n\r\ntype TouchEventHandlerType = (\r\n event: GestureTouchEvent,\r\n stateManager: GestureStateManagerType\r\n) => void;\r\n\r\nexport type HandlerCallbacks<EventPayloadT extends Record<string, unknown>> = {\r\n gestureId: number;\r\n handlerTag: number;\r\n onBegin?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\r\n onStart?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\r\n onEnd?: (\r\n event: GestureStateChangeEvent<EventPayloadT>,\r\n success: boolean\r\n ) => void;\r\n onFinalize?: (\r\n event: GestureStateChangeEvent<EventPayloadT>,\r\n success: boolean\r\n ) => void;\r\n onUpdate?: (event: GestureUpdateEvent<EventPayloadT>) => void;\r\n onChange?: (event: any) => void;\r\n onTouchesDown?: TouchEventHandlerType;\r\n onTouchesMove?: TouchEventHandlerType;\r\n onTouchesUp?: TouchEventHandlerType;\r\n onTouchesCancelled?: TouchEventHandlerType;\r\n changeEventCalculator?: (\r\n current: GestureUpdateEvent<Record<string, unknown>>,\r\n previous?: GestureUpdateEvent<Record<string, unknown>>\r\n ) => GestureUpdateEvent<Record<string, unknown>>;\r\n isWorklet: boolean[];\r\n};\r\n\r\nexport const CALLBACK_TYPE = {\r\n UNDEFINED: 0,\r\n BEGAN: 1,\r\n START: 2,\r\n UPDATE: 3,\r\n CHANGE: 4,\r\n END: 5,\r\n FINALIZE: 6,\r\n TOUCHES_DOWN: 7,\r\n TOUCHES_MOVE: 8,\r\n TOUCHES_UP: 9,\r\n TOUCHES_CANCELLED: 10,\r\n} as const;\r\n\r\n// Allow using CALLBACK_TYPE as object and type\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport type CALLBACK_TYPE = typeof CALLBACK_TYPE[keyof typeof CALLBACK_TYPE];\r\n\r\nexport abstract class Gesture {\r\n /**\r\n * Return array of gestures, providing the same interface for creating and updating\r\n * handlers, no matter which object was used to create gesture instance.\r\n */\r\n abstract toGestureArray(): GestureType[];\r\n\r\n /**\r\n * Assign handlerTag to the gesture instance and set ref.current (if a ref is set)\r\n */\r\n abstract initialize(): void;\r\n\r\n /**\r\n * Make sure that values of properties defining relations are arrays. Do any necessary\r\n * preprocessing required to configure relations between handlers. Called just before\r\n * updating the handler on the native side.\r\n */\r\n abstract prepare(): void;\r\n}\r\n\r\nlet nextGestureId = 0;\r\nexport abstract class BaseGesture<\r\n EventPayloadT extends Record<string, unknown>\r\n> extends Gesture {\r\n private gestureId = -1;\r\n public handlerTag = -1;\r\n public handlerName = '';\r\n public config: BaseGestureConfig = {};\r\n public handlers: HandlerCallbacks<EventPayloadT> = {\r\n gestureId: -1,\r\n handlerTag: -1,\r\n isWorklet: [],\r\n };\r\n\r\n constructor() {\r\n super();\r\n\r\n // Used to check whether the gesture config has been updated when wrapping it\r\n // with `useMemo`. Since every config will have a unique id, when the dependencies\r\n // don't change, the config won't be recreated and the id will stay the same.\r\n // If the id is different, it means that the config has changed and the gesture\r\n // needs to be updated.\r\n this.gestureId = nextGestureId++;\r\n this.handlers.gestureId = this.gestureId;\r\n }\r\n\r\n private addDependency(\r\n key: 'simultaneousWith' | 'requireToFail' | 'blocksHandlers',\r\n gesture: Exclude<GestureRef, number>\r\n ) {\r\n const value = this.config[key];\r\n this.config[key] = value\r\n ? Array<GestureRef>().concat(value, gesture)\r\n : [gesture];\r\n }\r\n\r\n withRef(ref: React.MutableRefObject<GestureType | undefined>) {\r\n this.config.ref = ref;\r\n return this;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/ban-types\r\n protected isWorklet(callback: Function) {\r\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\r\n return callback.__workletHash !== undefined;\r\n }\r\n\r\n onBegin(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\r\n this.handlers.onBegin = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);\r\n return this;\r\n }\r\n\r\n onStart(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\r\n this.handlers.onStart = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);\r\n return this;\r\n }\r\n\r\n onEnd(\r\n callback: (\r\n event: GestureStateChangeEvent<EventPayloadT>,\r\n success: boolean\r\n ) => void\r\n ) {\r\n this.handlers.onEnd = callback;\r\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\r\n this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);\r\n return this;\r\n }\r\n\r\n onFinalize(\r\n callback: (\r\n event: GestureStateChangeEvent<EventPayloadT>,\r\n success: boolean\r\n ) => void\r\n ) {\r\n this.handlers.onFinalize = callback;\r\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\r\n this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);\r\n return this;\r\n }\r\n\r\n onTouchesDown(callback: TouchEventHandlerType) {\r\n this.config.needsPointerData = true;\r\n this.handlers.onTouchesDown = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] =\r\n this.isWorklet(callback);\r\n\r\n return this;\r\n }\r\n\r\n onTouchesMove(callback: TouchEventHandlerType) {\r\n this.config.needsPointerData = true;\r\n this.handlers.onTouchesMove = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] =\r\n this.isWorklet(callback);\r\n\r\n return this;\r\n }\r\n\r\n onTouchesUp(callback: TouchEventHandlerType) {\r\n this.config.needsPointerData = true;\r\n this.handlers.onTouchesUp = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] =\r\n this.isWorklet(callback);\r\n\r\n return this;\r\n }\r\n\r\n onTouchesCancelled(callback: TouchEventHandlerType) {\r\n this.config.needsPointerData = true;\r\n this.handlers.onTouchesCancelled = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] =\r\n this.isWorklet(callback);\r\n\r\n return this;\r\n }\r\n\r\n enabled(enabled: boolean) {\r\n this.config.enabled = enabled;\r\n return this;\r\n }\r\n\r\n shouldCancelWhenOutside(value: boolean) {\r\n this.config.shouldCancelWhenOutside = value;\r\n return this;\r\n }\r\n\r\n hitSlop(hitSlop: HitSlop) {\r\n this.config.hitSlop = hitSlop;\r\n return this;\r\n }\r\n\r\n activeCursor(activeCursor: ActiveCursor) {\r\n this.config.activeCursor = activeCursor;\r\n return this;\r\n }\r\n\r\n runOnJS(runOnJS: boolean) {\r\n this.config.runOnJS = runOnJS;\r\n return this;\r\n }\r\n\r\n simultaneousWithExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\r\n for (const gesture of gestures) {\r\n this.addDependency('simultaneousWith', gesture);\r\n }\r\n return this;\r\n }\r\n\r\n requireExternalGestureToFail(...gestures: Exclude<GestureRef, number>[]) {\r\n for (const gesture of gestures) {\r\n this.addDependency('requireToFail', gesture);\r\n }\r\n return this;\r\n }\r\n\r\n blocksExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\r\n for (const gesture of gestures) {\r\n this.addDependency('blocksHandlers', gesture);\r\n }\r\n return this;\r\n }\r\n\r\n withTestId(id: string) {\r\n this.config.testId = id;\r\n return this;\r\n }\r\n\r\n cancelsTouchesInView(value: boolean) {\r\n this.config.cancelsTouchesInView = value;\r\n return this;\r\n }\r\n\r\n initialize() {\r\n this.handlerTag = getNextHandlerTag();\r\n\r\n this.handlers = { ...this.handlers, handlerTag: this.handlerTag };\r\n\r\n if (this.config.ref) {\r\n this.config.ref.current = this as GestureType;\r\n }\r\n }\r\n\r\n toGestureArray(): GestureType[] {\r\n return [this as GestureType];\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n prepare() {}\r\n\r\n get shouldUseReanimated(): boolean {\r\n // use Reanimated when runOnJS isn't set explicitly,\r\n // and all defined callbacks are worklets,\r\n // and remote debugging is disabled\r\n return (\r\n this.config.runOnJS !== true &&\r\n !this.handlers.isWorklet.includes(false) &&\r\n !isRemoteDebuggingEnabled()\r\n );\r\n }\r\n}\r\n\r\nexport abstract class ContinousBaseGesture<\r\n EventPayloadT extends Record<string, unknown>,\r\n EventChangePayloadT extends Record<string, unknown>\r\n> extends BaseGesture<EventPayloadT> {\r\n onUpdate(callback: (event: GestureUpdateEvent<EventPayloadT>) => void) {\r\n this.handlers.onUpdate = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);\r\n return this;\r\n }\r\n\r\n onChange(\r\n callback: (\r\n event: GestureUpdateEvent<EventPayloadT & EventChangePayloadT>\r\n ) => void\r\n ) {\r\n this.handlers.onChange = callback;\r\n this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);\r\n return this;\r\n }\r\n\r\n manualActivation(manualActivation: boolean) {\r\n this.config.manualActivation = manualActivation;\r\n return this;\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ExclusiveGesture = exports.SimultaneousGesture = exports.ComposedGesture = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
12
|
+
function extendRelation(currentRelation, extendWith) {
|
13
|
+
if (currentRelation === undefined) {
|
14
|
+
return [...extendWith];
|
15
|
+
} else {
|
16
|
+
return [...currentRelation, ...extendWith];
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
class ComposedGesture extends _gesture.Gesture {
|
21
|
+
constructor(...gestures) {
|
22
|
+
super();
|
23
|
+
|
24
|
+
_defineProperty(this, "gestures", []);
|
25
|
+
|
26
|
+
_defineProperty(this, "simultaneousGestures", []);
|
27
|
+
|
28
|
+
_defineProperty(this, "requireGesturesToFail", []);
|
29
|
+
|
30
|
+
this.gestures = gestures;
|
31
|
+
}
|
32
|
+
|
33
|
+
prepareSingleGesture(gesture, simultaneousGestures, requireGesturesToFail) {
|
34
|
+
if (gesture instanceof _gesture.BaseGesture) {
|
35
|
+
const newConfig = { ...gesture.config
|
36
|
+
};
|
37
|
+
newConfig.simultaneousWith = extendRelation(newConfig.simultaneousWith, simultaneousGestures);
|
38
|
+
newConfig.requireToFail = extendRelation(newConfig.requireToFail, requireGesturesToFail);
|
39
|
+
gesture.config = newConfig;
|
40
|
+
} else if (gesture instanceof ComposedGesture) {
|
41
|
+
gesture.simultaneousGestures = simultaneousGestures;
|
42
|
+
gesture.requireGesturesToFail = requireGesturesToFail;
|
43
|
+
gesture.prepare();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
prepare() {
|
48
|
+
for (const gesture of this.gestures) {
|
49
|
+
this.prepareSingleGesture(gesture, this.simultaneousGestures, this.requireGesturesToFail);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
initialize() {
|
54
|
+
for (const gesture of this.gestures) {
|
55
|
+
gesture.initialize();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
toGestureArray() {
|
60
|
+
return this.gestures.flatMap(gesture => gesture.toGestureArray());
|
61
|
+
}
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
exports.ComposedGesture = ComposedGesture;
|
66
|
+
|
67
|
+
class SimultaneousGesture extends ComposedGesture {
|
68
|
+
prepare() {
|
69
|
+
// this piece of magic works something like this:
|
70
|
+
// for every gesture in the array
|
71
|
+
const simultaneousArrays = this.gestures.map(gesture => // we take the array it's in
|
72
|
+
this.gestures // and make a copy without it
|
73
|
+
.filter(x => x !== gesture) // then we flatmap the result to get list of raw (not composed) gestures
|
74
|
+
// this way we don't make the gestures simultaneous with themselves, which is
|
75
|
+
// important when the gesture is `ExclusiveGesture` - we don't want to make
|
76
|
+
// exclusive gestures simultaneous
|
77
|
+
.flatMap(x => x.toGestureArray()));
|
78
|
+
|
79
|
+
for (let i = 0; i < this.gestures.length; i++) {
|
80
|
+
this.prepareSingleGesture(this.gestures[i], simultaneousArrays[i], this.requireGesturesToFail);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
}
|
85
|
+
|
86
|
+
exports.SimultaneousGesture = SimultaneousGesture;
|
87
|
+
|
88
|
+
class ExclusiveGesture extends ComposedGesture {
|
89
|
+
prepare() {
|
90
|
+
// transforms the array of gestures into array of grouped raw (not composed) gestures
|
91
|
+
// i.e. [gesture1, gesture2, ComposedGesture(gesture3, gesture4)] -> [[gesture1], [gesture2], [gesture3, gesture4]]
|
92
|
+
const gestureArrays = this.gestures.map(gesture => gesture.toGestureArray());
|
93
|
+
let requireToFail = [];
|
94
|
+
|
95
|
+
for (let i = 0; i < this.gestures.length; i++) {
|
96
|
+
this.prepareSingleGesture(this.gestures[i], this.simultaneousGestures, this.requireGesturesToFail.concat(requireToFail)); // every group gets to wait for all groups before it
|
97
|
+
|
98
|
+
requireToFail = requireToFail.concat(gestureArrays[i]);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
}
|
103
|
+
|
104
|
+
exports.ExclusiveGesture = ExclusiveGesture;
|
105
|
+
//# sourceMappingURL=gestureComposition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["gestureComposition.ts"],"names":["extendRelation","currentRelation","extendWith","undefined","ComposedGesture","Gesture","constructor","gestures","prepareSingleGesture","gesture","simultaneousGestures","requireGesturesToFail","BaseGesture","newConfig","config","simultaneousWith","requireToFail","prepare","initialize","toGestureArray","flatMap","SimultaneousGesture","simultaneousArrays","map","filter","x","i","length","ExclusiveGesture","gestureArrays","concat"],"mappings":";;;;;;;AAAA;;;;AAEA,SAASA,cAAT,CACEC,eADF,EAEEC,UAFF,EAGE;AACA,MAAID,eAAe,KAAKE,SAAxB,EAAmC;AACjC,WAAO,CAAC,GAAGD,UAAJ,CAAP;AACD,GAFD,MAEO;AACL,WAAO,CAAC,GAAGD,eAAJ,EAAqB,GAAGC,UAAxB,CAAP;AACD;AACF;;AAEM,MAAME,eAAN,SAA8BC,gBAA9B,CAAsC;AAK3CC,EAAAA,WAAW,CAAC,GAAGC,QAAJ,EAAyB;AAClC;;AADkC,sCAJJ,EAII;;AAAA,kDAHY,EAGZ;;AAAA,mDAFa,EAEb;;AAElC,SAAKA,QAAL,GAAgBA,QAAhB;AACD;;AAESC,EAAAA,oBAAoB,CAC5BC,OAD4B,EAE5BC,oBAF4B,EAG5BC,qBAH4B,EAI5B;AACA,QAAIF,OAAO,YAAYG,oBAAvB,EAAoC;AAClC,YAAMC,SAAS,GAAG,EAAE,GAAGJ,OAAO,CAACK;AAAb,OAAlB;AAEAD,MAAAA,SAAS,CAACE,gBAAV,GAA6Bf,cAAc,CACzCa,SAAS,CAACE,gBAD+B,EAEzCL,oBAFyC,CAA3C;AAIAG,MAAAA,SAAS,CAACG,aAAV,GAA0BhB,cAAc,CACtCa,SAAS,CAACG,aAD4B,EAEtCL,qBAFsC,CAAxC;AAKAF,MAAAA,OAAO,CAACK,MAAR,GAAiBD,SAAjB;AACD,KAbD,MAaO,IAAIJ,OAAO,YAAYL,eAAvB,EAAwC;AAC7CK,MAAAA,OAAO,CAACC,oBAAR,GAA+BA,oBAA/B;AACAD,MAAAA,OAAO,CAACE,qBAAR,GAAgCA,qBAAhC;AACAF,MAAAA,OAAO,CAACQ,O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A,QAAIH,aAA4B,GAAG,EAAnC;;AAEA,SAAK,IAAIU,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,KAAKnB,QAAL,CAAcoB,MAAlC,EAA0CD,CAAC,EAA3C,EAA+C;AAC7C,WAAKlB,oBAAL,CACE,KAAKD,QAAL,CAAcmB,CAAd,CADF,EAEE,KAAKhB,oBAFP,EAGE,KAAKC,qBAAL,CAA2BmB,MAA3B,CAAkCd,aAAlC,CAHF,EAD6C,CAO7C;;AACAA,MAAAA,aAAa,GAAGA,aAAa,CAACc,MAAd,CAAqBD,aAAa,CAACH,CAAD,CAAlC,CAAhB;AACD;AACF;;AApBmD","sourcesContent":["import { BaseGesture, Gesture, GestureRef, GestureType } from './gesture';\r\n\r\nfunction extendRelation(\r\n currentRelation: GestureRef[] | undefined,\r\n extendWith: GestureType[]\r\n) {\r\n if (currentRelation === undefined) {\r\n return [...extendWith];\r\n } else {\r\n return [...currentRelation, ...extendWith];\r\n }\r\n}\r\n\r\nexport class ComposedGesture extends Gesture {\r\n protected gestures: Gesture[] = [];\r\n protected simultaneousGestures: GestureType[] = [];\r\n protected requireGesturesToFail: GestureType[] = [];\r\n\r\n constructor(...gestures: Gesture[]) {\r\n super();\r\n this.gestures = gestures;\r\n }\r\n\r\n protected prepareSingleGesture(\r\n gesture: Gesture,\r\n simultaneousGestures: GestureType[],\r\n requireGesturesToFail: GestureType[]\r\n ) {\r\n if (gesture instanceof BaseGesture) {\r\n const newConfig = { ...gesture.config };\r\n\r\n newConfig.simultaneousWith = extendRelation(\r\n newConfig.simultaneousWith,\r\n simultaneousGestures\r\n );\r\n newConfig.requireToFail = extendRelation(\r\n newConfig.requireToFail,\r\n requireGesturesToFail\r\n );\r\n\r\n gesture.config = newConfig;\r\n } else if (gesture instanceof ComposedGesture) {\r\n gesture.simultaneousGestures = simultaneousGestures;\r\n gesture.requireGesturesToFail = requireGesturesToFail;\r\n gesture.prepare();\r\n }\r\n }\r\n\r\n prepare() {\r\n for (const gesture of this.gestures) {\r\n this.prepareSingleGesture(\r\n gesture,\r\n this.simultaneousGestures,\r\n this.requireGesturesToFail\r\n );\r\n }\r\n }\r\n\r\n initialize() {\r\n for (const gesture of this.gestures) {\r\n gesture.initialize();\r\n }\r\n }\r\n\r\n toGestureArray(): GestureType[] {\r\n return this.gestures.flatMap((gesture) => gesture.toGestureArray());\r\n }\r\n}\r\n\r\nexport class SimultaneousGesture extends ComposedGesture {\r\n prepare() {\r\n // this piece of magic works something like this:\r\n // for every gesture in the array\r\n const simultaneousArrays = this.gestures.map((gesture) =>\r\n // we take the array it's in\r\n this.gestures\r\n // and make a copy without it\r\n .filter((x) => x !== gesture)\r\n // then we flatmap the result to get list of raw (not composed) gestures\r\n // this way we don't make the gestures simultaneous with themselves, which is\r\n // important when the gesture is `ExclusiveGesture` - we don't want to make\r\n // exclusive gestures simultaneous\r\n .flatMap((x) => x.toGestureArray())\r\n );\r\n\r\n for (let i = 0; i < this.gestures.length; i++) {\r\n this.prepareSingleGesture(\r\n this.gestures[i],\r\n simultaneousArrays[i],\r\n this.requireGesturesToFail\r\n );\r\n }\r\n }\r\n}\r\n\r\nexport class ExclusiveGesture extends ComposedGesture {\r\n prepare() {\r\n // transforms the array of gestures into array of grouped raw (not composed) gestures\r\n // i.e. [gesture1, gesture2, ComposedGesture(gesture3, gesture4)] -> [[gesture1], [gesture2], [gesture3, gesture4]]\r\n const gestureArrays = this.gestures.map((gesture) =>\r\n gesture.toGestureArray()\r\n );\r\n\r\n let requireToFail: GestureType[] = [];\r\n\r\n for (let i = 0; i < this.gestures.length; i++) {\r\n this.prepareSingleGesture(\r\n this.gestures[i],\r\n this.simultaneousGestures,\r\n this.requireGesturesToFail.concat(requireToFail)\r\n );\r\n\r\n // every group gets to wait for all groups before it\r\n requireToFail = requireToFail.concat(gestureArrays[i]);\r\n }\r\n }\r\n}\r\n\r\nexport type ComposedGestureType = InstanceType<typeof ComposedGesture>;\r\nexport type RaceGestureType = ComposedGestureType;\r\nexport type SimultaneousGestureType = InstanceType<typeof SimultaneousGesture>;\r\nexport type ExclusiveGestureType = InstanceType<typeof ExclusiveGesture>;\r\n"]}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.GestureObjects = void 0;
|
7
|
+
|
8
|
+
var _flingGesture = require("./flingGesture");
|
9
|
+
|
10
|
+
var _forceTouchGesture = require("./forceTouchGesture");
|
11
|
+
|
12
|
+
var _gestureComposition = require("./gestureComposition");
|
13
|
+
|
14
|
+
var _longPressGesture = require("./longPressGesture");
|
15
|
+
|
16
|
+
var _panGesture = require("./panGesture");
|
17
|
+
|
18
|
+
var _pinchGesture = require("./pinchGesture");
|
19
|
+
|
20
|
+
var _rotationGesture = require("./rotationGesture");
|
21
|
+
|
22
|
+
var _tapGesture = require("./tapGesture");
|
23
|
+
|
24
|
+
var _nativeGesture = require("./nativeGesture");
|
25
|
+
|
26
|
+
var _manualGesture = require("./manualGesture");
|
27
|
+
|
28
|
+
var _hoverGesture = require("./hoverGesture");
|
29
|
+
|
30
|
+
const GestureObjects = {
|
31
|
+
Tap: () => {
|
32
|
+
return new _tapGesture.TapGesture();
|
33
|
+
},
|
34
|
+
Pan: () => {
|
35
|
+
return new _panGesture.PanGesture();
|
36
|
+
},
|
37
|
+
Pinch: () => {
|
38
|
+
return new _pinchGesture.PinchGesture();
|
39
|
+
},
|
40
|
+
Rotation: () => {
|
41
|
+
return new _rotationGesture.RotationGesture();
|
42
|
+
},
|
43
|
+
Fling: () => {
|
44
|
+
return new _flingGesture.FlingGesture();
|
45
|
+
},
|
46
|
+
LongPress: () => {
|
47
|
+
return new _longPressGesture.LongPressGesture();
|
48
|
+
},
|
49
|
+
ForceTouch: () => {
|
50
|
+
return new _forceTouchGesture.ForceTouchGesture();
|
51
|
+
},
|
52
|
+
Native: () => {
|
53
|
+
return new _nativeGesture.NativeGesture();
|
54
|
+
},
|
55
|
+
Manual: () => {
|
56
|
+
return new _manualGesture.ManualGesture();
|
57
|
+
},
|
58
|
+
Hover: () => {
|
59
|
+
return new _hoverGesture.HoverGesture();
|
60
|
+
},
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Builds a composed gesture consisting of gestures provided as parameters.
|
64
|
+
* The first one that becomes active cancels the rest of gestures.
|
65
|
+
*/
|
66
|
+
Race: (...gestures) => {
|
67
|
+
return new _gestureComposition.ComposedGesture(...gestures);
|
68
|
+
},
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Builds a composed gesture that allows all base gestures to run simultaneously.
|
72
|
+
*/
|
73
|
+
Simultaneous(...gestures) {
|
74
|
+
return new _gestureComposition.SimultaneousGesture(...gestures);
|
75
|
+
},
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Builds a composed gesture where only one of the provided gestures can become active.
|
79
|
+
* Priority is decided through the order of gestures: the first one has higher priority
|
80
|
+
* than the second one, second one has higher priority than the third one, and so on.
|
81
|
+
* For example, to make a gesture that recognizes both single and double tap you need
|
82
|
+
* to call Exclusive(doubleTap, singleTap).
|
83
|
+
*/
|
84
|
+
Exclusive(...gestures) {
|
85
|
+
return new _gestureComposition.ExclusiveGesture(...gestures);
|
86
|
+
}
|
87
|
+
|
88
|
+
};
|
89
|
+
exports.GestureObjects = GestureObjects;
|
90
|
+
//# sourceMappingURL=gestureObjects.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["gestureObjects.ts"],"names":["GestureObjects","Tap","TapGesture","Pan","PanGesture","Pinch","PinchGesture","Rotation","RotationGesture","Fling","FlingGesture","LongPress","LongPressGesture","ForceTouch","ForceTouchGesture","Native","NativeGesture","Manual","ManualGesture","Hover","HoverGesture","Race","gestures","ComposedGesture","Simultaneous","SimultaneousGesture","Exclusive","ExclusiveGesture"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,MAAMA,cAA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AACD;;AAjE2B,CAAvB","sourcesContent":["import { FlingGesture } from './flingGesture';\r\nimport { ForceTouchGesture } from './forceTouchGesture';\r\nimport { Gesture } from './gesture';\r\nimport {\r\n ComposedGesture,\r\n ExclusiveGesture,\r\n SimultaneousGesture,\r\n} from './gestureComposition';\r\nimport { LongPressGesture } from './longPressGesture';\r\nimport { PanGesture } from './panGesture';\r\nimport { PinchGesture } from './pinchGesture';\r\nimport { RotationGesture } from './rotationGesture';\r\nimport { TapGesture } from './tapGesture';\r\nimport { NativeGesture } from './nativeGesture';\r\nimport { ManualGesture } from './manualGesture';\r\nimport { HoverGesture } from './hoverGesture';\r\n\r\nexport const GestureObjects = {\r\n Tap: () => {\r\n return new TapGesture();\r\n },\r\n\r\n Pan: () => {\r\n return new PanGesture();\r\n },\r\n\r\n Pinch: () => {\r\n return new PinchGesture();\r\n },\r\n\r\n Rotation: () => {\r\n return new RotationGesture();\r\n },\r\n\r\n Fling: () => {\r\n return new FlingGesture();\r\n },\r\n\r\n LongPress: () => {\r\n return new LongPressGesture();\r\n },\r\n\r\n ForceTouch: () => {\r\n return new ForceTouchGesture();\r\n },\r\n\r\n Native: () => {\r\n return new NativeGesture();\r\n },\r\n\r\n Manual: () => {\r\n return new ManualGesture();\r\n },\r\n\r\n Hover: () => {\r\n return new HoverGesture();\r\n },\r\n\r\n /**\r\n * Builds a composed gesture consisting of gestures provided as parameters.\r\n * The first one that becomes active cancels the rest of gestures.\r\n */\r\n Race: (...gestures: Gesture[]) => {\r\n return new ComposedGesture(...gestures);\r\n },\r\n\r\n /**\r\n * Builds a composed gesture that allows all base gestures to run simultaneously.\r\n */\r\n Simultaneous(...gestures: Gesture[]) {\r\n return new SimultaneousGesture(...gestures);\r\n },\r\n\r\n /**\r\n * Builds a composed gesture where only one of the provided gestures can become active.\r\n * Priority is decided through the order of gestures: the first one has higher priority\r\n * than the second one, second one has higher priority than the third one, and so on.\r\n * For example, to make a gesture that recognizes both single and double tap you need\r\n * to call Exclusive(doubleTap, singleTap).\r\n */\r\n Exclusive(...gestures: Gesture[]) {\r\n return new ExclusiveGesture(...gestures);\r\n },\r\n};\r\n"]}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.GestureStateManager = void 0;
|
7
|
+
|
8
|
+
var _reanimatedWrapper = require("./reanimatedWrapper");
|
9
|
+
|
10
|
+
var _State = require("../../State");
|
11
|
+
|
12
|
+
var _utils = require("../../utils");
|
13
|
+
|
14
|
+
const warningMessage = (0, _utils.tagMessage)('react-native-reanimated is required in order to use synchronous state management'); // check if reanimated module is available, but look for useSharedValue as conditional
|
15
|
+
// require of reanimated can sometimes return content of `utils.ts` file (?)
|
16
|
+
|
17
|
+
const REANIMATED_AVAILABLE = (_reanimatedWrapper.Reanimated === null || _reanimatedWrapper.Reanimated === void 0 ? void 0 : _reanimatedWrapper.Reanimated.useSharedValue) !== undefined;
|
18
|
+
const setGestureState = _reanimatedWrapper.Reanimated === null || _reanimatedWrapper.Reanimated === void 0 ? void 0 : _reanimatedWrapper.Reanimated.setGestureState;
|
19
|
+
const GestureStateManager = {
|
20
|
+
create(handlerTag) {
|
21
|
+
'worklet';
|
22
|
+
|
23
|
+
return {
|
24
|
+
begin: () => {
|
25
|
+
'worklet';
|
26
|
+
|
27
|
+
if (REANIMATED_AVAILABLE) {
|
28
|
+
setGestureState(handlerTag, _State.State.BEGAN);
|
29
|
+
} else {
|
30
|
+
console.warn(warningMessage);
|
31
|
+
}
|
32
|
+
},
|
33
|
+
activate: () => {
|
34
|
+
'worklet';
|
35
|
+
|
36
|
+
if (REANIMATED_AVAILABLE) {
|
37
|
+
setGestureState(handlerTag, _State.State.ACTIVE);
|
38
|
+
} else {
|
39
|
+
console.warn(warningMessage);
|
40
|
+
}
|
41
|
+
},
|
42
|
+
fail: () => {
|
43
|
+
'worklet';
|
44
|
+
|
45
|
+
if (REANIMATED_AVAILABLE) {
|
46
|
+
setGestureState(handlerTag, _State.State.FAILED);
|
47
|
+
} else {
|
48
|
+
console.warn(warningMessage);
|
49
|
+
}
|
50
|
+
},
|
51
|
+
end: () => {
|
52
|
+
'worklet';
|
53
|
+
|
54
|
+
if (REANIMATED_AVAILABLE) {
|
55
|
+
setGestureState(handlerTag, _State.State.END);
|
56
|
+
} else {
|
57
|
+
console.warn(warningMessage);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
};
|
61
|
+
}
|
62
|
+
|
63
|
+
};
|
64
|
+
exports.GestureStateManager = GestureStateManager;
|
65
|
+
//# sourceMappingURL=gestureStateManager.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["gestureStateManager.ts"],"names":["warningMessage","REANIMATED_AVAILABLE","useSharedValue","undefined","setGestureState","Reanimated","GestureStateManager","create","handlerTag","begin","State","BEGAN","console","warn","activate","ACTIVE","fail","FAILED","end","END"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AASA,MAAMA,cAAc,GAAG,uBACrB,kFADqB,CAAvB,C,CAIA;AACA;;AACA,MAAMC,oBAAoB,GAAG,6HAAYC,cAAZ,MAA+BC,SAA5D;AACA,MAAMC,eAAe,GAAGC,6BAAH,aAAGA,6BAAH,uBAAGA,8BAAYD,eAApC;AAEO,MAAME,mBAAmB,GAAG;AACjCC,EAAAA,MAAM,CAACC,UAAD,EAA8C;AAClD;;AACA,WAAO;AACLC,MAAAA,KAAK,EAAE,MAAM;AACX;;AACA,YAAIR,oBAAJ,EAA0B;AACxBG,UAAAA,eAAe,CAACI,UAAD,EAAaE,aAAMC,KAAnB,CAAf;AACD,SAFD,MAEO;AACLC,UAAAA,OAAO,CAACC,IAAR,CAAab,cAAb;AACD;AACF,OARI;AAULc,MAAAA,QAAQ,EAAE,MAAM;AACd;;AACA,YAAIb,oBAAJ,EAA0B;AACxBG,UAAAA,eAAe,CAACI,UAAD,EAAaE,aAAMK,MAAnB,CAAf;AACD,SAFD,MAEO;AACLH,UAAAA,OAAO,CAACC,IAAR,CAAab,cAAb;AACD;AACF,OAjBI;AAmBLgB,MAAAA,IAAI,EAAE,MAAM;AACV;;AACA,YAAIf,oBAAJ,EAA0B;AACxBG,UAAAA,eAAe,CAACI,UAAD,EAAaE,aAAMO,MAAnB,CAAf;AACD,SAFD,MAEO;AACLL,UAAAA,OAAO,CAACC,IAAR,CAAab,cAAb;AACD;AACF,OA1BI;AA4BLkB,MAAAA,GAAG,EAAE,MAAM;AACT;;AACA,YAAIjB,oBAAJ,EAA0B;AACxBG,UAAAA,eAAe,CAACI,UAAD,EAAaE,aAAMS,GAAnB,CAAf;AACD,SAFD,MAEO;AACLP,UAAAA,OAAO,CAACC,IAAR,CAAab,cAAb;AACD;AACF;AAnCI,KAAP;AAqCD;;AAxCgC,CAA5B","sourcesContent":["import { Reanimated } from './reanimatedWrapper';\r\nimport { State } from '../../State';\r\nimport { tagMessage } from '../../utils';\r\n\r\nexport interface GestureStateManagerType {\r\n begin: () => void;\r\n activate: () => void;\r\n fail: () => void;\r\n end: () => void;\r\n}\r\n\r\nconst warningMessage = tagMessage(\r\n 'react-native-reanimated is required in order to use synchronous state management'\r\n);\r\n\r\n// check if reanimated module is available, but look for useSharedValue as conditional\r\n// require of reanimated can sometimes return content of `utils.ts` file (?)\r\nconst REANIMATED_AVAILABLE = Reanimated?.useSharedValue !== undefined;\r\nconst setGestureState = Reanimated?.setGestureState;\r\n\r\nexport const GestureStateManager = {\r\n create(handlerTag: number): GestureStateManagerType {\r\n 'worklet';\r\n return {\r\n begin: () => {\r\n 'worklet';\r\n if (REANIMATED_AVAILABLE) {\r\n setGestureState(handlerTag, State.BEGAN);\r\n } else {\r\n console.warn(warningMessage);\r\n }\r\n },\r\n\r\n activate: () => {\r\n 'worklet';\r\n if (REANIMATED_AVAILABLE) {\r\n setGestureState(handlerTag, State.ACTIVE);\r\n } else {\r\n console.warn(warningMessage);\r\n }\r\n },\r\n\r\n fail: () => {\r\n 'worklet';\r\n if (REANIMATED_AVAILABLE) {\r\n setGestureState(handlerTag, State.FAILED);\r\n } else {\r\n console.warn(warningMessage);\r\n }\r\n },\r\n\r\n end: () => {\r\n 'worklet';\r\n if (REANIMATED_AVAILABLE) {\r\n setGestureState(handlerTag, State.END);\r\n } else {\r\n console.warn(warningMessage);\r\n }\r\n },\r\n };\r\n },\r\n};\r\n"]}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.GestureStateManager = void 0;
|
7
|
+
|
8
|
+
var _NodeManager = _interopRequireDefault(require("../../web/tools/NodeManager"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
|
12
|
+
const GestureStateManager = {
|
13
|
+
create(handlerTag) {
|
14
|
+
return {
|
15
|
+
begin: () => {
|
16
|
+
_NodeManager.default.getHandler(handlerTag).begin();
|
17
|
+
},
|
18
|
+
activate: () => {
|
19
|
+
_NodeManager.default.getHandler(handlerTag).activate();
|
20
|
+
},
|
21
|
+
fail: () => {
|
22
|
+
_NodeManager.default.getHandler(handlerTag).fail();
|
23
|
+
},
|
24
|
+
end: () => {
|
25
|
+
_NodeManager.default.getHandler(handlerTag).end();
|
26
|
+
}
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
};
|
31
|
+
exports.GestureStateManager = GestureStateManager;
|
32
|
+
//# sourceMappingURL=gestureStateManager.web.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["gestureStateManager.web.ts"],"names":["GestureStateManager","create","handlerTag","begin","NodeManager","getHandler","activate","fail","end"],"mappings":";;;;;;;AAAA;;;;AAGO,MAAMA,mBAAmB,GAAG;AACjCC,EAAAA,MAAM,CAACC,UAAD,EAA8C;AAClD,WAAO;AACLC,MAAAA,KAAK,EAAE,MAAM;AACXC,6BAAYC,UAAZ,CAAuBH,UAAvB,EAAmCC,KAAnC;AACD,OAHI;AAKLG,MAAAA,QAAQ,EAAE,MAAM;AACdF,6BAAYC,UAAZ,CAAuBH,UAAvB,EAAmCI,QAAnC;AACD,OAPI;AASLC,MAAAA,IAAI,EAAE,MAAM;AACVH,6BAAYC,UAAZ,CAAuBH,UAAvB,EAAmCK,IAAnC;AACD,OAXI;AAaLC,MAAAA,GAAG,EAAE,MAAM;AACTJ,6BAAYC,UAAZ,CAAuBH,UAAvB,EAAmCM,GAAnC;AACD;AAfI,KAAP;AAiBD;;AAnBgC,CAA5B","sourcesContent":["import NodeManager from '../../web/tools/NodeManager';\r\nimport { GestureStateManagerType } from './gestureStateManager';\r\n\r\nexport const GestureStateManager = {\r\n create(handlerTag: number): GestureStateManagerType {\r\n return {\r\n begin: () => {\r\n NodeManager.getHandler(handlerTag).begin();\r\n },\r\n\r\n activate: () => {\r\n NodeManager.getHandler(handlerTag).activate();\r\n },\r\n\r\n fail: () => {\r\n NodeManager.getHandler(handlerTag).fail();\r\n },\r\n\r\n end: () => {\r\n NodeManager.getHandler(handlerTag).end();\r\n },\r\n };\r\n },\r\n};\r\n"]}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.HoverGesture = exports.hoverGestureHandlerProps = exports.HoverEffect = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
12
|
+
let HoverEffect;
|
13
|
+
exports.HoverEffect = HoverEffect;
|
14
|
+
|
15
|
+
(function (HoverEffect) {
|
16
|
+
HoverEffect[HoverEffect["NONE"] = 0] = "NONE";
|
17
|
+
HoverEffect[HoverEffect["LIFT"] = 1] = "LIFT";
|
18
|
+
HoverEffect[HoverEffect["HIGHLIGHT"] = 2] = "HIGHLIGHT";
|
19
|
+
})(HoverEffect || (exports.HoverEffect = HoverEffect = {}));
|
20
|
+
|
21
|
+
const hoverGestureHandlerProps = ['hoverEffect'];
|
22
|
+
exports.hoverGestureHandlerProps = hoverGestureHandlerProps;
|
23
|
+
|
24
|
+
function changeEventCalculator(current, previous) {
|
25
|
+
'worklet';
|
26
|
+
|
27
|
+
let changePayload;
|
28
|
+
|
29
|
+
if (previous === undefined) {
|
30
|
+
changePayload = {
|
31
|
+
changeX: current.x,
|
32
|
+
changeY: current.y
|
33
|
+
};
|
34
|
+
} else {
|
35
|
+
changePayload = {
|
36
|
+
changeX: current.x - previous.x,
|
37
|
+
changeY: current.y - previous.y
|
38
|
+
};
|
39
|
+
}
|
40
|
+
|
41
|
+
return { ...current,
|
42
|
+
...changePayload
|
43
|
+
};
|
44
|
+
}
|
45
|
+
|
46
|
+
class HoverGesture extends _gesture.ContinousBaseGesture {
|
47
|
+
constructor() {
|
48
|
+
super();
|
49
|
+
|
50
|
+
_defineProperty(this, "config", {});
|
51
|
+
|
52
|
+
this.handlerName = 'HoverGestureHandler';
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* Sets the visual hover effect.
|
56
|
+
* iOS only
|
57
|
+
*/
|
58
|
+
|
59
|
+
|
60
|
+
effect(effect) {
|
61
|
+
this.config.hoverEffect = effect;
|
62
|
+
return this;
|
63
|
+
}
|
64
|
+
|
65
|
+
onChange(callback) {
|
66
|
+
// @ts-ignore TS being overprotective, HoverGestureHandlerEventPayload is Record
|
67
|
+
this.handlers.changeEventCalculator = changeEventCalculator;
|
68
|
+
return super.onChange(callback);
|
69
|
+
}
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
exports.HoverGesture = HoverGesture;
|
74
|
+
//# sourceMappingURL=hoverGesture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["hoverGesture.ts"],"names":["HoverEffect","hoverGestureHandlerProps","changeEventCalculator","current","previous","changePayload","undefined","changeX","x","changeY","y","HoverGesture","ContinousBaseGesture","constructor","handlerName","effect","config","hoverEffect","onChange","callback","handlers"],"mappings":";;;;;;;AAAA;;;;IAeYA,W;;;WAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;GAAAA,W,2BAAAA,W;;AAUL,MAAMC,wBAAwB,GAAG,CAAC,aAAD,CAAjC;;;AAEP,SAASC,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,OAAO,EAAEJ,OAAO,CAACK,CADH;AAEdC,MAAAA,OAAO,EAAEN,OAAO,CAACO;AAFH,KAAhB;AAID,GALD,MAKO;AACLL,IAAAA,aAAa,GAAG;AACdE,MAAAA,OAAO,EAAEJ,OAAO,CAACK,CAAR,GAAYJ,QAAQ,CAACI,CADhB;AAEdC,MAAAA,OAAO,EAAEN,OAAO,CAACO,CAAR,GAAYN,QAAQ,CAACM;AAFhB,KAAhB;AAID;;AAED,SAAO,EAAE,GAAGP,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAEM,MAAMM,YAAN,SAA2BC,6BAA3B,CAGL;AAGAC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF0C,EAE1C;;AAGZ,SAAKC,WAAL,GAAmB,qBAAnB;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,MAAM,CAACA,MAAD,EAAsB;AAC1B,SAAKC,MAAL,CAAYC,WAAZ,GAA0BF,MAA1B;AACA,WAAO,IAAP;AACD;;AAEDG,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAclB,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMgB,QAAN,CAAeC,QAAf,CAAP;AACD;;AA5BD","sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\r\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\r\n\r\nexport type HoverGestureHandlerEventPayload = {\r\n x: number;\r\n y: number;\r\n absoluteX: number;\r\n absoluteY: number;\r\n};\r\n\r\nexport type HoverGestureChangeEventPayload = {\r\n changeX: number;\r\n changeY: number;\r\n};\r\n\r\nexport enum HoverEffect {\r\n NONE = 0,\r\n LIFT = 1,\r\n HIGHLIGHT = 2,\r\n}\r\n\r\nexport interface HoverGestureConfig {\r\n hoverEffect?: HoverEffect;\r\n}\r\n\r\nexport const hoverGestureHandlerProps = ['hoverEffect'] as const;\r\n\r\nfunction changeEventCalculator(\r\n current: GestureUpdateEvent<HoverGestureHandlerEventPayload>,\r\n previous?: GestureUpdateEvent<HoverGestureHandlerEventPayload>\r\n) {\r\n 'worklet';\r\n let changePayload: HoverGestureChangeEventPayload;\r\n if (previous === undefined) {\r\n changePayload = {\r\n changeX: current.x,\r\n changeY: current.y,\r\n };\r\n } else {\r\n changePayload = {\r\n changeX: current.x - previous.x,\r\n changeY: current.y - previous.y,\r\n };\r\n }\r\n\r\n return { ...current, ...changePayload };\r\n}\r\n\r\nexport class HoverGesture extends ContinousBaseGesture<\r\n HoverGestureHandlerEventPayload,\r\n HoverGestureChangeEventPayload\r\n> {\r\n public config: BaseGestureConfig & HoverGestureConfig = {};\r\n\r\n constructor() {\r\n super();\r\n\r\n this.handlerName = 'HoverGestureHandler';\r\n }\r\n\r\n /**\r\n * Sets the visual hover effect.\r\n * iOS only\r\n */\r\n effect(effect: HoverEffect) {\r\n this.config.hoverEffect = effect;\r\n return this;\r\n }\r\n\r\n onChange(\r\n callback: (\r\n event: GestureUpdateEvent<\r\n HoverGestureHandlerEventPayload & HoverGestureChangeEventPayload\r\n >\r\n ) => void\r\n ) {\r\n // @ts-ignore TS being overprotective, HoverGestureHandlerEventPayload is Record\r\n this.handlers.changeEventCalculator = changeEventCalculator;\r\n return super.onChange(callback);\r\n }\r\n}\r\n\r\nexport type HoverGestureType = InstanceType<typeof HoverGesture>;\r\n"]}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.LongPressGesture = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
12
|
+
class LongPressGesture extends _gesture.BaseGesture {
|
13
|
+
constructor() {
|
14
|
+
super();
|
15
|
+
|
16
|
+
_defineProperty(this, "config", {});
|
17
|
+
|
18
|
+
this.handlerName = 'LongPressGestureHandler';
|
19
|
+
this.shouldCancelWhenOutside(true);
|
20
|
+
}
|
21
|
+
|
22
|
+
minDuration(duration) {
|
23
|
+
this.config.minDurationMs = duration;
|
24
|
+
return this;
|
25
|
+
}
|
26
|
+
|
27
|
+
maxDistance(distance) {
|
28
|
+
this.config.maxDist = distance;
|
29
|
+
return this;
|
30
|
+
}
|
31
|
+
|
32
|
+
}
|
33
|
+
|
34
|
+
exports.LongPressGesture = LongPressGesture;
|
35
|
+
//# sourceMappingURL=longPressGesture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["longPressGesture.ts"],"names":["LongPressGesture","BaseGesture","constructor","handlerName","shouldCancelWhenOutside","minDuration","duration","config","minDurationMs","maxDistance","distance","maxDist"],"mappings":";;;;;;;AAAA;;;;AAMO,MAAMA,gBAAN,SAA+BC,oBAA/B,CAAgF;AAGrFC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF8C,EAE9C;;AAGZ,SAAKC,WAAL,GAAmB,yBAAnB;AACA,SAAKC,uBAAL,CAA6B,IAA7B;AACD;;AAEDC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKC,MAAL,CAAYC,aAAZ,GAA4BF,QAA5B;AACA,WAAO,IAAP;AACD;;AAEDG,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKH,MAAL,CAAYI,OAAZ,GAAsBD,QAAtB;AACA,WAAO,IAAP;AACD;;AAlBoF","sourcesContent":["import { BaseGesture, BaseGestureConfig } from './gesture';\r\nimport {\r\n LongPressGestureConfig,\r\n LongPressGestureHandlerEventPayload,\r\n} from '../LongPressGestureHandler';\r\n\r\nexport class LongPressGesture extends BaseGesture<LongPressGestureHandlerEventPayload> {\r\n public config: BaseGestureConfig & LongPressGestureConfig = {};\r\n\r\n constructor() {\r\n super();\r\n\r\n this.handlerName = 'LongPressGestureHandler';\r\n this.shouldCancelWhenOutside(true);\r\n }\r\n\r\n minDuration(duration: number) {\r\n this.config.minDurationMs = duration;\r\n return this;\r\n }\r\n\r\n maxDistance(distance: number) {\r\n this.config.maxDist = distance;\r\n return this;\r\n }\r\n}\r\n\r\nexport type LongPressGestureType = InstanceType<typeof LongPressGesture>;\r\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ManualGesture = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
function changeEventCalculator(current, _previous) {
|
11
|
+
'worklet';
|
12
|
+
|
13
|
+
return current;
|
14
|
+
}
|
15
|
+
|
16
|
+
class ManualGesture extends _gesture.ContinousBaseGesture {
|
17
|
+
constructor() {
|
18
|
+
super();
|
19
|
+
this.handlerName = 'ManualGestureHandler';
|
20
|
+
}
|
21
|
+
|
22
|
+
onChange(callback) {
|
23
|
+
// @ts-ignore TS being overprotective, Record<string, never> is Record
|
24
|
+
this.handlers.changeEventCalculator = changeEventCalculator;
|
25
|
+
return super.onChange(callback);
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
29
|
+
|
30
|
+
exports.ManualGesture = ManualGesture;
|
31
|
+
//# sourceMappingURL=manualGesture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["manualGesture.ts"],"names":["changeEventCalculator","current","_previous","ManualGesture","ContinousBaseGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":";;;;;;;AACA;;AAEA,SAASA,qBAAT,CACEC,OADF,EAEEC,SAFF,EAGE;AACA;;AACA,SAAOD,OAAP;AACD;;AAEM,MAAME,aAAN,SAA4BC,6BAA5B,CAGL;AACAC,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,sBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAEN;AACA;AACA,SAAKC,QAAL,CAAcT,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMO,QAAN,CAAeC,QAAf,CAAP;AACD;;AAbD","sourcesContent":["import { GestureUpdateEvent } from '../gestureHandlerCommon';\r\nimport { ContinousBaseGesture } from './gesture';\r\n\r\nfunction changeEventCalculator(\r\n current: GestureUpdateEvent<Record<string, never>>,\r\n _previous?: GestureUpdateEvent<Record<string, never>>\r\n) {\r\n 'worklet';\r\n return current;\r\n}\r\n\r\nexport class ManualGesture extends ContinousBaseGesture<\r\n Record<string, never>,\r\n Record<string, never>\r\n> {\r\n constructor() {\r\n super();\r\n\r\n this.handlerName = 'ManualGestureHandler';\r\n }\r\n\r\n onChange(\r\n callback: (event: GestureUpdateEvent<Record<string, never>>) => void\r\n ) {\r\n // @ts-ignore TS being overprotective, Record<string, never> is Record\r\n this.handlers.changeEventCalculator = changeEventCalculator;\r\n return super.onChange(callback);\r\n }\r\n}\r\n\r\nexport type ManualGestureType = InstanceType<typeof ManualGesture>;\r\n"]}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.NativeGesture = void 0;
|
7
|
+
|
8
|
+
var _gesture = require("./gesture");
|
9
|
+
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
12
|
+
class NativeGesture extends _gesture.BaseGesture {
|
13
|
+
constructor() {
|
14
|
+
super();
|
15
|
+
|
16
|
+
_defineProperty(this, "config", {});
|
17
|
+
|
18
|
+
this.handlerName = 'NativeViewGestureHandler';
|
19
|
+
}
|
20
|
+
|
21
|
+
shouldActivateOnStart(value) {
|
22
|
+
this.config.shouldActivateOnStart = value;
|
23
|
+
return this;
|
24
|
+
}
|
25
|
+
|
26
|
+
disallowInterruption(value) {
|
27
|
+
this.config.disallowInterruption = value;
|
28
|
+
return this;
|
29
|
+
}
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
exports.NativeGesture = NativeGesture;
|
34
|
+
//# sourceMappingURL=nativeGesture.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["nativeGesture.ts"],"names":["NativeGesture","BaseGesture","constructor","handlerName","shouldActivateOnStart","value","config","disallowInterruption"],"mappings":";;;;;;;AAAA;;;;AAMO,MAAMA,aAAN,SAA4BC,oBAA5B,CAAyE;AAG9EC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF+C,EAE/C;;AAGZ,SAAKC,WAAL,GAAmB,0BAAnB;AACD;;AAEDC,EAAAA,qBAAqB,CAACC,KAAD,EAAiB;AACpC,SAAKC,MAAL,CAAYF,qBAAZ,GAAoCC,KAApC;AACA,WAAO,IAAP;AACD;;AAEDE,EAAAA,oBAAoB,CAACF,KAAD,EAAiB;AACnC,SAAKC,MAAL,CAAYC,oBAAZ,GAAmCF,KAAnC;AACA,WAAO,IAAP;AACD;;AAjB6E","sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\r\nimport {\r\n NativeViewGestureConfig,\r\n NativeViewGestureHandlerPayload,\r\n} from '../NativeViewGestureHandler';\r\n\r\nexport class NativeGesture extends BaseGesture<NativeViewGestureHandlerPayload> {\r\n public config: BaseGestureConfig & NativeViewGestureConfig = {};\r\n\r\n constructor() {\r\n super();\r\n\r\n this.handlerName = 'NativeViewGestureHandler';\r\n }\r\n\r\n shouldActivateOnStart(value: boolean) {\r\n this.config.shouldActivateOnStart = value;\r\n return this;\r\n }\r\n\r\n disallowInterruption(value: boolean) {\r\n this.config.disallowInterruption = value;\r\n return this;\r\n }\r\n}\r\n\r\nexport type NativeGestureType = InstanceType<typeof NativeGesture>;\r\n"]}
|