react-native-gesture-handler 2.22.1 → 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 +61 -59
- 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 +17 -27
- 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 +57 -44
- 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 +12 -17
- 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 +97 -66
- 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/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,13 +1,12 @@
|
|
1
|
-
function _extends() { _extends = Object.assign
|
2
|
-
|
3
|
-
function
|
4
|
-
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
2
|
+
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; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
+
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); }
|
5
5
|
import * as React from 'react';
|
6
6
|
import { Component } from 'react';
|
7
7
|
import { Animated, Platform } from 'react-native';
|
8
8
|
import { State } from '../../State';
|
9
9
|
import { BaseButton } from '../GestureButtons';
|
10
|
-
|
11
10
|
/**
|
12
11
|
* Each touchable is a states' machine which preforms transitions.
|
13
12
|
* On very beginning (and on the very end or recognition) touchable is
|
@@ -21,26 +20,26 @@ export const TOUCHABLE_STATE = {
|
|
21
20
|
MOVED_OUTSIDE: 2
|
22
21
|
};
|
23
22
|
|
23
|
+
// TODO: maybe can be better
|
24
|
+
// TODO: all clearTimeout have ! added, maybe they shouldn't ?
|
25
|
+
|
24
26
|
/**
|
25
27
|
* GenericTouchable is not intented to be used as it is.
|
26
28
|
* Should be treated as a source for the rest of touchables
|
27
29
|
*/
|
30
|
+
|
28
31
|
export default class GenericTouchable extends Component {
|
29
32
|
constructor(...args) {
|
30
33
|
super(...args);
|
31
|
-
|
34
|
+
// Timeout handlers
|
32
35
|
_defineProperty(this, "pressInTimeout", void 0);
|
33
|
-
|
34
36
|
_defineProperty(this, "pressOutTimeout", void 0);
|
35
|
-
|
36
37
|
_defineProperty(this, "longPressTimeout", void 0);
|
37
|
-
|
38
|
+
// This flag is required since recognition of longPress implies not-invoking onPress
|
38
39
|
_defineProperty(this, "longPressDetected", false);
|
39
|
-
|
40
40
|
_defineProperty(this, "pointerInside", true);
|
41
|
-
|
41
|
+
// State of touchable
|
42
42
|
_defineProperty(this, "STATE", TOUCHABLE_STATE.UNDETERMINED);
|
43
|
-
|
44
43
|
_defineProperty(this, "onGestureEvent", ({
|
45
44
|
nativeEvent: {
|
46
45
|
pointerInside
|
@@ -53,21 +52,19 @@ export default class GenericTouchable extends Component {
|
|
53
52
|
this.onMoveOut();
|
54
53
|
}
|
55
54
|
}
|
56
|
-
|
57
55
|
this.pointerInside = pointerInside;
|
58
56
|
});
|
59
|
-
|
60
57
|
_defineProperty(this, "onHandlerStateChange", ({
|
61
58
|
nativeEvent
|
62
59
|
}) => {
|
63
60
|
const {
|
64
61
|
state
|
65
62
|
} = nativeEvent;
|
66
|
-
|
67
63
|
if (state === State.CANCELLED || state === State.FAILED) {
|
68
64
|
// Need to handle case with external cancellation (e.g. by ScrollView)
|
69
65
|
this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
|
70
|
-
} else if (
|
66
|
+
} else if (
|
67
|
+
// This platform check is an implication of slightly different behavior of handlers on different platform.
|
71
68
|
// And Android "Active" state is achieving on first move of a finger, not on press in.
|
72
69
|
// On iOS event on "Began" is not delivered.
|
73
70
|
state === (Platform.OS !== 'android' ? State.ACTIVE : State.BEGAN) && this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
|
@@ -76,25 +73,20 @@ export default class GenericTouchable extends Component {
|
|
76
73
|
} else if (state === State.END) {
|
77
74
|
const shouldCallOnPress = !this.longPressDetected && this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE && this.pressOutTimeout === null;
|
78
75
|
this.handleGoToUndetermined();
|
79
|
-
|
80
76
|
if (shouldCallOnPress) {
|
81
77
|
var _this$props$onPress, _this$props;
|
82
|
-
|
83
78
|
// Calls only inside component whether no long press was called previously
|
84
|
-
(_this$props$onPress = (_this$props = this.props).onPress) === null || _this$props$onPress === void 0
|
79
|
+
(_this$props$onPress = (_this$props = this.props).onPress) === null || _this$props$onPress === void 0 || _this$props$onPress.call(_this$props);
|
85
80
|
}
|
86
81
|
}
|
87
82
|
});
|
88
|
-
|
89
83
|
_defineProperty(this, "onLongPressDetected", () => {
|
90
84
|
var _this$props$onLongPre, _this$props2;
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
(_this$props$onLongPre = (_this$props2 = this.props).onLongPress) === null || _this$props$onLongPre === void 0 ? void 0 : _this$props$onLongPre.call(_this$props2);
|
85
|
+
this.longPressDetected = true;
|
86
|
+
// Checked for in the caller of `onLongPressDetected`, but better to check twice
|
87
|
+
(_this$props$onLongPre = (_this$props2 = this.props).onLongPress) === null || _this$props$onLongPre === void 0 || _this$props$onLongPre.call(_this$props2);
|
95
88
|
});
|
96
89
|
}
|
97
|
-
|
98
90
|
// handlePressIn in called on first touch on traveling inside component.
|
99
91
|
// Handles state transition with delay.
|
100
92
|
handlePressIn() {
|
@@ -106,15 +98,13 @@ export default class GenericTouchable extends Component {
|
|
106
98
|
} else {
|
107
99
|
this.moveToState(TOUCHABLE_STATE.BEGAN);
|
108
100
|
}
|
109
|
-
|
110
101
|
if (this.props.onLongPress) {
|
111
102
|
const time = (this.props.delayPressIn || 0) + (this.props.delayLongPress || 0);
|
112
103
|
this.longPressTimeout = setTimeout(this.onLongPressDetected, time);
|
113
104
|
}
|
114
|
-
}
|
105
|
+
}
|
106
|
+
// handleMoveOutside in called on traveling outside component.
|
115
107
|
// Handles state transition with delay.
|
116
|
-
|
117
|
-
|
118
108
|
handleMoveOutside() {
|
119
109
|
if (this.props.delayPressOut) {
|
120
110
|
this.pressOutTimeout = this.pressOutTimeout || setTimeout(() => {
|
@@ -124,18 +114,16 @@ export default class GenericTouchable extends Component {
|
|
124
114
|
} else {
|
125
115
|
this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);
|
126
116
|
}
|
127
|
-
}
|
128
|
-
|
117
|
+
}
|
129
118
|
|
119
|
+
// handleGoToUndetermined transits to UNDETERMINED state with proper delay
|
130
120
|
handleGoToUndetermined() {
|
131
121
|
clearTimeout(this.pressOutTimeout); // TODO: maybe it can be undefined
|
132
|
-
|
133
122
|
if (this.props.delayPressOut) {
|
134
123
|
this.pressOutTimeout = setTimeout(() => {
|
135
124
|
if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
|
136
125
|
this.moveToState(TOUCHABLE_STATE.BEGAN);
|
137
126
|
}
|
138
|
-
|
139
127
|
this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
|
140
128
|
this.pressOutTimeout = null;
|
141
129
|
}, this.props.delayPressOut);
|
@@ -143,16 +131,13 @@ export default class GenericTouchable extends Component {
|
|
143
131
|
if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
|
144
132
|
this.moveToState(TOUCHABLE_STATE.BEGAN);
|
145
133
|
}
|
146
|
-
|
147
134
|
this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
|
148
135
|
}
|
149
136
|
}
|
150
|
-
|
151
137
|
componentDidMount() {
|
152
138
|
this.reset();
|
153
|
-
}
|
154
|
-
|
155
|
-
|
139
|
+
}
|
140
|
+
// Reset timeout to prevent memory leaks.
|
156
141
|
reset() {
|
157
142
|
this.longPressDetected = false;
|
158
143
|
this.pointerInside = true;
|
@@ -162,70 +147,57 @@ export default class GenericTouchable extends Component {
|
|
162
147
|
this.pressOutTimeout = null;
|
163
148
|
this.longPressTimeout = null;
|
164
149
|
this.pressInTimeout = null;
|
165
|
-
}
|
166
|
-
|
150
|
+
}
|
167
151
|
|
152
|
+
// All states' transitions are defined here.
|
168
153
|
moveToState(newState) {
|
169
154
|
var _this$props$onStateCh, _this$props6;
|
170
|
-
|
171
155
|
if (newState === this.STATE) {
|
172
156
|
// Ignore dummy transitions
|
173
157
|
return;
|
174
158
|
}
|
175
|
-
|
176
159
|
if (newState === TOUCHABLE_STATE.BEGAN) {
|
177
160
|
var _this$props$onPressIn, _this$props3;
|
178
|
-
|
179
161
|
// First touch and moving inside
|
180
|
-
(_this$props$onPressIn = (_this$props3 = this.props).onPressIn) === null || _this$props$onPressIn === void 0
|
162
|
+
(_this$props$onPressIn = (_this$props3 = this.props).onPressIn) === null || _this$props$onPressIn === void 0 || _this$props$onPressIn.call(_this$props3);
|
181
163
|
} else if (newState === TOUCHABLE_STATE.MOVED_OUTSIDE) {
|
182
164
|
var _this$props$onPressOu, _this$props4;
|
183
|
-
|
184
165
|
// Moving outside
|
185
|
-
(_this$props$onPressOu = (_this$props4 = this.props).onPressOut) === null || _this$props$onPressOu === void 0
|
166
|
+
(_this$props$onPressOu = (_this$props4 = this.props).onPressOut) === null || _this$props$onPressOu === void 0 || _this$props$onPressOu.call(_this$props4);
|
186
167
|
} else if (newState === TOUCHABLE_STATE.UNDETERMINED) {
|
187
168
|
// Need to reset each time on transition to UNDETERMINED
|
188
169
|
this.reset();
|
189
|
-
|
190
170
|
if (this.STATE === TOUCHABLE_STATE.BEGAN) {
|
191
171
|
var _this$props$onPressOu2, _this$props5;
|
192
|
-
|
193
172
|
// ... and if it happens inside button.
|
194
|
-
(_this$props$onPressOu2 = (_this$props5 = this.props).onPressOut) === null || _this$props$onPressOu2 === void 0
|
173
|
+
(_this$props$onPressOu2 = (_this$props5 = this.props).onPressOut) === null || _this$props$onPressOu2 === void 0 || _this$props$onPressOu2.call(_this$props5);
|
195
174
|
}
|
196
|
-
}
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
175
|
+
}
|
176
|
+
// Finally call lister (used by subclasses)
|
177
|
+
(_this$props$onStateCh = (_this$props6 = this.props).onStateChange) === null || _this$props$onStateCh === void 0 || _this$props$onStateCh.call(_this$props6, this.STATE, newState);
|
178
|
+
// ... and make transition.
|
201
179
|
this.STATE = newState;
|
202
180
|
}
|
203
|
-
|
204
181
|
componentWillUnmount() {
|
205
182
|
// To prevent memory leaks
|
206
183
|
this.reset();
|
207
184
|
}
|
208
|
-
|
209
185
|
onMoveIn() {
|
210
186
|
if (this.STATE === TOUCHABLE_STATE.MOVED_OUTSIDE) {
|
211
187
|
// This call is not throttled with delays (like in RN's implementation).
|
212
188
|
this.moveToState(TOUCHABLE_STATE.BEGAN);
|
213
189
|
}
|
214
190
|
}
|
215
|
-
|
216
191
|
onMoveOut() {
|
217
192
|
// Long press should no longer be detected
|
218
193
|
clearTimeout(this.longPressTimeout);
|
219
194
|
this.longPressTimeout = null;
|
220
|
-
|
221
195
|
if (this.STATE === TOUCHABLE_STATE.BEGAN) {
|
222
196
|
this.handleMoveOutside();
|
223
197
|
}
|
224
198
|
}
|
225
|
-
|
226
199
|
render() {
|
227
200
|
var _ref, _this$props$touchSoun;
|
228
|
-
|
229
201
|
const hitSlop = (_ref = typeof this.props.hitSlop === 'number' ? {
|
230
202
|
top: this.props.hitSlop,
|
231
203
|
left: this.props.hitSlop,
|
@@ -247,7 +219,8 @@ export default class GenericTouchable extends Component {
|
|
247
219
|
};
|
248
220
|
return /*#__PURE__*/React.createElement(BaseButton, _extends({
|
249
221
|
style: this.props.containerStyle,
|
250
|
-
onHandlerStateChange:
|
222
|
+
onHandlerStateChange:
|
223
|
+
// TODO: not sure if it can be undefined instead of null
|
251
224
|
this.props.disabled ? undefined : this.onHandlerStateChange,
|
252
225
|
onGestureEvent: this.onGestureEvent,
|
253
226
|
hitSlop: hitSlop,
|
@@ -261,9 +234,7 @@ export default class GenericTouchable extends Component {
|
|
261
234
|
style: this.props.style
|
262
235
|
}), this.props.children));
|
263
236
|
}
|
264
|
-
|
265
237
|
}
|
266
|
-
|
267
238
|
_defineProperty(GenericTouchable, "defaultProps", {
|
268
239
|
delayLongPress: 600,
|
269
240
|
extraButtonProps: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["GenericTouchable.tsx"],"names":["React","Component","Animated","Platform","State","BaseButton","TOUCHABLE_STATE","UNDETERMINED","BEGAN","MOVED_OUTSIDE","GenericTouchable","nativeEvent","pointerInside","onMoveIn","onMoveOut","state","CANCELLED","FAILED","moveToState","OS","ACTIVE","STATE","handlePressIn","END","shouldCallOnPress","longPressDetected","pressOutTimeout","handleGoToUndetermined","props","onPress","onLongPress","delayPressIn","pressInTimeout","setTimeout","time","delayLongPress","longPressTimeout","onLongPressDetected","handleMoveOutside","delayPressOut","clearTimeout","componentDidMount","reset","newState","onPressIn","onPressOut","onStateChange","componentWillUnmount","render","hitSlop","top","left","bottom","right","undefined","coreProps","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","accessibilityState","accessibilityActions","onAccessibilityAction","nativeID","onLayout","containerStyle","disabled","onHandlerStateChange","onGestureEvent","userSelect","shouldActivateOnStart","disallowInterruption","testID","touchSoundDisabled","extraButtonProps","style","children","rippleColor","exclusive"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,cAAnC;AAEA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,UAAT,QAA2B,mBAA3B;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,YAAY,EAAE,CADe;AAE7BC,EAAAA,KAAK,EAAE,CAFsB;AAG7BC,EAAAA,aAAa,EAAE;AAHc,CAAxB;;AAiBP;AACA;AACA;AACA;AAEA,eAAe,MAAMC,gBAAN,SAA+BT,SAA/B,CAEb;AAAA;AAAA;;AAAA;;AAAA;;AAAA;;AAAA,+CAeoB,KAfpB;;AAAA,2CAiBgB,IAjBhB;;AAAA,mCAoBwBK,eAAe,CAACC,YApBxC;;AAAA,4CAkHiB,CAAC;AAChBI,MAAAA,WAAW,EAAE;AAAEC,QAAAA;AAAF;AADG,KAAD,KAEoC;AACnD,UAAI,KAAKA,aAAL,KAAuBA,aAA3B,EAA0C;AACxC,YAAIA,aAAJ,EAAmB;AACjB,eAAKC,QAAL;AACD,SAFD,MAEO;AACL,eAAKC,SAAL;AACD;AACF;;AACD,WAAKF,aAAL,GAAqBA,aAArB;AACD,KA7HD;;AAAA,kDA+HuB,CAAC;AACtBD,MAAAA;AADsB,KAAD,KAEyC;AAC9D,YAAM;AAAEI,QAAAA;AAAF,UAAYJ,WAAlB;;AACA,UAAII,KAAK,KAAKX,KAAK,CAACY,SAAhB,IAA6BD,KAAK,KAAKX,KAAK,CAACa,MAAjD,EAAyD;AACvD;AACA,aAAKC,WAAL,CAAiBZ,eAAe,CAACC,YAAjC;AACD,OAHD,MAGO,KACL;AACA;AACA;AACAQ,MAAAA,KAAK,MAAMZ,QA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AAA,OAAO,EAAEnB,OAPX;AAQE,MAAA,UAAU,EAAE,KAAKrB,KAAL,CAAWyC,UARzB;AASE,MAAA,qBAAqB,EAAE,KAAKzC,KAAL,CAAW0C,qBATpC;AAUE,MAAA,oBAAoB,EAAE,KAAK1C,KAAL,CAAW2C,oBAVnC;AAWE,MAAA,MAAM,EAAE,KAAK3C,KAAL,CAAW4C,MAXrB;AAYE,MAAA,kBAAkB,2BAAE,KAAK5C,KAAL,CAAW6C,kBAAb,yEAAmC,KAZvD;AAaE,MAAA,OAAO,EAAE,CAAC,KAAK7C,KAAL,CAAWsC;AAbvB,OAcM,KAAKtC,KAAL,CAAW8C,gBAdjB,gBAeE,oBAAC,QAAD,CAAU,IAAV,eAAmBnB,SAAnB;AAA8B,MAAA,KAAK,EAAE,KAAK3B,KAAL,CAAW+C;AAAhD,QACG,KAAK/C,KAAL,CAAWgD,QADd,CAfF,CADF;AAqBD;;AArOD;;gBAFmBlE,gB,kBAGG;AACpByB,EAAAA,cAAc,EAAE,GADI;AAEpBuC,EAAAA,gBAAgB,EAAE;AAChBG,IAAAA,WAAW,EAAE,aADG;AAEhBC,IAAAA,SAAS,EAAE;AAFK;AAFE,C","sourcesContent":["import * as React from 'react';\nimport { Component } from 'react';\nimport { Animated, Platform } from 'react-native';\n\nimport { State } from '../../State';\nimport { BaseButton } from '../GestureButtons';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../../handlers/gestureHandlerCommon';\nimport type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload';\nimport type { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';\nimport type { GenericTouchableProps } from './GenericTouchableProps';\n\n/**\n * Each touchable is a states' machine which preforms transitions.\n * On very beginning (and on the very end or recognition) touchable is\n * UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger\n * travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition\n * finishes in UNDETERMINED state.\n */\nexport const TOUCHABLE_STATE = {\n UNDETERMINED: 0,\n BEGAN: 1,\n MOVED_OUTSIDE: 2,\n} as const;\n\ntype TouchableState = (typeof TOUCHABLE_STATE)[keyof typeof TOUCHABLE_STATE];\n\ninterface InternalProps {\n extraButtonProps: TouchableNativeFeedbackExtraProps;\n onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;\n}\n\n// TODO: maybe can be better\n// TODO: all clearTimeout have ! added, maybe they shouldn't ?\ntype Timeout = ReturnType<typeof setTimeout> | null | undefined;\n\n/**\n * GenericTouchable is not intented to be used as it is.\n * Should be treated as a source for the rest of touchables\n */\n\nexport default class GenericTouchable extends Component<\n GenericTouchableProps & InternalProps\n> {\n static defaultProps = {\n delayLongPress: 600,\n extraButtonProps: {\n rippleColor: 'transparent',\n exclusive: true,\n },\n };\n\n // Timeout handlers\n pressInTimeout: Timeout;\n pressOutTimeout: Timeout;\n longPressTimeout: Timeout;\n\n // This flag is required since recognition of longPress implies not-invoking onPress\n longPressDetected = false;\n\n pointerInside = true;\n\n // State of touchable\n STATE: TouchableState = TOUCHABLE_STATE.UNDETERMINED;\n\n // handlePressIn in called on first touch on traveling inside component.\n // Handles state transition with delay.\n handlePressIn() {\n if (this.props.delayPressIn) {\n this.pressInTimeout = setTimeout(() => {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n this.pressInTimeout = null;\n }, this.props.delayPressIn);\n } else {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n if (this.props.onLongPress) {\n const time =\n (this.props.delayPressIn || 0) + (this.props.delayLongPress || 0);\n this.longPressTimeout = setTimeout(this.onLongPressDetected, time);\n }\n }\n // handleMoveOutside in called on traveling outside component.\n // Handles state transition with delay.\n handleMoveOutside() {\n if (this.props.delayPressOut) {\n this.pressOutTimeout =\n this.pressOutTimeout ||\n setTimeout(() => {\n this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);\n this.pressOutTimeout = null;\n }, this.props.delayPressOut);\n } else {\n this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);\n }\n }\n\n // handleGoToUndetermined transits to UNDETERMINED state with proper delay\n handleGoToUndetermined() {\n clearTimeout(this.pressOutTimeout!); // TODO: maybe it can be undefined\n if (this.props.delayPressOut) {\n this.pressOutTimeout = setTimeout(() => {\n if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n this.pressOutTimeout = null;\n }, this.props.delayPressOut);\n } else {\n if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n }\n }\n\n componentDidMount() {\n this.reset();\n }\n // Reset timeout to prevent memory leaks.\n reset() {\n this.longPressDetected = false;\n this.pointerInside = true;\n clearTimeout(this.pressInTimeout!);\n clearTimeout(this.pressOutTimeout!);\n clearTimeout(this.longPressTimeout!);\n this.pressOutTimeout = null;\n this.longPressTimeout = null;\n this.pressInTimeout = null;\n }\n\n // All states' transitions are defined here.\n moveToState(newState: TouchableState) {\n if (newState === this.STATE) {\n // Ignore dummy transitions\n return;\n }\n if (newState === TOUCHABLE_STATE.BEGAN) {\n // First touch and moving inside\n this.props.onPressIn?.();\n } else if (newState === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n // Moving outside\n this.props.onPressOut?.();\n } else if (newState === TOUCHABLE_STATE.UNDETERMINED) {\n // Need to reset each time on transition to UNDETERMINED\n this.reset();\n if (this.STATE === TOUCHABLE_STATE.BEGAN) {\n // ... and if it happens inside button.\n this.props.onPressOut?.();\n }\n }\n // Finally call lister (used by subclasses)\n this.props.onStateChange?.(this.STATE, newState);\n // ... and make transition.\n this.STATE = newState;\n }\n\n onGestureEvent = ({\n nativeEvent: { pointerInside },\n }: GestureEvent<NativeViewGestureHandlerPayload>) => {\n if (this.pointerInside !== pointerInside) {\n if (pointerInside) {\n this.onMoveIn();\n } else {\n this.onMoveOut();\n }\n }\n this.pointerInside = pointerInside;\n };\n\n onHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<NativeViewGestureHandlerPayload>) => {\n const { state } = nativeEvent;\n if (state === State.CANCELLED || state === State.FAILED) {\n // Need to handle case with external cancellation (e.g. by ScrollView)\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n } else if (\n // This platform check is an implication of slightly different behavior of handlers on different platform.\n // And Android \"Active\" state is achieving on first move of a finger, not on press in.\n // On iOS event on \"Began\" is not delivered.\n state === (Platform.OS !== 'android' ? State.ACTIVE : State.BEGAN) &&\n this.STATE === TOUCHABLE_STATE.UNDETERMINED\n ) {\n // Moving inside requires\n this.handlePressIn();\n } else if (state === State.END) {\n const shouldCallOnPress =\n !this.longPressDetected &&\n this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE &&\n this.pressOutTimeout === null;\n this.handleGoToUndetermined();\n if (shouldCallOnPress) {\n // Calls only inside component whether no long press was called previously\n this.props.onPress?.();\n }\n }\n };\n\n onLongPressDetected = () => {\n this.longPressDetected = true;\n // Checked for in the caller of `onLongPressDetected`, but better to check twice\n this.props.onLongPress?.();\n };\n\n componentWillUnmount() {\n // To prevent memory leaks\n this.reset();\n }\n\n onMoveIn() {\n if (this.STATE === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n // This call is not throttled with delays (like in RN's implementation).\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n }\n\n onMoveOut() {\n // Long press should no longer be detected\n clearTimeout(this.longPressTimeout!);\n this.longPressTimeout = null;\n if (this.STATE === TOUCHABLE_STATE.BEGAN) {\n this.handleMoveOutside();\n }\n }\n\n render() {\n const hitSlop =\n (typeof this.props.hitSlop === 'number'\n ? {\n top: this.props.hitSlop,\n left: this.props.hitSlop,\n bottom: this.props.hitSlop,\n right: this.props.hitSlop,\n }\n : this.props.hitSlop) ?? undefined;\n\n const coreProps = {\n accessible: this.props.accessible !== false,\n accessibilityLabel: this.props.accessibilityLabel,\n accessibilityHint: this.props.accessibilityHint,\n accessibilityRole: this.props.accessibilityRole,\n // TODO: check if changed to no 's' correctly, also removed 2 props that are no longer available: `accessibilityComponentType` and `accessibilityTraits`,\n // would be good to check if it is ok for sure, see: https://github.com/facebook/react-native/issues/24016\n accessibilityState: this.props.accessibilityState,\n accessibilityActions: this.props.accessibilityActions,\n onAccessibilityAction: this.props.onAccessibilityAction,\n nativeID: this.props.nativeID,\n onLayout: this.props.onLayout,\n };\n\n return (\n <BaseButton\n style={this.props.containerStyle}\n onHandlerStateChange={\n // TODO: not sure if it can be undefined instead of null\n this.props.disabled ? undefined : this.onHandlerStateChange\n }\n onGestureEvent={this.onGestureEvent}\n hitSlop={hitSlop}\n userSelect={this.props.userSelect}\n shouldActivateOnStart={this.props.shouldActivateOnStart}\n disallowInterruption={this.props.disallowInterruption}\n testID={this.props.testID}\n touchSoundDisabled={this.props.touchSoundDisabled ?? false}\n enabled={!this.props.disabled}\n {...this.props.extraButtonProps}>\n <Animated.View {...coreProps} style={this.props.style}>\n {this.props.children}\n </Animated.View>\n </BaseButton>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"names":["React","Component","Animated","Platform","State","BaseButton","TOUCHABLE_STATE","UNDETERMINED","BEGAN","MOVED_OUTSIDE","GenericTouchable","constructor","args","_defineProperty","nativeEvent","pointerInside","onMoveIn","onMoveOut","state","CANCELLED","FAILED","moveToState","OS","ACTIVE","STATE","handlePressIn","END","shouldCallOnPress","longPressDetected","pressOutTimeout","handleGoToUndetermined","_this$props$onPress","_this$props","props","onPress","call","_this$props$onLongPre","_this$props2","onLongPress","delayPressIn","pressInTimeout","setTimeout","time","delayLongPress","longPressTimeout","onLongPressDetected","handleMoveOutside","delayPressOut","clearTimeout","componentDidMount","reset","newState","_this$props$onStateCh","_this$props6","_this$props$onPressIn","_this$props3","onPressIn","_this$props$onPressOu","_this$props4","onPressOut","_this$props$onPressOu2","_this$props5","onStateChange","componentWillUnmount","render","_ref","_this$props$touchSoun","hitSlop","top","left","bottom","right","undefined","coreProps","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","accessibilityState","accessibilityActions","onAccessibilityAction","nativeID","onLayout","createElement","_extends","style","containerStyle","onHandlerStateChange","disabled","onGestureEvent","userSelect","shouldActivateOnStart","disallowInterruption","testID","touchSoundDisabled","enabled","extraButtonProps","View","children","rippleColor","exclusive"],"sources":["GenericTouchable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Component } from 'react';\nimport { Animated, Platform } from 'react-native';\n\nimport { State } from '../../State';\nimport { BaseButton } from '../GestureButtons';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../../handlers/gestureHandlerCommon';\nimport type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload';\nimport type { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';\nimport type { GenericTouchableProps } from './GenericTouchableProps';\n\n/**\n * Each touchable is a states' machine which preforms transitions.\n * On very beginning (and on the very end or recognition) touchable is\n * UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger\n * travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition\n * finishes in UNDETERMINED state.\n */\nexport const TOUCHABLE_STATE = {\n UNDETERMINED: 0,\n BEGAN: 1,\n MOVED_OUTSIDE: 2,\n} as const;\n\ntype TouchableState = (typeof TOUCHABLE_STATE)[keyof typeof TOUCHABLE_STATE];\n\ninterface InternalProps {\n extraButtonProps: TouchableNativeFeedbackExtraProps;\n onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;\n}\n\n// TODO: maybe can be better\n// TODO: all clearTimeout have ! added, maybe they shouldn't ?\ntype Timeout = ReturnType<typeof setTimeout> | null | undefined;\n\n/**\n * GenericTouchable is not intented to be used as it is.\n * Should be treated as a source for the rest of touchables\n */\n\nexport default class GenericTouchable extends Component<\n GenericTouchableProps & InternalProps\n> {\n static defaultProps = {\n delayLongPress: 600,\n extraButtonProps: {\n rippleColor: 'transparent',\n exclusive: true,\n },\n };\n\n // Timeout handlers\n pressInTimeout: Timeout;\n pressOutTimeout: Timeout;\n longPressTimeout: Timeout;\n\n // This flag is required since recognition of longPress implies not-invoking onPress\n longPressDetected = false;\n\n pointerInside = true;\n\n // State of touchable\n STATE: TouchableState = TOUCHABLE_STATE.UNDETERMINED;\n\n // handlePressIn in called on first touch on traveling inside component.\n // Handles state transition with delay.\n handlePressIn() {\n if (this.props.delayPressIn) {\n this.pressInTimeout = setTimeout(() => {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n this.pressInTimeout = null;\n }, this.props.delayPressIn);\n } else {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n if (this.props.onLongPress) {\n const time =\n (this.props.delayPressIn || 0) + (this.props.delayLongPress || 0);\n this.longPressTimeout = setTimeout(this.onLongPressDetected, time);\n }\n }\n // handleMoveOutside in called on traveling outside component.\n // Handles state transition with delay.\n handleMoveOutside() {\n if (this.props.delayPressOut) {\n this.pressOutTimeout =\n this.pressOutTimeout ||\n setTimeout(() => {\n this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);\n this.pressOutTimeout = null;\n }, this.props.delayPressOut);\n } else {\n this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);\n }\n }\n\n // handleGoToUndetermined transits to UNDETERMINED state with proper delay\n handleGoToUndetermined() {\n clearTimeout(this.pressOutTimeout!); // TODO: maybe it can be undefined\n if (this.props.delayPressOut) {\n this.pressOutTimeout = setTimeout(() => {\n if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n this.pressOutTimeout = null;\n }, this.props.delayPressOut);\n } else {\n if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n }\n }\n\n componentDidMount() {\n this.reset();\n }\n // Reset timeout to prevent memory leaks.\n reset() {\n this.longPressDetected = false;\n this.pointerInside = true;\n clearTimeout(this.pressInTimeout!);\n clearTimeout(this.pressOutTimeout!);\n clearTimeout(this.longPressTimeout!);\n this.pressOutTimeout = null;\n this.longPressTimeout = null;\n this.pressInTimeout = null;\n }\n\n // All states' transitions are defined here.\n moveToState(newState: TouchableState) {\n if (newState === this.STATE) {\n // Ignore dummy transitions\n return;\n }\n if (newState === TOUCHABLE_STATE.BEGAN) {\n // First touch and moving inside\n this.props.onPressIn?.();\n } else if (newState === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n // Moving outside\n this.props.onPressOut?.();\n } else if (newState === TOUCHABLE_STATE.UNDETERMINED) {\n // Need to reset each time on transition to UNDETERMINED\n this.reset();\n if (this.STATE === TOUCHABLE_STATE.BEGAN) {\n // ... and if it happens inside button.\n this.props.onPressOut?.();\n }\n }\n // Finally call lister (used by subclasses)\n this.props.onStateChange?.(this.STATE, newState);\n // ... and make transition.\n this.STATE = newState;\n }\n\n onGestureEvent = ({\n nativeEvent: { pointerInside },\n }: GestureEvent<NativeViewGestureHandlerPayload>) => {\n if (this.pointerInside !== pointerInside) {\n if (pointerInside) {\n this.onMoveIn();\n } else {\n this.onMoveOut();\n }\n }\n this.pointerInside = pointerInside;\n };\n\n onHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<NativeViewGestureHandlerPayload>) => {\n const { state } = nativeEvent;\n if (state === State.CANCELLED || state === State.FAILED) {\n // Need to handle case with external cancellation (e.g. by ScrollView)\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n } else if (\n // This platform check is an implication of slightly different behavior of handlers on different platform.\n // And Android \"Active\" state is achieving on first move of a finger, not on press in.\n // On iOS event on \"Began\" is not delivered.\n state === (Platform.OS !== 'android' ? State.ACTIVE : State.BEGAN) &&\n this.STATE === TOUCHABLE_STATE.UNDETERMINED\n ) {\n // Moving inside requires\n this.handlePressIn();\n } else if (state === State.END) {\n const shouldCallOnPress =\n !this.longPressDetected &&\n this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE &&\n this.pressOutTimeout === null;\n this.handleGoToUndetermined();\n if (shouldCallOnPress) {\n // Calls only inside component whether no long press was called previously\n this.props.onPress?.();\n }\n }\n };\n\n onLongPressDetected = () => {\n this.longPressDetected = true;\n // Checked for in the caller of `onLongPressDetected`, but better to check twice\n this.props.onLongPress?.();\n };\n\n componentWillUnmount() {\n // To prevent memory leaks\n this.reset();\n }\n\n onMoveIn() {\n if (this.STATE === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n // This call is not throttled with delays (like in RN's implementation).\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n }\n\n onMoveOut() {\n // Long press should no longer be detected\n clearTimeout(this.longPressTimeout!);\n this.longPressTimeout = null;\n if (this.STATE === TOUCHABLE_STATE.BEGAN) {\n this.handleMoveOutside();\n }\n }\n\n render() {\n const hitSlop =\n (typeof this.props.hitSlop === 'number'\n ? {\n top: this.props.hitSlop,\n left: this.props.hitSlop,\n bottom: this.props.hitSlop,\n right: this.props.hitSlop,\n }\n : this.props.hitSlop) ?? undefined;\n\n const coreProps = {\n accessible: this.props.accessible !== false,\n accessibilityLabel: this.props.accessibilityLabel,\n accessibilityHint: this.props.accessibilityHint,\n accessibilityRole: this.props.accessibilityRole,\n // TODO: check if changed to no 's' correctly, also removed 2 props that are no longer available: `accessibilityComponentType` and `accessibilityTraits`,\n // would be good to check if it is ok for sure, see: https://github.com/facebook/react-native/issues/24016\n accessibilityState: this.props.accessibilityState,\n accessibilityActions: this.props.accessibilityActions,\n onAccessibilityAction: this.props.onAccessibilityAction,\n nativeID: this.props.nativeID,\n onLayout: this.props.onLayout,\n };\n\n return (\n <BaseButton\n style={this.props.containerStyle}\n onHandlerStateChange={\n // TODO: not sure if it can be undefined instead of null\n this.props.disabled ? undefined : this.onHandlerStateChange\n }\n onGestureEvent={this.onGestureEvent}\n hitSlop={hitSlop}\n userSelect={this.props.userSelect}\n shouldActivateOnStart={this.props.shouldActivateOnStart}\n disallowInterruption={this.props.disallowInterruption}\n testID={this.props.testID}\n touchSoundDisabled={this.props.touchSoundDisabled ?? false}\n enabled={!this.props.disabled}\n {...this.props.extraButtonProps}>\n <Animated.View {...coreProps} style={this.props.style}>\n {this.props.children}\n </Animated.View>\n </BaseButton>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAEjD,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,UAAU,QAAQ,mBAAmB;AAU9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG;EAC7BC,YAAY,EAAE,CAAC;EACfC,KAAK,EAAE,CAAC;EACRC,aAAa,EAAE;AACjB,CAAU;;AASV;AACA;;AAGA;AACA;AACA;AACA;;AAEA,eAAe,MAAMC,gBAAgB,SAAST,SAAS,CAErD;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IASA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAKA;IAAAA,eAAA,4BACoB,KAAK;IAAAA,eAAA,wBAET,IAAI;IAEpB;IAAAA,eAAA,gBACwBP,eAAe,CAACC,YAAY;IAAAM,eAAA,yBA8FnC,CAAC;MAChBC,WAAW,EAAE;QAAEC;MAAc;IACgB,CAAC,KAAK;MACnD,IAAI,IAAI,CAACA,aAAa,KAAKA,aAAa,EAAE;QACxC,IAAIA,aAAa,EAAE;UACjB,IAAI,CAACC,QAAQ,CAAC,CAAC;QACjB,CAAC,MAAM;UACL,IAAI,CAACC,SAAS,CAAC,CAAC;QAClB;MACF;MACA,IAAI,CAACF,aAAa,GAAGA,aAAa;IACpC,CAAC;IAAAF,eAAA,+BAEsB,CAAC;MACtBC;IACwD,CAAC,KAAK;MAC9D,MAAM;QAAEI;MAAM,CAAC,GAAGJ,WAAW;MAC7B,IAAII,KAAK,KAAKd,KAAK,C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ACpCtB,OAAO,EAAEA,OAAQ;MACjBuB,UAAU,EAAE,IAAI,CAACzD,KAAK,CAACyD,UAAW;MAClCC,qBAAqB,EAAE,IAAI,CAAC1D,KAAK,CAAC0D,qBAAsB;MACxDC,oBAAoB,EAAE,IAAI,CAAC3D,KAAK,CAAC2D,oBAAqB;MACtDC,MAAM,EAAE,IAAI,CAAC5D,KAAK,CAAC4D,MAAO;MAC1BC,kBAAkB,GAAA5B,qBAAA,GAAE,IAAI,CAACjC,KAAK,CAAC6D,kBAAkB,cAAA5B,qBAAA,cAAAA,qBAAA,GAAI,KAAM;MAC3D6B,OAAO,EAAE,CAAC,IAAI,CAAC9D,KAAK,CAACuD;IAAS,GAC1B,IAAI,CAACvD,KAAK,CAAC+D,gBAAgB,gBAC/BhG,KAAA,CAAAmF,aAAA,CAACjF,QAAQ,CAAC+F,IAAI,EAAAb,QAAA,KAAKX,SAAS;MAAEY,KAAK,EAAE,IAAI,CAACpD,KAAK,CAACoD;IAAM,IACnD,IAAI,CAACpD,KAAK,CAACiE,QACC,CACL,CAAC;EAEjB;AACF;AAACrF,eAAA,CAxOoBH,gBAAgB,kBAGb;EACpBiC,cAAc,EAAE,GAAG;EACnBqD,gBAAgB,EAAE;IAChBG,WAAW,EAAE,aAAa;IAC1BC,SAAS,EAAE;EACb;AACF,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"
|
1
|
+
{"version":3,"names":[],"sources":["GenericTouchableProps.ts"],"sourcesContent":["import type {\n StyleProp,\n ViewStyle,\n TouchableWithoutFeedbackProps,\n Insets,\n} from 'react-native';\nimport type { UserSelect } from '../../handlers/gestureHandlerCommon';\n\nexport interface GenericTouchableProps\n extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {\n // Decided to drop not used fields from RN's implementation.\n // e.g. onBlur and onFocus as well as deprecated props. - TODO: this comment may be unuseful in this moment\n // TODO: in RN these events get native event parameter, which prolly could be used in our implementation too\n onPress?: () => void;\n onPressIn?: () => void;\n onPressOut?: () => void;\n onLongPress?: () => void;\n\n nativeID?: string;\n shouldActivateOnStart?: boolean;\n disallowInterruption?: boolean;\n\n containerStyle?: StyleProp<ViewStyle>;\n hitSlop?: Insets | number;\n userSelect?: UserSelect;\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -1,26 +1,30 @@
|
|
1
|
-
function _extends() { _extends = Object.assign
|
2
|
-
|
3
|
-
function
|
4
|
-
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
2
|
+
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; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
+
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); }
|
5
5
|
import * as React from 'react';
|
6
6
|
import { Component } from 'react';
|
7
7
|
import GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';
|
8
8
|
import { StyleSheet, View } from 'react-native';
|
9
9
|
|
10
10
|
/**
|
11
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
|
12
|
+
*/
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
|
16
|
+
*
|
11
17
|
* TouchableHighlight follows RN's implementation
|
12
18
|
*/
|
13
19
|
export default class TouchableHighlight extends Component {
|
14
20
|
constructor(props) {
|
15
21
|
super(props);
|
16
|
-
|
22
|
+
// Copied from RN
|
17
23
|
_defineProperty(this, "showUnderlay", () => {
|
18
24
|
var _this$props$onShowUnd, _this$props;
|
19
|
-
|
20
25
|
if (!this.hasPressHandler()) {
|
21
26
|
return;
|
22
27
|
}
|
23
|
-
|
24
28
|
this.setState({
|
25
29
|
extraChildStyle: {
|
26
30
|
opacity: this.props.activeOpacity
|
@@ -29,21 +33,17 @@ export default class TouchableHighlight extends Component {
|
|
29
33
|
backgroundColor: this.props.underlayColor
|
30
34
|
}
|
31
35
|
});
|
32
|
-
(_this$props$onShowUnd = (_this$props = this.props).onShowUnderlay) === null || _this$props$onShowUnd === void 0
|
36
|
+
(_this$props$onShowUnd = (_this$props = this.props).onShowUnderlay) === null || _this$props$onShowUnd === void 0 || _this$props$onShowUnd.call(_this$props);
|
33
37
|
});
|
34
|
-
|
35
38
|
_defineProperty(this, "hasPressHandler", () => this.props.onPress || this.props.onPressIn || this.props.onPressOut || this.props.onLongPress);
|
36
|
-
|
37
39
|
_defineProperty(this, "hideUnderlay", () => {
|
38
40
|
var _this$props$onHideUnd, _this$props2;
|
39
|
-
|
40
41
|
this.setState({
|
41
42
|
extraChildStyle: null,
|
42
43
|
extraUnderlayStyle: null
|
43
44
|
});
|
44
|
-
(_this$props$onHideUnd = (_this$props2 = this.props).onHideUnderlay) === null || _this$props$onHideUnd === void 0
|
45
|
+
(_this$props$onHideUnd = (_this$props2 = this.props).onHideUnderlay) === null || _this$props$onHideUnd === void 0 || _this$props$onHideUnd.call(_this$props2);
|
45
46
|
});
|
46
|
-
|
47
47
|
_defineProperty(this, "onStateChange", (_from, to) => {
|
48
48
|
if (to === TOUCHABLE_STATE.BEGAN) {
|
49
49
|
this.showUnderlay();
|
@@ -51,26 +51,20 @@ export default class TouchableHighlight extends Component {
|
|
51
51
|
this.hideUnderlay();
|
52
52
|
}
|
53
53
|
});
|
54
|
-
|
55
54
|
this.state = {
|
56
55
|
extraChildStyle: null,
|
57
56
|
extraUnderlayStyle: null
|
58
57
|
};
|
59
|
-
}
|
60
|
-
|
61
|
-
|
58
|
+
}
|
62
59
|
renderChildren() {
|
63
60
|
if (!this.props.children) {
|
64
61
|
return /*#__PURE__*/React.createElement(View, null);
|
65
62
|
}
|
66
|
-
|
67
63
|
const child = React.Children.only(this.props.children); // TODO: not sure if OK but fixes error
|
68
|
-
|
69
64
|
return /*#__PURE__*/React.cloneElement(child, {
|
70
65
|
style: StyleSheet.compose(child.props.style, this.state.extraChildStyle)
|
71
66
|
});
|
72
67
|
}
|
73
|
-
|
74
68
|
render() {
|
75
69
|
const {
|
76
70
|
style = {},
|
@@ -84,10 +78,9 @@ export default class TouchableHighlight extends Component {
|
|
84
78
|
onStateChange: this.onStateChange
|
85
79
|
}), this.renderChildren());
|
86
80
|
}
|
87
|
-
|
88
81
|
}
|
89
|
-
|
90
|
-
|
82
|
+
_defineProperty(TouchableHighlight, "defaultProps", {
|
83
|
+
...GenericTouchable.defaultProps,
|
91
84
|
activeOpacity: 0.85,
|
92
85
|
delayPressOut: 100,
|
93
86
|
underlayColor: 'black'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["React","Component","GenericTouchable","TOUCHABLE_STATE","StyleSheet","View","TouchableHighlight","constructor","props","_defineProperty","_this$props$onShowUnd","_this$props","hasPressHandler","setState","extraChildStyle","opacity","activeOpacity","extraUnderlayStyle","backgroundColor","underlayColor","onShowUnderlay","call","onPress","onPressIn","onPressOut","onLongPress","_this$props$onHideUnd","_this$props2","onHideUnderlay","_from","to","BEGAN","showUnderlay","UNDETERMINED","MOVED_OUTSIDE","hideUnderlay","state","renderChildren","children","createElement","child","Children","only","cloneElement","style","compose","render","rest","_extends","onStateChange","defaultProps","delayPressOut"],"sources":["TouchableHighlight.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Component } from 'react';\nimport GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';\nimport type { GenericTouchableProps } from './GenericTouchableProps';\nimport {\n StyleSheet,\n View,\n TouchableHighlightProps as RNTouchableHighlightProps,\n ColorValue,\n ViewProps,\n} from 'react-native';\n\ninterface State {\n extraChildStyle: null | {\n opacity?: number;\n };\n extraUnderlayStyle: null | {\n backgroundColor?: ColorValue;\n };\n}\n\n/**\n * @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.\n */\nexport type TouchableHighlightProps = RNTouchableHighlightProps &\n GenericTouchableProps;\n\n/**\n * @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.\n *\n * TouchableHighlight follows RN's implementation\n */\nexport default class TouchableHighlight extends Component<\n TouchableHighlightProps,\n State\n> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n activeOpacity: 0.85,\n delayPressOut: 100,\n underlayColor: 'black',\n };\n\n constructor(props: TouchableHighlightProps) {\n super(props);\n this.state = {\n extraChildStyle: null,\n extraUnderlayStyle: null,\n };\n }\n\n // Copied from RN\n showUnderlay = () => {\n if (!this.hasPressHandler()) {\n return;\n }\n this.setState({\n extraChildStyle: {\n opacity: this.props.activeOpacity,\n },\n extraUnderlayStyle: {\n backgroundColor: this.props.underlayColor,\n },\n });\n this.props.onShowUnderlay?.();\n };\n\n hasPressHandler = () =>\n this.props.onPress ||\n this.props.onPressIn ||\n this.props.onPressOut ||\n this.props.onLongPress;\n\n hideUnderlay = () => {\n this.setState({\n extraChildStyle: null,\n extraUnderlayStyle: null,\n });\n this.props.onHideUnderlay?.();\n };\n\n renderChildren() {\n if (!this.props.children) {\n return <View />;\n }\n\n const child = React.Children.only(\n this.props.children\n ) as React.ReactElement<ViewProps>; // TODO: not sure if OK but fixes error\n return React.cloneElement(child, {\n style: StyleSheet.compose(child.props.style, this.state.extraChildStyle),\n });\n }\n\n onStateChange = (_from: number, to: number) => {\n if (to === TOUCHABLE_STATE.BEGAN) {\n this.showUnderlay();\n } else if (\n to === TOUCHABLE_STATE.UNDETERMINED ||\n to === TOUCHABLE_STATE.MOVED_OUTSIDE\n ) {\n this.hideUnderlay();\n }\n };\n\n render() {\n const { style = {}, ...rest } = this.props;\n const { extraUnderlayStyle } = this.state;\n return (\n <GenericTouchable\n {...rest}\n style={[style, extraUnderlayStyle]}\n onStateChange={this.onStateChange}>\n {this.renderChildren()}\n </GenericTouchable>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,OAAOC,gBAAgB,IAAIC,eAAe,QAAQ,oBAAoB;AAEtE,SACEC,UAAU,EACVC,IAAI,QAIC,cAAc;;AAWrB;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASL,SAAS,CAGvD;EAQAM,WAAWA,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;IAOd;IAAAC,eAAA,uBACe,MAAM;MAAA,IAAAC,qBAAA,EAAAC,WAAA;MACnB,IAAI,CAAC,IAAI,CAACC,eAAe,CAAC,CAAC,EAAE;QAC3B;MACF;MACA,IAAI,CAACC,QAAQ,CAAC;QACZC,eAAe,EAAE;UACfC,OAAO,EAAE,IAAI,CAACP,KAAK,CAACQ;QACtB,CAAC;QACDC,kBAAkB,EAAE;UAClBC,eAAe,EAAE,IAAI,CAACV,KAAK,CAACW;QAC9B;MACF,CAAC,CAAC;MACF,CAAAT,qBAAA,IAAAC,WAAA,OAAI,CAACH,KAAK,EAACY,cAAc,cAAAV,qBAAA,eAAzBA,qBAAA,CAAAW,IAAA,CAAAV,WAA4B,CAAC;IAC/B,CAAC;IAAAF,eAAA,0BAEiB,MAChB,IAAI,CAACD,KAAK,CAACc,OAAO,IAClB,IAAI,CAACd,KAAK,CAACe,SAAS,IACpB,IAAI,CAACf,KAAK,CAACgB,UAAU,IACrB,IAAI,CAAChB,KAAK,CAACiB,WAAW;IAAAhB,eAAA,uBAET,MAAM;MAAA,IAAAiB,qBAAA,EAAAC,YAAA;MACnB,IAAI,CAACd,QAAQ,CAAC;QACZC,eAAe,EAAE,IAAI;QACrBG,kBAAkB,EAAE;MACtB,CAA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CAACrC,gBAAgB,EAAA8C,QAAA,KACXD,IAAI;MACRH,KAAK,EAAE,CAACA,KAAK,EAAE3B,kBAAkB,CAAE;MACnCgC,aAAa,EAAE,IAAI,CAACA;IAAc,IACjC,IAAI,CAACZ,cAAc,CAAC,CACL,CAAC;EAEvB;AACF;AAAC5B,eAAA,CArFoBH,kBAAkB,kBAIf;EACpB,GAAGJ,gBAAgB,CAACgD,YAAY;EAChClC,aAAa,EAAE,IAAI;EACnBmC,aAAa,EAAE,GAAG;EAClBhC,aAAa,EAAE;AACjB,CAAC","ignoreList":[]}
|
@@ -1,26 +1,25 @@
|
|
1
|
-
function _extends() { _extends = Object.assign
|
2
|
-
|
3
|
-
function
|
4
|
-
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
2
|
+
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; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
+
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); }
|
5
5
|
import { Platform } from 'react-native';
|
6
6
|
import * as React from 'react';
|
7
7
|
import { Component } from 'react';
|
8
8
|
import GenericTouchable from './GenericTouchable';
|
9
|
-
|
10
9
|
/**
|
10
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
11
|
+
*
|
11
12
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
12
13
|
* There's small difference with handling long press ripple since RN's implementation calls
|
13
14
|
* ripple animation via bridge. This solution leaves all animations' handling for native components so
|
14
15
|
* it follows native behaviours.
|
15
16
|
*/
|
16
17
|
export default class TouchableNativeFeedback extends Component {
|
17
|
-
// Could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change
|
18
18
|
getExtraButtonProps() {
|
19
19
|
const extraProps = {};
|
20
20
|
const {
|
21
21
|
background
|
22
22
|
} = this.props;
|
23
|
-
|
24
23
|
if (background) {
|
25
24
|
// I changed type values to match those used in RN
|
26
25
|
// TODO(TS): check if it works the same as previous implementation - looks like it works the same as RN component, so it should be ok
|
@@ -29,16 +28,13 @@ export default class TouchableNativeFeedback extends Component {
|
|
29
28
|
extraProps['rippleColor'] = background.color;
|
30
29
|
} else if (background.type === 'ThemeAttrAndroid') {
|
31
30
|
extraProps['borderless'] = background.attribute === 'selectableItemBackgroundBorderless';
|
32
|
-
}
|
33
|
-
|
34
|
-
|
31
|
+
}
|
32
|
+
// I moved it from above since it should be available in all options
|
35
33
|
extraProps['rippleRadius'] = background.rippleRadius;
|
36
34
|
}
|
37
|
-
|
38
35
|
extraProps['foreground'] = this.props.useForeground;
|
39
36
|
return extraProps;
|
40
37
|
}
|
41
|
-
|
42
38
|
render() {
|
43
39
|
const {
|
44
40
|
style = {},
|
@@ -49,36 +45,32 @@ export default class TouchableNativeFeedback extends Component {
|
|
49
45
|
extraButtonProps: this.getExtraButtonProps()
|
50
46
|
}));
|
51
47
|
}
|
52
|
-
|
53
48
|
}
|
54
|
-
|
55
|
-
|
49
|
+
_defineProperty(TouchableNativeFeedback, "defaultProps", {
|
50
|
+
...GenericTouchable.defaultProps,
|
56
51
|
useForeground: true,
|
57
52
|
extraButtonProps: {
|
58
53
|
// Disable hiding ripple on Android
|
59
54
|
rippleColor: null
|
60
55
|
}
|
61
56
|
});
|
62
|
-
|
57
|
+
// Could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change
|
63
58
|
_defineProperty(TouchableNativeFeedback, "SelectableBackground", rippleRadius => ({
|
64
59
|
type: 'ThemeAttrAndroid',
|
65
60
|
// I added `attribute` prop to clone the implementation of RN and be able to use only 2 types
|
66
61
|
attribute: 'selectableItemBackground',
|
67
62
|
rippleRadius
|
68
63
|
}));
|
69
|
-
|
70
64
|
_defineProperty(TouchableNativeFeedback, "SelectableBackgroundBorderless", rippleRadius => ({
|
71
65
|
type: 'ThemeAttrAndroid',
|
72
66
|
attribute: 'selectableItemBackgroundBorderless',
|
73
67
|
rippleRadius
|
74
68
|
}));
|
75
|
-
|
76
69
|
_defineProperty(TouchableNativeFeedback, "Ripple", (color, borderless, rippleRadius) => ({
|
77
70
|
type: 'RippleAndroid',
|
78
71
|
color,
|
79
72
|
borderless,
|
80
73
|
rippleRadius
|
81
74
|
}));
|
82
|
-
|
83
75
|
_defineProperty(TouchableNativeFeedback, "canUseNativeForeground", () => Platform.OS === 'android' && Platform.Version >= 23);
|
84
76
|
//# sourceMappingURL=TouchableNativeFeedback.android.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["Platform","React","Component","GenericTouchable","TouchableNativeFeedback","getExtraButtonProps","extraProps","background","props","type","borderless","color","attribute","rippleRadius","useForeground","render","style","rest","createElement","_extends","extraButtonProps","_defineProperty","defaultProps","rippleColor","OS","Version"],"sources":["TouchableNativeFeedback.android.tsx"],"sourcesContent":["import { Platform, ColorValue } from 'react-native';\nimport * as React from 'react';\nimport { Component } from 'react';\nimport GenericTouchable from './GenericTouchable';\nimport {\n TouchableNativeFeedbackProps,\n TouchableNativeFeedbackExtraProps,\n} from './TouchableNativeFeedbackProps';\n\n/**\n * @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.\n *\n * TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.\n * There's small difference with handling long press ripple since RN's implementation calls\n * ripple animation via bridge. This solution leaves all animations' handling for native components so\n * it follows native behaviours.\n */\nexport default class TouchableNativeFeedback extends Component<TouchableNativeFeedbackProps> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n useForeground: true,\n extraButtonProps: {\n // Disable hiding ripple on Android\n rippleColor: null,\n },\n };\n\n // Could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change\n static SelectableBackground = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n // I added `attribute` prop to clone the implementation of RN and be able to use only 2 types\n attribute: 'selectableItemBackground',\n rippleRadius,\n });\n static SelectableBackgroundBorderless = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n attribute: 'selectableItemBackgroundBorderless',\n rippleRadius,\n });\n static Ripple = (\n color: ColorValue,\n borderless: boolean,\n rippleRadius?: number\n ) => ({\n type: 'RippleAndroid',\n color,\n borderless,\n rippleRadius,\n });\n\n static canUseNativeForeground = () =>\n Platform.OS === 'android' && Platform.Version >= 23;\n\n getExtraButtonProps() {\n const extraProps: TouchableNativeFeedbackExtraProps = {};\n const { background } = this.props;\n if (background) {\n // I changed type values to match those used in RN\n // TODO(TS): check if it works the same as previous implementation - looks like it works the same as RN component, so it should be ok\n if (background.type === 'RippleAndroid') {\n extraProps['borderless'] = background.borderless;\n extraProps['rippleColor'] = background.color;\n } else if (background.type === 'ThemeAttrAndroid') {\n extraProps['borderless'] =\n background.attribute === 'selectableItemBackgroundBorderless';\n }\n // I moved it from above since it should be available in all options\n extraProps['rippleRadius'] = background.rippleRadius;\n }\n extraProps['foreground'] = this.props.useForeground;\n return extraProps;\n }\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n <GenericTouchable\n {...rest}\n style={style}\n extraButtonProps={this.getExtraButtonProps()}\n />\n );\n }\n}\n"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAoB,cAAc;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,OAAOC,gBAAgB,MAAM,oBAAoB;AAMjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,uBAAuB,SAAS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AAC;AAAAQ,eAAA,CAhBiBjB,uBAAuB,oCAiBDS,YAAqB,KAAM;EAClEJ,IAAI,EAAE,kBAAkB;EACxBG,SAAS,EAAE,oCAAoC;EAC/CC;AACF,CAAC,CAAC;AAAAQ,eAAA,CArBiBjB,uBAAuB,YAsB1B,CACdO,KAAiB,EACjBD,UAAmB,EACnBG,YAAqB,MACjB;EACJJ,IAAI,EAAE,eAAe;EACrBE,KAAK;EACLD,UAAU;EACVG;AACF,CAAC,CAAC;AAAAQ,eAAA,CA/BiBjB,uBAAuB,4BAiCV,MAC9BJ,QAAQ,CAACwB,EAAE,KAAK,SAAS,IAAIxB,QAAQ,CAACyB,OAAO,IAAI,EAAE","ignoreList":[]}
|
@@ -1,3 +1,8 @@
|
|
1
|
-
import { TouchableNativeFeedback } from 'react-native';
|
1
|
+
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
5
|
+
*/
|
6
|
+
const TouchableNativeFeedback = RNTouchableNativeFeedback;
|
2
7
|
export default TouchableNativeFeedback;
|
3
8
|
//# sourceMappingURL=TouchableNativeFeedback.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["TouchableNativeFeedback","RNTouchableNativeFeedback"],"sources":["TouchableNativeFeedback.tsx"],"sourcesContent":["import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';\n\n/**\n * @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.\n */\nconst TouchableNativeFeedback = RNTouchableNativeFeedback;\n\nexport default TouchableNativeFeedback;\n"],"mappings":"AAAA,SAASA,uBAAuB,IAAIC,yBAAyB,QAAQ,cAAc;;AAEnF;AACA;AACA;AACA,MAAMD,uBAAuB,GAAGC,yBAAyB;AAEzD,eAAeD,uBAAuB","ignoreList":[]}
|