react-native-gesture-handler 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/RNGestureHandler.podspec +0 -15
  2. package/android/build.gradle +5 -76
  3. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +16 -1
  4. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +43 -18
  5. package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +7 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +5 -0
  8. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +43 -16
  9. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +21 -0
  10. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +9 -1
  11. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +10 -0
  12. package/ios/Handlers/RNHoverHandler.h +12 -0
  13. package/ios/Handlers/RNHoverHandler.m +152 -0
  14. package/ios/RNGestureHandlerButtonComponentView.mm +2 -0
  15. package/ios/RNGestureHandlerEvents.h +1 -0
  16. package/ios/RNGestureHandlerEvents.m +10 -0
  17. package/ios/RNGestureHandlerManager.mm +2 -0
  18. package/ios/RNManualActivationRecognizer.m +2 -1
  19. package/ios/RNRootViewGestureRecognizer.m +7 -2
  20. package/lib/commonjs/RNGestureHandlerModule.macos.js +3 -1
  21. package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
  22. package/lib/commonjs/RNGestureHandlerModule.web.js +7 -2
  23. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  24. package/lib/commonjs/RNGestureHandlerModule.windows.js +3 -1
  25. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  26. package/lib/commonjs/components/DrawerLayout.js +1 -0
  27. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  28. package/lib/commonjs/components/touchables/GenericTouchable.js +1 -2
  29. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  30. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  31. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  32. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  33. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  34. package/lib/commonjs/components/touchables/index.js.map +1 -1
  35. package/lib/commonjs/handlers/createHandler.js +4 -4
  36. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  37. package/lib/commonjs/handlers/gestureHandlerCommon.js +1 -1
  38. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  39. package/lib/commonjs/handlers/gestures/GestureDetector.js +4 -2
  40. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  41. package/lib/commonjs/handlers/gestures/gesture.js +5 -0
  42. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  43. package/lib/commonjs/handlers/gestures/gestureObjects.js +5 -0
  44. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  45. package/lib/commonjs/handlers/gestures/hoverGesture.js +74 -0
  46. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
  47. package/lib/commonjs/index.js +8 -0
  48. package/lib/commonjs/index.js.map +1 -1
  49. package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -10
  50. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  51. package/lib/commonjs/web/handlers/GestureHandler.js +61 -88
  52. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  53. package/lib/commonjs/web/handlers/HoverGestureHandler.js +62 -0
  54. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
  55. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +6 -7
  56. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  57. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +12 -4
  58. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  59. package/lib/commonjs/web/handlers/PanGestureHandler.js +2 -7
  60. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  61. package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -10
  62. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  63. package/lib/commonjs/web/interfaces.js +1 -1
  64. package/lib/commonjs/web/interfaces.js.map +1 -1
  65. package/lib/commonjs/web/tools/EventManager.js +18 -4
  66. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  67. package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
  68. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
  69. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +5 -7
  70. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  71. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +118 -0
  72. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
  73. package/lib/commonjs/web/tools/PointerEventManager.js +38 -5
  74. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  75. package/lib/commonjs/web/tools/TouchEventManager.js +2 -2
  76. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
  77. package/lib/module/RNGestureHandlerModule.macos.js +2 -1
  78. package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
  79. package/lib/module/RNGestureHandlerModule.web.js +6 -3
  80. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  81. package/lib/module/RNGestureHandlerModule.windows.js +2 -1
  82. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  83. package/lib/module/components/DrawerLayout.js +1 -0
  84. package/lib/module/components/DrawerLayout.js.map +1 -1
  85. package/lib/module/components/touchables/GenericTouchable.js +1 -2
  86. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  87. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  88. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  89. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  90. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  91. package/lib/module/components/touchables/index.js.map +1 -1
  92. package/lib/module/handlers/createHandler.js +4 -4
  93. package/lib/module/handlers/createHandler.js.map +1 -1
  94. package/lib/module/handlers/gestureHandlerCommon.js +1 -1
  95. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  96. package/lib/module/handlers/gestures/GestureDetector.js +3 -2
  97. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  98. package/lib/module/handlers/gestures/gesture.js +5 -0
  99. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  100. package/lib/module/handlers/gestures/gestureObjects.js +4 -0
  101. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  102. package/lib/module/handlers/gestures/hoverGesture.js +62 -0
  103. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
  104. package/lib/module/index.js +1 -0
  105. package/lib/module/index.js.map +1 -1
  106. package/lib/module/web/handlers/FlingGestureHandler.js +0 -10
  107. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  108. package/lib/module/web/handlers/GestureHandler.js +61 -84
  109. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  110. package/lib/module/web/handlers/HoverGestureHandler.js +47 -0
  111. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
  112. package/lib/module/web/handlers/LongPressGestureHandler.js +5 -7
  113. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  114. package/lib/module/web/handlers/NativeViewGestureHandler.js +11 -4
  115. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  116. package/lib/module/web/handlers/PanGestureHandler.js +2 -7
  117. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  118. package/lib/module/web/handlers/TapGestureHandler.js +0 -10
  119. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  120. package/lib/module/web/interfaces.js +1 -1
  121. package/lib/module/web/interfaces.js.map +1 -1
  122. package/lib/module/web/tools/EventManager.js +18 -4
  123. package/lib/module/web/tools/EventManager.js.map +1 -1
  124. package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
  125. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
  126. package/lib/module/web/tools/GestureHandlerOrchestrator.js +5 -6
  127. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  128. package/lib/module/web/tools/GestureHandlerWebDelegate.js +102 -0
  129. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
  130. package/lib/module/web/tools/PointerEventManager.js +39 -6
  131. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  132. package/lib/module/web/tools/TouchEventManager.js +2 -2
  133. package/lib/module/web/tools/TouchEventManager.js.map +1 -1
  134. package/lib/typescript/RNGestureHandlerModule.macos.d.ts +1 -1
  135. package/lib/typescript/RNGestureHandlerModule.web.d.ts +3 -1
  136. package/lib/typescript/RNGestureHandlerModule.windows.d.ts +1 -1
  137. package/lib/typescript/components/DrawerLayout.d.ts +7 -1
  138. package/lib/typescript/components/touchables/GenericTouchable.d.ts +3 -2
  139. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +4 -3
  140. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -2
  141. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +4 -5
  142. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +1 -0
  143. package/lib/typescript/components/touchables/index.d.ts +3 -0
  144. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
  145. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +3 -1
  146. package/lib/typescript/handlers/gestures/gesture.d.ts +2 -1
  147. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +2 -0
  148. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
  149. package/lib/typescript/index.d.ts +4 -0
  150. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -6
  151. package/lib/typescript/web/handlers/GestureHandler.d.ts +12 -17
  152. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
  153. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +0 -4
  154. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -1
  155. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -4
  156. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -6
  157. package/lib/typescript/web/interfaces.d.ts +4 -3
  158. package/lib/typescript/web/tools/EventManager.d.ts +9 -5
  159. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
  160. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
  161. package/lib/typescript/web/tools/NodeManager.d.ts +2 -2
  162. package/lib/typescript/web/tools/PointerEventManager.d.ts +1 -1
  163. package/lib/typescript/web/tools/TouchEventManager.d.ts +1 -1
  164. package/package.json +2 -2
  165. package/src/RNGestureHandlerModule.macos.ts +5 -1
  166. package/src/RNGestureHandlerModule.web.ts +7 -1
  167. package/src/RNGestureHandlerModule.windows.ts +5 -1
  168. package/src/components/DrawerLayout.tsx +9 -0
  169. package/src/components/touchables/GenericTouchable.tsx +4 -4
  170. package/src/components/touchables/TouchableHighlight.tsx +6 -3
  171. package/src/components/touchables/TouchableNativeFeedback.android.tsx +5 -4
  172. package/src/components/touchables/TouchableOpacity.tsx +6 -7
  173. package/src/components/touchables/TouchableWithoutFeedback.tsx +3 -1
  174. package/src/components/touchables/index.ts +3 -0
  175. package/src/handlers/createHandler.tsx +5 -3
  176. package/src/handlers/gestureHandlerCommon.ts +39 -0
  177. package/src/handlers/gestures/GestureDetector.tsx +3 -1
  178. package/src/handlers/gestures/gesture.ts +6 -0
  179. package/src/handlers/gestures/gestureObjects.ts +5 -0
  180. package/src/handlers/gestures/hoverGesture.ts +83 -0
  181. package/src/index.ts +8 -0
  182. package/src/web/handlers/FlingGestureHandler.ts +0 -11
  183. package/src/web/handlers/GestureHandler.ts +68 -88
  184. package/src/web/handlers/HoverGestureHandler.ts +43 -0
  185. package/src/web/handlers/LongPressGestureHandler.ts +5 -7
  186. package/src/web/handlers/NativeViewGestureHandler.ts +11 -4
  187. package/src/web/handlers/PanGestureHandler.ts +1 -6
  188. package/src/web/handlers/TapGestureHandler.ts +0 -11
  189. package/src/web/interfaces.ts +4 -2
  190. package/src/web/tools/EventManager.ts +15 -7
  191. package/src/web/tools/GestureHandlerDelegate.ts +23 -0
  192. package/src/web/tools/GestureHandlerOrchestrator.ts +7 -6
  193. package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
  194. package/src/web/tools/PointerEventManager.ts +46 -16
  195. package/src/web/tools/TouchEventManager.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AA+CA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAiBA;;AAOA;;AAOA;;AAMA;;AA+CA;;AASA;;AAEA;;;;AAKA","sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './components/GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PureNativeButton,\n} from './components/GestureButtons';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n RefreshControl,\n} from './components/GestureComponents';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\nexport {\n enableExperimentalWebImplementation,\n enableLegacyWebImplementation,\n} from './EnableNewWebImplementation';\n\ninitialize();\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AA+CA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAkBA;;AAOA;;AAYA;;AAMA;;AAQA;;AAyCA;;AASA;;AAEA;;;;AAKA","sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './components/GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type { HoverGestureType as HoverGesture } from './handlers/gestures/hoverGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PureNativeButton,\n} from './components/GestureButtons';\nexport type {\n TouchableHighlightProps,\n TouchableOpacityProps,\n TouchableWithoutFeedbackProps,\n} from './components/touchables';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n RefreshControl,\n} from './components/GestureComponents';\nexport { HoverEffect } from './handlers/gestures/hoverGesture';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport type { SwipeableProps } from './components/Swipeable';\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\nexport {\n enableExperimentalWebImplementation,\n enableLegacyWebImplementation,\n} from './EnableNewWebImplementation';\n\ninitialize();\n"]}
@@ -65,16 +65,6 @@ class FlingGestureHandler extends _GestureHandler.default {
65
65
  }
66
66
  }
67
67
 
68
- transformNativeEvent() {
69
- const rect = this.view.getBoundingClientRect();
70
- return {
71
- x: this.tracker.getLastAvgX() - rect.left,
72
- y: this.tracker.getLastAvgY() - rect.top,
73
- absoluteX: this.tracker.getLastAvgX(),
74
- absoluteY: this.tracker.getLastAvgY()
75
- };
76
- }
77
-
78
68
  startFling() {
79
69
  this.startX = this.tracker.getLastX(this.keyPointer);
80
70
  this.startY = this.tracker.getLastY(this.keyPointer);
@@ -1 +1 @@
1
- {"version":3,"sources":["FlingGestureHandler.ts"],"names":["DEFAULT_MAX_DURATION_MS","DEFAULT_MIN_ACCEPTABLE_DELTA","DEFAULT_DIRECTION","Direction","RIGHT","DEFAULT_NUMBER_OF_TOUCHES_REQUIRED","FlingGestureHandler","GestureHandler","NaN","init","ref","propsRef","updateGestureConfig","enabled","props","config","direction","numberOfPointers","numberOfPointersRequired","transformNativeEvent","rect","view","getBoundingClientRect","x","tracker","getLastAvgX","left","y","getLastAvgY","top","absoluteX","absoluteY","startFling","startX","getLastX","keyPointer","startY","getLastY","begin","maxNumberOfPointersSimultaneously","delayTimeout","setTimeout","fail","maxDurationMs","tryEndFling","minAcceptableDelta","LEFT","UP","DOWN","clearTimeout","activate","endFling","onPointerDown","event","addToTracker","pointerId","newPointerAction","onPointerAdd","currentState","State","UNDETERMINED","BEGAN","getTrackedPointersCount","onPointerMove","track","onPointerUp","onUp","onPointerRemove","removeFromTracker","force","end","resetConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;;;;;AAEA,MAAMA,uBAAuB,GAAG,GAAhC;AACA,MAAMC,4BAA4B,GAAG,GAArC;AACA,MAAMC,iBAAiB,GAAGC,qBAAUC,KAApC;AACA,MAAMC,kCAAkC,GAAG,CAA3C;;AAEe,MAAMC,mBAAN,SAAkCC,uBAAlC,CAAiD;AAAA;AAAA;;AAAA,sDAC3BF,kCAD2B;;AAAA,uCAE1CH,iBAF0C;;AAAA,2CAItCF,uBAJsC;;AAAA,gDAKjCC,4BALiC;;AAAA;;AAAA,oCAQ7C,CAR6C;;AAA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AgCb,kCAAhC;AACA,SAAKW,SAAL,GAAiBd,iBAAjB;AACD;;AA/J6D","sourcesContent":["import { State } from '../../State';\nimport { Direction } from '../constants';\nimport { AdaptedEvent, Config } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\n\nconst DEFAULT_MAX_DURATION_MS = 800;\nconst DEFAULT_MIN_ACCEPTABLE_DELTA = 160;\nconst DEFAULT_DIRECTION = Direction.RIGHT;\nconst DEFAULT_NUMBER_OF_TOUCHES_REQUIRED = 1;\n\nexport default class FlingGestureHandler extends GestureHandler {\n private numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n private direction = DEFAULT_DIRECTION;\n\n private maxDurationMs = DEFAULT_MAX_DURATION_MS;\n private minAcceptableDelta = DEFAULT_MIN_ACCEPTABLE_DELTA;\n private delayTimeout!: number;\n\n private startX = 0;\n private startY = 0;\n\n private maxNumberOfPointersSimultaneously = 0;\n private keyPointer = NaN;\n\n public init(ref: number, propsRef: React.RefObject<unknown>): void {\n super.init(ref, propsRef);\n }\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.direction) {\n this.direction = this.config.direction;\n }\n\n if (this.config.numberOfPointers) {\n this.numberOfPointersRequired = this.config.numberOfPointers;\n }\n }\n\n protected transformNativeEvent() {\n const rect: DOMRect = this.view.getBoundingClientRect();\n\n return {\n x: this.tracker.getLastAvgX() - rect.left,\n y: this.tracker.getLastAvgY() - rect.top,\n absoluteX: this.tracker.getLastAvgX(),\n absoluteY: this.tracker.getLastAvgY(),\n };\n }\n\n private startFling(): void {\n this.startX = this.tracker.getLastX(this.keyPointer);\n this.startY = this.tracker.getLastY(this.keyPointer);\n\n this.begin();\n\n this.maxNumberOfPointersSimultaneously = 1;\n\n this.delayTimeout = setTimeout(() => this.fail(), this.maxDurationMs);\n }\n\n private tryEndFling(): boolean {\n if (\n this.maxNumberOfPointersSimultaneously ===\n this.numberOfPointersRequired &&\n ((this.direction & Direction.RIGHT &&\n this.tracker.getLastX(this.keyPointer) - this.startX >\n this.minAcceptableDelta) ||\n (this.direction & Direction.LEFT &&\n this.startX - this.tracker.getLastX(this.keyPointer) >\n this.minAcceptableDelta) ||\n (this.direction & Direction.UP &&\n this.startY - this.tracker.getLastY(this.keyPointer) >\n this.minAcceptableDelta) ||\n (this.direction & Direction.DOWN &&\n this.tracker.getLastY(this.keyPointer) - this.startY >\n this.minAcceptableDelta))\n ) {\n clearTimeout(this.delayTimeout);\n this.activate();\n\n return true;\n }\n\n return false;\n }\n\n private endFling() {\n if (!this.tryEndFling()) {\n this.fail();\n }\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n this.keyPointer = event.pointerId;\n\n super.onPointerDown(event);\n this.newPointerAction();\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n this.newPointerAction();\n }\n\n private newPointerAction(): void {\n if (this.currentState === State.UNDETERMINED) {\n this.startFling();\n }\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n if (\n this.tracker.getTrackedPointersCount() >\n this.maxNumberOfPointersSimultaneously\n ) {\n this.maxNumberOfPointersSimultaneously =\n this.tracker.getTrackedPointersCount();\n }\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.tracker.track(event);\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n super.onPointerMove(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.onUp(event);\n\n this.keyPointer = NaN;\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.onUp(event);\n }\n\n private onUp(event: AdaptedEvent): void {\n this.tracker.removeFromTracker(event.pointerId);\n if (this.currentState !== State.BEGAN) {\n return;\n }\n this.endFling();\n }\n\n public activate(force?: boolean): void {\n super.activate(force);\n this.end();\n }\n\n protected resetConfig(): void {\n super.resetConfig();\n this.numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n this.direction = DEFAULT_DIRECTION;\n }\n}\n"]}
1
+ {"version":3,"sources":["FlingGestureHandler.ts"],"names":["DEFAULT_MAX_DURATION_MS","DEFAULT_MIN_ACCEPTABLE_DELTA","DEFAULT_DIRECTION","Direction","RIGHT","DEFAULT_NUMBER_OF_TOUCHES_REQUIRED","FlingGestureHandler","GestureHandler","NaN","init","ref","propsRef","updateGestureConfig","enabled","props","config","direction","numberOfPointers","numberOfPointersRequired","startFling","startX","tracker","getLastX","keyPointer","startY","getLastY","begin","maxNumberOfPointersSimultaneously","delayTimeout","setTimeout","fail","maxDurationMs","tryEndFling","minAcceptableDelta","LEFT","UP","DOWN","clearTimeout","activate","endFling","onPointerDown","event","addToTracker","pointerId","newPointerAction","onPointerAdd","currentState","State","UNDETERMINED","BEGAN","getTrackedPointersCount","onPointerMove","track","onPointerUp","onUp","onPointerRemove","removeFromTracker","force","end","resetConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;;;;;AAEA,MAAMA,uBAAuB,GAAG,GAAhC;AACA,MAAMC,4BAA4B,GAAG,GAArC;AACA,MAAMC,iBAAiB,GAAGC,qBAAUC,KAApC;AACA,MAAMC,kCAAkC,GAAG,CAA3C;;AAEe,MAAMC,mBAAN,SAAkCC,uBAAlC,CAAiD;AAAA;AAAA;;AAAA,sDAC3BF,kCAD2B;;AAAA,uCAE1CH,iBAF0C;;AAAA,2CAItCF,uBAJsC;;AAAA,gDAKjCC,4BALiC;;AAAA;;AAAA,oCAQ7C,CAR6C;;AAAA,oCAS7C,CAT6C;;AAAA,+DAWlB,CAXkB;;AAAA,wCAYzCO,GAZyC;AAAA;;AAcvDC,EAAAA,IAAI,CAACC,GAAD,EAAcC,QAAd,EAAwD;AACjE,UAAMF,IAAN,CAAWC,GAAX,EAAgBC,QAAhB;AACD;;AAEMC,EAAAA,mBAAmB,CAAC;AAAEC,IAAA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EAAAA,WAAW,CAACZ,KAAD,EAA4B;AAC/C,UAAMY,WAAN,CAAkBZ,KAAlB;AACA,SAAKa,IAAL,CAAUb,KAAV;AAEA,SAAKlB,UAAL,GAAkBf,GAAlB;AACD;;AAES+C,EAAAA,eAAe,CAACd,KAAD,EAA4B;AACnD,UAAMc,eAAN,CAAsBd,KAAtB;AACA,SAAKa,IAAL,CAAUb,KAAV;AACD;;AAEOa,EAAAA,IAAI,CAACb,KAAD,EAA4B;AACtC,SAAKpB,OAAL,CAAamC,iBAAb,CAA+Bf,KAAK,CAACE,SAArC;;AACA,QAAI,KAAKG,YAAL,KAAsBC,aAAME,KAAhC,EAAuC;AACrC;AACD;;AACD,SAAKV,QAAL;AACD;;AAEMD,EAAAA,QAAQ,CAACmB,KAAD,EAAwB;AACrC,UAAMnB,QAAN,CAAemB,KAAf;AACA,SAAKC,GAAL;AACD;;AAESC,EAAAA,WAAW,GAAS;AAC5B,UAAMA,WAAN;AACA,SAAKzC,wBAAL,GAAgCb,kCAAhC;AACA,SAAKW,SAAL,GAAiBd,iBAAjB;AACD;;AApJ6D","sourcesContent":["import { State } from '../../State';\nimport { Direction } from '../constants';\nimport { AdaptedEvent, Config } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\n\nconst DEFAULT_MAX_DURATION_MS = 800;\nconst DEFAULT_MIN_ACCEPTABLE_DELTA = 160;\nconst DEFAULT_DIRECTION = Direction.RIGHT;\nconst DEFAULT_NUMBER_OF_TOUCHES_REQUIRED = 1;\n\nexport default class FlingGestureHandler extends GestureHandler {\n private numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n private direction = DEFAULT_DIRECTION;\n\n private maxDurationMs = DEFAULT_MAX_DURATION_MS;\n private minAcceptableDelta = DEFAULT_MIN_ACCEPTABLE_DELTA;\n private delayTimeout!: number;\n\n private startX = 0;\n private startY = 0;\n\n private maxNumberOfPointersSimultaneously = 0;\n private keyPointer = NaN;\n\n public init(ref: number, propsRef: React.RefObject<unknown>): void {\n super.init(ref, propsRef);\n }\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.direction) {\n this.direction = this.config.direction;\n }\n\n if (this.config.numberOfPointers) {\n this.numberOfPointersRequired = this.config.numberOfPointers;\n }\n }\n\n private startFling(): void {\n this.startX = this.tracker.getLastX(this.keyPointer);\n this.startY = this.tracker.getLastY(this.keyPointer);\n\n this.begin();\n\n this.maxNumberOfPointersSimultaneously = 1;\n\n this.delayTimeout = setTimeout(() => this.fail(), this.maxDurationMs);\n }\n\n private tryEndFling(): boolean {\n if (\n this.maxNumberOfPointersSimultaneously ===\n this.numberOfPointersRequired &&\n ((this.direction & Direction.RIGHT &&\n this.tracker.getLastX(this.keyPointer) - this.startX >\n this.minAcceptableDelta) ||\n (this.direction & Direction.LEFT &&\n this.startX - this.tracker.getLastX(this.keyPointer) >\n this.minAcceptableDelta) ||\n (this.direction & Direction.UP &&\n this.startY - this.tracker.getLastY(this.keyPointer) >\n this.minAcceptableDelta) ||\n (this.direction & Direction.DOWN &&\n this.tracker.getLastY(this.keyPointer) - this.startY >\n this.minAcceptableDelta))\n ) {\n clearTimeout(this.delayTimeout);\n this.activate();\n\n return true;\n }\n\n return false;\n }\n\n private endFling() {\n if (!this.tryEndFling()) {\n this.fail();\n }\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n this.keyPointer = event.pointerId;\n\n super.onPointerDown(event);\n this.newPointerAction();\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n this.newPointerAction();\n }\n\n private newPointerAction(): void {\n if (this.currentState === State.UNDETERMINED) {\n this.startFling();\n }\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n if (\n this.tracker.getTrackedPointersCount() >\n this.maxNumberOfPointersSimultaneously\n ) {\n this.maxNumberOfPointersSimultaneously =\n this.tracker.getTrackedPointersCount();\n }\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.tracker.track(event);\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n super.onPointerMove(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.onUp(event);\n\n this.keyPointer = NaN;\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.onUp(event);\n }\n\n private onUp(event: AdaptedEvent): void {\n this.tracker.removeFromTracker(event.pointerId);\n if (this.currentState !== State.BEGAN) {\n return;\n }\n this.endFling();\n }\n\n public activate(force?: boolean): void {\n super.activate(force);\n this.end();\n }\n\n protected resetConfig(): void {\n super.resetConfig();\n this.numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n this.direction = DEFAULT_DIRECTION;\n }\n}\n"]}
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _reactNative = require("react-native");
9
-
10
8
  var _State = require("../../State");
11
9
 
12
10
  var _interfaces = require("../interfaces");
@@ -15,32 +13,26 @@ var _GestureHandlerOrchestrator = _interopRequireDefault(require("../tools/Gestu
15
13
 
16
14
  var _InteractionManager = _interopRequireDefault(require("../tools/InteractionManager"));
17
15
 
18
- var _PointerEventManager = _interopRequireDefault(require("../tools/PointerEventManager"));
19
-
20
16
  var _PointerTracker = _interopRequireDefault(require("../tools/PointerTracker"));
21
17
 
22
- var _TouchEventManager = _interopRequireDefault(require("../tools/TouchEventManager"));
23
-
24
- var _utils = require("../utils");
25
-
26
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
19
 
28
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
21
 
30
22
  class GestureHandler {
31
23
  // Orchestrator properties
32
- constructor() {
24
+ constructor(delegate) {
33
25
  _defineProperty(this, "lastSentState", null);
34
26
 
35
27
  _defineProperty(this, "currentState", _State.State.UNDETERMINED);
36
28
 
37
29
  _defineProperty(this, "shouldCancellWhenOutside", false);
38
30
 
39
- _defineProperty(this, "hasCustomActivationCriteria", void 0);
31
+ _defineProperty(this, "hasCustomActivationCriteria", false);
40
32
 
41
33
  _defineProperty(this, "enabled", false);
42
34
 
43
- _defineProperty(this, "ref", void 0);
35
+ _defineProperty(this, "viewRef", void 0);
44
36
 
45
37
  _defineProperty(this, "propsRef", void 0);
46
38
 
@@ -50,10 +42,6 @@ class GestureHandler {
50
42
  enabled: false
51
43
  });
52
44
 
53
- _defineProperty(this, "view", void 0);
54
-
55
- _defineProperty(this, "eventManagers", []);
56
-
57
45
  _defineProperty(this, "tracker", new _PointerTracker.default());
58
46
 
59
47
  _defineProperty(this, "activationIndex", 0);
@@ -66,6 +54,8 @@ class GestureHandler {
66
54
 
67
55
  _defineProperty(this, "pointerType", _interfaces.PointerType.NONE);
68
56
 
57
+ _defineProperty(this, "delegate", void 0);
58
+
69
59
  _defineProperty(this, "sendEvent", (newState, oldState) => {
70
60
  const {
71
61
  onGestureHandlerEvent,
@@ -87,52 +77,32 @@ class GestureHandler {
87
77
  }
88
78
  });
89
79
 
90
- this.hasCustomActivationCriteria = false;
80
+ this.delegate = delegate;
91
81
  } //
92
82
  // Initializing handler
93
83
  //
94
84
 
95
85
 
96
- init(ref, propsRef) {
86
+ init(viewRef, propsRef) {
97
87
  this.propsRef = propsRef;
98
- this.ref = ref;
88
+ this.viewRef = viewRef;
99
89
  this.currentState = _State.State.UNDETERMINED;
100
- this.setView();
101
- this.addEventManager(new _PointerEventManager.default(this.view));
102
- this.addEventManager(new _TouchEventManager.default(this.view));
103
- }
104
-
105
- setView() {
106
- if (!this.ref) {
107
- throw new Error(`Cannot find HTML Element for handler ${this.handlerTag}`);
108
- }
109
-
110
- this.view = (0, _reactNative.findNodeHandle)(this.ref);
111
- this.view.style['touchAction'] = 'none'; //@ts-ignore This one disables default events on Safari
112
-
113
- this.view.style['WebkitTouchCallout'] = 'none';
114
-
115
- if (!this.config.userSelect) {
116
- this.view.style['webkitUserSelect'] = 'none';
117
- this.view.style['userSelect'] = 'none';
118
- } else {
119
- this.view.style['webkitUserSelect'] = this.config.userSelect;
120
- this.view.style['userSelect'] = this.config.userSelect;
121
- }
90
+ this.delegate.init(viewRef, this);
122
91
  }
123
92
 
124
- addEventManager(manager) {
93
+ attachEventManager(manager) {
125
94
  manager.setOnPointerDown(this.onPointerDown.bind(this));
126
95
  manager.setOnPointerAdd(this.onPointerAdd.bind(this));
127
96
  manager.setOnPointerUp(this.onPointerUp.bind(this));
128
97
  manager.setOnPointerRemove(this.onPointerRemove.bind(this));
129
98
  manager.setOnPointerMove(this.onPointerMove.bind(this));
130
99
  manager.setOnPointerEnter(this.onPointerEnter.bind(this));
131
- manager.setOnPointerOut(this.onPointerOut.bind(this));
100
+ manager.setOnPointerLeave(this.onPointerLeave.bind(this));
132
101
  manager.setOnPointerCancel(this.onPointerCancel.bind(this));
133
102
  manager.setOnPointerOutOfBounds(this.onPointerOutOfBounds.bind(this));
103
+ manager.setOnPointerMoveOver(this.onPointerMoveOver.bind(this));
104
+ manager.setOnPointerMoveOut(this.onPointerMoveOut.bind(this));
134
105
  manager.setListeners();
135
- this.eventManagers.push(manager);
136
106
  } //
137
107
  // Resetting handler
138
108
  //
@@ -148,7 +118,7 @@ class GestureHandler {
148
118
  this.tracker.resetTracker();
149
119
  this.onReset();
150
120
  this.resetProgress();
151
- this.eventManagers.forEach(manager => manager.resetManager());
121
+ this.delegate.reset();
152
122
  this.currentState = _State.State.UNDETERMINED;
153
123
  } //
154
124
  // State logic
@@ -190,8 +160,10 @@ class GestureHandler {
190
160
 
191
161
  fail(sendIfDisabled) {
192
162
  if (this.currentState === _State.State.ACTIVE || this.currentState === _State.State.BEGAN) {
163
+ // Here the order of calling the delegate and moveToState is important.
164
+ // At this point we can use currentState as previuos state, because immediately after changing cursor we call moveToState method.
165
+ this.delegate.onFail();
193
166
  this.moveToState(_State.State.FAILED, sendIfDisabled);
194
- this.view.style.cursor = 'auto';
195
167
  }
196
168
 
197
169
  this.resetProgress();
@@ -203,23 +175,25 @@ class GestureHandler {
203
175
 
204
176
  cancel(sendIfDisabled) {
205
177
  if (this.currentState === _State.State.ACTIVE || this.currentState === _State.State.UNDETERMINED || this.currentState === _State.State.BEGAN) {
206
- this.onCancel();
178
+ this.onCancel(); // Same as above - order matters
179
+
180
+ this.delegate.onCancel();
207
181
  this.moveToState(_State.State.CANCELLED, sendIfDisabled);
208
- this.view.style.cursor = 'auto';
209
182
  }
210
183
  }
211
184
 
212
185
  activate(_force = false) {
213
186
  if (this.currentState === _State.State.UNDETERMINED || this.currentState === _State.State.BEGAN) {
187
+ this.delegate.onActivate();
214
188
  this.moveToState(_State.State.ACTIVE);
215
- this.view.style.cursor = 'grab';
216
189
  }
217
190
  }
218
191
 
219
192
  end() {
220
193
  if (this.currentState === _State.State.BEGAN || this.currentState === _State.State.ACTIVE) {
194
+ // Same as above - order matters
195
+ this.delegate.onEnd();
221
196
  this.moveToState(_State.State.END);
222
- this.view.style.cursor = 'auto';
223
197
  }
224
198
 
225
199
  this.resetProgress();
@@ -337,7 +311,7 @@ class GestureHandler {
337
311
  }
338
312
  }
339
313
 
340
- onPointerOut(event) {
314
+ onPointerLeave(event) {
341
315
  if (this.shouldCancellWhenOutside) {
342
316
  switch (this.currentState) {
343
317
  case _State.State.ACTIVE:
@@ -380,6 +354,12 @@ class GestureHandler {
380
354
  }
381
355
  }
382
356
 
357
+ onPointerMoveOver(_event) {// used only by hover gesture handler atm
358
+ }
359
+
360
+ onPointerMoveOut(_event) {// used only by hover gesture handler atm
361
+ }
362
+
383
363
  tryToSendMoveEvent(out) {
384
364
  if (this.enabled && this.active && (!out || out && !this.shouldCancellWhenOutside)) {
385
365
  this.sendEvent(this.currentState, this.currentState);
@@ -409,13 +389,13 @@ class GestureHandler {
409
389
  nativeEvent: {
410
390
  numberOfPointers: this.tracker.getTrackedPointersCount(),
411
391
  state: newState,
412
- pointerInside: (0, _utils.isPointerInBounds)(this.view, {
392
+ pointerInside: this.delegate.isPointerInBounds({
413
393
  x: this.tracker.getLastAvgX(),
414
394
  y: this.tracker.getLastAvgY()
415
395
  }),
416
396
  ...this.transformNativeEvent(),
417
397
  handlerTag: this.handlerTag,
418
- target: this.ref,
398
+ target: this.viewRef,
419
399
  oldState: newState !== oldState ? oldState : undefined
420
400
  },
421
401
  timeStamp: Date.now()
@@ -425,7 +405,7 @@ class GestureHandler {
425
405
  transformTouchEvent(event) {
426
406
  var _event$touchEventType;
427
407
 
428
- const rect = this.view.getBoundingClientRect();
408
+ const rect = this.delegate.measureView();
429
409
  const all = [];
430
410
  const changed = [];
431
411
  const trackerData = this.tracker.getData(); // This if handles edge case where all pointers have been cancelled
@@ -441,8 +421,8 @@ class GestureHandler {
441
421
  const id = this.tracker.getMappedTouchEventId(key);
442
422
  all.push({
443
423
  id: id,
444
- x: element.lastX - rect.left,
445
- y: element.lastY - rect.top,
424
+ x: element.lastX - rect.pageX,
425
+ y: element.lastY - rect.pageY,
446
426
  absoluteX: element.lastX,
447
427
  absoluteY: element.lastY
448
428
  });
@@ -452,8 +432,8 @@ class GestureHandler {
452
432
  if (event.eventType !== _interfaces.EventTypes.CANCEL) {
453
433
  changed.push({
454
434
  id: this.tracker.getMappedTouchEventId(event.pointerId),
455
- x: event.x - rect.left,
456
- y: event.y - rect.top,
435
+ x: event.x - rect.pageX,
436
+ y: event.y - rect.pageY,
457
437
  absoluteX: event.x,
458
438
  absoluteY: event.y
459
439
  });
@@ -462,8 +442,8 @@ class GestureHandler {
462
442
  const id = this.tracker.getMappedTouchEventId(key);
463
443
  changed.push({
464
444
  id: id,
465
- x: element.lastX - rect.left,
466
- y: element.lastY - rect.top,
445
+ x: element.lastX - rect.pageX,
446
+ y: element.lastY - rect.pageY,
467
447
  absoluteX: element.lastX,
468
448
  absoluteY: element.lastY
469
449
  });
@@ -515,7 +495,7 @@ class GestureHandler {
515
495
  }
516
496
 
517
497
  cancelTouches() {
518
- const rect = this.view.getBoundingClientRect();
498
+ const rect = this.delegate.measureView();
519
499
  const all = [];
520
500
  const changed = [];
521
501
  const trackerData = this.tracker.getData();
@@ -528,15 +508,15 @@ class GestureHandler {
528
508
  const id = this.tracker.getMappedTouchEventId(key);
529
509
  all.push({
530
510
  id: id,
531
- x: element.lastX - rect.left,
532
- y: element.lastY - rect.top,
511
+ x: element.lastX - rect.pageX,
512
+ y: element.lastY - rect.pageY,
533
513
  absoluteX: element.lastX,
534
514
  absoluteY: element.lastY
535
515
  });
536
516
  changed.push({
537
517
  id: id,
538
- x: element.lastX - rect.left,
539
- y: element.lastY - rect.top,
518
+ x: element.lastX - rect.pageX,
519
+ y: element.lastY - rect.pageY,
540
520
  absoluteX: element.lastX,
541
521
  absoluteY: element.lastY
542
522
  });
@@ -559,7 +539,14 @@ class GestureHandler {
559
539
  }
560
540
 
561
541
  transformNativeEvent() {
562
- return {};
542
+ // those properties are shared by most handlers and if not this method will be overriden
543
+ const rect = this.delegate.measureView();
544
+ return {
545
+ x: this.tracker.getLastAvgX() - rect.pageX,
546
+ y: this.tracker.getLastAvgY() - rect.pageY,
547
+ absoluteX: this.tracker.getLastAvgX(),
548
+ absoluteY: this.tracker.getLastAvgY()
549
+ };
563
550
  } //
564
551
  // Handling config
565
552
  //
@@ -636,8 +623,10 @@ class GestureHandler {
636
623
  return true;
637
624
  }
638
625
 
639
- const width = this.view.getBoundingClientRect().width;
640
- const height = this.view.getBoundingClientRect().height;
626
+ const {
627
+ width,
628
+ height
629
+ } = this.delegate.measureView();
641
630
  let left = 0;
642
631
  let top = 0;
643
632
  let right = width;
@@ -685,9 +674,9 @@ class GestureHandler {
685
674
  }
686
675
  }
687
676
 
688
- const rect = this.view.getBoundingClientRect();
689
- const offsetX = this.tracker.getLastX() - rect.left;
690
- const offsetY = this.tracker.getLastY() - rect.top;
677
+ const rect = this.delegate.measureView();
678
+ const offsetX = this.tracker.getLastX() - rect.pageX;
679
+ const offsetY = this.tracker.getLastY() - rect.pageY;
691
680
 
692
681
  if (offsetX >= left && offsetX <= right && offsetY >= top && offsetY <= bottom) {
693
682
  return true;
@@ -696,14 +685,6 @@ class GestureHandler {
696
685
  return false;
697
686
  }
698
687
 
699
- isPointerInBounds({
700
- x,
701
- y
702
- }) {
703
- const rect = this.view.getBoundingClientRect();
704
- return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
705
- }
706
-
707
688
  resetConfig() {} //
708
689
  // Getters and setters
709
690
  //
@@ -721,16 +702,8 @@ class GestureHandler {
721
702
  return this.config;
722
703
  }
723
704
 
724
- getShouldEnableGestureOnSetup() {
725
- throw new Error('Must override GestureHandler.shouldEnableGestureOnSetup');
726
- }
727
-
728
- getView() {
729
- return this.view;
730
- }
731
-
732
- getEventManagers() {
733
- return this.eventManagers;
705
+ getDelegate() {
706
+ return this.delegate;
734
707
  }
735
708
 
736
709
  getTracker() {