react-native-gesture-handler 2.14.1 → 2.16.0-rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. package/README.md +1 -0
  2. package/RNGestureHandler.podspec +3 -24
  3. package/android/build.gradle +1 -1
  4. package/android/paper/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +55 -0
  5. package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +69 -4
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +4 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +69 -0
  8. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +37 -21
  9. package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +5 -1
  10. package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +5 -1
  11. package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +7 -3
  12. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +61 -24
  13. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +3 -2
  14. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +3 -0
  15. package/android/src/main/jni/cpp-adapter.cpp +18 -22
  16. package/{ios → apple}/Handlers/RNFlingHandler.m +29 -8
  17. package/{ios → apple}/Handlers/RNForceTouchHandler.m +28 -8
  18. package/{ios → apple}/Handlers/RNHoverHandler.m +28 -2
  19. package/{ios → apple}/Handlers/RNLongPressHandler.m +27 -5
  20. package/{ios → apple}/Handlers/RNManualHandler.m +25 -4
  21. package/{ios → apple}/Handlers/RNNativeViewHandler.mm +51 -13
  22. package/{ios → apple}/Handlers/RNPanHandler.m +106 -16
  23. package/apple/Handlers/RNPinchHandler.m +175 -0
  24. package/apple/Handlers/RNRotationHandler.m +169 -0
  25. package/{ios → apple}/Handlers/RNTapHandler.m +98 -26
  26. package/apple/RNGHUIKit.h +27 -0
  27. package/{ios → apple}/RNGestureHandler.h +12 -3
  28. package/{ios → apple}/RNGestureHandler.m +68 -7
  29. package/{ios → apple}/RNGestureHandlerButton.h +4 -1
  30. package/{ios → apple}/RNGestureHandlerButton.m +12 -4
  31. package/{ios → apple}/RNGestureHandlerButtonManager.m +4 -2
  32. package/{ios → apple}/RNGestureHandlerEvents.h +19 -10
  33. package/{ios → apple}/RNGestureHandlerEvents.m +29 -11
  34. package/{ios → apple}/RNGestureHandlerManager.h +7 -2
  35. package/{ios → apple}/RNGestureHandlerManager.mm +78 -17
  36. package/apple/RNGestureHandlerModule.h +19 -0
  37. package/{ios → apple}/RNGestureHandlerModule.mm +69 -69
  38. package/{ios → apple}/RNGestureHandlerPointerTracker.h +5 -5
  39. package/{ios → apple}/RNGestureHandlerPointerTracker.m +19 -14
  40. package/apple/RNGestureHandlerPointerType.h +8 -0
  41. package/{ios → apple}/RNGestureHandlerRegistry.h +1 -1
  42. package/{ios → apple}/RNGestureHandlerRegistry.m +1 -1
  43. package/{ios → apple}/RNManualActivationRecognizer.h +8 -0
  44. package/{ios → apple}/RNManualActivationRecognizer.m +27 -7
  45. package/{ios → apple}/RNRootViewGestureRecognizer.m +72 -4
  46. package/lib/commonjs/PointerType.js +16 -0
  47. package/lib/commonjs/PointerType.js.map +1 -0
  48. package/lib/commonjs/RNGestureHandlerModule.js +5 -18
  49. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  50. package/lib/commonjs/RNGestureHandlerModule.windows.js +10 -102
  51. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  52. package/lib/commonjs/components/DrawerLayout.js +2 -0
  53. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  54. package/lib/commonjs/components/GestureHandlerRootView.android.js +17 -2
  55. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  56. package/lib/commonjs/components/GestureHandlerRootView.js +15 -2
  57. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  58. package/lib/commonjs/components/GestureHandlerRootView.web.js +15 -2
  59. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
  60. package/lib/commonjs/getShadowNodeFromRef.js +19 -2
  61. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  62. package/lib/commonjs/handlers/createHandler.js +5 -0
  63. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  64. package/lib/commonjs/handlers/gestureHandlerCommon.js +1 -1
  65. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  66. package/lib/commonjs/handlers/gestures/GestureDetector.js +11 -1
  67. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  68. package/lib/commonjs/handlers/gestures/gesture.js +5 -0
  69. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  70. package/lib/commonjs/index.js +16 -0
  71. package/lib/commonjs/index.js.map +1 -1
  72. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +13 -0
  73. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -0
  74. package/lib/commonjs/web/handlers/FlingGestureHandler.js +4 -0
  75. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  76. package/lib/commonjs/web/handlers/GestureHandler.js +19 -4
  77. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  78. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +8 -6
  79. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  80. package/lib/commonjs/web/handlers/PanGestureHandler.js +4 -0
  81. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  82. package/lib/commonjs/web/handlers/TapGestureHandler.js +4 -0
  83. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  84. package/lib/commonjs/web/interfaces.js +12 -24
  85. package/lib/commonjs/web/interfaces.js.map +1 -1
  86. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +3 -3
  87. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  88. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +35 -0
  89. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  90. package/lib/commonjs/web/tools/NodeManager.js +3 -2
  91. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  92. package/lib/commonjs/web/tools/PointerEventManager.js +40 -10
  93. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  94. package/lib/commonjs/web/tools/TouchEventManager.js +3 -2
  95. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
  96. package/lib/commonjs/web/utils.js +6 -0
  97. package/lib/commonjs/web/utils.js.map +1 -1
  98. package/lib/module/PointerType.js +9 -0
  99. package/lib/module/PointerType.js.map +1 -0
  100. package/lib/module/RNGestureHandlerModule.js +4 -18
  101. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  102. package/lib/module/RNGestureHandlerModule.windows.js +10 -81
  103. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  104. package/lib/module/components/DrawerLayout.js +2 -0
  105. package/lib/module/components/DrawerLayout.js.map +1 -1
  106. package/lib/module/components/GestureHandlerRootView.android.js +15 -2
  107. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  108. package/lib/module/components/GestureHandlerRootView.js +15 -3
  109. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  110. package/lib/module/components/GestureHandlerRootView.web.js +15 -3
  111. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
  112. package/lib/module/getShadowNodeFromRef.js +19 -2
  113. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  114. package/lib/module/handlers/createHandler.js +6 -1
  115. package/lib/module/handlers/createHandler.js.map +1 -1
  116. package/lib/module/handlers/gestureHandlerCommon.js +1 -1
  117. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  118. package/lib/module/handlers/gestures/GestureDetector.js +11 -1
  119. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  120. package/lib/module/handlers/gestures/gesture.js +5 -0
  121. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  122. package/lib/module/index.js +2 -0
  123. package/lib/module/index.js.map +1 -1
  124. package/lib/module/specs/NativeRNGestureHandlerModule.js +3 -0
  125. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -0
  126. package/lib/module/web/handlers/FlingGestureHandler.js +4 -0
  127. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  128. package/lib/module/web/handlers/GestureHandler.js +18 -4
  129. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  130. package/lib/module/web/handlers/LongPressGestureHandler.js +8 -5
  131. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  132. package/lib/module/web/handlers/PanGestureHandler.js +4 -0
  133. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  134. package/lib/module/web/handlers/TapGestureHandler.js +4 -0
  135. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  136. package/lib/module/web/interfaces.js +9 -20
  137. package/lib/module/web/interfaces.js.map +1 -1
  138. package/lib/module/web/tools/GestureHandlerOrchestrator.js +2 -2
  139. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  140. package/lib/module/web/tools/GestureHandlerWebDelegate.js +34 -0
  141. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  142. package/lib/module/web/tools/NodeManager.js +3 -2
  143. package/lib/module/web/tools/NodeManager.js.map +1 -1
  144. package/lib/module/web/tools/PointerEventManager.js +41 -12
  145. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  146. package/lib/module/web/tools/TouchEventManager.js +2 -2
  147. package/lib/module/web/tools/TouchEventManager.js.map +1 -1
  148. package/lib/module/web/utils.js +2 -0
  149. package/lib/module/web/utils.js.map +1 -1
  150. package/lib/typescript/PointerType.d.ts +6 -0
  151. package/lib/typescript/RNGestureHandlerModule.d.ts +2 -13
  152. package/lib/typescript/RNGestureHandlerModule.windows.d.ts +5 -21
  153. package/lib/typescript/components/DrawerLayout.d.ts +11 -0
  154. package/lib/typescript/components/GestureHandlerRootView.android.d.ts +1 -1
  155. package/lib/typescript/components/GestureHandlerRootView.d.ts +1 -1
  156. package/lib/typescript/components/GestureHandlerRootView.web.d.ts +1 -1
  157. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -1
  158. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
  159. package/lib/typescript/handlers/PanGestureHandler.d.ts +1 -1
  160. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +6 -1
  161. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +2 -1
  162. package/lib/typescript/handlers/gestures/gesture.d.ts +2 -0
  163. package/lib/typescript/index.d.ts +2 -0
  164. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +14 -0
  165. package/lib/typescript/web/handlers/GestureHandler.d.ts +4 -1
  166. package/lib/typescript/web/interfaces.d.ts +10 -14
  167. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +2 -0
  168. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +7 -0
  169. package/lib/typescript/web/tools/PointerEventManager.d.ts +2 -0
  170. package/lib/typescript/web/utils.d.ts +2 -0
  171. package/package.json +14 -11
  172. package/src/PointerType.ts +6 -0
  173. package/src/RNGestureHandlerModule.ts +4 -49
  174. package/src/RNGestureHandlerModule.windows.ts +18 -100
  175. package/src/components/DrawerLayout.tsx +15 -0
  176. package/src/components/GestureHandlerRootView.android.tsx +13 -5
  177. package/src/components/GestureHandlerRootView.tsx +10 -5
  178. package/src/components/GestureHandlerRootView.web.tsx +10 -5
  179. package/src/getShadowNodeFromRef.ts +28 -6
  180. package/src/handlers/createHandler.tsx +6 -0
  181. package/src/handlers/gestureHandlerCommon.ts +7 -0
  182. package/src/handlers/gestures/GestureDetector.tsx +16 -2
  183. package/src/handlers/gestures/gesture.ts +6 -0
  184. package/src/index.ts +2 -0
  185. package/src/specs/NativeRNGestureHandlerModule.ts +26 -0
  186. package/src/web/handlers/FlingGestureHandler.ts +4 -0
  187. package/src/web/handlers/GestureHandler.ts +20 -2
  188. package/src/web/handlers/LongPressGestureHandler.ts +8 -5
  189. package/src/web/handlers/PanGestureHandler.ts +4 -0
  190. package/src/web/handlers/TapGestureHandler.ts +4 -0
  191. package/src/web/interfaces.ts +12 -17
  192. package/src/web/tools/GestureHandlerDelegate.ts +3 -0
  193. package/src/web/tools/GestureHandlerOrchestrator.ts +2 -2
  194. package/src/web/tools/GestureHandlerWebDelegate.ts +39 -0
  195. package/src/web/tools/NodeManager.ts +5 -1
  196. package/src/web/tools/PointerEventManager.ts +46 -10
  197. package/src/web/tools/TouchEventManager.ts +2 -8
  198. package/src/web/utils.ts +9 -0
  199. package/ios/Handlers/RNPinchHandler.m +0 -95
  200. package/ios/Handlers/RNRotationHandler.m +0 -93
  201. package/ios/RNGestureHandlerModule.h +0 -7
  202. package/lib/commonjs/RNGestureHandlerModule.macos.js +0 -149
  203. package/lib/commonjs/RNGestureHandlerModule.macos.js.map +0 -1
  204. package/lib/module/RNGestureHandlerModule.macos.js +0 -110
  205. package/lib/module/RNGestureHandlerModule.macos.js.map +0 -1
  206. package/lib/typescript/RNGestureHandlerModule.macos.d.ts +0 -47
  207. package/src/RNGestureHandlerModule.macos.ts +0 -133
  208. /package/{ios → apple}/Handlers/RNFlingHandler.h +0 -0
  209. /package/{ios → apple}/Handlers/RNForceTouchHandler.h +0 -0
  210. /package/{ios → apple}/Handlers/RNHoverHandler.h +0 -0
  211. /package/{ios → apple}/Handlers/RNLongPressHandler.h +0 -0
  212. /package/{ios → apple}/Handlers/RNManualHandler.h +0 -0
  213. /package/{ios → apple}/Handlers/RNNativeViewHandler.h +0 -0
  214. /package/{ios → apple}/Handlers/RNPanHandler.h +0 -0
  215. /package/{ios → apple}/Handlers/RNPinchHandler.h +0 -0
  216. /package/{ios → apple}/Handlers/RNRotationHandler.h +0 -0
  217. /package/{ios → apple}/Handlers/RNTapHandler.h +0 -0
  218. /package/{ios → apple}/RNGHTouchEventType.h +0 -0
  219. /package/{ios → apple}/RNGestureHandler.xcodeproj/project.pbxproj +0 -0
  220. /package/{ios → apple}/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  221. /package/{ios → apple}/RNGestureHandlerActionType.h +0 -0
  222. /package/{ios → apple}/RNGestureHandlerButtonComponentView.h +0 -0
  223. /package/{ios → apple}/RNGestureHandlerButtonComponentView.mm +0 -0
  224. /package/{ios → apple}/RNGestureHandlerButtonManager.h +0 -0
  225. /package/{ios → apple}/RNGestureHandlerDirection.h +0 -0
  226. /package/{ios → apple}/RNGestureHandlerRootViewComponentView.mm +0 -0
  227. /package/{ios → apple}/RNGestureHandlerState.h +0 -0
  228. /package/{ios → apple}/RNGestureHandlerStateManager.h +0 -0
  229. /package/{ios → apple}/RNRootViewGestureRecognizer.h +0 -0
@@ -5,7 +5,7 @@
5
5
 
6
6
  @implementation RNGestureHandlerPointerTracker {
7
7
  __weak RNGestureHandler *_gestureHandler;
8
- UITouch *_trackedPointers[MAX_POINTERS_COUNT];
8
+ RNGHUITouch *_trackedPointers[MAX_POINTERS_COUNT];
9
9
  int _trackedPointersCount;
10
10
  }
11
11
 
@@ -23,7 +23,7 @@
23
23
  return self;
24
24
  }
25
25
 
26
- - (int)registerTouch:(UITouch *)touch
26
+ - (int)registerTouch:(RNGHUITouch *)touch
27
27
  {
28
28
  for (int index = 0; index < MAX_POINTERS_COUNT; index++) {
29
29
  if (_trackedPointers[index] == nil) {
@@ -35,7 +35,7 @@
35
35
  return -1;
36
36
  }
37
37
 
38
- - (int)unregisterTouch:(UITouch *)touch
38
+ - (int)unregisterTouch:(RNGHUITouch *)touch
39
39
  {
40
40
  for (int index = 0; index < MAX_POINTERS_COUNT; index++) {
41
41
  if (_trackedPointers[index] == touch) {
@@ -47,7 +47,7 @@
47
47
  return -1;
48
48
  }
49
49
 
50
- - (int)findTouchIndex:(UITouch *)touch
50
+ - (int)findTouchIndex:(RNGHUITouch *)touch
51
51
  {
52
52
  for (int index = 0; index < MAX_POINTERS_COUNT; index++) {
53
53
  if (_trackedPointers[index] == touch) {
@@ -68,10 +68,15 @@
68
68
  return count;
69
69
  }
70
70
 
71
- - (NSDictionary *)extractPointerData:(int)index forTouch:(UITouch *)touch
71
+ - (NSDictionary *)extractPointerData:(int)index forTouch:(RNGHUITouch *)touch
72
72
  {
73
+ #if TARGET_OS_OSX
74
+ CGPoint absolutePos = [touch locationInWindow];
75
+ CGPoint relativePos = [touch.window.contentView convertPoint:absolutePos fromView:_gestureHandler.recognizer.view];
76
+ #else
73
77
  CGPoint relativePos = [touch locationInView:_gestureHandler.recognizer.view];
74
78
  CGPoint absolutePos = [touch locationInView:_gestureHandler.recognizer.view.window];
79
+ #endif
75
80
 
76
81
  return @{
77
82
  @"id" : @(index),
@@ -90,7 +95,7 @@
90
95
  int nextIndex = 0;
91
96
 
92
97
  for (int i = 0; i < MAX_POINTERS_COUNT; i++) {
93
- UITouch *touch = _trackedPointers[i];
98
+ RNGHUITouch *touch = _trackedPointers[i];
94
99
  if (touch != nil) {
95
100
  data[nextIndex++] = [self extractPointerData:i forTouch:touch];
96
101
  }
@@ -99,7 +104,7 @@
99
104
  _allPointersData = [[NSArray alloc] initWithObjects:data count:registeredTouches];
100
105
  }
101
106
 
102
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
107
+ - (void)touchesBegan:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
103
108
  {
104
109
  if (!_gestureHandler.needsPointerData) {
105
110
  return;
@@ -110,7 +115,7 @@
110
115
  NSDictionary *data[touches.count];
111
116
 
112
117
  for (int i = 0; i < [touches count]; i++) {
113
- UITouch *touch = [[touches allObjects] objectAtIndex:i];
118
+ RNGHUITouch *touch = [[touches allObjects] objectAtIndex:i];
114
119
  int index = [self registerTouch:touch];
115
120
  if (index >= 0) {
116
121
  _trackedPointersCount++;
@@ -125,7 +130,7 @@
125
130
  [self sendEvent];
126
131
  }
127
132
 
128
- - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
133
+ - (void)touchesMoved:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
129
134
  {
130
135
  if (!_gestureHandler.needsPointerData) {
131
136
  return;
@@ -136,7 +141,7 @@
136
141
  NSDictionary *data[touches.count];
137
142
 
138
143
  for (int i = 0; i < [touches count]; i++) {
139
- UITouch *touch = [[touches allObjects] objectAtIndex:i];
144
+ RNGHUITouch *touch = [[touches allObjects] objectAtIndex:i];
140
145
  int index = [self findTouchIndex:touch];
141
146
  data[i] = [self extractPointerData:index forTouch:touch];
142
147
  }
@@ -146,7 +151,7 @@
146
151
  [self sendEvent];
147
152
  }
148
153
 
149
- - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
154
+ - (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
150
155
  {
151
156
  if (!_gestureHandler.needsPointerData) {
152
157
  return;
@@ -160,7 +165,7 @@
160
165
  NSDictionary *data[touches.count];
161
166
 
162
167
  for (int i = 0; i < [touches count]; i++) {
163
- UITouch *touch = [[touches allObjects] objectAtIndex:i];
168
+ RNGHUITouch *touch = [[touches allObjects] objectAtIndex:i];
164
169
  int index = [self unregisterTouch:touch];
165
170
  if (index >= 0) {
166
171
  _trackedPointersCount--;
@@ -173,7 +178,7 @@
173
178
  [self sendEvent];
174
179
  }
175
180
 
176
- - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
181
+ - (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
177
182
  {
178
183
  if (!_gestureHandler.needsPointerData) {
179
184
  return;
@@ -213,7 +218,7 @@
213
218
  NSDictionary *data[registeredTouches];
214
219
 
215
220
  for (int i = 0; i < MAX_POINTERS_COUNT; i++) {
216
- UITouch *touch = _trackedPointers[i];
221
+ RNGHUITouch *touch = _trackedPointers[i];
217
222
  if (touch != nil) {
218
223
  data[nextIndex++] = [self extractPointerData:i forTouch:touch];
219
224
  [self unregisterTouch:touch];
@@ -0,0 +1,8 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ typedef NS_ENUM(NSInteger, RNGestureHandlerPointerType) {
4
+ RNGestureHandlerTouch = 0,
5
+ RNGestureHandlerStylus,
6
+ RNGestureHandlerMouse,
7
+ RNGestureHandlerOtherPointer,
8
+ };
@@ -13,7 +13,7 @@
13
13
  - (nullable RNGestureHandler *)handlerWithTag:(nonnull NSNumber *)handlerTag;
14
14
  - (void)registerGestureHandler:(nonnull RNGestureHandler *)gestureHandler;
15
15
  - (void)attachHandlerWithTag:(nonnull NSNumber *)handlerTag
16
- toView:(nonnull UIView *)view
16
+ toView:(nonnull RNGHUIView *)view
17
17
  withActionType:(RNGestureHandlerActionType)actionType;
18
18
  - (void)dropHandlerWithTag:(nonnull NSNumber *)handlerTag;
19
19
  - (void)dropAllHandlers;
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  - (void)attachHandlerWithTag:(NSNumber *)handlerTag
36
- toView:(UIView *)view
36
+ toView:(RNGHUIView *)view
37
37
  withActionType:(RNGestureHandlerActionType)actionType
38
38
  {
39
39
  RNGestureHandler *handler = _handlers[handlerTag];
@@ -1,8 +1,16 @@
1
+ #if !TARGET_OS_OSX
1
2
  #import <UIKit/UIGestureRecognizerSubclass.h>
3
+ #else
4
+ #import <Appkit/NSGestureRecognizer.h>
5
+ #endif
2
6
 
3
7
  @class RNGestureHandler;
4
8
 
9
+ #if !TARGET_OS_OSX
5
10
  @interface RNManualActivationRecognizer : UIGestureRecognizer <UIGestureRecognizerDelegate>
11
+ #else
12
+ @interface RNManualActivationRecognizer : NSGestureRecognizer <NSGestureRecognizerDelegate>
13
+ #endif
6
14
 
7
15
  - (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler;
8
16
  - (void)fail;
@@ -12,7 +12,9 @@
12
12
  _handler = gestureHandler;
13
13
  _activePointers = 0;
14
14
  self.delegate = self;
15
+ #if !TARGET_OS_OSX
15
16
  self.cancelsTouchesInView = NO;
17
+ #endif
16
18
  }
17
19
  return self;
18
20
  }
@@ -25,19 +27,35 @@
25
27
  }
26
28
  }
27
29
 
28
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
30
+ #if TARGET_OS_OSX
31
+ - (void)mouseUp:(NSEvent *)event
29
32
  {
30
- [super touchesBegan:touches withEvent:event];
33
+ [super mouseUp:event];
31
34
 
32
- _activePointers += touches.count;
35
+ _activePointers -= 1;
33
36
  }
34
37
 
35
- - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
38
+ - (void)mouseDown:(NSEvent *)event
36
39
  {
37
- [super touchesMoved:touches withEvent:event];
40
+ [super mouseDown:event];
41
+
42
+ _activePointers += 1;
43
+
44
+ if (_activePointers == 0) {
45
+ self.state = UIGestureRecognizerStateBegan;
46
+ }
38
47
  }
39
48
 
40
- - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
49
+ #else
50
+
51
+ - (void)touchesBegan:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
52
+ {
53
+ [super touchesBegan:touches withEvent:event];
54
+
55
+ _activePointers += touches.count;
56
+ }
57
+
58
+ - (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
41
59
  {
42
60
  [super touchesEnded:touches withEvent:event];
43
61
 
@@ -48,7 +66,7 @@
48
66
  }
49
67
  }
50
68
 
51
- - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
69
+ - (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
52
70
  {
53
71
  [super touchesCancelled:touches withEvent:event];
54
72
 
@@ -56,6 +74,8 @@
56
74
  [self reset];
57
75
  }
58
76
 
77
+ #endif
78
+
59
79
  - (void)reset
60
80
  {
61
81
  self.enabled = YES;
@@ -8,7 +8,9 @@
8
8
 
9
9
  #import "RNRootViewGestureRecognizer.h"
10
10
 
11
+ #if !TARGET_OS_OSX
11
12
  #import <UIKit/UIGestureRecognizerSubclass.h>
13
+ #endif
12
14
 
13
15
  #ifdef RCT_NEW_ARCH_ENABLED
14
16
  #import <React/RCTSurfaceTouchHandler.h>
@@ -24,10 +26,14 @@
24
26
 
25
27
  - (instancetype)init
26
28
  {
29
+ #if !TARGET_OS_OSX
27
30
  if (self = [super init]) {
28
31
  self.delaysTouchesEnded = NO;
29
32
  self.delaysTouchesBegan = NO;
30
33
  }
34
+ #else
35
+ self = [super init];
36
+ #endif
31
37
  return self;
32
38
  }
33
39
 
@@ -67,18 +73,18 @@
67
73
  return [super canBePreventedByGestureRecognizer:preventingGestureRecognizer];
68
74
  }
69
75
 
70
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
76
+ - (void)interactionsBegan:(NSSet *)touches withEvent:(UIEvent *)event
71
77
  {
72
78
  _active = YES;
73
79
  self.state = UIGestureRecognizerStatePossible;
74
80
  }
75
81
 
76
- - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
82
+ - (void)interactionsMoved:(NSSet *)touches withEvent:(UIEvent *)event
77
83
  {
78
84
  self.state = UIGestureRecognizerStatePossible;
79
85
  }
80
86
 
81
- - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
87
+ - (void)interactionsEnded:(NSSet *)touches withEvent:(UIEvent *)event
82
88
  {
83
89
  if (self.state == UIGestureRecognizerStateBegan || self.state == UIGestureRecognizerStateChanged) {
84
90
  self.state = UIGestureRecognizerStateEnded;
@@ -89,13 +95,75 @@
89
95
  _active = NO;
90
96
  }
91
97
 
92
- - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
98
+ - (void)interactionsCancelled:(NSSet *)touches withEvent:(UIEvent *)event
93
99
  {
94
100
  self.state = UIGestureRecognizerStateCancelled;
95
101
  [self reset];
96
102
  _active = NO;
97
103
  }
98
104
 
105
+ #if TARGET_OS_OSX
106
+ - (void)mouseDown:(NSEvent *)event
107
+ {
108
+ [super mouseDown:event];
109
+ [self interactionsBegan:[NSSet setWithObject:event] withEvent:event];
110
+ }
111
+
112
+ - (void)rightMouseDown:(NSEvent *)event
113
+ {
114
+ [super rightMouseDown:event];
115
+ [self interactionsBegan:[NSSet setWithObject:event] withEvent:event];
116
+ }
117
+
118
+ - (void)mouseDragged:(NSEvent *)event
119
+ {
120
+ [super mouseDragged:event];
121
+ [self interactionsMoved:[NSSet setWithObject:event] withEvent:event];
122
+ }
123
+
124
+ - (void)rightMouseDragged:(NSEvent *)event
125
+ {
126
+ [super rightMouseDragged:event];
127
+ [self interactionsMoved:[NSSet setWithObject:event] withEvent:event];
128
+ }
129
+
130
+ - (void)mouseUp:(NSEvent *)event
131
+ {
132
+ [super mouseUp:event];
133
+ [self interactionsEnded:[NSSet setWithObject:event] withEvent:event];
134
+ }
135
+
136
+ - (void)rightMouseUp:(NSEvent *)event
137
+ {
138
+ [super rightMouseUp:event];
139
+ [self interactionsEnded:[NSSet setWithObject:event] withEvent:event];
140
+ }
141
+ #else
142
+ - (void)touchesBegan:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
143
+ {
144
+ [super touchesBegan:touches withEvent:event];
145
+ [self interactionsBegan:[NSSet setWithObject:event] withEvent:event];
146
+ }
147
+
148
+ - (void)touchesMoved:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
149
+ {
150
+ [super touchesMoved:touches withEvent:event];
151
+ [self interactionsMoved:[NSSet setWithObject:event] withEvent:event];
152
+ }
153
+
154
+ - (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
155
+ {
156
+ [super touchesEnded:touches withEvent:event];
157
+ [self interactionsEnded:[NSSet setWithObject:event] withEvent:event];
158
+ }
159
+
160
+ - (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
161
+ {
162
+ [super touchesCancelled:touches withEvent:event];
163
+ [self interactionsCancelled:[NSSet setWithObject:event] withEvent:event];
164
+ }
165
+ #endif
166
+
99
167
  - (void)blockOtherRecognizers
100
168
  {
101
169
  if (_active) {
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PointerType = void 0;
7
+ let PointerType;
8
+ exports.PointerType = PointerType;
9
+
10
+ (function (PointerType) {
11
+ PointerType[PointerType["TOUCH"] = 0] = "TOUCH";
12
+ PointerType[PointerType["STYLUS"] = 1] = "STYLUS";
13
+ PointerType[PointerType["MOUSE"] = 2] = "MOUSE";
14
+ PointerType[PointerType["OTHER"] = 3] = "OTHER";
15
+ })(PointerType || (exports.PointerType = PointerType = {}));
16
+ //# sourceMappingURL=PointerType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PointerType.ts"],"names":["PointerType"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum PointerType {\n TOUCH,\n STYLUS,\n MOUSE,\n OTHER,\n}\n"]}
@@ -5,25 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _reactNative = require("react-native");
8
+ var _NativeRNGestureHandlerModule = _interopRequireDefault(require("./specs/NativeRNGestureHandlerModule"));
9
9
 
10
- var _utils = require("./utils");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
- const {
13
- RNGestureHandlerModule
14
- } = _reactNative.NativeModules;
15
-
16
- if (RNGestureHandlerModule == null) {
17
- console.error((0, _utils.tagMessage)(`react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).
18
-
19
- For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation`.split('\n').map(line => line.trim()).join('\n')));
20
- }
21
-
22
- if (RNGestureHandlerModule && RNGestureHandlerModule.flushOperations === undefined) {
23
- RNGestureHandlerModule.flushOperations = () => {// NO-OP if not defined
24
- };
25
- }
26
-
27
- var _default = RNGestureHandlerModule;
12
+ // Reexport the native module spec used by codegen. The relevant files are inluded on Android
13
+ // to ensure the compatibility with the old arch, while iOS doesn't require those at all.
14
+ var _default = _NativeRNGestureHandlerModule.default;
28
15
  exports.default = _default;
29
16
  //# sourceMappingURL=RNGestureHandlerModule.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["RNGestureHandlerModule","NativeModules","console","error","split","map","line","trim","join","flushOperations","undefined"],"mappings":";;;;;;;AAAA;;AAEA;;AACA,MAAM;AAAEA,EAAAA;AAAF,IAA6BC,0BAAnC;;AAEA,IAAID,sBAAsB,IAAI,IAA9B,EAAoC;AAClCE,EAAAA,OAAO,CAACC,KAAR,CACE,uBACG;AACP;AACA,gIAFM,CAGGC,KAHH,CAGS,IAHT,EAIGC,GAJH,CAIQC,IAAD,IAAUA,IAAI,CAACC,IAAL,EAJjB,EAKGC,IALH,CAKQ,IALR,CADF,CADF;AAUD;;AAED,IACER,sBAAsB,IACtBA,sBAAsB,CAACS,eAAvB,KAA2CC,SAF7C,EAGE;AACAV,EAAAA,sBAAsB,CAACS,eAAvB,GAAyC,MAAM,CAC7C;AACD,GAFD;AAGD;;eAwBcT,sB","sourcesContent":["import { NativeModules } from 'react-native';\nimport { ActionType } from './ActionType';\nimport { tagMessage } from './utils';\nconst { RNGestureHandlerModule } = NativeModules;\n\nif (RNGestureHandlerModule == null) {\n console.error(\n tagMessage(\n `react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).\n\n For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation`\n .split('\\n')\n .map((line) => line.trim())\n .join('\\n')\n )\n );\n}\n\nif (\n RNGestureHandlerModule &&\n RNGestureHandlerModule.flushOperations === undefined\n) {\n RNGestureHandlerModule.flushOperations = () => {\n // NO-OP if not defined\n };\n}\n\nexport type RNGestureHandlerModuleProps = {\n handleSetJSResponder: (tag: number, blockNativeResponder: boolean) => void;\n handleClearJSResponder: () => void;\n createGestureHandler: (\n handlerName: string,\n handlerTag: number,\n config: Readonly<Record<string, unknown>>\n ) => void;\n attachGestureHandler: (\n handlerTag: number,\n newView: number,\n actionType: ActionType\n ) => void;\n updateGestureHandler: (\n handlerTag: number,\n newConfig: Readonly<Record<string, unknown>>\n ) => void;\n dropGestureHandler: (handlerTag: number) => void;\n install: () => void;\n flushOperations: () => void;\n};\n\nexport default RNGestureHandlerModule as RNGestureHandlerModuleProps;\n"]}
1
+ {"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["Module"],"mappings":";;;;;;;AAGA;;;;AAHA;AACA;eAGeA,qC","sourcesContent":["// Reexport the native module spec used by codegen. The relevant files are inluded on Android\n// to ensure the compatibility with the old arch, while iOS doesn't require those at all.\n\nimport Module from './specs/NativeRNGestureHandlerModule';\nexport default Module;\n"]}
@@ -3,15 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.HammerGestures = exports.Gestures = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _EnableNewWebImplementation = require("./EnableNewWebImplementation");
11
-
12
- var _InteractionManager = _interopRequireDefault(require("./web/tools/InteractionManager"));
13
-
14
- var _NodeManager = _interopRequireDefault(require("./web/tools/NodeManager"));
6
+ exports.default = exports.Gestures = void 0;
15
7
 
16
8
  var _PanGestureHandler = _interopRequireDefault(require("./web/handlers/PanGestureHandler"));
17
9
 
@@ -29,32 +21,9 @@ var _NativeViewGestureHandler = _interopRequireDefault(require("./web/handlers/N
29
21
 
30
22
  var _ManualGestureHandler = _interopRequireDefault(require("./web/handlers/ManualGestureHandler"));
31
23
 
32
- var HammerNodeManager = _interopRequireWildcard(require("./web_hammer/NodeManager"));
33
-
34
- var _NativeViewGestureHandler2 = _interopRequireDefault(require("./web_hammer/NativeViewGestureHandler"));
35
-
36
- var _PanGestureHandler2 = _interopRequireDefault(require("./web_hammer/PanGestureHandler"));
37
-
38
- var _TapGestureHandler2 = _interopRequireDefault(require("./web_hammer/TapGestureHandler"));
39
-
40
- var _LongPressGestureHandler2 = _interopRequireDefault(require("./web_hammer/LongPressGestureHandler"));
41
-
42
- var _PinchGestureHandler2 = _interopRequireDefault(require("./web_hammer/PinchGestureHandler"));
43
-
44
- var _RotationGestureHandler2 = _interopRequireDefault(require("./web_hammer/RotationGestureHandler"));
45
-
46
- var _FlingGestureHandler2 = _interopRequireDefault(require("./web_hammer/FlingGestureHandler"));
47
-
48
- var _GestureHandlerWebDelegate = require("./web/tools/GestureHandlerWebDelegate");
49
-
50
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
51
-
52
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
53
-
54
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
55
25
 
56
- //GestureHandlers
57
- //Hammer Handlers
26
+ // GestureHandlers
58
27
  const Gestures = {
59
28
  NativeViewGestureHandler: _NativeViewGestureHandler.default,
60
29
  PanGestureHandler: _PanGestureHandler.default,
@@ -66,16 +35,6 @@ const Gestures = {
66
35
  ManualGestureHandler: _ManualGestureHandler.default
67
36
  };
68
37
  exports.Gestures = Gestures;
69
- const HammerGestures = {
70
- NativeViewGestureHandler: _NativeViewGestureHandler2.default,
71
- PanGestureHandler: _PanGestureHandler2.default,
72
- TapGestureHandler: _TapGestureHandler2.default,
73
- LongPressGestureHandler: _LongPressGestureHandler2.default,
74
- PinchGestureHandler: _PinchGestureHandler2.default,
75
- RotationGestureHandler: _RotationGestureHandler2.default,
76
- FlingGestureHandler: _FlingGestureHandler2.default
77
- };
78
- exports.HammerGestures = HammerGestures;
79
38
  var _default = {
80
39
  handleSetJSResponder(_tag, _blockNativeResponder) {// NO-OP
81
40
  },
@@ -83,75 +42,24 @@ var _default = {
83
42
  handleClearJSResponder() {// NO-OP
84
43
  },
85
44
 
86
- createGestureHandler(handlerName, handlerTag, config) {
87
- if ((0, _EnableNewWebImplementation.isNewWebImplementationEnabled)()) {
88
- if (!(handlerName in Gestures)) {
89
- throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
90
- }
91
-
92
- const GestureClass = Gestures[handlerName];
93
-
94
- _NodeManager.default.createGestureHandler(handlerTag, new GestureClass(new _GestureHandlerWebDelegate.GestureHandlerWebDelegate()));
95
-
96
- _InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
97
- } else {
98
- if (!(handlerName in HammerGestures)) {
99
- throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
100
- } // @ts-ignore If it doesn't exist, the error is thrown
101
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
102
-
103
-
104
- const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
105
-
106
- HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
107
- }
108
-
109
- this.updateGestureHandler(handlerTag, config);
45
+ createGestureHandler(_handlerName, _handlerTag, _config) {// NO-OP
110
46
  },
111
47
 
112
- attachGestureHandler(handlerTag, // eslint-disable-next-line @typescript-eslint/no-explicit-any
113
- newView, _actionType, propsRef) {
114
- if (!(newView instanceof HTMLElement || newView instanceof _react.default.Component)) {
115
- return;
116
- }
117
-
118
- if ((0, _EnableNewWebImplementation.isNewWebImplementationEnabled)()) {
119
- //@ts-ignore Types should be HTMLElement or React.Component
120
- _NodeManager.default.getHandler(handlerTag).init(newView, propsRef);
121
- } else {
122
- //@ts-ignore Types should be HTMLElement or React.Component
123
- HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
124
- }
48
+ attachGestureHandler(_handlerTag, // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
+ _newView, _actionType, _propsRef) {// NO-OP
125
50
  },
126
51
 
127
- updateGestureHandler(handlerTag, newConfig) {
128
- if ((0, _EnableNewWebImplementation.isNewWebImplementationEnabled)()) {
129
- _NodeManager.default.getHandler(handlerTag).updateGestureConfig(newConfig);
130
-
131
- _InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), newConfig);
132
- } else {
133
- HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
134
- }
52
+ updateGestureHandler(_handlerTag, _newConfig) {// NO-OP
135
53
  },
136
54
 
137
- getGestureHandlerNode(handlerTag) {
138
- if ((0, _EnableNewWebImplementation.isNewWebImplementationEnabled)()) {
139
- return _NodeManager.default.getHandler(handlerTag);
140
- } else {
141
- return HammerNodeManager.getHandler(handlerTag);
142
- }
55
+ getGestureHandlerNode(_handlerTag) {// NO-OP
143
56
  },
144
57
 
145
- dropGestureHandler(handlerTag) {
146
- if ((0, _EnableNewWebImplementation.isNewWebImplementationEnabled)()) {
147
- _NodeManager.default.dropGestureHandler(handlerTag);
148
- } else {
149
- HammerNodeManager.dropGestureHandler(handlerTag);
150
- }
58
+ dropGestureHandler(_handlerTag) {// NO-OP
151
59
  },
152
60
 
153
- // eslint-disable-next-line @typescript-eslint/no-empty-function
154
- flushOperations() {}
61
+ flushOperations() {// NO-OP
62
+ }
155
63
 
156
64
  };
157
65
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.windows.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","GestureHandlerWebDelegate","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","React","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"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","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\nimport { isNewWebImplementationEnabled } from './EnableNewWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\nimport { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(_tag: number, _blockNativeResponder: boolean) {\n // NO-OP\n },\n handleClearJSResponder() {\n // NO-OP\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isNewWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(\n handlerTag,\n new GestureClass(new GestureHandlerWebDelegate())\n );\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n config as unknown as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, config as unknown as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (\n !(newView instanceof HTMLElement || newView instanceof React.Component)\n ) {\n return;\n }\n\n if (isNewWebImplementationEnabled()) {\n //@ts-ignore Types should be HTMLElement or React.Component\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n //@ts-ignore Types should be HTMLElement or React.Component\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
1
+ {"version":3,"sources":["RNGestureHandlerModule.windows.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","_handlerName","_handlerTag","_config","attachGestureHandler","_newView","_actionType","_propsRef","updateGestureHandler","_newConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AARA;AAWO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,wBAAwB,EAAxBA,iCADsB;AAEtBC,EAAAA,iBAAiB,EAAjBA,0BAFsB;AAGtBC,EAAAA,iBAAiB,EAAjBA,0BAHsB;AAItBC,EAAAA,uBAAuB,EAAvBA,gCAJsB;AAKtBC,EAAAA,mBAAmB,EAAnBA,4BALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA,+BANsB;AAOtBC,EAAAA,mBAAmB,EAAnBA,4BAPsB;AAQtBC,EAAAA,oBAAoB,EAApBA;AARsB,CAAjB;;eAWQ;AACbC,EAAAA,oBAAoB,CAACC,IAAD,EAAeC,qBAAf,EAA+C,CACjE;AACD,GAHY;;AAIbC,EAAAA,sBAAsB,GAAG,CACvB;AACD,GANY;;AAObC,EAAAA,oBAAoB,CAClBC,YADkB,EAElBC,WAFkB,EAGlBC,OAHkB,EAIlB,CACA;AACD,GAbY;;AAcbC,EAAAA,oBAAoB,CAClBF,WADkB,EAElB;AACAG,EAAAA,QAHkB,EAIlBC,WAJkB,EAKlBC,SALkB,EAMlB,CACA;AACD,GAtBY;;AAuBbC,EAAAA,oBAAoB,CAACN,WAAD,EAAsBO,UAAtB,EAA0C,CAC5D;AACD,GAzBY;;AA0BbC,EAAAA,qBAAqB,CAACR,WAAD,EAAsB,CACzC;AACD,GA5BY;;AA6BbS,EAAAA,kBAAkB,CAACT,WAAD,EAAsB,CACtC;AACD,GA/BY;;AAgCbU,EAAAA,eAAe,GAAG,CAChB;AACD;;AAlCY,C","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\n\n// GestureHandlers\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\nimport { Config } from './web/interfaces';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(_tag: number, _blockNativeResponder: boolean) {\n // NO-OP\n },\n handleClearJSResponder() {\n // NO-OP\n },\n createGestureHandler<T>(\n _handlerName: keyof typeof Gestures,\n _handlerTag: number,\n _config: T\n ) {\n // NO-OP\n },\n attachGestureHandler(\n _handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _newView: any,\n _actionType: ActionType,\n _propsRef: React.RefObject<unknown>\n ) {\n // NO-OP\n },\n updateGestureHandler(_handlerTag: number, _newConfig: Config) {\n // NO-OP\n },\n getGestureHandlerNode(_handlerTag: number) {\n // NO-OP\n },\n dropGestureHandler(_handlerTag: number) {\n // NO-OP\n },\n flushOperations() {\n // NO-OP\n },\n};\n"]}
@@ -512,6 +512,8 @@ class DrawerLayout extends React.Component {
512
512
  , {
513
513
  userSelect: this.props.userSelect,
514
514
  activeCursor: this.props.activeCursor,
515
+ mouseButton: this.props.mouseButton,
516
+ enableContextMenu: this.props.enableContextMenu,
515
517
  ref: this.setPanGestureRef,
516
518
  hitSlop: hitSlop,
517
519
  activeOffsetX: gestureOrientation * minSwipeDistance,