react-native-gtkx 0.2.0-alpha.2 → 0.3.0-alpha.1

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 (340) hide show
  1. package/README.md +5 -2
  2. package/dist/aliases/index.d.ts +84 -0
  3. package/dist/aliases/index.js +208 -0
  4. package/dist/aliases/index.js.map +1 -0
  5. package/dist/animated/index.d.ts +2 -0
  6. package/dist/animated/index.js +5 -0
  7. package/dist/animated/index.js.map +1 -1
  8. package/dist/animated/types.d.ts +1 -0
  9. package/dist/animated/types.js.map +1 -1
  10. package/dist/animated/value-animation.js +17 -4
  11. package/dist/animated/value-animation.js.map +1 -1
  12. package/dist/apis/host.gtkx.js +9 -12
  13. package/dist/apis/host.gtkx.js.map +1 -1
  14. package/dist/apis/index.d.ts +4 -2
  15. package/dist/apis/index.js +2 -0
  16. package/dist/apis/index.js.map +1 -1
  17. package/dist/apis/keyboard.d.ts +60 -0
  18. package/dist/apis/keyboard.js +63 -0
  19. package/dist/apis/keyboard.js.map +1 -0
  20. package/dist/apis/log-box.d.ts +15 -0
  21. package/dist/apis/log-box.js +46 -0
  22. package/dist/apis/log-box.js.map +1 -0
  23. package/dist/apis/platform.d.ts +18 -1
  24. package/dist/apis/platform.js.map +1 -1
  25. package/dist/common/index.d.ts +0 -1
  26. package/dist/common/index.js +24 -1
  27. package/dist/common/index.js.map +1 -1
  28. package/dist/components/animated.d.ts +70 -6
  29. package/dist/components/animated.js +559 -46
  30. package/dist/components/animated.js.map +1 -1
  31. package/dist/components/driven-size.d.ts +27 -0
  32. package/dist/components/driven-size.js +85 -0
  33. package/dist/components/driven-size.js.map +1 -0
  34. package/dist/components/find-node-handle.d.ts +11 -0
  35. package/dist/components/find-node-handle.js +53 -0
  36. package/dist/components/find-node-handle.js.map +1 -0
  37. package/dist/components/flat-list.d.ts +3 -2
  38. package/dist/components/flat-list.js.map +1 -1
  39. package/dist/components/frame-scheduler.d.ts +16 -0
  40. package/dist/components/frame-scheduler.js +37 -0
  41. package/dist/components/frame-scheduler.js.map +1 -0
  42. package/dist/components/image.d.ts +6 -1
  43. package/dist/components/image.js +15 -4
  44. package/dist/components/image.js.map +1 -1
  45. package/dist/components/index.d.ts +7 -5
  46. package/dist/components/index.js +5 -3
  47. package/dist/components/index.js.map +1 -1
  48. package/dist/components/measure.d.ts +51 -1
  49. package/dist/components/measure.js +101 -2
  50. package/dist/components/measure.js.map +1 -1
  51. package/dist/components/pressable.d.ts +61 -1
  52. package/dist/components/pressable.js +151 -4
  53. package/dist/components/pressable.js.map +1 -1
  54. package/dist/components/rect-store.d.ts +58 -0
  55. package/dist/components/rect-store.js +124 -3
  56. package/dist/components/rect-store.js.map +1 -1
  57. package/dist/components/root.js +6 -1
  58. package/dist/components/root.js.map +1 -1
  59. package/dist/components/scroll-phase.d.ts +35 -0
  60. package/dist/components/scroll-phase.js +26 -0
  61. package/dist/components/scroll-phase.js.map +1 -0
  62. package/dist/components/scroll-view.d.ts +39 -3
  63. package/dist/components/scroll-view.js +378 -43
  64. package/dist/components/scroll-view.js.map +1 -1
  65. package/dist/components/text-input.js +9 -25
  66. package/dist/components/text-input.js.map +1 -1
  67. package/dist/components/text.d.ts +6 -2
  68. package/dist/components/text.js +43 -8
  69. package/dist/components/text.js.map +1 -1
  70. package/dist/components/use-focus.d.ts +27 -0
  71. package/dist/components/use-focus.js +116 -0
  72. package/dist/components/use-focus.js.map +1 -0
  73. package/dist/components/use-layout-child.d.ts +13 -1
  74. package/dist/components/use-layout-child.js +188 -5
  75. package/dist/components/use-layout-child.js.map +1 -1
  76. package/dist/components/view.d.ts +5 -2
  77. package/dist/components/view.js +18 -13
  78. package/dist/components/view.js.map +1 -1
  79. package/dist/components/virtualized-list.d.ts +45 -5
  80. package/dist/components/virtualized-list.js +90 -24
  81. package/dist/components/virtualized-list.js.map +1 -1
  82. package/dist/components/wheel-scroll-session.d.ts +7 -0
  83. package/dist/components/wheel-scroll-session.js +53 -0
  84. package/dist/components/wheel-scroll-session.js.map +1 -0
  85. package/dist/components/widget-retention.d.ts +35 -0
  86. package/dist/components/widget-retention.js +169 -0
  87. package/dist/components/widget-retention.js.map +1 -0
  88. package/dist/contracts.d.ts +4 -0
  89. package/dist/contracts.js.map +1 -1
  90. package/dist/dnd/context.d.ts +69 -0
  91. package/dist/dnd/context.js +149 -0
  92. package/dist/dnd/context.js.map +1 -0
  93. package/dist/dnd/draggable.d.ts +59 -0
  94. package/dist/dnd/draggable.js +149 -0
  95. package/dist/dnd/draggable.js.map +1 -0
  96. package/dist/dnd/droppable.d.ts +24 -0
  97. package/dist/dnd/droppable.js +74 -0
  98. package/dist/dnd/droppable.js.map +1 -0
  99. package/dist/dnd/gtk-controllers.d.ts +39 -0
  100. package/dist/dnd/gtk-controllers.js +110 -0
  101. package/dist/dnd/gtk-controllers.js.map +1 -0
  102. package/dist/dnd/index.d.ts +6 -0
  103. package/dist/dnd/index.js +31 -0
  104. package/dist/dnd/index.js.map +1 -0
  105. package/dist/dnd/order.d.ts +7 -0
  106. package/dist/dnd/order.js +20 -0
  107. package/dist/dnd/order.js.map +1 -0
  108. package/dist/dnd/payload.d.ts +14 -0
  109. package/dist/dnd/payload.js +41 -0
  110. package/dist/dnd/payload.js.map +1 -0
  111. package/dist/dnd/sortable.d.ts +49 -0
  112. package/dist/dnd/sortable.js +307 -0
  113. package/dist/dnd/sortable.js.map +1 -0
  114. package/dist/dnd/types.d.ts +290 -0
  115. package/dist/dnd/types.js +25 -0
  116. package/dist/dnd/types.js.map +1 -0
  117. package/dist/gesture-handler-compat/builder.d.ts +251 -0
  118. package/dist/gesture-handler-compat/builder.js +513 -0
  119. package/dist/gesture-handler-compat/builder.js.map +1 -0
  120. package/dist/gesture-handler-compat/composition.d.ts +23 -0
  121. package/dist/gesture-handler-compat/composition.js +111 -0
  122. package/dist/gesture-handler-compat/composition.js.map +1 -0
  123. package/dist/gesture-handler-compat/deciders.d.ts +3 -0
  124. package/dist/gesture-handler-compat/deciders.js +47 -0
  125. package/dist/gesture-handler-compat/deciders.js.map +1 -0
  126. package/dist/gesture-handler-compat/detector-runtime.d.ts +44 -0
  127. package/dist/gesture-handler-compat/detector-runtime.js +374 -0
  128. package/dist/gesture-handler-compat/detector-runtime.js.map +1 -0
  129. package/dist/gesture-handler-compat/detector.d.ts +22 -0
  130. package/dist/gesture-handler-compat/detector.js +104 -0
  131. package/dist/gesture-handler-compat/detector.js.map +1 -0
  132. package/dist/gesture-handler-compat/fling.d.ts +24 -0
  133. package/dist/gesture-handler-compat/fling.js +123 -0
  134. package/dist/gesture-handler-compat/fling.js.map +1 -0
  135. package/dist/gesture-handler-compat/force-touch.d.ts +13 -0
  136. package/dist/gesture-handler-compat/force-touch.js +40 -0
  137. package/dist/gesture-handler-compat/force-touch.js.map +1 -0
  138. package/dist/gesture-handler-compat/hooks.d.ts +157 -0
  139. package/dist/gesture-handler-compat/hooks.js +268 -0
  140. package/dist/gesture-handler-compat/hooks.js.map +1 -0
  141. package/dist/gesture-handler-compat/hover.d.ts +2 -0
  142. package/dist/gesture-handler-compat/hover.js +22 -0
  143. package/dist/gesture-handler-compat/hover.js.map +1 -0
  144. package/dist/gesture-handler-compat/index.d.ts +98 -0
  145. package/dist/gesture-handler-compat/index.js +255 -0
  146. package/dist/gesture-handler-compat/index.js.map +1 -0
  147. package/dist/gesture-handler-compat/long-press.d.ts +6 -0
  148. package/dist/gesture-handler-compat/long-press.js +21 -0
  149. package/dist/gesture-handler-compat/long-press.js.map +1 -0
  150. package/dist/gesture-handler-compat/manual.d.ts +2 -0
  151. package/dist/gesture-handler-compat/manual.js +18 -0
  152. package/dist/gesture-handler-compat/manual.js.map +1 -0
  153. package/dist/gesture-handler-compat/native.d.ts +7 -0
  154. package/dist/gesture-handler-compat/native.js +34 -0
  155. package/dist/gesture-handler-compat/native.js.map +1 -0
  156. package/dist/gesture-handler-compat/orchestrator.d.ts +77 -0
  157. package/dist/gesture-handler-compat/orchestrator.js +284 -0
  158. package/dist/gesture-handler-compat/orchestrator.js.map +1 -0
  159. package/dist/gesture-handler-compat/pan.d.ts +23 -0
  160. package/dist/gesture-handler-compat/pan.js +116 -0
  161. package/dist/gesture-handler-compat/pan.js.map +1 -0
  162. package/dist/gesture-handler-compat/recognizer.d.ts +268 -0
  163. package/dist/gesture-handler-compat/recognizer.js +1056 -0
  164. package/dist/gesture-handler-compat/recognizer.js.map +1 -0
  165. package/dist/gesture-handler-compat/relations.d.ts +43 -0
  166. package/dist/gesture-handler-compat/relations.js +128 -0
  167. package/dist/gesture-handler-compat/relations.js.map +1 -0
  168. package/dist/gesture-handler-compat/tap.d.ts +6 -0
  169. package/dist/gesture-handler-compat/tap.js +29 -0
  170. package/dist/gesture-handler-compat/tap.js.map +1 -0
  171. package/dist/gesture-handler-compat/touchpad.d.ts +41 -0
  172. package/dist/gesture-handler-compat/touchpad.js +64 -0
  173. package/dist/gesture-handler-compat/touchpad.js.map +1 -0
  174. package/dist/gesture-handler-compat/types.d.ts +441 -0
  175. package/dist/gesture-handler-compat/types.js +167 -0
  176. package/dist/gesture-handler-compat/types.js.map +1 -0
  177. package/dist/gtk/controllers.d.ts +39 -0
  178. package/dist/gtk/controllers.js +92 -0
  179. package/dist/gtk/controllers.js.map +1 -0
  180. package/dist/gtk/index.d.ts +2 -1
  181. package/dist/gtk/index.js +7 -1
  182. package/dist/gtk/index.js.map +1 -1
  183. package/dist/gtkx/bridge/geometry.js +6 -4
  184. package/dist/gtkx/bridge/geometry.js.map +1 -1
  185. package/dist/gtkx/bridge/index.d.ts +5 -3
  186. package/dist/gtkx/bridge/index.js +6 -3
  187. package/dist/gtkx/bridge/index.js.map +1 -1
  188. package/dist/gtkx/bridge/slot-portal.js.map +1 -1
  189. package/dist/gtkx/bridge/use-signal.js +1 -1
  190. package/dist/gtkx/bridge/use-signal.js.map +1 -1
  191. package/dist/gtkx/bridge/view-box.d.ts +56 -0
  192. package/dist/gtkx/bridge/view-box.js +394 -9
  193. package/dist/gtkx/bridge/view-box.js.map +1 -1
  194. package/dist/gtkx/bridge/widget-css.d.ts +17 -0
  195. package/dist/gtkx/bridge/widget-css.js +72 -0
  196. package/dist/gtkx/bridge/widget-css.js.map +1 -0
  197. package/dist/index.d.ts +3 -3
  198. package/dist/index.js +2 -2
  199. package/dist/index.js.map +1 -1
  200. package/dist/layout/driven-size.d.ts +12 -0
  201. package/dist/layout/driven-size.js +70 -0
  202. package/dist/layout/driven-size.js.map +1 -0
  203. package/dist/layout/engine.d.ts +17 -1
  204. package/dist/layout/engine.js +3 -20
  205. package/dist/layout/engine.js.map +1 -1
  206. package/dist/layout/node.d.ts +13 -0
  207. package/dist/layout/node.js +14 -0
  208. package/dist/layout/node.js.map +1 -1
  209. package/dist/layout/yoga.d.ts +3 -2
  210. package/dist/layout/yoga.js +5 -2
  211. package/dist/layout/yoga.js.map +1 -1
  212. package/dist/mcp/data/generated.d.ts +257 -60
  213. package/dist/mcp/data/generated.js +306 -62
  214. package/dist/mcp/data/generated.js.map +1 -1
  215. package/dist/metro/index.d.ts +10 -0
  216. package/dist/metro/index.js +21 -12
  217. package/dist/metro/index.js.map +1 -1
  218. package/dist/navigation/sidebar.d.ts +16 -0
  219. package/dist/navigation/sidebar.js +65 -1
  220. package/dist/navigation/sidebar.js.map +1 -1
  221. package/dist/reanimated-compat/animated-ref.d.ts +32 -0
  222. package/dist/reanimated-compat/animated-ref.js +57 -0
  223. package/dist/reanimated-compat/animated-ref.js.map +1 -0
  224. package/dist/reanimated-compat/animation.d.ts +177 -0
  225. package/dist/reanimated-compat/animation.js +540 -0
  226. package/dist/reanimated-compat/animation.js.map +1 -0
  227. package/dist/reanimated-compat/color.d.ts +28 -0
  228. package/dist/reanimated-compat/color.js +249 -0
  229. package/dist/reanimated-compat/color.js.map +1 -0
  230. package/dist/reanimated-compat/decay.d.ts +39 -0
  231. package/dist/reanimated-compat/decay.js +96 -0
  232. package/dist/reanimated-compat/decay.js.map +1 -0
  233. package/dist/reanimated-compat/easing.d.ts +30 -0
  234. package/dist/reanimated-compat/easing.js +76 -0
  235. package/dist/reanimated-compat/easing.js.map +1 -0
  236. package/dist/reanimated-compat/hooks.d.ts +14 -0
  237. package/dist/reanimated-compat/hooks.js +217 -0
  238. package/dist/reanimated-compat/hooks.js.map +1 -0
  239. package/dist/reanimated-compat/index.d.ts +258 -0
  240. package/dist/reanimated-compat/index.js +464 -0
  241. package/dist/reanimated-compat/index.js.map +1 -0
  242. package/dist/reanimated-compat/interpolation.d.ts +18 -0
  243. package/dist/reanimated-compat/interpolation.js +122 -0
  244. package/dist/reanimated-compat/interpolation.js.map +1 -0
  245. package/dist/reanimated-compat/layout-animation-config.d.ts +43 -0
  246. package/dist/reanimated-compat/layout-animation-config.js +78 -0
  247. package/dist/reanimated-compat/layout-animation-config.js.map +1 -0
  248. package/dist/reanimated-compat/layout-animation-presets.d.ts +117 -0
  249. package/dist/reanimated-compat/layout-animation-presets.js +498 -0
  250. package/dist/reanimated-compat/layout-animation-presets.js.map +1 -0
  251. package/dist/reanimated-compat/layout-animation-runtime.d.ts +21 -0
  252. package/dist/reanimated-compat/layout-animation-runtime.js +311 -0
  253. package/dist/reanimated-compat/layout-animation-runtime.js.map +1 -0
  254. package/dist/reanimated-compat/layout-animation-view.d.ts +27 -0
  255. package/dist/reanimated-compat/layout-animation-view.js +266 -0
  256. package/dist/reanimated-compat/layout-animation-view.js.map +1 -0
  257. package/dist/reanimated-compat/layout-animation.d.ts +171 -0
  258. package/dist/reanimated-compat/layout-animation.js +469 -0
  259. package/dist/reanimated-compat/layout-animation.js.map +1 -0
  260. package/dist/reanimated-compat/layout-transitions.d.ts +83 -0
  261. package/dist/reanimated-compat/layout-transitions.js +350 -0
  262. package/dist/reanimated-compat/layout-transitions.js.map +1 -0
  263. package/dist/reanimated-compat/mutable.d.ts +29 -0
  264. package/dist/reanimated-compat/mutable.js +139 -0
  265. package/dist/reanimated-compat/mutable.js.map +1 -0
  266. package/dist/reanimated-compat/props.d.ts +18 -0
  267. package/dist/reanimated-compat/props.js +111 -0
  268. package/dist/reanimated-compat/props.js.map +1 -0
  269. package/dist/reanimated-compat/scroll-handler.d.ts +119 -0
  270. package/dist/reanimated-compat/scroll-handler.js +274 -0
  271. package/dist/reanimated-compat/scroll-handler.js.map +1 -0
  272. package/dist/reanimated-compat/scroll-offset.d.ts +12 -0
  273. package/dist/reanimated-compat/scroll-offset.js +104 -0
  274. package/dist/reanimated-compat/scroll-offset.js.map +1 -0
  275. package/dist/reanimated-compat/style.d.ts +90 -0
  276. package/dist/reanimated-compat/style.js +452 -0
  277. package/dist/reanimated-compat/style.js.map +1 -0
  278. package/dist/reanimated-compat/test-timers.d.ts +28 -0
  279. package/dist/reanimated-compat/test-timers.js +136 -0
  280. package/dist/reanimated-compat/test-timers.js.map +1 -0
  281. package/dist/reanimated-compat/threads.d.ts +13 -0
  282. package/dist/reanimated-compat/threads.js +41 -0
  283. package/dist/reanimated-compat/threads.js.map +1 -0
  284. package/dist/reanimated-compat/tracking.d.ts +41 -0
  285. package/dist/reanimated-compat/tracking.js +106 -0
  286. package/dist/reanimated-compat/tracking.js.map +1 -0
  287. package/dist/reanimated-compat/updater-animations.d.ts +36 -0
  288. package/dist/reanimated-compat/updater-animations.js +273 -0
  289. package/dist/reanimated-compat/updater-animations.js.map +1 -0
  290. package/dist/responder/system.d.ts +80 -7
  291. package/dist/responder/system.js +143 -23
  292. package/dist/responder/system.js.map +1 -1
  293. package/dist/responder/use-responder.d.ts +11 -0
  294. package/dist/responder/use-responder.js +225 -6
  295. package/dist/responder/use-responder.js.map +1 -1
  296. package/dist/runner/host-dev.js +1 -1
  297. package/dist/runner/host-dev.js.map +1 -1
  298. package/dist/runner/host.js +1 -1
  299. package/dist/runner/host.js.map +1 -1
  300. package/dist/runner/index.js +3 -3
  301. package/dist/runner/index.js.map +1 -1
  302. package/dist/sea/gtkx-config-module.js +1 -1
  303. package/dist/sea/gtkx-config-module.js.map +1 -1
  304. package/dist/style/absolute-insets.d.ts +26 -0
  305. package/dist/style/absolute-insets.js +113 -0
  306. package/dist/style/absolute-insets.js.map +1 -0
  307. package/dist/style/animated-size.d.ts +25 -0
  308. package/dist/style/animated-size.js +225 -0
  309. package/dist/style/animated-size.js.map +1 -0
  310. package/dist/style/colors.d.ts +17 -0
  311. package/dist/style/colors.js +25 -6
  312. package/dist/style/colors.js.map +1 -1
  313. package/dist/style/imperative-css.d.ts +21 -0
  314. package/dist/style/imperative-css.js +63 -0
  315. package/dist/style/imperative-css.js.map +1 -0
  316. package/dist/style/index.d.ts +2 -1
  317. package/dist/style/index.js +2 -1
  318. package/dist/style/index.js.map +1 -1
  319. package/dist/style/split-style.js +5 -0
  320. package/dist/style/split-style.js.map +1 -1
  321. package/dist/testing/index.js.map +1 -1
  322. package/dist/unsupported-export.d.ts +8 -0
  323. package/dist/unsupported-export.js +66 -0
  324. package/dist/unsupported-export.js.map +1 -0
  325. package/dist/vite/index.d.ts +21 -8
  326. package/dist/vite/index.js +127 -82
  327. package/dist/vite/index.js.map +1 -1
  328. package/dist/vitest/index.d.ts +2 -2
  329. package/dist/vitest/index.js.map +1 -1
  330. package/dist/worklets-compat/index.d.ts +4 -0
  331. package/dist/worklets-compat/index.js +28 -0
  332. package/dist/worklets-compat/index.js.map +1 -0
  333. package/dist/worklets-compat/surface.d.ts +110 -0
  334. package/dist/worklets-compat/surface.js +153 -0
  335. package/dist/worklets-compat/surface.js.map +1 -0
  336. package/package.json +25 -9
  337. package/types.d.ts +9 -0
  338. package/dist/common/list.d.ts +0 -82
  339. package/dist/common/list.js +0 -166
  340. package/dist/common/list.js.map +0 -1
@@ -0,0 +1,255 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from "../components/view";
3
+ import { createUnsupportedFactory } from "../unsupported-export";
4
+ import { Gesture } from "./builder";
5
+ import { GestureDetector } from "./detector";
6
+ import { useCompetingGestures, useExclusiveGestures, useFlingGesture, useHoverGesture, useLongPressGesture, useManualGesture, useNativeGesture, usePanGesture, usePinchGesture, useRotationGesture, useSimultaneousGestures, useTapGesture, } from "./hooks";
7
+ import { DIRECTIONS, GESTURE_STATE, HOVER_EFFECT, MOUSE_BUTTON, POINTER_TYPE, } from "./types";
8
+ export { Gesture, GestureDetector, useCompetingGestures, useExclusiveGestures, useFlingGesture, useHoverGesture, useLongPressGesture, useManualGesture, useNativeGesture, usePanGesture, usePinchGesture, useRotationGesture, useSimultaneousGestures, useTapGesture, };
9
+ export { FlingGestureBuilder, ForceTouchGestureBuilder, HoverGestureBuilder, LongPressGestureBuilder, ManualGestureBuilder, NativeGestureBuilder, PanGestureBuilder, PinchGestureBuilder, RotationGestureBuilder, TapGestureBuilder, } from "./builder";
10
+ /**
11
+ * Upstream's default, and note that it is `style ?? {flex: 1}` rather than
12
+ * `[{flex: 1}, style]`: passing a style REPLACES the flex box, it does not
13
+ * merge with it. Verified against react-native-gesture-handler 3.1.0, where
14
+ * all three implementations (`.tsx`, `.web.tsx`, `.android.tsx`) agree on
15
+ * `<View style={style ?? styles.container} {...rest} />`. The difference is
16
+ * observable — with `style={{height: 100}}` upstream gives a 100px-tall box
17
+ * with no `flex`, and a merged version would give a flexing one.
18
+ */
19
+ const ROOT_STYLE = { flex: 1 };
20
+ /**
21
+ * The root box `react-native-gesture-handler` asks apps to put at the top of
22
+ * the tree.
23
+ *
24
+ * Faithful, not merely tolerated. Upstream's does two things: it renders a
25
+ * `flex: 1` `View`, and it marks the subtree as gesture-arbitrating. The
26
+ * first is reproduced exactly. The second is genuinely this platform's job
27
+ * already — RN's own gesture responder system is implemented here on GTK4
28
+ * event controllers (#41), and its lock is global — so there is no context to
29
+ * provide and nothing is being skipped.
30
+ */
31
+ export const GestureHandlerRootView = ({ children, style, testID, }) => (_jsx(View, { style: style ?? ROOT_STYLE, testID: testID, children: children }));
32
+ const unsupported = createUnsupportedFactory("react-native-gesture-handler", "Implemented: GestureHandlerRootView, GestureDetector, `State`, `Directions`, `HoverEffect`, " +
33
+ "the re-exported ScrollView/FlatList/TextInput/Switch and the three Touchables, and ALL TEN " +
34
+ "recognizers — Pan, Tap, LongPress, Native, Pinch, Rotation, Fling, Manual, Hover and " +
35
+ "ForceTouch — in both spellings where upstream has two (`Gesture.Pan()` and " +
36
+ "`usePanGesture()`, and so on), plus the three cross-gesture relations and the three " +
37
+ "composers. Three of them need input a mouse cannot produce: Pinch and Rotation need a " +
38
+ "TOUCHPAD (GtkGestureZoom/GtkGestureRotate) and ForceTouch needs a pressure-reporting " +
39
+ "STYLUS (GtkGestureStylus). RN's own responder system and PanResponder also work " +
40
+ "(docs/api.md); drag-and-drop is react-native-gtkx/dnd.");
41
+ // Every runtime value `react-native-gesture-handler` 3.1.0 exports, minus
42
+ // GestureHandlerRootView above. Enumerated rather than generated by a Proxy
43
+ // over the module, because ESM named imports are resolved statically: a
44
+ // symbol that is not exported here fails at BUILD time with "no export named
45
+ // X", which is loud in its own right — but only the names listed here can
46
+ // produce the descriptive runtime message, so the list is worth keeping
47
+ // complete.
48
+ //
49
+ // The `any` is deliberate and load-bearing: an app's `<PanGestureHandler>`
50
+ // must still type-check (it type-checks against the REAL package anyway, see
51
+ // the note at the top) and fail when it runs, not before.
52
+ /* eslint-disable @typescript-eslint/no-explicit-any */
53
+ // --- the legacy handler components ---
54
+ //
55
+ // ALL NINE STAY REFUSED, and now that every recognizer behind them is
56
+ // implemented the reason is worth stating precisely rather than leaving as a
57
+ // bare `unsupported()`: these are not gestures, they are the RNGH **1.x
58
+ // component API** — `<PanGestureHandler onGestureEvent={...}><View/></PanGestureHandler>`
59
+ // — which upstream deprecated years before it deprecated the builder, and
60
+ // which every one of the four libraries this epic targets has already
61
+ // migrated off. Reimplementing them would mean a second public surface over
62
+ // the same recognizers, with its own `onGestureEvent`/`onHandlerStateChange`
63
+ // event shape, its own `enabled`/`waitFor` prop plumbing and its own
64
+ // `createHandler` HOC — for zero measured consumers and a spelling upstream is
65
+ // removing. `Gesture.Pan()` and `usePanGesture()` are the two spellings that
66
+ // exist here, which is one more than upstream is keeping.
67
+ //
68
+ // The message each throws names itself, so an app on the old API is told which
69
+ // symbol to migrate rather than left with a missing export.
70
+ export const FlingGestureHandler = unsupported("FlingGestureHandler");
71
+ export const ForceTouchGestureHandler = unsupported("ForceTouchGestureHandler");
72
+ export const LongPressGestureHandler = unsupported("LongPressGestureHandler");
73
+ export const NativeViewGestureHandler = unsupported("NativeViewGestureHandler");
74
+ export const PanGestureHandler = unsupported("PanGestureHandler");
75
+ export const PinchGestureHandler = unsupported("PinchGestureHandler");
76
+ export const RotationGestureHandler = unsupported("RotationGestureHandler");
77
+ export const TapGestureHandler = unsupported("TapGestureHandler");
78
+ // `createNativeWrapper(Component, config)` attaches a `NativeViewGestureHandler`
79
+ // to an arbitrary RN component. On this platform the responder system IS the
80
+ // arbitration that wrapper registers with, every component this package ships
81
+ // already speaks it, and `Gesture.Native()` is how a gesture is declared over
82
+ // one explicitly — so the wrapper has nothing to add and would be a no-op
83
+ // dressed as a feature. The re-exported ScrollView/FlatList/Touchables below
84
+ // are that reasoning applied to the components upstream wraps itself.
85
+ export const legacy_createNativeWrapper = unsupported("legacy_createNativeWrapper");
86
+ // --- the new (v3) gesture API ---
87
+ // `Gesture`, `GestureDetector`, the nine gesture hooks and the three composer
88
+ // hooks are re-exported at the top of this file. `Gesture` is a real namespace
89
+ // and none of its statics throws any more.
90
+ //
91
+ // The four below are refused for four different reasons, none of them "not got
92
+ // round to it":
93
+ //
94
+ // - `GestureDetectorType` is a TYPE upstream, not a value. It only ever
95
+ // appears in a type position, where this module is not in the path at all
96
+ // (the alias is a BUNDLER alias; `tsc` resolves the real package's types
97
+ // from node_modules — see the note at the top of this file). A runtime
98
+ // value under that name could only be reached by code that has already
99
+ // gone wrong;
100
+ // - `GestureStateManager` is upstream's standalone FACTORY, `create(tag)`,
101
+ // which looks a mounted handler up by tag in a global `NodeManager`. The
102
+ // manager an app actually uses is the one handed into `onTouchesDown` /
103
+ // `onTouchesMove` / `onTouchesUp` / `onTouchesCancel`, and that one IS
104
+ // implemented — it is what drives `Gesture.Manual()`. What is missing is
105
+ // the global tag→handler registry, and its absence is deliberate: identity
106
+ // here is the mounted detector, and ./relations resolves an app's gesture
107
+ // object to a tag lazily precisely so that nothing has to be looked up in
108
+ // a process-wide map. Upstream marks this export deprecated in favour of
109
+ // the hook API in the same breath;
110
+ // - `InterceptingGestureDetector` and `VirtualGestureDetector` are 3.1.0's
111
+ // new experimental detectors. The first intercepts events destined for
112
+ // views BELOW it, which on this platform would mean claiming a GTK
113
+ // sequence before deciding — and `CLAIMED` is irrevocable here, so the
114
+ // "intercept, look, maybe give back" shape is not expressible. The second
115
+ // drives a gesture with no view at all, which needs the tag registry the
116
+ // entry above says why this platform does not have.
117
+ export const GestureDetectorType = unsupported("GestureDetectorType");
118
+ export const GestureStateManager = unsupported("GestureStateManager");
119
+ export const InterceptingGestureDetector = unsupported("InterceptingGestureDetector");
120
+ export const VirtualGestureDetector = unsupported("VirtualGestureDetector");
121
+ // --- enums and constants ---
122
+ //
123
+ // ALL FIVE ARE NOW DATA, and the last four changed here. The old rule was that
124
+ // an enum is only meaningful next to a handler that can run, so reading one
125
+ // was already a symptom — and that rule was right when six of the ten
126
+ // recognizers threw. It stopped describing anything true when the last four
127
+ // shipped, and the honest test is now the plain one: does an app comparing
128
+ // against this constant get a correct answer? For every one of these, yes.
129
+ //
130
+ // `State` went first, in slice 2, and the reasoning generalises to the rest:
131
+ // every payload carries a faithful `state`, so `=== State.ACTIVE` is ordinary
132
+ // correct code. `react-native-drawer-layout` does exactly that — it re-exports
133
+ // it as `GestureState`, seeds a shared value with `GestureState.UNDETERMINED`
134
+ // and tests `=== GestureState.ACTIVE`.
135
+ //
136
+ // `Directions` is REQUIRED rather than merely harmless: `Gesture.Fling()`
137
+ // takes a direction and this is the enum it takes. A refusal here would make
138
+ // the recognizer unusable in its documented spelling.
139
+ //
140
+ // `PointerType` became meaningful with `ForceTouch`, which is the first kind
141
+ // whose events are honestly not a mouse — every payload carries `pointerType`,
142
+ // and a stylus one says `STYLUS`.
143
+ //
144
+ // `HoverEffect` and `MouseButton` are INERT and exported anyway, which is the
145
+ // one place this file's rule bends. Both name values for knobs that are
146
+ // already accepted-and-inert here (`.effect()`, `.mouseButton()`) exactly as
147
+ // they are inert off their platforms upstream, and a knob that accepts a
148
+ // number while refusing the constant that number has a name for is incoherent.
149
+ // The refusal that matters is for something that would silently NOT WORK;
150
+ // these do exactly what they do upstream on this platform, which is nothing.
151
+ //
152
+ // Every number in all five is pinned by a test against 3.1.0's own sources,
153
+ // because nothing about a wrong one is loud: `state === State.ACTIVE` and
154
+ // `direction === Directions.LEFT` both go on compiling, go on running, and
155
+ // quietly answer false.
156
+ export const State = GESTURE_STATE;
157
+ export const Directions = DIRECTIONS;
158
+ export const HoverEffect = HOVER_EFFECT;
159
+ export const MouseButton = MOUSE_BUTTON;
160
+ export const PointerType = POINTER_TYPE;
161
+ // --- the wrapped RN components and buttons ---
162
+ //
163
+ // Upstream builds every one of these with `createNativeWrapper(RN.X, {
164
+ // disallowInterruption: true, shouldCancelWhenOutside: false })` — an RN
165
+ // component with a `NativeViewGestureHandler` attached, so that RNGH's
166
+ // arbitration knows about the native scrolling or the native press underneath.
167
+ // On this platform that wrapper has nothing to add: the responder system IS
168
+ // the arbitration these are being registered with, every one of these
169
+ // components already speaks it, and `Gesture.Native()` is how a gesture is
170
+ // declared over one of them explicitly. So the honest re-export is the
171
+ // platform's own component, unwrapped.
172
+ //
173
+ // They are here because they are RENDERED, not merely imported.
174
+ // `react-native-draggable-flatlist` 4.0.3 hands `FlatList` and `ScrollView` to
175
+ // `Animated.createAnimatedComponent()` at module scope in
176
+ // `DraggableFlatList.tsx` and `NestableScrollContainer.tsx`, which is what
177
+ // stopped that library at IMPORT rather than at use;
178
+ // `react-native-reanimated-dnd`'s `Sortable`/`SortableGrid` do the same;
179
+ // `@gorhom/bottom-sheet` re-exports the three Touchables from its own public
180
+ // entry as `BottomSheetTouchable` on every platform except iOS, and renders
181
+ // `TextInput` as `BottomSheetTextInput`.
182
+ //
183
+ // WHAT IS NOT HERE, and the boundary is upstream's own: the BUTTON family
184
+ // (`RawButton`, `BaseButton`, `RectButton`, `BorderlessButton`) is not RN
185
+ // components with a handler attached — it is RNGH's own NATIVE BUTTON VIEWS,
186
+ // implemented in Java and Objective-C, with an Android ripple
187
+ // (`TouchableNativeFeedback`'s), `borderless` drawable selection, `rippleColor`
188
+ // / `rippleRadius`, `exclusive`, and an `activeOpacity` applied by the native
189
+ // view rather than by style. There is no GTK widget with those semantics and
190
+ // no way to fake the ripple, so any implementation would be a `Pressable`
191
+ // wearing the name of something else — which is precisely the silent
192
+ // substitution this whole surface refuses.
193
+ //
194
+ // RE-CHECKED WITH THE FOUR TARGET LIBRARIES rather than assumed, because that
195
+ // is what settled the `Touchable` question in slice 4. Sweeping the shipped
196
+ // sources of `@gorhom/bottom-sheet` 5.2.14, `react-native-draggable-flatlist`
197
+ // 4.0.3, `react-native-drawer-layout` 4.2.9 and `react-native-reanimated-dnd`
198
+ // 2.0.0 for every symbol still refused here finds exactly one hit —
199
+ // `RefreshControl` in `@gorhom/bottom-sheet` — and it is not this package's:
200
+ // it is imported from `react-native`, as a type in `bottomSheetRefreshControl/
201
+ // index.ts` and as a value only in `BottomSheetRefreshControl.android.tsx`,
202
+ // which Metro on this platform never resolves (`.linux.* -> .native.* -> .*`).
203
+ // Nothing reaches for a button, a legacy handler component, `Directions`,
204
+ // `MouseButton`, `PointerType`, `GestureStateManager` or any `Legacy*` alias.
205
+ // The `Touchable` subset slice 4 shipped remains the only thing upstream's own
206
+ // exports forced.
207
+ //
208
+ // `TouchableNativeFeedback` is Android's ripple by another name and `Touchable`
209
+ // is RN's deprecated mixin; both stay refused for the reason RN itself would
210
+ // not give them to you here. `RefreshControl` is pull-to-refresh, which needs
211
+ // a scroll gesture this platform's `ScrollView` does not expose and a spinner
212
+ // widget it does not have — and, per the sweep above, nothing asks for it.
213
+ export const BaseButton = unsupported("BaseButton");
214
+ export const BorderlessButton = unsupported("BorderlessButton");
215
+ export { FlatList } from "../components/flat-list";
216
+ export { Pressable, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, } from "../components/pressable";
217
+ export { ScrollView } from "../components/scroll-view";
218
+ export { Switch } from "../components/switch";
219
+ export { TextInput } from "../components/text-input";
220
+ export const RawButton = unsupported("RawButton");
221
+ export const RectButton = unsupported("RectButton");
222
+ export const RefreshControl = unsupported("RefreshControl");
223
+ export const Touchable = unsupported("Touchable");
224
+ export const TouchableNativeFeedback = unsupported("TouchableNativeFeedback");
225
+ // --- the 2.x legacy aliases, still exported by 3.x ---
226
+ //
227
+ // ALL TWELVE STAY REFUSED, for one reason that covers them: each is 3.x's
228
+ // escape hatch back to the 2.x implementation of a component whose 3.x
229
+ // spelling is either implemented here already (`LegacyScrollView`,
230
+ // `LegacyFlatList`, `LegacyTextInput`, `LegacySwitch`, `LegacyPressable`,
231
+ // `LegacyText`) or refused above with its own reason (`LegacyRawButton`,
232
+ // `LegacyBaseButton`, `LegacyRectButton`, `LegacyBorderlessButton`,
233
+ // `LegacyRefreshControl`). Where the modern name works, the legacy alias would
234
+ // be a second name for the same component with a promise attached — "this one
235
+ // behaves like 2.x did" — that this platform cannot keep, because it never
236
+ // implemented 2.x's behaviour to differ from. Where the modern name is
237
+ // refused, the alias inherits the refusal.
238
+ //
239
+ // `LegacyDrawerLayoutAndroid` is the odd one and is refused twice over: it is
240
+ // Android's `DrawerLayoutAndroid`, which React Native itself does not ship off
241
+ // Android, and `@react-navigation/drawer` reaches for
242
+ // `react-native-drawer-layout` instead — which runs here (probe 3).
243
+ export const LegacyBaseButton = unsupported("LegacyBaseButton");
244
+ export const LegacyBorderlessButton = unsupported("LegacyBorderlessButton");
245
+ export const LegacyDrawerLayoutAndroid = unsupported("LegacyDrawerLayoutAndroid");
246
+ export const LegacyFlatList = unsupported("LegacyFlatList");
247
+ export const LegacyPressable = unsupported("LegacyPressable");
248
+ export const LegacyRawButton = unsupported("LegacyRawButton");
249
+ export const LegacyRectButton = unsupported("LegacyRectButton");
250
+ export const LegacyRefreshControl = unsupported("LegacyRefreshControl");
251
+ export const LegacyScrollView = unsupported("LegacyScrollView");
252
+ export const LegacySwitch = unsupported("LegacySwitch");
253
+ export const LegacyText = unsupported("LegacyText");
254
+ export const LegacyTextInput = unsupported("LegacyTextInput");
255
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gesture-handler-compat/index.tsx"],"names":[],"mappings":";AA6CA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,GACd,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,UAAU,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,GACd,CAAA;AACD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,WAAW,CAAA;AA4BlB;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,CAAC,EAAW,CAAA;AAQvC;;;;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;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAQ,WAAW,CAAC,kBAAkB,CAAC,CAAA;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAQ,WAAW,CAAC,wBAAwB,CAAC,CAAA;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAQ,WAAW,CACvD,2BAA2B,CAC5B,CAAA;AACD,MAAM,CAAC,MAAM,cAAc,GAAQ,WAAW,CAAC,gBAAgB,CAAC,CAAA;AAChE,MAAM,CAAC,MAAM,eAAe,GAAQ,WAAW,CAAC,iBAAiB,CAAC,CAAA;AAClE,MAAM,CAAC,MAAM,eAAe,GAAQ,WAAW,CAAC,iBAAiB,CAAC,CAAA;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAQ,WAAW,CAAC,kBAAkB,CAAC,CAAA;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAQ,WAAW,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAQ,WAAW,CAAC,kBAAkB,CAAC,CAAA;AACpE,MAAM,CAAC,MAAM,YAAY,GAAQ,WAAW,CAAC,cAAc,CAAC,CAAA;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAQ,WAAW,CAAC,YAAY,CAAC,CAAA;AACxD,MAAM,CAAC,MAAM,eAAe,GAAQ,WAAW,CAAC,iBAAiB,CAAC,CAAA","sourcesContent":["// react-native-gtkx/gesture-handler — all ten recognizers, `GestureDetector`,\n// the relations and the root view, reimplemented over this platform's own\n// responder system, and a loud refusal for what is left.\n//\n// WHAT IS LEFT is now a short and deliberate list rather than a backlog: the\n// RNGH 1.x component API, the native button family, and the three exports that\n// need a process-wide handler-tag registry this platform does not keep. Each\n// carries its reason where it is declared below and in docs/api.md, because a\n// refusal that does not say why is indistinguishable from one nobody has\n// revisited — which is exactly what happened to `Gesture.Hover()`, refused for\n// a year on a judgement about the test rig that turned out to be wrong.\n//\n// NOT A PORT. `docs/research/gestures.md` refused RNGH on four grounds, two of\n// which expired when `react-native-gtkx/reanimated` shipped; the other two —\n// no `exports` map on `src/web/`, no out-of-tree platform story, and a\n// react-native-windows precedent that has been a literal `// NO-OP` since\n// 2.8.0 — stand. So this is the third instance of the pattern that has worked\n// twice already: reimplement the SEMANTICS behind the package name, take the\n// upstream implementation as a blueprint rather than as a dependency. The\n// recognizer and its arbitration are the implementation (see ./recognizer,\n// ./pan); `Gesture.Pan()` and `usePanGesture()` are two thin spellings over\n// it, which is the mistake upstream made and had to undo in 3.1.0.\n//\n// The root view came first and for its own reason: exactly one RNGH symbol\n// appears in apps that do not otherwise use RNGH — `GestureHandlerRootView`.\n// Every drag-and-drop app has it at the root, because\n// `react-native-reanimated-dnd`'s own quick start puts it there.\n//\n// WHY it is not a bare passthrough. `GestureHandlerRootView` is a real layout\n// box: upstream renders `<View style={style ?? {flex: 1}}>`, so an app that\n// leans on that box to fill the screen would collapse without it. Rendering\n// only the children would be a simplification, not a shim. See `ROOT_STYLE`.\n//\n// WHY everything else throws rather than no-oping. docs/research/gestures.md\n// records the failure mode this repo most wants to avoid: `Animated.View`\n// silently accepting the responder props and ignoring them compiled, ran, and\n// did nothing — \"the worst possible failure mode\". A `PanGestureHandler` that\n// renders its children without gestures is the same trap. An unsupported RNGH\n// import must fail where it is used, naming itself.\n//\n// Note on types: this is a BUNDLER alias, so `tsc` never sees it. An app\n// keeps `react-native-gesture-handler` in its dependencies for iOS and\n// Android, and TypeScript goes on resolving the real package's types from\n// node_modules. That is why nothing here mirrors RNGH's ~60 type exports.\nimport type { ReactNode } from \"react\"\nimport { View } from \"../components/view\"\nimport type { StyleProp } from \"../contracts\"\nimport { createUnsupportedFactory } from \"../unsupported-export\"\nimport { Gesture } from \"./builder\"\nimport { GestureDetector } from \"./detector\"\nimport {\n useCompetingGestures,\n useExclusiveGestures,\n useFlingGesture,\n useHoverGesture,\n useLongPressGesture,\n useManualGesture,\n useNativeGesture,\n usePanGesture,\n usePinchGesture,\n useRotationGesture,\n useSimultaneousGestures,\n useTapGesture,\n} from \"./hooks\"\nimport {\n DIRECTIONS,\n GESTURE_STATE,\n HOVER_EFFECT,\n MOUSE_BUTTON,\n POINTER_TYPE,\n} from \"./types\"\n\nexport {\n Gesture,\n GestureDetector,\n useCompetingGestures,\n useExclusiveGestures,\n useFlingGesture,\n useHoverGesture,\n useLongPressGesture,\n useManualGesture,\n useNativeGesture,\n usePanGesture,\n usePinchGesture,\n useRotationGesture,\n useSimultaneousGestures,\n useTapGesture,\n}\nexport {\n FlingGestureBuilder,\n ForceTouchGestureBuilder,\n HoverGestureBuilder,\n LongPressGestureBuilder,\n ManualGestureBuilder,\n NativeGestureBuilder,\n PanGestureBuilder,\n PinchGestureBuilder,\n RotationGestureBuilder,\n TapGestureBuilder,\n} from \"./builder\"\nexport type { GestureDetectorProps } from \"./detector\"\nexport type {\n FlingGestureHookConfig,\n HoverGestureHookConfig,\n LongPressGestureHookConfig,\n ManualGestureHookConfig,\n NativeGestureHookConfig,\n PanGestureHookConfig,\n TapGestureHookConfig,\n} from \"./hooks\"\nexport type {\n AnyGestureSpec,\n ComposedGestureKind,\n ComposedGestureSpec,\n GestureEndEventPayload,\n GestureEventPayload,\n GestureHitSlop,\n GestureKind,\n GestureRef,\n GestureRelations,\n GestureSpec,\n GestureStateManagerApi,\n GestureTouchData,\n GestureTouchEvent,\n OffsetBound,\n} from \"./types\"\n\n/**\n * Upstream's default, and note that it is `style ?? {flex: 1}` rather than\n * `[{flex: 1}, style]`: passing a style REPLACES the flex box, it does not\n * merge with it. Verified against react-native-gesture-handler 3.1.0, where\n * all three implementations (`.tsx`, `.web.tsx`, `.android.tsx`) agree on\n * `<View style={style ?? styles.container} {...rest} />`. The difference is\n * observable — with `style={{height: 100}}` upstream gives a 100px-tall box\n * with no `flex`, and a merged version would give a flexing one.\n */\nconst ROOT_STYLE = { flex: 1 } as const\n\nexport type GestureHandlerRootViewProps = {\n children?: ReactNode\n style?: StyleProp\n testID?: string\n}\n\n/**\n * The root box `react-native-gesture-handler` asks apps to put at the top of\n * the tree.\n *\n * Faithful, not merely tolerated. Upstream's does two things: it renders a\n * `flex: 1` `View`, and it marks the subtree as gesture-arbitrating. The\n * first is reproduced exactly. The second is genuinely this platform's job\n * already — RN's own gesture responder system is implemented here on GTK4\n * event controllers (#41), and its lock is global — so there is no context to\n * provide and nothing is being skipped.\n */\nexport const GestureHandlerRootView = ({\n children,\n style,\n testID,\n}: GestureHandlerRootViewProps): ReactNode => (\n <View\n style={style ?? ROOT_STYLE}\n testID={testID}\n >\n {children}\n </View>\n)\n\nconst unsupported = createUnsupportedFactory(\n \"react-native-gesture-handler\",\n \"Implemented: GestureHandlerRootView, GestureDetector, `State`, `Directions`, `HoverEffect`, \" +\n \"the re-exported ScrollView/FlatList/TextInput/Switch and the three Touchables, and ALL TEN \" +\n \"recognizers — Pan, Tap, LongPress, Native, Pinch, Rotation, Fling, Manual, Hover and \" +\n \"ForceTouch — in both spellings where upstream has two (`Gesture.Pan()` and \" +\n \"`usePanGesture()`, and so on), plus the three cross-gesture relations and the three \" +\n \"composers. Three of them need input a mouse cannot produce: Pinch and Rotation need a \" +\n \"TOUCHPAD (GtkGestureZoom/GtkGestureRotate) and ForceTouch needs a pressure-reporting \" +\n \"STYLUS (GtkGestureStylus). RN's own responder system and PanResponder also work \" +\n \"(docs/api.md); drag-and-drop is react-native-gtkx/dnd.\",\n)\n\n// Every runtime value `react-native-gesture-handler` 3.1.0 exports, minus\n// GestureHandlerRootView above. Enumerated rather than generated by a Proxy\n// over the module, because ESM named imports are resolved statically: a\n// symbol that is not exported here fails at BUILD time with \"no export named\n// X\", which is loud in its own right — but only the names listed here can\n// produce the descriptive runtime message, so the list is worth keeping\n// complete.\n//\n// The `any` is deliberate and load-bearing: an app's `<PanGestureHandler>`\n// must still type-check (it type-checks against the REAL package anyway, see\n// the note at the top) and fail when it runs, not before.\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// --- the legacy handler components ---\n//\n// ALL NINE STAY REFUSED, and now that every recognizer behind them is\n// implemented the reason is worth stating precisely rather than leaving as a\n// bare `unsupported()`: these are not gestures, they are the RNGH **1.x\n// component API** — `<PanGestureHandler onGestureEvent={...}><View/></PanGestureHandler>`\n// — which upstream deprecated years before it deprecated the builder, and\n// which every one of the four libraries this epic targets has already\n// migrated off. Reimplementing them would mean a second public surface over\n// the same recognizers, with its own `onGestureEvent`/`onHandlerStateChange`\n// event shape, its own `enabled`/`waitFor` prop plumbing and its own\n// `createHandler` HOC — for zero measured consumers and a spelling upstream is\n// removing. `Gesture.Pan()` and `usePanGesture()` are the two spellings that\n// exist here, which is one more than upstream is keeping.\n//\n// The message each throws names itself, so an app on the old API is told which\n// symbol to migrate rather than left with a missing export.\nexport const FlingGestureHandler: any = unsupported(\"FlingGestureHandler\")\nexport const ForceTouchGestureHandler: any = unsupported(\n \"ForceTouchGestureHandler\",\n)\nexport const LongPressGestureHandler: any = unsupported(\n \"LongPressGestureHandler\",\n)\nexport const NativeViewGestureHandler: any = unsupported(\n \"NativeViewGestureHandler\",\n)\nexport const PanGestureHandler: any = unsupported(\"PanGestureHandler\")\nexport const PinchGestureHandler: any = unsupported(\"PinchGestureHandler\")\nexport const RotationGestureHandler: any = unsupported(\"RotationGestureHandler\")\nexport const TapGestureHandler: any = unsupported(\"TapGestureHandler\")\n// `createNativeWrapper(Component, config)` attaches a `NativeViewGestureHandler`\n// to an arbitrary RN component. On this platform the responder system IS the\n// arbitration that wrapper registers with, every component this package ships\n// already speaks it, and `Gesture.Native()` is how a gesture is declared over\n// one explicitly — so the wrapper has nothing to add and would be a no-op\n// dressed as a feature. The re-exported ScrollView/FlatList/Touchables below\n// are that reasoning applied to the components upstream wraps itself.\nexport const legacy_createNativeWrapper: any = unsupported(\n \"legacy_createNativeWrapper\",\n)\n\n// --- the new (v3) gesture API ---\n// `Gesture`, `GestureDetector`, the nine gesture hooks and the three composer\n// hooks are re-exported at the top of this file. `Gesture` is a real namespace\n// and none of its statics throws any more.\n//\n// The four below are refused for four different reasons, none of them \"not got\n// round to it\":\n//\n// - `GestureDetectorType` is a TYPE upstream, not a value. It only ever\n// appears in a type position, where this module is not in the path at all\n// (the alias is a BUNDLER alias; `tsc` resolves the real package's types\n// from node_modules — see the note at the top of this file). A runtime\n// value under that name could only be reached by code that has already\n// gone wrong;\n// - `GestureStateManager` is upstream's standalone FACTORY, `create(tag)`,\n// which looks a mounted handler up by tag in a global `NodeManager`. The\n// manager an app actually uses is the one handed into `onTouchesDown` /\n// `onTouchesMove` / `onTouchesUp` / `onTouchesCancel`, and that one IS\n// implemented — it is what drives `Gesture.Manual()`. What is missing is\n// the global tag→handler registry, and its absence is deliberate: identity\n// here is the mounted detector, and ./relations resolves an app's gesture\n// object to a tag lazily precisely so that nothing has to be looked up in\n// a process-wide map. Upstream marks this export deprecated in favour of\n// the hook API in the same breath;\n// - `InterceptingGestureDetector` and `VirtualGestureDetector` are 3.1.0's\n// new experimental detectors. The first intercepts events destined for\n// views BELOW it, which on this platform would mean claiming a GTK\n// sequence before deciding — and `CLAIMED` is irrevocable here, so the\n// \"intercept, look, maybe give back\" shape is not expressible. The second\n// drives a gesture with no view at all, which needs the tag registry the\n// entry above says why this platform does not have.\nexport const GestureDetectorType: any = unsupported(\"GestureDetectorType\")\nexport const GestureStateManager: any = unsupported(\"GestureStateManager\")\nexport const InterceptingGestureDetector: any = unsupported(\n \"InterceptingGestureDetector\",\n)\nexport const VirtualGestureDetector: any = unsupported(\"VirtualGestureDetector\")\n\n// --- enums and constants ---\n//\n// ALL FIVE ARE NOW DATA, and the last four changed here. The old rule was that\n// an enum is only meaningful next to a handler that can run, so reading one\n// was already a symptom — and that rule was right when six of the ten\n// recognizers threw. It stopped describing anything true when the last four\n// shipped, and the honest test is now the plain one: does an app comparing\n// against this constant get a correct answer? For every one of these, yes.\n//\n// `State` went first, in slice 2, and the reasoning generalises to the rest:\n// every payload carries a faithful `state`, so `=== State.ACTIVE` is ordinary\n// correct code. `react-native-drawer-layout` does exactly that — it re-exports\n// it as `GestureState`, seeds a shared value with `GestureState.UNDETERMINED`\n// and tests `=== GestureState.ACTIVE`.\n//\n// `Directions` is REQUIRED rather than merely harmless: `Gesture.Fling()`\n// takes a direction and this is the enum it takes. A refusal here would make\n// the recognizer unusable in its documented spelling.\n//\n// `PointerType` became meaningful with `ForceTouch`, which is the first kind\n// whose events are honestly not a mouse — every payload carries `pointerType`,\n// and a stylus one says `STYLUS`.\n//\n// `HoverEffect` and `MouseButton` are INERT and exported anyway, which is the\n// one place this file's rule bends. Both name values for knobs that are\n// already accepted-and-inert here (`.effect()`, `.mouseButton()`) exactly as\n// they are inert off their platforms upstream, and a knob that accepts a\n// number while refusing the constant that number has a name for is incoherent.\n// The refusal that matters is for something that would silently NOT WORK;\n// these do exactly what they do upstream on this platform, which is nothing.\n//\n// Every number in all five is pinned by a test against 3.1.0's own sources,\n// because nothing about a wrong one is loud: `state === State.ACTIVE` and\n// `direction === Directions.LEFT` both go on compiling, go on running, and\n// quietly answer false.\nexport const State = GESTURE_STATE\nexport const Directions = DIRECTIONS\nexport const HoverEffect = HOVER_EFFECT\nexport const MouseButton = MOUSE_BUTTON\nexport const PointerType = POINTER_TYPE\n\n// --- the wrapped RN components and buttons ---\n//\n// Upstream builds every one of these with `createNativeWrapper(RN.X, {\n// disallowInterruption: true, shouldCancelWhenOutside: false })` — an RN\n// component with a `NativeViewGestureHandler` attached, so that RNGH's\n// arbitration knows about the native scrolling or the native press underneath.\n// On this platform that wrapper has nothing to add: the responder system IS\n// the arbitration these are being registered with, every one of these\n// components already speaks it, and `Gesture.Native()` is how a gesture is\n// declared over one of them explicitly. So the honest re-export is the\n// platform's own component, unwrapped.\n//\n// They are here because they are RENDERED, not merely imported.\n// `react-native-draggable-flatlist` 4.0.3 hands `FlatList` and `ScrollView` to\n// `Animated.createAnimatedComponent()` at module scope in\n// `DraggableFlatList.tsx` and `NestableScrollContainer.tsx`, which is what\n// stopped that library at IMPORT rather than at use;\n// `react-native-reanimated-dnd`'s `Sortable`/`SortableGrid` do the same;\n// `@gorhom/bottom-sheet` re-exports the three Touchables from its own public\n// entry as `BottomSheetTouchable` on every platform except iOS, and renders\n// `TextInput` as `BottomSheetTextInput`.\n//\n// WHAT IS NOT HERE, and the boundary is upstream's own: the BUTTON family\n// (`RawButton`, `BaseButton`, `RectButton`, `BorderlessButton`) is not RN\n// components with a handler attached — it is RNGH's own NATIVE BUTTON VIEWS,\n// implemented in Java and Objective-C, with an Android ripple\n// (`TouchableNativeFeedback`'s), `borderless` drawable selection, `rippleColor`\n// / `rippleRadius`, `exclusive`, and an `activeOpacity` applied by the native\n// view rather than by style. There is no GTK widget with those semantics and\n// no way to fake the ripple, so any implementation would be a `Pressable`\n// wearing the name of something else — which is precisely the silent\n// substitution this whole surface refuses.\n//\n// RE-CHECKED WITH THE FOUR TARGET LIBRARIES rather than assumed, because that\n// is what settled the `Touchable` question in slice 4. Sweeping the shipped\n// sources of `@gorhom/bottom-sheet` 5.2.14, `react-native-draggable-flatlist`\n// 4.0.3, `react-native-drawer-layout` 4.2.9 and `react-native-reanimated-dnd`\n// 2.0.0 for every symbol still refused here finds exactly one hit —\n// `RefreshControl` in `@gorhom/bottom-sheet` — and it is not this package's:\n// it is imported from `react-native`, as a type in `bottomSheetRefreshControl/\n// index.ts` and as a value only in `BottomSheetRefreshControl.android.tsx`,\n// which Metro on this platform never resolves (`.linux.* -> .native.* -> .*`).\n// Nothing reaches for a button, a legacy handler component, `Directions`,\n// `MouseButton`, `PointerType`, `GestureStateManager` or any `Legacy*` alias.\n// The `Touchable` subset slice 4 shipped remains the only thing upstream's own\n// exports forced.\n//\n// `TouchableNativeFeedback` is Android's ripple by another name and `Touchable`\n// is RN's deprecated mixin; both stay refused for the reason RN itself would\n// not give them to you here. `RefreshControl` is pull-to-refresh, which needs\n// a scroll gesture this platform's `ScrollView` does not expose and a spinner\n// widget it does not have — and, per the sweep above, nothing asks for it.\nexport const BaseButton: any = unsupported(\"BaseButton\")\nexport const BorderlessButton: any = unsupported(\"BorderlessButton\")\nexport { FlatList } from \"../components/flat-list\"\nexport {\n Pressable,\n TouchableHighlight,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from \"../components/pressable\"\nexport { ScrollView } from \"../components/scroll-view\"\nexport { Switch } from \"../components/switch\"\nexport { TextInput } from \"../components/text-input\"\nexport const RawButton: any = unsupported(\"RawButton\")\nexport const RectButton: any = unsupported(\"RectButton\")\nexport const RefreshControl: any = unsupported(\"RefreshControl\")\nexport const Touchable: any = unsupported(\"Touchable\")\nexport const TouchableNativeFeedback: any = unsupported(\n \"TouchableNativeFeedback\",\n)\n\n// --- the 2.x legacy aliases, still exported by 3.x ---\n//\n// ALL TWELVE STAY REFUSED, for one reason that covers them: each is 3.x's\n// escape hatch back to the 2.x implementation of a component whose 3.x\n// spelling is either implemented here already (`LegacyScrollView`,\n// `LegacyFlatList`, `LegacyTextInput`, `LegacySwitch`, `LegacyPressable`,\n// `LegacyText`) or refused above with its own reason (`LegacyRawButton`,\n// `LegacyBaseButton`, `LegacyRectButton`, `LegacyBorderlessButton`,\n// `LegacyRefreshControl`). Where the modern name works, the legacy alias would\n// be a second name for the same component with a promise attached — \"this one\n// behaves like 2.x did\" — that this platform cannot keep, because it never\n// implemented 2.x's behaviour to differ from. Where the modern name is\n// refused, the alias inherits the refusal.\n//\n// `LegacyDrawerLayoutAndroid` is the odd one and is refused twice over: it is\n// Android's `DrawerLayoutAndroid`, which React Native itself does not ship off\n// Android, and `@react-navigation/drawer` reaches for\n// `react-native-drawer-layout` instead — which runs here (probe 3).\nexport const LegacyBaseButton: any = unsupported(\"LegacyBaseButton\")\nexport const LegacyBorderlessButton: any = unsupported(\"LegacyBorderlessButton\")\nexport const LegacyDrawerLayoutAndroid: any = unsupported(\n \"LegacyDrawerLayoutAndroid\",\n)\nexport const LegacyFlatList: any = unsupported(\"LegacyFlatList\")\nexport const LegacyPressable: any = unsupported(\"LegacyPressable\")\nexport const LegacyRawButton: any = unsupported(\"LegacyRawButton\")\nexport const LegacyRectButton: any = unsupported(\"LegacyRectButton\")\nexport const LegacyRefreshControl: any = unsupported(\"LegacyRefreshControl\")\nexport const LegacyScrollView: any = unsupported(\"LegacyScrollView\")\nexport const LegacySwitch: any = unsupported(\"LegacySwitch\")\nexport const LegacyText: any = unsupported(\"LegacyText\")\nexport const LegacyTextInput: any = unsupported(\"LegacyTextInput\")\n"]}
@@ -0,0 +1,6 @@
1
+ import type { RecognizerDecider } from "./recognizer";
2
+ /** Upstream's `DEFAULT_MIN_DURATION_MS`. */
3
+ export declare const DEFAULT_MIN_DURATION = 500;
4
+ /** Upstream's `DEFAULT_MAX_DIST_DP`. */
5
+ export declare const DEFAULT_MAX_DISTANCE = 10;
6
+ export declare const longPressDecider: RecognizerDecider;
@@ -0,0 +1,21 @@
1
+ /** Upstream's `DEFAULT_MIN_DURATION_MS`. */
2
+ export const DEFAULT_MIN_DURATION = 500;
3
+ /** Upstream's `DEFAULT_MAX_DIST_DP`. */
4
+ export const DEFAULT_MAX_DISTANCE = 10;
5
+ const travelledTooFar = (view, config) => view.distanceFromPress > (config.maxDistance ?? DEFAULT_MAX_DISTANCE);
6
+ export const longPressDecider = {
7
+ kind: "longPress",
8
+ timer: (config) => ({
9
+ delay: config.minDuration ?? DEFAULT_MIN_DURATION,
10
+ elapsed: "activate",
11
+ }),
12
+ shouldFail: travelledTooFar,
13
+ shouldActivate: (view, config) => view.timerElapsed &&
14
+ // Upstream arms its activation timer only while exactly this many pointers
15
+ // are down, so a two-finger long press is unreachable on a platform that
16
+ // fabricates one touch per pointer — honestly unreachable rather than
17
+ // silently single-finger.
18
+ view.pointerCount === (config.numberOfPointers ?? 1),
19
+ shouldCancelWhileActive: travelledTooFar,
20
+ };
21
+ //# sourceMappingURL=long-press.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-press.js","sourceRoot":"","sources":["../../src/gesture-handler-compat/long-press.ts"],"names":[],"mappings":"AA4BA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AACvC,wCAAwC;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAEtC,MAAM,eAAe,GAAG,CACtB,IAAoB,EACpB,MAAwB,EACf,EAAE,CACX,IAAI,CAAC,iBAAiB,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,oBAAoB,CAAC,CAAA;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,IAAI,EAAE,WAAW;IAEjB,KAAK,EAAE,CAAC,MAAwB,EAAmB,EAAE,CAAC,CAAC;QACrD,KAAK,EAAE,MAAM,CAAC,WAAW,IAAI,oBAAoB;QACjD,OAAO,EAAE,UAAU;KACpB,CAAC;IAEF,UAAU,EAAE,eAAe;IAE3B,cAAc,EAAE,CAAC,IAAoB,EAAE,MAAwB,EAAW,EAAE,CAC1E,IAAI,CAAC,YAAY;QACjB,2EAA2E;QAC3E,yEAAyE;QACzE,sEAAsE;QACtE,0BAA0B;QAC1B,IAAI,CAAC,YAAY,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAAI,CAAC,CAAC;IAEtD,uBAAuB,EAAE,eAAe;CACzC,CAAA","sourcesContent":["// LongPress's predicates, over the same machine `Pan` runs on.\n//\n// The shortest of the three, and the one that needed no new machinery at all:\n// `Pan().activateAfterLongPress()` already activates on a timer through the\n// out-of-event grant channel slice 1 added, and a long press is that, minus\n// the pan. What it does add is the only case where an ALREADY ACTIVE gesture\n// is cancelled by movement it would otherwise have reported — `maxDistance`\n// keeps applying after the press has matured, and going past it then is a\n// cancellation rather than a failure (upstream's `checkDistanceFail` branches\n// on exactly that).\n//\n// The distance is measured from the PRESS and not from the activation point,\n// which is why `RecognizerView` carries `distanceFromPress` at all. Upstream\n// sets `startX`/`startY` on pointer-down and never moves them (its base\n// `resetProgress()` is empty, unlike `Pan`'s), so a hold that drifts 8px\n// before the timer and 8px after it has travelled 16 and is cancelled at a\n// `maxDistance` of 10. Re-basing at activation would have let it drift twice.\n//\n// Restated from `src/web/handlers/LongPressGestureHandler.ts` at 3.1.0.\n// `DEFAULT_MAX_DIST_DP * SCALING_FACTOR` there is 10 × 10 — a squared\n// distance whose square root is the documented default of 10.\nimport type {\n RecognizerDecider,\n RecognizerTimer,\n RecognizerView,\n} from \"./recognizer\"\nimport type { RecognizerConfig } from \"./types\"\n\n/** Upstream's `DEFAULT_MIN_DURATION_MS`. */\nexport const DEFAULT_MIN_DURATION = 500\n/** Upstream's `DEFAULT_MAX_DIST_DP`. */\nexport const DEFAULT_MAX_DISTANCE = 10\n\nconst travelledTooFar = (\n view: RecognizerView,\n config: RecognizerConfig,\n): boolean =>\n view.distanceFromPress > (config.maxDistance ?? DEFAULT_MAX_DISTANCE)\n\nexport const longPressDecider: RecognizerDecider = {\n kind: \"longPress\",\n\n timer: (config: RecognizerConfig): RecognizerTimer => ({\n delay: config.minDuration ?? DEFAULT_MIN_DURATION,\n elapsed: \"activate\",\n }),\n\n shouldFail: travelledTooFar,\n\n shouldActivate: (view: RecognizerView, config: RecognizerConfig): boolean =>\n view.timerElapsed &&\n // Upstream arms its activation timer only while exactly this many pointers\n // are down, so a two-finger long press is unreachable on a platform that\n // fabricates one touch per pointer — honestly unreachable rather than\n // silently single-finger.\n view.pointerCount === (config.numberOfPointers ?? 1),\n\n shouldCancelWhileActive: travelledTooFar,\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { RecognizerDecider } from "./recognizer";
2
+ export declare const manualDecider: RecognizerDecider;
@@ -0,0 +1,18 @@
1
+ export const manualDecider = {
2
+ kind: "manual",
3
+ /**
4
+ * Never, from anything. Upstream's handler has no failure predicate at all —
5
+ * `onPointerUp` removes the pointer from its tracker and does not touch the
6
+ * state. `.fail()` is how a manual gesture fails.
7
+ */
8
+ shouldFail: () => false,
9
+ /**
10
+ * Never, from anything. This is the whole definition of the kind: no
11
+ * distance, no velocity, no timer and no release criterion. `.activate()` is
12
+ * the only way in.
13
+ */
14
+ shouldActivate: () => false,
15
+ /** See the header: a lift decides nothing, so the gesture stays BEGAN. */
16
+ onRelease: () => ({ kind: "hold" }),
17
+ };
18
+ //# sourceMappingURL=manual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manual.js","sourceRoot":"","sources":["../../src/gesture-handler-compat/manual.ts"],"names":[],"mappings":"AA4CA,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,IAAI,EAAE,QAAQ;IAEd;;;;OAIG;IACH,UAAU,EAAE,GAAY,EAAE,CAAC,KAAK;IAEhC;;;;OAIG;IACH,cAAc,EAAE,GAAY,EAAE,CAAC,KAAK;IAEpC,0EAA0E;IAC1E,SAAS,EAAE,GAAmB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;CACpD,CAAA","sourcesContent":["// `Gesture.Manual()` — the recognizer that recognizes nothing.\n//\n// It is the smallest kind in the module and the only one whose predicates are\n// both constant, because there is nothing for them to decide: the app drives\n// the state machine itself through the `GestureStateManager` handed to the\n// `onTouches*` callbacks. `.begin()`, `.activate()`, `.end()` and `.fail()`\n// ARE the recognizer.\n//\n// WHY IT IS WORTH HAVING, beyond completing the surface: it exercises the\n// arbitration registry from the OUTSIDE. Every other kind reaches\n// `tryActivate` from a predicate this module wrote, so a test of the registry\n// is also a test of the predicate that woke it. A `Manual` activated by an app\n// at a moment the app chose is the same registry with the recognizer's own\n// judgement removed — which is the only way to drive `requireExternalGestureToFail`,\n// the broadcast cancel and the responder handoff at instants no predicate\n// would have produced.\n//\n// AND IT GOES THROUGH THE SAME LOOP. `.activate()` does not set the state; it\n// asks, exactly as a `Pan` crossing its `activeOffset` asks. It can come back\n// parked behind another gesture, or cancelled, or granted — see\n// `stateManager` in ./recognizer. Upstream is the same shape: its web state\n// manager calls `handler.activate(true)`, and `activate` still routes through\n// `moveToState` into the orchestrator. The `true` is only about bypassing\n// `manualActivation`, not about bypassing arbitration.\n//\n// Restated from `src/web/handlers/ManualGestureHandler.ts` at 3.1.0, which is\n// forty lines of which only one is a state transition: `begin()` on pointer\n// down.\n//\n// ONE DELIBERATE DEVIATION, and this platform forces it. Upstream's Manual\n// does not end when the pointers lift — its documentation says so explicitly\n// (\"It will not fail when all the pointers are lifted from the screen\"). Half\n// of that is reproduced exactly: a Manual still BEGAN when the pointer comes\n// up stays BEGAN, holding nothing (`onRelease` below). The other half is not\n// reachable. A gesture that is ACTIVE here is holding an INTERACTION — the\n// responder lock, the GTK sequence, the suspended scrollers — and that\n// interaction ends when the button does. Staying ACTIVE past it would mean\n// holding a lock that no longer exists, receiving no further events of any\n// kind, and never reporting an ending at all. So an ACTIVE Manual ends with\n// the interaction, successfully. The app's own `onTouchesUp` fires FIRST and\n// gets the state manager, so an app that wants a different ending has the\n// event to write it in. docs/api.md records this.\nimport type { RecognizerDecider, ReleaseOutcome } from \"./recognizer\"\n\nexport const manualDecider: RecognizerDecider = {\n kind: \"manual\",\n\n /**\n * Never, from anything. Upstream's handler has no failure predicate at all —\n * `onPointerUp` removes the pointer from its tracker and does not touch the\n * state. `.fail()` is how a manual gesture fails.\n */\n shouldFail: (): boolean => false,\n\n /**\n * Never, from anything. This is the whole definition of the kind: no\n * distance, no velocity, no timer and no release criterion. `.activate()` is\n * the only way in.\n */\n shouldActivate: (): boolean => false,\n\n /** See the header: a lift decides nothing, so the gesture stays BEGAN. */\n onRelease: (): ReleaseOutcome => ({ kind: \"hold\" }),\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { RecognizerDecider } from "./recognizer";
2
+ /**
3
+ * Upstream's `DEFAULT_TOUCH_SLOP` (`src/web/constants.ts`), the travel at
4
+ * which a wrapped native view is taken to have started handling the gesture.
5
+ */
6
+ export declare const NATIVE_TOUCH_SLOP = 15;
7
+ export declare const nativeDecider: RecognizerDecider;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Upstream's `DEFAULT_TOUCH_SLOP` (`src/web/constants.ts`), the travel at
3
+ * which a wrapped native view is taken to have started handling the gesture.
4
+ */
5
+ export const NATIVE_TOUCH_SLOP = 15;
6
+ export const nativeDecider = {
7
+ // The one kind the arbitration loop asks about by name: an already ACTIVE or
8
+ // parked gesture is cancelled by nothing except an active native one, which
9
+ // is upstream's rule and the reason `Native` is special rather than just
10
+ // another recognizer. See ./orchestrator.
11
+ kind: "native",
12
+ // Reporting, not competing: it never takes the interaction, so it never
13
+ // suspends the scroller it is reporting on. See the file header.
14
+ claimsResponder: false,
15
+ /**
16
+ * Never on its own. Upstream's native handler has no failure predicate over
17
+ * movement at all — a native view that is being dragged is a native view
18
+ * doing its job. It still fails when the pointer lifts before it activated
19
+ * (the shared machine's default `onRelease`), when the pointer leaves and
20
+ * `shouldCancelWhenOutside` is on, and when the pointer count is refused.
21
+ */
22
+ shouldFail: () => false,
23
+ shouldActivate: (view, config) => {
24
+ if (config.shouldActivateOnStart === true) {
25
+ return true;
26
+ }
27
+ // From the PRESS rather than from the translation origin, matching
28
+ // upstream's `startX`/`startY` — a native view has no notion of being
29
+ // re-based, and nothing has activated yet for translation to be measured
30
+ // from anyway.
31
+ return view.distanceFromPress >= NATIVE_TOUCH_SLOP;
32
+ },
33
+ };
34
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/gesture-handler-compat/native.ts"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,6EAA6E;IAC7E,4EAA4E;IAC5E,yEAAyE;IACzE,0CAA0C;IAC1C,IAAI,EAAE,QAAQ;IAEd,wEAAwE;IACxE,iEAAiE;IACjE,eAAe,EAAE,KAAK;IAEtB;;;;;;OAMG;IACH,UAAU,EAAE,GAAY,EAAE,CAAC,KAAK;IAEhC,cAAc,EAAE,CAAC,IAAoB,EAAE,MAAwB,EAAW,EAAE;QAC1E,IAAI,MAAM,CAAC,qBAAqB,KAAK,IAAI,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAA;QACb,CAAC;QACD,mEAAmE;QACnE,sEAAsE;QACtE,yEAAyE;QACzE,eAAe;QACf,OAAO,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAA;IACpD,CAAC;CACF,CAAA","sourcesContent":["// `Gesture.Native()` — the recognizer that stands for the widget underneath\n// it rather than for anything React Native is doing.\n//\n// WHAT IT IS FOR. Upstream's `NativeViewGestureHandler` wraps a native\n// scrollable, a button or a switch and puts THAT into the arbitration, so a\n// JS gesture can be declared simultaneous with the platform's own scrolling\n// instead of racing it. `@gorhom/bottom-sheet` is the canonical use and the\n// reason this exists here: it builds\n// `Gesture.Native().simultaneousWithExternalGesture(sheetPan)` around its\n// scrollable so the list can scroll while the sheet's pan watches for a drag\n// on the handle.\n//\n// THE PREDICATES ARE UPSTREAM'S, restated from `src/web/handlers/\n// NativeViewGestureHandler.ts` at 3.1.0: BEGAN on press; ACTIVE once the\n// pointer has travelled `DEFAULT_TOUCH_SLOP` (15 px) from it, because that is\n// the point at which a native scrollable would have started scrolling;\n// immediately ACTIVE instead when `shouldActivateOnStart` is set, which is how\n// a button-shaped native view takes the press at once; `shouldCancelWhenOutside`\n// on by default, as upstream's `init` sets it; and a lift before activation is\n// a failure rather than an end.\n//\n// THE ONE THING THAT IS NOT UPSTREAM'S, and it is the whole point of putting\n// this in the slice that also fixed `->DENIED`: **this recognizer never takes\n// the responder** (`claimsResponder: false`). On this platform taking it is\n// what makes `responder/use-responder.ts` declare `CLAIMED` on the GTK\n// sequence and call `setKineticScrolling(false)` on every enclosing\n// `GtkScrolledWindow` — RN's `setIsJSResponder`, which exists to stop a native\n// scroller stealing a JS drag. A gesture whose entire meaning is \"the native\n// scroller is handling this\" cannot be the thing that switches the native\n// scroller off. So it reports, and yields.\n//\n// The consequence is that it runs off the touch props, which fire regardless\n// of responder status — and therefore that its ending is `onTouchEnd` or\n// `onTouchCancel`. Which is exactly why the `->DENIED` correction had to land\n// with it: before that fix a native ancestor claiming the sequence mid-drag\n// reached JS as `onTouchEnd`, and this gesture would have reported a clean,\n// successful end to a drag that had been taken away from it.\nimport type { RecognizerDecider, RecognizerView } from \"./recognizer\"\nimport type { RecognizerConfig } from \"./types\"\n\n/**\n * Upstream's `DEFAULT_TOUCH_SLOP` (`src/web/constants.ts`), the travel at\n * which a wrapped native view is taken to have started handling the gesture.\n */\nexport const NATIVE_TOUCH_SLOP = 15\n\nexport const nativeDecider: RecognizerDecider = {\n // The one kind the arbitration loop asks about by name: an already ACTIVE or\n // parked gesture is cancelled by nothing except an active native one, which\n // is upstream's rule and the reason `Native` is special rather than just\n // another recognizer. See ./orchestrator.\n kind: \"native\",\n\n // Reporting, not competing: it never takes the interaction, so it never\n // suspends the scroller it is reporting on. See the file header.\n claimsResponder: false,\n\n /**\n * Never on its own. Upstream's native handler has no failure predicate over\n * movement at all — a native view that is being dragged is a native view\n * doing its job. It still fails when the pointer lifts before it activated\n * (the shared machine's default `onRelease`), when the pointer leaves and\n * `shouldCancelWhenOutside` is on, and when the pointer count is refused.\n */\n shouldFail: (): boolean => false,\n\n shouldActivate: (view: RecognizerView, config: RecognizerConfig): boolean => {\n if (config.shouldActivateOnStart === true) {\n return true\n }\n // From the PRESS rather than from the translation origin, matching\n // upstream's `startX`/`startY` — a native view has no notion of being\n // re-based, and nothing has activated yet for translation to be measured\n // from anyway.\n return view.distanceFromPress >= NATIVE_TOUCH_SLOP\n },\n}\n"]}
@@ -0,0 +1,77 @@
1
+ import { type RelationRegistry } from "./relations";
2
+ import { type GestureStateValue } from "./types";
3
+ /** One mounted recognizer, as the loop sees it. */
4
+ export type Participant = {
5
+ readonly tag: number;
6
+ /**
7
+ * The recognizer kind.
8
+ *
9
+ * The loop reads exactly one thing off it — whether this is
10
+ * `Gesture.Native()` — because that is the single rule the relation
11
+ * registry contributes to cancellation, and it is why `Native` is special
12
+ * rather than just another recognizer: an ALREADY ACTIVE or parked gesture
13
+ * is cancelled by nothing except an active native one, and a gesture that
14
+ * wants to activate beside one is refused by it. `@gorhom/bottom-sheet`'s
15
+ * scrollable is the shape that needs both halves.
16
+ */
17
+ readonly kind: string;
18
+ /**
19
+ * Cleared to become ACTIVE.
20
+ *
21
+ * `needsResponder` is false when another participant already holds the
22
+ * interaction, and it is where the two locks meet: a gesture told `false`
23
+ * activates in JS without touching the responder lock, which is the only
24
+ * way `Simultaneous` can be expressed on a single-holder lock.
25
+ */
26
+ authorize: (needsResponder: boolean) => void;
27
+ /**
28
+ * Whether this gesture is holding the responder right now.
29
+ *
30
+ * Asked rather than assumed, because "is anything else active" is the wrong
31
+ * question and `Gesture.Native()` is what makes the difference visible: it
32
+ * is ACTIVE and it deliberately holds nothing, so a pan activating beside it
33
+ * still has an interaction to take. Nor is it a static per-kind fact — a
34
+ * `Pan` that lost the lock to a simultaneous partner is a claiming kind that
35
+ * does not hold it either.
36
+ */
37
+ holdsResponder: () => boolean;
38
+ /** Lost the arbitration: end now, unsuccessfully. */
39
+ cancel: () => void;
40
+ };
41
+ export type Orchestrator = {
42
+ readonly relations: RelationRegistry;
43
+ /** This gesture reached BEGAN and is part of the interaction under way. */
44
+ record: (participant: Participant) => void;
45
+ /** This gesture unmounted. Drops its relations with it. */
46
+ forget: (participant: Participant) => void;
47
+ /** This gesture's own criteria are met; may it activate? */
48
+ tryActivate: (participant: Participant) => void;
49
+ /** It really is ACTIVE now — the moment mutual exclusion is enforced. */
50
+ activated: (participant: Participant) => void;
51
+ finished: (participant: Participant, outcome: GestureStateValue) => void;
52
+ /**
53
+ * The participant holding the responder lost it to something outside this
54
+ * registry — an ancestor took the interaction, or the window went away.
55
+ */
56
+ interactionLost: (participant: Participant) => void;
57
+ /** Whether the loop is holding this one in BEGAN, waiting on another. */
58
+ isAwaiting: (participant: Participant) => boolean;
59
+ /** Every tag ACTIVE right now. `Simultaneous` is a claim about this list. */
60
+ activeTags: () => number[];
61
+ reset: () => void;
62
+ };
63
+ export declare const createOrchestrator: (relations?: RelationRegistry) => Orchestrator;
64
+ /**
65
+ * The process-wide loop, which is the right scope for it and needs saying
66
+ * because the responder lock's scope is the question slice 3 had to answer.
67
+ *
68
+ * This registry has NO tree knowledge at all: it is keyed by handler tag and
69
+ * a gesture enters it only when the interaction's pointer reaches it. That is
70
+ * what makes the islands answer simple — see docs/api.md, "Relations across
71
+ * `Root`s". A relation naming a gesture in another `Root` is expressible and
72
+ * simply never has an occasion to apply, because a gesture in another `Root`
73
+ * is never recorded during this interaction. In particular it does not
74
+ * deadlock: parking only ever happens against a gesture that is live in the
75
+ * interaction under way.
76
+ */
77
+ export declare const gestureOrchestrator: Orchestrator;