react-native-gesture-handler 2.23.0 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNGestureHandler.podspec +8 -0
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +8 -11
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +10 -2
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +6 -1
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +3 -1
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +5 -3
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +6 -2
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +3 -1
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +2 -1
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +3 -4
- package/lib/commonjs/State.js.map +1 -1
- package/lib/commonjs/TouchEventType.js +3 -3
- package/lib/commonjs/TouchEventType.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +115 -90
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +81 -28
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +37 -26
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +27 -13
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +6 -2
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +77 -29
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js +3 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +20 -5
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +76 -38
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +75 -34
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +23 -9
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +34 -19
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +25 -16
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +13 -9
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +12 -7
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +4 -1
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +14 -5
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +6 -1
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +14 -13
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +2 -1
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +134 -50
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +27 -17
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +14 -5
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +20 -10
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +24 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +84 -44
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +21 -6
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +26 -6
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +104 -75
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +11 -4
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +5 -4
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +83 -19
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +15 -5
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +12 -3
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +28 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +23 -5
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +4 -2
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +47 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +17 -9
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +41 -7
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +78 -11
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +22 -5
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +14 -7
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +45 -9
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +18 -3
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +55 -26
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +3 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +16 -9
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +26 -13
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +14 -4
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +1 -3
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +3 -9
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +5 -2
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +1 -0
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +1 -0
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +4 -3
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +0 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +20 -10
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +17 -18
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/RNRenderer.js.map +1 -1
- package/lib/module/RNRenderer.web.js.map +1 -1
- package/lib/module/State.js +1 -4
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +1 -3
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +99 -80
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +55 -19
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +12 -17
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +4 -4
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.web.js +2 -1
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +2 -1
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +2 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +2 -1
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +59 -26
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/PressableProps.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/Pressable/utils.js +14 -4
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +56 -34
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +30 -14
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +59 -28
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +10 -6
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js +2 -2
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchable.js +63 -34
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +24 -15
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +16 -10
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +3 -6
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/findNodeHandle.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +11 -5
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/getReactNativeVersion.js.map +1 -1
- package/lib/module/getReactNativeVersion.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +13 -13
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -6
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -6
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +19 -8
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -2
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -2
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -6
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +106 -47
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +17 -12
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +4 -9
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -3
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +6 -5
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +14 -11
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +6 -2
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +38 -14
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +9 -5
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +73 -44
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +24 -16
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +14 -1
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +18 -9
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +11 -6
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +4 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +9 -5
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +41 -18
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +7 -2
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +7 -2
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +19 -10
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +5 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +13 -4
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +2 -3
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +66 -20
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +7 -3
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +10 -3
- package/lib/module/mountRegistry.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/typeUtils.js.map +1 -1
- package/lib/module/utils.js +11 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +1 -2
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +38 -5
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +181 -61
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +40 -5
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +114 -7
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +59 -5
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +14 -9
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +13 -3
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +39 -7
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +71 -10
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +19 -5
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +19 -3
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +65 -30
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +12 -7
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +35 -9
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +39 -8
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +14 -3
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +25 -8
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +10 -3
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +40 -21
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +1 -0
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +130 -53
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +8 -6
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +40 -6
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +34 -13
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +45 -31
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +1 -2
- package/lib/module/web_hammer/constants.js.map +1 -1
- package/lib/module/web_hammer/utils.js +2 -2
- package/lib/module/web_hammer/utils.js.map +1 -1
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/touchables/TouchableHighlight.tsx +2 -2
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +1 -1
- package/src/components/touchables/TouchableOpacity.tsx +2 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +2 -2
@@ -1,11 +1,10 @@
|
|
1
|
-
function _extends() {
|
2
|
-
|
3
|
-
function
|
4
|
-
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
+
|
5
5
|
// Similarily to the DrawerLayout component this deserves to be put in a
|
6
6
|
// separate repo. Although, keeping it here for the time being will allow us to
|
7
7
|
// move faster and fix possible issues quicker
|
8
|
-
|
9
8
|
import * as React from 'react';
|
10
9
|
import { Component } from 'react';
|
11
10
|
import { Animated, StyleSheet, View, I18nManager } from 'react-native';
|
@@ -14,25 +13,27 @@ import { TapGestureHandler } from '../handlers/TapGestureHandler';
|
|
14
13
|
import { State } from '../State';
|
15
14
|
const DRAG_TOSS = 0.05;
|
16
15
|
|
17
|
-
// Animated.AnimatedInterpolation has been converted to a generic type
|
18
|
-
// in @types/react-native 0.70. This way we can maintain compatibility
|
19
|
-
// with all versions of @types/react-native
|
20
|
-
|
21
16
|
/**
|
22
17
|
* @deprecated use Reanimated version of Swipeable instead
|
23
18
|
*
|
24
19
|
* This component allows for implementing swipeable rows or similar interaction.
|
25
20
|
*/
|
26
|
-
|
27
21
|
export default class Swipeable extends Component {
|
28
22
|
constructor(_props) {
|
29
23
|
super(_props);
|
24
|
+
|
30
25
|
_defineProperty(this, "onGestureEvent", void 0);
|
26
|
+
|
31
27
|
_defineProperty(this, "transX", void 0);
|
28
|
+
|
32
29
|
_defineProperty(this, "showLeftAction", void 0);
|
30
|
+
|
33
31
|
_defineProperty(this, "leftActionTranslate", void 0);
|
32
|
+
|
34
33
|
_defineProperty(this, "showRightAction", void 0);
|
34
|
+
|
35
35
|
_defineProperty(this, "rightActionTranslate", void 0);
|
36
|
+
|
36
37
|
_defineProperty(this, "updateAnimatedEvent", (props, state) => {
|
37
38
|
const {
|
38
39
|
friction,
|
@@ -79,6 +80,7 @@ export default class Swipeable extends Component {
|
|
79
80
|
extrapolate: 'clamp'
|
80
81
|
});
|
81
82
|
});
|
83
|
+
|
82
84
|
_defineProperty(this, "onTapHandlerStateChange", ({
|
83
85
|
nativeEvent
|
84
86
|
}) => {
|
@@ -86,10 +88,12 @@ export default class Swipeable extends Component {
|
|
86
88
|
this.close();
|
87
89
|
}
|
88
90
|
});
|
91
|
+
|
89
92
|
_defineProperty(this, "onHandlerStateChange", ev => {
|
90
93
|
if (ev.nativeEvent.oldState === State.ACTIVE) {
|
91
94
|
this.handleRelease(ev);
|
92
95
|
}
|
96
|
+
|
93
97
|
if (ev.nativeEvent.state === State.ACTIVE) {
|
94
98
|
const {
|
95
99
|
velocityX,
|
@@ -103,15 +107,19 @@ export default class Swipeable extends Component {
|
|
103
107
|
} = this.props;
|
104
108
|
const translationX = (dragX + DRAG_TOSS * velocityX) / friction;
|
105
109
|
const direction = rowState === -1 ? 'right' : rowState === 1 ? 'left' : translationX > 0 ? 'left' : 'right';
|
110
|
+
|
106
111
|
if (rowState === 0) {
|
107
112
|
var _this$props$onSwipeab, _this$props;
|
108
|
-
|
113
|
+
|
114
|
+
(_this$props$onSwipeab = (_this$props = this.props).onSwipeableOpenStartDrag) === null || _this$props$onSwipeab === void 0 ? void 0 : _this$props$onSwipeab.call(_this$props, direction);
|
109
115
|
} else {
|
110
116
|
var _this$props$onSwipeab2, _this$props2;
|
111
|
-
|
117
|
+
|
118
|
+
(_this$props$onSwipeab2 = (_this$props2 = this.props).onSwipeableCloseStartDrag) === null || _this$props$onSwipeab2 === void 0 ? void 0 : _this$props$onSwipeab2.call(_this$props2, direction);
|
112
119
|
}
|
113
120
|
}
|
114
121
|
});
|
122
|
+
|
115
123
|
_defineProperty(this, "handleRelease", ev => {
|
116
124
|
const {
|
117
125
|
velocityX,
|
@@ -134,6 +142,7 @@ export default class Swipeable extends Component {
|
|
134
142
|
const startOffsetX = this.currentOffset() + dragX / friction;
|
135
143
|
const translationX = (dragX + DRAG_TOSS * velocityX) / friction;
|
136
144
|
let toValue = 0;
|
145
|
+
|
137
146
|
if (rowState === 0) {
|
138
147
|
if (translationX > leftThreshold) {
|
139
148
|
toValue = leftWidth;
|
@@ -151,8 +160,10 @@ export default class Swipeable extends Component {
|
|
151
160
|
toValue = -rightWidth;
|
152
161
|
}
|
153
162
|
}
|
163
|
+
|
154
164
|
this.animateRow(startOffsetX, toValue, velocityX / friction);
|
155
165
|
});
|
166
|
+
|
156
167
|
_defineProperty(this, "animateRow", (fromValue, toValue, velocityX) => {
|
157
168
|
const {
|
158
169
|
dragX,
|
@@ -177,33 +188,41 @@ export default class Swipeable extends Component {
|
|
177
188
|
if (finished) {
|
178
189
|
if (toValue > 0) {
|
179
190
|
var _this$props$onSwipeab3, _this$props3, _this$props$onSwipeab4, _this$props4;
|
180
|
-
|
181
|
-
(_this$props$
|
191
|
+
|
192
|
+
(_this$props$onSwipeab3 = (_this$props3 = this.props).onSwipeableLeftOpen) === null || _this$props$onSwipeab3 === void 0 ? void 0 : _this$props$onSwipeab3.call(_this$props3);
|
193
|
+
(_this$props$onSwipeab4 = (_this$props4 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab4 === void 0 ? void 0 : _this$props$onSwipeab4.call(_this$props4, 'left', this);
|
182
194
|
} else if (toValue < 0) {
|
183
195
|
var _this$props$onSwipeab5, _this$props5, _this$props$onSwipeab6, _this$props6;
|
184
|
-
|
185
|
-
(_this$props$
|
196
|
+
|
197
|
+
(_this$props$onSwipeab5 = (_this$props5 = this.props).onSwipeableRightOpen) === null || _this$props$onSwipeab5 === void 0 ? void 0 : _this$props$onSwipeab5.call(_this$props5);
|
198
|
+
(_this$props$onSwipeab6 = (_this$props6 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab6 === void 0 ? void 0 : _this$props$onSwipeab6.call(_this$props6, 'right', this);
|
186
199
|
} else {
|
187
200
|
var _this$props$onSwipeab7, _this$props7;
|
201
|
+
|
188
202
|
const closingDirection = fromValue > 0 ? 'left' : 'right';
|
189
|
-
(_this$props$onSwipeab7 = (_this$props7 = this.props).onSwipeableClose) === null || _this$props$onSwipeab7 === void 0
|
203
|
+
(_this$props$onSwipeab7 = (_this$props7 = this.props).onSwipeableClose) === null || _this$props$onSwipeab7 === void 0 ? void 0 : _this$props$onSwipeab7.call(_this$props7, closingDirection, this);
|
190
204
|
}
|
191
205
|
}
|
192
206
|
});
|
207
|
+
|
193
208
|
if (toValue > 0) {
|
194
209
|
var _this$props$onSwipeab8, _this$props8, _this$props$onSwipeab9, _this$props9;
|
195
|
-
|
196
|
-
(_this$props$
|
210
|
+
|
211
|
+
(_this$props$onSwipeab8 = (_this$props8 = this.props).onSwipeableLeftWillOpen) === null || _this$props$onSwipeab8 === void 0 ? void 0 : _this$props$onSwipeab8.call(_this$props8);
|
212
|
+
(_this$props$onSwipeab9 = (_this$props9 = this.props).onSwipeableWillOpen) === null || _this$props$onSwipeab9 === void 0 ? void 0 : _this$props$onSwipeab9.call(_this$props9, 'left');
|
197
213
|
} else if (toValue < 0) {
|
198
214
|
var _this$props$onSwipeab10, _this$props10, _this$props$onSwipeab11, _this$props11;
|
199
|
-
|
200
|
-
(_this$props$
|
215
|
+
|
216
|
+
(_this$props$onSwipeab10 = (_this$props10 = this.props).onSwipeableRightWillOpen) === null || _this$props$onSwipeab10 === void 0 ? void 0 : _this$props$onSwipeab10.call(_this$props10);
|
217
|
+
(_this$props$onSwipeab11 = (_this$props11 = this.props).onSwipeableWillOpen) === null || _this$props$onSwipeab11 === void 0 ? void 0 : _this$props$onSwipeab11.call(_this$props11, 'right');
|
201
218
|
} else {
|
202
219
|
var _this$props$onSwipeab12, _this$props12;
|
220
|
+
|
203
221
|
const closingDirection = fromValue > 0 ? 'left' : 'right';
|
204
|
-
(_this$props$onSwipeab12 = (_this$props12 = this.props).onSwipeableWillClose) === null || _this$props$onSwipeab12 === void 0
|
222
|
+
(_this$props$onSwipeab12 = (_this$props12 = this.props).onSwipeableWillClose) === null || _this$props$onSwipeab12 === void 0 ? void 0 : _this$props$onSwipeab12.call(_this$props12, closingDirection);
|
205
223
|
}
|
206
224
|
});
|
225
|
+
|
207
226
|
_defineProperty(this, "onRowLayout", ({
|
208
227
|
nativeEvent
|
209
228
|
}) => {
|
@@ -211,6 +230,7 @@ export default class Swipeable extends Component {
|
|
211
230
|
rowWidth: nativeEvent.layout.width
|
212
231
|
});
|
213
232
|
});
|
233
|
+
|
214
234
|
_defineProperty(this, "currentOffset", () => {
|
215
235
|
const {
|
216
236
|
leftWidth = 0,
|
@@ -221,22 +241,27 @@ export default class Swipeable extends Component {
|
|
221
241
|
rightOffset = rowWidth
|
222
242
|
} = this.state;
|
223
243
|
const rightWidth = rowWidth - rightOffset;
|
244
|
+
|
224
245
|
if (rowState === 1) {
|
225
246
|
return leftWidth;
|
226
247
|
} else if (rowState === -1) {
|
227
248
|
return -rightWidth;
|
228
249
|
}
|
250
|
+
|
229
251
|
return 0;
|
230
252
|
});
|
253
|
+
|
231
254
|
_defineProperty(this, "close", () => {
|
232
255
|
this.animateRow(this.currentOffset(), 0);
|
233
256
|
});
|
257
|
+
|
234
258
|
_defineProperty(this, "openLeft", () => {
|
235
259
|
const {
|
236
260
|
leftWidth = 0
|
237
261
|
} = this.state;
|
238
262
|
this.animateRow(this.currentOffset(), leftWidth);
|
239
263
|
});
|
264
|
+
|
240
265
|
_defineProperty(this, "openRight", () => {
|
241
266
|
const {
|
242
267
|
rowWidth = 0
|
@@ -247,6 +272,7 @@ export default class Swipeable extends Component {
|
|
247
272
|
const rightWidth = rowWidth - rightOffset;
|
248
273
|
this.animateRow(this.currentOffset(), -rightWidth);
|
249
274
|
});
|
275
|
+
|
250
276
|
_defineProperty(this, "reset", () => {
|
251
277
|
const {
|
252
278
|
dragX,
|
@@ -258,7 +284,9 @@ export default class Swipeable extends Component {
|
|
258
284
|
rowState: 0
|
259
285
|
});
|
260
286
|
});
|
287
|
+
|
261
288
|
const _dragX = new Animated.Value(0);
|
289
|
+
|
262
290
|
this.state = {
|
263
291
|
dragX: _dragX,
|
264
292
|
rowTranslation: new Animated.Value(0),
|
@@ -276,12 +304,15 @@ export default class Swipeable extends Component {
|
|
276
304
|
useNativeDriver: _props.useNativeAnimations
|
277
305
|
});
|
278
306
|
}
|
307
|
+
|
279
308
|
shouldComponentUpdate(props, state) {
|
280
309
|
if (this.props.friction !== props.friction || this.props.overshootLeft !== props.overshootLeft || this.props.overshootRight !== props.overshootRight || this.props.overshootFriction !== props.overshootFriction || this.state.leftWidth !== state.leftWidth || this.state.rightOffset !== state.rightOffset || this.state.rowWidth !== state.rowWidth) {
|
281
310
|
this.updateAnimatedEvent(props, state);
|
282
311
|
}
|
312
|
+
|
283
313
|
return true;
|
284
314
|
}
|
315
|
+
|
285
316
|
render() {
|
286
317
|
const {
|
287
318
|
rowState
|
@@ -294,8 +325,7 @@ export default class Swipeable extends Component {
|
|
294
325
|
dragOffsetFromRightEdge = 10
|
295
326
|
} = this.props;
|
296
327
|
const left = renderLeftActions && /*#__PURE__*/React.createElement(Animated.View, {
|
297
|
-
style: [styles.leftActions,
|
298
|
-
// All those and below parameters can have ! since they are all
|
328
|
+
style: [styles.leftActions, // All those and below parameters can have ! since they are all
|
299
329
|
// asigned in constructor in `updateAnimatedEvent` but TS cannot spot
|
300
330
|
// it for some reason
|
301
331
|
{
|
@@ -345,22 +375,23 @@ export default class Swipeable extends Component {
|
|
345
375
|
}, this.props.childrenContainerStyle]
|
346
376
|
}, children))));
|
347
377
|
}
|
378
|
+
|
348
379
|
}
|
380
|
+
|
349
381
|
_defineProperty(Swipeable, "defaultProps", {
|
350
382
|
friction: 1,
|
351
383
|
overshootFriction: 1,
|
352
384
|
useNativeAnimations: true
|
353
385
|
});
|
386
|
+
|
354
387
|
const styles = StyleSheet.create({
|
355
388
|
container: {
|
356
389
|
overflow: 'hidden'
|
357
390
|
},
|
358
|
-
leftActions: {
|
359
|
-
...StyleSheet.absoluteFillObject,
|
391
|
+
leftActions: { ...StyleSheet.absoluteFillObject,
|
360
392
|
flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row'
|
361
393
|
},
|
362
|
-
rightActions: {
|
363
|
-
...StyleSheet.absoluteFillObject,
|
394
|
+
rightActions: { ...StyleSheet.absoluteFillObject,
|
364
395
|
flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse'
|
365
396
|
}
|
366
397
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Component","Animated","StyleSheet","View","I18nManager","PanGestureHandler","TapGestureHandler","State","DRAG_TOSS","Swipeable","constructor","props","_defineProperty","state","friction","overshootFriction","dragX","rowTranslation","leftWidth","rowWidth","rightOffset","rightWidth","Math","max","overshootLeft","overshootRight","transX","add","interpolate","inputRange","outputRange","showLeftAction","Value","leftActionTranslate","Number","MIN_VALUE","extrapolate","showRightAction","rightActionTranslate","nativeEvent","oldState","ACTIVE","close","ev","handleRelease","velocityX","translationX","rowState","direction","_this$props$onSwipeab","_this$props","onSwipeableOpenStartDrag","call","_this$props$onSwipeab2","_this$props2","onSwipeableCloseStartDrag","leftThreshold","rightThreshold","startOffsetX","currentOffset","toValue","animateRow","fromValue","setValue","setState","sign","spring","restSpeedThreshold","restDisplacementThreshold","velocity","bounciness","useNativeDriver","useNativeAnimations","animationOptions","start","finished","_this$props$onSwipeab3","_this$props3","_this$props$onSwipeab4","_this$props4","onSwipeableLeftOpen","onSwipeableOpen","_this$props$onSwipeab5","_this$props5","_this$props$onSwipeab6","_this$props6","onSwipeableRightOpen","_this$props$onSwipeab7","_this$props7","closingDirection","onSwipeableClose","_this$props$onSwipeab8","_this$props8","_this$props$onSwipeab9","_this$props9","onSwipeableLeftWillOpen","onSwipeableWillOpen","_this$props$onSwipeab10","_this$props10","_this$props$onSwipeab11","_this$props11","onSwipeableRightWillOpen","_this$props$onSwipeab12","_this$props12","onSwipeableWillClose","layout","width","undefined","updateAnimatedEvent","onGestureEvent","event","shouldComponentUpdate","render","children","renderLeftActions","renderRightActions","dragOffsetFromLeftEdge","dragOffsetFromRightEdge","left","createElement","style","styles","leftActions","transform","translateX","onLayout","x","right","rightActions","_extends","activeOffsetX","touchAction","onHandlerStateChange","onRowLayout","container","containerStyle","enabled","onTapHandlerStateChange","pointerEvents","childrenContainerStyle","create","overflow","absoluteFillObject","flexDirection","isRTL"],"sources":["Swipeable.tsx"],"sourcesContent":["// Similarily to the DrawerLayout component this deserves to be put in a\n// separate repo. Although, keeping it here for the time being will allow us to\n// move faster and fix possible issues quicker\n\nimport * as React from 'react';\nimport { Component } from 'react';\nimport {\n Animated,\n StyleSheet,\n View,\n I18nManager,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../handlers/gestureHandlerCommon';\nimport {\n PanGestureHandler,\n PanGestureHandlerProps,\n} from '../handlers/PanGestureHandler';\nimport {\n PanGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n} from '../handlers/GestureHandlerEventPayload';\nimport { TapGestureHandler } from '../handlers/TapGestureHandler';\nimport { State } from '../State';\n\nconst DRAG_TOSS = 0.05;\n\ntype SwipeableExcludes = Exclude<\n keyof PanGestureHandlerProps,\n 'onGestureEvent' | 'onHandlerStateChange'\n>;\n\n// Animated.AnimatedInterpolation has been converted to a generic type\n// in @types/react-native 0.70. This way we can maintain compatibility\n// with all versions of @types/react-native\ntype AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;\n\nexport interface SwipeableProps\n extends Pick<PanGestureHandlerProps, SwipeableExcludes> {\n /**\n * Enables two-finger gestures on supported devices, for example iPads with\n * trackpads. If not enabled the gesture will require click + drag, with\n * `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger\n * the gesture.\n */\n enableTrackpadTwoFingerGesture?: boolean;\n\n /**\n * Specifies how much the visual interaction will be delayed compared to the\n * gesture distance. e.g. value of 1 will indicate that the swipeable panel\n * should exactly follow the gesture, 2 means it is going to be two times\n * \"slower\".\n */\n friction?: number;\n\n /**\n * Distance from the left edge at which released panel will animate to the\n * open state (or the open panel will animate into the closed state). By\n * default it's a half of the panel's width.\n */\n leftThreshold?: number;\n\n /**\n * Distance from the right edge at which released panel will animate to the\n * open state (or the open panel will animate into the closed state). By\n * default it's a half of the panel's width.\n */\n rightThreshold?: number;\n\n /**\n * Distance that the panel must be dragged from the left edge to be considered\n * a swipe. The default value is 10.\n */\n dragOffsetFromLeftEdge?: number;\n\n /**\n * Distance that the panel must be dragged from the right edge to be considered\n * a swipe. The default value is 10.\n */\n dragOffsetFromRightEdge?: number;\n\n /**\n * Value indicating if the swipeable panel can be pulled further than the left\n * actions panel's width. It is set to true by default as long as the left\n * panel render method is present.\n */\n overshootLeft?: boolean;\n\n /**\n * Value indicating if the swipeable panel can be pulled further than the\n * right actions panel's width. It is set to true by default as long as the\n * right panel render method is present.\n */\n overshootRight?: boolean;\n\n /**\n * Specifies how much the visual interaction will be delayed compared to the\n * gesture distance at overshoot. Default value is 1, it mean no friction, for\n * a native feel, try 8 or above.\n */\n overshootFriction?: number;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableOpen()\n *\n * Called when left action panel gets open.\n */\n onSwipeableLeftOpen?: () => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableOpen()\n *\n * Called when right action panel gets open.\n */\n onSwipeableRightOpen?: () => void;\n\n /**\n * Called when action panel gets open (either right or left).\n */\n onSwipeableOpen?: (direction: 'left' | 'right', swipeable: Swipeable) => void;\n\n /**\n * Called when action panel is closed.\n */\n onSwipeableClose?: (\n direction: 'left' | 'right',\n swipeable: Swipeable\n ) => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableWillOpen()\n *\n * Called when left action panel starts animating on open.\n */\n onSwipeableLeftWillOpen?: () => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableWillOpen()\n *\n * Called when right action panel starts animating on open.\n */\n onSwipeableRightWillOpen?: () => void;\n\n /**\n * Called when action panel starts animating on open (either right or left).\n */\n onSwipeableWillOpen?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts animating on close.\n */\n onSwipeableWillClose?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts being shown on dragging to open.\n */\n onSwipeableOpenStartDrag?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts being shown on dragging to close.\n */\n onSwipeableCloseStartDrag?: (direction: 'left' | 'right') => void;\n\n /**\n *\n * This map describes the values to use as inputRange for extra interpolation:\n * AnimatedValue: [startValue, endValue]\n *\n * progressAnimatedValue: [0, 1] dragAnimatedValue: [0, +]\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderLeftActions?: (\n progressAnimatedValue: AnimatedInterpolation,\n dragAnimatedValue: AnimatedInterpolation,\n swipeable: Swipeable\n ) => React.ReactNode;\n /**\n *\n * This map describes the values to use as inputRange for extra interpolation:\n * AnimatedValue: [startValue, endValue]\n *\n * progressAnimatedValue: [0, 1] dragAnimatedValue: [0, -]\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderRightActions?: (\n progressAnimatedValue: AnimatedInterpolation,\n dragAnimatedValue: AnimatedInterpolation,\n swipeable: Swipeable\n ) => React.ReactNode;\n\n useNativeAnimations?: boolean;\n\n animationOptions?: Record<string, unknown>;\n\n /**\n * Style object for the container (`Animated.View`), for example to override\n * `overflow: 'hidden'`.\n */\n containerStyle?: StyleProp<ViewStyle>;\n\n /**\n * Style object for the children container (`Animated.View`), for example to\n * apply `flex: 1`\n */\n childrenContainerStyle?: StyleProp<ViewStyle>;\n}\n\ntype SwipeableState = {\n dragX: Animated.Value;\n rowTranslation: Animated.Value;\n rowState: number;\n leftWidth?: number;\n rightOffset?: number;\n rowWidth?: number;\n};\n\n/**\n * @deprecated use Reanimated version of Swipeable instead\n *\n * This component allows for implementing swipeable rows or similar interaction.\n */\n\nexport default class Swipeable extends Component<\n SwipeableProps,\n SwipeableState\n> {\n static defaultProps = {\n friction: 1,\n overshootFriction: 1,\n useNativeAnimations: true,\n };\n\n constructor(props: SwipeableProps) {\n super(props);\n const dragX = new Animated.Value(0);\n this.state = {\n dragX,\n rowTranslation: new Animated.Value(0),\n rowState: 0,\n leftWidth: undefined,\n rightOffset: undefined,\n rowWidth: undefined,\n };\n this.updateAnimatedEvent(props, this.state);\n\n this.onGestureEvent = Animated.event(\n [{ nativeEvent: { translationX: dragX } }],\n { useNativeDriver: props.useNativeAnimations! }\n );\n }\n\n shouldComponentUpdate(props: SwipeableProps, state: SwipeableState) {\n if (\n this.props.friction !== props.friction ||\n this.props.overshootLeft !== props.overshootLeft ||\n this.props.overshootRight !== props.overshootRight ||\n this.props.overshootFriction !== props.overshootFriction ||\n this.state.leftWidth !== state.leftWidth ||\n this.state.rightOffset !== state.rightOffset ||\n this.state.rowWidth !== state.rowWidth\n ) {\n this.updateAnimatedEvent(props, state);\n }\n\n return true;\n }\n\n private onGestureEvent?: (\n event: GestureEvent<PanGestureHandlerEventPayload>\n ) => void;\n private transX?: AnimatedInterpolation;\n private showLeftAction?: AnimatedInterpolation | Animated.Value;\n private leftActionTranslate?: AnimatedInterpolation;\n private showRightAction?: AnimatedInterpolation | Animated.Value;\n private rightActionTranslate?: AnimatedInterpolation;\n\n private updateAnimatedEvent = (\n props: SwipeableProps,\n state: SwipeableState\n ) => {\n const { friction, overshootFriction } = props;\n const { dragX, rowTranslation, leftWidth = 0, rowWidth = 0 } = state;\n const { rightOffset = rowWidth } = state;\n const rightWidth = Math.max(0, rowWidth - rightOffset);\n\n const { overshootLeft = leftWidth > 0, overshootRight = rightWidth > 0 } =\n props;\n\n const transX = Animated.add(\n rowTranslation,\n dragX.interpolate({\n inputRange: [0, friction!],\n outputRange: [0, 1],\n })\n ).interpolate({\n inputRange: [-rightWidth - 1, -rightWidth, leftWidth, leftWidth + 1],\n outputRange: [\n -rightWidth - (overshootRight ? 1 / overshootFriction! : 0),\n -rightWidth,\n leftWidth,\n leftWidth + (overshootLeft ? 1 / overshootFriction! : 0),\n ],\n });\n this.transX = transX;\n this.showLeftAction =\n leftWidth > 0\n ? transX.interpolate({\n inputRange: [-1, 0, leftWidth],\n outputRange: [0, 0, 1],\n })\n : new Animated.Value(0);\n this.leftActionTranslate = this.showLeftAction.interpolate({\n inputRange: [0, Number.MIN_VALUE],\n outputRange: [-10000, 0],\n extrapolate: 'clamp',\n });\n this.showRightAction =\n rightWidth > 0\n ? transX.interpolate({\n inputRange: [-rightWidth, 0, 1],\n outputRange: [1, 0, 0],\n })\n : new Animated.Value(0);\n this.rightActionTranslate = this.showRightAction.interpolate({\n inputRange: [0, Number.MIN_VALUE],\n outputRange: [-10000, 0],\n extrapolate: 'clamp',\n });\n };\n\n private onTapHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<TapGestureHandlerEventPayload>) => {\n if (nativeEvent.oldState === State.ACTIVE) {\n this.close();\n }\n };\n\n private onHandlerStateChange = (\n ev: HandlerStateChangeEvent<PanGestureHandlerEventPayload>\n ) => {\n if (ev.nativeEvent.oldState === State.ACTIVE) {\n this.handleRelease(ev);\n }\n\n if (ev.nativeEvent.state === State.ACTIVE) {\n const { velocityX, translationX: dragX } = ev.nativeEvent;\n const { rowState } = this.state;\n const { friction } = this.props;\n\n const translationX = (dragX + DRAG_TOSS * velocityX) / friction!;\n\n const direction =\n rowState === -1\n ? 'right'\n : rowState === 1\n ? 'left'\n : translationX > 0\n ? 'left'\n : 'right';\n\n if (rowState === 0) {\n this.props.onSwipeableOpenStartDrag?.(direction);\n } else {\n this.props.onSwipeableCloseStartDrag?.(direction);\n }\n }\n };\n\n private handleRelease = (\n ev: HandlerStateChangeEvent<PanGestureHandlerEventPayload>\n ) => {\n const { velocityX, translationX: dragX } = ev.nativeEvent;\n const { leftWidth = 0, rowWidth = 0, rowState } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n const {\n friction,\n leftThreshold = leftWidth / 2,\n rightThreshold = rightWidth / 2,\n } = this.props;\n\n const startOffsetX = this.currentOffset() + dragX / friction!;\n const translationX = (dragX + DRAG_TOSS * velocityX) / friction!;\n\n let toValue = 0;\n if (rowState === 0) {\n if (translationX > leftThreshold) {\n toValue = leftWidth;\n } else if (translationX < -rightThreshold) {\n toValue = -rightWidth;\n }\n } else if (rowState === 1) {\n // Swiped to left\n if (translationX > -leftThreshold) {\n toValue = leftWidth;\n }\n } else {\n // Swiped to right\n if (translationX < rightThreshold) {\n toValue = -rightWidth;\n }\n }\n\n this.animateRow(startOffsetX, toValue, velocityX / friction!);\n };\n\n private animateRow = (\n fromValue: number,\n toValue: number,\n velocityX?:\n | number\n | {\n x: number;\n y: number;\n }\n ) => {\n const { dragX, rowTranslation } = this.state;\n dragX.setValue(0);\n rowTranslation.setValue(fromValue);\n\n this.setState({ rowState: Math.sign(toValue) });\n Animated.spring(rowTranslation, {\n restSpeedThreshold: 1.7,\n restDisplacementThreshold: 0.4,\n velocity: velocityX,\n bounciness: 0,\n toValue,\n useNativeDriver: this.props.useNativeAnimations!,\n ...this.props.animationOptions,\n }).start(({ finished }) => {\n if (finished) {\n if (toValue > 0) {\n this.props.onSwipeableLeftOpen?.();\n this.props.onSwipeableOpen?.('left', this);\n } else if (toValue < 0) {\n this.props.onSwipeableRightOpen?.();\n this.props.onSwipeableOpen?.('right', this);\n } else {\n const closingDirection = fromValue > 0 ? 'left' : 'right';\n this.props.onSwipeableClose?.(closingDirection, this);\n }\n }\n });\n if (toValue > 0) {\n this.props.onSwipeableLeftWillOpen?.();\n this.props.onSwipeableWillOpen?.('left');\n } else if (toValue < 0) {\n this.props.onSwipeableRightWillOpen?.();\n this.props.onSwipeableWillOpen?.('right');\n } else {\n const closingDirection = fromValue > 0 ? 'left' : 'right';\n this.props.onSwipeableWillClose?.(closingDirection);\n }\n };\n\n private onRowLayout = ({ nativeEvent }: LayoutChangeEvent) => {\n this.setState({ rowWidth: nativeEvent.layout.width });\n };\n\n private currentOffset = () => {\n const { leftWidth = 0, rowWidth = 0, rowState } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n if (rowState === 1) {\n return leftWidth;\n } else if (rowState === -1) {\n return -rightWidth;\n }\n return 0;\n };\n\n close = () => {\n this.animateRow(this.currentOffset(), 0);\n };\n\n openLeft = () => {\n const { leftWidth = 0 } = this.state;\n this.animateRow(this.currentOffset(), leftWidth);\n };\n\n openRight = () => {\n const { rowWidth = 0 } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n this.animateRow(this.currentOffset(), -rightWidth);\n };\n\n reset = () => {\n const { dragX, rowTranslation } = this.state;\n dragX.setValue(0);\n rowTranslation.setValue(0);\n this.setState({ rowState: 0 });\n };\n\n render() {\n const { rowState } = this.state;\n const {\n children,\n renderLeftActions,\n renderRightActions,\n dragOffsetFromLeftEdge = 10,\n dragOffsetFromRightEdge = 10,\n } = this.props;\n\n const left = renderLeftActions && (\n <Animated.View\n style={[\n styles.leftActions,\n // All those and below parameters can have ! since they are all\n // asigned in constructor in `updateAnimatedEvent` but TS cannot spot\n // it for some reason\n { transform: [{ translateX: this.leftActionTranslate! }] },\n ]}>\n {renderLeftActions(this.showLeftAction!, this.transX!, this)}\n <View\n onLayout={({ nativeEvent }) =>\n this.setState({ leftWidth: nativeEvent.layout.x })\n }\n />\n </Animated.View>\n );\n\n const right = renderRightActions && (\n <Animated.View\n style={[\n styles.rightActions,\n { transform: [{ translateX: this.rightActionTranslate! }] },\n ]}>\n {renderRightActions(this.showRightAction!, this.transX!, this)}\n <View\n onLayout={({ nativeEvent }) =>\n this.setState({ rightOffset: nativeEvent.layout.x })\n }\n />\n </Animated.View>\n );\n\n return (\n <PanGestureHandler\n activeOffsetX={[-dragOffsetFromRightEdge, dragOffsetFromLeftEdge]}\n touchAction=\"pan-y\"\n {...this.props}\n onGestureEvent={this.onGestureEvent}\n onHandlerStateChange={this.onHandlerStateChange}>\n <Animated.View\n onLayout={this.onRowLayout}\n style={[styles.container, this.props.containerStyle]}>\n {left}\n {right}\n <TapGestureHandler\n enabled={rowState !== 0}\n touchAction=\"pan-y\"\n onHandlerStateChange={this.onTapHandlerStateChange}>\n <Animated.View\n pointerEvents={rowState === 0 ? 'auto' : 'box-only'}\n style={[\n {\n transform: [{ translateX: this.transX! }],\n },\n this.props.childrenContainerStyle,\n ]}>\n {children}\n </Animated.View>\n </TapGestureHandler>\n </Animated.View>\n </PanGestureHandler>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n },\n leftActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',\n },\n rightActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',\n },\n});\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,SACEC,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AK,CAAC4H,cAAc;IAAE,GACpDjB,IAAI,EACJS,KAAK,eACNhI,KAAA,CAAAwH,aAAA,CAACjH,iBAAiB;MAChBkI,OAAO,EAAEzF,QAAQ,KAAK,CAAE;MACxBoF,WAAW,EAAC,OAAO;MACnBC,oBAAoB,EAAE,IAAI,CAACK;IAAwB,gBACnD1I,KAAA,CAAAwH,aAAA,CAACtH,QAAQ,CAACE,IAAI;MACZuI,aAAa,EAAE3F,QAAQ,KAAK,CAAC,GAAG,MAAM,GAAG,UAAW;MACpDyE,KAAK,EAAE,CACL;QACEG,SAAS,EAAE,CAAC;UAAEC,UAAU,EAAE,IAAI,CAAClG;QAAQ,CAAC;MAC1C,CAAC,EACD,IAAI,CAACf,KAAK,CAACgI,sBAAsB;IACjC,GACD1B,QACY,CACE,CACN,CACE,CAAC;EAExB;AACF;AAACrG,eAAA,CA3VoBH,SAAS,kBAIN;EACpBK,QAAQ,EAAE,CAAC;EACXC,iBAAiB,EAAE,CAAC;EACpByD,mBAAmB,EAAE;AACvB,CAAC;AAqVH,MAAMiD,MAAM,GAAGvH,UAAU,CAAC0I,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,QAAQ,EAAE;EACZ,CAAC;EACDnB,WAAW,EAAE;IACX,GAAGxH,UAAU,CAAC4I,kBAAkB;IAChCC,aAAa,EAAE3I,WAAW,CAAC4I,KAAK,GAAG,aAAa,GAAG;EACrD,CAAC;EACDhB,YAAY,EAAE;IACZ,GAAG9H,UAAU,CAAC4I,kBAAkB;IAChCC,aAAa,EAAE3I,WAAW,CAAC4I,KAAK,GAAG,KAAK,GAAG;EAC7C;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"sources":["Swipeable.tsx"],"names":["React","Component","Animated","StyleSheet","View","I18nManager","PanGestureHandler","TapGestureHandler","State","DRAG_TOSS","Swipeable","constructor","props","state","friction","overshootFriction","dragX","rowTranslation","leftWidth","rowWidth","rightOffset","rightWidth","Math","max","overshootLeft","overshootRight","transX","add","interpolate","inputRange","outputRange","showLeftAction","Value","leftActionTranslate","Number","MIN_VALUE","extrapolate","showRightAction","rightActionTranslate","nativeEvent","oldState","ACTIVE","close","ev","handleRelease","velocityX","translationX","rowState","direction","onSwipeableOpenStartDrag","onSwipeableCloseStartDrag","leftThreshold","rightThreshold","startOffsetX","currentOffset","toValue","animateRow","fromValue","setValue","setState","sign","spring","restSpeedThreshold","restDisplacementThreshold","velocity","bounciness","useNativeDriver","useNativeAnimations","animationOptions","start","finished","onSwipeableLeftOpen","onSwipeableOpen","onSwipeableRightOpen","closingDirection","onSwipeableClose","onSwipeableLeftWillOpen","onSwipeableWillOpen","onSwipeableRightWillOpen","onSwipeableWillClose","layout","width","undefined","updateAnimatedEvent","onGestureEvent","event","shouldComponentUpdate","render","children","renderLeftActions","renderRightActions","dragOffsetFromLeftEdge","dragOffsetFromRightEdge","left","styles","leftActions","transform","translateX","x","right","rightActions","onHandlerStateChange","onRowLayout","container","containerStyle","onTapHandlerStateChange","childrenContainerStyle","create","overflow","absoluteFillObject","flexDirection","isRTL"],"mappings":";;;;AAAA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,SACEC,QADF,EAEEC,UAFF,EAGEC,IAHF,EAIEC,WAJF,QAQO,cARP;AAcA,SACEC,iBADF,QAGO,+BAHP;AAQA,SAASC,iBAAT,QAAkC,+BAAlC;AACA,SAASC,KAAT,QAAsB,UAAtB;AAEA,MAAMC,SAAS,GAAG,IAAlB;;AAiMA;AACA;AACA;AACA;AACA;AAEA,eAAe,MAAMC,SAAN,SAAwBT,SAAxB,CAGb;AAOAU,EAAAA,WAAW,CAACC,MAAD,EAAwB;AACjC,UAAMA,MAAN;;AADiC;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA,iDA4CL,CAC5BA,KAD4B,EAE5BC,KAF4B,KAGzB;AACH,YAAM;AAAEC,QAAAA,QAAF;AAAYC,QAAAA;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X,CAAkB;AAC/BJ,EAAAA,SAAS,EAAE;AACTK,IAAAA,QAAQ,EAAE;AADD,GADoB;AAI/Bb,EAAAA,WAAW,EAAE,EACX,GAAG5F,UAAU,CAAC0G,kBADH;AAEXC,IAAAA,aAAa,EAAEzG,WAAW,CAAC0G,KAAZ,GAAoB,aAApB,GAAoC;AAFxC,GAJkB;AAQ/BX,EAAAA,YAAY,EAAE,EACZ,GAAGjG,UAAU,CAAC0G,kBADF;AAEZC,IAAAA,aAAa,EAAEzG,WAAW,CAAC0G,KAAZ,GAAoB,KAApB,GAA4B;AAF/B;AARiB,CAAlB,CAAf","sourcesContent":["// Similarily to the DrawerLayout component this deserves to be put in a\n// separate repo. Although, keeping it here for the time being will allow us to\n// move faster and fix possible issues quicker\n\nimport * as React from 'react';\nimport { Component } from 'react';\nimport {\n Animated,\n StyleSheet,\n View,\n I18nManager,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../handlers/gestureHandlerCommon';\nimport {\n PanGestureHandler,\n PanGestureHandlerProps,\n} from '../handlers/PanGestureHandler';\nimport {\n PanGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n} from '../handlers/GestureHandlerEventPayload';\nimport { TapGestureHandler } from '../handlers/TapGestureHandler';\nimport { State } from '../State';\n\nconst DRAG_TOSS = 0.05;\n\ntype SwipeableExcludes = Exclude<\n keyof PanGestureHandlerProps,\n 'onGestureEvent' | 'onHandlerStateChange'\n>;\n\n// Animated.AnimatedInterpolation has been converted to a generic type\n// in @types/react-native 0.70. This way we can maintain compatibility\n// with all versions of @types/react-native\ntype AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;\n\nexport interface SwipeableProps\n extends Pick<PanGestureHandlerProps, SwipeableExcludes> {\n /**\n * Enables two-finger gestures on supported devices, for example iPads with\n * trackpads. If not enabled the gesture will require click + drag, with\n * `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger\n * the gesture.\n */\n enableTrackpadTwoFingerGesture?: boolean;\n\n /**\n * Specifies how much the visual interaction will be delayed compared to the\n * gesture distance. e.g. value of 1 will indicate that the swipeable panel\n * should exactly follow the gesture, 2 means it is going to be two times\n * \"slower\".\n */\n friction?: number;\n\n /**\n * Distance from the left edge at which released panel will animate to the\n * open state (or the open panel will animate into the closed state). By\n * default it's a half of the panel's width.\n */\n leftThreshold?: number;\n\n /**\n * Distance from the right edge at which released panel will animate to the\n * open state (or the open panel will animate into the closed state). By\n * default it's a half of the panel's width.\n */\n rightThreshold?: number;\n\n /**\n * Distance that the panel must be dragged from the left edge to be considered\n * a swipe. The default value is 10.\n */\n dragOffsetFromLeftEdge?: number;\n\n /**\n * Distance that the panel must be dragged from the right edge to be considered\n * a swipe. The default value is 10.\n */\n dragOffsetFromRightEdge?: number;\n\n /**\n * Value indicating if the swipeable panel can be pulled further than the left\n * actions panel's width. It is set to true by default as long as the left\n * panel render method is present.\n */\n overshootLeft?: boolean;\n\n /**\n * Value indicating if the swipeable panel can be pulled further than the\n * right actions panel's width. It is set to true by default as long as the\n * right panel render method is present.\n */\n overshootRight?: boolean;\n\n /**\n * Specifies how much the visual interaction will be delayed compared to the\n * gesture distance at overshoot. Default value is 1, it mean no friction, for\n * a native feel, try 8 or above.\n */\n overshootFriction?: number;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableOpen()\n *\n * Called when left action panel gets open.\n */\n onSwipeableLeftOpen?: () => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableOpen()\n *\n * Called when right action panel gets open.\n */\n onSwipeableRightOpen?: () => void;\n\n /**\n * Called when action panel gets open (either right or left).\n */\n onSwipeableOpen?: (direction: 'left' | 'right', swipeable: Swipeable) => void;\n\n /**\n * Called when action panel is closed.\n */\n onSwipeableClose?: (\n direction: 'left' | 'right',\n swipeable: Swipeable\n ) => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableWillOpen()\n *\n * Called when left action panel starts animating on open.\n */\n onSwipeableLeftWillOpen?: () => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableWillOpen()\n *\n * Called when right action panel starts animating on open.\n */\n onSwipeableRightWillOpen?: () => void;\n\n /**\n * Called when action panel starts animating on open (either right or left).\n */\n onSwipeableWillOpen?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts animating on close.\n */\n onSwipeableWillClose?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts being shown on dragging to open.\n */\n onSwipeableOpenStartDrag?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts being shown on dragging to close.\n */\n onSwipeableCloseStartDrag?: (direction: 'left' | 'right') => void;\n\n /**\n *\n * This map describes the values to use as inputRange for extra interpolation:\n * AnimatedValue: [startValue, endValue]\n *\n * progressAnimatedValue: [0, 1] dragAnimatedValue: [0, +]\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderLeftActions?: (\n progressAnimatedValue: AnimatedInterpolation,\n dragAnimatedValue: AnimatedInterpolation,\n swipeable: Swipeable\n ) => React.ReactNode;\n /**\n *\n * This map describes the values to use as inputRange for extra interpolation:\n * AnimatedValue: [startValue, endValue]\n *\n * progressAnimatedValue: [0, 1] dragAnimatedValue: [0, -]\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderRightActions?: (\n progressAnimatedValue: AnimatedInterpolation,\n dragAnimatedValue: AnimatedInterpolation,\n swipeable: Swipeable\n ) => React.ReactNode;\n\n useNativeAnimations?: boolean;\n\n animationOptions?: Record<string, unknown>;\n\n /**\n * Style object for the container (`Animated.View`), for example to override\n * `overflow: 'hidden'`.\n */\n containerStyle?: StyleProp<ViewStyle>;\n\n /**\n * Style object for the children container (`Animated.View`), for example to\n * apply `flex: 1`\n */\n childrenContainerStyle?: StyleProp<ViewStyle>;\n}\n\ntype SwipeableState = {\n dragX: Animated.Value;\n rowTranslation: Animated.Value;\n rowState: number;\n leftWidth?: number;\n rightOffset?: number;\n rowWidth?: number;\n};\n\n/**\n * @deprecated use Reanimated version of Swipeable instead\n *\n * This component allows for implementing swipeable rows or similar interaction.\n */\n\nexport default class Swipeable extends Component<\n SwipeableProps,\n SwipeableState\n> {\n static defaultProps = {\n friction: 1,\n overshootFriction: 1,\n useNativeAnimations: true,\n };\n\n constructor(props: SwipeableProps) {\n super(props);\n const dragX = new Animated.Value(0);\n this.state = {\n dragX,\n rowTranslation: new Animated.Value(0),\n rowState: 0,\n leftWidth: undefined,\n rightOffset: undefined,\n rowWidth: undefined,\n };\n this.updateAnimatedEvent(props, this.state);\n\n this.onGestureEvent = Animated.event(\n [{ nativeEvent: { translationX: dragX } }],\n { useNativeDriver: props.useNativeAnimations! }\n );\n }\n\n shouldComponentUpdate(props: SwipeableProps, state: SwipeableState) {\n if (\n this.props.friction !== props.friction ||\n this.props.overshootLeft !== props.overshootLeft ||\n this.props.overshootRight !== props.overshootRight ||\n this.props.overshootFriction !== props.overshootFriction ||\n this.state.leftWidth !== state.leftWidth ||\n this.state.rightOffset !== state.rightOffset ||\n this.state.rowWidth !== state.rowWidth\n ) {\n this.updateAnimatedEvent(props, state);\n }\n\n return true;\n }\n\n private onGestureEvent?: (\n event: GestureEvent<PanGestureHandlerEventPayload>\n ) => void;\n private transX?: AnimatedInterpolation;\n private showLeftAction?: AnimatedInterpolation | Animated.Value;\n private leftActionTranslate?: AnimatedInterpolation;\n private showRightAction?: AnimatedInterpolation | Animated.Value;\n private rightActionTranslate?: AnimatedInterpolation;\n\n private updateAnimatedEvent = (\n props: SwipeableProps,\n state: SwipeableState\n ) => {\n const { friction, overshootFriction } = props;\n const { dragX, rowTranslation, leftWidth = 0, rowWidth = 0 } = state;\n const { rightOffset = rowWidth } = state;\n const rightWidth = Math.max(0, rowWidth - rightOffset);\n\n const { overshootLeft = leftWidth > 0, overshootRight = rightWidth > 0 } =\n props;\n\n const transX = Animated.add(\n rowTranslation,\n dragX.interpolate({\n inputRange: [0, friction!],\n outputRange: [0, 1],\n })\n ).interpolate({\n inputRange: [-rightWidth - 1, -rightWidth, leftWidth, leftWidth + 1],\n outputRange: [\n -rightWidth - (overshootRight ? 1 / overshootFriction! : 0),\n -rightWidth,\n leftWidth,\n leftWidth + (overshootLeft ? 1 / overshootFriction! : 0),\n ],\n });\n this.transX = transX;\n this.showLeftAction =\n leftWidth > 0\n ? transX.interpolate({\n inputRange: [-1, 0, leftWidth],\n outputRange: [0, 0, 1],\n })\n : new Animated.Value(0);\n this.leftActionTranslate = this.showLeftAction.interpolate({\n inputRange: [0, Number.MIN_VALUE],\n outputRange: [-10000, 0],\n extrapolate: 'clamp',\n });\n this.showRightAction =\n rightWidth > 0\n ? transX.interpolate({\n inputRange: [-rightWidth, 0, 1],\n outputRange: [1, 0, 0],\n })\n : new Animated.Value(0);\n this.rightActionTranslate = this.showRightAction.interpolate({\n inputRange: [0, Number.MIN_VALUE],\n outputRange: [-10000, 0],\n extrapolate: 'clamp',\n });\n };\n\n private onTapHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<TapGestureHandlerEventPayload>) => {\n if (nativeEvent.oldState === State.ACTIVE) {\n this.close();\n }\n };\n\n private onHandlerStateChange = (\n ev: HandlerStateChangeEvent<PanGestureHandlerEventPayload>\n ) => {\n if (ev.nativeEvent.oldState === State.ACTIVE) {\n this.handleRelease(ev);\n }\n\n if (ev.nativeEvent.state === State.ACTIVE) {\n const { velocityX, translationX: dragX } = ev.nativeEvent;\n const { rowState } = this.state;\n const { friction } = this.props;\n\n const translationX = (dragX + DRAG_TOSS * velocityX) / friction!;\n\n const direction =\n rowState === -1\n ? 'right'\n : rowState === 1\n ? 'left'\n : translationX > 0\n ? 'left'\n : 'right';\n\n if (rowState === 0) {\n this.props.onSwipeableOpenStartDrag?.(direction);\n } else {\n this.props.onSwipeableCloseStartDrag?.(direction);\n }\n }\n };\n\n private handleRelease = (\n ev: HandlerStateChangeEvent<PanGestureHandlerEventPayload>\n ) => {\n const { velocityX, translationX: dragX } = ev.nativeEvent;\n const { leftWidth = 0, rowWidth = 0, rowState } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n const {\n friction,\n leftThreshold = leftWidth / 2,\n rightThreshold = rightWidth / 2,\n } = this.props;\n\n const startOffsetX = this.currentOffset() + dragX / friction!;\n const translationX = (dragX + DRAG_TOSS * velocityX) / friction!;\n\n let toValue = 0;\n if (rowState === 0) {\n if (translationX > leftThreshold) {\n toValue = leftWidth;\n } else if (translationX < -rightThreshold) {\n toValue = -rightWidth;\n }\n } else if (rowState === 1) {\n // Swiped to left\n if (translationX > -leftThreshold) {\n toValue = leftWidth;\n }\n } else {\n // Swiped to right\n if (translationX < rightThreshold) {\n toValue = -rightWidth;\n }\n }\n\n this.animateRow(startOffsetX, toValue, velocityX / friction!);\n };\n\n private animateRow = (\n fromValue: number,\n toValue: number,\n velocityX?:\n | number\n | {\n x: number;\n y: number;\n }\n ) => {\n const { dragX, rowTranslation } = this.state;\n dragX.setValue(0);\n rowTranslation.setValue(fromValue);\n\n this.setState({ rowState: Math.sign(toValue) });\n Animated.spring(rowTranslation, {\n restSpeedThreshold: 1.7,\n restDisplacementThreshold: 0.4,\n velocity: velocityX,\n bounciness: 0,\n toValue,\n useNativeDriver: this.props.useNativeAnimations!,\n ...this.props.animationOptions,\n }).start(({ finished }) => {\n if (finished) {\n if (toValue > 0) {\n this.props.onSwipeableLeftOpen?.();\n this.props.onSwipeableOpen?.('left', this);\n } else if (toValue < 0) {\n this.props.onSwipeableRightOpen?.();\n this.props.onSwipeableOpen?.('right', this);\n } else {\n const closingDirection = fromValue > 0 ? 'left' : 'right';\n this.props.onSwipeableClose?.(closingDirection, this);\n }\n }\n });\n if (toValue > 0) {\n this.props.onSwipeableLeftWillOpen?.();\n this.props.onSwipeableWillOpen?.('left');\n } else if (toValue < 0) {\n this.props.onSwipeableRightWillOpen?.();\n this.props.onSwipeableWillOpen?.('right');\n } else {\n const closingDirection = fromValue > 0 ? 'left' : 'right';\n this.props.onSwipeableWillClose?.(closingDirection);\n }\n };\n\n private onRowLayout = ({ nativeEvent }: LayoutChangeEvent) => {\n this.setState({ rowWidth: nativeEvent.layout.width });\n };\n\n private currentOffset = () => {\n const { leftWidth = 0, rowWidth = 0, rowState } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n if (rowState === 1) {\n return leftWidth;\n } else if (rowState === -1) {\n return -rightWidth;\n }\n return 0;\n };\n\n close = () => {\n this.animateRow(this.currentOffset(), 0);\n };\n\n openLeft = () => {\n const { leftWidth = 0 } = this.state;\n this.animateRow(this.currentOffset(), leftWidth);\n };\n\n openRight = () => {\n const { rowWidth = 0 } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n this.animateRow(this.currentOffset(), -rightWidth);\n };\n\n reset = () => {\n const { dragX, rowTranslation } = this.state;\n dragX.setValue(0);\n rowTranslation.setValue(0);\n this.setState({ rowState: 0 });\n };\n\n render() {\n const { rowState } = this.state;\n const {\n children,\n renderLeftActions,\n renderRightActions,\n dragOffsetFromLeftEdge = 10,\n dragOffsetFromRightEdge = 10,\n } = this.props;\n\n const left = renderLeftActions && (\n <Animated.View\n style={[\n styles.leftActions,\n // All those and below parameters can have ! since they are all\n // asigned in constructor in `updateAnimatedEvent` but TS cannot spot\n // it for some reason\n { transform: [{ translateX: this.leftActionTranslate! }] },\n ]}>\n {renderLeftActions(this.showLeftAction!, this.transX!, this)}\n <View\n onLayout={({ nativeEvent }) =>\n this.setState({ leftWidth: nativeEvent.layout.x })\n }\n />\n </Animated.View>\n );\n\n const right = renderRightActions && (\n <Animated.View\n style={[\n styles.rightActions,\n { transform: [{ translateX: this.rightActionTranslate! }] },\n ]}>\n {renderRightActions(this.showRightAction!, this.transX!, this)}\n <View\n onLayout={({ nativeEvent }) =>\n this.setState({ rightOffset: nativeEvent.layout.x })\n }\n />\n </Animated.View>\n );\n\n return (\n <PanGestureHandler\n activeOffsetX={[-dragOffsetFromRightEdge, dragOffsetFromLeftEdge]}\n touchAction=\"pan-y\"\n {...this.props}\n onGestureEvent={this.onGestureEvent}\n onHandlerStateChange={this.onHandlerStateChange}>\n <Animated.View\n onLayout={this.onRowLayout}\n style={[styles.container, this.props.containerStyle]}>\n {left}\n {right}\n <TapGestureHandler\n enabled={rowState !== 0}\n touchAction=\"pan-y\"\n onHandlerStateChange={this.onTapHandlerStateChange}>\n <Animated.View\n pointerEvents={rowState === 0 ? 'auto' : 'box-only'}\n style={[\n {\n transform: [{ translateX: this.transX! }],\n },\n this.props.childrenContainerStyle,\n ]}>\n {children}\n </Animated.View>\n </TapGestureHandler>\n </Animated.View>\n </PanGestureHandler>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n },\n leftActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',\n },\n rightActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',\n },\n});\n"]}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
function _extends() {
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
2
3
|
import React, { forwardRef, useEffect, useRef } from 'react';
|
3
4
|
import { Platform, Text as RNText } from 'react-native';
|
4
5
|
import { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';
|
@@ -11,25 +12,29 @@ export const Text = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
12
|
} = props;
|
12
13
|
const textRef = useRef(null);
|
13
14
|
const native = Gesture.Native().runOnJS(true);
|
15
|
+
|
14
16
|
const refHandler = node => {
|
15
17
|
textRef.current = node;
|
18
|
+
|
16
19
|
if (ref === null) {
|
17
20
|
return;
|
18
21
|
}
|
22
|
+
|
19
23
|
if (typeof ref === 'function') {
|
20
24
|
ref(node);
|
21
25
|
} else {
|
22
26
|
ref.current = node;
|
23
27
|
}
|
24
28
|
};
|
29
|
+
|
25
30
|
useEffect(() => {
|
26
31
|
if (Platform.OS !== 'web') {
|
27
32
|
return;
|
28
33
|
}
|
29
|
-
const textElement = ref ? ref.current : textRef.current;
|
30
34
|
|
31
|
-
// At this point we are sure that textElement is div in HTML tree
|
32
|
-
|
35
|
+
const textElement = ref ? ref.current : textRef.current; // At this point we are sure that textElement is div in HTML tree
|
36
|
+
|
37
|
+
textElement === null || textElement === void 0 ? void 0 : textElement.setAttribute('rnghtext', 'true');
|
33
38
|
}, []);
|
34
39
|
return onPress || onLongPress ? /*#__PURE__*/React.createElement(GestureDetector, {
|
35
40
|
gesture: native
|
@@ -40,6 +45,5 @@ export const Text = /*#__PURE__*/forwardRef((props, ref) => {
|
|
40
45
|
}, rest))) : /*#__PURE__*/React.createElement(RNText, _extends({
|
41
46
|
ref: ref
|
42
47
|
}, rest));
|
43
|
-
});
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
48
|
+
}); // eslint-disable-next-line @typescript-eslint/no-redeclare
|
45
49
|
//# sourceMappingURL=Text.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useEffect","useRef","Platform","Text","RNText","GestureObjects","Gesture","GestureDetector","props","ref","onPress","onLongPress","rest","textRef","native","Native","runOnJS","refHandler","node","current","OS","textElement","setAttribute","
|
1
|
+
{"version":3,"sources":["Text.tsx"],"names":["React","forwardRef","useEffect","useRef","Platform","Text","RNText","GestureObjects","Gesture","GestureDetector","props","ref","onPress","onLongPress","rest","textRef","native","Native","runOnJS","refHandler","node","current","OS","textElement","setAttribute"],"mappings":";;AAAA,OAAOA,KAAP,IAEEC,UAFF,EAIEC,SAJF,EAKEC,MALF,QAMO,OANP;AAOA,SACEC,QADF,EAEEC,IAAI,IAAIC,MAFV,QAIO,cAJP;AAMA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,qCAA1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AAsBG,IAAtB,EAVF;AAYD,CAjD2B,CAAvB,C,CAmDP","sourcesContent":["import React, {\n ForwardedRef,\n forwardRef,\n RefObject,\n useEffect,\n useRef,\n} from 'react';\nimport {\n Platform,\n Text as RNText,\n TextProps as RNTextProps,\n} from 'react-native';\n\nimport { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';\nimport { GestureDetector } from '../handlers/gestures/GestureDetector';\n\nexport const Text = forwardRef(\n (props: RNTextProps, ref: ForwardedRef<RNText>) => {\n const { onPress, onLongPress, ...rest } = props;\n\n const textRef = useRef<RNText | null>(null);\n const native = Gesture.Native().runOnJS(true);\n\n const refHandler = (node: any) => {\n textRef.current = node;\n\n if (ref === null) {\n return;\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n };\n\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n\n const textElement = ref\n ? (ref as RefObject<RNText>).current\n : textRef.current;\n\n // At this point we are sure that textElement is div in HTML tree\n (textElement as unknown as HTMLDivElement)?.setAttribute(\n 'rnghtext',\n 'true'\n );\n }, []);\n\n return onPress || onLongPress ? (\n <GestureDetector gesture={native}>\n <RNText\n onPress={onPress}\n onLongPress={onLongPress}\n ref={refHandler}\n {...rest}\n />\n </GestureDetector>\n ) : (\n <RNText ref={ref} {...rest} />\n );\n }\n);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Text = typeof Text & RNText;\n"]}
|
@@ -8,9 +8,9 @@ export default function gestureHandlerRootHOC(Component, containerStyles) {
|
|
8
8
|
style: [styles.container, containerStyles]
|
9
9
|
}, /*#__PURE__*/React.createElement(Component, props));
|
10
10
|
}
|
11
|
-
Wrapper.displayName = `gestureHandlerRootHOC(${Component.displayName || Component.name})`;
|
12
11
|
|
13
|
-
// @ts-ignore - hoistNonReactStatics uses old version of @types/react
|
12
|
+
Wrapper.displayName = `gestureHandlerRootHOC(${Component.displayName || Component.name})`; // @ts-ignore - hoistNonReactStatics uses old version of @types/react
|
13
|
+
|
14
14
|
hoistNonReactStatics(Wrapper, Component);
|
15
15
|
return Wrapper;
|
16
16
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","hoistNonReactStatics","GestureHandlerRootView","gestureHandlerRootHOC","Component","containerStyles","Wrapper","props","
|
1
|
+
{"version":3,"sources":["gestureHandlerRootHOC.tsx"],"names":["React","StyleSheet","hoistNonReactStatics","GestureHandlerRootView","gestureHandlerRootHOC","Component","containerStyles","Wrapper","props","styles","container","displayName","name","create","flex"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,QAAiD,cAAjD;AACA,OAAOC,oBAAP,MAAiC,yBAAjC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AAEA,eAAe,SAASC,qBAAT,CACbC,SADa,EAEbC,eAFa,EAGW;AACxB,WAASC,OAAT,CAAiBC,KAAjB,EAA2B;AACzB,wBACE,oBAAC,sBAAD;AAAwB,MAAA,KAAK,EAAE,CAACC,MAAM,CAACC,SAAR,EAAmBJ,eAAnB;AAA/B,oBACE,oBAAC,SAAD,EAAeE,KAAf,CADF,CADF;AAKD;;AAEDD,EAAAA,OAAO,CAACI,WAAR,GAAuB,yBACrBN,SAAS,CAACM,WAAV,IAAyBN,SAAS,CAACO,IACpC,GAFD,CATwB,CAaxB;;AACAV,EAAAA,oBAAoB,CAACK,OAAD,EAAUF,SAAV,CAApB;AAEA,SAAOE,OAAP;AACD;AAED,MAAME,MAAM,GAAGR,UAAU,CAACY,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AAAEI,IAAAA,IAAI,EAAE;AAAR;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { StyleSheet, StyleProp, ViewStyle } from 'react-native';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport GestureHandlerRootView from './GestureHandlerRootView';\n\nexport default function gestureHandlerRootHOC<P extends object>(\n Component: React.ComponentType<P>,\n containerStyles?: StyleProp<ViewStyle>\n): React.ComponentType<P> {\n function Wrapper(props: P) {\n return (\n <GestureHandlerRootView style={[styles.container, containerStyles]}>\n <Component {...props} />\n </GestureHandlerRootView>\n );\n }\n\n Wrapper.displayName = `gestureHandlerRootHOC(${\n Component.displayName || Component.name\n })`;\n\n // @ts-ignore - hoistNonReactStatics uses old version of @types/react\n hoistNonReactStatics(Wrapper, Component);\n\n return Wrapper;\n}\n\nconst styles = StyleSheet.create({\n container: { flex: 1 },\n});\n"]}
|