react-native-gesture-handler 2.6.0 → 2.6.2

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 (196) hide show
  1. package/android/build.gradle +2 -2
  2. package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  3. package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcuserdata/jakubpiasecki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  4. package/ios/RNGestureHandler.xcodeproj/xcuserdata/jakubpiasecki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
  5. package/lib/commonjs/EnableExperimentalWebImplementation.js +7 -0
  6. package/lib/commonjs/EnableExperimentalWebImplementation.js.map +1 -1
  7. package/lib/commonjs/RNGestureHandlerModule.js +1 -1
  8. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  9. package/lib/commonjs/RNGestureHandlerModule.macos.js +22 -13
  10. package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
  11. package/lib/commonjs/RNGestureHandlerModule.web.js +23 -10
  12. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  13. package/lib/commonjs/components/GestureComponents.js +6 -4
  14. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  15. package/lib/commonjs/components/GestureComponents.web.js +1 -1
  16. package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
  17. package/lib/commonjs/components/Swipeable.js +4 -4
  18. package/lib/commonjs/components/Swipeable.js.map +1 -1
  19. package/lib/commonjs/fabric/RNGestureHandlerButtonNativeComponent.js +1 -5
  20. package/lib/commonjs/fabric/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  21. package/lib/commonjs/fabric/RNGestureHandlerRootViewNativeComponent.js +1 -5
  22. package/lib/commonjs/fabric/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  23. package/lib/commonjs/handlers/gestures/GestureDetector.js +4 -2
  24. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  25. package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -20
  26. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
  27. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +32 -0
  28. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
  29. package/lib/commonjs/utils.js +10 -6
  30. package/lib/commonjs/utils.js.map +1 -1
  31. package/lib/commonjs/web/detectors/RotationGestureDetector.js +13 -17
  32. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  33. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +3 -14
  34. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  35. package/lib/commonjs/web/handlers/FlingGestureHandler.js +37 -12
  36. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  37. package/lib/commonjs/web/handlers/GestureHandler.js +330 -79
  38. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  39. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +23 -18
  40. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  41. package/lib/commonjs/web/handlers/ManualGestureHandler.js +51 -0
  42. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
  43. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +81 -22
  44. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  45. package/lib/commonjs/web/handlers/PanGestureHandler.js +57 -40
  46. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  47. package/lib/commonjs/web/handlers/PinchGestureHandler.js +43 -34
  48. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  49. package/lib/commonjs/web/handlers/RotationGestureHandler.js +45 -39
  50. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  51. package/lib/commonjs/web/handlers/TapGestureHandler.js +52 -50
  52. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  53. package/lib/commonjs/web/interfaces.js +22 -1
  54. package/lib/commonjs/web/interfaces.js.map +1 -1
  55. package/lib/commonjs/web/tools/EventManager.js +40 -96
  56. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  57. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +109 -30
  58. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  59. package/lib/commonjs/web/tools/InteractionManager.js +24 -10
  60. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  61. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  62. package/lib/commonjs/web/tools/PointerEventManager.js +130 -0
  63. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
  64. package/lib/commonjs/web/tools/PointerTracker.js +97 -7
  65. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  66. package/lib/commonjs/web/tools/TouchEventManager.js +138 -0
  67. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
  68. package/lib/commonjs/web/utils.js +15 -0
  69. package/lib/commonjs/web/utils.js.map +1 -0
  70. package/lib/module/EnableExperimentalWebImplementation.js +5 -0
  71. package/lib/module/EnableExperimentalWebImplementation.js.map +1 -1
  72. package/lib/module/RNGestureHandlerModule.js +1 -1
  73. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  74. package/lib/module/RNGestureHandlerModule.macos.js +21 -14
  75. package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
  76. package/lib/module/RNGestureHandlerModule.web.js +22 -11
  77. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  78. package/lib/module/components/GestureComponents.js +6 -4
  79. package/lib/module/components/GestureComponents.js.map +1 -1
  80. package/lib/module/components/GestureComponents.web.js +1 -1
  81. package/lib/module/components/GestureComponents.web.js.map +1 -1
  82. package/lib/module/components/Swipeable.js +4 -4
  83. package/lib/module/components/Swipeable.js.map +1 -1
  84. package/lib/module/fabric/RNGestureHandlerButtonNativeComponent.js +1 -5
  85. package/lib/module/fabric/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  86. package/lib/module/fabric/RNGestureHandlerRootViewNativeComponent.js +1 -4
  87. package/lib/module/fabric/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  88. package/lib/module/handlers/gestures/GestureDetector.js +5 -3
  89. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  90. package/lib/module/handlers/gestures/eventReceiver.js +14 -20
  91. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
  92. package/lib/module/handlers/gestures/gestureStateManager.web.js +21 -0
  93. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
  94. package/lib/module/utils.js +7 -6
  95. package/lib/module/utils.js.map +1 -1
  96. package/lib/module/web/detectors/RotationGestureDetector.js +13 -17
  97. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  98. package/lib/module/web/detectors/ScaleGestureDetector.js +3 -14
  99. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  100. package/lib/module/web/handlers/FlingGestureHandler.js +37 -12
  101. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  102. package/lib/module/web/handlers/GestureHandler.js +324 -79
  103. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  104. package/lib/module/web/handlers/LongPressGestureHandler.js +23 -18
  105. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  106. package/lib/module/web/handlers/ManualGestureHandler.js +39 -0
  107. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
  108. package/lib/module/web/handlers/NativeViewGestureHandler.js +80 -22
  109. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  110. package/lib/module/web/handlers/PanGestureHandler.js +57 -41
  111. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  112. package/lib/module/web/handlers/PinchGestureHandler.js +43 -33
  113. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  114. package/lib/module/web/handlers/RotationGestureHandler.js +45 -38
  115. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  116. package/lib/module/web/handlers/TapGestureHandler.js +52 -50
  117. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  118. package/lib/module/web/interfaces.js +19 -0
  119. package/lib/module/web/interfaces.js.map +1 -1
  120. package/lib/module/web/tools/EventManager.js +39 -95
  121. package/lib/module/web/tools/EventManager.js.map +1 -1
  122. package/lib/module/web/tools/GestureHandlerOrchestrator.js +107 -30
  123. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  124. package/lib/module/web/tools/InteractionManager.js +24 -10
  125. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  126. package/lib/module/web/tools/NodeManager.js.map +1 -1
  127. package/lib/module/web/tools/PointerEventManager.js +116 -0
  128. package/lib/module/web/tools/PointerEventManager.js.map +1 -0
  129. package/lib/module/web/tools/PointerTracker.js +97 -7
  130. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  131. package/lib/module/web/tools/TouchEventManager.js +124 -0
  132. package/lib/module/web/tools/TouchEventManager.js.map +1 -0
  133. package/lib/module/web/utils.js +8 -0
  134. package/lib/module/web/utils.js.map +1 -0
  135. package/lib/typescript/RNGestureHandlerModule.macos.d.ts +6 -3
  136. package/lib/typescript/RNGestureHandlerModule.web.d.ts +5 -2
  137. package/lib/typescript/components/Swipeable.d.ts +3 -3
  138. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +1 -1
  139. package/lib/typescript/fabric/RNGestureHandlerButtonNativeComponent.d.ts +3 -3
  140. package/lib/typescript/fabric/RNGestureHandlerRootViewNativeComponent.d.ts +3 -2
  141. package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
  142. package/lib/typescript/utils.d.ts +4 -0
  143. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
  144. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +6 -7
  145. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +12 -10
  146. package/lib/typescript/web/handlers/GestureHandler.d.ts +42 -32
  147. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +6 -9
  148. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +11 -0
  149. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +15 -6
  150. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +15 -23
  151. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +11 -12
  152. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +12 -12
  153. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +11 -14
  154. package/lib/typescript/web/interfaces.d.ts +50 -10
  155. package/lib/typescript/web/tools/EventManager.d.ts +28 -26
  156. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +4 -2
  157. package/lib/typescript/web/tools/InteractionManager.d.ts +3 -0
  158. package/lib/typescript/web/tools/NodeManager.d.ts +3 -3
  159. package/lib/typescript/web/tools/PointerEventManager.d.ts +6 -0
  160. package/lib/typescript/web/tools/PointerTracker.d.ts +29 -5
  161. package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
  162. package/lib/typescript/web/utils.d.ts +4 -0
  163. package/package.json +2 -2
  164. package/src/EnableExperimentalWebImplementation.ts +9 -0
  165. package/src/RNGestureHandlerModule.macos.ts +28 -13
  166. package/src/RNGestureHandlerModule.ts +4 -1
  167. package/src/RNGestureHandlerModule.web.ts +20 -7
  168. package/src/components/GestureComponents.tsx +12 -16
  169. package/src/components/GestureComponents.web.tsx +1 -1
  170. package/src/components/Swipeable.tsx +11 -7
  171. package/src/fabric/RNGestureHandlerButtonNativeComponent.ts +2 -12
  172. package/src/fabric/RNGestureHandlerRootViewNativeComponent.ts +2 -8
  173. package/src/handlers/gestures/GestureDetector.tsx +8 -4
  174. package/src/handlers/gestures/eventReceiver.ts +23 -24
  175. package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
  176. package/src/utils.ts +6 -6
  177. package/src/web/detectors/RotationGestureDetector.ts +20 -52
  178. package/src/web/detectors/ScaleGestureDetector.ts +9 -45
  179. package/src/web/handlers/FlingGestureHandler.ts +45 -22
  180. package/src/web/handlers/GestureHandler.ts +365 -97
  181. package/src/web/handlers/LongPressGestureHandler.ts +30 -24
  182. package/src/web/handlers/ManualGestureHandler.ts +39 -0
  183. package/src/web/handlers/NativeViewGestureHandler.ts +81 -24
  184. package/src/web/handlers/PanGestureHandler.ts +68 -53
  185. package/src/web/handlers/PinchGestureHandler.ts +47 -44
  186. package/src/web/handlers/RotationGestureHandler.ts +52 -51
  187. package/src/web/handlers/TapGestureHandler.ts +74 -56
  188. package/src/web/interfaces.ts +57 -10
  189. package/src/web/tools/EventManager.ts +58 -148
  190. package/src/web/tools/GestureHandlerOrchestrator.ts +115 -47
  191. package/src/web/tools/InteractionManager.ts +25 -9
  192. package/src/web/tools/NodeManager.ts +6 -6
  193. package/src/web/tools/PointerEventManager.ts +134 -0
  194. package/src/web/tools/PointerTracker.ts +120 -10
  195. package/src/web/tools/TouchEventManager.ts +167 -0
  196. package/src/web/utils.ts +8 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["TouchEventManager.ts"],"names":["TouchEventManager","EventManager","setListeners","view","addEventListener","event","i","changedTouches","length","adaptedEvent","mapEvent","EventTypes","DOWN","TouchEventType","x","y","touchType","markAsInBounds","pointerId","activePointersCounter","eventType","ADDITIONAL_POINTER_DOWN","onPointerAdd","onPointerDown","MOVE","inBounds","pointerIndex","pointersInBounds","indexOf","ENTER","onPointerEnter","onPointerMove","OUT","onPointerOut","markAsOutOfBounds","onPointerOutOfBounds","UP","ADDITIONAL_POINTER_UP","onPointerRemove","onPointerUp","CANCEL","CANCELLED","onPointerCancel","index","touchEventType","rect","getBoundingClientRect","clientX","clientY","offsetX","left","offsetY","top","identifier","pointerType","PointerType","TOUCH","buttons","MouseButtons","NONE","time","timeStamp","allTouches","touches"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;;;AAEe,MAAMA,iBAAN,SAAgCC,qBAAhC,CAA6C;AACnDC,EAAA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E,cAAN,CAAqBoC,KAArB,EAA4BK,OAA5C;AAEA,WAAO;AACLlC,MAAAA,CAAC,EAAEiC,OADE;AAELhC,MAAAA,CAAC,EAAEiC,OAFE;AAGLC,MAAAA,OAAO,EAAEF,OAAO,GAAGF,IAAI,CAACK,IAHnB;AAILC,MAAAA,OAAO,EAAEH,OAAO,GAAGH,IAAI,CAACO,GAJnB;AAKLlC,MAAAA,SAAS,EAAEb,KAAK,CAACE,cAAN,CAAqBoC,KAArB,EAA4BU,UALlC;AAMLjC,MAAAA,SAAS,EAAEA,SANN;AAOLkC,MAAAA,WAAW,EAAEC,wBAAYC,KAPpB;AAQLC,MAAAA,OAAO,EAAEC,yBAAaC,IARjB;AASLC,MAAAA,IAAI,EAAEvD,KAAK,CAACwD,SATP;AAULC,MAAAA,UAAU,EAAEzD,KAAK,CAAC0D,OAVb;AAWLxD,MAAAA,cAAc,EAAEF,KAAK,CAACE,cAXjB;AAYLqC,MAAAA,cAAc,EAAEA;AAZX,KAAP;AAcD;;AA3JyD","sourcesContent":["import {\n AdaptedEvent,\n EventTypes,\n MouseButtons,\n PointerType,\n TouchEventType,\n} from '../interfaces';\nimport EventManager from './EventManager';\nimport { isPointerInBounds } from '../utils';\n\nexport default class TouchEventManager extends EventManager {\n public setListeners(): void {\n this.view.addEventListener('touchstart', (event: TouchEvent) => {\n for (let i = 0; i < event.changedTouches.length; ++i) {\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.DOWN,\n i,\n TouchEventType.DOWN\n );\n\n // Here we skip stylus, because in case of anything different than touch we want to handle it by using PointerEvents\n // If we leave stylus to send touch events, handlers will receive every action twice\n if (\n !isPointerInBounds(this.view, {\n x: adaptedEvent.x,\n y: adaptedEvent.y,\n }) ||\n //@ts-ignore touchType field does exist\n event.changedTouches[i].touchType === 'stylus'\n ) {\n continue;\n }\n\n this.markAsInBounds(adaptedEvent.pointerId);\n\n if (++this.activePointersCounter > 1) {\n adaptedEvent.eventType = EventTypes.ADDITIONAL_POINTER_DOWN;\n this.onPointerAdd(adaptedEvent);\n } else {\n this.onPointerDown(adaptedEvent);\n }\n }\n });\n\n this.view.addEventListener('touchmove', (event: TouchEvent) => {\n for (let i = 0; i < event.changedTouches.length; ++i) {\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.MOVE,\n i,\n TouchEventType.MOVE\n );\n //@ts-ignore touchType field does exist\n if (event.changedTouches[i].touchType === 'stylus') {\n continue;\n }\n\n const inBounds: boolean = isPointerInBounds(this.view, {\n x: adaptedEvent.x,\n y: adaptedEvent.y,\n });\n\n const pointerIndex: number = this.pointersInBounds.indexOf(\n adaptedEvent.pointerId\n );\n\n if (inBounds) {\n if (pointerIndex < 0) {\n adaptedEvent.eventType = EventTypes.ENTER;\n this.onPointerEnter(adaptedEvent);\n this.markAsInBounds(adaptedEvent.pointerId);\n } else {\n this.onPointerMove(adaptedEvent);\n }\n } else {\n if (pointerIndex >= 0) {\n adaptedEvent.eventType = EventTypes.OUT;\n this.onPointerOut(adaptedEvent);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n } else {\n this.onPointerOutOfBounds(adaptedEvent);\n }\n }\n }\n });\n\n this.view.addEventListener('touchend', (event: TouchEvent) => {\n for (let i = 0; i < event.changedTouches.length; ++i) {\n // When we call reset on gesture handlers, it also resets their event managers\n // In some handlers (like RotationGestureHandler) reset is called before all pointers leave view\n // This means, that activePointersCounter will be set to 0, while there are still remaining pointers on view\n // Removing them will end in activePointersCounter going below 0, therefore handlers won't behave properly\n if (this.activePointersCounter === 0) {\n break;\n }\n\n //@ts-ignore touchType field does exist\n if (event.changedTouches[i].touchType === 'stylus') {\n continue;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.UP,\n i,\n TouchEventType.UP\n );\n\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n\n if (--this.activePointersCounter > 0) {\n adaptedEvent.eventType = EventTypes.ADDITIONAL_POINTER_UP;\n this.onPointerRemove(adaptedEvent);\n } else {\n this.onPointerUp(adaptedEvent);\n }\n }\n });\n\n this.view.addEventListener('touchcancel', (event: TouchEvent) => {\n for (let i = 0; i < event.changedTouches.length; ++i) {\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.CANCEL,\n i,\n TouchEventType.CANCELLED\n );\n\n //@ts-ignore touchType field does exist\n if (event.changedTouches[i].touchType === 'stylus') {\n continue;\n }\n\n this.onPointerCancel(adaptedEvent);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n this.activePointersCounter = 0;\n }\n });\n }\n\n protected mapEvent(\n event: TouchEvent,\n eventType: EventTypes,\n index: number,\n touchEventType: TouchEventType\n ): AdaptedEvent {\n const rect = this.view.getBoundingClientRect();\n const clientX = event.changedTouches[index].clientX;\n const clientY = event.changedTouches[index].clientY;\n\n return {\n x: clientX,\n y: clientY,\n offsetX: clientX - rect.left,\n offsetY: clientY - rect.top,\n pointerId: event.changedTouches[index].identifier,\n eventType: eventType,\n pointerType: PointerType.TOUCH,\n buttons: MouseButtons.NONE,\n time: event.timeStamp,\n allTouches: event.touches,\n changedTouches: event.changedTouches,\n touchEventType: touchEventType,\n };\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isPointerInBounds = isPointerInBounds;
7
+
8
+ function isPointerInBounds(view, {
9
+ x,
10
+ y
11
+ }) {
12
+ const rect = view.getBoundingClientRect();
13
+ return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
14
+ }
15
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils.ts"],"names":["isPointerInBounds","view","x","y","rect","getBoundingClientRect","left","right","top","bottom"],"mappings":";;;;;;;AAAO,SAASA,iBAAT,CACLC,IADK,EAEL;AAAEC,EAAAA,CAAF;AAAKC,EAAAA;AAAL,CAFK,EAGI;AACT,QAAMC,IAAa,GAAGH,IAAI,CAACI,qBAAL,EAAtB;AAEA,SAAOH,CAAC,IAAIE,IAAI,CAACE,IAAV,IAAkBJ,CAAC,IAAIE,IAAI,CAACG,KAA5B,IAAqCJ,CAAC,IAAIC,IAAI,CAACI,GAA/C,IAAsDL,CAAC,IAAIC,IAAI,CAACK,MAAvE;AACD","sourcesContent":["export function isPointerInBounds(\n view: HTMLElement,\n { x, y }: { x: number; y: number }\n): boolean {\n const rect: DOMRect = view.getBoundingClientRect();\n\n return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;\n}\n"]}
@@ -1,6 +1,11 @@
1
+ import { Platform } from 'react-native';
1
2
  let EXPERIMENTAL_WEB_IMPLEMENTATION = false;
2
3
  let getWasCalled = false;
3
4
  export function enableExperimentalWebImplementation(shouldEnable = true) {
5
+ if (Platform.OS !== 'web' || EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable) {
6
+ return;
7
+ }
8
+
4
9
  if (getWasCalled) {
5
10
  console.error('Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.');
6
11
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["EnableExperimentalWebImplementation.ts"],"names":["EXPERIMENTAL_WEB_IMPLEMENTATION","getWasCalled","enableExperimentalWebImplementation","shouldEnable","console","error","isExperimentalWebImplementationEnabled"],"mappings":"AAAA,IAAIA,+BAA+B,GAAG,KAAtC;AACA,IAAIC,YAAY,GAAG,KAAnB;AAEA,OAAO,SAASC,mCAAT,CAA6CC,YAAY,GAAG,IAA5D,EAAwE;AAC7E,MAAIF,YAAJ,EAAkB;AAChBG,IAAAA,OAAO,CAACC,KAAR,CACE,4KADF;AAGA;AACD;;AAEDL,EAAAA,+BAA+B,GAAGG,YAAlC;AACD;AAED,OAAO,SAASG,sCAAT,GAA2D;AAChEL,EAAAA,YAAY,GAAG,IAAf;AACA,SAAOD,+BAAP;AACD","sourcesContent":["let EXPERIMENTAL_WEB_IMPLEMENTATION = false;\nlet getWasCalled = false;\n\nexport function enableExperimentalWebImplementation(shouldEnable = true): void {\n if (getWasCalled) {\n console.error(\n 'Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.'\n );\n return;\n }\n\n EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;\n}\n\nexport function isExperimentalWebImplementationEnabled(): boolean {\n getWasCalled = true;\n return EXPERIMENTAL_WEB_IMPLEMENTATION;\n}\n"]}
1
+ {"version":3,"sources":["EnableExperimentalWebImplementation.ts"],"names":["Platform","EXPERIMENTAL_WEB_IMPLEMENTATION","getWasCalled","enableExperimentalWebImplementation","shouldEnable","OS","console","error","isExperimentalWebImplementationEnabled"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,IAAIC,+BAA+B,GAAG,KAAtC;AACA,IAAIC,YAAY,GAAG,KAAnB;AAEA,OAAO,SAASC,mCAAT,CAA6CC,YAAY,GAAG,IAA5D,EAAwE;AAC7E,MACEJ,QAAQ,CAACK,EAAT,KAAgB,KAAhB,IACAJ,+BAA+B,KAAKG,YAFtC,EAGE;AACA;AACD;;AAED,MAAIF,YAAJ,EAAkB;AAChBI,IAAAA,OAAO,CAACC,KAAR,CACE,4KADF;AAGA;AACD;;AAEDN,EAAAA,+BAA+B,GAAGG,YAAlC;AACD;AAED,OAAO,SAASI,sCAAT,GAA2D;AAChEN,EAAAA,YAAY,GAAG,IAAf;AACA,SAAOD,+BAAP;AACD","sourcesContent":["import { Platform } from 'react-native';\n\nlet EXPERIMENTAL_WEB_IMPLEMENTATION = false;\nlet getWasCalled = false;\n\nexport function enableExperimentalWebImplementation(shouldEnable = true): void {\n if (\n Platform.OS !== 'web' ||\n EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable\n ) {\n return;\n }\n\n if (getWasCalled) {\n console.error(\n 'Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.'\n );\n return;\n }\n\n EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;\n}\n\nexport function isExperimentalWebImplementationEnabled(): boolean {\n getWasCalled = true;\n return EXPERIMENTAL_WEB_IMPLEMENTATION;\n}\n"]}
@@ -10,7 +10,7 @@ if (RNGestureHandlerModule == null) {
10
10
  For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation`.split('\n').map(line => line.trim()).join('\n')));
11
11
  }
12
12
 
13
- if (RNGestureHandlerModule.flushOperations === undefined) {
13
+ if (RNGestureHandlerModule && RNGestureHandlerModule.flushOperations === undefined) {
14
14
  RNGestureHandlerModule.flushOperations = () => {// NO-OP if not defined
15
15
  };
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["NativeModules","tagMessage","RNGestureHandlerModule","console","error","split","map","line","trim","join","flushOperations","undefined"],"mappings":"AAAA,SAASA,aAAT,QAA8B,cAA9B;AAEA,SAASC,UAAT,QAA2B,SAA3B;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA6BF,aAAnC;;AAEA,IAAIE,sBAAsB,IAAI,IAA9B,EAAoC;AAClCC,EAAAA,OAAO,CAACC,KAAR,CACEH,UAAU,CACP;AACP;AACA,gIAFM,CAGGI,KAHH,CAGS,IAHT,EAIGC,GAJH,CAIQC,IAAD,IAAUA,IAAI,CAACC,IAAL,EAJjB,EAKGC,IALH,CAKQ,IALR,CADQ,CADZ;AAUD;;AAED,IAAIP,sBAAsB,CAACQ,eAAvB,KAA2CC,SAA/C,EAA0D;AACxDT,EAAAA,sBAAsB,CAACQ,eAAvB,GAAyC,MAAM,CAC7C;AACD,GAFD;AAGD;;AAwBD,eAAeR,sBAAf","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 (RNGestureHandlerModule.flushOperations === undefined) {\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":["NativeModules","tagMessage","RNGestureHandlerModule","console","error","split","map","line","trim","join","flushOperations","undefined"],"mappings":"AAAA,SAASA,aAAT,QAA8B,cAA9B;AAEA,SAASC,UAAT,QAA2B,SAA3B;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA6BF,aAAnC;;AAEA,IAAIE,sBAAsB,IAAI,IAA9B,EAAoC;AAClCC,EAAAA,OAAO,CAACC,KAAR,CACEH,UAAU,CACP;AACP;AACA,gIAFM,CAGGI,KAHH,CAGS,IAHT,EAIGC,GAJH,CAIQC,IAAD,IAAUA,IAAI,CAACC,IAAL,EAJjB,EAKGC,IALH,CAKQ,IALR,CADQ,CADZ;AAUD;;AAED,IACEP,sBAAsB,IACtBA,sBAAsB,CAACQ,eAAvB,KAA2CC,SAF7C,EAGE;AACAT,EAAAA,sBAAsB,CAACQ,eAAvB,GAAyC,MAAM,CAC7C;AACD,GAFD;AAGD;;AAwBD,eAAeR,sBAAf","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"]}
@@ -8,7 +8,8 @@ import LongPressGestureHandler from './web/handlers/LongPressGestureHandler';
8
8
  import PinchGestureHandler from './web/handlers/PinchGestureHandler';
9
9
  import RotationGestureHandler from './web/handlers/RotationGestureHandler';
10
10
  import FlingGestureHandler from './web/handlers/FlingGestureHandler';
11
- import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler'; //Hammer Handlers
11
+ import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';
12
+ import ManualGestureHandler from './web/handlers/ManualGestureHandler'; //Hammer Handlers
12
13
 
13
14
  import * as HammerNodeManager from './web_hammer/NodeManager';
14
15
  import HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';
@@ -25,7 +26,8 @@ export const Gestures = {
25
26
  LongPressGestureHandler,
26
27
  PinchGestureHandler,
27
28
  RotationGestureHandler,
28
- FlingGestureHandler
29
+ FlingGestureHandler,
30
+ ManualGestureHandler
29
31
  };
30
32
  export const HammerGestures = {
31
33
  NativeViewGestureHandler: HammerNativeViewGestureHandler,
@@ -37,33 +39,37 @@ export const HammerGestures = {
37
39
  FlingGestureHandler: HammerFlingGestureHandler
38
40
  };
39
41
  export default {
40
- // Direction,
41
- handleSetJSResponder(tag, blockNativeResponder) {
42
- console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
42
+ handleSetJSResponder(_tag, _blockNativeResponder) {// NO-OP
43
43
  },
44
44
 
45
- handleClearJSResponder() {
46
- console.warn('handleClearJSResponder: ');
45
+ handleClearJSResponder() {// NO-OP
47
46
  },
48
47
 
49
48
  createGestureHandler(handlerName, handlerTag, config) {
50
49
  if (isExperimentalWebImplementationEnabled()) {
51
- if (!(handlerName in Gestures)) return;
52
- const interactionManager = new InteractionManager();
50
+ if (!(handlerName in Gestures)) {
51
+ throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
52
+ }
53
+
53
54
  const GestureClass = Gestures[handlerName];
54
55
  NodeManager.createGestureHandler(handlerTag, new GestureClass());
55
- interactionManager.configureInteractions(NodeManager.getHandler(handlerTag), config);
56
+ InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), config);
56
57
  } else {
57
- if (!(handlerName in HammerGestures)) return;
58
- const GestureClass = HammerGestures[handlerName];
58
+ if (!(handlerName in HammerGestures)) {
59
+ throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
60
+ } // @ts-ignore If it doesn't exist, the error is thrown
61
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
62
+
63
+
64
+ const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
65
+
59
66
  HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
60
67
  }
61
68
 
62
69
  this.updateGestureHandler(handlerTag, config);
63
70
  },
64
71
 
65
- attachGestureHandler(handlerTag, newView, //ref
66
- _actionType, propsRef) {
72
+ attachGestureHandler(handlerTag, newView, _actionType, propsRef) {
67
73
  if (isExperimentalWebImplementationEnabled()) {
68
74
  NodeManager.getHandler(handlerTag).init(newView, propsRef);
69
75
  } else {
@@ -74,6 +80,7 @@ export default {
74
80
  updateGestureHandler(handlerTag, newConfig) {
75
81
  if (isExperimentalWebImplementationEnabled()) {
76
82
  NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
83
+ InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), newConfig);
77
84
  } else {
78
85
  HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
79
86
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.macos.ts"],"names":["isExperimentalWebImplementationEnabled","InteractionManager","NodeManager","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","HammerNodeManager","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","Gestures","HammerGestures","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","interactionManager","GestureClass","configureInteractions","getHandler","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"AACA,SAASA,sCAAT,QAAuD,uCAAvD,C,CAEA;;AACA,OAAOC,kBAAP,MAA+B,gCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,uBAAP,MAAoC,wCAApC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,sBAAP,MAAmC,uCAAnC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AAC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AACF,GAnDY;;AAoDbE,EAAAA,qBAAqB,CAACf,UAAD,EAAqB;AACxC,QAAI5B,sCAAsC,EAA1C,EAA8C;AAC5C,aAAOE,WAAW,CAAC+B,UAAZ,CAAuBL,UAAvB,CAAP;AACD,KAFD,MAEO;AACL,aAAOlB,iBAAiB,CAACuB,UAAlB,CAA6BL,UAA7B,CAAP;AACD;AACF,GA1DY;;AA2DbgB,EAAAA,kBAAkB,CAAChB,UAAD,EAAqB;AACrC,QAAI5B,sCAAsC,EAA1C,EAA8C;AAC5CE,MAAAA,WAAW,CAAC0C,kBAAZ,CAA+BhB,UAA/B;AACD,KAFD,MAEO;AACLlB,MAAAA,iBAAiB,CAACkC,kBAAlB,CAAqChB,UAArC;AACD;AACF,GAjEY;;AAkEb;AACAiB,EAAAA,eAAe,GAAG,CAAE;;AAnEP,CAAf","sourcesContent":["import { ActionType } from './ActionType';\nimport { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';\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';\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_hammer/GestureHandler';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\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 // Direction,\n handleSetJSResponder(tag: number, blockNativeResponder: boolean) {\n console.warn('handleSetJSResponder: ', tag, blockNativeResponder);\n },\n handleClearJSResponder() {\n console.warn('handleClearJSResponder: ');\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) return;\n\n const interactionManager = new InteractionManager();\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(handlerTag, new GestureClass());\n interactionManager.configureInteractions(\n NodeManager.getHandler(handlerTag),\n (config as unknown) as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) return;\n\n const GestureClass = HammerGestures[handlerName];\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, config);\n },\n attachGestureHandler(\n handlerTag: number,\n newView: number, //ref\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: any) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\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.macos.ts"],"names":["isExperimentalWebImplementationEnabled","InteractionManager","NodeManager","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","ManualGestureHandler","HammerNodeManager","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","Gestures","HammerGestures","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","getInstance","configureInteractions","getHandler","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"AACA,SAASA,sCAAT,QAAuD,uCAAvD,C,CAEA;;AACA,OAAOC,kBAAP,MAA+B,gCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,uBAAP,MAAoC,wCAApC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,sBAAP,MAAmC,uCAAnC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,wBAAP,MAAqC,yCAArC;A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CAAuBN,UAAvB,CADF,EAEEc,SAFF;AAID,KAPD,MAOO;AACL9B,MAAAA,iBAAiB,CAACsB,UAAlB,CAA6BN,UAA7B,EAAyCe,mBAAzC,CAA6DD,SAA7D;AACD;AACF,GAhEY;;AAiEbE,EAAAA,qBAAqB,CAAChB,UAAD,EAAqB;AACxC,QAAI3B,sCAAsC,EAA1C,EAA8C;AAC5C,aAAOE,WAAW,CAAC+B,UAAZ,CAAuBN,UAAvB,CAAP;AACD,KAFD,MAEO;AACL,aAAOhB,iBAAiB,CAACsB,UAAlB,CAA6BN,UAA7B,CAAP;AACD;AACF,GAvEY;;AAwEbiB,EAAAA,kBAAkB,CAACjB,UAAD,EAAqB;AACrC,QAAI3B,sCAAsC,EAA1C,EAA8C;AAC5CE,MAAAA,WAAW,CAAC0C,kBAAZ,CAA+BjB,UAA/B;AACD,KAFD,MAEO;AACLhB,MAAAA,iBAAiB,CAACiC,kBAAlB,CAAqCjB,UAArC;AACD;AACF,GA9EY;;AA+Eb;AACAkB,EAAAA,eAAe,GAAG,CAAE;;AAhFP,CAAf","sourcesContent":["import { ActionType } from './ActionType';\nimport { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';\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';\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 (isExperimentalWebImplementationEnabled()) {\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(handlerTag, new GestureClass());\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 newView: number,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isExperimentalWebImplementationEnabled()) {\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 (isExperimentalWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\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,4 +1,6 @@
1
- //GestureHandlers
1
+ import React from 'react';
2
+ import { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation'; //GestureHandlers
3
+
2
4
  import InteractionManager from './web/tools/InteractionManager';
3
5
  import NodeManager from './web/tools/NodeManager';
4
6
  import PanGestureHandler from './web/handlers/PanGestureHandler';
@@ -7,7 +9,8 @@ import LongPressGestureHandler from './web/handlers/LongPressGestureHandler';
7
9
  import PinchGestureHandler from './web/handlers/PinchGestureHandler';
8
10
  import RotationGestureHandler from './web/handlers/RotationGestureHandler';
9
11
  import FlingGestureHandler from './web/handlers/FlingGestureHandler';
10
- import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler'; //Hammer Handlers
12
+ import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';
13
+ import ManualGestureHandler from './web/handlers/ManualGestureHandler'; //Hammer Handlers
11
14
 
12
15
  import * as HammerNodeManager from './web_hammer/NodeManager';
13
16
  import HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';
@@ -17,7 +20,6 @@ import HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler'
17
20
  import HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';
18
21
  import HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';
19
22
  import HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';
20
- import { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';
21
23
  export const Gestures = {
22
24
  NativeViewGestureHandler,
23
25
  PanGestureHandler,
@@ -25,7 +27,8 @@ export const Gestures = {
25
27
  LongPressGestureHandler,
26
28
  PinchGestureHandler,
27
29
  RotationGestureHandler,
28
- FlingGestureHandler
30
+ FlingGestureHandler,
31
+ ManualGestureHandler
29
32
  };
30
33
  export const HammerGestures = {
31
34
  NativeViewGestureHandler: HammerNativeViewGestureHandler,
@@ -36,9 +39,7 @@ export const HammerGestures = {
36
39
  RotationGestureHandler: HammerRotationGestureHandler,
37
40
  FlingGestureHandler: HammerFlingGestureHandler
38
41
  };
39
- const interactionManager = new InteractionManager();
40
42
  export default {
41
- // Direction,
42
43
  handleSetJSResponder(tag, blockNativeResponder) {
43
44
  console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
44
45
  },
@@ -55,23 +56,33 @@ export default {
55
56
 
56
57
  const GestureClass = Gestures[handlerName];
57
58
  NodeManager.createGestureHandler(handlerTag, new GestureClass());
58
- interactionManager.configureInteractions(NodeManager.getHandler(handlerTag), config);
59
+ InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), config);
59
60
  } else {
60
61
  if (!(handlerName in HammerGestures)) {
61
62
  throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
62
- }
63
+ } // @ts-ignore If it doesn't exist, the error is thrown
64
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
65
+
66
+
67
+ const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
63
68
 
64
- const GestureClass = HammerGestures[handlerName];
65
69
  HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
66
70
  }
67
71
 
68
72
  this.updateGestureHandler(handlerTag, config);
69
73
  },
70
74
 
71
- attachGestureHandler(handlerTag, newView, _actionType, propsRef) {
75
+ attachGestureHandler(handlerTag, // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
+ newView, _actionType, propsRef) {
77
+ if (!(newView instanceof HTMLElement || newView instanceof React.Component)) {
78
+ return;
79
+ }
80
+
72
81
  if (isExperimentalWebImplementationEnabled()) {
82
+ //@ts-ignore Types should be HTMLElement or React.Component
73
83
  NodeManager.getHandler(handlerTag).init(newView, propsRef);
74
84
  } else {
85
+ //@ts-ignore Types should be HTMLElement or React.Component
75
86
  HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
76
87
  }
77
88
  },
@@ -79,7 +90,7 @@ export default {
79
90
  updateGestureHandler(handlerTag, newConfig) {
80
91
  if (isExperimentalWebImplementationEnabled()) {
81
92
  NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
82
- interactionManager.configureInteractions(NodeManager.getHandler(handlerTag), newConfig);
93
+ InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), newConfig);
83
94
  } else {
84
95
  HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
85
96
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.web.ts"],"names":["InteractionManager","NodeManager","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","HammerNodeManager","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","isExperimentalWebImplementationEnabled","Gestures","HammerGestures","interactionManager","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","configureInteractions","getHandler","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"AAEA;AACA,OAAOA,kBAAP,MAA+B,gCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,uBAAP,MAAoC,wCAApC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,sBAAP,MAAmC,uCAAnC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,wBAAP,MAAqC,yCAArC,C,CAEA;;AACA,OAAO,KAAKC,iBAAZ,MAAmC,0BAAnC;AACA,OAAOC,8BAAP,MAA2C,uCAA3C;AACA,OAAOC,uBAAP,MAAoC,gCAApC;AACA,OAAOC,uBAAP,MAAoC,gCAApC;AACA,OAAOC,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,yBAAP,MAAsC,kCAAtC;AACA,OAAOC,4BAAP,MAAyC,qCAAzC;AACA,OAAOC,yBAAP,MAAsC,kCAAtC;AAEA,SAASC,sCAAT,QAAuD,uCAAvD;AAEA,OAAO,MAAMC,QAAQ,GAAG;AACtBV,EAAAA,wBADsB;AAEtBN,EAAAA,iBAFsB;AAGtBC,EAAAA,iBAHsB;AAItBC,EAAAA,uBAJsB;AAKtBC,EAAAA,mBALsB;AAMtBC,EAAAA,sBANsB;AAOtBC,EAAAA;AAPsB,CAAjB;AAUP,OAAO,MAAMY,cAAc,GAAG;AAC5BX,EAAAA,wBAAwB,EAAEE,8BADE;AAE5BR,EAAAA,iBAAiB,EAAES,uBAFS;AAG5BR,EAAAA,iBAAiB,EAAES,uBAH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ArC;AACD;AACF,GA5EY;;AA6Eb;AACAiB,EAAAA,eAAe,GAAG,CAAE;;AA9EP,CAAf","sourcesContent":["import { ActionType } from './ActionType';\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';\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 { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\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\nconst interactionManager = new InteractionManager();\n\nexport default {\n // Direction,\n handleSetJSResponder(tag: number, blockNativeResponder: boolean) {\n console.warn('handleSetJSResponder: ', tag, blockNativeResponder);\n },\n handleClearJSResponder() {\n console.warn('handleClearJSResponder: ');\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isExperimentalWebImplementationEnabled()) {\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(handlerTag, new GestureClass());\n interactionManager.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 const GestureClass = HammerGestures[handlerName];\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, (config as unknown) as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n newView: number,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n interactionManager.configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\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.web.ts"],"names":["React","isExperimentalWebImplementationEnabled","InteractionManager","NodeManager","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","ManualGestureHandler","HammerNodeManager","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","Gestures","HammerGestures","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","getInstance","configureInteractions","getHandler","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,sCAAT,QAAuD,uCAAvD,C,CAEA;;AACA,OAAOC,kBAAP,MAA+B,gCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,uBAAP,MAAoC,wCAApC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,sBAAP,MAAmC,uCAAnC;AACA,OAAOC,mBAAP,MAAgC,oCAAhC;AACA,OAAOC,wBAAP,MAAqC,yCAArC;AACA,OAAOC,oBAAP,MAAiC,qCAAjC,C,CAEA;;AACA,OAAO,KAAKC,iBAAZ,MAAmC,0BAAnC;AACA,OAAOC,8BAAP,MAA2C,uCAA3C;AACA,OAAOC,uBAAP,MAAoC,gCAApC;AACA,OAAOC,uBAAP,MAAoC,gCAApC;AACA,OAAOC,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,yBA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CAAuBN,UAAvB,CADF,EAEEgB,SAFF;AAID,KAPD,MAOO;AACLlC,MAAAA,iBAAiB,CAACwB,UAAlB,CAA6BN,UAA7B,EAAyCiB,mBAAzC,CAA6DD,SAA7D;AACD;AACF,GAzEY;;AA0EbE,EAAAA,qBAAqB,CAAClB,UAAD,EAAqB;AACxC,QAAI7B,sCAAsC,EAA1C,EAA8C;AAC5C,aAAOE,WAAW,CAACiC,UAAZ,CAAuBN,UAAvB,CAAP;AACD,KAFD,MAEO;AACL,aAAOlB,iBAAiB,CAACwB,UAAlB,CAA6BN,UAA7B,CAAP;AACD;AACF,GAhFY;;AAiFbmB,EAAAA,kBAAkB,CAACnB,UAAD,EAAqB;AACrC,QAAI7B,sCAAsC,EAA1C,EAA8C;AAC5CE,MAAAA,WAAW,CAAC8C,kBAAZ,CAA+BnB,UAA/B;AACD,KAFD,MAEO;AACLlB,MAAAA,iBAAiB,CAACqC,kBAAlB,CAAqCnB,UAArC;AACD;AACF,GAvFY;;AAwFb;AACAoB,EAAAA,eAAe,GAAG,CAAE;;AAzFP,CAAf","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\nimport { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';\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';\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 console.warn('handleSetJSResponder: ', tag, blockNativeResponder);\n },\n handleClearJSResponder() {\n console.warn('handleClearJSResponder: ');\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isExperimentalWebImplementationEnabled()) {\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(handlerTag, new GestureClass());\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 (isExperimentalWebImplementationEnabled()) {\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 (isExperimentalWebImplementationEnabled()) {\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 (isExperimentalWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\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"]}
@@ -26,9 +26,10 @@ export const ScrollView = /*#__PURE__*/React.forwardRef((props, ref) => {
26
26
  ref: ref,
27
27
  waitFor: [...toArray(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef] // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
28
28
  ,
29
- refreshControl: refreshControl ? /*#__PURE__*/React.createElement(RefreshControl, _extends({}, refreshControl.props, {
29
+ refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
30
+ // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
30
31
  ref: refreshControlGestureRef
31
- })) : refreshControl
32
+ }) : undefined
32
33
  }));
33
34
  }); // backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457
34
35
  // include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.
@@ -79,9 +80,10 @@ export const FlatList = /*#__PURE__*/React.forwardRef((props, ref) => {
79
80
  waitFor: [...toArray(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef]
80
81
  })) // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
81
82
  ,
82
- refreshControl: refreshControl ? /*#__PURE__*/React.createElement(RefreshControl, _extends({}, refreshControl.props, {
83
+ refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
84
+ // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
83
85
  ref: refreshControlGestureRef
84
- })) : refreshControl
86
+ }) : undefined
85
87
  }))
86
88
  );
87
89
  }); // eslint-disable-next-line @typescript-eslint/no-redeclare
@@ -1 +1 @@
1
- {"version":3,"sources":["GestureComponents.tsx"],"names":["React","ScrollView","RNScrollView","Switch","RNSwitch","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","RNFlatList","RefreshControl","RNRefreshControl","createNativeWrapper","nativeViewProps","toArray","disallowInterruption","shouldCancelWhenOutside","GHScrollView","forwardRef","props","ref","refreshControlGestureRef","useRef","refreshControl","waitFor","rest","shouldActivateOnStart","flatListProps","scrollViewProps","propName","value","Object","entries","includes","scrollProps"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAOA,SACEC,UAAU,IAAIC,YADhB,EAGEC,MAAM,IAAIC,QAHZ,EAKEC,SAAS,IAAIC,WALf,E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J,CAYE;AAZF;AAaE,MAAA,cAAc,EACZE,cAAc,gBACZ,oBAAC,cAAD,eACMA,cAAc,CAACJ,KADrB;AAEE,QAAA,GAAG,EAAEE;AAFP,SADY,GAMZE;AApBN;AAFF;AA2BD,CA/CuB,CAAjB,C,CAuDP","sourcesContent":["import * as React from 'react';\nimport {\n PropsWithChildren,\n ForwardedRef,\n RefAttributes,\n ReactElement,\n} from 'react';\nimport {\n ScrollView as RNScrollView,\n ScrollViewProps as RNScrollViewProps,\n Switch as RNSwitch,\n SwitchProps as RNSwitchProps,\n TextInput as RNTextInput,\n TextInputProps as RNTextInputProps,\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n RefreshControl as RNRefreshControl,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nimport {\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from '../handlers/NativeViewGestureHandler';\n\nimport { toArray } from '../utils';\n\nexport const RefreshControl = createNativeWrapper(RNRefreshControl, {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type RefreshControl = typeof RefreshControl & RNRefreshControl;\n\nconst GHScrollView = createNativeWrapper<PropsWithChildren<RNScrollViewProps>>(\n RNScrollView,\n {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n }\n);\nexport const ScrollView = React.forwardRef<\n RNScrollView,\n RNScrollViewProps & NativeViewGestureHandlerProps\n>((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n const { refreshControl, waitFor, ...rest } = props;\n\n return (\n <GHScrollView\n {...rest}\n // @ts-ignore `ref` exists on `GHScrollView`\n ref={ref}\n waitFor={[...toArray(waitFor ?? []), refreshControlGestureRef]}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl ? (\n <RefreshControl\n {...refreshControl.props}\n ref={refreshControlGestureRef}\n />\n ) : (\n refreshControl\n )\n }\n />\n );\n});\n// backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457\n// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type ScrollView = typeof GHScrollView & RNScrollView;\n\nexport const Switch = createNativeWrapper<RNSwitchProps>(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Switch = typeof Switch & RNSwitch;\n\nexport const TextInput = createNativeWrapper<RNTextInputProps>(RNTextInput);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TextInput = typeof TextInput & RNTextInput;\n\nexport const DrawerLayoutAndroid = createNativeWrapper<\n PropsWithChildren<RNDrawerLayoutAndroidProps>\n>(RNDrawerLayoutAndroid, { disallowInterruption: true });\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DrawerLayoutAndroid = typeof DrawerLayoutAndroid &\n RNDrawerLayoutAndroid;\n\nexport const FlatList = React.forwardRef((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n\n const { waitFor, refreshControl, ...rest } = props;\n\n const flatListProps = {};\n const scrollViewProps = {};\n for (const [propName, value] of Object.entries(rest)) {\n // https://github.com/microsoft/TypeScript/issues/26255\n if ((nativeViewProps as readonly string[]).includes(propName)) {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n scrollViewProps[propName] = value;\n } else {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n flatListProps[propName] = value;\n }\n }\n\n return (\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n <RNFlatList\n ref={ref}\n {...flatListProps}\n renderScrollComponent={(scrollProps) => (\n <ScrollView\n {...{\n ...scrollProps,\n ...scrollViewProps,\n waitFor: [...toArray(waitFor ?? []), refreshControlGestureRef],\n }}\n />\n )}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl ? (\n <RefreshControl\n {...refreshControl.props}\n ref={refreshControlGestureRef}\n />\n ) : (\n refreshControl\n )\n }\n />\n );\n}) as <ItemT = any>(\n props: PropsWithChildren<\n RNFlatListProps<ItemT> &\n RefAttributes<FlatList<ItemT>> &\n NativeViewGestureHandlerProps\n >,\n ref: ForwardedRef<FlatList<ItemT>>\n) => ReactElement | null;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;\n"]}
1
+ {"version":3,"sources":["GestureComponents.tsx"],"names":["React","ScrollView","RNScrollView","Switch","RNSwitch","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","RNFlatList","RefreshControl","RNRefreshControl","createNativeWrapper","nativeViewProps","toArray","disallowInterruption","shouldCancelWhenOutside","GHScrollView","forwardRef","props","ref","refreshControlGestureRef","useRef","refreshControl","waitFor","rest","cloneElement","undefined","shouldActivateOnStart","flatListProps","scrollViewProps","propName","value","Object","entries","includes","scrollProps"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAOA,SACEC,UAAU,IAAIC,YADhB,EAGEC,MAAM,IAAIC,QAHZ,EAKEC,SAAS,IAAIC,WALf,EAOEC,mBAAmB,IAAIC,qBAPzB,EASEC,QAAQ,IAAIC,UATd,EAWEC,cAAc,IAAIC,gBAXpB,QAYO,cAZP;AAcA,OAAOC,mBAAP,MAAgC,iCAAhC;AAEA,SAEEC,eAFF,QAGO,sCAHP;AAKA,SAASC,OAAT,QAAwB,UAAxB;AAEA,OAAO,MAAMJ,cAAc,GAAGE,mBAAmB,CAACD,gBAAD,EAAm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ildren,\n ForwardedRef,\n RefAttributes,\n ReactElement,\n} from 'react';\nimport {\n ScrollView as RNScrollView,\n ScrollViewProps as RNScrollViewProps,\n Switch as RNSwitch,\n SwitchProps as RNSwitchProps,\n TextInput as RNTextInput,\n TextInputProps as RNTextInputProps,\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n RefreshControl as RNRefreshControl,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nimport {\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from '../handlers/NativeViewGestureHandler';\n\nimport { toArray } from '../utils';\n\nexport const RefreshControl = createNativeWrapper(RNRefreshControl, {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type RefreshControl = typeof RefreshControl & RNRefreshControl;\n\nconst GHScrollView = createNativeWrapper<PropsWithChildren<RNScrollViewProps>>(\n RNScrollView,\n {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n }\n);\nexport const ScrollView = React.forwardRef<\n RNScrollView,\n RNScrollViewProps & NativeViewGestureHandlerProps\n>((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n const { refreshControl, waitFor, ...rest } = props;\n\n return (\n <GHScrollView\n {...rest}\n // @ts-ignore `ref` exists on `GHScrollView`\n ref={ref}\n waitFor={[...toArray(waitFor ?? []), refreshControlGestureRef]}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n});\n// backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457\n// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type ScrollView = typeof GHScrollView & RNScrollView;\n\nexport const Switch = createNativeWrapper<RNSwitchProps>(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Switch = typeof Switch & RNSwitch;\n\nexport const TextInput = createNativeWrapper<RNTextInputProps>(RNTextInput);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TextInput = typeof TextInput & RNTextInput;\n\nexport const DrawerLayoutAndroid = createNativeWrapper<\n PropsWithChildren<RNDrawerLayoutAndroidProps>\n>(RNDrawerLayoutAndroid, { disallowInterruption: true });\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DrawerLayoutAndroid = typeof DrawerLayoutAndroid &\n RNDrawerLayoutAndroid;\n\nexport const FlatList = React.forwardRef((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n\n const { waitFor, refreshControl, ...rest } = props;\n\n const flatListProps = {};\n const scrollViewProps = {};\n for (const [propName, value] of Object.entries(rest)) {\n // https://github.com/microsoft/TypeScript/issues/26255\n if ((nativeViewProps as readonly string[]).includes(propName)) {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n scrollViewProps[propName] = value;\n } else {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n flatListProps[propName] = value;\n }\n }\n\n return (\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n <RNFlatList\n ref={ref}\n {...flatListProps}\n renderScrollComponent={(scrollProps) => (\n <ScrollView\n {...{\n ...scrollProps,\n ...scrollViewProps,\n waitFor: [...toArray(waitFor ?? []), refreshControlGestureRef],\n }}\n />\n )}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n}) as <ItemT = any>(\n props: PropsWithChildren<\n RNFlatListProps<ItemT> &\n RefAttributes<FlatList<ItemT>> &\n NativeViewGestureHandlerProps\n >,\n ref: ForwardedRef<FlatList<ItemT>>\n) => ReactElement | null;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;\n"]}
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { DrawerLayoutAndroid as RNDrawerLayoutAndroid, FlatList as RNFlatList, Switch as RNSwitch, TextInput as RNTextInput, ScrollView as RNScrollView, View } from 'react-native';
5
5
  import createNativeWrapper from '../handlers/createNativeWrapper';
6
6
  export const ScrollView = createNativeWrapper(RNScrollView, {
7
- disallowInterruption: true
7
+ disallowInterruption: false
8
8
  });
9
9
  export const Switch = createNativeWrapper(RNSwitch, {
10
10
  shouldCancelWhenOutside: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["GestureComponents.web.tsx"],"names":["React","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","RNFlatList","Switch","RNSwitch","TextInput","RNTextInput","ScrollView","RNScrollView","View","createNativeWrapper","disallowInterruption","shouldCancelWhenOutside","shouldActivateOnStart","positions","RefreshControl","forwardRef","props","ref","scrollProps"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,mBAAmB,IAAIC,qBADzB,EAEEC,QAAQ,IAAIC,UAFd,EAGEC,MAAM,IAAIC,QAHZ,EAIEC,SAAS,IAAIC,WAJf,EAKEC,UAAU,IAAIC,YALhB,EAOEC,IAPF,QAQO,cARP;AAUA,OAAOC,mBAAP,MAAgC,iCAAhC;AAEA,OAAO,MAAMH,UAAU,GAAGG,mBAAmB,CAACF,YAAD,EAAe;AAC1DG,EAAAA,oBAAoB,EAAE;AADoC,CAAf,CAAtC;AAIP,OAAO,MAAMR,MAAM,GAAGO,mBAAmB,CAACN,QAAD,EAAW;AAClDQ,EAAAA,uBAAuB,EAAE,KADyB;AAElDC,EAAAA,qBAAqB,EAAE,IAF2B;AAGlDF,EAAAA,oBAAoB,EAAE;AAH4B,CAAX,CAAlC;AAKP,OAAO,MAAMN,SAAS,GAAGK,mBAAmB,CAACJ,WAAD,CAArC;AACP,OAAO,MAAMP,mBAAmB,GAAGW,mBAAmB,CAACV,qBAAD,EAAwB;AAC5EW,EAAAA,oBAAoB,EAAE;AADsD,CAAxB,CAA/C,C,CAGP;;AACAZ,mBAAmB,CAACe,SAApB,GAAgCd,qBAAqB,CAACc,SAAtD,C,CACA;AACA;AACA;;AACA,OAAO,MAAMC,cAAc,GAAGL,mBAAmB,CAACD,IAAD,CAA1C;AAEP,OAAO,MAAMR,QAAQ,gBAAGH,KAAK,CAACkB,UAAN,CACtB,CAAoBC,KAApB,EAAiDC,GAAjD,kBACE,oBAAC,UAAD;AACE,EAAA,GAAG,EAAEA;AADP,GAEMD,KAFN;AAGE,EAAA,qBAAqB,EAAGE,WAAD,iBAAiB,oBAAC,UAAD,EAAgBA,WAAhB;AAH1C,GAFoB,CAAjB","sourcesContent":["import * as React from 'react';\nimport {\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n FlatList as RNFlatList,\n Switch as RNSwitch,\n TextInput as RNTextInput,\n ScrollView as RNScrollView,\n FlatListProps,\n View,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nexport const ScrollView = createNativeWrapper(RNScrollView, {\n disallowInterruption: true,\n});\n\nexport const Switch = createNativeWrapper(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\nexport const TextInput = createNativeWrapper(RNTextInput);\nexport const DrawerLayoutAndroid = createNativeWrapper(RNDrawerLayoutAndroid, {\n disallowInterruption: true,\n});\n// @ts-ignore -- TODO(TS) to investigate if it's needed\nDrawerLayoutAndroid.positions = RNDrawerLayoutAndroid.positions;\n// RefreshControl is implemented as a functional component, rendering a View\n// NativeViewGestureHandler needs to set a ref on its child, which cannot be done\n// on functional components\nexport const RefreshControl = createNativeWrapper(View);\n\nexport const FlatList = React.forwardRef(\n <ItemT extends any>(props: FlatListProps<ItemT>, ref: any) => (\n <RNFlatList\n ref={ref}\n {...props}\n renderScrollComponent={(scrollProps) => <ScrollView {...scrollProps} />}\n />\n )\n);\n"]}
1
+ {"version":3,"sources":["GestureComponents.web.tsx"],"names":["React","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","RNFlatList","Switch","RNSwitch","TextInput","RNTextInput","ScrollView","RNScrollView","View","createNativeWrapper","disallowInterruption","shouldCancelWhenOutside","shouldActivateOnStart","positions","RefreshControl","forwardRef","props","ref","scrollProps"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,mBAAmB,IAAIC,qBADzB,EAEEC,QAAQ,IAAIC,UAFd,EAGEC,MAAM,IAAIC,QAHZ,EAIEC,SAAS,IAAIC,WAJf,EAKEC,UAAU,IAAIC,YALhB,EAOEC,IAPF,QAQO,cARP;AAUA,OAAOC,mBAAP,MAAgC,iCAAhC;AAEA,OAAO,MAAMH,UAAU,GAAGG,mBAAmB,CAACF,YAAD,EAAe;AAC1DG,EAAAA,oBAAoB,EAAE;AADoC,CAAf,CAAtC;AAIP,OAAO,MAAMR,MAAM,GAAGO,mBAAmB,CAACN,QAAD,EAAW;AAClDQ,EAAAA,uBAAuB,EAAE,KADyB;AAElDC,EAAAA,qBAAqB,EAAE,IAF2B;AAGlDF,EAAAA,oBAAoB,EAAE;AAH4B,CAAX,CAAlC;AAKP,OAAO,MAAMN,SAAS,GAAGK,mBAAmB,CAACJ,WAAD,CAArC;AACP,OAAO,MAAMP,mBAAmB,GAAGW,mBAAmB,CAACV,qBAAD,EAAwB;AAC5EW,EAAAA,oBAAoB,EAAE;AADsD,CAAxB,CAA/C,C,CAGP;;AACAZ,mBAAmB,CAACe,SAApB,GAAgCd,qBAAqB,CAACc,SAAtD,C,CACA;AACA;AACA;;AACA,OAAO,MAAMC,cAAc,GAAGL,mBAAmB,CAACD,IAAD,CAA1C;AAEP,OAAO,MAAMR,QAAQ,gBAAGH,KAAK,CAACkB,UAAN,CACtB,CAAoBC,KAApB,EAAiDC,GAAjD,kBACE,oBAAC,UAAD;AACE,EAAA,GAAG,EAAEA;AADP,GAEMD,KAFN;AAGE,EAAA,qBAAqB,EAAGE,WAAD,iBAAiB,oBAAC,UAAD,EAAgBA,WAAhB;AAH1C,GAFoB,CAAjB","sourcesContent":["import * as React from 'react';\nimport {\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n FlatList as RNFlatList,\n Switch as RNSwitch,\n TextInput as RNTextInput,\n ScrollView as RNScrollView,\n FlatListProps,\n View,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nexport const ScrollView = createNativeWrapper(RNScrollView, {\n disallowInterruption: false,\n});\n\nexport const Switch = createNativeWrapper(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\nexport const TextInput = createNativeWrapper(RNTextInput);\nexport const DrawerLayoutAndroid = createNativeWrapper(RNDrawerLayoutAndroid, {\n disallowInterruption: true,\n});\n// @ts-ignore -- TODO(TS) to investigate if it's needed\nDrawerLayoutAndroid.positions = RNDrawerLayoutAndroid.positions;\n// RefreshControl is implemented as a functional component, rendering a View\n// NativeViewGestureHandler needs to set a ref on its child, which cannot be done\n// on functional components\nexport const RefreshControl = createNativeWrapper(View);\n\nexport const FlatList = React.forwardRef(\n <ItemT extends any>(props: FlatListProps<ItemT>, ref: any) => (\n <RNFlatList\n ref={ref}\n {...props}\n renderScrollComponent={(scrollProps) => <ScrollView {...scrollProps} />}\n />\n )\n);\n"]}
@@ -159,17 +159,17 @@ export default class Swipeable extends Component {
159
159
  var _this$props$onSwipeab, _this$props, _this$props$onSwipeab2, _this$props2;
160
160
 
161
161
  (_this$props$onSwipeab = (_this$props = this.props).onSwipeableLeftOpen) === null || _this$props$onSwipeab === void 0 ? void 0 : _this$props$onSwipeab.call(_this$props);
162
- (_this$props$onSwipeab2 = (_this$props2 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab2 === void 0 ? void 0 : _this$props$onSwipeab2.call(_this$props2, 'left');
162
+ (_this$props$onSwipeab2 = (_this$props2 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab2 === void 0 ? void 0 : _this$props$onSwipeab2.call(_this$props2, 'left', this);
163
163
  } else if (toValue < 0) {
164
164
  var _this$props$onSwipeab3, _this$props3, _this$props$onSwipeab4, _this$props4;
165
165
 
166
166
  (_this$props$onSwipeab3 = (_this$props3 = this.props).onSwipeableRightOpen) === null || _this$props$onSwipeab3 === void 0 ? void 0 : _this$props$onSwipeab3.call(_this$props3);
167
- (_this$props$onSwipeab4 = (_this$props4 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab4 === void 0 ? void 0 : _this$props$onSwipeab4.call(_this$props4, 'right');
167
+ (_this$props$onSwipeab4 = (_this$props4 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab4 === void 0 ? void 0 : _this$props$onSwipeab4.call(_this$props4, 'right', this);
168
168
  } else {
169
169
  var _this$props$onSwipeab5, _this$props5;
170
170
 
171
171
  const closingDirection = fromValue > 0 ? 'left' : 'right';
172
- (_this$props$onSwipeab5 = (_this$props5 = this.props).onSwipeableClose) === null || _this$props$onSwipeab5 === void 0 ? void 0 : _this$props$onSwipeab5.call(_this$props5, closingDirection);
172
+ (_this$props$onSwipeab5 = (_this$props5 = this.props).onSwipeableClose) === null || _this$props$onSwipeab5 === void 0 ? void 0 : _this$props$onSwipeab5.call(_this$props5, closingDirection, this);
173
173
  }
174
174
  }
175
175
  });
@@ -301,7 +301,7 @@ export default class Swipeable extends Component {
301
301
  translateX: this.rightActionTranslate
302
302
  }]
303
303
  }]
304
- }, renderRightActions(this.showRightAction, this.transX), /*#__PURE__*/React.createElement(View, {
304
+ }, renderRightActions(this.showRightAction, this.transX, this), /*#__PURE__*/React.createElement(View, {
305
305
  onLayout: ({
306
306
  nativeEvent
307
307
  }) => this.setState({