react-native-screen-transitions 3.6.0-alpha.1 → 3.6.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/lib/commonjs/component-stack/components/component-screen.js +1 -7
  2. package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
  3. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +27 -34
  4. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +17 -19
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +27 -7
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +23 -51
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  15. package/lib/commonjs/shared/components/create-boundary-component/index.js +3 -1
  16. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  17. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +75 -0
  18. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
  19. package/lib/commonjs/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +15 -2
  20. package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
  21. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +103 -0
  22. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
  23. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +52 -0
  24. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
  25. package/lib/commonjs/shared/components/native-screen.js +2 -13
  26. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  27. package/lib/commonjs/shared/constants.js +2 -7
  28. package/lib/commonjs/shared/constants.js.map +1 -1
  29. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +35 -0
  30. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
  31. package/lib/commonjs/shared/providers/register-bounds.provider.js +48 -55
  32. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -6
  36. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  38. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
  39. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js +9 -2
  41. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
  42. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js +19 -0
  43. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
  44. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js +2 -2
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
  48. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js +2 -2
  49. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
  51. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +2 -2
  53. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +18 -2
  55. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  56. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +1 -5
  57. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
  59. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  60. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +125 -0
  61. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
  62. package/lib/commonjs/shared/stores/bounds/index.js +6 -12
  63. package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
  64. package/lib/commonjs/shared/stores/bounds/internals/clear.js +13 -21
  65. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  66. package/lib/commonjs/shared/stores/bounds/internals/entries.js +49 -9
  67. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  68. package/lib/commonjs/shared/stores/bounds/internals/links.js +143 -82
  69. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  70. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +17 -43
  71. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  72. package/lib/commonjs/shared/stores/bounds/internals/state.js +26 -3
  73. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  74. package/lib/commonjs/shared/stores/gesture.store.js +2 -0
  75. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  76. package/lib/commonjs/shared/types/gesture.types.js +2 -2
  77. package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
  78. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
  79. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
  81. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
  83. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +23 -0
  85. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
  86. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +91 -199
  87. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  88. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +15 -2
  89. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  90. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +155 -14
  91. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  92. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
  93. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
  94. package/lib/module/component-stack/components/component-screen.js +2 -8
  95. package/lib/module/component-stack/components/component-screen.js.map +1 -1
  96. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +27 -34
  97. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  98. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
  99. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +18 -20
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +28 -8
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
  104. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +22 -50
  105. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  106. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
  107. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  108. package/lib/module/shared/components/create-boundary-component/index.js +3 -1
  109. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  110. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +70 -0
  111. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
  112. package/lib/module/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +13 -1
  113. package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
  114. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +98 -0
  115. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
  116. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +47 -0
  117. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
  118. package/lib/module/shared/components/native-screen.js +3 -14
  119. package/lib/module/shared/components/native-screen.js.map +1 -1
  120. package/lib/module/shared/constants.js +1 -6
  121. package/lib/module/shared/constants.js.map +1 -1
  122. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +30 -0
  123. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
  124. package/lib/module/shared/providers/register-bounds.provider.js +48 -55
  125. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  126. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
  127. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  128. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -1
  129. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  130. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  131. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
  132. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
  133. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js +10 -3
  134. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
  135. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js +20 -1
  136. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
  137. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
  138. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
  139. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +3 -3
  140. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
  141. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js +3 -3
  142. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
  143. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
  144. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
  145. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +3 -3
  146. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
  147. package/lib/module/shared/providers/screen/gestures/shared/physics.js +15 -0
  148. package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  149. package/lib/module/shared/providers/screen/gestures/shared/policy.js +3 -3
  150. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  151. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
  152. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  153. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +105 -0
  154. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
  155. package/lib/module/shared/stores/bounds/index.js +7 -13
  156. package/lib/module/shared/stores/bounds/index.js.map +1 -1
  157. package/lib/module/shared/stores/bounds/internals/clear.js +14 -22
  158. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  159. package/lib/module/shared/stores/bounds/internals/entries.js +49 -9
  160. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  161. package/lib/module/shared/stores/bounds/internals/links.js +139 -80
  162. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  163. package/lib/module/shared/stores/bounds/internals/resolver.js +17 -43
  164. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  165. package/lib/module/shared/stores/bounds/internals/state.js +25 -2
  166. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  167. package/lib/module/shared/stores/gesture.store.js +2 -0
  168. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  169. package/lib/module/shared/types/animation.types.js +0 -4
  170. package/lib/module/shared/types/animation.types.js.map +1 -1
  171. package/lib/module/shared/types/gesture.types.js +0 -1
  172. package/lib/module/shared/types/gesture.types.js.map +1 -1
  173. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
  174. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  175. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
  176. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  177. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
  178. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  179. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +18 -0
  180. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
  181. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +90 -198
  182. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  183. package/lib/module/shared/utils/bounds/navigation/reveal/config.js +14 -1
  184. package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  185. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +144 -12
  186. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  187. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
  188. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
  189. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  190. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +1 -0
  191. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts +1 -1
  193. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts +5 -4
  195. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  196. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts +6 -2
  197. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts +5 -4
  199. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
  200. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +7 -7
  201. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
  202. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +11 -7
  204. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts +10 -0
  206. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +1 -0
  207. package/lib/typescript/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.d.ts → utils/measured-bounds.d.ts} +3 -2
  208. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +1 -0
  209. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts +22 -0
  210. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts +16 -0
  212. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  214. package/lib/typescript/shared/constants.d.ts +0 -5
  215. package/lib/typescript/shared/constants.d.ts.map +1 -1
  216. package/lib/typescript/shared/index.d.ts +1 -1
  217. package/lib/typescript/shared/index.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +21 -0
  219. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -0
  220. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  221. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  222. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts +0 -1
  223. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  224. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +1 -1
  225. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  226. package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +1 -1
  227. package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +1 -1
  228. package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +1 -1
  229. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts +2 -1
  230. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +1 -1
  231. package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +1 -1
  232. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +1 -1
  233. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +1 -1
  234. package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +1 -1
  235. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +7 -0
  236. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts.map +1 -1
  237. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +0 -10
  238. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  239. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +2 -0
  240. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  242. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +18 -0
  243. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -0
  244. package/lib/typescript/shared/stores/bounds/index.d.ts +6 -12
  245. package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  247. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  248. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +13 -10
  249. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  250. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  251. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +26 -5
  252. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  253. package/lib/typescript/shared/stores/bounds/types.d.ts +14 -7
  254. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  255. package/lib/typescript/shared/stores/gesture.store.d.ts +1 -0
  256. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  257. package/lib/typescript/shared/types/animation.types.d.ts +0 -18
  258. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  259. package/lib/typescript/shared/types/gesture.types.d.ts +8 -1
  260. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  261. package/lib/typescript/shared/types/index.d.ts +1 -1
  262. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  263. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  264. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  265. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +1 -1
  266. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  267. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts +4 -0
  268. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -0
  269. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  270. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +14 -1
  271. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
  272. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +48 -7
  273. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  274. package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -3
  275. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  276. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts +3 -2
  277. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +1 -1
  278. package/package.json +1 -1
  279. package/src/component-stack/components/component-screen.tsx +3 -11
  280. package/src/shared/components/create-boundary-component/create-boundary-component.tsx +30 -27
  281. package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +5 -5
  282. package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +25 -24
  283. package/src/shared/components/create-boundary-component/hooks/use-initial-source-measurement.ts +41 -11
  284. package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +49 -64
  285. package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +44 -83
  286. package/src/shared/components/create-boundary-component/index.tsx +3 -1
  287. package/src/shared/components/create-boundary-component/types.ts +13 -11
  288. package/src/shared/components/create-boundary-component/utils/destination-signals.ts +129 -0
  289. package/src/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.ts → utils/measured-bounds.ts} +25 -1
  290. package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +164 -0
  291. package/src/shared/components/create-boundary-component/utils/source-signals.ts +72 -0
  292. package/src/shared/components/native-screen.tsx +3 -12
  293. package/src/shared/constants.ts +1 -6
  294. package/src/shared/index.ts +0 -3
  295. package/src/shared/providers/helpers/measured-bounds-writes.ts +67 -0
  296. package/src/shared/providers/register-bounds.provider.tsx +68 -91
  297. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +0 -14
  298. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +1 -2
  299. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -4
  300. package/src/shared/providers/screen/gestures/pan/pan-activation.ts +4 -1
  301. package/src/shared/providers/screen/gestures/pan/pan-lifecycle.ts +18 -2
  302. package/src/shared/providers/screen/gestures/pan/pan-release.ts +33 -0
  303. package/src/shared/providers/screen/gestures/pan/pan-reset.ts +3 -0
  304. package/src/shared/providers/screen/gestures/pan/use-pan-behavior.ts +9 -6
  305. package/src/shared/providers/screen/gestures/pinch/pinch-activation.ts +5 -2
  306. package/src/shared/providers/screen/gestures/pinch/pinch-lifecycle.ts +1 -0
  307. package/src/shared/providers/screen/gestures/pinch/use-pinch-behavior.ts +9 -6
  308. package/src/shared/providers/screen/gestures/shared/physics.ts +25 -0
  309. package/src/shared/providers/screen/gestures/shared/policy.ts +3 -5
  310. package/src/shared/providers/screen/gestures/types.ts +2 -0
  311. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +0 -3
  312. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +161 -0
  313. package/src/shared/stores/bounds/index.ts +10 -20
  314. package/src/shared/stores/bounds/internals/clear.ts +17 -41
  315. package/src/shared/stores/bounds/internals/entries.ts +56 -13
  316. package/src/shared/stores/bounds/internals/links.ts +222 -113
  317. package/src/shared/stores/bounds/internals/resolver.ts +23 -87
  318. package/src/shared/stores/bounds/internals/state.ts +27 -5
  319. package/src/shared/stores/bounds/types.ts +17 -7
  320. package/src/shared/stores/gesture.store.ts +3 -0
  321. package/src/shared/types/animation.types.ts +0 -23
  322. package/src/shared/types/gesture.types.ts +8 -2
  323. package/src/shared/types/index.ts +0 -4
  324. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +1 -0
  325. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +6 -6
  326. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +20 -11
  327. package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +22 -0
  328. package/src/shared/utils/bounds/navigation/reveal/build.ts +153 -297
  329. package/src/shared/utils/bounds/navigation/reveal/config.ts +20 -1
  330. package/src/shared/utils/bounds/navigation/reveal/math.ts +234 -18
  331. package/src/shared/utils/bounds/types/options.ts +2 -3
  332. package/src/shared/utils/navigation/resolve-scene-neighbors.ts +36 -23
  333. package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -43
  334. package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
  335. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -17
  336. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
  337. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -28
  338. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
  339. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -75
  340. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
  341. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -20
  342. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
  343. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
  344. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -16
  345. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
  346. package/lib/commonjs/shared/providers/layout-anchor.provider.js +0 -86
  347. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +0 -1
  348. package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js +0 -49
  349. package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
  350. package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js +0 -25
  351. package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js.map +0 -1
  352. package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js +0 -30
  353. package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
  354. package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js +0 -79
  355. package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
  356. package/lib/commonjs/shared/stores/bounds/helpers/matching.js +0 -13
  357. package/lib/commonjs/shared/stores/bounds/helpers/matching.js.map +0 -1
  358. package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js +0 -30
  359. package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
  360. package/lib/commonjs/shared/stores/bounds/internals/groups.js +0 -102
  361. package/lib/commonjs/shared/stores/bounds/internals/groups.js.map +0 -1
  362. package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -38
  363. package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
  364. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -12
  365. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
  366. package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -23
  367. package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
  368. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -68
  369. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
  370. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -15
  371. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
  372. package/lib/module/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
  373. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -12
  374. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
  375. package/lib/module/shared/providers/layout-anchor.provider.js +0 -80
  376. package/lib/module/shared/providers/layout-anchor.provider.js.map +0 -1
  377. package/lib/module/shared/stores/bounds/helpers/entries.helpers.js +0 -42
  378. package/lib/module/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
  379. package/lib/module/shared/stores/bounds/helpers/find-latest.js +0 -19
  380. package/lib/module/shared/stores/bounds/helpers/find-latest.js.map +0 -1
  381. package/lib/module/shared/stores/bounds/helpers/groups.helpers.js +0 -23
  382. package/lib/module/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
  383. package/lib/module/shared/stores/bounds/helpers/link.helpers.js +0 -69
  384. package/lib/module/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
  385. package/lib/module/shared/stores/bounds/helpers/matching.js +0 -9
  386. package/lib/module/shared/stores/bounds/helpers/matching.js.map +0 -1
  387. package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js +0 -24
  388. package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
  389. package/lib/module/shared/stores/bounds/internals/groups.js +0 -95
  390. package/lib/module/shared/stores/bounds/internals/groups.js.map +0 -1
  391. package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts +0 -15
  392. package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts.map +0 -1
  393. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts +0 -2
  394. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +0 -1
  395. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts +0 -22
  396. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts.map +0 -1
  397. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +0 -29
  398. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +0 -1
  399. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts +0 -3
  400. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts.map +0 -1
  401. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.d.ts.map +0 -1
  402. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -8
  403. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +0 -1
  404. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +0 -39
  405. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +0 -1
  406. package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts +0 -5
  407. package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts.map +0 -1
  408. package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts +0 -3
  409. package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts.map +0 -1
  410. package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts +0 -10
  411. package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts.map +0 -1
  412. package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts +0 -14
  413. package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts.map +0 -1
  414. package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts +0 -3
  415. package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts.map +0 -1
  416. package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts +0 -5
  417. package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts.map +0 -1
  418. package/lib/typescript/shared/stores/bounds/internals/groups.d.ts +0 -16
  419. package/lib/typescript/shared/stores/bounds/internals/groups.d.ts.map +0 -1
  420. package/src/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.ts +0 -83
  421. package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +0 -20
  422. package/src/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.ts +0 -48
  423. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +0 -101
  424. package/src/shared/components/create-boundary-component/hooks/helpers/measurement.ts +0 -25
  425. package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +0 -14
  426. package/src/shared/providers/layout-anchor.provider.tsx +0 -112
  427. package/src/shared/stores/bounds/helpers/entries.helpers.ts +0 -55
  428. package/src/shared/stores/bounds/helpers/find-latest.ts +0 -22
  429. package/src/shared/stores/bounds/helpers/groups.helpers.ts +0 -27
  430. package/src/shared/stores/bounds/helpers/link.helpers.ts +0 -131
  431. package/src/shared/stores/bounds/helpers/matching.ts +0 -11
  432. package/src/shared/stores/bounds/helpers/tag-state.helpers.ts +0 -24
  433. package/src/shared/stores/bounds/internals/groups.ts +0 -116
@@ -128,5 +128,8 @@ export const usePanActivation = ({
128
128
  ],
129
129
  );
130
130
 
131
- return { onTouchesDown, onTouchesMove };
131
+ return useMemo(
132
+ () => ({ onTouchesDown, onTouchesMove }),
133
+ [onTouchesDown, onTouchesMove],
134
+ );
132
135
  };
@@ -2,7 +2,10 @@ import { clamp } from "react-native-reanimated";
2
2
  import { EPSILON, FALSE, TRUE } from "../../../../constants";
3
3
  import { animateToProgress } from "../../../../utils/animation/animate-to-progress";
4
4
  import { emit } from "../../../../utils/animation/emit";
5
- import { normalizeGestureTranslation } from "../shared/physics";
5
+ import {
6
+ normalizeGestureTranslation,
7
+ resolveGestureVelocity,
8
+ } from "../shared/physics";
6
9
  import type {
7
10
  GestureDimensions,
8
11
  PanGestureEvent,
@@ -36,6 +39,7 @@ export const startPanBase = (runtime: PanGestureRuntime) => {
36
39
  gestures.y.set(0);
37
40
  gestures.normX.set(0);
38
41
  gestures.normY.set(0);
42
+ gestures.velocity.set(0);
39
43
  gestures.raw.x.set(0);
40
44
  gestures.raw.y.set(0);
41
45
  gestures.raw.normX.set(0);
@@ -51,18 +55,28 @@ export const trackPanGesture = (
51
55
  ): PanTrackState => {
52
56
  "worklet";
53
57
  const { translationX: x, translationY: y } = event;
54
- const { translationX: rawX, translationY: rawY } = rawEvent;
58
+ const {
59
+ translationX: rawX,
60
+ translationY: rawY,
61
+ velocityX,
62
+ velocityY,
63
+ } = rawEvent;
55
64
  const { width, height } = dimensions;
56
65
 
57
66
  const normX = clamp(normalizeGestureTranslation(x, width), -1, 1);
58
67
  const normY = clamp(normalizeGestureTranslation(y, height), -1, 1);
59
68
  const rawNormX = clamp(normalizeGestureTranslation(rawX, width), -1, 1);
60
69
  const rawNormY = clamp(normalizeGestureTranslation(rawY, height), -1, 1);
70
+ const velocity = resolveGestureVelocity(
71
+ velocityX / Math.max(1, width),
72
+ velocityY / Math.max(1, height),
73
+ );
61
74
 
62
75
  gestures.x.set(x);
63
76
  gestures.y.set(y);
64
77
  gestures.normX.set(normX);
65
78
  gestures.normY.set(normY);
79
+ gestures.velocity.set(velocity);
66
80
  gestures.raw.x.set(rawX);
67
81
  gestures.raw.y.set(rawY);
68
82
  gestures.raw.normX.set(rawNormX);
@@ -73,6 +87,7 @@ export const trackPanGesture = (
73
87
  y,
74
88
  normX,
75
89
  normY,
90
+ velocity,
76
91
  };
77
92
  };
78
93
 
@@ -102,6 +117,7 @@ export const finalizePanRelease = (
102
117
  velocityY: plan.resetVelocityY,
103
118
  velocityNormX: plan.resetVelocityNormX,
104
119
  velocityNormY: plan.resetVelocityNormY,
120
+ releaseVelocity: plan.releaseVelocity,
105
121
  resetNormalizedValues: plan.resetNormalizedValues,
106
122
  resetNormalizedValuesImmediately: plan.resetNormalizedValuesImmediately,
107
123
  preserveRawValues: plan.preserveRawValues,
@@ -6,6 +6,7 @@ import {
6
6
  import {
7
7
  getPanReleaseHandoffVelocity,
8
8
  getPanReleaseProgressVelocity,
9
+ resolveGestureVelocity,
9
10
  } from "../shared/physics";
10
11
  import {
11
12
  getProgressVelocityTowardTarget,
@@ -24,6 +25,26 @@ import type {
24
25
  PanReleaseResult,
25
26
  } from "../types";
26
27
 
28
+ const resolvePanReleaseVelocity = (
29
+ runtime: PanGestureRuntime,
30
+ velocityNormX: number,
31
+ velocityNormY: number,
32
+ ) => {
33
+ "worklet";
34
+ const activeGesture = runtime.stores.gestures.active.get();
35
+
36
+ switch (activeGesture) {
37
+ case "horizontal":
38
+ case "horizontal-inverted":
39
+ return resolveGestureVelocity(velocityNormX, 0);
40
+ case "vertical":
41
+ case "vertical-inverted":
42
+ return resolveGestureVelocity(0, velocityNormY);
43
+ default:
44
+ return resolveGestureVelocity(velocityNormX, velocityNormY);
45
+ }
46
+ };
47
+
27
48
  const resolveActivePanSnapAxis = (runtime: PanGestureRuntime) => {
28
49
  "worklet";
29
50
  const activeGesture = runtime.stores.gestures.active.get();
@@ -226,6 +247,17 @@ export const buildPanReleasePlan = (
226
247
  resetVelocityScale === 0 ? 0 : rawEvent.velocityX * resetVelocityScale;
227
248
  const resetVelocityY =
228
249
  resetVelocityScale === 0 ? 0 : rawEvent.velocityY * resetVelocityScale;
250
+ const releaseVelocityNormX =
251
+ rawEvent.velocityX / Math.max(1, dimensions.width);
252
+ const releaseVelocityNormY =
253
+ rawEvent.velocityY / Math.max(1, dimensions.height);
254
+ const releaseVelocity = release.shouldDismiss
255
+ ? resolvePanReleaseVelocity(
256
+ runtime,
257
+ releaseVelocityNormX,
258
+ releaseVelocityNormY,
259
+ )
260
+ : 0;
229
261
 
230
262
  return {
231
263
  target: release.target,
@@ -235,6 +267,7 @@ export const buildPanReleasePlan = (
235
267
  resetVelocityY,
236
268
  resetVelocityNormX: resetVelocityX / Math.max(1, dimensions.width),
237
269
  resetVelocityNormY: resetVelocityY / Math.max(1, dimensions.height),
270
+ releaseVelocity,
238
271
  resetNormalizedValues: !release.shouldDismiss || progressDriven,
239
272
  resetNormalizedValuesImmediately:
240
273
  release.resetNormalizedValuesImmediately === true,
@@ -15,6 +15,7 @@ interface ResetPanGestureValuesProps {
15
15
  velocityY?: number;
16
16
  velocityNormX?: number;
17
17
  velocityNormY?: number;
18
+ releaseVelocity?: number;
18
19
  resetNormalizedValues?: boolean;
19
20
  resetNormalizedValuesImmediately?: boolean;
20
21
  preserveRawValues?: boolean;
@@ -42,6 +43,7 @@ export const resetPanGestureValues = ({
42
43
  velocityY,
43
44
  velocityNormX,
44
45
  velocityNormY,
46
+ releaseVelocity,
45
47
  resetNormalizedValues = true,
46
48
  resetNormalizedValuesImmediately = false,
47
49
  preserveRawValues = shouldDismiss,
@@ -58,6 +60,7 @@ export const resetPanGestureValues = ({
58
60
  gestures.dragging.set(FALSE);
59
61
  gestures.dismissing.set(shouldDismiss ? TRUE : FALSE);
60
62
  gestures.settling.set(shouldDismiss ? FALSE : TRUE);
63
+ gestures.velocity.set(shouldDismiss ? (releaseVelocity ?? 0) : 0);
61
64
 
62
65
  animateResetValue(gestures.x, 0, getGestureResetSpec(spec, velocityX), () =>
63
66
  clearPanSettlingIfResting(gestures),
@@ -1,4 +1,4 @@
1
- import { useCallback } from "react";
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
4
  import type { ScreenOptionsContextValue } from "../../options";
@@ -81,9 +81,12 @@ export const usePanBehavior = (
81
81
  [runtime, screenOptions, dimensions, dismissScreen, withSensitivity],
82
82
  );
83
83
 
84
- return {
85
- onStart,
86
- onUpdate,
87
- onEnd,
88
- };
84
+ return useMemo(
85
+ () => ({
86
+ onStart,
87
+ onUpdate,
88
+ onEnd,
89
+ }),
90
+ [onStart, onUpdate, onEnd],
91
+ );
89
92
  };
@@ -1,4 +1,4 @@
1
- import { useCallback } from "react";
1
+ import { useCallback, useMemo } from "react";
2
2
  import type {
3
3
  GestureStateManager,
4
4
  GestureTouchEvent,
@@ -68,5 +68,8 @@ export const usePinchActivation = ({
68
68
  [runtime, screenOptions],
69
69
  );
70
70
 
71
- return { onTouchesDown, onTouchesMove };
71
+ return useMemo(
72
+ () => ({ onTouchesDown, onTouchesMove }),
73
+ [onTouchesDown, onTouchesMove],
74
+ );
72
75
  };
@@ -33,6 +33,7 @@ export const startPinchBase = (
33
33
  gestures.settling.set(0);
34
34
  gestures.active.set(null);
35
35
  gestures.direction.set(null);
36
+ gestures.velocity.set(0);
36
37
  gestures.scale.set(1);
37
38
  gestures.normScale.set(0);
38
39
  gestures.raw.scale.set(1);
@@ -1,4 +1,4 @@
1
- import { useCallback } from "react";
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
4
  import type { ScreenOptionsContextValue } from "../../options";
@@ -74,9 +74,12 @@ export const usePinchBehavior = (
74
74
  [runtime, screenOptions, dismissScreen, withSensitivity],
75
75
  );
76
76
 
77
- return {
78
- onStart,
79
- onUpdate,
80
- onEnd,
81
- };
77
+ return useMemo(
78
+ () => ({
79
+ onStart,
80
+ onUpdate,
81
+ onEnd,
82
+ }),
83
+ [onStart, onUpdate, onEnd],
84
+ );
82
85
  };
@@ -18,6 +18,8 @@ type GestureAxisCandidate = {
18
18
  velocityContribution: number;
19
19
  };
20
20
 
21
+ const FULL_GESTURE_VELOCITY_PROGRESS_PER_SECOND = 4;
22
+
21
23
  /**
22
24
  * Converts a pan velocity from pixels/second into progress/second.
23
25
  */
@@ -29,6 +31,29 @@ export const toProgressVelocity = (
29
31
  return velocityPixelsPerSecond / Math.max(1, screenSize);
30
32
  };
31
33
 
34
+ /**
35
+ * Converts normalized pan velocity into a 0-1 scalar for interpolators.
36
+ *
37
+ * `1` means the velocity reached or exceeded the library's full-velocity
38
+ * threshold, not a physical maximum for the device.
39
+ */
40
+ export const resolveGestureVelocity = (
41
+ velocityNormX: number,
42
+ velocityNormY: number,
43
+ ) => {
44
+ "worklet";
45
+
46
+ const dominantVelocity = Math.max(
47
+ Math.abs(velocityNormX),
48
+ Math.abs(velocityNormY),
49
+ );
50
+
51
+ return Math.min(
52
+ 1,
53
+ dominantVelocity / FULL_GESTURE_VELOCITY_PROGRESS_PER_SECOND,
54
+ );
55
+ };
56
+
32
57
  /**
33
58
  * Converts pan release velocity into a spring handoff in progress units/second.
34
59
  */
@@ -62,9 +62,7 @@ const resolveGestureDirection = (options: GesturePolicyOptions) => {
62
62
  return options.gestureDirection ?? DEFAULT_GESTURE_DIRECTION;
63
63
  };
64
64
 
65
- export function resolveGestureProgressModePolicy(
66
- options: GesturePolicyOptions,
67
- ) {
65
+ function resolveGestureProgressModePolicy(options: GesturePolicyOptions) {
68
66
  "worklet";
69
67
  return resolveGestureProgressMode({
70
68
  gestureProgressMode: options.gestureProgressMode,
@@ -131,7 +129,7 @@ const resolvePinchDirections = (
131
129
  };
132
130
  };
133
131
 
134
- export const resolveGestureCanDismiss = ({
132
+ const resolveGestureCanDismiss = ({
135
133
  isFirstKey,
136
134
  gestureEnabled,
137
135
  }: {
@@ -215,7 +213,7 @@ export const resolvePinchPolicy = (
215
213
  };
216
214
  };
217
215
 
218
- export const resolveGestureParticipation = ({
216
+ const resolveGestureParticipation = ({
219
217
  options,
220
218
  isFirstKey,
221
219
  gestureContext,
@@ -160,6 +160,7 @@ export interface PanTrackState {
160
160
  y: number;
161
161
  normX: number;
162
162
  normY: number;
163
+ velocity: number;
163
164
  }
164
165
 
165
166
  export interface PinchTrackState {
@@ -185,6 +186,7 @@ export interface PanReleasePlan {
185
186
  resetVelocityY: number;
186
187
  resetVelocityNormX: number;
187
188
  resetVelocityNormY: number;
189
+ releaseVelocity: number;
188
190
  resetNormalizedValues: boolean;
189
191
  resetNormalizedValuesImmediately: boolean;
190
192
  preserveRawValues: boolean;
@@ -8,7 +8,6 @@ import type {
8
8
  import { logger } from "../../../../utils/logger";
9
9
  import { useScreenAnimationContext } from "../../animation";
10
10
  import { useBuildBoundsAccessor } from "../../animation/helpers/accessors/use-build-bounds-accessor";
11
- import { useBuildTransitionAccessor } from "../../animation/helpers/accessors/use-build-transition-accessor";
12
11
  import { syncSelectedInterpolatorOptions } from "../../animation/helpers/selected-interpolator-options";
13
12
  import { useDescriptorDerivations } from "../../descriptors";
14
13
  import {
@@ -55,7 +54,6 @@ export const useInterpolatedStylesMap = () => {
55
54
  currentInterpolator,
56
55
  } = useScreenAnimationContext();
57
56
  const boundsAccessor = useBuildBoundsAccessor();
58
- const transition = useBuildTransitionAccessor();
59
57
  const pendingLifecycleStartBlockCount = SystemStore.getValue(
60
58
  currentScreenKey,
61
59
  "pendingLifecycleStartBlockCount",
@@ -126,7 +124,6 @@ export const useInterpolatedStylesMap = () => {
126
124
  progress: effectiveProgress,
127
125
  next: effectiveNext,
128
126
  bounds: boundsAccessor,
129
- transition,
130
127
  });
131
128
 
132
129
  const rawStyleMap: TransitionInterpolatedStyle | undefined =
@@ -0,0 +1,161 @@
1
+ import type {
2
+ GroupKey,
3
+ LinkGroupState,
4
+ LinkKey,
5
+ LinkPairState,
6
+ LinkPairsState,
7
+ ScreenIdentifier,
8
+ ScreenPairKey,
9
+ TagLink,
10
+ } from "../types";
11
+
12
+ const PAIR_SEPARATOR = "<>";
13
+
14
+ export const createScreenPairKey = (
15
+ sourceScreenKey: ScreenIdentifier["screenKey"],
16
+ destinationScreenKey: ScreenIdentifier["screenKey"] | "",
17
+ ): ScreenPairKey => {
18
+ "worklet";
19
+ return `${sourceScreenKey}${PAIR_SEPARATOR}${destinationScreenKey}`;
20
+ };
21
+
22
+ export const createPendingPairKey = (
23
+ sourceScreenKey: ScreenIdentifier["screenKey"],
24
+ ): ScreenPairKey => {
25
+ "worklet";
26
+ return createScreenPairKey(sourceScreenKey, "");
27
+ };
28
+
29
+ export const getSourceScreenKeyFromPairKey = (
30
+ pairKey: ScreenPairKey,
31
+ ): ScreenIdentifier["screenKey"] => {
32
+ "worklet";
33
+ const separatorIndex = pairKey.indexOf(PAIR_SEPARATOR);
34
+ if (separatorIndex === -1) return pairKey;
35
+ return pairKey.slice(0, separatorIndex);
36
+ };
37
+
38
+ export const getDestinationScreenKeyFromPairKey = (
39
+ pairKey: ScreenPairKey,
40
+ ): ScreenIdentifier["screenKey"] | "" => {
41
+ "worklet";
42
+ const separatorIndex = pairKey.indexOf(PAIR_SEPARATOR);
43
+ if (separatorIndex === -1) return "";
44
+ return pairKey.slice(separatorIndex + PAIR_SEPARATOR.length);
45
+ };
46
+
47
+ export const isScreenPairKeyForScreen = (
48
+ pairKey: ScreenPairKey,
49
+ screenKey: ScreenIdentifier["screenKey"],
50
+ ): boolean => {
51
+ "worklet";
52
+ return (
53
+ pairKey === createPendingPairKey(screenKey) ||
54
+ pairKey.startsWith(`${screenKey}${PAIR_SEPARATOR}`) ||
55
+ pairKey.endsWith(`${PAIR_SEPARATOR}${screenKey}`)
56
+ );
57
+ };
58
+
59
+ export const getLinkKeyFromTag = (tag: string): LinkKey => {
60
+ "worklet";
61
+ const separatorIndex = tag.indexOf(":");
62
+ if (separatorIndex === -1) return tag;
63
+ return tag.slice(separatorIndex + 1);
64
+ };
65
+
66
+ export const getGroupKeyFromTag = (tag: string): GroupKey | null => {
67
+ "worklet";
68
+ const separatorIndex = tag.indexOf(":");
69
+ if (separatorIndex === -1) return null;
70
+ return tag.slice(0, separatorIndex);
71
+ };
72
+
73
+ export const createGroupTag = (group: GroupKey, linkKey: LinkKey): string => {
74
+ "worklet";
75
+ return `${group}:${linkKey}`;
76
+ };
77
+
78
+ export const ensurePairState = (
79
+ state: LinkPairsState,
80
+ pairKey: ScreenPairKey,
81
+ ): LinkPairState => {
82
+ "worklet";
83
+ if (!state[pairKey]) {
84
+ state[pairKey] = {
85
+ links: {},
86
+ groups: {},
87
+ };
88
+ }
89
+ state[pairKey].groups ??= {};
90
+ return state[pairKey];
91
+ };
92
+
93
+ export const ensurePairLinks = (
94
+ state: LinkPairsState,
95
+ pairKey: ScreenPairKey,
96
+ ): Record<LinkKey, TagLink> => {
97
+ "worklet";
98
+ return ensurePairState(state, pairKey).links;
99
+ };
100
+
101
+ export const ensurePairGroups = (
102
+ state: LinkPairsState,
103
+ pairKey: ScreenPairKey,
104
+ ): Record<GroupKey, LinkGroupState> => {
105
+ "worklet";
106
+ return ensurePairState(state, pairKey).groups;
107
+ };
108
+
109
+ export const removePairLink = (
110
+ state: LinkPairsState,
111
+ pairKey: ScreenPairKey,
112
+ linkKey: LinkKey,
113
+ ) => {
114
+ "worklet";
115
+ const pair = state[pairKey];
116
+ if (!pair) return;
117
+
118
+ delete pair.links[linkKey];
119
+
120
+ for (const key in pair.links) {
121
+ if (pair.links[key]) return;
122
+ }
123
+
124
+ delete state[pairKey];
125
+ };
126
+
127
+ export const getLink = (
128
+ state: LinkPairsState,
129
+ pairKey: ScreenPairKey,
130
+ linkKey: LinkKey,
131
+ ): TagLink | null => {
132
+ "worklet";
133
+ return state[pairKey]?.links[linkKey] ?? null;
134
+ };
135
+
136
+ export const getSource = (
137
+ state: LinkPairsState,
138
+ pairKey: ScreenPairKey,
139
+ linkKey: LinkKey,
140
+ ): TagLink["source"] | null => {
141
+ "worklet";
142
+ return getLink(state, pairKey, linkKey)?.source ?? null;
143
+ };
144
+
145
+ export const getDestination = (
146
+ state: LinkPairsState,
147
+ pairKey: ScreenPairKey,
148
+ linkKey: LinkKey,
149
+ ): TagLink["destination"] | null => {
150
+ "worklet";
151
+ return getLink(state, pairKey, linkKey)?.destination ?? null;
152
+ };
153
+
154
+ export const getActiveGroupId = (
155
+ state: LinkPairsState,
156
+ pairKey: ScreenPairKey,
157
+ group: GroupKey,
158
+ ): LinkKey | null => {
159
+ "worklet";
160
+ return state[pairKey]?.groups?.[group]?.activeId ?? null;
161
+ };
@@ -1,16 +1,11 @@
1
1
  import { clear } from "./internals/clear";
2
2
  import { getEntry, removeEntry, setEntry } from "./internals/entries";
3
3
  import {
4
- getGroupActiveId,
5
- getGroupInitialId,
6
- setGroupActiveId,
7
- setGroupInitialId,
8
- } from "./internals/groups";
9
- import {
10
- getMatchedLink,
11
- getPendingLink,
12
- hasDestinationLink,
13
- hasSourceLink,
4
+ getActiveGroupId,
5
+ getDestination,
6
+ getLink,
7
+ getSource,
8
+ setActiveGroupId,
14
9
  setDestination,
15
10
  setSource,
16
11
  } from "./internals/links";
@@ -37,17 +32,12 @@ export const BoundStore = {
37
32
  link: {
38
33
  setSource,
39
34
  setDestination,
40
- getMatched: getMatchedLink,
35
+ setActiveGroupId,
36
+ getLink,
37
+ getSource,
38
+ getDestination,
39
+ getActiveGroupId,
41
40
  getPair: resolveTransitionPair,
42
- getPending: getPendingLink,
43
- hasSource: hasSourceLink,
44
- hasDestination: hasDestinationLink,
45
- },
46
- group: {
47
- setActiveId: setGroupActiveId,
48
- setInitialId: setGroupInitialId,
49
- getActiveId: getGroupActiveId,
50
- getInitialId: getGroupInitialId,
51
41
  },
52
42
  cleanup: {
53
43
  byScreen: clear,
@@ -1,59 +1,35 @@
1
1
  import { hasAnyKeys } from "../helpers/keys";
2
- import { matchesScreenKey } from "../helpers/matching";
3
- import type { ScreenEntry, ScreenKey, TagLink } from "../types";
4
- import { type RegistryState, registry } from "./state";
2
+ import { isScreenPairKeyForScreen } from "../helpers/link-pairs.helpers";
3
+ import type { LinkPairsState, ScreenKey } from "../types";
4
+ import { type BoundaryEntriesState, boundaryRegistry, pairs } from "./state";
5
5
 
6
- type LinkPredicate = (link: TagLink) => boolean;
7
-
8
- type ScreenPredicate = (
9
- screenKey: ScreenKey,
10
- screenEntry: ScreenEntry,
11
- ) => boolean;
12
-
13
- const clearRegistry = (
14
- shouldClearScreen: ScreenPredicate,
15
- shouldClearLink: LinkPredicate,
16
- ) => {
6
+ function clear(screenKey: ScreenKey) {
17
7
  "worklet";
18
- registry.modify(<T extends RegistryState>(state: T): T => {
8
+
9
+ boundaryRegistry.modify(<T extends BoundaryEntriesState>(state: T): T => {
19
10
  "worklet";
20
11
  for (const tag in state) {
21
12
  const tagState = state[tag];
13
+ delete tagState.screens[screenKey];
22
14
 
23
- for (const entryScreenKey in tagState.screens) {
24
- const screenEntry = tagState.screens[entryScreenKey];
25
- if (shouldClearScreen(entryScreenKey, screenEntry)) {
26
- delete tagState.screens[entryScreenKey];
27
- }
15
+ if (!hasAnyKeys(tagState.screens)) {
16
+ delete state[tag];
28
17
  }
18
+ }
29
19
 
30
- for (let i = tagState.linkStack.length - 1; i >= 0; i--) {
31
- const link = tagState.linkStack[i];
32
- if (shouldClearLink(link)) {
33
- tagState.linkStack.splice(i, 1);
34
- }
35
- }
20
+ return state;
21
+ });
36
22
 
37
- if (!hasAnyKeys(tagState.screens) && tagState.linkStack.length === 0) {
38
- delete state[tag];
23
+ pairs.modify(<T extends LinkPairsState>(state: T): T => {
24
+ "worklet";
25
+ for (const pairKey in state) {
26
+ if (isScreenPairKeyForScreen(pairKey, screenKey)) {
27
+ delete state[pairKey];
39
28
  }
40
29
  }
41
30
 
42
31
  return state;
43
32
  });
44
- };
45
-
46
- function clear(screenKey: ScreenKey) {
47
- "worklet";
48
- clearRegistry(
49
- (entryScreenKey) => entryScreenKey === screenKey,
50
- (link) => {
51
- return (
52
- matchesScreenKey(link.source, screenKey) ||
53
- matchesScreenKey(link.destination, screenKey)
54
- );
55
- },
56
- );
57
33
  }
58
34
 
59
35
  export { clear };