@amazon-devices/react-native-gesture-handler 2.0.1758683737

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.
Files changed (848) hide show
  1. package/DrawerLayout/package.json +6 -0
  2. package/LICENSE +7 -0
  3. package/README.kepler.md +167 -0
  4. package/RNGestureHandler.podspec +41 -0
  5. package/Swipeable/package.json +6 -0
  6. package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.bundle +67466 -0
  7. package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.map +1 -0
  8. package/SystemModules/amzn__react-native-gesture-handler-2.modules.txt +338 -0
  9. package/SystemModules/amzn__react-native-gesture-handler-2.private.modules.txt +96 -0
  10. package/SystemModules/keplerscript-system-bundle-config.json +7 -0
  11. package/THIRD_PARTY_NOTICES.txt +578 -0
  12. package/android/build.gradle +205 -0
  13. package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
  14. package/android/gradle.properties +19 -0
  15. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
  16. package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
  17. package/android/src/fabric/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +29 -0
  18. package/android/src/fabric/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +12 -0
  19. package/android/src/main/AndroidManifest.xml +3 -0
  20. package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +21 -0
  21. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +100 -0
  22. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +807 -0
  23. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +8 -0
  24. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +707 -0
  25. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +8 -0
  26. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +47 -0
  27. package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
  28. package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +100 -0
  29. package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +11 -0
  30. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +257 -0
  31. package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +9 -0
  32. package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +322 -0
  33. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +103 -0
  34. package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +23 -0
  35. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +125 -0
  36. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +93 -0
  37. package/android/src/main/java/com/swmansion/gesturehandler/core/ScaleGestureDetector.java +558 -0
  38. package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +168 -0
  39. package/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt +10 -0
  40. package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +16 -0
  41. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +419 -0
  42. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +15 -0
  43. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +77 -0
  44. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +8 -0
  45. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +67 -0
  46. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +756 -0
  47. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +100 -0
  48. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +142 -0
  49. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.kt +5 -0
  50. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +78 -0
  51. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +51 -0
  52. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +72 -0
  53. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +69 -0
  54. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +51 -0
  55. package/android/src/main/jni/CMakeLists.txt +25 -0
  56. package/android/src/main/jni/cpp-adapter.cpp +44 -0
  57. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +50 -0
  58. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +23 -0
  59. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +25 -0
  60. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
  61. package/android/src/paper/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
  62. package/ios/Handlers/RNFlingHandler.h +4 -0
  63. package/ios/Handlers/RNFlingHandler.m +152 -0
  64. package/ios/Handlers/RNForceTouchHandler.h +4 -0
  65. package/ios/Handlers/RNForceTouchHandler.m +175 -0
  66. package/ios/Handlers/RNHoverHandler.h +12 -0
  67. package/ios/Handlers/RNHoverHandler.m +152 -0
  68. package/ios/Handlers/RNLongPressHandler.h +12 -0
  69. package/ios/Handlers/RNLongPressHandler.m +183 -0
  70. package/ios/Handlers/RNManualHandler.h +4 -0
  71. package/ios/Handlers/RNManualHandler.m +88 -0
  72. package/ios/Handlers/RNNativeViewHandler.h +15 -0
  73. package/ios/Handlers/RNNativeViewHandler.mm +193 -0
  74. package/ios/Handlers/RNPanHandler.h +12 -0
  75. package/ios/Handlers/RNPanHandler.m +331 -0
  76. package/ios/Handlers/RNPinchHandler.h +12 -0
  77. package/ios/Handlers/RNPinchHandler.m +95 -0
  78. package/ios/Handlers/RNRotationHandler.h +12 -0
  79. package/ios/Handlers/RNRotationHandler.m +93 -0
  80. package/ios/Handlers/RNTapHandler.h +12 -0
  81. package/ios/Handlers/RNTapHandler.m +265 -0
  82. package/ios/RNGHTouchEventType.h +9 -0
  83. package/ios/RNGestureHandler.h +90 -0
  84. package/ios/RNGestureHandler.m +482 -0
  85. package/ios/RNGestureHandler.xcodeproj/project.pbxproj +690 -0
  86. package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  87. package/ios/RNGestureHandlerActionType.h +10 -0
  88. package/ios/RNGestureHandlerButton.h +19 -0
  89. package/ios/RNGestureHandlerButton.m +77 -0
  90. package/ios/RNGestureHandlerButtonComponentView.h +17 -0
  91. package/ios/RNGestureHandlerButtonComponentView.mm +62 -0
  92. package/ios/RNGestureHandlerButtonManager.h +5 -0
  93. package/ios/RNGestureHandlerButtonManager.m +34 -0
  94. package/ios/RNGestureHandlerDirection.h +8 -0
  95. package/ios/RNGestureHandlerEvents.h +65 -0
  96. package/ios/RNGestureHandlerEvents.m +260 -0
  97. package/ios/RNGestureHandlerManager.h +35 -0
  98. package/ios/RNGestureHandlerManager.mm +367 -0
  99. package/ios/RNGestureHandlerModule.h +7 -0
  100. package/ios/RNGestureHandlerModule.mm +320 -0
  101. package/ios/RNGestureHandlerPointerTracker.h +25 -0
  102. package/ios/RNGestureHandlerPointerTracker.m +243 -0
  103. package/ios/RNGestureHandlerRegistry.h +21 -0
  104. package/ios/RNGestureHandlerRegistry.m +63 -0
  105. package/ios/RNGestureHandlerRootViewComponentView.mm +21 -0
  106. package/ios/RNGestureHandlerState.h +10 -0
  107. package/ios/RNGestureHandlerStateManager.h +5 -0
  108. package/ios/RNManualActivationRecognizer.h +10 -0
  109. package/ios/RNManualActivationRecognizer.m +88 -0
  110. package/ios/RNRootViewGestureRecognizer.h +17 -0
  111. package/ios/RNRootViewGestureRecognizer.m +106 -0
  112. package/jest-utils/package.json +6 -0
  113. package/jestSetup.js +7 -0
  114. package/kepler-compatibility.json +8 -0
  115. package/kepler-transformed-package-info.json +3 -0
  116. package/lib/commonjs/ActionType.js +15 -0
  117. package/lib/commonjs/ActionType.js.map +1 -0
  118. package/lib/commonjs/Directions.js +15 -0
  119. package/lib/commonjs/Directions.js.map +1 -0
  120. package/lib/commonjs/EnableNewWebImplementation.js +29 -0
  121. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
  122. package/lib/commonjs/GestureHandlerRootViewContext.js +10 -0
  123. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
  124. package/lib/commonjs/PlatformConstants.js +10 -0
  125. package/lib/commonjs/PlatformConstants.js.map +1 -0
  126. package/lib/commonjs/PlatformConstants.web.js +12 -0
  127. package/lib/commonjs/PlatformConstants.web.js.map +1 -0
  128. package/lib/commonjs/RNGestureHandlerModule.js +23 -0
  129. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
  130. package/lib/commonjs/RNGestureHandlerModule.kepler.js +33 -0
  131. package/lib/commonjs/RNGestureHandlerModule.kepler.js.map +1 -0
  132. package/lib/commonjs/RNGestureHandlerModule.macos.js +113 -0
  133. package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -0
  134. package/lib/commonjs/RNGestureHandlerModule.web.js +123 -0
  135. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
  136. package/lib/commonjs/RNGestureHandlerModule.windows.js +121 -0
  137. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -0
  138. package/lib/commonjs/RNRenderer.js +14 -0
  139. package/lib/commonjs/RNRenderer.js.map +1 -0
  140. package/lib/commonjs/RNRenderer.web.js +10 -0
  141. package/lib/commonjs/RNRenderer.web.js.map +1 -0
  142. package/lib/commonjs/State.js +19 -0
  143. package/lib/commonjs/State.js.map +1 -0
  144. package/lib/commonjs/TouchEventType.js +16 -0
  145. package/lib/commonjs/TouchEventType.js.map +1 -0
  146. package/lib/commonjs/components/DrawerLayout.js +512 -0
  147. package/lib/commonjs/components/DrawerLayout.js.map +1 -0
  148. package/lib/commonjs/components/GestureButtons.js +194 -0
  149. package/lib/commonjs/components/GestureButtons.js.map +1 -0
  150. package/lib/commonjs/components/GestureComponents.js +104 -0
  151. package/lib/commonjs/components/GestureComponents.js.map +1 -0
  152. package/lib/commonjs/components/GestureComponents.web.js +38 -0
  153. package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
  154. package/lib/commonjs/components/GestureHandlerButton.js +10 -0
  155. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
  156. package/lib/commonjs/components/GestureHandlerButton.web.js +16 -0
  157. package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
  158. package/lib/commonjs/components/GestureHandlerRootView.android.js +23 -0
  159. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
  160. package/lib/commonjs/components/GestureHandlerRootView.js +23 -0
  161. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
  162. package/lib/commonjs/components/GestureHandlerRootView.kepler.js +18 -0
  163. package/lib/commonjs/components/GestureHandlerRootView.kepler.js.map +1 -0
  164. package/lib/commonjs/components/GestureHandlerRootView.web.js +18 -0
  165. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
  166. package/lib/commonjs/components/Swipeable.js +345 -0
  167. package/lib/commonjs/components/Swipeable.js.map +1 -0
  168. package/lib/commonjs/components/gestureHandlerRootHOC.js +31 -0
  169. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
  170. package/lib/commonjs/components/touchables/GenericTouchable.js +253 -0
  171. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
  172. package/lib/commonjs/components/touchables/TouchableHighlight.js +90 -0
  173. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
  174. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +84 -0
  175. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
  176. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +9 -0
  177. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
  178. package/lib/commonjs/components/touchables/TouchableOpacity.js +64 -0
  179. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
  180. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +18 -0
  181. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
  182. package/lib/commonjs/components/touchables/index.js +35 -0
  183. package/lib/commonjs/components/touchables/index.js.map +1 -0
  184. package/lib/commonjs/getShadowNodeFromRef.js +27 -0
  185. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -0
  186. package/lib/commonjs/getShadowNodeFromRef.web.js +14 -0
  187. package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -0
  188. package/lib/commonjs/handlers/FlingGestureHandler.js +18 -0
  189. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
  190. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +37 -0
  191. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
  192. package/lib/commonjs/handlers/LongPressGestureHandler.js +20 -0
  193. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
  194. package/lib/commonjs/handlers/NativeViewGestureHandler.js +19 -0
  195. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
  196. package/lib/commonjs/handlers/PanGestureHandler.js +99 -0
  197. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
  198. package/lib/commonjs/handlers/PinchGestureHandler.js +17 -0
  199. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
  200. package/lib/commonjs/handlers/PressabilityDebugView.js +13 -0
  201. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -0
  202. package/lib/commonjs/handlers/PressabilityDebugView.web.js +11 -0
  203. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -0
  204. package/lib/commonjs/handlers/RotationGestureHandler.js +17 -0
  205. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
  206. package/lib/commonjs/handlers/TapGestureHandler.js +20 -0
  207. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
  208. package/lib/commonjs/handlers/createHandler.js +402 -0
  209. package/lib/commonjs/handlers/createHandler.js.map +1 -0
  210. package/lib/commonjs/handlers/createNativeWrapper.js +63 -0
  211. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
  212. package/lib/commonjs/handlers/gestureHandlerCommon.js +86 -0
  213. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
  214. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +6 -0
  215. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -0
  216. package/lib/commonjs/handlers/gestures/GestureDetector.js +548 -0
  217. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
  218. package/lib/commonjs/handlers/gestures/eventReceiver.js +125 -0
  219. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
  220. package/lib/commonjs/handlers/gestures/flingGesture.js +27 -0
  221. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
  222. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +54 -0
  223. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
  224. package/lib/commonjs/handlers/gestures/gesture.js +196 -0
  225. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
  226. package/lib/commonjs/handlers/gestures/gestureComposition.js +90 -0
  227. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
  228. package/lib/commonjs/handlers/gestures/gestureObjects.js +73 -0
  229. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
  230. package/lib/commonjs/handlers/gestures/gestureStateManager.js +60 -0
  231. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
  232. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +27 -0
  233. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
  234. package/lib/commonjs/handlers/gestures/hoverGesture.js +60 -0
  235. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
  236. package/lib/commonjs/handlers/gestures/longPressGesture.js +28 -0
  237. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
  238. package/lib/commonjs/handlers/gestures/manualGesture.js +25 -0
  239. package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
  240. package/lib/commonjs/handlers/gestures/nativeGesture.js +27 -0
  241. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
  242. package/lib/commonjs/handlers/gestures/panGesture.js +124 -0
  243. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
  244. package/lib/commonjs/handlers/gestures/pinchGesture.js +38 -0
  245. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
  246. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +30 -0
  247. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
  248. package/lib/commonjs/handlers/gestures/rotationGesture.js +38 -0
  249. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
  250. package/lib/commonjs/handlers/gestures/tapGesture.js +48 -0
  251. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
  252. package/lib/commonjs/handlers/handlersRegistry.js +52 -0
  253. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
  254. package/lib/commonjs/index.js +241 -0
  255. package/lib/commonjs/index.js.map +1 -0
  256. package/lib/commonjs/init.js +25 -0
  257. package/lib/commonjs/init.js.map +1 -0
  258. package/lib/commonjs/jestUtils/index.js +19 -0
  259. package/lib/commonjs/jestUtils/index.js.map +1 -0
  260. package/lib/commonjs/jestUtils/jestUtils.js +312 -0
  261. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
  262. package/lib/commonjs/mocks.js +61 -0
  263. package/lib/commonjs/mocks.js.map +1 -0
  264. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
  265. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
  266. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js +20 -0
  267. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
  268. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -0
  269. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
  270. package/lib/commonjs/typeUtils.js +2 -0
  271. package/lib/commonjs/typeUtils.js.map +1 -0
  272. package/lib/commonjs/utils.js +64 -0
  273. package/lib/commonjs/utils.js.map +1 -0
  274. package/lib/commonjs/web/constants.js +14 -0
  275. package/lib/commonjs/web/constants.js.map +1 -0
  276. package/lib/commonjs/web/detectors/RotationGestureDetector.js +129 -0
  277. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -0
  278. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +127 -0
  279. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -0
  280. package/lib/commonjs/web/handlers/FlingGestureHandler.js +127 -0
  281. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -0
  282. package/lib/commonjs/web/handlers/GestureHandler.js +668 -0
  283. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -0
  284. package/lib/commonjs/web/handlers/HoverGestureHandler.js +48 -0
  285. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
  286. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +119 -0
  287. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -0
  288. package/lib/commonjs/web/handlers/ManualGestureHandler.js +49 -0
  289. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
  290. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +140 -0
  291. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -0
  292. package/lib/commonjs/web/handlers/PanGestureHandler.js +347 -0
  293. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -0
  294. package/lib/commonjs/web/handlers/PinchGestureHandler.js +136 -0
  295. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -0
  296. package/lib/commonjs/web/handlers/RotationGestureHandler.js +146 -0
  297. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -0
  298. package/lib/commonjs/web/handlers/TapGestureHandler.js +219 -0
  299. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -0
  300. package/lib/commonjs/web/interfaces.js +44 -0
  301. package/lib/commonjs/web/interfaces.js.map +1 -0
  302. package/lib/commonjs/web/tools/CircularBuffer.js +47 -0
  303. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
  304. package/lib/commonjs/web/tools/EventManager.js +95 -0
  305. package/lib/commonjs/web/tools/EventManager.js.map +1 -0
  306. package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
  307. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
  308. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +305 -0
  309. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -0
  310. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +93 -0
  311. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
  312. package/lib/commonjs/web/tools/InteractionManager.js +99 -0
  313. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -0
  314. package/lib/commonjs/web/tools/LeastSquareSolver.js +167 -0
  315. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
  316. package/lib/commonjs/web/tools/NodeManager.js +41 -0
  317. package/lib/commonjs/web/tools/NodeManager.js.map +1 -0
  318. package/lib/commonjs/web/tools/PointerEventManager.js +171 -0
  319. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
  320. package/lib/commonjs/web/tools/PointerTracker.js +202 -0
  321. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -0
  322. package/lib/commonjs/web/tools/TouchEventManager.js +126 -0
  323. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
  324. package/lib/commonjs/web/tools/VelocityTracker.js +89 -0
  325. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
  326. package/lib/commonjs/web/utils.js +14 -0
  327. package/lib/commonjs/web/utils.js.map +1 -0
  328. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +93 -0
  329. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -0
  330. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +43 -0
  331. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -0
  332. package/lib/commonjs/web_hammer/Errors.js +13 -0
  333. package/lib/commonjs/web_hammer/Errors.js.map +1 -0
  334. package/lib/commonjs/web_hammer/FlingGestureHandler.js +139 -0
  335. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -0
  336. package/lib/commonjs/web_hammer/GestureHandler.js +491 -0
  337. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -0
  338. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +45 -0
  339. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -0
  340. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +57 -0
  341. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -0
  342. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +58 -0
  343. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -0
  344. package/lib/commonjs/web_hammer/NodeManager.js +40 -0
  345. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -0
  346. package/lib/commonjs/web_hammer/PanGestureHandler.js +167 -0
  347. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -0
  348. package/lib/commonjs/web_hammer/PinchGestureHandler.js +31 -0
  349. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -0
  350. package/lib/commonjs/web_hammer/PressGestureHandler.js +160 -0
  351. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -0
  352. package/lib/commonjs/web_hammer/RotationGestureHandler.js +33 -0
  353. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -0
  354. package/lib/commonjs/web_hammer/TapGestureHandler.js +173 -0
  355. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -0
  356. package/lib/commonjs/web_hammer/constants.js +51 -0
  357. package/lib/commonjs/web_hammer/constants.js.map +1 -0
  358. package/lib/commonjs/web_hammer/utils.js +32 -0
  359. package/lib/commonjs/web_hammer/utils.js.map +1 -0
  360. package/lib/module/ActionType.js +9 -0
  361. package/lib/module/ActionType.js.map +1 -0
  362. package/lib/module/Directions.js +9 -0
  363. package/lib/module/Directions.js.map +1 -0
  364. package/lib/module/EnableNewWebImplementation.js +21 -0
  365. package/lib/module/EnableNewWebImplementation.js.map +1 -0
  366. package/lib/module/GestureHandlerRootViewContext.js +3 -0
  367. package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
  368. package/lib/module/PlatformConstants.js +4 -0
  369. package/lib/module/PlatformConstants.js.map +1 -0
  370. package/lib/module/PlatformConstants.web.js +6 -0
  371. package/lib/module/PlatformConstants.web.js.map +1 -0
  372. package/lib/module/RNGestureHandlerModule.js +17 -0
  373. package/lib/module/RNGestureHandlerModule.js.map +1 -0
  374. package/lib/module/RNGestureHandlerModule.kepler.js +24 -0
  375. package/lib/module/RNGestureHandlerModule.kepler.js.map +1 -0
  376. package/lib/module/RNGestureHandlerModule.macos.js +104 -0
  377. package/lib/module/RNGestureHandlerModule.macos.js.map +1 -0
  378. package/lib/module/RNGestureHandlerModule.web.js +114 -0
  379. package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
  380. package/lib/module/RNGestureHandlerModule.windows.js +112 -0
  381. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -0
  382. package/lib/module/RNRenderer.js +4 -0
  383. package/lib/module/RNRenderer.js.map +1 -0
  384. package/lib/module/RNRenderer.web.js +4 -0
  385. package/lib/module/RNRenderer.web.js.map +1 -0
  386. package/lib/module/State.js +13 -0
  387. package/lib/module/State.js.map +1 -0
  388. package/lib/module/TouchEventType.js +10 -0
  389. package/lib/module/TouchEventType.js.map +1 -0
  390. package/lib/module/components/DrawerLayout.js +504 -0
  391. package/lib/module/components/DrawerLayout.js.map +1 -0
  392. package/lib/module/components/GestureButtons.js +176 -0
  393. package/lib/module/components/GestureButtons.js.map +1 -0
  394. package/lib/module/components/GestureComponents.js +95 -0
  395. package/lib/module/components/GestureComponents.js.map +1 -0
  396. package/lib/module/components/GestureComponents.web.js +28 -0
  397. package/lib/module/components/GestureComponents.web.js.map +1 -0
  398. package/lib/module/components/GestureHandlerButton.js +3 -0
  399. package/lib/module/components/GestureHandlerButton.js.map +1 -0
  400. package/lib/module/components/GestureHandlerButton.web.js +8 -0
  401. package/lib/module/components/GestureHandlerButton.web.js.map +1 -0
  402. package/lib/module/components/GestureHandlerRootView.android.js +14 -0
  403. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
  404. package/lib/module/components/GestureHandlerRootView.js +14 -0
  405. package/lib/module/components/GestureHandlerRootView.js.map +1 -0
  406. package/lib/module/components/GestureHandlerRootView.kepler.js +9 -0
  407. package/lib/module/components/GestureHandlerRootView.kepler.js.map +1 -0
  408. package/lib/module/components/GestureHandlerRootView.web.js +9 -0
  409. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
  410. package/lib/module/components/Swipeable.js +338 -0
  411. package/lib/module/components/Swipeable.js.map +1 -0
  412. package/lib/module/components/gestureHandlerRootHOC.js +22 -0
  413. package/lib/module/components/gestureHandlerRootHOC.js.map +1 -0
  414. package/lib/module/components/touchables/GenericTouchable.js +244 -0
  415. package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
  416. package/lib/module/components/touchables/TouchableHighlight.js +81 -0
  417. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
  418. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +74 -0
  419. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
  420. package/lib/module/components/touchables/TouchableNativeFeedback.js +3 -0
  421. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -0
  422. package/lib/module/components/touchables/TouchableOpacity.js +55 -0
  423. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
  424. package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -0
  425. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -0
  426. package/lib/module/components/touchables/index.js +5 -0
  427. package/lib/module/components/touchables/index.js.map +1 -0
  428. package/lib/module/getShadowNodeFromRef.js +21 -0
  429. package/lib/module/getShadowNodeFromRef.js.map +1 -0
  430. package/lib/module/getShadowNodeFromRef.web.js +8 -0
  431. package/lib/module/getShadowNodeFromRef.web.js.map +1 -0
  432. package/lib/module/handlers/FlingGestureHandler.js +11 -0
  433. package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
  434. package/lib/module/handlers/ForceTouchGestureHandler.js +30 -0
  435. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -0
  436. package/lib/module/handlers/LongPressGestureHandler.js +13 -0
  437. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -0
  438. package/lib/module/handlers/NativeViewGestureHandler.js +12 -0
  439. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -0
  440. package/lib/module/handlers/PanGestureHandler.js +90 -0
  441. package/lib/module/handlers/PanGestureHandler.js.map +1 -0
  442. package/lib/module/handlers/PinchGestureHandler.js +10 -0
  443. package/lib/module/handlers/PinchGestureHandler.js.map +1 -0
  444. package/lib/module/handlers/PressabilityDebugView.js +3 -0
  445. package/lib/module/handlers/PressabilityDebugView.js.map +1 -0
  446. package/lib/module/handlers/PressabilityDebugView.web.js +5 -0
  447. package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -0
  448. package/lib/module/handlers/RotationGestureHandler.js +10 -0
  449. package/lib/module/handlers/RotationGestureHandler.js.map +1 -0
  450. package/lib/module/handlers/TapGestureHandler.js +13 -0
  451. package/lib/module/handlers/TapGestureHandler.js.map +1 -0
  452. package/lib/module/handlers/createHandler.js +395 -0
  453. package/lib/module/handlers/createHandler.js.map +1 -0
  454. package/lib/module/handlers/createNativeWrapper.js +56 -0
  455. package/lib/module/handlers/createNativeWrapper.js.map +1 -0
  456. package/lib/module/handlers/gestureHandlerCommon.js +76 -0
  457. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
  458. package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
  459. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -0
  460. package/lib/module/handlers/gestures/GestureDetector.js +538 -0
  461. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
  462. package/lib/module/handlers/gestures/eventReceiver.js +116 -0
  463. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
  464. package/lib/module/handlers/gestures/flingGesture.js +20 -0
  465. package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
  466. package/lib/module/handlers/gestures/forceTouchGesture.js +47 -0
  467. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
  468. package/lib/module/handlers/gestures/gesture.js +188 -0
  469. package/lib/module/handlers/gestures/gesture.js.map +1 -0
  470. package/lib/module/handlers/gestures/gestureComposition.js +81 -0
  471. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
  472. package/lib/module/handlers/gestures/gestureObjects.js +67 -0
  473. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -0
  474. package/lib/module/handlers/gestures/gestureStateManager.js +54 -0
  475. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -0
  476. package/lib/module/handlers/gestures/gestureStateManager.web.js +20 -0
  477. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
  478. package/lib/module/handlers/gestures/hoverGesture.js +53 -0
  479. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
  480. package/lib/module/handlers/gestures/longPressGesture.js +21 -0
  481. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
  482. package/lib/module/handlers/gestures/manualGesture.js +18 -0
  483. package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
  484. package/lib/module/handlers/gestures/nativeGesture.js +20 -0
  485. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
  486. package/lib/module/handlers/gestures/panGesture.js +117 -0
  487. package/lib/module/handlers/gestures/panGesture.js.map +1 -0
  488. package/lib/module/handlers/gestures/pinchGesture.js +31 -0
  489. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
  490. package/lib/module/handlers/gestures/reanimatedWrapper.js +25 -0
  491. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
  492. package/lib/module/handlers/gestures/rotationGesture.js +31 -0
  493. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
  494. package/lib/module/handlers/gestures/tapGesture.js +41 -0
  495. package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
  496. package/lib/module/handlers/handlersRegistry.js +39 -0
  497. package/lib/module/handlers/handlersRegistry.js.map +1 -0
  498. package/lib/module/index.js +25 -0
  499. package/lib/module/index.js.map +1 -0
  500. package/lib/module/init.js +17 -0
  501. package/lib/module/init.js.map +1 -0
  502. package/lib/module/jestUtils/index.js +2 -0
  503. package/lib/module/jestUtils/index.js.map +1 -0
  504. package/lib/module/jestUtils/jestUtils.js +305 -0
  505. package/lib/module/jestUtils/jestUtils.js.map +1 -0
  506. package/lib/module/mocks.js +55 -0
  507. package/lib/module/mocks.js.map +1 -0
  508. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +4 -0
  509. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
  510. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js +12 -0
  511. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
  512. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +4 -0
  513. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
  514. package/lib/module/typeUtils.js +2 -0
  515. package/lib/module/typeUtils.js.map +1 -0
  516. package/lib/module/utils.js +50 -0
  517. package/lib/module/utils.js.map +1 -0
  518. package/lib/module/web/constants.js +8 -0
  519. package/lib/module/web/constants.js.map +1 -0
  520. package/lib/module/web/detectors/RotationGestureDetector.js +122 -0
  521. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -0
  522. package/lib/module/web/detectors/ScaleGestureDetector.js +120 -0
  523. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -0
  524. package/lib/module/web/handlers/FlingGestureHandler.js +119 -0
  525. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -0
  526. package/lib/module/web/handlers/GestureHandler.js +661 -0
  527. package/lib/module/web/handlers/GestureHandler.js.map +1 -0
  528. package/lib/module/web/handlers/HoverGestureHandler.js +40 -0
  529. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
  530. package/lib/module/web/handlers/LongPressGestureHandler.js +111 -0
  531. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -0
  532. package/lib/module/web/handlers/ManualGestureHandler.js +41 -0
  533. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
  534. package/lib/module/web/handlers/NativeViewGestureHandler.js +132 -0
  535. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -0
  536. package/lib/module/web/handlers/PanGestureHandler.js +339 -0
  537. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -0
  538. package/lib/module/web/handlers/PinchGestureHandler.js +128 -0
  539. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -0
  540. package/lib/module/web/handlers/RotationGestureHandler.js +138 -0
  541. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -0
  542. package/lib/module/web/handlers/TapGestureHandler.js +211 -0
  543. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -0
  544. package/lib/module/web/interfaces.js +38 -0
  545. package/lib/module/web/interfaces.js.map +1 -0
  546. package/lib/module/web/tools/CircularBuffer.js +40 -0
  547. package/lib/module/web/tools/CircularBuffer.js.map +1 -0
  548. package/lib/module/web/tools/EventManager.js +88 -0
  549. package/lib/module/web/tools/EventManager.js.map +1 -0
  550. package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
  551. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
  552. package/lib/module/web/tools/GestureHandlerOrchestrator.js +297 -0
  553. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -0
  554. package/lib/module/web/tools/GestureHandlerWebDelegate.js +85 -0
  555. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
  556. package/lib/module/web/tools/InteractionManager.js +92 -0
  557. package/lib/module/web/tools/InteractionManager.js.map +1 -0
  558. package/lib/module/web/tools/LeastSquareSolver.js +160 -0
  559. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
  560. package/lib/module/web/tools/NodeManager.js +34 -0
  561. package/lib/module/web/tools/NodeManager.js.map +1 -0
  562. package/lib/module/web/tools/PointerEventManager.js +163 -0
  563. package/lib/module/web/tools/PointerEventManager.js.map +1 -0
  564. package/lib/module/web/tools/PointerTracker.js +194 -0
  565. package/lib/module/web/tools/PointerTracker.js.map +1 -0
  566. package/lib/module/web/tools/TouchEventManager.js +118 -0
  567. package/lib/module/web/tools/TouchEventManager.js.map +1 -0
  568. package/lib/module/web/tools/VelocityTracker.js +81 -0
  569. package/lib/module/web/tools/VelocityTracker.js.map +1 -0
  570. package/lib/module/web/utils.js +8 -0
  571. package/lib/module/web/utils.js.map +1 -0
  572. package/lib/module/web_hammer/DiscreteGestureHandler.js +85 -0
  573. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -0
  574. package/lib/module/web_hammer/DraggingGestureHandler.js +35 -0
  575. package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -0
  576. package/lib/module/web_hammer/Errors.js +6 -0
  577. package/lib/module/web_hammer/Errors.js.map +1 -0
  578. package/lib/module/web_hammer/FlingGestureHandler.js +131 -0
  579. package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -0
  580. package/lib/module/web_hammer/GestureHandler.js +485 -0
  581. package/lib/module/web_hammer/GestureHandler.js.map +1 -0
  582. package/lib/module/web_hammer/IndiscreteGestureHandler.js +39 -0
  583. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -0
  584. package/lib/module/web_hammer/LongPressGestureHandler.js +49 -0
  585. package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -0
  586. package/lib/module/web_hammer/NativeViewGestureHandler.js +49 -0
  587. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -0
  588. package/lib/module/web_hammer/NodeManager.js +31 -0
  589. package/lib/module/web_hammer/NodeManager.js.map +1 -0
  590. package/lib/module/web_hammer/PanGestureHandler.js +160 -0
  591. package/lib/module/web_hammer/PanGestureHandler.js.map +1 -0
  592. package/lib/module/web_hammer/PinchGestureHandler.js +24 -0
  593. package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -0
  594. package/lib/module/web_hammer/PressGestureHandler.js +153 -0
  595. package/lib/module/web_hammer/PressGestureHandler.js.map +1 -0
  596. package/lib/module/web_hammer/RotationGestureHandler.js +26 -0
  597. package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -0
  598. package/lib/module/web_hammer/TapGestureHandler.js +166 -0
  599. package/lib/module/web_hammer/TapGestureHandler.js.map +1 -0
  600. package/lib/module/web_hammer/constants.js +44 -0
  601. package/lib/module/web_hammer/constants.js.map +1 -0
  602. package/lib/module/web_hammer/utils.js +19 -0
  603. package/lib/module/web_hammer/utils.js.map +1 -0
  604. package/lib/typescript/ActionType.d.ts +7 -0
  605. package/lib/typescript/Directions.d.ts +7 -0
  606. package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
  607. package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
  608. package/lib/typescript/PlatformConstants.d.ts +5 -0
  609. package/lib/typescript/PlatformConstants.web.d.ts +4 -0
  610. package/lib/typescript/RNGestureHandlerModule.d.ts +13 -0
  611. package/lib/typescript/RNGestureHandlerModule.kepler.d.ts +17 -0
  612. package/lib/typescript/RNGestureHandlerModule.macos.d.ts +47 -0
  613. package/lib/typescript/RNGestureHandlerModule.web.d.ts +50 -0
  614. package/lib/typescript/RNGestureHandlerModule.windows.d.ts +48 -0
  615. package/lib/typescript/RNRenderer.d.ts +1 -0
  616. package/lib/typescript/RNRenderer.web.d.ts +3 -0
  617. package/lib/typescript/State.d.ts +9 -0
  618. package/lib/typescript/TouchEventType.d.ts +8 -0
  619. package/lib/typescript/components/DrawerLayout.d.ts +148 -0
  620. package/lib/typescript/components/GestureButtons.d.ts +121 -0
  621. package/lib/typescript/components/GestureComponents.d.ts +22 -0
  622. package/lib/typescript/components/GestureComponents.web.d.ts +8 -0
  623. package/lib/typescript/components/GestureHandlerButton.d.ts +4 -0
  624. package/lib/typescript/components/GestureHandlerButton.web.d.ts +4 -0
  625. package/lib/typescript/components/GestureHandlerRootView.android.d.ts +6 -0
  626. package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -0
  627. package/lib/typescript/components/GestureHandlerRootView.kepler.d.ts +6 -0
  628. package/lib/typescript/components/GestureHandlerRootView.web.d.ts +6 -0
  629. package/lib/typescript/components/Swipeable.d.ts +170 -0
  630. package/lib/typescript/components/gestureHandlerRootHOC.d.ts +3 -0
  631. package/lib/typescript/components/touchables/GenericTouchable.d.ts +68 -0
  632. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +36 -0
  633. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +45 -0
  634. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +2 -0
  635. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +25 -0
  636. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +7 -0
  637. package/lib/typescript/components/touchables/index.d.ts +7 -0
  638. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -0
  639. package/lib/typescript/getShadowNodeFromRef.web.d.ts +1 -0
  640. package/lib/typescript/handlers/FlingGestureHandler.d.ts +34 -0
  641. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +44 -0
  642. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +56 -0
  643. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +28 -0
  644. package/lib/typescript/handlers/PanGestureHandler.d.ts +139 -0
  645. package/lib/typescript/handlers/PinchGestureHandler.d.ts +29 -0
  646. package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -0
  647. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +1 -0
  648. package/lib/typescript/handlers/RotationGestureHandler.d.ts +29 -0
  649. package/lib/typescript/handlers/TapGestureHandler.d.ts +57 -0
  650. package/lib/typescript/handlers/createHandler.d.ts +11 -0
  651. package/lib/typescript/handlers/createNativeWrapper.d.ts +3 -0
  652. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +67 -0
  653. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +42 -0
  654. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +19 -0
  655. package/lib/typescript/handlers/gestures/eventReceiver.d.ts +4 -0
  656. package/lib/typescript/handlers/gestures/flingGesture.d.ts +9 -0
  657. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +15 -0
  658. package/lib/typescript/handlers/gestures/gesture.d.ts +108 -0
  659. package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
  660. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +41 -0
  661. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +9 -0
  662. package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
  663. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
  664. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +9 -0
  665. package/lib/typescript/handlers/gestures/manualGesture.d.ts +7 -0
  666. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
  667. package/lib/typescript/handlers/gestures/panGesture.d.ts +26 -0
  668. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +11 -0
  669. package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
  670. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +12 -0
  671. package/lib/typescript/handlers/gestures/tapGesture.d.ts +14 -0
  672. package/lib/typescript/handlers/handlersRegistry.d.ts +14 -0
  673. package/lib/typescript/index.d.ts +52 -0
  674. package/lib/typescript/init.d.ts +2 -0
  675. package/lib/typescript/jestUtils/index.d.ts +1 -0
  676. package/lib/typescript/jestUtils/jestUtils.d.ts +28 -0
  677. package/lib/typescript/mocks.d.ts +44 -0
  678. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -0
  679. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.kepler.d.ts +7 -0
  680. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -0
  681. package/lib/typescript/typeUtils.d.ts +1 -0
  682. package/lib/typescript/utils.d.ts +12 -0
  683. package/lib/typescript/web/constants.d.ts +7 -0
  684. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +30 -0
  685. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +29 -0
  686. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +27 -0
  687. package/lib/typescript/web/handlers/GestureHandler.d.ts +90 -0
  688. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
  689. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +26 -0
  690. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +12 -0
  691. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +24 -0
  692. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +55 -0
  693. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +28 -0
  694. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +29 -0
  695. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +39 -0
  696. package/lib/typescript/web/interfaces.d.ts +140 -0
  697. package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
  698. package/lib/typescript/web/tools/EventManager.d.ts +34 -0
  699. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
  700. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +30 -0
  701. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
  702. package/lib/typescript/web/tools/InteractionManager.d.ts +16 -0
  703. package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
  704. package/lib/typescript/web/tools/NodeManager.d.ts +11 -0
  705. package/lib/typescript/web/tools/PointerEventManager.d.ts +8 -0
  706. package/lib/typescript/web/tools/PointerTracker.d.ts +53 -0
  707. package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
  708. package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
  709. package/lib/typescript/web/utils.d.ts +4 -0
  710. package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +20 -0
  711. package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +15 -0
  712. package/lib/typescript/web_hammer/Errors.d.ts +3 -0
  713. package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +43 -0
  714. package/lib/typescript/web_hammer/GestureHandler.d.ts +145 -0
  715. package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +40 -0
  716. package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +38 -0
  717. package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +7 -0
  718. package/lib/typescript/web_hammer/NodeManager.d.ts +8 -0
  719. package/lib/typescript/web_hammer/PanGestureHandler.d.ts +56 -0
  720. package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +13 -0
  721. package/lib/typescript/web_hammer/PressGestureHandler.d.ts +83 -0
  722. package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +13 -0
  723. package/lib/typescript/web_hammer/TapGestureHandler.d.ts +57 -0
  724. package/lib/typescript/web_hammer/constants.d.ts +39 -0
  725. package/lib/typescript/web_hammer/utils.d.ts +9 -0
  726. package/package.json +1 -0
  727. package/src/ActionType.ts +9 -0
  728. package/src/Directions.ts +9 -0
  729. package/src/EnableNewWebImplementation.ts +35 -0
  730. package/src/GestureHandlerRootViewContext.ts +3 -0
  731. package/src/PlatformConstants.ts +8 -0
  732. package/src/PlatformConstants.web.ts +5 -0
  733. package/src/RNGestureHandlerModule.kepler.ts +64 -0
  734. package/src/RNGestureHandlerModule.macos.ts +133 -0
  735. package/src/RNGestureHandlerModule.ts +50 -0
  736. package/src/RNGestureHandlerModule.web.ts +146 -0
  737. package/src/RNGestureHandlerModule.windows.ts +144 -0
  738. package/src/RNRenderer.ts +3 -0
  739. package/src/RNRenderer.web.ts +3 -0
  740. package/src/State.ts +13 -0
  741. package/src/TouchEventType.ts +10 -0
  742. package/src/components/DrawerLayout.tsx +743 -0
  743. package/src/components/GestureButtons.tsx +334 -0
  744. package/src/components/GestureComponents.tsx +148 -0
  745. package/src/components/GestureComponents.web.tsx +41 -0
  746. package/src/components/GestureHandlerButton.tsx +5 -0
  747. package/src/components/GestureHandlerButton.web.tsx +6 -0
  748. package/src/components/GestureHandlerRootView.android.tsx +24 -0
  749. package/src/components/GestureHandlerRootView.kepler.tsx +17 -0
  750. package/src/components/GestureHandlerRootView.tsx +23 -0
  751. package/src/components/GestureHandlerRootView.web.tsx +17 -0
  752. package/src/components/Swipeable.tsx +551 -0
  753. package/src/components/gestureHandlerRootHOC.tsx +32 -0
  754. package/src/components/touchables/GenericTouchable.tsx +301 -0
  755. package/src/components/touchables/TouchableHighlight.tsx +115 -0
  756. package/src/components/touchables/TouchableNativeFeedback.android.tsx +91 -0
  757. package/src/components/touchables/TouchableNativeFeedback.tsx +3 -0
  758. package/src/components/touchables/TouchableOpacity.tsx +75 -0
  759. package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -0
  760. package/src/components/touchables/index.ts +7 -0
  761. package/src/getShadowNodeFromRef.ts +22 -0
  762. package/src/getShadowNodeFromRef.web.ts +7 -0
  763. package/src/handlers/FlingGestureHandler.ts +59 -0
  764. package/src/handlers/ForceTouchGestureHandler.ts +90 -0
  765. package/src/handlers/LongPressGestureHandler.ts +88 -0
  766. package/src/handlers/NativeViewGestureHandler.ts +55 -0
  767. package/src/handlers/PanGestureHandler.ts +325 -0
  768. package/src/handlers/PinchGestureHandler.ts +48 -0
  769. package/src/handlers/PressabilityDebugView.tsx +2 -0
  770. package/src/handlers/PressabilityDebugView.web.tsx +4 -0
  771. package/src/handlers/RotationGestureHandler.ts +48 -0
  772. package/src/handlers/TapGestureHandler.ts +94 -0
  773. package/src/handlers/createHandler.tsx +547 -0
  774. package/src/handlers/createNativeWrapper.tsx +80 -0
  775. package/src/handlers/gestureHandlerCommon.ts +244 -0
  776. package/src/handlers/gestureHandlerTypesCompat.ts +106 -0
  777. package/src/handlers/gestures/GestureDetector.tsx +818 -0
  778. package/src/handlers/gestures/eventReceiver.ts +172 -0
  779. package/src/handlers/gestures/flingGesture.ts +27 -0
  780. package/src/handlers/gestures/forceTouchGesture.ts +74 -0
  781. package/src/handlers/gestures/gesture.ts +341 -0
  782. package/src/handlers/gestures/gestureComposition.ts +122 -0
  783. package/src/handlers/gestures/gestureObjects.ts +84 -0
  784. package/src/handlers/gestures/gestureStateManager.ts +62 -0
  785. package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
  786. package/src/handlers/gestures/hoverGesture.ts +83 -0
  787. package/src/handlers/gestures/longPressGesture.ts +28 -0
  788. package/src/handlers/gestures/manualGesture.ts +31 -0
  789. package/src/handlers/gestures/nativeGesture.ts +27 -0
  790. package/src/handlers/gestures/panGesture.ts +152 -0
  791. package/src/handlers/gestures/pinchGesture.ts +51 -0
  792. package/src/handlers/gestures/reanimatedWrapper.ts +56 -0
  793. package/src/handlers/gestures/rotationGesture.ts +51 -0
  794. package/src/handlers/gestures/tapGesture.ts +53 -0
  795. package/src/handlers/handlersRegistry.ts +60 -0
  796. package/src/index.ts +174 -0
  797. package/src/init.ts +18 -0
  798. package/src/jestUtils/index.ts +1 -0
  799. package/src/jestUtils/jestUtils.ts +505 -0
  800. package/src/mocks.ts +67 -0
  801. package/src/specs/RNGestureHandlerButtonNativeComponent.kepler.ts +27 -0
  802. package/src/specs/RNGestureHandlerButtonNativeComponent.ts +20 -0
  803. package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +7 -0
  804. package/src/typeUtils.ts +1 -0
  805. package/src/utils.ts +62 -0
  806. package/src/web/constants.ts +8 -0
  807. package/src/web/detectors/RotationGestureDetector.ts +168 -0
  808. package/src/web/detectors/ScaleGestureDetector.ts +172 -0
  809. package/src/web/handlers/FlingGestureHandler.ts +161 -0
  810. package/src/web/handlers/GestureHandler.ts +850 -0
  811. package/src/web/handlers/HoverGestureHandler.ts +43 -0
  812. package/src/web/handlers/LongPressGestureHandler.ts +125 -0
  813. package/src/web/handlers/ManualGestureHandler.ts +43 -0
  814. package/src/web/handlers/NativeViewGestureHandler.ts +167 -0
  815. package/src/web/handlers/PanGestureHandler.ts +485 -0
  816. package/src/web/handlers/PinchGestureHandler.ts +158 -0
  817. package/src/web/handlers/RotationGestureHandler.ts +172 -0
  818. package/src/web/handlers/TapGestureHandler.ts +273 -0
  819. package/src/web/interfaces.ts +166 -0
  820. package/src/web/tools/CircularBuffer.ts +42 -0
  821. package/src/web/tools/EventManager.ts +104 -0
  822. package/src/web/tools/GestureHandlerDelegate.ts +23 -0
  823. package/src/web/tools/GestureHandlerOrchestrator.ts +398 -0
  824. package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
  825. package/src/web/tools/InteractionManager.ts +123 -0
  826. package/src/web/tools/LeastSquareSolver.ts +182 -0
  827. package/src/web/tools/NodeManager.ts +43 -0
  828. package/src/web/tools/PointerEventManager.ts +193 -0
  829. package/src/web/tools/PointerTracker.ts +240 -0
  830. package/src/web/tools/TouchEventManager.ts +167 -0
  831. package/src/web/tools/VelocityTracker.ts +98 -0
  832. package/src/web/utils.ts +8 -0
  833. package/src/web_hammer/DiscreteGestureHandler.ts +82 -0
  834. package/src/web_hammer/DraggingGestureHandler.ts +34 -0
  835. package/src/web_hammer/Errors.ts +7 -0
  836. package/src/web_hammer/FlingGestureHandler.ts +134 -0
  837. package/src/web_hammer/GestureHandler.ts +598 -0
  838. package/src/web_hammer/IndiscreteGestureHandler.ts +33 -0
  839. package/src/web_hammer/LongPressGestureHandler.ts +56 -0
  840. package/src/web_hammer/NativeViewGestureHandler.ts +47 -0
  841. package/src/web_hammer/NodeManager.ts +42 -0
  842. package/src/web_hammer/PanGestureHandler.ts +226 -0
  843. package/src/web_hammer/PinchGestureHandler.ts +25 -0
  844. package/src/web_hammer/PressGestureHandler.ts +167 -0
  845. package/src/web_hammer/RotationGestureHandler.ts +25 -0
  846. package/src/web_hammer/TapGestureHandler.ts +172 -0
  847. package/src/web_hammer/constants.ts +48 -0
  848. package/src/web_hammer/utils.ts +24 -0
@@ -0,0 +1,244 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import * as React from 'react';
6
+ import { Component } from 'react';
7
+ import { Animated, Platform } from 'react-native';
8
+ import { State } from '../../State';
9
+ import { BaseButton } from '../GestureButtons';
10
+ /**
11
+ * Each touchable is a states' machine which preforms transitions.
12
+ * On very beginning (and on the very end or recognition) touchable is
13
+ * UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger
14
+ * travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition
15
+ * finishes in UNDETERMINED state.
16
+ */
17
+ export const TOUCHABLE_STATE = {
18
+ UNDETERMINED: 0,
19
+ BEGAN: 1,
20
+ MOVED_OUTSIDE: 2
21
+ };
22
+
23
+ // TODO: maybe can be better
24
+ // TODO: all clearTimeout have ! added, maybe they shouldn't ?
25
+
26
+ /**
27
+ * GenericTouchable is not intented to be used as it is.
28
+ * Should be treated as a source for the rest of touchables
29
+ */
30
+
31
+ export default class GenericTouchable extends Component {
32
+ constructor(...args) {
33
+ super(...args);
34
+ // timeout handlers
35
+ _defineProperty(this, "pressInTimeout", void 0);
36
+ _defineProperty(this, "pressOutTimeout", void 0);
37
+ _defineProperty(this, "longPressTimeout", void 0);
38
+ // This flag is required since recognition of longPress implies not-invoking onPress
39
+ _defineProperty(this, "longPressDetected", false);
40
+ _defineProperty(this, "pointerInside", true);
41
+ // State of touchable
42
+ _defineProperty(this, "STATE", TOUCHABLE_STATE.UNDETERMINED);
43
+ _defineProperty(this, "onGestureEvent", ({
44
+ nativeEvent: {
45
+ pointerInside
46
+ }
47
+ }) => {
48
+ if (this.pointerInside !== pointerInside) {
49
+ if (pointerInside) {
50
+ this.onMoveIn();
51
+ } else {
52
+ this.onMoveOut();
53
+ }
54
+ }
55
+ this.pointerInside = pointerInside;
56
+ });
57
+ _defineProperty(this, "onHandlerStateChange", ({
58
+ nativeEvent
59
+ }) => {
60
+ const {
61
+ state
62
+ } = nativeEvent;
63
+ if (state === State.CANCELLED || state === State.FAILED) {
64
+ // Need to handle case with external cancellation (e.g. by ScrollView)
65
+ this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
66
+ } else if (
67
+ // This platform check is an implication of slightly different behavior of handlers on different platform.
68
+ // And Android "Active" state is achieving on first move of a finger, not on press in.
69
+ // On iOS event on "Began" is not delivered.
70
+ state === (Platform.OS !== 'android' ? State.ACTIVE : State.BEGAN) && this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
71
+ // Moving inside requires
72
+ this.handlePressIn();
73
+ } else if (state === State.END) {
74
+ const shouldCallOnPress = !this.longPressDetected && this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE && this.pressOutTimeout === null;
75
+ this.handleGoToUndetermined();
76
+ if (shouldCallOnPress) {
77
+ var _this$props$onPress, _this$props;
78
+ // Calls only inside component whether no long press was called previously
79
+ (_this$props$onPress = (_this$props = this.props).onPress) === null || _this$props$onPress === void 0 || _this$props$onPress.call(_this$props);
80
+ }
81
+ }
82
+ });
83
+ _defineProperty(this, "onLongPressDetected", () => {
84
+ var _this$props$onLongPre, _this$props2;
85
+ this.longPressDetected = true;
86
+ // checked for in the caller of `onLongPressDetected`, but better to check twice
87
+ (_this$props$onLongPre = (_this$props2 = this.props).onLongPress) === null || _this$props$onLongPre === void 0 || _this$props$onLongPre.call(_this$props2);
88
+ });
89
+ }
90
+ // handlePressIn in called on first touch on traveling inside component.
91
+ // Handles state transition with delay.
92
+ handlePressIn() {
93
+ if (this.props.delayPressIn) {
94
+ this.pressInTimeout = setTimeout(() => {
95
+ this.moveToState(TOUCHABLE_STATE.BEGAN);
96
+ this.pressInTimeout = null;
97
+ }, this.props.delayPressIn);
98
+ } else {
99
+ this.moveToState(TOUCHABLE_STATE.BEGAN);
100
+ }
101
+ if (this.props.onLongPress) {
102
+ const time = (this.props.delayPressIn || 0) + (this.props.delayLongPress || 0);
103
+ this.longPressTimeout = setTimeout(this.onLongPressDetected, time);
104
+ }
105
+ }
106
+ // handleMoveOutside in called on traveling outside component.
107
+ // Handles state transition with delay.
108
+ handleMoveOutside() {
109
+ if (this.props.delayPressOut) {
110
+ this.pressOutTimeout = this.pressOutTimeout || setTimeout(() => {
111
+ this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);
112
+ this.pressOutTimeout = null;
113
+ }, this.props.delayPressOut);
114
+ } else {
115
+ this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);
116
+ }
117
+ }
118
+
119
+ // handleGoToUndetermined transits to UNDETERMINED state with proper delay
120
+ handleGoToUndetermined() {
121
+ clearTimeout(this.pressOutTimeout); // TODO: maybe it can be undefined
122
+ if (this.props.delayPressOut) {
123
+ this.pressOutTimeout = setTimeout(() => {
124
+ if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
125
+ this.moveToState(TOUCHABLE_STATE.BEGAN);
126
+ }
127
+ this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
128
+ this.pressOutTimeout = null;
129
+ }, this.props.delayPressOut);
130
+ } else {
131
+ if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
132
+ this.moveToState(TOUCHABLE_STATE.BEGAN);
133
+ }
134
+ this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
135
+ }
136
+ }
137
+ componentDidMount() {
138
+ this.reset();
139
+ }
140
+ // reset timeout to prevent memory leaks.
141
+ reset() {
142
+ this.longPressDetected = false;
143
+ this.pointerInside = true;
144
+ clearTimeout(this.pressInTimeout);
145
+ clearTimeout(this.pressOutTimeout);
146
+ clearTimeout(this.longPressTimeout);
147
+ this.pressOutTimeout = null;
148
+ this.longPressTimeout = null;
149
+ this.pressInTimeout = null;
150
+ }
151
+
152
+ // All states' transitions are defined here.
153
+ moveToState(newState) {
154
+ var _this$props$onStateCh, _this$props6;
155
+ if (newState === this.STATE) {
156
+ // Ignore dummy transitions
157
+ return;
158
+ }
159
+ if (newState === TOUCHABLE_STATE.BEGAN) {
160
+ var _this$props$onPressIn, _this$props3;
161
+ // First touch and moving inside
162
+ (_this$props$onPressIn = (_this$props3 = this.props).onPressIn) === null || _this$props$onPressIn === void 0 || _this$props$onPressIn.call(_this$props3);
163
+ } else if (newState === TOUCHABLE_STATE.MOVED_OUTSIDE) {
164
+ var _this$props$onPressOu, _this$props4;
165
+ // Moving outside
166
+ (_this$props$onPressOu = (_this$props4 = this.props).onPressOut) === null || _this$props$onPressOu === void 0 || _this$props$onPressOu.call(_this$props4);
167
+ } else if (newState === TOUCHABLE_STATE.UNDETERMINED) {
168
+ // Need to reset each time on transition to UNDETERMINED
169
+ this.reset();
170
+ if (this.STATE === TOUCHABLE_STATE.BEGAN) {
171
+ var _this$props$onPressOu2, _this$props5;
172
+ // ... and if it happens inside button.
173
+ (_this$props$onPressOu2 = (_this$props5 = this.props).onPressOut) === null || _this$props$onPressOu2 === void 0 || _this$props$onPressOu2.call(_this$props5);
174
+ }
175
+ }
176
+ // Finally call lister (used by subclasses)
177
+ (_this$props$onStateCh = (_this$props6 = this.props).onStateChange) === null || _this$props$onStateCh === void 0 || _this$props$onStateCh.call(_this$props6, this.STATE, newState);
178
+ // ... and make transition.
179
+ this.STATE = newState;
180
+ }
181
+ componentWillUnmount() {
182
+ // to prevent memory leaks
183
+ this.reset();
184
+ }
185
+ onMoveIn() {
186
+ if (this.STATE === TOUCHABLE_STATE.MOVED_OUTSIDE) {
187
+ // This call is not throttled with delays (like in RN's implementation).
188
+ this.moveToState(TOUCHABLE_STATE.BEGAN);
189
+ }
190
+ }
191
+ onMoveOut() {
192
+ // long press should no longer be detected
193
+ clearTimeout(this.longPressTimeout);
194
+ this.longPressTimeout = null;
195
+ if (this.STATE === TOUCHABLE_STATE.BEGAN) {
196
+ this.handleMoveOutside();
197
+ }
198
+ }
199
+ render() {
200
+ var _ref, _this$props$touchSoun;
201
+ const hitSlop = (_ref = typeof this.props.hitSlop === 'number' ? {
202
+ top: this.props.hitSlop,
203
+ left: this.props.hitSlop,
204
+ bottom: this.props.hitSlop,
205
+ right: this.props.hitSlop
206
+ } : this.props.hitSlop) !== null && _ref !== void 0 ? _ref : undefined;
207
+ const coreProps = {
208
+ accessible: this.props.accessible !== false,
209
+ accessibilityLabel: this.props.accessibilityLabel,
210
+ accessibilityHint: this.props.accessibilityHint,
211
+ accessibilityRole: this.props.accessibilityRole,
212
+ // TODO: check if changed to no 's' correctly, also removed 2 props that are no longer available: `accessibilityComponentType` and `accessibilityTraits`,
213
+ // would be good to check if it is ok for sure, see: https://github.com/facebook/react-native/issues/24016
214
+ accessibilityState: this.props.accessibilityState,
215
+ accessibilityActions: this.props.accessibilityActions,
216
+ onAccessibilityAction: this.props.onAccessibilityAction,
217
+ nativeID: this.props.nativeID,
218
+ onLayout: this.props.onLayout
219
+ };
220
+ return /*#__PURE__*/React.createElement(BaseButton, _extends({
221
+ style: this.props.containerStyle,
222
+ onHandlerStateChange:
223
+ // TODO: not sure if it can be undefined instead of null
224
+ this.props.disabled ? undefined : this.onHandlerStateChange,
225
+ onGestureEvent: this.onGestureEvent,
226
+ hitSlop: hitSlop,
227
+ shouldActivateOnStart: this.props.shouldActivateOnStart,
228
+ disallowInterruption: this.props.disallowInterruption,
229
+ testID: this.props.testID,
230
+ touchSoundDisabled: (_this$props$touchSoun = this.props.touchSoundDisabled) !== null && _this$props$touchSoun !== void 0 ? _this$props$touchSoun : false,
231
+ enabled: !this.props.disabled
232
+ }, this.props.extraButtonProps), /*#__PURE__*/React.createElement(Animated.View, _extends({}, coreProps, {
233
+ style: this.props.style
234
+ }), this.props.children));
235
+ }
236
+ }
237
+ _defineProperty(GenericTouchable, "defaultProps", {
238
+ delayLongPress: 600,
239
+ extraButtonProps: {
240
+ rippleColor: 'transparent',
241
+ exclusive: true
242
+ }
243
+ });
244
+ //# sourceMappingURL=GenericTouchable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Component","Animated","Platform","State","BaseButton","TOUCHABLE_STATE","UNDETERMINED","BEGAN","MOVED_OUTSIDE","GenericTouchable","constructor","args","_defineProperty","nativeEvent","pointerInside","onMoveIn","onMoveOut","state","CANCELLED","FAILED","moveToState","OS","ACTIVE","STATE","handlePressIn","END","shouldCallOnPress","longPressDetected","pressOutTimeout","handleGoToUndetermined","_this$props$onPress","_this$props","props","onPress","call","_this$props$onLongPre","_this$props2","onLongPress","delayPressIn","pressInTimeout","setTimeout","time","delayLongPress","longPressTimeout","onLongPressDetected","handleMoveOutside","delayPressOut","clearTimeout","componentDidMount","reset","newState","_this$props$onStateCh","_this$props6","_this$props$onPressIn","_this$props3","onPressIn","_this$props$onPressOu","_this$props4","onPressOut","_this$props$onPressOu2","_this$props5","onStateChange","componentWillUnmount","render","_ref","_this$props$touchSoun","hitSlop","top","left","bottom","right","undefined","coreProps","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","accessibilityState","accessibilityActions","onAccessibilityAction","nativeID","onLayout","createElement","_extends","style","containerStyle","onHandlerStateChange","disabled","onGestureEvent","shouldActivateOnStart","disallowInterruption","testID","touchSoundDisabled","enabled","extraButtonProps","View","children","rippleColor","exclusive"],"sources":["GenericTouchable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Component } from 'react';\nimport {\n Animated,\n Platform,\n StyleProp,\n ViewStyle,\n TouchableWithoutFeedbackProps,\n Insets,\n} from 'react-native';\n\nimport { State } from '../../State';\nimport { BaseButton } from '../GestureButtons';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../../handlers/gestureHandlerCommon';\nimport { NativeViewGestureHandlerPayload } from '../../handlers/NativeViewGestureHandler';\nimport { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedback.android';\n\n/**\n * Each touchable is a states' machine which preforms transitions.\n * On very beginning (and on the very end or recognition) touchable is\n * UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger\n * travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition\n * finishes in UNDETERMINED state.\n */\nexport const TOUCHABLE_STATE = {\n UNDETERMINED: 0,\n BEGAN: 1,\n MOVED_OUTSIDE: 2,\n} as const;\n\ntype TouchableState = typeof TOUCHABLE_STATE[keyof typeof TOUCHABLE_STATE];\n\nexport interface GenericTouchableProps\n extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {\n // Decided to drop not used fields from RN's implementation.\n // e.g. onBlur and onFocus as well as deprecated props. - TODO: this comment may be unuseful in this moment\n\n // TODO: in RN these events get native event parameter, which prolly could be used in our implementation too\n onPress?: () => void;\n onPressIn?: () => void;\n onPressOut?: () => void;\n onLongPress?: () => void;\n\n nativeID?: string;\n shouldActivateOnStart?: boolean;\n disallowInterruption?: boolean;\n\n containerStyle?: StyleProp<ViewStyle>;\n hitSlop?: Insets | number;\n}\n\ninterface InternalProps {\n extraButtonProps: TouchableNativeFeedbackExtraProps;\n onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;\n}\n\n// TODO: maybe can be better\n// TODO: all clearTimeout have ! added, maybe they shouldn't ?\ntype Timeout = ReturnType<typeof setTimeout> | null | undefined;\n\n/**\n * GenericTouchable is not intented to be used as it is.\n * Should be treated as a source for the rest of touchables\n */\n\nexport default class GenericTouchable extends Component<\n GenericTouchableProps & InternalProps\n> {\n static defaultProps = {\n delayLongPress: 600,\n extraButtonProps: {\n rippleColor: 'transparent',\n exclusive: true,\n },\n };\n\n // timeout handlers\n pressInTimeout: Timeout;\n pressOutTimeout: Timeout;\n longPressTimeout: Timeout;\n\n // This flag is required since recognition of longPress implies not-invoking onPress\n longPressDetected = false;\n\n pointerInside = true;\n\n // State of touchable\n STATE: TouchableState = TOUCHABLE_STATE.UNDETERMINED;\n\n // handlePressIn in called on first touch on traveling inside component.\n // Handles state transition with delay.\n handlePressIn() {\n if (this.props.delayPressIn) {\n this.pressInTimeout = setTimeout(() => {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n this.pressInTimeout = null;\n }, this.props.delayPressIn);\n } else {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n if (this.props.onLongPress) {\n const time =\n (this.props.delayPressIn || 0) + (this.props.delayLongPress || 0);\n this.longPressTimeout = setTimeout(this.onLongPressDetected, time);\n }\n }\n // handleMoveOutside in called on traveling outside component.\n // Handles state transition with delay.\n handleMoveOutside() {\n if (this.props.delayPressOut) {\n this.pressOutTimeout =\n this.pressOutTimeout ||\n setTimeout(() => {\n this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);\n this.pressOutTimeout = null;\n }, this.props.delayPressOut);\n } else {\n this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);\n }\n }\n\n // handleGoToUndetermined transits to UNDETERMINED state with proper delay\n handleGoToUndetermined() {\n clearTimeout(this.pressOutTimeout!); // TODO: maybe it can be undefined\n if (this.props.delayPressOut) {\n this.pressOutTimeout = setTimeout(() => {\n if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n this.pressOutTimeout = null;\n }, this.props.delayPressOut);\n } else {\n if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n }\n }\n\n componentDidMount() {\n this.reset();\n }\n // reset timeout to prevent memory leaks.\n reset() {\n this.longPressDetected = false;\n this.pointerInside = true;\n clearTimeout(this.pressInTimeout!);\n clearTimeout(this.pressOutTimeout!);\n clearTimeout(this.longPressTimeout!);\n this.pressOutTimeout = null;\n this.longPressTimeout = null;\n this.pressInTimeout = null;\n }\n\n // All states' transitions are defined here.\n moveToState(newState: TouchableState) {\n if (newState === this.STATE) {\n // Ignore dummy transitions\n return;\n }\n if (newState === TOUCHABLE_STATE.BEGAN) {\n // First touch and moving inside\n this.props.onPressIn?.();\n } else if (newState === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n // Moving outside\n this.props.onPressOut?.();\n } else if (newState === TOUCHABLE_STATE.UNDETERMINED) {\n // Need to reset each time on transition to UNDETERMINED\n this.reset();\n if (this.STATE === TOUCHABLE_STATE.BEGAN) {\n // ... and if it happens inside button.\n this.props.onPressOut?.();\n }\n }\n // Finally call lister (used by subclasses)\n this.props.onStateChange?.(this.STATE, newState);\n // ... and make transition.\n this.STATE = newState;\n }\n\n onGestureEvent = ({\n nativeEvent: { pointerInside },\n }: GestureEvent<NativeViewGestureHandlerPayload>) => {\n if (this.pointerInside !== pointerInside) {\n if (pointerInside) {\n this.onMoveIn();\n } else {\n this.onMoveOut();\n }\n }\n this.pointerInside = pointerInside;\n };\n\n onHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<NativeViewGestureHandlerPayload>) => {\n const { state } = nativeEvent;\n if (state === State.CANCELLED || state === State.FAILED) {\n // Need to handle case with external cancellation (e.g. by ScrollView)\n this.moveToState(TOUCHABLE_STATE.UNDETERMINED);\n } else if (\n // This platform check is an implication of slightly different behavior of handlers on different platform.\n // And Android \"Active\" state is achieving on first move of a finger, not on press in.\n // On iOS event on \"Began\" is not delivered.\n state === (Platform.OS !== 'android' ? State.ACTIVE : State.BEGAN) &&\n this.STATE === TOUCHABLE_STATE.UNDETERMINED\n ) {\n // Moving inside requires\n this.handlePressIn();\n } else if (state === State.END) {\n const shouldCallOnPress =\n !this.longPressDetected &&\n this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE &&\n this.pressOutTimeout === null;\n this.handleGoToUndetermined();\n if (shouldCallOnPress) {\n // Calls only inside component whether no long press was called previously\n this.props.onPress?.();\n }\n }\n };\n\n onLongPressDetected = () => {\n this.longPressDetected = true;\n // checked for in the caller of `onLongPressDetected`, but better to check twice\n this.props.onLongPress?.();\n };\n\n componentWillUnmount() {\n // to prevent memory leaks\n this.reset();\n }\n\n onMoveIn() {\n if (this.STATE === TOUCHABLE_STATE.MOVED_OUTSIDE) {\n // This call is not throttled with delays (like in RN's implementation).\n this.moveToState(TOUCHABLE_STATE.BEGAN);\n }\n }\n\n onMoveOut() {\n // long press should no longer be detected\n clearTimeout(this.longPressTimeout!);\n this.longPressTimeout = null;\n if (this.STATE === TOUCHABLE_STATE.BEGAN) {\n this.handleMoveOutside();\n }\n }\n\n render() {\n const hitSlop =\n (typeof this.props.hitSlop === 'number'\n ? {\n top: this.props.hitSlop,\n left: this.props.hitSlop,\n bottom: this.props.hitSlop,\n right: this.props.hitSlop,\n }\n : this.props.hitSlop) ?? undefined;\n\n const coreProps = {\n accessible: this.props.accessible !== false,\n accessibilityLabel: this.props.accessibilityLabel,\n accessibilityHint: this.props.accessibilityHint,\n accessibilityRole: this.props.accessibilityRole,\n // TODO: check if changed to no 's' correctly, also removed 2 props that are no longer available: `accessibilityComponentType` and `accessibilityTraits`,\n // would be good to check if it is ok for sure, see: https://github.com/facebook/react-native/issues/24016\n accessibilityState: this.props.accessibilityState,\n accessibilityActions: this.props.accessibilityActions,\n onAccessibilityAction: this.props.onAccessibilityAction,\n nativeID: this.props.nativeID,\n onLayout: this.props.onLayout,\n };\n\n return (\n <BaseButton\n style={this.props.containerStyle}\n onHandlerStateChange={\n // TODO: not sure if it can be undefined instead of null\n this.props.disabled ? undefined : this.onHandlerStateChange\n }\n onGestureEvent={this.onGestureEvent}\n hitSlop={hitSlop}\n shouldActivateOnStart={this.props.shouldActivateOnStart}\n disallowInterruption={this.props.disallowInterruption}\n testID={this.props.testID}\n touchSoundDisabled={this.props.touchSoundDisabled ?? false}\n enabled={!this.props.disabled}\n {...this.props.extraButtonProps}>\n <Animated.View {...coreProps} style={this.props.style}>\n {this.props.children}\n </Animated.View>\n </BaseButton>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,SACEC,QAAQ,EACRC,QAAQ,QAKH,cAAc;AAErB,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,UAAU,QAAQ,mBAAmB;AAS9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG;EAC7BC,YAAY,EAAE,CAAC;EACfC,KAAK,EAAE,CAAC;EACRC,aAAa,EAAE;AACj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AEY,KAAK,EAAE,IAAI,CAACpD,KAAK,CAACoD;IAAM,IACnD,IAAI,CAACpD,KAAK,CAACgE,QACC,CACL,CAAC;EAEjB;AACF;AAACpF,eAAA,CAvOoBH,gBAAgB,kBAGb;EACpBiC,cAAc,EAAE,GAAG;EACnBoD,gBAAgB,EAAE;IAChBG,WAAW,EAAE,aAAa;IAC1BC,SAAS,EAAE;EACb;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import * as React from 'react';
6
+ import { Component } from 'react';
7
+ import GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';
8
+ import { StyleSheet, View } from 'react-native';
9
+ /**
10
+ * TouchableHighlight follows RN's implementation
11
+ */
12
+ export default class TouchableHighlight extends Component {
13
+ constructor(props) {
14
+ super(props);
15
+ // Copied from RN
16
+ _defineProperty(this, "showUnderlay", () => {
17
+ var _this$props$onShowUnd, _this$props;
18
+ if (!this.hasPressHandler()) {
19
+ return;
20
+ }
21
+ this.setState({
22
+ extraChildStyle: {
23
+ opacity: this.props.activeOpacity
24
+ },
25
+ extraUnderlayStyle: {
26
+ backgroundColor: this.props.underlayColor
27
+ }
28
+ });
29
+ (_this$props$onShowUnd = (_this$props = this.props).onShowUnderlay) === null || _this$props$onShowUnd === void 0 || _this$props$onShowUnd.call(_this$props);
30
+ });
31
+ _defineProperty(this, "hasPressHandler", () => this.props.onPress || this.props.onPressIn || this.props.onPressOut || this.props.onLongPress);
32
+ _defineProperty(this, "hideUnderlay", () => {
33
+ var _this$props$onHideUnd, _this$props2;
34
+ this.setState({
35
+ extraChildStyle: null,
36
+ extraUnderlayStyle: null
37
+ });
38
+ (_this$props$onHideUnd = (_this$props2 = this.props).onHideUnderlay) === null || _this$props$onHideUnd === void 0 || _this$props$onHideUnd.call(_this$props2);
39
+ });
40
+ _defineProperty(this, "onStateChange", (_from, to) => {
41
+ if (to === TOUCHABLE_STATE.BEGAN) {
42
+ this.showUnderlay();
43
+ } else if (to === TOUCHABLE_STATE.UNDETERMINED || to === TOUCHABLE_STATE.MOVED_OUTSIDE) {
44
+ this.hideUnderlay();
45
+ }
46
+ });
47
+ this.state = {
48
+ extraChildStyle: null,
49
+ extraUnderlayStyle: null
50
+ };
51
+ }
52
+ renderChildren() {
53
+ if (!this.props.children) {
54
+ return /*#__PURE__*/React.createElement(View, null);
55
+ }
56
+ const child = React.Children.only(this.props.children); // TODO: not sure if OK but fixes error
57
+ return /*#__PURE__*/React.cloneElement(child, {
58
+ style: StyleSheet.compose(child.props.style, this.state.extraChildStyle)
59
+ });
60
+ }
61
+ render() {
62
+ const {
63
+ style = {},
64
+ ...rest
65
+ } = this.props;
66
+ const {
67
+ extraUnderlayStyle
68
+ } = this.state;
69
+ return /*#__PURE__*/React.createElement(GenericTouchable, _extends({}, rest, {
70
+ style: [style, extraUnderlayStyle],
71
+ onStateChange: this.onStateChange
72
+ }), this.renderChildren());
73
+ }
74
+ }
75
+ _defineProperty(TouchableHighlight, "defaultProps", {
76
+ ...GenericTouchable.defaultProps,
77
+ activeOpacity: 0.85,
78
+ delayPressOut: 100,
79
+ underlayColor: 'black'
80
+ });
81
+ //# sourceMappingURL=TouchableHighlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Component","GenericTouchable","TOUCHABLE_STATE","StyleSheet","View","TouchableHighlight","constructor","props","_defineProperty","_this$props$onShowUnd","_this$props","hasPressHandler","setState","extraChildStyle","opacity","activeOpacity","extraUnderlayStyle","backgroundColor","underlayColor","onShowUnderlay","call","onPress","onPressIn","onPressOut","onLongPress","_this$props$onHideUnd","_this$props2","onHideUnderlay","_from","to","BEGAN","showUnderlay","UNDETERMINED","MOVED_OUTSIDE","hideUnderlay","state","renderChildren","children","createElement","child","Children","only","cloneElement","style","compose","render","rest","_extends","onStateChange","defaultProps","delayPressOut"],"sources":["TouchableHighlight.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Component } from 'react';\nimport GenericTouchable, {\n GenericTouchableProps,\n TOUCHABLE_STATE,\n} from './GenericTouchable';\nimport {\n StyleSheet,\n View,\n TouchableHighlightProps as RNTouchableHighlightProps,\n ColorValue,\n ViewProps,\n} from 'react-native';\n\ninterface State {\n extraChildStyle: null | {\n opacity?: number;\n };\n extraUnderlayStyle: null | {\n backgroundColor?: ColorValue;\n };\n}\n\nexport type TouchableHighlightProps = RNTouchableHighlightProps &\n GenericTouchableProps;\n\n/**\n * TouchableHighlight follows RN's implementation\n */\nexport default class TouchableHighlight extends Component<\n TouchableHighlightProps,\n State\n> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n activeOpacity: 0.85,\n delayPressOut: 100,\n underlayColor: 'black',\n };\n\n constructor(props: TouchableHighlightProps) {\n super(props);\n this.state = {\n extraChildStyle: null,\n extraUnderlayStyle: null,\n };\n }\n\n // Copied from RN\n showUnderlay = () => {\n if (!this.hasPressHandler()) {\n return;\n }\n this.setState({\n extraChildStyle: {\n opacity: this.props.activeOpacity,\n },\n extraUnderlayStyle: {\n backgroundColor: this.props.underlayColor,\n },\n });\n this.props.onShowUnderlay?.();\n };\n\n hasPressHandler = () =>\n this.props.onPress ||\n this.props.onPressIn ||\n this.props.onPressOut ||\n this.props.onLongPress;\n\n hideUnderlay = () => {\n this.setState({\n extraChildStyle: null,\n extraUnderlayStyle: null,\n });\n this.props.onHideUnderlay?.();\n };\n\n renderChildren() {\n if (!this.props.children) {\n return <View />;\n }\n\n const child = React.Children.only(\n this.props.children\n ) as React.ReactElement<ViewProps>; // TODO: not sure if OK but fixes error\n return React.cloneElement(child, {\n style: StyleSheet.compose(child.props.style, this.state.extraChildStyle),\n });\n }\n\n onStateChange = (_from: number, to: number) => {\n if (to === TOUCHABLE_STATE.BEGAN) {\n this.showUnderlay();\n } else if (\n to === TOUCHABLE_STATE.UNDETERMINED ||\n to === TOUCHABLE_STATE.MOVED_OUTSIDE\n ) {\n this.hideUnderlay();\n }\n };\n\n render() {\n const { style = {}, ...rest } = this.props;\n const { extraUnderlayStyle } = this.state;\n return (\n <GenericTouchable\n {...rest}\n style={[style, extraUnderlayStyle]}\n onStateChange={this.onStateChange}>\n {this.renderChildren()}\n </GenericTouchable>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,OAAOC,gBAAgB,IAErBC,eAAe,QACV,oBAAoB;AAC3B,SACEC,UAAU,EACVC,IAAI,QAIC,cAAc;AAcrB;AACA;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASL,SAAS,CAGvD;EAQAM,WAAWA,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;IAOd;IAAAC,eAAA,uBACe,MAAM;MAAA,IAAAC,qBAAA,EAAAC,WAAA;MACnB,IAAI,CAAC,IAAI,CAACC,eAAe,CAAC,CAAC,EAAE;QAC3B;MACF;MACA,IAAI,CAACC,QAAQ,CAAC;QACZC,eAAe,EAAE;UACfC,OAAO,EAAE,IAAI,CAACP,KAAK,CAACQ;QACtB,CAAC;QACDC,kBAAkB,EAAE;UAClBC,eAAe,EAAE,IAAI,CAACV,KAAK,CAACW;QAC9B;MACF,CAAC,CAAC;MACF,CAAAT,qBAAA,IA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8B,QACb,CAAkC,CAAC,CAAC;IACpC,oBAAOtC,KAAK,CAAC2C,YAAY,CAACH,KAAK,EAAE;MAC/BI,KAAK,EAAExC,UAAU,CAACyC,OAAO,CAACL,KAAK,CAAChC,KAAK,CAACoC,KAAK,EAAE,IAAI,CAACR,KAAK,CAACtB,eAAe;IACzE,CAAC,CAAC;EACJ;EAaAgC,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEF,KAAK,GAAG,CAAC,CAAC;MAAE,GAAGG;IAAK,CAAC,GAAG,IAAI,CAACvC,KAAK;IAC1C,MAAM;MAAES;IAAmB,CAAC,GAAG,IAAI,CAACmB,KAAK;IACzC,oBACEpC,KAAA,CAAAuC,aAAA,CAACrC,gBAAgB,EAAA8C,QAAA,KACXD,IAAI;MACRH,KAAK,EAAE,CAACA,KAAK,EAAE3B,kBAAkB,CAAE;MACnCgC,aAAa,EAAE,IAAI,CAACA;IAAc,IACjC,IAAI,CAACZ,cAAc,CAAC,CACL,CAAC;EAEvB;AACF;AAAC5B,eAAA,CArFoBH,kBAAkB,kBAIf;EACpB,GAAGJ,gBAAgB,CAACgD,YAAY;EAChClC,aAAa,EAAE,IAAI;EACnBmC,aAAa,EAAE,GAAG;EAClBhC,aAAa,EAAE;AACjB,CAAC","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import { Platform } from 'react-native';
6
+ import * as React from 'react';
7
+ import { Component } from 'react';
8
+ import GenericTouchable from './GenericTouchable';
9
+ /**
10
+ * TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
11
+ * There's small difference with handling long press ripple since RN's implementation calls
12
+ * ripple animation via bridge. This solution leaves all animations' handling for native components so
13
+ * it follows native behaviours.
14
+ */
15
+ export default class TouchableNativeFeedback extends Component {
16
+ getExtraButtonProps() {
17
+ const extraProps = {};
18
+ const {
19
+ background
20
+ } = this.props;
21
+ if (background) {
22
+ // I changed type values to match those used in RN
23
+ // TODO(TS): check if it works the same as previous implementation - looks like it works the same as RN component, so it should be ok
24
+ if (background.type === 'RippleAndroid') {
25
+ extraProps['borderless'] = background.borderless;
26
+ extraProps['rippleColor'] = background.color;
27
+ } else if (background.type === 'ThemeAttrAndroid') {
28
+ extraProps['borderless'] = background.attribute === 'selectableItemBackgroundBorderless';
29
+ }
30
+ // I moved it from above since it should be available in all options
31
+ extraProps['rippleRadius'] = background.rippleRadius;
32
+ }
33
+ extraProps['foreground'] = this.props.useForeground;
34
+ return extraProps;
35
+ }
36
+ render() {
37
+ const {
38
+ style = {},
39
+ ...rest
40
+ } = this.props;
41
+ return /*#__PURE__*/React.createElement(GenericTouchable, _extends({}, rest, {
42
+ style: style,
43
+ extraButtonProps: this.getExtraButtonProps()
44
+ }));
45
+ }
46
+ }
47
+ _defineProperty(TouchableNativeFeedback, "defaultProps", {
48
+ ...GenericTouchable.defaultProps,
49
+ useForeground: true,
50
+ extraButtonProps: {
51
+ // Disable hiding ripple on Android
52
+ rippleColor: null
53
+ }
54
+ });
55
+ // could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change
56
+ _defineProperty(TouchableNativeFeedback, "SelectableBackground", rippleRadius => ({
57
+ type: 'ThemeAttrAndroid',
58
+ // I added `attribute` prop to clone the implementation of RN and be able to use only 2 types
59
+ attribute: 'selectableItemBackground',
60
+ rippleRadius
61
+ }));
62
+ _defineProperty(TouchableNativeFeedback, "SelectableBackgroundBorderless", rippleRadius => ({
63
+ type: 'ThemeAttrAndroid',
64
+ attribute: 'selectableItemBackgroundBorderless',
65
+ rippleRadius
66
+ }));
67
+ _defineProperty(TouchableNativeFeedback, "Ripple", (color, borderless, rippleRadius) => ({
68
+ type: 'RippleAndroid',
69
+ color,
70
+ borderless,
71
+ rippleRadius
72
+ }));
73
+ _defineProperty(TouchableNativeFeedback, "canUseNativeForeground", () => parseInt(Platform.Version.toString()) >= 23);
74
+ //# sourceMappingURL=TouchableNativeFeedback.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","React","Component","GenericTouchable","TouchableNativeFeedback","getExtraButtonProps","extraProps","background","props","type","borderless","color","attribute","rippleRadius","useForeground","render","style","rest","createElement","_extends","extraButtonProps","_defineProperty","defaultProps","rippleColor","parseInt","Version","toString"],"sources":["TouchableNativeFeedback.android.tsx"],"sourcesContent":["import {\n Platform,\n TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps,\n ColorValue,\n} from 'react-native';\nimport * as React from 'react';\nimport { Component } from 'react';\nimport GenericTouchable, { GenericTouchableProps } from './GenericTouchable';\n\nexport type TouchableNativeFeedbackExtraProps = {\n borderless?: boolean;\n rippleColor?: number | null;\n rippleRadius?: number | null;\n foreground?: boolean;\n};\n\nexport type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps &\n GenericTouchableProps;\n\n/**\n * TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.\n * There's small difference with handling long press ripple since RN's implementation calls\n * ripple animation via bridge. This solution leaves all animations' handling for native components so\n * it follows native behaviours.\n */\nexport default class TouchableNativeFeedback extends Component<TouchableNativeFeedbackProps> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n useForeground: true,\n extraButtonProps: {\n // Disable hiding ripple on Android\n rippleColor: null,\n },\n };\n\n // could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change\n static SelectableBackground = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n // I added `attribute` prop to clone the implementation of RN and be able to use only 2 types\n attribute: 'selectableItemBackground',\n rippleRadius,\n });\n static SelectableBackgroundBorderless = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n attribute: 'selectableItemBackgroundBorderless',\n rippleRadius,\n });\n static Ripple = (\n color: ColorValue,\n borderless: boolean,\n rippleRadius?: number\n ) => ({\n type: 'RippleAndroid',\n color,\n borderless,\n rippleRadius,\n });\n\n static canUseNativeForeground = () =>\n parseInt(Platform.Version.toString()) >= 23;\n\n getExtraButtonProps() {\n const extraProps: TouchableNativeFeedbackExtraProps = {};\n const { background } = this.props;\n if (background) {\n // I changed type values to match those used in RN\n // TODO(TS): check if it works the same as previous implementation - looks like it works the same as RN component, so it should be ok\n if (background.type === 'RippleAndroid') {\n extraProps['borderless'] = background.borderless;\n extraProps['rippleColor'] = background.color;\n } else if (background.type === 'ThemeAttrAndroid') {\n extraProps['borderless'] =\n background.attribute === 'selectableItemBackgroundBorderless';\n }\n // I moved it from above since it should be available in all options\n extraProps['rippleRadius'] = background.rippleRadius;\n }\n extraProps['foreground'] = this.props.useForeground;\n return extraProps;\n }\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n <GenericTouchable\n {...rest}\n style={style}\n extraButtonProps={this.getExtraButtonProps()}\n />\n );\n }\n}\n"],"mappings":";;;;AAAA,SACEA,QAAQ,QAGH,cAAc;AACrB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AACjC,OAAOC,gBAAgB,MAAiC,oBAAoB;AAY5E;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,uBAAuB,SAASF,SAAS,CAA+B;EAoC3FG,mBAAmBA,CAAA,EAAG;IACpB,MAAMC,UAA6C,GAAG,CAAC,CAAC;IACxD,MAAM;MAAEC;IAAW,C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AAoC;EAC/CC;AACF,CAAC,CAAC;AAAAQ,eAAA,CArBiBjB,uBAAuB,YAsB1B,CACdO,KAAiB,EACjBD,UAAmB,EACnBG,YAAqB,MACjB;EACJJ,IAAI,EAAE,eAAe;EACrBE,KAAK;EACLD,UAAU;EACVG;AACF,CAAC,CAAC;AAAAQ,eAAA,CA/BiBjB,uBAAuB,4BAiCV,MAC9BoB,QAAQ,CAACxB,QAAQ,CAACyB,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { TouchableNativeFeedback } from 'react-native';
2
+ export default TouchableNativeFeedback;
3
+ //# sourceMappingURL=TouchableNativeFeedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TouchableNativeFeedback"],"sources":["TouchableNativeFeedback.tsx"],"sourcesContent":["import { TouchableNativeFeedback } from 'react-native';\n\nexport default TouchableNativeFeedback;\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,cAAc;AAEtD,eAAeA,uBAAuB","ignoreList":[]}
@@ -0,0 +1,55 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import { Animated, Easing, StyleSheet, View } from 'react-native';
6
+ import GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';
7
+ import * as React from 'react';
8
+ import { Component } from 'react';
9
+ /**
10
+ * TouchableOpacity bases on timing animation which has been used in RN's core
11
+ */
12
+ export default class TouchableOpacity extends Component {
13
+ constructor(...args) {
14
+ super(...args);
15
+ // opacity is 1 one by default but could be overwritten
16
+ _defineProperty(this, "getChildStyleOpacityWithDefault", () => {
17
+ const childStyle = StyleSheet.flatten(this.props.style) || {};
18
+ return childStyle.opacity == null ? 1 : childStyle.opacity.valueOf();
19
+ });
20
+ _defineProperty(this, "opacity", new Animated.Value(this.getChildStyleOpacityWithDefault()));
21
+ _defineProperty(this, "setOpacityTo", (value, duration) => {
22
+ var _this$props$useNative;
23
+ Animated.timing(this.opacity, {
24
+ toValue: value,
25
+ duration: duration,
26
+ easing: Easing.inOut(Easing.quad),
27
+ useNativeDriver: (_this$props$useNative = this.props.useNativeAnimations) !== null && _this$props$useNative !== void 0 ? _this$props$useNative : true
28
+ }).start();
29
+ });
30
+ _defineProperty(this, "onStateChange", (_from, to) => {
31
+ if (to === TOUCHABLE_STATE.BEGAN) {
32
+ this.setOpacityTo(this.props.activeOpacity, 0);
33
+ } else if (to === TOUCHABLE_STATE.UNDETERMINED || to === TOUCHABLE_STATE.MOVED_OUTSIDE) {
34
+ this.setOpacityTo(this.getChildStyleOpacityWithDefault(), 150);
35
+ }
36
+ });
37
+ }
38
+ render() {
39
+ const {
40
+ style = {},
41
+ ...rest
42
+ } = this.props;
43
+ return /*#__PURE__*/React.createElement(GenericTouchable, _extends({}, rest, {
44
+ style: [style, {
45
+ opacity: this.opacity // TODO: fix this
46
+ }],
47
+ onStateChange: this.onStateChange
48
+ }), this.props.children ? this.props.children : /*#__PURE__*/React.createElement(View, null));
49
+ }
50
+ }
51
+ _defineProperty(TouchableOpacity, "defaultProps", {
52
+ ...GenericTouchable.defaultProps,
53
+ activeOpacity: 0.2
54
+ });
55
+ //# sourceMappingURL=TouchableOpacity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Animated","Easing","StyleSheet","View","GenericTouchable","TOUCHABLE_STATE","React","Component","TouchableOpacity","constructor","args","_defineProperty","childStyle","flatten","props","style","opacity","valueOf","Value","getChildStyleOpacityWithDefault","value","duration","_this$props$useNative","timing","toValue","easing","inOut","quad","useNativeDriver","useNativeAnimations","start","_from","to","BEGAN","setOpacityTo","activeOpacity","UNDETERMINED","MOVED_OUTSIDE","render","rest","createElement","_extends","onStateChange","children","defaultProps"],"sources":["TouchableOpacity.tsx"],"sourcesContent":["import {\n Animated,\n Easing,\n StyleSheet,\n View,\n TouchableOpacityProps as RNTouchableOpacityProps,\n} from 'react-native';\nimport GenericTouchable, {\n TOUCHABLE_STATE,\n GenericTouchableProps,\n} from './GenericTouchable';\nimport * as React from 'react';\nimport { Component } from 'react';\n\nexport type TouchableOpacityProps = RNTouchableOpacityProps &\n GenericTouchableProps & {\n useNativeAnimations?: boolean;\n };\n\n/**\n * TouchableOpacity bases on timing animation which has been used in RN's core\n */\nexport default class TouchableOpacity extends Component<TouchableOpacityProps> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n activeOpacity: 0.2,\n };\n\n // opacity is 1 one by default but could be overwritten\n getChildStyleOpacityWithDefault = () => {\n const childStyle = StyleSheet.flatten(this.props.style) || {};\n return childStyle.opacity == null\n ? 1\n : (childStyle.opacity.valueOf() as number);\n };\n\n opacity = new Animated.Value(this.getChildStyleOpacityWithDefault());\n\n setOpacityTo = (value: number, duration: number) => {\n Animated.timing(this.opacity, {\n toValue: value,\n duration: duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: this.props.useNativeAnimations ?? true,\n }).start();\n };\n\n onStateChange = (_from: number, to: number) => {\n if (to === TOUCHABLE_STATE.BEGAN) {\n this.setOpacityTo(this.props.activeOpacity!, 0);\n } else if (\n to === TOUCHABLE_STATE.UNDETERMINED ||\n to === TOUCHABLE_STATE.MOVED_OUTSIDE\n ) {\n this.setOpacityTo(this.getChildStyleOpacityWithDefault(), 150);\n }\n };\n\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n <GenericTouchable\n {...rest}\n style={[\n style,\n {\n opacity: this.opacity as unknown as number, // TODO: fix this\n },\n ]}\n onStateChange={this.onStateChange}>\n {this.props.children ? this.props.children : <View />}\n </GenericTouchable>\n );\n }\n}\n"],"mappings":";;;;AAAA,SACEA,QAAQ,EACRC,MAAM,EACNC,UAAU,EACVC,IAAI,QAEC,cAAc;AACrB,OAAOC,gBAAgB,IACrBC,eAAe,QAEV,oBAAoB;AAC3B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,OAAO;AAOjC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAwB;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAM7E;IAAAC,eAAA,0CACkC,MAAM;MACtC,MAAMC,UAAU,GAAGV,UAAU,CAACW,OAAO,CAAC,IAAI,CAACC,KAAK,CAACC,KAAK,CAAC,IAAI,CAAC,CAAC;MAC7D,OAAOH,UAAU,CAACI,OAAO,IAAI,IAAI,GAC7B,CAAC,GACAJ,UAAU,CAACI,OAAO,CAACC,OAAO,CAAC,CAAY;IAC9C,CAAC;IAAAN,eAAA,kBAES,IAAIX,QAAQ,CAACkB,KAAK,CAAC,IAAI,CAACC,+BAA+B,CAAC,CAAC,CAAC;IAAAR,eAAA,uBAErD,CAACS,KAAa,EAAEC,QAAgB,KAAK;MAAA,IAAAC,qBAAA;MAClDtB,QAAQ,CAACuB,MAAM,CAAC,IAAI,CAACP,OAAO,EAAE;QAC5BQ,OAAO,EAAEJ,KAAK;QACdC,QAAQ,EAAEA,QAAQ;QAClBI,MAAM,EAAExB,MAAM,CAACyB,KAAK,CAACzB,MAAM,CAAC0B,IAAI,CAAC;QACjCC,eAAe,GAAAN,qBAAA,GAAE,IAAI,CAACR,KAAK,CAACe,mBAAmB,cAAAP,qBAAA,cAAAA,qBAAA,GAAI;MACrD,CAAC,CAAC,CAACQ,KAAK,CAAC,CAAC;IACZ,CAAC;IAAAnB,eAAA,wBAEe,CAACoB,KAAa,EAAEC,EAAU,KAAK;MAC7C,IAAIA,EAAE,KAAK3B,eAAe,CAAC4B,KAAK,EAAE;QAChC,IAAI,CAACC,YAAY,CAAC,IAAI,CAACpB,KAAK,CAACqB,aAAa,EAAG,CAAC,CAAC;MACjD,CAAC,MAAM,IACLH,EAAE,KAAK3B,eAAe,CAAC+B,YAAY,IACnCJ,EAAE,KAAK3B,eAAe,CAACgC,aAAa,EACpC;QACA,IAAI,CAACH,YAAY,CAAC,IAAI,CAACf,+BAA+B,CAAC,CAAC,EAAE,GAAG,CAAC;MAChE;IACF,CAAC;EAAA;EAEDmB,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEvB,KAAK,GAAG,CAAC,CAAC;MAAE,GAAGwB;IAAK,CAAC,GAAG,IAAI,CAACzB,KAAK;IAC1C,oBACER,KAAA,CAAAkC,aAAA,CAACpC,gBAAgB,EAAAqC,QAAA,KACXF,IAAI;MACRxB,KAAK,EAAE,CACLA,KAAK,EACL;QACEC,OAAO,EAAE,IAAI,CAACA,OAA4B,CAAE;MAC9C,CAAC,CACD;MACF0B,aAAa,EAAE,IAAI,CAACA;IAAc,IACjC,IAAI,CAAC5B,KAAK,CAAC6B,QAAQ,GAAG,IAAI,CAAC7B,KAAK,CAAC6B,QAAQ,gBAAGrC,KAAA,CAAAkC,aAAA,CAACrC,IAAI,MAAE,CACpC,CAAC;EAEvB;AACF;AAACQ,eAAA,CApDoBH,gBAAgB,kBACb;EACpB,GAAGJ,gBAAgB,CAACwC,YAAY;EAChCT,aAAa,EAAE;AACjB,CAAC","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import * as React from 'react';
3
+ import GenericTouchable from './GenericTouchable';
4
+ const TouchableWithoutFeedback = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(GenericTouchable, _extends({
5
+ ref: ref
6
+ }, props)));
7
+ TouchableWithoutFeedback.defaultProps = GenericTouchable.defaultProps;
8
+ export default TouchableWithoutFeedback;
9
+ //# sourceMappingURL=TouchableWithoutFeedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","GenericTouchable","TouchableWithoutFeedback","forwardRef","props","ref","createElement","_extends","defaultProps"],"sources":["TouchableWithoutFeedback.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport GenericTouchable, { GenericTouchableProps } from './GenericTouchable';\n\nexport type TouchableWithoutFeedbackProps = GenericTouchable;\n\nconst TouchableWithoutFeedback = React.forwardRef<\n TouchableWithoutFeedbackProps,\n PropsWithChildren<GenericTouchableProps>\n>((props, ref) => <GenericTouchable ref={ref} {...props} />);\n\nTouchableWithoutFeedback.defaultProps = GenericTouchable.defaultProps;\n\nexport default TouchableWithoutFeedback;\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,gBAAgB,MAAiC,oBAAoB;AAI5E,MAAMC,wBAAwB,gBAAGF,KAAK,CAACG,UAAU,CAG/C,CAACC,KAAK,EAAEC,GAAG,kBAAKL,KAAA,CAAAM,aAAA,CAACL,gBAAgB,EAAAM,QAAA;EAACF,GAAG,EAAEA;AAAI,GAAKD,KAAK,CAAG,CAAC,CAAC;AAE5DF,wBAAwB,CAACM,YAAY,GAAGP,gBAAgB,CAACO,YAAY;AAErE,eAAeN,wBAAwB","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export { default as TouchableNativeFeedback } from './TouchableNativeFeedback';
2
+ export { default as TouchableWithoutFeedback } from './TouchableWithoutFeedback';
3
+ export { default as TouchableOpacity } from './TouchableOpacity';
4
+ export { default as TouchableHighlight } from './TouchableHighlight';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","TouchableNativeFeedback","TouchableWithoutFeedback","TouchableOpacity","TouchableHighlight"],"sources":["index.ts"],"sourcesContent":["export type { TouchableHighlightProps } from './TouchableHighlight';\nexport type { TouchableOpacityProps } from './TouchableOpacity';\nexport type { TouchableWithoutFeedbackProps } from './TouchableWithoutFeedback';\nexport { default as TouchableNativeFeedback } from './TouchableNativeFeedback';\nexport { default as TouchableWithoutFeedback } from './TouchableWithoutFeedback';\nexport { default as TouchableOpacity } from './TouchableOpacity';\nexport { default as TouchableHighlight } from './TouchableHighlight';\n"],"mappings":"AAGA,SAASA,OAAO,IAAIC,uBAAuB,QAAQ,2BAA2B;AAC9E,SAASD,OAAO,IAAIE,wBAAwB,QAAQ,4BAA4B;AAChF,SAASF,OAAO,IAAIG,gBAAgB,QAAQ,oBAAoB;AAChE,SAASH,OAAO,IAAII,kBAAkB,QAAQ,sBAAsB","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ // Used by GestureDetector (unsupported on web at the moment) to check whether the
2
+ // attached view may get flattened on Fabric. This implementation causes errors
3
+ // on web due to the static resolution of `require` statements by webpack breaking
4
+ // the conditional importing. Solved by making .web file.
5
+ let findHostInstance_DEPRECATED;
6
+ export function getShadowNodeFromRef(ref) {
7
+ // load findHostInstance_DEPRECATED lazily because it may not be available before render
8
+ if (findHostInstance_DEPRECATED === undefined) {
9
+ try {
10
+ findHostInstance_DEPRECATED =
11
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
13
+ } catch (e) {
14
+ findHostInstance_DEPRECATED = _ref => null;
15
+ }
16
+ }
17
+
18
+ // @ts-ignore Fabric
19
+ return findHostInstance_DEPRECATED(ref)._internalInstanceHandle.stateNode.node;
20
+ }
21
+ //# sourceMappingURL=getShadowNodeFromRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["findHostInstance_DEPRECATED","getShadowNodeFromRef","ref","undefined","require","e","_ref","_internalInstanceHandle","stateNode","node"],"sources":["getShadowNodeFromRef.ts"],"sourcesContent":["// Used by GestureDetector (unsupported on web at the moment) to check whether the\n// attached view may get flattened on Fabric. This implementation causes errors\n// on web due to the static resolution of `require` statements by webpack breaking\n// the conditional importing. Solved by making .web file.\nlet findHostInstance_DEPRECATED: (ref: any) => void;\n\nexport function getShadowNodeFromRef(ref: any) {\n // load findHostInstance_DEPRECATED lazily because it may not be available before render\n if (findHostInstance_DEPRECATED === undefined) {\n try {\n findHostInstance_DEPRECATED =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;\n } catch (e) {\n findHostInstance_DEPRECATED = (_ref: any) => null;\n }\n }\n\n // @ts-ignore Fabric\n return findHostInstance_DEPRECATED(ref)._internalInstanceHandle.stateNode\n .node;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,IAAIA,2BAA+C;AAEnD,OAAO,SAASC,oBAAoBA,CAACC,GAAQ,EAAE;EAC7C;EACA,IAAIF,2BAA2B,KAAKG,SAAS,EAAE;IAC7C,IAAI;MACFH,2BAA2B;MACzB;MACAI,OAAO,CAAC,mDAAmD,CAAC,CAACJ,2BAA2B;IAC5F,CAAC,CAAC,OAAOK,CAAC,EAAE;MACVL,2BAA2B,GAAIM,IAAS,IAAK,IAAI;IACnD;EACF;;EAEA;EACA,OAAON,2BAA2B,CAACE,GAAG,CAAC,CAACK,uBAAuB,CAACC,SAAS,CACtEC,IAAI;AACT","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ // Used by GestureDetector (unsupported on web at the moment) to check whether the
2
+ // attached view may get flattened on Fabric. Original implementation causes errors
3
+ // on web due to the static resolution of `require` statements by webpack breaking
4
+ // the conditional importing.
5
+ export function getShadowNodeFromRef(_ref) {
6
+ return null;
7
+ }
8
+ //# sourceMappingURL=getShadowNodeFromRef.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getShadowNodeFromRef","_ref"],"sources":["getShadowNodeFromRef.web.ts"],"sourcesContent":["// Used by GestureDetector (unsupported on web at the moment) to check whether the\n// attached view may get flattened on Fabric. Original implementation causes errors\n// on web due to the static resolution of `require` statements by webpack breaking\n// the conditional importing.\nexport function getShadowNodeFromRef(_ref: any) {\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,SAASA,oBAAoBA,CAACC,IAAS,EAAE;EAC9C,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import createHandler from './createHandler';
2
+ import { baseGestureHandlerProps } from './gestureHandlerCommon';
3
+ export const flingGestureHandlerProps = ['numberOfPointers', 'direction'];
4
+ export const flingHandlerName = 'FlingGestureHandler';
5
+ // eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
6
+ export const FlingGestureHandler = createHandler({
7
+ name: flingHandlerName,
8
+ allowedProps: [...baseGestureHandlerProps, ...flingGestureHandlerProps],
9
+ config: {}
10
+ });
11
+ //# sourceMappingURL=FlingGestureHandler.js.map