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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (535) hide show
  1. package/README.md +11 -1046
  2. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
  3. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  4. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
  5. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
  6. package/lib/commonjs/shared/animation/snap-to.js +5 -1
  7. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
  15. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
  16. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
  17. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  18. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
  19. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
  20. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
  21. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  22. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
  23. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  24. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
  25. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
  26. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
  27. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
  28. package/lib/commonjs/shared/components/create-boundary-component/index.js +22 -8
  29. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  30. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
  31. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
  32. package/lib/commonjs/shared/components/create-transition-aware-component.js +3 -2
  33. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  34. package/lib/commonjs/shared/components/native-screen-container.js +12 -6
  35. package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
  36. package/lib/commonjs/shared/components/native-screen.js +35 -8
  37. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  38. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +2 -2
  39. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  40. package/lib/commonjs/shared/components/overlay/index.js +1 -3
  41. package/lib/commonjs/shared/components/overlay/index.js.map +1 -1
  42. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +2 -16
  43. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  44. package/lib/commonjs/shared/components/scene-view.js +2 -4
  45. package/lib/commonjs/shared/components/scene-view.js.map +1 -1
  46. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
  47. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
  48. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +9 -6
  49. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  50. package/lib/commonjs/shared/components/screen-container/layers/content.js +16 -56
  51. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  52. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +86 -0
  53. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
  54. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  55. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
  56. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  57. package/lib/commonjs/shared/constants.js +6 -2
  58. package/lib/commonjs/shared/constants.js.map +1 -1
  59. package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js +49 -0
  60. package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
  61. package/lib/commonjs/shared/hooks/gestures/types.js +2 -0
  62. package/lib/commonjs/shared/hooks/gestures/types.js.map +1 -0
  63. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js +7 -3
  64. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
  65. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  66. package/lib/commonjs/shared/index.js +15 -3
  67. package/lib/commonjs/shared/index.js.map +1 -1
  68. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +61 -25
  69. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  70. package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
  71. package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
  72. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +44 -0
  73. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
  74. package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
  75. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
  76. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +31 -17
  77. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -9
  79. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  80. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +25 -13
  81. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  82. package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +33 -0
  83. package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
  84. package/lib/commonjs/shared/providers/screen/animation/types.js +2 -0
  85. package/lib/commonjs/shared/providers/screen/animation/types.js.map +1 -0
  86. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +9 -3
  87. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  88. package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
  89. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
  90. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
  91. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  92. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  93. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  94. package/lib/commonjs/shared/stores/animation.store.js +10 -2
  95. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  96. package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
  97. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -0
  98. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  99. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +6 -0
  100. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  101. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
  102. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  103. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js +3 -2
  104. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -1
  105. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js +3 -2
  106. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +1 -1
  107. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js +2 -2
  108. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
  109. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
  110. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  111. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +4 -3
  112. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  113. package/lib/commonjs/shared/utils/bounds/index.js +13 -3
  114. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  115. package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
  116. package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
  117. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +54 -0
  118. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +1 -0
  119. package/lib/commonjs/shared/utils/bounds/zoom/build.js +548 -0
  120. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -0
  121. package/lib/commonjs/shared/utils/bounds/zoom/config.js +118 -0
  122. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -0
  123. package/lib/commonjs/shared/utils/bounds/zoom/index.js +20 -0
  124. package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +1 -0
  125. package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -0
  126. package/lib/commonjs/shared/utils/gesture/validate-snap-points.js +11 -5
  127. package/lib/commonjs/shared/utils/gesture/validate-snap-points.js.map +1 -1
  128. package/lib/commonjs/shared/utils/overlay/visibility.js +2 -9
  129. package/lib/commonjs/shared/utils/overlay/visibility.js.map +1 -1
  130. package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
  131. package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
  132. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
  133. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
  134. package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
  135. package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
  136. package/lib/module/shared/animation/snap-to.js +5 -1
  137. package/lib/module/shared/animation/snap-to.js.map +1 -1
  138. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
  139. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
  140. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
  141. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  142. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
  143. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  144. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
  145. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
  146. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
  147. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  148. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
  149. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
  150. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
  151. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  152. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
  153. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  154. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
  155. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
  156. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
  157. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
  158. package/lib/module/shared/components/create-boundary-component/index.js +22 -8
  159. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  160. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
  161. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
  162. package/lib/module/shared/components/create-transition-aware-component.js +3 -2
  163. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  164. package/lib/module/shared/components/native-screen-container.js +12 -6
  165. package/lib/module/shared/components/native-screen-container.js.map +1 -1
  166. package/lib/module/shared/components/native-screen.js +35 -8
  167. package/lib/module/shared/components/native-screen.js.map +1 -1
  168. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +3 -3
  169. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  170. package/lib/module/shared/components/overlay/index.js +1 -3
  171. package/lib/module/shared/components/overlay/index.js.map +1 -1
  172. package/lib/module/shared/components/overlay/variations/overlay-host.js +3 -17
  173. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  174. package/lib/module/shared/components/scene-view.js +3 -5
  175. package/lib/module/shared/components/scene-view.js.map +1 -1
  176. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
  177. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
  178. package/lib/module/shared/components/screen-container/layers/backdrop.js +9 -6
  179. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  180. package/lib/module/shared/components/screen-container/layers/content.js +18 -58
  181. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  182. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +81 -0
  183. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
  184. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  185. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
  186. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  187. package/lib/module/shared/constants.js +6 -2
  188. package/lib/module/shared/constants.js.map +1 -1
  189. package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js +45 -0
  190. package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
  191. package/lib/module/shared/hooks/gestures/types.js +2 -0
  192. package/lib/module/shared/hooks/gestures/types.js.map +1 -0
  193. package/lib/module/shared/hooks/gestures/use-screen-gesture.js +7 -4
  194. package/lib/module/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
  195. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  196. package/lib/module/shared/index.js +1 -2
  197. package/lib/module/shared/index.js.map +1 -1
  198. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +61 -25
  199. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  200. package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
  201. package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
  202. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +38 -0
  203. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
  204. package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
  205. package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
  206. package/lib/module/shared/providers/screen/animation/animation.provider.js +30 -15
  207. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  208. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -9
  209. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  210. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +25 -13
  211. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  212. package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +29 -0
  213. package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
  214. package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
  215. package/lib/module/shared/providers/screen/animation/types.js +2 -0
  216. package/lib/module/shared/providers/screen/animation/types.js.map +1 -0
  217. package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -3
  218. package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  219. package/lib/module/shared/providers/stack/core.provider.js +14 -21
  220. package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
  221. package/lib/module/shared/providers/stack/direct.provider.js +2 -2
  222. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  223. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +2 -2
  224. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  225. package/lib/module/shared/stores/animation.store.js +10 -2
  226. package/lib/module/shared/stores/animation.store.js.map +1 -1
  227. package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
  228. package/lib/module/shared/stores/bounds/internals/resolver.js +7 -0
  229. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  230. package/lib/module/shared/utils/animation/animate-to-progress.js +6 -0
  231. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  232. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
  233. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  234. package/lib/module/shared/utils/bounds/helpers/geometry.js +3 -2
  235. package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -1
  236. package/lib/module/shared/utils/bounds/helpers/interpolators.js +3 -2
  237. package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +1 -1
  238. package/lib/module/shared/utils/bounds/helpers/link-accessor.js +2 -2
  239. package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
  240. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
  241. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
  242. package/lib/module/shared/utils/bounds/helpers/style-composers.js +4 -3
  243. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
  244. package/lib/module/shared/utils/bounds/index.js +13 -3
  245. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  246. package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
  247. package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
  248. package/lib/module/shared/utils/bounds/zoom/accessor.js +49 -0
  249. package/lib/module/shared/utils/bounds/zoom/accessor.js.map +1 -0
  250. package/lib/module/shared/utils/bounds/zoom/build.js +543 -0
  251. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -0
  252. package/lib/module/shared/utils/bounds/zoom/config.js +112 -0
  253. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -0
  254. package/lib/module/shared/utils/bounds/zoom/index.js +5 -0
  255. package/lib/module/shared/utils/bounds/zoom/index.js.map +1 -0
  256. package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -0
  257. package/lib/module/shared/utils/gesture/validate-snap-points.js +11 -5
  258. package/lib/module/shared/utils/gesture/validate-snap-points.js.map +1 -1
  259. package/lib/module/shared/utils/overlay/visibility.js +1 -7
  260. package/lib/module/shared/utils/overlay/visibility.js.map +1 -1
  261. package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
  262. package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
  263. package/lib/typescript/blank-stack/index.d.ts +1 -1
  264. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  265. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
  266. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  267. package/lib/typescript/blank-stack/types.d.ts +33 -4
  268. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  269. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
  270. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  271. package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
  272. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
  273. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
  274. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
  275. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
  276. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
  277. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
  278. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
  279. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
  280. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
  281. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
  282. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
  283. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
  284. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
  285. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
  286. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
  287. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
  288. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
  289. package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
  290. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  291. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
  292. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  293. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -1
  294. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +1 -1
  295. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
  296. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  297. package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
  298. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  299. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +1 -1
  300. package/lib/typescript/shared/components/overlay/index.d.ts +0 -2
  301. package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -1
  302. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  303. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  304. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
  305. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
  306. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  307. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  308. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +9 -0
  309. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -0
  310. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
  311. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
  312. package/lib/typescript/shared/constants.d.ts +3 -0
  313. package/lib/typescript/shared/constants.d.ts.map +1 -1
  314. package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts +10 -0
  315. package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts.map +1 -0
  316. package/lib/typescript/shared/hooks/gestures/types.d.ts +4 -0
  317. package/lib/typescript/shared/hooks/gestures/types.d.ts.map +1 -0
  318. package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts +4 -2
  319. package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts.map +1 -1
  320. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -2
  321. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  322. package/lib/typescript/shared/index.d.ts +16 -18
  323. package/lib/typescript/shared/index.d.ts.map +1 -1
  324. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
  325. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  326. package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
  327. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +18 -0
  328. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -0
  329. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
  330. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -1
  331. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +6 -3
  332. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  333. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +0 -2
  334. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  335. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  336. package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +11 -0
  337. package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -0
  338. package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
  339. package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
  340. package/lib/typescript/shared/providers/screen/animation/types.d.ts +4 -0
  341. package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -0
  342. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +5 -1
  343. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
  344. package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
  345. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
  346. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  347. package/lib/typescript/shared/stores/animation.store.d.ts +8 -2
  348. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  349. package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
  350. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  351. package/lib/typescript/shared/stores/bounds/types.d.ts +2 -0
  352. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  353. package/lib/typescript/shared/types/animation.types.d.ts +33 -51
  354. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  355. package/lib/typescript/shared/types/bounds.types.d.ts +46 -9
  356. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  357. package/lib/typescript/shared/types/index.d.ts +3 -3
  358. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  359. package/lib/typescript/shared/types/overlay.types.d.ts +1 -22
  360. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
  361. package/lib/typescript/shared/types/screen.types.d.ts +62 -37
  362. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  363. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  364. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +2 -2
  365. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +1 -1
  366. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  367. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +3 -2
  368. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
  369. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts +3 -2
  370. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +1 -1
  371. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts +3 -2
  372. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +1 -1
  373. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +2 -1
  374. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
  375. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +4 -3
  376. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  377. package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
  378. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  379. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
  380. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
  381. package/lib/typescript/shared/utils/bounds/types/options.d.ts +5 -4
  382. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  383. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +17 -0
  384. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -0
  385. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +4 -0
  386. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -0
  387. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +43 -0
  388. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -0
  389. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +3 -0
  390. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +1 -0
  391. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +17 -0
  392. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -0
  393. package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts +5 -3
  394. package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts.map +1 -1
  395. package/lib/typescript/shared/utils/overlay/visibility.d.ts +1 -4
  396. package/lib/typescript/shared/utils/overlay/visibility.d.ts.map +1 -1
  397. package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
  398. package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
  399. package/package.json +3 -2
  400. package/src/blank-stack/index.ts +1 -0
  401. package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
  402. package/src/blank-stack/types.ts +33 -5
  403. package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
  404. package/src/shared/animation/snap-to.ts +12 -1
  405. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
  406. package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
  407. package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
  408. package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
  409. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
  410. package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
  411. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
  412. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
  413. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
  414. package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
  415. package/src/shared/components/create-boundary-component/index.tsx +25 -6
  416. package/src/shared/components/create-boundary-component/types.ts +8 -4
  417. package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
  418. package/src/shared/components/create-transition-aware-component.tsx +5 -2
  419. package/src/shared/components/native-screen-container.tsx +11 -3
  420. package/src/shared/components/native-screen.tsx +65 -20
  421. package/src/shared/components/overlay/helpers/get-active-overlay.ts +3 -3
  422. package/src/shared/components/overlay/index.ts +0 -2
  423. package/src/shared/components/overlay/variations/overlay-host.tsx +2 -16
  424. package/src/shared/components/scene-view.tsx +0 -3
  425. package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
  426. package/src/shared/components/screen-container/layers/backdrop.tsx +25 -6
  427. package/src/shared/components/screen-container/layers/content.tsx +23 -82
  428. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +101 -0
  429. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +1 -2
  430. package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +20 -6
  431. package/src/shared/constants.ts +6 -2
  432. package/src/shared/hooks/gestures/resolve-screen-gesture-target.ts +66 -0
  433. package/src/shared/hooks/gestures/types.ts +5 -0
  434. package/src/shared/hooks/gestures/use-screen-gesture.ts +10 -3
  435. package/src/shared/hooks/navigation/use-stack.tsx +1 -2
  436. package/src/shared/index.ts +14 -16
  437. package/src/shared/providers/gestures/handlers/use-handlers.ts +75 -29
  438. package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
  439. package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
  440. package/src/shared/providers/layout-anchor.provider.tsx +2 -5
  441. package/src/shared/providers/register-bounds.provider.tsx +1 -1
  442. package/src/shared/providers/screen/animation/animation.provider.tsx +46 -10
  443. package/src/shared/providers/screen/animation/helpers/derivations.ts +0 -8
  444. package/src/shared/providers/screen/animation/helpers/pipeline.ts +51 -14
  445. package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +44 -0
  446. package/src/shared/providers/screen/animation/index.tsx +4 -1
  447. package/src/shared/providers/screen/animation/types.ts +5 -0
  448. package/src/shared/providers/screen/animation/use-screen-animation.tsx +16 -3
  449. package/src/shared/providers/stack/core.provider.tsx +27 -14
  450. package/src/shared/providers/stack/direct.provider.tsx +2 -5
  451. package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
  452. package/src/shared/stores/animation.store.ts +21 -5
  453. package/src/shared/stores/bounds/internals/presence.ts +3 -1
  454. package/src/shared/stores/bounds/internals/resolver.ts +13 -1
  455. package/src/shared/stores/bounds/types.ts +2 -0
  456. package/src/shared/types/animation.types.ts +32 -58
  457. package/src/shared/types/bounds.types.ts +30 -10
  458. package/src/shared/types/index.ts +2 -15
  459. package/src/shared/types/overlay.types.ts +1 -28
  460. package/src/shared/types/screen.types.ts +67 -38
  461. package/src/shared/utils/animation/animate-to-progress.ts +7 -0
  462. package/src/shared/utils/bounds/helpers/build-bounds-options.ts +2 -2
  463. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +47 -8
  464. package/src/shared/utils/bounds/helpers/geometry.ts +3 -2
  465. package/src/shared/utils/bounds/helpers/interpolators.ts +8 -6
  466. package/src/shared/utils/bounds/helpers/link-accessor.ts +10 -6
  467. package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +7 -10
  468. package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
  469. package/src/shared/utils/bounds/index.ts +22 -13
  470. package/src/shared/utils/bounds/types/frame-props.ts +5 -0
  471. package/src/shared/utils/bounds/types/options.ts +6 -4
  472. package/src/shared/utils/bounds/zoom/accessor.ts +69 -0
  473. package/src/shared/utils/bounds/zoom/build.ts +715 -0
  474. package/src/shared/utils/bounds/zoom/config.ts +179 -0
  475. package/src/shared/utils/bounds/zoom/index.ts +2 -0
  476. package/src/shared/utils/bounds/zoom/types.ts +22 -0
  477. package/src/shared/utils/gesture/validate-snap-points.ts +20 -8
  478. package/src/shared/utils/overlay/visibility.ts +1 -16
  479. package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
  480. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +0 -64
  481. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +0 -1
  482. package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
  483. package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
  484. package/lib/commonjs/shared/utils/bounds/helpers/math.js +0 -132
  485. package/lib/commonjs/shared/utils/bounds/helpers/math.js.map +0 -1
  486. package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js +0 -45
  487. package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
  488. package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js +0 -60
  489. package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
  490. package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js +0 -20
  491. package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
  492. package/lib/commonjs/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
  493. package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js +0 -295
  494. package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
  495. package/lib/module/shared/components/overlay/variations/screen-overlay.js +0 -61
  496. package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +0 -1
  497. package/lib/module/shared/providers/viewport.provider.js +0 -27
  498. package/lib/module/shared/providers/viewport.provider.js.map +0 -1
  499. package/lib/module/shared/utils/bounds/helpers/math.js +0 -115
  500. package/lib/module/shared/utils/bounds/helpers/math.js.map +0 -1
  501. package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js +0 -40
  502. package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
  503. package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js +0 -54
  504. package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
  505. package/lib/module/shared/utils/bounds/sugar/navigation/index.js +0 -15
  506. package/lib/module/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
  507. package/lib/module/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
  508. package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js +0 -290
  509. package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
  510. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +0 -10
  511. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +0 -1
  512. package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
  513. package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
  514. package/lib/typescript/shared/utils/bounds/helpers/math.d.ts +0 -38
  515. package/lib/typescript/shared/utils/bounds/helpers/math.d.ts.map +0 -1
  516. package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts +0 -16
  517. package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts.map +0 -1
  518. package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts +0 -17
  519. package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts.map +0 -1
  520. package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts +0 -3
  521. package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts.map +0 -1
  522. package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts +0 -18
  523. package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts.map +0 -1
  524. package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts +0 -4
  525. package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts.map +0 -1
  526. package/src/shared/components/overlay/variations/screen-overlay.tsx +0 -68
  527. package/src/shared/providers/viewport.provider.tsx +0 -39
  528. package/src/shared/utils/bounds/helpers/math.ts +0 -161
  529. package/src/shared/utils/bounds/helpers/navigation-accessor.ts +0 -61
  530. package/src/shared/utils/bounds/sugar/navigation/helpers.ts +0 -74
  531. package/src/shared/utils/bounds/sugar/navigation/index.ts +0 -14
  532. package/src/shared/utils/bounds/sugar/navigation/types.ts +0 -26
  533. package/src/shared/utils/bounds/sugar/navigation/zoom.ts +0 -348
  534. /package/lib/commonjs/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
  535. /package/lib/module/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
@@ -3,13 +3,11 @@ import {
3
3
  NavigationRouteContext,
4
4
  } from "@react-navigation/native";
5
5
  import { memo, useMemo } from "react";
6
- import { Animated, StyleSheet, useWindowDimensions, View } from "react-native";
6
+ import { Animated, StyleSheet, View } from "react-native";
7
7
  import { useDerivedValue } from "react-native-reanimated";
8
- import { useSafeAreaInsets } from "react-native-safe-area-context";
9
8
  import type { StackScene } from "../../../hooks/navigation/use-stack";
10
9
  import { useScreenAnimation } from "../../../providers/screen/animation";
11
10
  import type { BaseDescriptor } from "../../../providers/screen/descriptors";
12
- import type { OverlayInterpolationProps } from "../../../types/animation.types";
13
11
  import type {
14
12
  OverlayProps,
15
13
  OverlayScreenState,
@@ -25,8 +23,6 @@ export const OverlayHost = memo(function OverlayHost({
25
23
  overlayScreenState,
26
24
  }: OverlayHostProps) {
27
25
  const OverlayComponent = scene.descriptor.options.overlay;
28
- const screen = useWindowDimensions();
29
- const insets = useSafeAreaInsets();
30
26
 
31
27
  const screenAnimation = useScreenAnimation();
32
28
  const relativeProgress = useDerivedValue(() => {
@@ -34,22 +30,12 @@ export const OverlayHost = memo(function OverlayHost({
34
30
  return screenAnimation.value.stackProgress;
35
31
  });
36
32
 
37
- const overlayAnimation = useDerivedValue<OverlayInterpolationProps>(() => ({
38
- progress: relativeProgress.value,
39
- layouts: { screen },
40
- insets,
41
- }));
42
-
43
33
  const overlayProps: OverlayProps<BaseDescriptor["navigation"]> = useMemo(
44
34
  () => ({
45
35
  ...overlayScreenState,
46
36
  progress: relativeProgress,
47
- /**@deprecated */
48
- overlayAnimation,
49
- /**@deprecated */
50
- screenAnimation,
51
37
  }),
52
- [relativeProgress, overlayAnimation, screenAnimation, overlayScreenState],
38
+ [relativeProgress, overlayScreenState],
53
39
  );
54
40
 
55
41
  if (!OverlayComponent) {
@@ -4,8 +4,6 @@ import {
4
4
  } from "@react-navigation/native";
5
5
  import * as React from "react";
6
6
  import type { BaseStackDescriptor } from "../types/stack.types";
7
- import { isScreenOverlayVisible } from "../utils/overlay/visibility";
8
- import { Overlay } from "./overlay";
9
7
 
10
8
  type SceneViewProps = {
11
9
  descriptor: BaseStackDescriptor;
@@ -24,7 +22,6 @@ export const SceneView = React.memo(function SceneView({
24
22
  return (
25
23
  <NavigationContext.Provider value={navigation as any}>
26
24
  <NavigationRouteContext.Provider value={route}>
27
- {isScreenOverlayVisible(descriptor.options) && <Overlay.Screen />}
28
25
  {render?.()}
29
26
  </NavigationRouteContext.Provider>
30
27
  </NavigationContext.Provider>
@@ -0,0 +1,82 @@
1
+ import { useCallback } from "react";
2
+ import { type LayoutChangeEvent, useWindowDimensions } from "react-native";
3
+ import { runOnUI } from "react-native-reanimated";
4
+ import {
5
+ useDescriptorDerivations,
6
+ useDescriptors,
7
+ } from "../../../providers/screen/descriptors";
8
+ import { AnimationStore } from "../../../stores/animation.store";
9
+ import { animateToProgress } from "../../../utils/animation/animate-to-progress";
10
+
11
+ export function useContentLayout() {
12
+ const { current } = useDescriptors();
13
+ const { isFirstKey } = useDescriptorDerivations();
14
+ const { height: screenHeight } = useWindowDimensions();
15
+ const routeKey = current.route.key;
16
+ const animations = AnimationStore.getRouteAnimations(routeKey);
17
+ const autoSnapPointValue = AnimationStore.getAnimation(
18
+ routeKey,
19
+ "autoSnapPoint",
20
+ );
21
+ const contentLayoutValue = AnimationStore.getAnimation(
22
+ routeKey,
23
+ "contentLayout",
24
+ );
25
+
26
+ return useCallback(
27
+ (event: LayoutChangeEvent) => {
28
+ const { width, height } = event.nativeEvent.layout;
29
+ if (width <= 0 || height <= 0) return;
30
+
31
+ const fraction = Math.min(height / screenHeight, 1);
32
+ const transitionSpec = current.options.transitionSpec;
33
+
34
+ runOnUI(
35
+ (
36
+ nextWidth: number,
37
+ nextHeight: number,
38
+ nextFraction: number,
39
+ isInitialScreen: boolean,
40
+ spec: typeof transitionSpec,
41
+ ) => {
42
+ "worklet";
43
+ contentLayoutValue.value = {
44
+ width: nextWidth,
45
+ height: nextHeight,
46
+ };
47
+
48
+ const isFirstMeasurement = autoSnapPointValue.value <= 0;
49
+ autoSnapPointValue.value = nextFraction;
50
+
51
+ if (
52
+ !isFirstMeasurement ||
53
+ animations.progress.value !== 0 ||
54
+ animations.animating.value !== 0
55
+ ) {
56
+ return;
57
+ }
58
+
59
+ if (isInitialScreen) {
60
+ animations.targetProgress.value = nextFraction;
61
+ animations.progress.value = nextFraction;
62
+ return;
63
+ }
64
+
65
+ animateToProgress({
66
+ target: nextFraction,
67
+ spec,
68
+ animations,
69
+ });
70
+ },
71
+ )(width, height, fraction, isFirstKey, transitionSpec);
72
+ },
73
+ [
74
+ animations,
75
+ autoSnapPointValue,
76
+ contentLayoutValue,
77
+ current.options.transitionSpec,
78
+ isFirstKey,
79
+ screenHeight,
80
+ ],
81
+ );
82
+ }
@@ -23,6 +23,12 @@ export const BackdropLayer = memo(function BackdropLayer() {
23
23
  const { isBackdropActive, backdropBehavior } = useBackdropPointerEvents();
24
24
 
25
25
  const BackdropComponent = current.options.backdropComponent;
26
+ const routeKey = current.route.key;
27
+ const animations = AnimationStore.getRouteAnimations(routeKey);
28
+ const autoSnapPointValue = AnimationStore.getAnimation(
29
+ routeKey,
30
+ "autoSnapPoint",
31
+ );
26
32
 
27
33
  const AnimatedBackdropComponent = useMemo(
28
34
  () =>
@@ -38,24 +44,27 @@ export const BackdropLayer = memo(function BackdropLayer() {
38
44
  }
39
45
 
40
46
  if (backdropBehavior === "collapse") {
41
- const snapPoints = current.options.snapPoints;
47
+ const rawSnapPoints = current.options.snapPoints;
42
48
  const canDismiss = current.options.gestureEnabled !== false;
43
49
 
44
50
  // No snap points → fallback to dismiss
45
- if (!snapPoints || snapPoints.length === 0) {
51
+ if (!rawSnapPoints || rawSnapPoints.length === 0) {
46
52
  dismissScreen();
47
53
  return;
48
54
  }
49
55
 
50
- const animations = AnimationStore.getRouteAnimations(current.route.key);
51
- const gestures = GestureStore.getRouteGestures(current.route.key);
56
+ const gestures = GestureStore.getRouteGestures(routeKey);
52
57
  const transitionSpec = current.options.transitionSpec;
53
58
 
54
59
  runOnUI(() => {
55
60
  "worklet";
61
+ const resolvedSnaps = rawSnapPoints
62
+ .map((point) => (point === "auto" ? autoSnapPointValue.value : point))
63
+ .filter((point): point is number => typeof point === "number");
64
+
56
65
  const { target, shouldDismiss } = findCollapseTarget(
57
66
  animations.progress.value,
58
- snapPoints,
67
+ resolvedSnaps,
59
68
  canDismiss,
60
69
  );
61
70
 
@@ -79,7 +88,14 @@ export const BackdropLayer = memo(function BackdropLayer() {
79
88
  });
80
89
  })();
81
90
  }
82
- }, [backdropBehavior, current, dismissScreen]);
91
+ }, [
92
+ animations,
93
+ autoSnapPointValue,
94
+ backdropBehavior,
95
+ current,
96
+ dismissScreen,
97
+ routeKey,
98
+ ]);
83
99
 
84
100
  const animatedBackdropStyle = useAnimatedStyle(() => {
85
101
  "worklet";
@@ -97,6 +113,9 @@ export const BackdropLayer = memo(function BackdropLayer() {
97
113
  pointerEvents={isBackdropActive ? "auto" : "none"}
98
114
  onPress={isBackdropActive ? handleBackdropPress : undefined}
99
115
  >
116
+ {/* Keep blur props and visual style separated.
117
+ * BlurView's animatable ref points at the inner native blur view, and mixing
118
+ * animated style with animatedProps can break intensity updates. */}
100
119
  {AnimatedBackdropComponent && (
101
120
  <AnimatedBackdropComponent
102
121
  style={[StyleSheet.absoluteFillObject]}
@@ -1,47 +1,36 @@
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";
2
+ import { memo } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { GestureDetector } from "react-native-gesture-handler";
5
5
  import Animated, {
6
6
  useAnimatedProps,
7
7
  useAnimatedStyle,
8
8
  } 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";
9
+ import { NO_PROPS, NO_STYLES } from "../../../constants";
15
10
  import { useGestureContext } from "../../../providers/gestures";
16
11
  import { useDescriptors } from "../../../providers/screen/descriptors";
17
12
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
18
- import { logger } from "../../../utils/logger";
13
+ import { resolveNavigationMaskEnabled } from "../../../utils/resolve-screen-transition-options";
19
14
  import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
15
+ import { useContentLayout } from "../hooks/use-content-layout";
16
+ import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
20
17
  import { SurfaceContainer } from "./surface-container";
21
18
 
22
19
  type Props = {
23
20
  children: React.ReactNode;
24
21
  };
25
22
 
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
23
  export const ContentLayer = memo(({ children }: Props) => {
37
24
  const { stylesMap } = useScreenStyles();
38
25
  const { current } = useDescriptors();
39
26
  const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
40
27
  const gestureContext = useGestureContext();
41
- const isNavigationMaskEnabled = !!current.options.maskEnabled;
28
+ const isNavigationMaskEnabled = resolveNavigationMaskEnabled(current.options);
42
29
  const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
30
+ const hasAutoSnapPoint =
31
+ current.options.snapPoints?.includes("auto") ?? false;
32
+ const handleContentLayout = useContentLayout();
43
33
 
44
- // ── Content ──
45
34
  const animatedContentStyle = useAnimatedStyle(() => {
46
35
  "worklet";
47
36
  return stylesMap.value.content?.style || NO_STYLES;
@@ -52,56 +41,6 @@ export const ContentLayer = memo(({ children }: Props) => {
52
41
  return stylesMap.value.content?.props ?? NO_PROPS;
53
42
  });
54
43
 
55
- // ── Navigation mask / container ──
56
- const animatedNavigationContainerStyle = useAnimatedStyle(() => {
57
- "worklet";
58
- return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
59
- });
60
-
61
- const animatedNavigationMaskStyle = useAnimatedStyle(() => {
62
- "worklet";
63
- return stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
64
- });
65
-
66
- useEffect(() => {
67
- if (!isNavigationMaskEnabled) return;
68
- if (LazyMaskedView !== View) return;
69
- if (hasWarnedMissingMaskedView) return;
70
-
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]);
76
-
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
103
- );
104
-
105
44
  return (
106
45
  <GestureDetector gesture={gestureContext!.panGesture}>
107
46
  <Animated.View
@@ -109,9 +48,20 @@ export const ContentLayer = memo(({ children }: Props) => {
109
48
  animatedProps={animatedContentProps}
110
49
  pointerEvents={contentPointerEvents}
111
50
  >
112
- <SurfaceContainer pointerEvents={contentPointerEvents}>
113
- {contentChildren}
114
- </SurfaceContainer>
51
+ <MaybeMaskedNavigationContainer
52
+ pointerEvents={contentPointerEvents}
53
+ enabled={isNavigationMaskEnabled}
54
+ >
55
+ <SurfaceContainer pointerEvents={contentPointerEvents}>
56
+ {hasAutoSnapPoint ? (
57
+ <View collapsable={false} onLayout={handleContentLayout}>
58
+ {children}
59
+ </View>
60
+ ) : (
61
+ children
62
+ )}
63
+ </SurfaceContainer>
64
+ </MaybeMaskedNavigationContainer>
115
65
  </Animated.View>
116
66
  </GestureDetector>
117
67
  );
@@ -121,13 +71,4 @@ const styles = StyleSheet.create({
121
71
  content: {
122
72
  flex: 1,
123
73
  },
124
- navigationMaskedRoot: {
125
- flex: 1,
126
- },
127
- navigationMaskElement: {
128
- backgroundColor: "white",
129
- },
130
- navigationContainer: {
131
- flex: 1,
132
- },
133
74
  });
@@ -0,0 +1,101 @@
1
+ import { memo, useEffect } from "react";
2
+ import { Platform, StyleSheet, View, type ViewProps } 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
+ pointerEvents: ViewProps["pointerEvents"];
16
+ };
17
+
18
+ let LazyMaskedView = View;
19
+
20
+ try {
21
+ LazyMaskedView = require("@react-native-masked-view/masked-view").default;
22
+ } catch (_) {
23
+ // optional peer dependency
24
+ }
25
+
26
+ let hasWarnedMissingMaskedView = false;
27
+ const IS_ANDROID = Platform.OS === "android";
28
+
29
+ export const MaybeMaskedNavigationContainer = memo(
30
+ ({ enabled, children, pointerEvents }: Props) => {
31
+ const { stylesMap } = useScreenStyles();
32
+ const animatedNavigationContainerStyle = useAnimatedStyle(() => {
33
+ "worklet";
34
+ return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
35
+ });
36
+
37
+ const animatedNavigationMaskStyle = useAnimatedStyle(() => {
38
+ "worklet";
39
+ return stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
40
+ });
41
+
42
+ useEffect(() => {
43
+ if (!enabled) return;
44
+ if (LazyMaskedView !== View) return;
45
+ if (hasWarnedMissingMaskedView) return;
46
+
47
+ hasWarnedMissingMaskedView = true;
48
+ logger.warn(
49
+ "navigationMaskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
50
+ );
51
+ }, [enabled]);
52
+
53
+ const navigationContainer = (
54
+ <Animated.View
55
+ style={[styles.navigationContainer, animatedNavigationContainerStyle]}
56
+ pointerEvents={pointerEvents}
57
+ collapsable={false}
58
+ renderToHardwareTextureAndroid={IS_ANDROID && !enabled}
59
+ needsOffscreenAlphaCompositing={IS_ANDROID && !enabled}
60
+ >
61
+ {children}
62
+ </Animated.View>
63
+ );
64
+
65
+ // Navigation zoom uses the root container transform even when the mask
66
+ // wrapper is disabled. Only the mask element itself is optional.
67
+ if (!enabled) return navigationContainer;
68
+
69
+ if (LazyMaskedView === View) {
70
+ return navigationContainer;
71
+ }
72
+
73
+ return (
74
+ <LazyMaskedView
75
+ style={styles.navigationMaskedRoot}
76
+ // @ts-expect-error masked-view package types are too strict here
77
+ maskElement={
78
+ <Animated.View
79
+ style={[styles.navigationMaskElement, animatedNavigationMaskStyle]}
80
+ pointerEvents="none"
81
+ />
82
+ }
83
+ pointerEvents={pointerEvents}
84
+ >
85
+ {navigationContainer}
86
+ </LazyMaskedView>
87
+ );
88
+ },
89
+ );
90
+
91
+ const styles = StyleSheet.create({
92
+ navigationMaskedRoot: {
93
+ flex: 1,
94
+ },
95
+ navigationMaskElement: {
96
+ backgroundColor: "white",
97
+ },
98
+ navigationContainer: {
99
+ flex: 1,
100
+ },
101
+ });
@@ -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;