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,268 @@
1
+ // Spelling two: `usePanGesture` / `useTapGesture` / `useLongPressGesture`,
2
+ // the hooks.
3
+ //
4
+ // The replacement upstream is migrating to — a 6,763-line tree of hooks that
5
+ // deprecated all twelve builder statics in 3.1.0. Nothing here reimplements
6
+ // the recognizer; it normalises a config object onto the same
7
+ // `RecognizerConfig` the builder writes and returns the same `GestureSpec`.
8
+ // That the file is this short is the evidence that the internal shape was
9
+ // picked correctly: upstream had to rewrite its internals for this migration
10
+ // because its builder WAS its internals.
11
+ //
12
+ // Four real differences from the builder spelling, all upstream's:
13
+ // - `onStart` is `onActivate`, `onEnd` is `onDeactivate`;
14
+ // - `onTouchesCancelled` is `onTouchesCancel`, and the touch callbacks take
15
+ // the event alone, with no state manager;
16
+ // - the ending callbacks take one argument, and read `canceled` off the
17
+ // event rather than a second `success` parameter;
18
+ // - there is no `onChange` at all — `changeX`/`changeY` are always on the
19
+ // update payload instead.
20
+ import { exclusiveGestures, raceGestures, simultaneousGestures, } from "./composition";
21
+ const asList = (value) => {
22
+ if (value === undefined) {
23
+ return undefined;
24
+ }
25
+ return Array.isArray(value) ? value : [value];
26
+ };
27
+ /**
28
+ * Upstream's dev-time validation, reproduced because both messages describe
29
+ * configs that look reasonable and silently never activate.
30
+ */
31
+ const validate = (config) => {
32
+ for (const [name, bound] of [
33
+ ["activeOffsetX", config.activeOffsetX],
34
+ ["activeOffsetY", config.activeOffsetY],
35
+ ["failOffsetX", config.failOffsetX],
36
+ ["failOffsetY", config.failOffsetY],
37
+ ]) {
38
+ if (Array.isArray(bound) && (bound[0] > 0 || bound[1] < 0)) {
39
+ throw new Error(`react-native-gtkx: first element of ${name} should be negative, ` +
40
+ "and the second one should be positive.");
41
+ }
42
+ }
43
+ if (config.minDistance === undefined) {
44
+ return;
45
+ }
46
+ if (config.failOffsetX !== undefined || config.failOffsetY !== undefined) {
47
+ throw new Error("react-native-gtkx: it is not supported to use minDistance with " +
48
+ "failOffsetX or failOffsetY; use activeOffsetX and activeOffsetY instead.");
49
+ }
50
+ if (config.activeOffsetX !== undefined ||
51
+ config.activeOffsetY !== undefined) {
52
+ throw new Error("react-native-gtkx: it is not supported to use minDistance with " +
53
+ "activeOffsetX or activeOffsetY.");
54
+ }
55
+ };
56
+ /**
57
+ * Everything the three hooks normalise identically: the common knobs, the
58
+ * ending callbacks' `canceled` shape, and the touch callbacks' missing state
59
+ * manager. The per-kind hooks below add their own fields and nothing else.
60
+ */
61
+ const adaptCommon = (config) => {
62
+ const normalised = {
63
+ enabled: config.enabled,
64
+ hitSlop: config.hitSlop,
65
+ shouldCancelWhenOutside: config.shouldCancelWhenOutside,
66
+ manualActivation: config.manualActivation,
67
+ runOnJS: config.runOnJS,
68
+ testId: config.testID,
69
+ onBegin: config.onBegin,
70
+ onActivate: config.onActivate,
71
+ // The relations land in the map names, from either spelling. That both
72
+ // spellings normalise onto one set of lists rather than each carrying its
73
+ // own is the same claim slice 1 made about the callbacks, tested the same
74
+ // way: one orchestrator test drives both.
75
+ simultaneousHandlers: asList(config.simultaneousWith),
76
+ waitFor: asList(config.requireToFail),
77
+ blocksHandlers: asList(config.block),
78
+ };
79
+ // The ending callbacks are the one place the two spellings disagree about
80
+ // shape rather than about names: this one reads `canceled` off the event.
81
+ const { onDeactivate, onFinalize } = config;
82
+ if (onDeactivate) {
83
+ normalised.onDeactivate = (event, success) => {
84
+ onDeactivate({ ...event, canceled: !success });
85
+ };
86
+ }
87
+ if (onFinalize) {
88
+ normalised.onFinalize = (event, success) => {
89
+ onFinalize({ ...event, canceled: !success });
90
+ };
91
+ }
92
+ // And the touch callbacks take no state manager in this spelling.
93
+ const { onTouchesDown, onTouchesMove, onTouchesUp, onTouchesCancel } = config;
94
+ if (onTouchesDown) {
95
+ normalised.onTouchesDown = (event) => {
96
+ onTouchesDown(event);
97
+ };
98
+ }
99
+ if (onTouchesMove) {
100
+ normalised.onTouchesMove = (event) => {
101
+ onTouchesMove(event);
102
+ };
103
+ }
104
+ if (onTouchesUp) {
105
+ normalised.onTouchesUp = (event) => {
106
+ onTouchesUp(event);
107
+ };
108
+ }
109
+ if (onTouchesCancel) {
110
+ normalised.onTouchesCancel = (event) => {
111
+ onTouchesCancel(event);
112
+ };
113
+ }
114
+ return normalised;
115
+ };
116
+ const EMPTY_PAN = {};
117
+ const EMPTY_TAP = {};
118
+ const EMPTY_LONG_PRESS = {};
119
+ const EMPTY_NATIVE = {};
120
+ /**
121
+ * The hook spelling. Rebuilds its spec every render, exactly as the builder
122
+ * chained in a component body does, because the callbacks it closes over are
123
+ * rebuilt every render too — `GestureDetector` reads the config through a ref
124
+ * rather than resubscribing, which is what makes that free.
125
+ */
126
+ export const usePanGesture = (config = EMPTY_PAN) => {
127
+ validate(config);
128
+ return {
129
+ kind: "pan",
130
+ config: {
131
+ ...adaptCommon(config),
132
+ activeOffsetX: config.activeOffsetX,
133
+ activeOffsetY: config.activeOffsetY,
134
+ failOffsetX: config.failOffsetX,
135
+ failOffsetY: config.failOffsetY,
136
+ minDistance: config.minDistance,
137
+ minVelocity: config.minVelocity,
138
+ minVelocityX: config.minVelocityX,
139
+ minVelocityY: config.minVelocityY,
140
+ minPointers: config.minPointers,
141
+ maxPointers: config.maxPointers,
142
+ activateAfterLongPress: config.activateAfterLongPress,
143
+ onUpdate: config.onUpdate,
144
+ },
145
+ };
146
+ };
147
+ /**
148
+ * `useTapGesture`, the hook spelling of `Gesture.Tap()`.
149
+ *
150
+ * `shouldCancelWhenOutside` defaults to true here, matching the builder.
151
+ * Upstream's own hook does NOT do this even though its builder's constructor
152
+ * does and its native handler config does — `useLongPressGesture` remembers it
153
+ * (`transformLongPressProps`) and `useTapGesture` forgets. Two spellings of
154
+ * one gesture disagreeing about whether a press may wander off the view is a
155
+ * slip rather than a semantic, and reproducing it would make this module's own
156
+ * "two spellings, one implementation" claim false.
157
+ */
158
+ export const useTapGesture = (config = EMPTY_TAP) => ({
159
+ kind: "tap",
160
+ config: {
161
+ ...adaptCommon(config),
162
+ shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? true,
163
+ numberOfTaps: config.numberOfTaps,
164
+ maxDuration: config.maxDuration,
165
+ maxDelay: config.maxDelay,
166
+ maxDistance: config.maxDistance,
167
+ maxDeltaX: config.maxDeltaX,
168
+ maxDeltaY: config.maxDeltaY,
169
+ minPointers: config.minPointers,
170
+ },
171
+ });
172
+ /** `useLongPressGesture`, the hook spelling of `Gesture.LongPress()`. */
173
+ export const useLongPressGesture = (config = EMPTY_LONG_PRESS) => ({
174
+ kind: "longPress",
175
+ config: {
176
+ ...adaptCommon(config),
177
+ shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? true,
178
+ minDuration: config.minDuration,
179
+ maxDistance: config.maxDistance,
180
+ numberOfPointers: config.numberOfPointers,
181
+ },
182
+ });
183
+ /** `useNativeGesture`, the hook spelling of `Gesture.Native()`. */
184
+ export const useNativeGesture = (config = EMPTY_NATIVE) => ({
185
+ kind: "native",
186
+ config: {
187
+ ...adaptCommon(config),
188
+ shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? true,
189
+ shouldActivateOnStart: config.shouldActivateOnStart,
190
+ disallowInterruption: config.disallowInterruption,
191
+ yieldsToContinuousGestures: config.yieldsToContinuousGestures,
192
+ onUpdate: config.onUpdate,
193
+ },
194
+ });
195
+ const EMPTY_TOUCHPAD = {};
196
+ /**
197
+ * `usePinchGesture`, the hook spelling of `Gesture.Pinch()` — and the spelling
198
+ * upstream's own `@deprecated` tag on `Gesture.Pinch()` points at.
199
+ *
200
+ * `shouldCancelWhenOutside` defaults to FALSE, matching the builder and
201
+ * matching `PinchGestureHandler.init`: a pinch is not addressed to a point the
202
+ * way a tap is, and a focal point that drifts off the view mid-gesture is not
203
+ * a reason to cancel it.
204
+ */
205
+ export const usePinchGesture = (config = EMPTY_TOUCHPAD) => ({
206
+ kind: "pinch",
207
+ config: {
208
+ ...adaptCommon(config),
209
+ shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? false,
210
+ onUpdate: config.onUpdate,
211
+ },
212
+ });
213
+ /** `useRotationGesture`, the hook spelling of `Gesture.Rotation()`. */
214
+ export const useRotationGesture = (config = EMPTY_TOUCHPAD) => ({
215
+ kind: "rotation",
216
+ config: {
217
+ ...adaptCommon(config),
218
+ shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? false,
219
+ onUpdate: config.onUpdate,
220
+ },
221
+ });
222
+ const EMPTY_FLING = {};
223
+ const EMPTY_MANUAL = {};
224
+ const EMPTY_HOVER = {};
225
+ /** `useFlingGesture`, the hook spelling of `Gesture.Fling()`. */
226
+ export const useFlingGesture = (config = EMPTY_FLING) => ({
227
+ kind: "fling",
228
+ config: {
229
+ ...adaptCommon(config),
230
+ direction: config.direction,
231
+ numberOfPointers: config.numberOfPointers,
232
+ },
233
+ });
234
+ /** `useManualGesture`, the hook spelling of `Gesture.Manual()`. */
235
+ export const useManualGesture = (config = EMPTY_MANUAL) => ({
236
+ kind: "manual",
237
+ config: {
238
+ ...adaptCommon(config),
239
+ onUpdate: config.onUpdate,
240
+ },
241
+ });
242
+ /** `useHoverGesture`, the hook spelling of `Gesture.Hover()`. */
243
+ export const useHoverGesture = (config = EMPTY_HOVER) => ({
244
+ kind: "hover",
245
+ config: {
246
+ ...adaptCommon(config),
247
+ hoverEffect: config.effect,
248
+ onUpdate: config.onUpdate,
249
+ },
250
+ });
251
+ // There is deliberately NO `useForceTouchGesture`, and that is upstream's own
252
+ // boundary rather than this platform's: `src/v3/hooks/gestures/` has nine
253
+ // directories and no `forceTouch`, `SingleGesture` omits it from its union,
254
+ // and no such hook is exported anywhere in 3.1.0. Inventing one would be the
255
+ // only place in this module where the hook spelling is richer than the
256
+ // spelling it was migrated from. `Gesture.ForceTouch()` is the whole API
257
+ // upstream offers, so it is the whole API offered here.
258
+ // --- the composers, in the hook spelling ---
259
+ //
260
+ // Not hooks in any real sense — upstream's are not either, past a `useMemo`
261
+ // it does not need — and exported under these names because that is what
262
+ // upstream's `src/v3` calls them and what an app migrating off the deprecated
263
+ // statics will write. `useCompetingGestures` is `Gesture.Race()` under the
264
+ // better name: the gestures compete, and they would have anyway.
265
+ export const useCompetingGestures = (...gestures) => raceGestures(...gestures);
266
+ export const useSimultaneousGestures = (...gestures) => simultaneousGestures(...gestures);
267
+ export const useExclusiveGestures = (...gestures) => exclusiveGestures(...gestures);
268
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../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AA2E;AAC3E,iEAAiE;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAAG,QAA0B,EACR,EAAE,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAA;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,GAAG,QAA0B,EACR,EAAE,CAAC,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAAG,QAA0B,EACR,EAAE,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAA","sourcesContent":["// Spelling two: `usePanGesture` / `useTapGesture` / `useLongPressGesture`,\n// the hooks.\n//\n// The replacement upstream is migrating to — a 6,763-line tree of hooks that\n// deprecated all twelve builder statics in 3.1.0. Nothing here reimplements\n// the recognizer; it normalises a config object onto the same\n// `RecognizerConfig` the builder writes and returns the same `GestureSpec`.\n// That the file is this short is the evidence that the internal shape was\n// picked correctly: upstream had to rewrite its internals for this migration\n// because its builder WAS its internals.\n//\n// Four real differences from the builder spelling, all upstream's:\n// - `onStart` is `onActivate`, `onEnd` is `onDeactivate`;\n// - `onTouchesCancelled` is `onTouchesCancel`, and the touch callbacks take\n// the event alone, with no state manager;\n// - the ending callbacks take one argument, and read `canceled` off the\n// event rather than a second `success` parameter;\n// - there is no `onChange` at all — `changeX`/`changeY` are always on the\n// update payload instead.\nimport {\n exclusiveGestures,\n raceGestures,\n simultaneousGestures,\n} from \"./composition\"\nimport type {\n AnyGestureSpec,\n ComposedGestureSpec,\n GestureEndEventPayload,\n GestureEventPayload,\n GestureHitSlop,\n GestureRef,\n GestureSpec,\n GestureTouchEvent,\n OffsetBound,\n RecognizerConfig,\n} from \"./types\"\n\n/**\n * The relations, in the hook spelling's names.\n *\n * The same three lists the builder's three methods write, renamed and moved\n * into the config object — `simultaneousWithExternalGesture` is\n * `simultaneousWith`, `requireExternalGestureToFail` is `requireToFail`, and\n * `blocksExternalGesture` is `block`. One gesture or several, because\n * upstream accepts both and an app writing one should not have to wrap it.\n */\ntype RelationHookConfig = {\n simultaneousWith?: GestureRef | GestureRef[]\n requireToFail?: GestureRef | GestureRef[]\n block?: GestureRef | GestureRef[]\n}\n\n/** What every hook spelling accepts, which is upstream's `CommonGestureConfig`. */\ntype CommonGestureHookConfig = RelationHookConfig & {\n enabled?: boolean\n hitSlop?: GestureHitSlop\n shouldCancelWhenOutside?: boolean\n manualActivation?: boolean\n runOnJS?: boolean\n testID?: string\n onBegin?: (event: GestureEventPayload) => void\n onActivate?: (event: GestureEventPayload) => void\n onDeactivate?: (event: GestureEndEventPayload) => void\n onFinalize?: (event: GestureEndEventPayload) => void\n onTouchesDown?: (event: GestureTouchEvent) => void\n onTouchesMove?: (event: GestureTouchEvent) => void\n onTouchesUp?: (event: GestureTouchEvent) => void\n onTouchesCancel?: (event: GestureTouchEvent) => void\n}\n\nconst asList = (\n value: GestureRef | GestureRef[] | undefined,\n): GestureRef[] | undefined => {\n if (value === undefined) {\n return undefined\n }\n return Array.isArray(value) ? value : [value]\n}\n\n/** The config object `usePanGesture` accepts. */\nexport type PanGestureHookConfig = CommonGestureHookConfig & {\n activeOffsetX?: OffsetBound\n activeOffsetY?: OffsetBound\n failOffsetX?: OffsetBound\n failOffsetY?: OffsetBound\n minDistance?: number\n minVelocity?: number\n minVelocityX?: number\n minVelocityY?: number\n minPointers?: number\n maxPointers?: number\n activateAfterLongPress?: number\n /**\n * Only a CONTINUOUS gesture has one. Upstream's discrete hooks omit\n * `onUpdate` from their config type by name (`BaseDiscreteGestureConfig` is\n * `Omit<…, \"onUpdate\">`), which is the same statement in the other\n * direction.\n */\n onUpdate?: (event: GestureEventPayload) => void\n}\n\n/** The config object `useTapGesture` accepts, in upstream's external names. */\nexport type TapGestureHookConfig = CommonGestureHookConfig & {\n numberOfTaps?: number\n maxDuration?: number\n maxDelay?: number\n maxDistance?: number\n maxDeltaX?: number\n maxDeltaY?: number\n minPointers?: number\n}\n\n/** The config object `useLongPressGesture` accepts. */\nexport type LongPressGestureHookConfig = CommonGestureHookConfig & {\n minDuration?: number\n maxDistance?: number\n numberOfPointers?: number\n}\n\n/** The config object `useNativeGesture` accepts. */\nexport type NativeGestureHookConfig = CommonGestureHookConfig & {\n shouldActivateOnStart?: boolean\n disallowInterruption?: boolean\n yieldsToContinuousGestures?: boolean\n /** A native view is continuous upstream, so it reports travel. */\n onUpdate?: (event: GestureEventPayload) => void\n}\n\n/**\n * The config object `usePinchGesture` and `useRotationGesture` accept.\n *\n * Nothing of their own, and that is upstream's shape rather than an omission:\n * `PinchGestureNativeProperties` and `RotationGestureNativeProperties` are\n * both `Record<string, never>` in 3.1.0's `src/v3`, and the builder classes\n * add no methods either. Both are continuous, so `onUpdate` is here.\n */\nexport type TouchpadGestureHookConfig = CommonGestureHookConfig & {\n onUpdate?: (event: GestureEventPayload) => void\n}\n\n/**\n * Upstream's dev-time validation, reproduced because both messages describe\n * configs that look reasonable and silently never activate.\n */\nconst validate = (config: PanGestureHookConfig): void => {\n for (const [name, bound] of [\n [\"activeOffsetX\", config.activeOffsetX],\n [\"activeOffsetY\", config.activeOffsetY],\n [\"failOffsetX\", config.failOffsetX],\n [\"failOffsetY\", config.failOffsetY],\n ] as const) {\n if (Array.isArray(bound) && (bound[0] > 0 || bound[1] < 0)) {\n throw new Error(\n `react-native-gtkx: first element of ${name} should be negative, ` +\n \"and the second one should be positive.\",\n )\n }\n }\n if (config.minDistance === undefined) {\n return\n }\n if (config.failOffsetX !== undefined || config.failOffsetY !== undefined) {\n throw new Error(\n \"react-native-gtkx: it is not supported to use minDistance with \" +\n \"failOffsetX or failOffsetY; use activeOffsetX and activeOffsetY instead.\",\n )\n }\n if (\n config.activeOffsetX !== undefined ||\n config.activeOffsetY !== undefined\n ) {\n throw new Error(\n \"react-native-gtkx: it is not supported to use minDistance with \" +\n \"activeOffsetX or activeOffsetY.\",\n )\n }\n}\n\n/**\n * Everything the three hooks normalise identically: the common knobs, the\n * ending callbacks' `canceled` shape, and the touch callbacks' missing state\n * manager. The per-kind hooks below add their own fields and nothing else.\n */\nconst adaptCommon = (config: CommonGestureHookConfig): RecognizerConfig => {\n const normalised: RecognizerConfig = {\n enabled: config.enabled,\n hitSlop: config.hitSlop,\n shouldCancelWhenOutside: config.shouldCancelWhenOutside,\n manualActivation: config.manualActivation,\n runOnJS: config.runOnJS,\n testId: config.testID,\n onBegin: config.onBegin,\n onActivate: config.onActivate,\n // The relations land in the map names, from either spelling. That both\n // spellings normalise onto one set of lists rather than each carrying its\n // own is the same claim slice 1 made about the callbacks, tested the same\n // way: one orchestrator test drives both.\n simultaneousHandlers: asList(config.simultaneousWith),\n waitFor: asList(config.requireToFail),\n blocksHandlers: asList(config.block),\n }\n\n // The ending callbacks are the one place the two spellings disagree about\n // shape rather than about names: this one reads `canceled` off the event.\n const { onDeactivate, onFinalize } = config\n if (onDeactivate) {\n normalised.onDeactivate = (event, success) => {\n onDeactivate({ ...event, canceled: !success })\n }\n }\n if (onFinalize) {\n normalised.onFinalize = (event, success) => {\n onFinalize({ ...event, canceled: !success })\n }\n }\n\n // And the touch callbacks take no state manager in this spelling.\n const { onTouchesDown, onTouchesMove, onTouchesUp, onTouchesCancel } = config\n if (onTouchesDown) {\n normalised.onTouchesDown = (event) => {\n onTouchesDown(event)\n }\n }\n if (onTouchesMove) {\n normalised.onTouchesMove = (event) => {\n onTouchesMove(event)\n }\n }\n if (onTouchesUp) {\n normalised.onTouchesUp = (event) => {\n onTouchesUp(event)\n }\n }\n if (onTouchesCancel) {\n normalised.onTouchesCancel = (event) => {\n onTouchesCancel(event)\n }\n }\n\n return normalised\n}\n\nconst EMPTY_PAN: PanGestureHookConfig = {}\nconst EMPTY_TAP: TapGestureHookConfig = {}\nconst EMPTY_LONG_PRESS: LongPressGestureHookConfig = {}\nconst EMPTY_NATIVE: NativeGestureHookConfig = {}\n\n/**\n * The hook spelling. Rebuilds its spec every render, exactly as the builder\n * chained in a component body does, because the callbacks it closes over are\n * rebuilt every render too — `GestureDetector` reads the config through a ref\n * rather than resubscribing, which is what makes that free.\n */\nexport const usePanGesture = (\n config: PanGestureHookConfig = EMPTY_PAN,\n): GestureSpec => {\n validate(config)\n\n return {\n kind: \"pan\",\n config: {\n ...adaptCommon(config),\n activeOffsetX: config.activeOffsetX,\n activeOffsetY: config.activeOffsetY,\n failOffsetX: config.failOffsetX,\n failOffsetY: config.failOffsetY,\n minDistance: config.minDistance,\n minVelocity: config.minVelocity,\n minVelocityX: config.minVelocityX,\n minVelocityY: config.minVelocityY,\n minPointers: config.minPointers,\n maxPointers: config.maxPointers,\n activateAfterLongPress: config.activateAfterLongPress,\n onUpdate: config.onUpdate,\n },\n }\n}\n\n/**\n * `useTapGesture`, the hook spelling of `Gesture.Tap()`.\n *\n * `shouldCancelWhenOutside` defaults to true here, matching the builder.\n * Upstream's own hook does NOT do this even though its builder's constructor\n * does and its native handler config does — `useLongPressGesture` remembers it\n * (`transformLongPressProps`) and `useTapGesture` forgets. Two spellings of\n * one gesture disagreeing about whether a press may wander off the view is a\n * slip rather than a semantic, and reproducing it would make this module's own\n * \"two spellings, one implementation\" claim false.\n */\nexport const useTapGesture = (\n config: TapGestureHookConfig = EMPTY_TAP,\n): GestureSpec => ({\n kind: \"tap\",\n config: {\n ...adaptCommon(config),\n shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? true,\n numberOfTaps: config.numberOfTaps,\n maxDuration: config.maxDuration,\n maxDelay: config.maxDelay,\n maxDistance: config.maxDistance,\n maxDeltaX: config.maxDeltaX,\n maxDeltaY: config.maxDeltaY,\n minPointers: config.minPointers,\n },\n})\n\n/** `useLongPressGesture`, the hook spelling of `Gesture.LongPress()`. */\nexport const useLongPressGesture = (\n config: LongPressGestureHookConfig = EMPTY_LONG_PRESS,\n): GestureSpec => ({\n kind: \"longPress\",\n config: {\n ...adaptCommon(config),\n shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? true,\n minDuration: config.minDuration,\n maxDistance: config.maxDistance,\n numberOfPointers: config.numberOfPointers,\n },\n})\n\n/** `useNativeGesture`, the hook spelling of `Gesture.Native()`. */\nexport const useNativeGesture = (\n config: NativeGestureHookConfig = EMPTY_NATIVE,\n): GestureSpec => ({\n kind: \"native\",\n config: {\n ...adaptCommon(config),\n shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? true,\n shouldActivateOnStart: config.shouldActivateOnStart,\n disallowInterruption: config.disallowInterruption,\n yieldsToContinuousGestures: config.yieldsToContinuousGestures,\n onUpdate: config.onUpdate,\n },\n})\n\nconst EMPTY_TOUCHPAD: TouchpadGestureHookConfig = {}\n\n/**\n * `usePinchGesture`, the hook spelling of `Gesture.Pinch()` — and the spelling\n * upstream's own `@deprecated` tag on `Gesture.Pinch()` points at.\n *\n * `shouldCancelWhenOutside` defaults to FALSE, matching the builder and\n * matching `PinchGestureHandler.init`: a pinch is not addressed to a point the\n * way a tap is, and a focal point that drifts off the view mid-gesture is not\n * a reason to cancel it.\n */\nexport const usePinchGesture = (\n config: TouchpadGestureHookConfig = EMPTY_TOUCHPAD,\n): GestureSpec => ({\n kind: \"pinch\",\n config: {\n ...adaptCommon(config),\n shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? false,\n onUpdate: config.onUpdate,\n },\n})\n\n/** `useRotationGesture`, the hook spelling of `Gesture.Rotation()`. */\nexport const useRotationGesture = (\n config: TouchpadGestureHookConfig = EMPTY_TOUCHPAD,\n): GestureSpec => ({\n kind: \"rotation\",\n config: {\n ...adaptCommon(config),\n shouldCancelWhenOutside: config.shouldCancelWhenOutside ?? false,\n onUpdate: config.onUpdate,\n },\n})\n\n/**\n * The config object `useFlingGesture` accepts.\n *\n * No `onUpdate`, matching upstream: `FlingGestureInternalConfig` is a\n * `BaseDiscreteGestureConfig`, which omits it by name. A fling activates and\n * ends in one breath and has nothing to update with.\n */\nexport type FlingGestureHookConfig = CommonGestureHookConfig & {\n direction?: number\n numberOfPointers?: number\n}\n\n/** The config object `useManualGesture` accepts, which is only the common one. */\nexport type ManualGestureHookConfig = CommonGestureHookConfig & {\n onUpdate?: (event: GestureEventPayload) => void\n}\n\n/** The config object `useHoverGesture` accepts. */\nexport type HoverGestureHookConfig = CommonGestureHookConfig & {\n /**\n * iOS's own pointer effect. Upstream's hook maps `effect` onto the native\n * `hoverEffect` prop; both names arrive at the same inert field here.\n */\n effect?: number\n onUpdate?: (event: GestureEventPayload) => void\n}\n\nconst EMPTY_FLING: FlingGestureHookConfig = {}\nconst EMPTY_MANUAL: ManualGestureHookConfig = {}\nconst EMPTY_HOVER: HoverGestureHookConfig = {}\n\n/** `useFlingGesture`, the hook spelling of `Gesture.Fling()`. */\nexport const useFlingGesture = (\n config: FlingGestureHookConfig = EMPTY_FLING,\n): GestureSpec => ({\n kind: \"fling\",\n config: {\n ...adaptCommon(config),\n direction: config.direction,\n numberOfPointers: config.numberOfPointers,\n },\n})\n\n/** `useManualGesture`, the hook spelling of `Gesture.Manual()`. */\nexport const useManualGesture = (\n config: ManualGestureHookConfig = EMPTY_MANUAL,\n): GestureSpec => ({\n kind: \"manual\",\n config: {\n ...adaptCommon(config),\n onUpdate: config.onUpdate,\n },\n})\n\n/** `useHoverGesture`, the hook spelling of `Gesture.Hover()`. */\nexport const useHoverGesture = (\n config: HoverGestureHookConfig = EMPTY_HOVER,\n): GestureSpec => ({\n kind: \"hover\",\n config: {\n ...adaptCommon(config),\n hoverEffect: config.effect,\n onUpdate: config.onUpdate,\n },\n})\n\n// There is deliberately NO `useForceTouchGesture`, and that is upstream's own\n// boundary rather than this platform's: `src/v3/hooks/gestures/` has nine\n// directories and no `forceTouch`, `SingleGesture` omits it from its union,\n// and no such hook is exported anywhere in 3.1.0. Inventing one would be the\n// only place in this module where the hook spelling is richer than the\n// spelling it was migrated from. `Gesture.ForceTouch()` is the whole API\n// upstream offers, so it is the whole API offered here.\n\n// --- the composers, in the hook spelling ---\n//\n// Not hooks in any real sense — upstream's are not either, past a `useMemo`\n// it does not need — and exported under these names because that is what\n// upstream's `src/v3` calls them and what an app migrating off the deprecated\n// statics will write. `useCompetingGestures` is `Gesture.Race()` under the\n// better name: the gestures compete, and they would have anyway.\n\nexport const useCompetingGestures = (\n ...gestures: AnyGestureSpec[]\n): ComposedGestureSpec => raceGestures(...gestures)\n\nexport const useSimultaneousGestures = (\n ...gestures: AnyGestureSpec[]\n): ComposedGestureSpec => simultaneousGestures(...gestures)\n\nexport const useExclusiveGestures = (\n ...gestures: AnyGestureSpec[]\n): ComposedGestureSpec => exclusiveGestures(...gestures)\n"]}
@@ -0,0 +1,2 @@
1
+ import type { RecognizerDecider } from "./recognizer";
2
+ export declare const hoverDecider: RecognizerDecider;
@@ -0,0 +1,22 @@
1
+ export const hoverDecider = {
2
+ kind: "hover",
3
+ // See the header: no press, so no interaction lock to take. Every event
4
+ // arrives through `Recognizer.controller` instead.
5
+ claimsResponder: false,
6
+ source: "hover",
7
+ /**
8
+ * Never. A hover has no failure mode of its own — the pointer is either over
9
+ * the view or it is not, and leaving is an END rather than a failure
10
+ * (upstream's `onPointerMoveOut` calls `end()`). The controller channel's
11
+ * own `end` is what reports it.
12
+ */
13
+ shouldFail: () => false,
14
+ /**
15
+ * Always. The crossing IS the gesture: there is no distance to travel, no
16
+ * time to wait and nothing to disambiguate it from. Returning a constant is
17
+ * upstream's `begin(); activate();` on the enter event, stated as the
18
+ * predicate the shared machine asks for.
19
+ */
20
+ shouldActivate: () => true,
21
+ };
22
+ //# sourceMappingURL=hover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover.js","sourceRoot":"","sources":["../../src/gesture-handler-compat/hover.ts"],"names":[],"mappings":"AA2DA,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,IAAI,EAAE,OAAO;IAEb,wEAAwE;IACxE,mDAAmD;IACnD,eAAe,EAAE,KAAK;IACtB,MAAM,EAAE,OAAO;IAEf;;;;;OAKG;IACH,UAAU,EAAE,GAAY,EAAE,CAAC,KAAK;IAEhC;;;;;OAKG;IACH,cAAc,EAAE,GAAY,EAAE,CAAC,IAAI;CACpC,CAAA","sourcesContent":["// `Gesture.Hover()` — the pointer being OVER a view, with no button involved.\n//\n// THE REFUSAL THIS REPLACES WAS WRONG, and it is worth writing down why rather\n// than quietly deleting it. `docs/research/gesture-detector.md` grouped `Hover`\n// with `Pinch`/`Rotation`/`ForceTouch` as \"no input to run on\". That was a\n// reasonable reading of a rig whose only injection protocol was\n// `zwlr_virtual_pointer_v1` — but it is the wrong test for this gesture,\n// because a hover needs no protocol the rig lacked. A mouse hovers. The\n// virtual pointer moves a mouse. `motion_absolute` with no `button` request is\n// already a hover, and it always was: `Pressable` has shipped hover on\n// `GtkEventControllerMotion` since long before this epic, and the gallery has\n// hovered rows on screen. The refusal was inherited from its neighbours rather\n// than measured, and measuring it takes one injected move.\n//\n// SO IT IS THE MOST TESTABLE of the four rather than the least: everything\n// here runs under the ordinary headless compositor in the ordinary test suite,\n// with a real pointer and a real crossing, which is more than `Pinch` and\n// `Rotation` can say.\n//\n// WHERE IT COMES FROM. `GtkEventControllerMotion`'s `enter`/`motion`/`leave`,\n// the same controller `components/pressable.tsx` already uses, attached by\n// ./detector-runtime and pumped into `Recognizer.controller`. Not the touch\n// props: those fire from a PRESS, and the defining property of a hover is that\n// there is no press. That is the same reason `Pinch` needed a channel of its\n// own, and it is the same channel.\n//\n// IT NEVER TAKES THE RESPONDER (`claimsResponder: false`), for exactly the\n// structural reason the touchpad kinds do not: the responder lock is a lock\n// over an INTERACTION, an interaction here starts with a press, and a hover\n// has none. There is no session to take, no GTK sequence to claim and nothing\n// to transfer. A hover therefore cannot exclude a press, which is the correct\n// behaviour and also the only reachable one.\n//\n// Restated from `src/web/handlers/HoverGestureHandler.ts` at 3.1.0. Two\n// details are worth naming:\n//\n// - **it activates on the crossing itself.** `onPointerMoveOver` calls\n// `begin()` and then `activate()` in the same synchronous breath, so a\n// hover is BEGAN and ACTIVE within one event and there is no threshold of\n// any kind. `shouldActivate` returning a constant `true` IS that;\n// - **no button is consulted anywhere on the path.** Upstream's other\n// handlers gate `onPointerDown` on `isButtonInConfig`; the three hover\n// entry points never call it. `mouseButton` is inert for this kind, on\n// both platforms and for the same reason.\n//\n// UPSTREAM'S DEFAULT IS MUTUAL EXCLUSION AND THAT IS REPRODUCED, which is the\n// one thing to know before putting a hover next to something. A gesture that\n// activates cancels every recorded gesture it is not simultaneous with, and a\n// hover activates whenever the pointer crosses in — so a hover entering while\n// a pan on another view is still BEGAN will cancel that pan. Upstream behaves\n// the same way and works around it per-use: its own `Pressable` sets\n// `manualActivation` on the hover recognizer precisely to stop it blocking a\n// `Gesture.Native()`. Inventing an exemption here would be a second\n// arbitration rule that upstream does not have; declaring\n// `simultaneousWithExternalGesture` is the answer, and it is the answer the\n// relation registry exists to give. docs/api.md says so where an app will\n// read it.\nimport type { RecognizerDecider } from \"./recognizer\"\n\nexport const hoverDecider: RecognizerDecider = {\n kind: \"hover\",\n\n // See the header: no press, so no interaction lock to take. Every event\n // arrives through `Recognizer.controller` instead.\n claimsResponder: false,\n source: \"hover\",\n\n /**\n * Never. A hover has no failure mode of its own — the pointer is either over\n * the view or it is not, and leaving is an END rather than a failure\n * (upstream's `onPointerMoveOut` calls `end()`). The controller channel's\n * own `end` is what reports it.\n */\n shouldFail: (): boolean => false,\n\n /**\n * Always. The crossing IS the gesture: there is no distance to travel, no\n * time to wait and nothing to disambiguate it from. Returning a constant is\n * upstream's `begin(); activate();` on the enter event, stated as the\n * predicate the shared machine asks for.\n */\n shouldActivate: (): boolean => true,\n}\n"]}
@@ -0,0 +1,98 @@
1
+ import type { ReactNode } from "react";
2
+ import type { StyleProp } from "../contracts";
3
+ import { Gesture } from "./builder";
4
+ import { GestureDetector } from "./detector";
5
+ import { useCompetingGestures, useExclusiveGestures, useFlingGesture, useHoverGesture, useLongPressGesture, useManualGesture, useNativeGesture, usePanGesture, usePinchGesture, useRotationGesture, useSimultaneousGestures, useTapGesture } from "./hooks";
6
+ export { Gesture, GestureDetector, useCompetingGestures, useExclusiveGestures, useFlingGesture, useHoverGesture, useLongPressGesture, useManualGesture, useNativeGesture, usePanGesture, usePinchGesture, useRotationGesture, useSimultaneousGestures, useTapGesture, };
7
+ export { FlingGestureBuilder, ForceTouchGestureBuilder, HoverGestureBuilder, LongPressGestureBuilder, ManualGestureBuilder, NativeGestureBuilder, PanGestureBuilder, PinchGestureBuilder, RotationGestureBuilder, TapGestureBuilder, } from "./builder";
8
+ export type { GestureDetectorProps } from "./detector";
9
+ export type { FlingGestureHookConfig, HoverGestureHookConfig, LongPressGestureHookConfig, ManualGestureHookConfig, NativeGestureHookConfig, PanGestureHookConfig, TapGestureHookConfig, } from "./hooks";
10
+ export type { AnyGestureSpec, ComposedGestureKind, ComposedGestureSpec, GestureEndEventPayload, GestureEventPayload, GestureHitSlop, GestureKind, GestureRef, GestureRelations, GestureSpec, GestureStateManagerApi, GestureTouchData, GestureTouchEvent, OffsetBound, } from "./types";
11
+ export type GestureHandlerRootViewProps = {
12
+ children?: ReactNode;
13
+ style?: StyleProp;
14
+ testID?: string;
15
+ };
16
+ /**
17
+ * The root box `react-native-gesture-handler` asks apps to put at the top of
18
+ * the tree.
19
+ *
20
+ * Faithful, not merely tolerated. Upstream's does two things: it renders a
21
+ * `flex: 1` `View`, and it marks the subtree as gesture-arbitrating. The
22
+ * first is reproduced exactly. The second is genuinely this platform's job
23
+ * already — RN's own gesture responder system is implemented here on GTK4
24
+ * event controllers (#41), and its lock is global — so there is no context to
25
+ * provide and nothing is being skipped.
26
+ */
27
+ export declare const GestureHandlerRootView: ({ children, style, testID, }: GestureHandlerRootViewProps) => ReactNode;
28
+ export declare const FlingGestureHandler: any;
29
+ export declare const ForceTouchGestureHandler: any;
30
+ export declare const LongPressGestureHandler: any;
31
+ export declare const NativeViewGestureHandler: any;
32
+ export declare const PanGestureHandler: any;
33
+ export declare const PinchGestureHandler: any;
34
+ export declare const RotationGestureHandler: any;
35
+ export declare const TapGestureHandler: any;
36
+ export declare const legacy_createNativeWrapper: any;
37
+ export declare const GestureDetectorType: any;
38
+ export declare const GestureStateManager: any;
39
+ export declare const InterceptingGestureDetector: any;
40
+ export declare const VirtualGestureDetector: any;
41
+ export declare const State: {
42
+ readonly UNDETERMINED: 0;
43
+ readonly FAILED: 1;
44
+ readonly BEGAN: 2;
45
+ readonly CANCELLED: 3;
46
+ readonly ACTIVE: 4;
47
+ readonly END: 5;
48
+ };
49
+ export declare const Directions: {
50
+ readonly RIGHT: 1;
51
+ readonly LEFT: 2;
52
+ readonly UP: 4;
53
+ readonly DOWN: 8;
54
+ };
55
+ export declare const HoverEffect: {
56
+ readonly NONE: 0;
57
+ readonly LIFT: 1;
58
+ readonly HIGHLIGHT: 2;
59
+ };
60
+ export declare const MouseButton: {
61
+ readonly LEFT: 1;
62
+ readonly RIGHT: 2;
63
+ readonly MIDDLE: 4;
64
+ readonly BUTTON_4: 8;
65
+ readonly BUTTON_5: 16;
66
+ readonly ALL: 31;
67
+ };
68
+ export declare const PointerType: {
69
+ readonly TOUCH: 0;
70
+ readonly STYLUS: 1;
71
+ readonly MOUSE: 2;
72
+ readonly KEY: 3;
73
+ readonly OTHER: 4;
74
+ };
75
+ export declare const BaseButton: any;
76
+ export declare const BorderlessButton: any;
77
+ export { FlatList } from "../components/flat-list";
78
+ export { Pressable, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, } from "../components/pressable";
79
+ export { ScrollView } from "../components/scroll-view";
80
+ export { Switch } from "../components/switch";
81
+ export { TextInput } from "../components/text-input";
82
+ export declare const RawButton: any;
83
+ export declare const RectButton: any;
84
+ export declare const RefreshControl: any;
85
+ export declare const Touchable: any;
86
+ export declare const TouchableNativeFeedback: any;
87
+ export declare const LegacyBaseButton: any;
88
+ export declare const LegacyBorderlessButton: any;
89
+ export declare const LegacyDrawerLayoutAndroid: any;
90
+ export declare const LegacyFlatList: any;
91
+ export declare const LegacyPressable: any;
92
+ export declare const LegacyRawButton: any;
93
+ export declare const LegacyRectButton: any;
94
+ export declare const LegacyRefreshControl: any;
95
+ export declare const LegacyScrollView: any;
96
+ export declare const LegacySwitch: any;
97
+ export declare const LegacyText: any;
98
+ export declare const LegacyTextInput: any;