react-native-gesture-handler 2.23.0 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNGestureHandler.podspec +8 -0
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +8 -11
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +10 -2
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +6 -1
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +3 -1
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +5 -3
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +6 -2
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +3 -1
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +2 -1
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +3 -4
- 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 +115 -90
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +81 -28
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +37 -26
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +27 -13
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +6 -2
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +77 -29
- 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 +3 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +20 -5
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +76 -38
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +75 -34
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +23 -9
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
- 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 +34 -19
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
- 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 +25 -16
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +13 -9
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +12 -7
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +4 -1
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +14 -5
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +6 -1
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +14 -13
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +2 -1
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +134 -50
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +27 -17
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
- 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 +14 -5
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +20 -10
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
- 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 +24 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +84 -44
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +21 -6
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +26 -6
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +104 -75
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +11 -4
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +5 -4
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +83 -19
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +15 -5
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +12 -3
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +28 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +23 -5
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +4 -2
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
- 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 +47 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +17 -9
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +41 -7
- 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 +78 -11
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +22 -5
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +14 -7
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +45 -9
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +18 -3
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +55 -26
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +3 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +16 -9
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +26 -13
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +14 -4
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +1 -3
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +3 -9
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +5 -2
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +1 -0
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +1 -0
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +4 -3
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +0 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +20 -10
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +17 -18
- 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 +1 -4
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +1 -3
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +99 -80
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +55 -19
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +12 -17
- 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 +2 -1
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +2 -1
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +2 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +2 -1
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +59 -26
- 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 +14 -4
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +56 -34
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +30 -14
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +59 -28
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +10 -6
- 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 +63 -34
- 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 +24 -15
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
- 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 +16 -10
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +3 -6
- 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 +11 -5
- 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 +0 -6
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -6
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +19 -8
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -2
- 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 +0 -2
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -6
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +106 -47
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +17 -12
- 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 +4 -9
- 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 +4 -3
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +6 -5
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
- 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 +14 -11
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
- 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 +6 -2
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +38 -14
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +9 -5
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +73 -44
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +24 -16
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +14 -1
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +18 -9
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +11 -6
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +4 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +9 -5
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +41 -18
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +7 -2
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +7 -2
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +19 -10
- 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 +5 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +13 -4
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +2 -3
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +66 -20
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +7 -3
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +10 -3
- 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 +11 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +1 -2
- 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 +38 -5
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +181 -61
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
- 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 +40 -5
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +114 -7
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +59 -5
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +14 -9
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +13 -3
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +39 -7
- 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 +71 -10
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +19 -5
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +19 -3
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +65 -30
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +12 -7
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +35 -9
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +39 -8
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +14 -3
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +25 -8
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +10 -3
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +40 -21
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +1 -0
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +130 -53
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
- 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 +8 -6
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +40 -6
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +34 -13
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +45 -31
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +1 -2
- 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/touchables/TouchableHighlight.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/touchables/TouchableHighlight.tsx +2 -2
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +1 -1
- package/src/components/touchables/TouchableOpacity.tsx +2 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +2 -2
package/lib/module/mocks.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","View","State","Directions","NOOP","PanGestureHandler","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","install","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","enabled","rest","
|
1
|
+
{"version":3,"sources":["mocks.tsx"],"names":["React","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","View","State","Directions","NOOP","PanGestureHandler","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","install","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","enabled","rest","BaseButton","RectButton","BorderlessButton"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,EAKEC,UALF,EAMEC,QANF,EAOEC,MAPF,EAQEC,SARF,EASEC,mBATF,EAUEC,IAVF,QAWO,cAXP;AAYA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,UAAT,QAA2B,cAA3B;;AAEA,MAAMC,IAAI,GAAG,MAAM,CACjB;AACD,CAFD;;AAGA,MAAMC,iBAAiB,GAAGJ,IAA1B;AACA,MAAMK,oBAAoB,GAAGF,IAA7B;AACA,MAAMG,oBAAoB,GAAGH,IAA7B;AACA,MAAMI,kBAAkB,GAAGJ,IAA3B;AACA,MAAMK,oBAAoB,GAAGL,IAA7B;AACA,MAAMM,eAAe,GAAGN,IAAxB;AACA,MAAMO,OAAO,GAAGP,IAAhB;AACA,MAAMQ,wBAAwB,GAAGX,IAAjC;AACA,MAAMY,iBAAiB,GAAGZ,IAA1B;AACA,MAAMa,wBAAwB,GAAGb,IAAjC;AACA,MAAMc,uBAAuB,GAAGd,IAAhC;AACA,MAAMe,mBAAmB,GAAGf,IAA5B;AACA,MAAMgB,sBAAsB,GAAGhB,IAA/B;AACA,MAAMiB,mBAAmB,GAAGjB,IAA5B;;AACA,MAAMkB,SAAS,GAAG,CAAC;AAAEC,EAAAA,OAAF;AAAW,KAAGC;AAAd,CAAD,kBAChB,oBAAC,uBAAD;AAAyB,EAAA,QAAQ,EAAE,CAACD;AAApC,GAAiDC,IAAjD,gBACE,oBAAC,IAAD,OADF,CADF;;AAKA,MAAMC,UAAU,GAAGH,SAAnB;AACA,MAAMI,UAAU,GAAGJ,SAAnB;AACA,MAAMK,gBAAgB,GAAG/B,uBAAzB;AAEA,eAAe;AACbD,EAAAA,kBADa;AAEbC,EAAAA,uBAFa;AAGbC,EAAAA,gBAHa;AAIbC,EAAAA,wBAJa;AAKbC,EAAAA,UALa;AAMbC,EAAAA,QANa;AAObC,EAAAA,MAPa;AAQbC,EAAAA,SARa;AASbC,EAAAA,mBATa;AAUbY,EAAAA,wBAVa;AAWbC,EAAAA,iBAXa;AAYbC,EAAAA,wBAZa;AAabC,EAAAA,uBAba;AAcbC,EAAAA,mBAda;AAebC,EAAAA,sBAfa;AAgBbC,EAAAA,mBAhBa;AAiBbC,EAAAA,SAjBa;AAkBbG,EAAAA,UAlBa;AAmBbC,EAAAA,UAnBa;AAoBbC,EAAAA,gBApBa;AAqBbnB,EAAAA,iBArBa;AAsBbC,EAAAA,oBAtBa;AAuBbC,EAAAA,oBAvBa;AAwBbC,EAAAA,kBAxBa;AAyBbC,EAAAA,oBAzBa;AA0BbC,EAAAA,eA1Ba;AA2BbC,EAAAA,OA3Ba;AA4Bb;AACAR,EAAAA,UA7Ba;AA8BbD,EAAAA;AA9Ba,CAAf","sourcesContent":["import React from 'react';\nimport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n View,\n} from 'react-native';\nimport { State } from './State';\nimport { Directions } from './Directions';\n\nconst NOOP = () => {\n // Do nothing\n};\nconst PanGestureHandler = View;\nconst attachGestureHandler = NOOP;\nconst createGestureHandler = NOOP;\nconst dropGestureHandler = NOOP;\nconst updateGestureHandler = NOOP;\nconst flushOperations = NOOP;\nconst install = NOOP;\nconst NativeViewGestureHandler = View;\nconst TapGestureHandler = View;\nconst ForceTouchGestureHandler = View;\nconst LongPressGestureHandler = View;\nconst PinchGestureHandler = View;\nconst RotationGestureHandler = View;\nconst FlingGestureHandler = View;\nconst RawButton = ({ enabled, ...rest }: any) => (\n <TouchableNativeFeedback disabled={!enabled} {...rest}>\n <View />\n </TouchableNativeFeedback>\n);\nconst BaseButton = RawButton;\nconst RectButton = RawButton;\nconst BorderlessButton = TouchableNativeFeedback;\n\nexport default {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n NativeViewGestureHandler,\n TapGestureHandler,\n ForceTouchGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PanGestureHandler,\n attachGestureHandler,\n createGestureHandler,\n dropGestureHandler,\n updateGestureHandler,\n flushOperations,\n install,\n // Probably can be removed\n Directions,\n State,\n} as const;\n"]}
|
@@ -1,6 +1,5 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
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); }
|
1
|
+
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; }
|
2
|
+
|
4
3
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
5
4
|
export class MountRegistry {
|
6
5
|
static addMountListener(listener) {
|
@@ -9,25 +8,33 @@ export class MountRegistry {
|
|
9
8
|
this.mountListeners.delete(listener);
|
10
9
|
};
|
11
10
|
}
|
11
|
+
|
12
12
|
static addUnmountListener(listener) {
|
13
13
|
this.unmountListeners.add(listener);
|
14
14
|
return () => {
|
15
15
|
this.unmountListeners.delete(listener);
|
16
16
|
};
|
17
17
|
}
|
18
|
+
|
18
19
|
static gestureHandlerWillMount(handler) {
|
19
20
|
this.mountListeners.forEach(listener => listener(handler));
|
20
21
|
}
|
22
|
+
|
21
23
|
static gestureHandlerWillUnmount(handler) {
|
22
24
|
this.unmountListeners.forEach(listener => listener(handler));
|
23
25
|
}
|
26
|
+
|
24
27
|
static gestureWillMount(gesture) {
|
25
28
|
this.mountListeners.forEach(listener => listener(gesture));
|
26
29
|
}
|
30
|
+
|
27
31
|
static gestureWillUnmount(gesture) {
|
28
32
|
this.unmountListeners.forEach(listener => listener(gesture));
|
29
33
|
}
|
34
|
+
|
30
35
|
}
|
36
|
+
|
31
37
|
_defineProperty(MountRegistry, "mountListeners", new Set());
|
38
|
+
|
32
39
|
_defineProperty(MountRegistry, "unmountListeners", new Set());
|
33
40
|
//# sourceMappingURL=mountRegistry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MountRegistry","addMountListener","listener","mountListeners","add","delete","addUnmountListener","unmountListeners","gestureHandlerWillMount","handler","forEach","gestureHandlerWillUnmount","gestureWillMount","gesture","gestureWillUnmount","
|
1
|
+
{"version":3,"sources":["mountRegistry.ts"],"names":["MountRegistry","addMountListener","listener","mountListeners","add","delete","addUnmountListener","unmountListeners","gestureHandlerWillMount","handler","forEach","gestureHandlerWillUnmount","gestureWillMount","gesture","gestureWillUnmount","Set"],"mappings":";;AAUA;AACA,OAAO,MAAMA,aAAN,CAAoB;AAIF,SAAhBC,gBAAgB,CAACC,QAAD,EAA6C;AAClE,SAAKC,cAAL,CAAoBC,GAApB,CAAwBF,QAAxB;AAEA,WAAO,MAAM;AACX,WAAKC,cAAL,CAAoBE,MAApB,CAA2BH,QAA3B;AACD,KAFD;AAGD;;AAEwB,SAAlBI,kBAAkB,CAACJ,QAAD,EAA6C;AACpE,SAAKK,gBAAL,CAAsBH,GAAtB,CAA0BF,QAA1B;AAEA,WAAO,MAAM;AACX,WAAKK,gBAAL,CAAsBF,MAAtB,CAA6BH,QAA7B;AACD,KAFD;AAGD;;AAE6B,SAAvBM,uBAAuB,CAACC,OAAD,EAA2B;AACvD,SAAKN,cAAL,CAAoBO,OAApB,CAA6BR,QAAD,IAC1BA,QAAQ,CAACO,OAAD,CADV;AAGD;;AAE+B,SAAzBE,yBAAyB,CAACF,OAAD,EAA2B;AACzD,SAAKF,gBAAL,CAAsBG,OAAtB,CAA+BR,QAAD,IAC5BA,QAAQ,CAACO,OAAD,CADV;AAGD;;AAEsB,SAAhBG,gBAAgB,CAACC,OAAD,EAAuB;AAC5C,SAAKV,cAAL,CAAoBO,OAApB,CAA6BR,QAAD,IAAcA,QAAQ,CAACW,OAAD,CAAlD;AACD;;AAEwB,SAAlBC,kBAAkB,CAACD,OAAD,EAAuB;AAC9C,SAAKN,gBAAL,CAAsBG,OAAtB,CAA+BR,QAAD,IAAcA,QAAQ,CAACW,OAAD,CAApD;AACD;;AAtCwB;;gBAAdb,a,oBACqB,IAAIe,GAAJ,E;;gBADrBf,a,sBAEuB,IAAIe,GAAJ,E","sourcesContent":["import { GestureType } from './handlers/gestures/gesture';\n\ninterface ReactComponentWithHandlerTag extends React.Component {\n handlerTag: number;\n}\n\nexport type GestureMountListener = (\n gesture: GestureType | ReactComponentWithHandlerTag\n) => void;\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class MountRegistry {\n private static mountListeners = new Set<GestureMountListener>();\n private static unmountListeners = new Set<GestureMountListener>();\n\n static addMountListener(listener: GestureMountListener): () => void {\n this.mountListeners.add(listener);\n\n return () => {\n this.mountListeners.delete(listener);\n };\n }\n\n static addUnmountListener(listener: GestureMountListener): () => void {\n this.unmountListeners.add(listener);\n\n return () => {\n this.unmountListeners.delete(listener);\n };\n }\n\n static gestureHandlerWillMount(handler: React.Component) {\n this.mountListeners.forEach((listener) =>\n listener(handler as ReactComponentWithHandlerTag)\n );\n }\n\n static gestureHandlerWillUnmount(handler: React.Component) {\n this.unmountListeners.forEach((listener) =>\n listener(handler as ReactComponentWithHandlerTag)\n );\n }\n\n static gestureWillMount(gesture: GestureType) {\n this.mountListeners.forEach((listener) => listener(gesture));\n }\n\n static gestureWillUnmount(gesture: GestureType) {\n this.unmountListeners.forEach((listener) => listener(gesture));\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"
|
1
|
+
{"version":3,"sources":["NativeRNGestureHandlerModule.ts"],"names":["TurboModuleRegistry","getEnforcing"],"mappings":"AAAA,SAASA,mBAAT,QAAiD,cAAjD;AAyBA,eAAeA,mBAAmB,CAACC,YAApB,CAAuC,wBAAvC,CAAf","sourcesContent":["import { TurboModuleRegistry, TurboModule } from 'react-native';\nimport { Double } from 'react-native/Libraries/Types/CodegenTypes';\n\nexport interface Spec extends TurboModule {\n handleSetJSResponder: (tag: Double, blockNativeResponder: boolean) => void;\n handleClearJSResponder: () => void;\n createGestureHandler: (\n handlerName: string,\n handlerTag: Double,\n // Record<> is not supported by codegen\n // eslint-disable-next-line @typescript-eslint/ban-types\n config: Object\n ) => void;\n attachGestureHandler: (\n handlerTag: Double,\n newView: Double,\n actionType: Double\n ) => void;\n // eslint-disable-next-line @typescript-eslint/ban-types\n updateGestureHandler: (handlerTag: Double, newConfig: Object) => void;\n dropGestureHandler: (handlerTag: Double) => void;\n install: () => boolean;\n flushOperations: () => void;\n}\n\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNGestureHandlerModule');\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["RNGestureHandlerButtonNativeComponent.ts"],"names":["codegenNativeComponent"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAqBA,eAAeA,sBAAsB,CAAc,wBAAd,CAArC","sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type {\n Int32,\n WithDefault,\n Float,\n} from 'react-native/Libraries/Types/CodegenTypes';\nimport type { ViewProps, ColorValue } from 'react-native';\n\ninterface NativeProps extends ViewProps {\n exclusive?: WithDefault<boolean, true>;\n foreground?: boolean;\n borderless?: boolean;\n enabled?: WithDefault<boolean, true>;\n rippleColor?: ColorValue;\n rippleRadius?: Int32;\n touchSoundDisabled?: WithDefault<boolean, false>;\n borderWidth?: Float;\n borderColor?: ColorValue;\n borderStyle?: WithDefault<string, 'solid'>;\n}\n\nexport default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["RNGestureHandlerRootViewNativeComponent.ts"],"names":["codegenNativeComponent"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAKA,eAAeA,sBAAsB,CAAc,0BAAd,CAArC","sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps } from 'react-native';\n\ninterface NativeProps extends ViewProps {}\n\nexport default codegenNativeComponent<NativeProps>('RNGestureHandlerRootView');\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
package/lib/module/utils.js
CHANGED
@@ -2,6 +2,7 @@ export function toArray(object) {
|
|
2
2
|
if (!Array.isArray(object)) {
|
3
3
|
return [object];
|
4
4
|
}
|
5
|
+
|
5
6
|
return object;
|
6
7
|
}
|
7
8
|
export function withPrevAndCurrent(array, mapFn) {
|
@@ -18,9 +19,8 @@ export function withPrevAndCurrent(array, mapFn) {
|
|
18
19
|
transformedArr.push(transformed);
|
19
20
|
});
|
20
21
|
return transformedArr;
|
21
|
-
}
|
22
|
+
} // eslint-disable-next-line @typescript-eslint/ban-types
|
22
23
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
24
24
|
export function hasProperty(object, key) {
|
25
25
|
return Object.prototype.hasOwnProperty.call(object, key);
|
26
26
|
}
|
@@ -30,12 +30,12 @@ export function isTestEnv() {
|
|
30
30
|
}
|
31
31
|
export function tagMessage(msg) {
|
32
32
|
return `[react-native-gesture-handler] ${msg}`;
|
33
|
-
}
|
34
|
-
|
35
|
-
// Helper method to check whether Fabric is enabled, however global.nativeFabricUIManager
|
33
|
+
} // Helper method to check whether Fabric is enabled, however global.nativeFabricUIManager
|
36
34
|
// may not be initialized before the first render
|
35
|
+
|
37
36
|
export function isFabric() {
|
38
37
|
var _global;
|
38
|
+
|
39
39
|
// @ts-expect-error nativeFabricUIManager is not yet included in the RN types
|
40
40
|
return !!((_global = global) !== null && _global !== void 0 && _global.nativeFabricUIManager);
|
41
41
|
}
|
@@ -45,7 +45,6 @@ export function isRemoteDebuggingEnabled() {
|
|
45
45
|
const localGlobal = global;
|
46
46
|
return (!localGlobal.nativeCallSyncHook || !!localGlobal.__REMOTEDEV__) && !localGlobal.RN$Bridgeless;
|
47
47
|
}
|
48
|
-
|
49
48
|
/**
|
50
49
|
* Recursively compares two objects for deep equality.
|
51
50
|
*
|
@@ -55,23 +54,29 @@ export function isRemoteDebuggingEnabled() {
|
|
55
54
|
* @param obj2 - The second object to compare.
|
56
55
|
* @returns `true` if the objects are deeply equal, `false` otherwise.
|
57
56
|
*/
|
57
|
+
|
58
58
|
export function deepEqual(obj1, obj2) {
|
59
59
|
if (obj1 === obj2) {
|
60
60
|
return true;
|
61
61
|
}
|
62
|
+
|
62
63
|
if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) {
|
63
64
|
return false;
|
64
65
|
}
|
66
|
+
|
65
67
|
const keys1 = Object.keys(obj1);
|
66
68
|
const keys2 = Object.keys(obj2);
|
69
|
+
|
67
70
|
if (keys1.length !== keys2.length) {
|
68
71
|
return false;
|
69
72
|
}
|
73
|
+
|
70
74
|
for (const key of keys1) {
|
71
75
|
if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) {
|
72
76
|
return false;
|
73
77
|
}
|
74
78
|
}
|
79
|
+
|
75
80
|
return true;
|
76
81
|
}
|
77
82
|
export const INT32_MAX = 2 ** 31 - 1;
|
package/lib/module/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["toArray","object","Array","isArray","withPrevAndCurrent","array","mapFn","previousArr","currentArr","transformedArr","forEach","current","i","previous","transformed","push","hasProperty","key","Object","prototype","hasOwnProperty","call","isTestEnv","global","process","env","NODE_ENV","tagMessage","msg","isFabric","
|
1
|
+
{"version":3,"sources":["utils.ts"],"names":["toArray","object","Array","isArray","withPrevAndCurrent","array","mapFn","previousArr","currentArr","transformedArr","forEach","current","i","previous","transformed","push","hasProperty","key","Object","prototype","hasOwnProperty","call","isTestEnv","global","process","env","NODE_ENV","tagMessage","msg","isFabric","nativeFabricUIManager","isRemoteDebuggingEnabled","localGlobal","nativeCallSyncHook","__REMOTEDEV__","RN$Bridgeless","deepEqual","obj1","obj2","keys1","keys","keys2","length","includes","INT32_MAX"],"mappings":"AAAA,OAAO,SAASA,OAAT,CAAoBC,MAApB,EAA0C;AAC/C,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,MAAd,CAAL,EAA4B;AAC1B,WAAO,CAACA,MAAD,CAAP;AACD;;AAED,SAAOA,MAAP;AACD;AAMD,OAAO,SAASG,kBAAT,CACLC,KADK,EAELC,KAFK,EAGU;AACf,QAAMC,WAAmC,GAAG,CAAC,IAAD,CAA5C;AACA,QAAMC,UAAU,GAAG,CAAC,GAAGH,KAAJ,CAAnB;AACA,QAAMI,cAA6B,GAAG,EAAtC;AACAD,EAAAA,UAAU,CAACE,OAAX,CAAmB,CAACC,OAAD,EAAUC,CAAV,KAAgB;AACjC;AACA;AACA;AACA,UAAMC,QAAQ,GAAGN,WAAW,CAACK,CAAD,CAA5B;AACA,UAAME,WAAW,GAAGR,KAAK,CAACO,QAAD,EAAWF,OAAX,CAAzB;AACAJ,IAAAA,WAAW,CAACQ,IAAZ,CAAiBD,WAAjB;AACAL,IAAAA,cAAc,CAACM,IAAf,CAAoBD,WAApB;AACD,GARD;AASA,SAAOL,cAAP;AACD,C,CAED;;AACA,OAAO,SAASO,WAAT,CAAqBf,MAArB,EAAqCgB,GAArC,EAAkD;AACvD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCpB,MAArC,EAA6CgB,GAA7C,CAAP;AACD;AAED,OAAO,SAASK,SAAT,GAA8B;AACnC;AACA,SAAON,WAAW,CAACO,MAAD,EAAS,SAAT,CAAX,IAAkCC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,MAAlE;AACD;AAED,OAAO,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,SAAQ,kCAAiCA,GAAI,EAA7C;AACD,C,CAED;AACA;;AACA,OAAO,SAASC,QAAT,GAA6B;AAAA;;AAClC;AACA,SAAO,CAAC,aAACN,MAAD,oCAAC,QAAQO,qBAAT,CAAR;AACD;AAED,OAAO,SAASC,wBAAT,GAA6C;AAClD;AACA;AACA,QAAMC,WAAW,GAAGT,MAApB;AACA,SACE,CAAC,CAACS,WAAW,CAACC,kBAAb,IAAmC,CAAC,CAACD,WAAW,CAACE,aAAlD,KACA,CAACF,WAAW,CAACG,aAFf;AAID;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,SAAT,CAAmBC,IAAnB,EAA8BC,IAA9B,EAAyC;AAC9C,MAAID,IAAI,KAAKC,IAAb,EAAmB;AACjB,WAAO,IAAP;AACD;;AAED,MACE,OAAOD,IAAP,KAAgB,QAAhB,IACA,OAAOC,IAAP,KAAgB,QADhB,IAEAD,IAAI,KAAK,IAFT,IAGAC,IAAI,KAAK,IAJX,EAKE;AACA,WAAO,KAAP;AACD;;AAED,QAAMC,KAAK,GAAGrB,MAAM,CAACsB,IAAP,CAAYH,IAAZ,CAAd;AACA,QAAMI,KAAK,GAAGvB,MAAM,CAACsB,IAAP,CAAYF,IAAZ,CAAd;;AAEA,MAAIC,KAAK,CAACG,MAAN,KAAiBD,KAAK,CAACC,MAA3B,EAAmC;AACjC,WAAO,KAAP;AACD;;AAED,OAAK,MAAMzB,GAAX,IAAkBsB,KAAlB,EAAyB;AACvB,QAAI,CAACE,KAAK,CAACE,QAAN,CAAe1B,GAAf,CAAD,IAAwB,CAACmB,SAAS,CAACC,IAAI,CAACpB,GAAD,CAAL,EAAYqB,IAAI,CAACrB,GAAD,CAAhB,CAAtC,EAA8D;AAC5D,aAAO,KAAP;AACD;AACF;;AAED,SAAO,IAAP;AACD;AAED,OAAO,MAAM2B,SAAS,GAAG,KAAK,EAAL,GAAU,CAA5B","sourcesContent":["export function toArray<T>(object: T | T[]): T[] {\n if (!Array.isArray(object)) {\n return [object];\n }\n\n return object;\n}\n\nexport type withPrevAndCurrentMapFn<T, Transformed> = (\n previous: Transformed | null,\n current: T\n) => Transformed;\nexport function withPrevAndCurrent<T, Transformed>(\n array: T[],\n mapFn: withPrevAndCurrentMapFn<T, Transformed>\n): Transformed[] {\n const previousArr: (null | Transformed)[] = [null];\n const currentArr = [...array];\n const transformedArr: Transformed[] = [];\n currentArr.forEach((current, i) => {\n // This type cast is fine and solves problem mentioned in https://github.com/software-mansion/react-native-gesture-handler/pull/2867 (namely that `previous` can be undefined).\n // Unfortunately, linter on our CI does not allow this type of casting as it is unnecessary. To bypass that we use eslint-disable.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const previous = previousArr[i] as Transformed | null;\n const transformed = mapFn(previous, current);\n previousArr.push(transformed);\n transformedArr.push(transformed);\n });\n return transformedArr;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function hasProperty(object: object, key: string) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nexport function isTestEnv(): boolean {\n // @ts-ignore Do not use `@types/node` because it will prioritise Node types over RN types which breaks the types (ex. setTimeout) in React Native projects.\n return hasProperty(global, 'process') && process.env.NODE_ENV === 'test';\n}\n\nexport function tagMessage(msg: string) {\n return `[react-native-gesture-handler] ${msg}`;\n}\n\n// Helper method to check whether Fabric is enabled, however global.nativeFabricUIManager\n// may not be initialized before the first render\nexport function isFabric(): boolean {\n // @ts-expect-error nativeFabricUIManager is not yet included in the RN types\n return !!global?.nativeFabricUIManager;\n}\n\nexport function isRemoteDebuggingEnabled(): boolean {\n // react-native-reanimated checks if in remote debugging in the same way\n // @ts-ignore global is available but node types are not included\n const localGlobal = global as any;\n return (\n (!localGlobal.nativeCallSyncHook || !!localGlobal.__REMOTEDEV__) &&\n !localGlobal.RN$Bridgeless\n );\n}\n\n/**\n * Recursively compares two objects for deep equality.\n *\n * **Note:** This function does not support cyclic references.\n *\n * @param obj1 - The first object to compare.\n * @param obj2 - The second object to compare.\n * @returns `true` if the objects are deeply equal, `false` otherwise.\n */\nexport function deepEqual(obj1: any, obj2: any) {\n if (obj1 === obj2) {\n return true;\n }\n\n if (\n typeof obj1 !== 'object' ||\n typeof obj2 !== 'object' ||\n obj1 === null ||\n obj2 === null\n ) {\n return false;\n }\n\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) {\n return false;\n }\n }\n\n return true;\n}\n\nexport const INT32_MAX = 2 ** 31 - 1;\n"]}
|
@@ -7,9 +7,8 @@ import RotationGestureHandler from './handlers/RotationGestureHandler';
|
|
7
7
|
import FlingGestureHandler from './handlers/FlingGestureHandler';
|
8
8
|
import NativeViewGestureHandler from './handlers/NativeViewGestureHandler';
|
9
9
|
import ManualGestureHandler from './handlers/ManualGestureHandler';
|
10
|
-
import HoverGestureHandler from './handlers/HoverGestureHandler';
|
10
|
+
import HoverGestureHandler from './handlers/HoverGestureHandler'; // Hammer Handlers
|
11
11
|
|
12
|
-
// Hammer Handlers
|
13
12
|
import HammerNativeViewGestureHandler from '../web_hammer/NativeViewGestureHandler';
|
14
13
|
import HammerPanGestureHandler from '../web_hammer/PanGestureHandler';
|
15
14
|
import HammerTapGestureHandler from '../web_hammer/TapGestureHandler';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","ManualGestureHandler","HoverGestureHandler","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","Gestures","HammerGestures"],"
|
1
|
+
{"version":3,"sources":["Gestures.ts"],"names":["PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","ManualGestureHandler","HoverGestureHandler","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","Gestures","HammerGestures"],"mappings":"AAAA;AACA,OAAOA,iBAAP,MAA8B,8BAA9B;AACA,OAAOC,iBAAP,MAA8B,8BAA9B;AACA,OAAOC,uBAAP,MAAoC,oCAApC;AACA,OAAOC,mBAAP,MAAgC,gCAAhC;AACA,OAAOC,sBAAP,MAAmC,mCAAnC;AACA,OAAOC,mBAAP,MAAgC,gCAAhC;AACA,OAAOC,wBAAP,MAAqC,qCAArC;AACA,OAAOC,oBAAP,MAAiC,iCAAjC;AACA,OAAOC,mBAAP,MAAgC,gCAAhC,C,CAEA;;AACA,OAAOC,8BAAP,MAA2C,wCAA3C;AACA,OAAOC,uBAAP,MAAoC,iCAApC;AACA,OAAOC,uBAAP,MAAoC,iCAApC;AACA,OAAOC,6BAAP,MAA0C,uCAA1C;AACA,OAAOC,yBAAP,MAAsC,mCAAtC;AACA,OAAOC,4BAAP,MAAyC,sCAAzC;AACA,OAAOC,yBAAP,MAAsC,mCAAtC;AAEA,OAAO,MAAMC,QAAQ,GAAG;AACtBV,EAAAA,wBADsB;AAEtBN,EAAAA,iBAFsB;AAGtBC,EAAAA,iBAHsB;AAItBC,EAAAA,uBAJsB;AAKtBC,EAAAA,mBALsB;AAMtBC,EAAAA,sBANsB;AAOtBC,EAAAA,mBAPsB;AAQtBE,EAAAA,oBARsB;AAStBC,EAAAA;AATsB,CAAjB;AAYP,OAAO,MAAMS,cAAc,GAAG;AAC5BX,EAAAA,wBAAwB,EAAEG,8BADE;AAE5BT,EAAAA,iBAAiB,EAAEU,uBAFS;AAG5BT,EAAAA,iBAAiB,EAAEU,uBAHS;AAI5BT,EAAAA,uBAAuB,EAAEU,6BAJG;AAK5BT,EAAAA,mBAAmB,EAAEU,yBALO;AAM5BT,EAAAA,sBAAsB,EAAEU,4BANI;AAO5BT,EAAAA,mBAAmB,EAAEU;AAPO,CAAvB","sourcesContent":["// Gesture Handlers\nimport PanGestureHandler from './handlers/PanGestureHandler';\nimport TapGestureHandler from './handlers/TapGestureHandler';\nimport LongPressGestureHandler from './handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './handlers/PinchGestureHandler';\nimport RotationGestureHandler from './handlers/RotationGestureHandler';\nimport FlingGestureHandler from './handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './handlers/ManualGestureHandler';\nimport HoverGestureHandler from './handlers/HoverGestureHandler';\n\n// Hammer Handlers\nimport HammerNativeViewGestureHandler from '../web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from '../web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from '../web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from '../web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from '../web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from '../web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from '../web_hammer/FlingGestureHandler';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n HoverGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["constants.ts"],"names":["DEFAULT_TOUCH_SLOP","MINIMAL_RECOGNIZABLE_MAGNITUDE"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,EAA3B;AACP,OAAO,MAAMC,8BAA8B,GAAG,GAAvC","sourcesContent":["export const DEFAULT_TOUCH_SLOP = 15;\nexport const MINIMAL_RECOGNIZABLE_MAGNITUDE = 0.1;\n"]}
|
@@ -1,24 +1,35 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
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); }
|
1
|
+
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; }
|
2
|
+
|
4
3
|
import { EventTypes } from '../interfaces';
|
5
4
|
export default class RotationGestureDetector {
|
6
5
|
constructor(callbacks) {
|
7
6
|
_defineProperty(this, "onRotationBegin", void 0);
|
7
|
+
|
8
8
|
_defineProperty(this, "onRotation", void 0);
|
9
|
+
|
9
10
|
_defineProperty(this, "onRotationEnd", void 0);
|
11
|
+
|
10
12
|
_defineProperty(this, "currentTime", 0);
|
13
|
+
|
11
14
|
_defineProperty(this, "previousTime", 0);
|
15
|
+
|
12
16
|
_defineProperty(this, "previousAngle", 0);
|
17
|
+
|
13
18
|
_defineProperty(this, "_rotation", 0);
|
19
|
+
|
14
20
|
_defineProperty(this, "_anchorX", 0);
|
21
|
+
|
15
22
|
_defineProperty(this, "_anchorY", 0);
|
23
|
+
|
16
24
|
_defineProperty(this, "isInProgress", false);
|
25
|
+
|
17
26
|
_defineProperty(this, "keyPointers", [NaN, NaN]);
|
27
|
+
|
18
28
|
this.onRotationBegin = callbacks.onRotationBegin;
|
19
29
|
this.onRotation = callbacks.onRotation;
|
20
30
|
this.onRotationEnd = callbacks.onRotationEnd;
|
21
31
|
}
|
32
|
+
|
22
33
|
updateCurrent(event, tracker) {
|
23
34
|
this.previousTime = this.currentTime;
|
24
35
|
this.currentTime = event.time;
|
@@ -28,48 +39,56 @@ export default class RotationGestureDetector {
|
|
28
39
|
const vectorX = secondPointerCoords.x - firstPointerCoords.x;
|
29
40
|
const vectorY = secondPointerCoords.y - firstPointerCoords.y;
|
30
41
|
this._anchorX = (firstPointerCoords.x + secondPointerCoords.x) / 2;
|
31
|
-
this._anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2;
|
42
|
+
this._anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2; // Angle diff should be positive when rotating in clockwise direction
|
32
43
|
|
33
|
-
// Angle diff should be positive when rotating in clockwise direction
|
34
44
|
const angle = -Math.atan2(vectorY, vectorX);
|
35
45
|
this._rotation = Number.isNaN(this.previousAngle) ? 0 : this.previousAngle - angle;
|
36
46
|
this.previousAngle = angle;
|
47
|
+
|
37
48
|
if (this.rotation > Math.PI) {
|
38
49
|
this._rotation -= Math.PI;
|
39
50
|
} else if (this.rotation < -Math.PI) {
|
40
51
|
this._rotation += Math.PI;
|
41
52
|
}
|
53
|
+
|
42
54
|
if (this.rotation > Math.PI / 2) {
|
43
55
|
this._rotation -= Math.PI;
|
44
56
|
} else if (this.rotation < -Math.PI / 2) {
|
45
57
|
this._rotation += Math.PI;
|
46
58
|
}
|
47
59
|
}
|
60
|
+
|
48
61
|
finish() {
|
49
62
|
if (!this.isInProgress) {
|
50
63
|
return;
|
51
64
|
}
|
65
|
+
|
52
66
|
this.isInProgress = false;
|
53
67
|
this.keyPointers = [NaN, NaN];
|
54
68
|
this.onRotationEnd(this);
|
55
69
|
}
|
70
|
+
|
56
71
|
setKeyPointers(tracker) {
|
57
72
|
if (this.keyPointers[0] && this.keyPointers[1]) {
|
58
73
|
return;
|
59
74
|
}
|
75
|
+
|
60
76
|
const pointerIDs = tracker.trackedPointers.keys();
|
61
77
|
this.keyPointers[0] = pointerIDs.next().value;
|
62
78
|
this.keyPointers[1] = pointerIDs.next().value;
|
63
79
|
}
|
80
|
+
|
64
81
|
onTouchEvent(event, tracker) {
|
65
82
|
switch (event.eventType) {
|
66
83
|
case EventTypes.DOWN:
|
67
84
|
this.isInProgress = false;
|
68
85
|
break;
|
86
|
+
|
69
87
|
case EventTypes.ADDITIONAL_POINTER_DOWN:
|
70
88
|
if (this.isInProgress) {
|
71
89
|
break;
|
72
90
|
}
|
91
|
+
|
73
92
|
this.isInProgress = true;
|
74
93
|
this.previousTime = event.time;
|
75
94
|
this.previousAngle = NaN;
|
@@ -77,44 +96,58 @@ export default class RotationGestureDetector {
|
|
77
96
|
this.updateCurrent(event, tracker);
|
78
97
|
this.onRotationBegin(this);
|
79
98
|
break;
|
99
|
+
|
80
100
|
case EventTypes.MOVE:
|
81
101
|
if (!this.isInProgress) {
|
82
102
|
break;
|
83
103
|
}
|
104
|
+
|
84
105
|
this.updateCurrent(event, tracker);
|
85
106
|
this.onRotation(this);
|
86
107
|
break;
|
108
|
+
|
87
109
|
case EventTypes.ADDITIONAL_POINTER_UP:
|
88
110
|
if (!this.isInProgress) {
|
89
111
|
break;
|
90
112
|
}
|
113
|
+
|
91
114
|
if (this.keyPointers.indexOf(event.pointerId) >= 0) {
|
92
115
|
this.finish();
|
93
116
|
}
|
117
|
+
|
94
118
|
break;
|
119
|
+
|
95
120
|
case EventTypes.UP:
|
96
121
|
if (this.isInProgress) {
|
97
122
|
this.finish();
|
98
123
|
}
|
124
|
+
|
99
125
|
break;
|
100
126
|
}
|
127
|
+
|
101
128
|
return true;
|
102
129
|
}
|
130
|
+
|
103
131
|
reset() {
|
104
132
|
this.keyPointers = [NaN, NaN];
|
105
133
|
this.isInProgress = false;
|
106
134
|
}
|
135
|
+
|
107
136
|
get anchorX() {
|
108
137
|
return this._anchorX;
|
109
138
|
}
|
139
|
+
|
110
140
|
get anchorY() {
|
111
141
|
return this._anchorY;
|
112
142
|
}
|
143
|
+
|
113
144
|
get rotation() {
|
114
145
|
return this._rotation;
|
115
146
|
}
|
147
|
+
|
116
148
|
get timeDelta() {
|
117
149
|
return this.currentTime + this.previousTime;
|
118
150
|
}
|
151
|
+
|
119
152
|
}
|
120
153
|
//# sourceMappingURL=RotationGestureDetector.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["EventTypes","RotationGestureDetector","constructor","callbacks","
|
1
|
+
{"version":3,"sources":["RotationGestureDetector.ts"],"names":["EventTypes","RotationGestureDetector","constructor","callbacks","NaN","onRotationBegin","onRotation","onRotationEnd","updateCurrent","event","tracker","previousTime","currentTime","time","firstPointerID","secondPointerID","keyPointers","firstPointerCoords","getLastAbsoluteCoords","secondPointerCoords","vectorX","x","vectorY","y","_anchorX","_anchorY","angle","Math","atan2","_rotation","Number","isNaN","previousAngle","rotation","PI","finish","isInProgress","setKeyPointers","pointerIDs","trackedPointers","keys","next","value","onTouchEvent","eventType","DOWN","ADDITIONAL_POINTER_DOWN","MOVE","ADDITIONAL_POINTER_UP","indexOf","pointerId","UP","reset","anchorX","anchorY","timeDelta"],"mappings":";;AAAA,SAAuBA,UAAvB,QAAyC,eAAzC;AASA,eAAe,MAAMC,uBAAN,CAEf;AAkBEC,EAAAA,WAAW,CAACC,SAAD,EAAqC;AAAA;;AAAA;;AAAA;;AAAA,yCAb1B,CAa0B;;AAAA,0CAZzB,CAYyB;;AAAA,2CAVxB,CAUwB;;AAAA,uCAT5B,CAS4B;;AAAA,sCAP7B,CAO6B;;AAAA,sCAN7B,CAM6B;;AAAA,0CAJzB,KAIyB;;AAAA,yCAFhB,CAACC,GAAD,EAAMA,GAAN,CAEgB;;AAC9C,SAAKC,eAAL,GAAuBF,SAAS,CAACE,eAAjC;AACA,SAAKC,UAAL,GAAkBH,SAAS,CAACG,UAA5B;AACA,SAAKC,aAAL,GAAqBJ,SAAS,CAACI,aAA/B;AACD;;AAEOC,EAAAA,aAAa,CAACC,KAAD,EAAsBC,OAAtB,EAAqD;AACxE,SAAKC,YAAL,GAAoB,KAAKC,WAAzB;AACA,SAAKA,WAAL,GAAmBH,KAAK,CAACI,IAAzB;AAEA,UAAM,CAACC,cAAD,EAAiBC,eAAjB,IAAoC,KAAKC,WAA/C;AAEA,UAAMC,kBAAkB,GAAGP,OAAO,CAACQ,qBAAR,CAA8BJ,cAA9B,CAA3B;AACA,UAAMK,mBAAmB,GAAGT,OAAO,CAACQ,qBAAR,CAA8BH,eAA9B,CAA5B;AAEA,UAAMK,OAAe,GAAGD,mBAAmB,CAACE,CAApB,GAAwBJ,kBAAkB,CAACI,CAAnE;AACA,UAAMC,OAAe,GAAGH,mBAAmB,CAACI,CAApB,GAAwBN,kBAAkB,CAACM,CAAnE;AAEA,SAAKC,QAAL,GAAgB,CAACP,kBAAkB,CAACI,CAAnB,GAAuBF,mBAAmB,CAACE,CAA5C,IAAiD,CAAjE;AACA,SAAKI,QAAL,GAAgB,CAACR,kBAAkB,CAACM,CAAnB,GAAuBJ,mBAAmB,CAACI,CAA5C,IAAiD,CAAjE,CAbwE,CAexE;;AACA,UAAMG,KAAa,GAAG,CAACC,IAAI,CAACC,KAAL,CAAWN,OAAX,EAAoBF,OAApB,CAAvB;AAEA,SAAKS,SAAL,GAAiBC,MAAM,CAACC,KAAP,CAAa,KAAKC,aAAlB,IACb,CADa,GAEb,KAAKA,aAAL,GAAqBN,KAFzB;AAIA,SAAKM,aAAL,GAAqBN,KAArB;;AAEA,QAAI,KAAKO,QAAL,GAAgBN,IAAI,CAACO,EAAzB,EAA6B;AAC3B,WAAKL,SAAL,IAAkBF,IAAI,CAACO,EAAvB;AACD,KAFD,MAEO,IAAI,KAAKD,QAAL,GAAgB,CAACN,IAAI,CAACO,EAA1B,EAA8B;AACnC,WAAKL,SAAL,IAAkBF,IAAI,CAACO,EAAvB;AACD;;AAED,QAAI,KAAKD,QAAL,GAAgBN,IAAI,CAACO,EAAL,GAAU,CAA9B,EAAiC;AAC/B,WAAKL,SAAL,IAAkBF,IAAI,CAACO,EAAvB;AACD,KAFD,MAEO,IAAI,KAAKD,QAAL,GAAgB,CAACN,IAAI,CAACO,EAAN,GAAW,CAA/B,EAAkC;AACvC,WAAKL,SAAL,IAAkBF,IAAI,CAACO,EAAvB;AACD;AACF;;AAEOC,EAAAA,MAAM,GAAS;AACrB,QAAI,CAAC,KAAKC,YAAV,EAAwB;AACtB;AACD;;AAED,SAAKA,YAAL,GAAoB,KAApB;AACA,SAAKpB,WAAL,GAAmB,CAACZ,GAAD,EAAMA,GAAN,CAAnB;AACA,SAAKG,aAAL,CAAmB,IAAnB;AACD;;AAEO8B,EAAAA,cAAc,CAAC3B,OAAD,EAAgC;AACpD,QAAI,KAAKM,WAAL,CAAiB,CAAjB,KAAuB,KAAKA,WAAL,CAAiB,CAAjB,CAA3B,EAAgD;AAC9C;AACD;;AAED,UAAMsB,UAAoC,GAAG5B,OAAO,CAAC6B,eAAR,CAAwBC,IAAxB,EAA7C;AAEA,SAAKxB,WAAL,CAAiB,CAAjB,IAAsBsB,UAAU,CAACG,IAAX,GAAkBC,KAAxC;AACA,SAAK1B,WAAL,CAAiB,CAAjB,IAAsBsB,UAAU,CAACG,IAAX,GAAkBC,KAAxC;AACD;;AAEMC,EAAAA,YAAY,CAAClC,KAAD,EAAsBC,OAAtB,EAAwD;AACzE,YAAQD,KAAK,CAACmC,SAAd;AACE,WAAK5C,UAAU,CAAC6C,IAAhB;AACE,aAAKT,YAAL,GAAoB,KAApB;AACA;;AAEF,WAAKpC,UAAU,CAAC8C,uBAAhB;AACE,YAAI,KAAKV,YAAT,EAAuB;AACrB;AACD;;AACD,aAAKA,YAAL,GAAoB,IAApB;AAEA,aAAKzB,YAAL,GAAoBF,KAAK,CAACI,IAA1B;AACA,aAAKmB,aAAL,GAAqB5B,GAArB;AAEA,aAAKiC,cAAL,CAAoB3B,OAApB;AAEA,aAAKF,aAAL,CAAmBC,KAAnB,EAA0BC,OAA1B;AACA,aAAKL,eAAL,CAAqB,IAArB;AACA;;AAEF,WAAKL,UAAU,CAAC+C,IAAhB;AACE,YAAI,CAAC,KAAKX,YAAV,EAAwB;AACtB;AACD;;AAED,aAAK5B,aAAL,CAAmBC,KAAnB,EAA0BC,OAA1B;AACA,aAAKJ,UAAL,CAAgB,IAAhB;AAEA;;AAEF,WAAKN,UAAU,CAACgD,qBAAhB;AACE,YAAI,CAAC,KAAKZ,YAAV,EAAwB;AACtB;AACD;;AAED,YAAI,KAAKpB,WAAL,CAAiBiC,OAAjB,CAAyBxC,KAAK,CAACyC,SAA/B,KAA6C,CAAjD,EAAoD;AAClD,eAAKf,MAAL;AACD;;AAED;;AAEF,WAAKnC,UAAU,CAACmD,EAAhB;AACE,YAAI,KAAKf,YAAT,EAAuB;AACrB,eAAKD,MAAL;AACD;;AACD;AA7CJ;;AAgDA,WAAO,IAAP;AACD;;AAEMiB,EAAAA,KAAK,GAAS;AACnB,SAAKpC,WAAL,GAAmB,CAACZ,GAAD,EAAMA,GAAN,CAAnB;AACA,SAAKgC,YAAL,GAAoB,KAApB;AACD;;AAEiB,MAAPiB,OAAO,GAAG;AACnB,WAAO,KAAK7B,QAAZ;AACD;;AAEiB,MAAP8B,OAAO,GAAG;AACnB,WAAO,KAAK7B,QAAZ;AACD;;AAEkB,MAARQ,QAAQ,GAAG;AACpB,WAAO,KAAKJ,SAAZ;AACD;;AAEmB,MAAT0B,SAAS,GAAG;AACrB,WAAO,KAAK3C,WAAL,GAAmB,KAAKD,YAA/B;AACD;;AAzJH","sourcesContent":["import { AdaptedEvent, EventTypes } from '../interfaces';\nimport PointerTracker from '../tools/PointerTracker';\n\nexport interface RotationGestureListener {\n onRotationBegin: (detector: RotationGestureDetector) => boolean;\n onRotation: (detector: RotationGestureDetector) => boolean;\n onRotationEnd: (detector: RotationGestureDetector) => void;\n}\n\nexport default class RotationGestureDetector\n implements RotationGestureListener\n{\n onRotationBegin: (detector: RotationGestureDetector) => boolean;\n onRotation: (detector: RotationGestureDetector) => boolean;\n onRotationEnd: (detector: RotationGestureDetector) => void;\n\n private currentTime = 0;\n private previousTime = 0;\n\n private previousAngle = 0;\n private _rotation = 0;\n\n private _anchorX = 0;\n private _anchorY = 0;\n\n private isInProgress = false;\n\n private keyPointers: number[] = [NaN, NaN];\n\n constructor(callbacks: RotationGestureListener) {\n this.onRotationBegin = callbacks.onRotationBegin;\n this.onRotation = callbacks.onRotation;\n this.onRotationEnd = callbacks.onRotationEnd;\n }\n\n private updateCurrent(event: AdaptedEvent, tracker: PointerTracker): void {\n this.previousTime = this.currentTime;\n this.currentTime = event.time;\n\n const [firstPointerID, secondPointerID] = this.keyPointers;\n\n const firstPointerCoords = tracker.getLastAbsoluteCoords(firstPointerID);\n const secondPointerCoords = tracker.getLastAbsoluteCoords(secondPointerID);\n\n const vectorX: number = secondPointerCoords.x - firstPointerCoords.x;\n const vectorY: number = secondPointerCoords.y - firstPointerCoords.y;\n\n this._anchorX = (firstPointerCoords.x + secondPointerCoords.x) / 2;\n this._anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2;\n\n // Angle diff should be positive when rotating in clockwise direction\n const angle: number = -Math.atan2(vectorY, vectorX);\n\n this._rotation = Number.isNaN(this.previousAngle)\n ? 0\n : this.previousAngle - angle;\n\n this.previousAngle = angle;\n\n if (this.rotation > Math.PI) {\n this._rotation -= Math.PI;\n } else if (this.rotation < -Math.PI) {\n this._rotation += Math.PI;\n }\n\n if (this.rotation > Math.PI / 2) {\n this._rotation -= Math.PI;\n } else if (this.rotation < -Math.PI / 2) {\n this._rotation += Math.PI;\n }\n }\n\n private finish(): void {\n if (!this.isInProgress) {\n return;\n }\n\n this.isInProgress = false;\n this.keyPointers = [NaN, NaN];\n this.onRotationEnd(this);\n }\n\n private setKeyPointers(tracker: PointerTracker): void {\n if (this.keyPointers[0] && this.keyPointers[1]) {\n return;\n }\n\n const pointerIDs: IterableIterator<number> = tracker.trackedPointers.keys();\n\n this.keyPointers[0] = pointerIDs.next().value as number;\n this.keyPointers[1] = pointerIDs.next().value as number;\n }\n\n public onTouchEvent(event: AdaptedEvent, tracker: PointerTracker): boolean {\n switch (event.eventType) {\n case EventTypes.DOWN:\n this.isInProgress = false;\n break;\n\n case EventTypes.ADDITIONAL_POINTER_DOWN:\n if (this.isInProgress) {\n break;\n }\n this.isInProgress = true;\n\n this.previousTime = event.time;\n this.previousAngle = NaN;\n\n this.setKeyPointers(tracker);\n\n this.updateCurrent(event, tracker);\n this.onRotationBegin(this);\n break;\n\n case EventTypes.MOVE:\n if (!this.isInProgress) {\n break;\n }\n\n this.updateCurrent(event, tracker);\n this.onRotation(this);\n\n break;\n\n case EventTypes.ADDITIONAL_POINTER_UP:\n if (!this.isInProgress) {\n break;\n }\n\n if (this.keyPointers.indexOf(event.pointerId) >= 0) {\n this.finish();\n }\n\n break;\n\n case EventTypes.UP:\n if (this.isInProgress) {\n this.finish();\n }\n break;\n }\n\n return true;\n }\n\n public reset(): void {\n this.keyPointers = [NaN, NaN];\n this.isInProgress = false;\n }\n\n public get anchorX() {\n return this._anchorX;\n }\n\n public get anchorY() {\n return this._anchorY;\n }\n\n public get rotation() {\n return this._rotation;\n }\n\n public get timeDelta() {\n return this.currentTime + this.previousTime;\n }\n}\n"]}
|
@@ -1,56 +1,68 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
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); }
|
1
|
+
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; }
|
2
|
+
|
4
3
|
import { DEFAULT_TOUCH_SLOP } from '../constants';
|
5
4
|
import { EventTypes } from '../interfaces';
|
6
5
|
export default class ScaleGestureDetector {
|
7
6
|
constructor(callbacks) {
|
8
7
|
_defineProperty(this, "onScaleBegin", void 0);
|
8
|
+
|
9
9
|
_defineProperty(this, "onScale", void 0);
|
10
|
+
|
10
11
|
_defineProperty(this, "onScaleEnd", void 0);
|
12
|
+
|
11
13
|
_defineProperty(this, "_focusX", void 0);
|
14
|
+
|
12
15
|
_defineProperty(this, "_focusY", void 0);
|
16
|
+
|
13
17
|
_defineProperty(this, "_currentSpan", void 0);
|
18
|
+
|
14
19
|
_defineProperty(this, "prevSpan", void 0);
|
20
|
+
|
15
21
|
_defineProperty(this, "initialSpan", void 0);
|
22
|
+
|
16
23
|
_defineProperty(this, "currentTime", void 0);
|
24
|
+
|
17
25
|
_defineProperty(this, "prevTime", void 0);
|
26
|
+
|
18
27
|
_defineProperty(this, "inProgress", false);
|
28
|
+
|
19
29
|
_defineProperty(this, "spanSlop", void 0);
|
30
|
+
|
20
31
|
_defineProperty(this, "minSpan", void 0);
|
32
|
+
|
21
33
|
this.onScaleBegin = callbacks.onScaleBegin;
|
22
34
|
this.onScale = callbacks.onScale;
|
23
35
|
this.onScaleEnd = callbacks.onScaleEnd;
|
24
36
|
this.spanSlop = DEFAULT_TOUCH_SLOP * 2;
|
25
37
|
this.minSpan = 0;
|
26
38
|
}
|
39
|
+
|
27
40
|
onTouchEvent(event, tracker) {
|
28
41
|
this.currentTime = event.time;
|
29
42
|
const action = event.eventType;
|
30
43
|
const numOfPointers = tracker.trackedPointersCount;
|
31
44
|
const streamComplete = action === EventTypes.UP || action === EventTypes.ADDITIONAL_POINTER_UP || action === EventTypes.CANCEL;
|
45
|
+
|
32
46
|
if (action === EventTypes.DOWN || streamComplete) {
|
33
47
|
if (this.inProgress) {
|
34
48
|
this.onScaleEnd(this);
|
35
49
|
this.inProgress = false;
|
36
50
|
this.initialSpan = 0;
|
37
51
|
}
|
52
|
+
|
38
53
|
if (streamComplete) {
|
39
54
|
return true;
|
40
55
|
}
|
41
56
|
}
|
57
|
+
|
42
58
|
const configChanged = action === EventTypes.DOWN || action === EventTypes.ADDITIONAL_POINTER_UP || action === EventTypes.ADDITIONAL_POINTER_DOWN;
|
43
59
|
const pointerUp = action === EventTypes.ADDITIONAL_POINTER_UP;
|
44
|
-
const ignoredPointer = pointerUp ? event.pointerId : undefined;
|
45
|
-
|
46
|
-
// Determine focal point
|
60
|
+
const ignoredPointer = pointerUp ? event.pointerId : undefined; // Determine focal point
|
47
61
|
|
48
62
|
const div = pointerUp ? numOfPointers - 1 : numOfPointers;
|
49
63
|
const coordsSum = tracker.getAbsoluteCoordsSum();
|
50
64
|
const focusX = coordsSum.x / div;
|
51
|
-
const focusY = coordsSum.y / div;
|
52
|
-
|
53
|
-
// Determine average deviation from focal point
|
65
|
+
const focusY = coordsSum.y / div; // Determine average deviation from focal point
|
54
66
|
|
55
67
|
let devSumX = 0;
|
56
68
|
let devSumY = 0;
|
@@ -58,6 +70,7 @@ export default class ScaleGestureDetector {
|
|
58
70
|
if (key === ignoredPointer) {
|
59
71
|
return;
|
60
72
|
}
|
73
|
+
|
61
74
|
devSumX += Math.abs(value.abosoluteCoords.x - focusX);
|
62
75
|
devSumY += Math.abs(value.abosoluteCoords.y - focusY);
|
63
76
|
});
|
@@ -65,55 +78,67 @@ export default class ScaleGestureDetector {
|
|
65
78
|
const devY = devSumY / div;
|
66
79
|
const spanX = devX * 2;
|
67
80
|
const spanY = devY * 2;
|
68
|
-
const span = Math.hypot(spanX, spanY);
|
81
|
+
const span = Math.hypot(spanX, spanY); // Begin/end events
|
69
82
|
|
70
|
-
// Begin/end events
|
71
83
|
const wasInProgress = this.inProgress;
|
72
84
|
this._focusX = focusX;
|
73
85
|
this._focusY = focusY;
|
86
|
+
|
74
87
|
if (this.inProgress && (span < this.minSpan || configChanged)) {
|
75
88
|
this.onScaleEnd(this);
|
76
89
|
this.inProgress = false;
|
77
90
|
this.initialSpan = span;
|
78
91
|
}
|
92
|
+
|
79
93
|
if (configChanged) {
|
80
94
|
this.initialSpan = this.prevSpan = this._currentSpan = span;
|
81
95
|
}
|
96
|
+
|
82
97
|
if (!this.inProgress && span >= this.minSpan && (wasInProgress || Math.abs(span - this.initialSpan) > this.spanSlop)) {
|
83
98
|
this.prevSpan = this._currentSpan = span;
|
84
99
|
this.prevTime = this.currentTime;
|
85
100
|
this.inProgress = this.onScaleBegin(this);
|
86
|
-
}
|
101
|
+
} // Handle motion
|
102
|
+
|
87
103
|
|
88
|
-
// Handle motion
|
89
104
|
if (action !== EventTypes.MOVE) {
|
90
105
|
return true;
|
91
106
|
}
|
107
|
+
|
92
108
|
this._currentSpan = span;
|
109
|
+
|
93
110
|
if (this.inProgress && !this.onScale(this)) {
|
94
111
|
return true;
|
95
112
|
}
|
113
|
+
|
96
114
|
this.prevSpan = this.currentSpan;
|
97
115
|
this.prevTime = this.currentTime;
|
98
116
|
return true;
|
99
117
|
}
|
118
|
+
|
100
119
|
calculateScaleFactor(numOfPointers) {
|
101
120
|
if (numOfPointers < 2) {
|
102
121
|
return 1;
|
103
122
|
}
|
123
|
+
|
104
124
|
return this.prevSpan > 0 ? this.currentSpan / this.prevSpan : 1;
|
105
125
|
}
|
126
|
+
|
106
127
|
get currentSpan() {
|
107
128
|
return this._currentSpan;
|
108
129
|
}
|
130
|
+
|
109
131
|
get focusX() {
|
110
132
|
return this._focusX;
|
111
133
|
}
|
134
|
+
|
112
135
|
get focusY() {
|
113
136
|
return this._focusY;
|
114
137
|
}
|
138
|
+
|
115
139
|
get timeDelta() {
|
116
140
|
return this.currentTime - this.prevTime;
|
117
141
|
}
|
142
|
+
|
118
143
|
}
|
119
144
|
//# sourceMappingURL=ScaleGestureDetector.js.map
|