react-native-gesture-handler 2.25.0 → 2.27.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/README.md +2 -4
- package/RNGestureHandler.podspec +1 -0
- package/android/build.gradle +41 -42
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +1 -1
- package/android/gradle.properties +1 -1
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -2
- package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +4 -1
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +1 -1
- package/android/{package77/src → src}/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +14 -19
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +29 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +229 -114
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +4 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +91 -49
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +13 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +20 -6
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +52 -21
- package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +12 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +65 -35
- package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +3 -3
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +187 -92
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +12 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +3 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +12 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/StylusData.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +55 -33
- package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +13 -18
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +27 -21
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +7 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +13 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDispatcher.kt +189 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerFactoryUtil.kt +34 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +7 -11
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +29 -590
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +8 -14
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +26 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +15 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +2 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +17 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +6 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +7 -5
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/jni/CMakeLists.txt +8 -18
- package/android/svg/src/main/java/com/swmansion/gesturehandler/RNSVGHitTester.kt +1 -3
- package/apple/RNGestureHandlerButton.mm +6 -2
- package/package.json +29 -47
- package/src/components/DrawerLayout.tsx +5 -2
- package/src/components/GestureButtons.tsx +2 -2
- package/src/components/GestureComponents.web.tsx +1 -1
- package/src/components/GestureHandlerButton.web.tsx +3 -3
- package/src/components/Pressable/Pressable.tsx +362 -425
- package/src/components/Pressable/PressableProps.tsx +34 -0
- package/src/components/Pressable/StateMachine.tsx +49 -0
- package/src/components/Pressable/stateDefinitions.ts +125 -0
- package/src/components/Pressable/utils.ts +11 -7
- package/src/components/ReanimatedSwipeable.tsx +55 -33
- package/src/components/Swipeable.tsx +3 -0
- package/src/components/Text.tsx +5 -2
- package/src/components/utils.ts +26 -0
- package/src/getShadowNodeFromRef.ts +2 -2
- package/src/handlers/GestureHandlerEventPayload.ts +3 -0
- package/src/handlers/createHandler.tsx +1 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +9 -0
- package/src/handlers/gestures/forceTouchGesture.ts +9 -0
- package/src/handlers/gestures/gestureObjects.ts +3 -1
- package/src/handlers/gestures/reanimatedWrapper.ts +0 -1
- package/src/handlers/utils.ts +1 -1
- package/src/utils.ts +0 -1
- package/src/web/detectors/RotationGestureDetector.ts +4 -0
- package/src/web/handlers/FlingGestureHandler.ts +4 -0
- package/src/web/handlers/GestureHandler.ts +9 -3
- package/src/web/handlers/PanGestureHandler.ts +25 -36
- package/src/web/handlers/TapGestureHandler.ts +14 -19
- package/src/web/tools/GestureHandlerOrchestrator.ts +1 -0
- package/src/web/tools/PointerEventManager.ts +1 -1
- package/src/web/tools/PointerTracker.ts +17 -15
- package/src/web/tools/Vector.ts +1 -1
- package/src/web_hammer/DiscreteGestureHandler.ts +1 -1
- package/src/web_hammer/DraggingGestureHandler.ts +1 -1
- package/src/web_hammer/FlingGestureHandler.ts +1 -1
- package/src/web_hammer/GestureHandler.ts +2 -1
- package/src/web_hammer/LongPressGestureHandler.ts +1 -1
- package/android/packageDeprecated/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +0 -85
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -60
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -26
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -26
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -16
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +0 -67
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -13
- package/lib/commonjs/ActionType.js +0 -15
- package/lib/commonjs/ActionType.js.map +0 -1
- package/lib/commonjs/Directions.js +0 -28
- package/lib/commonjs/Directions.js.map +0 -1
- package/lib/commonjs/EnableNewWebImplementation.js +0 -48
- package/lib/commonjs/EnableNewWebImplementation.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +0 -15
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +0 -1
- package/lib/commonjs/PlatformConstants.js +0 -15
- package/lib/commonjs/PlatformConstants.js.map +0 -1
- package/lib/commonjs/PlatformConstants.web.js +0 -14
- package/lib/commonjs/PlatformConstants.web.js.map +0 -1
- package/lib/commonjs/PointerType.js +0 -17
- package/lib/commonjs/PointerType.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.js +0 -16
- package/lib/commonjs/RNGestureHandlerModule.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +0 -122
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +0 -66
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +0 -1
- package/lib/commonjs/RNRenderer.js +0 -16
- package/lib/commonjs/RNRenderer.js.map +0 -1
- package/lib/commonjs/RNRenderer.web.js +0 -11
- package/lib/commonjs/RNRenderer.web.js.map +0 -1
- package/lib/commonjs/State.js +0 -18
- package/lib/commonjs/State.js.map +0 -1
- package/lib/commonjs/TouchEventType.js +0 -16
- package/lib/commonjs/TouchEventType.js.map +0 -1
- package/lib/commonjs/components/DrawerLayout.js +0 -574
- package/lib/commonjs/components/DrawerLayout.js.map +0 -1
- package/lib/commonjs/components/GestureButtons.js +0 -269
- package/lib/commonjs/components/GestureButtons.js.map +0 -1
- package/lib/commonjs/components/GestureButtonsProps.js +0 -6
- package/lib/commonjs/components/GestureButtonsProps.js.map +0 -1
- package/lib/commonjs/components/GestureComponents.js +0 -115
- package/lib/commonjs/components/GestureComponents.js.map +0 -1
- package/lib/commonjs/components/GestureComponents.web.js +0 -52
- package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.js +0 -14
- package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +0 -46
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +0 -44
- package/lib/commonjs/components/GestureHandlerRootView.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +0 -38
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
- package/lib/commonjs/components/Pressable/Pressable.js +0 -370
- package/lib/commonjs/components/Pressable/Pressable.js.map +0 -1
- package/lib/commonjs/components/Pressable/PressableProps.js +0 -6
- package/lib/commonjs/components/Pressable/PressableProps.js.map +0 -1
- package/lib/commonjs/components/Pressable/index.js +0 -16
- package/lib/commonjs/components/Pressable/index.js.map +0 -1
- package/lib/commonjs/components/Pressable/utils.js +0 -114
- package/lib/commonjs/components/Pressable/utils.js.map +0 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +0 -393
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +0 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +0 -367
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +0 -1
- package/lib/commonjs/components/Swipeable.js +0 -415
- package/lib/commonjs/components/Swipeable.js.map +0 -1
- package/lib/commonjs/components/Text.js +0 -71
- package/lib/commonjs/components/Text.js.map +0 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +0 -40
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +0 -1
- package/lib/commonjs/components/touchables/ExtraButtonProps.js +0 -2
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +0 -290
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js +0 -6
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +0 -111
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +0 -102
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +0 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +0 -6
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -79
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -37
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/index.js +0 -40
- package/lib/commonjs/components/touchables/index.js.map +0 -1
- package/lib/commonjs/findNodeHandle.js +0 -12
- package/lib/commonjs/findNodeHandle.js.map +0 -1
- package/lib/commonjs/findNodeHandle.web.js +0 -48
- package/lib/commonjs/findNodeHandle.web.js.map +0 -1
- package/lib/commonjs/getShadowNodeFromRef.js +0 -52
- package/lib/commonjs/getShadowNodeFromRef.js.map +0 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
- package/lib/commonjs/ghQueueMicrotask.js +0 -11
- package/lib/commonjs/ghQueueMicrotask.js.map +0 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +0 -33
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +0 -53
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js +0 -6
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +0 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +0 -35
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -35
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +0 -131
- package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +0 -31
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +0 -14
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +0 -31
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +0 -35
- package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/createHandler.js +0 -494
- package/lib/commonjs/handlers/createHandler.js.map +0 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +0 -87
- package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +0 -14
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +0 -11
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -28
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +0 -6
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +0 -42
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +0 -49
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +0 -87
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +0 -29
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +0 -148
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -25
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js +0 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +0 -77
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -180
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -57
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +0 -48
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -49
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +0 -172
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +0 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +0 -147
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +0 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +0 -47
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +0 -82
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gesture.js +0 -381
- package/lib/commonjs/handlers/gestures/gesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +0 -107
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +0 -156
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +0 -75
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +0 -32
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +0 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +0 -74
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +0 -57
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +0 -31
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +0 -44
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +0 -225
- package/lib/commonjs/handlers/gestures/panGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +0 -45
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +0 -37
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +0 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +0 -45
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +0 -102
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +0 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +0 -12
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +0 -1
- package/lib/commonjs/handlers/handlersRegistry.js +0 -66
- package/lib/commonjs/handlers/handlersRegistry.js.map +0 -1
- package/lib/commonjs/handlers/utils.js +0 -92
- package/lib/commonjs/handlers/utils.js.map +0 -1
- package/lib/commonjs/index.js +0 -298
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/init.js +0 -32
- package/lib/commonjs/init.js.map +0 -1
- package/lib/commonjs/jestUtils/index.js +0 -20
- package/lib/commonjs/jestUtils/index.js.map +0 -1
- package/lib/commonjs/jestUtils/jestUtils.js +0 -383
- package/lib/commonjs/jestUtils/jestUtils.js.map +0 -1
- package/lib/commonjs/mocks.js +0 -81
- package/lib/commonjs/mocks.js.map +0 -1
- package/lib/commonjs/mountRegistry.js +0 -49
- package/lib/commonjs/mountRegistry.js.map +0 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +0 -13
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +0 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +0 -15
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +0 -15
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
- package/lib/commonjs/typeUtils.js +0 -2
- package/lib/commonjs/typeUtils.js.map +0 -1
- package/lib/commonjs/utils.js +0 -116
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/commonjs/web/Gestures.js +0 -66
- package/lib/commonjs/web/Gestures.js.map +0 -1
- package/lib/commonjs/web/constants.js +0 -11
- package/lib/commonjs/web/constants.js.map +0 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +0 -163
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +0 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +0 -155
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +0 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -190
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +0 -821
- package/lib/commonjs/web/handlers/GestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +0 -65
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js +0 -2
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +0 -194
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -48
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -189
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +0 -530
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -165
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -173
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -286
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/web/interfaces.js +0 -40
- package/lib/commonjs/web/interfaces.js.map +0 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +0 -59
- package/lib/commonjs/web/tools/CircularBuffer.js.map +0 -1
- package/lib/commonjs/web/tools/EventManager.js +0 -133
- package/lib/commonjs/web/tools/EventManager.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +0 -6
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +0 -340
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +0 -217
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +0 -1
- package/lib/commonjs/web/tools/InteractionManager.js +0 -119
- package/lib/commonjs/web/tools/InteractionManager.js.map +0 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +0 -110
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +0 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +0 -204
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +0 -1
- package/lib/commonjs/web/tools/NodeManager.js +0 -49
- package/lib/commonjs/web/tools/NodeManager.js.map +0 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +0 -229
- package/lib/commonjs/web/tools/PointerEventManager.js.map +0 -1
- package/lib/commonjs/web/tools/PointerTracker.js +0 -234
- package/lib/commonjs/web/tools/PointerTracker.js.map +0 -1
- package/lib/commonjs/web/tools/Vector.js +0 -61
- package/lib/commonjs/web/tools/Vector.js.map +0 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +0 -111
- package/lib/commonjs/web/tools/VelocityTracker.js.map +0 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +0 -74
- package/lib/commonjs/web/tools/WheelEventManager.js.map +0 -1
- package/lib/commonjs/web/utils.js +0 -270
- package/lib/commonjs/web/utils.js.map +0 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +0 -105
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +0 -53
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/Errors.js +0 -16
- package/lib/commonjs/web_hammer/Errors.js.map +0 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +0 -170
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +0 -579
- package/lib/commonjs/web_hammer/GestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +0 -54
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +0 -71
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +0 -66
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/NodeManager.js +0 -48
- package/lib/commonjs/web_hammer/NodeManager.js.map +0 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +0 -208
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +0 -40
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +0 -188
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +0 -44
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +0 -192
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/constants.js +0 -64
- package/lib/commonjs/web_hammer/constants.js.map +0 -1
- package/lib/commonjs/web_hammer/utils.js +0 -42
- package/lib/commonjs/web_hammer/utils.js.map +0 -1
- package/lib/module/ActionType.js +0 -7
- package/lib/module/ActionType.js.map +0 -1
- package/lib/module/Directions.js +0 -19
- package/lib/module/Directions.js.map +0 -1
- package/lib/module/EnableNewWebImplementation.js +0 -35
- package/lib/module/EnableNewWebImplementation.js.map +0 -1
- package/lib/module/GestureHandlerRootViewContext.js +0 -3
- package/lib/module/GestureHandlerRootViewContext.js.map +0 -1
- package/lib/module/PlatformConstants.js +0 -5
- package/lib/module/PlatformConstants.js.map +0 -1
- package/lib/module/PlatformConstants.web.js +0 -7
- package/lib/module/PlatformConstants.web.js.map +0 -1
- package/lib/module/PointerType.js +0 -10
- package/lib/module/PointerType.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.js +0 -5
- package/lib/module/RNGestureHandlerModule.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.web.js +0 -98
- package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.windows.js +0 -47
- package/lib/module/RNGestureHandlerModule.windows.js.map +0 -1
- package/lib/module/RNRenderer.js +0 -4
- package/lib/module/RNRenderer.js.map +0 -1
- package/lib/module/RNRenderer.web.js +0 -4
- package/lib/module/RNRenderer.web.js.map +0 -1
- package/lib/module/State.js +0 -10
- package/lib/module/State.js.map +0 -1
- package/lib/module/TouchEventType.js +0 -8
- package/lib/module/TouchEventType.js.map +0 -1
- package/lib/module/components/DrawerLayout.js +0 -560
- package/lib/module/components/DrawerLayout.js.map +0 -1
- package/lib/module/components/GestureButtons.js +0 -237
- package/lib/module/components/GestureButtons.js.map +0 -1
- package/lib/module/components/GestureButtonsProps.js +0 -2
- package/lib/module/components/GestureButtonsProps.js.map +0 -1
- package/lib/module/components/GestureComponents.js +0 -90
- package/lib/module/components/GestureComponents.js.map +0 -1
- package/lib/module/components/GestureComponents.web.js +0 -28
- package/lib/module/components/GestureComponents.web.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.js +0 -3
- package/lib/module/components/GestureHandlerButton.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.web.js +0 -9
- package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.android.js +0 -27
- package/lib/module/components/GestureHandlerRootView.android.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.js +0 -26
- package/lib/module/components/GestureHandlerRootView.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.web.js +0 -21
- package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
- package/lib/module/components/Pressable/Pressable.js +0 -346
- package/lib/module/components/Pressable/Pressable.js.map +0 -1
- package/lib/module/components/Pressable/PressableProps.js +0 -2
- package/lib/module/components/Pressable/PressableProps.js.map +0 -1
- package/lib/module/components/Pressable/index.js +0 -2
- package/lib/module/components/Pressable/index.js.map +0 -1
- package/lib/module/components/Pressable/utils.js +0 -99
- package/lib/module/components/Pressable/utils.js.map +0 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +0 -369
- package/lib/module/components/ReanimatedDrawerLayout.js.map +0 -1
- package/lib/module/components/ReanimatedSwipeable.js +0 -350
- package/lib/module/components/ReanimatedSwipeable.js.map +0 -1
- package/lib/module/components/Swipeable.js +0 -398
- package/lib/module/components/Swipeable.js.map +0 -1
- package/lib/module/components/Text.js +0 -53
- package/lib/module/components/Text.js.map +0 -1
- package/lib/module/components/gestureHandlerRootHOC.js +0 -22
- package/lib/module/components/gestureHandlerRootHOC.js.map +0 -1
- package/lib/module/components/touchables/ExtraButtonProps.js +0 -2
- package/lib/module/components/touchables/ExtraButtonProps.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchable.js +0 -274
- package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchableProps.js +0 -2
- package/lib/module/components/touchables/GenericTouchableProps.js.map +0 -1
- package/lib/module/components/touchables/TouchableHighlight.js +0 -97
- package/lib/module/components/touchables/TouchableHighlight.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +0 -86
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +0 -8
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +0 -2
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
- package/lib/module/components/touchables/TouchableOpacity.js +0 -68
- package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -22
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/module/components/touchables/index.js +0 -5
- package/lib/module/components/touchables/index.js.map +0 -1
- package/lib/module/findNodeHandle.js +0 -3
- package/lib/module/findNodeHandle.js.map +0 -1
- package/lib/module/findNodeHandle.web.js +0 -39
- package/lib/module/findNodeHandle.web.js.map +0 -1
- package/lib/module/getShadowNodeFromRef.js +0 -45
- package/lib/module/getShadowNodeFromRef.js.map +0 -1
- package/lib/module/getShadowNodeFromRef.web.js +0 -8
- package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
- package/lib/module/ghQueueMicrotask.js +0 -4
- package/lib/module/ghQueueMicrotask.js.map +0 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -18
- package/lib/module/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +0 -35
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +0 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js +0 -2
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +0 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -20
- package/lib/module/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -19
- package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/handlers/PanGestureHandler.js +0 -114
- package/lib/module/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -21
- package/lib/module/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/module/handlers/PressabilityDebugView.js +0 -3
- package/lib/module/handlers/PressabilityDebugView.js.map +0 -1
- package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
- package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -21
- package/lib/module/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -20
- package/lib/module/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/handlers/createHandler.js +0 -460
- package/lib/module/handlers/createHandler.js.map +0 -1
- package/lib/module/handlers/createNativeWrapper.js +0 -75
- package/lib/module/handlers/createNativeWrapper.js.map +0 -1
- package/lib/module/handlers/customDirectEventTypes.js +0 -3
- package/lib/module/handlers/customDirectEventTypes.js.map +0 -1
- package/lib/module/handlers/customDirectEventTypes.web.js +0 -5
- package/lib/module/handlers/customDirectEventTypes.web.js.map +0 -1
- package/lib/module/handlers/gestureHandlerCommon.js +0 -19
- package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js +0 -2
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +0 -26
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +0 -32
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +0 -68
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -14
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +0 -118
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -18
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js +0 -2
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +0 -61
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -165
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -41
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +0 -39
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -36
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +0 -139
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +0 -1
- package/lib/module/handlers/gestures/eventReceiver.js +0 -131
- package/lib/module/handlers/gestures/eventReceiver.js.map +0 -1
- package/lib/module/handlers/gestures/flingGesture.js +0 -37
- package/lib/module/handlers/gestures/flingGesture.js.map +0 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +0 -73
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +0 -1
- package/lib/module/handlers/gestures/gesture.js +0 -362
- package/lib/module/handlers/gestures/gesture.js.map +0 -1
- package/lib/module/handlers/gestures/gestureComposition.js +0 -92
- package/lib/module/handlers/gestures/gestureComposition.js.map +0 -1
- package/lib/module/handlers/gestures/gestureObjects.js +0 -138
- package/lib/module/handlers/gestures/gestureObjects.js.map +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +0 -64
- package/lib/module/handlers/gestures/gestureStateManager.js.map +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -21
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +0 -1
- package/lib/module/handlers/gestures/hoverGesture.js +0 -62
- package/lib/module/handlers/gestures/hoverGesture.js.map +0 -1
- package/lib/module/handlers/gestures/longPressGesture.js +0 -47
- package/lib/module/handlers/gestures/longPressGesture.js.map +0 -1
- package/lib/module/handlers/gestures/manualGesture.js +0 -22
- package/lib/module/handlers/gestures/manualGesture.js.map +0 -1
- package/lib/module/handlers/gestures/nativeGesture.js +0 -34
- package/lib/module/handlers/gestures/nativeGesture.js.map +0 -1
- package/lib/module/handlers/gestures/panGesture.js +0 -216
- package/lib/module/handlers/gestures/panGesture.js.map +0 -1
- package/lib/module/handlers/gestures/pinchGesture.js +0 -36
- package/lib/module/handlers/gestures/pinchGesture.js.map +0 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -30
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +0 -1
- package/lib/module/handlers/gestures/rotationGesture.js +0 -36
- package/lib/module/handlers/gestures/rotationGesture.js.map +0 -1
- package/lib/module/handlers/gestures/tapGesture.js +0 -92
- package/lib/module/handlers/gestures/tapGesture.js.map +0 -1
- package/lib/module/handlers/getNextHandlerTag.js +0 -5
- package/lib/module/handlers/getNextHandlerTag.js.map +0 -1
- package/lib/module/handlers/handlersRegistry.js +0 -43
- package/lib/module/handlers/handlersRegistry.js.map +0 -1
- package/lib/module/handlers/utils.js +0 -71
- package/lib/module/handlers/utils.js.map +0 -1
- package/lib/module/index.js +0 -29
- package/lib/module/index.js.map +0 -1
- package/lib/module/init.js +0 -16
- package/lib/module/init.js.map +0 -1
- package/lib/module/jestUtils/index.js +0 -2
- package/lib/module/jestUtils/index.js.map +0 -1
- package/lib/module/jestUtils/jestUtils.js +0 -358
- package/lib/module/jestUtils/jestUtils.js.map +0 -1
- package/lib/module/mocks.js +0 -68
- package/lib/module/mocks.js.map +0 -1
- package/lib/module/mountRegistry.js +0 -40
- package/lib/module/mountRegistry.js.map +0 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js +0 -3
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +0 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +0 -3
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +0 -3
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
- package/lib/module/typeUtils.js +0 -2
- package/lib/module/typeUtils.js.map +0 -1
- package/lib/module/utils.js +0 -87
- package/lib/module/utils.js.map +0 -1
- package/lib/module/web/Gestures.js +0 -39
- package/lib/module/web/Gestures.js.map +0 -1
- package/lib/module/web/constants.js +0 -3
- package/lib/module/web/constants.js.map +0 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +0 -153
- package/lib/module/web/detectors/RotationGestureDetector.js.map +0 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +0 -144
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +0 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +0 -173
- package/lib/module/web/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/GestureHandler.js +0 -801
- package/lib/module/web/handlers/GestureHandler.js.map +0 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +0 -50
- package/lib/module/web/handlers/HoverGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/IGestureHandler.js +0 -2
- package/lib/module/web/handlers/IGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +0 -180
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -36
- package/lib/module/web/handlers/ManualGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -174
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/PanGestureHandler.js +0 -514
- package/lib/module/web/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +0 -150
- package/lib/module/web/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +0 -158
- package/lib/module/web/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/TapGestureHandler.js +0 -271
- package/lib/module/web/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/web/interfaces.js +0 -31
- package/lib/module/web/interfaces.js.map +0 -1
- package/lib/module/web/tools/CircularBuffer.js +0 -50
- package/lib/module/web/tools/CircularBuffer.js.map +0 -1
- package/lib/module/web/tools/EventManager.js +0 -124
- package/lib/module/web/tools/EventManager.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js +0 -2
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +0 -326
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +0 -199
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +0 -1
- package/lib/module/web/tools/InteractionManager.js +0 -110
- package/lib/module/web/tools/InteractionManager.js.map +0 -1
- package/lib/module/web/tools/KeyboardEventManager.js +0 -96
- package/lib/module/web/tools/KeyboardEventManager.js.map +0 -1
- package/lib/module/web/tools/LeastSquareSolver.js +0 -195
- package/lib/module/web/tools/LeastSquareSolver.js.map +0 -1
- package/lib/module/web/tools/NodeManager.js +0 -40
- package/lib/module/web/tools/NodeManager.js.map +0 -1
- package/lib/module/web/tools/PointerEventManager.js +0 -212
- package/lib/module/web/tools/PointerEventManager.js.map +0 -1
- package/lib/module/web/tools/PointerTracker.js +0 -221
- package/lib/module/web/tools/PointerTracker.js.map +0 -1
- package/lib/module/web/tools/Vector.js +0 -50
- package/lib/module/web/tools/Vector.js.map +0 -1
- package/lib/module/web/tools/VelocityTracker.js +0 -98
- package/lib/module/web/tools/VelocityTracker.js.map +0 -1
- package/lib/module/web/tools/WheelEventManager.js +0 -60
- package/lib/module/web/tools/WheelEventManager.js.map +0 -1
- package/lib/module/web/utils.js +0 -243
- package/lib/module/web/utils.js.map +0 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +0 -94
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +0 -40
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/Errors.js +0 -7
- package/lib/module/web_hammer/Errors.js.map +0 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +0 -156
- package/lib/module/web_hammer/FlingGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/GestureHandler.js +0 -563
- package/lib/module/web_hammer/GestureHandler.js.map +0 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +0 -44
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +0 -58
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +0 -49
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/NodeManager.js +0 -33
- package/lib/module/web_hammer/NodeManager.js.map +0 -1
- package/lib/module/web_hammer/PanGestureHandler.js +0 -194
- package/lib/module/web_hammer/PanGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +0 -29
- package/lib/module/web_hammer/PinchGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/PressGestureHandler.js +0 -174
- package/lib/module/web_hammer/PressGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +0 -32
- package/lib/module/web_hammer/RotationGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/TapGestureHandler.js +0 -180
- package/lib/module/web_hammer/TapGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/constants.js +0 -43
- package/lib/module/web_hammer/constants.js.map +0 -1
- package/lib/module/web_hammer/utils.js +0 -19
- package/lib/module/web_hammer/utils.js.map +0 -1
- package/lib/typescript/ActionType.d.ts +0 -7
- package/lib/typescript/Directions.d.ts +0 -14
- package/lib/typescript/EnableNewWebImplementation.d.ts +0 -9
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +0 -3
- package/lib/typescript/PlatformConstants.d.ts +0 -5
- package/lib/typescript/PlatformConstants.web.d.ts +0 -4
- package/lib/typescript/PointerType.d.ts +0 -7
- package/lib/typescript/RNGestureHandlerModule.d.ts +0 -2
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -15
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +0 -32
- package/lib/typescript/RNRenderer.d.ts +0 -1
- package/lib/typescript/RNRenderer.web.d.ts +0 -3
- package/lib/typescript/State.d.ts +0 -9
- package/lib/typescript/TouchEventType.d.ts +0 -8
- package/lib/typescript/components/DrawerLayout.d.ts +0 -185
- package/lib/typescript/components/GestureButtons.d.ts +0 -7
- package/lib/typescript/components/GestureButtonsProps.d.ts +0 -115
- package/lib/typescript/components/GestureComponents.d.ts +0 -22
- package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
- package/lib/typescript/components/GestureHandlerButton.d.ts +0 -4
- package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +0 -6
- package/lib/typescript/components/GestureHandlerRootView.d.ts +0 -6
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +0 -6
- package/lib/typescript/components/Pressable/Pressable.d.ts +0 -5
- package/lib/typescript/components/Pressable/PressableProps.d.ts +0 -109
- package/lib/typescript/components/Pressable/index.d.ts +0 -2
- package/lib/typescript/components/Pressable/utils.d.ts +0 -13
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +0 -167
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +0 -137
- package/lib/typescript/components/Swipeable.d.ts +0 -183
- package/lib/typescript/components/Text.d.ts +0 -4
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +0 -3
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +0 -7
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -55
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +0 -16
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +0 -41
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +0 -40
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +0 -6
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +0 -8
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -30
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -14
- package/lib/typescript/components/touchables/index.d.ts +0 -7
- package/lib/typescript/findNodeHandle.d.ts +0 -2
- package/lib/typescript/findNodeHandle.web.d.ts +0 -2
- package/lib/typescript/getShadowNodeFromRef.d.ts +0 -1
- package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
- package/lib/typescript/ghQueueMicrotask.d.ts +0 -1
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +0 -39
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +0 -44
- package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +0 -194
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +0 -36
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -33
- package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -100
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +0 -17
- package/lib/typescript/handlers/PressabilityDebugView.d.ts +0 -1
- package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +0 -17
- package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -62
- package/lib/typescript/handlers/createHandler.d.ts +0 -11
- package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -3
- package/lib/typescript/handlers/customDirectEventTypes.d.ts +0 -1
- package/lib/typescript/handlers/customDirectEventTypes.web.d.ts +0 -2
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -78
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +0 -43
- package/lib/typescript/handlers/gestures/GestureDetector/Wrap.d.ts +0 -13
- package/lib/typescript/handlers/gestures/GestureDetector/Wrap.web.d.ts +0 -7
- package/lib/typescript/handlers/gestures/GestureDetector/attachHandlers.d.ts +0 -13
- package/lib/typescript/handlers/gestures/GestureDetector/dropHandlers.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/index.d.ts +0 -49
- package/lib/typescript/handlers/gestures/GestureDetector/needsToReattach.d.ts +0 -3
- package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +0 -21
- package/lib/typescript/handlers/gestures/GestureDetector/updateHandlers.d.ts +0 -4
- package/lib/typescript/handlers/gestures/GestureDetector/useAnimatedGesture.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/useDetectorUpdater.d.ts +0 -5
- package/lib/typescript/handlers/gestures/GestureDetector/useMountReactions.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/useViewRefHandler.d.ts +0 -3
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +0 -13
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +0 -4
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +0 -21
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +0 -30
- package/lib/typescript/handlers/gestures/gesture.d.ts +0 -218
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +0 -21
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +0 -98
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +0 -11
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +0 -4
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +0 -27
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +0 -25
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +0 -7
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +0 -18
- package/lib/typescript/handlers/gestures/panGesture.d.ts +0 -90
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +0 -11
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +0 -14
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +0 -12
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +0 -50
- package/lib/typescript/handlers/getNextHandlerTag.d.ts +0 -1
- package/lib/typescript/handlers/handlersRegistry.d.ts +0 -14
- package/lib/typescript/handlers/utils.d.ts +0 -7
- package/lib/typescript/index.d.ts +0 -58
- package/lib/typescript/init.d.ts +0 -2
- package/lib/typescript/jestUtils/index.d.ts +0 -1
- package/lib/typescript/jestUtils/jestUtils.d.ts +0 -30
- package/lib/typescript/mocks.d.ts +0 -46
- package/lib/typescript/mountRegistry.d.ts +0 -17
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +0 -14
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +0 -17
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +0 -6
- package/lib/typescript/typeUtils.d.ts +0 -1
- package/lib/typescript/utils.d.ts +0 -20
- package/lib/typescript/web/Gestures.d.ts +0 -36
- package/lib/typescript/web/constants.d.ts +0 -2
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +0 -30
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +0 -29
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -26
- package/lib/typescript/web/handlers/GestureHandler.d.ts +0 -103
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +0 -10
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +0 -37
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +0 -31
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -10
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -26
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -61
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -28
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -28
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -38
- package/lib/typescript/web/interfaces.d.ts +0 -157
- package/lib/typescript/web/tools/CircularBuffer.d.ts +0 -11
- package/lib/typescript/web/tools/EventManager.d.ts +0 -39
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +0 -24
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +0 -31
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +0 -35
- package/lib/typescript/web/tools/InteractionManager.d.ts +0 -17
- package/lib/typescript/web/tools/KeyboardEventManager.d.ts +0 -13
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +0 -12
- package/lib/typescript/web/tools/NodeManager.d.ts +0 -12
- package/lib/typescript/web/tools/PointerEventManager.d.ts +0 -19
- package/lib/typescript/web/tools/PointerTracker.d.ts +0 -50
- package/lib/typescript/web/tools/Vector.d.ts +0 -15
- package/lib/typescript/web/tools/VelocityTracker.d.ts +0 -13
- package/lib/typescript/web/tools/WheelEventManager.d.ts +0 -11
- package/lib/typescript/web/utils.d.ts +0 -14
- package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +0 -20
- package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +0 -15
- package/lib/typescript/web_hammer/Errors.d.ts +0 -3
- package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +0 -43
- package/lib/typescript/web_hammer/GestureHandler.d.ts +0 -145
- package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +0 -40
- package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +0 -38
- package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +0 -7
- package/lib/typescript/web_hammer/NodeManager.d.ts +0 -7
- package/lib/typescript/web_hammer/PanGestureHandler.d.ts +0 -56
- package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +0 -13
- package/lib/typescript/web_hammer/PressGestureHandler.d.ts +0 -83
- package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +0 -13
- package/lib/typescript/web_hammer/TapGestureHandler.d.ts +0 -57
- package/lib/typescript/web_hammer/constants.d.ts +0 -39
- package/lib/typescript/web_hammer/utils.d.ts +0 -9
- /package/android/{common → noreanimated}/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +0 -0
@@ -1,560 +0,0 @@
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
-
|
3
|
-
// This component is based on RN's DrawerLayoutAndroid API
|
4
|
-
//
|
5
|
-
// It perhaps deserves to be put in a separate repo, but since it relies on
|
6
|
-
// react-native-gesture-handler library which isn't very popular at the moment I
|
7
|
-
// decided to keep it here for the time being. It will allow us to move faster
|
8
|
-
// and fix issues that may arise in gesture handler library that could be found
|
9
|
-
// when using the drawer component
|
10
|
-
import * as React from 'react';
|
11
|
-
import { Component } from 'react';
|
12
|
-
import invariant from 'invariant';
|
13
|
-
import { Animated, StyleSheet, View, Keyboard, StatusBar, I18nManager } from 'react-native';
|
14
|
-
import { PanGestureHandler } from '../handlers/PanGestureHandler';
|
15
|
-
import { TapGestureHandler } from '../handlers/TapGestureHandler';
|
16
|
-
import { State } from '../State';
|
17
|
-
const DRAG_TOSS = 0.05;
|
18
|
-
const IDLE = 'Idle';
|
19
|
-
const DRAGGING = 'Dragging';
|
20
|
-
const SETTLING = 'Settling';
|
21
|
-
/**
|
22
|
-
* @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.
|
23
|
-
*/
|
24
|
-
|
25
|
-
/**
|
26
|
-
* @deprecated use Reanimated version of DrawerLayout instead
|
27
|
-
*/
|
28
|
-
export default class DrawerLayout extends Component {
|
29
|
-
constructor(_props) {
|
30
|
-
super(_props);
|
31
|
-
|
32
|
-
_defineProperty(this, "openValue", void 0);
|
33
|
-
|
34
|
-
_defineProperty(this, "onGestureEvent", void 0);
|
35
|
-
|
36
|
-
_defineProperty(this, "accessibilityIsModalView", /*#__PURE__*/React.createRef());
|
37
|
-
|
38
|
-
_defineProperty(this, "pointerEventsView", /*#__PURE__*/React.createRef());
|
39
|
-
|
40
|
-
_defineProperty(this, "panGestureHandler", /*#__PURE__*/React.createRef());
|
41
|
-
|
42
|
-
_defineProperty(this, "drawerShown", false);
|
43
|
-
|
44
|
-
_defineProperty(this, "updateAnimatedEvent", (props, state) => {
|
45
|
-
// Event definition is based on
|
46
|
-
const {
|
47
|
-
drawerPosition,
|
48
|
-
drawerWidth,
|
49
|
-
drawerType
|
50
|
-
} = props;
|
51
|
-
const {
|
52
|
-
dragX: dragXValue,
|
53
|
-
touchX: touchXValue,
|
54
|
-
drawerTranslation,
|
55
|
-
containerWidth
|
56
|
-
} = state;
|
57
|
-
let dragX = dragXValue;
|
58
|
-
let touchX = touchXValue;
|
59
|
-
|
60
|
-
if (drawerPosition !== 'left') {
|
61
|
-
// Most of the code is written in a way to handle left-side drawer. In
|
62
|
-
// order to handle right-side drawer the only thing we need to do is to
|
63
|
-
// reverse events coming from gesture handler in a way they emulate
|
64
|
-
// left-side drawer gestures. E.g. dragX is simply -dragX, and touchX is
|
65
|
-
// calulcated by subtracing real touchX from the width of the container
|
66
|
-
// (such that when touch happens at the right edge the value is simply 0)
|
67
|
-
dragX = Animated.multiply(new Animated.Value(-1), dragXValue); // TODO(TS): (for all "as" in this file) make sure we can map this
|
68
|
-
|
69
|
-
touchX = Animated.add(new Animated.Value(containerWidth), Animated.multiply(new Animated.Value(-1), touchXValue)); // TODO(TS): make sure we can map this;
|
70
|
-
|
71
|
-
touchXValue.setValue(containerWidth);
|
72
|
-
} else {
|
73
|
-
touchXValue.setValue(0);
|
74
|
-
} // While closing the drawer when user starts gesture outside of its area (in greyed
|
75
|
-
// out part of the window), we want the drawer to follow only once finger reaches the
|
76
|
-
// edge of the drawer.
|
77
|
-
// E.g. on the diagram below drawer is illustrate by X signs and the greyed out area by
|
78
|
-
// dots. The touch gesture starts at '*' and moves left, touch path is indicated by
|
79
|
-
// an arrow pointing left
|
80
|
-
// 1) +---------------+ 2) +---------------+ 3) +---------------+ 4) +---------------+
|
81
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
82
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
83
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
84
|
-
// |XXXXXXXX|......| |XXXXXXXX|.<-*..| |XXXXXXXX|<--*..| |XXXXX|<-----*..|
|
85
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
86
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
87
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
88
|
-
// +---------------+ +---------------+ +---------------+ +---------------+
|
89
|
-
//
|
90
|
-
// For the above to work properly we define animated value that will keep
|
91
|
-
// start position of the gesture. Then we use that value to calculate how
|
92
|
-
// much we need to subtract from the dragX. If the gesture started on the
|
93
|
-
// greyed out area we take the distance from the edge of the drawer to the
|
94
|
-
// start position. Otherwise we don't subtract at all and the drawer be
|
95
|
-
// pulled back as soon as you start the pan.
|
96
|
-
//
|
97
|
-
// This is used only when drawerType is "front"
|
98
|
-
//
|
99
|
-
|
100
|
-
|
101
|
-
let translationX = dragX;
|
102
|
-
|
103
|
-
if (drawerType === 'front') {
|
104
|
-
const startPositionX = Animated.add(touchX, Animated.multiply(new Animated.Value(-1), dragX));
|
105
|
-
const dragOffsetFromOnStartPosition = startPositionX.interpolate({
|
106
|
-
inputRange: [drawerWidth - 1, drawerWidth, drawerWidth + 1],
|
107
|
-
outputRange: [0, 0, 1]
|
108
|
-
});
|
109
|
-
translationX = Animated.add(dragX, dragOffsetFromOnStartPosition); // TODO: as above
|
110
|
-
}
|
111
|
-
|
112
|
-
this.openValue = Animated.add(translationX, drawerTranslation).interpolate({
|
113
|
-
inputRange: [0, drawerWidth],
|
114
|
-
outputRange: [0, 1],
|
115
|
-
extrapolate: 'clamp'
|
116
|
-
});
|
117
|
-
const gestureOptions = {
|
118
|
-
useNativeDriver: props.useNativeAnimations
|
119
|
-
};
|
120
|
-
|
121
|
-
if (this.props.onDrawerSlide) {
|
122
|
-
gestureOptions.listener = ev => {
|
123
|
-
var _this$props$onDrawerS, _this$props;
|
124
|
-
|
125
|
-
const translationX = Math.floor(Math.abs(ev.nativeEvent.translationX));
|
126
|
-
const position = translationX / this.state.containerWidth;
|
127
|
-
(_this$props$onDrawerS = (_this$props = this.props).onDrawerSlide) === null || _this$props$onDrawerS === void 0 ? void 0 : _this$props$onDrawerS.call(_this$props, position);
|
128
|
-
};
|
129
|
-
}
|
130
|
-
|
131
|
-
this.onGestureEvent = Animated.event([{
|
132
|
-
nativeEvent: {
|
133
|
-
translationX: dragXValue,
|
134
|
-
x: touchXValue
|
135
|
-
}
|
136
|
-
}], gestureOptions);
|
137
|
-
});
|
138
|
-
|
139
|
-
_defineProperty(this, "handleContainerLayout", ({
|
140
|
-
nativeEvent
|
141
|
-
}) => {
|
142
|
-
this.setState({
|
143
|
-
containerWidth: nativeEvent.layout.width
|
144
|
-
});
|
145
|
-
});
|
146
|
-
|
147
|
-
_defineProperty(this, "emitStateChanged", (newState, drawerWillShow) => {
|
148
|
-
var _this$props$onDrawerS2, _this$props2;
|
149
|
-
|
150
|
-
(_this$props$onDrawerS2 = (_this$props2 = this.props).onDrawerStateChanged) === null || _this$props$onDrawerS2 === void 0 ? void 0 : _this$props$onDrawerS2.call(_this$props2, newState, drawerWillShow);
|
151
|
-
});
|
152
|
-
|
153
|
-
_defineProperty(this, "openingHandlerStateChange", ({
|
154
|
-
nativeEvent
|
155
|
-
}) => {
|
156
|
-
if (nativeEvent.oldState === State.ACTIVE) {
|
157
|
-
this.handleRelease({
|
158
|
-
nativeEvent
|
159
|
-
});
|
160
|
-
} else if (nativeEvent.state === State.ACTIVE) {
|
161
|
-
this.emitStateChanged(DRAGGING, false);
|
162
|
-
this.setState({
|
163
|
-
drawerState: DRAGGING
|
164
|
-
});
|
165
|
-
|
166
|
-
if (this.props.keyboardDismissMode === 'on-drag') {
|
167
|
-
Keyboard.dismiss();
|
168
|
-
}
|
169
|
-
|
170
|
-
if (this.props.hideStatusBar) {
|
171
|
-
StatusBar.setHidden(true, this.props.statusBarAnimation || 'slide');
|
172
|
-
}
|
173
|
-
}
|
174
|
-
});
|
175
|
-
|
176
|
-
_defineProperty(this, "onTapHandlerStateChange", ({
|
177
|
-
nativeEvent
|
178
|
-
}) => {
|
179
|
-
if (this.drawerShown && nativeEvent.oldState === State.ACTIVE && this.props.drawerLockMode !== 'locked-open') {
|
180
|
-
this.closeDrawer();
|
181
|
-
}
|
182
|
-
});
|
183
|
-
|
184
|
-
_defineProperty(this, "handleRelease", ({
|
185
|
-
nativeEvent
|
186
|
-
}) => {
|
187
|
-
const {
|
188
|
-
drawerWidth,
|
189
|
-
drawerPosition,
|
190
|
-
drawerType
|
191
|
-
} = this.props;
|
192
|
-
const {
|
193
|
-
containerWidth
|
194
|
-
} = this.state;
|
195
|
-
let {
|
196
|
-
translationX: dragX,
|
197
|
-
velocityX,
|
198
|
-
x: touchX
|
199
|
-
} = nativeEvent;
|
200
|
-
|
201
|
-
if (drawerPosition !== 'left') {
|
202
|
-
// See description in _updateAnimatedEvent about why events are flipped
|
203
|
-
// for right-side drawer
|
204
|
-
dragX = -dragX;
|
205
|
-
touchX = containerWidth - touchX;
|
206
|
-
velocityX = -velocityX;
|
207
|
-
}
|
208
|
-
|
209
|
-
const gestureStartX = touchX - dragX;
|
210
|
-
let dragOffsetBasedOnStart = 0;
|
211
|
-
|
212
|
-
if (drawerType === 'front') {
|
213
|
-
dragOffsetBasedOnStart = gestureStartX > drawerWidth ? gestureStartX - drawerWidth : 0;
|
214
|
-
}
|
215
|
-
|
216
|
-
const startOffsetX = dragX + dragOffsetBasedOnStart + (this.drawerShown ? drawerWidth : 0);
|
217
|
-
const projOffsetX = startOffsetX + DRAG_TOSS * velocityX;
|
218
|
-
const shouldOpen = projOffsetX > drawerWidth / 2;
|
219
|
-
|
220
|
-
if (shouldOpen) {
|
221
|
-
this.animateDrawer(startOffsetX, drawerWidth, velocityX);
|
222
|
-
} else {
|
223
|
-
this.animateDrawer(startOffsetX, 0, velocityX);
|
224
|
-
}
|
225
|
-
});
|
226
|
-
|
227
|
-
_defineProperty(this, "updateShowing", showing => {
|
228
|
-
var _this$accessibilityIs, _this$pointerEventsVi, _this$panGestureHandl;
|
229
|
-
|
230
|
-
this.drawerShown = showing;
|
231
|
-
(_this$accessibilityIs = this.accessibilityIsModalView.current) === null || _this$accessibilityIs === void 0 ? void 0 : _this$accessibilityIs.setNativeProps({
|
232
|
-
accessibilityViewIsModal: showing
|
233
|
-
});
|
234
|
-
(_this$pointerEventsVi = this.pointerEventsView.current) === null || _this$pointerEventsVi === void 0 ? void 0 : _this$pointerEventsVi.setNativeProps({
|
235
|
-
pointerEvents: showing ? 'auto' : 'none'
|
236
|
-
});
|
237
|
-
const {
|
238
|
-
drawerPosition,
|
239
|
-
minSwipeDistance,
|
240
|
-
edgeWidth
|
241
|
-
} = this.props;
|
242
|
-
const fromLeft = drawerPosition === 'left'; // gestureOrientation is 1 if the expected gesture is from left to right and
|
243
|
-
// -1 otherwise e.g. when drawer is on the left and is closed we expect left
|
244
|
-
// to right gesture, thus orientation will be 1.
|
245
|
-
|
246
|
-
const gestureOrientation = (fromLeft ? 1 : -1) * (this.drawerShown ? -1 : 1); // When drawer is closed we want the hitSlop to be horizontally shorter than
|
247
|
-
// the container size by the value of SLOP. This will make it only activate
|
248
|
-
// when gesture happens not further than SLOP away from the edge
|
249
|
-
|
250
|
-
const hitSlop = fromLeft ? {
|
251
|
-
left: 0,
|
252
|
-
width: showing ? undefined : edgeWidth
|
253
|
-
} : {
|
254
|
-
right: 0,
|
255
|
-
width: showing ? undefined : edgeWidth
|
256
|
-
}; // @ts-ignore internal API, maybe could be fixed in handler types
|
257
|
-
|
258
|
-
(_this$panGestureHandl = this.panGestureHandler.current) === null || _this$panGestureHandl === void 0 ? void 0 : _this$panGestureHandl.setNativeProps({
|
259
|
-
hitSlop,
|
260
|
-
activeOffsetX: gestureOrientation * minSwipeDistance
|
261
|
-
});
|
262
|
-
});
|
263
|
-
|
264
|
-
_defineProperty(this, "animateDrawer", (fromValue, toValue, velocity, speed) => {
|
265
|
-
this.state.dragX.setValue(0);
|
266
|
-
this.state.touchX.setValue(this.props.drawerPosition === 'left' ? 0 : this.state.containerWidth);
|
267
|
-
|
268
|
-
if (fromValue != null) {
|
269
|
-
let nextFramePosition = fromValue;
|
270
|
-
|
271
|
-
if (this.props.useNativeAnimations) {
|
272
|
-
// When using native driver, we predict the next position of the
|
273
|
-
// animation because it takes one frame of a roundtrip to pass RELEASE
|
274
|
-
// event from native driver to JS before we can start animating. Without
|
275
|
-
// it, it is more noticable that the frame is dropped.
|
276
|
-
if (fromValue < toValue && velocity > 0) {
|
277
|
-
nextFramePosition = Math.min(fromValue + velocity / 60.0, toValue);
|
278
|
-
} else if (fromValue > toValue && velocity < 0) {
|
279
|
-
nextFramePosition = Math.max(fromValue + velocity / 60.0, toValue);
|
280
|
-
}
|
281
|
-
}
|
282
|
-
|
283
|
-
this.state.drawerTranslation.setValue(nextFramePosition);
|
284
|
-
}
|
285
|
-
|
286
|
-
const willShow = toValue !== 0;
|
287
|
-
this.updateShowing(willShow);
|
288
|
-
this.emitStateChanged(SETTLING, willShow);
|
289
|
-
this.setState({
|
290
|
-
drawerState: SETTLING
|
291
|
-
});
|
292
|
-
|
293
|
-
if (this.props.hideStatusBar) {
|
294
|
-
StatusBar.setHidden(willShow, this.props.statusBarAnimation || 'slide');
|
295
|
-
}
|
296
|
-
|
297
|
-
Animated.spring(this.state.drawerTranslation, {
|
298
|
-
velocity,
|
299
|
-
bounciness: 0,
|
300
|
-
toValue,
|
301
|
-
useNativeDriver: this.props.useNativeAnimations,
|
302
|
-
speed: speed !== null && speed !== void 0 ? speed : undefined
|
303
|
-
}).start(({
|
304
|
-
finished
|
305
|
-
}) => {
|
306
|
-
if (finished) {
|
307
|
-
this.emitStateChanged(IDLE, willShow);
|
308
|
-
this.setState({
|
309
|
-
drawerOpened: willShow
|
310
|
-
});
|
311
|
-
|
312
|
-
if (this.state.drawerState !== DRAGGING) {
|
313
|
-
// It's possilbe that user started drag while the drawer
|
314
|
-
// was settling, don't override state in this case
|
315
|
-
this.setState({
|
316
|
-
drawerState: IDLE
|
317
|
-
});
|
318
|
-
}
|
319
|
-
|
320
|
-
if (willShow) {
|
321
|
-
var _this$props$onDrawerO, _this$props3;
|
322
|
-
|
323
|
-
(_this$props$onDrawerO = (_this$props3 = this.props).onDrawerOpen) === null || _this$props$onDrawerO === void 0 ? void 0 : _this$props$onDrawerO.call(_this$props3);
|
324
|
-
} else {
|
325
|
-
var _this$props$onDrawerC, _this$props4;
|
326
|
-
|
327
|
-
(_this$props$onDrawerC = (_this$props4 = this.props).onDrawerClose) === null || _this$props$onDrawerC === void 0 ? void 0 : _this$props$onDrawerC.call(_this$props4);
|
328
|
-
}
|
329
|
-
}
|
330
|
-
});
|
331
|
-
});
|
332
|
-
|
333
|
-
_defineProperty(this, "openDrawer", (options = {}) => {
|
334
|
-
this.animateDrawer( // TODO: decide if it should be null or undefined is the proper value
|
335
|
-
undefined, this.props.drawerWidth, options.velocity ? options.velocity : 0, options.speed); // We need to force the update, otherwise the overlay is not rerendered and
|
336
|
-
// it would not be clickable
|
337
|
-
|
338
|
-
this.forceUpdate();
|
339
|
-
});
|
340
|
-
|
341
|
-
_defineProperty(this, "closeDrawer", (options = {}) => {
|
342
|
-
// TODO: decide if it should be null or undefined is the proper value
|
343
|
-
this.animateDrawer(undefined, 0, options.velocity ? options.velocity : 0, options.speed); // We need to force the update, otherwise the overlay is not rerendered and
|
344
|
-
// it would be still clickable
|
345
|
-
|
346
|
-
this.forceUpdate();
|
347
|
-
});
|
348
|
-
|
349
|
-
_defineProperty(this, "renderOverlay", () => {
|
350
|
-
/* Overlay styles */
|
351
|
-
invariant(this.openValue, 'should be set');
|
352
|
-
let overlayOpacity;
|
353
|
-
|
354
|
-
if (this.state.drawerState !== IDLE) {
|
355
|
-
overlayOpacity = this.openValue;
|
356
|
-
} else {
|
357
|
-
overlayOpacity = this.state.drawerOpened ? 1 : 0;
|
358
|
-
}
|
359
|
-
|
360
|
-
const dynamicOverlayStyles = {
|
361
|
-
opacity: overlayOpacity,
|
362
|
-
backgroundColor: this.props.overlayColor
|
363
|
-
};
|
364
|
-
return /*#__PURE__*/React.createElement(TapGestureHandler, {
|
365
|
-
onHandlerStateChange: this.onTapHandlerStateChange
|
366
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
367
|
-
pointerEvents: this.drawerShown ? 'auto' : 'none',
|
368
|
-
ref: this.pointerEventsView,
|
369
|
-
style: [styles.overlay, dynamicOverlayStyles]
|
370
|
-
}));
|
371
|
-
});
|
372
|
-
|
373
|
-
_defineProperty(this, "renderDrawer", () => {
|
374
|
-
const {
|
375
|
-
drawerBackgroundColor,
|
376
|
-
drawerWidth,
|
377
|
-
drawerPosition,
|
378
|
-
drawerType,
|
379
|
-
drawerContainerStyle,
|
380
|
-
contentContainerStyle
|
381
|
-
} = this.props;
|
382
|
-
const fromLeft = drawerPosition === 'left';
|
383
|
-
const drawerSlide = drawerType !== 'back';
|
384
|
-
const containerSlide = drawerType !== 'front'; // We rely on row and row-reverse flex directions to position the drawer
|
385
|
-
// properly. Apparently for RTL these are flipped which requires us to use
|
386
|
-
// the opposite setting for the drawer to appear from left or right
|
387
|
-
// according to the drawerPosition prop
|
388
|
-
|
389
|
-
const reverseContentDirection = I18nManager.isRTL ? fromLeft : !fromLeft;
|
390
|
-
const dynamicDrawerStyles = {
|
391
|
-
backgroundColor: drawerBackgroundColor,
|
392
|
-
width: drawerWidth
|
393
|
-
};
|
394
|
-
const openValue = this.openValue;
|
395
|
-
invariant(openValue, 'should be set');
|
396
|
-
let containerStyles;
|
397
|
-
|
398
|
-
if (containerSlide) {
|
399
|
-
const containerTranslateX = openValue.interpolate({
|
400
|
-
inputRange: [0, 1],
|
401
|
-
outputRange: fromLeft ? [0, drawerWidth] : [0, -drawerWidth],
|
402
|
-
extrapolate: 'clamp'
|
403
|
-
});
|
404
|
-
containerStyles = {
|
405
|
-
transform: [{
|
406
|
-
translateX: containerTranslateX
|
407
|
-
}]
|
408
|
-
};
|
409
|
-
}
|
410
|
-
|
411
|
-
let drawerTranslateX = 0;
|
412
|
-
|
413
|
-
if (drawerSlide) {
|
414
|
-
const closedDrawerOffset = fromLeft ? -drawerWidth : drawerWidth;
|
415
|
-
|
416
|
-
if (this.state.drawerState !== IDLE) {
|
417
|
-
drawerTranslateX = openValue.interpolate({
|
418
|
-
inputRange: [0, 1],
|
419
|
-
outputRange: [closedDrawerOffset, 0],
|
420
|
-
extrapolate: 'clamp'
|
421
|
-
});
|
422
|
-
} else {
|
423
|
-
drawerTranslateX = this.state.drawerOpened ? 0 : closedDrawerOffset;
|
424
|
-
}
|
425
|
-
}
|
426
|
-
|
427
|
-
const drawerStyles = {
|
428
|
-
transform: [{
|
429
|
-
translateX: drawerTranslateX
|
430
|
-
}],
|
431
|
-
flexDirection: reverseContentDirection ? 'row-reverse' : 'row'
|
432
|
-
};
|
433
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
434
|
-
style: styles.main,
|
435
|
-
onLayout: this.handleContainerLayout
|
436
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
437
|
-
style: [drawerType === 'front' ? styles.containerOnBack : styles.containerInFront, containerStyles, contentContainerStyle],
|
438
|
-
importantForAccessibility: this.drawerShown ? 'no-hide-descendants' : 'yes'
|
439
|
-
}, typeof this.props.children === 'function' ? this.props.children(this.openValue) : this.props.children, this.renderOverlay()), /*#__PURE__*/React.createElement(Animated.View, {
|
440
|
-
pointerEvents: "box-none",
|
441
|
-
ref: this.accessibilityIsModalView,
|
442
|
-
accessibilityViewIsModal: this.drawerShown,
|
443
|
-
style: [styles.drawerContainer, drawerStyles, drawerContainerStyle]
|
444
|
-
}, /*#__PURE__*/React.createElement(View, {
|
445
|
-
style: dynamicDrawerStyles
|
446
|
-
}, this.props.renderNavigationView(this.openValue))));
|
447
|
-
});
|
448
|
-
|
449
|
-
_defineProperty(this, "setPanGestureRef", ref => {
|
450
|
-
var _this$props$onGesture, _this$props5;
|
451
|
-
|
452
|
-
// TODO(TS): make sure it is OK taken from
|
453
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31065#issuecomment-596081842
|
454
|
-
this.panGestureHandler.current = ref;
|
455
|
-
(_this$props$onGesture = (_this$props5 = this.props).onGestureRef) === null || _this$props$onGesture === void 0 ? void 0 : _this$props$onGesture.call(_this$props5, ref);
|
456
|
-
});
|
457
|
-
|
458
|
-
const _dragX = new Animated.Value(0);
|
459
|
-
|
460
|
-
const _touchX = new Animated.Value(0);
|
461
|
-
|
462
|
-
const _drawerTranslation = new Animated.Value(0);
|
463
|
-
|
464
|
-
this.state = {
|
465
|
-
dragX: _dragX,
|
466
|
-
touchX: _touchX,
|
467
|
-
drawerTranslation: _drawerTranslation,
|
468
|
-
containerWidth: 0,
|
469
|
-
drawerState: IDLE,
|
470
|
-
drawerOpened: false
|
471
|
-
};
|
472
|
-
this.updateAnimatedEvent(_props, this.state);
|
473
|
-
}
|
474
|
-
|
475
|
-
shouldComponentUpdate(props, state) {
|
476
|
-
if (this.props.drawerPosition !== props.drawerPosition || this.props.drawerWidth !== props.drawerWidth || this.props.drawerType !== props.drawerType || this.state.containerWidth !== state.containerWidth) {
|
477
|
-
this.updateAnimatedEvent(props, state);
|
478
|
-
}
|
479
|
-
|
480
|
-
return true;
|
481
|
-
}
|
482
|
-
|
483
|
-
render() {
|
484
|
-
const {
|
485
|
-
drawerPosition,
|
486
|
-
drawerLockMode,
|
487
|
-
edgeWidth,
|
488
|
-
minSwipeDistance
|
489
|
-
} = this.props;
|
490
|
-
const fromLeft = drawerPosition === 'left'; // gestureOrientation is 1 if the expected gesture is from left to right and
|
491
|
-
// -1 otherwise e.g. when drawer is on the left and is closed we expect left
|
492
|
-
// to right gesture, thus orientation will be 1.
|
493
|
-
|
494
|
-
const gestureOrientation = (fromLeft ? 1 : -1) * (this.drawerShown ? -1 : 1); // When drawer is closed we want the hitSlop to be horizontally shorter than
|
495
|
-
// the container size by the value of SLOP. This will make it only activate
|
496
|
-
// when gesture happens not further than SLOP away from the edge
|
497
|
-
|
498
|
-
const hitSlop = fromLeft ? {
|
499
|
-
left: 0,
|
500
|
-
width: this.drawerShown ? undefined : edgeWidth
|
501
|
-
} : {
|
502
|
-
right: 0,
|
503
|
-
width: this.drawerShown ? undefined : edgeWidth
|
504
|
-
};
|
505
|
-
return /*#__PURE__*/React.createElement(PanGestureHandler // @ts-ignore could be fixed in handler types
|
506
|
-
, {
|
507
|
-
userSelect: this.props.userSelect,
|
508
|
-
activeCursor: this.props.activeCursor,
|
509
|
-
mouseButton: this.props.mouseButton,
|
510
|
-
enableContextMenu: this.props.enableContextMenu,
|
511
|
-
ref: this.setPanGestureRef,
|
512
|
-
hitSlop: hitSlop,
|
513
|
-
activeOffsetX: gestureOrientation * minSwipeDistance,
|
514
|
-
failOffsetY: [-15, 15],
|
515
|
-
onGestureEvent: this.onGestureEvent,
|
516
|
-
onHandlerStateChange: this.openingHandlerStateChange,
|
517
|
-
enableTrackpadTwoFingerGesture: this.props.enableTrackpadTwoFingerGesture,
|
518
|
-
enabled: drawerLockMode !== 'locked-closed' && drawerLockMode !== 'locked-open'
|
519
|
-
}, this.renderDrawer());
|
520
|
-
}
|
521
|
-
|
522
|
-
}
|
523
|
-
|
524
|
-
_defineProperty(DrawerLayout, "defaultProps", {
|
525
|
-
drawerWidth: 200,
|
526
|
-
drawerPosition: 'left',
|
527
|
-
useNativeAnimations: true,
|
528
|
-
drawerType: 'front',
|
529
|
-
edgeWidth: 20,
|
530
|
-
minSwipeDistance: 3,
|
531
|
-
overlayColor: 'rgba(0, 0, 0, 0.7)',
|
532
|
-
drawerLockMode: 'unlocked',
|
533
|
-
enableTrackpadTwoFingerGesture: false
|
534
|
-
});
|
535
|
-
|
536
|
-
_defineProperty(DrawerLayout, "positions", {
|
537
|
-
Left: 'left',
|
538
|
-
Right: 'right'
|
539
|
-
});
|
540
|
-
|
541
|
-
const styles = StyleSheet.create({
|
542
|
-
drawerContainer: { ...StyleSheet.absoluteFillObject,
|
543
|
-
zIndex: 1001,
|
544
|
-
flexDirection: 'row'
|
545
|
-
},
|
546
|
-
containerInFront: { ...StyleSheet.absoluteFillObject,
|
547
|
-
zIndex: 1002
|
548
|
-
},
|
549
|
-
containerOnBack: { ...StyleSheet.absoluteFillObject
|
550
|
-
},
|
551
|
-
main: {
|
552
|
-
flex: 1,
|
553
|
-
zIndex: 0,
|
554
|
-
overflow: 'hidden'
|
555
|
-
},
|
556
|
-
overlay: { ...StyleSheet.absoluteFillObject,
|
557
|
-
zIndex: 1000
|
558
|
-
}
|
559
|
-
});
|
560
|
-
//# sourceMappingURL=DrawerLayout.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["DrawerLayout.tsx"],"names":["React","Component","invariant","Animated","StyleSheet","View","Keyboard","StatusBar","I18nManager","PanGestureHandler","TapGestureHandler","State","DRAG_TOSS","IDLE","DRAGGING","SETTLING","DrawerLayout","constructor","props","createRef","state","drawerPosition","drawerWidth","drawerType","dragX","dragXValue","touchX","touchXValue","drawerTranslation","containerWidth","multiply","Value","add","setValue","translationX","startPositionX","dragOffsetFromOnStartPosition","interpolate","inputRange","outputRange","openValue","extrapolate","gestureOptions","useNativeDriver","useNativeAnimations","onDrawerSlide","listener","ev","Math","floor","abs","nativeEvent","position","onGestureEvent","event","x","setState","layout","width","newState","drawerWillShow","onDrawerStateChanged","oldState","ACTIVE","handleRelease","emitStateChanged","drawerState","keyboardDismissMode","dismiss","hideStatusBar","setHidden","statusBarAnimation","drawerShown","drawerLockMode","closeDrawer","velocityX","gestureStartX","dragOffsetBasedOnStart","startOffsetX","projOffsetX","shouldOpen","animateDrawer","showing","accessibilityIsModalView","current","setNativeProps","accessibilityViewIsModal","pointerEventsView","pointerEvents","minSwipeDistance","edgeWidth","fromLeft","gestureOrientation","hitSlop","left","undefined","right","panGestureHandler","activeOffsetX","fromValue","toValue","velocity","speed","nextFramePosition","min","max","willShow","updateShowing","spring","bounciness","start","finished","drawerOpened","onDrawerOpen","onDrawerClose","options","forceUpdate","overlayOpacity","dynamicOverlayStyles","opacity","backgroundColor","overlayColor","onTapHandlerStateChange","styles","overlay","drawerBackgroundColor","drawerContainerStyle","contentContainerStyle","drawerSlide","containerSlide","reverseContentDirection","isRTL","dynamicDrawerStyles","containerStyles","containerTranslateX","transform","translateX","drawerTranslateX","closedDrawerOffset","drawerStyles","flexDirection","main","handleContainerLayout","containerOnBack","containerInFront","children","renderOverlay","drawerContainer","renderNavigationView","ref","onGestureRef","updateAnimatedEvent","shouldComponentUpdate","render","userSelect","activeCursor","mouseButton","enableContextMenu","setPanGestureRef","openingHandlerStateChange","enableTrackpadTwoFingerGesture","renderDrawer","Left","Right","create","absoluteFillObject","zIndex","flex","overflow"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,OAAOC,SAAP,MAAsB,WAAtB;AACA,SACEC,QADF,EAEEC,UAFF,EAGEC,IAHF,EAIEC,QAJF,EAKEC,SALF,EAMEC,WANF,QAYO,cAZP;AAqBA,SAASC,iBAAT,QAAkC,+BAAlC;AAKA,SAASC,iBAAT,QAAkC,+BAAlC;AACA,SAASC,KAAT,QAAsB,UAAtB;AAEA,MAAMC,SAAS,GAAG,IAAlB;AAEA,MAAMC,IAAiB,GAAG,MAA1B;AACA,MAAMC,QAAqB,GAAG,UAA9B;AACA,MAAMC,QAAqB,GAAG,UAA9B;AAEA;AACA;AACA;;AAmLA;AACA;AACA;AACA,eAAe,MAAMC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;;gBAHmBjJ,Y,kBAIG;AACpBM,EAAAA,WAAW,EAAE,GADO;AAEpBD,EAAAA,cAAc,EAAE,MAFI;AAGpBuB,EAAAA,mBAAmB,EAAE,IAHD;AAIpBrB,EAAAA,UAAU,EAAE,OAJQ;AAKpBmE,EAAAA,SAAS,EAAE,EALS;AAMpBD,EAAAA,gBAAgB,EAAE,CANE;AAOpBgC,EAAAA,YAAY,EAAE,oBAPM;AAQpBhD,EAAAA,cAAc,EAAE,UARI;AASpBuF,EAAAA,8BAA8B,EAAE;AATZ,C;;gBAJHhJ,Y,eAyDA;AACjBkJ,EAAAA,IAAI,EAAE,MADW;AAEjBC,EAAAA,KAAK,EAAE;AAFU,C;;AA2drB,MAAMxC,MAAM,GAAGvH,UAAU,CAACgK,MAAX,CAAkB;AAC/BjB,EAAAA,eAAe,EAAE,EACf,GAAG/I,UAAU,CAACiK,kBADC;AAEfC,IAAAA,MAAM,EAAE,IAFO;AAGf1B,IAAAA,aAAa,EAAE;AAHA,GADc;AAM/BI,EAAAA,gBAAgB,EAAE,EAChB,GAAG5I,UAAU,CAACiK,kBADE;AAEhBC,IAAAA,MAAM,EAAE;AAFQ,GANa;AAU/BvB,EAAAA,eAAe,EAAE,EACf,GAAG3I,UAAU,CAACiK;AADC,GAVc;AAa/BxB,EAAAA,IAAI,EAAE;AACJ0B,IAAAA,IAAI,EAAE,CADF;AAEJD,IAAAA,MAAM,EAAE,CAFJ;AAGJE,IAAAA,QAAQ,EAAE;AAHN,GAbyB;AAkB/B5C,EAAAA,OAAO,EAAE,EACP,GAAGxH,UAAU,CAACiK,kBADP;AAEPC,IAAAA,MAAM,EAAE;AAFD;AAlBsB,CAAlB,CAAf","sourcesContent":["// This component is based on RN's DrawerLayoutAndroid API\n//\n// It perhaps deserves to be put in a separate repo, but since it relies on\n// react-native-gesture-handler library which isn't very popular at the moment I\n// decided to keep it here for the time being. It will allow us to move faster\n// and fix issues that may arise in gesture handler library that could be found\n// when using the drawer component\n\nimport * as React from 'react';\nimport { Component } from 'react';\nimport invariant from 'invariant';\nimport {\n Animated,\n StyleSheet,\n View,\n Keyboard,\n StatusBar,\n I18nManager,\n StatusBarAnimation,\n StyleProp,\n ViewStyle,\n LayoutChangeEvent,\n NativeSyntheticEvent,\n} from 'react-native';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n UserSelect,\n ActiveCursor,\n MouseButton,\n} from '../handlers/gestureHandlerCommon';\nimport { PanGestureHandler } from '../handlers/PanGestureHandler';\nimport type {\n PanGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n} from '../handlers/GestureHandlerEventPayload';\nimport { TapGestureHandler } from '../handlers/TapGestureHandler';\nimport { State } from '../State';\n\nconst DRAG_TOSS = 0.05;\n\nconst IDLE: DrawerState = 'Idle';\nconst DRAGGING: DrawerState = 'Dragging';\nconst SETTLING: DrawerState = 'Settling';\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerPosition = 'left' | 'right';\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerState = 'Idle' | 'Dragging' | 'Settling';\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerType = 'front' | 'back' | 'slide';\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerLockMode = 'unlocked' | 'locked-closed' | 'locked-open';\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerKeyboardDismissMode = 'none' | 'on-drag';\n\n// Animated.AnimatedInterpolation has been converted to a generic type\n// in @types/react-native 0.70. This way we can maintain compatibility\n// with all versions of @types/react-native`\ntype AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport interface DrawerLayoutProps {\n /**\n * This attribute is present in the standard implementation already and is one\n * of the required params. Gesture handler version of DrawerLayout make it\n * possible for the function passed as `renderNavigationView` to take an\n * Animated value as a parameter that indicates the progress of drawer\n * opening/closing animation (progress value is 0 when closed and 1 when\n * opened). This can be used by the drawer component to animated its children\n * while the drawer is opening or closing.\n */\n renderNavigationView: (\n progressAnimatedValue: Animated.Value\n ) => React.ReactNode;\n\n drawerPosition?: DrawerPosition;\n\n drawerWidth?: number;\n\n drawerBackgroundColor?: string;\n\n drawerLockMode?: DrawerLockMode;\n\n keyboardDismissMode?: DrawerKeyboardDismissMode;\n\n /**\n * Called when the drawer is closed.\n */\n onDrawerClose?: () => void;\n\n /**\n * Called when the drawer is opened.\n */\n onDrawerOpen?: () => void;\n\n /**\n * Called when the status of the drawer changes.\n */\n onDrawerStateChanged?: (\n newState: DrawerState,\n drawerWillShow: boolean\n ) => void;\n useNativeAnimations?: boolean;\n\n drawerType?: DrawerType;\n\n /**\n * Defines how far from the edge of the content view the gesture should\n * activate.\n */\n edgeWidth?: number;\n\n minSwipeDistance?: number;\n\n /**\n * When set to true Drawer component will use\n * {@link https://reactnative.dev/docs/statusbar StatusBar} API to hide the OS\n * status bar whenever the drawer is pulled or when its in an \"open\" state.\n */\n hideStatusBar?: boolean;\n\n /**\n * @default 'slide'\n *\n * Can be used when hideStatusBar is set to true and will select the animation\n * used for hiding/showing the status bar. See\n * {@link https://reactnative.dev/docs/statusbar StatusBar} documentation for\n * more details\n */\n statusBarAnimation?: StatusBarAnimation;\n\n /**\n * @default black\n *\n * Color of a semi-transparent overlay to be displayed on top of the content\n * view when drawer gets open. A solid color should be used as the opacity is\n * added by the Drawer itself and the opacity of the overlay is animated (from\n * 0% to 70%).\n */\n overlayColor?: string;\n\n contentContainerStyle?: StyleProp<ViewStyle>;\n\n drawerContainerStyle?: StyleProp<ViewStyle>;\n\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 onDrawerSlide?: (position: number) => void;\n\n onGestureRef?: (ref: PanGestureHandler) => void;\n\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?:\n | React.ReactNode\n | ((openValue?: AnimatedInterpolation) => React.ReactNode);\n\n /**\n * @default 'none'\n * Defines which userSelect property should be used.\n * Values: 'none'|'text'|'auto'\n */\n userSelect?: UserSelect;\n\n /**\n * @default 'auto'\n * Defines which cursor property should be used when gesture activates.\n * Values: see CSS cursor values\n */\n activeCursor?: ActiveCursor;\n\n /**\n * @default 'MouseButton.LEFT'\n * Allows to choose which mouse button should underlying pan handler react to.\n */\n mouseButton?: MouseButton;\n\n /**\n * @default 'false if MouseButton.RIGHT is specified'\n * Allows to enable/disable context menu.\n */\n enableContextMenu?: boolean;\n}\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerLayoutState = {\n dragX: Animated.Value;\n touchX: Animated.Value;\n drawerTranslation: Animated.Value;\n containerWidth: number;\n drawerState: DrawerState;\n drawerOpened: boolean;\n};\n\n/**\n * @deprecated DrawerLayout is deprecated. Use Reanimated version of DrawerLayout instead.\n */\nexport type DrawerMovementOption = {\n velocity?: number;\n speed?: number;\n};\n\n/**\n * @deprecated use Reanimated version of DrawerLayout instead\n */\nexport default class DrawerLayout extends Component<\n DrawerLayoutProps,\n DrawerLayoutState\n> {\n static defaultProps = {\n drawerWidth: 200,\n drawerPosition: 'left',\n useNativeAnimations: true,\n drawerType: 'front',\n edgeWidth: 20,\n minSwipeDistance: 3,\n overlayColor: 'rgba(0, 0, 0, 0.7)',\n drawerLockMode: 'unlocked',\n enableTrackpadTwoFingerGesture: false,\n };\n\n constructor(props: DrawerLayoutProps) {\n super(props);\n\n const dragX = new Animated.Value(0);\n const touchX = new Animated.Value(0);\n const drawerTranslation = new Animated.Value(0);\n\n this.state = {\n dragX,\n touchX,\n drawerTranslation,\n containerWidth: 0,\n drawerState: IDLE,\n drawerOpened: false,\n };\n\n this.updateAnimatedEvent(props, this.state);\n }\n\n shouldComponentUpdate(props: DrawerLayoutProps, state: DrawerLayoutState) {\n if (\n this.props.drawerPosition !== props.drawerPosition ||\n this.props.drawerWidth !== props.drawerWidth ||\n this.props.drawerType !== props.drawerType ||\n this.state.containerWidth !== state.containerWidth\n ) {\n this.updateAnimatedEvent(props, state);\n }\n\n return true;\n }\n\n private openValue?: AnimatedInterpolation;\n private onGestureEvent?: (\n event: GestureEvent<PanGestureHandlerEventPayload>\n ) => void;\n private accessibilityIsModalView = React.createRef<View>();\n private pointerEventsView = React.createRef<View>();\n private panGestureHandler = React.createRef<PanGestureHandler | null>();\n private drawerShown = false;\n\n static positions = {\n Left: 'left',\n Right: 'right',\n };\n\n private updateAnimatedEvent = (\n props: DrawerLayoutProps,\n state: DrawerLayoutState\n ) => {\n // Event definition is based on\n const { drawerPosition, drawerWidth, drawerType } = props;\n const {\n dragX: dragXValue,\n touchX: touchXValue,\n drawerTranslation,\n containerWidth,\n } = state;\n\n let dragX = dragXValue;\n let touchX = touchXValue;\n\n if (drawerPosition !== 'left') {\n // Most of the code is written in a way to handle left-side drawer. In\n // order to handle right-side drawer the only thing we need to do is to\n // reverse events coming from gesture handler in a way they emulate\n // left-side drawer gestures. E.g. dragX is simply -dragX, and touchX is\n // calulcated by subtracing real touchX from the width of the container\n // (such that when touch happens at the right edge the value is simply 0)\n dragX = Animated.multiply(\n new Animated.Value(-1),\n dragXValue\n ) as Animated.Value; // TODO(TS): (for all \"as\" in this file) make sure we can map this\n touchX = Animated.add(\n new Animated.Value(containerWidth),\n Animated.multiply(new Animated.Value(-1), touchXValue)\n ) as Animated.Value; // TODO(TS): make sure we can map this;\n touchXValue.setValue(containerWidth);\n } else {\n touchXValue.setValue(0);\n }\n\n // While closing the drawer when user starts gesture outside of its area (in greyed\n // out part of the window), we want the drawer to follow only once finger reaches the\n // edge of the drawer.\n // E.g. on the diagram below drawer is illustrate by X signs and the greyed out area by\n // dots. The touch gesture starts at '*' and moves left, touch path is indicated by\n // an arrow pointing left\n // 1) +---------------+ 2) +---------------+ 3) +---------------+ 4) +---------------+\n // |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|\n // |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|\n // |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|\n // |XXXXXXXX|......| |XXXXXXXX|.<-*..| |XXXXXXXX|<--*..| |XXXXX|<-----*..|\n // |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|\n // |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|\n // |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|\n // +---------------+ +---------------+ +---------------+ +---------------+\n //\n // For the above to work properly we define animated value that will keep\n // start position of the gesture. Then we use that value to calculate how\n // much we need to subtract from the dragX. If the gesture started on the\n // greyed out area we take the distance from the edge of the drawer to the\n // start position. Otherwise we don't subtract at all and the drawer be\n // pulled back as soon as you start the pan.\n //\n // This is used only when drawerType is \"front\"\n //\n let translationX = dragX;\n if (drawerType === 'front') {\n const startPositionX = Animated.add(\n touchX,\n Animated.multiply(new Animated.Value(-1), dragX)\n );\n\n const dragOffsetFromOnStartPosition = startPositionX.interpolate({\n inputRange: [drawerWidth! - 1, drawerWidth!, drawerWidth! + 1],\n outputRange: [0, 0, 1],\n });\n translationX = Animated.add(\n dragX,\n dragOffsetFromOnStartPosition\n ) as Animated.Value; // TODO: as above\n }\n\n this.openValue = Animated.add(translationX, drawerTranslation).interpolate({\n inputRange: [0, drawerWidth!],\n outputRange: [0, 1],\n extrapolate: 'clamp',\n });\n\n const gestureOptions: {\n useNativeDriver: boolean;\n // TODO: make sure it is correct\n listener?: (\n ev: NativeSyntheticEvent<PanGestureHandlerEventPayload>\n ) => void;\n } = {\n useNativeDriver: props.useNativeAnimations!,\n };\n\n if (this.props.onDrawerSlide) {\n gestureOptions.listener = (ev) => {\n const translationX = Math.floor(Math.abs(ev.nativeEvent.translationX));\n const position = translationX / this.state.containerWidth;\n\n this.props.onDrawerSlide?.(position);\n };\n }\n\n this.onGestureEvent = Animated.event(\n [{ nativeEvent: { translationX: dragXValue, x: touchXValue } }],\n gestureOptions\n );\n };\n\n private handleContainerLayout = ({ nativeEvent }: LayoutChangeEvent) => {\n this.setState({ containerWidth: nativeEvent.layout.width });\n };\n\n private emitStateChanged = (\n newState: DrawerState,\n drawerWillShow: boolean\n ) => {\n this.props.onDrawerStateChanged?.(newState, drawerWillShow);\n };\n\n private openingHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<PanGestureHandlerEventPayload>) => {\n if (nativeEvent.oldState === State.ACTIVE) {\n this.handleRelease({ nativeEvent });\n } else if (nativeEvent.state === State.ACTIVE) {\n this.emitStateChanged(DRAGGING, false);\n this.setState({ drawerState: DRAGGING });\n if (this.props.keyboardDismissMode === 'on-drag') {\n Keyboard.dismiss();\n }\n if (this.props.hideStatusBar) {\n StatusBar.setHidden(true, this.props.statusBarAnimation || 'slide');\n }\n }\n };\n\n private onTapHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<TapGestureHandlerEventPayload>) => {\n if (\n this.drawerShown &&\n nativeEvent.oldState === State.ACTIVE &&\n this.props.drawerLockMode !== 'locked-open'\n ) {\n this.closeDrawer();\n }\n };\n\n private handleRelease = ({\n nativeEvent,\n }: HandlerStateChangeEvent<PanGestureHandlerEventPayload>) => {\n const { drawerWidth, drawerPosition, drawerType } = this.props;\n const { containerWidth } = this.state;\n let { translationX: dragX, velocityX, x: touchX } = nativeEvent;\n\n if (drawerPosition !== 'left') {\n // See description in _updateAnimatedEvent about why events are flipped\n // for right-side drawer\n dragX = -dragX;\n touchX = containerWidth - touchX;\n velocityX = -velocityX;\n }\n\n const gestureStartX = touchX - dragX;\n let dragOffsetBasedOnStart = 0;\n\n if (drawerType === 'front') {\n dragOffsetBasedOnStart =\n gestureStartX > drawerWidth! ? gestureStartX - drawerWidth! : 0;\n }\n\n const startOffsetX =\n dragX + dragOffsetBasedOnStart + (this.drawerShown ? drawerWidth! : 0);\n const projOffsetX = startOffsetX + DRAG_TOSS * velocityX;\n\n const shouldOpen = projOffsetX > drawerWidth! / 2;\n\n if (shouldOpen) {\n this.animateDrawer(startOffsetX, drawerWidth!, velocityX);\n } else {\n this.animateDrawer(startOffsetX, 0, velocityX);\n }\n };\n\n private updateShowing = (showing: boolean) => {\n this.drawerShown = showing;\n this.accessibilityIsModalView.current?.setNativeProps({\n accessibilityViewIsModal: showing,\n });\n this.pointerEventsView.current?.setNativeProps({\n pointerEvents: showing ? 'auto' : 'none',\n });\n const { drawerPosition, minSwipeDistance, edgeWidth } = this.props;\n const fromLeft = drawerPosition === 'left';\n // gestureOrientation is 1 if the expected gesture is from left to right and\n // -1 otherwise e.g. when drawer is on the left and is closed we expect left\n // to right gesture, thus orientation will be 1.\n const gestureOrientation =\n (fromLeft ? 1 : -1) * (this.drawerShown ? -1 : 1);\n // When drawer is closed we want the hitSlop to be horizontally shorter than\n // the container size by the value of SLOP. This will make it only activate\n // when gesture happens not further than SLOP away from the edge\n const hitSlop = fromLeft\n ? { left: 0, width: showing ? undefined : edgeWidth }\n : { right: 0, width: showing ? undefined : edgeWidth };\n // @ts-ignore internal API, maybe could be fixed in handler types\n this.panGestureHandler.current?.setNativeProps({\n hitSlop,\n activeOffsetX: gestureOrientation * minSwipeDistance!,\n });\n };\n\n private animateDrawer = (\n fromValue: number | null | undefined,\n toValue: number,\n velocity: number,\n speed?: number\n ) => {\n this.state.dragX.setValue(0);\n this.state.touchX.setValue(\n this.props.drawerPosition === 'left' ? 0 : this.state.containerWidth\n );\n\n if (fromValue != null) {\n let nextFramePosition = fromValue;\n if (this.props.useNativeAnimations) {\n // When using native driver, we predict the next position of the\n // animation because it takes one frame of a roundtrip to pass RELEASE\n // event from native driver to JS before we can start animating. Without\n // it, it is more noticable that the frame is dropped.\n if (fromValue < toValue && velocity > 0) {\n nextFramePosition = Math.min(fromValue + velocity / 60.0, toValue);\n } else if (fromValue > toValue && velocity < 0) {\n nextFramePosition = Math.max(fromValue + velocity / 60.0, toValue);\n }\n }\n this.state.drawerTranslation.setValue(nextFramePosition);\n }\n\n const willShow = toValue !== 0;\n this.updateShowing(willShow);\n this.emitStateChanged(SETTLING, willShow);\n this.setState({ drawerState: SETTLING });\n if (this.props.hideStatusBar) {\n StatusBar.setHidden(willShow, this.props.statusBarAnimation || 'slide');\n }\n Animated.spring(this.state.drawerTranslation, {\n velocity,\n bounciness: 0,\n toValue,\n useNativeDriver: this.props.useNativeAnimations!,\n speed: speed ?? undefined,\n }).start(({ finished }) => {\n if (finished) {\n this.emitStateChanged(IDLE, willShow);\n this.setState({ drawerOpened: willShow });\n if (this.state.drawerState !== DRAGGING) {\n // It's possilbe that user started drag while the drawer\n // was settling, don't override state in this case\n this.setState({ drawerState: IDLE });\n }\n if (willShow) {\n this.props.onDrawerOpen?.();\n } else {\n this.props.onDrawerClose?.();\n }\n }\n });\n };\n\n openDrawer = (options: DrawerMovementOption = {}) => {\n this.animateDrawer(\n // TODO: decide if it should be null or undefined is the proper value\n undefined,\n this.props.drawerWidth!,\n options.velocity ? options.velocity : 0,\n options.speed\n );\n\n // We need to force the update, otherwise the overlay is not rerendered and\n // it would not be clickable\n this.forceUpdate();\n };\n\n closeDrawer = (options: DrawerMovementOption = {}) => {\n // TODO: decide if it should be null or undefined is the proper value\n this.animateDrawer(\n undefined,\n 0,\n options.velocity ? options.velocity : 0,\n options.speed\n );\n\n // We need to force the update, otherwise the overlay is not rerendered and\n // it would be still clickable\n this.forceUpdate();\n };\n\n private renderOverlay = () => {\n /* Overlay styles */\n invariant(this.openValue, 'should be set');\n let overlayOpacity;\n\n if (this.state.drawerState !== IDLE) {\n overlayOpacity = this.openValue;\n } else {\n overlayOpacity = this.state.drawerOpened ? 1 : 0;\n }\n\n const dynamicOverlayStyles = {\n opacity: overlayOpacity,\n backgroundColor: this.props.overlayColor,\n };\n\n return (\n <TapGestureHandler onHandlerStateChange={this.onTapHandlerStateChange}>\n <Animated.View\n pointerEvents={this.drawerShown ? 'auto' : 'none'}\n ref={this.pointerEventsView}\n style={[styles.overlay, dynamicOverlayStyles]}\n />\n </TapGestureHandler>\n );\n };\n\n private renderDrawer = () => {\n const {\n drawerBackgroundColor,\n drawerWidth,\n drawerPosition,\n drawerType,\n drawerContainerStyle,\n contentContainerStyle,\n } = this.props;\n\n const fromLeft = drawerPosition === 'left';\n const drawerSlide = drawerType !== 'back';\n const containerSlide = drawerType !== 'front';\n\n // We rely on row and row-reverse flex directions to position the drawer\n // properly. Apparently for RTL these are flipped which requires us to use\n // the opposite setting for the drawer to appear from left or right\n // according to the drawerPosition prop\n const reverseContentDirection = I18nManager.isRTL ? fromLeft : !fromLeft;\n\n const dynamicDrawerStyles = {\n backgroundColor: drawerBackgroundColor,\n width: drawerWidth,\n };\n const openValue = this.openValue;\n invariant(openValue, 'should be set');\n\n let containerStyles;\n if (containerSlide) {\n const containerTranslateX = openValue.interpolate({\n inputRange: [0, 1],\n outputRange: fromLeft ? [0, drawerWidth!] : [0, -drawerWidth!],\n extrapolate: 'clamp',\n });\n containerStyles = {\n transform: [{ translateX: containerTranslateX }],\n };\n }\n\n let drawerTranslateX: number | AnimatedInterpolation = 0;\n if (drawerSlide) {\n const closedDrawerOffset = fromLeft ? -drawerWidth! : drawerWidth!;\n if (this.state.drawerState !== IDLE) {\n drawerTranslateX = openValue.interpolate({\n inputRange: [0, 1],\n outputRange: [closedDrawerOffset, 0],\n extrapolate: 'clamp',\n });\n } else {\n drawerTranslateX = this.state.drawerOpened ? 0 : closedDrawerOffset;\n }\n }\n const drawerStyles: {\n transform: { translateX: number | AnimatedInterpolation }[];\n flexDirection: 'row-reverse' | 'row';\n } = {\n transform: [{ translateX: drawerTranslateX }],\n flexDirection: reverseContentDirection ? 'row-reverse' : 'row',\n };\n\n return (\n <Animated.View style={styles.main} onLayout={this.handleContainerLayout}>\n <Animated.View\n style={[\n drawerType === 'front'\n ? styles.containerOnBack\n : styles.containerInFront,\n containerStyles,\n contentContainerStyle,\n ]}\n importantForAccessibility={\n this.drawerShown ? 'no-hide-descendants' : 'yes'\n }>\n {typeof this.props.children === 'function'\n ? this.props.children(this.openValue)\n : this.props.children}\n {this.renderOverlay()}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n ref={this.accessibilityIsModalView}\n accessibilityViewIsModal={this.drawerShown}\n style={[styles.drawerContainer, drawerStyles, drawerContainerStyle]}>\n <View style={dynamicDrawerStyles}>\n {this.props.renderNavigationView(this.openValue as Animated.Value)}\n </View>\n </Animated.View>\n </Animated.View>\n );\n };\n\n private setPanGestureRef = (ref: PanGestureHandler) => {\n // TODO(TS): make sure it is OK taken from\n // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31065#issuecomment-596081842\n (\n this.panGestureHandler as React.MutableRefObject<PanGestureHandler>\n ).current = ref;\n this.props.onGestureRef?.(ref);\n };\n\n render() {\n const { drawerPosition, drawerLockMode, edgeWidth, minSwipeDistance } =\n this.props;\n\n const fromLeft = drawerPosition === 'left';\n\n // gestureOrientation is 1 if the expected gesture is from left to right and\n // -1 otherwise e.g. when drawer is on the left and is closed we expect left\n // to right gesture, thus orientation will be 1.\n const gestureOrientation =\n (fromLeft ? 1 : -1) * (this.drawerShown ? -1 : 1);\n\n // When drawer is closed we want the hitSlop to be horizontally shorter than\n // the container size by the value of SLOP. This will make it only activate\n // when gesture happens not further than SLOP away from the edge\n const hitSlop = fromLeft\n ? { left: 0, width: this.drawerShown ? undefined : edgeWidth }\n : { right: 0, width: this.drawerShown ? undefined : edgeWidth };\n\n return (\n <PanGestureHandler\n // @ts-ignore could be fixed in handler types\n userSelect={this.props.userSelect}\n activeCursor={this.props.activeCursor}\n mouseButton={this.props.mouseButton}\n enableContextMenu={this.props.enableContextMenu}\n ref={this.setPanGestureRef}\n hitSlop={hitSlop}\n activeOffsetX={gestureOrientation * minSwipeDistance!}\n failOffsetY={[-15, 15]}\n onGestureEvent={this.onGestureEvent}\n onHandlerStateChange={this.openingHandlerStateChange}\n enableTrackpadTwoFingerGesture={\n this.props.enableTrackpadTwoFingerGesture\n }\n enabled={\n drawerLockMode !== 'locked-closed' && drawerLockMode !== 'locked-open'\n }>\n {this.renderDrawer()}\n </PanGestureHandler>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n drawerContainer: {\n ...StyleSheet.absoluteFillObject,\n zIndex: 1001,\n flexDirection: 'row',\n },\n containerInFront: {\n ...StyleSheet.absoluteFillObject,\n zIndex: 1002,\n },\n containerOnBack: {\n ...StyleSheet.absoluteFillObject,\n },\n main: {\n flex: 1,\n zIndex: 0,\n overflow: 'hidden',\n },\n overlay: {\n ...StyleSheet.absoluteFillObject,\n zIndex: 1000,\n },\n});\n"]}
|