react-native-gesture-handler 2.22.0 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
- package/android/src/main/jni/cpp-adapter.cpp +19 -12
- package/apple/RNGestureHandler.mm +15 -8
- package/apple/RNGestureHandlerModule.mm +17 -5
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +11 -8
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +2 -10
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +2 -7
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +1 -6
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +1 -3
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +3 -5
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +2 -6
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +13 -39
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +22 -32
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +1 -3
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +1 -2
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +4 -3
- package/lib/commonjs/State.js.map +1 -1
- package/lib/commonjs/TouchEventType.js +3 -3
- package/lib/commonjs/TouchEventType.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +96 -115
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +36 -80
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +26 -37
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +13 -27
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +2 -6
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +4 -12
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +4 -15
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +4 -14
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +4 -13
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +46 -78
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js +1 -3
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +5 -20
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +38 -76
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +133 -98
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +34 -75
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +18 -26
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +5 -14
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +40 -76
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +20 -33
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +17 -31
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -4
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +17 -24
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +12 -13
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +7 -12
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +1 -4
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +9 -10
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +1 -6
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +0 -1
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +13 -14
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +0 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +1 -2
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +16 -10
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +20 -23
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +16 -10
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +17 -12
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +20 -31
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +14 -8
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +14 -8
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +16 -10
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +55 -135
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +33 -32
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +1 -2
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +9 -10
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +5 -14
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +10 -20
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -29
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +1 -10
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +12 -37
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +12 -24
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -48
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +3 -13
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +2 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +8 -16
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +28 -56
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -46
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +5 -12
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +8 -19
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +44 -84
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +17 -31
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +1 -27
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +3 -9
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +2 -7
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +11 -25
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +6 -14
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +0 -6
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +5 -12
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +18 -43
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +2 -9
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +1 -8
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +2 -9
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +10 -22
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +0 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +11 -21
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +6 -26
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +75 -104
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +4 -11
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +4 -5
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +19 -83
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +5 -15
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +3 -12
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +1 -5
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +2 -7
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +2 -7
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +15 -30
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +5 -23
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +2 -4
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +26 -62
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +36 -65
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +12 -55
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +160 -273
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +8 -21
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +12 -53
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +1 -11
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +21 -62
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +23 -138
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +19 -56
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +16 -54
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +10 -71
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +9 -17
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +17 -29
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +7 -41
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +51 -118
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +37 -58
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +21 -40
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +4 -26
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +30 -67
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +9 -16
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +10 -45
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +24 -60
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +3 -18
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +10 -32
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +4 -17
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +26 -55
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +7 -19
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +3 -13
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +0 -3
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +13 -44
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +55 -142
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +2 -11
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +5 -19
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +16 -24
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +9 -16
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +8 -49
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +2 -11
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +15 -43
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +2 -13
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +33 -52
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +13 -26
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +4 -14
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +3 -1
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +9 -3
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +2 -5
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +0 -1
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +0 -1
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +3 -4
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +1 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +12 -22
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +18 -17
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/RNRenderer.js.map +1 -1
- package/lib/module/RNRenderer.web.js.map +1 -1
- package/lib/module/State.js +4 -1
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +3 -1
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +87 -99
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +27 -55
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +17 -12
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +4 -4
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.web.js +1 -2
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +1 -2
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +1 -2
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +1 -2
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +44 -61
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/PressableProps.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/Pressable/utils.js +4 -14
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +34 -56
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +130 -84
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +28 -59
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +14 -13
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js +2 -2
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchable.js +34 -63
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +16 -23
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +11 -19
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +13 -14
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -2
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/findNodeHandle.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +9 -8
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/getReactNativeVersion.js.map +1 -1
- package/lib/module/getReactNativeVersion.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +13 -13
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +13 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +16 -8
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +13 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +13 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +15 -19
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +13 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +13 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +13 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +54 -108
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +28 -22
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +9 -4
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +3 -4
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +5 -6
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +8 -16
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +9 -15
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -2
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +11 -14
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -39
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +2 -6
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -9
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +25 -30
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +14 -38
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +5 -9
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +8 -17
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +44 -73
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +16 -24
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +1 -14
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +3 -4
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +9 -18
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +6 -11
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +0 -4
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +5 -9
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +18 -41
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +2 -7
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -5
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +2 -7
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +10 -19
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +6 -8
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +4 -13
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +3 -2
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +20 -66
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +3 -7
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +3 -10
- package/lib/module/mountRegistry.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/typeUtils.js.map +1 -1
- package/lib/module/utils.js +8 -13
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +2 -1
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +26 -59
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +36 -61
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +11 -45
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +159 -259
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +7 -13
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +11 -46
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -6
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +20 -54
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +22 -129
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +18 -48
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +15 -46
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +9 -63
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +9 -14
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +17 -27
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +7 -39
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +50 -111
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +36 -47
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +21 -35
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +3 -19
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +30 -65
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +9 -14
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +9 -35
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +23 -54
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +3 -14
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +9 -26
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +3 -10
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +21 -40
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +4 -13
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +0 -5
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +0 -1
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +10 -35
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +53 -130
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +1 -6
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +2 -11
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +6 -8
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +6 -40
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +0 -5
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +13 -34
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +0 -6
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +31 -45
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +2 -1
- package/lib/module/web_hammer/constants.js.map +1 -1
- package/lib/module/web_hammer/utils.js +2 -2
- package/lib/module/web_hammer/utils.js.map +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +27 -0
- package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
- package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
- package/lib/typescript/components/Pressable/index.d.ts +1 -1
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -1
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
- package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
- package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
- package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
- package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
- package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
- package/package.json +2 -2
- package/src/RNGestureHandlerModule.web.ts +2 -2
- package/src/components/DrawerLayout.tsx +29 -0
- package/src/components/GestureButtons.tsx +13 -2
- package/src/components/GestureButtonsProps.ts +31 -2
- package/src/components/Pressable/Pressable.tsx +22 -5
- package/src/components/Pressable/PressableProps.tsx +4 -11
- package/src/components/Pressable/index.ts +4 -1
- package/src/components/ReanimatedSwipeable.tsx +194 -113
- package/src/components/Text.tsx +13 -4
- package/src/components/touchables/TouchableHighlight.tsx +5 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +5 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
- package/src/findNodeHandle.web.ts +6 -0
- package/src/handlers/FlingGestureHandler.ts +10 -0
- package/src/handlers/ForceTouchGestureHandler.ts +9 -0
- package/src/handlers/LongPressGestureHandler.ts +10 -0
- package/src/handlers/NativeViewGestureHandler.ts +10 -0
- package/src/handlers/PanGestureHandler.ts +10 -0
- package/src/handlers/PinchGestureHandler.ts +10 -0
- package/src/handlers/RotationGestureHandler.ts +10 -0
- package/src/handlers/TapGestureHandler.ts +10 -0
- package/src/handlers/createHandler.tsx +11 -4
- package/src/handlers/createNativeWrapper.tsx +10 -4
- package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
- package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
- package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
- package/src/handlers/handlersRegistry.ts +7 -3
- package/src/index.ts +4 -1
- package/src/utils.ts +2 -2
- package/src/web/detectors/RotationGestureDetector.ts +22 -22
- package/src/web/detectors/ScaleGestureDetector.ts +24 -24
- package/src/web/handlers/FlingGestureHandler.ts +6 -7
- package/src/web/handlers/GestureHandler.ts +115 -105
- package/src/web/handlers/HoverGestureHandler.ts +2 -2
- package/src/web/handlers/IGestureHandler.ts +12 -13
- package/src/web/handlers/LongPressGestureHandler.ts +7 -7
- package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
- package/src/web/handlers/PanGestureHandler.ts +17 -17
- package/src/web/handlers/PinchGestureHandler.ts +17 -21
- package/src/web/handlers/RotationGestureHandler.ts +12 -12
- package/src/web/handlers/TapGestureHandler.ts +4 -6
- package/src/web/tools/CircularBuffer.ts +15 -15
- package/src/web/tools/GestureHandlerDelegate.ts +1 -1
- package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
- package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
- package/src/web/tools/InteractionManager.ts +16 -16
- package/src/web/tools/NodeManager.ts +2 -2
- package/src/web/tools/PointerTracker.ts +20 -20
- package/src/web/tools/Vector.ts +1 -1
- package/src/web/tools/VelocityTracker.ts +1 -1
@@ -1,5 +1,6 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
3
4
|
import { State } from '../../State';
|
4
5
|
import { DEFAULT_TOUCH_SLOP } from '../constants';
|
5
6
|
import GestureHandler from './GestureHandler';
|
@@ -7,144 +8,113 @@ import ScaleGestureDetector from '../detectors/ScaleGestureDetector';
|
|
7
8
|
export default class PinchGestureHandler extends GestureHandler {
|
8
9
|
constructor(...args) {
|
9
10
|
super(...args);
|
10
|
-
|
11
11
|
_defineProperty(this, "scale", 1);
|
12
|
-
|
13
12
|
_defineProperty(this, "velocity", 0);
|
14
|
-
|
15
13
|
_defineProperty(this, "startingSpan", 0);
|
16
|
-
|
17
14
|
_defineProperty(this, "spanSlop", DEFAULT_TOUCH_SLOP);
|
18
|
-
|
19
15
|
_defineProperty(this, "scaleDetectorListener", {
|
20
16
|
onScaleBegin: detector => {
|
21
|
-
this.startingSpan = detector.
|
17
|
+
this.startingSpan = detector.currentSpan;
|
22
18
|
return true;
|
23
19
|
},
|
24
20
|
onScale: detector => {
|
25
21
|
const prevScaleFactor = this.scale;
|
26
|
-
this.scale *= detector.
|
27
|
-
const delta = detector.
|
28
|
-
|
22
|
+
this.scale *= detector.calculateScaleFactor(this.tracker.trackedPointersCount);
|
23
|
+
const delta = detector.timeDelta;
|
29
24
|
if (delta > 0) {
|
30
25
|
this.velocity = (this.scale - prevScaleFactor) / delta;
|
31
26
|
}
|
32
|
-
|
33
|
-
if (Math.abs(this.startingSpan - detector.getCurrentSpan()) >= this.spanSlop && this.currentState === State.BEGAN) {
|
27
|
+
if (Math.abs(this.startingSpan - detector.currentSpan) >= this.spanSlop && this.state === State.BEGAN) {
|
34
28
|
this.activate();
|
35
29
|
}
|
36
|
-
|
37
30
|
return true;
|
38
31
|
},
|
39
32
|
onScaleEnd: _detector => {}
|
40
33
|
});
|
41
|
-
|
42
34
|
_defineProperty(this, "scaleGestureDetector", new ScaleGestureDetector(this.scaleDetectorListener));
|
43
35
|
}
|
44
|
-
|
45
36
|
init(ref, propsRef) {
|
46
37
|
super.init(ref, propsRef);
|
47
|
-
this.
|
38
|
+
this.shouldCancelWhenOutside = false;
|
48
39
|
}
|
49
|
-
|
50
40
|
transformNativeEvent() {
|
51
41
|
return {
|
52
|
-
focalX: this.scaleGestureDetector.
|
53
|
-
focalY: this.scaleGestureDetector.
|
42
|
+
focalX: this.scaleGestureDetector.focusX,
|
43
|
+
focalY: this.scaleGestureDetector.focusY,
|
54
44
|
velocity: this.velocity,
|
55
45
|
scale: this.scale
|
56
46
|
};
|
57
47
|
}
|
58
|
-
|
59
48
|
onPointerDown(event) {
|
60
49
|
this.tracker.addToTracker(event);
|
61
50
|
super.onPointerDown(event);
|
62
51
|
this.tryToSendTouchEvent(event);
|
63
52
|
}
|
64
|
-
|
65
53
|
onPointerAdd(event) {
|
66
54
|
this.tracker.addToTracker(event);
|
67
55
|
super.onPointerAdd(event);
|
68
56
|
this.tryBegin();
|
69
57
|
this.scaleGestureDetector.onTouchEvent(event, this.tracker);
|
70
58
|
}
|
71
|
-
|
72
59
|
onPointerUp(event) {
|
73
60
|
super.onPointerUp(event);
|
74
61
|
this.tracker.removeFromTracker(event.pointerId);
|
75
|
-
|
76
|
-
if (this.currentState !== State.ACTIVE) {
|
62
|
+
if (this.state !== State.ACTIVE) {
|
77
63
|
return;
|
78
64
|
}
|
79
|
-
|
80
65
|
this.scaleGestureDetector.onTouchEvent(event, this.tracker);
|
81
|
-
|
82
|
-
if (this.currentState === State.ACTIVE) {
|
66
|
+
if (this.state === State.ACTIVE) {
|
83
67
|
this.end();
|
84
68
|
} else {
|
85
69
|
this.fail();
|
86
70
|
}
|
87
71
|
}
|
88
|
-
|
89
72
|
onPointerRemove(event) {
|
90
73
|
super.onPointerRemove(event);
|
91
74
|
this.scaleGestureDetector.onTouchEvent(event, this.tracker);
|
92
75
|
this.tracker.removeFromTracker(event.pointerId);
|
93
|
-
|
94
|
-
if (this.currentState === State.ACTIVE && this.tracker.getTrackedPointersCount() < 2) {
|
76
|
+
if (this.state === State.ACTIVE && this.tracker.trackedPointersCount < 2) {
|
95
77
|
this.end();
|
96
78
|
}
|
97
79
|
}
|
98
|
-
|
99
80
|
onPointerMove(event) {
|
100
|
-
if (this.tracker.
|
81
|
+
if (this.tracker.trackedPointersCount < 2) {
|
101
82
|
return;
|
102
83
|
}
|
103
|
-
|
104
84
|
this.tracker.track(event);
|
105
85
|
this.scaleGestureDetector.onTouchEvent(event, this.tracker);
|
106
86
|
super.onPointerMove(event);
|
107
87
|
}
|
108
|
-
|
109
88
|
onPointerOutOfBounds(event) {
|
110
|
-
if (this.tracker.
|
89
|
+
if (this.tracker.trackedPointersCount < 2) {
|
111
90
|
return;
|
112
91
|
}
|
113
|
-
|
114
92
|
this.tracker.track(event);
|
115
93
|
this.scaleGestureDetector.onTouchEvent(event, this.tracker);
|
116
94
|
super.onPointerOutOfBounds(event);
|
117
95
|
}
|
118
|
-
|
119
96
|
tryBegin() {
|
120
|
-
if (this.
|
97
|
+
if (this.state !== State.UNDETERMINED) {
|
121
98
|
return;
|
122
99
|
}
|
123
|
-
|
124
100
|
this.resetProgress();
|
125
101
|
this.begin();
|
126
102
|
}
|
127
|
-
|
128
103
|
activate(force) {
|
129
|
-
if (this.
|
104
|
+
if (this.state !== State.ACTIVE) {
|
130
105
|
this.resetProgress();
|
131
106
|
}
|
132
|
-
|
133
107
|
super.activate(force);
|
134
108
|
}
|
135
|
-
|
136
109
|
onReset() {
|
137
110
|
this.resetProgress();
|
138
111
|
}
|
139
|
-
|
140
112
|
resetProgress() {
|
141
|
-
if (this.
|
113
|
+
if (this.state === State.ACTIVE) {
|
142
114
|
return;
|
143
115
|
}
|
144
|
-
|
145
116
|
this.velocity = 0;
|
146
117
|
this.scale = 1;
|
147
118
|
}
|
148
|
-
|
149
119
|
}
|
150
120
|
//# sourceMappingURL=PinchGestureHandler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["State","DEFAULT_TOUCH_SLOP","GestureHandler","ScaleGestureDetector","PinchGestureHandler","constructor","args","_defineProperty","onScaleBegin","detector","startingSpan","currentSpan","onScale","prevScaleFactor","scale","calculateScaleFactor","tracker","trackedPointersCount","delta","timeDelta","velocity","Math","abs","spanSlop","state","BEGAN","activate","onScaleEnd","_detector","scaleDetectorListener","init","ref","propsRef","shouldCancelWhenOutside","transformNativeEvent","focalX","scaleGestureDetector","focusX","focalY","focusY","onPointerDown","event","addToTracker","tryToSendTouchEvent","onPointerAdd","tryBegin","onTouchEvent","onPointerUp","removeFromTracker","pointerId","ACTIVE","end","fail","onPointerRemove","onPointerMove","track","onPointerOutOfBounds","UNDETERMINED","resetProgress","begin","force","onReset"],"sources":["PinchGestureHandler.ts"],"sourcesContent":["import { State } from '../../State';\nimport { DEFAULT_TOUCH_SLOP } from '../constants';\nimport { AdaptedEvent } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\nimport ScaleGestureDetector, {\n ScaleGestureListener,\n} from '../detectors/ScaleGestureDetector';\n\nexport default class PinchGestureHandler extends GestureHandler {\n private scale = 1;\n private velocity = 0;\n\n private startingSpan = 0;\n private spanSlop = DEFAULT_TOUCH_SLOP;\n\n private scaleDetectorListener: ScaleGestureListener = {\n onScaleBegin: (detector: ScaleGestureDetector): boolean => {\n this.startingSpan = detector.currentSpan;\n return true;\n },\n onScale: (detector: ScaleGestureDetector): boolean => {\n const prevScaleFactor: number = this.scale;\n this.scale *= detector.calculateScaleFactor(\n this.tracker.trackedPointersCount\n );\n\n const delta = detector.timeDelta;\n if (delta > 0) {\n this.velocity = (this.scale - prevScaleFactor) / delta;\n }\n\n if (\n Math.abs(this.startingSpan - detector.currentSpan) >= this.spanSlop &&\n this.state === State.BEGAN\n ) {\n this.activate();\n }\n return true;\n },\n onScaleEnd: (\n _detector: ScaleGestureDetector\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n ): void => {},\n };\n\n private scaleGestureDetector: ScaleGestureDetector = new ScaleGestureDetector(\n this.scaleDetectorListener\n );\n\n public init(ref: number, propsRef: React.RefObject<unknown>) {\n super.init(ref, propsRef);\n\n this.shouldCancelWhenOutside = false;\n }\n\n protected transformNativeEvent() {\n return {\n focalX: this.scaleGestureDetector.focusX,\n focalY: this.scaleGestureDetector.focusY,\n velocity: this.velocity,\n scale: this.scale,\n };\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerDown(event);\n\n this.tryToSendTouchEvent(event);\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n this.tryBegin();\n this.scaleGestureDetector.onTouchEvent(event, this.tracker);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.tracker.removeFromTracker(event.pointerId);\n if (this.state !== State.ACTIVE) {\n return;\n }\n this.scaleGestureDetector.onTouchEvent(event, this.tracker);\n\n if (this.state === State.ACTIVE) {\n this.end();\n } else {\n this.fail();\n }\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.scaleGestureDetector.onTouchEvent(event, this.tracker);\n this.tracker.removeFromTracker(event.pointerId);\n\n if (this.state === State.ACTIVE && this.tracker.trackedPointersCount < 2) {\n this.end();\n }\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n if (this.tracker.trackedPointersCount < 2) {\n return;\n }\n this.tracker.track(event);\n\n this.scaleGestureDetector.onTouchEvent(event, this.tracker);\n super.onPointerMove(event);\n }\n protected onPointerOutOfBounds(event: AdaptedEvent): void {\n if (this.tracker.trackedPointersCount < 2) {\n return;\n }\n this.tracker.track(event);\n\n this.scaleGestureDetector.onTouchEvent(event, this.tracker);\n super.onPointerOutOfBounds(event);\n }\n\n private tryBegin(): void {\n if (this.state !== State.UNDETERMINED) {\n return;\n }\n\n this.resetProgress();\n this.begin();\n }\n\n public activate(force?: boolean): void {\n if (this.state !== State.ACTIVE) {\n this.resetProgress();\n }\n\n super.activate(force);\n }\n\n protected onReset(): void {\n this.resetProgress();\n }\n\n protected resetProgress(): void {\n if (this.state === State.ACTIVE) {\n return;\n }\n this.velocity = 0;\n this.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d;EAEOjC,QAAQA,CAACkC,KAAe,EAAQ;IACrC,IAAI,IAAI,CAACpC,KAAK,KAAKxB,KAAK,CAACkD,MAAM,EAAE;MAC/B,IAAI,CAACQ,aAAa,CAAC,CAAC;IACtB;IAEA,KAAK,CAAChC,QAAQ,CAACkC,KAAK,CAAC;EACvB;EAEUC,OAAOA,CAAA,EAAS;IACxB,IAAI,CAACH,aAAa,CAAC,CAAC;EACtB;EAEUA,aAAaA,CAAA,EAAS;IAC9B,IAAI,IAAI,CAAClC,KAAK,KAAKxB,KAAK,CAACkD,MAAM,EAAE;MAC/B;IACF;IACA,IAAI,CAAC9B,QAAQ,GAAG,CAAC;IACjB,IAAI,CAACN,KAAK,GAAG,CAAC;EAChB;AACF","ignoreList":[]}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
3
4
|
import { State } from '../../State';
|
4
5
|
import GestureHandler from './GestureHandler';
|
5
6
|
import RotationGestureDetector from '../detectors/RotationGestureDetector';
|
@@ -7,45 +8,34 @@ const ROTATION_RECOGNITION_THRESHOLD = Math.PI / 36;
|
|
7
8
|
export default class RotationGestureHandler extends GestureHandler {
|
8
9
|
constructor(...args) {
|
9
10
|
super(...args);
|
10
|
-
|
11
11
|
_defineProperty(this, "rotation", 0);
|
12
|
-
|
13
12
|
_defineProperty(this, "velocity", 0);
|
14
|
-
|
15
13
|
_defineProperty(this, "cachedAnchorX", 0);
|
16
|
-
|
17
14
|
_defineProperty(this, "cachedAnchorY", 0);
|
18
|
-
|
19
15
|
_defineProperty(this, "rotationGestureListener", {
|
20
16
|
onRotationBegin: _detector => true,
|
21
17
|
onRotation: detector => {
|
22
18
|
const previousRotation = this.rotation;
|
23
|
-
this.rotation += detector.
|
24
|
-
const delta = detector.
|
25
|
-
|
19
|
+
this.rotation += detector.rotation;
|
20
|
+
const delta = detector.timeDelta;
|
26
21
|
if (delta > 0) {
|
27
22
|
this.velocity = (this.rotation - previousRotation) / delta;
|
28
23
|
}
|
29
|
-
|
30
|
-
if (Math.abs(this.rotation) >= ROTATION_RECOGNITION_THRESHOLD && this.currentState === State.BEGAN) {
|
24
|
+
if (Math.abs(this.rotation) >= ROTATION_RECOGNITION_THRESHOLD && this.state === State.BEGAN) {
|
31
25
|
this.activate();
|
32
26
|
}
|
33
|
-
|
34
27
|
return true;
|
35
28
|
},
|
36
29
|
onRotationEnd: _detector => {
|
37
30
|
this.end();
|
38
31
|
}
|
39
32
|
});
|
40
|
-
|
41
33
|
_defineProperty(this, "rotationGestureDetector", new RotationGestureDetector(this.rotationGestureListener));
|
42
34
|
}
|
43
|
-
|
44
35
|
init(ref, propsRef) {
|
45
36
|
super.init(ref, propsRef);
|
46
|
-
this.
|
37
|
+
this.shouldCancelWhenOutside = false;
|
47
38
|
}
|
48
|
-
|
49
39
|
transformNativeEvent() {
|
50
40
|
return {
|
51
41
|
rotation: this.rotation ? this.rotation : 0,
|
@@ -54,105 +44,84 @@ export default class RotationGestureHandler extends GestureHandler {
|
|
54
44
|
velocity: this.velocity ? this.velocity : 0
|
55
45
|
};
|
56
46
|
}
|
57
|
-
|
58
47
|
getAnchorX() {
|
59
|
-
const anchorX = this.rotationGestureDetector.
|
48
|
+
const anchorX = this.rotationGestureDetector.anchorX;
|
60
49
|
return anchorX ? anchorX : this.cachedAnchorX;
|
61
50
|
}
|
62
|
-
|
63
51
|
getAnchorY() {
|
64
|
-
const anchorY = this.rotationGestureDetector.
|
52
|
+
const anchorY = this.rotationGestureDetector.anchorY;
|
65
53
|
return anchorY ? anchorY : this.cachedAnchorY;
|
66
54
|
}
|
67
|
-
|
68
55
|
onPointerDown(event) {
|
69
56
|
this.tracker.addToTracker(event);
|
70
57
|
super.onPointerDown(event);
|
71
58
|
this.tryToSendTouchEvent(event);
|
72
59
|
}
|
73
|
-
|
74
60
|
onPointerAdd(event) {
|
75
61
|
this.tracker.addToTracker(event);
|
76
62
|
super.onPointerAdd(event);
|
77
63
|
this.tryBegin();
|
78
64
|
this.rotationGestureDetector.onTouchEvent(event, this.tracker);
|
79
65
|
}
|
80
|
-
|
81
66
|
onPointerMove(event) {
|
82
|
-
if (this.tracker.
|
67
|
+
if (this.tracker.trackedPointersCount < 2) {
|
83
68
|
return;
|
84
69
|
}
|
85
|
-
|
86
70
|
if (this.getAnchorX()) {
|
87
71
|
this.cachedAnchorX = this.getAnchorX();
|
88
72
|
}
|
89
|
-
|
90
73
|
if (this.getAnchorY()) {
|
91
74
|
this.cachedAnchorY = this.getAnchorY();
|
92
75
|
}
|
93
|
-
|
94
76
|
this.tracker.track(event);
|
95
77
|
this.rotationGestureDetector.onTouchEvent(event, this.tracker);
|
96
78
|
super.onPointerMove(event);
|
97
79
|
}
|
98
|
-
|
99
80
|
onPointerOutOfBounds(event) {
|
100
|
-
if (this.tracker.
|
81
|
+
if (this.tracker.trackedPointersCount < 2) {
|
101
82
|
return;
|
102
83
|
}
|
103
|
-
|
104
84
|
if (this.getAnchorX()) {
|
105
85
|
this.cachedAnchorX = this.getAnchorX();
|
106
86
|
}
|
107
|
-
|
108
87
|
if (this.getAnchorY()) {
|
109
88
|
this.cachedAnchorY = this.getAnchorY();
|
110
89
|
}
|
111
|
-
|
112
90
|
this.tracker.track(event);
|
113
91
|
this.rotationGestureDetector.onTouchEvent(event, this.tracker);
|
114
92
|
super.onPointerOutOfBounds(event);
|
115
93
|
}
|
116
|
-
|
117
94
|
onPointerUp(event) {
|
118
95
|
super.onPointerUp(event);
|
119
96
|
this.tracker.removeFromTracker(event.pointerId);
|
120
97
|
this.rotationGestureDetector.onTouchEvent(event, this.tracker);
|
121
|
-
|
122
|
-
if (this.currentState !== State.ACTIVE) {
|
98
|
+
if (this.state !== State.ACTIVE) {
|
123
99
|
return;
|
124
100
|
}
|
125
|
-
|
126
|
-
if (this.currentState === State.ACTIVE) {
|
101
|
+
if (this.state === State.ACTIVE) {
|
127
102
|
this.end();
|
128
103
|
} else {
|
129
104
|
this.fail();
|
130
105
|
}
|
131
106
|
}
|
132
|
-
|
133
107
|
onPointerRemove(event) {
|
134
108
|
super.onPointerRemove(event);
|
135
109
|
this.rotationGestureDetector.onTouchEvent(event, this.tracker);
|
136
110
|
this.tracker.removeFromTracker(event.pointerId);
|
137
111
|
}
|
138
|
-
|
139
112
|
tryBegin() {
|
140
|
-
if (this.
|
113
|
+
if (this.state !== State.UNDETERMINED) {
|
141
114
|
return;
|
142
115
|
}
|
143
|
-
|
144
116
|
this.begin();
|
145
117
|
}
|
146
|
-
|
147
118
|
onReset() {
|
148
|
-
if (this.
|
119
|
+
if (this.state === State.ACTIVE) {
|
149
120
|
return;
|
150
121
|
}
|
151
|
-
|
152
122
|
this.rotation = 0;
|
153
123
|
this.velocity = 0;
|
154
124
|
this.rotationGestureDetector.reset();
|
155
125
|
}
|
156
|
-
|
157
126
|
}
|
158
127
|
//# sourceMappingURL=RotationGestureHandler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["State","GestureHandler","RotationGestureDetector","ROTATION_RECOGNITION_THRESHOLD","Math","PI","RotationGestureHandler","constructor","args","_defineProperty","onRotationBegin","_detector","onRotation","detector","previousRotation","rotation","delta","timeDelta","velocity","abs","state","BEGAN","activate","onRotationEnd","end","rotationGestureListener","init","ref","propsRef","shouldCancelWhenOutside","transformNativeEvent","anchorX","getAnchorX","anchorY","getAnchorY","rotationGestureDetector","cachedAnchorX","cachedAnchorY","onPointerDown","event","tracker","addToTracker","tryToSendTouchEvent","onPointerAdd","tryBegin","onTouchEvent","onPointerMove","trackedPointersCount","track","onPointerOutOfBounds","onPointerUp","removeFromTracker","pointerId","ACTIVE","fail","onPointerRemove","UNDETERMINED","begin","onReset","reset"],"sources":["RotationGestureHandler.ts"],"sourcesContent":["import { State } from '../../State';\nimport { AdaptedEvent } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\nimport RotationGestureDetector, {\n RotationGestureListener,\n} from '../detectors/RotationGestureDetector';\n\nconst ROTATION_RECOGNITION_THRESHOLD = Math.PI / 36;\n\nexport default class RotationGestureHandler extends GestureHandler {\n private rotation = 0;\n private velocity = 0;\n\n private cachedAnchorX = 0;\n private cachedAnchorY = 0;\n\n private rotationGestureListener: RotationGestureListener = {\n onRotationBegin: (_detector: RotationGestureDetector): boolean => true,\n onRotation: (detector: RotationGestureDetector): boolean => {\n const previousRotation: number = this.rotation;\n this.rotation += detector.rotation;\n\n const delta = detector.timeDelta;\n\n if (delta > 0) {\n this.velocity = (this.rotation - previousRotation) / delta;\n }\n\n if (\n Math.abs(this.rotation) >= ROTATION_RECOGNITION_THRESHOLD &&\n this.state === State.BEGAN\n ) {\n this.activate();\n }\n\n return true;\n },\n onRotationEnd: (_detector: RotationGestureDetector): void => {\n this.end();\n },\n };\n\n private rotationGestureDetector: RotationGestureDetector =\n new RotationGestureDetector(this.rotationGestureListener);\n\n public init(ref: number, propsRef: React.RefObject<unknown>): void {\n super.init(ref, propsRef);\n\n this.shouldCancelWhenOutside = false;\n }\n\n protected transformNativeEvent() {\n return {\n rotation: this.rotation ? this.rotation : 0,\n anchorX: this.getAnchorX(),\n anchorY: this.getAnchorY(),\n velocity: this.velocity ? this.velocity : 0,\n };\n }\n\n public getAnchorX(): number {\n const anchorX = this.rotationGestureDetector.anchorX;\n\n return anchorX ? anchorX : this.cachedAnchorX;\n }\n\n public getAnchorY(): number {\n const anchorY = this.rotationGestureDetector.anchorY;\n\n return anchorY ? anchorY : this.cachedAnchorY;\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerDown(event);\n\n this.tryToSendTouchEvent(event);\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n\n this.tryBegin();\n this.rotationGestureDetector.onTouchEvent(event, this.tracker);\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n if (this.tracker.trackedPointersCount < 2) {\n return;\n }\n\n if (this.getAnchorX()) {\n this.cachedAnchorX = this.getAnchorX();\n }\n if (this.getAnchorY()) {\n this.cachedAnchorY = this.getAnchorY();\n }\n\n this.tracker.track(event);\n\n this.rotationGestureDetector.onTouchEvent(event, this.tracker);\n\n super.onPointerMove(event);\n }\n\n protected onPointerOutOfBounds(event: AdaptedEvent): void {\n if (this.tracker.trackedPointersCount < 2) {\n return;\n }\n\n if (this.getAnchorX()) {\n this.cachedAnchorX = this.getAnchorX();\n }\n if (this.getAnchorY()) {\n this.cachedAnchorY = this.getAnchorY();\n }\n\n this.tracker.track(event);\n\n this.rotationGestureDetector.onTouchEvent(event, this.tracker);\n\n super.onPointerOutOfBounds(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.tracker.removeFromTracker(event.pointerId);\n this.rotationGestureDetector.onTouchEvent(event, this.tracker);\n\n if (this.state !== State.ACTIVE) {\n return;\n }\n\n if (this.state === State.ACTIVE) {\n this.end();\n } else {\n this.fail();\n }\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.rotationGestureDetector.onTouchEvent(event, this.tracker);\n this.tracker.removeFromTracker(event.pointerId);\n }\n\n protected tryBegin(): void {\n if (this.state !== State.UNDETERMINED) {\n return;\n }\n\n this.begin();\n }\n\n protected onReset(): void {\n if (this.state === State.ACTIVE) {\n return;\n }\n\n this.rotation = 0;\n this.velocity = 0;\n this.rotationGestureDetector.reset();\n }\n}\n"],"mappings":";;;AAAA,SAASA,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