react-native-screen-transitions 3.4.0-alpha.0 → 3.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/README.md +65 -2
  2. package/lib/commonjs/shared/animation/snap-to.js +5 -1
  3. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  4. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
  5. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
  6. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +2 -2
  7. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  8. package/lib/commonjs/shared/components/overlay/index.js +1 -3
  9. package/lib/commonjs/shared/components/overlay/index.js.map +1 -1
  10. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +2 -16
  11. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  12. package/lib/commonjs/shared/components/scene-view.js +2 -4
  13. package/lib/commonjs/shared/components/scene-view.js.map +1 -1
  14. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +9 -6
  15. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  16. package/lib/commonjs/shared/components/screen-container/layers/content.js +47 -55
  17. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  18. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +77 -0
  19. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
  20. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  21. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
  22. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  23. package/lib/commonjs/shared/constants.js +6 -2
  24. package/lib/commonjs/shared/constants.js.map +1 -1
  25. package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js +49 -0
  26. package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
  27. package/lib/commonjs/shared/hooks/gestures/types.js +2 -0
  28. package/lib/commonjs/shared/hooks/gestures/types.js.map +1 -0
  29. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js +7 -3
  30. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
  31. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  32. package/lib/commonjs/shared/index.js +15 -3
  33. package/lib/commonjs/shared/index.js.map +1 -1
  34. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +55 -18
  35. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  36. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +44 -0
  37. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
  38. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +31 -17
  39. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -9
  41. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  42. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +11 -6
  43. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  44. package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +33 -0
  45. package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
  46. package/lib/commonjs/shared/providers/screen/animation/types.js +2 -0
  47. package/lib/commonjs/shared/providers/screen/animation/types.js.map +1 -0
  48. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +9 -3
  49. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  50. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
  51. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  52. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  53. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  54. package/lib/commonjs/shared/stores/animation.store.js +8 -2
  55. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  56. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -0
  57. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  58. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +6 -0
  59. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  60. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +24 -9
  61. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  62. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js +3 -2
  63. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -1
  64. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js +3 -2
  65. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +1 -1
  66. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js +2 -2
  67. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
  68. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +6 -5
  69. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  70. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +4 -3
  71. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  72. package/lib/commonjs/shared/utils/bounds/index.js +3 -3
  73. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  74. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +54 -0
  75. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +1 -0
  76. package/lib/commonjs/shared/utils/bounds/zoom/build.js +541 -0
  77. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -0
  78. package/lib/commonjs/shared/utils/bounds/zoom/config.js +118 -0
  79. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -0
  80. package/lib/commonjs/shared/utils/bounds/zoom/index.js +20 -0
  81. package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +1 -0
  82. package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -0
  83. package/lib/commonjs/shared/utils/gesture/validate-snap-points.js +11 -5
  84. package/lib/commonjs/shared/utils/gesture/validate-snap-points.js.map +1 -1
  85. package/lib/commonjs/shared/utils/overlay/visibility.js +2 -9
  86. package/lib/commonjs/shared/utils/overlay/visibility.js.map +1 -1
  87. package/lib/module/shared/animation/snap-to.js +5 -1
  88. package/lib/module/shared/animation/snap-to.js.map +1 -1
  89. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
  90. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
  91. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +3 -3
  92. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  93. package/lib/module/shared/components/overlay/index.js +1 -3
  94. package/lib/module/shared/components/overlay/index.js.map +1 -1
  95. package/lib/module/shared/components/overlay/variations/overlay-host.js +3 -17
  96. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  97. package/lib/module/shared/components/scene-view.js +3 -5
  98. package/lib/module/shared/components/scene-view.js.map +1 -1
  99. package/lib/module/shared/components/screen-container/layers/backdrop.js +9 -6
  100. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  101. package/lib/module/shared/components/screen-container/layers/content.js +52 -60
  102. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  103. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +72 -0
  104. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
  105. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  106. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
  107. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  108. package/lib/module/shared/constants.js +6 -2
  109. package/lib/module/shared/constants.js.map +1 -1
  110. package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js +45 -0
  111. package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
  112. package/lib/module/shared/hooks/gestures/types.js +2 -0
  113. package/lib/module/shared/hooks/gestures/types.js.map +1 -0
  114. package/lib/module/shared/hooks/gestures/use-screen-gesture.js +7 -4
  115. package/lib/module/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
  116. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  117. package/lib/module/shared/index.js +1 -2
  118. package/lib/module/shared/index.js.map +1 -1
  119. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +55 -18
  120. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  121. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +38 -0
  122. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
  123. package/lib/module/shared/providers/screen/animation/animation.provider.js +30 -15
  124. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  125. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -9
  126. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  127. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +11 -6
  128. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  129. package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +29 -0
  130. package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
  131. package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
  132. package/lib/module/shared/providers/screen/animation/types.js +2 -0
  133. package/lib/module/shared/providers/screen/animation/types.js.map +1 -0
  134. package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -3
  135. package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  136. package/lib/module/shared/providers/stack/direct.provider.js +2 -2
  137. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  138. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +2 -2
  139. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  140. package/lib/module/shared/stores/animation.store.js +8 -2
  141. package/lib/module/shared/stores/animation.store.js.map +1 -1
  142. package/lib/module/shared/stores/bounds/internals/resolver.js +7 -0
  143. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  144. package/lib/module/shared/utils/animation/animate-to-progress.js +6 -0
  145. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  146. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +24 -9
  147. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  148. package/lib/module/shared/utils/bounds/helpers/geometry.js +3 -2
  149. package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -1
  150. package/lib/module/shared/utils/bounds/helpers/interpolators.js +3 -2
  151. package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +1 -1
  152. package/lib/module/shared/utils/bounds/helpers/link-accessor.js +2 -2
  153. package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
  154. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +6 -5
  155. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  156. package/lib/module/shared/utils/bounds/helpers/style-composers.js +4 -3
  157. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  158. package/lib/module/shared/utils/bounds/index.js +3 -3
  159. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  160. package/lib/module/shared/utils/bounds/zoom/accessor.js +49 -0
  161. package/lib/module/shared/utils/bounds/zoom/accessor.js.map +1 -0
  162. package/lib/module/shared/utils/bounds/zoom/build.js +536 -0
  163. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -0
  164. package/lib/module/shared/utils/bounds/zoom/config.js +112 -0
  165. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -0
  166. package/lib/module/shared/utils/bounds/zoom/index.js +5 -0
  167. package/lib/module/shared/utils/bounds/zoom/index.js.map +1 -0
  168. package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -0
  169. package/lib/module/shared/utils/gesture/validate-snap-points.js +11 -5
  170. package/lib/module/shared/utils/gesture/validate-snap-points.js.map +1 -1
  171. package/lib/module/shared/utils/overlay/visibility.js +1 -7
  172. package/lib/module/shared/utils/overlay/visibility.js.map +1 -1
  173. package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
  174. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -1
  175. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +1 -1
  176. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +1 -1
  177. package/lib/typescript/shared/components/overlay/index.d.ts +0 -2
  178. package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -1
  179. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  183. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +7 -0
  184. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -0
  185. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
  187. package/lib/typescript/shared/constants.d.ts +3 -0
  188. package/lib/typescript/shared/constants.d.ts.map +1 -1
  189. package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts +10 -0
  190. package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts.map +1 -0
  191. package/lib/typescript/shared/hooks/gestures/types.d.ts +4 -0
  192. package/lib/typescript/shared/hooks/gestures/types.d.ts.map +1 -0
  193. package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts +4 -2
  194. package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts.map +1 -1
  195. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -2
  196. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  197. package/lib/typescript/shared/index.d.ts +16 -17
  198. package/lib/typescript/shared/index.d.ts.map +1 -1
  199. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  200. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +18 -0
  201. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -0
  202. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +6 -3
  203. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  204. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +0 -2
  205. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  206. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  207. package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +11 -0
  208. package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -0
  209. package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
  210. package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/screen/animation/types.d.ts +4 -0
  212. package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -0
  213. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +5 -1
  214. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
  215. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  216. package/lib/typescript/shared/stores/animation.store.d.ts +4 -0
  217. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  218. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  219. package/lib/typescript/shared/stores/bounds/types.d.ts +2 -0
  220. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  221. package/lib/typescript/shared/types/animation.types.d.ts +26 -51
  222. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  223. package/lib/typescript/shared/types/bounds.types.d.ts +46 -9
  224. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  225. package/lib/typescript/shared/types/index.d.ts +3 -3
  226. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  227. package/lib/typescript/shared/types/overlay.types.d.ts +1 -22
  228. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
  229. package/lib/typescript/shared/types/screen.types.d.ts +16 -15
  230. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  231. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +2 -2
  233. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +1 -1
  234. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  235. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +3 -2
  236. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
  237. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts +3 -2
  238. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +1 -1
  239. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts +3 -2
  240. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +2 -1
  242. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
  243. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +4 -3
  244. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  245. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/utils/bounds/types/options.d.ts +5 -4
  247. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  248. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +17 -0
  249. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -0
  250. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +4 -0
  251. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -0
  252. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +43 -0
  253. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -0
  254. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +3 -0
  255. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +1 -0
  256. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +17 -0
  257. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -0
  258. package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts +5 -3
  259. package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts.map +1 -1
  260. package/lib/typescript/shared/utils/overlay/visibility.d.ts +1 -4
  261. package/lib/typescript/shared/utils/overlay/visibility.d.ts.map +1 -1
  262. package/package.json +2 -2
  263. package/src/shared/animation/snap-to.ts +12 -1
  264. package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
  265. package/src/shared/components/overlay/helpers/get-active-overlay.ts +3 -3
  266. package/src/shared/components/overlay/index.ts +0 -2
  267. package/src/shared/components/overlay/variations/overlay-host.tsx +2 -16
  268. package/src/shared/components/scene-view.tsx +0 -3
  269. package/src/shared/components/screen-container/layers/backdrop.tsx +25 -6
  270. package/src/shared/components/screen-container/layers/content.tsx +80 -77
  271. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +93 -0
  272. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +1 -2
  273. package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +20 -6
  274. package/src/shared/constants.ts +6 -2
  275. package/src/shared/hooks/gestures/resolve-screen-gesture-target.ts +66 -0
  276. package/src/shared/hooks/gestures/types.ts +5 -0
  277. package/src/shared/hooks/gestures/use-screen-gesture.ts +10 -3
  278. package/src/shared/hooks/navigation/use-stack.tsx +1 -2
  279. package/src/shared/index.ts +14 -16
  280. package/src/shared/providers/gestures/handlers/use-handlers.ts +67 -24
  281. package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
  282. package/src/shared/providers/screen/animation/animation.provider.tsx +46 -10
  283. package/src/shared/providers/screen/animation/helpers/derivations.ts +0 -8
  284. package/src/shared/providers/screen/animation/helpers/pipeline.ts +26 -5
  285. package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +44 -0
  286. package/src/shared/providers/screen/animation/index.tsx +4 -1
  287. package/src/shared/providers/screen/animation/types.ts +5 -0
  288. package/src/shared/providers/screen/animation/use-screen-animation.tsx +16 -3
  289. package/src/shared/providers/stack/direct.provider.tsx +2 -5
  290. package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
  291. package/src/shared/stores/animation.store.ts +13 -1
  292. package/src/shared/stores/bounds/internals/resolver.ts +13 -1
  293. package/src/shared/stores/bounds/types.ts +2 -0
  294. package/src/shared/types/animation.types.ts +25 -58
  295. package/src/shared/types/bounds.types.ts +30 -10
  296. package/src/shared/types/index.ts +2 -15
  297. package/src/shared/types/overlay.types.ts +1 -28
  298. package/src/shared/types/screen.types.ts +17 -16
  299. package/src/shared/utils/animation/animate-to-progress.ts +7 -0
  300. package/src/shared/utils/bounds/helpers/build-bounds-options.ts +2 -2
  301. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +34 -8
  302. package/src/shared/utils/bounds/helpers/geometry.ts +3 -2
  303. package/src/shared/utils/bounds/helpers/interpolators.ts +8 -6
  304. package/src/shared/utils/bounds/helpers/link-accessor.ts +10 -6
  305. package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +9 -6
  306. package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
  307. package/src/shared/utils/bounds/index.ts +6 -8
  308. package/src/shared/utils/bounds/types/options.ts +6 -4
  309. package/src/shared/utils/bounds/zoom/accessor.ts +69 -0
  310. package/src/shared/utils/bounds/zoom/build.ts +705 -0
  311. package/src/shared/utils/bounds/zoom/config.ts +179 -0
  312. package/src/shared/utils/bounds/zoom/index.ts +2 -0
  313. package/src/shared/utils/bounds/zoom/types.ts +22 -0
  314. package/src/shared/utils/gesture/validate-snap-points.ts +20 -8
  315. package/src/shared/utils/overlay/visibility.ts +1 -16
  316. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +0 -64
  317. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +0 -1
  318. package/lib/commonjs/shared/utils/bounds/helpers/math.js +0 -132
  319. package/lib/commonjs/shared/utils/bounds/helpers/math.js.map +0 -1
  320. package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js +0 -45
  321. package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
  322. package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js +0 -60
  323. package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
  324. package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js +0 -20
  325. package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
  326. package/lib/commonjs/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
  327. package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js +0 -295
  328. package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
  329. package/lib/module/shared/components/overlay/variations/screen-overlay.js +0 -61
  330. package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +0 -1
  331. package/lib/module/shared/utils/bounds/helpers/math.js +0 -115
  332. package/lib/module/shared/utils/bounds/helpers/math.js.map +0 -1
  333. package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js +0 -40
  334. package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
  335. package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js +0 -54
  336. package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
  337. package/lib/module/shared/utils/bounds/sugar/navigation/index.js +0 -15
  338. package/lib/module/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
  339. package/lib/module/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
  340. package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js +0 -290
  341. package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
  342. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +0 -10
  343. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +0 -1
  344. package/lib/typescript/shared/utils/bounds/helpers/math.d.ts +0 -38
  345. package/lib/typescript/shared/utils/bounds/helpers/math.d.ts.map +0 -1
  346. package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts +0 -16
  347. package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts.map +0 -1
  348. package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts +0 -17
  349. package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts.map +0 -1
  350. package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts +0 -3
  351. package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts.map +0 -1
  352. package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts +0 -18
  353. package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts.map +0 -1
  354. package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts +0 -4
  355. package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts.map +0 -1
  356. package/src/shared/components/overlay/variations/screen-overlay.tsx +0 -68
  357. package/src/shared/utils/bounds/helpers/math.ts +0 -161
  358. package/src/shared/utils/bounds/helpers/navigation-accessor.ts +0 -61
  359. package/src/shared/utils/bounds/sugar/navigation/helpers.ts +0 -74
  360. package/src/shared/utils/bounds/sugar/navigation/index.ts +0 -14
  361. package/src/shared/utils/bounds/sugar/navigation/types.ts +0 -26
  362. package/src/shared/utils/bounds/sugar/navigation/zoom.ts +0 -348
  363. /package/lib/commonjs/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
  364. /package/lib/module/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
@@ -53,6 +53,10 @@ import {
53
53
  normalizeVelocity,
54
54
  } from "../helpers/gesture-physics";
55
55
  import { resetGestureValues } from "../helpers/gesture-reset";
56
+ import {
57
+ findNearestSnapPoint,
58
+ resolveRuntimeSnapPoints,
59
+ } from "../helpers/gesture-snap-points";
56
60
  import {
57
61
  determineDismissal,
58
62
  determineSnapTarget,
@@ -147,14 +151,22 @@ export const useHandlers = ({
147
151
 
148
152
  const { dimensions } = useViewportContext();
149
153
  const routeKey = current.route.key;
150
- const animations = AnimationStore.getRouteAnimations(current.route.key);
151
- const gestureAnimationValues = GestureStore.getRouteGestures(
152
- current.route.key,
154
+ const animations = AnimationStore.getRouteAnimations(routeKey);
155
+ const gestureAnimationValues = GestureStore.getRouteGestures(routeKey);
156
+ const {
157
+ hasSnapPoints,
158
+ hasAutoSnapPoint,
159
+ snapPoints,
160
+ minSnapPoint,
161
+ maxSnapPoint,
162
+ } = effectiveSnapPoints;
163
+
164
+ // Read the measured "auto" snap point reactively inside worklets.
165
+ const autoSnapPointValue = AnimationStore.getAnimation(
166
+ routeKey,
167
+ "autoSnapPoint",
153
168
  );
154
169
 
155
- const { hasSnapPoints, snapPoints, minSnapPoint, maxSnapPoint } =
156
- effectiveSnapPoints;
157
-
158
170
  const directions = useMemo(() => {
159
171
  warnOnSnapDirectionArray({ gestureDirection, hasSnapPoints });
160
172
  return resolveGestureDirections({ gestureDirection, hasSnapPoints });
@@ -289,9 +301,17 @@ export const useHandlers = ({
289
301
  return;
290
302
  }
291
303
 
304
+ const { resolvedMaxSnapPoint } = resolveRuntimeSnapPoints({
305
+ snapPoints,
306
+ hasAutoSnapPoint,
307
+ autoSnapPoint: autoSnapPointValue.value,
308
+ minSnapPoint,
309
+ maxSnapPoint,
310
+ canDismiss,
311
+ });
292
312
  const effectiveMaxSnapPoint = gestureSnapLocked
293
313
  ? lockedSnapPoint.value
294
- : maxSnapPoint;
314
+ : resolvedMaxSnapPoint;
295
315
 
296
316
  const canExpandMore =
297
317
  animations.progress.value < effectiveMaxSnapPoint - EPSILON &&
@@ -312,22 +332,23 @@ export const useHandlers = ({
312
332
 
313
333
  const onStart = useStableCallbackValue(() => {
314
334
  "worklet";
315
- if (hasSnapPoints && gestureSnapLocked) {
316
- let nearest = snapPoints[0] ?? animations.progress.value;
317
- let smallestDistance = Math.abs(animations.progress.value - nearest);
318
-
319
- for (let i = 1; i < snapPoints.length; i++) {
320
- const point = snapPoints[i];
321
- const distance = Math.abs(animations.progress.value - point);
322
- if (distance < smallestDistance) {
323
- smallestDistance = distance;
324
- nearest = point;
325
- }
326
- }
335
+ const { resolvedSnapPoints, resolvedMaxSnapPoint } =
336
+ resolveRuntimeSnapPoints({
337
+ snapPoints,
338
+ hasAutoSnapPoint,
339
+ autoSnapPoint: autoSnapPointValue.value,
340
+ minSnapPoint,
341
+ maxSnapPoint,
342
+ canDismiss,
343
+ });
327
344
 
328
- lockedSnapPoint.value = nearest;
345
+ if (hasSnapPoints && gestureSnapLocked) {
346
+ lockedSnapPoint.value = findNearestSnapPoint(
347
+ animations.progress.value,
348
+ resolvedSnapPoints,
349
+ );
329
350
  } else {
330
- lockedSnapPoint.value = maxSnapPoint;
351
+ lockedSnapPoint.value = resolvedMaxSnapPoint;
331
352
  }
332
353
 
333
354
  gestureAnimationValues.dragging.value = TRUE;
@@ -363,14 +384,25 @@ export const useHandlers = ({
363
384
  const baseSign = -1;
364
385
  const sign = directions.snapAxisInverted ? -baseSign : baseSign;
365
386
  const progressDelta = (sign * translation) / dimension;
387
+
388
+ const { resolvedMinSnapPoint, resolvedMaxSnapPoint } =
389
+ resolveRuntimeSnapPoints({
390
+ snapPoints,
391
+ hasAutoSnapPoint,
392
+ autoSnapPoint: autoSnapPointValue.value,
393
+ minSnapPoint,
394
+ maxSnapPoint,
395
+ canDismiss,
396
+ });
397
+
366
398
  const maxProgressForGesture = gestureSnapLocked
367
399
  ? lockedSnapPoint.value
368
- : maxSnapPoint;
400
+ : resolvedMaxSnapPoint;
369
401
  const minProgressForGesture = gestureSnapLocked
370
402
  ? canDismiss
371
403
  ? 0
372
404
  : lockedSnapPoint.value
373
- : minSnapPoint;
405
+ : resolvedMinSnapPoint;
374
406
 
375
407
  animations.progress.value = Math.max(
376
408
  minProgressForGesture,
@@ -430,9 +462,20 @@ export const useHandlers = ({
430
462
  ? -axisVelocity
431
463
  : axisVelocity;
432
464
 
465
+ const { resolvedSnapPoints } = resolveRuntimeSnapPoints({
466
+ snapPoints,
467
+ hasAutoSnapPoint,
468
+ autoSnapPoint: autoSnapPointValue.value,
469
+ minSnapPoint,
470
+ maxSnapPoint,
471
+ canDismiss,
472
+ });
473
+
433
474
  const result = determineSnapTarget({
434
475
  currentProgress: animations.progress.value,
435
- snapPoints: gestureSnapLocked ? [lockedSnapPoint.value] : snapPoints,
476
+ snapPoints: gestureSnapLocked
477
+ ? [lockedSnapPoint.value]
478
+ : resolvedSnapPoints,
436
479
  velocity: snapVelocity,
437
480
  dimension: axisDimension,
438
481
  velocityFactor: snapVelocityImpact,
@@ -0,0 +1,72 @@
1
+ interface ResolveRuntimeSnapPointsProps {
2
+ snapPoints: number[];
3
+ hasAutoSnapPoint: boolean;
4
+ autoSnapPoint: number;
5
+ minSnapPoint: number;
6
+ maxSnapPoint: number;
7
+ canDismiss: boolean;
8
+ }
9
+
10
+ interface ResolvedRuntimeSnapPointsResult {
11
+ resolvedAutoSnapPoint: number | null;
12
+ resolvedSnapPoints: number[];
13
+ resolvedMinSnapPoint: number;
14
+ resolvedMaxSnapPoint: number;
15
+ }
16
+
17
+ export const resolveRuntimeSnapPoints = ({
18
+ snapPoints,
19
+ hasAutoSnapPoint,
20
+ autoSnapPoint,
21
+ minSnapPoint,
22
+ maxSnapPoint,
23
+ canDismiss,
24
+ }: ResolveRuntimeSnapPointsProps): ResolvedRuntimeSnapPointsResult => {
25
+ "worklet";
26
+
27
+ const resolvedAutoSnapPoint =
28
+ hasAutoSnapPoint && autoSnapPoint > 0 ? autoSnapPoint : null;
29
+
30
+ const resolvedSnapPoints =
31
+ resolvedAutoSnapPoint === null
32
+ ? snapPoints
33
+ : [...snapPoints, resolvedAutoSnapPoint].sort((a, b) => a - b);
34
+
35
+ const resolvedMinSnapPoint =
36
+ resolvedAutoSnapPoint !== null && !canDismiss
37
+ ? Math.min(
38
+ minSnapPoint === -1 ? resolvedAutoSnapPoint : minSnapPoint,
39
+ resolvedAutoSnapPoint,
40
+ )
41
+ : minSnapPoint;
42
+
43
+ return {
44
+ resolvedAutoSnapPoint,
45
+ resolvedSnapPoints,
46
+ resolvedMinSnapPoint,
47
+ resolvedMaxSnapPoint:
48
+ resolvedSnapPoints[resolvedSnapPoints.length - 1] ?? maxSnapPoint,
49
+ };
50
+ };
51
+
52
+ export const findNearestSnapPoint = (
53
+ progress: number,
54
+ snapPoints: number[],
55
+ ): number => {
56
+ "worklet";
57
+
58
+ let nearest = snapPoints[0] ?? progress;
59
+ let smallestDistance = Math.abs(progress - nearest);
60
+
61
+ for (let i = 1; i < snapPoints.length; i++) {
62
+ const point = snapPoints[i];
63
+ const distance = Math.abs(progress - point);
64
+
65
+ if (distance < smallestDistance) {
66
+ smallestDistance = distance;
67
+ nearest = point;
68
+ }
69
+ }
70
+
71
+ return nearest;
72
+ };
@@ -1,23 +1,26 @@
1
- import { type ReactNode, useMemo } from "react";
1
+ import { createContext, type ReactNode, useContext, useMemo } from "react";
2
2
  import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
3
3
  import type { ScreenInterpolationProps } from "../../../types/animation.types";
4
- import createProvider from "../../../utils/create-provider";
5
4
  import { useScreenAnimationPipeline } from "./helpers/pipeline";
6
5
 
7
6
  type Props = {
8
7
  children: ReactNode;
9
8
  };
10
9
 
11
- type ScreenAnimationContextValue = ReturnType<
10
+ export type ScreenAnimationContextValue = ReturnType<
12
11
  typeof useScreenAnimationPipeline
13
12
  > & {
14
13
  screenAnimation: DerivedValue<ScreenInterpolationProps>;
14
+ ancestorScreenAnimations: DerivedValue<ScreenInterpolationProps>[];
15
15
  };
16
16
 
17
- const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
18
- "ScreenAnimation",
19
- { guarded: true },
20
- )<Props, ScreenAnimationContextValue>(() => {
17
+ const ScreenAnimationContext =
18
+ createContext<ScreenAnimationContextValue | null>(null);
19
+ ScreenAnimationContext.displayName = "ScreenAnimation";
20
+
21
+ function ScreenAnimationProvider({ children }: Props) {
22
+ const parentContext = useContext(ScreenAnimationContext);
23
+
21
24
  const {
22
25
  screenInterpolatorProps,
23
26
  nextInterpolator,
@@ -34,6 +37,17 @@ const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
34
37
  };
35
38
  });
36
39
 
40
+ const ancestorScreenAnimations = useMemo(() => {
41
+ if (!parentContext) {
42
+ return [];
43
+ }
44
+
45
+ return [
46
+ parentContext.screenAnimation,
47
+ ...parentContext.ancestorScreenAnimations,
48
+ ];
49
+ }, [parentContext]);
50
+
37
51
  const value = useMemo(
38
52
  () => ({
39
53
  screenInterpolatorProps,
@@ -41,6 +55,7 @@ const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
41
55
  currentInterpolator,
42
56
  boundsAccessor,
43
57
  screenAnimation,
58
+ ancestorScreenAnimations,
44
59
  }),
45
60
  [
46
61
  screenInterpolatorProps,
@@ -48,10 +63,31 @@ const { ScreenAnimationProvider, useScreenAnimationContext } = createProvider(
48
63
  currentInterpolator,
49
64
  boundsAccessor,
50
65
  screenAnimation,
66
+ ancestorScreenAnimations,
51
67
  ],
52
68
  );
53
69
 
54
- return { value };
55
- });
70
+ return (
71
+ <ScreenAnimationContext.Provider value={value}>
72
+ {children}
73
+ </ScreenAnimationContext.Provider>
74
+ );
75
+ }
56
76
 
57
- export { ScreenAnimationProvider, useScreenAnimationContext };
77
+ function useScreenAnimationContext(): ScreenAnimationContextValue {
78
+ const context = useContext(ScreenAnimationContext);
79
+
80
+ if (!context) {
81
+ throw new Error(
82
+ "ScreenAnimation context must be used within a ScreenAnimationProvider",
83
+ );
84
+ }
85
+
86
+ return context;
87
+ }
88
+
89
+ export {
90
+ ScreenAnimationContext,
91
+ ScreenAnimationProvider,
92
+ useScreenAnimationContext,
93
+ };
@@ -24,18 +24,10 @@ export const derivations = ({ previous, current, next }: DerivationsParams) => {
24
24
  // The screen NOT driving the transition
25
25
  const inactive = focused ? previous : current;
26
26
 
27
- // deprecated
28
- const isActiveTransitioning = !!(active.gesture.dragging || active.animating);
29
-
30
- // deprecated
31
- const isDismissing = !!(active.gesture.dismissing || active.closing);
32
-
33
27
  return {
34
28
  progress,
35
29
  focused,
36
30
  active,
37
31
  inactive,
38
- isActiveTransitioning,
39
- isDismissing,
40
32
  };
41
33
  };
@@ -175,11 +175,24 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
175
175
  const currentRouteKey = currentDescriptor?.route?.key;
176
176
  const currentIndex = routeKeys.indexOf(currentRouteKey);
177
177
 
178
- const sortedSnapPoints = useMemo(() => {
178
+ const sortedNumericSnapPoints = useMemo(() => {
179
179
  const points = currentDescriptor?.options?.snapPoints;
180
- return points ? [...points].sort((a, b) => a - b) : [];
180
+ if (!points) return [];
181
+ return points
182
+ .filter((p): p is number => typeof p === "number")
183
+ .sort((a, b) => a - b);
181
184
  }, [currentDescriptor?.options?.snapPoints]);
182
185
 
186
+ const hasAutoSnapPoint = useMemo(
187
+ () => currentDescriptor?.options?.snapPoints?.includes("auto") ?? false,
188
+ [currentDescriptor?.options?.snapPoints],
189
+ );
190
+
191
+ const autoSnapPointValue = AnimationStore.getAnimation(
192
+ currentRouteKey ?? "_",
193
+ "autoSnapPoint",
194
+ );
195
+
183
196
  const nextRouteKey = nextDescriptor?.route?.key;
184
197
  const nextHasTransitions =
185
198
  !!nextRouteKey &&
@@ -199,8 +212,6 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
199
212
  focused: true,
200
213
  active: DEFAULT_SCREEN_TRANSITION_STATE,
201
214
  inactive: undefined,
202
- isActiveTransitioning: false,
203
- isDismissing: false,
204
215
  });
205
216
 
206
217
  const boundsAccessor = useMemo(() => {
@@ -238,7 +249,17 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
238
249
  const stackProgress =
239
250
  currentIndex >= 0 ? rootStackProgress.value - currentIndex : progress;
240
251
 
241
- const snapIndex = computeSnapIndex(current.progress, sortedSnapPoints);
252
+ // Resolve 'auto' snap point reactively so computeSnapIndex stays accurate
253
+ const resolvedAutoSnap =
254
+ hasAutoSnapPoint && autoSnapPointValue.value > 0
255
+ ? autoSnapPointValue.value
256
+ : null;
257
+ const resolvedSnapPoints =
258
+ resolvedAutoSnap !== null
259
+ ? [...sortedNumericSnapPoints, resolvedAutoSnap].sort((a, b) => a - b)
260
+ : sortedNumericSnapPoints;
261
+
262
+ const snapIndex = computeSnapIndex(current.progress, resolvedSnapPoints);
242
263
 
243
264
  const nextProps = {
244
265
  layouts: { screen: dimensions },
@@ -0,0 +1,44 @@
1
+ import type { DerivedValue } from "react-native-reanimated";
2
+ import type { ScreenInterpolationProps } from "../../../../types/animation.types";
3
+ import type { ScreenAnimationTarget } from "../types";
4
+
5
+ type Params = {
6
+ target: ScreenAnimationTarget | undefined;
7
+ self: DerivedValue<ScreenInterpolationProps>;
8
+ ancestors: DerivedValue<ScreenInterpolationProps>[];
9
+ };
10
+
11
+ const isAncestorTarget = (
12
+ target: ScreenAnimationTarget,
13
+ ): target is { ancestor: number } => {
14
+ return typeof target === "object" && target !== null && "ancestor" in target;
15
+ };
16
+
17
+ export function resolveScreenAnimationTarget({
18
+ target,
19
+ self,
20
+ ancestors,
21
+ }: Params): DerivedValue<ScreenInterpolationProps> {
22
+ if (!target || target === "self") {
23
+ return self;
24
+ }
25
+
26
+ if (target === "parent") {
27
+ return ancestors[0] ?? self;
28
+ }
29
+
30
+ if (target === "root") {
31
+ return ancestors[ancestors.length - 1] ?? self;
32
+ }
33
+
34
+ if (!isAncestorTarget(target)) {
35
+ return self;
36
+ }
37
+
38
+ const depth = target.ancestor;
39
+ if (!Number.isInteger(depth) || depth < 1) {
40
+ return self;
41
+ }
42
+
43
+ return ancestors[depth - 1] ?? self;
44
+ }
@@ -2,4 +2,7 @@ export {
2
2
  ScreenAnimationProvider,
3
3
  useScreenAnimationContext,
4
4
  } from "./animation.provider";
5
- export { useScreenAnimation } from "./use-screen-animation";
5
+ export {
6
+ type ScreenAnimationTarget,
7
+ useScreenAnimation,
8
+ } from "./use-screen-animation";
@@ -0,0 +1,5 @@
1
+ export type ScreenAnimationTarget =
2
+ | "self"
3
+ | "parent"
4
+ | "root"
5
+ | { ancestor: number };
@@ -1,6 +1,19 @@
1
+ import type { DerivedValue } from "react-native-reanimated";
2
+ import type { ScreenInterpolationProps } from "../../../types/animation.types";
1
3
  import { useScreenAnimationContext } from "./animation.provider";
4
+ import { resolveScreenAnimationTarget } from "./helpers/resolve-screen-animation-target";
5
+ import type { ScreenAnimationTarget } from "./types";
2
6
 
3
- export function useScreenAnimation() {
4
- const { screenAnimation } = useScreenAnimationContext();
5
- return screenAnimation;
7
+ export type { ScreenAnimationTarget } from "./types";
8
+
9
+ export function useScreenAnimation(
10
+ target?: ScreenAnimationTarget,
11
+ ): DerivedValue<ScreenInterpolationProps> {
12
+ const { screenAnimation, ancestorScreenAnimations } =
13
+ useScreenAnimationContext();
14
+ return resolveScreenAnimationTarget({
15
+ target,
16
+ self: screenAnimation,
17
+ ancestors: ancestorScreenAnimations,
18
+ });
6
19
  }
@@ -14,7 +14,7 @@ import type {
14
14
  DirectStackProps,
15
15
  DirectStackScene,
16
16
  } from "../../types/providers/direct-stack.types";
17
- import { isFloatOverlayVisible } from "../../utils/overlay/visibility";
17
+ import { isOverlayVisible } from "../../utils/overlay/visibility";
18
18
  import { useStackCoreContext } from "./core.provider";
19
19
  import { useStackDerived } from "./helpers/use-stack-derived";
20
20
 
@@ -64,10 +64,7 @@ function useDirectStackValue(
64
64
 
65
65
  if (!shouldShowFloatOverlay && descriptor) {
66
66
  const options = descriptor.options;
67
- if (
68
- options?.enableTransitions === true &&
69
- isFloatOverlayVisible(options)
70
- ) {
67
+ if (options?.enableTransitions === true && isOverlayVisible(options)) {
71
68
  shouldShowFloatOverlay = true;
72
69
  }
73
70
  }
@@ -7,7 +7,7 @@ import type {
7
7
  BaseStackDescriptor,
8
8
  BaseStackScene,
9
9
  } from "../../../types/stack.types";
10
- import { isFloatOverlayVisible } from "../../../utils/overlay/visibility";
10
+ import { isOverlayVisible } from "../../../utils/overlay/visibility";
11
11
 
12
12
  export interface ProcessedRoutes<
13
13
  TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
@@ -52,7 +52,7 @@ export function useProcessedRoutes<
52
52
  animationMaps[i] = AnimationStore.getRouteAnimations(route.key);
53
53
 
54
54
  if (!shouldShowFloatOverlay) {
55
- shouldShowFloatOverlay = isFloatOverlayVisible(options);
55
+ shouldShowFloatOverlay = isOverlayVisible(options);
56
56
  }
57
57
 
58
58
  if (!stopLimit) {
@@ -11,6 +11,8 @@ export type AnimationStoreMap = {
11
11
  closing: SharedValue<number>;
12
12
  entering: SharedValue<number>;
13
13
  targetProgress: SharedValue<number>;
14
+ /** Resolved fraction (contentHeight / screenHeight) for the 'auto' snap point. -1 = not yet measured. */
15
+ autoSnapPoint: SharedValue<number>;
14
16
  };
15
17
 
16
18
  const store: Record<ScreenKey, AnimationStoreMap> = {};
@@ -20,8 +22,9 @@ function createAnimationBag(): AnimationStoreMap {
20
22
  progress: makeMutable(0),
21
23
  closing: makeMutable(0),
22
24
  animating: makeMutable(0),
23
- entering: makeMutable(1),
25
+ entering: makeMutable(0),
24
26
  targetProgress: makeMutable(1),
27
+ autoSnapPoint: makeMutable(-1),
25
28
  };
26
29
  }
27
30
 
@@ -47,6 +50,13 @@ function getRouteAnimation(
47
50
  return ensure(routeKey)[type];
48
51
  }
49
52
 
53
+ function getAnimation(
54
+ routeKey: ScreenKey,
55
+ type: keyof AnimationStoreMap,
56
+ ): SharedValue<number> {
57
+ return getRouteAnimation(routeKey, type);
58
+ }
59
+
50
60
  function getRouteAnimations(routeKey: ScreenKey): AnimationStoreMap {
51
61
  return ensure(routeKey);
52
62
  }
@@ -59,11 +69,13 @@ function clear(routeKey: ScreenKey) {
59
69
  cancelAnimation(bag.closing);
60
70
  cancelAnimation(bag.entering);
61
71
  cancelAnimation(bag.targetProgress);
72
+ cancelAnimation(bag.autoSnapPoint);
62
73
  }
63
74
  delete store[routeKey];
64
75
  }
65
76
 
66
77
  export const AnimationStore = {
78
+ getAnimation,
67
79
  peekRouteAnimations,
68
80
  getRouteAnimation,
69
81
  getRouteAnimations,
@@ -1,3 +1,4 @@
1
+ import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
1
2
  import { matchesScreenKey } from "../helpers/matching";
2
3
  import type {
3
4
  ResolvedTransitionPair,
@@ -69,7 +70,11 @@ function findPendingLinkBySource(
69
70
  function getSnapshotBoundsByPriority(
70
71
  tag: TagID,
71
72
  keys: (ScreenKey | undefined)[],
72
- ): { bounds: any; screenKey: ScreenKey } | null {
73
+ ): {
74
+ bounds: MeasuredDimensions;
75
+ styles: StyleProps;
76
+ screenKey: ScreenKey;
77
+ } | null {
73
78
  "worklet";
74
79
  for (let i = 0; i < keys.length; i++) {
75
80
  const key = keys[i];
@@ -78,6 +83,7 @@ function getSnapshotBoundsByPriority(
78
83
  if (!snapshot) continue;
79
84
  return {
80
85
  bounds: snapshot.bounds,
86
+ styles: snapshot.styles,
81
87
  screenKey: key,
82
88
  };
83
89
  }
@@ -149,6 +155,8 @@ function resolveTransitionPair(
149
155
 
150
156
  let sourceBounds = matchedLink?.source?.bounds ?? null;
151
157
  let destinationBounds = matchedLink?.destination?.bounds ?? null;
158
+ let sourceStyles = matchedLink?.source?.styles ?? null;
159
+ let destinationStyles = matchedLink?.destination?.styles ?? null;
152
160
  let sourceScreenKey = matchedLink?.source?.screenKey ?? null;
153
161
  let destinationScreenKey = matchedLink?.destination?.screenKey ?? null;
154
162
  let usedSnapshotSource = false;
@@ -174,6 +182,7 @@ function resolveTransitionPair(
174
182
  const sourceSnapshot = getSnapshotBoundsByPriority(tag, sourceFallbackKeys);
175
183
  if (sourceSnapshot) {
176
184
  sourceBounds = sourceSnapshot.bounds;
185
+ sourceStyles = sourceSnapshot.styles;
177
186
  sourceScreenKey = sourceSnapshot.screenKey;
178
187
  usedSnapshotSource = true;
179
188
  }
@@ -186,6 +195,7 @@ function resolveTransitionPair(
186
195
  );
187
196
  if (destinationSnapshot) {
188
197
  destinationBounds = destinationSnapshot.bounds;
198
+ destinationStyles = destinationSnapshot.styles;
189
199
  destinationScreenKey = destinationSnapshot.screenKey;
190
200
  usedSnapshotDestination = true;
191
201
  }
@@ -202,6 +212,8 @@ function resolveTransitionPair(
202
212
  return {
203
213
  sourceBounds,
204
214
  destinationBounds,
215
+ sourceStyles,
216
+ destinationStyles,
205
217
  sourceScreenKey,
206
218
  destinationScreenKey,
207
219
  usedPending,
@@ -43,6 +43,8 @@ export type ResolveTransitionContext = {
43
43
  export type ResolvedTransitionPair = {
44
44
  sourceBounds: MeasuredDimensions | null;
45
45
  destinationBounds: MeasuredDimensions | null;
46
+ sourceStyles: StyleProps | null;
47
+ destinationStyles: StyleProps | null;
46
48
  sourceScreenKey: ScreenKey | null;
47
49
  destinationScreenKey: ScreenKey | null;
48
50
  usedPending: boolean;