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
@@ -1,47 +1,52 @@
1
1
  /** biome-ignore-all lint/style/noNonNullAssertion: <Screen gesture is under the gesture context, so this will always exist.> */
2
- import { memo, useEffect } from "react";
3
- import { StyleSheet, View } from "react-native";
2
+ import { memo, useCallback } from "react";
3
+ import {
4
+ type LayoutChangeEvent,
5
+ StyleSheet,
6
+ useWindowDimensions,
7
+ View,
8
+ } from "react-native";
4
9
  import { GestureDetector } from "react-native-gesture-handler";
5
10
  import Animated, {
11
+ runOnUI,
6
12
  useAnimatedProps,
7
13
  useAnimatedStyle,
8
14
  } from "react-native-reanimated";
9
- import {
10
- NAVIGATION_CONTAINER_STYLE_ID,
11
- NAVIGATION_MASK_STYLE_ID,
12
- NO_PROPS,
13
- NO_STYLES,
14
- } from "../../../constants";
15
+ import { NO_PROPS, NO_STYLES } from "../../../constants";
15
16
  import { useGestureContext } from "../../../providers/gestures";
16
- import { useDescriptors } from "../../../providers/screen/descriptors";
17
+ import {
18
+ useDescriptorDerivations,
19
+ useDescriptors,
20
+ } from "../../../providers/screen/descriptors";
17
21
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
18
- import { logger } from "../../../utils/logger";
22
+ import { AnimationStore } from "../../../stores/animation.store";
23
+ import { animateToProgress } from "../../../utils/animation/animate-to-progress";
19
24
  import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
25
+ import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
20
26
  import { SurfaceContainer } from "./surface-container";
21
27
 
22
28
  type Props = {
23
29
  children: React.ReactNode;
24
30
  };
25
31
 
26
- let LazyMaskedView = View;
27
-
28
- try {
29
- LazyMaskedView = require("@react-native-masked-view/masked-view").default;
30
- } catch (_) {
31
- // optional peer dependency
32
- }
33
-
34
- let hasWarnedMissingMaskedView = false;
35
-
36
32
  export const ContentLayer = memo(({ children }: Props) => {
37
33
  const { stylesMap } = useScreenStyles();
38
34
  const { current } = useDescriptors();
35
+ const { isFirstKey } = useDescriptorDerivations();
39
36
  const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
40
37
  const gestureContext = useGestureContext();
38
+ const { height: screenHeight } = useWindowDimensions();
41
39
  const isNavigationMaskEnabled = !!current.options.maskEnabled;
42
40
  const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
41
+ const routeKey = current.route.key;
42
+ const animations = AnimationStore.getRouteAnimations(routeKey);
43
+ const autoSnapPointValue = AnimationStore.getAnimation(
44
+ routeKey,
45
+ "autoSnapPoint",
46
+ );
47
+ const hasAutoSnapPoint =
48
+ current.options.snapPoints?.includes("auto") ?? false;
43
49
 
44
- // ── Content ──
45
50
  const animatedContentStyle = useAnimatedStyle(() => {
46
51
  "worklet";
47
52
  return stylesMap.value.content?.style || NO_STYLES;
@@ -52,54 +57,53 @@ export const ContentLayer = memo(({ children }: Props) => {
52
57
  return stylesMap.value.content?.props ?? NO_PROPS;
53
58
  });
54
59
 
55
- // ── Navigation mask / container ──
56
- const animatedNavigationContainerStyle = useAnimatedStyle(() => {
57
- "worklet";
58
- return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
59
- });
60
+ const handleContentLayout = useCallback(
61
+ (event: LayoutChangeEvent) => {
62
+ const contentHeight = event.nativeEvent.layout.height;
63
+ if (contentHeight <= 0) return;
60
64
 
61
- const animatedNavigationMaskStyle = useAnimatedStyle(() => {
62
- "worklet";
63
- return stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
64
- });
65
+ const fraction = Math.min(contentHeight / screenHeight, 1);
66
+ const transitionSpec = current.options.transitionSpec;
65
67
 
66
- useEffect(() => {
67
- if (!isNavigationMaskEnabled) return;
68
- if (LazyMaskedView !== View) return;
69
- if (hasWarnedMissingMaskedView) return;
68
+ runOnUI(
69
+ (
70
+ nextFraction: number,
71
+ isInitialScreen: boolean,
72
+ spec: typeof transitionSpec,
73
+ ) => {
74
+ "worklet";
75
+ const isFirstMeasurement = autoSnapPointValue.value <= 0;
76
+ autoSnapPointValue.value = nextFraction;
70
77
 
71
- hasWarnedMissingMaskedView = true;
72
- logger.warn(
73
- "maskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
74
- );
75
- }, [isNavigationMaskEnabled]);
78
+ if (
79
+ !isFirstMeasurement ||
80
+ animations.progress.value !== 0 ||
81
+ animations.animating.value !== 0
82
+ ) {
83
+ return;
84
+ }
76
85
 
77
- const contentChildren = isNavigationMaskEnabled ? (
78
- LazyMaskedView !== View ? (
79
- <LazyMaskedView
80
- style={styles.navigationMaskedRoot}
81
- // @ts-expect-error masked-view package types are too strict here
82
- maskElement={
83
- <Animated.View
84
- style={[styles.navigationMaskElement, animatedNavigationMaskStyle]}
85
- />
86
- }
87
- >
88
- <Animated.View
89
- style={[styles.navigationContainer, animatedNavigationContainerStyle]}
90
- >
91
- {children}
92
- </Animated.View>
93
- </LazyMaskedView>
94
- ) : (
95
- <Animated.View
96
- style={[styles.navigationContainer, animatedNavigationContainerStyle]}
97
- >
98
- {children}
99
- </Animated.View>
100
- )
101
- ) : (
102
- children
86
+ if (isInitialScreen) {
87
+ animations.targetProgress.value = nextFraction;
88
+ animations.progress.value = nextFraction;
89
+ return;
90
+ }
91
+
92
+ animateToProgress({
93
+ target: nextFraction,
94
+ spec,
95
+ animations,
96
+ });
97
+ },
98
+ )(fraction, isFirstKey, transitionSpec);
99
+ },
100
+ [
101
+ animations,
102
+ autoSnapPointValue,
103
+ current.options.transitionSpec,
104
+ isFirstKey,
105
+ screenHeight,
106
+ ],
103
107
  );
104
108
 
105
109
  return (
@@ -109,9 +113,17 @@ export const ContentLayer = memo(({ children }: Props) => {
109
113
  animatedProps={animatedContentProps}
110
114
  pointerEvents={contentPointerEvents}
111
115
  >
112
- <SurfaceContainer pointerEvents={contentPointerEvents}>
113
- {contentChildren}
114
- </SurfaceContainer>
116
+ <MaybeMaskedNavigationContainer enabled={isNavigationMaskEnabled}>
117
+ <SurfaceContainer pointerEvents={contentPointerEvents}>
118
+ {hasAutoSnapPoint ? (
119
+ <View collapsable={false} onLayout={handleContentLayout}>
120
+ {children}
121
+ </View>
122
+ ) : (
123
+ children
124
+ )}
125
+ </SurfaceContainer>
126
+ </MaybeMaskedNavigationContainer>
115
127
  </Animated.View>
116
128
  </GestureDetector>
117
129
  );
@@ -121,13 +133,4 @@ const styles = StyleSheet.create({
121
133
  content: {
122
134
  flex: 1,
123
135
  },
124
- navigationMaskedRoot: {
125
- flex: 1,
126
- },
127
- navigationMaskElement: {
128
- backgroundColor: "white",
129
- },
130
- navigationContainer: {
131
- flex: 1,
132
- },
133
136
  });
@@ -0,0 +1,93 @@
1
+ import { memo, useEffect } from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
+ import {
5
+ NAVIGATION_CONTAINER_STYLE_ID,
6
+ NAVIGATION_MASK_STYLE_ID,
7
+ NO_STYLES,
8
+ } from "../../../constants";
9
+ import { useScreenStyles } from "../../../providers/screen/styles.provider";
10
+ import { logger } from "../../../utils/logger";
11
+
12
+ type Props = {
13
+ enabled: boolean;
14
+ children: React.ReactNode;
15
+ };
16
+
17
+ let LazyMaskedView = View;
18
+
19
+ try {
20
+ LazyMaskedView = require("@react-native-masked-view/masked-view").default;
21
+ } catch (_) {
22
+ // optional peer dependency
23
+ }
24
+
25
+ let hasWarnedMissingMaskedView = false;
26
+
27
+ export const MaybeMaskedNavigationContainer = memo(
28
+ ({ enabled, children }: Props) => {
29
+ const { stylesMap } = useScreenStyles();
30
+ const animatedNavigationContainerStyle = useAnimatedStyle(() => {
31
+ "worklet";
32
+ return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
33
+ });
34
+
35
+ const animatedNavigationMaskStyle = useAnimatedStyle(() => {
36
+ "worklet";
37
+ return stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
38
+ });
39
+
40
+ useEffect(() => {
41
+ if (!enabled) return;
42
+ if (LazyMaskedView !== View) return;
43
+ if (hasWarnedMissingMaskedView) return;
44
+
45
+ hasWarnedMissingMaskedView = true;
46
+ logger.warn(
47
+ "maskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
48
+ );
49
+ }, [enabled]);
50
+
51
+ if (!enabled) return children;
52
+
53
+ if (LazyMaskedView === View) {
54
+ return (
55
+ <Animated.View
56
+ style={[styles.navigationContainer, animatedNavigationContainerStyle]}
57
+ >
58
+ {children}
59
+ </Animated.View>
60
+ );
61
+ }
62
+
63
+ return (
64
+ <LazyMaskedView
65
+ style={styles.navigationMaskedRoot}
66
+ // @ts-expect-error masked-view package types are too strict here
67
+ maskElement={
68
+ <Animated.View
69
+ style={[styles.navigationMaskElement, animatedNavigationMaskStyle]}
70
+ />
71
+ }
72
+ >
73
+ <Animated.View
74
+ style={[styles.navigationContainer, animatedNavigationContainerStyle]}
75
+ >
76
+ {children}
77
+ </Animated.View>
78
+ </LazyMaskedView>
79
+ );
80
+ },
81
+ );
82
+
83
+ const styles = StyleSheet.create({
84
+ navigationMaskedRoot: {
85
+ flex: 1,
86
+ },
87
+ navigationMaskElement: {
88
+ backgroundColor: "white",
89
+ },
90
+ navigationContainer: {
91
+ flex: 1,
92
+ },
93
+ });
@@ -1,7 +1,6 @@
1
- import { useEffect, useLayoutEffect } from "react";
1
+ import { useLayoutEffect } from "react";
2
2
  import {
3
3
  runOnJS,
4
- runOnUI,
5
4
  useAnimatedReaction,
6
5
  useDerivedValue,
7
6
  } from "react-native-reanimated";
@@ -1,19 +1,22 @@
1
1
  import { useLayoutEffect } from "react";
2
2
  import type { BaseDescriptor } from "../../../providers/screen/descriptors";
3
3
  import type { AnimationStoreMap } from "../../../stores/animation.store";
4
+ import type { SnapPoint } from "../../../types/screen.types";
4
5
  import { animateToProgress } from "../../../utils/animation/animate-to-progress";
5
6
  import { useHighRefreshRate } from "./use-high-refresh-rate";
6
7
 
7
8
  /**
8
9
  * Calculates the initial progress value based on snap points configuration.
10
+ * Returns `'auto'` if the initial snap point is the `'auto'` keyword
11
+ * (meaning the animation must be deferred until content is measured).
9
12
  */
10
13
  function getInitialProgress({
11
14
  snapPoints,
12
15
  initialSnapIndex,
13
16
  }: {
14
- snapPoints?: number[];
17
+ snapPoints?: SnapPoint[];
15
18
  initialSnapIndex: number;
16
- }): number | undefined {
19
+ }): number | "auto" | undefined {
17
20
  if (!snapPoints) {
18
21
  return undefined;
19
22
  }
@@ -41,14 +44,25 @@ export function useOpenTransition(
41
44
  useLayoutEffect(() => {
42
45
  const { snapPoints, initialSnapIndex = 0 } = current.options;
43
46
  const targetProgress = getInitialProgress({ snapPoints, initialSnapIndex });
44
- const target = targetProgress ?? 1;
45
47
 
46
48
  if (isFirstKey) {
47
- animations.targetProgress.set(target);
48
- animations.progress.set(target);
49
+ if (targetProgress === "auto") {
50
+ animations.targetProgress.set(0);
51
+ animations.progress.set(0);
52
+ } else {
53
+ const target = targetProgress ?? 1;
54
+ animations.targetProgress.set(target);
55
+ animations.progress.set(target);
56
+ }
49
57
  animations.animating.set(0);
50
58
  animations.closing.set(0);
51
- animations.entering.set(1);
59
+ animations.entering.set(0);
60
+ return;
61
+ }
62
+
63
+ // When the initial snap point is 'auto', defer the opening animation until
64
+ // ScreenContainer has measured the content and set autoSnapPoint.
65
+ if (targetProgress === "auto") {
52
66
  return;
53
67
  }
54
68
 
@@ -11,6 +11,10 @@ import type { BaseStackRoute } from "./types/stack.types";
11
11
  */
12
12
  export const MASK_STYLE_ID = "_ROOT_MASKED";
13
13
  export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
14
+
15
+ /**
16
+ * Navigation mask integration
17
+ */
14
18
  export const NAVIGATION_MASK_HOST_FLAG_STYLE_ID = "_NAVIGATION_MASK_HOST";
15
19
  export const NAVIGATION_MASK_STYLE_ID = "_NAVIGATION_ROOT_MASK";
16
20
  export const NAVIGATION_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
@@ -51,7 +55,7 @@ export const createScreenTransitionState = (
51
55
  closing: 0,
52
56
  animating: 0,
53
57
  settled: 1,
54
- entering: 1,
58
+ entering: 0,
55
59
  gesture: { ...DEFAULT_GESTURE_VALUES },
56
60
  route,
57
61
  meta,
@@ -66,7 +70,7 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
66
70
  closing: 0,
67
71
  animating: 0,
68
72
  settled: 1,
69
- entering: 1,
73
+ entering: 0,
70
74
  gesture: DEFAULT_GESTURE_VALUES,
71
75
  route: {} as RouteProp<ParamListBase>,
72
76
  });
@@ -0,0 +1,66 @@
1
+ import type { GestureContextType } from "../../providers/gestures";
2
+ import type { ScreenGestureTarget } from "./types";
3
+
4
+ type ScreenGestureRef = GestureContextType["panGestureRef"] | null;
5
+
6
+ type Params = {
7
+ target: ScreenGestureTarget | undefined;
8
+ self: GestureContextType | null | undefined;
9
+ };
10
+
11
+ const isAncestorTarget = (
12
+ target: ScreenGestureTarget,
13
+ ): target is { ancestor: number } => {
14
+ return typeof target === "object" && target !== null && "ancestor" in target;
15
+ };
16
+
17
+ function getGestureAncestors(self: GestureContextType): GestureContextType[] {
18
+ const ancestors: GestureContextType[] = [];
19
+ const startIsolated = self.isIsolated;
20
+ let current = self.ancestorContext;
21
+
22
+ while (current) {
23
+ if (current.isIsolated !== startIsolated) {
24
+ break;
25
+ }
26
+
27
+ ancestors.push(current);
28
+ current = current.ancestorContext;
29
+ }
30
+
31
+ return ancestors;
32
+ }
33
+
34
+ export function resolveScreenGestureTarget({
35
+ target,
36
+ self,
37
+ }: Params): ScreenGestureRef {
38
+ if (!self) {
39
+ return null;
40
+ }
41
+
42
+ if (!target || target === "self") {
43
+ return self.panGestureRef ?? null;
44
+ }
45
+
46
+ const ancestors = getGestureAncestors(self);
47
+
48
+ if (target === "parent") {
49
+ return ancestors[0]?.panGestureRef ?? null;
50
+ }
51
+
52
+ if (target === "root") {
53
+ return ancestors[ancestors.length - 1]?.panGestureRef ?? null;
54
+ }
55
+
56
+ if (!isAncestorTarget(target)) {
57
+ return null;
58
+ }
59
+
60
+ const depth = target.ancestor;
61
+ if (!Number.isInteger(depth) || depth < 1) {
62
+ return null;
63
+ }
64
+
65
+ return ancestors[depth - 1]?.panGestureRef ?? null;
66
+ }
@@ -0,0 +1,5 @@
1
+ export type ScreenGestureTarget =
2
+ | "self"
3
+ | "parent"
4
+ | "root"
5
+ | { ancestor: number };
@@ -1,7 +1,11 @@
1
1
  import { useGestureContext } from "../../providers/gestures";
2
+ import { resolveScreenGestureTarget } from "./resolve-screen-gesture-target";
3
+ import type { ScreenGestureTarget } from "./types";
4
+
5
+ export type { ScreenGestureTarget } from "./types";
2
6
 
3
7
  /**
4
- * Returns a ref to the screen's navigation pan gesture.
8
+ * Returns a ref to a screen navigation pan gesture.
5
9
  * Use this to coordinate child gestures with the navigation gesture.
6
10
  *
7
11
  * @example
@@ -13,7 +17,10 @@ import { useGestureContext } from "../../providers/gestures";
13
17
  * .onUpdate(...);
14
18
  * ```
15
19
  */
16
- export const useScreenGesture = () => {
20
+ export const useScreenGesture = (target?: ScreenGestureTarget) => {
17
21
  const ctx = useGestureContext();
18
- return ctx?.panGestureRef ?? null;
22
+ return resolveScreenGestureTarget({
23
+ target,
24
+ self: ctx,
25
+ });
19
26
  };
@@ -2,7 +2,7 @@ import type { Route } from "@react-navigation/native";
2
2
  import { createContext, useContext } from "react";
3
3
  import type { DerivedValue } from "react-native-reanimated";
4
4
  import type { StackCoreContextValue } from "../../providers/stack/core.provider";
5
- import type { OverlayMode, OverlayProps } from "../../types/overlay.types";
5
+ import type { OverlayProps } from "../../types/overlay.types";
6
6
  import type {
7
7
  BaseStackDescriptor,
8
8
  BaseStackNavigation,
@@ -16,7 +16,6 @@ export interface StackDescriptor<
16
16
  > extends BaseStackDescriptor<TRoute, TNavigation> {
17
17
  options: BaseStackDescriptor["options"] & {
18
18
  overlay?: (props: OverlayProps) => React.ReactNode;
19
- overlayMode?: OverlayMode;
20
19
  overlayShown?: boolean;
21
20
  meta?: Record<string, unknown>;
22
21
  enableTransitions?: boolean;
@@ -3,7 +3,6 @@ import {
3
3
  Boundary,
4
4
  createBoundaryComponent,
5
5
  } from "./components/create-boundary-component";
6
- import { buildBoundaryMatchKey } from "./components/create-boundary-component/utils/build-boundary-match-key";
7
6
  import { createTransitionAwareComponent } from "./components/create-transition-aware-component";
8
7
  import MaskedView from "./components/integrations/masked-view";
9
8
  import { Presets, Specs } from "./configs";
@@ -26,36 +25,35 @@ export default {
26
25
  };
27
26
 
28
27
  export { snapTo } from "./animation/snap-to";
29
- export { useScreenGesture } from "./hooks/gestures/use-screen-gesture";
28
+ export {
29
+ NAVIGATION_CONTAINER_STYLE_ID,
30
+ NAVIGATION_MASK_HOST_FLAG_STYLE_ID,
31
+ NAVIGATION_MASK_STYLE_ID,
32
+ } from "./constants";
33
+ export {
34
+ type ScreenGestureTarget,
35
+ useScreenGesture,
36
+ } from "./hooks/gestures/use-screen-gesture";
30
37
  export { useHistory } from "./hooks/navigation/use-history";
31
38
  export {
32
39
  type ScreenState,
33
40
  useScreenState,
34
41
  } from "./hooks/navigation/use-screen-state";
35
- export { useScreenAnimation } from "./providers/screen/animation";
36
- export { buildBoundaryMatchKey };
42
+ export {
43
+ type ScreenAnimationTarget,
44
+ useScreenAnimation,
45
+ } from "./providers/screen/animation";
37
46
 
38
47
  export type {
39
48
  AnimatedViewStyle,
40
49
  AnimationConfig,
41
- BoundEntry,
42
- BoundsLink,
43
50
  BoundsNavigationAccessor,
44
- BoundsNavigationOptions,
45
- BoundsNavigationPreset,
46
- BoundsStyleOptions,
47
- LegacyTransitionInterpolatedStyle,
48
- NewTransitionInterpolatedStyle,
49
- NormalizedTransitionInterpolatedStyle,
50
- NormalizedTransitionSlotStyle,
51
- OverlayInterpolationProps,
52
- OverlayMode,
51
+ BoundsNavigationZoomOptions,
53
52
  OverlayProps,
54
53
  ScreenInterpolationProps,
55
54
  ScreenStyleInterpolator,
56
55
  ScreenTransitionConfig,
57
56
  TransitionInterpolatedStyle,
58
- TransitionSlotExplicit,
59
57
  TransitionSlotStyle,
60
58
  TransitionSpec,
61
59
  } from "./types";