react-native-screen-transitions 3.9.0-beta.2 → 3.9.0-beta.3

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 (241) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +19 -14
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
  4. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -0
  6. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
  7. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
  8. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +4 -3
  10. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
  12. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +2 -1
  14. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +2 -3
  16. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  21. package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -1
  22. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +16 -3
  24. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  25. package/lib/commonjs/shared/constants.js +4 -0
  26. package/lib/commonjs/shared/constants.js.map +1 -1
  27. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  28. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  29. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  30. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  31. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  32. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  34. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
  36. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  38. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  40. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  42. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  43. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  44. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  45. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
  46. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
  47. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
  48. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  49. package/lib/commonjs/shared/stores/gesture.store.js +8 -0
  50. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  51. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
  52. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  53. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +2 -1
  54. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  55. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +177 -314
  56. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  57. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +12 -18
  58. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  59. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
  60. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  61. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +94 -108
  62. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  63. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +72 -0
  64. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  65. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +55 -0
  66. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  67. package/lib/module/shared/components/boundary/components/boundary-target.js +20 -15
  68. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  69. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
  70. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  71. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +2 -1
  72. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
  73. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
  74. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  75. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +5 -4
  76. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
  77. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
  78. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  79. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +3 -2
  80. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  81. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +3 -4
  82. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
  83. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
  84. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  85. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
  86. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  87. package/lib/module/shared/components/boundary/portal/teleport.js +1 -0
  88. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  89. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +17 -4
  90. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  91. package/lib/module/shared/constants.js +4 -0
  92. package/lib/module/shared/constants.js.map +1 -1
  93. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  94. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  95. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  96. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  97. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  98. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  99. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  100. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  101. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
  102. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  103. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  104. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  105. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  106. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  107. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  108. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  109. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  110. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  111. package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
  112. package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
  113. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
  114. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  115. package/lib/module/shared/stores/gesture.store.js +8 -0
  116. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  117. package/lib/module/shared/types/bounds.types.js +26 -0
  118. package/lib/module/shared/types/bounds.types.js.map +1 -1
  119. package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
  120. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  121. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +2 -1
  122. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  123. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +181 -318
  124. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  125. package/lib/module/shared/utils/bounds/navigation/zoom/config.js +11 -17
  126. package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  127. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
  128. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  129. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +91 -102
  130. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  131. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +67 -0
  132. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  133. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +50 -0
  134. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  135. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
  136. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  137. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  138. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -1
  139. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  140. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +1 -3
  141. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
  142. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
  143. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  144. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +2 -3
  145. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -1
  146. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  147. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -3
  148. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
  149. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
  150. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  151. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +1 -0
  152. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  153. package/lib/typescript/shared/constants.d.ts.map +1 -1
  154. package/lib/typescript/shared/index.d.ts +1 -1
  155. package/lib/typescript/shared/index.d.ts.map +1 -1
  156. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  157. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
  158. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
  159. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
  160. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  161. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
  162. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
  163. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
  164. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
  165. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  166. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  167. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
  168. package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
  169. package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
  170. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +4 -0
  171. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  172. package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
  173. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  174. package/lib/typescript/shared/types/bounds.types.d.ts +115 -88
  175. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  176. package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
  177. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  178. package/lib/typescript/shared/types/index.d.ts +1 -1
  179. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  180. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  181. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  182. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
  183. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  184. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
  185. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
  186. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
  187. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
  188. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +31 -34
  189. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  190. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +25 -0
  191. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
  192. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +16 -0
  193. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
  194. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
  195. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
  196. package/package.json +1 -1
  197. package/src/shared/components/boundary/components/boundary-target.tsx +37 -26
  198. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +16 -13
  199. package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +6 -2
  200. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +46 -3
  201. package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +8 -5
  202. package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +3 -2
  203. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +3 -2
  204. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +4 -5
  205. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +5 -1
  206. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -4
  207. package/src/shared/components/boundary/portal/teleport.ts +1 -0
  208. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +23 -3
  209. package/src/shared/constants.ts +4 -0
  210. package/src/shared/index.ts +2 -0
  211. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
  212. package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
  213. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
  214. package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
  215. package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
  216. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
  217. package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
  218. package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
  219. package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
  220. package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
  221. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -1
  222. package/src/shared/stores/gesture.store.ts +12 -0
  223. package/src/shared/types/bounds.types.ts +119 -90
  224. package/src/shared/types/gesture.types.ts +10 -0
  225. package/src/shared/types/index.ts +2 -0
  226. package/src/shared/utils/animation/animate-to-progress.ts +23 -7
  227. package/src/shared/utils/bounds/navigation/reveal/math.ts +2 -1
  228. package/src/shared/utils/bounds/navigation/zoom/build.ts +223 -411
  229. package/src/shared/utils/bounds/navigation/zoom/config.ts +15 -18
  230. package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
  231. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +122 -184
  232. package/src/shared/utils/bounds/navigation/zoom/mask.ts +130 -0
  233. package/src/shared/utils/bounds/navigation/zoom/targets.ts +74 -0
  234. package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
  235. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
  236. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  237. package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
  238. package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  239. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
  240. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
  241. package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
@@ -9,6 +9,7 @@ import { useDescriptorsStore } from "../../../../../../providers/screen/descript
9
9
  import { useScreenSlots } from "../../../../../../providers/screen/styles";
10
10
  import { useRegisteredScreenSlots } from "../../../../../../providers/screen/styles/stores/slot-references.store";
11
11
  import { AnimationStore } from "../../../../../../stores/animation.store";
12
+ import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
12
13
  import { pairs } from "../../../../../../stores/bounds/internals/state";
13
14
  import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
14
15
  import {
@@ -132,7 +133,7 @@ export const useBoundaryContentPortalAttachment = ({
132
133
  useAnimatedReaction(
133
134
  () => {
134
135
  "worklet";
135
- if (!enabled || !sourcePairKey) {
136
+ if (!enabled) {
136
137
  return {
137
138
  hostScreenKey: null,
138
139
  ownerPairKey: sourcePairKey,
@@ -144,13 +145,51 @@ export const useBoundaryContentPortalAttachment = ({
144
145
  const progressAnimating = settledHostAnimating.get();
145
146
  const progressSettled = settledHostProgress.get();
146
147
  const willAnimate = settledHostWillAnimate.get();
148
+ const closing = settledHostClosing.get();
149
+ const isOwnedHostClosing =
150
+ !!closing &&
151
+ !!ownership &&
152
+ settledHostScreenKey === ownership.hostScreenKey;
153
+
154
+ if (isOwnedHostClosing && ownership) {
155
+ const isClosingComplete = isHandoffHostClosingComplete({
156
+ closing,
157
+ progressAnimating,
158
+ progressSettled,
159
+ willAnimate,
160
+ });
161
+
162
+ if (!isClosingComplete) {
163
+ return ownership;
164
+ }
165
+
166
+ const sourceScreenKey = getSourceScreenKeyFromPairKey(
167
+ ownership.ownerPairKey,
168
+ );
169
+
170
+ return {
171
+ hostScreenKey: sourceScreenKey,
172
+ ownerPairKey: ownership.ownerPairKey,
173
+ ownerScreenKey: sourceScreenKey,
174
+ status: "complete",
175
+ };
176
+ }
177
+
178
+ if (!sourcePairKey) {
179
+ return {
180
+ hostScreenKey: null,
181
+ ownerPairKey: sourcePairKey,
182
+ ownerScreenKey: null,
183
+ status: "clear",
184
+ };
185
+ }
147
186
 
148
187
  return resolveBoundaryPortalOwnership({
149
188
  boundaryId,
150
189
  currentScreenKey,
151
190
  handoff: true,
152
191
  isSettledHostClosingComplete: isHandoffHostClosingComplete({
153
- closing: settledHostClosing.get(),
192
+ closing,
154
193
  progressAnimating,
155
194
  progressSettled,
156
195
  willAnimate,
@@ -251,7 +290,11 @@ export const useBoundaryContentPortalAttachment = ({
251
290
  "worklet";
252
291
 
253
292
  const slot = activeSlotsMap.get()[boundaryId];
254
- const { teleport, ...slotProps } = slot?.props ?? {};
293
+ const {
294
+ pointerEvents: _pointerEvents,
295
+ teleport,
296
+ ...slotProps
297
+ } = slot?.props ?? {};
255
298
  const shouldTeleport = shouldAttachBoundaryPortal({
256
299
  enabled,
257
300
  teleport,
@@ -4,9 +4,13 @@ import {
4
4
  memo,
5
5
  type ReactNode,
6
6
  } from "react";
7
- import type { ViewProps } from "react-native";
7
+ import { StyleSheet } from "react-native";
8
8
  import Animated from "react-native-reanimated";
9
- import { isTeleportAvailable, NativePortal } from "../../teleport";
9
+ import {
10
+ isTeleportAvailable,
11
+ NativePortal,
12
+ PORTAL_POINTER_EVENTS,
13
+ } from "../../teleport";
10
14
  import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content-portal-attachment";
11
15
 
12
16
  export { BoundaryContentPortalHost } from "./components/host";
@@ -15,7 +19,6 @@ type BoundaryContentPortalProps = {
15
19
  boundaryId?: string;
16
20
  children: ReactNode;
17
21
  enabled: boolean;
18
- pointerEvents?: ViewProps["pointerEvents"];
19
22
  };
20
23
 
21
24
  type NullableHostNamePortalProps = Omit<
@@ -35,7 +38,6 @@ export const BoundaryContentPortal = memo(function BoundaryContentPortal({
35
38
  boundaryId,
36
39
  children,
37
40
  enabled,
38
- pointerEvents,
39
41
  }: BoundaryContentPortalProps) {
40
42
  const shouldEnablePortal = enabled && boundaryId !== undefined;
41
43
  const { teleportProps } = useBoundaryContentPortalAttachment({
@@ -48,7 +50,8 @@ export const BoundaryContentPortal = memo(function BoundaryContentPortal({
48
50
  <AnimatedNativePortal
49
51
  animatedProps={teleportProps}
50
52
  name={boundaryId}
51
- pointerEvents={pointerEvents}
53
+ pointerEvents={PORTAL_POINTER_EVENTS}
54
+ style={StyleSheet.absoluteFill}
52
55
  >
53
56
  {children}
54
57
  </AnimatedNativePortal>
@@ -10,6 +10,7 @@ import Animated from "react-native-reanimated";
10
10
  import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
11
11
  import { useScreenSlots } from "../../../../../../providers/screen/styles";
12
12
  import { SystemStore } from "../../../../../../stores/system.store";
13
+ import { PORTAL_POINTER_EVENTS } from "../../../teleport";
13
14
  import { useHostMeasurement } from "../hooks/use-host-measurement";
14
15
  import { registerHost, unregisterHost } from "../stores/host-registry.store";
15
16
  import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
@@ -74,7 +75,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
74
75
  ? activeBoundaryHosts.map((host) => (
75
76
  <View
76
77
  key={host.portalHostName}
77
- pointerEvents="none"
78
+ pointerEvents={PORTAL_POINTER_EVENTS}
78
79
  style={[
79
80
  styles.boundaryHostViewport,
80
81
  { width: viewportWidth, height: viewportHeight },
@@ -89,7 +90,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
89
90
  return (
90
91
  <Animated.View
91
92
  ref={measurement.hostRef}
92
- pointerEvents="none"
93
+ pointerEvents={PORTAL_POINTER_EVENTS}
93
94
  style={[
94
95
  styles.host,
95
96
  { width: viewportWidth, height: viewportHeight },
@@ -11,7 +11,7 @@ import {
11
11
  ScrollStore,
12
12
  } from "../../../../../../stores/scroll.store";
13
13
  import type { ScrollMeasuredDimensions } from "../../../../utils/measured-bounds";
14
- import { NativePortalHost } from "../../../teleport";
14
+ import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
15
15
  import { hasLocalSlot } from "../helpers/has-local-slot";
16
16
  import { resolvePortalOffsetStyle } from "../helpers/offset-style";
17
17
  import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
@@ -142,12 +142,13 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
142
142
 
143
143
  return (
144
144
  <Animated.View
145
- pointerEvents="none"
145
+ pointerEvents={PORTAL_POINTER_EVENTS}
146
146
  style={[style, hostStyle]}
147
147
  collapsable={false}
148
148
  >
149
149
  <AnimatedPortalBoundaryHost
150
150
  name={host.portalHostName}
151
+ pointerEvents={PORTAL_POINTER_EVENTS}
151
152
  style={[styles.content, contentFrameStyle, slotStyle]}
152
153
  />
153
154
  </Animated.View>
@@ -4,11 +4,12 @@ import {
4
4
  memo,
5
5
  type ReactNode,
6
6
  } from "react";
7
- import type { View, ViewProps } from "react-native";
7
+ import type { View } from "react-native";
8
8
  import Animated, { type AnimatedRef, runOnUI } from "react-native-reanimated";
9
9
  import { logger } from "../../../../../../utils/logger";
10
10
  import {
11
11
  isTeleportAvailable,
12
+ PORTAL_POINTER_EVENTS,
12
13
  NativePortal as TeleportPortal,
13
14
  } from "../../../teleport";
14
15
  import { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
@@ -31,7 +32,6 @@ type BoundaryPortalSlotProps = {
31
32
  children: ReactNode;
32
33
  enabled: boolean;
33
34
  animatedProps: any;
34
- pointerEvents?: ViewProps["pointerEvents"];
35
35
  placeholderRef?: AnimatedRef<View>;
36
36
  };
37
37
 
@@ -40,7 +40,6 @@ export const BoundaryPortalSlot = memo(function BoundaryPortalSlot({
40
40
  children,
41
41
  enabled,
42
42
  animatedProps,
43
- pointerEvents,
44
43
  placeholderRef,
45
44
  }: BoundaryPortalSlotProps) {
46
45
  const isPortalEnabled = enabled && isTeleportAvailable;
@@ -62,13 +61,13 @@ export const BoundaryPortalSlot = memo(function BoundaryPortalSlot({
62
61
  runOnUI(handleOnLayout)(layout)
63
62
  }
64
63
  style={placeholderStyle}
65
- pointerEvents={pointerEvents}
64
+ pointerEvents={PORTAL_POINTER_EVENTS}
66
65
  collapsable={false}
67
66
  >
68
67
  <AnimatedNativePortal
69
68
  animatedProps={animatedProps}
70
69
  name={id}
71
- pointerEvents={pointerEvents}
70
+ pointerEvents={PORTAL_POINTER_EVENTS}
72
71
  >
73
72
  {children}
74
73
  </AnimatedNativePortal>
@@ -227,7 +227,11 @@ export const useBoundaryPortalAttachment = ({
227
227
  "worklet";
228
228
 
229
229
  const slot = slotsMap.get()[boundaryId];
230
- const { teleport, ...slotProps } = slot?.props ?? {};
230
+ const {
231
+ pointerEvents: _pointerEvents,
232
+ teleport,
233
+ ...slotProps
234
+ } = slot?.props ?? {};
231
235
  const shouldTeleport = shouldAttachBoundaryPortal({
232
236
  enabled,
233
237
  teleport,
@@ -1,5 +1,5 @@
1
1
  import { memo, type ReactNode } from "react";
2
- import type { View, ViewProps } from "react-native";
2
+ import type { View } from "react-native";
3
3
  import type { AnimatedRef } from "react-native-reanimated";
4
4
  import { BoundaryPortalSlot } from "./components/portal-slot";
5
5
  import { useBoundaryPortalAttachment } from "./hooks/use-boundary-portal-attachment";
@@ -9,7 +9,6 @@ type BoundaryPortalProps = {
9
9
  children: ReactNode;
10
10
  enabled: boolean;
11
11
  placeholderRef?: AnimatedRef<View>;
12
- pointerEvents?: ViewProps["pointerEvents"];
13
12
  };
14
13
 
15
14
  export const BoundaryPortal = memo(function BoundaryPortal({
@@ -17,7 +16,6 @@ export const BoundaryPortal = memo(function BoundaryPortal({
17
16
  children,
18
17
  enabled,
19
18
  placeholderRef,
20
- pointerEvents,
21
19
  }: BoundaryPortalProps) {
22
20
  const { teleportProps } = useBoundaryPortalAttachment({
23
21
  boundaryId,
@@ -30,7 +28,6 @@ export const BoundaryPortal = memo(function BoundaryPortal({
30
28
  enabled={enabled}
31
29
  animatedProps={teleportProps}
32
30
  placeholderRef={placeholderRef}
33
- pointerEvents={pointerEvents}
34
31
  >
35
32
  {children}
36
33
  </BoundaryPortalSlot>
@@ -39,6 +39,7 @@ const SafeNativePortalProvider: ComponentType<{ children: ReactNode }> | null =
39
39
 
40
40
  export const isTeleportAvailable =
41
41
  mod !== null && SafeNativePortalProvider !== null;
42
+ export const PORTAL_POINTER_EVENTS = "box-none" as const;
42
43
  export const NativePortal: ComponentType<any> | null = mod?.Portal ?? null;
43
44
  export const NativePortalProvider: ComponentType<any> | null =
44
45
  SafeNativePortalProvider;
@@ -4,6 +4,7 @@ import {
4
4
  useCallback,
5
5
  useImperativeHandle,
6
6
  useMemo,
7
+ useRef,
7
8
  useState,
8
9
  } from "react";
9
10
  import type { View } from "react-native";
@@ -59,6 +60,7 @@ export type BoundaryRootRenderState = {
59
60
  attachedStyle: unknown;
60
61
  boundTag: BoundTag;
61
62
  currentScreenKey: string;
63
+ handoffEnabled: boolean;
62
64
  portalRuntime: BoundaryPortalRuntime;
63
65
  ref: AnimatedRef<View>;
64
66
  rootEscapePlaceholderRef: AnimatedRef<View>;
@@ -96,7 +98,7 @@ export const {
96
98
  id,
97
99
  style,
98
100
  }) => {
99
- const boundTag = useMemo(
101
+ const requestedBoundTag = useMemo(
100
102
  () => createBoundTag(String(id), group),
101
103
  [id, group],
102
104
  );
@@ -108,6 +110,21 @@ export const {
108
110
  const currentScreenKey = useDescriptorsStore(
109
111
  (s) => s.derivations.currentScreenKey,
110
112
  );
113
+ const currentActivity = useDescriptorsStore(
114
+ (s) => s.descriptors.current.activity,
115
+ );
116
+ const retainedBoundTagRef = useRef(requestedBoundTag);
117
+ const shouldRetainClosingBoundTag =
118
+ portalRuntime.handoff && currentActivity === "closing";
119
+
120
+ // Navigation can update a retained closing route's params before that
121
+ // route leaves the stack. Keep its handoff identity stable so the payload
122
+ // remains attached to the closing destination instead of being orphaned.
123
+ if (!shouldRetainClosingBoundTag) {
124
+ retainedBoundTagRef.current = requestedBoundTag;
125
+ }
126
+
127
+ const boundTag = retainedBoundTagRef.current;
111
128
  const hasConfiguredInterpolator = useDescriptorsStore(
112
129
  (s) => s.derivations.hasConfiguredInterpolator,
113
130
  );
@@ -183,6 +200,7 @@ export const {
183
200
 
184
201
  const shouldRenderBoundaryRootThroughPortal =
185
202
  shouldEscapeBoundaryRootToScreenHost && !hasActiveTarget;
203
+ const handoffEnabled = enabled && portalRuntime.handoff;
186
204
  // A nested active target takes the full associated style, so the root keeps
187
205
  // only its stacking context. Root-owned escape-clipping moves the root
188
206
  // through a screen host, so its associated style is applied through the
@@ -204,19 +222,21 @@ export const {
204
222
  activeTargetRef: targetEntry?.ref ?? null,
205
223
  boundTag,
206
224
  currentScreenKey,
225
+ handoffEnabled,
207
226
  portalRuntime,
208
227
  registerTargetRef,
209
228
  ref: rootRef,
210
229
  rootEscapePlaceholderRef,
211
230
  shouldRenderBoundaryRootThroughPortal,
212
- shouldRenderHandoffHost: enabled && portalRuntime.handoff,
231
+ shouldRenderHandoffHost: handoffEnabled && !hasActiveTarget,
213
232
  unregisterTargetRef,
214
233
  }),
215
234
  [
216
235
  attachedStyle,
217
236
  boundTag,
218
237
  currentScreenKey,
219
- enabled,
238
+ handoffEnabled,
239
+ hasActiveTarget,
220
240
  portalRuntime,
221
241
  registerTargetRef,
222
242
  rootRef,
@@ -53,12 +53,16 @@ const DEFAULT_GESTURE_VALUES = {
53
53
  velocity: 0,
54
54
  focalX: 0,
55
55
  focalY: 0,
56
+ pinchOriginX: 0,
57
+ pinchOriginY: 0,
56
58
  raw: DEFAULT_RAW_GESTURE_VALUES,
57
59
  handoff: {
58
60
  ...DEFAULT_RAW_GESTURE_VALUES,
59
61
  velocity: 0,
60
62
  focalX: 0,
61
63
  focalY: 0,
64
+ pinchOriginX: 0,
65
+ pinchOriginY: 0,
62
66
  raw: DEFAULT_RAW_GESTURE_VALUES,
63
67
  active: null,
64
68
  direction: null,
@@ -63,6 +63,8 @@ export type {
63
63
  BoundsNavigationAccessor,
64
64
  BoundsNavigationRevealOptions,
65
65
  BoundsNavigationRevealStyle,
66
+ BoundsNavigationZoomAxisResponse,
67
+ BoundsNavigationZoomDragOptions,
66
68
  BoundsNavigationZoomOpacityRange,
67
69
  BoundsNavigationZoomOpacityRanges,
68
70
  BoundsNavigationZoomOptions,
@@ -78,6 +78,8 @@ export const hydrateTransitionState = (
78
78
  out.gesture.normScale = s.gesture.normScale.get();
79
79
  out.gesture.focalX = s.gesture.focalX.get();
80
80
  out.gesture.focalY = s.gesture.focalY.get();
81
+ out.gesture.pinchOriginX = s.gesture.pinchOriginX.get();
82
+ out.gesture.pinchOriginY = s.gesture.pinchOriginY.get();
81
83
  out.gesture.rotation = s.gesture.rotation.get();
82
84
  out.gesture.raw.x = s.gesture.raw.x.get();
83
85
  out.gesture.raw.y = s.gesture.raw.y.get();
@@ -121,6 +123,12 @@ export const hydrateTransitionState = (
121
123
  handoff.focalY = useHandoffSnapshot
122
124
  ? s.gesture.internal.snapshot.focalY.get()
123
125
  : out.gesture.focalY;
126
+ handoff.pinchOriginX = useHandoffSnapshot
127
+ ? s.gesture.internal.snapshot.pinchOriginX.get()
128
+ : out.gesture.pinchOriginX;
129
+ handoff.pinchOriginY = useHandoffSnapshot
130
+ ? s.gesture.internal.snapshot.pinchOriginY.get()
131
+ : out.gesture.pinchOriginY;
124
132
  handoff.rotation = useHandoffSnapshot
125
133
  ? s.gesture.internal.snapshot.rotation.get()
126
134
  : out.gesture.rotation;
@@ -6,6 +6,7 @@ import type {
6
6
  import { type SharedValue, useSharedValue } from "react-native-reanimated";
7
7
  import { GestureStore } from "../../../../../stores/gesture.store";
8
8
  import { GestureActivationState } from "../../../../../types/gesture.types";
9
+ import type { Direction } from "../../../../../types/ownership.types";
9
10
  import { useDescriptorDerivations } from "../../../descriptors";
10
11
  import type { ScreenOptionsContextValue } from "../../../options";
11
12
  import { resolvePanRuntime } from "../../shared/runtime";
@@ -47,6 +48,7 @@ export const usePanActivation = ({
47
48
  const gestureActivationState = useSharedValue<GestureActivationState>(
48
49
  GestureActivationState.PENDING,
49
50
  );
51
+ const pendingDirection = useSharedValue<Direction | null>(null);
50
52
 
51
53
  const onTouchesDown = useCallback(
52
54
  (
@@ -61,6 +63,7 @@ export const usePanActivation = ({
61
63
 
62
64
  if (!participation.canTrackGesture) {
63
65
  gestureActivationState.set(GestureActivationState.FAILED);
66
+ pendingDirection.set(null);
64
67
  stateManager?.fail();
65
68
  return;
66
69
  }
@@ -68,8 +71,15 @@ export const usePanActivation = ({
68
71
  const firstTouch = event.changedTouches[0];
69
72
  initialTouch.set({ x: firstTouch.x, y: firstTouch.y });
70
73
  gestureActivationState.set(GestureActivationState.PENDING);
74
+ pendingDirection.set(null);
71
75
  },
72
- [gestureActivationState, initialTouch, runtime, screenOptions],
76
+ [
77
+ gestureActivationState,
78
+ initialTouch,
79
+ pendingDirection,
80
+ runtime,
81
+ screenOptions,
82
+ ],
73
83
  );
74
84
 
75
85
  const onTouchesMove = useCallback(
@@ -110,6 +120,7 @@ export const usePanActivation = ({
110
120
  }
111
121
 
112
122
  if (decision.action === "fail") {
123
+ pendingDirection.set(null);
113
124
  stateManager.fail();
114
125
  return;
115
126
  }
@@ -119,12 +130,9 @@ export const usePanActivation = ({
119
130
  }
120
131
 
121
132
  if (decision.direction) {
122
- const { gestures } = resolvedRuntime.stores;
123
- gestures.active.set(decision.direction);
124
- gestures.direction.set(decision.direction);
133
+ pendingDirection.set(decision.direction);
125
134
  }
126
135
 
127
- gestureCompositionOwner.set("pan");
128
136
  stateManager.activate();
129
137
  },
130
138
  [
@@ -134,6 +142,7 @@ export const usePanActivation = ({
134
142
  dimensions,
135
143
  gestureActivationState,
136
144
  initialTouch,
145
+ pendingDirection,
137
146
  runtime,
138
147
  screenOptions,
139
148
  scrollState,
@@ -142,7 +151,7 @@ export const usePanActivation = ({
142
151
  );
143
152
 
144
153
  return useMemo(
145
- () => ({ onTouchesDown, onTouchesMove }),
146
- [onTouchesDown, onTouchesMove],
154
+ () => ({ onTouchesDown, onTouchesMove, pendingDirection }),
155
+ [onTouchesDown, onTouchesMove, pendingDirection],
147
156
  );
148
157
  };
@@ -1,6 +1,7 @@
1
1
  import { useCallback, useMemo } from "react";
2
2
  import type { SharedValue } from "react-native-reanimated";
3
3
  import { useNavigationHelpers } from "../../../../../hooks/navigation/use-navigation-helpers";
4
+ import type { Direction } from "../../../../../types/ownership.types";
4
5
  import type { ScreenOptionsContextValue } from "../../../options";
5
6
  import { usePanGestureSensitivity } from "../../hooks/use-gesture-sensitivity";
6
7
  import { resolvePanRuntime } from "../../shared/runtime";
@@ -28,6 +29,7 @@ export const usePanBehavior = (
28
29
  screenOptions: ScreenOptionsContextValue,
29
30
  dimensions: GestureDimensions,
30
31
  gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
32
+ pendingDirection: SharedValue<Direction | null>,
31
33
  ): PanBehavior => {
32
34
  const { dismissScreen, requestDismiss } = useNavigationHelpers();
33
35
  const { withSensitivity, resetSensitivity } =
@@ -38,16 +40,31 @@ export const usePanBehavior = (
38
40
  const latestRuntime = resolvePanRuntime(runtime.get(), screenOptions.get());
39
41
  if (gestureCompositionOwner.get() === "pinch") {
40
42
  clearPanTrackingValues(latestRuntime.stores.gestures);
43
+ pendingDirection.set(null);
41
44
  resetSensitivity();
42
45
  return;
43
46
  }
44
47
 
48
+ const direction = pendingDirection.get();
49
+ if (direction) {
50
+ latestRuntime.stores.gestures.active.set(direction);
51
+ latestRuntime.stores.gestures.direction.set(direction);
52
+ }
53
+ pendingDirection.set(null);
54
+ gestureCompositionOwner.set("pan");
55
+
45
56
  if (latestRuntime.participation.effectiveSnapPoints.hasSnapPoints) {
46
57
  primeSnapPanRelease(latestRuntime);
47
58
  }
48
59
  startPanBase(latestRuntime);
49
60
  resetSensitivity();
50
- }, [runtime, screenOptions, resetSensitivity, gestureCompositionOwner]);
61
+ }, [
62
+ runtime,
63
+ screenOptions,
64
+ resetSensitivity,
65
+ gestureCompositionOwner,
66
+ pendingDirection,
67
+ ]);
51
68
 
52
69
  const onUpdate = useCallback(
53
70
  (rawEvent: PanGestureEvent) => {
@@ -50,6 +50,7 @@ export const useBuildPanGesture = ({
50
50
  screenOptions,
51
51
  dimensions,
52
52
  gestureCompositionOwner,
53
+ activation.pendingDirection,
53
54
  );
54
55
 
55
56
  const panGesture = useMemo(() => {
@@ -4,10 +4,36 @@ import type {
4
4
  GestureTouchEvent,
5
5
  } from "react-native-gesture-handler";
6
6
  import type { SharedValue } from "react-native-reanimated";
7
+ import type { GestureStoreMap } from "../../../../../stores/gesture.store";
7
8
  import type { ScreenOptionsContextValue } from "../../../options";
8
9
  import { resolvePinchRuntime } from "../../shared/runtime";
9
10
  import type { GestureCompositionOwner, PinchGestureRuntime } from "../../types";
10
11
 
12
+ export const updateAbsolutePinchFocalPoint = (
13
+ event: GestureTouchEvent,
14
+ gestures: GestureStoreMap,
15
+ captureOrigin: boolean,
16
+ ) => {
17
+ "worklet";
18
+ const firstTouch = event.allTouches[0];
19
+ const secondTouch = event.allTouches[1];
20
+
21
+ if (!firstTouch || !secondTouch) {
22
+ return;
23
+ }
24
+
25
+ const focalX = (firstTouch.absoluteX + secondTouch.absoluteX) / 2;
26
+ const focalY = (firstTouch.absoluteY + secondTouch.absoluteY) / 2;
27
+
28
+ gestures.focalX.set(focalX);
29
+ gestures.focalY.set(focalY);
30
+
31
+ if (captureOrigin) {
32
+ gestures.pinchOriginX.set(focalX);
33
+ gestures.pinchOriginY.set(focalY);
34
+ }
35
+ };
36
+
11
37
  interface UsePinchActivationProps {
12
38
  runtime: SharedValue<PinchGestureRuntime>;
13
39
  screenOptions: ScreenOptionsContextValue;
@@ -25,10 +51,11 @@ export const usePinchActivation = ({
25
51
  stateManager: GestureStateManager | undefined,
26
52
  ) => {
27
53
  "worklet";
28
- const { participation, policy } = resolvePinchRuntime(
54
+ const latestRuntime = resolvePinchRuntime(
29
55
  runtime.get(),
30
56
  screenOptions.get(),
31
57
  );
58
+ const { participation, policy } = latestRuntime;
32
59
 
33
60
  if (!participation.canTrackGesture || !policy.enabled) {
34
61
  stateManager?.fail();
@@ -36,6 +63,11 @@ export const usePinchActivation = ({
36
63
  }
37
64
 
38
65
  if (event.numberOfTouches === 2) {
66
+ updateAbsolutePinchFocalPoint(
67
+ event,
68
+ latestRuntime.stores.gestures,
69
+ true,
70
+ );
39
71
  if (gestureCompositionOwner.get() === null) {
40
72
  gestureCompositionOwner.set("pinch");
41
73
  }
@@ -53,10 +85,11 @@ export const usePinchActivation = ({
53
85
  const onTouchesMove = useCallback(
54
86
  (event: GestureTouchEvent, stateManager: GestureStateManager) => {
55
87
  "worklet";
56
- const { participation, policy } = resolvePinchRuntime(
88
+ const latestRuntime = resolvePinchRuntime(
57
89
  runtime.get(),
58
90
  screenOptions.get(),
59
91
  );
92
+ const { participation, policy } = latestRuntime;
60
93
 
61
94
  if (!participation.canTrackGesture || !policy.enabled) {
62
95
  stateManager.fail();
@@ -64,6 +97,11 @@ export const usePinchActivation = ({
64
97
  }
65
98
 
66
99
  if (event.numberOfTouches === 2) {
100
+ updateAbsolutePinchFocalPoint(
101
+ event,
102
+ latestRuntime.stores.gestures,
103
+ false,
104
+ );
67
105
  if (gestureCompositionOwner.get() === null) {
68
106
  gestureCompositionOwner.set("pinch");
69
107
  }
@@ -13,10 +13,7 @@ import type {
13
13
  } from "../../types";
14
14
  import { resetPinchGestureValues } from "./pinch-reset";
15
15
 
16
- export const startPinchBase = (
17
- runtime: PinchGestureRuntime,
18
- event: PinchGestureEvent,
19
- ) => {
16
+ export const startPinchBase = (runtime: PinchGestureRuntime) => {
20
17
  "worklet";
21
18
  const {
22
19
  stores: { gestures, animations },
@@ -38,8 +35,6 @@ export const startPinchBase = (
38
35
  gestures.direction.set(null);
39
36
  gestures.velocity.set(0);
40
37
  clearTransformTrackingValues(gestures);
41
- gestures.focalX.set(event.focalX);
42
- gestures.focalY.set(event.focalY);
43
38
  gestures.internal.progressBaseline.set(animations.transitionProgress.get());
44
39
  };
45
40
 
@@ -56,13 +51,14 @@ export const trackPinchGesture = (
56
51
 
57
52
  gestures.scale.set(scale);
58
53
  gestures.normScale.set(normScale);
59
- gestures.focalX.set(event.focalX);
60
- gestures.focalY.set(event.focalY);
61
54
  gestures.raw.scale.set(rawScale);
62
55
  gestures.raw.normScale.set(rawNormScale);
63
- gestures.active.set(
64
- normScale < 0 ? "pinch-in" : normScale > 0 ? "pinch-out" : null,
65
- );
56
+
57
+ if (gestures.active.get() === null) {
58
+ gestures.active.set(
59
+ normScale < 0 ? "pinch-in" : normScale > 0 ? "pinch-out" : null,
60
+ );
61
+ }
66
62
 
67
63
  return {
68
64
  scale,