react-native-gesture-handler 2.23.0 → 2.24.0
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/android/build.gradle +9 -3
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +2 -1
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +2 -1
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +60 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +67 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -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 +86 -44
- 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 +28 -10
- 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/ExtraButtonProps.js +2 -0
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -0
- 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 +25 -13
- 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 +146 -59
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +30 -18
- 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 +21 -13
- 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 +37 -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 +76 -27
- 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 +66 -40
- 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 +15 -7
- 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/ExtraButtonProps.js +2 -0
- package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -0
- 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 +15 -10
- 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 +119 -57
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +22 -15
- 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 +7 -8
- 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 +15 -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 +57 -22
- 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/GestureComponents.d.ts +1 -1
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +5 -0
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +7 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -2
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -7
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -0
- package/lib/typescript/web/utils.d.ts +2 -0
- package/package.json +9 -8
- package/src/components/GestureComponents.tsx +1 -1
- package/src/components/ReanimatedDrawerLayout.tsx +17 -4
- package/src/components/Text.tsx +5 -0
- package/src/components/touchables/ExtraButtonProps.ts +7 -0
- package/src/components/touchables/GenericTouchable.tsx +0 -2
- package/src/components/touchables/GenericTouchableProps.ts +2 -0
- 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 +3 -8
- package/src/components/touchables/TouchableOpacity.tsx +2 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +22 -4
- package/src/handlers/createHandler.tsx +20 -9
- package/src/handlers/createNativeWrapper.tsx +7 -3
- package/src/handlers/gestures/GestureDetector/Wrap.web.tsx +2 -4
- package/src/utils.ts +6 -0
- package/src/web/utils.ts +21 -3
@@ -1,19 +1,21 @@
|
|
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
|
// Similarily to the DrawerLayout component this deserves to be put in a
|
3
4
|
// separate repo. Although, keeping it here for the time being will allow us to
|
4
5
|
// move faster and fix possible issues quicker
|
5
|
-
|
6
6
|
import React, { forwardRef, useCallback, useImperativeHandle, useMemo } from 'react';
|
7
7
|
import { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';
|
8
8
|
import { GestureDetector } from '../handlers/gestures/GestureDetector';
|
9
9
|
import Animated, { ReduceMotion, interpolate, measure, runOnJS, runOnUI, useAnimatedRef, useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
10
10
|
import { I18nManager, StyleSheet, View } from 'react-native';
|
11
11
|
const DRAG_TOSS = 0.05;
|
12
|
-
var SwipeDirection
|
12
|
+
var SwipeDirection;
|
13
|
+
|
14
|
+
(function (SwipeDirection) {
|
13
15
|
SwipeDirection["LEFT"] = "left";
|
14
16
|
SwipeDirection["RIGHT"] = "right";
|
15
|
-
|
16
|
-
|
17
|
+
})(SwipeDirection || (SwipeDirection = {}));
|
18
|
+
|
17
19
|
const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
18
20
|
const defaultProps = {
|
19
21
|
friction: 1,
|
@@ -104,8 +106,7 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
104
106
|
const isClosing = toValue === 0;
|
105
107
|
const moveToRight = isClosing ? rowState.value < 0 : toValue > 0;
|
106
108
|
const usedWidth = isClosing ? moveToRight ? rightWidth.value : leftWidth.value : moveToRight ? leftWidth.value : rightWidth.value;
|
107
|
-
const progressSpringConfig = {
|
108
|
-
...translationSpringConfig,
|
109
|
+
const progressSpringConfig = { ...translationSpringConfig,
|
109
110
|
restDisplacementThreshold: 0.01,
|
110
111
|
restSpeedThreshold: 0.01,
|
111
112
|
velocity: velocityX && interpolate(velocityX, [-usedWidth, usedWidth], [-1, 1])
|
@@ -129,6 +130,7 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
129
130
|
'worklet';
|
130
131
|
|
131
132
|
var _leftLayout$pageX, _leftWrapperLayout$pa, _rightLayout$pageX, _leftWrapperLayout$pa2;
|
133
|
+
|
132
134
|
const leftLayout = measure(leftLayoutRef);
|
133
135
|
const leftWrapperLayout = measure(leftWrapperLayoutRef);
|
134
136
|
const rightLayout = measure(rightLayoutRef);
|
@@ -143,10 +145,12 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
143
145
|
animateRow(0);
|
144
146
|
return;
|
145
147
|
}
|
148
|
+
|
146
149
|
runOnUI(() => {
|
147
150
|
animateRow(0);
|
148
151
|
})();
|
149
152
|
},
|
153
|
+
|
150
154
|
openLeft() {
|
151
155
|
'worklet';
|
152
156
|
|
@@ -155,11 +159,13 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
155
159
|
animateRow(leftWidth.value);
|
156
160
|
return;
|
157
161
|
}
|
162
|
+
|
158
163
|
runOnUI(() => {
|
159
164
|
updateElementWidths();
|
160
165
|
animateRow(leftWidth.value);
|
161
166
|
})();
|
162
167
|
},
|
168
|
+
|
163
169
|
openRight() {
|
164
170
|
'worklet';
|
165
171
|
|
@@ -168,11 +174,13 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
168
174
|
animateRow(-rightWidth.value);
|
169
175
|
return;
|
170
176
|
}
|
177
|
+
|
171
178
|
runOnUI(() => {
|
172
179
|
updateElementWidths();
|
173
180
|
animateRow(-rightWidth.value);
|
174
181
|
})();
|
175
182
|
},
|
183
|
+
|
176
184
|
reset() {
|
177
185
|
'worklet';
|
178
186
|
|
@@ -181,14 +189,13 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
181
189
|
appliedTranslation.value = 0;
|
182
190
|
rowState.value = 0;
|
183
191
|
}
|
192
|
+
|
184
193
|
}), [animateRow, updateElementWidths, leftWidth, rightWidth, userDrag, showLeftProgress, appliedTranslation, rowState]);
|
185
194
|
const onRowLayout = useCallback(({
|
186
195
|
nativeEvent
|
187
196
|
}) => {
|
188
197
|
rowWidth.value = nativeEvent.layout.width;
|
189
|
-
}, [rowWidth]);
|
190
|
-
|
191
|
-
// As stated in `Dimensions.get` docstring, this function should be called on every render
|
198
|
+
}, [rowWidth]); // As stated in `Dimensions.get` docstring, this function should be called on every render
|
192
199
|
// since dimensions may change (e.g. orientation change)
|
193
200
|
|
194
201
|
const leftActionAnimation = useAnimatedStyle(() => {
|
@@ -223,6 +230,7 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
223
230
|
const rightThresholdProp = rightThreshold !== null && rightThreshold !== void 0 ? rightThreshold : rightWidth.value / 2;
|
224
231
|
const translationX = (userDrag.value + DRAG_TOSS * velocityX) / friction;
|
225
232
|
let toValue = 0;
|
233
|
+
|
226
234
|
if (rowState.value === 0) {
|
227
235
|
if (translationX > leftThresholdProp) {
|
228
236
|
toValue = leftWidth.value;
|
@@ -240,6 +248,7 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
240
248
|
toValue = -rightWidth.value;
|
241
249
|
}
|
242
250
|
}
|
251
|
+
|
243
252
|
animateRow(toValue, velocityX / friction);
|
244
253
|
}, [animateRow, friction, leftThreshold, leftWidth, rightThreshold, rightWidth, rowState, userDrag]);
|
245
254
|
const close = useCallback(() => {
|
@@ -254,42 +263,51 @@ const Swipeable = /*#__PURE__*/forwardRef(function Swipeable(props, ref) {
|
|
254
263
|
close();
|
255
264
|
}
|
256
265
|
});
|
266
|
+
|
257
267
|
if (!simultaneousWithExternalGesture) {
|
258
268
|
return tap;
|
259
269
|
}
|
270
|
+
|
260
271
|
if (Array.isArray(simultaneousWithExternalGesture)) {
|
261
272
|
tap.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);
|
262
273
|
} else {
|
263
274
|
tap.simultaneousWithExternalGesture(simultaneousWithExternalGesture);
|
264
275
|
}
|
276
|
+
|
265
277
|
return tap;
|
266
278
|
}, [close, rowState, simultaneousWithExternalGesture]);
|
267
279
|
const panGesture = useMemo(() => {
|
268
280
|
const pan = Gesture.Pan().enabled(enabled !== false).enableTrackpadTwoFingerGesture(enableTrackpadTwoFingerGesture).activeOffsetX([-dragOffsetFromRightEdge, dragOffsetFromLeftEdge]).onStart(updateElementWidths).onUpdate(event => {
|
269
281
|
userDrag.value = event.translationX;
|
270
282
|
const direction = rowState.value === -1 ? SwipeDirection.RIGHT : rowState.value === 1 ? SwipeDirection.LEFT : event.translationX > 0 ? SwipeDirection.RIGHT : SwipeDirection.LEFT;
|
283
|
+
|
271
284
|
if (!dragStarted.value) {
|
272
285
|
dragStarted.value = true;
|
286
|
+
|
273
287
|
if (rowState.value === 0 && onSwipeableOpenStartDrag) {
|
274
288
|
runOnJS(onSwipeableOpenStartDrag)(direction);
|
275
289
|
} else if (onSwipeableCloseStartDrag) {
|
276
290
|
runOnJS(onSwipeableCloseStartDrag)(direction);
|
277
291
|
}
|
278
292
|
}
|
293
|
+
|
279
294
|
updateAnimatedEvent();
|
280
295
|
}).onEnd(event => {
|
281
296
|
handleRelease(event);
|
282
297
|
}).onFinalize(() => {
|
283
298
|
dragStarted.value = false;
|
284
299
|
});
|
300
|
+
|
285
301
|
if (!simultaneousWithExternalGesture) {
|
286
302
|
return pan;
|
287
303
|
}
|
304
|
+
|
288
305
|
if (Array.isArray(simultaneousWithExternalGesture)) {
|
289
306
|
pan.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);
|
290
307
|
} else {
|
291
308
|
pan.simultaneousWithExternalGesture(simultaneousWithExternalGesture);
|
292
309
|
}
|
310
|
+
|
293
311
|
return pan;
|
294
312
|
}, [dragOffsetFromLeftEdge, dragOffsetFromRightEdge, dragStarted, enableTrackpadTwoFingerGesture, enabled, handleRelease, onSwipeableCloseStartDrag, onSwipeableOpenStartDrag, rowState, updateAnimatedEvent, updateElementWidths, userDrag, simultaneousWithExternalGesture]);
|
295
313
|
useImperativeHandle(ref, () => swipeableMethods, [swipeableMethods]);
|
@@ -320,13 +338,11 @@ const styles = StyleSheet.create({
|
|
320
338
|
container: {
|
321
339
|
overflow: 'hidden'
|
322
340
|
},
|
323
|
-
leftActions: {
|
324
|
-
...StyleSheet.absoluteFillObject,
|
341
|
+
leftActions: { ...StyleSheet.absoluteFillObject,
|
325
342
|
flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',
|
326
343
|
overflow: 'hidden'
|
327
344
|
},
|
328
|
-
rightActions: {
|
329
|
-
...StyleSheet.absoluteFillObject,
|
345
|
+
rightActions: { ...StyleSheet.absoluteFillObject,
|
330
346
|
flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',
|
331
347
|
overflow: 'hidden'
|
332
348
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useCallback","useImperativeHandle","useMemo","GestureObjects","Gesture","GestureDetector","Animated","ReduceMotion","interpolate","measure","runOnJS","runOnUI","useAnimatedRef","useAnimatedStyle","useSharedValue","withSpring","I18nManager","StyleSheet","View","DRAG_TOSS","SwipeDirection","Swipeable","props","ref","defaultProps","friction","overshootFriction","dragOffset","enableTrackpadTwoFingerGesture","leftThreshold","rightThreshold","enabled","containerStyle","childrenContainerStyle","animationOptions","overshootLeft","overshootRight","testID","children","dragOffsetFromLeftEdge","dragOffsetFromRightEdge","onSwipeableOpenStartDrag","onSwipeableCloseStartDrag","onSwipeableWillOpen","onSwipeableWillClose","onSwipeableOpen","onSwipeableClose","renderLeftActions","renderRightActions","simultaneousWithExternalGesture","remainingProps","rowState","userDrag","appliedTranslation","rowWidth","leftWidth","rightWidth","showLeftProgress","showRightProgress","updateAnimatedEvent","shouldOvershootLeft","value","shouldOvershootRight","startOffset","offsetDrag","dispatchImmediateEvents","fromValue","toValue","RIGHT","LEFT","dispatchEndEvents","animateRow","velocityX","translationSpringConfig","mass","damping","stiffness","velocity","overshootClamping","reduceMotion","System","isClosing","moveToRight","usedWidth","progressSpringConfig","restDisplacementThreshold","restSpeedThreshold","frozenRowState","isFinished","progressTarget","Math","sign","max","leftLayoutRef","leftWrapperLayoutRef","rightLayoutRef","updateElementWidths","_leftLayout$pageX","_leftWrapperLayout$pa","_rightLayout$pageX","_leftWrapperLayout$pa2","leftLayout","leftWrapperLayout","rightLayout","pageX","swipeableMethods","close","_WORKLET","openLeft","openRight","reset","onRowLayout","nativeEvent","layout","width","leftActionAnimation","opacity","leftElement","createElement","style","styles","leftActions","rightActionAnimation","rightElement","rightActions","handleRelease","event","translationX","leftThresholdProp","rightThresholdProp","dragStarted","tapGesture","tap","Tap","shouldCancelWhenOutside","onStart","Array","isArray","panGesture","pan","Pan","activeOffsetX","onUpdate","direction","onEnd","onFinalize","animatedStyle","transform","translateX","pointerEvents","swipeableComponent","gesture","touchAction","_extends","onLayout","container","create","overflow","absoluteFillObject","flexDirection","isRTL"],"sources":["ReanimatedSwipeable.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 React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n} from 'react';\nimport { GestureRef } from '../handlers/gestures/gesture';\nimport { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';\nimport { GestureDetector } from '../handlers/gestures/GestureDetector';\nimport {\n GestureStateChangeEvent,\n GestureUpdateEvent,\n} from '../handlers/gestureHandlerCommon';\nimport type { PanGestureHandlerProps } from '../handlers/PanGestureHandler';\nimport type { PanGestureHandlerEventPayload } from '../handlers/GestureHandlerEventPayload';\nimport Animated, {\n ReduceMotion,\n SharedValue,\n interpolate,\n measure,\n runOnJS,\n runOnUI,\n useAnimatedRef,\n useAnimatedStyle,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport {\n I18nManager,\n LayoutChangeEvent,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\n\nconst DRAG_TOSS = 0.05;\n\ntype SwipeableExcludes = Exclude<\n keyof PanGestureHandlerProps,\n 'onGestureEvent' | 'onHandlerStateChange'\n>;\n\nenum SwipeDirection {\n LEFT = 'left',\n RIGHT = 'right',\n}\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 * Called when action panel gets open (either right or left).\n */\n onSwipeableOpen?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel is closed.\n */\n onSwipeableClose?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts animating on open (either right or left).\n */\n onSwipeableWillOpen?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts animating on close.\n */\n onSwipeableWillClose?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts being shown on dragging to open.\n */\n onSwipeableOpenStartDrag?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts being shown on dragging to close.\n */\n onSwipeableCloseStartDrag?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * `progress`: Equals `0` when `swipeable` is closed, `1` when `swipeable` is opened.\n * - When the element overshoots it's opened position the value tends towards `Infinity`.\n * - Goes back to `1` when `swipeable` is released.\n *\n * `translation`: a horizontal offset of the `swipeable` relative to its closed position.\\\n * `swipeableMethods`: provides an object exposing methods for controlling the `swipeable`.\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderLeftActions?: (\n progress: SharedValue<number>,\n translation: SharedValue<number>,\n swipeableMethods: SwipeableMethods\n ) => React.ReactNode;\n\n /**\n * `progress`: Equals `0` when `swipeable` is closed, `1` when `swipeable` is opened.\n * - When the element overshoots it's opened position the value tends towards `Infinity`.\n * - Goes back to `1` when `swipeable` is released.\n *\n * `translation`: a horizontal offset of the `swipeable` relative to its closed position.\\\n * `swipeableMethods`: provides an object exposing methods for controlling the `swipeable`.\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderRightActions?: (\n progress: SharedValue<number>,\n translation: SharedValue<number>,\n swipeableMethods: SwipeableMethods\n ) => React.ReactNode;\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 /**\n * A gesture object or an array of gesture objects containing the configuration and callbacks to be\n * used with the swipeable's gesture handler.\n */\n simultaneousWithExternalGesture?:\n | Exclude<GestureRef, number>\n | Exclude<GestureRef, number>[];\n}\n\nexport interface SwipeableMethods {\n close: () => void;\n openLeft: () => void;\n openRight: () => void;\n reset: () => void;\n}\n\nconst Swipeable = forwardRef<SwipeableMethods, SwipeableProps>(\n function Swipeable(\n props: SwipeableProps,\n ref: ForwardedRef<SwipeableMethods>\n ) {\n const defaultProps = {\n friction: 1,\n overshootFriction: 1,\n dragOffset: 10,\n enableTrackpadTwoFingerGesture: false,\n };\n\n const {\n leftThreshold,\n rightThreshold,\n enabled,\n containerStyle,\n childrenContainerStyle,\n animationOptions,\n overshootLeft,\n overshootRight,\n testID,\n children,\n enableTrackpadTwoFingerGesture = defaultProps.enableTrackpadTwoFingerGesture,\n dragOffsetFromLeftEdge = defaultProps.dragOffset,\n dragOffsetFromRightEdge = defaultProps.dragOffset,\n friction = defaultProps.friction,\n overshootFriction = defaultProps.overshootFriction,\n onSwipeableOpenStartDrag,\n onSwipeableCloseStartDrag,\n onSwipeableWillOpen,\n onSwipeableWillClose,\n onSwipeableOpen,\n onSwipeableClose,\n renderLeftActions,\n renderRightActions,\n simultaneousWithExternalGesture,\n ...remainingProps\n } = props;\n\n const rowState = useSharedValue<number>(0);\n\n const userDrag = useSharedValue<number>(0);\n\n const appliedTranslation = useSharedValue<number>(0);\n\n const rowWidth = useSharedValue<number>(0);\n const leftWidth = useSharedValue<number>(0);\n const rightWidth = useSharedValue<number>(0);\n\n const showLeftProgress = useSharedValue<number>(0);\n const showRightProgress = useSharedValue<number>(0);\n\n const updateAnimatedEvent = useCallback(() => {\n 'worklet';\n\n const shouldOvershootLeft = overshootLeft ?? leftWidth.value > 0;\n const shouldOvershootRight = overshootRight ?? rightWidth.value > 0;\n\n const startOffset =\n rowState.value === 1\n ? leftWidth.value\n : rowState.value === -1\n ? -rightWidth.value\n : 0;\n\n const offsetDrag = userDrag.value / friction + startOffset;\n\n appliedTranslation.value = interpolate(\n offsetDrag,\n [\n -rightWidth.value - 1,\n -rightWidth.value,\n leftWidth.value,\n leftWidth.value + 1,\n ],\n [\n -rightWidth.value -\n (shouldOvershootRight ? 1 / overshootFriction : 0),\n -rightWidth.value,\n leftWidth.value,\n leftWidth.value + (shouldOvershootLeft ? 1 / overshootFriction : 0),\n ]\n );\n\n showLeftProgress.value =\n leftWidth.value > 0\n ? interpolate(\n appliedTranslation.value,\n [-1, 0, leftWidth.value],\n [0, 0, 1]\n )\n : 0;\n\n showRightProgress.value =\n rightWidth.value > 0\n ? interpolate(\n appliedTranslation.value,\n [-rightWidth.value, 0, 1],\n [1, 0, 0]\n )\n : 0;\n }, [\n appliedTranslation,\n friction,\n leftWidth,\n overshootFriction,\n rightWidth,\n rowState,\n showLeftProgress,\n showRightProgress,\n userDrag,\n overshootLeft,\n overshootRight,\n ]);\n\n const dispatchImmediateEvents = useCallback(\n (fromValue: number, toValue: number) => {\n 'worklet';\n if (toValue > 0 && onSwipeableWillOpen) {\n runOnJS(onSwipeableWillOpen)(SwipeDirection.RIGHT);\n } else if (toValue < 0 && onSwipeableWillOpen) {\n runOnJS(onSwipeableWillOpen)(SwipeDirection.LEFT);\n } else if (onSwipeableWillClose) {\n runOnJS(onSwipeableWillClose)(\n fromValue > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT\n );\n }\n },\n [onSwipeableWillClose, onSwipeableWillOpen]\n );\n\n const dispatchEndEvents = useCallback(\n (fromValue: number, toValue: number) => {\n 'worklet';\n if (toValue > 0 && onSwipeableOpen) {\n runOnJS(onSwipeableOpen)(SwipeDirection.RIGHT);\n } else if (toValue < 0 && onSwipeableOpen) {\n runOnJS(onSwipeableOpen)(SwipeDirection.LEFT);\n } else if (onSwipeableClose) {\n runOnJS(onSwipeableClose)(\n fromValue > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT\n );\n }\n },\n [onSwipeableClose, onSwipeableOpen]\n );\n\n const animateRow: (toValue: number, velocityX?: number) => void =\n useCallback(\n (toValue: number, velocityX?: number) => {\n 'worklet';\n\n const translationSpringConfig = {\n mass: 2,\n damping: 1000,\n stiffness: 700,\n velocity: velocityX,\n overshootClamping: true,\n reduceMotion: ReduceMotion.System,\n ...animationOptions,\n };\n\n const isClosing = toValue === 0;\n const moveToRight = isClosing ? rowState.value < 0 : toValue > 0;\n\n const usedWidth = isClosing\n ? moveToRight\n ? rightWidth.value\n : leftWidth.value\n : moveToRight\n ? leftWidth.value\n : rightWidth.value;\n\n const progressSpringConfig = {\n ...translationSpringConfig,\n restDisplacementThreshold: 0.01,\n restSpeedThreshold: 0.01,\n velocity:\n velocityX &&\n interpolate(velocityX, [-usedWidth, usedWidth], [-1, 1]),\n };\n\n const frozenRowState = rowState.value;\n\n appliedTranslation.value = withSpring(\n toValue,\n translationSpringConfig,\n (isFinished) => {\n if (isFinished) {\n dispatchEndEvents(frozenRowState, toValue);\n }\n }\n );\n\n const progressTarget = toValue === 0 ? 0 : 1 * Math.sign(toValue);\n\n showLeftProgress.value = withSpring(\n Math.max(progressTarget, 0),\n progressSpringConfig\n );\n\n showRightProgress.value = withSpring(\n Math.max(-progressTarget, 0),\n progressSpringConfig\n );\n\n dispatchImmediateEvents(frozenRowState, toValue);\n\n rowState.value = Math.sign(toValue);\n },\n [\n rowState,\n animationOptions,\n appliedTranslation,\n showLeftProgress,\n leftWidth,\n showRightProgress,\n rightWidth,\n dispatchImmediateEvents,\n dispatchEndEvents,\n ]\n );\n\n const leftLayoutRef = useAnimatedRef();\n const leftWrapperLayoutRef = useAnimatedRef();\n const rightLayoutRef = useAnimatedRef();\n\n const updateElementWidths = useCallback(() => {\n 'worklet';\n const leftLayout = measure(leftLayoutRef);\n const leftWrapperLayout = measure(leftWrapperLayoutRef);\n const rightLayout = measure(rightLayoutRef);\n leftWidth.value =\n (leftLayout?.pageX ?? 0) - (leftWrapperLayout?.pageX ?? 0);\n\n rightWidth.value =\n rowWidth.value -\n (rightLayout?.pageX ?? rowWidth.value) +\n (leftWrapperLayout?.pageX ?? 0);\n }, [\n leftLayoutRef,\n leftWrapperLayoutRef,\n rightLayoutRef,\n leftWidth,\n rightWidth,\n rowWidth,\n ]);\n\n const swipeableMethods = useMemo<SwipeableMethods>(\n () => ({\n close() {\n 'worklet';\n if (_WORKLET) {\n animateRow(0);\n return;\n }\n runOnUI(() => {\n animateRow(0);\n })();\n },\n openLeft() {\n 'worklet';\n if (_WORKLET) {\n updateElementWidths();\n animateRow(leftWidth.value);\n return;\n }\n runOnUI(() => {\n updateElementWidths();\n animateRow(leftWidth.value);\n })();\n },\n openRight() {\n 'worklet';\n if (_WORKLET) {\n updateElementWidths();\n animateRow(-rightWidth.value);\n return;\n }\n runOnUI(() => {\n updateElementWidths();\n animateRow(-rightWidth.value);\n })();\n },\n reset() {\n 'worklet';\n userDrag.value = 0;\n showLeftProgress.value = 0;\n appliedTranslation.value = 0;\n rowState.value = 0;\n },\n }),\n [\n animateRow,\n updateElementWidths,\n leftWidth,\n rightWidth,\n userDrag,\n showLeftProgress,\n appliedTranslation,\n rowState,\n ]\n );\n\n const onRowLayout = useCallback(\n ({ nativeEvent }: LayoutChangeEvent) => {\n rowWidth.value = nativeEvent.layout.width;\n },\n [rowWidth]\n );\n\n // As stated in `Dimensions.get` docstring, this function should be called on every render\n // since dimensions may change (e.g. orientation change)\n\n const leftActionAnimation = useAnimatedStyle(() => {\n return {\n opacity: showLeftProgress.value === 0 ? 0 : 1,\n };\n });\n\n const leftElement = useCallback(\n () => (\n <Animated.View\n ref={leftWrapperLayoutRef}\n style={[styles.leftActions, leftActionAnimation]}>\n {renderLeftActions?.(\n showLeftProgress,\n appliedTranslation,\n swipeableMethods\n )}\n <Animated.View ref={leftLayoutRef} />\n </Animated.View>\n ),\n [\n appliedTranslation,\n leftActionAnimation,\n leftLayoutRef,\n leftWrapperLayoutRef,\n renderLeftActions,\n showLeftProgress,\n swipeableMethods,\n ]\n );\n\n const rightActionAnimation = useAnimatedStyle(() => {\n return {\n opacity: showRightProgress.value === 0 ? 0 : 1,\n };\n });\n\n const rightElement = useCallback(\n () => (\n <Animated.View style={[styles.rightActions, rightActionAnimation]}>\n {renderRightActions?.(\n showRightProgress,\n appliedTranslation,\n swipeableMethods\n )}\n <Animated.View ref={rightLayoutRef} />\n </Animated.View>\n ),\n [\n appliedTranslation,\n renderRightActions,\n rightActionAnimation,\n rightLayoutRef,\n showRightProgress,\n swipeableMethods,\n ]\n );\n\n const handleRelease = useCallback(\n (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {\n 'worklet';\n const { velocityX } = event;\n userDrag.value = event.translationX;\n\n const leftThresholdProp = leftThreshold ?? leftWidth.value / 2;\n const rightThresholdProp = rightThreshold ?? rightWidth.value / 2;\n\n const translationX =\n (userDrag.value + DRAG_TOSS * velocityX) / friction;\n\n let toValue = 0;\n\n if (rowState.value === 0) {\n if (translationX > leftThresholdProp) {\n toValue = leftWidth.value;\n } else if (translationX < -rightThresholdProp) {\n toValue = -rightWidth.value;\n }\n } else if (rowState.value === 1) {\n // Swiped to left\n if (translationX > -leftThresholdProp) {\n toValue = leftWidth.value;\n }\n } else {\n // Swiped to right\n if (translationX < rightThresholdProp) {\n toValue = -rightWidth.value;\n }\n }\n\n animateRow(toValue, velocityX / friction);\n },\n [\n animateRow,\n friction,\n leftThreshold,\n leftWidth,\n rightThreshold,\n rightWidth,\n rowState,\n userDrag,\n ]\n );\n\n const close = useCallback(() => {\n 'worklet';\n animateRow(0);\n }, [animateRow]);\n\n const dragStarted = useSharedValue<boolean>(false);\n\n const tapGesture = useMemo(() => {\n const tap = Gesture.Tap()\n .shouldCancelWhenOutside(true)\n .onStart(() => {\n if (rowState.value !== 0) {\n close();\n }\n });\n\n if (!simultaneousWithExternalGesture) {\n return tap;\n }\n\n if (Array.isArray(simultaneousWithExternalGesture)) {\n tap.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);\n } else {\n tap.simultaneousWithExternalGesture(simultaneousWithExternalGesture);\n }\n\n return tap;\n }, [close, rowState, simultaneousWithExternalGesture]);\n\n const panGesture = useMemo(() => {\n const pan = Gesture.Pan()\n .enabled(enabled !== false)\n .enableTrackpadTwoFingerGesture(enableTrackpadTwoFingerGesture)\n .activeOffsetX([-dragOffsetFromRightEdge, dragOffsetFromLeftEdge])\n .onStart(updateElementWidths)\n .onUpdate(\n (event: GestureUpdateEvent<PanGestureHandlerEventPayload>) => {\n userDrag.value = event.translationX;\n\n const direction =\n rowState.value === -1\n ? SwipeDirection.RIGHT\n : rowState.value === 1\n ? SwipeDirection.LEFT\n : event.translationX > 0\n ? SwipeDirection.RIGHT\n : SwipeDirection.LEFT;\n\n if (!dragStarted.value) {\n dragStarted.value = true;\n if (rowState.value === 0 && onSwipeableOpenStartDrag) {\n runOnJS(onSwipeableOpenStartDrag)(direction);\n } else if (onSwipeableCloseStartDrag) {\n runOnJS(onSwipeableCloseStartDrag)(direction);\n }\n }\n\n updateAnimatedEvent();\n }\n )\n .onEnd(\n (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {\n handleRelease(event);\n }\n )\n .onFinalize(() => {\n dragStarted.value = false;\n });\n\n if (!simultaneousWithExternalGesture) {\n return pan;\n }\n\n if (Array.isArray(simultaneousWithExternalGesture)) {\n pan.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);\n } else {\n pan.simultaneousWithExternalGesture(simultaneousWithExternalGesture);\n }\n\n return pan;\n }, [\n dragOffsetFromLeftEdge,\n dragOffsetFromRightEdge,\n dragStarted,\n enableTrackpadTwoFingerGesture,\n enabled,\n handleRelease,\n onSwipeableCloseStartDrag,\n onSwipeableOpenStartDrag,\n rowState,\n updateAnimatedEvent,\n updateElementWidths,\n userDrag,\n simultaneousWithExternalGesture,\n ]);\n\n useImperativeHandle(ref, () => swipeableMethods, [swipeableMethods]);\n\n const animatedStyle = useAnimatedStyle(\n () => ({\n transform: [{ translateX: appliedTranslation.value }],\n pointerEvents: rowState.value === 0 ? 'auto' : 'box-only',\n }),\n [appliedTranslation, rowState]\n );\n\n const swipeableComponent = (\n <GestureDetector gesture={panGesture} touchAction=\"pan-y\">\n <Animated.View\n {...remainingProps}\n onLayout={onRowLayout}\n style={[styles.container, containerStyle]}>\n {leftElement()}\n {rightElement()}\n <GestureDetector gesture={tapGesture} touchAction=\"pan-y\">\n <Animated.View style={[animatedStyle, childrenContainerStyle]}>\n {children}\n </Animated.View>\n </GestureDetector>\n </Animated.View>\n </GestureDetector>\n );\n\n return testID ? (\n <View testID={testID}>{swipeableComponent}</View>\n ) : (\n swipeableComponent\n );\n }\n);\n\nexport default Swipeable;\nexport type SwipeableRef = ForwardedRef<SwipeableMethods>;\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n },\n leftActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',\n overflow: 'hidden',\n },\n rightActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',\n overflow: 'hidden',\n },\n});\n"],"mappings":";AAAA;AACA;AACA;;AAEA,OAAOA,KAAK,IAEVC,UAAU,EACVC,WAAW,EACXC,mBAAmB,EACnBC,OAAO,QACF,OAAO;AAEd,SAASC,cAAc,IAAIC,OAAO,QAAQ,qCAAqC;AAC/E,SAASC,eAAe,QAAQ,sCAAsC;AAOtE,OAAOC,QAAQ,IACbC,YAAY,EAEZC,WAAW,EACXC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SACEC,WAAW,EAGXC,UAAU,EACVC,IAAI,QAEC,cAAc;AAErB,MAAMC,SAAS,GAAG,IAAI;AAAC,IAOlBC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA,EAAdA,cAAc;AA8KnB,MAAMC,SAAS,gBAAGtB,UAAU,CAC1B,SAASsB,SAASA,CAChBC,KAAqB,EACrBC,GAAmC,EACnC;EACA,MAAMC,YAAY,GAAG;IACnBC,QAAQ,EAAE,CAAC;IACXC,iBAAiB,EAAE,CAAC;IACpBC,UAAU,EAAE,EAAE;IACdC,8BAA8B,EAAE;EAClC,CAAC;EAED,MAAM;IACJC,aAAa;IACbC,cAAc;IACdC,OAAO;IACPC,cAAc;IACdC,sBAAsB;IACtBC,gBAAgB;IAChBC,a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C,MAAM,CAACmC,SAAS,EAAE3H,cAAc;EAAE,IACzCqF,WAAW,CAAC,CAAC,EACbM,YAAY,CAAC,CAAC,eACf7H,KAAA,CAAAwH,aAAA,CAACjH,eAAe;IAACkJ,OAAO,EAAEpB,UAAW;IAACqB,WAAW,EAAC;EAAO,gBACvD1J,KAAA,CAAAwH,aAAA,CAAChH,QAAQ,CAACY,IAAI;IAACqG,KAAK,EAAE,CAAC2B,aAAa,EAAEjH,sBAAsB;EAAE,GAC3DK,QACY,CACA,CACJ,CACA,CAClB;EAED,OAAOD,MAAM,gBACXvC,KAAA,CAAAwH,aAAA,CAACpG,IAAI;IAACmB,MAAM,EAAEA;EAAO,GAAEiH,kBAAyB,CAAC,GAEjDA,kBACD;AACH,CACF,CAAC;AAED,eAAejI,SAAS;AAGxB,MAAMmG,MAAM,GAAGvG,UAAU,CAAC2I,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,QAAQ,EAAE;EACZ,CAAC;EACDpC,WAAW,EAAE;IACX,GAAGxG,UAAU,CAAC6I,kBAAkB;IAChCC,aAAa,EAAE/I,WAAW,CAACgJ,KAAK,GAAG,aAAa,GAAG,KAAK;IACxDH,QAAQ,EAAE;EACZ,CAAC;EACDjC,YAAY,EAAE;IACZ,GAAG3G,UAAU,CAAC6I,kBAAkB;IAChCC,aAAa,EAAE/I,WAAW,CAACgJ,KAAK,GAAG,KAAK,GAAG,aAAa;IACxDH,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"sources":["ReanimatedSwipeable.tsx"],"names":["React","forwardRef","useCallback","useImperativeHandle","useMemo","GestureObjects","Gesture","GestureDetector","Animated","ReduceMotion","interpolate","measure","runOnJS","runOnUI","useAnimatedRef","useAnimatedStyle","useSharedValue","withSpring","I18nManager","StyleSheet","View","DRAG_TOSS","SwipeDirection","Swipeable","props","ref","defaultProps","friction","overshootFriction","dragOffset","enableTrackpadTwoFingerGesture","leftThreshold","rightThreshold","enabled","containerStyle","childrenContainerStyle","animationOptions","overshootLeft","overshootRight","testID","children","dragOffsetFromLeftEdge","dragOffsetFromRightEdge","onSwipeableOpenStartDrag","onSwipeableCloseStartDrag","onSwipeableWillOpen","onSwipeableWillClose","onSwipeableOpen","onSwipeableClose","renderLeftActions","renderRightActions","simultaneousWithExternalGesture","remainingProps","rowState","userDrag","appliedTranslation","rowWidth","leftWidth","rightWidth","showLeftProgress","showRightProgress","updateAnimatedEvent","shouldOvershootLeft","value","shouldOvershootRight","startOffset","offsetDrag","dispatchImmediateEvents","fromValue","toValue","RIGHT","LEFT","dispatchEndEvents","animateRow","velocityX","translationSpringConfig","mass","damping","stiffness","velocity","overshootClamping","reduceMotion","System","isClosing","moveToRight","usedWidth","progressSpringConfig","restDisplacementThreshold","restSpeedThreshold","frozenRowState","isFinished","progressTarget","Math","sign","max","leftLayoutRef","leftWrapperLayoutRef","rightLayoutRef","updateElementWidths","leftLayout","leftWrapperLayout","rightLayout","pageX","swipeableMethods","close","_WORKLET","openLeft","openRight","reset","onRowLayout","nativeEvent","layout","width","leftActionAnimation","opacity","leftElement","styles","leftActions","rightActionAnimation","rightElement","rightActions","handleRelease","event","translationX","leftThresholdProp","rightThresholdProp","dragStarted","tapGesture","tap","Tap","shouldCancelWhenOutside","onStart","Array","isArray","panGesture","pan","Pan","activeOffsetX","onUpdate","direction","onEnd","onFinalize","animatedStyle","transform","translateX","pointerEvents","swipeableComponent","container","create","overflow","absoluteFillObject","flexDirection","isRTL"],"mappings":";;AAAA;AACA;AACA;AAEA,OAAOA,KAAP,IAEEC,UAFF,EAGEC,WAHF,EAIEC,mBAJF,EAKEC,OALF,QAMO,OANP;AAQA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,qCAA1C;AACA,SAASC,eAAT,QAAgC,sCAAhC;AAOA,OAAOC,QAAP,IACEC,YADF,EAGEC,WAHF,EAIEC,OAJF,EAKEC,OALF,EAMEC,OANF,EAOEC,cAPF,EAQEC,gBARF,EASEC,cATF,EA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X,CAAkB;AAC/BD,EAAAA,SAAS,EAAE;AACTE,IAAAA,QAAQ,EAAE;AADD,GADoB;AAI/BhC,EAAAA,WAAW,EAAE,EACX,GAAGlG,UAAU,CAACmI,kBADH;AAEXC,IAAAA,aAAa,EAAErI,WAAW,CAACsI,KAAZ,GAAoB,aAApB,GAAoC,KAFxC;AAGXH,IAAAA,QAAQ,EAAE;AAHC,GAJkB;AAS/B7B,EAAAA,YAAY,EAAE,EACZ,GAAGrG,UAAU,CAACmI,kBADF;AAEZC,IAAAA,aAAa,EAAErI,WAAW,CAACsI,KAAZ,GAAoB,KAApB,GAA4B,aAF/B;AAGZH,IAAAA,QAAQ,EAAE;AAHE;AATiB,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 React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n} from 'react';\nimport { GestureRef } from '../handlers/gestures/gesture';\nimport { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';\nimport { GestureDetector } from '../handlers/gestures/GestureDetector';\nimport {\n GestureStateChangeEvent,\n GestureUpdateEvent,\n} from '../handlers/gestureHandlerCommon';\nimport type { PanGestureHandlerProps } from '../handlers/PanGestureHandler';\nimport type { PanGestureHandlerEventPayload } from '../handlers/GestureHandlerEventPayload';\nimport Animated, {\n ReduceMotion,\n SharedValue,\n interpolate,\n measure,\n runOnJS,\n runOnUI,\n useAnimatedRef,\n useAnimatedStyle,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport {\n I18nManager,\n LayoutChangeEvent,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\n\nconst DRAG_TOSS = 0.05;\n\ntype SwipeableExcludes = Exclude<\n keyof PanGestureHandlerProps,\n 'onGestureEvent' | 'onHandlerStateChange'\n>;\n\nenum SwipeDirection {\n LEFT = 'left',\n RIGHT = 'right',\n}\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 * Called when action panel gets open (either right or left).\n */\n onSwipeableOpen?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel is closed.\n */\n onSwipeableClose?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts animating on open (either right or left).\n */\n onSwipeableWillOpen?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts animating on close.\n */\n onSwipeableWillClose?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts being shown on dragging to open.\n */\n onSwipeableOpenStartDrag?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * Called when action panel starts being shown on dragging to close.\n */\n onSwipeableCloseStartDrag?: (\n direction: SwipeDirection.LEFT | SwipeDirection.RIGHT\n ) => void;\n\n /**\n * `progress`: Equals `0` when `swipeable` is closed, `1` when `swipeable` is opened.\n * - When the element overshoots it's opened position the value tends towards `Infinity`.\n * - Goes back to `1` when `swipeable` is released.\n *\n * `translation`: a horizontal offset of the `swipeable` relative to its closed position.\\\n * `swipeableMethods`: provides an object exposing methods for controlling the `swipeable`.\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderLeftActions?: (\n progress: SharedValue<number>,\n translation: SharedValue<number>,\n swipeableMethods: SwipeableMethods\n ) => React.ReactNode;\n\n /**\n * `progress`: Equals `0` when `swipeable` is closed, `1` when `swipeable` is opened.\n * - When the element overshoots it's opened position the value tends towards `Infinity`.\n * - Goes back to `1` when `swipeable` is released.\n *\n * `translation`: a horizontal offset of the `swipeable` relative to its closed position.\\\n * `swipeableMethods`: provides an object exposing methods for controlling the `swipeable`.\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderRightActions?: (\n progress: SharedValue<number>,\n translation: SharedValue<number>,\n swipeableMethods: SwipeableMethods\n ) => React.ReactNode;\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 /**\n * A gesture object or an array of gesture objects containing the configuration and callbacks to be\n * used with the swipeable's gesture handler.\n */\n simultaneousWithExternalGesture?:\n | Exclude<GestureRef, number>\n | Exclude<GestureRef, number>[];\n}\n\nexport interface SwipeableMethods {\n close: () => void;\n openLeft: () => void;\n openRight: () => void;\n reset: () => void;\n}\n\nconst Swipeable = forwardRef<SwipeableMethods, SwipeableProps>(\n function Swipeable(\n props: SwipeableProps,\n ref: ForwardedRef<SwipeableMethods>\n ) {\n const defaultProps = {\n friction: 1,\n overshootFriction: 1,\n dragOffset: 10,\n enableTrackpadTwoFingerGesture: false,\n };\n\n const {\n leftThreshold,\n rightThreshold,\n enabled,\n containerStyle,\n childrenContainerStyle,\n animationOptions,\n overshootLeft,\n overshootRight,\n testID,\n children,\n enableTrackpadTwoFingerGesture = defaultProps.enableTrackpadTwoFingerGesture,\n dragOffsetFromLeftEdge = defaultProps.dragOffset,\n dragOffsetFromRightEdge = defaultProps.dragOffset,\n friction = defaultProps.friction,\n overshootFriction = defaultProps.overshootFriction,\n onSwipeableOpenStartDrag,\n onSwipeableCloseStartDrag,\n onSwipeableWillOpen,\n onSwipeableWillClose,\n onSwipeableOpen,\n onSwipeableClose,\n renderLeftActions,\n renderRightActions,\n simultaneousWithExternalGesture,\n ...remainingProps\n } = props;\n\n const rowState = useSharedValue<number>(0);\n\n const userDrag = useSharedValue<number>(0);\n\n const appliedTranslation = useSharedValue<number>(0);\n\n const rowWidth = useSharedValue<number>(0);\n const leftWidth = useSharedValue<number>(0);\n const rightWidth = useSharedValue<number>(0);\n\n const showLeftProgress = useSharedValue<number>(0);\n const showRightProgress = useSharedValue<number>(0);\n\n const updateAnimatedEvent = useCallback(() => {\n 'worklet';\n\n const shouldOvershootLeft = overshootLeft ?? leftWidth.value > 0;\n const shouldOvershootRight = overshootRight ?? rightWidth.value > 0;\n\n const startOffset =\n rowState.value === 1\n ? leftWidth.value\n : rowState.value === -1\n ? -rightWidth.value\n : 0;\n\n const offsetDrag = userDrag.value / friction + startOffset;\n\n appliedTranslation.value = interpolate(\n offsetDrag,\n [\n -rightWidth.value - 1,\n -rightWidth.value,\n leftWidth.value,\n leftWidth.value + 1,\n ],\n [\n -rightWidth.value -\n (shouldOvershootRight ? 1 / overshootFriction : 0),\n -rightWidth.value,\n leftWidth.value,\n leftWidth.value + (shouldOvershootLeft ? 1 / overshootFriction : 0),\n ]\n );\n\n showLeftProgress.value =\n leftWidth.value > 0\n ? interpolate(\n appliedTranslation.value,\n [-1, 0, leftWidth.value],\n [0, 0, 1]\n )\n : 0;\n\n showRightProgress.value =\n rightWidth.value > 0\n ? interpolate(\n appliedTranslation.value,\n [-rightWidth.value, 0, 1],\n [1, 0, 0]\n )\n : 0;\n }, [\n appliedTranslation,\n friction,\n leftWidth,\n overshootFriction,\n rightWidth,\n rowState,\n showLeftProgress,\n showRightProgress,\n userDrag,\n overshootLeft,\n overshootRight,\n ]);\n\n const dispatchImmediateEvents = useCallback(\n (fromValue: number, toValue: number) => {\n 'worklet';\n if (toValue > 0 && onSwipeableWillOpen) {\n runOnJS(onSwipeableWillOpen)(SwipeDirection.RIGHT);\n } else if (toValue < 0 && onSwipeableWillOpen) {\n runOnJS(onSwipeableWillOpen)(SwipeDirection.LEFT);\n } else if (onSwipeableWillClose) {\n runOnJS(onSwipeableWillClose)(\n fromValue > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT\n );\n }\n },\n [onSwipeableWillClose, onSwipeableWillOpen]\n );\n\n const dispatchEndEvents = useCallback(\n (fromValue: number, toValue: number) => {\n 'worklet';\n if (toValue > 0 && onSwipeableOpen) {\n runOnJS(onSwipeableOpen)(SwipeDirection.RIGHT);\n } else if (toValue < 0 && onSwipeableOpen) {\n runOnJS(onSwipeableOpen)(SwipeDirection.LEFT);\n } else if (onSwipeableClose) {\n runOnJS(onSwipeableClose)(\n fromValue > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT\n );\n }\n },\n [onSwipeableClose, onSwipeableOpen]\n );\n\n const animateRow: (toValue: number, velocityX?: number) => void =\n useCallback(\n (toValue: number, velocityX?: number) => {\n 'worklet';\n\n const translationSpringConfig = {\n mass: 2,\n damping: 1000,\n stiffness: 700,\n velocity: velocityX,\n overshootClamping: true,\n reduceMotion: ReduceMotion.System,\n ...animationOptions,\n };\n\n const isClosing = toValue === 0;\n const moveToRight = isClosing ? rowState.value < 0 : toValue > 0;\n\n const usedWidth = isClosing\n ? moveToRight\n ? rightWidth.value\n : leftWidth.value\n : moveToRight\n ? leftWidth.value\n : rightWidth.value;\n\n const progressSpringConfig = {\n ...translationSpringConfig,\n restDisplacementThreshold: 0.01,\n restSpeedThreshold: 0.01,\n velocity:\n velocityX &&\n interpolate(velocityX, [-usedWidth, usedWidth], [-1, 1]),\n };\n\n const frozenRowState = rowState.value;\n\n appliedTranslation.value = withSpring(\n toValue,\n translationSpringConfig,\n (isFinished) => {\n if (isFinished) {\n dispatchEndEvents(frozenRowState, toValue);\n }\n }\n );\n\n const progressTarget = toValue === 0 ? 0 : 1 * Math.sign(toValue);\n\n showLeftProgress.value = withSpring(\n Math.max(progressTarget, 0),\n progressSpringConfig\n );\n\n showRightProgress.value = withSpring(\n Math.max(-progressTarget, 0),\n progressSpringConfig\n );\n\n dispatchImmediateEvents(frozenRowState, toValue);\n\n rowState.value = Math.sign(toValue);\n },\n [\n rowState,\n animationOptions,\n appliedTranslation,\n showLeftProgress,\n leftWidth,\n showRightProgress,\n rightWidth,\n dispatchImmediateEvents,\n dispatchEndEvents,\n ]\n );\n\n const leftLayoutRef = useAnimatedRef();\n const leftWrapperLayoutRef = useAnimatedRef();\n const rightLayoutRef = useAnimatedRef();\n\n const updateElementWidths = useCallback(() => {\n 'worklet';\n const leftLayout = measure(leftLayoutRef);\n const leftWrapperLayout = measure(leftWrapperLayoutRef);\n const rightLayout = measure(rightLayoutRef);\n leftWidth.value =\n (leftLayout?.pageX ?? 0) - (leftWrapperLayout?.pageX ?? 0);\n\n rightWidth.value =\n rowWidth.value -\n (rightLayout?.pageX ?? rowWidth.value) +\n (leftWrapperLayout?.pageX ?? 0);\n }, [\n leftLayoutRef,\n leftWrapperLayoutRef,\n rightLayoutRef,\n leftWidth,\n rightWidth,\n rowWidth,\n ]);\n\n const swipeableMethods = useMemo<SwipeableMethods>(\n () => ({\n close() {\n 'worklet';\n if (_WORKLET) {\n animateRow(0);\n return;\n }\n runOnUI(() => {\n animateRow(0);\n })();\n },\n openLeft() {\n 'worklet';\n if (_WORKLET) {\n updateElementWidths();\n animateRow(leftWidth.value);\n return;\n }\n runOnUI(() => {\n updateElementWidths();\n animateRow(leftWidth.value);\n })();\n },\n openRight() {\n 'worklet';\n if (_WORKLET) {\n updateElementWidths();\n animateRow(-rightWidth.value);\n return;\n }\n runOnUI(() => {\n updateElementWidths();\n animateRow(-rightWidth.value);\n })();\n },\n reset() {\n 'worklet';\n userDrag.value = 0;\n showLeftProgress.value = 0;\n appliedTranslation.value = 0;\n rowState.value = 0;\n },\n }),\n [\n animateRow,\n updateElementWidths,\n leftWidth,\n rightWidth,\n userDrag,\n showLeftProgress,\n appliedTranslation,\n rowState,\n ]\n );\n\n const onRowLayout = useCallback(\n ({ nativeEvent }: LayoutChangeEvent) => {\n rowWidth.value = nativeEvent.layout.width;\n },\n [rowWidth]\n );\n\n // As stated in `Dimensions.get` docstring, this function should be called on every render\n // since dimensions may change (e.g. orientation change)\n\n const leftActionAnimation = useAnimatedStyle(() => {\n return {\n opacity: showLeftProgress.value === 0 ? 0 : 1,\n };\n });\n\n const leftElement = useCallback(\n () => (\n <Animated.View\n ref={leftWrapperLayoutRef}\n style={[styles.leftActions, leftActionAnimation]}>\n {renderLeftActions?.(\n showLeftProgress,\n appliedTranslation,\n swipeableMethods\n )}\n <Animated.View ref={leftLayoutRef} />\n </Animated.View>\n ),\n [\n appliedTranslation,\n leftActionAnimation,\n leftLayoutRef,\n leftWrapperLayoutRef,\n renderLeftActions,\n showLeftProgress,\n swipeableMethods,\n ]\n );\n\n const rightActionAnimation = useAnimatedStyle(() => {\n return {\n opacity: showRightProgress.value === 0 ? 0 : 1,\n };\n });\n\n const rightElement = useCallback(\n () => (\n <Animated.View style={[styles.rightActions, rightActionAnimation]}>\n {renderRightActions?.(\n showRightProgress,\n appliedTranslation,\n swipeableMethods\n )}\n <Animated.View ref={rightLayoutRef} />\n </Animated.View>\n ),\n [\n appliedTranslation,\n renderRightActions,\n rightActionAnimation,\n rightLayoutRef,\n showRightProgress,\n swipeableMethods,\n ]\n );\n\n const handleRelease = useCallback(\n (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {\n 'worklet';\n const { velocityX } = event;\n userDrag.value = event.translationX;\n\n const leftThresholdProp = leftThreshold ?? leftWidth.value / 2;\n const rightThresholdProp = rightThreshold ?? rightWidth.value / 2;\n\n const translationX =\n (userDrag.value + DRAG_TOSS * velocityX) / friction;\n\n let toValue = 0;\n\n if (rowState.value === 0) {\n if (translationX > leftThresholdProp) {\n toValue = leftWidth.value;\n } else if (translationX < -rightThresholdProp) {\n toValue = -rightWidth.value;\n }\n } else if (rowState.value === 1) {\n // Swiped to left\n if (translationX > -leftThresholdProp) {\n toValue = leftWidth.value;\n }\n } else {\n // Swiped to right\n if (translationX < rightThresholdProp) {\n toValue = -rightWidth.value;\n }\n }\n\n animateRow(toValue, velocityX / friction);\n },\n [\n animateRow,\n friction,\n leftThreshold,\n leftWidth,\n rightThreshold,\n rightWidth,\n rowState,\n userDrag,\n ]\n );\n\n const close = useCallback(() => {\n 'worklet';\n animateRow(0);\n }, [animateRow]);\n\n const dragStarted = useSharedValue<boolean>(false);\n\n const tapGesture = useMemo(() => {\n const tap = Gesture.Tap()\n .shouldCancelWhenOutside(true)\n .onStart(() => {\n if (rowState.value !== 0) {\n close();\n }\n });\n\n if (!simultaneousWithExternalGesture) {\n return tap;\n }\n\n if (Array.isArray(simultaneousWithExternalGesture)) {\n tap.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);\n } else {\n tap.simultaneousWithExternalGesture(simultaneousWithExternalGesture);\n }\n\n return tap;\n }, [close, rowState, simultaneousWithExternalGesture]);\n\n const panGesture = useMemo(() => {\n const pan = Gesture.Pan()\n .enabled(enabled !== false)\n .enableTrackpadTwoFingerGesture(enableTrackpadTwoFingerGesture)\n .activeOffsetX([-dragOffsetFromRightEdge, dragOffsetFromLeftEdge])\n .onStart(updateElementWidths)\n .onUpdate(\n (event: GestureUpdateEvent<PanGestureHandlerEventPayload>) => {\n userDrag.value = event.translationX;\n\n const direction =\n rowState.value === -1\n ? SwipeDirection.RIGHT\n : rowState.value === 1\n ? SwipeDirection.LEFT\n : event.translationX > 0\n ? SwipeDirection.RIGHT\n : SwipeDirection.LEFT;\n\n if (!dragStarted.value) {\n dragStarted.value = true;\n if (rowState.value === 0 && onSwipeableOpenStartDrag) {\n runOnJS(onSwipeableOpenStartDrag)(direction);\n } else if (onSwipeableCloseStartDrag) {\n runOnJS(onSwipeableCloseStartDrag)(direction);\n }\n }\n\n updateAnimatedEvent();\n }\n )\n .onEnd(\n (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {\n handleRelease(event);\n }\n )\n .onFinalize(() => {\n dragStarted.value = false;\n });\n\n if (!simultaneousWithExternalGesture) {\n return pan;\n }\n\n if (Array.isArray(simultaneousWithExternalGesture)) {\n pan.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);\n } else {\n pan.simultaneousWithExternalGesture(simultaneousWithExternalGesture);\n }\n\n return pan;\n }, [\n dragOffsetFromLeftEdge,\n dragOffsetFromRightEdge,\n dragStarted,\n enableTrackpadTwoFingerGesture,\n enabled,\n handleRelease,\n onSwipeableCloseStartDrag,\n onSwipeableOpenStartDrag,\n rowState,\n updateAnimatedEvent,\n updateElementWidths,\n userDrag,\n simultaneousWithExternalGesture,\n ]);\n\n useImperativeHandle(ref, () => swipeableMethods, [swipeableMethods]);\n\n const animatedStyle = useAnimatedStyle(\n () => ({\n transform: [{ translateX: appliedTranslation.value }],\n pointerEvents: rowState.value === 0 ? 'auto' : 'box-only',\n }),\n [appliedTranslation, rowState]\n );\n\n const swipeableComponent = (\n <GestureDetector gesture={panGesture} touchAction=\"pan-y\">\n <Animated.View\n {...remainingProps}\n onLayout={onRowLayout}\n style={[styles.container, containerStyle]}>\n {leftElement()}\n {rightElement()}\n <GestureDetector gesture={tapGesture} touchAction=\"pan-y\">\n <Animated.View style={[animatedStyle, childrenContainerStyle]}>\n {children}\n </Animated.View>\n </GestureDetector>\n </Animated.View>\n </GestureDetector>\n );\n\n return testID ? (\n <View testID={testID}>{swipeableComponent}</View>\n ) : (\n swipeableComponent\n );\n }\n);\n\nexport default Swipeable;\nexport type SwipeableRef = ForwardedRef<SwipeableMethods>;\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n },\n leftActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',\n overflow: 'hidden',\n },\n rightActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',\n overflow: 'hidden',\n },\n});\n"]}
|