react-native-screen-transitions 3.8.0-alpha.0 → 3.8.0-beta.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 (404) hide show
  1. package/lib/commonjs/shared/animation/snap-to.js +1 -1
  2. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  3. package/lib/commonjs/shared/components/activity/variants/activity-screen.js +10 -2
  4. package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +2 -2
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +1 -1
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +1 -1
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-transition-aware-component.js +7 -5
  12. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  13. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +9 -6
  14. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  15. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +2 -2
  16. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  17. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +1 -1
  18. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  19. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js +2 -2
  20. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js.map +1 -1
  21. package/lib/commonjs/shared/configs/presets.js +5 -8
  22. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  23. package/lib/commonjs/shared/constants.js +18 -2
  24. package/lib/commonjs/shared/constants.js.map +1 -1
  25. package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -8
  26. package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
  27. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js +26 -31
  28. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
  29. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +30 -4
  30. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  31. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +3 -3
  32. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +3 -3
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +4 -2
  36. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +7 -8
  38. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js +3 -7
  40. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js +8 -2
  42. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -1
  43. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +7 -4
  44. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +20 -36
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js +12 -21
  48. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  49. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-reset.js +40 -39
  50. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -1
  51. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +11 -21
  52. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  53. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +4 -11
  54. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  55. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +12 -10
  56. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  57. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +13 -10
  58. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js +15 -11
  60. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js +28 -23
  62. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -1
  63. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +3 -3
  64. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js +4 -11
  66. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +12 -10
  68. package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +3 -10
  70. package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/index.js +7 -0
  72. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/index.js.map +1 -1
  73. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js +40 -0
  74. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js.map +1 -0
  75. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.js +51 -13
  76. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +74 -6
  78. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  79. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +23 -23
  80. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +0 -11
  82. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  83. package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js +17 -10
  84. package/lib/commonjs/shared/providers/screen/gestures/shared/reset.js.map +1 -1
  85. package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js +6 -7
  86. package/lib/commonjs/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
  87. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +32 -0
  88. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -0
  89. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +65 -0
  90. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -0
  91. package/lib/commonjs/shared/providers/screen/gestures/types.js +1 -1
  92. package/lib/commonjs/shared/providers/screen/options/helpers.js +1 -19
  93. package/lib/commonjs/shared/providers/screen/options/helpers.js.map +1 -1
  94. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +8 -8
  95. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  96. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -2
  97. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  98. package/lib/commonjs/shared/stores/animation.store.js +6 -6
  99. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  100. package/lib/commonjs/shared/stores/gesture.store.js +56 -0
  101. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  102. package/lib/commonjs/shared/stores/scroll.store.js +49 -5
  103. package/lib/commonjs/shared/stores/scroll.store.js.map +1 -1
  104. package/lib/commonjs/shared/types/gesture.types.js +18 -0
  105. package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
  106. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +3 -3
  107. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  108. package/lib/commonjs/shared/utils/animation/spring/spring.js +7 -3
  109. package/lib/commonjs/shared/utils/animation/spring/spring.js.map +1 -1
  110. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +1 -1
  111. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  112. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +39 -34
  113. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  114. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +37 -28
  115. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  116. package/lib/module/shared/animation/snap-to.js +1 -1
  117. package/lib/module/shared/animation/snap-to.js.map +1 -1
  118. package/lib/module/shared/components/activity/variants/activity-screen.js +10 -2
  119. package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
  120. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +2 -2
  121. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  122. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +1 -1
  123. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  124. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +1 -1
  125. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  126. package/lib/module/shared/components/create-transition-aware-component.js +8 -6
  127. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  128. package/lib/module/shared/components/overlay/variations/float-overlay.js +9 -6
  129. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  130. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +2 -2
  131. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  132. package/lib/module/shared/components/screen-container/layers/backdrop.js +1 -1
  133. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  134. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js +2 -2
  135. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js.map +1 -1
  136. package/lib/module/shared/configs/presets.js +5 -8
  137. package/lib/module/shared/configs/presets.js.map +1 -1
  138. package/lib/module/shared/constants.js +17 -1
  139. package/lib/module/shared/constants.js.map +1 -1
  140. package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -8
  141. package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
  142. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js +25 -30
  143. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
  144. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +31 -5
  145. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  146. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +3 -3
  147. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  148. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +3 -3
  149. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  150. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +4 -2
  151. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  152. package/lib/module/shared/providers/screen/gestures/gestures.provider.js +7 -8
  153. package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  154. package/lib/module/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js +3 -7
  155. package/lib/module/shared/providers/screen/gestures/hooks/use-stable-runtime-config.js.map +1 -1
  156. package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js +8 -2
  157. package/lib/module/shared/providers/screen/gestures/pan/activation/pan-activation-decision.js.map +1 -1
  158. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +7 -4
  159. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  160. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +20 -36
  161. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  162. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js +12 -21
  163. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
  164. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-reset.js +42 -41
  165. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-reset.js.map +1 -1
  166. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +11 -21
  167. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  168. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +4 -11
  169. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  170. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +12 -10
  171. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  172. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +13 -10
  173. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  174. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js +16 -12
  175. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
  176. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js +30 -25
  177. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-reset.js.map +1 -1
  178. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +3 -3
  179. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  180. package/lib/module/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js +4 -11
  181. package/lib/module/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.js.map +1 -1
  182. package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +12 -10
  183. package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +1 -1
  184. package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +3 -10
  185. package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +1 -1
  186. package/lib/module/shared/providers/screen/gestures/scroll-coordination/index.js +1 -0
  187. package/lib/module/shared/providers/screen/gestures/scroll-coordination/index.js.map +1 -1
  188. package/lib/module/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js +33 -0
  189. package/lib/module/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js.map +1 -0
  190. package/lib/module/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.js +48 -12
  191. package/lib/module/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.js.map +1 -1
  192. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +76 -8
  193. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  194. package/lib/module/shared/providers/screen/gestures/shared/physics.js +21 -22
  195. package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  196. package/lib/module/shared/providers/screen/gestures/shared/policy.js +1 -12
  197. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  198. package/lib/module/shared/providers/screen/gestures/shared/reset.js +17 -8
  199. package/lib/module/shared/providers/screen/gestures/shared/reset.js.map +1 -1
  200. package/lib/module/shared/providers/screen/gestures/shared/snap-points.js +6 -7
  201. package/lib/module/shared/providers/screen/gestures/shared/snap-points.js.map +1 -1
  202. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +27 -0
  203. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -0
  204. package/lib/module/shared/providers/screen/gestures/shared/values.js +54 -0
  205. package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -0
  206. package/lib/module/shared/providers/screen/gestures/types.js +1 -1
  207. package/lib/module/shared/providers/screen/options/helpers.js +2 -20
  208. package/lib/module/shared/providers/screen/options/helpers.js.map +1 -1
  209. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +8 -8
  210. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  211. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -2
  212. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  213. package/lib/module/shared/stores/animation.store.js +6 -6
  214. package/lib/module/shared/stores/animation.store.js.map +1 -1
  215. package/lib/module/shared/stores/gesture.store.js +56 -0
  216. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  217. package/lib/module/shared/stores/scroll.store.js +49 -5
  218. package/lib/module/shared/stores/scroll.store.js.map +1 -1
  219. package/lib/module/shared/types/animation.types.js.map +1 -1
  220. package/lib/module/shared/types/gesture.types.js +23 -0
  221. package/lib/module/shared/types/gesture.types.js.map +1 -1
  222. package/lib/module/shared/utils/animation/animate-to-progress.js +3 -3
  223. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  224. package/lib/module/shared/utils/animation/spring/spring.js +7 -3
  225. package/lib/module/shared/utils/animation/spring/spring.js.map +1 -1
  226. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +1 -1
  227. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  228. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +39 -34
  229. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  230. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +37 -28
  231. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  232. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  233. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
  234. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  235. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  236. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  237. package/lib/typescript/shared/constants.d.ts +1 -2
  238. package/lib/typescript/shared/constants.d.ts.map +1 -1
  239. package/lib/typescript/shared/index.d.ts +1 -1
  240. package/lib/typescript/shared/index.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
  242. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.d.ts +7 -3
  243. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.d.ts.map +1 -1
  244. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  245. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +4 -2
  246. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  247. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +1 -1
  248. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
  249. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +4 -3
  250. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  251. package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
  252. package/lib/typescript/shared/providers/screen/gestures/hooks/use-stable-runtime-config.d.ts.map +1 -1
  253. package/lib/typescript/shared/providers/screen/gestures/pan/activation/pan-activation-decision.d.ts.map +1 -1
  254. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +3 -3
  255. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
  256. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts +2 -2
  257. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
  258. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -1
  259. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-reset.d.ts +3 -12
  260. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-reset.d.ts.map +1 -1
  261. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -2
  262. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  263. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts +3 -3
  264. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
  265. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +3 -3
  266. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
  267. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  268. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -1
  269. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-reset.d.ts.map +1 -1
  270. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts +2 -2
  271. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  272. package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts +3 -3
  273. package/lib/typescript/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.d.ts.map +1 -1
  274. package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts +3 -3
  275. package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts.map +1 -1
  276. package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts +3 -3
  277. package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts.map +1 -1
  278. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/index.d.ts +1 -0
  279. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/index.d.ts.map +1 -1
  280. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.d.ts +12 -0
  281. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.d.ts.map +1 -0
  282. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.d.ts +5 -1
  283. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.d.ts.map +1 -1
  284. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts +4 -0
  285. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
  286. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +3 -3
  287. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts.map +1 -1
  288. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +1 -3
  289. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  290. package/lib/typescript/shared/providers/screen/gestures/shared/reset.d.ts +7 -4
  291. package/lib/typescript/shared/providers/screen/gestures/shared/reset.d.ts.map +1 -1
  292. package/lib/typescript/shared/providers/screen/gestures/shared/snap-points.d.ts.map +1 -1
  293. package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts +7 -0
  294. package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -0
  295. package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts +9 -0
  296. package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -0
  297. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +6 -13
  298. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  299. package/lib/typescript/shared/providers/screen/options/helpers.d.ts.map +1 -1
  300. package/lib/typescript/shared/providers/screen/options/types.d.ts +0 -2
  301. package/lib/typescript/shared/providers/screen/options/types.d.ts.map +1 -1
  302. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  303. package/lib/typescript/shared/stores/animation.store.d.ts +4 -4
  304. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  305. package/lib/typescript/shared/stores/gesture.store.d.ts +23 -0
  306. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  307. package/lib/typescript/shared/stores/scroll.store.d.ts +15 -8
  308. package/lib/typescript/shared/stores/scroll.store.d.ts.map +1 -1
  309. package/lib/typescript/shared/types/animation.types.d.ts +8 -0
  310. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  311. package/lib/typescript/shared/types/bounds.types.d.ts +12 -8
  312. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  313. package/lib/typescript/shared/types/gesture.types.d.ts +64 -14
  314. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  315. package/lib/typescript/shared/types/index.d.ts +1 -1
  316. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  317. package/lib/typescript/shared/types/screen.types.d.ts +33 -9
  318. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  319. package/lib/typescript/shared/utils/animation/spring/spring.d.ts.map +1 -1
  320. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  321. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  322. package/lib/typescript/shared/utils/bounds/types/options.d.ts +8 -0
  323. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  324. package/package.json +1 -1
  325. package/src/shared/animation/snap-to.ts +1 -1
  326. package/src/shared/components/activity/variants/activity-screen.tsx +8 -2
  327. package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +5 -2
  328. package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +1 -1
  329. package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +4 -1
  330. package/src/shared/components/create-transition-aware-component.tsx +14 -6
  331. package/src/shared/components/overlay/variations/float-overlay.tsx +11 -5
  332. package/src/shared/components/screen-container/hooks/use-content-layout.ts +2 -2
  333. package/src/shared/components/screen-container/layers/backdrop.tsx +1 -1
  334. package/src/shared/components/screen-lifecycle/hooks/use-open-transition-intent.ts +2 -2
  335. package/src/shared/configs/presets.ts +6 -8
  336. package/src/shared/constants.ts +16 -6
  337. package/src/shared/index.ts +6 -0
  338. package/src/shared/providers/screen/animation/helpers/build-screen-transition-options.ts +2 -17
  339. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.ts +54 -53
  340. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +74 -8
  341. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +4 -2
  342. package/src/shared/providers/screen/animation/helpers/pipeline.ts +3 -3
  343. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +3 -3
  344. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +8 -4
  345. package/src/shared/providers/screen/gestures/gestures.provider.tsx +8 -10
  346. package/src/shared/providers/screen/gestures/hooks/use-stable-runtime-config.ts +2 -5
  347. package/src/shared/providers/screen/gestures/pan/activation/pan-activation-decision.ts +11 -2
  348. package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +9 -7
  349. package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +25 -38
  350. package/src/shared/providers/screen/gestures/pan/behavior/pan-release.ts +23 -25
  351. package/src/shared/providers/screen/gestures/pan/behavior/pan-reset.ts +45 -77
  352. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +12 -20
  353. package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +5 -11
  354. package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +14 -16
  355. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +13 -9
  356. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-release.ts +31 -16
  357. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-reset.ts +32 -41
  358. package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +4 -4
  359. package/src/shared/providers/screen/gestures/pinch/use-build-pinch-gesture.ts +5 -10
  360. package/src/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.ts +14 -13
  361. package/src/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.ts +4 -9
  362. package/src/shared/providers/screen/gestures/scroll-coordination/index.ts +1 -0
  363. package/src/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.tsx +43 -0
  364. package/src/shared/providers/screen/gestures/scroll-coordination/update-scroll-gesture-state.ts +59 -4
  365. package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +130 -8
  366. package/src/shared/providers/screen/gestures/shared/physics.ts +15 -32
  367. package/src/shared/providers/screen/gestures/shared/policy.ts +0 -15
  368. package/src/shared/providers/screen/gestures/shared/reset.ts +33 -11
  369. package/src/shared/providers/screen/gestures/shared/snap-points.ts +8 -7
  370. package/src/shared/providers/screen/gestures/shared/snapshot.ts +33 -0
  371. package/src/shared/providers/screen/gestures/shared/values.ts +52 -0
  372. package/src/shared/providers/screen/gestures/types.ts +6 -13
  373. package/src/shared/providers/screen/options/helpers.ts +0 -44
  374. package/src/shared/providers/screen/options/types.ts +0 -2
  375. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +8 -8
  376. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +3 -2
  377. package/src/shared/stores/animation.store.ts +8 -8
  378. package/src/shared/stores/gesture.store.ts +81 -0
  379. package/src/shared/stores/scroll.store.ts +80 -7
  380. package/src/shared/types/animation.types.ts +9 -0
  381. package/src/shared/types/bounds.types.ts +12 -8
  382. package/src/shared/types/gesture.types.ts +66 -15
  383. package/src/shared/types/index.ts +6 -0
  384. package/src/shared/types/screen.types.ts +33 -8
  385. package/src/shared/utils/animation/animate-to-progress.ts +3 -3
  386. package/src/shared/utils/animation/spring/spring.ts +7 -3
  387. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +1 -1
  388. package/src/shared/utils/bounds/navigation/reveal/build.ts +42 -46
  389. package/src/shared/utils/bounds/navigation/zoom/build.ts +36 -33
  390. package/src/shared/utils/bounds/types/options.ts +9 -0
  391. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js +0 -32
  392. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js.map +0 -1
  393. package/lib/commonjs/shared/utils/gesture-progress-mode.js +0 -50
  394. package/lib/commonjs/shared/utils/gesture-progress-mode.js.map +0 -1
  395. package/lib/module/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js +0 -27
  396. package/lib/module/shared/providers/screen/gestures/hooks/use-gesture-builder-state.js.map +0 -1
  397. package/lib/module/shared/utils/gesture-progress-mode.js +0 -42
  398. package/lib/module/shared/utils/gesture-progress-mode.js.map +0 -1
  399. package/lib/typescript/shared/providers/screen/gestures/hooks/use-gesture-builder-state.d.ts +0 -21
  400. package/lib/typescript/shared/providers/screen/gestures/hooks/use-gesture-builder-state.d.ts.map +0 -1
  401. package/lib/typescript/shared/utils/gesture-progress-mode.d.ts +0 -14
  402. package/lib/typescript/shared/utils/gesture-progress-mode.d.ts.map +0 -1
  403. package/src/shared/providers/screen/gestures/hooks/use-gesture-builder-state.ts +0 -31
  404. package/src/shared/utils/gesture-progress-mode.ts +0 -67
@@ -2,6 +2,7 @@ import { clamp } from "react-native-reanimated";
2
2
  import {
3
3
  getPinchReleaseHandoffVelocity,
4
4
  normalizePinchScale,
5
+ resolveGestureVelocityMagnitude,
5
6
  shouldDismissFromPinch,
6
7
  } from "../../shared/physics";
7
8
  import {
@@ -66,7 +67,7 @@ const getPinchSnapReleaseProgress = ({
66
67
  const snapDirections = runtime.policy.snapDirections;
67
68
 
68
69
  if (!pinchDirection || !snapDirections) {
69
- return runtime.stores.animations.progress.get();
70
+ return runtime.stores.animations.transitionProgress.get();
70
71
  }
71
72
 
72
73
  const progressDelta =
@@ -75,7 +76,7 @@ const getPinchSnapReleaseProgress = ({
75
76
  : Math.abs(normalizedScale);
76
77
 
77
78
  return clamp(
78
- runtime.gestureProgressBaseline.get() + progressDelta,
79
+ runtime.stores.gestures.internal.progressBaseline.get() + progressDelta,
79
80
  minSnapPoint,
80
81
  maxSnapPoint,
81
82
  );
@@ -94,11 +95,10 @@ export const resolvePinchRelease = (
94
95
  const {
95
96
  participation,
96
97
  policy,
97
- gestureProgressBaseline,
98
98
  stores: { animations },
99
99
  } = runtime;
100
100
  const normalizedScale = clamp(normalizePinchScale(event.scale), -1, 1);
101
- const currentProgress = animations.progress.get();
101
+ const currentProgress = animations.transitionProgress.get();
102
102
  const shouldDismiss =
103
103
  participation.canDismiss &&
104
104
  shouldDismissFromPinch(
@@ -106,19 +106,26 @@ export const resolvePinchRelease = (
106
106
  policy.pinchInEnabled,
107
107
  policy.pinchOutEnabled,
108
108
  );
109
- const target = shouldDismiss ? 0 : gestureProgressBaseline.get();
109
+ const target = shouldDismiss
110
+ ? 0
111
+ : runtime.stores.gestures.internal.progressBaseline.get();
112
+ const progressVelocity = getPinchReleaseHandoffVelocity(event.velocity);
113
+ const handoffVelocity = getPinchReleaseHandoffVelocity(
114
+ event.velocity,
115
+ policy.gestureReleaseVelocityScale,
116
+ );
110
117
 
111
118
  return {
112
119
  target,
113
120
  shouldDismiss,
114
121
  initialVelocity: getProgressVelocityTowardTarget({
115
- handoffVelocity: getPinchReleaseHandoffVelocity(
116
- event.velocity,
117
- policy.gestureReleaseVelocityScale,
118
- ),
122
+ handoffVelocity: progressVelocity,
119
123
  target,
120
124
  currentProgress,
121
125
  }),
126
+ handoffVelocity: shouldDismiss
127
+ ? resolveGestureVelocityMagnitude(handoffVelocity)
128
+ : 0,
122
129
  transitionSpec: policy.transitionSpec,
123
130
  resetSpec: shouldDismiss
124
131
  ? policy.transitionSpec?.close
@@ -131,7 +138,7 @@ export const resolveSnapPinchRelease = (
131
138
  runtime: PinchGestureRuntime,
132
139
  ): PinchReleaseResult => {
133
140
  "worklet";
134
- const { participation, policy, lockedSnapPoint } = runtime;
141
+ const { participation, policy } = runtime;
135
142
  const normalizedScale = clamp(normalizePinchScale(event.scale), -1, 1);
136
143
 
137
144
  const { resolvedSnapPoints, resolvedMinSnapPoint, resolvedMaxSnapPoint } =
@@ -146,7 +153,10 @@ export const resolveSnapPinchRelease = (
146
153
  const result = determineSnapTarget({
147
154
  currentProgress,
148
155
  snapPoints: policy.gestureSnapLocked
149
- ? [lockedSnapPoint.get()]
156
+ ? [
157
+ runtime.stores.gestures.internal.lockedSnapPoint.get() ??
158
+ resolvedMaxSnapPoint,
159
+ ]
150
160
  : resolvedSnapPoints,
151
161
  velocity: getPinchSnapVelocity(event, runtime, normalizedScale),
152
162
  dimension: 1,
@@ -156,20 +166,25 @@ export const resolveSnapPinchRelease = (
156
166
 
157
167
  const shouldDismiss = participation.canDismiss && result.shouldDismiss;
158
168
  const target = shouldDismiss ? 0 : result.targetProgress;
169
+ const progressVelocity = getPinchReleaseHandoffVelocity(event.velocity);
170
+ const handoffVelocity = getPinchReleaseHandoffVelocity(
171
+ event.velocity,
172
+ policy.gestureReleaseVelocityScale,
173
+ );
159
174
 
160
175
  return {
161
176
  target,
162
177
  shouldDismiss,
163
178
  initialVelocity: getProgressVelocityTowardTarget({
164
- handoffVelocity: getPinchReleaseHandoffVelocity(
165
- event.velocity,
166
- policy.gestureReleaseVelocityScale,
167
- ),
179
+ handoffVelocity: progressVelocity,
168
180
  target,
169
181
  currentProgress,
170
182
  }),
183
+ handoffVelocity: shouldDismiss
184
+ ? resolveGestureVelocityMagnitude(handoffVelocity)
185
+ : 0,
171
186
  commitProgress: currentProgress,
172
- resetValuesImmediately: policy.gestureProgressMode === "progress-driven",
187
+ resetValuesImmediately: true,
173
188
  transitionSpec: resolveGestureSnapTransitionSpec({
174
189
  transitionSpec: policy.transitionSpec,
175
190
  shouldDismiss,
@@ -1,11 +1,12 @@
1
- import { EPSILON, FALSE, TRUE } from "../../../../../constants";
1
+ import { FALSE, TRUE } from "../../../../../constants";
2
2
  import type { GestureStoreMap } from "../../../../../stores/gesture.store";
3
3
  import type { AnimationConfig } from "../../../../../types/animation.types";
4
+ import { animateMany } from "../../shared/reset";
4
5
  import {
5
- animateResetValue,
6
- clearGestureSettlingIfResting,
7
- getGestureResetSpec,
8
- } from "../../shared/reset";
6
+ clearFocalPoint,
7
+ clearRawTransformValues,
8
+ clearTransformTrackingValues,
9
+ } from "../../shared/values";
9
10
 
10
11
  interface ResetPinchGestureValuesProps {
11
12
  spec?: AnimationConfig;
@@ -14,24 +15,6 @@ interface ResetPinchGestureValuesProps {
14
15
  resetValuesImmediately?: boolean;
15
16
  }
16
17
 
17
- const clearPinchSettlingIfResting = (gestures: GestureStoreMap) => {
18
- "worklet";
19
-
20
- const isResting =
21
- !gestures.dragging.get() &&
22
- !gestures.dismissing.get() &&
23
- Math.abs(gestures.scale.get() - 1) <= EPSILON &&
24
- Math.abs(gestures.normScale.get()) <= EPSILON &&
25
- Math.abs(gestures.rotation.get()) <= EPSILON;
26
-
27
- if (isResting) {
28
- gestures.focalX.set(0);
29
- gestures.focalY.set(0);
30
- }
31
-
32
- clearGestureSettlingIfResting(gestures, isResting);
33
- };
34
-
35
18
  export const resetPinchGestureValues = ({
36
19
  spec,
37
20
  gestures,
@@ -39,33 +22,41 @@ export const resetPinchGestureValues = ({
39
22
  resetValuesImmediately = false,
40
23
  }: ResetPinchGestureValuesProps) => {
41
24
  "worklet";
42
- const resetSpec = getGestureResetSpec(spec);
25
+ const finishPinchReset = () => {
26
+ "worklet";
27
+ if (shouldDismiss) {
28
+ return;
29
+ }
43
30
 
44
- if (!shouldDismiss) {
45
- gestures.raw.scale.set(1);
46
- gestures.raw.normScale.set(0);
47
- gestures.raw.rotation.set(0);
48
- }
31
+ clearFocalPoint(gestures);
32
+ gestures.active.set(null);
33
+ gestures.direction.set(null);
34
+ gestures.settling.set(FALSE);
35
+ };
36
+
37
+ clearRawTransformValues(gestures);
49
38
 
50
39
  gestures.dragging.set(FALSE);
51
40
  gestures.dismissing.set(shouldDismiss ? TRUE : FALSE);
52
41
  gestures.settling.set(shouldDismiss ? FALSE : TRUE);
53
42
 
43
+ if (shouldDismiss) {
44
+ clearFocalPoint(gestures);
45
+ }
46
+
54
47
  if (resetValuesImmediately) {
55
- gestures.scale.set(1);
56
- gestures.normScale.set(0);
57
- gestures.rotation.set(0);
58
- clearPinchSettlingIfResting(gestures);
48
+ clearTransformTrackingValues(gestures);
49
+ finishPinchReset();
59
50
  return;
60
51
  }
61
52
 
62
- animateResetValue(gestures.scale, 1, resetSpec, () =>
63
- clearPinchSettlingIfResting(gestures),
64
- );
65
- animateResetValue(gestures.normScale, 0, resetSpec, () =>
66
- clearPinchSettlingIfResting(gestures),
67
- );
68
- animateResetValue(gestures.rotation, 0, resetSpec, () =>
69
- clearPinchSettlingIfResting(gestures),
53
+ animateMany(
54
+ [
55
+ { value: gestures.scale, toValue: 1 },
56
+ { value: gestures.normScale, toValue: 0 },
57
+ { value: gestures.rotation, toValue: 0 },
58
+ ],
59
+ spec,
60
+ finishPinchReset,
70
61
  );
71
62
  };
@@ -5,7 +5,7 @@ import type { ScreenOptionsContextValue } from "../../../options";
5
5
  import { usePinchGestureSensitivity } from "../../hooks/use-gesture-sensitivity";
6
6
  import { resolvePinchRuntime } from "../../shared/runtime";
7
7
  import type {
8
- GestureCompositionActivation,
8
+ GestureCompositionOwner,
9
9
  PinchBehavior,
10
10
  PinchGestureEvent,
11
11
  PinchGestureRuntime,
@@ -24,7 +24,7 @@ import {
24
24
  export const usePinchBehavior = (
25
25
  runtime: SharedValue<PinchGestureRuntime>,
26
26
  screenOptions: ScreenOptionsContextValue,
27
- gestureCompositionActivation: SharedValue<GestureCompositionActivation>,
27
+ gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
28
28
  ): PinchBehavior => {
29
29
  const { dismissScreen, requestDismiss } = useNavigationHelpers();
30
30
  const { withSensitivity, resetSensitivity } =
@@ -77,7 +77,7 @@ export const usePinchBehavior = (
77
77
  dismissScreen,
78
78
  requestDismiss,
79
79
  );
80
- gestureCompositionActivation.set(null);
80
+ gestureCompositionOwner.set(null);
81
81
  },
82
82
  [
83
83
  runtime,
@@ -85,7 +85,7 @@ export const usePinchBehavior = (
85
85
  dismissScreen,
86
86
  requestDismiss,
87
87
  withSensitivity,
88
- gestureCompositionActivation,
88
+ gestureCompositionOwner,
89
89
  ],
90
90
  );
91
91
 
@@ -2,10 +2,9 @@ import { useMemo } from "react";
2
2
  import { Gesture } from "react-native-gesture-handler";
3
3
  import type { SharedValue } from "react-native-reanimated";
4
4
  import { useScreenOptionsContext } from "../../options";
5
- import { useGestureBuilderState } from "../hooks/use-gesture-builder-state";
6
5
  import { useStableRuntimeConfig } from "../hooks/use-stable-runtime-config";
7
6
  import type {
8
- GestureCompositionActivation,
7
+ GestureCompositionOwner,
9
8
  PinchGesture,
10
9
  ScreenGestureConfig,
11
10
  } from "../types";
@@ -14,35 +13,31 @@ import { usePinchBehavior } from "./behavior/use-pinch-behavior";
14
13
 
15
14
  interface UseBuildPinchGestureProps {
16
15
  gestureConfig: ScreenGestureConfig;
17
- gestureCompositionActivation: SharedValue<GestureCompositionActivation>;
16
+ gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
18
17
  }
19
18
 
20
19
  export const useBuildPinchGesture = ({
21
20
  gestureConfig,
22
- gestureCompositionActivation,
21
+ gestureCompositionOwner,
23
22
  }: UseBuildPinchGestureProps): PinchGesture => {
24
23
  const { participation, pinch: policy } = gestureConfig;
25
24
  const screenOptions = useScreenOptionsContext();
26
- const { gestureProgressBaseline, lockedSnapPoint } =
27
- useGestureBuilderState(participation);
28
25
 
29
26
  const runtime = useStableRuntimeConfig({
30
27
  participation,
31
28
  policy,
32
- gestureProgressBaseline,
33
- lockedSnapPoint,
34
29
  });
35
30
 
36
31
  const activation = usePinchActivation({
37
32
  runtime,
38
33
  screenOptions,
39
- gestureCompositionActivation,
34
+ gestureCompositionOwner,
40
35
  });
41
36
 
42
37
  const behavior = usePinchBehavior(
43
38
  runtime,
44
39
  screenOptions,
45
- gestureCompositionActivation,
40
+ gestureCompositionOwner,
46
41
  );
47
42
 
48
43
  const pinchGesture = useMemo(() => {
@@ -7,20 +7,20 @@ import type { SharedValue } from "react-native-reanimated";
7
7
  import type { ScreenOptionsContextValue } from "../../../options";
8
8
  import { resolvePinchRuntime } from "../../shared/runtime";
9
9
  import type {
10
- GestureCompositionActivation,
10
+ GestureCompositionOwner,
11
11
  RotationGestureRuntime,
12
12
  } from "../../types";
13
13
 
14
14
  interface UseRotationActivationProps {
15
15
  runtime: SharedValue<RotationGestureRuntime>;
16
16
  screenOptions: ScreenOptionsContextValue;
17
- gestureCompositionActivation: SharedValue<GestureCompositionActivation>;
17
+ gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
18
18
  }
19
19
 
20
20
  export const useRotationActivation = ({
21
21
  runtime,
22
22
  screenOptions,
23
- gestureCompositionActivation,
23
+ gestureCompositionOwner,
24
24
  }: UseRotationActivationProps) => {
25
25
  const onTouchesDown = useCallback(
26
26
  (
@@ -33,18 +33,15 @@ export const useRotationActivation = ({
33
33
  screenOptions.get(),
34
34
  );
35
35
 
36
- if (gestureCompositionActivation.get() === "pan") {
37
- stateManager?.fail();
38
- return;
39
- }
40
-
41
36
  if (!participation.canTrackGesture || !policy.enabled) {
42
37
  stateManager?.fail();
43
38
  return;
44
39
  }
45
40
 
46
41
  if (event.numberOfTouches === 2) {
47
- gestureCompositionActivation.set("pinch");
42
+ if (gestureCompositionOwner.get() === null) {
43
+ gestureCompositionOwner.set("pinch");
44
+ }
48
45
  stateManager?.activate();
49
46
  return;
50
47
  }
@@ -53,7 +50,7 @@ export const useRotationActivation = ({
53
50
  stateManager?.fail();
54
51
  }
55
52
  },
56
- [runtime, screenOptions, gestureCompositionActivation],
53
+ [runtime, screenOptions, gestureCompositionOwner],
57
54
  );
58
55
 
59
56
  const onTouchesMove = useCallback(
@@ -70,14 +67,18 @@ export const useRotationActivation = ({
70
67
  }
71
68
 
72
69
  if (event.numberOfTouches === 2) {
73
- gestureCompositionActivation.set("pinch");
70
+ if (gestureCompositionOwner.get() === null) {
71
+ gestureCompositionOwner.set("pinch");
72
+ }
74
73
  stateManager.activate();
75
74
  return;
76
75
  }
77
76
 
78
- stateManager.fail();
77
+ if (event.numberOfTouches > 2) {
78
+ stateManager.fail();
79
+ }
79
80
  },
80
- [runtime, screenOptions, gestureCompositionActivation],
81
+ [runtime, screenOptions, gestureCompositionOwner],
81
82
  );
82
83
 
83
84
  return useMemo(
@@ -2,10 +2,9 @@ import { useMemo } from "react";
2
2
  import { Gesture } from "react-native-gesture-handler";
3
3
  import type { SharedValue } from "react-native-reanimated";
4
4
  import { useScreenOptionsContext } from "../../options";
5
- import { useGestureBuilderState } from "../hooks/use-gesture-builder-state";
6
5
  import { useStableRuntimeConfig } from "../hooks/use-stable-runtime-config";
7
6
  import type {
8
- GestureCompositionActivation,
7
+ GestureCompositionOwner,
9
8
  RotationGesture,
10
9
  ScreenGestureConfig,
11
10
  } from "../types";
@@ -14,29 +13,25 @@ import { useRotationBehavior } from "./behavior/use-rotation-behavior";
14
13
 
15
14
  interface UseBuildRotationGestureProps {
16
15
  gestureConfig: ScreenGestureConfig;
17
- gestureCompositionActivation: SharedValue<GestureCompositionActivation>;
16
+ gestureCompositionOwner: SharedValue<GestureCompositionOwner>;
18
17
  }
19
18
 
20
19
  export const useBuildRotationGesture = ({
21
20
  gestureConfig,
22
- gestureCompositionActivation,
21
+ gestureCompositionOwner,
23
22
  }: UseBuildRotationGestureProps): RotationGesture => {
24
23
  const { participation, pinch: policy } = gestureConfig;
25
24
  const screenOptions = useScreenOptionsContext();
26
- const { gestureProgressBaseline, lockedSnapPoint } =
27
- useGestureBuilderState(participation);
28
25
 
29
26
  const runtime = useStableRuntimeConfig({
30
27
  participation,
31
28
  policy,
32
- gestureProgressBaseline,
33
- lockedSnapPoint,
34
29
  });
35
30
 
36
31
  const activation = useRotationActivation({
37
32
  runtime,
38
33
  screenOptions,
39
- gestureCompositionActivation,
34
+ gestureCompositionOwner,
40
35
  });
41
36
 
42
37
  const behavior = useRotationBehavior(runtime, screenOptions);
@@ -1 +1,2 @@
1
+ export { ScrollMetadataOwnerProvider } from "./scroll-metadata-owner";
1
2
  export { useScrollGestureCoordination } from "./use-scroll-gesture-coordination";
@@ -0,0 +1,43 @@
1
+ import { type ReactNode, useMemo } from "react";
2
+ import createProvider from "../../../../utils/create-provider";
3
+ import type { ScrollGestureAxis } from "../types";
4
+
5
+ type ScrollMetadataOwnerContextValue = Record<ScrollGestureAxis, boolean>;
6
+
7
+ interface ScrollMetadataOwnerProviderProps {
8
+ children: ReactNode;
9
+ value: ScrollMetadataOwnerContextValue;
10
+ }
11
+
12
+ const DEFAULT_SCROLL_METADATA_OWNER_CONTEXT: ScrollMetadataOwnerContextValue = {
13
+ vertical: false,
14
+ horizontal: false,
15
+ };
16
+
17
+ const {
18
+ ScrollMetadataOwnerProvider,
19
+ useScrollMetadataOwnerContext: useMaybeScrollMetadataOwnerContext,
20
+ } = createProvider("ScrollMetadataOwner", { guarded: false })<
21
+ ScrollMetadataOwnerProviderProps,
22
+ ScrollMetadataOwnerContextValue
23
+ >(({ children, value }) => ({ children, value }));
24
+
25
+ export const useScrollMetadataOwnerContext = () =>
26
+ useMaybeScrollMetadataOwnerContext() ?? DEFAULT_SCROLL_METADATA_OWNER_CONTEXT;
27
+
28
+ export const useScrollMetadataOwnerProviderValue = (
29
+ axis: ScrollGestureAxis,
30
+ ) => {
31
+ const parent = useScrollMetadataOwnerContext();
32
+
33
+ return useMemo(() => {
34
+ if (parent[axis]) return parent;
35
+
36
+ return {
37
+ ...parent,
38
+ [axis]: true,
39
+ };
40
+ }, [axis, parent]);
41
+ };
42
+
43
+ export { ScrollMetadataOwnerProvider };
@@ -2,14 +2,27 @@ import type {
2
2
  ScrollGestureAxis,
3
3
  ScrollGestureAxisState,
4
4
  ScrollGestureState,
5
+ ScrollMetadataState,
5
6
  } from "../types";
6
7
 
8
+ function createScrollGestureAxisState(): ScrollGestureAxisState {
9
+ "worklet";
10
+ return { offset: 0, contentSize: 0, layoutSize: 0, isTouched: false };
11
+ }
12
+
7
13
  const createScrollGestureState = (): ScrollGestureState => {
8
14
  "worklet";
9
15
  return {
10
- vertical: { offset: 0, contentSize: 0, layoutSize: 0 },
11
- horizontal: { offset: 0, contentSize: 0, layoutSize: 0 },
12
- isTouched: false,
16
+ vertical: createScrollGestureAxisState(),
17
+ horizontal: createScrollGestureAxisState(),
18
+ };
19
+ };
20
+
21
+ const createScrollMetadataState = (): ScrollMetadataState => {
22
+ "worklet";
23
+ return {
24
+ vertical: null,
25
+ horizontal: null,
13
26
  };
14
27
  };
15
28
 
@@ -37,8 +50,50 @@ export const updateScrollGestureAxisState = (
37
50
  }
38
51
 
39
52
  if (patch.isTouched !== undefined) {
40
- nextState.isTouched = patch.isTouched;
53
+ axisState.isTouched = patch.isTouched;
54
+ }
55
+
56
+ return nextState;
57
+ };
58
+
59
+ export const updateScrollMetadataAxisState = (
60
+ state: ScrollMetadataState | null,
61
+ axis: ScrollGestureAxis,
62
+ patch: Partial<ScrollGestureAxisState> & { isTouched?: boolean },
63
+ ): ScrollMetadataState => {
64
+ "worklet";
65
+
66
+ const nextState = state ?? createScrollMetadataState();
67
+ const axisState = nextState[axis] ?? createScrollGestureAxisState();
68
+ nextState[axis] = axisState;
69
+
70
+ if (patch.offset !== undefined) {
71
+ axisState.offset = patch.offset;
72
+ }
73
+
74
+ if (patch.contentSize !== undefined) {
75
+ axisState.contentSize = patch.contentSize;
76
+ }
77
+
78
+ if (patch.layoutSize !== undefined) {
79
+ axisState.layoutSize = patch.layoutSize;
80
+ }
81
+
82
+ if (patch.isTouched !== undefined) {
83
+ axisState.isTouched = patch.isTouched;
41
84
  }
42
85
 
43
86
  return nextState;
44
87
  };
88
+
89
+ export const clearScrollMetadataAxisState = (
90
+ state: ScrollMetadataState | null,
91
+ axis: ScrollGestureAxis,
92
+ ): ScrollMetadataState | null => {
93
+ "worklet";
94
+ if (!state) return null;
95
+
96
+ state[axis] = null;
97
+
98
+ return state.vertical || state.horizontal ? state : null;
99
+ };